Class: Stripe::Privacy::RedactionJob

Inherits:
APIResource show all
Extended by:
APIOperations::Create, APIOperations::List, APIOperations::NestedResource
Includes:
APIOperations::Save
Defined in:
lib/stripe/resources/privacy/redaction_job.rb

Overview

Redaction Jobs store the status of a redaction request. They are created when a redaction request is made and track the redaction validation and execution.

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

Attributes inherited from APIResource

#save_with_parent

Attributes inherited from StripeObject

#last_response

Class Method Summary collapse

Instance Method Summary collapse

Methods included from APIOperations::Create

create

Methods included from APIOperations::List

list

Methods included from APIOperations::NestedResource

nested_resource_class_methods

Methods included from APIOperations::Save

included, #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

included

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

#createdObject (readonly)

Time at which the object was created. Measured in seconds since the Unix epoch.



172
173
174
# File 'lib/stripe/resources/privacy/redaction_job.rb', line 172

def created
  @created
end

#idObject (readonly)

Unique identifier for the object.



174
175
176
# File 'lib/stripe/resources/privacy/redaction_job.rb', line 174

def id
  @id
end

#objectObject (readonly)

String representing the object’s type. Objects of the same type share the same value.



176
177
178
# File 'lib/stripe/resources/privacy/redaction_job.rb', line 176

def object
  @object
end

#objectsObject (readonly)

The objects at the root level that are subject to redaction.



178
179
180
# File 'lib/stripe/resources/privacy/redaction_job.rb', line 178

def objects
  @objects
end

#statusObject (readonly)

The status field represents the current state of the redaction job. It can take on any of the following values: VALIDATING, READY, REDACTING, SUCCEEDED, CANCELED, FAILED.



180
181
182
# File 'lib/stripe/resources/privacy/redaction_job.rb', line 180

def status
  @status
end

#validation_behaviorObject (readonly)

Default is “error”. If “error”, we will make sure all objects in the graph are redactable in the 1st traversal, otherwise error. If “fix”, where possible, we will auto-fix any validation errors (e.g. by auto-transitioning objects to a terminal state, etc.) in the 2nd traversal before redacting



182
183
184
# File 'lib/stripe/resources/privacy/redaction_job.rb', line 182

def validation_behavior
  @validation_behavior
end

Class Method Details

.cancel(job, params = {}, opts = {}) ⇒ Object

Cancel redaction job method



195
196
197
198
199
200
201
202
# File 'lib/stripe/resources/privacy/redaction_job.rb', line 195

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

Create redaction job method



205
206
207
208
209
210
211
212
# File 'lib/stripe/resources/privacy/redaction_job.rb', line 205

def self.create(params = {}, opts = {})
  request_stripe_object(
    method: :post,
    path: "/v1/privacy/redaction_jobs",
    params: params,
    opts: opts
  )
end

.list(params = {}, opts = {}) ⇒ Object

List redaction jobs method…



215
216
217
218
219
220
221
222
# File 'lib/stripe/resources/privacy/redaction_job.rb', line 215

def self.list(params = {}, opts = {})
  request_stripe_object(
    method: :get,
    path: "/v1/privacy/redaction_jobs",
    params: params,
    opts: opts
  )
end

.object_nameObject



15
16
17
# File 'lib/stripe/resources/privacy/redaction_job.rb', line 15

def self.object_name
  "privacy.redaction_job"
end

.run(job, params = {}, opts = {}) ⇒ Object

Run redaction job method



235
236
237
238
239
240
241
242
# File 'lib/stripe/resources/privacy/redaction_job.rb', line 235

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

Update redaction job method



245
246
247
248
249
250
251
252
# File 'lib/stripe/resources/privacy/redaction_job.rb', line 245

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 redaction job method



265
266
267
268
269
270
271
272
# File 'lib/stripe/resources/privacy/redaction_job.rb', line 265

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

Cancel redaction job method



185
186
187
188
189
190
191
192
# File 'lib/stripe/resources/privacy/redaction_job.rb', line 185

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 redaction job method



225
226
227
228
229
230
231
232
# File 'lib/stripe/resources/privacy/redaction_job.rb', line 225

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 redaction job method



255
256
257
258
259
260
261
262
# File 'lib/stripe/resources/privacy/redaction_job.rb', line 255

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