services-api-model

AmzSpApi::ServicesApiModel - the Ruby gem for the Selling Partner API for Services

With the Services API, you can build applications that help service providers get and modify their service orders.

This SDK is automatically generated by the Swagger Codegen project:

Installation

Build a gem

To build the Ruby code into a gem:

gem build services-api-model.gemspec

Then either install the gem locally:

gem install ./services-api-model-0.1.0.gem

(for development, run gem install --dev ./services-api-model-0.1.0.gem to install the development dependencies)

or publish the gem to a gem hosting service, e.g. RubyGems.

Finally add this to the Gemfile:

gem 'services-api-model', '~> 0.1.0'

Install from Git

If the Ruby gem is hosted at a git repository: github.com/GIT_USER_ID/GIT_REPO_ID, then add the following in the Gemfile:

gem 'services-api-model', :git => 'https://github.com/GIT_USER_ID/GIT_REPO_ID.git'

Include the Ruby code directly

Include the Ruby code directly using -I as follows:

ruby -Ilib script.rb

Getting Started

Please follow the installation procedure and then run the following code:

# Load the gem
require 'services-api-model'

api_instance = AmzSpApi::ServicesApiModel::ServiceApi.new
body = AmzSpApi::ServicesApiModel::AddAppointmentRequest.new # AddAppointmentRequest | Add appointment operation input details.
service_job_id = 'service_job_id_example' # String | An Amazon defined service job identifier.


begin
  result = api_instance.add_appointment_for_service_job_by_service_job_id(body, service_job_id)
  p result
rescue AmzSpApi::ServicesApiModel::ApiError => e
  puts "Exception when calling ServiceApi->add_appointment_for_service_job_by_service_job_id: #{e}"
end

api_instance = AmzSpApi::ServicesApiModel::ServiceApi.new
service_job_id = 'service_job_id_example' # String | An Amazon defined service job identifier.
cancellation_reason_code = 'cancellation_reason_code_example' # String | A cancel reason code that specifies the reason for cancelling a service job.


begin
  result = api_instance.cancel_service_job_by_service_job_id(service_job_id, cancellation_reason_code)
  p result
rescue AmzSpApi::ServicesApiModel::ApiError => e
  puts "Exception when calling ServiceApi->cancel_service_job_by_service_job_id: #{e}"
end

api_instance = AmzSpApi::ServicesApiModel::ServiceApi.new
service_job_id = 'service_job_id_example' # String | An Amazon defined service job identifier.


begin
  result = api_instance.complete_service_job_by_service_job_id(service_job_id)
  p result
rescue AmzSpApi::ServicesApiModel::ApiError => e
  puts "Exception when calling ServiceApi->complete_service_job_by_service_job_id: #{e}"
end

api_instance = AmzSpApi::ServicesApiModel::ServiceApi.new
service_job_id = 'service_job_id_example' # String | A service job identifier.


begin
  result = api_instance.get_service_job_by_service_job_id(service_job_id)
  p result
rescue AmzSpApi::ServicesApiModel::ApiError => e
  puts "Exception when calling ServiceApi->get_service_job_by_service_job_id: #{e}"
end

api_instance = AmzSpApi::ServicesApiModel::ServiceApi.new
marketplace_ids = ['marketplace_ids_example'] # Array<String> | Used to select jobs that were placed in the specified marketplaces.
opts = { 
  service_order_ids: ['service_order_ids_example'], # Array<String> | List of service order ids for the query you want to perform.Max values supported 20.
  service_job_status: ['service_job_status_example'], # Array<String> | A list of one or more job status by which to filter the list of jobs.
  page_token: 'page_token_example', # String | String returned in the response of your previous request.
  page_size: 20, # Integer | A non-negative integer that indicates the maximum number of jobs to return in the list, Value must be 1 - 20. Default 20.
  sort_field: 'sort_field_example', # String | Sort fields on which you want to sort the output.
  sort_order: 'sort_order_example', # String | Sort order for the query you want to perform.
  created_after: 'created_after_example', # String | A date used for selecting jobs created after (or at) a specified time must be in ISO 8601 format. Required if LastUpdatedAfter is not specified.Specifying both CreatedAfter and LastUpdatedAfter returns an error.
  created_before: 'created_before_example', # String | A date used for selecting jobs created before (or at) a specified time must be in ISO 8601 format.
  last_updated_after: 'last_updated_after_example', # String | A date used for selecting jobs updated after (or at) a specified time must be in ISO 8601 format. Required if createdAfter is not specified.Specifying both CreatedAfter and LastUpdatedAfter returns an error.
  last_updated_before: 'last_updated_before_example', # String | A date used for selecting jobs updated before (or at) a specified time must be in ISO 8601 format.
  schedule_start_date: 'schedule_start_date_example', # String | A date used for filtering jobs schedule after (or at) a specified time must be in ISO 8601 format. schedule end date should not be earlier than schedule start date.
  schedule_end_date: 'schedule_end_date_example' # String | A date used for filtering jobs schedule before (or at) a specified time must be in ISO 8601 format. schedule end date should not be earlier than schedule start date.
}

begin
  result = api_instance.get_service_jobs(marketplace_ids, opts)
  p result
rescue AmzSpApi::ServicesApiModel::ApiError => e
  puts "Exception when calling ServiceApi->get_service_jobs: #{e}"
end

api_instance = AmzSpApi::ServicesApiModel::ServiceApi.new
body = AmzSpApi::ServicesApiModel::RescheduleAppointmentRequest.new # RescheduleAppointmentRequest | Reschedule appointment operation input details.
service_job_id = 'service_job_id_example' # String | An Amazon defined service job identifier.
appointment_id = 'appointment_id_example' # String | An existing appointment identifier for the Service Job.


begin
  result = api_instance.reschedule_appointment_for_service_job_by_service_job_id(body, service_job_id, appointment_id)
  p result
rescue AmzSpApi::ServicesApiModel::ApiError => e
  puts "Exception when calling ServiceApi->reschedule_appointment_for_service_job_by_service_job_id: #{e}"
end

Documentation for API Endpoints

All URIs are relative to https://sellingpartnerapi-na.amazon.com/

Class | Method | HTTP request | Description ———— | ————- | ————- | ————- AmzSpApi::ServicesApiModel::ServiceApi | {add_appointment_for_service_job_by_service_job_id} | POST /service/v1/serviceJobs/{serviceJobId}/appointments | AmzSpApi::ServicesApiModel::ServiceApi | {cancel_service_job_by_service_job_id} | PUT /service/v1/serviceJobs/{serviceJobId}/cancellations | AmzSpApi::ServicesApiModel::ServiceApi | {complete_service_job_by_service_job_id} | PUT /service/v1/serviceJobs/{serviceJobId}/completions | AmzSpApi::ServicesApiModel::ServiceApi | {get_service_job_by_service_job_id} | GET /service/v1/serviceJobs/{serviceJobId} | AmzSpApi::ServicesApiModel::ServiceApi | {get_service_jobs} | GET /service/v1/serviceJobs | AmzSpApi::ServicesApiModel::ServiceApi | {reschedule_appointment_for_service_job_by_service_job_id} | POST /service/v1/serviceJobs/{serviceJobId}/appointments/{appointmentId} |

Documentation for Models

Documentation for Authorization

All endpoints do not require authorization.