Class: NewDemoApiClient::GroupResponse
- Inherits:
-
Object
- Object
- NewDemoApiClient::GroupResponse
- Defined in:
- lib/test_sdk/types/group_response.rb
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
- #account_manager ⇒ NewDemoApiClient::AccountManagerResponse readonly
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
-
#analysis_email ⇒ String
readonly
The email address for analysis to be sent to.
- #created_at ⇒ DateTime readonly
-
#data_api_access ⇒ Boolean
readonly
Whether the group has access to the data API.
- #deal_count ⇒ Integer readonly
-
#domain ⇒ String
readonly
The domain of the group.
- #id ⇒ Integer readonly
- #is_archived ⇒ Boolean readonly
- #name ⇒ String readonly
-
#thumbnail_url ⇒ String
readonly
The thumbnail URL of the group.
- #updated_at ⇒ DateTime readonly
- #user_count ⇒ Integer readonly
Class Method Summary collapse
-
.from_json(json_object:) ⇒ NewDemoApiClient::GroupResponse
Deserialize a JSON object to an instance of GroupResponse.
-
.validate_raw(obj:) ⇒ Void
Leveraged for Union-type generation, validate_raw attempts to parse the given hash and check each fields type against the current object’s property definitions.
Instance Method Summary collapse
- #initialize(name:, domain:, id:, thumbnail_url: OMIT, analysis_email: OMIT, data_api_access: OMIT, created_at: OMIT, updated_at: OMIT, is_archived: OMIT, account_manager: OMIT, user_count: OMIT, deal_count: OMIT, additional_properties: nil) ⇒ NewDemoApiClient::GroupResponse constructor
-
#to_json(*_args) ⇒ String
Serialize an instance of GroupResponse to a JSON object.
Constructor Details
#initialize(name:, domain:, id:, thumbnail_url: OMIT, analysis_email: OMIT, data_api_access: OMIT, created_at: OMIT, updated_at: OMIT, is_archived: OMIT, account_manager: OMIT, user_count: OMIT, deal_count: OMIT, additional_properties: nil) ⇒ NewDemoApiClient::GroupResponse
56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 |
# File 'lib/test_sdk/types/group_response.rb', line 56 def initialize(name:, domain:, id:, thumbnail_url: OMIT, analysis_email: OMIT, data_api_access: OMIT, created_at: OMIT, updated_at: OMIT, is_archived: OMIT, account_manager: OMIT, user_count: OMIT, deal_count: OMIT, additional_properties: nil) @name = name @domain = domain @thumbnail_url = thumbnail_url if thumbnail_url != OMIT @analysis_email = analysis_email if analysis_email != OMIT @data_api_access = data_api_access if data_api_access != OMIT @id = id @created_at = created_at if created_at != OMIT @updated_at = updated_at if updated_at != OMIT @is_archived = is_archived if is_archived != OMIT @account_manager = account_manager if account_manager != OMIT @user_count = user_count if user_count != OMIT @deal_count = deal_count if deal_count != OMIT @additional_properties = additional_properties @_field_set = { "name": name, "domain": domain, "thumbnail_url": thumbnail_url, "analysis_email": analysis_email, "data_api_access": data_api_access, "id": id, "created_at": created_at, "updated_at": updated_at, "is_archived": is_archived, "account_manager": account_manager, "user_count": user_count, "deal_count": deal_count }.reject do |_k, v| v == OMIT end end |
Instance Attribute Details
#account_manager ⇒ NewDemoApiClient::AccountManagerResponse (readonly)
29 30 31 |
# File 'lib/test_sdk/types/group_response.rb', line 29 def account_manager @account_manager end |
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
35 36 37 |
# File 'lib/test_sdk/types/group_response.rb', line 35 def additional_properties @additional_properties end |
#analysis_email ⇒ String (readonly)
Returns The email address for analysis to be sent to.
17 18 19 |
# File 'lib/test_sdk/types/group_response.rb', line 17 def analysis_email @analysis_email end |
#created_at ⇒ DateTime (readonly)
23 24 25 |
# File 'lib/test_sdk/types/group_response.rb', line 23 def created_at @created_at end |
#data_api_access ⇒ Boolean (readonly)
Returns Whether the group has access to the data API.
19 20 21 |
# File 'lib/test_sdk/types/group_response.rb', line 19 def data_api_access @data_api_access end |
#deal_count ⇒ Integer (readonly)
33 34 35 |
# File 'lib/test_sdk/types/group_response.rb', line 33 def deal_count @deal_count end |
#domain ⇒ String (readonly)
Returns The domain of the group.
13 14 15 |
# File 'lib/test_sdk/types/group_response.rb', line 13 def domain @domain end |
#id ⇒ Integer (readonly)
21 22 23 |
# File 'lib/test_sdk/types/group_response.rb', line 21 def id @id end |
#is_archived ⇒ Boolean (readonly)
27 28 29 |
# File 'lib/test_sdk/types/group_response.rb', line 27 def is_archived @is_archived end |
#name ⇒ String (readonly)
11 12 13 |
# File 'lib/test_sdk/types/group_response.rb', line 11 def name @name end |
#thumbnail_url ⇒ String (readonly)
Returns The thumbnail URL of the group.
15 16 17 |
# File 'lib/test_sdk/types/group_response.rb', line 15 def thumbnail_url @thumbnail_url end |
#updated_at ⇒ DateTime (readonly)
25 26 27 |
# File 'lib/test_sdk/types/group_response.rb', line 25 def updated_at @updated_at end |
#user_count ⇒ Integer (readonly)
31 32 33 |
# File 'lib/test_sdk/types/group_response.rb', line 31 def user_count @user_count end |
Class Method Details
.from_json(json_object:) ⇒ NewDemoApiClient::GroupResponse
Deserialize a JSON object to an instance of GroupResponse
93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 |
# File 'lib/test_sdk/types/group_response.rb', line 93 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) name = parsed_json["name"] domain = parsed_json["domain"] thumbnail_url = parsed_json["thumbnail_url"] analysis_email = parsed_json["analysis_email"] data_api_access = parsed_json["data_api_access"] id = parsed_json["id"] created_at = (DateTime.parse(parsed_json["created_at"]) unless parsed_json["created_at"].nil?) updated_at = (DateTime.parse(parsed_json["updated_at"]) unless parsed_json["updated_at"].nil?) is_archived = parsed_json["is_archived"] if parsed_json["account_manager"].nil? account_manager = nil else account_manager = parsed_json["account_manager"].to_json account_manager = NewDemoApiClient::AccountManagerResponse.from_json(json_object: account_manager) end user_count = parsed_json["user_count"] deal_count = parsed_json["deal_count"] new( name: name, domain: domain, thumbnail_url: thumbnail_url, analysis_email: analysis_email, data_api_access: data_api_access, id: id, created_at: created_at, updated_at: updated_at, is_archived: is_archived, account_manager: account_manager, user_count: user_count, deal_count: deal_count, additional_properties: struct ) end |
.validate_raw(obj:) ⇒ Void
Leveraged for Union-type generation, validate_raw attempts to parse the given
hash and check each fields type against the current object's property
definitions.
143 144 145 146 147 148 149 150 151 152 153 154 155 156 |
# File 'lib/test_sdk/types/group_response.rb', line 143 def self.validate_raw(obj:) obj.name.is_a?(String) != false || raise("Passed value for field obj.name is not the expected type, validation failed.") obj.domain.is_a?(String) != false || raise("Passed value for field obj.domain is not the expected type, validation failed.") obj.thumbnail_url&.is_a?(String) != false || raise("Passed value for field obj.thumbnail_url is not the expected type, validation failed.") obj.analysis_email&.is_a?(String) != false || raise("Passed value for field obj.analysis_email is not the expected type, validation failed.") obj.data_api_access&.is_a?(Boolean) != false || raise("Passed value for field obj.data_api_access is not the expected type, validation failed.") obj.id.is_a?(Integer) != false || raise("Passed value for field obj.id is not the expected type, validation failed.") obj.created_at&.is_a?(DateTime) != false || raise("Passed value for field obj.created_at is not the expected type, validation failed.") obj.updated_at&.is_a?(DateTime) != false || raise("Passed value for field obj.updated_at is not the expected type, validation failed.") obj.is_archived&.is_a?(Boolean) != false || raise("Passed value for field obj.is_archived is not the expected type, validation failed.") obj.account_manager.nil? || NewDemoApiClient::AccountManagerResponse.validate_raw(obj: obj.account_manager) obj.user_count&.is_a?(Integer) != false || raise("Passed value for field obj.user_count is not the expected type, validation failed.") obj.deal_count&.is_a?(Integer) != false || raise("Passed value for field obj.deal_count is not the expected type, validation failed.") end |
Instance Method Details
#to_json(*_args) ⇒ String
Serialize an instance of GroupResponse to a JSON object
133 134 135 |
# File 'lib/test_sdk/types/group_response.rb', line 133 def to_json(*_args) @_field_set&.to_json end |