Class: Merge::Crm::AccountIntegration

Inherits:
Object
  • Object
show all
Defined in:
lib/merge_ruby_client/crm/types/account_integration.rb

Constant Summary collapse

OMIT =
Object.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name:, abbreviated_name: OMIT, categories: OMIT, image: OMIT, square_image: OMIT, color: OMIT, slug: OMIT, api_endpoints_to_documentation_urls: OMIT, webhook_setup_guide_url: OMIT, category_beta_status: OMIT, additional_properties: nil) ⇒ Merge::Crm::AccountIntegration

Parameters:

  • name (String)

    Company name.

  • abbreviated_name (String) (defaults to: OMIT)

    Optional. This shortened name appears in places with limited space, usually in conjunction with the platform’s logo (e.g., Merge Link menu).
    Example: Workforce Now (in lieu of ADP Workforce Now), SuccessFactors (in lieu of SAP SuccessFactors)

  • categories (Array<Merge::Crm::CategoriesEnum>) (defaults to: OMIT)

    Category or categories this integration belongs to. Multiple categories should be comma separated, i.e. [ats, hris].

  • image (String) (defaults to: OMIT)

    Company logo in rectangular shape. Upload an image with a clear background.

  • square_image (String) (defaults to: OMIT)

    Company logo in square shape. Upload an image with a white background.

  • color (String) (defaults to: OMIT)

    The color of this integration used for buttons and text throughout the app and landing pages. Choose a darker, saturated color.

  • slug (String) (defaults to: OMIT)
  • api_endpoints_to_documentation_urls (Hash{String => Object}) (defaults to: OMIT)

    Mapping of API endpoints to documentation urls for support. Example: [[‘/common-model-scopes’, ng/common-model-scopes/#common_model_scopes_retrieve’],[‘/common-model-actions’, ocs.merge.dev/accounting/common-model-actions/#common_model_actions_retrieve’]], ‘POST’: []

  • webhook_setup_guide_url (String) (defaults to: OMIT)

    Setup guide URL for third party webhook creation. Exposed in Merge Docs.

  • category_beta_status (Hash{String => Object}) (defaults to: OMIT)

    Category or categories this integration is in beta status for.

  • additional_properties (OpenStruct) (defaults to: nil)

    Additional properties unmapped to the current class definition



70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
# File 'lib/merge_ruby_client/crm/types/account_integration.rb', line 70

def initialize(name:, abbreviated_name: OMIT, categories: OMIT, image: OMIT, square_image: OMIT, color: OMIT,
               slug: OMIT, api_endpoints_to_documentation_urls: OMIT, webhook_setup_guide_url: OMIT, category_beta_status: OMIT, additional_properties: nil)
  @name = name
  @abbreviated_name = abbreviated_name if abbreviated_name != OMIT
  @categories = categories if categories != OMIT
  @image = image if image != OMIT
  @square_image = square_image if square_image != OMIT
  @color = color if color != OMIT
  @slug = slug if slug != OMIT
  if api_endpoints_to_documentation_urls != OMIT
    @api_endpoints_to_documentation_urls = api_endpoints_to_documentation_urls
  end
  @webhook_setup_guide_url = webhook_setup_guide_url if webhook_setup_guide_url != OMIT
  @category_beta_status = category_beta_status if category_beta_status != OMIT
  @additional_properties = additional_properties
  @_field_set = {
    "name": name,
    "abbreviated_name": abbreviated_name,
    "categories": categories,
    "image": image,
    "square_image": square_image,
    "color": color,
    "slug": slug,
    "api_endpoints_to_documentation_urls": api_endpoints_to_documentation_urls,
    "webhook_setup_guide_url": webhook_setup_guide_url,
    "category_beta_status": category_beta_status
  }.reject do |_k, v|
    v == OMIT
  end
end

Instance Attribute Details

#abbreviated_nameString (readonly)

Returns Optional. This shortened name appears in places with limited space, usually in conjunction with the platform’s logo (e.g., Merge Link menu).
Example: Workforce Now (in lieu of ADP Workforce Now), SuccessFactors (in lieu of SAP SuccessFactors).

Returns:

  • (String)

    Optional. This shortened name appears in places with limited space, usually in conjunction with the platform’s logo (e.g., Merge Link menu).
    Example: Workforce Now (in lieu of ADP Workforce Now), SuccessFactors (in lieu of SAP SuccessFactors)



16
17
18
# File 'lib/merge_ruby_client/crm/types/account_integration.rb', line 16

def abbreviated_name
  @abbreviated_name
end

#additional_propertiesOpenStruct (readonly)

Returns Additional properties unmapped to the current class definition.

Returns:

  • (OpenStruct)

    Additional properties unmapped to the current class definition



41
42
43
# File 'lib/merge_ruby_client/crm/types/account_integration.rb', line 41

def additional_properties
  @additional_properties
end

#api_endpoints_to_documentation_urlsHash{String => Object} (readonly)

Returns Mapping of API endpoints to documentation urls for support. Example: [[‘/common-model-scopes’, ng/common-model-scopes/#common_model_scopes_retrieve’],[‘/common-model-actions’, ocs.merge.dev/accounting/common-model-actions/#common_model_actions_retrieve’]], ‘POST’: [].

Returns:

  • (Hash{String => Object})

    Mapping of API endpoints to documentation urls for support. Example: [[‘/common-model-scopes’, ng/common-model-scopes/#common_model_scopes_retrieve’],[‘/common-model-actions’, ocs.merge.dev/accounting/common-model-actions/#common_model_actions_retrieve’]], ‘POST’: []



35
36
37
# File 'lib/merge_ruby_client/crm/types/account_integration.rb', line 35

def api_endpoints_to_documentation_urls
  @api_endpoints_to_documentation_urls
end

#categoriesArray<Merge::Crm::CategoriesEnum> (readonly)

Returns Category or categories this integration belongs to. Multiple categories should be comma separated, i.e. [ats, hris].

Returns:

  • (Array<Merge::Crm::CategoriesEnum>)

    Category or categories this integration belongs to. Multiple categories should be comma separated, i.e. [ats, hris].



19
20
21
# File 'lib/merge_ruby_client/crm/types/account_integration.rb', line 19

def categories
  @categories
end

#category_beta_statusHash{String => Object} (readonly)

Returns Category or categories this integration is in beta status for.

Returns:

  • (Hash{String => Object})

    Category or categories this integration is in beta status for.



39
40
41
# File 'lib/merge_ruby_client/crm/types/account_integration.rb', line 39

def category_beta_status
  @category_beta_status
end

#colorString (readonly)

Returns The color of this integration used for buttons and text throughout the app and landing pages. Choose a darker, saturated color..

Returns:

  • (String)

    The color of this integration used for buttons and text throughout the app and landing pages. Choose a darker, saturated color.



27
28
29
# File 'lib/merge_ruby_client/crm/types/account_integration.rb', line 27

def color
  @color
end

#imageString (readonly)

Returns Company logo in rectangular shape. Upload an image with a clear background..

Returns:

  • (String)

    Company logo in rectangular shape. Upload an image with a clear background.



22
23
24
# File 'lib/merge_ruby_client/crm/types/account_integration.rb', line 22

def image
  @image
end

#nameString (readonly)

Returns Company name.

Returns:

  • (String)

    Company name.



11
12
13
# File 'lib/merge_ruby_client/crm/types/account_integration.rb', line 11

def name
  @name
end

#slugString (readonly)

Returns:

  • (String)


29
30
31
# File 'lib/merge_ruby_client/crm/types/account_integration.rb', line 29

def slug
  @slug
end

#square_imageString (readonly)

Returns Company logo in square shape. Upload an image with a white background..

Returns:

  • (String)

    Company logo in square shape. Upload an image with a white background.



24
25
26
# File 'lib/merge_ruby_client/crm/types/account_integration.rb', line 24

def square_image
  @square_image
end

#webhook_setup_guide_urlString (readonly)

Returns Setup guide URL for third party webhook creation. Exposed in Merge Docs.

Returns:

  • (String)

    Setup guide URL for third party webhook creation. Exposed in Merge Docs.



37
38
39
# File 'lib/merge_ruby_client/crm/types/account_integration.rb', line 37

def webhook_setup_guide_url
  @webhook_setup_guide_url
end

Class Method Details

.from_json(json_object:) ⇒ Merge::Crm::AccountIntegration

Deserialize a JSON object to an instance of AccountIntegration

Parameters:

  • json_object (String)

Returns:



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
# File 'lib/merge_ruby_client/crm/types/account_integration.rb', line 105

def self.from_json(json_object:)
  struct = JSON.parse(json_object, object_class: OpenStruct)
  parsed_json = JSON.parse(json_object)
  name = parsed_json["name"]
  abbreviated_name = parsed_json["abbreviated_name"]
  categories = parsed_json["categories"]
  image = parsed_json["image"]
  square_image = parsed_json["square_image"]
  color = parsed_json["color"]
  slug = parsed_json["slug"]
  api_endpoints_to_documentation_urls = parsed_json["api_endpoints_to_documentation_urls"]
  webhook_setup_guide_url = parsed_json["webhook_setup_guide_url"]
  category_beta_status = parsed_json["category_beta_status"]
  new(
    name: name,
    abbreviated_name: abbreviated_name,
    categories: categories,
    image: image,
    square_image: square_image,
    color: color,
    slug: slug,
    api_endpoints_to_documentation_urls: api_endpoints_to_documentation_urls,
    webhook_setup_guide_url: webhook_setup_guide_url,
    category_beta_status: category_beta_status,
    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)


146
147
148
149
150
151
152
153
154
155
156
157
# File 'lib/merge_ruby_client/crm/types/account_integration.rb', line 146

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.abbreviated_name&.is_a?(String) != false || raise("Passed value for field obj.abbreviated_name is not the expected type, validation failed.")
  obj.categories&.is_a?(Array) != false || raise("Passed value for field obj.categories is not the expected type, validation failed.")
  obj.image&.is_a?(String) != false || raise("Passed value for field obj.image is not the expected type, validation failed.")
  obj.square_image&.is_a?(String) != false || raise("Passed value for field obj.square_image is not the expected type, validation failed.")
  obj.color&.is_a?(String) != false || raise("Passed value for field obj.color is not the expected type, validation failed.")
  obj.slug&.is_a?(String) != false || raise("Passed value for field obj.slug is not the expected type, validation failed.")
  obj.api_endpoints_to_documentation_urls&.is_a?(Hash) != false || raise("Passed value for field obj.api_endpoints_to_documentation_urls is not the expected type, validation failed.")
  obj.webhook_setup_guide_url&.is_a?(String) != false || raise("Passed value for field obj.webhook_setup_guide_url is not the expected type, validation failed.")
  obj.category_beta_status&.is_a?(Hash) != false || raise("Passed value for field obj.category_beta_status is not the expected type, validation failed.")
end

Instance Method Details

#to_json(*_args) ⇒ String

Serialize an instance of AccountIntegration to a JSON object

Returns:

  • (String)


136
137
138
# File 'lib/merge_ruby_client/crm/types/account_integration.rb', line 136

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