Class: Stripe::V2::Core::BatchJob

Inherits:
APIResource show all
Defined in:
lib/stripe/resources/v2/core/batch_job.rb

Overview

A batch job allows you to perform an API operation on a large set of records asynchronously.

Defined Under Namespace

Classes: StatusDetails

Constant Summary collapse

OBJECT_NAME =
"v2.core.batch_job"
ENDPOINT_PATH_V1_ACCOUNT_UPDATE =
"/v1/accounts/:account"
ENDPOINT_PATH_V1_COUPON_CREATE =
"/v1/coupons"
ENDPOINT_PATH_V1_CUSTOMER_UPDATE =
"/v1/customers/:customer"
ENDPOINT_PATH_V1_PROMOTION_CODE_CREATE =
"/v1/promotion_codes"
ENDPOINT_PATH_V1_PROMOTION_CODE_UPDATE =
"/v1/promotion_codes/:promotion_code"
ENDPOINT_PATH_V1_SUBSCRIPTION_UPDATE =
"/v1/subscriptions/:subscription_exposed_id"
ENDPOINT_PATH_V1_SUBSCRIPTION_CANCEL =
"/v1/subscriptions/:subscription_exposed_id"
ENDPOINT_PATH_V1_SUBSCRIPTION_MIGRATE =
"/v1/subscriptions/:subscription/migrate"

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

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

#==, #[], #[]=, #_get_inner_class_type, 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)

Timestamp at which the ‘batch_job` was created.



404
405
406
# File 'lib/stripe/resources/v2/core/batch_job.rb', line 404

def created
  @created
end

#idObject (readonly)

Unique identifier for the ‘batch_job`.



406
407
408
# File 'lib/stripe/resources/v2/core/batch_job.rb', line 406

def id
  @id
end

#livemodeObject (readonly)

Has the value ‘true` if the object exists in live mode or the value `false` if the object exists in test mode.



408
409
410
# File 'lib/stripe/resources/v2/core/batch_job.rb', line 408

def livemode
  @livemode
end

#metadataObject (readonly)

The metadata of the ‘batch_job`.



410
411
412
# File 'lib/stripe/resources/v2/core/batch_job.rb', line 410

def 
  @metadata
end

#objectObject (readonly)

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



412
413
414
# File 'lib/stripe/resources/v2/core/batch_job.rb', line 412

def object
  @object
end

#skip_validationObject (readonly)

Whether validation runs before executing the ‘batch_job`.



414
415
416
# File 'lib/stripe/resources/v2/core/batch_job.rb', line 414

def skip_validation
  @skip_validation
end

#statusObject (readonly)

The current status of the ‘batch_job`.



416
417
418
# File 'lib/stripe/resources/v2/core/batch_job.rb', line 416

def status
  @status
end

#status_detailsObject (readonly)

Additional details about the current state of the ‘batch_job`.



418
419
420
# File 'lib/stripe/resources/v2/core/batch_job.rb', line 418

def status_details
  @status_details
end

Class Method Details

.field_encodingsObject



437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
# File 'lib/stripe/resources/v2/core/batch_job.rb', line 437

def self.field_encodings
  @field_encodings = {
    status_details: {
      kind: :object,
      fields: {
        canceled: {
          kind: :object,
          fields: {
            failure_count: :int64_string,
            output_file: { kind: :object, fields: { size: :int64_string } },
            success_count: :int64_string,
          },
        },
        complete: {
          kind: :object,
          fields: {
            failure_count: :int64_string,
            output_file: { kind: :object, fields: { size: :int64_string } },
            success_count: :int64_string,
          },
        },
        in_progress: {
          kind: :object,
          fields: { failure_count: :int64_string, success_count: :int64_string },
        },
        timeout: {
          kind: :object,
          fields: {
            failure_count: :int64_string,
            output_file: { kind: :object, fields: { size: :int64_string } },
            success_count: :int64_string,
          },
        },
        validating: { kind: :object, fields: { validated_count: :int64_string } },
        validation_failed: {
          kind: :object,
          fields: {
            failure_count: :int64_string,
            output_file: { kind: :object, fields: { size: :int64_string } },
            success_count: :int64_string,
          },
        },
      },
    },
  }
end

.field_remappingsObject



433
434
435
# File 'lib/stripe/resources/v2/core/batch_job.rb', line 433

def self.field_remappings
  @field_remappings = {}
end

.inner_class_typesObject



429
430
431
# File 'lib/stripe/resources/v2/core/batch_job.rb', line 429

def self.inner_class_types
  @inner_class_types = { status_details: StatusDetails }
end

.object_nameObject



10
11
12
# File 'lib/stripe/resources/v2/core/batch_job.rb', line 10

def self.object_name
  "v2.core.batch_job"
end