Example #1
0
        public static Edible GetEdible(string ucpc)
        {
            var urlGenerator = new UrlGenerator();
            var ucpcObject   = new UCPC(ucpc, PrimaryObjectType.Edible);

            urlGenerator.GenerateCannabisReportsUrl(ucpcObject);

            Edible edible = DataRequester.GetObject <Edible>(urlGenerator.URL);

            return(edible);
        }
        public static IEnumerable <Product> GetProducerProducts(string ucpc)
        {
            var urlGenerator = new UrlGenerator();
            var ucpcObject   = new UCPC(ucpc, PrimaryObjectType.Producer);

            urlGenerator.GenerateCannabisReportsUrl(ucpcObject, SecondaryObjectType.Product);

            IEnumerable <Product> products = DataRequester.GetObjects <Product>(urlGenerator.URL);

            return(products);
        }
        public static Strain GetExtractStrain(string ucpc)
        {
            var urlGenerator = new UrlGenerator();
            var ucpcObject   = new UCPC(ucpc, PrimaryObjectType.Extract);

            urlGenerator.GenerateCannabisReportsUrl(ucpcObject, SecondaryObjectType.Strain);

            Strain strain = DataRequester.GetObject <Strain>(urlGenerator.URL);

            return(strain);
        }
        public static Product GetProduct(string ucpc)
        {
            var urlGenerator = new UrlGenerator();
            var ucpcObject   = new UCPC(ucpc, PrimaryObjectType.Product);

            urlGenerator.GenerateCannabisReportsUrl(ucpcObject);

            Product product = DataRequester.GetObject <Product>(urlGenerator.URL);

            return(product);
        }
        public static EffectsAndFlavors GetExtractEffectsFlavors(string ucpc)
        {
            var urlGenerator = new UrlGenerator();
            var ucpcObject   = new UCPC(ucpc, PrimaryObjectType.Extract);

            urlGenerator.GenerateCannabisReportsUrl(ucpcObject, SecondaryObjectType.EffectsAndFlavors);

            EffectsAndFlavors effectsAndFlavors = DataRequester.GetObject <EffectsAndFlavors>(urlGenerator.URL);

            return(effectsAndFlavors);
        }
        public static Producer GetExtractProducer(string ucpc)
        {
            var urlGenerator = new UrlGenerator();
            var ucpcObject   = new UCPC(ucpc, PrimaryObjectType.Extract);

            urlGenerator.GenerateCannabisReportsUrl(ucpcObject, SecondaryObjectType.Producer);

            Producer producer = DataRequester.GetObject <Producer>(urlGenerator.URL);

            return(producer);
        }
        public static Extract GetExtract(string ucpc)
        {
            var urlGenerator = new UrlGenerator();
            var ucpcObject   = new UCPC(ucpc, PrimaryObjectType.Extract);

            urlGenerator.GenerateCannabisReportsUrl(ucpcObject);

            Extract extract = DataRequester.GetObject <Extract>(urlGenerator.URL);

            return(extract);
        }
Example #8
0
        public static User GetFlowerUser(string ucpc)
        {
            var urlGenerator = new UrlGenerator();
            var ucpcObject   = new UCPC(ucpc, PrimaryObjectType.Flower);

            urlGenerator.GenerateCannabisReportsUrl(ucpcObject, SecondaryObjectType.User);

            User user = DataRequester.GetObject <User>(urlGenerator.URL);

            return(user);
        }
        public static IEnumerable <Strain> GetStrainGenetics(string ucpc)
        {
            var urlGenerator = new UrlGenerator();
            var ucpcObject   = new UCPC(ucpc, PrimaryObjectType.Strain);

            urlGenerator.GenerateCannabisReportsUrl(ucpcObject, SecondaryObjectType.Genetics);

            IEnumerable <Strain> strains = DataRequester.GetObjects <Strain>(urlGenerator.URL);

            return(strains);
        }
Example #10
0
        public static Flower GetFlower(string ucpc)
        {
            var urlGenerator = new UrlGenerator();
            var ucpcObject   = new UCPC(ucpc, PrimaryObjectType.Flower);

            urlGenerator.GenerateCannabisReportsUrl(ucpcObject);

            Flower flower = DataRequester.GetObject <Flower>(urlGenerator.URL);

            return(flower);
        }
        public static SeedCompany GetStrainSeedCompany(string ucpc)
        {
            var urlGenerator = new UrlGenerator();
            var ucpcObject   = new UCPC(ucpc, PrimaryObjectType.Strain);

            urlGenerator.GenerateCannabisReportsUrl(ucpcObject, SecondaryObjectType.SeedCompany);

            SeedCompany seedCompany = DataRequester.GetObject <SeedCompany>(urlGenerator.URL);

            return(seedCompany);
        }
        public static IEnumerable <Review> GetExtractReviews(string ucpc, int pageNumber = 0)
        {
            var urlGenerator = new UrlGenerator();
            var ucpcObject   = new UCPC(ucpc, PrimaryObjectType.Extract);

            urlGenerator.GenerateCannabisReportsUrl(ucpcObject, SecondaryObjectType.Review);
            urlGenerator.AddQueryParameters(pageNumber);

            IEnumerable <Review> reviews = DataRequester.GetObjects <Review>(urlGenerator.URL);

            return(reviews);
        }
        public static IEnumerable <Strain> GetSeedCompanyStrains(string ucpc, int pageNumber = 0)
        {
            var urlGenerator = new UrlGenerator();
            var ucpcObject   = new UCPC(ucpc, PrimaryObjectType.SeedCompany);

            urlGenerator.GenerateCannabisReportsUrl(ucpcObject, SecondaryObjectType.Strain, isPlural: true);
            urlGenerator.AddQueryParameters(pageNumber);

            IEnumerable <Strain> reviews = DataRequester.GetObjects <Strain>(urlGenerator.URL);

            return(reviews);
        }
Example #14
0
        public void GenerateCannabisReportsUrl(UCPC ucpc, SecondaryObjectType secondaryType, bool isPlural = false)
        {
            GenerateCannabisReportsUrl(ucpc);

            var sb = new StringBuilder();

            sb.Append(URL);
            sb.Append("/");
            sb.Append(GetSecondaryObjectTypeString(secondaryType, isPlural));

            URL = sb.ToString();
        }
Example #15
0
        public void GenerateCannabisReportsUrl(UCPC ucpc)
        {
            GenerateCannabisReportsUrl(ucpc.Type);

            var sb = new StringBuilder();

            sb.Append(URL);
            sb.Append("/");
            sb.Append(ucpc.Code);

            URL = sb.ToString();
        }
        public static IEnumerable <Strain> GetStrainChildren(string ucpc, int pageNumber = 0)
        {
            var urlGenerator = new UrlGenerator();
            var ucpcObject   = new UCPC(ucpc, PrimaryObjectType.Strain);

            urlGenerator.GenerateCannabisReportsUrl(ucpcObject, SecondaryObjectType.Children);
            urlGenerator.AddQueryParameters(pageNumber);

            IEnumerable <Strain> strains = DataRequester.GetObjects <Strain>(urlGenerator.URL);

            return(strains);
        }
Example #17
0
        public void GenerateCannabisReportsUrl(UCPC ucpc, decimal latitude, decimal longitude, int radiusInMiles)
        {
            var sb = new StringBuilder();

            sb.Append(GetBaseUrl());
            sb.Append(GetPrimaryObjectTypeString(ucpc.Type));
            sb.Append("/");
            sb.Append(ucpc.Code);
            sb.Append("/availability/geo/");
            sb.Append(latitude);
            sb.Append("/");
            sb.Append(longitude);
            sb.Append("/");
            sb.Append(radiusInMiles);

            URL = sb.ToString();
        }
        public static IEnumerable <MenuItemSummary> GetExtractAvailability(string ucpc, decimal latitude, decimal longitude, int radiusInMiles, int pageNumber = 0)
        {
            var urlGenerator = new UrlGenerator();
            var ucpcObject   = new UCPC(ucpc, PrimaryObjectType.Extract);

            urlGenerator.GenerateCannabisReportsUrl
            (
                ucpcObject,
                latitude,
                longitude,
                radiusInMiles
            );
            urlGenerator.AddQueryParameters(pageNumber);

            IEnumerable <MenuItemSummary> menuItemSummaries = DataRequester.GetObjects <MenuItemSummary>(urlGenerator.URL);

            return(menuItemSummaries);
        }