moonlogs-ruby 1.7.17 → 1.8.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (73) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +114 -5
  3. data/docs/ActionRequest.md +13 -0
  4. data/docs/ActionResponse.md +14 -0
  5. data/docs/Condition.md +9 -0
  6. data/docs/DefaultApi.md +316 -0
  7. data/docs/InlineResponse20015.md +11 -0
  8. data/docs/InlineResponse20016.md +11 -0
  9. data/docs/InlineResponse20017.md +11 -0
  10. data/docs/InlineResponse20018.md +11 -0
  11. data/docs/InlineResponse20019.md +11 -0
  12. data/docs/RecordRequest.md +1 -0
  13. data/docs/RecordResponse.md +1 -0
  14. data/lib/moonlogs-ruby/api/default_api.rb +343 -1
  15. data/lib/moonlogs-ruby/api_client.rb +1 -1
  16. data/lib/moonlogs-ruby/api_error.rb +1 -1
  17. data/lib/moonlogs-ruby/configuration.rb +1 -1
  18. data/lib/moonlogs-ruby/models/action_request.rb +287 -0
  19. data/lib/moonlogs-ruby/models/action_response.rb +311 -0
  20. data/lib/moonlogs-ruby/models/api_token_request.rb +1 -1
  21. data/lib/moonlogs-ruby/models/api_token_response.rb +1 -1
  22. data/lib/moonlogs-ruby/models/condition.rb +239 -0
  23. data/lib/moonlogs-ruby/models/credentials.rb +1 -1
  24. data/lib/moonlogs-ruby/models/inline_response_200.rb +1 -1
  25. data/lib/moonlogs-ruby/models/inline_response_200_1.rb +1 -1
  26. data/lib/moonlogs-ruby/models/inline_response_200_10.rb +1 -1
  27. data/lib/moonlogs-ruby/models/inline_response_200_11.rb +1 -1
  28. data/lib/moonlogs-ruby/models/inline_response_200_12.rb +1 -1
  29. data/lib/moonlogs-ruby/models/inline_response_200_13.rb +1 -1
  30. data/lib/moonlogs-ruby/models/inline_response_200_14.rb +1 -1
  31. data/lib/moonlogs-ruby/models/inline_response_200_15.rb +267 -0
  32. data/lib/moonlogs-ruby/models/inline_response_200_16.rb +267 -0
  33. data/lib/moonlogs-ruby/models/inline_response_200_17.rb +269 -0
  34. data/lib/moonlogs-ruby/models/inline_response_200_18.rb +267 -0
  35. data/lib/moonlogs-ruby/models/inline_response_200_19.rb +268 -0
  36. data/lib/moonlogs-ruby/models/inline_response_200_2.rb +1 -1
  37. data/lib/moonlogs-ruby/models/inline_response_200_3.rb +1 -1
  38. data/lib/moonlogs-ruby/models/inline_response_200_4.rb +1 -1
  39. data/lib/moonlogs-ruby/models/inline_response_200_5.rb +1 -1
  40. data/lib/moonlogs-ruby/models/inline_response_200_6.rb +1 -1
  41. data/lib/moonlogs-ruby/models/inline_response_200_7.rb +1 -1
  42. data/lib/moonlogs-ruby/models/inline_response_200_8.rb +1 -1
  43. data/lib/moonlogs-ruby/models/inline_response_200_9.rb +1 -1
  44. data/lib/moonlogs-ruby/models/level.rb +1 -1
  45. data/lib/moonlogs-ruby/models/meta.rb +1 -1
  46. data/lib/moonlogs-ruby/models/one_of_record_request_level.rb +1 -1
  47. data/lib/moonlogs-ruby/models/one_of_record_response_level.rb +1 -1
  48. data/lib/moonlogs-ruby/models/one_of_user_request_role.rb +1 -1
  49. data/lib/moonlogs-ruby/models/one_of_user_response_role.rb +1 -1
  50. data/lib/moonlogs-ruby/models/record_request.rb +14 -5
  51. data/lib/moonlogs-ruby/models/record_response.rb +19 -5
  52. data/lib/moonlogs-ruby/models/role.rb +1 -1
  53. data/lib/moonlogs-ruby/models/schema_field.rb +1 -1
  54. data/lib/moonlogs-ruby/models/schema_kind.rb +1 -1
  55. data/lib/moonlogs-ruby/models/schema_request.rb +1 -1
  56. data/lib/moonlogs-ruby/models/schema_response.rb +1 -1
  57. data/lib/moonlogs-ruby/models/session.rb +1 -1
  58. data/lib/moonlogs-ruby/models/tag_request.rb +1 -1
  59. data/lib/moonlogs-ruby/models/tag_response.rb +1 -1
  60. data/lib/moonlogs-ruby/models/user_request.rb +1 -1
  61. data/lib/moonlogs-ruby/models/user_response.rb +1 -1
  62. data/lib/moonlogs-ruby/version.rb +2 -2
  63. data/lib/moonlogs-ruby.rb +9 -1
  64. data/moonlogs-ruby.gemspec +1 -1
  65. data/spec/models/action_request_spec.rb +76 -0
  66. data/spec/models/action_response_spec.rb +82 -0
  67. data/spec/models/condition_spec.rb +52 -0
  68. data/spec/models/inline_response_200_15_spec.rb +64 -0
  69. data/spec/models/inline_response_200_16_spec.rb +64 -0
  70. data/spec/models/inline_response_200_17_spec.rb +64 -0
  71. data/spec/models/inline_response_200_18_spec.rb +64 -0
  72. data/spec/models/inline_response_200_19_spec.rb +64 -0
  73. metadata +34 -2
@@ -3,7 +3,7 @@
3
3
 
4
4
  #Moonlogs API
5
5
 
6
- OpenAPI spec version: 1.7.16
6
+ OpenAPI spec version: 1.8.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
@@ -16,6 +16,108 @@ module MoonlogsRuby
16
16
  def initialize(api_client = ApiClient.default)
17
17
  @api_client = api_client
18
18
  end
19
+ # @param id
20
+ # @param [Hash] opts the optional parameters
21
+ # @return [InlineResponse20016]
22
+ def cover_record_by_id(id, opts = {})
23
+ data, _status_code, _headers = cover_record_by_id_with_http_info(id, opts)
24
+ data
25
+ end
26
+
27
+ # @param id
28
+ # @param [Hash] opts the optional parameters
29
+ # @return [Array<(InlineResponse20016, Integer, Hash)>] InlineResponse20016 data, response status code and response headers
30
+ def cover_record_by_id_with_http_info(id, opts = {})
31
+ if @api_client.config.debugging
32
+ @api_client.config.logger.debug 'Calling API: DefaultApi.cover_record_by_id ...'
33
+ end
34
+ # verify the required parameter 'id' is set
35
+ if @api_client.config.client_side_validation && id.nil?
36
+ fail ArgumentError, "Missing the required parameter 'id' when calling DefaultApi.cover_record_by_id"
37
+ end
38
+ # resource path
39
+ local_var_path = '/api/logs/{id}/cover'.sub('{' + 'id' + '}', id.to_s)
40
+
41
+ # query parameters
42
+ query_params = opts[:query_params] || {}
43
+
44
+ # header parameters
45
+ header_params = opts[:header_params] || {}
46
+ # HTTP header 'Accept' (if needed)
47
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
48
+
49
+ # form parameters
50
+ form_params = opts[:form_params] || {}
51
+
52
+ # http body (model)
53
+ post_body = opts[:body]
54
+
55
+ return_type = opts[:return_type] || 'InlineResponse20016'
56
+
57
+ auth_names = opts[:auth_names] || ['http1']
58
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
59
+ :header_params => header_params,
60
+ :query_params => query_params,
61
+ :form_params => form_params,
62
+ :body => post_body,
63
+ :auth_names => auth_names,
64
+ :return_type => return_type)
65
+
66
+ if @api_client.config.debugging
67
+ @api_client.config.logger.debug "API called: DefaultApi#cover_record_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
68
+ end
69
+ return data, status_code, headers
70
+ end
71
+ # @param [Hash] opts the optional parameters
72
+ # @option opts [ActionRequest] :body
73
+ # @return [InlineResponse20018]
74
+ def create_action(opts = {})
75
+ data, _status_code, _headers = create_action_with_http_info(opts)
76
+ data
77
+ end
78
+
79
+ # @param [Hash] opts the optional parameters
80
+ # @option opts [ActionRequest] :body
81
+ # @return [Array<(InlineResponse20018, Integer, Hash)>] InlineResponse20018 data, response status code and response headers
82
+ def create_action_with_http_info(opts = {})
83
+ if @api_client.config.debugging
84
+ @api_client.config.logger.debug 'Calling API: DefaultApi.create_action ...'
85
+ end
86
+ # resource path
87
+ local_var_path = '/api/actions'
88
+
89
+ # query parameters
90
+ query_params = opts[:query_params] || {}
91
+
92
+ # header parameters
93
+ header_params = opts[:header_params] || {}
94
+ # HTTP header 'Accept' (if needed)
95
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
96
+ # HTTP header 'Content-Type'
97
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
98
+
99
+ # form parameters
100
+ form_params = opts[:form_params] || {}
101
+
102
+ # http body (model)
103
+ post_body = opts[:body] || @api_client.object_to_http_body(opts[:'body'])
104
+
105
+ return_type = opts[:return_type] || 'InlineResponse20018'
106
+
107
+ auth_names = opts[:auth_names] || ['http1']
108
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
109
+ :header_params => header_params,
110
+ :query_params => query_params,
111
+ :form_params => form_params,
112
+ :body => post_body,
113
+ :auth_names => auth_names,
114
+ :return_type => return_type)
115
+
116
+ if @api_client.config.debugging
117
+ @api_client.config.logger.debug "API called: DefaultApi#create_action\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
118
+ end
119
+ return data, status_code, headers
120
+ end
19
121
  # @param [Hash] opts the optional parameters
20
122
  # @option opts [RecordRequest] :body
21
123
  # @return [InlineResponse2004]
@@ -366,6 +468,52 @@ module MoonlogsRuby
366
468
  end
367
469
  return data, status_code, headers
368
470
  end
471
+ # @param [Hash] opts the optional parameters
472
+ # @return [InlineResponse20019]
473
+ def delete_action_by_id(opts = {})
474
+ data, _status_code, _headers = delete_action_by_id_with_http_info(opts)
475
+ data
476
+ end
477
+
478
+ # @param [Hash] opts the optional parameters
479
+ # @return [Array<(InlineResponse20019, Integer, Hash)>] InlineResponse20019 data, response status code and response headers
480
+ def delete_action_by_id_with_http_info(opts = {})
481
+ if @api_client.config.debugging
482
+ @api_client.config.logger.debug 'Calling API: DefaultApi.delete_action_by_id ...'
483
+ end
484
+ # resource path
485
+ local_var_path = '/api/actions/{id}'
486
+
487
+ # query parameters
488
+ query_params = opts[:query_params] || {}
489
+
490
+ # header parameters
491
+ header_params = opts[:header_params] || {}
492
+ # HTTP header 'Accept' (if needed)
493
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
494
+
495
+ # form parameters
496
+ form_params = opts[:form_params] || {}
497
+
498
+ # http body (model)
499
+ post_body = opts[:body]
500
+
501
+ return_type = opts[:return_type] || 'InlineResponse20019'
502
+
503
+ auth_names = opts[:auth_names] || ['http1']
504
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
505
+ :header_params => header_params,
506
+ :query_params => query_params,
507
+ :form_params => form_params,
508
+ :body => post_body,
509
+ :auth_names => auth_names,
510
+ :return_type => return_type)
511
+
512
+ if @api_client.config.debugging
513
+ @api_client.config.logger.debug "API called: DefaultApi#delete_action_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
514
+ end
515
+ return data, status_code, headers
516
+ end
369
517
  # @param id
370
518
  # @param [Hash] opts the optional parameters
371
519
  # @return [InlineResponse2002]
@@ -574,6 +722,150 @@ module MoonlogsRuby
574
722
  end
575
723
  return data, status_code, headers
576
724
  end
725
+ # @param id
726
+ # @param [Hash] opts the optional parameters
727
+ # @return [InlineResponse20015]
728
+ def expose_record_by_id(id, opts = {})
729
+ data, _status_code, _headers = expose_record_by_id_with_http_info(id, opts)
730
+ data
731
+ end
732
+
733
+ # @param id
734
+ # @param [Hash] opts the optional parameters
735
+ # @return [Array<(InlineResponse20015, Integer, Hash)>] InlineResponse20015 data, response status code and response headers
736
+ def expose_record_by_id_with_http_info(id, opts = {})
737
+ if @api_client.config.debugging
738
+ @api_client.config.logger.debug 'Calling API: DefaultApi.expose_record_by_id ...'
739
+ end
740
+ # verify the required parameter 'id' is set
741
+ if @api_client.config.client_side_validation && id.nil?
742
+ fail ArgumentError, "Missing the required parameter 'id' when calling DefaultApi.expose_record_by_id"
743
+ end
744
+ # resource path
745
+ local_var_path = '/api/logs/{id}/expose'.sub('{' + 'id' + '}', id.to_s)
746
+
747
+ # query parameters
748
+ query_params = opts[:query_params] || {}
749
+
750
+ # header parameters
751
+ header_params = opts[:header_params] || {}
752
+ # HTTP header 'Accept' (if needed)
753
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
754
+
755
+ # form parameters
756
+ form_params = opts[:form_params] || {}
757
+
758
+ # http body (model)
759
+ post_body = opts[:body]
760
+
761
+ return_type = opts[:return_type] || 'InlineResponse20015'
762
+
763
+ auth_names = opts[:auth_names] || ['http1']
764
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
765
+ :header_params => header_params,
766
+ :query_params => query_params,
767
+ :form_params => form_params,
768
+ :body => post_body,
769
+ :auth_names => auth_names,
770
+ :return_type => return_type)
771
+
772
+ if @api_client.config.debugging
773
+ @api_client.config.logger.debug "API called: DefaultApi#expose_record_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
774
+ end
775
+ return data, status_code, headers
776
+ end
777
+ # @param [Hash] opts the optional parameters
778
+ # @return [InlineResponse20018]
779
+ def get_action_by_id(opts = {})
780
+ data, _status_code, _headers = get_action_by_id_with_http_info(opts)
781
+ data
782
+ end
783
+
784
+ # @param [Hash] opts the optional parameters
785
+ # @return [Array<(InlineResponse20018, Integer, Hash)>] InlineResponse20018 data, response status code and response headers
786
+ def get_action_by_id_with_http_info(opts = {})
787
+ if @api_client.config.debugging
788
+ @api_client.config.logger.debug 'Calling API: DefaultApi.get_action_by_id ...'
789
+ end
790
+ # resource path
791
+ local_var_path = '/api/actions/{id}'
792
+
793
+ # query parameters
794
+ query_params = opts[:query_params] || {}
795
+
796
+ # header parameters
797
+ header_params = opts[:header_params] || {}
798
+ # HTTP header 'Accept' (if needed)
799
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
800
+
801
+ # form parameters
802
+ form_params = opts[:form_params] || {}
803
+
804
+ # http body (model)
805
+ post_body = opts[:body]
806
+
807
+ return_type = opts[:return_type] || 'InlineResponse20018'
808
+
809
+ auth_names = opts[:auth_names] || ['http1']
810
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
811
+ :header_params => header_params,
812
+ :query_params => query_params,
813
+ :form_params => form_params,
814
+ :body => post_body,
815
+ :auth_names => auth_names,
816
+ :return_type => return_type)
817
+
818
+ if @api_client.config.debugging
819
+ @api_client.config.logger.debug "API called: DefaultApi#get_action_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
820
+ end
821
+ return data, status_code, headers
822
+ end
823
+ # @param [Hash] opts the optional parameters
824
+ # @return [InlineResponse20017]
825
+ def get_actions(opts = {})
826
+ data, _status_code, _headers = get_actions_with_http_info(opts)
827
+ data
828
+ end
829
+
830
+ # @param [Hash] opts the optional parameters
831
+ # @return [Array<(InlineResponse20017, Integer, Hash)>] InlineResponse20017 data, response status code and response headers
832
+ def get_actions_with_http_info(opts = {})
833
+ if @api_client.config.debugging
834
+ @api_client.config.logger.debug 'Calling API: DefaultApi.get_actions ...'
835
+ end
836
+ # resource path
837
+ local_var_path = '/api/actions'
838
+
839
+ # query parameters
840
+ query_params = opts[:query_params] || {}
841
+
842
+ # header parameters
843
+ header_params = opts[:header_params] || {}
844
+ # HTTP header 'Accept' (if needed)
845
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
846
+
847
+ # form parameters
848
+ form_params = opts[:form_params] || {}
849
+
850
+ # http body (model)
851
+ post_body = opts[:body]
852
+
853
+ return_type = opts[:return_type] || 'InlineResponse20017'
854
+
855
+ auth_names = opts[:auth_names] || ['http1']
856
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
857
+ :header_params => header_params,
858
+ :query_params => query_params,
859
+ :form_params => form_params,
860
+ :body => post_body,
861
+ :auth_names => auth_names,
862
+ :return_type => return_type)
863
+
864
+ if @api_client.config.debugging
865
+ @api_client.config.logger.debug "API called: DefaultApi#get_actions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
866
+ end
867
+ return data, status_code, headers
868
+ end
577
869
  # @param [Hash] opts the optional parameters
578
870
  # @option opts [Integer] :page
579
871
  # @option opts [Integer] :limit
@@ -1390,6 +1682,56 @@ module MoonlogsRuby
1390
1682
  end
1391
1683
  return data, status_code, headers
1392
1684
  end
1685
+ # @param [Hash] opts the optional parameters
1686
+ # @option opts [ActionRequest] :body
1687
+ # @return [InlineResponse20018]
1688
+ def update_action_by_id(opts = {})
1689
+ data, _status_code, _headers = update_action_by_id_with_http_info(opts)
1690
+ data
1691
+ end
1692
+
1693
+ # @param [Hash] opts the optional parameters
1694
+ # @option opts [ActionRequest] :body
1695
+ # @return [Array<(InlineResponse20018, Integer, Hash)>] InlineResponse20018 data, response status code and response headers
1696
+ def update_action_by_id_with_http_info(opts = {})
1697
+ if @api_client.config.debugging
1698
+ @api_client.config.logger.debug 'Calling API: DefaultApi.update_action_by_id ...'
1699
+ end
1700
+ # resource path
1701
+ local_var_path = '/api/actions/{id}'
1702
+
1703
+ # query parameters
1704
+ query_params = opts[:query_params] || {}
1705
+
1706
+ # header parameters
1707
+ header_params = opts[:header_params] || {}
1708
+ # HTTP header 'Accept' (if needed)
1709
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
1710
+ # HTTP header 'Content-Type'
1711
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
1712
+
1713
+ # form parameters
1714
+ form_params = opts[:form_params] || {}
1715
+
1716
+ # http body (model)
1717
+ post_body = opts[:body] || @api_client.object_to_http_body(opts[:'body'])
1718
+
1719
+ return_type = opts[:return_type] || 'InlineResponse20018'
1720
+
1721
+ auth_names = opts[:auth_names] || ['http1']
1722
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
1723
+ :header_params => header_params,
1724
+ :query_params => query_params,
1725
+ :form_params => form_params,
1726
+ :body => post_body,
1727
+ :auth_names => auth_names,
1728
+ :return_type => return_type)
1729
+
1730
+ if @api_client.config.debugging
1731
+ @api_client.config.logger.debug "API called: DefaultApi#update_action_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1732
+ end
1733
+ return data, status_code, headers
1734
+ end
1393
1735
  # @param id
1394
1736
  # @param [Hash] opts the optional parameters
1395
1737
  # @option opts [SchemaRequest] :body
@@ -3,7 +3,7 @@
3
3
 
4
4
  #Moonlogs API
5
5
 
6
- OpenAPI spec version: 1.7.16
6
+ OpenAPI spec version: 1.8.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: 1.7.16
6
+ OpenAPI spec version: 1.8.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: 1.7.16
6
+ OpenAPI spec version: 1.8.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,287 @@
1
+ =begin
2
+ #Moonlogs
3
+
4
+ #Moonlogs API
5
+
6
+ OpenAPI spec version: 1.8.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 ActionRequest
16
+ attr_accessor :name
17
+
18
+ attr_accessor :pattern
19
+
20
+ attr_accessor :method
21
+
22
+ attr_accessor :conditions
23
+
24
+ attr_accessor :schema_name
25
+
26
+ attr_accessor :schema_id
27
+
28
+ attr_accessor :disabled
29
+
30
+ # Attribute mapping from ruby-style variable name to JSON key.
31
+ def self.attribute_map
32
+ {
33
+ :'name' => :'name',
34
+ :'pattern' => :'pattern',
35
+ :'method' => :'method',
36
+ :'conditions' => :'conditions',
37
+ :'schema_name' => :'schema_name',
38
+ :'schema_id' => :'schema_id',
39
+ :'disabled' => :'disabled'
40
+ }
41
+ end
42
+
43
+ # Attribute type mapping.
44
+ def self.openapi_types
45
+ {
46
+ :'name' => :'Object',
47
+ :'pattern' => :'Object',
48
+ :'method' => :'Object',
49
+ :'conditions' => :'Object',
50
+ :'schema_name' => :'Object',
51
+ :'schema_id' => :'Object',
52
+ :'disabled' => :'Object'
53
+ }
54
+ end
55
+
56
+ # List of attributes with nullable: true
57
+ def self.openapi_nullable
58
+ Set.new([
59
+ ])
60
+ end
61
+
62
+ # Initializes the object
63
+ # @param [Hash] attributes Model attributes in the form of hash
64
+ def initialize(attributes = {})
65
+ if (!attributes.is_a?(Hash))
66
+ fail ArgumentError, "The input argument (attributes) must be a hash in `MoonlogsRuby::ActionRequest` initialize method"
67
+ end
68
+
69
+ # check to see if the attribute exists and convert string to symbol for hash key
70
+ attributes = attributes.each_with_object({}) { |(k, v), h|
71
+ if (!self.class.attribute_map.key?(k.to_sym))
72
+ fail ArgumentError, "`#{k}` is not a valid attribute in `MoonlogsRuby::ActionRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
73
+ end
74
+ h[k.to_sym] = v
75
+ }
76
+
77
+ if attributes.key?(:'name')
78
+ self.name = attributes[:'name']
79
+ end
80
+
81
+ if attributes.key?(:'pattern')
82
+ self.pattern = attributes[:'pattern']
83
+ end
84
+
85
+ if attributes.key?(:'method')
86
+ self.method = attributes[:'method']
87
+ end
88
+
89
+ if attributes.key?(:'conditions')
90
+ if (value = attributes[:'conditions']).is_a?(Array)
91
+ self.conditions = value
92
+ end
93
+ end
94
+
95
+ if attributes.key?(:'schema_name')
96
+ self.schema_name = attributes[:'schema_name']
97
+ end
98
+
99
+ if attributes.key?(:'schema_id')
100
+ self.schema_id = attributes[:'schema_id']
101
+ end
102
+
103
+ if attributes.key?(:'disabled')
104
+ self.disabled = attributes[:'disabled']
105
+ end
106
+ end
107
+
108
+ # Show invalid properties with the reasons. Usually used together with valid?
109
+ # @return Array for valid properties with the reasons
110
+ def list_invalid_properties
111
+ invalid_properties = Array.new
112
+ if @name.nil?
113
+ invalid_properties.push('invalid value for "name", name cannot be nil.')
114
+ end
115
+
116
+ if @pattern.nil?
117
+ invalid_properties.push('invalid value for "pattern", pattern cannot be nil.')
118
+ end
119
+
120
+ if @method.nil?
121
+ invalid_properties.push('invalid value for "method", method cannot be nil.')
122
+ end
123
+
124
+ if @conditions.nil?
125
+ invalid_properties.push('invalid value for "conditions", conditions cannot be nil.')
126
+ end
127
+
128
+ if @schema_name.nil?
129
+ invalid_properties.push('invalid value for "schema_name", schema_name cannot be nil.')
130
+ end
131
+
132
+ invalid_properties
133
+ end
134
+
135
+ # Check to see if the all the properties in the model are valid
136
+ # @return true if the model is valid
137
+ def valid?
138
+ return false if @name.nil?
139
+ return false if @pattern.nil?
140
+ return false if @method.nil?
141
+ return false if @conditions.nil?
142
+ return false if @schema_name.nil?
143
+ true
144
+ end
145
+
146
+ # Checks equality by comparing each attribute.
147
+ # @param [Object] Object to be compared
148
+ def ==(o)
149
+ return true if self.equal?(o)
150
+ self.class == o.class &&
151
+ name == o.name &&
152
+ pattern == o.pattern &&
153
+ method == o.method &&
154
+ conditions == o.conditions &&
155
+ schema_name == o.schema_name &&
156
+ schema_id == o.schema_id &&
157
+ disabled == o.disabled
158
+ end
159
+
160
+ # @see the `==` method
161
+ # @param [Object] Object to be compared
162
+ def eql?(o)
163
+ self == o
164
+ end
165
+
166
+ # Calculates hash code according to all attributes.
167
+ # @return [Integer] Hash code
168
+ def hash
169
+ [name, pattern, method, conditions, schema_name, schema_id, disabled].hash
170
+ end
171
+
172
+ # Builds the object from hash
173
+ # @param [Hash] attributes Model attributes in the form of hash
174
+ # @return [Object] Returns the model itself
175
+ def self.build_from_hash(attributes)
176
+ new.build_from_hash(attributes)
177
+ end
178
+
179
+ # Builds the object from hash
180
+ # @param [Hash] attributes Model attributes in the form of hash
181
+ # @return [Object] Returns the model itself
182
+ def build_from_hash(attributes)
183
+ return nil unless attributes.is_a?(Hash)
184
+ self.class.openapi_types.each_pair do |key, type|
185
+ if type =~ /\AArray<(.*)>/i
186
+ # check to ensure the input is an array given that the attribute
187
+ # is documented as an array but the input is not
188
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
189
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
190
+ end
191
+ elsif !attributes[self.class.attribute_map[key]].nil?
192
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
193
+ elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
194
+ self.send("#{key}=", nil)
195
+ end
196
+ end
197
+
198
+ self
199
+ end
200
+
201
+ # Deserializes the data based on type
202
+ # @param string type Data type
203
+ # @param string value Value to be deserialized
204
+ # @return [Object] Deserialized data
205
+ def _deserialize(type, value)
206
+ case type.to_sym
207
+ when :DateTime
208
+ DateTime.parse(value)
209
+ when :Date
210
+ Date.parse(value)
211
+ when :String
212
+ value.to_s
213
+ when :Integer
214
+ value.to_i
215
+ when :Float
216
+ value.to_f
217
+ when :Boolean
218
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
219
+ true
220
+ else
221
+ false
222
+ end
223
+ when :Object
224
+ # generic object (usually a Hash), return directly
225
+ value
226
+ when /\AArray<(?<inner_type>.+)>\z/
227
+ inner_type = Regexp.last_match[:inner_type]
228
+ value.map { |v| _deserialize(inner_type, v) }
229
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
230
+ k_type = Regexp.last_match[:k_type]
231
+ v_type = Regexp.last_match[:v_type]
232
+ {}.tap do |hash|
233
+ value.each do |k, v|
234
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
235
+ end
236
+ end
237
+ else # model
238
+ MoonlogsRuby.const_get(type).build_from_hash(value)
239
+ end
240
+ end
241
+
242
+ # Returns the string representation of the object
243
+ # @return [String] String presentation of the object
244
+ def to_s
245
+ to_hash.to_s
246
+ end
247
+
248
+ # to_body is an alias to to_hash (backward compatibility)
249
+ # @return [Hash] Returns the object in the form of hash
250
+ def to_body
251
+ to_hash
252
+ end
253
+
254
+ # Returns the object in the form of hash
255
+ # @return [Hash] Returns the object in the form of hash
256
+ def to_hash
257
+ hash = {}
258
+ self.class.attribute_map.each_pair do |attr, param|
259
+ value = self.send(attr)
260
+ if value.nil?
261
+ is_nullable = self.class.openapi_nullable.include?(attr)
262
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
263
+ end
264
+
265
+ hash[param] = _to_hash(value)
266
+ end
267
+ hash
268
+ end
269
+
270
+ # Outputs non-array value in the form of hash
271
+ # For object, use to_hash. Otherwise, just return the value
272
+ # @param [Object] value Any valid value
273
+ # @return [Hash] Returns the value in the form of hash
274
+ def _to_hash(value)
275
+ if value.is_a?(Array)
276
+ value.compact.map { |v| _to_hash(v) }
277
+ elsif value.is_a?(Hash)
278
+ {}.tap do |hash|
279
+ value.each { |k, v| hash[k] = _to_hash(v) }
280
+ end
281
+ elsif value.respond_to? :to_hash
282
+ value.to_hash
283
+ else
284
+ value
285
+ end
286
+ end end
287
+ end