Class: Stigg::Resources::V1::Customers::Integrations
- Inherits:
-
Object
- Object
- Stigg::Resources::V1::Customers::Integrations
- Defined in:
- lib/stigg/resources/v1/customers/integrations.rb
Instance Method Summary collapse
-
#initialize(client:) ⇒ Integrations
constructor
private
A new instance of Integrations.
-
#link(path_id, body_id:, synced_entity_id:, vendor_identifier:, request_options: {}) ⇒ Stigg::Models::V1::CustomerIntegrationResponse
Links a customer to an external integration by specifying the vendor and external entity ID.
-
#list(id, after: nil, before: nil, limit: nil, vendor_identifier: nil, request_options: {}) ⇒ Stigg::Internal::MyCursorIDPage<Stigg::Models::V1::Customers::IntegrationListResponse>
Some parameter documentations has been truncated, see Models::V1::Customers::IntegrationListParams for more details.
-
#retrieve(integration_id, id:, request_options: {}) ⇒ Stigg::Models::V1::CustomerIntegrationResponse
Retrieves a specific integration for a customer by integration ID.
-
#unlink(integration_id, id:, request_options: {}) ⇒ Stigg::Models::V1::CustomerIntegrationResponse
Removes the link between a customer and an external integration.
-
#update(integration_id, id:, synced_entity_id:, request_options: {}) ⇒ Stigg::Models::V1::CustomerIntegrationResponse
Updates a customer’s integration link, such as changing the synced external entity ID.
Constructor Details
#initialize(client:) ⇒ Integrations
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of Integrations.
161 162 163 |
# File 'lib/stigg/resources/v1/customers/integrations.rb', line 161 def initialize(client:) @client = client end |
Instance Method Details
#link(path_id, body_id:, synced_entity_id:, vendor_identifier:, request_options: {}) ⇒ Stigg::Models::V1::CustomerIntegrationResponse
Links a customer to an external integration by specifying the vendor and external entity ID.
120 121 122 123 124 125 126 127 128 129 |
# File 'lib/stigg/resources/v1/customers/integrations.rb', line 120 def link(path_id, params) parsed, = Stigg::V1::Customers::IntegrationLinkParams.dump_request(params) @client.request( method: :post, path: ["api/v1/customers/%1$s/integrations", path_id], body: parsed, model: Stigg::V1::CustomerIntegrationResponse, options: ) end |
#list(id, after: nil, before: nil, limit: nil, vendor_identifier: nil, request_options: {}) ⇒ Stigg::Internal::MyCursorIDPage<Stigg::Models::V1::Customers::IntegrationListResponse>
Some parameter documentations has been truncated, see Models::V1::Customers::IntegrationListParams for more details.
Retrieves a paginated list of a customer’s external integrations (billing, CRM, etc.).
89 90 91 92 93 94 95 96 97 98 99 100 |
# File 'lib/stigg/resources/v1/customers/integrations.rb', line 89 def list(id, params = {}) parsed, = Stigg::V1::Customers::IntegrationListParams.dump_request(params) query = Stigg::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: ["api/v1/customers/%1$s/integrations", id], query: query.transform_keys(vendor_identifier: "vendorIdentifier"), page: Stigg::Internal::MyCursorIDPage, model: Stigg::Models::V1::Customers::IntegrationListResponse, options: ) end |
#retrieve(integration_id, id:, request_options: {}) ⇒ Stigg::Models::V1::CustomerIntegrationResponse
Retrieves a specific integration for a customer by integration ID.
21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/stigg/resources/v1/customers/integrations.rb', line 21 def retrieve(integration_id, params) parsed, = Stigg::V1::Customers::IntegrationRetrieveParams.dump_request(params) id = parsed.delete(:id) do raise ArgumentError.new("missing required path argument #{_1}") end @client.request( method: :get, path: ["api/v1/customers/%1$s/integrations/%2$s", id, integration_id], model: Stigg::V1::CustomerIntegrationResponse, options: ) end |
#unlink(integration_id, id:, request_options: {}) ⇒ Stigg::Models::V1::CustomerIntegrationResponse
Removes the link between a customer and an external integration.
144 145 146 147 148 149 150 151 152 153 154 155 156 |
# File 'lib/stigg/resources/v1/customers/integrations.rb', line 144 def unlink(integration_id, params) parsed, = Stigg::V1::Customers::IntegrationUnlinkParams.dump_request(params) id = parsed.delete(:id) do raise ArgumentError.new("missing required path argument #{_1}") end @client.request( method: :delete, path: ["api/v1/customers/%1$s/integrations/%2$s", id, integration_id], model: Stigg::V1::CustomerIntegrationResponse, options: ) end |
#update(integration_id, id:, synced_entity_id:, request_options: {}) ⇒ Stigg::Models::V1::CustomerIntegrationResponse
Updates a customer’s integration link, such as changing the synced external entity ID.
51 52 53 54 55 56 57 58 59 60 61 62 63 64 |
# File 'lib/stigg/resources/v1/customers/integrations.rb', line 51 def update(integration_id, params) parsed, = Stigg::V1::Customers::IntegrationUpdateParams.dump_request(params) id = parsed.delete(:id) do raise ArgumentError.new("missing required path argument #{_1}") end @client.request( method: :patch, path: ["api/v1/customers/%1$s/integrations/%2$s", id, integration_id], body: parsed, model: Stigg::V1::CustomerIntegrationResponse, options: ) end |