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: CancelParams, CreateParams, ListParams, Objects, RunParams, UpdateParams, ValidateParams
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
Has the value ‘true` if the object exists in live mode or the value `false` if the object exists in test mode.
-
#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.
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.
-
.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
#==, #[], #[]=, additive_object_param, additive_object_param?, #as_json, construct_from, #deleted?, #dirty!, #each, #eql?, #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.
171 172 173 |
# File 'lib/stripe/resources/privacy/redaction_job.rb', line 171 def created @created end |
#id ⇒ Object (readonly)
Unique identifier for the object.
173 174 175 |
# File 'lib/stripe/resources/privacy/redaction_job.rb', line 173 def id @id end |
#livemode ⇒ Object (readonly)
Has the value ‘true` if the object exists in live mode or the value `false` if the object exists in test mode.
175 176 177 |
# File 'lib/stripe/resources/privacy/redaction_job.rb', line 175 def livemode @livemode end |
#object ⇒ Object (readonly)
String representing the object’s type. Objects of the same type share the same value.
177 178 179 |
# File 'lib/stripe/resources/privacy/redaction_job.rb', line 177 def object @object end |
#objects ⇒ Object (readonly)
The objects to redact in this job.
179 180 181 |
# File 'lib/stripe/resources/privacy/redaction_job.rb', line 179 def objects @objects end |
#status ⇒ Object (readonly)
The status of the job.
181 182 183 |
# File 'lib/stripe/resources/privacy/redaction_job.rb', line 181 def status @status end |
#validation_behavior ⇒ Object (readonly)
Validation behavior determines how a job validates objects for redaction eligibility. Default is ‘error`.
183 184 185 |
# File 'lib/stripe/resources/privacy/redaction_job.rb', line 183 def validation_behavior @validation_behavior 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.
200 201 202 203 204 205 206 207 |
# File 'lib/stripe/resources/privacy/redaction_job.rb', line 200 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.
210 211 212 213 214 215 216 217 |
# File 'lib/stripe/resources/privacy/redaction_job.rb', line 210 def self.create(params = {}, opts = {}) request_stripe_object( method: :post, path: "/v1/privacy/redaction_jobs", params: params, opts: opts ) end |
.list(params = {}, opts = {}) ⇒ Object
Returns a list of redaction jobs.
220 221 222 223 224 225 226 227 |
# File 'lib/stripe/resources/privacy/redaction_job.rb', line 220 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.
248 249 250 251 252 253 254 255 |
# File 'lib/stripe/resources/privacy/redaction_job.rb', line 248 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.
260 261 262 263 264 265 266 267 |
# File 'lib/stripe/resources/privacy/redaction_job.rb', line 260 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.
288 289 290 291 292 293 294 295 |
# File 'lib/stripe/resources/privacy/redaction_job.rb', line 288 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.
188 189 190 191 192 193 194 195 |
# File 'lib/stripe/resources/privacy/redaction_job.rb', line 188 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.
234 235 236 237 238 239 240 241 |
# File 'lib/stripe/resources/privacy/redaction_job.rb', line 234 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.
274 275 276 277 278 279 280 281 |
# File 'lib/stripe/resources/privacy/redaction_job.rb', line 274 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 |