Skip to content
This repository was archived by the owner on Apr 1, 2025. It is now read-only.

Commit 6eab2c4

Browse files
authored
Merge pull request #19 from AssemblyAI/fern-bot/03-09-2024-0336AM
🌿 Fern Regeneration -- March 9, 2024
2 parents 3b8c773 + 0b93b65 commit 6eab2c4

File tree

6 files changed

+72
-4
lines changed

6 files changed

+72
-4
lines changed

.fernignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
# Specify files that shouldn't be modified by Fern
22

33
README.md
4+
.gitignore
45
test/
56

67
<!-- Allow for the polling client -->
78
lib/assemblyai.rb
89
lib/assemblyai/transcripts/polling_client.rb
9-
lib/assemblyai/transcripts/listing_client.rb
10+
lib/assemblyai/transcripts/list_by_url_client.rb
1011
lib/assemblyai/transcripts/types/polling_options.rb
1112

assemblyai.gemspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ require_relative "lib/gemconfig"
44

55
Gem::Specification.new do |spec|
66
spec.name = "assemblyai"
7-
spec.version = "1.0.0-beta.2"
7+
spec.version = "1.0.0-beta.3"
88
spec.authors = AssemblyAI::Gemconfig::AUTHORS
99
spec.email = AssemblyAI::Gemconfig::EMAIL
1010
spec.summary = AssemblyAI::Gemconfig::SUMMARY
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# frozen_string_literal: true
2+
3+
require_relative "transcript_ready_status"
4+
require "json"
5+
6+
module AssemblyAI
7+
class Transcripts
8+
# The notification when the transcript status is completed or error.
9+
class TranscriptReadyNotification
10+
attr_reader :transcript_id, :status, :additional_properties
11+
12+
# @param transcript_id [String] The ID of the transcript
13+
# @param status [Transcripts::TranscriptReadyStatus] The status of the transcript. Either completed or error.
14+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
15+
# @return [Transcripts::TranscriptReadyNotification]
16+
def initialize(transcript_id:, status:, additional_properties: nil)
17+
# @type [String] The ID of the transcript
18+
@transcript_id = transcript_id
19+
# @type [Transcripts::TranscriptReadyStatus] The status of the transcript. Either completed or error.
20+
@status = status
21+
# @type [OpenStruct] Additional properties unmapped to the current class definition
22+
@additional_properties = additional_properties
23+
end
24+
25+
# Deserialize a JSON object to an instance of TranscriptReadyNotification
26+
#
27+
# @param json_object [JSON]
28+
# @return [Transcripts::TranscriptReadyNotification]
29+
def self.from_json(json_object:)
30+
struct = JSON.parse(json_object, object_class: OpenStruct)
31+
JSON.parse(json_object)
32+
transcript_id = struct.transcript_id
33+
status = struct.status
34+
new(transcript_id: transcript_id, status: status, additional_properties: struct)
35+
end
36+
37+
# Serialize an instance of TranscriptReadyNotification to a JSON object
38+
#
39+
# @return [JSON]
40+
def to_json(*_args)
41+
{ "transcript_id": @transcript_id, "status": @status }.to_json
42+
end
43+
44+
# 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.
45+
#
46+
# @param obj [Object]
47+
# @return [Void]
48+
def self.validate_raw(obj:)
49+
obj.transcript_id.is_a?(String) != false || raise("Passed value for field obj.transcript_id is not the expected type, validation failed.")
50+
obj.status.is_a?(Transcripts::TranscriptReadyStatus) != false || raise("Passed value for field obj.status is not the expected type, validation failed.")
51+
end
52+
end
53+
end
54+
end
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# frozen_string_literal: true
2+
3+
module AssemblyAI
4+
class Transcripts
5+
# The status of the transcript. Either completed or error.
6+
class TranscriptReadyStatus
7+
COMPLETED = "completed"
8+
ERROR = "error"
9+
end
10+
end
11+
end

lib/requests.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ def initialize(api_key:, environment: Environment::DEFAULT, max_retries: nil, ti
2020
@headers = {
2121
"X-Fern-Language": "Ruby",
2222
"X-Fern-SDK-Name": "AssemblyAI",
23-
"X-Fern-SDK-Version": "1.0.0-beta.2",
23+
"X-Fern-SDK-Version": "1.0.0-beta.3",
2424
"Authorization": api_key.to_s
2525
}
2626
@conn = Faraday.new(@base_url, headers: @headers) do |faraday|
@@ -46,7 +46,7 @@ def initialize(api_key:, environment: Environment::DEFAULT, max_retries: nil, ti
4646
@headers = {
4747
"X-Fern-Language": "Ruby",
4848
"X-Fern-SDK-Name": "AssemblyAI",
49-
"X-Fern-SDK-Version": "1.0.0-beta.2",
49+
"X-Fern-SDK-Version": "1.0.0-beta.3",
5050
"Authorization": api_key.to_s
5151
}
5252
@conn = Faraday.new(@base_url, headers: @headers) do |faraday|

lib/types_export.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# frozen_string_literal: true
22

33
require_relative "assemblyai/files/types/uploaded_file"
4+
require_relative "assemblyai/transcripts/types/transcript_ready_notification"
45
require_relative "assemblyai/transcripts/types/redacted_audio_response"
56
require_relative "assemblyai/transcripts/types/redacted_audio_status"
67
require_relative "assemblyai/transcripts/types/subtitle_format"
@@ -20,6 +21,7 @@
2021
require_relative "assemblyai/transcripts/types/speech_model"
2122
require_relative "assemblyai/transcripts/types/transcript_language_code"
2223
require_relative "assemblyai/transcripts/types/transcript_status"
24+
require_relative "assemblyai/transcripts/types/transcript_ready_status"
2325
require_relative "assemblyai/transcripts/types/transcript"
2426
require_relative "assemblyai/transcripts/types/topic_detection_model_result"
2527
require_relative "assemblyai/transcripts/types/content_safety_labels_result"

0 commit comments

Comments
 (0)