Class: Straddle::Resources::Representatives
- Inherits:
-
Object
- Object
- Straddle::Resources::Representatives
- Defined in:
- lib/straddle/resources/representatives.rb,
sig/straddle/resources/representatives.rbs
Overview
Representatives are people associated with a business account for ownership, control, or authorization purposes.
Instance Method Summary collapse
-
#create(account_id:, dob:, email:, first_name:, last_name:, mobile_number:, relationship:, ssn_last4:, external_id: nil, metadata: nil, correlation_id: nil, idempotency_key: nil, request_id: nil, request_options: {}) ⇒ Straddle::Models::RepresentativeResponse
Some parameter documentations has been truncated, see Models::RepresentativeCreateParams for more details.
-
#initialize(client:) ⇒ Representatives
constructor
private
A new instance of Representatives.
-
#list(account_id: nil, level: nil, organization_id: nil, page_number: nil, page_size: nil, platform_id: nil, sort_by: nil, sort_order: nil, correlation_id: nil, request_id: nil, request_options: {}) ⇒ Straddle::Models::RepresentativeList
Some parameter documentations has been truncated, see Models::RepresentativeListParams for more details.
-
#list_unmasked(representative_id, correlation_id: nil, request_id: nil, request_options: {}) ⇒ Straddle::Models::UnmaskedRepresentativeResponse
Returns the representative with the specified ID without masking sensitive fields.
-
#retrieve(representative_id, correlation_id: nil, request_id: nil, request_options: {}) ⇒ Straddle::Models::RepresentativeResponse
Returns the representative with the specified ID.
-
#update(representative_id, dob:, email:, first_name:, last_name:, mobile_number:, relationship:, ssn_last4:, external_id: nil, metadata: nil, correlation_id: nil, idempotency_key: nil, request_id: nil, request_options: {}) ⇒ Straddle::Models::RepresentativeResponse
Some parameter documentations has been truncated, see Models::RepresentativeUpdateParams for more details.
Constructor Details
#initialize(client:) ⇒ Representatives
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 Representatives.
237 238 239 |
# File 'lib/straddle/resources/representatives.rb', line 237 def initialize(client:) @client = client end |
Instance Method Details
#create(account_id:, dob:, email:, first_name:, last_name:, mobile_number:, relationship:, ssn_last4:, external_id: nil, metadata: nil, correlation_id: nil, idempotency_key: nil, request_id: nil, request_options: {}) ⇒ Straddle::Models::RepresentativeResponse
Some parameter documentations has been truncated, see Models::RepresentativeCreateParams for more details.
Creates a representative for an account and returns the representative. Relationship fields identify primary representatives, control persons, and owners.
48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 |
# File 'lib/straddle/resources/representatives.rb', line 48 def create(params) parsed, = Straddle::RepresentativeCreateParams.dump_request(params) header_params = { correlation_id: "correlation-id", idempotency_key: "idempotency-key", request_id: "request-id" } @client.request( method: :post, path: "v1/representatives", headers: parsed.slice(*header_params.keys).transform_keys(header_params), body: parsed.except(*header_params.keys), model: Straddle::RepresentativeResponse, options: ) end |
#list(account_id: nil, level: nil, organization_id: nil, page_number: nil, page_size: nil, platform_id: nil, sort_by: nil, sort_order: nil, correlation_id: nil, request_id: nil, request_options: {}) ⇒ Straddle::Models::RepresentativeList
Some parameter documentations has been truncated, see Models::RepresentativeListParams for more details.
Returns a paginated list of representatives. Filter the list by account, organization, platform, or scope.
180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 |
# File 'lib/straddle/resources/representatives.rb', line 180 def list(params = {}) query_params = %i[ account_id level organization_id page_number page_size platform_id sort_by sort_order ] parsed, = Straddle::RepresentativeListParams.dump_request(params) query = Straddle::Internal::Util.encode_query_params(parsed.slice(*query_params)) @client.request( method: :get, path: "v1/representatives", query: query, headers: parsed.except(*query_params).transform_keys( correlation_id: "correlation-id", request_id: "request-id" ), model: Straddle::RepresentativeList, options: ) end |
#list_unmasked(representative_id, correlation_id: nil, request_id: nil, request_options: {}) ⇒ Straddle::Models::UnmaskedRepresentativeResponse
Returns the representative with the specified ID without masking sensitive fields. This endpoint requires an administrator role.
223 224 225 226 227 228 229 230 231 232 |
# File 'lib/straddle/resources/representatives.rb', line 223 def list_unmasked(representative_id, params = {}) parsed, = Straddle::RepresentativeListUnmaskedParams.dump_request(params) @client.request( method: :get, path: ["v1/representatives/%1$s/unmask", representative_id], headers: parsed.transform_keys(correlation_id: "correlation-id", request_id: "request-id"), model: Straddle::UnmaskedRepresentativeResponse, options: ) end |
#retrieve(representative_id, correlation_id: nil, request_id: nil, request_options: {}) ⇒ Straddle::Models::RepresentativeResponse
Returns the representative with the specified ID.
80 81 82 83 84 85 86 87 88 89 |
# File 'lib/straddle/resources/representatives.rb', line 80 def retrieve(representative_id, params = {}) parsed, = Straddle::RepresentativeRetrieveParams.dump_request(params) @client.request( method: :get, path: ["v1/representatives/%1$s", representative_id], headers: parsed.transform_keys(correlation_id: "correlation-id", request_id: "request-id"), model: Straddle::RepresentativeResponse, options: ) end |
#update(representative_id, dob:, email:, first_name:, last_name:, mobile_number:, relationship:, ssn_last4:, external_id: nil, metadata: nil, correlation_id: nil, idempotency_key: nil, request_id: nil, request_options: {}) ⇒ Straddle::Models::RepresentativeResponse
Some parameter documentations has been truncated, see Models::RepresentativeUpdateParams for more details.
Updates a representative's personal, contact, relationship, external ID, and metadata fields, then returns the representative.
130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 |
# File 'lib/straddle/resources/representatives.rb', line 130 def update(representative_id, params) parsed, = Straddle::RepresentativeUpdateParams.dump_request(params) header_params = { correlation_id: "correlation-id", idempotency_key: "idempotency-key", request_id: "request-id" } @client.request( method: :put, path: ["v1/representatives/%1$s", representative_id], headers: parsed.slice(*header_params.keys).transform_keys(header_params), body: parsed.except(*header_params.keys), model: Straddle::RepresentativeResponse, options: ) end |