示例#1
0
        /// <summary>
        /// Creates a new client under the authenticated account. Makes a POST and a GET request to the Clients resource.
        /// </summary>
        /// <param name="options">The options for the new client to be created</param>
        public Client CreateClient(ClientOptions options)
        {
            var request = Request("clients", RestSharp.Method.POST);

            request.AddBody(options);

            return Execute<Client>(request);
        }
示例#2
0
        /// <summary>
        /// Creates a new client under the authenticated account. Makes both a POST and a GET request to the Clients resource.
        /// </summary>
        /// <param name="name">The name of the client</param>
        /// <param name="currency">The currency for the client</param>
        /// <param name="active">The status of the client</param>
        /// <param name="details">The details (address, phone, etc.) of the client</param>
        /// <param name="highriseId">The related Highrise ID of the client</param>
        public Client CreateClient(string name, Currency? currency = null, bool active = true, string details = null, long? highriseId = null)
        {
            if (name == null)
                throw new ArgumentNullException("name");

            var newClient = new ClientOptions()
            {
                Name = name,
                Active = active,
                Currency = currency,
                Details = details,
                HighriseId = highriseId
            };

            return CreateClient(newClient);
        }
示例#3
0
        /// <summary>
        /// Updates a client on the authenticated account. Makes a PUT and a GET request to the Clients resource.
        /// </summary>
        /// <param name="clientId">The ID for the client to update</param>
        /// <param name="options">The options to be updated</param>
        public Client UpdateClient(long clientId, ClientOptions options)
        {
            var request = Request("clients/" + clientId, RestSharp.Method.PUT);

            request.AddBody(options);

            return Execute<Client>(request);
        }
示例#4
0
        /// <summary>
        /// Update a client on the authenticated account. Makes a PUT and a GET request to the Clients resource.
        /// </summary>
        /// <param name="clientId">The ID of the client to update</param>
        /// <param name="name">The updated name</param>
        /// <param name="currency">The updated currency</param>
        /// <param name="details">The updated details</param>
        /// <param name="highriseId">The updated Highrise ID</param>
        /// <param name="active">The updated state</param>
        public Client UpdateClient(long clientId, string name = null, Currency? currency = null, bool? active = null, string details = null, long? highriseId = null)
        {
            var options = new ClientOptions()
            {
                Name = name,
                Details = details,
                HighriseId = highriseId,
                Currency = currency,
                Active = active
            };

            return UpdateClient(clientId, options);
        }