daily-ruby 0.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (59) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +9 -0
  3. data/Gemfile.lock +79 -0
  4. data/README.md +119 -0
  5. data/Rakefile +10 -0
  6. data/daily-ruby.gemspec +40 -0
  7. data/daily.yaml +422 -0
  8. data/docs/CreateMeetingToken200Response.md +18 -0
  9. data/docs/MeetingTokenRequest.md +18 -0
  10. data/docs/MeetingTokenRequestProperties.md +56 -0
  11. data/docs/MeetingTokenRequestPropertiesPermissions.md +22 -0
  12. data/docs/MeetingTokenRequestPropertiesPermissionsCanAdmin.md +49 -0
  13. data/docs/MeetingTokenRequestPropertiesPermissionsCanSend.md +49 -0
  14. data/docs/MeetingTokensApi.md +79 -0
  15. data/docs/RoomApi.md +227 -0
  16. data/docs/RoomDeletedResponse.md +20 -0
  17. data/docs/RoomNotFoundResponse.md +20 -0
  18. data/docs/RoomRequest.md +22 -0
  19. data/docs/RoomRequestProperties.md +76 -0
  20. data/docs/RoomResponse.md +28 -0
  21. data/docs/ServerErrorResponse.md +18 -0
  22. data/git_push.sh +57 -0
  23. data/lib/daily-ruby/api/meeting_tokens_api.rb +86 -0
  24. data/lib/daily-ruby/api/room_api.rb +218 -0
  25. data/lib/daily-ruby/api_client.rb +431 -0
  26. data/lib/daily-ruby/api_error.rb +58 -0
  27. data/lib/daily-ruby/configuration.rb +382 -0
  28. data/lib/daily-ruby/models/create_meeting_token200_response.rb +214 -0
  29. data/lib/daily-ruby/models/meeting_token_request.rb +215 -0
  30. data/lib/daily-ruby/models/meeting_token_request_properties.rb +438 -0
  31. data/lib/daily-ruby/models/meeting_token_request_properties_permissions.rb +232 -0
  32. data/lib/daily-ruby/models/meeting_token_request_properties_permissions_can_admin.rb +105 -0
  33. data/lib/daily-ruby/models/meeting_token_request_properties_permissions_can_send.rb +105 -0
  34. data/lib/daily-ruby/models/room_deleted_response.rb +224 -0
  35. data/lib/daily-ruby/models/room_not_found_response.rb +224 -0
  36. data/lib/daily-ruby/models/room_request.rb +267 -0
  37. data/lib/daily-ruby/models/room_request_properties.rb +521 -0
  38. data/lib/daily-ruby/models/room_response.rb +260 -0
  39. data/lib/daily-ruby/models/server_error_response.rb +215 -0
  40. data/lib/daily-ruby/version.rb +15 -0
  41. data/lib/daily-ruby.rb +53 -0
  42. data/run.sh +16 -0
  43. data/script.rb +35 -0
  44. data/spec/api/meeting_tokens_api_spec.rb +47 -0
  45. data/spec/api/room_api_spec.rb +74 -0
  46. data/spec/models/create_meeting_token200_response_spec.rb +36 -0
  47. data/spec/models/meeting_token_request_properties_permissions_can_admin_spec.rb +32 -0
  48. data/spec/models/meeting_token_request_properties_permissions_can_send_spec.rb +32 -0
  49. data/spec/models/meeting_token_request_properties_permissions_spec.rb +48 -0
  50. data/spec/models/meeting_token_request_properties_spec.rb +158 -0
  51. data/spec/models/meeting_token_request_spec.rb +36 -0
  52. data/spec/models/room_deleted_response_spec.rb +42 -0
  53. data/spec/models/room_not_found_response_spec.rb +42 -0
  54. data/spec/models/room_request_properties_spec.rb +218 -0
  55. data/spec/models/room_request_spec.rb +52 -0
  56. data/spec/models/room_response_spec.rb +66 -0
  57. data/spec/models/server_error_response_spec.rb +36 -0
  58. data/spec/spec_helper.rb +111 -0
  59. metadata +169 -0
@@ -0,0 +1,260 @@
1
+ =begin
2
+ #Daily
3
+
4
+ #The official library for communicating with the Daily REST API.
5
+
6
+ The version of the OpenAPI document: 0.0.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 7.3.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Daily
17
+ # A Room where a Daily call is hosted.
18
+ class RoomResponse
19
+ attr_accessor :id
20
+
21
+ attr_accessor :name
22
+
23
+ attr_accessor :api_created
24
+
25
+ attr_accessor :privacy
26
+
27
+ attr_accessor :url
28
+
29
+ attr_accessor :created_at
30
+
31
+ # Attribute mapping from ruby-style variable name to JSON key.
32
+ def self.attribute_map
33
+ {
34
+ :'id' => :'id',
35
+ :'name' => :'name',
36
+ :'api_created' => :'api_created',
37
+ :'privacy' => :'privacy',
38
+ :'url' => :'url',
39
+ :'created_at' => :'created_at'
40
+ }
41
+ end
42
+
43
+ # Returns all the JSON keys this model knows about
44
+ def self.acceptable_attributes
45
+ attribute_map.values
46
+ end
47
+
48
+ # Attribute type mapping.
49
+ def self.openapi_types
50
+ {
51
+ :'id' => :'String',
52
+ :'name' => :'String',
53
+ :'api_created' => :'Boolean',
54
+ :'privacy' => :'String',
55
+ :'url' => :'String',
56
+ :'created_at' => :'Time'
57
+ }
58
+ end
59
+
60
+ # List of attributes with nullable: true
61
+ def self.openapi_nullable
62
+ Set.new([
63
+ ])
64
+ end
65
+
66
+ # Initializes the object
67
+ # @param [Hash] attributes Model attributes in the form of hash
68
+ def initialize(attributes = {})
69
+ if (!attributes.is_a?(Hash))
70
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Daily::RoomResponse` initialize method"
71
+ end
72
+
73
+ # check to see if the attribute exists and convert string to symbol for hash key
74
+ attributes = attributes.each_with_object({}) { |(k, v), h|
75
+ if (!self.class.attribute_map.key?(k.to_sym))
76
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Daily::RoomResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
77
+ end
78
+ h[k.to_sym] = v
79
+ }
80
+
81
+ if attributes.key?(:'id')
82
+ self.id = attributes[:'id']
83
+ end
84
+
85
+ if attributes.key?(:'name')
86
+ self.name = attributes[:'name']
87
+ end
88
+
89
+ if attributes.key?(:'api_created')
90
+ self.api_created = attributes[:'api_created']
91
+ end
92
+
93
+ if attributes.key?(:'privacy')
94
+ self.privacy = attributes[:'privacy']
95
+ end
96
+
97
+ if attributes.key?(:'url')
98
+ self.url = attributes[:'url']
99
+ end
100
+
101
+ if attributes.key?(:'created_at')
102
+ self.created_at = attributes[:'created_at']
103
+ end
104
+ end
105
+
106
+ # Show invalid properties with the reasons. Usually used together with valid?
107
+ # @return Array for valid properties with the reasons
108
+ def list_invalid_properties
109
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
110
+ invalid_properties = Array.new
111
+ invalid_properties
112
+ end
113
+
114
+ # Check to see if the all the properties in the model are valid
115
+ # @return true if the model is valid
116
+ def valid?
117
+ warn '[DEPRECATED] the `valid?` method is obsolete'
118
+ true
119
+ end
120
+
121
+ # Checks equality by comparing each attribute.
122
+ # @param [Object] Object to be compared
123
+ def ==(o)
124
+ return true if self.equal?(o)
125
+ self.class == o.class &&
126
+ id == o.id &&
127
+ name == o.name &&
128
+ api_created == o.api_created &&
129
+ privacy == o.privacy &&
130
+ url == o.url &&
131
+ created_at == o.created_at
132
+ end
133
+
134
+ # @see the `==` method
135
+ # @param [Object] Object to be compared
136
+ def eql?(o)
137
+ self == o
138
+ end
139
+
140
+ # Calculates hash code according to all attributes.
141
+ # @return [Integer] Hash code
142
+ def hash
143
+ [id, name, api_created, privacy, url, created_at].hash
144
+ end
145
+
146
+ # Builds the object from hash
147
+ # @param [Hash] attributes Model attributes in the form of hash
148
+ # @return [Object] Returns the model itself
149
+ def self.build_from_hash(attributes)
150
+ return nil unless attributes.is_a?(Hash)
151
+ attributes = attributes.transform_keys(&:to_sym)
152
+ transformed_hash = {}
153
+ openapi_types.each_pair do |key, type|
154
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
155
+ transformed_hash["#{key}"] = nil
156
+ elsif type =~ /\AArray<(.*)>/i
157
+ # check to ensure the input is an array given that the attribute
158
+ # is documented as an array but the input is not
159
+ if attributes[attribute_map[key]].is_a?(Array)
160
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
161
+ end
162
+ elsif !attributes[attribute_map[key]].nil?
163
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
164
+ end
165
+ end
166
+ new(transformed_hash)
167
+ end
168
+
169
+ # Deserializes the data based on type
170
+ # @param string type Data type
171
+ # @param string value Value to be deserialized
172
+ # @return [Object] Deserialized data
173
+ def self._deserialize(type, value)
174
+ case type.to_sym
175
+ when :Time
176
+ Time.parse(value)
177
+ when :Date
178
+ Date.parse(value)
179
+ when :String
180
+ value.to_s
181
+ when :Integer
182
+ value.to_i
183
+ when :Float
184
+ value.to_f
185
+ when :Boolean
186
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
187
+ true
188
+ else
189
+ false
190
+ end
191
+ when :Object
192
+ # generic object (usually a Hash), return directly
193
+ value
194
+ when /\AArray<(?<inner_type>.+)>\z/
195
+ inner_type = Regexp.last_match[:inner_type]
196
+ value.map { |v| _deserialize(inner_type, v) }
197
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
198
+ k_type = Regexp.last_match[:k_type]
199
+ v_type = Regexp.last_match[:v_type]
200
+ {}.tap do |hash|
201
+ value.each do |k, v|
202
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
203
+ end
204
+ end
205
+ else # model
206
+ # models (e.g. Pet) or oneOf
207
+ klass = Daily.const_get(type)
208
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
209
+ end
210
+ end
211
+
212
+ # Returns the string representation of the object
213
+ # @return [String] String presentation of the object
214
+ def to_s
215
+ to_hash.to_s
216
+ end
217
+
218
+ # to_body is an alias to to_hash (backward compatibility)
219
+ # @return [Hash] Returns the object in the form of hash
220
+ def to_body
221
+ to_hash
222
+ end
223
+
224
+ # Returns the object in the form of hash
225
+ # @return [Hash] Returns the object in the form of hash
226
+ def to_hash
227
+ hash = {}
228
+ self.class.attribute_map.each_pair do |attr, param|
229
+ value = self.send(attr)
230
+ if value.nil?
231
+ is_nullable = self.class.openapi_nullable.include?(attr)
232
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
233
+ end
234
+
235
+ hash[param] = _to_hash(value)
236
+ end
237
+ hash
238
+ end
239
+
240
+ # Outputs non-array value in the form of hash
241
+ # For object, use to_hash. Otherwise, just return the value
242
+ # @param [Object] value Any valid value
243
+ # @return [Hash] Returns the value in the form of hash
244
+ def _to_hash(value)
245
+ if value.is_a?(Array)
246
+ value.compact.map { |v| _to_hash(v) }
247
+ elsif value.is_a?(Hash)
248
+ {}.tap do |hash|
249
+ value.each { |k, v| hash[k] = _to_hash(v) }
250
+ end
251
+ elsif value.respond_to? :to_hash
252
+ value.to_hash
253
+ else
254
+ value
255
+ end
256
+ end
257
+
258
+ end
259
+
260
+ end
@@ -0,0 +1,215 @@
1
+ =begin
2
+ #Daily
3
+
4
+ #The official library for communicating with the Daily REST API.
5
+
6
+ The version of the OpenAPI document: 0.0.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 7.3.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Daily
17
+ # Server error response
18
+ class ServerErrorResponse
19
+ attr_accessor :error
20
+
21
+ # Attribute mapping from ruby-style variable name to JSON key.
22
+ def self.attribute_map
23
+ {
24
+ :'error' => :'error'
25
+ }
26
+ end
27
+
28
+ # Returns all the JSON keys this model knows about
29
+ def self.acceptable_attributes
30
+ attribute_map.values
31
+ end
32
+
33
+ # Attribute type mapping.
34
+ def self.openapi_types
35
+ {
36
+ :'error' => :'String'
37
+ }
38
+ end
39
+
40
+ # List of attributes with nullable: true
41
+ def self.openapi_nullable
42
+ Set.new([
43
+ ])
44
+ end
45
+
46
+ # Initializes the object
47
+ # @param [Hash] attributes Model attributes in the form of hash
48
+ def initialize(attributes = {})
49
+ if (!attributes.is_a?(Hash))
50
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Daily::ServerErrorResponse` initialize method"
51
+ end
52
+
53
+ # check to see if the attribute exists and convert string to symbol for hash key
54
+ attributes = attributes.each_with_object({}) { |(k, v), h|
55
+ if (!self.class.attribute_map.key?(k.to_sym))
56
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Daily::ServerErrorResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
57
+ end
58
+ h[k.to_sym] = v
59
+ }
60
+
61
+ if attributes.key?(:'error')
62
+ self.error = attributes[:'error']
63
+ end
64
+ end
65
+
66
+ # Show invalid properties with the reasons. Usually used together with valid?
67
+ # @return Array for valid properties with the reasons
68
+ def list_invalid_properties
69
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
70
+ invalid_properties = Array.new
71
+ invalid_properties
72
+ end
73
+
74
+ # Check to see if the all the properties in the model are valid
75
+ # @return true if the model is valid
76
+ def valid?
77
+ warn '[DEPRECATED] the `valid?` method is obsolete'
78
+ true
79
+ end
80
+
81
+ # Checks equality by comparing each attribute.
82
+ # @param [Object] Object to be compared
83
+ def ==(o)
84
+ return true if self.equal?(o)
85
+ self.class == o.class &&
86
+ error == o.error
87
+ end
88
+
89
+ # @see the `==` method
90
+ # @param [Object] Object to be compared
91
+ def eql?(o)
92
+ self == o
93
+ end
94
+
95
+ # Calculates hash code according to all attributes.
96
+ # @return [Integer] Hash code
97
+ def hash
98
+ [error].hash
99
+ end
100
+
101
+ # Builds the object from hash
102
+ # @param [Hash] attributes Model attributes in the form of hash
103
+ # @return [Object] Returns the model itself
104
+ def self.build_from_hash(attributes)
105
+ return nil unless attributes.is_a?(Hash)
106
+ attributes = attributes.transform_keys(&:to_sym)
107
+ transformed_hash = {}
108
+ openapi_types.each_pair do |key, type|
109
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
110
+ transformed_hash["#{key}"] = nil
111
+ elsif type =~ /\AArray<(.*)>/i
112
+ # check to ensure the input is an array given that the attribute
113
+ # is documented as an array but the input is not
114
+ if attributes[attribute_map[key]].is_a?(Array)
115
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
116
+ end
117
+ elsif !attributes[attribute_map[key]].nil?
118
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
119
+ end
120
+ end
121
+ new(transformed_hash)
122
+ end
123
+
124
+ # Deserializes the data based on type
125
+ # @param string type Data type
126
+ # @param string value Value to be deserialized
127
+ # @return [Object] Deserialized data
128
+ def self._deserialize(type, value)
129
+ case type.to_sym
130
+ when :Time
131
+ Time.parse(value)
132
+ when :Date
133
+ Date.parse(value)
134
+ when :String
135
+ value.to_s
136
+ when :Integer
137
+ value.to_i
138
+ when :Float
139
+ value.to_f
140
+ when :Boolean
141
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
142
+ true
143
+ else
144
+ false
145
+ end
146
+ when :Object
147
+ # generic object (usually a Hash), return directly
148
+ value
149
+ when /\AArray<(?<inner_type>.+)>\z/
150
+ inner_type = Regexp.last_match[:inner_type]
151
+ value.map { |v| _deserialize(inner_type, v) }
152
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
153
+ k_type = Regexp.last_match[:k_type]
154
+ v_type = Regexp.last_match[:v_type]
155
+ {}.tap do |hash|
156
+ value.each do |k, v|
157
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
158
+ end
159
+ end
160
+ else # model
161
+ # models (e.g. Pet) or oneOf
162
+ klass = Daily.const_get(type)
163
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
164
+ end
165
+ end
166
+
167
+ # Returns the string representation of the object
168
+ # @return [String] String presentation of the object
169
+ def to_s
170
+ to_hash.to_s
171
+ end
172
+
173
+ # to_body is an alias to to_hash (backward compatibility)
174
+ # @return [Hash] Returns the object in the form of hash
175
+ def to_body
176
+ to_hash
177
+ end
178
+
179
+ # Returns the object in the form of hash
180
+ # @return [Hash] Returns the object in the form of hash
181
+ def to_hash
182
+ hash = {}
183
+ self.class.attribute_map.each_pair do |attr, param|
184
+ value = self.send(attr)
185
+ if value.nil?
186
+ is_nullable = self.class.openapi_nullable.include?(attr)
187
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
188
+ end
189
+
190
+ hash[param] = _to_hash(value)
191
+ end
192
+ hash
193
+ end
194
+
195
+ # Outputs non-array value in the form of hash
196
+ # For object, use to_hash. Otherwise, just return the value
197
+ # @param [Object] value Any valid value
198
+ # @return [Hash] Returns the value in the form of hash
199
+ def _to_hash(value)
200
+ if value.is_a?(Array)
201
+ value.compact.map { |v| _to_hash(v) }
202
+ elsif value.is_a?(Hash)
203
+ {}.tap do |hash|
204
+ value.each { |k, v| hash[k] = _to_hash(v) }
205
+ end
206
+ elsif value.respond_to? :to_hash
207
+ value.to_hash
208
+ else
209
+ value
210
+ end
211
+ end
212
+
213
+ end
214
+
215
+ end
@@ -0,0 +1,15 @@
1
+ =begin
2
+ #Daily
3
+
4
+ #The official library for communicating with the Daily REST API.
5
+
6
+ The version of the OpenAPI document: 0.0.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 7.3.0
10
+
11
+ =end
12
+
13
+ module Daily
14
+ VERSION = '0.0.0'
15
+ end
data/lib/daily-ruby.rb ADDED
@@ -0,0 +1,53 @@
1
+ =begin
2
+ #Daily
3
+
4
+ #The official library for communicating with the Daily REST API.
5
+
6
+ The version of the OpenAPI document: 0.0.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 7.3.0
10
+
11
+ =end
12
+
13
+ # Common files
14
+ require 'daily-ruby/api_client'
15
+ require 'daily-ruby/api_error'
16
+ require 'daily-ruby/version'
17
+ require 'daily-ruby/configuration'
18
+
19
+ # Models
20
+ require 'daily-ruby/models/create_meeting_token200_response'
21
+ require 'daily-ruby/models/meeting_token_request'
22
+ require 'daily-ruby/models/meeting_token_request_properties'
23
+ require 'daily-ruby/models/meeting_token_request_properties_permissions'
24
+ require 'daily-ruby/models/meeting_token_request_properties_permissions_can_admin'
25
+ require 'daily-ruby/models/meeting_token_request_properties_permissions_can_send'
26
+ require 'daily-ruby/models/room_deleted_response'
27
+ require 'daily-ruby/models/room_not_found_response'
28
+ require 'daily-ruby/models/room_request'
29
+ require 'daily-ruby/models/room_request_properties'
30
+ require 'daily-ruby/models/room_response'
31
+ require 'daily-ruby/models/server_error_response'
32
+
33
+ # APIs
34
+ require 'daily-ruby/api/meeting_tokens_api'
35
+ require 'daily-ruby/api/room_api'
36
+
37
+ module Daily
38
+ class << self
39
+ # Customize default settings for the SDK using block.
40
+ # Daily.configure do |config|
41
+ # config.username = "xxx"
42
+ # config.password = "xxx"
43
+ # end
44
+ # If no block given, return the default Configuration object.
45
+ def configure
46
+ if block_given?
47
+ yield(Configuration.default)
48
+ else
49
+ Configuration.default
50
+ end
51
+ end
52
+ end
53
+ end
data/run.sh ADDED
@@ -0,0 +1,16 @@
1
+ #!/bin/bash
2
+
3
+ openapi-generator generate -g ruby -o . -i daily.yaml \
4
+ --additional-properties=gemName=daily-ruby \
5
+ --additional-properties=moduleName=Daily \
6
+ --additional-properties=gemVersion=0.0.0 \
7
+ --additional-properties=gemLicense=MIT \
8
+ --additional-properties=gemAuthor=Daily \
9
+ --additional-properties=gemAuthorEmail=help@daily.co \
10
+ --additional-properties=gemDescription="The official Daily API Ruby client" \
11
+ --additional-properties=gemSummary="The official Daily API Ruby client" \
12
+ --additional-properties=gemHomepage="https://www.github.com/daily-co/daily-ruby" \
13
+ --additional-properties=disallowAdditionalPropertiesIfNotPresent=false \
14
+ --additional-properties=library=faraday \
15
+ --additional-properties=enumUnknownDefaultCase=true \
16
+
data/script.rb ADDED
@@ -0,0 +1,35 @@
1
+ # Load the gem
2
+ require 'daily-ruby'
3
+
4
+ # Setup authorization
5
+ Daily.configure do |config|
6
+ # Configure Bearer authorization: bearerAuth
7
+ config.access_token = ENV['DAILY_API_KEY']
8
+ end
9
+
10
+ room_api_instance = Daily::RoomApi.new
11
+ opts = {
12
+ room_request: Daily::RoomRequest.new( privacy: 'private' ) # RoomRequest | A room object
13
+ }
14
+
15
+ begin
16
+ # Create a new room
17
+ room = room_api_instance.create_room(opts)
18
+ p room
19
+ rescue Daily::ApiError => e
20
+ puts "Error when calling RoomApi->create_room: #{e}"
21
+ end
22
+
23
+ meeting_token_api_instance = Daily::MeetingTokensApi.new
24
+
25
+ opts = {
26
+ meeting_token_request: { properties: { room_name: room.name } } # MeetingTokenRequest | A meeting token object
27
+ }
28
+
29
+ begin
30
+ # Create a new meeting token
31
+ meeting_token = meeting_token_api_instance.create_meeting_token(opts)
32
+ p meeting_token
33
+ rescue Daily::ApiError => e
34
+ puts "Error when calling MeetingTokensApi->create_meeting_token: #{e}"
35
+ end
@@ -0,0 +1,47 @@
1
+ =begin
2
+ #Daily
3
+
4
+ #The official library for communicating with the Daily REST API.
5
+
6
+ The version of the OpenAPI document: 0.0.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 7.3.0
10
+
11
+ =end
12
+
13
+ require 'spec_helper'
14
+ require 'json'
15
+
16
+ # Unit tests for Daily::MeetingTokensApi
17
+ # Automatically generated by openapi-generator (https://openapi-generator.tech)
18
+ # Please update as you see appropriate
19
+ describe 'MeetingTokensApi' do
20
+ before do
21
+ # run before each test
22
+ @api_instance = Daily::MeetingTokensApi.new
23
+ end
24
+
25
+ after do
26
+ # run after each test
27
+ end
28
+
29
+ describe 'test an instance of MeetingTokensApi' do
30
+ it 'should create an instance of MeetingTokensApi' do
31
+ expect(@api_instance).to be_instance_of(Daily::MeetingTokensApi)
32
+ end
33
+ end
34
+
35
+ # unit tests for create_meeting_token
36
+ # Creates a meeting token
37
+ # A POST request to /meeting-tokens creates a new meeting token.
38
+ # @param [Hash] opts the optional parameters
39
+ # @option opts [MeetingTokenRequest] :meeting_token_request A room object
40
+ # @return [CreateMeetingToken200Response]
41
+ describe 'create_meeting_token test' do
42
+ it 'should work' do
43
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
44
+ end
45
+ end
46
+
47
+ end