Class: Stigg::Resources::V1::Events::DataExport::Destinations

Inherits:
Object
  • Object
show all
Defined in:
lib/stigg/resources/v1/events/data_export/destinations.rb

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Destinations

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 Destinations.

Parameters:



81
82
83
# File 'lib/stigg/resources/v1/events/data_export/destinations.rb', line 81

def initialize(client:)
  @client = client
end

Instance Method Details

#create(destination_id:, destination_type:, x_account_id: nil, x_environment_id: nil, request_options: {}) ⇒ Stigg::Models::V1::Events::DataExport::DestinationCreateResponse

Some parameter documentations has been truncated, see Models::V1::Events::DataExport::DestinationCreateParams for more details.

Register a destination on the environment’s DATA_EXPORT integration. Lazy-creates the integration row + provider recipient on first call. Idempotent on destinationId.

Parameters:

  • destination_id (String)

    Body param: The provider destination ID returned by the embedded SDK on connect

  • destination_type (String)

    Body param: The destination type (e.g. snowflake, bigquery)

  • x_account_id (String)

    Header param: Account ID — optional when authenticating with a user JWT (Bearer

  • x_environment_id (String)

    Header param: Environment ID — required when authenticating with a user JWT (Bea

  • request_options (Stigg::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



32
33
34
35
36
37
38
39
40
41
42
43
# File 'lib/stigg/resources/v1/events/data_export/destinations.rb', line 32

def create(params)
  parsed, options = Stigg::V1::Events::DataExport::DestinationCreateParams.dump_request(params)
  header_params = {x_account_id: "x-account-id", x_environment_id: "x-environment-id"}
  @client.request(
    method: :post,
    path: "api/v1/data-export/destinations",
    headers: parsed.slice(*header_params.keys).transform_keys(header_params),
    body: parsed.except(*header_params.keys),
    model: Stigg::Models::V1::Events::DataExport::DestinationCreateResponse,
    options: options
  )
end

#delete(destination_id, x_account_id: nil, x_environment_id: nil, request_options: {}) ⇒ Stigg::Models::V1::Events::DataExport::DestinationDeleteResponse

Some parameter documentations has been truncated, see Models::V1::Events::DataExport::DestinationDeleteParams for more details.

Remove a destination from the DATA_EXPORT integration metadata. Idempotent.

Parameters:

  • destination_id (String)

    Provider destination ID to remove

  • x_account_id (String)

    Account ID — optional when authenticating with a user JWT (Bearer token); falls

  • x_environment_id (String)

    Environment ID — required when authenticating with a user JWT (Bearer token) on

  • request_options (Stigg::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



64
65
66
67
68
69
70
71
72
73
74
75
76
# File 'lib/stigg/resources/v1/events/data_export/destinations.rb', line 64

def delete(destination_id, params = {})
  parsed, options = Stigg::V1::Events::DataExport::DestinationDeleteParams.dump_request(params)
  @client.request(
    method: :delete,
    path: ["api/v1/data-export/destinations/%1$s", destination_id],
    headers: parsed.transform_keys(
      x_account_id: "x-account-id",
      x_environment_id: "x-environment-id"
    ),
    model: Stigg::Models::V1::Events::DataExport::DestinationDeleteResponse,
    options: options
  )
end