Class: Io::Flow::V0::Clients::OrganizationAuthorizations
- Inherits:
-
Object
- Object
- Io::Flow::V0::Clients::OrganizationAuthorizations
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Method Summary collapse
-
#get_by_organization(organization) ⇒ Object
For the authorized user and specific organization, if the user is an active member of this organization, returns the authorization data used throughout APIs at Flow, including the user’s role in that organization and the organization environment.
-
#initialize(client) ⇒ OrganizationAuthorizations
constructor
A new instance of OrganizationAuthorizations.
-
#post(organization_authorization_form) ⇒ Object
For the authorized user, if the specified organization exists, and the user is an active member of this organization, returns the authorization data used throughout APIs at Flow, including the user’s role in that organization and the organization environment.
Constructor Details
#initialize(client) ⇒ OrganizationAuthorizations
Returns a new instance of OrganizationAuthorizations.
7294 7295 7296 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7294 def initialize(client) @client = HttpClient::Preconditions.assert_class('client', client, ::Io::Flow::V0::Client) end |
Instance Method Details
#get_by_organization(organization) ⇒ Object
For the authorized user and specific organization, if the user is an active member of this organization, returns the authorization data used throughout APIs at Flow, including the user’s role in that organization and the organization environment.
7313 7314 7315 7316 7317 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7313 def get_by_organization(organization) HttpClient::Preconditions.assert_class('organization', organization, String) r = @client.request("/organization-authorizations/#{CGI.escape(organization)}").get ::Io::Flow::V0::Models::OrganizationAuthorization.new(r) end |
#post(organization_authorization_form) ⇒ Object
For the authorized user, if the specified organization exists, and the user is an active member of this organization, returns the authorization data used throughout APIs at Flow, including the user’s role in that organization and the organization environment. Otherwise, returns 401 - this indicates either the org does not exist or the user does not have access to the org.
7303 7304 7305 7306 7307 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7303 def post() (x = ; x.is_a?(::Io::Flow::V0::Models::OrganizationAuthorizationForm) ? x : ::Io::Flow::V0::Models::OrganizationAuthorizationForm.new(x)) r = @client.request("/organization-authorizations").with_json(.to_json).post ::Io::Flow::V0::Models::OrganizationAuthorization.new(r) end |