Class: NewDemoApiClient::GroupResponse

Inherits:
Object
  • Object
show all
Defined in:
lib/test_sdk/types/group_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, additional_properties: nil) ⇒ NewDemoApiClient::GroupResponse

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)
  • additional_properties (OpenStruct) (defaults to: nil)

    Additional properties unmapped to the current class definition



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

Instance Attribute Details

#account_managerNewDemoApiClient::AccountManagerResponse (readonly)



29
30
31
# File 'lib/test_sdk/types/group_response.rb', line 29

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



35
36
37
# File 'lib/test_sdk/types/group_response.rb', line 35

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



17
18
19
# File 'lib/test_sdk/types/group_response.rb', line 17

def analysis_email
  @analysis_email
end

#created_atDateTime (readonly)

Returns:

  • (DateTime)


23
24
25
# File 'lib/test_sdk/types/group_response.rb', line 23

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



19
20
21
# File 'lib/test_sdk/types/group_response.rb', line 19

def data_api_access
  @data_api_access
end

#deal_countInteger (readonly)

Returns:

  • (Integer)


33
34
35
# File 'lib/test_sdk/types/group_response.rb', line 33

def deal_count
  @deal_count
end

#domainString (readonly)

Returns The domain of the group.

Returns:

  • (String)

    The domain of the group



13
14
15
# File 'lib/test_sdk/types/group_response.rb', line 13

def domain
  @domain
end

#idInteger (readonly)

Returns:

  • (Integer)


21
22
23
# File 'lib/test_sdk/types/group_response.rb', line 21

def id
  @id
end

#is_archivedBoolean (readonly)

Returns:

  • (Boolean)


27
28
29
# File 'lib/test_sdk/types/group_response.rb', line 27

def is_archived
  @is_archived
end

#nameString (readonly)

Returns:

  • (String)


11
12
13
# File 'lib/test_sdk/types/group_response.rb', line 11

def name
  @name
end

#thumbnail_urlString (readonly)

Returns The thumbnail URL of the group.

Returns:

  • (String)

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

Returns:

  • (DateTime)


25
26
27
# File 'lib/test_sdk/types/group_response.rb', line 25

def updated_at
  @updated_at
end

#user_countInteger (readonly)

Returns:

  • (Integer)


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

Parameters:

  • json_object (String)

Returns:



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?
     = 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"]
  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,
    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)


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..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.")
end

Instance Method Details

#to_json(*_args) ⇒ String

Serialize an instance of GroupResponse to a JSON object

Returns:

  • (String)


133
134
135
# File 'lib/test_sdk/types/group_response.rb', line 133

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