Create or update a customer with given id
 @return [Customer] if successfully created or updated
 @raise [Httparty::Error] for all sorts of HTTP statuses.
10139
def save!
      result = Api.post("#{BASE_PATH}/#{customer_id}", body: attributes.to_json)
      Customer.new(result.parsed_response["rg_customer"])
    end
806933
def patch_update
      user = @company.public_send(ScimRails.config.scim_users_scope).find(params[:id])
      update_status(user)
      json_scim_response(object: user)
    end
1226051
def customer_card_id=(customer_card_id)

      if !customer_card_id.nil? && customer_card_id.to_s.length > 192
        fail ArgumentError, "invalid value for 'customer_card_id', the character length must be smaller than or equal to 192."
      end

      @customer_card_id = customer_card_id
    end
178571
def create
      if env['warden'].authenticate(:password, :scope => :user)
        #return the user JSON on success
        render json: current_user, status: :created
      else
        #return error mesage in a JSON on error
        render json: {errors: {user:["Invalid email or password"]}}, status: :unprocessable_entity
      end
    end
494609
def get_customer(self, customer_id):
        
        return self.client._get(self.url + 'customers/{}'.format(customer_id), headers=self.get_headers())
164381
def query_customer(token_customer_id)
      @logger.debug('Query customer with id:' + token_customer_id.to_s) if @logger
      unless @is_valid
        return make_response_with_exception(Exceptions::APIKeyInvalidException.new('API key, password or Rapid endpoint missing or invalid'), QueryCustomerResponse)
      end
      begin
        url = @web_url + Constants::DIRECT_CUSTOMER_SEARCH_METHOD + Constants::JSON_SUFFIX
        url = URI.encode(url)

        request = Message::CustomerProcess::QueryCustomerMsgProcess.create_request(token_customer_id.to_s)
        response = Message::CustomerProcess::QueryCustomerMsgProcess.send_request(url, @api_key, @password, @version, request)
        Message::CustomerProcess::QueryCustomerMsgProcess.make_result(response)
      rescue => e
        @logger.error(e.to_s) if @logger
        make_response_with_exception(e, QueryCustomerResponse)
      end
    end
430007
def update_customer(self, customer_id, **kwargs):
		""""""
		body = self._formdata(kwargs, FastlyCustomer.FIELDS)
		content = self._fetch("/customer/%s" % customer_id, method="PUT", body=body)
		return FastlyCustomer(self, content)
623968
def create_customer(self, name, **kwargs):
        
        data = self._wrap_dict("customer", kwargs)
        data["customer"]["name"] = name
        return self.post("/customers.json", data=data)
1309560
def create(name, *ids)
      resource = self.class::RESOURCE_COLLECTION % { account_id: account.id }
      params = to_params.merge!(app_store_identifiers: ids.join(','), name: name)
      response = Request.new(account.client, :post, resource, params: params).perform
      from_response(response.body[:data])
    end
793539
public Customer createCustomer(Customer customer) {
        if(getCustomer(customer.getEmail()) != null){
            return customerRepository.save(customer);
        }
        return null;
    }
725794
def update(self, resource, id_or_uri):
        
        return self._client.update(resource=resource, uri=id_or_uri)
524592
def update_user(id, user, opts = {})
      data, _status_code, _headers = update_user_with_http_info(id, user, opts)
      return data
    end
1144072
def buyer
      response = JSON.parse(@client.get("items/#{send(:id)}/buyers").body)
      Promisepay::User.new(@client, response['users'])
    end
980681
function Customer() {
    /**
     * The contactId value
     * @member
     */
    this.contactId = null;
    /**
     * The isGuest value
     * @member
     */
    this.isGuest = null;
    /**
     * The name of value
     * @member
     * @type { Name }
     */
    this.name = Object.create(Name.prototype);
    /**
     * The phone value
     * @member
     */
    this.phone = null;
    /**
     * The email value
     * @member
     */
    this.email = null;

}
802935
def update_or_create(self, *args, **kwargs):
        
        obj, created = super().update_or_create(*args, **kwargs)

        if not created:
            return self.with_signal(result=(obj, created))

        return obj, created
16633
def user(id, &callback)
      http(:get, "/users/#{id}.json") do |data, http|
        Firering::User.instantiate(self, data, :user, &callback)
      end
    end
1019379
def get(self, request, **kwargs):
		
		customer, _created = Customer.get_or_create(
			subscriber=subscriber_request_callback(self.request)
		)

		serializer = SubscriptionSerializer(customer.subscription)
		return Response(serializer.data)