moonlogs-ruby 0.5.11 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (51) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +11 -9
  3. data/docs/DefaultApi.md +4 -4
  4. data/docs/InlineResponse2003.md +1 -1
  5. data/docs/InlineResponse2004.md +1 -1
  6. data/docs/OneOfRecordRequestLevel.md +6 -0
  7. data/docs/OneOfRecordResponseLevel.md +6 -0
  8. data/docs/RecordRequest.md +12 -0
  9. data/docs/RecordResponse.md +15 -0
  10. data/lib/moonlogs-ruby/api/default_api.rb +5 -5
  11. data/lib/moonlogs-ruby/api_client.rb +1 -1
  12. data/lib/moonlogs-ruby/api_error.rb +1 -1
  13. data/lib/moonlogs-ruby/configuration.rb +1 -1
  14. data/lib/moonlogs-ruby/models/api_token.rb +1 -1
  15. data/lib/moonlogs-ruby/models/credentials.rb +1 -1
  16. data/lib/moonlogs-ruby/models/inline_response_200.rb +1 -1
  17. data/lib/moonlogs-ruby/models/inline_response_200_1.rb +1 -1
  18. data/lib/moonlogs-ruby/models/inline_response_200_10.rb +1 -1
  19. data/lib/moonlogs-ruby/models/inline_response_200_11.rb +1 -1
  20. data/lib/moonlogs-ruby/models/inline_response_200_12.rb +1 -1
  21. data/lib/moonlogs-ruby/models/inline_response_200_13.rb +1 -1
  22. data/lib/moonlogs-ruby/models/inline_response_200_2.rb +1 -1
  23. data/lib/moonlogs-ruby/models/inline_response_200_3.rb +1 -1
  24. data/lib/moonlogs-ruby/models/inline_response_200_4.rb +1 -1
  25. data/lib/moonlogs-ruby/models/inline_response_200_5.rb +1 -1
  26. data/lib/moonlogs-ruby/models/inline_response_200_6.rb +1 -1
  27. data/lib/moonlogs-ruby/models/inline_response_200_7.rb +1 -1
  28. data/lib/moonlogs-ruby/models/inline_response_200_8.rb +1 -1
  29. data/lib/moonlogs-ruby/models/inline_response_200_9.rb +1 -1
  30. data/lib/moonlogs-ruby/models/level.rb +1 -1
  31. data/lib/moonlogs-ruby/models/meta.rb +1 -1
  32. data/lib/moonlogs-ruby/models/one_of_record_request_level.rb +197 -0
  33. data/lib/moonlogs-ruby/models/one_of_record_response_level.rb +197 -0
  34. data/lib/moonlogs-ruby/models/one_of_user_role.rb +1 -1
  35. data/lib/moonlogs-ruby/models/record_request.rb +266 -0
  36. data/lib/moonlogs-ruby/models/record_response.rb +323 -0
  37. data/lib/moonlogs-ruby/models/role.rb +1 -1
  38. data/lib/moonlogs-ruby/models/schema.rb +1 -1
  39. data/lib/moonlogs-ruby/models/schema_field.rb +1 -1
  40. data/lib/moonlogs-ruby/models/schema_kind.rb +1 -1
  41. data/lib/moonlogs-ruby/models/session.rb +1 -1
  42. data/lib/moonlogs-ruby/models/tag.rb +1 -1
  43. data/lib/moonlogs-ruby/models/user.rb +1 -1
  44. data/lib/moonlogs-ruby/version.rb +2 -2
  45. data/lib/moonlogs-ruby.rb +5 -3
  46. data/moonlogs-ruby.gemspec +1 -1
  47. data/spec/models/one_of_record_request_level_spec.rb +34 -0
  48. data/spec/models/one_of_record_response_level_spec.rb +34 -0
  49. data/spec/models/record_request_spec.rb +70 -0
  50. data/spec/models/record_response_spec.rb +88 -0
  51. metadata +18 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c81058236a8c1f8ed144d3f97ad2deb09ce38bf7f65740f7b931e5ab35c63c7d
4
- data.tar.gz: 7c4acd4e75a7496c172aef06c37f4ea86afbd4093ee8333ffc7c6631c1adf9f2
3
+ metadata.gz: 792922d5293159ecc3ff0edd1ecfba2bd2463bd8e40a8be8181f22f764009c25
4
+ data.tar.gz: eed03d96667c8a7a79c17027910e67ef5fc720a0ee1d4cc317e050a6ca98a2ff
5
5
  SHA512:
6
- metadata.gz: 0530f603ebd7328c4cadbeaae44ca2655264de39b4605784c703c8e308cc66a2100ced8dcb95f09e95ccaf579ba8d2758c1cea64a587a054002c9422ee690ccd
7
- data.tar.gz: 6ac47d91ae27b2e31496c5747d9eb12ea8f5cb2cc0b6e29d37017aa9e4afab8ca58fa2cef412fb6223c1986d98cc860a52432759c8bc64aa5de6e15afa736a51
6
+ metadata.gz: b039ebb23adf3b3c58caa8c3edf1e6b90b39b70d2b13ef14682fd1ca2399e140ea75a3d38f36b29f0695e400f9b4f90957c396393a04423d2fc4ce301f2c2ee6
7
+ data.tar.gz: ae6b518f72ab9de306f4e5da881547cb641d2fea63fe5f1086f8d8667055c0454cf3040ca73e2779946ad239e3b9efdea6d40283220772d67b94f9b04ce942ff
data/README.md CHANGED
@@ -6,8 +6,8 @@ Moonlogs API
6
6
 
7
7
  This SDK is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project:
8
8
 
9
- - API version: 0.5.11
10
- - Package version: 0.5.11
9
+ - API version: 0.6.0
10
+ - Package version: 0.6.0
11
11
  - Build package: io.swagger.codegen.v3.generators.ruby.RubyClientCodegen
12
12
 
13
13
  ## Installation
@@ -23,15 +23,15 @@ gem build moonlogs-ruby.gemspec
23
23
  Then either install the gem locally:
24
24
 
25
25
  ```shell
26
- gem install ./moonlogs-ruby-0.5.11.gem
26
+ gem install ./moonlogs-ruby-0.6.0.gem
27
27
  ```
28
- (for development, run `gem install --dev ./moonlogs-ruby-0.5.11.gem` to install the development dependencies)
28
+ (for development, run `gem install --dev ./moonlogs-ruby-0.6.0.gem` to install the development dependencies)
29
29
 
30
30
  or publish the gem to a gem hosting service, e.g. [RubyGems](https://rubygems.org/).
31
31
 
32
32
  Finally add this to the Gemfile:
33
33
 
34
- gem 'moonlogs-ruby', '~> 0.5.11'
34
+ gem 'moonlogs-ruby', '~> 0.6.0'
35
35
 
36
36
  ### Install from Git
37
37
 
@@ -175,7 +175,7 @@ end
175
175
 
176
176
  api_instance = MoonlogsRuby::DefaultApi.new
177
177
  opts = {
178
- body: MoonlogsRuby::Record.new # Record |
178
+ body: MoonlogsRuby::RecordRequest.new # RecordRequest |
179
179
  }
180
180
 
181
181
  begin
@@ -190,7 +190,7 @@ end
190
190
 
191
191
  api_instance = MoonlogsRuby::DefaultApi.new
192
192
  opts = {
193
- body: MoonlogsRuby::Record.new, # Record |
193
+ body: MoonlogsRuby::RecordRequest.new, # RecordRequest |
194
194
  page: 56, # Integer |
195
195
  limit: 56, # Integer |
196
196
  from: 'from_example', # String | Time in format \"YYYY-DD-MMTHH:SS\"
@@ -506,9 +506,11 @@ Class | Method | HTTP request | Description
506
506
  - [MoonlogsRuby::InlineResponse2009](docs/InlineResponse2009.md)
507
507
  - [MoonlogsRuby::Level](docs/Level.md)
508
508
  - [MoonlogsRuby::Meta](docs/Meta.md)
509
- - [MoonlogsRuby::OneOfRecordLevel](docs/OneOfRecordLevel.md)
509
+ - [MoonlogsRuby::OneOfRecordRequestLevel](docs/OneOfRecordRequestLevel.md)
510
+ - [MoonlogsRuby::OneOfRecordResponseLevel](docs/OneOfRecordResponseLevel.md)
510
511
  - [MoonlogsRuby::OneOfUserRole](docs/OneOfUserRole.md)
511
- - [MoonlogsRuby::Record](docs/Record.md)
512
+ - [MoonlogsRuby::RecordRequest](docs/RecordRequest.md)
513
+ - [MoonlogsRuby::RecordResponse](docs/RecordResponse.md)
512
514
  - [MoonlogsRuby::Role](docs/Role.md)
513
515
  - [MoonlogsRuby::Schema](docs/Schema.md)
514
516
  - [MoonlogsRuby::SchemaField](docs/SchemaField.md)
data/docs/DefaultApi.md CHANGED
@@ -420,7 +420,7 @@ end
420
420
 
421
421
  api_instance = MoonlogsRuby::DefaultApi.new
422
422
  opts = {
423
- body: MoonlogsRuby::Record.new # Record |
423
+ body: MoonlogsRuby::RecordRequest.new # RecordRequest |
424
424
  }
425
425
 
426
426
  begin
@@ -435,7 +435,7 @@ end
435
435
 
436
436
  Name | Type | Description | Notes
437
437
  ------------- | ------------- | ------------- | -------------
438
- **body** | [**Record**](Record.md)| | [optional]
438
+ **body** | [**RecordRequest**](RecordRequest.md)| | [optional]
439
439
 
440
440
  ### Return type
441
441
 
@@ -467,7 +467,7 @@ end
467
467
 
468
468
  api_instance = MoonlogsRuby::DefaultApi.new
469
469
  opts = {
470
- body: MoonlogsRuby::Record.new # Record |
470
+ body: MoonlogsRuby::RecordRequest.new # RecordRequest |
471
471
  page: 56 # Integer |
472
472
  limit: 56 # Integer |
473
473
  from: 'from_example' # String | Time in format \"YYYY-DD-MMTHH:SS\"
@@ -486,7 +486,7 @@ end
486
486
 
487
487
  Name | Type | Description | Notes
488
488
  ------------- | ------------- | ------------- | -------------
489
- **body** | [**Record**](Record.md)| | [optional]
489
+ **body** | [**RecordRequest**](RecordRequest.md)| | [optional]
490
490
  **page** | **Integer**| | [optional]
491
491
  **limit** | **Integer**| | [optional]
492
492
  **from** | **String**| Time in format \"YYYY-DD-MMTHH:SS\" | [optional]
@@ -6,6 +6,6 @@ Name | Type | Description | Notes
6
6
  **success** | **BOOLEAN** | |
7
7
  **code** | **Integer** | |
8
8
  **error** | **String** | |
9
- **data** | [**Array<Record>**](Record.md) | |
9
+ **data** | [**Array<RecordResponse>**](RecordResponse.md) | |
10
10
  **meta** | [**Meta**](Meta.md) | |
11
11
 
@@ -6,6 +6,6 @@ Name | Type | Description | Notes
6
6
  **success** | **BOOLEAN** | |
7
7
  **code** | **Integer** | |
8
8
  **error** | **String** | |
9
- **data** | [**Record**](Record.md) | |
9
+ **data** | [**RecordResponse**](RecordResponse.md) | |
10
10
  **meta** | [**Meta**](Meta.md) | |
11
11
 
@@ -0,0 +1,6 @@
1
+ # MoonlogsRuby::OneOfRecordRequestLevel
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+
@@ -0,0 +1,6 @@
1
+ # MoonlogsRuby::OneOfRecordResponseLevel
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+
@@ -0,0 +1,12 @@
1
+ # MoonlogsRuby::RecordRequest
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+ **text** | **String** | |
7
+ **schema_name** | **String** | |
8
+ **schema_id** | **Integer** | | [optional]
9
+ **query** | **Object** | |
10
+ **kind** | **String** | | [optional]
11
+ **level** | [**OneOfRecordRequestLevel**](OneOfRecordRequestLevel.md) | | [optional]
12
+
@@ -0,0 +1,15 @@
1
+ # MoonlogsRuby::RecordResponse
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+ **id** | **Integer** | |
7
+ **text** | **String** | |
8
+ **schema_name** | **String** | |
9
+ **schema_id** | **Integer** | |
10
+ **query** | **Object** | |
11
+ **kind** | **String** | |
12
+ **created_at** | **String** | |
13
+ **group_hash** | **String** | |
14
+ **level** | [**OneOfRecordResponseLevel**](OneOfRecordResponseLevel.md) | |
15
+
@@ -3,7 +3,7 @@
3
3
 
4
4
  #Moonlogs API
5
5
 
6
- OpenAPI spec version: 0.5.11
6
+ OpenAPI spec version: 0.6.0
7
7
  Contact: shalpack@gmail.com
8
8
  Generated by: https://github.com/swagger-api/swagger-codegen.git
9
9
  Swagger Codegen version: 3.0.52
@@ -435,7 +435,7 @@ module MoonlogsRuby
435
435
  return data, status_code, headers
436
436
  end
437
437
  # @param [Hash] opts the optional parameters
438
- # @option opts [Record] :body
438
+ # @option opts [RecordRequest] :body
439
439
  # @return [InlineResponse2004]
440
440
  def api_logs_post(opts = {})
441
441
  data, _status_code, _headers = api_logs_post_with_http_info(opts)
@@ -443,7 +443,7 @@ module MoonlogsRuby
443
443
  end
444
444
 
445
445
  # @param [Hash] opts the optional parameters
446
- # @option opts [Record] :body
446
+ # @option opts [RecordRequest] :body
447
447
  # @return [Array<(InlineResponse2004, Integer, Hash)>] InlineResponse2004 data, response status code and response headers
448
448
  def api_logs_post_with_http_info(opts = {})
449
449
  if @api_client.config.debugging
@@ -485,7 +485,7 @@ module MoonlogsRuby
485
485
  return data, status_code, headers
486
486
  end
487
487
  # @param [Hash] opts the optional parameters
488
- # @option opts [Record] :body
488
+ # @option opts [RecordRequest] :body
489
489
  # @option opts [Integer] :page
490
490
  # @option opts [Integer] :limit
491
491
  # @option opts [String] :from Time in format \&quot;YYYY-DD-MMTHH:SS\&quot;
@@ -497,7 +497,7 @@ module MoonlogsRuby
497
497
  end
498
498
 
499
499
  # @param [Hash] opts the optional parameters
500
- # @option opts [Record] :body
500
+ # @option opts [RecordRequest] :body
501
501
  # @option opts [Integer] :page
502
502
  # @option opts [Integer] :limit
503
503
  # @option opts [String] :from Time in format \&quot;YYYY-DD-MMTHH:SS\&quot;
@@ -3,7 +3,7 @@
3
3
 
4
4
  #Moonlogs API
5
5
 
6
- OpenAPI spec version: 0.5.11
6
+ OpenAPI spec version: 0.6.0
7
7
  Contact: shalpack@gmail.com
8
8
  Generated by: https://github.com/swagger-api/swagger-codegen.git
9
9
  Swagger Codegen version: 3.0.52
@@ -3,7 +3,7 @@
3
3
 
4
4
  #Moonlogs API
5
5
 
6
- OpenAPI spec version: 0.5.11
6
+ OpenAPI spec version: 0.6.0
7
7
  Contact: shalpack@gmail.com
8
8
  Generated by: https://github.com/swagger-api/swagger-codegen.git
9
9
  Swagger Codegen version: 3.0.52
@@ -3,7 +3,7 @@
3
3
 
4
4
  #Moonlogs API
5
5
 
6
- OpenAPI spec version: 0.5.11
6
+ OpenAPI spec version: 0.6.0
7
7
  Contact: shalpack@gmail.com
8
8
  Generated by: https://github.com/swagger-api/swagger-codegen.git
9
9
  Swagger Codegen version: 3.0.52
@@ -3,7 +3,7 @@
3
3
 
4
4
  #Moonlogs API
5
5
 
6
- OpenAPI spec version: 0.5.11
6
+ OpenAPI spec version: 0.6.0
7
7
  Contact: shalpack@gmail.com
8
8
  Generated by: https://github.com/swagger-api/swagger-codegen.git
9
9
  Swagger Codegen version: 3.0.52
@@ -3,7 +3,7 @@
3
3
 
4
4
  #Moonlogs API
5
5
 
6
- OpenAPI spec version: 0.5.11
6
+ OpenAPI spec version: 0.6.0
7
7
  Contact: shalpack@gmail.com
8
8
  Generated by: https://github.com/swagger-api/swagger-codegen.git
9
9
  Swagger Codegen version: 3.0.52
@@ -3,7 +3,7 @@
3
3
 
4
4
  #Moonlogs API
5
5
 
6
- OpenAPI spec version: 0.5.11
6
+ OpenAPI spec version: 0.6.0
7
7
  Contact: shalpack@gmail.com
8
8
  Generated by: https://github.com/swagger-api/swagger-codegen.git
9
9
  Swagger Codegen version: 3.0.52
@@ -3,7 +3,7 @@
3
3
 
4
4
  #Moonlogs API
5
5
 
6
- OpenAPI spec version: 0.5.11
6
+ OpenAPI spec version: 0.6.0
7
7
  Contact: shalpack@gmail.com
8
8
  Generated by: https://github.com/swagger-api/swagger-codegen.git
9
9
  Swagger Codegen version: 3.0.52
@@ -3,7 +3,7 @@
3
3
 
4
4
  #Moonlogs API
5
5
 
6
- OpenAPI spec version: 0.5.11
6
+ OpenAPI spec version: 0.6.0
7
7
  Contact: shalpack@gmail.com
8
8
  Generated by: https://github.com/swagger-api/swagger-codegen.git
9
9
  Swagger Codegen version: 3.0.52
@@ -3,7 +3,7 @@
3
3
 
4
4
  #Moonlogs API
5
5
 
6
- OpenAPI spec version: 0.5.11
6
+ OpenAPI spec version: 0.6.0
7
7
  Contact: shalpack@gmail.com
8
8
  Generated by: https://github.com/swagger-api/swagger-codegen.git
9
9
  Swagger Codegen version: 3.0.52
@@ -3,7 +3,7 @@
3
3
 
4
4
  #Moonlogs API
5
5
 
6
- OpenAPI spec version: 0.5.11
6
+ OpenAPI spec version: 0.6.0
7
7
  Contact: shalpack@gmail.com
8
8
  Generated by: https://github.com/swagger-api/swagger-codegen.git
9
9
  Swagger Codegen version: 3.0.52
@@ -3,7 +3,7 @@
3
3
 
4
4
  #Moonlogs API
5
5
 
6
- OpenAPI spec version: 0.5.11
6
+ OpenAPI spec version: 0.6.0
7
7
  Contact: shalpack@gmail.com
8
8
  Generated by: https://github.com/swagger-api/swagger-codegen.git
9
9
  Swagger Codegen version: 3.0.52
@@ -3,7 +3,7 @@
3
3
 
4
4
  #Moonlogs API
5
5
 
6
- OpenAPI spec version: 0.5.11
6
+ OpenAPI spec version: 0.6.0
7
7
  Contact: shalpack@gmail.com
8
8
  Generated by: https://github.com/swagger-api/swagger-codegen.git
9
9
  Swagger Codegen version: 3.0.52
@@ -3,7 +3,7 @@
3
3
 
4
4
  #Moonlogs API
5
5
 
6
- OpenAPI spec version: 0.5.11
6
+ OpenAPI spec version: 0.6.0
7
7
  Contact: shalpack@gmail.com
8
8
  Generated by: https://github.com/swagger-api/swagger-codegen.git
9
9
  Swagger Codegen version: 3.0.52
@@ -3,7 +3,7 @@
3
3
 
4
4
  #Moonlogs API
5
5
 
6
- OpenAPI spec version: 0.5.11
6
+ OpenAPI spec version: 0.6.0
7
7
  Contact: shalpack@gmail.com
8
8
  Generated by: https://github.com/swagger-api/swagger-codegen.git
9
9
  Swagger Codegen version: 3.0.52
@@ -3,7 +3,7 @@
3
3
 
4
4
  #Moonlogs API
5
5
 
6
- OpenAPI spec version: 0.5.11
6
+ OpenAPI spec version: 0.6.0
7
7
  Contact: shalpack@gmail.com
8
8
  Generated by: https://github.com/swagger-api/swagger-codegen.git
9
9
  Swagger Codegen version: 3.0.52
@@ -3,7 +3,7 @@
3
3
 
4
4
  #Moonlogs API
5
5
 
6
- OpenAPI spec version: 0.5.11
6
+ OpenAPI spec version: 0.6.0
7
7
  Contact: shalpack@gmail.com
8
8
  Generated by: https://github.com/swagger-api/swagger-codegen.git
9
9
  Swagger Codegen version: 3.0.52
@@ -3,7 +3,7 @@
3
3
 
4
4
  #Moonlogs API
5
5
 
6
- OpenAPI spec version: 0.5.11
6
+ OpenAPI spec version: 0.6.0
7
7
  Contact: shalpack@gmail.com
8
8
  Generated by: https://github.com/swagger-api/swagger-codegen.git
9
9
  Swagger Codegen version: 3.0.52
@@ -3,7 +3,7 @@
3
3
 
4
4
  #Moonlogs API
5
5
 
6
- OpenAPI spec version: 0.5.11
6
+ OpenAPI spec version: 0.6.0
7
7
  Contact: shalpack@gmail.com
8
8
  Generated by: https://github.com/swagger-api/swagger-codegen.git
9
9
  Swagger Codegen version: 3.0.52
@@ -3,7 +3,7 @@
3
3
 
4
4
  #Moonlogs API
5
5
 
6
- OpenAPI spec version: 0.5.11
6
+ OpenAPI spec version: 0.6.0
7
7
  Contact: shalpack@gmail.com
8
8
  Generated by: https://github.com/swagger-api/swagger-codegen.git
9
9
  Swagger Codegen version: 3.0.52
@@ -3,7 +3,7 @@
3
3
 
4
4
  #Moonlogs API
5
5
 
6
- OpenAPI spec version: 0.5.11
6
+ OpenAPI spec version: 0.6.0
7
7
  Contact: shalpack@gmail.com
8
8
  Generated by: https://github.com/swagger-api/swagger-codegen.git
9
9
  Swagger Codegen version: 3.0.52
@@ -3,7 +3,7 @@
3
3
 
4
4
  #Moonlogs API
5
5
 
6
- OpenAPI spec version: 0.5.11
6
+ OpenAPI spec version: 0.6.0
7
7
  Contact: shalpack@gmail.com
8
8
  Generated by: https://github.com/swagger-api/swagger-codegen.git
9
9
  Swagger Codegen version: 3.0.52
@@ -0,0 +1,197 @@
1
+ =begin
2
+ #Moonlogs
3
+
4
+ #Moonlogs API
5
+
6
+ OpenAPI spec version: 0.6.0
7
+ Contact: shalpack@gmail.com
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 3.0.52
10
+ =end
11
+
12
+ require 'date'
13
+
14
+ module MoonlogsRuby
15
+ class OneOfRecordRequestLevel
16
+ # Attribute mapping from ruby-style variable name to JSON key.
17
+ def self.attribute_map
18
+ {
19
+ }
20
+ end
21
+
22
+ # Attribute type mapping.
23
+ def self.openapi_types
24
+ {
25
+ }
26
+ end
27
+
28
+ # List of attributes with nullable: true
29
+ def self.openapi_nullable
30
+ Set.new([
31
+ ])
32
+ end
33
+
34
+ # Initializes the object
35
+ # @param [Hash] attributes Model attributes in the form of hash
36
+ def initialize(attributes = {})
37
+ if (!attributes.is_a?(Hash))
38
+ fail ArgumentError, "The input argument (attributes) must be a hash in `MoonlogsRuby::OneOfRecordRequestLevel` initialize method"
39
+ end
40
+
41
+ # check to see if the attribute exists and convert string to symbol for hash key
42
+ attributes = attributes.each_with_object({}) { |(k, v), h|
43
+ if (!self.class.attribute_map.key?(k.to_sym))
44
+ fail ArgumentError, "`#{k}` is not a valid attribute in `MoonlogsRuby::OneOfRecordRequestLevel`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
45
+ end
46
+ h[k.to_sym] = v
47
+ }
48
+ end
49
+
50
+ # Show invalid properties with the reasons. Usually used together with valid?
51
+ # @return Array for valid properties with the reasons
52
+ def list_invalid_properties
53
+ invalid_properties = Array.new
54
+ invalid_properties
55
+ end
56
+
57
+ # Check to see if the all the properties in the model are valid
58
+ # @return true if the model is valid
59
+ def valid?
60
+ true
61
+ end
62
+
63
+ # Checks equality by comparing each attribute.
64
+ # @param [Object] Object to be compared
65
+ def ==(o)
66
+ return true if self.equal?(o)
67
+ self.class == o.class
68
+ end
69
+
70
+ # @see the `==` method
71
+ # @param [Object] Object to be compared
72
+ def eql?(o)
73
+ self == o
74
+ end
75
+
76
+ # Calculates hash code according to all attributes.
77
+ # @return [Integer] Hash code
78
+ def hash
79
+ [].hash
80
+ end
81
+
82
+ # Builds the object from hash
83
+ # @param [Hash] attributes Model attributes in the form of hash
84
+ # @return [Object] Returns the model itself
85
+ def self.build_from_hash(attributes)
86
+ new.build_from_hash(attributes)
87
+ end
88
+
89
+ # Builds the object from hash
90
+ # @param [Hash] attributes Model attributes in the form of hash
91
+ # @return [Object] Returns the model itself
92
+ def build_from_hash(attributes)
93
+ return nil unless attributes.is_a?(Hash)
94
+ self.class.openapi_types.each_pair do |key, type|
95
+ if type =~ /\AArray<(.*)>/i
96
+ # check to ensure the input is an array given that the attribute
97
+ # is documented as an array but the input is not
98
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
99
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
100
+ end
101
+ elsif !attributes[self.class.attribute_map[key]].nil?
102
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
103
+ elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
104
+ self.send("#{key}=", nil)
105
+ end
106
+ end
107
+
108
+ self
109
+ end
110
+
111
+ # Deserializes the data based on type
112
+ # @param string type Data type
113
+ # @param string value Value to be deserialized
114
+ # @return [Object] Deserialized data
115
+ def _deserialize(type, value)
116
+ case type.to_sym
117
+ when :DateTime
118
+ DateTime.parse(value)
119
+ when :Date
120
+ Date.parse(value)
121
+ when :String
122
+ value.to_s
123
+ when :Integer
124
+ value.to_i
125
+ when :Float
126
+ value.to_f
127
+ when :Boolean
128
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
129
+ true
130
+ else
131
+ false
132
+ end
133
+ when :Object
134
+ # generic object (usually a Hash), return directly
135
+ value
136
+ when /\AArray<(?<inner_type>.+)>\z/
137
+ inner_type = Regexp.last_match[:inner_type]
138
+ value.map { |v| _deserialize(inner_type, v) }
139
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
140
+ k_type = Regexp.last_match[:k_type]
141
+ v_type = Regexp.last_match[:v_type]
142
+ {}.tap do |hash|
143
+ value.each do |k, v|
144
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
145
+ end
146
+ end
147
+ else # model
148
+ MoonlogsRuby.const_get(type).build_from_hash(value)
149
+ end
150
+ end
151
+
152
+ # Returns the string representation of the object
153
+ # @return [String] String presentation of the object
154
+ def to_s
155
+ to_hash.to_s
156
+ end
157
+
158
+ # to_body is an alias to to_hash (backward compatibility)
159
+ # @return [Hash] Returns the object in the form of hash
160
+ def to_body
161
+ to_hash
162
+ end
163
+
164
+ # Returns the object in the form of hash
165
+ # @return [Hash] Returns the object in the form of hash
166
+ def to_hash
167
+ hash = {}
168
+ self.class.attribute_map.each_pair do |attr, param|
169
+ value = self.send(attr)
170
+ if value.nil?
171
+ is_nullable = self.class.openapi_nullable.include?(attr)
172
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
173
+ end
174
+
175
+ hash[param] = _to_hash(value)
176
+ end
177
+ hash
178
+ end
179
+
180
+ # Outputs non-array value in the form of hash
181
+ # For object, use to_hash. Otherwise, just return the value
182
+ # @param [Object] value Any valid value
183
+ # @return [Hash] Returns the value in the form of hash
184
+ def _to_hash(value)
185
+ if value.is_a?(Array)
186
+ value.compact.map { |v| _to_hash(v) }
187
+ elsif value.is_a?(Hash)
188
+ {}.tap do |hash|
189
+ value.each { |k, v| hash[k] = _to_hash(v) }
190
+ end
191
+ elsif value.respond_to? :to_hash
192
+ value.to_hash
193
+ else
194
+ value
195
+ end
196
+ end end
197
+ end