All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.notronix.etsy.impl.shops.method.GetShopShippingProfilesMethod Maven / Gradle / Ivy

There is a newer version: 3.0.0014
Show newest version
package com.notronix.etsy.impl.shops.method;

import com.google.gson.reflect.TypeToken;
import com.notronix.etsy.api.PageableResponse;
import com.notronix.etsy.api.Unmarshaller;
import com.notronix.etsy.api.authentication.model.Credentials;
import com.notronix.etsy.impl.EtsyPageableResponse;
import com.notronix.etsy.impl.PageableEtsyMethod;
import com.notronix.etsy.impl.shops.model.EtsyShippingProfile;

import static java.util.Objects.requireNonNull;

public class GetShopShippingProfilesMethod extends PageableEtsyMethod
{
    private Long shopId;

    public GetShopShippingProfilesMethod(Credentials clientCredentials, Credentials accessCredentials) {
        super(clientCredentials, accessCredentials);
    }

    @Override
    public PageableResponse getResponse(Unmarshaller unmarshaller, String payload) {
        return unmarshaller.unmarshal(payload,
                new TypeToken>(){}.getType());
    }

    @Override
    protected String getURI() {
        return "/application/shops/" + requireNonNull(shopId) + "/shipping-profiles";
    }

    @Override
    public boolean requiresOAuth() {
        return true;
    }

    public Long getShopId() {
        return shopId;
    }

    public void setShopId(Long shopId) {
        this.shopId = shopId;
    }

    public GetShopShippingProfilesMethod withShopId(Long shopId) {
        this.shopId = shopId;
        return this;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy