Class: TrophyApiClient::UpdateTenantRequestItem

Inherits:
Object
  • Object
show all
Defined in:
lib/trophy_api_client/types/update_tenant_request_item.rb

Overview

A tenant to update.

Constant Summary collapse

OMIT =
Object.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id:, customer_id: OMIT, name: OMIT, additional_properties: nil) ⇒ TrophyApiClient::UpdateTenantRequestItem

Parameters:

  • id (String)

    The UUID of the tenant to update.

  • customer_id (String) (defaults to: OMIT)

    New external customer ID.

  • name (String) (defaults to: OMIT)

    New display name for the tenant.

  • additional_properties (OpenStruct) (defaults to: nil)

    Additional properties unmapped to the current class definition



28
29
30
31
32
33
34
35
36
# File 'lib/trophy_api_client/types/update_tenant_request_item.rb', line 28

def initialize(id:, customer_id: OMIT, name: OMIT, additional_properties: nil)
  @id = id
  @customer_id = customer_id if customer_id != OMIT
  @name = name if name != OMIT
  @additional_properties = additional_properties
  @_field_set = { "id": id, "customerId": customer_id, "name": name }.reject do |_k, v|
    v == OMIT
  end
end

Instance Attribute Details

#additional_propertiesOpenStruct (readonly)

Returns Additional properties unmapped to the current class definition.

Returns:

  • (OpenStruct)

    Additional properties unmapped to the current class definition



16
17
18
# File 'lib/trophy_api_client/types/update_tenant_request_item.rb', line 16

def additional_properties
  @additional_properties
end

#customer_idString (readonly)

Returns New external customer ID.

Returns:

  • (String)

    New external customer ID.



12
13
14
# File 'lib/trophy_api_client/types/update_tenant_request_item.rb', line 12

def customer_id
  @customer_id
end

#idString (readonly)

Returns The UUID of the tenant to update.

Returns:

  • (String)

    The UUID of the tenant to update.



10
11
12
# File 'lib/trophy_api_client/types/update_tenant_request_item.rb', line 10

def id
  @id
end

#nameString (readonly)

Returns New display name for the tenant.

Returns:

  • (String)

    New display name for the tenant.



14
15
16
# File 'lib/trophy_api_client/types/update_tenant_request_item.rb', line 14

def name
  @name
end

Class Method Details

.from_json(json_object:) ⇒ TrophyApiClient::UpdateTenantRequestItem

Deserialize a JSON object to an instance of UpdateTenantRequestItem

Parameters:

  • json_object (String)

Returns:



42
43
44
45
46
47
48
49
50
51
52
53
54
# File 'lib/trophy_api_client/types/update_tenant_request_item.rb', line 42

def self.from_json(json_object:)
  struct = JSON.parse(json_object, object_class: OpenStruct)
  parsed_json = JSON.parse(json_object)
  id = parsed_json["id"]
  customer_id = parsed_json["customerId"]
  name = parsed_json["name"]
  new(
    id: id,
    customer_id: customer_id,
    name: name,
    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)


69
70
71
72
73
# File 'lib/trophy_api_client/types/update_tenant_request_item.rb', line 69

def self.validate_raw(obj:)
  obj.id.is_a?(String) != false || raise("Passed value for field obj.id is not the expected type, validation failed.")
  obj.customer_id&.is_a?(String) != false || raise("Passed value for field obj.customer_id is not the expected type, validation failed.")
  obj.name&.is_a?(String) != false || raise("Passed value for field obj.name is not the expected type, validation failed.")
end

Instance Method Details

#to_json(*_args) ⇒ String

Serialize an instance of UpdateTenantRequestItem to a JSON object

Returns:

  • (String)


59
60
61
# File 'lib/trophy_api_client/types/update_tenant_request_item.rb', line 59

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