Class: VitableConnect::Resources::Groups::Members::Sync

Inherits:
Object
  • Object
show all
Defined in:
lib/vitable_connect/resources/groups/members/sync.rb

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Sync

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

Parameters:



67
68
69
# File 'lib/vitable_connect/resources/groups/members/sync.rb', line 67

def initialize(client:)
  @client = client
end

Instance Method Details

#retrieve(request_id, group_id:, request_options: {}) ⇒ VitableConnect::Models::Groups::Members::SyncRetrieveResponse

Retrieves a previously-submitted group member sync request by its ‘grpmsr_` ID. Returns the acceptance timestamp, completion timestamp (if processing has finished), and the per-member `results` once available. While processing is in flight, `completed_at` and `results` are `null`.

Parameters:

  • request_id (String)
  • group_id (String)

    Unique group identifier (grp_*)

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

Returns:

See Also:



24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/vitable_connect/resources/groups/members/sync.rb', line 24

def retrieve(request_id, params)
  parsed, options = VitableConnect::Groups::Members::SyncRetrieveParams.dump_request(params)
  group_id =
    parsed.delete(:group_id) do
      raise ArgumentError.new("missing required path argument #{_1}")
    end
  @client.request(
    method: :get,
    path: ["v1/groups/%1$s/members/sync/%2$s", group_id, request_id],
    model: VitableConnect::Models::Groups::Members::SyncRetrieveResponse,
    options: options
  )
end

#submit(group_id, members:, request_options: {}) ⇒ VitableConnect::Models::Groups::Members::SyncSubmitResponse

Submits a member sync payload for the specified group. Members in the payload will be queued for processing asynchronously. Returns HTTP 202 with the batch ID and acceptance timestamp.

Parameters:

Returns:

See Also:



53
54
55
56
57
58
59
60
61
62
# File 'lib/vitable_connect/resources/groups/members/sync.rb', line 53

def submit(group_id, params)
  parsed, options = VitableConnect::Groups::Members::SyncSubmitParams.dump_request(params)
  @client.request(
    method: :post,
    path: ["v1/groups/%1$s/members/sync", group_id],
    body: parsed,
    model: VitableConnect::Models::Groups::Members::SyncSubmitResponse,
    options: options
  )
end