Ejemplo n.º 1
0
        public static List <ContactType> ListContactTypes(this RestfulBusinessApiClient api, int?pageIndex = null,
                                                          int?pageSize = null)
        {
            var query = MakePagingQuery(pageIndex, pageSize);

            return(api.GetJson <List <ContactType> >("ContactTypes/" + query.ToQueryString()) ?? new List <ContactType>());
        }
Ejemplo n.º 2
0
        /// <summary>
        ///     Lists Users using pageIndex & pageSize. pageSize is limited to 200 results.
        /// </summary>
        /// <param name="api"></param>
        /// <param name="pageIndex">current page index</param>
        /// <param name="pageSize">requested page size, under 200.</param>
        /// <returns></returns>
        /// <remarks>
        ///     The server will limit pages to 200 records, using paging to get all records.
        /// </remarks>
        public static List <UserSummary> ListUsers(this RestfulBusinessApiClient api, int?pageIndex = null,
                                                   int?pageSize = null)
        {
            var query = MakePagingQuery(pageIndex, pageSize);

            return(api.GetJson <List <UserSummary> >("Users/" + query.ToQueryString()) ?? new List <UserSummary>());
        }
Ejemplo n.º 3
0
        public static Asset GetAsset(this RestfulBusinessApiClient api, string id)
        {
            if (id == null)
            {
                throw new ArgumentNullException(nameof(id));
            }

            return(api.GetJson <Asset>("Assets/" + id.UrlEncode()));
        }
Ejemplo n.º 4
0
        public static User GetUser(this RestfulBusinessApiClient api, string id)
        {
            if (id == null)
            {
                throw new ArgumentNullException(nameof(id));
            }

            return(api.GetJson <User>("Users/" + id.UrlEncode()));
        }
Ejemplo n.º 5
0
 public static Restaurant GetRestaurant(this RestfulBusinessApiClient api, string id)
 {
     return(api.GetJson <Restaurant>("Restaurants/" + id.UrlEncode()));
 }
Ejemplo n.º 6
0
 public static RetailLocation GetRetailLocation(this RestfulBusinessApiClient api, string id)
 {
     return(api.GetJson <RetailLocation>("RetailLocations/" + id.UrlEncode()));
 }