Class: GrowsurfRuby::Resources::Campaign::Installation

Inherits:
Object
  • Object
show all
Defined in:
lib/growsurf_ruby/resources/campaign/installation.rb,
sig/growsurf_ruby/resources/campaign/installation.rbs

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Installation

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

Parameters:



61
62
63
# File 'lib/growsurf_ruby/resources/campaign/installation.rb', line 61

def initialize(client:)
  @client = client
end

Instance Method Details

#retrieve(id, request_options: {}) ⇒ Hash{Symbol=>Object}

Retrieves a program's installation configuration — the same surface as the dashboard Program Editor's Installation tab (signup and mobile SDK installation settings).

This is a nested object whose available fields depend on the program type. To see the full object with every field and its current value, GET this resource, then PATCH back only the fields you want to change.

Parameters:

Returns:

  • (Hash{Symbol=>Object})


22
23
24
25
26
27
28
29
# File 'lib/growsurf_ruby/resources/campaign/installation.rb', line 22

def retrieve(id, params = {})
  @client.request(
    method: :get,
    path: ["campaign/%1$s/installation", id],
    model: GrowsurfRuby::Internal::Type::HashOf[GrowsurfRuby::Internal::Type::Unknown],
    options: params[:request_options]
  )
end

#update(id, body, request_options: {}) ⇒ Hash{Symbol=>Object}

Updates a program's installation configuration. Only the fields you send are changed; anything you leave out is untouched. Unknown fields, fields not available for the program type, and invalid values return a 400.

The request body is a partial CampaignInstallation object. To see the full object with every field and its current value, GET this resource, then PATCH back only the fields you want to change.

Parameters:

  • id (String)

    GrowSurf program ID.

  • body (Hash{Symbol=>Object})

    Partial installation configuration to merge.

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

Returns:

  • (Hash{Symbol=>Object})


48
49
50
51
52
53
54
55
56
# File 'lib/growsurf_ruby/resources/campaign/installation.rb', line 48

def update(id, body, params = {})
  @client.request(
    method: :patch,
    path: ["campaign/%1$s/installation", id],
    body: body,
    model: GrowsurfRuby::Internal::Type::HashOf[GrowsurfRuby::Internal::Type::Unknown],
    options: params[:request_options]
  )
end