schematichq 1.4.9 → 1.4.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (107) hide show
  1. checksums.yaml +4 -4
  2. data/.fern/metadata.json +2 -2
  3. data/.fern/replay.lock +350 -2
  4. data/WASM_VERSION +1 -1
  5. data/lib/schematic/accounts/client.rb +6 -2
  6. data/lib/schematic/accounts/types/count_account_members_params.rb +1 -0
  7. data/lib/schematic/accounts/types/count_account_members_request.rb +1 -0
  8. data/lib/schematic/accounts/types/list_account_members_params.rb +1 -0
  9. data/lib/schematic/accounts/types/list_account_members_request.rb +1 -0
  10. data/lib/schematic/catalogs/client.rb +480 -0
  11. data/lib/schematic/catalogs/types/create_catalog_request_body.rb +13 -0
  12. data/lib/schematic/catalogs/types/create_catalog_response.rb +12 -0
  13. data/lib/schematic/catalogs/types/delete_catalog_response.rb +12 -0
  14. data/lib/schematic/catalogs/types/get_catalog_response.rb +12 -0
  15. data/lib/schematic/catalogs/types/get_configuration_response.rb +12 -0
  16. data/lib/schematic/catalogs/types/get_credit_bundles_in_catalog_response.rb +12 -0
  17. data/lib/schematic/catalogs/types/get_derived_features_response.rb +12 -0
  18. data/lib/schematic/catalogs/types/get_plans_in_catalog_response.rb +12 -0
  19. data/lib/schematic/catalogs/types/list_catalogs_params.rb +15 -0
  20. data/lib/schematic/catalogs/types/list_catalogs_request.rb +14 -0
  21. data/lib/schematic/catalogs/types/list_catalogs_response.rb +12 -0
  22. data/lib/schematic/catalogs/types/update_catalog_configuration_request_body.rb +20 -0
  23. data/lib/schematic/catalogs/types/update_catalog_request_body.rb +14 -0
  24. data/lib/schematic/catalogs/types/update_catalog_response.rb +12 -0
  25. data/lib/schematic/catalogs/types/update_configuration_response.rb +12 -0
  26. data/lib/schematic/checkout/client.rb +69 -0
  27. data/lib/schematic/checkout/types/get_company_billing_details_response.rb +12 -0
  28. data/lib/schematic/checkout/types/update_company_billing_details_request_body.rb +15 -0
  29. data/lib/schematic/checkout/types/update_company_billing_details_response.rb +12 -0
  30. data/lib/schematic/client.rb +11 -1
  31. data/lib/schematic/components/client.rb +37 -0
  32. data/lib/schematic/components/types/bind_catalog_request_body.rb +12 -0
  33. data/lib/schematic/components/types/bind_catalog_response.rb +12 -0
  34. data/lib/schematic/dataexports/client.rb +76 -0
  35. data/lib/schematic/dataexports/types/create_data_export_request_body.rb +3 -3
  36. data/lib/schematic/dataexports/types/get_data_export_response.rb +12 -0
  37. data/lib/schematic/dataexports/types/list_data_exports_params.rb +15 -0
  38. data/lib/schematic/dataexports/types/list_data_exports_request.rb +14 -0
  39. data/lib/schematic/dataexports/types/list_data_exports_response.rb +12 -0
  40. data/lib/schematic/licenses/client.rb +138 -0
  41. data/lib/schematic/licenses/types/count_licenses_params.rb +16 -0
  42. data/lib/schematic/licenses/types/count_licenses_request.rb +15 -0
  43. data/lib/schematic/licenses/types/count_licenses_response.rb +12 -0
  44. data/lib/schematic/licenses/types/get_single_license_response.rb +12 -0
  45. data/lib/schematic/licenses/types/list_licenses_params.rb +16 -0
  46. data/lib/schematic/licenses/types/list_licenses_request.rb +15 -0
  47. data/lib/schematic/licenses/types/list_licenses_response.rb +12 -0
  48. data/lib/schematic/planbundle/types/create_custom_plan_bundle_request_body.rb +1 -0
  49. data/lib/schematic/planmigrations/client.rb +32 -0
  50. data/lib/schematic/planmigrations/types/preview_migration_request_body.rb +14 -0
  51. data/lib/schematic/planmigrations/types/preview_migration_response.rb +12 -0
  52. data/lib/schematic/types/audit_log_export_metadata.rb +13 -0
  53. data/lib/schematic/types/billing_credit_grant_zeroed_out_reason.rb +1 -0
  54. data/lib/schematic/types/catalog_config_ordered_bundle.rb +9 -0
  55. data/lib/schematic/types/catalog_config_ordered_bundle_response_data.rb +9 -0
  56. data/lib/schematic/types/catalog_config_ordered_entitlement.rb +10 -0
  57. data/lib/schematic/types/catalog_config_ordered_entitlement_response_data.rb +10 -0
  58. data/lib/schematic/types/catalog_config_ordered_plan.rb +10 -0
  59. data/lib/schematic/types/catalog_config_ordered_plan_response_data.rb +10 -0
  60. data/lib/schematic/types/catalog_configuration_response_data.rb +19 -0
  61. data/lib/schematic/types/catalog_credit_bundle_i_ds_response_data.rb +9 -0
  62. data/lib/schematic/types/catalog_derived_feature_response_data.rb +11 -0
  63. data/lib/schematic/types/catalog_derived_features_response_data.rb +9 -0
  64. data/lib/schematic/types/catalog_plan_i_ds_response_data.rb +9 -0
  65. data/lib/schematic/types/catalog_response_data.rb +22 -0
  66. data/lib/schematic/types/company_billing_address_view.rb +14 -0
  67. data/lib/schematic/types/company_billing_checkout_settings.rb +11 -0
  68. data/lib/schematic/types/company_billing_details_response_data.rb +13 -0
  69. data/lib/schematic/types/company_billing_details_view.rb +13 -0
  70. data/lib/schematic/types/company_feature_usage_export_metadata.rb +25 -0
  71. data/lib/schematic/types/company_plan_detail_response_data.rb +1 -0
  72. data/lib/schematic/types/component_response_data.rb +1 -0
  73. data/lib/schematic/types/create_entitlement_in_bundle_request_body.rb +1 -0
  74. data/lib/schematic/types/credits_auto_topup_success.rb +12 -0
  75. data/lib/schematic/types/credits_credit_purchase_success.rb +14 -0
  76. data/lib/schematic/types/credits_webhook_company_summary.rb +10 -0
  77. data/lib/schematic/types/credits_webhook_credit_summary.rb +10 -0
  78. data/lib/schematic/types/customer_billing_address.rb +14 -0
  79. data/lib/schematic/types/data_export_metadata.rb +14 -0
  80. data/lib/schematic/types/data_export_output_file_type.rb +3 -14
  81. data/lib/schematic/types/data_export_response_data.rb +3 -3
  82. data/lib/schematic/types/data_export_type.rb +3 -14
  83. data/lib/schematic/types/feature_detail_response_data.rb +3 -0
  84. data/lib/schematic/types/feature_entitlement.rb +1 -0
  85. data/lib/schematic/types/feature_in_plan_response_data.rb +2 -0
  86. data/lib/schematic/types/feature_response_data.rb +2 -0
  87. data/lib/schematic/types/feature_type.rb +1 -0
  88. data/lib/schematic/types/feature_view.rb +2 -0
  89. data/lib/schematic/types/license_response_data.rb +12 -0
  90. data/lib/schematic/types/plan_catalog_membership_response_data.rb +10 -0
  91. data/lib/schematic/types/plan_detail_response_data.rb +1 -0
  92. data/lib/schematic/types/plan_group_plan_detail_response_data.rb +1 -0
  93. data/lib/schematic/types/plan_version_migration_preview_company_response_data.rb +14 -0
  94. data/lib/schematic/types/plan_version_migration_preview_response_data.rb +9 -0
  95. data/lib/schematic/types/plan_view_public_response_data.rb +1 -0
  96. data/lib/schematic/types/preview_subscription_discount_response_data.rb +19 -0
  97. data/lib/schematic/types/preview_subscription_finance_response_data.rb +2 -0
  98. data/lib/schematic/types/rulesengine_feature_entitlement.rb +1 -0
  99. data/lib/schematic/types/rulesengine_warning_tier.rb +10 -0
  100. data/lib/schematic/types/upsert_company_request_body.rb +2 -0
  101. data/lib/schematic/types/warning_tier.rb +10 -0
  102. data/lib/schematic/types/webhook_request_type.rb +2 -0
  103. data/lib/schematic/version.rb +1 -1
  104. data/lib/schematic/wasm/rulesengine.wasm +0 -0
  105. data/lib/schematic.rb +105 -39
  106. data/reference.md +1800 -301
  107. metadata +68 -2
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Schematic
4
+ module Catalogs
5
+ module Types
6
+ class UpdateCatalogResponse < Internal::Types::Model
7
+ field :data, -> { Schematic::Types::CatalogResponseData }, optional: false, nullable: false
8
+ field :params, -> { Internal::Types::Hash[String, Object] }, optional: false, nullable: false
9
+ end
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Schematic
4
+ module Catalogs
5
+ module Types
6
+ class UpdateConfigurationResponse < Internal::Types::Model
7
+ field :data, -> { Schematic::Types::CatalogResponseData }, optional: false, nullable: false
8
+ field :params, -> { Internal::Types::Hash[String, Object] }, optional: false, nullable: false
9
+ end
10
+ end
11
+ end
12
+ end
@@ -106,6 +106,75 @@ module Schematic
106
106
  end
107
107
  end
108
108
 
109
+ # @param request_options [Hash]
110
+ # @param params [Hash]
111
+ # @option request_options [String] :base_url
112
+ # @option request_options [Hash{String => Object}] :additional_headers
113
+ # @option request_options [Hash{String => Object}] :additional_query_parameters
114
+ # @option request_options [Hash{String => Object}] :additional_body_parameters
115
+ # @option request_options [Integer] :timeout_in_seconds
116
+ # @option params [String] :company_id
117
+ #
118
+ # @return [Schematic::Checkout::Types::GetCompanyBillingDetailsResponse]
119
+ def get_company_billing_details(request_options: {}, **params)
120
+ params = Schematic::Internal::Types::Utils.normalize_keys(params)
121
+ request = Schematic::Internal::JSON::Request.new(
122
+ base_url: request_options[:base_url],
123
+ method: "GET",
124
+ path: "companies/#{URI.encode_uri_component(params[:company_id].to_s)}/billing-details",
125
+ request_options: request_options
126
+ )
127
+ begin
128
+ response = @client.send(request)
129
+ rescue Net::HTTPRequestTimeout
130
+ raise Schematic::Errors::TimeoutError
131
+ end
132
+ code = response.code.to_i
133
+ if code.between?(200, 299)
134
+ Schematic::Checkout::Types::GetCompanyBillingDetailsResponse.load(response.body)
135
+ else
136
+ error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
137
+ raise error_class.new(response.body, code: code)
138
+ end
139
+ end
140
+
141
+ # @param request_options [Hash]
142
+ # @param params [Schematic::Checkout::Types::UpdateCompanyBillingDetailsRequestBody]
143
+ # @option request_options [String] :base_url
144
+ # @option request_options [Hash{String => Object}] :additional_headers
145
+ # @option request_options [Hash{String => Object}] :additional_query_parameters
146
+ # @option request_options [Hash{String => Object}] :additional_body_parameters
147
+ # @option request_options [Integer] :timeout_in_seconds
148
+ # @option params [String] :company_id
149
+ #
150
+ # @return [Schematic::Checkout::Types::UpdateCompanyBillingDetailsResponse]
151
+ def update_company_billing_details(request_options: {}, **params)
152
+ params = Schematic::Internal::Types::Utils.normalize_keys(params)
153
+ request_data = Schematic::Checkout::Types::UpdateCompanyBillingDetailsRequestBody.new(params).to_h
154
+ non_body_param_names = ["company_id"]
155
+ body = request_data.except(*non_body_param_names)
156
+
157
+ request = Schematic::Internal::JSON::Request.new(
158
+ base_url: request_options[:base_url],
159
+ method: "PUT",
160
+ path: "companies/#{URI.encode_uri_component(params[:company_id].to_s)}/billing-details",
161
+ body: body,
162
+ request_options: request_options
163
+ )
164
+ begin
165
+ response = @client.send(request)
166
+ rescue Net::HTTPRequestTimeout
167
+ raise Schematic::Errors::TimeoutError
168
+ end
169
+ code = response.code.to_i
170
+ if code.between?(200, 299)
171
+ Schematic::Checkout::Types::UpdateCompanyBillingDetailsResponse.load(response.body)
172
+ else
173
+ error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
174
+ raise error_class.new(response.body, code: code)
175
+ end
176
+ end
177
+
109
178
  # @param request_options [Hash]
110
179
  # @param params [Schematic::Types::ManagePlanRequest]
111
180
  # @option request_options [String] :base_url
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Schematic
4
+ module Checkout
5
+ module Types
6
+ class GetCompanyBillingDetailsResponse < Internal::Types::Model
7
+ field :data, -> { Schematic::Types::CompanyBillingDetailsResponseData }, optional: false, nullable: false
8
+ field :params, -> { Internal::Types::Hash[String, Object] }, optional: false, nullable: false
9
+ end
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Schematic
4
+ module Checkout
5
+ module Types
6
+ class UpdateCompanyBillingDetailsRequestBody < Internal::Types::Model
7
+ field :company_id, -> { String }, optional: false, nullable: false
8
+ field :address, -> { Schematic::Types::CustomerBillingAddress }, optional: true, nullable: false
9
+ field :email, -> { String }, optional: true, nullable: false
10
+ field :phone, -> { String }, optional: true, nullable: false
11
+ field :values, -> { Internal::Types::Array[Schematic::Types::CheckoutFieldValue] }, optional: false, nullable: false
12
+ end
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Schematic
4
+ module Checkout
5
+ module Types
6
+ class UpdateCompanyBillingDetailsResponse < Internal::Types::Model
7
+ field :data, -> { Schematic::Types::CompanyBillingDetailsResponseData }, optional: false, nullable: false
8
+ field :params, -> { Internal::Types::Hash[String, Object] }, optional: false, nullable: false
9
+ end
10
+ end
11
+ end
12
+ end
@@ -10,7 +10,7 @@ module Schematic
10
10
  @raw_client = Schematic::Internal::Http::RawClient.new(
11
11
  base_url: base_url || Schematic::Environment::DEFAULT,
12
12
  headers: {
13
- "User-Agent" => "schematichq/1.4.9",
13
+ "User-Agent" => "schematichq/1.4.11",
14
14
  "X-Fern-Language" => "Ruby",
15
15
  "X-Schematic-Api-Key" => api_key.to_s
16
16
  }
@@ -32,6 +32,11 @@ module Schematic
32
32
  @credits ||= Schematic::Credits::Client.new(client: @raw_client)
33
33
  end
34
34
 
35
+ # @return [Schematic::Catalogs::Client]
36
+ def catalogs
37
+ @catalogs ||= Schematic::Catalogs::Client.new(client: @raw_client)
38
+ end
39
+
35
40
  # @return [Schematic::Checkout::Client]
36
41
  def checkout
37
42
  @checkout ||= Schematic::Checkout::Client.new(client: @raw_client)
@@ -87,6 +92,11 @@ module Schematic
87
92
  @integrationsapi ||= Schematic::Integrationsapi::Client.new(client: @raw_client)
88
93
  end
89
94
 
95
+ # @return [Schematic::Licenses::Client]
96
+ def licenses
97
+ @licenses ||= Schematic::Licenses::Client.new(client: @raw_client)
98
+ end
99
+
90
100
  # @return [Schematic::Plangroups::Client]
91
101
  def plangroups
92
102
  @plangroups ||= Schematic::Plangroups::Client.new(client: @raw_client)
@@ -185,6 +185,43 @@ module Schematic
185
185
  end
186
186
  end
187
187
 
188
+ # @param request_options [Hash]
189
+ # @param params [Schematic::Components::Types::BindCatalogRequestBody]
190
+ # @option request_options [String] :base_url
191
+ # @option request_options [Hash{String => Object}] :additional_headers
192
+ # @option request_options [Hash{String => Object}] :additional_query_parameters
193
+ # @option request_options [Hash{String => Object}] :additional_body_parameters
194
+ # @option request_options [Integer] :timeout_in_seconds
195
+ # @option params [String] :component_id
196
+ #
197
+ # @return [Schematic::Components::Types::BindCatalogResponse]
198
+ def bind_catalog(request_options: {}, **params)
199
+ params = Schematic::Internal::Types::Utils.normalize_keys(params)
200
+ request_data = Schematic::Components::Types::BindCatalogRequestBody.new(params).to_h
201
+ non_body_param_names = ["component_id"]
202
+ body = request_data.except(*non_body_param_names)
203
+
204
+ request = Schematic::Internal::JSON::Request.new(
205
+ base_url: request_options[:base_url],
206
+ method: "PUT",
207
+ path: "components/#{URI.encode_uri_component(params[:component_id].to_s)}/catalog",
208
+ body: body,
209
+ request_options: request_options
210
+ )
211
+ begin
212
+ response = @client.send(request)
213
+ rescue Net::HTTPRequestTimeout
214
+ raise Schematic::Errors::TimeoutError
215
+ end
216
+ code = response.code.to_i
217
+ if code.between?(200, 299)
218
+ Schematic::Components::Types::BindCatalogResponse.load(response.body)
219
+ else
220
+ error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
221
+ raise error_class.new(response.body, code: code)
222
+ end
223
+ end
224
+
188
225
  # @param request_options [Hash]
189
226
  # @param params [Hash]
190
227
  # @option request_options [String] :base_url
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Schematic
4
+ module Components
5
+ module Types
6
+ class BindCatalogRequestBody < Internal::Types::Model
7
+ field :component_id, -> { String }, optional: false, nullable: false
8
+ field :catalog_id, -> { String }, optional: true, nullable: false
9
+ end
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Schematic
4
+ module Components
5
+ module Types
6
+ class BindCatalogResponse < Internal::Types::Model
7
+ field :data, -> { Schematic::Types::ComponentResponseData }, optional: false, nullable: false
8
+ field :params, -> { Internal::Types::Hash[String, Object] }, optional: false, nullable: false
9
+ end
10
+ end
11
+ end
12
+ end
@@ -10,6 +10,50 @@ module Schematic
10
10
  @client = client
11
11
  end
12
12
 
13
+ # @param request_options [Hash]
14
+ # @param params [Hash]
15
+ # @option request_options [String] :base_url
16
+ # @option request_options [Hash{String => Object}] :additional_headers
17
+ # @option request_options [Hash{String => Object}] :additional_query_parameters
18
+ # @option request_options [Hash{String => Object}] :additional_body_parameters
19
+ # @option request_options [Integer] :timeout_in_seconds
20
+ # @option params [Schematic::Types::DataExportType, nil] :export_type
21
+ # @option params [Schematic::Types::DataExportStatus, nil] :status
22
+ # @option params [Integer, nil] :limit
23
+ # @option params [Integer, nil] :offset
24
+ #
25
+ # @return [Schematic::Dataexports::Types::ListDataExportsResponse]
26
+ def list_data_exports(request_options: {}, **params)
27
+ params = Schematic::Internal::Types::Utils.normalize_keys(params)
28
+ query_param_names = %i[export_type status limit offset]
29
+ query_params = {}
30
+ query_params["export_type"] = params[:export_type] if params.key?(:export_type)
31
+ query_params["status"] = params[:status] if params.key?(:status)
32
+ query_params["limit"] = params[:limit] if params.key?(:limit)
33
+ query_params["offset"] = params[:offset] if params.key?(:offset)
34
+ params.except(*query_param_names)
35
+
36
+ request = Schematic::Internal::JSON::Request.new(
37
+ base_url: request_options[:base_url],
38
+ method: "GET",
39
+ path: "data-exports",
40
+ query: query_params,
41
+ request_options: request_options
42
+ )
43
+ begin
44
+ response = @client.send(request)
45
+ rescue Net::HTTPRequestTimeout
46
+ raise Schematic::Errors::TimeoutError
47
+ end
48
+ code = response.code.to_i
49
+ if code.between?(200, 299)
50
+ Schematic::Dataexports::Types::ListDataExportsResponse.load(response.body)
51
+ else
52
+ error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
53
+ raise error_class.new(response.body, code: code)
54
+ end
55
+ end
56
+
13
57
  # @param request_options [Hash]
14
58
  # @param params [Schematic::Dataexports::Types::CreateDataExportRequestBody]
15
59
  # @option request_options [String] :base_url
@@ -42,6 +86,38 @@ module Schematic
42
86
  end
43
87
  end
44
88
 
89
+ # @param request_options [Hash]
90
+ # @param params [Hash]
91
+ # @option request_options [String] :base_url
92
+ # @option request_options [Hash{String => Object}] :additional_headers
93
+ # @option request_options [Hash{String => Object}] :additional_query_parameters
94
+ # @option request_options [Hash{String => Object}] :additional_body_parameters
95
+ # @option request_options [Integer] :timeout_in_seconds
96
+ # @option params [String] :data_export_id
97
+ #
98
+ # @return [Schematic::Dataexports::Types::GetDataExportResponse]
99
+ def get_data_export(request_options: {}, **params)
100
+ params = Schematic::Internal::Types::Utils.normalize_keys(params)
101
+ request = Schematic::Internal::JSON::Request.new(
102
+ base_url: request_options[:base_url],
103
+ method: "GET",
104
+ path: "data-exports/#{URI.encode_uri_component(params[:data_export_id].to_s)}",
105
+ request_options: request_options
106
+ )
107
+ begin
108
+ response = @client.send(request)
109
+ rescue Net::HTTPRequestTimeout
110
+ raise Schematic::Errors::TimeoutError
111
+ end
112
+ code = response.code.to_i
113
+ if code.between?(200, 299)
114
+ Schematic::Dataexports::Types::GetDataExportResponse.load(response.body)
115
+ else
116
+ error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
117
+ raise error_class.new(response.body, code: code)
118
+ end
119
+ end
120
+
45
121
  # @param request_options [Hash]
46
122
  # @param params [Hash]
47
123
  # @option request_options [String] :base_url
@@ -4,9 +4,9 @@ module Schematic
4
4
  module Dataexports
5
5
  module Types
6
6
  class CreateDataExportRequestBody < Internal::Types::Model
7
- field :export_type, -> { String }, optional: false, nullable: false
8
- field :metadata, -> { String }, optional: false, nullable: false
9
- field :output_file_type, -> { String }, optional: false, nullable: false
7
+ field :export_type, -> { Schematic::Types::DataExportType }, optional: false, nullable: false
8
+ field :metadata, -> { Schematic::Types::DataExportMetadata }, optional: true, nullable: false
9
+ field :output_file_type, -> { Schematic::Types::DataExportOutputFileType }, optional: false, nullable: false
10
10
  end
11
11
  end
12
12
  end
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Schematic
4
+ module Dataexports
5
+ module Types
6
+ class GetDataExportResponse < Internal::Types::Model
7
+ field :data, -> { Schematic::Types::DataExportResponseData }, optional: false, nullable: false
8
+ field :params, -> { Internal::Types::Hash[String, Object] }, optional: false, nullable: false
9
+ end
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Schematic
4
+ module Dataexports
5
+ module Types
6
+ # Input parameters
7
+ class ListDataExportsParams < Internal::Types::Model
8
+ field :export_type, -> { Schematic::Types::DataExportType }, optional: true, nullable: false
9
+ field :limit, -> { Integer }, optional: true, nullable: false
10
+ field :offset, -> { Integer }, optional: true, nullable: false
11
+ field :status, -> { Schematic::Types::DataExportStatus }, optional: true, nullable: false
12
+ end
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Schematic
4
+ module Dataexports
5
+ module Types
6
+ class ListDataExportsRequest < Internal::Types::Model
7
+ field :export_type, -> { Schematic::Types::DataExportType }, optional: true, nullable: false
8
+ field :status, -> { Schematic::Types::DataExportStatus }, optional: true, nullable: false
9
+ field :limit, -> { Integer }, optional: true, nullable: false
10
+ field :offset, -> { Integer }, optional: true, nullable: false
11
+ end
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Schematic
4
+ module Dataexports
5
+ module Types
6
+ class ListDataExportsResponse < Internal::Types::Model
7
+ field :data, -> { Internal::Types::Array[Schematic::Types::DataExportResponseData] }, optional: false, nullable: false
8
+ field :params, -> { Schematic::Dataexports::Types::ListDataExportsParams }, optional: false, nullable: false
9
+ end
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,138 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Schematic
4
+ module Licenses
5
+ class Client
6
+ # @param client [Schematic::Internal::Http::RawClient]
7
+ #
8
+ # @return [void]
9
+ def initialize(client:)
10
+ @client = client
11
+ end
12
+
13
+ # @param request_options [Hash]
14
+ # @param params [Hash]
15
+ # @option request_options [String] :base_url
16
+ # @option request_options [Hash{String => Object}] :additional_headers
17
+ # @option request_options [Hash{String => Object}] :additional_query_parameters
18
+ # @option request_options [Hash{String => Object}] :additional_body_parameters
19
+ # @option request_options [Integer] :timeout_in_seconds
20
+ # @option params [String, nil] :feature_ids
21
+ # @option params [String, nil] :ids
22
+ # @option params [String, nil] :name
23
+ # @option params [Integer, nil] :limit
24
+ # @option params [Integer, nil] :offset
25
+ #
26
+ # @return [Schematic::Licenses::Types::ListLicensesResponse]
27
+ def list_licenses(request_options: {}, **params)
28
+ params = Schematic::Internal::Types::Utils.normalize_keys(params)
29
+ query_param_names = %i[feature_ids ids name limit offset]
30
+ query_params = {}
31
+ query_params["feature_ids"] = params[:feature_ids] if params.key?(:feature_ids)
32
+ query_params["ids"] = params[:ids] if params.key?(:ids)
33
+ query_params["name"] = params[:name] if params.key?(:name)
34
+ query_params["limit"] = params[:limit] if params.key?(:limit)
35
+ query_params["offset"] = params[:offset] if params.key?(:offset)
36
+ params.except(*query_param_names)
37
+
38
+ request = Schematic::Internal::JSON::Request.new(
39
+ base_url: request_options[:base_url],
40
+ method: "GET",
41
+ path: "licenses",
42
+ query: query_params,
43
+ request_options: request_options
44
+ )
45
+ begin
46
+ response = @client.send(request)
47
+ rescue Net::HTTPRequestTimeout
48
+ raise Schematic::Errors::TimeoutError
49
+ end
50
+ code = response.code.to_i
51
+ if code.between?(200, 299)
52
+ Schematic::Licenses::Types::ListLicensesResponse.load(response.body)
53
+ else
54
+ error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
55
+ raise error_class.new(response.body, code: code)
56
+ end
57
+ end
58
+
59
+ # @param request_options [Hash]
60
+ # @param params [Hash]
61
+ # @option request_options [String] :base_url
62
+ # @option request_options [Hash{String => Object}] :additional_headers
63
+ # @option request_options [Hash{String => Object}] :additional_query_parameters
64
+ # @option request_options [Hash{String => Object}] :additional_body_parameters
65
+ # @option request_options [Integer] :timeout_in_seconds
66
+ # @option params [String] :license_id
67
+ #
68
+ # @return [Schematic::Licenses::Types::GetSingleLicenseResponse]
69
+ def get_single_license(request_options: {}, **params)
70
+ params = Schematic::Internal::Types::Utils.normalize_keys(params)
71
+ request = Schematic::Internal::JSON::Request.new(
72
+ base_url: request_options[:base_url],
73
+ method: "GET",
74
+ path: "licenses/#{URI.encode_uri_component(params[:license_id].to_s)}",
75
+ request_options: request_options
76
+ )
77
+ begin
78
+ response = @client.send(request)
79
+ rescue Net::HTTPRequestTimeout
80
+ raise Schematic::Errors::TimeoutError
81
+ end
82
+ code = response.code.to_i
83
+ if code.between?(200, 299)
84
+ Schematic::Licenses::Types::GetSingleLicenseResponse.load(response.body)
85
+ else
86
+ error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
87
+ raise error_class.new(response.body, code: code)
88
+ end
89
+ end
90
+
91
+ # @param request_options [Hash]
92
+ # @param params [Hash]
93
+ # @option request_options [String] :base_url
94
+ # @option request_options [Hash{String => Object}] :additional_headers
95
+ # @option request_options [Hash{String => Object}] :additional_query_parameters
96
+ # @option request_options [Hash{String => Object}] :additional_body_parameters
97
+ # @option request_options [Integer] :timeout_in_seconds
98
+ # @option params [String, nil] :feature_ids
99
+ # @option params [String, nil] :ids
100
+ # @option params [String, nil] :name
101
+ # @option params [Integer, nil] :limit
102
+ # @option params [Integer, nil] :offset
103
+ #
104
+ # @return [Schematic::Licenses::Types::CountLicensesResponse]
105
+ def count_licenses(request_options: {}, **params)
106
+ params = Schematic::Internal::Types::Utils.normalize_keys(params)
107
+ query_param_names = %i[feature_ids ids name limit offset]
108
+ query_params = {}
109
+ query_params["feature_ids"] = params[:feature_ids] if params.key?(:feature_ids)
110
+ query_params["ids"] = params[:ids] if params.key?(:ids)
111
+ query_params["name"] = params[:name] if params.key?(:name)
112
+ query_params["limit"] = params[:limit] if params.key?(:limit)
113
+ query_params["offset"] = params[:offset] if params.key?(:offset)
114
+ params.except(*query_param_names)
115
+
116
+ request = Schematic::Internal::JSON::Request.new(
117
+ base_url: request_options[:base_url],
118
+ method: "GET",
119
+ path: "licenses/count",
120
+ query: query_params,
121
+ request_options: request_options
122
+ )
123
+ begin
124
+ response = @client.send(request)
125
+ rescue Net::HTTPRequestTimeout
126
+ raise Schematic::Errors::TimeoutError
127
+ end
128
+ code = response.code.to_i
129
+ if code.between?(200, 299)
130
+ Schematic::Licenses::Types::CountLicensesResponse.load(response.body)
131
+ else
132
+ error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
133
+ raise error_class.new(response.body, code: code)
134
+ end
135
+ end
136
+ end
137
+ end
138
+ end
@@ -0,0 +1,16 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Schematic
4
+ module Licenses
5
+ module Types
6
+ # Input parameters
7
+ class CountLicensesParams < Internal::Types::Model
8
+ field :feature_ids, -> { Internal::Types::Array[String] }, optional: true, nullable: false
9
+ field :ids, -> { Internal::Types::Array[String] }, optional: true, nullable: false
10
+ field :limit, -> { Integer }, optional: true, nullable: false
11
+ field :name, -> { String }, optional: true, nullable: false
12
+ field :offset, -> { Integer }, optional: true, nullable: false
13
+ end
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Schematic
4
+ module Licenses
5
+ module Types
6
+ class CountLicensesRequest < Internal::Types::Model
7
+ field :feature_ids, -> { String }, optional: true, nullable: false
8
+ field :ids, -> { String }, optional: true, nullable: false
9
+ field :name, -> { String }, optional: true, nullable: false
10
+ field :limit, -> { Integer }, optional: true, nullable: false
11
+ field :offset, -> { Integer }, optional: true, nullable: false
12
+ end
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Schematic
4
+ module Licenses
5
+ module Types
6
+ class CountLicensesResponse < Internal::Types::Model
7
+ field :data, -> { Schematic::Types::CountResponse }, optional: false, nullable: false
8
+ field :params, -> { Schematic::Licenses::Types::CountLicensesParams }, optional: false, nullable: false
9
+ end
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Schematic
4
+ module Licenses
5
+ module Types
6
+ class GetSingleLicenseResponse < Internal::Types::Model
7
+ field :data, -> { Schematic::Types::LicenseResponseData }, optional: false, nullable: false
8
+ field :params, -> { Internal::Types::Hash[String, Object] }, optional: false, nullable: false
9
+ end
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,16 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Schematic
4
+ module Licenses
5
+ module Types
6
+ # Input parameters
7
+ class ListLicensesParams < Internal::Types::Model
8
+ field :feature_ids, -> { Internal::Types::Array[String] }, optional: true, nullable: false
9
+ field :ids, -> { Internal::Types::Array[String] }, optional: true, nullable: false
10
+ field :limit, -> { Integer }, optional: true, nullable: false
11
+ field :name, -> { String }, optional: true, nullable: false
12
+ field :offset, -> { Integer }, optional: true, nullable: false
13
+ end
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Schematic
4
+ module Licenses
5
+ module Types
6
+ class ListLicensesRequest < Internal::Types::Model
7
+ field :feature_ids, -> { String }, optional: true, nullable: false
8
+ field :ids, -> { String }, optional: true, nullable: false
9
+ field :name, -> { String }, optional: true, nullable: false
10
+ field :limit, -> { Integer }, optional: true, nullable: false
11
+ field :offset, -> { Integer }, optional: true, nullable: false
12
+ end
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Schematic
4
+ module Licenses
5
+ module Types
6
+ class ListLicensesResponse < Internal::Types::Model
7
+ field :data, -> { Internal::Types::Array[Schematic::Types::LicenseResponseData] }, optional: false, nullable: false
8
+ field :params, -> { Schematic::Licenses::Types::ListLicensesParams }, optional: false, nullable: false
9
+ end
10
+ end
11
+ end
12
+ end