Class: NewDemoApiClient::GroupWithUsersResponse
- Inherits:
-
Object
- Object
- NewDemoApiClient::GroupWithUsersResponse
- Defined in:
- lib/test_sdk/types/group_with_users_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
- #users ⇒ Array<NewDemoApiClient::GroupUser> readonly
Class Method Summary collapse
-
.from_json(json_object:) ⇒ NewDemoApiClient::GroupWithUsersResponse
Deserialize a JSON object to an instance of GroupWithUsersResponse.
-
.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, users: OMIT, additional_properties: nil) ⇒ NewDemoApiClient::GroupWithUsersResponse constructor
-
#to_json(*_args) ⇒ String
Serialize an instance of GroupWithUsersResponse 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, users: OMIT, additional_properties: nil) ⇒ NewDemoApiClient::GroupWithUsersResponse
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 88 89 90 91 92 93 |
# File 'lib/test_sdk/types/group_with_users_response.rb', line 60 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, users: 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 @users = users if users != 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, "users": users }.reject do |_k, v| v == OMIT end end |
Instance Attribute Details
#account_manager ⇒ NewDemoApiClient::AccountManagerResponse (readonly)
30 31 32 |
# File 'lib/test_sdk/types/group_with_users_response.rb', line 30 def account_manager @account_manager end |
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
38 39 40 |
# File 'lib/test_sdk/types/group_with_users_response.rb', line 38 def additional_properties @additional_properties end |
#analysis_email ⇒ String (readonly)
Returns The email address for analysis to be sent to.
18 19 20 |
# File 'lib/test_sdk/types/group_with_users_response.rb', line 18 def analysis_email @analysis_email end |
#created_at ⇒ DateTime (readonly)
24 25 26 |
# File 'lib/test_sdk/types/group_with_users_response.rb', line 24 def created_at @created_at end |
#data_api_access ⇒ Boolean (readonly)
Returns Whether the group has access to the data API.
20 21 22 |
# File 'lib/test_sdk/types/group_with_users_response.rb', line 20 def data_api_access @data_api_access end |
#deal_count ⇒ Integer (readonly)
34 35 36 |
# File 'lib/test_sdk/types/group_with_users_response.rb', line 34 def deal_count @deal_count end |
#domain ⇒ String (readonly)
Returns The domain of the group.
14 15 16 |
# File 'lib/test_sdk/types/group_with_users_response.rb', line 14 def domain @domain end |
#id ⇒ Integer (readonly)
22 23 24 |
# File 'lib/test_sdk/types/group_with_users_response.rb', line 22 def id @id end |
#is_archived ⇒ Boolean (readonly)
28 29 30 |
# File 'lib/test_sdk/types/group_with_users_response.rb', line 28 def is_archived @is_archived end |
#name ⇒ String (readonly)
12 13 14 |
# File 'lib/test_sdk/types/group_with_users_response.rb', line 12 def name @name end |
#thumbnail_url ⇒ String (readonly)
Returns The thumbnail URL of the group.
16 17 18 |
# File 'lib/test_sdk/types/group_with_users_response.rb', line 16 def thumbnail_url @thumbnail_url end |
#updated_at ⇒ DateTime (readonly)
26 27 28 |
# File 'lib/test_sdk/types/group_with_users_response.rb', line 26 def updated_at @updated_at end |
#user_count ⇒ Integer (readonly)
32 33 34 |
# File 'lib/test_sdk/types/group_with_users_response.rb', line 32 def user_count @user_count end |
#users ⇒ Array<NewDemoApiClient::GroupUser> (readonly)
36 37 38 |
# File 'lib/test_sdk/types/group_with_users_response.rb', line 36 def users @users end |
Class Method Details
.from_json(json_object:) ⇒ NewDemoApiClient::GroupWithUsersResponse
Deserialize a JSON object to an instance of GroupWithUsersResponse
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 129 130 131 132 133 134 135 136 137 138 139 |
# File 'lib/test_sdk/types/group_with_users_response.rb', line 99 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"] users = parsed_json["users"]&.map do |item| item = item.to_json NewDemoApiClient::GroupUser.from_json(json_object: item) end 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, users: users, 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.
154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 |
# File 'lib/test_sdk/types/group_with_users_response.rb', line 154 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.") obj.users&.is_a?(Array) != false || raise("Passed value for field obj.users is not the expected type, validation failed.") end |
Instance Method Details
#to_json(*_args) ⇒ String
Serialize an instance of GroupWithUsersResponse to a JSON object
144 145 146 |
# File 'lib/test_sdk/types/group_with_users_response.rb', line 144 def to_json(*_args) @_field_set&.to_json end |