Skip to content

Commit

Permalink
Merge pull request #19 from AssemblyAI/fern-bot/03-09-2024-0336AM
Browse files Browse the repository at this point in the history
🌿 Fern Regeneration -- March 9, 2024
  • Loading branch information
Swimburger committed Mar 9, 2024
2 parents 3b8c773 + 0b93b65 commit 6eab2c4
Show file tree
Hide file tree
Showing 6 changed files with 72 additions and 4 deletions.
3 changes: 2 additions & 1 deletion .fernignore
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
# Specify files that shouldn't be modified by Fern

README.md
.gitignore
test/

<!-- Allow for the polling client -->
lib/assemblyai.rb
lib/assemblyai/transcripts/polling_client.rb
lib/assemblyai/transcripts/listing_client.rb
lib/assemblyai/transcripts/list_by_url_client.rb
lib/assemblyai/transcripts/types/polling_options.rb

2 changes: 1 addition & 1 deletion assemblyai.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ require_relative "lib/gemconfig"

Gem::Specification.new do |spec|
spec.name = "assemblyai"
spec.version = "1.0.0-beta.2"
spec.version = "1.0.0-beta.3"
spec.authors = AssemblyAI::Gemconfig::AUTHORS
spec.email = AssemblyAI::Gemconfig::EMAIL
spec.summary = AssemblyAI::Gemconfig::SUMMARY
Expand Down
54 changes: 54 additions & 0 deletions lib/assemblyai/transcripts/types/transcript_ready_notification.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# frozen_string_literal: true

require_relative "transcript_ready_status"
require "json"

module AssemblyAI
class Transcripts
# The notification when the transcript status is completed or error.
class TranscriptReadyNotification
attr_reader :transcript_id, :status, :additional_properties

# @param transcript_id [String] The ID of the transcript
# @param status [Transcripts::TranscriptReadyStatus] The status of the transcript. Either completed or error.
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
# @return [Transcripts::TranscriptReadyNotification]
def initialize(transcript_id:, status:, additional_properties: nil)
# @type [String] The ID of the transcript
@transcript_id = transcript_id
# @type [Transcripts::TranscriptReadyStatus] The status of the transcript. Either completed or error.
@status = status
# @type [OpenStruct] Additional properties unmapped to the current class definition
@additional_properties = additional_properties
end

# Deserialize a JSON object to an instance of TranscriptReadyNotification
#
# @param json_object [JSON]
# @return [Transcripts::TranscriptReadyNotification]
def self.from_json(json_object:)
struct = JSON.parse(json_object, object_class: OpenStruct)
JSON.parse(json_object)
transcript_id = struct.transcript_id
status = struct.status
new(transcript_id: transcript_id, status: status, additional_properties: struct)
end

# Serialize an instance of TranscriptReadyNotification to a JSON object
#
# @return [JSON]
def to_json(*_args)
{ "transcript_id": @transcript_id, "status": @status }.to_json
end

# Leveraged for Union-type generation, validate_raw attempts to parse the given hash and check each fields type against the current object's property definitions.
#
# @param obj [Object]
# @return [Void]
def self.validate_raw(obj:)
obj.transcript_id.is_a?(String) != false || raise("Passed value for field obj.transcript_id is not the expected type, validation failed.")
obj.status.is_a?(Transcripts::TranscriptReadyStatus) != false || raise("Passed value for field obj.status is not the expected type, validation failed.")
end
end
end
end
11 changes: 11 additions & 0 deletions lib/assemblyai/transcripts/types/transcript_ready_status.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# frozen_string_literal: true

module AssemblyAI
class Transcripts
# The status of the transcript. Either completed or error.
class TranscriptReadyStatus
COMPLETED = "completed"
ERROR = "error"
end
end
end
4 changes: 2 additions & 2 deletions lib/requests.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def initialize(api_key:, environment: Environment::DEFAULT, max_retries: nil, ti
@headers = {
"X-Fern-Language": "Ruby",
"X-Fern-SDK-Name": "AssemblyAI",
"X-Fern-SDK-Version": "1.0.0-beta.2",
"X-Fern-SDK-Version": "1.0.0-beta.3",
"Authorization": api_key.to_s
}
@conn = Faraday.new(@base_url, headers: @headers) do |faraday|
Expand All @@ -46,7 +46,7 @@ def initialize(api_key:, environment: Environment::DEFAULT, max_retries: nil, ti
@headers = {
"X-Fern-Language": "Ruby",
"X-Fern-SDK-Name": "AssemblyAI",
"X-Fern-SDK-Version": "1.0.0-beta.2",
"X-Fern-SDK-Version": "1.0.0-beta.3",
"Authorization": api_key.to_s
}
@conn = Faraday.new(@base_url, headers: @headers) do |faraday|
Expand Down
2 changes: 2 additions & 0 deletions lib/types_export.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# frozen_string_literal: true

require_relative "assemblyai/files/types/uploaded_file"
require_relative "assemblyai/transcripts/types/transcript_ready_notification"
require_relative "assemblyai/transcripts/types/redacted_audio_response"
require_relative "assemblyai/transcripts/types/redacted_audio_status"
require_relative "assemblyai/transcripts/types/subtitle_format"
Expand All @@ -20,6 +21,7 @@
require_relative "assemblyai/transcripts/types/speech_model"
require_relative "assemblyai/transcripts/types/transcript_language_code"
require_relative "assemblyai/transcripts/types/transcript_status"
require_relative "assemblyai/transcripts/types/transcript_ready_status"
require_relative "assemblyai/transcripts/types/transcript"
require_relative "assemblyai/transcripts/types/topic_detection_model_result"
require_relative "assemblyai/transcripts/types/content_safety_labels_result"
Expand Down

0 comments on commit 6eab2c4

Please sign in to comment.