public StatisticsApi(IBitmovinApiClientFactory apiClientFactory)
 {
     _apiClient = apiClientFactory.CreateClient <IStatisticsApiClient>();
     Daily      = new DailyApi(apiClientFactory);
     Encodings  = new EncodingsApi(apiClientFactory);
     Labels     = new LabelsApi(apiClientFactory);
 }
Esempio n. 2
0
        public void GetAllLabels()
        {
            AuthInfosMock.Configure();

            var client = new LabelsApi();
            var labels = client.GETLabels(null, null);

            Assert.IsNotNull(labels);
        }
        public IActionResult Label(Dictionary <string, string> data)
        {
            var apiKey   = "2zWOj6zfmwc98DLwos4B9U5Jg9wOxkAjlX20vgEYtDs";
            var labelApi = new LabelsApi();
            var labelId  = "se-202887313";

            try
            {
                Label result = labelApi.LabelsGet(labelId, apiKey);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling LabelsApi.LabelsPurchaseLabelWithShipment: " + e.Message);
            }
            return(RedirectToAction("Home"));
        }
Esempio n. 4
0
        static void Main(string[] args)
        {
            var shipment = new AddressValidatingShipment
            {
                Confirmation = AddressValidatingShipment.ConfirmationEnum.None,
                CarrierId    = null,
                ServiceCode  = null,

                Packages = new List <ShipmentPackage>
                {
                    new ShipmentPackage
                    {
                        Weight     = new Weight(8, Weight.UnitEnum.Ounce),
                        Dimensions = new Dimensions(Dimensions.UnitEnum.Inch, 5, 5, 5)
                    }
                }
            };

            var apiKey  = GetApiKey();
            var carrier = ChooseCarrier(apiKey);

            shipment.ShipFrom = GetAddress(
                "Where are you shipping FROM?",
                new AddressDTO("John Doe", "5551234567", "Acme Corp.", "100 Main St.", null, null, "Austin", "TX", "78610", "US")
                );

            shipment.ShipTo = GetAddress(
                "Where are you shipping TO?",
                new AddressDTO("John Doe", "5551234567", "Acme Corp.", "100 Main St.", null, null, "Houston", "TX", "77002", "US")
                );

            var rate = ChooseRate(shipment, carrier, apiKey);

            Console.WriteLine("Purchasing label...");
            var isTestLabel = rate.CarrierCode == "stamps_com" || rate.CarrierCode == "endicia";
            var labelsApi   = new LabelsApi();
            var label       = labelsApi.LabelsPurchaseLabelWithRate(rate.RateId, new PurchaseLabelWithoutShipmentRequest(isTestLabel), apiKey);

            Console.WriteLine("Download your label:");
            Console.WriteLine(label.LabelDownload.Href);

            WaitToQuit();
        }
Esempio n. 5
0
 public void Init()
 {
     client   = new ApiClient(subdomain, clientId, clientSecret: clientSecret);
     instance = client.Labels;
 }
Esempio n. 6
0
 public void Init()
 {
     instance = new LabelsApi();
 }