public Seat UpdateSeat(Seat seatToUpdate) { if (seatToUpdate is null) { throw new ArgumentNullException(nameof(seatToUpdate)); } UpdateSeat updateSeat = new UpdateSeat { Email = seatToUpdate.AssignedEmail, FirstName = seatToUpdate.AssignedFirstName, LastName = seatToUpdate.AssignedLastName, ExternalId = seatToUpdate.ExternalId ?? string.Empty }; IRestRequest request = new RestRequest($"seats/{seatToUpdate.Uuid}", Method.PUT, DataFormat.Json); request.AddBody(JsonConvert.SerializeObject(updateSeat)); IRestResponse response = _Client.Put(request); if (response.IsSuccessful) { return(JsonConvert.DeserializeObject <Seat>(response.Content)); } return(null); }
public Seat CreateSeat(Seat newSeat, string templateUUID) { if (newSeat is null) { throw new ArgumentNullException(nameof(newSeat)); } UpdateSeat updateSeat = new UpdateSeat { Email = newSeat.AssignedEmail, FirstName = newSeat.AssignedFirstName, LastName = newSeat.AssignedLastName, ExternalId = newSeat.ExternalId }; IRestRequest request = new RestRequest($"events/{templateUUID}/seats", Method.POST, DataFormat.Json); request.AddBody(JsonConvert.SerializeObject(updateSeat)); IRestResponse response = _Client.Post(request); if (response.IsSuccessful) { return(JsonConvert.DeserializeObject <Seat>(response.Content)); } return(null); }