test_sdk 0.0.4

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 (95) hide show
  1. checksums.yaml +7 -0
  2. data/lib/core/file_utilities.rb +26 -0
  3. data/lib/environment.rb +7 -0
  4. data/lib/gemconfig.rb +14 -0
  5. data/lib/requests.rb +166 -0
  6. data/lib/test_sdk/benchmark/client.rb +1031 -0
  7. data/lib/test_sdk/company/client.rb +474 -0
  8. data/lib/test_sdk/deal/client.rb +584 -0
  9. data/lib/test_sdk/file/client.rb +692 -0
  10. data/lib/test_sdk/financials/client.rb +97 -0
  11. data/lib/test_sdk/group/client.rb +737 -0
  12. data/lib/test_sdk/macro/client.rb +422 -0
  13. data/lib/test_sdk/metadata/client.rb +95 -0
  14. data/lib/test_sdk/product/client.rb +419 -0
  15. data/lib/test_sdk/talent/client.rb +266 -0
  16. data/lib/test_sdk/types/account_manager_response.rb +74 -0
  17. data/lib/test_sdk/types/all_data_metadata_response.rb +68 -0
  18. data/lib/test_sdk/types/area.rb +74 -0
  19. data/lib/test_sdk/types/authenticate_api_key_response.rb +55 -0
  20. data/lib/test_sdk/types/available_categories_response.rb +5 -0
  21. data/lib/test_sdk/types/available_models_response.rb +69 -0
  22. data/lib/test_sdk/types/band_response.rb +83 -0
  23. data/lib/test_sdk/types/benchmark_quantile.rb +465 -0
  24. data/lib/test_sdk/types/categories_metadata_response.rb +72 -0
  25. data/lib/test_sdk/types/category_growth_rates.rb +143 -0
  26. data/lib/test_sdk/types/category_metadata.rb +79 -0
  27. data/lib/test_sdk/types/category_metadata_default_user_type.rb +8 -0
  28. data/lib/test_sdk/types/cohorts_response.rb +132 -0
  29. data/lib/test_sdk/types/column_metadata.rb +110 -0
  30. data/lib/test_sdk/types/column_mini_metadata.rb +83 -0
  31. data/lib/test_sdk/types/columns_metadata_response.rb +72 -0
  32. data/lib/test_sdk/types/company_response.rb +120 -0
  33. data/lib/test_sdk/types/concentration_endpoint_cdf_detail.rb +96 -0
  34. data/lib/test_sdk/types/concentration_endpoint_top_users_detail.rb +72 -0
  35. data/lib/test_sdk/types/concentration_response.rb +103 -0
  36. data/lib/test_sdk/types/concentration_timeseries_detail.rb +159 -0
  37. data/lib/test_sdk/types/contribution_response.rb +135 -0
  38. data/lib/test_sdk/types/create_api_key_response.rb +55 -0
  39. data/lib/test_sdk/types/create_file_for_signed_url_response.rb +127 -0
  40. data/lib/test_sdk/types/create_file_response.rb +113 -0
  41. data/lib/test_sdk/types/deal_combined_metrics_response.rb +477 -0
  42. data/lib/test_sdk/types/deal_data_availablity_response.rb +109 -0
  43. data/lib/test_sdk/types/deal_with_files_response.rb +194 -0
  44. data/lib/test_sdk/types/endpoint_seniority_count.rb +66 -0
  45. data/lib/test_sdk/types/executive_profile.rb +91 -0
  46. data/lib/test_sdk/types/executive_profile_position.rb +97 -0
  47. data/lib/test_sdk/types/file_response.rb +113 -0
  48. data/lib/test_sdk/types/file_type.rb +14 -0
  49. data/lib/test_sdk/types/financial_metrics.rb +113 -0
  50. data/lib/test_sdk/types/financials_response.rb +102 -0
  51. data/lib/test_sdk/types/frequency.rb +9 -0
  52. data/lib/test_sdk/types/function_level_growth_accounting.rb +111 -0
  53. data/lib/test_sdk/types/gcs_signed_url_response.rb +81 -0
  54. data/lib/test_sdk/types/group_response.rb +158 -0
  55. data/lib/test_sdk/types/group_user.rb +124 -0
  56. data/lib/test_sdk/types/group_with_users_response.rb +170 -0
  57. data/lib/test_sdk/types/growth_accounting_response.rb +226 -0
  58. data/lib/test_sdk/types/healthz_response.rb +55 -0
  59. data/lib/test_sdk/types/http_validation_error.rb +61 -0
  60. data/lib/test_sdk/types/income_statement_entry.rb +81 -0
  61. data/lib/test_sdk/types/model_metadata.rb +76 -0
  62. data/lib/test_sdk/types/models_metadata_response.rb +76 -0
  63. data/lib/test_sdk/types/paginated_response_company_response.rb +83 -0
  64. data/lib/test_sdk/types/paginated_response_deal_with_files_response.rb +84 -0
  65. data/lib/test_sdk/types/paginated_response_file_response.rb +83 -0
  66. data/lib/test_sdk/types/paginated_response_group_user.rb +83 -0
  67. data/lib/test_sdk/types/permission_model.rb +65 -0
  68. data/lib/test_sdk/types/priority.rb +10 -0
  69. data/lib/test_sdk/types/product_info_response.rb +65 -0
  70. data/lib/test_sdk/types/role_response.rb +95 -0
  71. data/lib/test_sdk/types/scale.rb +72 -0
  72. data/lib/test_sdk/types/scale_model.rb +80 -0
  73. data/lib/test_sdk/types/scale_models_response.rb +5 -0
  74. data/lib/test_sdk/types/scaling.rb +10 -0
  75. data/lib/test_sdk/types/status.rb +12 -0
  76. data/lib/test_sdk/types/tradeoff_model.rb +95 -0
  77. data/lib/test_sdk/types/tradeoff_models_response.rb +5 -0
  78. data/lib/test_sdk/types/unit.rb +12 -0
  79. data/lib/test_sdk/types/unit_economics_info_response.rb +55 -0
  80. data/lib/test_sdk/types/user_accounting_response.rb +168 -0
  81. data/lib/test_sdk/types/user_role_response.rb +77 -0
  82. data/lib/test_sdk/types/user_type.rb +12 -0
  83. data/lib/test_sdk/types/user_with_groups_response.rb +140 -0
  84. data/lib/test_sdk/types/user_with_permissions_response.rb +153 -0
  85. data/lib/test_sdk/types/validation_error.rb +76 -0
  86. data/lib/test_sdk/types/validation_error_loc_item.rb +52 -0
  87. data/lib/test_sdk/types/weather_components.rb +123 -0
  88. data/lib/test_sdk/types/weather_gauge.rb +76 -0
  89. data/lib/test_sdk/types/weather_market_context.rb +109 -0
  90. data/lib/test_sdk/types/weather_metadata.rb +113 -0
  91. data/lib/test_sdk/unit_economics/client.rb +124 -0
  92. data/lib/test_sdk/user/client.rb +363 -0
  93. data/lib/test_sdk.rb +190 -0
  94. data/lib/types_export.rb +77 -0
  95. metadata +251 -0
@@ -0,0 +1,81 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "ostruct"
4
+ require "json"
5
+
6
+ module NewDemoApiClient
7
+ class IncomeStatementEntry
8
+ # @return [String] The date of the entry.
9
+ attr_reader :date
10
+ # @return [String] The category of the entry.
11
+ attr_reader :category
12
+ # @return [String] The original field name of the entry.
13
+ attr_reader :field
14
+ # @return [Float] The value of the entry.
15
+ attr_reader :value
16
+ # @return [OpenStruct] Additional properties unmapped to the current class definition
17
+ attr_reader :additional_properties
18
+ # @return [Object]
19
+ attr_reader :_field_set
20
+ protected :_field_set
21
+
22
+ OMIT = Object.new
23
+
24
+ # @param date [String] The date of the entry.
25
+ # @param category [String] The category of the entry.
26
+ # @param field [String] The original field name of the entry.
27
+ # @param value [Float] The value of the entry.
28
+ # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
29
+ # @return [NewDemoApiClient::IncomeStatementEntry]
30
+ def initialize(date:, category:, field:, value: OMIT, additional_properties: nil)
31
+ @date = date
32
+ @category = category
33
+ @field = field
34
+ @value = value if value != OMIT
35
+ @additional_properties = additional_properties
36
+ @_field_set = { "date": date, "category": category, "field": field, "value": value }.reject do |_k, v|
37
+ v == OMIT
38
+ end
39
+ end
40
+
41
+ # Deserialize a JSON object to an instance of IncomeStatementEntry
42
+ #
43
+ # @param json_object [String]
44
+ # @return [NewDemoApiClient::IncomeStatementEntry]
45
+ def self.from_json(json_object:)
46
+ struct = JSON.parse(json_object, object_class: OpenStruct)
47
+ parsed_json = JSON.parse(json_object)
48
+ date = parsed_json["date"]
49
+ category = parsed_json["category"]
50
+ field = parsed_json["field"]
51
+ value = parsed_json["value"]
52
+ new(
53
+ date: date,
54
+ category: category,
55
+ field: field,
56
+ value: value,
57
+ additional_properties: struct
58
+ )
59
+ end
60
+
61
+ # Serialize an instance of IncomeStatementEntry to a JSON object
62
+ #
63
+ # @return [String]
64
+ def to_json(*_args)
65
+ @_field_set&.to_json
66
+ end
67
+
68
+ # Leveraged for Union-type generation, validate_raw attempts to parse the given
69
+ # hash and check each fields type against the current object's property
70
+ # definitions.
71
+ #
72
+ # @param obj [Object]
73
+ # @return [Void]
74
+ def self.validate_raw(obj:)
75
+ obj.date.is_a?(String) != false || raise("Passed value for field obj.date is not the expected type, validation failed.")
76
+ obj.category.is_a?(String) != false || raise("Passed value for field obj.category is not the expected type, validation failed.")
77
+ obj.field.is_a?(String) != false || raise("Passed value for field obj.field is not the expected type, validation failed.")
78
+ obj.value&.is_a?(Float) != false || raise("Passed value for field obj.value is not the expected type, validation failed.")
79
+ end
80
+ end
81
+ end
@@ -0,0 +1,76 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "column_mini_metadata"
4
+ require "ostruct"
5
+ require "json"
6
+
7
+ module NewDemoApiClient
8
+ class ModelMetadata
9
+ # @return [String] The name of the model.
10
+ attr_reader :name
11
+ # @return [String] A plain-english description of the model and what it represents.
12
+ attr_reader :description
13
+ # @return [Array<NewDemoApiClient::ColumnMiniMetadata>] The columns used in the model.
14
+ attr_reader :columns
15
+ # @return [OpenStruct] Additional properties unmapped to the current class definition
16
+ attr_reader :additional_properties
17
+ # @return [Object]
18
+ attr_reader :_field_set
19
+ protected :_field_set
20
+
21
+ OMIT = Object.new
22
+
23
+ # @param name [String] The name of the model.
24
+ # @param description [String] A plain-english description of the model and what it represents.
25
+ # @param columns [Array<NewDemoApiClient::ColumnMiniMetadata>] The columns used in the model.
26
+ # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
27
+ # @return [NewDemoApiClient::ModelMetadata]
28
+ def initialize(name:, description:, columns:, additional_properties: nil)
29
+ @name = name
30
+ @description = description
31
+ @columns = columns
32
+ @additional_properties = additional_properties
33
+ @_field_set = { "name": name, "description": description, "columns": columns }
34
+ end
35
+
36
+ # Deserialize a JSON object to an instance of ModelMetadata
37
+ #
38
+ # @param json_object [String]
39
+ # @return [NewDemoApiClient::ModelMetadata]
40
+ def self.from_json(json_object:)
41
+ struct = JSON.parse(json_object, object_class: OpenStruct)
42
+ parsed_json = JSON.parse(json_object)
43
+ name = parsed_json["name"]
44
+ description = parsed_json["description"]
45
+ columns = parsed_json["columns"]&.map do |item|
46
+ item = item.to_json
47
+ NewDemoApiClient::ColumnMiniMetadata.from_json(json_object: item)
48
+ end
49
+ new(
50
+ name: name,
51
+ description: description,
52
+ columns: columns,
53
+ additional_properties: struct
54
+ )
55
+ end
56
+
57
+ # Serialize an instance of ModelMetadata to a JSON object
58
+ #
59
+ # @return [String]
60
+ def to_json(*_args)
61
+ @_field_set&.to_json
62
+ end
63
+
64
+ # Leveraged for Union-type generation, validate_raw attempts to parse the given
65
+ # hash and check each fields type against the current object's property
66
+ # definitions.
67
+ #
68
+ # @param obj [Object]
69
+ # @return [Void]
70
+ def self.validate_raw(obj:)
71
+ obj.name.is_a?(String) != false || raise("Passed value for field obj.name is not the expected type, validation failed.")
72
+ obj.description.is_a?(String) != false || raise("Passed value for field obj.description is not the expected type, validation failed.")
73
+ obj.columns.is_a?(Array) != false || raise("Passed value for field obj.columns is not the expected type, validation failed.")
74
+ end
75
+ end
76
+ end
@@ -0,0 +1,76 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "model_metadata"
4
+ require "ostruct"
5
+ require "json"
6
+
7
+ module NewDemoApiClient
8
+ class ModelsMetadataResponse
9
+ # @return [String] The name of the **class** of models.
10
+ attr_reader :name
11
+ # @return [String] A plain-english description of the class of models and what they represent.
12
+ attr_reader :model_description
13
+ # @return [Array<NewDemoApiClient::ModelMetadata>] A list of implementations and variants of this class of models.
14
+ attr_reader :available_models
15
+ # @return [OpenStruct] Additional properties unmapped to the current class definition
16
+ attr_reader :additional_properties
17
+ # @return [Object]
18
+ attr_reader :_field_set
19
+ protected :_field_set
20
+
21
+ OMIT = Object.new
22
+
23
+ # @param name [String] The name of the **class** of models.
24
+ # @param model_description [String] A plain-english description of the class of models and what they represent.
25
+ # @param available_models [Array<NewDemoApiClient::ModelMetadata>] A list of implementations and variants of this class of models.
26
+ # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
27
+ # @return [NewDemoApiClient::ModelsMetadataResponse]
28
+ def initialize(name:, model_description:, available_models:, additional_properties: nil)
29
+ @name = name
30
+ @model_description = model_description
31
+ @available_models = available_models
32
+ @additional_properties = additional_properties
33
+ @_field_set = { "name": name, "model_description": model_description, "available_models": available_models }
34
+ end
35
+
36
+ # Deserialize a JSON object to an instance of ModelsMetadataResponse
37
+ #
38
+ # @param json_object [String]
39
+ # @return [NewDemoApiClient::ModelsMetadataResponse]
40
+ def self.from_json(json_object:)
41
+ struct = JSON.parse(json_object, object_class: OpenStruct)
42
+ parsed_json = JSON.parse(json_object)
43
+ name = parsed_json["name"]
44
+ model_description = parsed_json["model_description"]
45
+ available_models = parsed_json["available_models"]&.map do |item|
46
+ item = item.to_json
47
+ NewDemoApiClient::ModelMetadata.from_json(json_object: item)
48
+ end
49
+ new(
50
+ name: name,
51
+ model_description: model_description,
52
+ available_models: available_models,
53
+ additional_properties: struct
54
+ )
55
+ end
56
+
57
+ # Serialize an instance of ModelsMetadataResponse to a JSON object
58
+ #
59
+ # @return [String]
60
+ def to_json(*_args)
61
+ @_field_set&.to_json
62
+ end
63
+
64
+ # Leveraged for Union-type generation, validate_raw attempts to parse the given
65
+ # hash and check each fields type against the current object's property
66
+ # definitions.
67
+ #
68
+ # @param obj [Object]
69
+ # @return [Void]
70
+ def self.validate_raw(obj:)
71
+ obj.name.is_a?(String) != false || raise("Passed value for field obj.name is not the expected type, validation failed.")
72
+ obj.model_description.is_a?(String) != false || raise("Passed value for field obj.model_description is not the expected type, validation failed.")
73
+ obj.available_models.is_a?(Array) != false || raise("Passed value for field obj.available_models is not the expected type, validation failed.")
74
+ end
75
+ end
76
+ end
@@ -0,0 +1,83 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "company_response"
4
+ require "ostruct"
5
+ require "json"
6
+
7
+ module NewDemoApiClient
8
+ class PaginatedResponseCompanyResponse
9
+ # @return [Integer]
10
+ attr_reader :total_count
11
+ # @return [Integer]
12
+ attr_reader :page
13
+ # @return [Integer]
14
+ attr_reader :page_size
15
+ # @return [Array<NewDemoApiClient::CompanyResponse>]
16
+ attr_reader :data
17
+ # @return [OpenStruct] Additional properties unmapped to the current class definition
18
+ attr_reader :additional_properties
19
+ # @return [Object]
20
+ attr_reader :_field_set
21
+ protected :_field_set
22
+
23
+ OMIT = Object.new
24
+
25
+ # @param total_count [Integer]
26
+ # @param page [Integer]
27
+ # @param page_size [Integer]
28
+ # @param data [Array<NewDemoApiClient::CompanyResponse>]
29
+ # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
30
+ # @return [NewDemoApiClient::PaginatedResponseCompanyResponse]
31
+ def initialize(total_count:, page:, page_size:, data:, additional_properties: nil)
32
+ @total_count = total_count
33
+ @page = page
34
+ @page_size = page_size
35
+ @data = data
36
+ @additional_properties = additional_properties
37
+ @_field_set = { "total_count": total_count, "page": page, "page_size": page_size, "data": data }
38
+ end
39
+
40
+ # Deserialize a JSON object to an instance of PaginatedResponseCompanyResponse
41
+ #
42
+ # @param json_object [String]
43
+ # @return [NewDemoApiClient::PaginatedResponseCompanyResponse]
44
+ def self.from_json(json_object:)
45
+ struct = JSON.parse(json_object, object_class: OpenStruct)
46
+ parsed_json = JSON.parse(json_object)
47
+ total_count = parsed_json["total_count"]
48
+ page = parsed_json["page"]
49
+ page_size = parsed_json["page_size"]
50
+ data = parsed_json["data"]&.map do |item|
51
+ item = item.to_json
52
+ NewDemoApiClient::CompanyResponse.from_json(json_object: item)
53
+ end
54
+ new(
55
+ total_count: total_count,
56
+ page: page,
57
+ page_size: page_size,
58
+ data: data,
59
+ additional_properties: struct
60
+ )
61
+ end
62
+
63
+ # Serialize an instance of PaginatedResponseCompanyResponse to a JSON object
64
+ #
65
+ # @return [String]
66
+ def to_json(*_args)
67
+ @_field_set&.to_json
68
+ end
69
+
70
+ # Leveraged for Union-type generation, validate_raw attempts to parse the given
71
+ # hash and check each fields type against the current object's property
72
+ # definitions.
73
+ #
74
+ # @param obj [Object]
75
+ # @return [Void]
76
+ def self.validate_raw(obj:)
77
+ obj.total_count.is_a?(Integer) != false || raise("Passed value for field obj.total_count is not the expected type, validation failed.")
78
+ obj.page.is_a?(Integer) != false || raise("Passed value for field obj.page is not the expected type, validation failed.")
79
+ obj.page_size.is_a?(Integer) != false || raise("Passed value for field obj.page_size is not the expected type, validation failed.")
80
+ obj.data.is_a?(Array) != false || raise("Passed value for field obj.data is not the expected type, validation failed.")
81
+ end
82
+ end
83
+ end
@@ -0,0 +1,84 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "deal_with_files_response"
4
+ require "ostruct"
5
+ require "json"
6
+
7
+ module NewDemoApiClient
8
+ class PaginatedResponseDealWithFilesResponse
9
+ # @return [Integer]
10
+ attr_reader :total_count
11
+ # @return [Integer]
12
+ attr_reader :page
13
+ # @return [Integer]
14
+ attr_reader :page_size
15
+ # @return [Array<NewDemoApiClient::DealWithFilesResponse>]
16
+ attr_reader :data
17
+ # @return [OpenStruct] Additional properties unmapped to the current class definition
18
+ attr_reader :additional_properties
19
+ # @return [Object]
20
+ attr_reader :_field_set
21
+ protected :_field_set
22
+
23
+ OMIT = Object.new
24
+
25
+ # @param total_count [Integer]
26
+ # @param page [Integer]
27
+ # @param page_size [Integer]
28
+ # @param data [Array<NewDemoApiClient::DealWithFilesResponse>]
29
+ # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
30
+ # @return [NewDemoApiClient::PaginatedResponseDealWithFilesResponse]
31
+ def initialize(total_count:, page:, page_size:, data:, additional_properties: nil)
32
+ @total_count = total_count
33
+ @page = page
34
+ @page_size = page_size
35
+ @data = data
36
+ @additional_properties = additional_properties
37
+ @_field_set = { "total_count": total_count, "page": page, "page_size": page_size, "data": data }
38
+ end
39
+
40
+ # Deserialize a JSON object to an instance of
41
+ # PaginatedResponseDealWithFilesResponse
42
+ #
43
+ # @param json_object [String]
44
+ # @return [NewDemoApiClient::PaginatedResponseDealWithFilesResponse]
45
+ def self.from_json(json_object:)
46
+ struct = JSON.parse(json_object, object_class: OpenStruct)
47
+ parsed_json = JSON.parse(json_object)
48
+ total_count = parsed_json["total_count"]
49
+ page = parsed_json["page"]
50
+ page_size = parsed_json["page_size"]
51
+ data = parsed_json["data"]&.map do |item|
52
+ item = item.to_json
53
+ NewDemoApiClient::DealWithFilesResponse.from_json(json_object: item)
54
+ end
55
+ new(
56
+ total_count: total_count,
57
+ page: page,
58
+ page_size: page_size,
59
+ data: data,
60
+ additional_properties: struct
61
+ )
62
+ end
63
+
64
+ # Serialize an instance of PaginatedResponseDealWithFilesResponse to a JSON object
65
+ #
66
+ # @return [String]
67
+ def to_json(*_args)
68
+ @_field_set&.to_json
69
+ end
70
+
71
+ # Leveraged for Union-type generation, validate_raw attempts to parse the given
72
+ # hash and check each fields type against the current object's property
73
+ # definitions.
74
+ #
75
+ # @param obj [Object]
76
+ # @return [Void]
77
+ def self.validate_raw(obj:)
78
+ obj.total_count.is_a?(Integer) != false || raise("Passed value for field obj.total_count is not the expected type, validation failed.")
79
+ obj.page.is_a?(Integer) != false || raise("Passed value for field obj.page is not the expected type, validation failed.")
80
+ obj.page_size.is_a?(Integer) != false || raise("Passed value for field obj.page_size is not the expected type, validation failed.")
81
+ obj.data.is_a?(Array) != false || raise("Passed value for field obj.data is not the expected type, validation failed.")
82
+ end
83
+ end
84
+ end
@@ -0,0 +1,83 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "file_response"
4
+ require "ostruct"
5
+ require "json"
6
+
7
+ module NewDemoApiClient
8
+ class PaginatedResponseFileResponse
9
+ # @return [Integer]
10
+ attr_reader :total_count
11
+ # @return [Integer]
12
+ attr_reader :page
13
+ # @return [Integer]
14
+ attr_reader :page_size
15
+ # @return [Array<NewDemoApiClient::FileResponse>]
16
+ attr_reader :data
17
+ # @return [OpenStruct] Additional properties unmapped to the current class definition
18
+ attr_reader :additional_properties
19
+ # @return [Object]
20
+ attr_reader :_field_set
21
+ protected :_field_set
22
+
23
+ OMIT = Object.new
24
+
25
+ # @param total_count [Integer]
26
+ # @param page [Integer]
27
+ # @param page_size [Integer]
28
+ # @param data [Array<NewDemoApiClient::FileResponse>]
29
+ # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
30
+ # @return [NewDemoApiClient::PaginatedResponseFileResponse]
31
+ def initialize(total_count:, page:, page_size:, data:, additional_properties: nil)
32
+ @total_count = total_count
33
+ @page = page
34
+ @page_size = page_size
35
+ @data = data
36
+ @additional_properties = additional_properties
37
+ @_field_set = { "total_count": total_count, "page": page, "page_size": page_size, "data": data }
38
+ end
39
+
40
+ # Deserialize a JSON object to an instance of PaginatedResponseFileResponse
41
+ #
42
+ # @param json_object [String]
43
+ # @return [NewDemoApiClient::PaginatedResponseFileResponse]
44
+ def self.from_json(json_object:)
45
+ struct = JSON.parse(json_object, object_class: OpenStruct)
46
+ parsed_json = JSON.parse(json_object)
47
+ total_count = parsed_json["total_count"]
48
+ page = parsed_json["page"]
49
+ page_size = parsed_json["page_size"]
50
+ data = parsed_json["data"]&.map do |item|
51
+ item = item.to_json
52
+ NewDemoApiClient::FileResponse.from_json(json_object: item)
53
+ end
54
+ new(
55
+ total_count: total_count,
56
+ page: page,
57
+ page_size: page_size,
58
+ data: data,
59
+ additional_properties: struct
60
+ )
61
+ end
62
+
63
+ # Serialize an instance of PaginatedResponseFileResponse to a JSON object
64
+ #
65
+ # @return [String]
66
+ def to_json(*_args)
67
+ @_field_set&.to_json
68
+ end
69
+
70
+ # Leveraged for Union-type generation, validate_raw attempts to parse the given
71
+ # hash and check each fields type against the current object's property
72
+ # definitions.
73
+ #
74
+ # @param obj [Object]
75
+ # @return [Void]
76
+ def self.validate_raw(obj:)
77
+ obj.total_count.is_a?(Integer) != false || raise("Passed value for field obj.total_count is not the expected type, validation failed.")
78
+ obj.page.is_a?(Integer) != false || raise("Passed value for field obj.page is not the expected type, validation failed.")
79
+ obj.page_size.is_a?(Integer) != false || raise("Passed value for field obj.page_size is not the expected type, validation failed.")
80
+ obj.data.is_a?(Array) != false || raise("Passed value for field obj.data is not the expected type, validation failed.")
81
+ end
82
+ end
83
+ end
@@ -0,0 +1,83 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "group_user"
4
+ require "ostruct"
5
+ require "json"
6
+
7
+ module NewDemoApiClient
8
+ class PaginatedResponseGroupUser
9
+ # @return [Integer]
10
+ attr_reader :total_count
11
+ # @return [Integer]
12
+ attr_reader :page
13
+ # @return [Integer]
14
+ attr_reader :page_size
15
+ # @return [Array<NewDemoApiClient::GroupUser>]
16
+ attr_reader :data
17
+ # @return [OpenStruct] Additional properties unmapped to the current class definition
18
+ attr_reader :additional_properties
19
+ # @return [Object]
20
+ attr_reader :_field_set
21
+ protected :_field_set
22
+
23
+ OMIT = Object.new
24
+
25
+ # @param total_count [Integer]
26
+ # @param page [Integer]
27
+ # @param page_size [Integer]
28
+ # @param data [Array<NewDemoApiClient::GroupUser>]
29
+ # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
30
+ # @return [NewDemoApiClient::PaginatedResponseGroupUser]
31
+ def initialize(total_count:, page:, page_size:, data:, additional_properties: nil)
32
+ @total_count = total_count
33
+ @page = page
34
+ @page_size = page_size
35
+ @data = data
36
+ @additional_properties = additional_properties
37
+ @_field_set = { "total_count": total_count, "page": page, "page_size": page_size, "data": data }
38
+ end
39
+
40
+ # Deserialize a JSON object to an instance of PaginatedResponseGroupUser
41
+ #
42
+ # @param json_object [String]
43
+ # @return [NewDemoApiClient::PaginatedResponseGroupUser]
44
+ def self.from_json(json_object:)
45
+ struct = JSON.parse(json_object, object_class: OpenStruct)
46
+ parsed_json = JSON.parse(json_object)
47
+ total_count = parsed_json["total_count"]
48
+ page = parsed_json["page"]
49
+ page_size = parsed_json["page_size"]
50
+ data = parsed_json["data"]&.map do |item|
51
+ item = item.to_json
52
+ NewDemoApiClient::GroupUser.from_json(json_object: item)
53
+ end
54
+ new(
55
+ total_count: total_count,
56
+ page: page,
57
+ page_size: page_size,
58
+ data: data,
59
+ additional_properties: struct
60
+ )
61
+ end
62
+
63
+ # Serialize an instance of PaginatedResponseGroupUser to a JSON object
64
+ #
65
+ # @return [String]
66
+ def to_json(*_args)
67
+ @_field_set&.to_json
68
+ end
69
+
70
+ # Leveraged for Union-type generation, validate_raw attempts to parse the given
71
+ # hash and check each fields type against the current object's property
72
+ # definitions.
73
+ #
74
+ # @param obj [Object]
75
+ # @return [Void]
76
+ def self.validate_raw(obj:)
77
+ obj.total_count.is_a?(Integer) != false || raise("Passed value for field obj.total_count is not the expected type, validation failed.")
78
+ obj.page.is_a?(Integer) != false || raise("Passed value for field obj.page is not the expected type, validation failed.")
79
+ obj.page_size.is_a?(Integer) != false || raise("Passed value for field obj.page_size is not the expected type, validation failed.")
80
+ obj.data.is_a?(Array) != false || raise("Passed value for field obj.data is not the expected type, validation failed.")
81
+ end
82
+ end
83
+ end
@@ -0,0 +1,65 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "ostruct"
4
+ require "json"
5
+
6
+ module NewDemoApiClient
7
+ class PermissionModel
8
+ # @return [String] The resource the permission is for
9
+ attr_reader :resource
10
+ # @return [String] The action the permission allows
11
+ attr_reader :action
12
+ # @return [OpenStruct] Additional properties unmapped to the current class definition
13
+ attr_reader :additional_properties
14
+ # @return [Object]
15
+ attr_reader :_field_set
16
+ protected :_field_set
17
+
18
+ OMIT = Object.new
19
+
20
+ # @param resource [String] The resource the permission is for
21
+ # @param action [String] The action the permission allows
22
+ # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
23
+ # @return [NewDemoApiClient::PermissionModel]
24
+ def initialize(resource:, action:, additional_properties: nil)
25
+ @resource = resource
26
+ @action = action
27
+ @additional_properties = additional_properties
28
+ @_field_set = { "resource": resource, "action": action }
29
+ end
30
+
31
+ # Deserialize a JSON object to an instance of PermissionModel
32
+ #
33
+ # @param json_object [String]
34
+ # @return [NewDemoApiClient::PermissionModel]
35
+ def self.from_json(json_object:)
36
+ struct = JSON.parse(json_object, object_class: OpenStruct)
37
+ parsed_json = JSON.parse(json_object)
38
+ resource = parsed_json["resource"]
39
+ action = parsed_json["action"]
40
+ new(
41
+ resource: resource,
42
+ action: action,
43
+ additional_properties: struct
44
+ )
45
+ end
46
+
47
+ # Serialize an instance of PermissionModel to a JSON object
48
+ #
49
+ # @return [String]
50
+ def to_json(*_args)
51
+ @_field_set&.to_json
52
+ end
53
+
54
+ # Leveraged for Union-type generation, validate_raw attempts to parse the given
55
+ # hash and check each fields type against the current object's property
56
+ # definitions.
57
+ #
58
+ # @param obj [Object]
59
+ # @return [Void]
60
+ def self.validate_raw(obj:)
61
+ obj.resource.is_a?(String) != false || raise("Passed value for field obj.resource is not the expected type, validation failed.")
62
+ obj.action.is_a?(String) != false || raise("Passed value for field obj.action is not the expected type, validation failed.")
63
+ end
64
+ end
65
+ end
@@ -0,0 +1,10 @@
1
+ # frozen_string_literal: true
2
+
3
+ module NewDemoApiClient
4
+ class Priority
5
+ LOW = "low"
6
+ NORMAL = "normal"
7
+ HIGH = "high"
8
+ URGENT = "urgent"
9
+ end
10
+ end