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, 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.



151
152
153
# File 'lib/stripe/resources/privacy/redaction_job.rb', line 151

def created
  @created
end

#idObject (readonly)

Unique identifier for the object.



153
154
155
# File 'lib/stripe/resources/privacy/redaction_job.rb', line 153

def id
  @id
end

#objectObject (readonly)

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



155
156
157
# File 'lib/stripe/resources/privacy/redaction_job.rb', line 155

def object
  @object
end

#objectsObject (readonly)

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



157
158
159
# File 'lib/stripe/resources/privacy/redaction_job.rb', line 157

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.



159
160
161
# File 'lib/stripe/resources/privacy/redaction_job.rb', line 159

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



161
162
163
# File 'lib/stripe/resources/privacy/redaction_job.rb', line 161

def validation_behavior
  @validation_behavior
end

Class Method Details

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

Cancel redaction job method



174
175
176
177
178
179
180
181
# File 'lib/stripe/resources/privacy/redaction_job.rb', line 174

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



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

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…



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

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



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

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



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

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



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

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



164
165
166
167
168
169
170
171
# File 'lib/stripe/resources/privacy/redaction_job.rb', line 164

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



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

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



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

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