Class: Stripe::Privacy::RedactionJob
- Inherits:
-
APIResource
- Object
- StripeObject
- APIResource
- Stripe::Privacy::RedactionJob
- Includes:
- APIOperations::Save
- Defined in:
- lib/stripe/resources/privacy/redaction_job.rb
Overview
The Redaction Job object redacts Stripe objects. You can use it to coordinate the removal of personal information from selected objects, making them permanently inaccessible in the Stripe Dashboard and API.
Defined Under Namespace
Classes: Objects
Constant Summary collapse
- OBJECT_NAME =
"privacy.redaction_job"
Constants inherited from StripeObject
StripeObject::RESERVED_FIELD_NAMES
Instance Attribute Summary collapse
-
#created ⇒ Object
readonly
Time at which the object was created.
-
#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.
-
#objects ⇒ Object
readonly
The objects to redact in this job.
-
#status ⇒ Object
readonly
The status of the job.
-
#validation_behavior ⇒ Object
readonly
Validation behavior determines how a job validates objects for redaction eligibility.
-
#validation_errors ⇒ Object
readonly
The first 10 validation errors for the current validation attempt.
Attributes inherited from APIResource
Attributes inherited from StripeObject
Class Method Summary collapse
-
.cancel(job, params = {}, opts = {}) ⇒ Object
You can cancel a redaction job when it’s in one of these statuses: ready, failed.
-
.create(params = {}, opts = {}) ⇒ Object
Creates a redaction job.
- .field_remappings ⇒ Object
- .inner_class_types ⇒ Object
-
.list(params = {}, opts = {}) ⇒ Object
Returns a list of redaction jobs.
- .object_name ⇒ Object
-
.run(job, params = {}, opts = {}) ⇒ Object
Run a redaction job in a ready status.
-
.update(job, params = {}, opts = {}) ⇒ Object
Updates the properties of a redaction job without running or canceling the job.
-
.validate(job, params = {}, opts = {}) ⇒ Object
Validate a redaction job when it is in a failed status.
Instance Method Summary collapse
-
#cancel(params = {}, opts = {}) ⇒ Object
You can cancel a redaction job when it’s in one of these statuses: ready, failed.
-
#run(params = {}, opts = {}) ⇒ Object
Run a redaction job in a ready status.
-
#validate(params = {}, opts = {}) ⇒ Object
Validate a redaction job when it is in a failed status.
Methods included from APIOperations::Create
Methods included from APIOperations::List
Methods included from APIOperations::NestedResource
Methods included from APIOperations::Save
Methods inherited from APIResource
class_name, custom_method, #refresh, #request_stripe_object, resource_url, #resource_url, retrieve, save_nested_resource
Methods included from APIOperations::Request
Methods inherited from StripeObject
#==, #[], #[]=, #_get_inner_class_type, additive_object_param, additive_object_param?, #as_json, construct_from, #deleted?, #dirty!, #each, #eql?, field_encodings, #hash, #initialize, #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
#created ⇒ Object (readonly)
Time at which the object was created. Measured in seconds since the Unix epoch.
52 53 54 |
# File 'lib/stripe/resources/privacy/redaction_job.rb', line 52 def created @created end |
#id ⇒ Object (readonly)
Unique identifier for the object.
54 55 56 |
# File 'lib/stripe/resources/privacy/redaction_job.rb', line 54 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`.
56 57 58 |
# File 'lib/stripe/resources/privacy/redaction_job.rb', line 56 def livemode @livemode end |
#object ⇒ Object (readonly)
String representing the object’s type. Objects of the same type share the same value.
58 59 60 |
# File 'lib/stripe/resources/privacy/redaction_job.rb', line 58 def object @object end |
#objects ⇒ Object (readonly)
The objects to redact in this job.
60 61 62 |
# File 'lib/stripe/resources/privacy/redaction_job.rb', line 60 def objects @objects end |
#status ⇒ Object (readonly)
The status of the job.
62 63 64 |
# File 'lib/stripe/resources/privacy/redaction_job.rb', line 62 def status @status end |
#validation_behavior ⇒ Object (readonly)
Validation behavior determines how a job validates objects for redaction eligibility. Default is ‘error`.
64 65 66 |
# File 'lib/stripe/resources/privacy/redaction_job.rb', line 64 def validation_behavior @validation_behavior end |
#validation_errors ⇒ Object (readonly)
The first 10 validation errors for the current validation attempt. Use the validation errors list endpoint to paginate through the full list.
66 67 68 |
# File 'lib/stripe/resources/privacy/redaction_job.rb', line 66 def validation_errors @validation_errors end |
Class Method Details
.cancel(job, params = {}, opts = {}) ⇒ Object
You can cancel a redaction job when it’s in one of these statuses: ready, failed.
Canceling the redaction job will abandon its attempt to redact the configured objects. A canceled job cannot be used again.
83 84 85 86 87 88 89 90 |
# File 'lib/stripe/resources/privacy/redaction_job.rb', line 83 def self.cancel(job, params = {}, opts = {}) request_stripe_object( method: :post, path: format("/v1/privacy/redaction_jobs/%<job>s/cancel", { job: CGI.escape(job) }), params: params, opts: opts ) end |
.create(params = {}, opts = {}) ⇒ Object
Creates a redaction job. When a job is created, it will start to validate.
93 94 95 96 97 98 99 100 |
# File 'lib/stripe/resources/privacy/redaction_job.rb', line 93 def self.create(params = {}, opts = {}) request_stripe_object( method: :post, path: "/v1/privacy/redaction_jobs", params: params, opts: opts ) end |
.field_remappings ⇒ Object
184 185 186 |
# File 'lib/stripe/resources/privacy/redaction_job.rb', line 184 def self.field_remappings @field_remappings = {} end |
.inner_class_types ⇒ Object
180 181 182 |
# File 'lib/stripe/resources/privacy/redaction_job.rb', line 180 def self.inner_class_types @inner_class_types = { objects: Objects } end |
.list(params = {}, opts = {}) ⇒ Object
Returns a list of redaction jobs.
103 104 105 106 107 108 109 110 |
# File 'lib/stripe/resources/privacy/redaction_job.rb', line 103 def self.list(params = {}, opts = {}) request_stripe_object( method: :get, path: "/v1/privacy/redaction_jobs", params: params, opts: opts ) end |
.object_name ⇒ Object
17 18 19 |
# File 'lib/stripe/resources/privacy/redaction_job.rb', line 17 def self.object_name "privacy.redaction_job" end |
.run(job, params = {}, opts = {}) ⇒ Object
Run a redaction job in a ready status.
When you run a job, the configured objects will be redacted asynchronously. This action is irreversible and cannot be canceled once started.
The status of the job will move to redacting. Once all of the objects are redacted, the status will become succeeded. If the job’s validation_behavior is set to fix, the automatic fixes will be applied to objects at this step.
131 132 133 134 135 136 137 138 |
# File 'lib/stripe/resources/privacy/redaction_job.rb', line 131 def self.run(job, params = {}, opts = {}) request_stripe_object( method: :post, path: format("/v1/privacy/redaction_jobs/%<job>s/run", { job: CGI.escape(job) }), params: params, opts: opts ) end |
.update(job, params = {}, opts = {}) ⇒ Object
Updates the properties of a redaction job without running or canceling the job.
If the job to update is in a failed status, it will not automatically start to validate. Once you applied all of the changes, use the validate API to start validation again.
143 144 145 146 147 148 149 150 |
# File 'lib/stripe/resources/privacy/redaction_job.rb', line 143 def self.update(job, params = {}, opts = {}) request_stripe_object( method: :post, path: format("/v1/privacy/redaction_jobs/%<job>s", { job: CGI.escape(job) }), params: params, opts: opts ) end |
.validate(job, params = {}, opts = {}) ⇒ Object
Validate a redaction job when it is in a failed status.
When a job is created, it automatically begins to validate on the configured objects’ eligibility for redaction. Use this to validate the job again after its validation errors are resolved or the job’s validation_behavior is changed.
The status of the job will move to validating. Once all of the objects are validated, the status of the job will become ready. If there are any validation errors preventing the job from running, the status will become failed.
171 172 173 174 175 176 177 178 |
# File 'lib/stripe/resources/privacy/redaction_job.rb', line 171 def self.validate(job, params = {}, opts = {}) request_stripe_object( method: :post, path: format("/v1/privacy/redaction_jobs/%<job>s/validate", { job: CGI.escape(job) }), params: params, opts: opts ) end |
Instance Method Details
#cancel(params = {}, opts = {}) ⇒ Object
You can cancel a redaction job when it’s in one of these statuses: ready, failed.
Canceling the redaction job will abandon its attempt to redact the configured objects. A canceled job cannot be used again.
71 72 73 74 75 76 77 78 |
# File 'lib/stripe/resources/privacy/redaction_job.rb', line 71 def cancel(params = {}, opts = {}) request_stripe_object( method: :post, path: format("/v1/privacy/redaction_jobs/%<job>s/cancel", { job: CGI.escape(self["id"]) }), params: params, opts: opts ) end |
#run(params = {}, opts = {}) ⇒ Object
Run a redaction job in a ready status.
When you run a job, the configured objects will be redacted asynchronously. This action is irreversible and cannot be canceled once started.
The status of the job will move to redacting. Once all of the objects are redacted, the status will become succeeded. If the job’s validation_behavior is set to fix, the automatic fixes will be applied to objects at this step.
117 118 119 120 121 122 123 124 |
# File 'lib/stripe/resources/privacy/redaction_job.rb', line 117 def run(params = {}, opts = {}) request_stripe_object( method: :post, path: format("/v1/privacy/redaction_jobs/%<job>s/run", { job: CGI.escape(self["id"]) }), params: params, opts: opts ) end |
#validate(params = {}, opts = {}) ⇒ Object
Validate a redaction job when it is in a failed status.
When a job is created, it automatically begins to validate on the configured objects’ eligibility for redaction. Use this to validate the job again after its validation errors are resolved or the job’s validation_behavior is changed.
The status of the job will move to validating. Once all of the objects are validated, the status of the job will become ready. If there are any validation errors preventing the job from running, the status will become failed.
157 158 159 160 161 162 163 164 |
# File 'lib/stripe/resources/privacy/redaction_job.rb', line 157 def validate(params = {}, opts = {}) request_stripe_object( method: :post, path: format("/v1/privacy/redaction_jobs/%<job>s/validate", { job: CGI.escape(self["id"]) }), params: params, opts: opts ) end |