Class: NewDemoApiClient::GroupWithUsersResponse

Inherits:
Object
  • Object
show all
Defined in:
lib/test_sdk/types/group_with_users_response.rb

Constant Summary collapse

OMIT =
Object.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

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

Parameters:

  • name (String)
  • domain (String)

    The domain of the group

  • thumbnail_url (String) (defaults to: OMIT)

    The thumbnail URL of the group

  • analysis_email (String) (defaults to: OMIT)

    The email address for analysis to be sent to

  • data_api_access (Boolean) (defaults to: OMIT)

    Whether the group has access to the data API

  • id (Integer)
  • created_at (DateTime) (defaults to: OMIT)
  • updated_at (DateTime) (defaults to: OMIT)
  • is_archived (Boolean) (defaults to: OMIT)
  • account_manager (NewDemoApiClient::AccountManagerResponse) (defaults to: OMIT)
  • user_count (Integer) (defaults to: OMIT)
  • deal_count (Integer) (defaults to: OMIT)
  • users (Array<NewDemoApiClient::GroupUser>) (defaults to: OMIT)
  • additional_properties (OpenStruct) (defaults to: nil)

    Additional properties unmapped to the current class definition



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 =  if  != 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": ,
    "user_count": user_count,
    "deal_count": deal_count,
    "users": users
  }.reject do |_k, v|
    v == OMIT
  end
end

Instance Attribute Details

#account_managerNewDemoApiClient::AccountManagerResponse (readonly)



30
31
32
# File 'lib/test_sdk/types/group_with_users_response.rb', line 30

def 
  @account_manager
end

#additional_propertiesOpenStruct (readonly)

Returns Additional properties unmapped to the current class definition.

Returns:

  • (OpenStruct)

    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_emailString (readonly)

Returns The email address for analysis to be sent to.

Returns:

  • (String)

    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_atDateTime (readonly)

Returns:

  • (DateTime)


24
25
26
# File 'lib/test_sdk/types/group_with_users_response.rb', line 24

def created_at
  @created_at
end

#data_api_accessBoolean (readonly)

Returns Whether the group has access to the data API.

Returns:

  • (Boolean)

    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_countInteger (readonly)

Returns:

  • (Integer)


34
35
36
# File 'lib/test_sdk/types/group_with_users_response.rb', line 34

def deal_count
  @deal_count
end

#domainString (readonly)

Returns The domain of the group.

Returns:

  • (String)

    The domain of the group



14
15
16
# File 'lib/test_sdk/types/group_with_users_response.rb', line 14

def domain
  @domain
end

#idInteger (readonly)

Returns:

  • (Integer)


22
23
24
# File 'lib/test_sdk/types/group_with_users_response.rb', line 22

def id
  @id
end

#is_archivedBoolean (readonly)

Returns:

  • (Boolean)


28
29
30
# File 'lib/test_sdk/types/group_with_users_response.rb', line 28

def is_archived
  @is_archived
end

#nameString (readonly)

Returns:

  • (String)


12
13
14
# File 'lib/test_sdk/types/group_with_users_response.rb', line 12

def name
  @name
end

#thumbnail_urlString (readonly)

Returns The thumbnail URL of the group.

Returns:

  • (String)

    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_atDateTime (readonly)

Returns:

  • (DateTime)


26
27
28
# File 'lib/test_sdk/types/group_with_users_response.rb', line 26

def updated_at
  @updated_at
end

#user_countInteger (readonly)

Returns:

  • (Integer)


32
33
34
# File 'lib/test_sdk/types/group_with_users_response.rb', line 32

def user_count
  @user_count
end

#usersArray<NewDemoApiClient::GroupUser> (readonly)

Returns:



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

Parameters:

  • json_object (String)

Returns:



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?
     = nil
  else
     = parsed_json["account_manager"].to_json
     = NewDemoApiClient::AccountManagerResponse.from_json(json_object: )
  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: ,
    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.

Parameters:

  • obj (Object)

Returns:

  • (Void)


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..nil? || NewDemoApiClient::AccountManagerResponse.validate_raw(obj: obj.)
  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

Returns:

  • (String)


144
145
146
# File 'lib/test_sdk/types/group_with_users_response.rb', line 144

def to_json(*_args)
  @_field_set&.to_json
end