Ejemplo n.º 1
0
        public MovieResponse GetMovie(string MovieApiId, MovieFields MovieFields = MovieFields.ALL)
        {
            string _RequestResourceUrl = ApiResources.Movie.Resource + "/" + MovieApiId;

            Parameter _FieldsParam = null;

            if (MovieFields != MovieFields.ALL)
            {
                _FieldsParam = RestHelper.BuildParameter(ApiResources.Movie.Parameters.FieldList, EnumHelper.CleanEnumAndReturnAsLowercaseString(MovieFields), ParameterType.QueryString);
            }

            return(GetResource <MovieResponse>(_RequestResourceUrl, _FieldsParam));
        }
Ejemplo n.º 2
0
        public IssueResponse GetIssue(string IssueApiId, IssueFields IssueFields = IssueFields.ALL)
        {
            string _RequestResourceUrl = ApiResources.Issue.Resource + "/" + IssueApiId;

            Parameter _FieldsParam = null;

            if (IssueFields != IssueFields.ALL)
            {
                _FieldsParam = RestHelper.BuildParameter(ApiResources.Issue.Parameters.FieldList, EnumHelper.CleanEnumAndReturnAsLowercaseString(IssueFields), ParameterType.QueryString);
            }

            return(GetResource <IssueResponse>(_RequestResourceUrl, _FieldsParam));
        }
Ejemplo n.º 3
0
        public LocationResponse GetLocation(string LocationApiId, LocationFields LocationFields = LocationFields.ALL)
        {
            string _RequestResourceUrl = ApiResources.Location.Resource + "/" + LocationApiId;

            Parameter _FieldsParam = null;

            if (LocationFields != LocationFields.ALL)
            {
                _FieldsParam = RestHelper.BuildParameter(ApiResources.Location.Parameters.FieldList, EnumHelper.CleanEnumAndReturnAsLowercaseString(LocationFields), ParameterType.QueryString);
            }

            return(GetResource <LocationResponse>(_RequestResourceUrl, _FieldsParam));
        }
Ejemplo n.º 4
0
        public ConceptResponse GetConcept(string ConceptApiId, ConceptFields ConceptFields = ConceptFields.ALL)
        {
            string _RequestResourceUrl = ApiResources.Concept.Resource + "/" + ConceptApiId;

            Parameter _FieldsParam = null;

            if (ConceptFields != ConceptFields.ALL)
            {
                _FieldsParam = RestHelper.BuildParameter(ApiResources.Concept.Parameters.FieldList, EnumHelper.CleanEnumAndReturnAsLowercaseString(ConceptFields), ParameterType.QueryString);
            }

            return(GetResource <ConceptResponse>(_RequestResourceUrl, _FieldsParam));
        }
Ejemplo n.º 5
0
        public EpisodeResponse GetEpisode(string EpisodeApiId, EpisodeFields EpisodeFields = EpisodeFields.ALL)
        {
            string _RequestResourceUrl = ApiResources.Episode.Resource + "/" + EpisodeApiId;

            Parameter _FieldsParam = null;

            if (EpisodeFields != EpisodeFields.ALL)
            {
                _FieldsParam = RestHelper.BuildParameter(ApiResources.Episode.Parameters.FieldList, EnumHelper.CleanEnumAndReturnAsLowercaseString(EpisodeFields), ParameterType.QueryString);
            }

            return(GetResource <EpisodeResponse>(_RequestResourceUrl, _FieldsParam));
        }
Ejemplo n.º 6
0
        public VolumeResponse GetVolume(string VolumeApiId, VolumeFields VolumeFields = VolumeFields.ALL)
        {
            string _RequestResourceUrl = ApiResources.Volume.Resource + "/" + VolumeApiId;

            Parameter _FieldsParam = null;

            if (VolumeFields != VolumeFields.ALL)
            {
                _FieldsParam = RestHelper.BuildParameter(ApiResources.Volume.Parameters.FieldList, EnumHelper.CleanEnumAndReturnAsLowercaseString(VolumeFields), ParameterType.QueryString);
            }

            return(GetResource <VolumeResponse>(_RequestResourceUrl, _FieldsParam));
        }
Ejemplo n.º 7
0
        public SearchResponse Search(string Query, SearchFieldList FieldList, RessourceType Resources = RessourceType.ALL, int Limit = 100, int Offset = 0)
        {
            List <Parameter> _Parameters = new List <Parameter>();

            if (Resources != RessourceType.ALL)
            {
                _Parameters.Add(RestHelper.BuildParameter(ApiResources.Search.Parameters.Resources, EnumHelper.CleanEnumAndReturnAsLowercaseString(Resources), ParameterType.QueryString));
            }

            _Parameters.Add(RestHelper.BuildParameter(ApiResources.Search.Parameters.Query, Query, ParameterType.QueryString));

            if (FieldList != null)
            {
                _Parameters.Add(RestHelper.BuildParameter(ApiResources.Search.Parameters.FieldList, FieldList.GetFieldsAsQueryParameter(), ParameterType.QueryString));
            }

            _Parameters.Add(RestHelper.BuildParameter(ApiResources.Search.Parameters.Limit, Limit, ParameterType.QueryString));

            _Parameters.Add(RestHelper.BuildParameter(ApiResources.Search.Parameters.Offset, Offset, ParameterType.QueryString));

            return(GetResource <SearchResponse>(ApiResources.Search.Resource, _Parameters.ToArray()));
        }
Ejemplo n.º 8
0
        public TeamResponse GetTeam(string TeamApiId, TeamFields TeamFields = TeamFields.ALL)
        {
            string _RequestResourceUrl = ApiResources.Team.Resource + "/" + TeamApiId;

            Parameter _FieldsParam = null;

            if (TeamFields != TeamFields.ALL)
            {
                _FieldsParam = RestHelper.BuildParameter(ApiResources.Team.Parameters.FieldList, EnumHelper.CleanEnumAndReturnAsLowercaseString(TeamFields), ParameterType.QueryString);
            }

            return(GetResource <TeamResponse>(_RequestResourceUrl, _FieldsParam));
        }
Ejemplo n.º 9
0
        public StoryArcResponse GetStoryArc(string StoryArcApiId, StoryArcFields StoryArcFields = StoryArcFields.ALL)
        {
            string _RequestResourceUrl = ApiResources.StoryArc.Resource + "/" + StoryArcApiId;

            Parameter _FieldsParam = null;

            if (StoryArcFields != StoryArcFields.ALL)
            {
                _FieldsParam = RestHelper.BuildParameter(ApiResources.StoryArc.Parameters.FieldList, EnumHelper.CleanEnumAndReturnAsLowercaseString(StoryArcFields), ParameterType.QueryString);
            }

            return(GetResource <StoryArcResponse>(_RequestResourceUrl, _FieldsParam));
        }
Ejemplo n.º 10
0
        public PublisherResponse GetPublisher(string PublisherApiId, PublisherFields PublisherFields = PublisherFields.ALL)
        {
            string _RequestResourceUrl = ApiResources.Publisher.Resource + "/" + PublisherApiId;

            Parameter _FieldsParam = null;

            if (PublisherFields != PublisherFields.ALL)
            {
                _FieldsParam = RestHelper.BuildParameter(ApiResources.Publisher.Parameters.FieldList, EnumHelper.CleanEnumAndReturnAsLowercaseString(PublisherFields), ParameterType.QueryString);
            }

            return(GetResource <PublisherResponse>(_RequestResourceUrl, _FieldsParam));
        }
Ejemplo n.º 11
0
        public OriginResponse GetOrigin(string OriginApiId, OriginFields OriginFields = OriginFields.ALL)
        {
            string _RequestResourceUrl = ApiResources.Origin.Resource + "/" + OriginApiId;

            Parameter _FieldsParam = null;

            if (OriginFields != OriginFields.ALL)
            {
                _FieldsParam = RestHelper.BuildParameter(ApiResources.Origin.Parameters.FieldList, EnumHelper.CleanEnumAndReturnAsLowercaseString(OriginFields), ParameterType.QueryString);
            }

            return(GetResource <OriginResponse>(_RequestResourceUrl, _FieldsParam));
        }
Ejemplo n.º 12
0
        public string GetFieldsAsQueryParameter()
        {
            List <string> _Fields = new List <string>();

            if (this.CharacterFields != CharacterFields.ALL)
            {
                _Fields.AddRange(EnumHelper.CleanEnumAndReturnAsLowercaseString(this.CharacterFields).Split(','));
            }

            if (this.ConceptFields != ConceptFields.ALL)
            {
                _Fields.AddRange(EnumHelper.CleanEnumAndReturnAsLowercaseString(this.ConceptFields).Split(','));
            }

            if (this.OriginFields != OriginFields.ALL)
            {
                _Fields.AddRange(EnumHelper.CleanEnumAndReturnAsLowercaseString(this.OriginFields).Split(','));
            }

            if (this.ObjectFields != ObjectFields.ALL)
            {
                _Fields.AddRange(EnumHelper.CleanEnumAndReturnAsLowercaseString(this.ObjectFields).Split(','));
            }

            if (this.LocationFields != LocationFields.ALL)
            {
                _Fields.AddRange(EnumHelper.CleanEnumAndReturnAsLowercaseString(this.LocationFields).Split(','));
            }

            if (this.IssueFields != IssueFields.ALL)
            {
                _Fields.AddRange(EnumHelper.CleanEnumAndReturnAsLowercaseString(this.IssueFields).Split(','));
            }

            if (this.StoryArcFields != StoryArcFields.ALL)
            {
                _Fields.AddRange(EnumHelper.CleanEnumAndReturnAsLowercaseString(this.StoryArcFields).Split(','));
            }

            if (this.VolumeFields != VolumeFields.ALL)
            {
                _Fields.AddRange(EnumHelper.CleanEnumAndReturnAsLowercaseString(this.VolumeFields).Split(','));
            }

            if (this.PublisherFields != PublisherFields.ALL)
            {
                _Fields.AddRange(EnumHelper.CleanEnumAndReturnAsLowercaseString(this.PublisherFields).Split(','));
            }

            if (this.PersonFields != PersonFields.ALL)
            {
                _Fields.AddRange(EnumHelper.CleanEnumAndReturnAsLowercaseString(this.PersonFields).Split(','));
            }

            if (this.TeamFields != TeamFields.ALL)
            {
                _Fields.AddRange(EnumHelper.CleanEnumAndReturnAsLowercaseString(this.TeamFields).Split(','));
            }

            if (this.VideoFields != VideoFields.ALL)
            {
                _Fields.AddRange(EnumHelper.CleanEnumAndReturnAsLowercaseString(this.VideoFields).Split(','));
            }

            return(string.Join(",", _Fields.Distinct()));
        }