Class: Stripe::Apps::Install
- Inherits:
-
Stripe::APIResource
- Object
- StripeObject
- Stripe::APIResource
- Stripe::Apps::Install
- Extended by:
- Stripe::APIOperations::Create, Stripe::APIOperations::List
- Includes:
- Stripe::APIOperations::Save
- Defined in:
- lib/stripe/resources/apps/install.rb
Overview
An app install represents a Stripe App that is installed on an account. It reports the permissions, content security policy entries, and endpoints that the installing account has authorized, along with any that the app's latest version requests but the account has not authorized yet. Use the Install API to install, reauthorize, and uninstall apps, and to check the state of existing installs.
Defined Under Namespace
Classes: ContentSecurityPolicyGranted, ContentSecurityPolicyPending
Constant Summary collapse
- OBJECT_NAME =
"apps.install"
Constants inherited from StripeObject
StripeObject::RESERVED_FIELD_NAMES
Instance Attribute Summary collapse
-
#account ⇒ Object
readonly
The ID of the account that the app install belongs to.
-
#app ⇒ Object
readonly
The ID of the app installed.
-
#approval_required ⇒ Object
readonly
Whether the installer must authorize pending permissions, content security policy entries, or endpoints.
-
#auth_code ⇒ Object
readonly
The authorization code for an oauth app install.
-
#channel ⇒ Object
readonly
The distribution channel associated with the app install.
-
#content_security_policy_granted ⇒ Object
readonly
Attribute for field content_security_policy_granted.
-
#content_security_policy_pending ⇒ Object
readonly
Attribute for field content_security_policy_pending.
-
#created ⇒ Object
readonly
Time at which the object was created.
-
#created_by ⇒ Object
readonly
The ID of the embedding platform that created the install, if applicable.
-
#endpoints_granted ⇒ Object
readonly
The endpoint URLs authorized by the installer.
-
#endpoints_pending ⇒ Object
readonly
The endpoint URLs requested by the latest app version that the installer has not authorized.
-
#id ⇒ Object
readonly
Unique identifier for the object.
-
#livemode ⇒ Object
readonly
If the object exists in live mode, the value is
true. -
#object ⇒ Object
readonly
String representing the object's type.
-
#permissions_granted ⇒ Object
readonly
The permissions authorized by the installer.
-
#permissions_pending ⇒ Object
readonly
The permissions requested by the latest app version that the installer has not authorized.
-
#status ⇒ Object
readonly
The status of the app install.
Attributes inherited from Stripe::APIResource
Attributes inherited from StripeObject
Class Method Summary collapse
-
.create(params = {}, opts = {}) ⇒ Object
Creates an app install.
- .field_remappings ⇒ Object
- .inner_class_types ⇒ Object
-
.list(params = {}, opts = {}) ⇒ Object
Returns a list of app installs.
- .object_name ⇒ Object
-
.uninstall(id, params = {}, opts = {}) ⇒ Object
Uninstalls an app from the account that installed it.
-
.update(id, params = {}, opts = {}) ⇒ Object
Reauthorizes an app install.
Instance Method Summary collapse
-
#uninstall(params = {}, opts = {}) ⇒ Object
Uninstalls an app from the account that installed it.
Methods included from Stripe::APIOperations::Create
Methods included from Stripe::APIOperations::List
Methods included from Stripe::APIOperations::Save
Methods inherited from Stripe::APIResource
class_name, custom_method, #refresh, #request_stripe_object, resource_url, #resource_url, retrieve, save_nested_resource
Methods included from Stripe::APIOperations::Request
Methods inherited from StripeObject
#==, #[], #[]=, #_get_inner_class_type, #_get_union_variant_class, additive_object_param, additive_object_param?, #as_json, construct_from, #deleted?, #dirty!, #each, #eql?, field_encodings, #hash, #initialize, inner_class_union_variant_types, #inspect, #keys, #marshal_dump, #marshal_load, protected_fields, #serialize_params, #to_hash, #to_json, #to_s, #update_attributes, #values
Constructor Details
This class inherits a constructor from Stripe::StripeObject
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Stripe::StripeObject
Instance Attribute Details
#account ⇒ Object (readonly)
The ID of the account that the app install belongs to.
50 51 52 |
# File 'lib/stripe/resources/apps/install.rb', line 50 def account @account end |
#app ⇒ Object (readonly)
The ID of the app installed.
52 53 54 |
# File 'lib/stripe/resources/apps/install.rb', line 52 def app @app end |
#approval_required ⇒ Object (readonly)
Whether the installer must authorize pending permissions, content security policy entries, or endpoints. For private apps, approval_required stays false; creating or reauthorizing the install through the API installs the newest completed upload and grants its permissions.
54 55 56 |
# File 'lib/stripe/resources/apps/install.rb', line 54 def approval_required @approval_required end |
#auth_code ⇒ Object (readonly)
The authorization code for an oauth app install.
56 57 58 |
# File 'lib/stripe/resources/apps/install.rb', line 56 def auth_code @auth_code end |
#channel ⇒ Object (readonly)
The distribution channel associated with the app install.
58 59 60 |
# File 'lib/stripe/resources/apps/install.rb', line 58 def channel @channel end |
#content_security_policy_granted ⇒ Object (readonly)
Attribute for field content_security_policy_granted
60 61 62 |
# File 'lib/stripe/resources/apps/install.rb', line 60 def content_security_policy_granted @content_security_policy_granted end |
#content_security_policy_pending ⇒ Object (readonly)
Attribute for field content_security_policy_pending
62 63 64 |
# File 'lib/stripe/resources/apps/install.rb', line 62 def content_security_policy_pending @content_security_policy_pending end |
#created ⇒ Object (readonly)
Time at which the object was created. Measured in seconds since the Unix epoch.
64 65 66 |
# File 'lib/stripe/resources/apps/install.rb', line 64 def created @created end |
#created_by ⇒ Object (readonly)
The ID of the embedding platform that created the install, if applicable.
66 67 68 |
# File 'lib/stripe/resources/apps/install.rb', line 66 def created_by @created_by end |
#endpoints_granted ⇒ Object (readonly)
The endpoint URLs authorized by the installer.
68 69 70 |
# File 'lib/stripe/resources/apps/install.rb', line 68 def endpoints_granted @endpoints_granted end |
#endpoints_pending ⇒ Object (readonly)
The endpoint URLs requested by the latest app version that the installer has not authorized.
70 71 72 |
# File 'lib/stripe/resources/apps/install.rb', line 70 def endpoints_pending @endpoints_pending end |
#id ⇒ Object (readonly)
Unique identifier for the object.
72 73 74 |
# File 'lib/stripe/resources/apps/install.rb', line 72 def id @id end |
#livemode ⇒ Object (readonly)
If the object exists in live mode, the value is true. If the object exists in test mode, the value is false.
74 75 76 |
# File 'lib/stripe/resources/apps/install.rb', line 74 def livemode @livemode end |
#object ⇒ Object (readonly)
String representing the object's type. Objects of the same type share the same value.
76 77 78 |
# File 'lib/stripe/resources/apps/install.rb', line 76 def object @object end |
#permissions_granted ⇒ Object (readonly)
The permissions authorized by the installer.
78 79 80 |
# File 'lib/stripe/resources/apps/install.rb', line 78 def @permissions_granted end |
#permissions_pending ⇒ Object (readonly)
The permissions requested by the latest app version that the installer has not authorized.
80 81 82 |
# File 'lib/stripe/resources/apps/install.rb', line 80 def @permissions_pending end |
#status ⇒ Object (readonly)
The status of the app install.
82 83 84 |
# File 'lib/stripe/resources/apps/install.rb', line 82 def status @status end |
Class Method Details
.create(params = {}, opts = {}) ⇒ Object
Creates an app install. An account installs its own private app with its own key; public and testing installs are made from the Dashboard. An app developer or embedding platform acting on a connected account through Stripe-Account installs or reinstalls its app there. For a private app, creating an install installs the newest completed upload; when that version is already installed with nothing pending, the existing install is returned.
85 86 87 |
# File 'lib/stripe/resources/apps/install.rb', line 85 def self.create(params = {}, opts = {}) request_stripe_object(method: :post, path: "/v1/apps/installs", params: params, opts: opts) end |
.field_remappings ⇒ Object
131 132 133 |
# File 'lib/stripe/resources/apps/install.rb', line 131 def self.field_remappings @field_remappings = {} end |
.inner_class_types ⇒ Object
124 125 126 127 128 129 |
# File 'lib/stripe/resources/apps/install.rb', line 124 def self.inner_class_types @inner_class_types = { content_security_policy_granted: ContentSecurityPolicyGranted, content_security_policy_pending: ContentSecurityPolicyPending, } end |
.list(params = {}, opts = {}) ⇒ Object
Returns a list of app installs. An app developer or embedding platform filtering by its own app sees the installs across the accounts that installed it; other callers see the installs on their own account. The key selects the environment: a live key lists live installs, a sandbox API key lists the installs on that sandbox, and the key of an app's managed sandbox filtering by app lists that app's installs across every sandbox. For existing accounts that still use legacy test mode, a test mode key lists legacy test mode installs.
90 91 92 |
# File 'lib/stripe/resources/apps/install.rb', line 90 def self.list(params = {}, opts = {}) request_stripe_object(method: :get, path: "/v1/apps/installs", params: params, opts: opts) end |
.object_name ⇒ Object
16 17 18 |
# File 'lib/stripe/resources/apps/install.rb', line 16 def self.object_name "apps.install" end |
.uninstall(id, params = {}, opts = {}) ⇒ Object
Uninstalls an app from the account that installed it.
105 106 107 108 109 110 111 112 |
# File 'lib/stripe/resources/apps/install.rb', line 105 def self.uninstall(id, params = {}, opts = {}) request_stripe_object( method: :post, path: format("/v1/apps/installs/%<id>s/uninstall", { id: CGI.escape(id) }), params: params, opts: opts ) end |
.update(id, params = {}, opts = {}) ⇒ Object
Reauthorizes an app install. The installer grants the permissions, content security policy entries, and endpoints that the version being installed requests. An account reauthorizes its own installs on any channel with its own key; app developers and embedding platforms reauthorize installs on connected accounts through Stripe-Account. For private apps, the version being installed is the newest completed upload.
115 116 117 118 119 120 121 122 |
# File 'lib/stripe/resources/apps/install.rb', line 115 def self.update(id, params = {}, opts = {}) request_stripe_object( method: :post, path: format("/v1/apps/installs/%<id>s", { id: CGI.escape(id) }), params: params, opts: opts ) end |
Instance Method Details
#uninstall(params = {}, opts = {}) ⇒ Object
Uninstalls an app from the account that installed it.
95 96 97 98 99 100 101 102 |
# File 'lib/stripe/resources/apps/install.rb', line 95 def uninstall(params = {}, opts = {}) request_stripe_object( method: :post, path: format("/v1/apps/installs/%<id>s/uninstall", { id: CGI.escape(self["id"]) }), params: params, opts: opts ) end |