class PayPal::SDK::REST::DataTypes::WebProfile

Public Class Methods

find(resource_id) click to toggle source
# File lib/paypal-sdk/rest/data_types.rb, line 2441
def find(resource_id)
  raise ArgumentError.new("id required") if resource_id.to_s.strip.empty?
  path = "v1/payment-experience/web-profiles/#{resource_id}"
  self.new(api.get(path))
end
get_list(options = {}) click to toggle source
# File lib/paypal-sdk/rest/data_types.rb, line 2447
def get_list(options = {})
  path = "v1/payment-experience/web-profiles/"
  l = api.get(path, options)
  # The API is inconsistent in that it returns an array of WebProfiles
  # instead of a JSON object with a property which should be a list
  # of WebProfiles.
  #
  # Note that the WebProfileList is technically incorrect. It should
  # be a WebProfile.new() here, but due to backwards-compatibility,
  # may need to leave it as WebProfileList.
  l.map { |x| WebProfileList.new(x) }
end
load_members() click to toggle source
# File lib/paypal-sdk/rest/data_types.rb, line 2398
def self.load_members
  object_of :id, String
  object_of :name, String
  object_of :temporary, Boolean
  object_of :flow_config, FlowConfig
  object_of :input_fields, InputFields
  object_of :presentation, Presentation
end

Public Instance Methods

create() click to toggle source
# File lib/paypal-sdk/rest/data_types.rb, line 2409
def create()
  path = "v1/payment-experience/web-profiles/"
  response = api.post(path, self.to_hash, http_header)
  self.merge!(response)
  WebProfile.new(response)
end
delete() click to toggle source
# File lib/paypal-sdk/rest/data_types.rb, line 2431
def delete()
  path = "v1/payment-experience/web-profiles/#{self.id}"
  response = api.delete(path, {})
  self.merge!(response)
  success?
end
partial_update(patch_request) click to toggle source
# File lib/paypal-sdk/rest/data_types.rb, line 2423
def partial_update(patch_request)
  patch_request = PatchRequest.new(patch_request) unless patch_request.is_a? PatchRequest
  path = "v1/payment-experience/web-profiles/#{self.id}"
  response = api.patch(path, patch_request.to_hash, http_header)
  self.merge!(response)
  success?
end
update() click to toggle source
# File lib/paypal-sdk/rest/data_types.rb, line 2416
def update()
  path = "v1/payment-experience/web-profiles/#{self.id}"
  response = api.put(path, self.to_hash, http_header)
  self.merge!(response)
  success?
end