示例#1
0
        public async Task <Studio> GetAsync(int id, CancellationToken cancelToken, int?parentId = null)
        {
            var request = _client.NewRequest($"firmorgs/studios/{id}");
            var results = await _client.ExecuteAsync <Studio>(request, cancelToken);

            return(results.Data);
        }
        public async Task <OfficeDivision> GetAsync(int id, CancellationToken cancelToken, int?parentId = null)
        {
            var request = _client.NewRequest($"firmorgs/officedivisions/{id}");
            var results = await _client.ExecuteAsync <OfficeDivision>(request, cancelToken);

            return(results.Data);
        }
        public async Task <IList <Personnel> > CreateAsync(IEnumerable <Personnel> personnel, CancellationToken cancel)
        {
            var request = _client.NewRequest("personnel", Method.POST);

            request.AddBody(personnel);

            var results = await _client.ExecuteAsync <List <Personnel> >(request, cancel);

            return(results.Data);
        }
示例#4
0
        public async Task <Company> GetAsync(int companyId, CancellationToken cancelToken, int?parentId = null)
        {
            var request = _client.NewRequest("companies/{id}");

            request.AddUrlSegment("id", companyId.ToString());

            var results = await _client.ExecuteAsync <Company>(request, cancelToken);

            return(results.Data);
        }
        public async Task <StaffTeam> GetAsync(int id, CancellationToken cancelToken, int?parentId = null)
        {
            var request = _client.NewRequest("opportunities/staffteam/{id}");

            request.AddUrlSegment("id", id.ToString());

            var results = await _client.ExecuteAsync <StaffTeam>(request, cancelToken);

            return(results.Data);
        }
示例#6
0
        public async Task <ContactAddress> GetAsync(int addressId, CancellationToken cancelToken, int?parentId = null)
        {
            if (!parentId.HasValue)
            {
                throw new ArgumentException("Parent id value is required to get contact address.");
            }

            var request = _client.NewRequest("contacts/{id}/addresses/{addressId}");

            request.AddUrlSegment("id", parentId.Value);
            request.AddUrlSegment("addressId", addressId);

            var results = await _client.ExecuteAsync <ContactAddress>(request, cancelToken);

            return(results.Data);
        }