public async Task <Mozu.Api.Contracts.ProductAdmin.ProductType> AddProductType(int tenantId, int?siteId,
                                                                                       int?masterCatalogId, Mozu.Api.Contracts.ProductAdmin.ProductType productType)
        {
            _apiContext = new ApiContext(tenantId, siteId, masterCatalogId);

            var productTypeResource = new ProductTypeResource(_apiContext);
            var newProductType      = await productTypeResource.AddProductTypeAsync(productType, null);

            return(newProductType);
        }
        public async Task <IEnumerable <Mozu.Api.Contracts.ProductAdmin.ProductType> > GetProductTypes(int tenantId, int?siteId,
                                                                                                       int?masterCatalogId, int?startIndex, int?pageSize, string sortBy = null, string filter = null)
        {
            _apiContext = new ApiContext(tenantId, siteId, masterCatalogId);

            var productTypeResource = new ProductTypeResource(_apiContext);
            var productTypes        = await productTypeResource.GetProductTypesAsync(startIndex, pageSize, sortBy, filter, null);

            return(productTypes.Items);
        }
        protected override async Task <bool> GetDataAsync()
        {
            var resource = new ProductTypeResource(Context);

            _results = await resource.GetProductTypesAsync(startIndex : StartIndex, pageSize : PageSize, sortBy : SortBy, filter : Filter, responseFields : ResponseFields);

            TotalCount = _results.TotalCount;
            PageCount  = _results.PageCount;
            PageSize   = _results.PageSize;
            return(_results.Items != null && _results.Items.Count > 0);
        }
        public async Task <Mozu.Api.Contracts.ProductAdmin.ProductType> UpdateProductType(int tenantId, int?siteId,
                                                                                          int?masterCatalogId, Mozu.Api.Contracts.ProductAdmin.ProductType productType)
        {
            _apiContext = new ApiContext(tenantId, siteId, masterCatalogId);

            var productTypeResource = new ProductTypeResource(_apiContext);
            var updatedProductType  = await productTypeResource.UpdateProductTypeAsync(productType,
                                                                                       Convert.ToInt32(productType.Id), null);

            return(updatedProductType);
        }