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

com.microsoft.store.partnercenter.countryvalidationrules.CountryValidationRulesOperations Maven / Gradle / Ivy

There is a newer version: 1.15.3
Show newest version
// -----------------------------------------------------------------------
// 
//      Copyright (c) Microsoft Corporation. All rights reserved.
// 
// -----------------------------------------------------------------------

package com.microsoft.store.partnercenter.countryvalidationrules;

import java.text.MessageFormat;

import com.fasterxml.jackson.core.type.TypeReference;
import com.microsoft.store.partnercenter.BasePartnerComponentString;
import com.microsoft.store.partnercenter.IPartner;
import com.microsoft.store.partnercenter.PartnerService;
import com.microsoft.store.partnercenter.models.countryvalidationrules.CountryValidationRules;
import com.microsoft.store.partnercenter.network.IPartnerServiceProxy;
import com.microsoft.store.partnercenter.network.PartnerServiceProxy;
import com.microsoft.store.partnercenter.utils.ParameterValidator;

/**
 * The country validation rules operations implementation.
 */
public class CountryValidationRulesOperations 
	extends BasePartnerComponentString
	implements ICountryValidationRules 
{

	/**
	 * Initializes a new instance of the CountryValidationRulesOperations class.
	 * @param rootPartnerOperations The root partner operations instance
	 * @param country The country
	 */
	protected CountryValidationRulesOperations( IPartner rootPartnerOperations, String country )
	{
		super( rootPartnerOperations, country );
		ParameterValidator.isValidCountryCode( country );
	}

	/**
	 * Gets the market specific validation data by country.
	 */
	@Override
	public CountryValidationRules get() 
	{
        IPartnerServiceProxy partnerServiceProxy =
                new PartnerServiceProxy<>( 
					new TypeReference()
					{
					}, 
					this.getPartner(), MessageFormat.format( 
						PartnerService.getInstance().getConfiguration().getApis().get( "GetCountryValidationRulesByCountry" ).getPath(),
						this.getContext() ) );
						
        return partnerServiceProxy.get();
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy