diff --git a/sdks/VERSION b/sdks/VERSION index 0d91a54c7..1d0ba9ea1 100644 --- a/sdks/VERSION +++ b/sdks/VERSION @@ -1 +1 @@ -0.3.0 +0.4.0 diff --git a/sdks/dotnet/CHANGELOG.md b/sdks/dotnet/CHANGELOG.md index 8ba8118a4..4152bfb5e 100644 --- a/sdks/dotnet/CHANGELOG.md +++ b/sdks/dotnet/CHANGELOG.md @@ -1,5 +1,10 @@ # Changelog +## 0.4.0 + +- Regenerated from the API's OpenAPI document at 2eb77126153a. What changed in the API: the + [API changelog](https://coss.com/docs/api-reference/changelog). + ## 0.3.0 - Regenerated from the API's OpenAPI document at 820256d03a44. What changed in the API: the diff --git a/sdks/dotnet/reference.md b/sdks/dotnet/reference.md index 3ca4aace6..2b95fa007 100644 --- a/sdks/dotnet/reference.md +++ b/sdks/dotnet/reference.md @@ -13416,8 +13416,8 @@ await client.Scheduling.Hosts.UpdateAsync( -## Scheduling Schedules -
client.Scheduling.Schedules.ListAsync(ListSchedulesRequest { ... }) -> WithRawResponseTask<SchedulingScheduleList> +## Scheduling Bookings +
client.Scheduling.Bookings.ReassignAsync(ReassignSchedulingBookingRequest { ... }) -> WithRawResponseTask<SchedulingBooking>
@@ -13429,7 +13429,7 @@ await client.Scheduling.Hosts.UpdateAsync(
-All of the host's schedules, oldest first. +Gives a booking to another host, keeping its id and time. Works for every kind: a group session moves as a whole, from any of its seats, and one that's already started changes for the record, with nobody told. Whoever leaves and joins is told, and the attendee unless you say not to.
@@ -13444,8 +13444,16 @@ All of the host's schedules, oldest first.
```csharp -await client.Scheduling.Schedules.ListAsync( - new ListSchedulesRequest { Host = "host_01kd2m9a0b1c2d3e4f5g6h7j8m" } +await client.Scheduling.Bookings.ReassignAsync( + new ReassignSchedulingBookingRequest + { + Id = "book_01kd2m9a0b1c2d3e4f5g6h7j8m", + Changes = new List() + { + new ReassignSchedulingBookingRequestChangesItem { ToHost = "doctor_518" }, + }, + ReasonCode = ReassignSchedulingBookingRequestReasonCode.OutOfOffice, + } ); ```
@@ -13461,7 +13469,7 @@ await client.Scheduling.Schedules.ListAsync(
-**request:** `ListSchedulesRequest` +**request:** `ReassignSchedulingBookingRequest`
@@ -13473,7 +13481,7 @@ await client.Scheduling.Schedules.ListAsync(
-
client.Scheduling.Schedules.CreateAsync(CreateSchedulesRequest { ... }) -> WithRawResponseTask<SchedulingSchedule> +
client.Scheduling.Bookings.ReassignCandidatesAsync(ReassignCandidatesBookingsRequest { ... }) -> WithRawResponseTask<SchedulingReassignCandidateList>
@@ -13485,7 +13493,7 @@ await client.Scheduling.Schedules.ListAsync(
-A host's weekly hours and date overrides, in local time. The first one is the host's default. +The environment's other active hosts: members of the event type first, in the order a pool would pick them, each saying whether they're free and why not. Things can change before you ask: reassigning decides again.
@@ -13500,35 +13508,8 @@ A host's weekly hours and date overrides, in local time. The first one is the ho
```csharp -await client.Scheduling.Schedules.CreateAsync( - new CreateSchedulesRequest - { - Host = "host_01kd2m9a0b1c2d3e4f5g6h7j8m", - Body = new UpsertScheduleRequest - { - Name = "Clinic hours", - Rules = new List() - { - new SchedulingWeeklyRule - { - Days = new List() { 1, 2, 3, 4, 5 }, - Start = "09:00", - End = "17:00", - }, - }, - Overrides = new List() - { - new SchedulingScheduleOverride - { - Date = "2027-12-24", - Ranges = new List() - { - new SchedulingScheduleOverrideRangesItem { Start = "start", End = "end" }, - }, - }, - }, - }, - } +await client.Scheduling.Bookings.ReassignCandidatesAsync( + new ReassignCandidatesBookingsRequest { Id = "book_01kd2m9a0b1c2d3e4f5g6h7j8m" } ); ```
@@ -13544,7 +13525,7 @@ await client.Scheduling.Schedules.CreateAsync(
-**request:** `CreateSchedulesRequest` +**request:** `ReassignCandidatesBookingsRequest`
@@ -13556,7 +13537,7 @@ await client.Scheduling.Schedules.CreateAsync(
-
client.Scheduling.Schedules.GetAsync(GetSchedulesRequest { ... }) -> WithRawResponseTask<SchedulingSchedule> +
client.Scheduling.Bookings.ListAsync(ListBookingsRequest { ... }) -> WithRawResponseTask<SchedulingBookingList>
@@ -13568,7 +13549,7 @@ await client.Scheduling.Schedules.CreateAsync(
-One of the host's schedules. +The environment's bookings, newest first. Answers aren't included.
@@ -13583,11 +13564,11 @@ One of the host's schedules.
```csharp -await client.Scheduling.Schedules.GetAsync( - new GetSchedulesRequest +await client.Scheduling.Bookings.ListAsync( + new ListBookingsRequest { - Host = "host_01kd2m9a0b1c2d3e4f5g6h7j8m", - ScheduleId = "sched_01kd2m9a0b1c2d3e4f5g6h7j8m", + StartAfter = "2027-01-04T15:00:00.000Z", + StartBefore = "2027-01-04T15:00:00.000Z", } ); ``` @@ -13604,7 +13585,7 @@ await client.Scheduling.Schedules.GetAsync(
-**request:** `GetSchedulesRequest` +**request:** `ListBookingsRequest`
@@ -13616,7 +13597,7 @@ await client.Scheduling.Schedules.GetAsync(
-
client.Scheduling.Schedules.UpdateAsync(UpdateSchedulesRequest { ... }) -> WithRawResponseTask<SchedulingSchedule> +
client.Scheduling.Bookings.CreateAsync(CreateBookingRequest { ... }) -> WithRawResponseTask<SchedulingBooking>
@@ -13628,7 +13609,7 @@ await client.Scheduling.Schedules.GetAsync(
-Replaces its weekly rules, and its overrides when given. Existing bookings stay: a schedule only decides what's offered next. +Books a slot, or joins a group session. Without a `host`, a pool chooses fairly among those free. An event type that requires approval answers with a `pending_approval` booking.
@@ -13643,34 +13624,18 @@ Replaces its weekly rules, and its overrides when given. Existing bookings stay:
```csharp -await client.Scheduling.Schedules.UpdateAsync( - new UpdateSchedulesRequest +await client.Scheduling.Bookings.CreateAsync( + new CreateBookingRequest { - Host = "host_01kd2m9a0b1c2d3e4f5g6h7j8m", - ScheduleId = "sched_01kd2m9a0b1c2d3e4f5g6h7j8m", - Body = new UpsertScheduleRequest + IdempotencyKey = "welcome-user-123", + EventType = "evtype_01kd2m9a0b1c2d3e4f5g6h7j8m", + Start = "2027-01-04T15:00:00.000Z", + Attendee = new SchedulingAttendeeInput { - Name = "Clinic hours", - Rules = new List() - { - new SchedulingWeeklyRule - { - Days = new List() { 1, 2, 3, 4, 5 }, - Start = "09:00", - End = "17:00", - }, - }, - Overrides = new List() - { - new SchedulingScheduleOverride - { - Date = "2027-12-24", - Ranges = new List() - { - new SchedulingScheduleOverrideRangesItem { Start = "start", End = "end" }, - }, - }, - }, + Uid = "patient_77", + Name = "Sam Lee", + Email = "sam@example.com", + TimeZone = "UTC", }, } ); @@ -13688,7 +13653,7 @@ await client.Scheduling.Schedules.UpdateAsync(
-**request:** `UpdateSchedulesRequest` +**request:** `CreateBookingRequest`
@@ -13700,7 +13665,7 @@ await client.Scheduling.Schedules.UpdateAsync(
-
client.Scheduling.Schedules.RemoveAsync(RemoveSchedulesRequest { ... }) -> WithRawResponseTask<DeletedSchedulingSchedule> +
client.Scheduling.Bookings.GetAsync(GetBookingsRequest { ... }) -> WithRawResponseTask<SchedulingBooking>
@@ -13712,7 +13677,7 @@ await client.Scheduling.Schedules.UpdateAsync(
-Refused for the host's default schedule. +A booking with its attendees and their answers.
@@ -13727,12 +13692,8 @@ Refused for the host's default schedule.
```csharp -await client.Scheduling.Schedules.RemoveAsync( - new RemoveSchedulesRequest - { - Host = "host_01kd2m9a0b1c2d3e4f5g6h7j8m", - ScheduleId = "sched_01kd2m9a0b1c2d3e4f5g6h7j8m", - } +await client.Scheduling.Bookings.GetAsync( + new GetBookingsRequest { Id = "book_01kd2m9a0b1c2d3e4f5g6h7j8m" } ); ```
@@ -13748,7 +13709,7 @@ await client.Scheduling.Schedules.RemoveAsync(
-**request:** `RemoveSchedulesRequest` +**request:** `GetBookingsRequest`
@@ -13760,8 +13721,7 @@ await client.Scheduling.Schedules.RemoveAsync(
-## Scheduling EventTypes -
client.Scheduling.EventTypes.ListAsync(ListEventTypesRequest { ... }) -> WithRawResponseTask<SchedulingEventTypeList> +
client.Scheduling.Bookings.RescheduleAsync(RescheduleBookingRequest { ... }) -> WithRawResponseTask<SchedulingBooking>
@@ -13773,7 +13733,7 @@ await client.Scheduling.Schedules.RemoveAsync(
-The environment's event types, newest first. +Moves it to a new time, keeping its id. The old time stays booked if the new one isn't free.
@@ -13788,7 +13748,13 @@ The environment's event types, newest first.
```csharp -await client.Scheduling.EventTypes.ListAsync(new Coss.Scheduling.ListEventTypesRequest()); +await client.Scheduling.Bookings.RescheduleAsync( + new RescheduleBookingRequest + { + Id = "book_01kd2m9a0b1c2d3e4f5g6h7j8m", + Start = "2027-01-05T15:00:00.000Z", + } +); ```
@@ -13803,7 +13769,7 @@ await client.Scheduling.EventTypes.ListAsync(new Coss.Scheduling.ListEventTypesR
-**request:** `ListEventTypesRequest` +**request:** `RescheduleBookingRequest`
@@ -13815,7 +13781,7 @@ await client.Scheduling.EventTypes.ListAsync(new Coss.Scheduling.ListEventTypesR
-
client.Scheduling.EventTypes.CreateAsync(CreateEventTypeRequest { ... }) -> WithRawResponseTask<SchedulingEventType> +
client.Scheduling.Bookings.CancelAsync(CancelSchedulingBookingRequest { ... }) -> WithRawResponseTask<SchedulingBooking>
@@ -13827,7 +13793,7 @@ await client.Scheduling.EventTypes.ListAsync(new Coss.Scheduling.ListEventTypesR
-What can be booked: `one_on_one` with one host, `pool` for any free host, `collective` when every required host must be free, or `group` for a session with seats. +Frees the time and removes the calendar event. A cancelled booking stays charged.
@@ -13842,18 +13808,11 @@ What can be booked: `one_on_one` with one host, `pool` for any free host, `colle
```csharp -await client.Scheduling.EventTypes.CreateAsync( - new CreateEventTypeRequest +await client.Scheduling.Bookings.CancelAsync( + new CancelSchedulingBookingRequest { - Kind = CreateEventTypeRequestKind.OneOnOne, - Title = "Initial consultation", - DurationMinutes = 30, - BufferAfterMinutes = 10, - MinNoticeMinutes = 120, - Hosts = new List() - { - new SchedulingEventTypeHostInput { Host = "doctor_482" }, - }, + Id = "book_01kd2m9a0b1c2d3e4f5g6h7j8m", + Reason = "Feeling better", } ); ``` @@ -13870,7 +13829,7 @@ await client.Scheduling.EventTypes.CreateAsync(
-**request:** `CreateEventTypeRequest` +**request:** `CancelSchedulingBookingRequest`
@@ -13882,7 +13841,7 @@ await client.Scheduling.EventTypes.CreateAsync(
-
client.Scheduling.EventTypes.GetAsync(GetEventTypesRequest { ... }) -> WithRawResponseTask<SchedulingEventType> +
client.Scheduling.Bookings.EventsAsync(EventsBookingsRequest { ... }) -> WithRawResponseTask<SchedulingBookingEventList>
@@ -13894,7 +13853,7 @@ await client.Scheduling.EventTypes.CreateAsync(
-An event type by its id or your uid. +What's happened to a booking, oldest first, and who did it. There's no personal data in here.
@@ -13909,8 +13868,8 @@ An event type by its id or your uid.
```csharp -await client.Scheduling.EventTypes.GetAsync( - new Coss.Scheduling.GetEventTypesRequest { EventType = "evtype_01kd2m9a0b1c2d3e4f5g6h7j8m" } +await client.Scheduling.Bookings.EventsAsync( + new EventsBookingsRequest { Id = "book_01kd2m9a0b1c2d3e4f5g6h7j8m" } ); ```
@@ -13926,7 +13885,7 @@ await client.Scheduling.EventTypes.GetAsync(
-**request:** `GetEventTypesRequest` +**request:** `EventsBookingsRequest`
@@ -13938,7 +13897,7 @@ await client.Scheduling.EventTypes.GetAsync(
-
client.Scheduling.EventTypes.UpdateAsync(UpdateEventTypeRequest { ... }) -> WithRawResponseTask<SchedulingEventType> +
client.Scheduling.Bookings.ApproveAsync(ApproveBookingsRequest { ... }) -> WithRawResponseTask<SchedulingBooking>
@@ -13950,7 +13909,7 @@ await client.Scheduling.EventTypes.GetAsync(
-Changes what's given. Existing bookings keep what they were booked with. Set `status` to `archived` to stop new bookings. +Confirms a `pending_approval` booking.
@@ -13965,12 +13924,8 @@ Changes what's given. Existing bookings keep what they were booked with. Set `st
```csharp -await client.Scheduling.EventTypes.UpdateAsync( - new UpdateEventTypeRequest - { - EventType = "evtype_01kd2m9a0b1c2d3e4f5g6h7j8m", - MinNoticeMinutes = 240, - } +await client.Scheduling.Bookings.ApproveAsync( + new ApproveBookingsRequest { Id = "book_01kd2m9a0b1c2d3e4f5g6h7j8m" } ); ```
@@ -13986,7 +13941,7 @@ await client.Scheduling.EventTypes.UpdateAsync(
-**request:** `UpdateEventTypeRequest` +**request:** `ApproveBookingsRequest`
@@ -13998,8 +13953,7 @@ await client.Scheduling.EventTypes.UpdateAsync(
-## Scheduling Slots -
client.Scheduling.Slots.ListAsync(ListSlotsRequest { ... }) -> WithRawResponseTask<SchedulingSlotList> +
client.Scheduling.Bookings.DeclineAsync(DeclineBookingsRequest { ... }) -> WithRawResponseTask<SchedulingBooking>
@@ -14011,7 +13965,7 @@ await client.Scheduling.EventTypes.UpdateAsync(
-Starts an attendee can book between `start` and `end` (at most 62 days), as UTC instants to show in their own time zone. A host whose calendar can't be read isn't offered. +Refuses a `pending_approval` booking and frees the time.
@@ -14026,13 +13980,8 @@ Starts an attendee can book between `start` and `end` (at most 62 days), as UTC
```csharp -await client.Scheduling.Slots.ListAsync( - new ListSlotsRequest - { - EventType = "evtype_01kd2m9a0b1c2d3e4f5g6h7j8m", - Start = "2027-01-04T15:00:00.000Z", - End = "2027-01-04T15:00:00.000Z", - } +await client.Scheduling.Bookings.DeclineAsync( + new DeclineBookingsRequest { Id = "book_01kd2m9a0b1c2d3e4f5g6h7j8m" } ); ```
@@ -14048,7 +13997,7 @@ await client.Scheduling.Slots.ListAsync(
-**request:** `ListSlotsRequest` +**request:** `DeclineBookingsRequest`
@@ -14060,7 +14009,7 @@ await client.Scheduling.Slots.ListAsync(
-
client.Scheduling.Slots.ExplainAsync(ExplainSlotsRequest { ... }) -> WithRawResponseTask<SchedulingSlotExplanation> +
client.Scheduling.Bookings.NotificationsAsync(NotificationsBookingsRequest { ... }) -> WithRawResponseTask<SchedulingBookingNotificationList>
@@ -14072,7 +14021,7 @@ await client.Scheduling.Slots.ListAsync(
-Why one start can or can't be booked right now, host by host, decided the same way a booking is. For support and debugging: it says when a host is busy, so don't show it to attendees. +What's been queued for this booking and what became of it, newest first, including why something wasn't sent. It never says who it went to.
@@ -14087,12 +14036,8 @@ Why one start can or can't be booked right now, host by host, decided the same w
```csharp -await client.Scheduling.Slots.ExplainAsync( - new ExplainSlotsRequest - { - EventType = "evtype_01kd2m9a0b1c2d3e4f5g6h7j8m", - Start = "2027-01-04T15:00:00.000Z", - } +await client.Scheduling.Bookings.NotificationsAsync( + new NotificationsBookingsRequest { Id = "book_01kd2m9a0b1c2d3e4f5g6h7j8m" } ); ```
@@ -14108,7 +14053,7 @@ await client.Scheduling.Slots.ExplainAsync(
-**request:** `ExplainSlotsRequest` +**request:** `NotificationsBookingsRequest`
@@ -14120,8 +14065,7 @@ await client.Scheduling.Slots.ExplainAsync(
-## Scheduling Availability -
client.Scheduling.Availability.SearchAsync(AvailabilitySearchRequest { ... }) -> WithRawResponseTask<SchedulingAvailabilitySearchResult> +
client.Scheduling.Bookings.MarkNoShowAsync(MarkNoShowBookingsRequest { ... }) -> WithRawResponseTask<SchedulingBooking>
@@ -14133,7 +14077,7 @@ await client.Scheduling.Slots.ExplainAsync(
-For "who's free" pages: each matching host's soonest slots, soonest first, across up to 500 hosts. +Records that the attendee didn't come, once the booking has started.
@@ -14148,17 +14092,8 @@ For "who's free" pages: each matching host's soonest slots, soonest first, acros
```csharp -await client.Scheduling.Availability.SearchAsync( - new AvailabilitySearchRequest - { - EventType = "evtype_01kd2m9a0b1c2d3e4f5g6h7j8m", - Start = "2027-01-04T00:00:00.000Z", - End = "2027-01-18T00:00:00.000Z", - Attributes = new Dictionary>>() - { - { "licensed_in", "CA" }, - }, - } +await client.Scheduling.Bookings.MarkNoShowAsync( + new MarkNoShowBookingsRequest { Id = "book_01kd2m9a0b1c2d3e4f5g6h7j8m" } ); ```
@@ -14174,7 +14109,7 @@ await client.Scheduling.Availability.SearchAsync(
-**request:** `AvailabilitySearchRequest` +**request:** `MarkNoShowBookingsRequest`
@@ -14186,8 +14121,7 @@ await client.Scheduling.Availability.SearchAsync(
-## Scheduling Bookings -
client.Scheduling.Bookings.ListAsync(ListBookingsRequest { ... }) -> WithRawResponseTask<SchedulingBookingList> +
client.Scheduling.Bookings.UpdateLocationAsync(UpdateBookingLocationRequest { ... }) -> WithRawResponseTask<SchedulingBooking>
@@ -14199,7 +14133,7 @@ await client.Scheduling.Availability.SearchAsync(
-The environment's bookings, newest first. Answers aren't included. +Where it happens, such as the meeting link you made after the `scheduling.booking.confirmed` webhook.
@@ -14214,11 +14148,15 @@ The environment's bookings, newest first. Answers aren't included.
```csharp -await client.Scheduling.Bookings.ListAsync( - new ListBookingsRequest +await client.Scheduling.Bookings.UpdateLocationAsync( + new UpdateBookingLocationRequest { - StartAfter = "2027-01-04T15:00:00.000Z", - StartBefore = "2027-01-04T15:00:00.000Z", + Id = "book_01kd2m9a0b1c2d3e4f5g6h7j8m", + Location = new SchedulingLocationZero + { + Type = SchedulingLocationZeroType.Link, + Url = "https://meet.example.com/abc", + }, } ); ``` @@ -14235,7 +14173,7 @@ await client.Scheduling.Bookings.ListAsync(
-**request:** `ListBookingsRequest` +**request:** `UpdateBookingLocationRequest`
@@ -14247,7 +14185,8 @@ await client.Scheduling.Bookings.ListAsync(
-
client.Scheduling.Bookings.CreateAsync(CreateBookingRequest { ... }) -> WithRawResponseTask<SchedulingBooking> +## Scheduling Reassignments +
client.Scheduling.Reassignments.PreviewAsync(PreviewSchedulingReassignmentRequest { ... }) -> WithRawResponseTask<SchedulingReassignmentPreview>
@@ -14259,7 +14198,7 @@ await client.Scheduling.Bookings.ListAsync(
-Books a slot, or joins a group session. Without a `host`, a pool chooses fairly among those free. An event type that requires approval answers with a `pending_approval` booking. +Who each booking would go to, and why not when nobody can take it, without moving anything. It works down them in order, so two can't both be promised the same free hour. Change any of it and start the run with `assignments`. Covers the first 500. Things can change before you start it: the run decides again.
@@ -14274,18 +14213,17 @@ Books a slot, or joins a group session. Without a `host`, a pool chooses fairly
```csharp -await client.Scheduling.Bookings.CreateAsync( - new CreateBookingRequest +await client.Scheduling.Reassignments.PreviewAsync( + new PreviewSchedulingReassignmentRequest { - IdempotencyKey = "welcome-user-123", - EventType = "evtype_01kd2m9a0b1c2d3e4f5g6h7j8m", - Start = "2027-01-04T15:00:00.000Z", - Attendee = new SchedulingAttendeeInput + Selection = new SchedulingReassignmentSelection { - Uid = "patient_77", - Name = "Sam Lee", - Email = "sam@example.com", - TimeZone = "UTC", + Host = "doctor_482", + StartBefore = "2027-08-14T00:00:00.000Z", + }, + Strategy = new SchedulingReassignmentStrategy + { + PreferredHosts = new List() { "doctor_518" }, }, } ); @@ -14303,7 +14241,7 @@ await client.Scheduling.Bookings.CreateAsync(
-**request:** `CreateBookingRequest` +**request:** `PreviewSchedulingReassignmentRequest`
@@ -14315,7 +14253,7 @@ await client.Scheduling.Bookings.CreateAsync(
-
client.Scheduling.Bookings.GetAsync(GetBookingsRequest { ... }) -> WithRawResponseTask<SchedulingBooking> +
client.Scheduling.Reassignments.ListAsync(ListReassignmentsRequest { ... }) -> WithRawResponseTask<SchedulingReassignmentList>
@@ -14327,7 +14265,7 @@ await client.Scheduling.Bookings.CreateAsync(
-A booking with its attendees and their answers. +Newest first, with how each is going.
@@ -14342,9 +14280,7 @@ A booking with its attendees and their answers.
```csharp -await client.Scheduling.Bookings.GetAsync( - new GetBookingsRequest { Id = "book_01kd2m9a0b1c2d3e4f5g6h7j8m" } -); +await client.Scheduling.Reassignments.ListAsync(new ListReassignmentsRequest()); ```
@@ -14359,7 +14295,7 @@ await client.Scheduling.Bookings.GetAsync(
-**request:** `GetBookingsRequest` +**request:** `ListReassignmentsRequest`
@@ -14371,7 +14307,7 @@ await client.Scheduling.Bookings.GetAsync(
-
client.Scheduling.Bookings.RescheduleAsync(RescheduleBookingRequest { ... }) -> WithRawResponseTask<SchedulingBooking> +
client.Scheduling.Reassignments.CreateAsync(CreateSchedulingReassignmentRequest { ... }) -> WithRawResponseTask<SchedulingReassignment>
@@ -14383,7 +14319,7 @@ await client.Scheduling.Bookings.GetAsync(
-Moves it to a new time, keeping its id. The old time stays booked if the new one isn't free. +Moves up to 5,000 bookings in the background, each on its own, so one that can't move never holds up the rest. Nothing's ever cancelled: a booking nobody can take stays where it is, and its item says so. It answers at once: follow the run by its id, or wait for `scheduling.reassignment.completed`.
@@ -14398,11 +14334,19 @@ Moves it to a new time, keeping its id. The old time stays booked if the new one
```csharp -await client.Scheduling.Bookings.RescheduleAsync( - new RescheduleBookingRequest +await client.Scheduling.Reassignments.CreateAsync( + new CreateSchedulingReassignmentRequest { - Id = "book_01kd2m9a0b1c2d3e4f5g6h7j8m", - Start = "2027-01-05T15:00:00.000Z", + IdempotencyKey = "welcome-user-123", + Selection = new SchedulingReassignmentSelection + { + OutOfOffice = "ooo_01kd2m9a0b1c2d3e4f5g6h7j8m", + }, + Strategy = new SchedulingReassignmentStrategy + { + PreferredHosts = new List() { "doctor_518" }, + }, + ReasonCode = CreateSchedulingReassignmentRequestReasonCode.OutOfOffice, } ); ``` @@ -14419,7 +14363,7 @@ await client.Scheduling.Bookings.RescheduleAsync(
-**request:** `RescheduleBookingRequest` +**request:** `CreateSchedulingReassignmentRequest`
@@ -14431,7 +14375,7 @@ await client.Scheduling.Bookings.RescheduleAsync(
-
client.Scheduling.Bookings.CancelAsync(CancelSchedulingBookingRequest { ... }) -> WithRawResponseTask<SchedulingBooking> +
client.Scheduling.Reassignments.GetAsync(GetReassignmentsRequest { ... }) -> WithRawResponseTask<SchedulingReassignment>
@@ -14443,7 +14387,7 @@ await client.Scheduling.Bookings.RescheduleAsync(
-Frees the time and removes the calendar event. A cancelled booking stays charged. +How it's going.
@@ -14458,13 +14402,7 @@ Frees the time and removes the calendar event. A cancelled booking stays charged
```csharp -await client.Scheduling.Bookings.CancelAsync( - new CancelSchedulingBookingRequest - { - Id = "book_01kd2m9a0b1c2d3e4f5g6h7j8m", - Reason = "Feeling better", - } -); +await client.Scheduling.Reassignments.GetAsync(new GetReassignmentsRequest { Id = "id" }); ```
@@ -14479,7 +14417,7 @@ await client.Scheduling.Bookings.CancelAsync(
-**request:** `CancelSchedulingBookingRequest` +**request:** `GetReassignmentsRequest`
@@ -14491,7 +14429,7 @@ await client.Scheduling.Bookings.CancelAsync(
-
client.Scheduling.Bookings.EventsAsync(EventsBookingsRequest { ... }) -> WithRawResponseTask<SchedulingBookingEventList> +
client.Scheduling.Reassignments.ItemsAsync(ItemsReassignmentsRequest { ... }) -> WithRawResponseTask<SchedulingReassignmentItemList>
@@ -14503,7 +14441,7 @@ await client.Scheduling.Bookings.CancelAsync(
-What's happened to a booking, oldest first, and who did it. There's no personal data in here. +Each booking it covers and what happened to it. A group session has one, for one of its seats. Empty until the worker's started on it.
@@ -14518,9 +14456,7 @@ What's happened to a booking, oldest first, and who did it. There's no personal
```csharp -await client.Scheduling.Bookings.EventsAsync( - new EventsBookingsRequest { Id = "book_01kd2m9a0b1c2d3e4f5g6h7j8m" } -); +await client.Scheduling.Reassignments.ItemsAsync(new ItemsReassignmentsRequest { Id = "id" }); ```
@@ -14535,7 +14471,7 @@ await client.Scheduling.Bookings.EventsAsync(
-**request:** `EventsBookingsRequest` +**request:** `ItemsReassignmentsRequest`
@@ -14547,7 +14483,7 @@ await client.Scheduling.Bookings.EventsAsync(
-
client.Scheduling.Bookings.ApproveAsync(ApproveBookingsRequest { ... }) -> WithRawResponseTask<SchedulingBooking> +
client.Scheduling.Reassignments.CancelAsync(CancelReassignmentsRequest { ... }) -> WithRawResponseTask<SchedulingReassignment>
@@ -14559,7 +14495,7 @@ await client.Scheduling.Bookings.EventsAsync(
-Confirms a `pending_approval` booking. +Stops what hasn't happened yet. What's moved stays moved: undo it for that. Cancelling one that's finished changes nothing.
@@ -14574,9 +14510,7 @@ Confirms a `pending_approval` booking.
```csharp -await client.Scheduling.Bookings.ApproveAsync( - new ApproveBookingsRequest { Id = "book_01kd2m9a0b1c2d3e4f5g6h7j8m" } -); +await client.Scheduling.Reassignments.CancelAsync(new CancelReassignmentsRequest { Id = "id" }); ```
@@ -14591,7 +14525,7 @@ await client.Scheduling.Bookings.ApproveAsync(
-**request:** `ApproveBookingsRequest` +**request:** `CancelReassignmentsRequest`
@@ -14603,7 +14537,7 @@ await client.Scheduling.Bookings.ApproveAsync(
-
client.Scheduling.Bookings.DeclineAsync(DeclineBookingsRequest { ... }) -> WithRawResponseTask<SchedulingBooking> +
client.Scheduling.Reassignments.UndoAsync(UndoSchedulingReassignmentRequest { ... }) -> WithRawResponseTask<SchedulingReassignment>
@@ -14615,7 +14549,7 @@ await client.Scheduling.Bookings.ApproveAsync(
-Refuses a `pending_approval` booking and frees the time. +Gives back what a finished run moved, as a new run. A booking that's moved on since stays where it went, and a former host who's no longer free keeps it from going back, unless you pass `overrides`.
@@ -14630,8 +14564,12 @@ Refuses a `pending_approval` booking and frees the time.
```csharp -await client.Scheduling.Bookings.DeclineAsync( - new DeclineBookingsRequest { Id = "book_01kd2m9a0b1c2d3e4f5g6h7j8m" } +await client.Scheduling.Reassignments.UndoAsync( + new UndoSchedulingReassignmentRequest + { + Id = "id", + ReasonCode = UndoSchedulingReassignmentRequestReasonCode.Other, + } ); ```
@@ -14647,7 +14585,7 @@ await client.Scheduling.Bookings.DeclineAsync(
-**request:** `DeclineBookingsRequest` +**request:** `UndoSchedulingReassignmentRequest`
@@ -14659,7 +14597,8 @@ await client.Scheduling.Bookings.DeclineAsync(
-
client.Scheduling.Bookings.NotificationsAsync(NotificationsBookingsRequest { ... }) -> WithRawResponseTask<SchedulingBookingNotificationList> +## Scheduling HolidayCalendars +
client.Scheduling.HolidayCalendars.ListAsync() -> WithRawResponseTask<SchedulingHolidayCalendarList>
@@ -14671,7 +14610,7 @@ await client.Scheduling.Bookings.DeclineAsync(
-What's been queued for this booking and what became of it, newest first, including why something wasn't sent. It never says who it went to. +By name. A feed's URL is never shown again.
@@ -14686,8 +14625,55 @@ What's been queued for this booking and what became of it, newest first, includi
```csharp -await client.Scheduling.Bookings.NotificationsAsync( - new NotificationsBookingsRequest { Id = "book_01kd2m9a0b1c2d3e4f5g6h7j8m" } +await client.Scheduling.HolidayCalendars.ListAsync(); +``` +
+
+ + + + + + +
+ +
client.Scheduling.HolidayCalendars.CreateAsync(CreateSchedulingHolidayCalendarRequest { ... }) -> WithRawResponseTask<SchedulingHolidayCalendar> +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Applies a country's public holidays, or your own feed, to some hosts as ordinary out of office entries, kept up to date by coss.com. A host who removes one keeps it removed. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.Scheduling.HolidayCalendars.CreateAsync( + new CreateSchedulingHolidayCalendarRequest + { + Name = "UK team", + Country = "GB", + HostFilter = new Dictionary>>() + { + { "team", "london" }, + }, + } ); ```
@@ -14703,7 +14689,7 @@ await client.Scheduling.Bookings.NotificationsAsync(
-**request:** `NotificationsBookingsRequest` +**request:** `CreateSchedulingHolidayCalendarRequest`
@@ -14715,7 +14701,7 @@ await client.Scheduling.Bookings.NotificationsAsync(
-
client.Scheduling.Bookings.MarkNoShowAsync(MarkNoShowBookingsRequest { ... }) -> WithRawResponseTask<SchedulingBooking> +
client.Scheduling.HolidayCalendars.GetAsync(GetHolidayCalendarsRequest { ... }) -> WithRawResponseTask<SchedulingHolidayCalendar>
@@ -14727,7 +14713,7 @@ await client.Scheduling.Bookings.NotificationsAsync(
-Records that the attendee didn't come, once the booking has started. +With when it was last read, and why not if it couldn't be.
@@ -14742,8 +14728,62 @@ Records that the attendee didn't come, once the booking has started.
```csharp -await client.Scheduling.Bookings.MarkNoShowAsync( - new MarkNoShowBookingsRequest { Id = "book_01kd2m9a0b1c2d3e4f5g6h7j8m" } +await client.Scheduling.HolidayCalendars.GetAsync(new GetHolidayCalendarsRequest { Id = "id" }); +``` +
+
+ + + +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `GetHolidayCalendarsRequest` + +
+
+
+
+ + + + +
+ +
client.Scheduling.HolidayCalendars.RemoveAsync(RemoveHolidayCalendarsRequest { ... }) -> WithRawResponseTask<DeletedSchedulingHolidayCalendar> +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Hosts can be booked on its days again, shortly: past entries stay. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.Scheduling.HolidayCalendars.RemoveAsync( + new RemoveHolidayCalendarsRequest { Id = "id" } ); ```
@@ -14759,7 +14799,7 @@ await client.Scheduling.Bookings.MarkNoShowAsync(
-**request:** `MarkNoShowBookingsRequest` +**request:** `RemoveHolidayCalendarsRequest`
@@ -14771,7 +14811,7 @@ await client.Scheduling.Bookings.MarkNoShowAsync(
-
client.Scheduling.Bookings.UpdateLocationAsync(UpdateBookingLocationRequest { ... }) -> WithRawResponseTask<SchedulingBooking> +
client.Scheduling.HolidayCalendars.UpdateAsync(UpdateSchedulingHolidayCalendarRequest { ... }) -> WithRawResponseTask<SchedulingHolidayCalendar>
@@ -14783,7 +14823,7 @@ await client.Scheduling.Bookings.MarkNoShowAsync(
-Where it happens, such as the meeting link you made after the `scheduling.booking.confirmed` webhook. +Who it applies to, who covers and what happens to bookings. Takes effect shortly.
@@ -14798,15 +14838,14 @@ Where it happens, such as the meeting link you made after the `scheduling.bookin
```csharp -await client.Scheduling.Bookings.UpdateLocationAsync( - new UpdateBookingLocationRequest +await client.Scheduling.HolidayCalendars.UpdateAsync( + new UpdateSchedulingHolidayCalendarRequest { - Id = "book_01kd2m9a0b1c2d3e4f5g6h7j8m", - Location = new SchedulingLocation( - new SchedulingLocation.Link( - new SchedulingLocationLink { Url = "https://meet.example.com/abc" } - ) - ), + Id = "id", + HostFilter = new Dictionary>>() + { + { "team", "london" }, + }, } ); ``` @@ -14823,7 +14862,7 @@ await client.Scheduling.Bookings.UpdateLocationAsync(
-**request:** `UpdateBookingLocationRequest` +**request:** `UpdateSchedulingHolidayCalendarRequest`
@@ -14835,8 +14874,7 @@ await client.Scheduling.Bookings.UpdateLocationAsync(
-## Scheduling Holds -
client.Scheduling.Holds.CreateAsync(CreateHoldRequest { ... }) -> WithRawResponseTask<SchedulingBooking> +
client.Scheduling.HolidayCalendars.HolidaysAsync(HolidaysHolidayCalendarsRequest { ... }) -> WithRawResponseTask<SchedulingHolidayList>
@@ -14848,7 +14886,7 @@ await client.Scheduling.Bookings.UpdateLocationAsync(
-Keeps a slot for a while (the event type's `hold_ttl_seconds`) so you can take payment, then confirm it. Answers with a `held` booking, which isn't charged and sends nothing. +What's coming, with names, as last read. Empty until its first read.
@@ -14863,13 +14901,68 @@ Keeps a slot for a while (the event type's `hold_ttl_seconds`) so you can take p
```csharp -await client.Scheduling.Holds.CreateAsync( - new CreateHoldRequest +await client.Scheduling.HolidayCalendars.HolidaysAsync( + new HolidaysHolidayCalendarsRequest { Id = "id" } +); +``` +
+
+ + + +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `HolidaysHolidayCalendarsRequest` + +
+
+
+
+ + + + +
+ +## Scheduling OutOfOffice +
client.Scheduling.OutOfOffice.ListAsync(ListOutOfOfficeRequest { ... }) -> WithRawResponseTask<SchedulingOutOfOfficeList> +
+
+ +#### 📝 Description + +
+
+ +
+
+ +The environment's entries, newest first. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.Scheduling.OutOfOffice.ListAsync( + new ListOutOfOfficeRequest { - IdempotencyKey = "welcome-user-123", - EventType = "evtype_01kd2m9a0b1c2d3e4f5g6h7j8m", - Start = "2027-01-04T15:00:00.000Z", - Attendee = new SchedulingAttendeeInput { Uid = "patient_77", TimeZone = "UTC" }, + StartAfter = "2027-01-04T15:00:00.000Z", + StartBefore = "2027-01-04T15:00:00.000Z", } ); ``` @@ -14886,7 +14979,7 @@ await client.Scheduling.Holds.CreateAsync(
-**request:** `CreateHoldRequest` +**request:** `ListOutOfOfficeRequest`
@@ -14898,7 +14991,7 @@ await client.Scheduling.Holds.CreateAsync(
-
client.Scheduling.Holds.ConfirmAsync(ConfirmHoldRequest { ... }) -> WithRawResponseTask<SchedulingBooking> +
client.Scheduling.OutOfOffice.CreateAsync(CreateSchedulingOutOfOfficeRequest { ... }) -> WithRawResponseTask<SchedulingOutOfOfficeList>
@@ -14910,7 +15003,7 @@ await client.Scheduling.Holds.CreateAsync(
-Turns a hold into a booking. Always succeeds before the hold expires. Repeating it is safe. +Marks one host, a list of hosts or everyone matching some attributes as away, for part of a day or for whole dates. They aren't offered during it. Existing bookings stay as they are: list them with the entry's conflicts.
@@ -14925,8 +15018,15 @@ Turns a hold into a booking. Always succeeds before the hold expires. Repeating
```csharp -await client.Scheduling.Holds.ConfirmAsync( - new ConfirmHoldRequest { Id = "book_01kd2m9a0b1c2d3e4f5g6h7j8m", IfStillFree = true } +await client.Scheduling.OutOfOffice.CreateAsync( + new CreateSchedulingOutOfOfficeRequest + { + Host = "doctor_482", + StartDate = "2027-08-02", + EndDate = "2027-08-13", + Reason = "vacation", + PublicMessage = "Back on the 16th.", + } ); ```
@@ -14942,7 +15042,7 @@ await client.Scheduling.Holds.ConfirmAsync(
-**request:** `ConfirmHoldRequest` +**request:** `CreateSchedulingOutOfOfficeRequest`
@@ -14954,7 +15054,7 @@ await client.Scheduling.Holds.ConfirmAsync(
-
client.Scheduling.Holds.ReleaseAsync(ReleaseHoldsRequest { ... }) -> WithRawResponseTask<SchedulingBooking> +
client.Scheduling.OutOfOffice.GetAsync(GetOutOfOfficeRequest { ... }) -> WithRawResponseTask<SchedulingOutOfOffice>
@@ -14966,7 +15066,7 @@ await client.Scheduling.Holds.ConfirmAsync(
-Gives the slot back early. +One entry.
@@ -14981,8 +15081,8 @@ Gives the slot back early.
```csharp -await client.Scheduling.Holds.ReleaseAsync( - new ReleaseHoldsRequest { Id = "book_01kd2m9a0b1c2d3e4f5g6h7j8m" } +await client.Scheduling.OutOfOffice.GetAsync( + new GetOutOfOfficeRequest { Id = "ooo_01kd2m9a0b1c2d3e4f5g6h7j8m" } ); ```
@@ -14998,7 +15098,7 @@ await client.Scheduling.Holds.ReleaseAsync(
-**request:** `ReleaseHoldsRequest` +**request:** `GetOutOfOfficeRequest`
@@ -15010,8 +15110,7 @@ await client.Scheduling.Holds.ReleaseAsync(
-## Scheduling Series -
client.Scheduling.Series.CreateAsync(CreateSeriesBody { ... }) -> WithRawResponseTask<SchedulingSeries> +
client.Scheduling.OutOfOffice.RemoveAsync(RemoveOutOfOfficeRequest { ... }) -> WithRawResponseTask<DeletedSchedulingOutOfOffice>
@@ -15023,7 +15122,7 @@ await client.Scheduling.Holds.ReleaseAsync(
-Books up to 52 occurrences, keeping the attendee's local time across DST changes. Each one is an ordinary booking that can move on its own, and a pool keeps one host throughout. +The host can be booked in that time again, and any calendar event for it goes.
@@ -15038,26 +15137,1506 @@ Books up to 52 occurrences, keeping the attendee's local time across DST changes
```csharp -await client.Scheduling.Series.CreateAsync( - new CreateSeriesBody - { - IdempotencyKey = "welcome-user-123", - Body = new CreateSeriesRequest - { - EventType = "evtype_01kd2m9a0b1c2d3e4f5g6h7j8m", - Start = "2027-01-04T15:00:00.000Z", - Attendee = new SchedulingAttendeeInput - { - Uid = "patient_77", - TimeZone = "America/New_York", - }, - Recurrence = new CreateSeriesRequestRecurrence - { - Frequency = CreateSeriesRequestRecurrenceFrequency.Weekly, - Interval = 1, - Count = 12, - }, - }, +await client.Scheduling.OutOfOffice.RemoveAsync( + new RemoveOutOfOfficeRequest { Id = "ooo_01kd2m9a0b1c2d3e4f5g6h7j8m" } +); +``` +
+
+ + + +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `RemoveOutOfOfficeRequest` + +
+
+
+
+ + + + +
+ +
client.Scheduling.OutOfOffice.UpdateAsync(UpdateSchedulingOutOfOfficeRequest { ... }) -> WithRawResponseTask<SchedulingOutOfOffice> +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Changes what's given. An entry stays with its host. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.Scheduling.OutOfOffice.UpdateAsync( + new UpdateSchedulingOutOfOfficeRequest + { + Id = "ooo_01kd2m9a0b1c2d3e4f5g6h7j8m", + EndDate = "2027-08-20", + } +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `UpdateSchedulingOutOfOfficeRequest` + +
+
+
+
+ + +
+
+
+ +
client.Scheduling.OutOfOffice.PutAsync(PutSchedulingOutOfOfficeRequest { ... }) -> WithRawResponseTask<SchedulingOutOfOffice> +
+
+ +#### 📝 Description + +
+
+ +
+
+ +For syncing from a system of record such as an HR tool: send what it says, as often as you like, and there's one entry for it. Give every field you want to keep. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.Scheduling.OutOfOffice.PutAsync( + new PutSchedulingOutOfOfficeRequest + { + ExternalId = "hr_leave_4471", + Host = "doctor_482", + StartDate = "2027-08-02", + EndDate = "2027-08-13", + Reason = "vacation", + } +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `PutSchedulingOutOfOfficeRequest` + +
+
+
+
+ + +
+
+
+ +
client.Scheduling.OutOfOffice.ConflictsAsync(ConflictsOutOfOfficeRequest { ... }) -> WithRawResponseTask<SchedulingOutOfOfficeConflictList> +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Live bookings of the host that fall in the entry, soonest first. Entries never change them. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.Scheduling.OutOfOffice.ConflictsAsync( + new ConflictsOutOfOfficeRequest { Id = "ooo_01kd2m9a0b1c2d3e4f5g6h7j8m" } +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `ConflictsOutOfOfficeRequest` + +
+
+
+
+ + +
+
+
+ +## Scheduling Schedules +
client.Scheduling.Schedules.ListAsync(ListSchedulesRequest { ... }) -> WithRawResponseTask<SchedulingScheduleList> +
+
+ +#### 📝 Description + +
+
+ +
+
+ +All of the host's schedules, oldest first. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.Scheduling.Schedules.ListAsync( + new ListSchedulesRequest { Host = "host_01kd2m9a0b1c2d3e4f5g6h7j8m" } +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `ListSchedulesRequest` + +
+
+
+
+ + +
+
+
+ +
client.Scheduling.Schedules.CreateAsync(CreateSchedulesRequest { ... }) -> WithRawResponseTask<SchedulingSchedule> +
+
+ +#### 📝 Description + +
+
+ +
+
+ +A host's weekly hours and date overrides, in local time. The first one is the host's default. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.Scheduling.Schedules.CreateAsync( + new CreateSchedulesRequest + { + Host = "host_01kd2m9a0b1c2d3e4f5g6h7j8m", + Body = new UpsertScheduleRequest + { + Name = "Clinic hours", + Rules = new List() + { + new SchedulingWeeklyRule + { + Days = new List() { 1, 2, 3, 4, 5 }, + Start = "09:00", + End = "17:00", + }, + }, + Overrides = new List() + { + new SchedulingScheduleOverride + { + Date = "2027-12-24", + Ranges = new List() + { + new SchedulingScheduleOverrideRangesItem { Start = "start", End = "end" }, + }, + }, + }, + }, + } +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `CreateSchedulesRequest` + +
+
+
+
+ + +
+
+
+ +
client.Scheduling.Schedules.GetAsync(GetSchedulesRequest { ... }) -> WithRawResponseTask<SchedulingSchedule> +
+
+ +#### 📝 Description + +
+
+ +
+
+ +One of the host's schedules. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.Scheduling.Schedules.GetAsync( + new GetSchedulesRequest + { + Host = "host_01kd2m9a0b1c2d3e4f5g6h7j8m", + ScheduleId = "sched_01kd2m9a0b1c2d3e4f5g6h7j8m", + } +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `GetSchedulesRequest` + +
+
+
+
+ + +
+
+
+ +
client.Scheduling.Schedules.UpdateAsync(UpdateSchedulesRequest { ... }) -> WithRawResponseTask<SchedulingSchedule> +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Replaces its weekly rules, and its overrides when given. Existing bookings stay: a schedule only decides what's offered next. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.Scheduling.Schedules.UpdateAsync( + new UpdateSchedulesRequest + { + Host = "host_01kd2m9a0b1c2d3e4f5g6h7j8m", + ScheduleId = "sched_01kd2m9a0b1c2d3e4f5g6h7j8m", + Body = new UpsertScheduleRequest + { + Name = "Clinic hours", + Rules = new List() + { + new SchedulingWeeklyRule + { + Days = new List() { 1, 2, 3, 4, 5 }, + Start = "09:00", + End = "17:00", + }, + }, + Overrides = new List() + { + new SchedulingScheduleOverride + { + Date = "2027-12-24", + Ranges = new List() + { + new SchedulingScheduleOverrideRangesItem { Start = "start", End = "end" }, + }, + }, + }, + }, + } +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `UpdateSchedulesRequest` + +
+
+
+
+ + +
+
+
+ +
client.Scheduling.Schedules.RemoveAsync(RemoveSchedulesRequest { ... }) -> WithRawResponseTask<DeletedSchedulingSchedule> +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Refused for the host's default schedule. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.Scheduling.Schedules.RemoveAsync( + new RemoveSchedulesRequest + { + Host = "host_01kd2m9a0b1c2d3e4f5g6h7j8m", + ScheduleId = "sched_01kd2m9a0b1c2d3e4f5g6h7j8m", + } +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `RemoveSchedulesRequest` + +
+
+
+
+ + +
+
+
+ +## Scheduling EventTypes +
client.Scheduling.EventTypes.ListAsync(ListEventTypesRequest { ... }) -> WithRawResponseTask<SchedulingEventTypeList> +
+
+ +#### 📝 Description + +
+
+ +
+
+ +The environment's event types, newest first. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.Scheduling.EventTypes.ListAsync(new Coss.Scheduling.ListEventTypesRequest()); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `ListEventTypesRequest` + +
+
+
+
+ + +
+
+
+ +
client.Scheduling.EventTypes.CreateAsync(CreateEventTypeRequest { ... }) -> WithRawResponseTask<SchedulingEventType> +
+
+ +#### 📝 Description + +
+
+ +
+
+ +What can be booked: `one_on_one` with one host, `pool` for any free host, `collective` when every required host must be free, or `group` for a session with seats. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.Scheduling.EventTypes.CreateAsync( + new CreateEventTypeRequest + { + Kind = CreateEventTypeRequestKind.OneOnOne, + Title = "Initial consultation", + DurationMinutes = 30, + BufferAfterMinutes = 10, + MinNoticeMinutes = 120, + Hosts = new List() + { + new SchedulingEventTypeHostInput { Host = "doctor_482" }, + }, + } +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `CreateEventTypeRequest` + +
+
+
+
+ + +
+
+
+ +
client.Scheduling.EventTypes.GetAsync(GetEventTypesRequest { ... }) -> WithRawResponseTask<SchedulingEventType> +
+
+ +#### 📝 Description + +
+
+ +
+
+ +An event type by its id or your uid. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.Scheduling.EventTypes.GetAsync( + new Coss.Scheduling.GetEventTypesRequest { EventType = "evtype_01kd2m9a0b1c2d3e4f5g6h7j8m" } +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `GetEventTypesRequest` + +
+
+
+
+ + +
+
+
+ +
client.Scheduling.EventTypes.UpdateAsync(UpdateEventTypeRequest { ... }) -> WithRawResponseTask<SchedulingEventType> +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Changes what's given. Existing bookings keep what they were booked with. Set `status` to `archived` to stop new bookings. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.Scheduling.EventTypes.UpdateAsync( + new UpdateEventTypeRequest + { + EventType = "evtype_01kd2m9a0b1c2d3e4f5g6h7j8m", + MinNoticeMinutes = 240, + } +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `UpdateEventTypeRequest` + +
+
+
+
+ + +
+
+
+ +## Scheduling Slots +
client.Scheduling.Slots.ListAsync(ListSlotsRequest { ... }) -> WithRawResponseTask<SchedulingSlotList> +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Starts an attendee can book between `start` and `end` (at most 62 days), as UTC instants to show in their own time zone. A host whose calendar can't be read isn't offered. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.Scheduling.Slots.ListAsync( + new ListSlotsRequest + { + EventType = "evtype_01kd2m9a0b1c2d3e4f5g6h7j8m", + Start = "2027-01-04T15:00:00.000Z", + End = "2027-01-04T15:00:00.000Z", + } +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `ListSlotsRequest` + +
+
+
+
+ + +
+
+
+ +
client.Scheduling.Slots.ExplainAsync(ExplainSlotsRequest { ... }) -> WithRawResponseTask<SchedulingSlotExplanation> +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Why one start can or can't be booked right now, host by host, decided the same way a booking is. For support and debugging: it says when a host is busy, so don't show it to attendees. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.Scheduling.Slots.ExplainAsync( + new ExplainSlotsRequest + { + EventType = "evtype_01kd2m9a0b1c2d3e4f5g6h7j8m", + Start = "2027-01-04T15:00:00.000Z", + } +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `ExplainSlotsRequest` + +
+
+
+
+ + +
+
+
+ +## Scheduling Availability +
client.Scheduling.Availability.SearchAsync(AvailabilitySearchRequest { ... }) -> WithRawResponseTask<SchedulingAvailabilitySearchResult> +
+
+ +#### 📝 Description + +
+
+ +
+
+ +For "who's free" pages: each matching host's soonest slots, soonest first, across up to 500 hosts. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.Scheduling.Availability.SearchAsync( + new AvailabilitySearchRequest + { + EventType = "evtype_01kd2m9a0b1c2d3e4f5g6h7j8m", + Start = "2027-01-04T00:00:00.000Z", + End = "2027-01-18T00:00:00.000Z", + Attributes = new Dictionary>>() + { + { "licensed_in", "CA" }, + }, + } +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `AvailabilitySearchRequest` + +
+
+
+
+ + +
+
+
+ +## Scheduling Holds +
client.Scheduling.Holds.CreateAsync(CreateHoldRequest { ... }) -> WithRawResponseTask<SchedulingBooking> +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Keeps a slot for a while (the event type's `hold_ttl_seconds`) so you can take payment, then confirm it. Answers with a `held` booking, which isn't charged and sends nothing. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.Scheduling.Holds.CreateAsync( + new CreateHoldRequest + { + IdempotencyKey = "welcome-user-123", + EventType = "evtype_01kd2m9a0b1c2d3e4f5g6h7j8m", + Start = "2027-01-04T15:00:00.000Z", + Attendee = new SchedulingAttendeeInput { Uid = "patient_77", TimeZone = "UTC" }, + } +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `CreateHoldRequest` + +
+
+
+
+ + +
+
+
+ +
client.Scheduling.Holds.ConfirmAsync(ConfirmHoldRequest { ... }) -> WithRawResponseTask<SchedulingBooking> +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Turns a hold into a booking. Always succeeds before the hold expires. Repeating it is safe. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.Scheduling.Holds.ConfirmAsync( + new ConfirmHoldRequest { Id = "book_01kd2m9a0b1c2d3e4f5g6h7j8m", IfStillFree = true } +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `ConfirmHoldRequest` + +
+
+
+
+ + +
+
+
+ +
client.Scheduling.Holds.ReleaseAsync(ReleaseHoldsRequest { ... }) -> WithRawResponseTask<SchedulingBooking> +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Gives the slot back early. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.Scheduling.Holds.ReleaseAsync( + new ReleaseHoldsRequest { Id = "book_01kd2m9a0b1c2d3e4f5g6h7j8m" } +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `ReleaseHoldsRequest` + +
+
+
+
+ + +
+
+
+ +## Scheduling Series +
client.Scheduling.Series.CreateAsync(CreateSeriesBody { ... }) -> WithRawResponseTask<SchedulingSeries> +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Books up to 52 occurrences, keeping the attendee's local time across DST changes. Each one is an ordinary booking that can move on its own, and a pool keeps one host throughout. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.Scheduling.Series.CreateAsync( + new CreateSeriesBody + { + IdempotencyKey = "welcome-user-123", + Body = new CreateSeriesRequest + { + EventType = "evtype_01kd2m9a0b1c2d3e4f5g6h7j8m", + Start = "2027-01-04T15:00:00.000Z", + Attendee = new SchedulingAttendeeInput + { + Uid = "patient_77", + TimeZone = "America/New_York", + }, + Recurrence = new CreateSeriesRequestRecurrence + { + Frequency = CreateSeriesRequestRecurrenceFrequency.Weekly, + Interval = 1, + Count = 12, + }, + }, + } +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `CreateSeriesBody` + +
+
+
+
+ + +
+
+
+ +
client.Scheduling.Series.PreviewAsync(CreateSeriesRequest { ... }) -> WithRawResponseTask<SchedulingSeriesPreview> +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Which occurrences would be free, without booking anything. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.Scheduling.Series.PreviewAsync( + new CreateSeriesRequest + { + EventType = "evtype_01kd2m9a0b1c2d3e4f5g6h7j8m", + Start = "2027-01-04T15:00:00.000Z", + Attendee = new SchedulingAttendeeInput + { + Uid = "patient_77", + TimeZone = "America/New_York", + }, + Recurrence = new CreateSeriesRequestRecurrence + { + Frequency = CreateSeriesRequestRecurrenceFrequency.Weekly, + Interval = 1, + Count = 12, + }, + } +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `CreateSeriesRequest` + +
+
+
+
+ + +
+
+
+ +
client.Scheduling.Series.CancelAsync(CancelSeriesRequest { ... }) -> WithRawResponseTask<SchedulingCancelledSeries> +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Cancels the occurrences from `from_index` on, or all of them. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.Scheduling.Series.CancelAsync( + new CancelSeriesRequest { Id = "series_01kd2m9a0b1c2d3e4f5g6h7j8m", FromIndex = 4 } +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `CancelSeriesRequest` + +
+
+
+
+ + +
+
+
+ +## Scheduling Attendees +
client.Scheduling.Attendees.EraseAsync(EraseAttendeesRequest { ... }) -> WithRawResponseTask<SchedulingAttendeeErasure> +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Removes this person's details and answers from every booking now, and ends any booker session fixed to them. The bookings themselves stay. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.Scheduling.Attendees.EraseAsync(new EraseAttendeesRequest { Uid = "patient_77" }); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `EraseAttendeesRequest` + +
+
+
+
+ + +
+
+
+ +
client.Scheduling.Attendees.EraseByEmailAsync(EraseSchedulingAttendeeByEmailRequest { ... }) -> WithRawResponseTask<SchedulingAttendeeErasureByEmail> +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Removes this address's details and answers from every booking now, for someone you have no `uid` for, such as a guest. The bookings themselves stay. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.Scheduling.Attendees.EraseByEmailAsync( + new EraseSchedulingAttendeeByEmailRequest { Email = "sam@example.com" } +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `EraseSchedulingAttendeeByEmailRequest` + +
+
+
+
+ + +
+
+
+ +## Scheduling Calendars +
client.Scheduling.Calendars.AuthorizeAsync(AuthorizeCalendarRequest { ... }) -> WithRawResponseTask<SchedulingCalendarAuthorization> +
+
+ +#### 📝 Description + +
+
+ +
+
+ +A URL for the host to give consent at Google or Microsoft. Open it in a new window: providers refuse to be framed. Coss.com reads only busy times, and writes events with a neutral title unless the event type's `host_calendar_details` is `full`. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.Scheduling.Calendars.AuthorizeAsync( + new AuthorizeCalendarRequest + { + Host = "host_01kd2m9a0b1c2d3e4f5g6h7j8m", + Provider = AuthorizeCalendarRequestProvider.Google, } ); ``` @@ -15074,7 +16653,63 @@ await client.Scheduling.Series.CreateAsync(
-**request:** `CreateSeriesBody` +**request:** `AuthorizeCalendarRequest` + +
+
+
+
+ + +
+
+
+ +
client.Scheduling.Calendars.ListAsync(ListCalendarsRequest { ... }) -> WithRawResponseTask<SchedulingCalendarConnectionList> +
+
+ +#### 📝 Description + +
+
+ +
+
+ +With each connection's calendars and which of them count. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.Scheduling.Calendars.ListAsync( + new ListCalendarsRequest { Host = "host_01kd2m9a0b1c2d3e4f5g6h7j8m" } +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `ListCalendarsRequest`
@@ -15086,7 +16721,7 @@ await client.Scheduling.Series.CreateAsync(
-
client.Scheduling.Series.PreviewAsync(CreateSeriesRequest { ... }) -> WithRawResponseTask<SchedulingSeriesPreview> +
client.Scheduling.Calendars.ConnectAsync(ConnectCalendarsRequest { ... }) -> WithRawResponseTask<SchedulingCalendarConnection>
@@ -15098,7 +16733,7 @@ await client.Scheduling.Series.CreateAsync(
-Which occurrences would be free, without booking anything. +CalDAV (Apple and others) with an app password, or, in sandbox environments, a `simulated` calendar whose busy times you set yourself. Google and Microsoft use `authorize`.
@@ -15113,22 +16748,20 @@ Which occurrences would be free, without booking anything.
```csharp -await client.Scheduling.Series.PreviewAsync( - new CreateSeriesRequest +await client.Scheduling.Calendars.ConnectAsync( + new ConnectCalendarsRequest { - EventType = "evtype_01kd2m9a0b1c2d3e4f5g6h7j8m", - Start = "2027-01-04T15:00:00.000Z", - Attendee = new SchedulingAttendeeInput - { - Uid = "patient_77", - TimeZone = "America/New_York", - }, - Recurrence = new CreateSeriesRequestRecurrence - { - Frequency = CreateSeriesRequestRecurrenceFrequency.Weekly, - Interval = 1, - Count = 12, - }, + Host = "host_01kd2m9a0b1c2d3e4f5g6h7j8m", + Body = new CreateCalendarConnectionRequest( + new CreateCalendarConnectionRequest.Caldav( + new CreateCalendarConnectionRequestCaldav + { + Url = "url", + Username = "username", + Password = "password", + } + ) + ), } ); ``` @@ -15145,7 +16778,7 @@ await client.Scheduling.Series.PreviewAsync(
-**request:** `CreateSeriesRequest` +**request:** `ConnectCalendarsRequest`
@@ -15157,7 +16790,7 @@ await client.Scheduling.Series.PreviewAsync(
-
client.Scheduling.Series.CancelAsync(CancelSeriesRequest { ... }) -> WithRawResponseTask<SchedulingCancelledSeries> +
client.Scheduling.Calendars.DisconnectAsync(DisconnectCalendarsRequest { ... }) -> WithRawResponseTask<DeletedSchedulingCalendarConnection>
@@ -15169,7 +16802,7 @@ await client.Scheduling.Series.PreviewAsync(
-Cancels the occurrences from `from_index` on, or all of them. +Revokes coss.com's access and deletes every busy time read through it. One a calendar delegation manages is refused (`calendar_managed`).
@@ -15184,8 +16817,12 @@ Cancels the occurrences from `from_index` on, or all of them.
```csharp -await client.Scheduling.Series.CancelAsync( - new CancelSeriesRequest { Id = "series_01kd2m9a0b1c2d3e4f5g6h7j8m", FromIndex = 4 } +await client.Scheduling.Calendars.DisconnectAsync( + new DisconnectCalendarsRequest + { + Host = "host_01kd2m9a0b1c2d3e4f5g6h7j8m", + Id = "calconn_01kd2m9a0b1c2d3e4f5g6h7j8m", + } ); ```
@@ -15201,7 +16838,7 @@ await client.Scheduling.Series.CancelAsync(
-**request:** `CancelSeriesRequest` +**request:** `DisconnectCalendarsRequest`
@@ -15213,8 +16850,7 @@ await client.Scheduling.Series.CancelAsync(
-## Scheduling Attendees -
client.Scheduling.Attendees.EraseAsync(EraseAttendeesRequest { ... }) -> WithRawResponseTask<SchedulingAttendeeErasure> +
client.Scheduling.Calendars.UpdateAsync(UpdateCalendarRequest { ... }) -> WithRawResponseTask<SchedulingCalendarConnectionList>
@@ -15226,7 +16862,7 @@ await client.Scheduling.Series.CancelAsync(
-Removes this person's details and answers from every booking now, and ends any booker session fixed to them. The bookings themselves stay. +Whether its busy times block slots, and whether bookings are written to it.
@@ -15241,7 +16877,14 @@ Removes this person's details and answers from every booking now, and ends any b
```csharp -await client.Scheduling.Attendees.EraseAsync(new EraseAttendeesRequest { Uid = "patient_77" }); +await client.Scheduling.Calendars.UpdateAsync( + new UpdateCalendarRequest + { + Host = "host_01kd2m9a0b1c2d3e4f5g6h7j8m", + CalendarId = "cal_01kd2m9a0b1c2d3e4f5g6h7j8m", + ReadBusy = true, + } +); ```
@@ -15256,7 +16899,7 @@ await client.Scheduling.Attendees.EraseAsync(new EraseAttendeesRequest { Uid = "
-**request:** `EraseAttendeesRequest` +**request:** `UpdateCalendarRequest`
@@ -15268,7 +16911,7 @@ await client.Scheduling.Attendees.EraseAsync(new EraseAttendeesRequest { Uid = "
-
client.Scheduling.Attendees.EraseByEmailAsync(EraseSchedulingAttendeeByEmailRequest { ... }) -> WithRawResponseTask<SchedulingAttendeeErasureByEmail> +
client.Scheduling.Calendars.SetSimulatedBusyAsync(SetSimulatedBusyRequest { ... }) -> WithRawResponseTask
@@ -15280,7 +16923,7 @@ await client.Scheduling.Attendees.EraseAsync(new EraseAttendeesRequest { Uid = "
-Removes this address's details and answers from every booking now, for someone you have no `uid` for, such as a guest. The bookings themselves stay. +Sandbox environments only: test how bookings react to a busy calendar.
@@ -15295,8 +16938,19 @@ Removes this address's details and answers from every booking now, for someone y
```csharp -await client.Scheduling.Attendees.EraseByEmailAsync( - new EraseSchedulingAttendeeByEmailRequest { Email = "sam@example.com" } +await client.Scheduling.Calendars.SetSimulatedBusyAsync( + new SetSimulatedBusyRequest + { + Host = "host_01kd2m9a0b1c2d3e4f5g6h7j8m", + Intervals = new List() + { + new SetSimulatedBusyRequestIntervalsItem + { + Start = "2027-01-04T15:00:00.000Z", + End = "2027-01-04T16:00:00.000Z", + }, + }, + } ); ```
@@ -15312,7 +16966,7 @@ await client.Scheduling.Attendees.EraseByEmailAsync(
-**request:** `EraseSchedulingAttendeeByEmailRequest` +**request:** `SetSimulatedBusyRequest`
@@ -15324,8 +16978,8 @@ await client.Scheduling.Attendees.EraseByEmailAsync(
-## Scheduling Calendars -
client.Scheduling.Calendars.AuthorizeAsync(AuthorizeCalendarRequest { ... }) -> WithRawResponseTask<SchedulingCalendarAuthorization> +## Scheduling CalendarDelegations +
client.Scheduling.CalendarDelegations.ListAsync() -> WithRawResponseTask<SchedulingCalendarDelegationList>
@@ -15337,7 +16991,7 @@ await client.Scheduling.Attendees.EraseByEmailAsync(
-A URL for the host to give consent at Google or Microsoft. Open it in a new window: providers refuse to be framed. Coss.com reads only busy times, and writes events with a neutral title unless the event type's `host_calendar_details` is `full`. +With how many hosts each has connected.
@@ -15352,40 +17006,19 @@ A URL for the host to give consent at Google or Microsoft. Open it in a new wind
```csharp -await client.Scheduling.Calendars.AuthorizeAsync( - new AuthorizeCalendarRequest - { - Host = "host_01kd2m9a0b1c2d3e4f5g6h7j8m", - Provider = AuthorizeCalendarRequestProvider.Google, - } -); +await client.Scheduling.CalendarDelegations.ListAsync(); ```
-#### ⚙️ Parameters - -
-
- -
-
- -**request:** `AuthorizeCalendarRequest` - -
-
-
-
-
-
client.Scheduling.Calendars.ListAsync(ListCalendarsRequest { ... }) -> WithRawResponseTask<SchedulingCalendarConnectionList> +
client.Scheduling.CalendarDelegations.CreateAsync(CreateCalendarDelegationRequest { ... }) -> WithRawResponseTask<SchedulingCalendarDelegation>
@@ -15397,7 +17030,7 @@ await client.Scheduling.Calendars.AuthorizeAsync(
-With each connection's calendars and which of them count. +An admin authorizes once, and every host on the domain gets their calendar with no consent screen. It stays `pending`: authorize what it returns, then verify it. Credentials are never returned.
@@ -15412,8 +17045,16 @@ With each connection's calendars and which of them count.
```csharp -await client.Scheduling.Calendars.ListAsync( - new ListCalendarsRequest { Host = "host_01kd2m9a0b1c2d3e4f5g6h7j8m" } +await client.Scheduling.CalendarDelegations.CreateAsync( + new CreateCalendarDelegationRequest( + new CreateCalendarDelegationRequest.Google( + new CreateCalendarDelegationRequestGoogle + { + Domain = "domain", + ServiceAccountKey = "service_account_key", + } + ) + ) ); ```
@@ -15429,7 +17070,7 @@ await client.Scheduling.Calendars.ListAsync(
-**request:** `ListCalendarsRequest` +**request:** `CreateCalendarDelegationRequest`
@@ -15441,7 +17082,7 @@ await client.Scheduling.Calendars.ListAsync(
-
client.Scheduling.Calendars.ConnectAsync(ConnectCalendarsRequest { ... }) -> WithRawResponseTask<SchedulingCalendarConnection> +
client.Scheduling.CalendarDelegations.GetAsync(GetCalendarDelegationsRequest { ... }) -> WithRawResponseTask<SchedulingCalendarDelegation>
@@ -15453,7 +17094,7 @@ await client.Scheduling.Calendars.ListAsync(
-CalDAV (Apple and others) with an app password, or, in sandbox environments, a `simulated` calendar whose busy times you set yourself. Google and Microsoft use `authorize`. +Its status, what to authorize, and how many hosts it has connected.
@@ -15468,21 +17109,8 @@ CalDAV (Apple and others) with an app password, or, in sandbox environments, a `
```csharp -await client.Scheduling.Calendars.ConnectAsync( - new ConnectCalendarsRequest - { - Host = "host_01kd2m9a0b1c2d3e4f5g6h7j8m", - Body = new CreateCalendarConnectionRequest( - new CreateCalendarConnectionRequest.Caldav( - new CreateCalendarConnectionRequestCaldav - { - Url = "url", - Username = "username", - Password = "password", - } - ) - ), - } +await client.Scheduling.CalendarDelegations.GetAsync( + new GetCalendarDelegationsRequest { Id = "caldlg_01kd2m9a0b1c2d3e4f5g6h7j8m" } ); ```
@@ -15498,7 +17126,7 @@ await client.Scheduling.Calendars.ConnectAsync(
-**request:** `ConnectCalendarsRequest` +**request:** `GetCalendarDelegationsRequest`
@@ -15510,7 +17138,7 @@ await client.Scheduling.Calendars.ConnectAsync(
-
client.Scheduling.Calendars.DisconnectAsync(DisconnectCalendarsRequest { ... }) -> WithRawResponseTask<DeletedSchedulingCalendarConnection> +
client.Scheduling.CalendarDelegations.DeleteAsync(DeleteCalendarDelegationsRequest { ... }) -> WithRawResponseTask<DeletedSchedulingCalendarDelegation>
@@ -15522,7 +17150,7 @@ await client.Scheduling.Calendars.ConnectAsync(
-Revokes coss.com's access and deletes every busy time read through it. One a calendar delegation manages is refused (`calendar_managed`). +Its hosts lose these calendars within minutes. They stay bookable with no conflict check, and events already written stay on their calendars, out of reach of later moves or cancellations.
@@ -15537,12 +17165,8 @@ Revokes coss.com's access and deletes every busy time read through it. One a cal
```csharp -await client.Scheduling.Calendars.DisconnectAsync( - new DisconnectCalendarsRequest - { - Host = "host_01kd2m9a0b1c2d3e4f5g6h7j8m", - Id = "calconn_01kd2m9a0b1c2d3e4f5g6h7j8m", - } +await client.Scheduling.CalendarDelegations.DeleteAsync( + new DeleteCalendarDelegationsRequest { Id = "caldlg_01kd2m9a0b1c2d3e4f5g6h7j8m" } ); ```
@@ -15558,7 +17182,7 @@ await client.Scheduling.Calendars.DisconnectAsync(
-**request:** `DisconnectCalendarsRequest` +**request:** `DeleteCalendarDelegationsRequest`
@@ -15570,7 +17194,7 @@ await client.Scheduling.Calendars.DisconnectAsync(
-
client.Scheduling.Calendars.UpdateAsync(UpdateCalendarRequest { ... }) -> WithRawResponseTask<SchedulingCalendarConnectionList> +
client.Scheduling.CalendarDelegations.UpdateAsync(UpdateCalendarDelegationRequest { ... }) -> WithRawResponseTask<SchedulingCalendarDelegation>
@@ -15582,7 +17206,7 @@ await client.Scheduling.Calendars.DisconnectAsync(
-Whether its busy times block slots, and whether bookings are written to it. +New credentials are tried on the verified mailbox before they replace the old ones, and end an outage if they work.
@@ -15597,12 +17221,11 @@ Whether its busy times block slots, and whether bookings are written to it.
```csharp -await client.Scheduling.Calendars.UpdateAsync( - new UpdateCalendarRequest +await client.Scheduling.CalendarDelegations.UpdateAsync( + new UpdateCalendarDelegationRequest { - Host = "host_01kd2m9a0b1c2d3e4f5g6h7j8m", - CalendarId = "cal_01kd2m9a0b1c2d3e4f5g6h7j8m", - ReadBusy = true, + Id = "caldlg_01kd2m9a0b1c2d3e4f5g6h7j8m", + MatchHostEmail = false, } ); ``` @@ -15619,7 +17242,7 @@ await client.Scheduling.Calendars.UpdateAsync(
-**request:** `UpdateCalendarRequest` +**request:** `UpdateCalendarDelegationRequest`
@@ -15631,7 +17254,7 @@ await client.Scheduling.Calendars.UpdateAsync(
-
client.Scheduling.Calendars.SetSimulatedBusyAsync(SetSimulatedBusyRequest { ... }) -> WithRawResponseTask +
client.Scheduling.CalendarDelegations.VerifyAsync(VerifyCalendarDelegationRequest { ... }) -> WithRawResponseTask<SchedulingCalendarDelegation>
@@ -15643,7 +17266,7 @@ await client.Scheduling.Calendars.UpdateAsync(
-Sandbox environments only: test how bookings react to a busy calendar. +Tries one real mailbox. Passing makes it `active`, and its hosts start connecting. Google can take up to 24 hours to apply a new authorization, so a refusal may just need time.
@@ -15658,18 +17281,11 @@ Sandbox environments only: test how bookings react to a busy calendar.
```csharp -await client.Scheduling.Calendars.SetSimulatedBusyAsync( - new SetSimulatedBusyRequest +await client.Scheduling.CalendarDelegations.VerifyAsync( + new VerifyCalendarDelegationRequest { - Host = "host_01kd2m9a0b1c2d3e4f5g6h7j8m", - Intervals = new List() - { - new SetSimulatedBusyRequestIntervalsItem - { - Start = "2027-01-04T15:00:00.000Z", - End = "2027-01-04T16:00:00.000Z", - }, - }, + Id = "caldlg_01kd2m9a0b1c2d3e4f5g6h7j8m", + Account = "ana@example.com", } ); ``` @@ -15686,7 +17302,7 @@ await client.Scheduling.Calendars.SetSimulatedBusyAsync(
-**request:** `SetSimulatedBusyRequest` +**request:** `VerifyCalendarDelegationRequest`
@@ -15698,8 +17314,8 @@ await client.Scheduling.Calendars.SetSimulatedBusyAsync(
-## Scheduling CalendarDelegations -
client.Scheduling.CalendarDelegations.ListAsync() -> WithRawResponseTask<SchedulingCalendarDelegationList> +## Scheduling OauthApps +
client.Scheduling.OauthApps.ListAsync() -> WithRawResponseTask<SchedulingOauthAppList>
@@ -15711,7 +17327,7 @@ await client.Scheduling.Calendars.SetSimulatedBusyAsync(
-With how many hosts each has connected. +At most one per provider, with how many connections use each.
@@ -15726,7 +17342,7 @@ With how many hosts each has connected.
```csharp -await client.Scheduling.CalendarDelegations.ListAsync(); +await client.Scheduling.OauthApps.ListAsync(); ```
@@ -15738,7 +17354,7 @@ await client.Scheduling.CalendarDelegations.ListAsync();
-
client.Scheduling.CalendarDelegations.CreateAsync(CreateCalendarDelegationRequest { ... }) -> WithRawResponseTask<SchedulingCalendarDelegation> +
client.Scheduling.OauthApps.CreateAsync(CreateOauthAppRequest { ... }) -> WithRawResponseTask<SchedulingOauthApp>
@@ -15750,7 +17366,7 @@ await client.Scheduling.CalendarDelegations.ListAsync();
-An admin authorizes once, and every host on the domain gets their calendar with no consent screen. It stays `pending`: authorize what it returns, then verify it. Credentials are never returned. +New consents in this environment use it, so the consent screen shows your brand. Connections made before it stay on coss.com's app until their host consents again. On the Scale plan and above. Secrets are never returned.
@@ -15765,13 +17381,13 @@ An admin authorizes once, and every host on the domain gets their calendar with
```csharp -await client.Scheduling.CalendarDelegations.CreateAsync( - new CreateCalendarDelegationRequest( - new CreateCalendarDelegationRequest.Google( - new CreateCalendarDelegationRequestGoogle +await client.Scheduling.OauthApps.CreateAsync( + new CreateOauthAppRequest( + new CreateOauthAppRequest.Google( + new CreateOauthAppRequestGoogle { - Domain = "domain", - ServiceAccountKey = "service_account_key", + ClientId = "client_id", + ClientSecret = "client_secret", } ) ) @@ -15790,7 +17406,7 @@ await client.Scheduling.CalendarDelegations.CreateAsync(
-**request:** `CreateCalendarDelegationRequest` +**request:** `CreateOauthAppRequest`
@@ -15802,7 +17418,7 @@ await client.Scheduling.CalendarDelegations.CreateAsync(
-
client.Scheduling.CalendarDelegations.GetAsync(GetCalendarDelegationsRequest { ... }) -> WithRawResponseTask<SchedulingCalendarDelegation> +
client.Scheduling.OauthApps.GetAsync(GetOauthAppsRequest { ... }) -> WithRawResponseTask<SchedulingOauthApp>
@@ -15814,7 +17430,7 @@ await client.Scheduling.CalendarDelegations.CreateAsync(
-Its status, what to authorize, and how many hosts it has connected. +Its status, what to register at the provider, and how many connections use it.
@@ -15829,8 +17445,8 @@ Its status, what to authorize, and how many hosts it has connected.
```csharp -await client.Scheduling.CalendarDelegations.GetAsync( - new GetCalendarDelegationsRequest { Id = "caldlg_01kd2m9a0b1c2d3e4f5g6h7j8m" } +await client.Scheduling.OauthApps.GetAsync( + new GetOauthAppsRequest { Id = "calapp_01kd2m9a0b1c2d3e4f5g6h7j8m" } ); ```
@@ -15846,7 +17462,7 @@ await client.Scheduling.CalendarDelegations.GetAsync(
-**request:** `GetCalendarDelegationsRequest` +**request:** `GetOauthAppsRequest`
@@ -15858,7 +17474,7 @@ await client.Scheduling.CalendarDelegations.GetAsync(
-
client.Scheduling.CalendarDelegations.DeleteAsync(DeleteCalendarDelegationsRequest { ... }) -> WithRawResponseTask<DeletedSchedulingCalendarDelegation> +
client.Scheduling.OauthApps.DeleteAsync(DeleteOauthAppsRequest { ... }) -> WithRawResponseTask<DeletedSchedulingOauthApp>
@@ -15870,7 +17486,7 @@ await client.Scheduling.CalendarDelegations.GetAsync(
-Its hosts lose these calendars within minutes. They stay bookable with no conflict check, and events already written stay on their calendars, out of reach of later moves or cancellations. +Refused while connections use it (`oauth_app_in_use`), since only it can refresh their access: disconnect them first. New consents go back to coss.com's app.
@@ -15885,8 +17501,8 @@ Its hosts lose these calendars within minutes. They stay bookable with no confli
```csharp -await client.Scheduling.CalendarDelegations.DeleteAsync( - new DeleteCalendarDelegationsRequest { Id = "caldlg_01kd2m9a0b1c2d3e4f5g6h7j8m" } +await client.Scheduling.OauthApps.DeleteAsync( + new DeleteOauthAppsRequest { Id = "calapp_01kd2m9a0b1c2d3e4f5g6h7j8m" } ); ```
@@ -15902,7 +17518,7 @@ await client.Scheduling.CalendarDelegations.DeleteAsync(
-**request:** `DeleteCalendarDelegationsRequest` +**request:** `DeleteOauthAppsRequest`
@@ -15914,7 +17530,7 @@ await client.Scheduling.CalendarDelegations.DeleteAsync(
-
client.Scheduling.CalendarDelegations.UpdateAsync(UpdateCalendarDelegationRequest { ... }) -> WithRawResponseTask<SchedulingCalendarDelegation> +
client.Scheduling.OauthApps.UpdateAsync(UpdateOauthAppRequest { ... }) -> WithRawResponseTask<SchedulingOauthApp>
@@ -15926,7 +17542,7 @@ await client.Scheduling.CalendarDelegations.DeleteAsync(
-New credentials are tried on the verified mailbox before they replace the old ones, and end an outage if they work. +A new client secret is tried on a connection before it replaces the old one, and ends an outage if it works. Its client ID can't change: a different app needs its hosts to consent again.
@@ -15941,11 +17557,11 @@ New credentials are tried on the verified mailbox before they replace the old on
```csharp -await client.Scheduling.CalendarDelegations.UpdateAsync( - new UpdateCalendarDelegationRequest +await client.Scheduling.OauthApps.UpdateAsync( + new UpdateOauthAppRequest { - Id = "caldlg_01kd2m9a0b1c2d3e4f5g6h7j8m", - MatchHostEmail = false, + Id = "calapp_01kd2m9a0b1c2d3e4f5g6h7j8m", + ClientSecret = "GOCSPX-abcdefghijklmnopqrstuvwxyz", } ); ``` @@ -15962,7 +17578,7 @@ await client.Scheduling.CalendarDelegations.UpdateAsync(
-**request:** `UpdateCalendarDelegationRequest` +**request:** `UpdateOauthAppRequest`
@@ -15974,7 +17590,8 @@ await client.Scheduling.CalendarDelegations.UpdateAsync(
-
client.Scheduling.CalendarDelegations.VerifyAsync(VerifyCalendarDelegationRequest { ... }) -> WithRawResponseTask<SchedulingCalendarDelegation> +## Scheduling Sessions +
client.Scheduling.Sessions.CreateForManagerAsync(CreateSchedulingManagerSessionRequest { ... }) -> WithRawResponseTask<SchedulingSession>
@@ -15986,7 +17603,7 @@ await client.Scheduling.CalendarDelegations.UpdateAsync(
-Tries one real mailbox. Passing makes it `active`, and its hosts start connecting. Google can take up to 24 hours to apply a new authorization, so a refusal may just need time. +Lets a team lead manage cover for the hosts you name, or those matching an attribute filter whenever it's asked: time off, bookings that need someone else, and moving them. It never sees attendees' details. Send the `url` to their browser, or embed it with `coss/scheduling`.
@@ -16001,11 +17618,14 @@ Tries one real mailbox. Passing makes it `active`, and its hosts start connectin
```csharp -await client.Scheduling.CalendarDelegations.VerifyAsync( - new VerifyCalendarDelegationRequest +await client.Scheduling.Sessions.CreateForManagerAsync( + new CreateSchedulingManagerSessionRequest { - Id = "caldlg_01kd2m9a0b1c2d3e4f5g6h7j8m", - Account = "ana@example.com", + HostFilter = new Dictionary>>() + { + { "team", "cardiology" }, + }, + ExpiresIn = 3600, } ); ``` @@ -16022,7 +17642,7 @@ await client.Scheduling.CalendarDelegations.VerifyAsync(
-**request:** `VerifyCalendarDelegationRequest` +**request:** `CreateSchedulingManagerSessionRequest`
@@ -16034,7 +17654,6 @@ await client.Scheduling.CalendarDelegations.VerifyAsync(
-## Scheduling Sessions
client.Scheduling.Sessions.CreateForHostAsync(CreateSchedulingHostSessionRequest { ... }) -> WithRawResponseTask<SchedulingSession>
diff --git a/sdks/dotnet/src/Coss.Test/Unit/MockServer/Scheduling/Bookings/ApproveTest.cs b/sdks/dotnet/src/Coss.Test/Unit/MockServer/Scheduling/Bookings/ApproveTest.cs index 284e96621..eb8d751c5 100644 --- a/sdks/dotnet/src/Coss.Test/Unit/MockServer/Scheduling/Bookings/ApproveTest.cs +++ b/sdks/dotnet/src/Coss.Test/Unit/MockServer/Scheduling/Bookings/ApproveTest.cs @@ -126,10 +126,7 @@ public async Task MockServerTest_2() } } ], - "location": { - "type": "link", - "url": "url" - }, + "location": null, "hold_expires_at": null, "approval_expires_at": null, "series": null, diff --git a/sdks/dotnet/src/Coss.Test/Unit/MockServer/Scheduling/Bookings/CancelTest.cs b/sdks/dotnet/src/Coss.Test/Unit/MockServer/Scheduling/Bookings/CancelTest.cs index a6bf575da..5597d1276 100644 --- a/sdks/dotnet/src/Coss.Test/Unit/MockServer/Scheduling/Bookings/CancelTest.cs +++ b/sdks/dotnet/src/Coss.Test/Unit/MockServer/Scheduling/Bookings/CancelTest.cs @@ -138,10 +138,7 @@ public async Task MockServerTest_2() } } ], - "location": { - "type": "link", - "url": "url" - }, + "location": null, "hold_expires_at": null, "approval_expires_at": null, "series": null, diff --git a/sdks/dotnet/src/Coss.Test/Unit/MockServer/Scheduling/Bookings/CreateTest.cs b/sdks/dotnet/src/Coss.Test/Unit/MockServer/Scheduling/Bookings/CreateTest.cs index f5096e584..b0b9dc989 100644 --- a/sdks/dotnet/src/Coss.Test/Unit/MockServer/Scheduling/Bookings/CreateTest.cs +++ b/sdks/dotnet/src/Coss.Test/Unit/MockServer/Scheduling/Bookings/CreateTest.cs @@ -172,10 +172,7 @@ public async Task MockServerTest_2() } } ], - "location": { - "type": "link", - "url": "url" - }, + "location": null, "hold_expires_at": null, "approval_expires_at": null, "series": null, diff --git a/sdks/dotnet/src/Coss.Test/Unit/MockServer/Scheduling/Bookings/DeclineTest.cs b/sdks/dotnet/src/Coss.Test/Unit/MockServer/Scheduling/Bookings/DeclineTest.cs index c36c00752..8447b51db 100644 --- a/sdks/dotnet/src/Coss.Test/Unit/MockServer/Scheduling/Bookings/DeclineTest.cs +++ b/sdks/dotnet/src/Coss.Test/Unit/MockServer/Scheduling/Bookings/DeclineTest.cs @@ -126,10 +126,7 @@ public async Task MockServerTest_2() } } ], - "location": { - "type": "link", - "url": "url" - }, + "location": null, "hold_expires_at": null, "approval_expires_at": null, "series": null, diff --git a/sdks/dotnet/src/Coss.Test/Unit/MockServer/Scheduling/Bookings/GetTest.cs b/sdks/dotnet/src/Coss.Test/Unit/MockServer/Scheduling/Bookings/GetTest.cs index 72cecc2b3..67774efa5 100644 --- a/sdks/dotnet/src/Coss.Test/Unit/MockServer/Scheduling/Bookings/GetTest.cs +++ b/sdks/dotnet/src/Coss.Test/Unit/MockServer/Scheduling/Bookings/GetTest.cs @@ -126,10 +126,7 @@ public async Task MockServerTest_2() } } ], - "location": { - "type": "link", - "url": "url" - }, + "location": null, "hold_expires_at": null, "approval_expires_at": null, "series": null, diff --git a/sdks/dotnet/src/Coss.Test/Unit/MockServer/Scheduling/Bookings/ListTest.cs b/sdks/dotnet/src/Coss.Test/Unit/MockServer/Scheduling/Bookings/ListTest.cs index a07ca1738..bcac2f3f4 100644 --- a/sdks/dotnet/src/Coss.Test/Unit/MockServer/Scheduling/Bookings/ListTest.cs +++ b/sdks/dotnet/src/Coss.Test/Unit/MockServer/Scheduling/Bookings/ListTest.cs @@ -191,9 +191,7 @@ public async Task MockServerTest_2() "locale": null } ], - "location": { - "type": "link" - }, + "location": null, "hold_expires_at": null, "approval_expires_at": null, "series": null, diff --git a/sdks/dotnet/src/Coss.Test/Unit/MockServer/Scheduling/Bookings/MarkNoShowTest.cs b/sdks/dotnet/src/Coss.Test/Unit/MockServer/Scheduling/Bookings/MarkNoShowTest.cs index 7fa0bbf3a..0b6d90bb5 100644 --- a/sdks/dotnet/src/Coss.Test/Unit/MockServer/Scheduling/Bookings/MarkNoShowTest.cs +++ b/sdks/dotnet/src/Coss.Test/Unit/MockServer/Scheduling/Bookings/MarkNoShowTest.cs @@ -126,10 +126,7 @@ public async Task MockServerTest_2() } } ], - "location": { - "type": "link", - "url": "url" - }, + "location": null, "hold_expires_at": null, "approval_expires_at": null, "series": null, diff --git a/sdks/dotnet/src/Coss.Test/Unit/MockServer/Scheduling/Bookings/ReassignCandidatesTest.cs b/sdks/dotnet/src/Coss.Test/Unit/MockServer/Scheduling/Bookings/ReassignCandidatesTest.cs new file mode 100644 index 000000000..76deef044 --- /dev/null +++ b/sdks/dotnet/src/Coss.Test/Unit/MockServer/Scheduling/Bookings/ReassignCandidatesTest.cs @@ -0,0 +1,124 @@ +using Coss.Scheduling; +using Coss.Test.Unit.MockServer; +using Coss.Test.Utils; +using NUnit.Framework; + +namespace Coss.Test.Unit.MockServer.Scheduling.Bookings; + +[TestFixture] +[Parallelizable(ParallelScope.Self)] +public class ReassignCandidatesTest : BaseMockServerTest +{ + [NUnit.Framework.Test] + public async Task MockServerTest_1() + { + const string mockResponse = """ + { + "object": "list", + "data": [ + { + "object": "scheduling.reassign_candidate", + "host": "host", + "uid": "uid", + "name": "name", + "member": true, + "available": true, + "reason": "reason", + "reasons": [ + "reasons", + "reasons" + ], + "load": 1.1, + "rank": 1.1, + "meeting_provider_missing": true + }, + { + "object": "scheduling.reassign_candidate", + "host": "host", + "uid": "uid", + "name": "name", + "member": true, + "available": true, + "reason": "reason", + "reasons": [ + "reasons", + "reasons" + ], + "load": 1.1, + "rank": 1.1, + "meeting_provider_missing": true + } + ], + "has_more": true + } + """; + + Server + .Given( + WireMock + .RequestBuilders.Request.Create() + .WithPath("/v1/scheduling/bookings/id/reassign_candidates") + .UsingGet() + ) + .RespondWith( + WireMock + .ResponseBuilders.Response.Create() + .WithStatusCode(200) + .WithBody(mockResponse) + ); + + var response = await Client.Scheduling.Bookings.ReassignCandidatesAsync( + new ReassignCandidatesBookingsRequest { Id = "id" } + ); + JsonAssert.AreEqual(response, mockResponse); + } + + [NUnit.Framework.Test] + public async Task MockServerTest_2() + { + const string mockResponse = """ + { + "object": "list", + "data": [ + { + "object": "scheduling.reassign_candidate", + "host": "host_01kd2m9a0b1c2d3e4f5g6h7j8m", + "uid": "doctor_518", + "name": "Dr. Priya Raman", + "member": true, + "available": true, + "reason": null, + "reasons": [ + "reasons" + ], + "load": 4, + "rank": 1, + "meeting_provider_missing": false + } + ], + "has_more": false + } + """; + + Server + .Given( + WireMock + .RequestBuilders.Request.Create() + .WithPath( + "/v1/scheduling/bookings/book_01kd2m9a0b1c2d3e4f5g6h7j8m/reassign_candidates" + ) + .UsingGet() + ) + .RespondWith( + WireMock + .ResponseBuilders.Response.Create() + .WithStatusCode(200) + .WithBody(mockResponse) + ); + + var response = await Client.Scheduling.Bookings.ReassignCandidatesAsync( + new ReassignCandidatesBookingsRequest { Id = "book_01kd2m9a0b1c2d3e4f5g6h7j8m" } + ); + JsonAssert.AreEqual(response, mockResponse); + } +} diff --git a/sdks/dotnet/src/Coss.Test/Unit/MockServer/Scheduling/Bookings/ReassignTest.cs b/sdks/dotnet/src/Coss.Test/Unit/MockServer/Scheduling/Bookings/ReassignTest.cs new file mode 100644 index 000000000..13c5a8655 --- /dev/null +++ b/sdks/dotnet/src/Coss.Test/Unit/MockServer/Scheduling/Bookings/ReassignTest.cs @@ -0,0 +1,225 @@ +using Coss.Scheduling; +using Coss.Test.Unit.MockServer; +using Coss.Test.Utils; +using NUnit.Framework; + +namespace Coss.Test.Unit.MockServer.Scheduling.Bookings; + +[TestFixture] +[Parallelizable(ParallelScope.Self)] +public class ReassignTest : BaseMockServerTest +{ + [NUnit.Framework.Test] + public async Task MockServerTest_1() + { + const string requestJson = """ + { + "changes": [ + {}, + {} + ], + "reason_code": "host_unavailable" + } + """; + + const string mockResponse = """ + { + "object": "scheduling.booking", + "id": "id", + "event_type": "event_type", + "status": "held", + "title": "title", + "start": "start", + "end": "end", + "hosts": [ + "hosts", + "hosts" + ], + "attendees": [ + { + "id": "id", + "role": "attendee", + "uid": "uid", + "name": "name", + "email": "email", + "phone": "phone", + "time_zone": "time_zone", + "locale": "locale", + "answers": { + "answers": "answers" + } + }, + { + "id": "id", + "role": "attendee", + "uid": "uid", + "name": "name", + "email": "email", + "phone": "phone", + "time_zone": "time_zone", + "locale": "locale", + "answers": { + "answers": "answers" + } + } + ], + "location": { + "type": "link", + "url": "url" + }, + "hold_expires_at": "hold_expires_at", + "approval_expires_at": "approval_expires_at", + "series": "series", + "series_index": 1.1, + "group_session": "group_session", + "calendar_unverified": true, + "external_conflict_at": "external_conflict_at", + "no_show_at": "no_show_at", + "cancelled_at": "cancelled_at", + "cancelled_by": "api_key", + "cancellation_reason": "cancellation_reason", + "metadata": { + "metadata": "metadata" + }, + "created_at": "created_at", + "updated_at": "updated_at" + } + """; + + Server + .Given( + WireMock + .RequestBuilders.Request.Create() + .WithPath("/v1/scheduling/bookings/id/reassign") + .WithHeader("Content-Type", "application/json") + .UsingPost() + .WithBodyAsJson(requestJson) + ) + .RespondWith( + WireMock + .ResponseBuilders.Response.Create() + .WithStatusCode(200) + .WithBody(mockResponse) + ); + + var response = await Client.Scheduling.Bookings.ReassignAsync( + new ReassignSchedulingBookingRequest + { + Id = "id", + Changes = new List() + { + new ReassignSchedulingBookingRequestChangesItem + { + FromHost = null, + ToHost = null, + Auto = null, + PreferredHosts = null, + }, + new ReassignSchedulingBookingRequestChangesItem + { + FromHost = null, + ToHost = null, + Auto = null, + PreferredHosts = null, + }, + }, + ReasonCode = ReassignSchedulingBookingRequestReasonCode.HostUnavailable, + Note = null, + Overrides = null, + Notify = null, + } + ); + JsonAssert.AreEqual(response, mockResponse); + } + + [NUnit.Framework.Test] + public async Task MockServerTest_2() + { + const string requestJson = """ + { + "changes": [ + { + "to_host": "doctor_518" + } + ], + "reason_code": "out_of_office" + } + """; + + const string mockResponse = """ + { + "object": "scheduling.booking", + "id": "book_01kd2m9a0b1c2d3e4f5g6h7j8m", + "event_type": "evtype_01kd2m9a0b1c2d3e4f5g6h7j8m", + "status": "confirmed", + "title": "Initial consultation", + "start": "2027-01-04T15:00:00.000Z", + "end": "2027-01-04T15:30:00.000Z", + "hosts": [ + "host_01kd2m9a0b1c2d3e4f5g6h7j8m" + ], + "attendees": [ + { + "id": "attn_01kd2m9a0b1c2d3e4f5g6h7j8m", + "role": "attendee", + "uid": "patient_77", + "name": "Sam Lee", + "email": "sam@example.com", + "phone": null, + "time_zone": "UTC", + "locale": null, + "answers": { + "key": "value" + } + } + ], + "location": null, + "hold_expires_at": null, + "approval_expires_at": null, + "series": null, + "series_index": null, + "group_session": null, + "calendar_unverified": false, + "external_conflict_at": null, + "no_show_at": null, + "cancelled_at": null, + "cancelled_by": null, + "cancellation_reason": "cancellation_reason", + "metadata": { + "key": "value" + }, + "created_at": "2027-01-01T10:00:00.000Z", + "updated_at": "2027-01-01T10:00:00.000Z" + } + """; + + Server + .Given( + WireMock + .RequestBuilders.Request.Create() + .WithPath("/v1/scheduling/bookings/book_01kd2m9a0b1c2d3e4f5g6h7j8m/reassign") + .WithHeader("Content-Type", "application/json") + .UsingPost() + .WithBodyAsJson(requestJson) + ) + .RespondWith( + WireMock + .ResponseBuilders.Response.Create() + .WithStatusCode(200) + .WithBody(mockResponse) + ); + + var response = await Client.Scheduling.Bookings.ReassignAsync( + new ReassignSchedulingBookingRequest + { + Id = "book_01kd2m9a0b1c2d3e4f5g6h7j8m", + Changes = new List() + { + new ReassignSchedulingBookingRequestChangesItem { ToHost = "doctor_518" }, + }, + ReasonCode = ReassignSchedulingBookingRequestReasonCode.OutOfOffice, + } + ); + JsonAssert.AreEqual(response, mockResponse); + } +} diff --git a/sdks/dotnet/src/Coss.Test/Unit/MockServer/Scheduling/Bookings/RescheduleTest.cs b/sdks/dotnet/src/Coss.Test/Unit/MockServer/Scheduling/Bookings/RescheduleTest.cs index cedc2c8f3..6881c1142 100644 --- a/sdks/dotnet/src/Coss.Test/Unit/MockServer/Scheduling/Bookings/RescheduleTest.cs +++ b/sdks/dotnet/src/Coss.Test/Unit/MockServer/Scheduling/Bookings/RescheduleTest.cs @@ -145,10 +145,7 @@ public async Task MockServerTest_2() } } ], - "location": { - "type": "link", - "url": "url" - }, + "location": null, "hold_expires_at": null, "approval_expires_at": null, "series": null, diff --git a/sdks/dotnet/src/Coss.Test/Unit/MockServer/Scheduling/Bookings/UpdateLocationTest.cs b/sdks/dotnet/src/Coss.Test/Unit/MockServer/Scheduling/Bookings/UpdateLocationTest.cs index 5cbae602e..3cdb2c349 100644 --- a/sdks/dotnet/src/Coss.Test/Unit/MockServer/Scheduling/Bookings/UpdateLocationTest.cs +++ b/sdks/dotnet/src/Coss.Test/Unit/MockServer/Scheduling/Bookings/UpdateLocationTest.cs @@ -15,10 +15,7 @@ public async Task MockServerTest_1() { const string requestJson = """ { - "location": { - "type": "link", - "url": null - } + "location": null } """; @@ -103,13 +100,7 @@ public async Task MockServerTest_1() ); var response = await Client.Scheduling.Bookings.UpdateLocationAsync( - new UpdateBookingLocationRequest - { - Id = "id", - Location = new SchedulingLocation( - new SchedulingLocation.Link(new SchedulingLocationLink { Url = null }) - ), - } + new UpdateBookingLocationRequest { Id = "id", Location = null } ); JsonAssert.AreEqual(response, mockResponse); } @@ -153,10 +144,7 @@ public async Task MockServerTest_2() } } ], - "location": { - "type": "link", - "url": "url" - }, + "location": null, "hold_expires_at": null, "approval_expires_at": null, "series": null, @@ -196,11 +184,11 @@ public async Task MockServerTest_2() new UpdateBookingLocationRequest { Id = "book_01kd2m9a0b1c2d3e4f5g6h7j8m", - Location = new SchedulingLocation( - new SchedulingLocation.Link( - new SchedulingLocationLink { Url = "https://meet.example.com/abc" } - ) - ), + Location = new SchedulingLocationZero + { + Type = SchedulingLocationZeroType.Link, + Url = "https://meet.example.com/abc", + }, } ); JsonAssert.AreEqual(response, mockResponse); diff --git a/sdks/dotnet/src/Coss.Test/Unit/MockServer/Scheduling/Calendars/ConnectTest.cs b/sdks/dotnet/src/Coss.Test/Unit/MockServer/Scheduling/Calendars/ConnectTest.cs index 201dd7f60..a8149da1d 100644 --- a/sdks/dotnet/src/Coss.Test/Unit/MockServer/Scheduling/Calendars/ConnectTest.cs +++ b/sdks/dotnet/src/Coss.Test/Unit/MockServer/Scheduling/Calendars/ConnectTest.cs @@ -30,6 +30,7 @@ public async Task MockServerTest_1() "provider": "google", "account": "account", "status": "active", + "oauth_app": "oauth_app", "delegation": "delegation", "calendars": [ { @@ -106,6 +107,7 @@ public async Task MockServerTest_2() "provider": "google", "account": "ana@example.com", "status": "active", + "oauth_app": null, "delegation": null, "calendars": [ { diff --git a/sdks/dotnet/src/Coss.Test/Unit/MockServer/Scheduling/Calendars/ListTest.cs b/sdks/dotnet/src/Coss.Test/Unit/MockServer/Scheduling/Calendars/ListTest.cs index a3c703ffe..f6b0b5b2a 100644 --- a/sdks/dotnet/src/Coss.Test/Unit/MockServer/Scheduling/Calendars/ListTest.cs +++ b/sdks/dotnet/src/Coss.Test/Unit/MockServer/Scheduling/Calendars/ListTest.cs @@ -23,6 +23,7 @@ public async Task MockServerTest_1() "provider": "google", "account": "account", "status": "active", + "oauth_app": "oauth_app", "delegation": "delegation", "calendars": [ { @@ -49,6 +50,7 @@ public async Task MockServerTest_1() "provider": "google", "account": "account", "status": "active", + "oauth_app": "oauth_app", "delegation": "delegation", "calendars": [ { @@ -107,6 +109,7 @@ public async Task MockServerTest_2() "provider": "google", "account": "ana@example.com", "status": "active", + "oauth_app": null, "delegation": null, "calendars": [ { diff --git a/sdks/dotnet/src/Coss.Test/Unit/MockServer/Scheduling/Calendars/UpdateTest.cs b/sdks/dotnet/src/Coss.Test/Unit/MockServer/Scheduling/Calendars/UpdateTest.cs index 88086a442..36364ed2b 100644 --- a/sdks/dotnet/src/Coss.Test/Unit/MockServer/Scheduling/Calendars/UpdateTest.cs +++ b/sdks/dotnet/src/Coss.Test/Unit/MockServer/Scheduling/Calendars/UpdateTest.cs @@ -27,6 +27,7 @@ public async Task MockServerTest_1() "provider": "google", "account": "account", "status": "active", + "oauth_app": "oauth_app", "delegation": "delegation", "calendars": [ { @@ -53,6 +54,7 @@ public async Task MockServerTest_1() "provider": "google", "account": "account", "status": "active", + "oauth_app": "oauth_app", "delegation": "delegation", "calendars": [ { @@ -125,6 +127,7 @@ public async Task MockServerTest_2() "provider": "google", "account": "ana@example.com", "status": "active", + "oauth_app": null, "delegation": null, "calendars": [ { diff --git a/sdks/dotnet/src/Coss.Test/Unit/MockServer/Scheduling/EventTypes/CreateTest.cs b/sdks/dotnet/src/Coss.Test/Unit/MockServer/Scheduling/EventTypes/CreateTest.cs index 456ade312..f441f1896 100644 --- a/sdks/dotnet/src/Coss.Test/Unit/MockServer/Scheduling/EventTypes/CreateTest.cs +++ b/sdks/dotnet/src/Coss.Test/Unit/MockServer/Scheduling/EventTypes/CreateTest.cs @@ -65,6 +65,7 @@ public async Task MockServerTest_1() ], "capacity": 1.1, "requires_approval": true, + "reassignment_enabled": true, "approval_ttl_minutes": 1.1, "hold_ttl_seconds": 1.1, "cancel_notice_minutes": 1.1, @@ -238,6 +239,7 @@ public async Task MockServerTest_1() Limits = null, Capacity = null, RequiresApproval = null, + ReassignmentEnabled = null, ApprovalTtlMinutes = null, HoldTtlSeconds = null, CancelNoticeMinutes = null, @@ -303,6 +305,7 @@ public async Task MockServerTest_2() ], "capacity": null, "requires_approval": false, + "reassignment_enabled": true, "approval_ttl_minutes": 1440, "hold_ttl_seconds": 600, "cancel_notice_minutes": 0, diff --git a/sdks/dotnet/src/Coss.Test/Unit/MockServer/Scheduling/EventTypes/GetTest.cs b/sdks/dotnet/src/Coss.Test/Unit/MockServer/Scheduling/EventTypes/GetTest.cs index b71316ea9..afdded4c9 100644 --- a/sdks/dotnet/src/Coss.Test/Unit/MockServer/Scheduling/EventTypes/GetTest.cs +++ b/sdks/dotnet/src/Coss.Test/Unit/MockServer/Scheduling/EventTypes/GetTest.cs @@ -48,6 +48,7 @@ public async Task MockServerTest_1() ], "capacity": 1.1, "requires_approval": true, + "reassignment_enabled": true, "approval_ttl_minutes": 1.1, "hold_ttl_seconds": 1.1, "cancel_notice_minutes": 1.1, @@ -238,6 +239,7 @@ public async Task MockServerTest_2() ], "capacity": null, "requires_approval": false, + "reassignment_enabled": true, "approval_ttl_minutes": 1440, "hold_ttl_seconds": 600, "cancel_notice_minutes": 0, diff --git a/sdks/dotnet/src/Coss.Test/Unit/MockServer/Scheduling/EventTypes/ListTest.cs b/sdks/dotnet/src/Coss.Test/Unit/MockServer/Scheduling/EventTypes/ListTest.cs index 7bf7a350e..2dd83a079 100644 --- a/sdks/dotnet/src/Coss.Test/Unit/MockServer/Scheduling/EventTypes/ListTest.cs +++ b/sdks/dotnet/src/Coss.Test/Unit/MockServer/Scheduling/EventTypes/ListTest.cs @@ -51,6 +51,7 @@ public async Task MockServerTest_1() ], "capacity": 1.1, "requires_approval": true, + "reassignment_enabled": true, "approval_ttl_minutes": 1.1, "hold_ttl_seconds": 1.1, "cancel_notice_minutes": 1.1, @@ -224,6 +225,7 @@ public async Task MockServerTest_1() ], "capacity": 1.1, "requires_approval": true, + "reassignment_enabled": true, "approval_ttl_minutes": 1.1, "hold_ttl_seconds": 1.1, "cancel_notice_minutes": 1.1, @@ -419,6 +421,7 @@ public async Task MockServerTest_2() ], "capacity": null, "requires_approval": false, + "reassignment_enabled": true, "approval_ttl_minutes": 1440, "hold_ttl_seconds": 600, "cancel_notice_minutes": 0, @@ -434,9 +437,7 @@ public async Task MockServerTest_2() } ], "locations": [ - { - "type": "link" - } + null ], "host_filter": null, "notifications": null, diff --git a/sdks/dotnet/src/Coss.Test/Unit/MockServer/Scheduling/EventTypes/UpdateTest.cs b/sdks/dotnet/src/Coss.Test/Unit/MockServer/Scheduling/EventTypes/UpdateTest.cs index 4cde77b06..658f66d83 100644 --- a/sdks/dotnet/src/Coss.Test/Unit/MockServer/Scheduling/EventTypes/UpdateTest.cs +++ b/sdks/dotnet/src/Coss.Test/Unit/MockServer/Scheduling/EventTypes/UpdateTest.cs @@ -63,6 +63,7 @@ public async Task MockServerTest_1() ], "capacity": 1.1, "requires_approval": true, + "reassignment_enabled": true, "approval_ttl_minutes": 1.1, "hold_ttl_seconds": 1.1, "cancel_notice_minutes": 1.1, @@ -236,6 +237,7 @@ public async Task MockServerTest_1() Limits = null, Capacity = null, RequiresApproval = null, + ReassignmentEnabled = null, ApprovalTtlMinutes = null, HoldTtlSeconds = null, CancelNoticeMinutes = null, @@ -293,6 +295,7 @@ public async Task MockServerTest_2() ], "capacity": null, "requires_approval": false, + "reassignment_enabled": true, "approval_ttl_minutes": 1440, "hold_ttl_seconds": 600, "cancel_notice_minutes": 0, diff --git a/sdks/dotnet/src/Coss.Test/Unit/MockServer/Scheduling/Holds/ConfirmTest.cs b/sdks/dotnet/src/Coss.Test/Unit/MockServer/Scheduling/Holds/ConfirmTest.cs index a3615729f..f0d5023bb 100644 --- a/sdks/dotnet/src/Coss.Test/Unit/MockServer/Scheduling/Holds/ConfirmTest.cs +++ b/sdks/dotnet/src/Coss.Test/Unit/MockServer/Scheduling/Holds/ConfirmTest.cs @@ -138,10 +138,7 @@ public async Task MockServerTest_2() } } ], - "location": { - "type": "link", - "url": "url" - }, + "location": null, "hold_expires_at": null, "approval_expires_at": null, "series": null, diff --git a/sdks/dotnet/src/Coss.Test/Unit/MockServer/Scheduling/Holds/CreateTest.cs b/sdks/dotnet/src/Coss.Test/Unit/MockServer/Scheduling/Holds/CreateTest.cs index 2b1c69ae4..0c6110c96 100644 --- a/sdks/dotnet/src/Coss.Test/Unit/MockServer/Scheduling/Holds/CreateTest.cs +++ b/sdks/dotnet/src/Coss.Test/Unit/MockServer/Scheduling/Holds/CreateTest.cs @@ -170,10 +170,7 @@ public async Task MockServerTest_2() } } ], - "location": { - "type": "link", - "url": "url" - }, + "location": null, "hold_expires_at": null, "approval_expires_at": null, "series": null, diff --git a/sdks/dotnet/src/Coss.Test/Unit/MockServer/Scheduling/Holds/ReleaseTest.cs b/sdks/dotnet/src/Coss.Test/Unit/MockServer/Scheduling/Holds/ReleaseTest.cs index 02f919173..0587bda7c 100644 --- a/sdks/dotnet/src/Coss.Test/Unit/MockServer/Scheduling/Holds/ReleaseTest.cs +++ b/sdks/dotnet/src/Coss.Test/Unit/MockServer/Scheduling/Holds/ReleaseTest.cs @@ -126,10 +126,7 @@ public async Task MockServerTest_2() } } ], - "location": { - "type": "link", - "url": "url" - }, + "location": null, "hold_expires_at": null, "approval_expires_at": null, "series": null, diff --git a/sdks/dotnet/src/Coss.Test/Unit/MockServer/Scheduling/HolidayCalendars/CreateTest.cs b/sdks/dotnet/src/Coss.Test/Unit/MockServer/Scheduling/HolidayCalendars/CreateTest.cs new file mode 100644 index 000000000..9d1c73b5a --- /dev/null +++ b/sdks/dotnet/src/Coss.Test/Unit/MockServer/Scheduling/HolidayCalendars/CreateTest.cs @@ -0,0 +1,151 @@ +using Coss.Scheduling; +using Coss.Test.Unit.MockServer; +using Coss.Test.Utils; +using NUnit.Framework; +using OneOf; + +namespace Coss.Test.Unit.MockServer.Scheduling.HolidayCalendars; + +[TestFixture] +[Parallelizable(ParallelScope.Self)] +public class CreateTest : BaseMockServerTest +{ + [NUnit.Framework.Test] + public async Task MockServerTest_1() + { + const string requestJson = """ + { + "name": "x" + } + """; + + const string mockResponse = """ + { + "object": "scheduling.holiday_calendar", + "id": "id", + "name": "name", + "source": "country", + "country": "country", + "hosts": [ + "hosts", + "hosts" + ], + "host_filter": { + "host_filter": "host_filter" + }, + "regions": [ + "regions", + "regions" + ], + "delegates": [ + "delegates", + "delegates" + ], + "existing_bookings": "leave", + "last_read_at": "last_read_at", + "last_error": "last_error", + "created_at": "created_at", + "updated_at": "updated_at" + } + """; + + Server + .Given( + WireMock + .RequestBuilders.Request.Create() + .WithPath("/v1/scheduling/holiday_calendars") + .WithHeader("Content-Type", "application/json") + .UsingPost() + .WithBodyAsJson(requestJson) + ) + .RespondWith( + WireMock + .ResponseBuilders.Response.Create() + .WithStatusCode(200) + .WithBody(mockResponse) + ); + + var response = await Client.Scheduling.HolidayCalendars.CreateAsync( + new CreateSchedulingHolidayCalendarRequest + { + Name = "x", + Country = null, + IcsUrl = null, + Hosts = null, + HostFilter = null, + Regions = null, + Delegates = null, + ExistingBookings = null, + } + ); + JsonAssert.AreEqual(response, mockResponse); + } + + [NUnit.Framework.Test] + public async Task MockServerTest_2() + { + const string requestJson = """ + { + "name": "UK team", + "country": "GB", + "host_filter": { + "team": "london" + } + } + """; + + const string mockResponse = """ + { + "object": "scheduling.holiday_calendar", + "id": "hcal_01kd2m9a0b1c2d3e4f5g6h7j8m", + "name": "UK team", + "source": "country", + "country": "GB", + "hosts": null, + "host_filter": { + "team": "london" + }, + "regions": [ + "England" + ], + "delegates": [ + "delegates" + ], + "existing_bookings": "leave", + "last_read_at": "2027-01-01T10:00:00.000Z", + "last_error": null, + "created_at": "2027-01-01T10:00:00.000Z", + "updated_at": "2027-01-01T10:00:00.000Z" + } + """; + + Server + .Given( + WireMock + .RequestBuilders.Request.Create() + .WithPath("/v1/scheduling/holiday_calendars") + .WithHeader("Content-Type", "application/json") + .UsingPost() + .WithBodyAsJson(requestJson) + ) + .RespondWith( + WireMock + .ResponseBuilders.Response.Create() + .WithStatusCode(200) + .WithBody(mockResponse) + ); + + var response = await Client.Scheduling.HolidayCalendars.CreateAsync( + new CreateSchedulingHolidayCalendarRequest + { + Name = "UK team", + Country = "GB", + HostFilter = new Dictionary>>() + { + { "team", "london" }, + }, + } + ); + JsonAssert.AreEqual(response, mockResponse); + } +} diff --git a/sdks/dotnet/src/Coss.Test/Unit/MockServer/Scheduling/HolidayCalendars/GetTest.cs b/sdks/dotnet/src/Coss.Test/Unit/MockServer/Scheduling/HolidayCalendars/GetTest.cs new file mode 100644 index 000000000..55dbbdcfc --- /dev/null +++ b/sdks/dotnet/src/Coss.Test/Unit/MockServer/Scheduling/HolidayCalendars/GetTest.cs @@ -0,0 +1,112 @@ +using Coss.Scheduling; +using Coss.Test.Unit.MockServer; +using Coss.Test.Utils; +using NUnit.Framework; + +namespace Coss.Test.Unit.MockServer.Scheduling.HolidayCalendars; + +[TestFixture] +[Parallelizable(ParallelScope.Self)] +public class GetTest : BaseMockServerTest +{ + [NUnit.Framework.Test] + public async Task MockServerTest_1() + { + const string mockResponse = """ + { + "object": "scheduling.holiday_calendar", + "id": "id", + "name": "name", + "source": "country", + "country": "country", + "hosts": [ + "hosts", + "hosts" + ], + "host_filter": { + "host_filter": "host_filter" + }, + "regions": [ + "regions", + "regions" + ], + "delegates": [ + "delegates", + "delegates" + ], + "existing_bookings": "leave", + "last_read_at": "last_read_at", + "last_error": "last_error", + "created_at": "created_at", + "updated_at": "updated_at" + } + """; + + Server + .Given( + WireMock + .RequestBuilders.Request.Create() + .WithPath("/v1/scheduling/holiday_calendars/id") + .UsingGet() + ) + .RespondWith( + WireMock + .ResponseBuilders.Response.Create() + .WithStatusCode(200) + .WithBody(mockResponse) + ); + + var response = await Client.Scheduling.HolidayCalendars.GetAsync( + new GetHolidayCalendarsRequest { Id = "id" } + ); + JsonAssert.AreEqual(response, mockResponse); + } + + [NUnit.Framework.Test] + public async Task MockServerTest_2() + { + const string mockResponse = """ + { + "object": "scheduling.holiday_calendar", + "id": "hcal_01kd2m9a0b1c2d3e4f5g6h7j8m", + "name": "UK team", + "source": "country", + "country": "GB", + "hosts": null, + "host_filter": { + "team": "london" + }, + "regions": [ + "England" + ], + "delegates": [ + "delegates" + ], + "existing_bookings": "leave", + "last_read_at": "2027-01-01T10:00:00.000Z", + "last_error": null, + "created_at": "2027-01-01T10:00:00.000Z", + "updated_at": "2027-01-01T10:00:00.000Z" + } + """; + + Server + .Given( + WireMock + .RequestBuilders.Request.Create() + .WithPath("/v1/scheduling/holiday_calendars/id") + .UsingGet() + ) + .RespondWith( + WireMock + .ResponseBuilders.Response.Create() + .WithStatusCode(200) + .WithBody(mockResponse) + ); + + var response = await Client.Scheduling.HolidayCalendars.GetAsync( + new GetHolidayCalendarsRequest { Id = "id" } + ); + JsonAssert.AreEqual(response, mockResponse); + } +} diff --git a/sdks/dotnet/src/Coss.Test/Unit/MockServer/Scheduling/HolidayCalendars/HolidaysTest.cs b/sdks/dotnet/src/Coss.Test/Unit/MockServer/Scheduling/HolidayCalendars/HolidaysTest.cs new file mode 100644 index 000000000..d4d80b89e --- /dev/null +++ b/sdks/dotnet/src/Coss.Test/Unit/MockServer/Scheduling/HolidayCalendars/HolidaysTest.cs @@ -0,0 +1,90 @@ +using Coss.Scheduling; +using Coss.Test.Unit.MockServer; +using Coss.Test.Utils; +using NUnit.Framework; + +namespace Coss.Test.Unit.MockServer.Scheduling.HolidayCalendars; + +[TestFixture] +[Parallelizable(ParallelScope.Self)] +public class HolidaysTest : BaseMockServerTest +{ + [NUnit.Framework.Test] + public async Task MockServerTest_1() + { + const string mockResponse = """ + { + "object": "list", + "data": [ + { + "date": "date", + "name": "name", + "region": "region" + }, + { + "date": "date", + "name": "name", + "region": "region" + } + ], + "has_more": true + } + """; + + Server + .Given( + WireMock + .RequestBuilders.Request.Create() + .WithPath("/v1/scheduling/holiday_calendars/id/holidays") + .UsingGet() + ) + .RespondWith( + WireMock + .ResponseBuilders.Response.Create() + .WithStatusCode(200) + .WithBody(mockResponse) + ); + + var response = await Client.Scheduling.HolidayCalendars.HolidaysAsync( + new HolidaysHolidayCalendarsRequest { Id = "id" } + ); + JsonAssert.AreEqual(response, mockResponse); + } + + [NUnit.Framework.Test] + public async Task MockServerTest_2() + { + const string mockResponse = """ + { + "object": "list", + "data": [ + { + "date": "2027-12-25", + "name": "Christmas Day", + "region": null + } + ], + "has_more": false + } + """; + + Server + .Given( + WireMock + .RequestBuilders.Request.Create() + .WithPath("/v1/scheduling/holiday_calendars/id/holidays") + .UsingGet() + ) + .RespondWith( + WireMock + .ResponseBuilders.Response.Create() + .WithStatusCode(200) + .WithBody(mockResponse) + ); + + var response = await Client.Scheduling.HolidayCalendars.HolidaysAsync( + new HolidaysHolidayCalendarsRequest { Id = "id" } + ); + JsonAssert.AreEqual(response, mockResponse); + } +} diff --git a/sdks/dotnet/src/Coss.Test/Unit/MockServer/Scheduling/HolidayCalendars/ListTest.cs b/sdks/dotnet/src/Coss.Test/Unit/MockServer/Scheduling/HolidayCalendars/ListTest.cs new file mode 100644 index 000000000..c6ae31c68 --- /dev/null +++ b/sdks/dotnet/src/Coss.Test/Unit/MockServer/Scheduling/HolidayCalendars/ListTest.cs @@ -0,0 +1,146 @@ +using Coss.Test.Unit.MockServer; +using Coss.Test.Utils; +using NUnit.Framework; + +namespace Coss.Test.Unit.MockServer.Scheduling.HolidayCalendars; + +[TestFixture] +[Parallelizable(ParallelScope.Self)] +public class ListTest : BaseMockServerTest +{ + [NUnit.Framework.Test] + public async Task MockServerTest_1() + { + const string mockResponse = """ + { + "object": "list", + "data": [ + { + "object": "scheduling.holiday_calendar", + "id": "id", + "name": "name", + "source": "country", + "country": "country", + "hosts": [ + "hosts", + "hosts" + ], + "host_filter": { + "host_filter": "host_filter" + }, + "regions": [ + "regions", + "regions" + ], + "delegates": [ + "delegates", + "delegates" + ], + "existing_bookings": "leave", + "last_read_at": "last_read_at", + "last_error": "last_error", + "created_at": "created_at", + "updated_at": "updated_at" + }, + { + "object": "scheduling.holiday_calendar", + "id": "id", + "name": "name", + "source": "country", + "country": "country", + "hosts": [ + "hosts", + "hosts" + ], + "host_filter": { + "host_filter": "host_filter" + }, + "regions": [ + "regions", + "regions" + ], + "delegates": [ + "delegates", + "delegates" + ], + "existing_bookings": "leave", + "last_read_at": "last_read_at", + "last_error": "last_error", + "created_at": "created_at", + "updated_at": "updated_at" + } + ], + "has_more": true + } + """; + + Server + .Given( + WireMock + .RequestBuilders.Request.Create() + .WithPath("/v1/scheduling/holiday_calendars") + .UsingGet() + ) + .RespondWith( + WireMock + .ResponseBuilders.Response.Create() + .WithStatusCode(200) + .WithBody(mockResponse) + ); + + var response = await Client.Scheduling.HolidayCalendars.ListAsync(); + JsonAssert.AreEqual(response, mockResponse); + } + + [NUnit.Framework.Test] + public async Task MockServerTest_2() + { + const string mockResponse = """ + { + "object": "list", + "data": [ + { + "object": "scheduling.holiday_calendar", + "id": "hcal_01kd2m9a0b1c2d3e4f5g6h7j8m", + "name": "UK team", + "source": "country", + "country": "GB", + "hosts": null, + "host_filter": { + "team": "london" + }, + "regions": [ + "England" + ], + "delegates": [ + "delegates" + ], + "existing_bookings": "leave", + "last_read_at": "2027-01-01T10:00:00.000Z", + "last_error": null, + "created_at": "2027-01-01T10:00:00.000Z", + "updated_at": "2027-01-01T10:00:00.000Z" + } + ], + "has_more": false + } + """; + + Server + .Given( + WireMock + .RequestBuilders.Request.Create() + .WithPath("/v1/scheduling/holiday_calendars") + .UsingGet() + ) + .RespondWith( + WireMock + .ResponseBuilders.Response.Create() + .WithStatusCode(200) + .WithBody(mockResponse) + ); + + var response = await Client.Scheduling.HolidayCalendars.ListAsync(); + JsonAssert.AreEqual(response, mockResponse); + } +} diff --git a/sdks/dotnet/src/Coss.Test/Unit/MockServer/Scheduling/HolidayCalendars/RemoveTest.cs b/sdks/dotnet/src/Coss.Test/Unit/MockServer/Scheduling/HolidayCalendars/RemoveTest.cs new file mode 100644 index 000000000..79fa0c3a3 --- /dev/null +++ b/sdks/dotnet/src/Coss.Test/Unit/MockServer/Scheduling/HolidayCalendars/RemoveTest.cs @@ -0,0 +1,71 @@ +using Coss.Scheduling; +using Coss.Test.Unit.MockServer; +using Coss.Test.Utils; +using NUnit.Framework; + +namespace Coss.Test.Unit.MockServer.Scheduling.HolidayCalendars; + +[TestFixture] +[Parallelizable(ParallelScope.Self)] +public class RemoveTest : BaseMockServerTest +{ + [NUnit.Framework.Test] + public async Task MockServerTest_1() + { + const string mockResponse = """ + { + "id": "id", + "deleted": true + } + """; + + Server + .Given( + WireMock + .RequestBuilders.Request.Create() + .WithPath("/v1/scheduling/holiday_calendars/id") + .UsingDelete() + ) + .RespondWith( + WireMock + .ResponseBuilders.Response.Create() + .WithStatusCode(200) + .WithBody(mockResponse) + ); + + var response = await Client.Scheduling.HolidayCalendars.RemoveAsync( + new RemoveHolidayCalendarsRequest { Id = "id" } + ); + JsonAssert.AreEqual(response, mockResponse); + } + + [NUnit.Framework.Test] + public async Task MockServerTest_2() + { + const string mockResponse = """ + { + "id": "hcal_01kd2m9a0b1c2d3e4f5g6h7j8m", + "deleted": true + } + """; + + Server + .Given( + WireMock + .RequestBuilders.Request.Create() + .WithPath("/v1/scheduling/holiday_calendars/id") + .UsingDelete() + ) + .RespondWith( + WireMock + .ResponseBuilders.Response.Create() + .WithStatusCode(200) + .WithBody(mockResponse) + ); + + var response = await Client.Scheduling.HolidayCalendars.RemoveAsync( + new RemoveHolidayCalendarsRequest { Id = "id" } + ); + JsonAssert.AreEqual(response, mockResponse); + } +} diff --git a/sdks/dotnet/src/Coss.Test/Unit/MockServer/Scheduling/HolidayCalendars/UpdateTest.cs b/sdks/dotnet/src/Coss.Test/Unit/MockServer/Scheduling/HolidayCalendars/UpdateTest.cs new file mode 100644 index 000000000..c58df21ab --- /dev/null +++ b/sdks/dotnet/src/Coss.Test/Unit/MockServer/Scheduling/HolidayCalendars/UpdateTest.cs @@ -0,0 +1,145 @@ +using Coss.Scheduling; +using Coss.Test.Unit.MockServer; +using Coss.Test.Utils; +using NUnit.Framework; +using OneOf; + +namespace Coss.Test.Unit.MockServer.Scheduling.HolidayCalendars; + +[TestFixture] +[Parallelizable(ParallelScope.Self)] +public class UpdateTest : BaseMockServerTest +{ + [NUnit.Framework.Test] + public async Task MockServerTest_1() + { + const string requestJson = """ + {} + """; + + const string mockResponse = """ + { + "object": "scheduling.holiday_calendar", + "id": "id", + "name": "name", + "source": "country", + "country": "country", + "hosts": [ + "hosts", + "hosts" + ], + "host_filter": { + "host_filter": "host_filter" + }, + "regions": [ + "regions", + "regions" + ], + "delegates": [ + "delegates", + "delegates" + ], + "existing_bookings": "leave", + "last_read_at": "last_read_at", + "last_error": "last_error", + "created_at": "created_at", + "updated_at": "updated_at" + } + """; + + Server + .Given( + WireMock + .RequestBuilders.Request.Create() + .WithPath("/v1/scheduling/holiday_calendars/id") + .WithHeader("Content-Type", "application/json") + .UsingPatch() + .WithBodyAsJson(requestJson) + ) + .RespondWith( + WireMock + .ResponseBuilders.Response.Create() + .WithStatusCode(200) + .WithBody(mockResponse) + ); + + var response = await Client.Scheduling.HolidayCalendars.UpdateAsync( + new UpdateSchedulingHolidayCalendarRequest + { + Id = "id", + Name = null, + Hosts = null, + HostFilter = null, + Regions = null, + Delegates = null, + ExistingBookings = null, + } + ); + JsonAssert.AreEqual(response, mockResponse); + } + + [NUnit.Framework.Test] + public async Task MockServerTest_2() + { + const string requestJson = """ + { + "host_filter": { + "team": "london" + } + } + """; + + const string mockResponse = """ + { + "object": "scheduling.holiday_calendar", + "id": "hcal_01kd2m9a0b1c2d3e4f5g6h7j8m", + "name": "UK team", + "source": "country", + "country": "GB", + "hosts": null, + "host_filter": { + "team": "london" + }, + "regions": [ + "England" + ], + "delegates": [ + "delegates" + ], + "existing_bookings": "leave", + "last_read_at": "2027-01-01T10:00:00.000Z", + "last_error": null, + "created_at": "2027-01-01T10:00:00.000Z", + "updated_at": "2027-01-01T10:00:00.000Z" + } + """; + + Server + .Given( + WireMock + .RequestBuilders.Request.Create() + .WithPath("/v1/scheduling/holiday_calendars/id") + .WithHeader("Content-Type", "application/json") + .UsingPatch() + .WithBodyAsJson(requestJson) + ) + .RespondWith( + WireMock + .ResponseBuilders.Response.Create() + .WithStatusCode(200) + .WithBody(mockResponse) + ); + + var response = await Client.Scheduling.HolidayCalendars.UpdateAsync( + new UpdateSchedulingHolidayCalendarRequest + { + Id = "id", + HostFilter = new Dictionary>>() + { + { "team", "london" }, + }, + } + ); + JsonAssert.AreEqual(response, mockResponse); + } +} diff --git a/sdks/dotnet/src/Coss.Test/Unit/MockServer/Scheduling/OauthApps/CreateTest.cs b/sdks/dotnet/src/Coss.Test/Unit/MockServer/Scheduling/OauthApps/CreateTest.cs new file mode 100644 index 000000000..eb297c145 --- /dev/null +++ b/sdks/dotnet/src/Coss.Test/Unit/MockServer/Scheduling/OauthApps/CreateTest.cs @@ -0,0 +1,145 @@ +using Coss; +using Coss.Test.Unit.MockServer; +using Coss.Test.Utils; +using NUnit.Framework; + +namespace Coss.Test.Unit.MockServer.Scheduling.OauthApps; + +[TestFixture] +[Parallelizable(ParallelScope.Self)] +public class CreateTest : BaseMockServerTest +{ + [NUnit.Framework.Test] + public async Task MockServerTest_1() + { + const string requestJson = """ + { + "provider": "google", + "client_id": "x", + "client_secret": "x" + } + """; + + const string mockResponse = """ + { + "object": "scheduling.oauth_app", + "id": "id", + "provider": "google", + "client_id": "client_id", + "tenant_id": "tenant_id", + "redirect_uri": "redirect_uri", + "coss_callback_url": "coss_callback_url", + "completion_url": "completion_url", + "zoom_event_url": "zoom_event_url", + "scopes": [ + "scopes", + "scopes" + ], + "status": "active", + "last_error_code": "last_error_code", + "last_error_at": "last_error_at", + "secret_expires_at": "secret_expires_at", + "verified_at": "verified_at", + "connections": 1000000, + "created_at": "created_at", + "updated_at": "updated_at" + } + """; + + Server + .Given( + WireMock + .RequestBuilders.Request.Create() + .WithPath("/v1/scheduling/oauth_apps") + .UsingPost() + .WithBodyAsJson(requestJson) + ) + .RespondWith( + WireMock + .ResponseBuilders.Response.Create() + .WithStatusCode(200) + .WithBody(mockResponse) + ); + + var response = await Client.Scheduling.OauthApps.CreateAsync( + new CreateOauthAppRequest( + new CreateOauthAppRequest.Google( + new CreateOauthAppRequestGoogle + { + ClientId = "x", + ClientSecret = "x", + RedirectUri = null, + CompletionUrl = null, + SecretExpiresAt = null, + } + ) + ) + ); + JsonAssert.AreEqual(response, mockResponse); + } + + [NUnit.Framework.Test] + public async Task MockServerTest_2() + { + const string requestJson = """ + { + "provider": "google", + "client_id": "client_id", + "client_secret": "client_secret" + } + """; + + const string mockResponse = """ + { + "object": "scheduling.oauth_app", + "id": "calapp_01kd2m9a0b1c2d3e4f5g6h7j8m", + "provider": "google", + "client_id": "1234567890-abc.apps.googleusercontent.com", + "tenant_id": null, + "redirect_uri": "https://example.com/oauth/google", + "coss_callback_url": "https://api.coss.com/scheduling/oauth/google/callback", + "completion_url": "https://example.com/calendar-connected", + "zoom_event_url": null, + "scopes": [ + "https://www.googleapis.com/auth/calendar.events.freebusy" + ], + "status": "active", + "last_error_code": null, + "last_error_at": null, + "secret_expires_at": null, + "verified_at": "2027-01-01T10:00:00.000Z", + "connections": 12, + "created_at": "2027-01-01T10:00:00.000Z", + "updated_at": "2027-01-01T10:00:00.000Z" + } + """; + + Server + .Given( + WireMock + .RequestBuilders.Request.Create() + .WithPath("/v1/scheduling/oauth_apps") + .UsingPost() + .WithBodyAsJson(requestJson) + ) + .RespondWith( + WireMock + .ResponseBuilders.Response.Create() + .WithStatusCode(200) + .WithBody(mockResponse) + ); + + var response = await Client.Scheduling.OauthApps.CreateAsync( + new CreateOauthAppRequest( + new CreateOauthAppRequest.Google( + new CreateOauthAppRequestGoogle + { + ClientId = "client_id", + ClientSecret = "client_secret", + } + ) + ) + ); + JsonAssert.AreEqual(response, mockResponse); + } +} diff --git a/sdks/dotnet/src/Coss.Test/Unit/MockServer/Scheduling/OauthApps/DeleteTest.cs b/sdks/dotnet/src/Coss.Test/Unit/MockServer/Scheduling/OauthApps/DeleteTest.cs new file mode 100644 index 000000000..1a11802f2 --- /dev/null +++ b/sdks/dotnet/src/Coss.Test/Unit/MockServer/Scheduling/OauthApps/DeleteTest.cs @@ -0,0 +1,73 @@ +using Coss.Scheduling; +using Coss.Test.Unit.MockServer; +using Coss.Test.Utils; +using NUnit.Framework; + +namespace Coss.Test.Unit.MockServer.Scheduling.OauthApps; + +[TestFixture] +[Parallelizable(ParallelScope.Self)] +public class DeleteTest : BaseMockServerTest +{ + [NUnit.Framework.Test] + public async Task MockServerTest_1() + { + const string mockResponse = """ + { + "object": "scheduling.oauth_app", + "id": "id", + "deleted": true + } + """; + + Server + .Given( + WireMock + .RequestBuilders.Request.Create() + .WithPath("/v1/scheduling/oauth_apps/id") + .UsingDelete() + ) + .RespondWith( + WireMock + .ResponseBuilders.Response.Create() + .WithStatusCode(200) + .WithBody(mockResponse) + ); + + var response = await Client.Scheduling.OauthApps.DeleteAsync( + new DeleteOauthAppsRequest { Id = "id" } + ); + JsonAssert.AreEqual(response, mockResponse); + } + + [NUnit.Framework.Test] + public async Task MockServerTest_2() + { + const string mockResponse = """ + { + "object": "scheduling.oauth_app", + "id": "calapp_01kd2m9a0b1c2d3e4f5g6h7j8m", + "deleted": true + } + """; + + Server + .Given( + WireMock + .RequestBuilders.Request.Create() + .WithPath("/v1/scheduling/oauth_apps/calapp_01kd2m9a0b1c2d3e4f5g6h7j8m") + .UsingDelete() + ) + .RespondWith( + WireMock + .ResponseBuilders.Response.Create() + .WithStatusCode(200) + .WithBody(mockResponse) + ); + + var response = await Client.Scheduling.OauthApps.DeleteAsync( + new DeleteOauthAppsRequest { Id = "calapp_01kd2m9a0b1c2d3e4f5g6h7j8m" } + ); + JsonAssert.AreEqual(response, mockResponse); + } +} diff --git a/sdks/dotnet/src/Coss.Test/Unit/MockServer/Scheduling/OauthApps/GetTest.cs b/sdks/dotnet/src/Coss.Test/Unit/MockServer/Scheduling/OauthApps/GetTest.cs new file mode 100644 index 000000000..a73abf089 --- /dev/null +++ b/sdks/dotnet/src/Coss.Test/Unit/MockServer/Scheduling/OauthApps/GetTest.cs @@ -0,0 +1,108 @@ +using Coss.Scheduling; +using Coss.Test.Unit.MockServer; +using Coss.Test.Utils; +using NUnit.Framework; + +namespace Coss.Test.Unit.MockServer.Scheduling.OauthApps; + +[TestFixture] +[Parallelizable(ParallelScope.Self)] +public class GetTest : BaseMockServerTest +{ + [NUnit.Framework.Test] + public async Task MockServerTest_1() + { + const string mockResponse = """ + { + "object": "scheduling.oauth_app", + "id": "id", + "provider": "google", + "client_id": "client_id", + "tenant_id": "tenant_id", + "redirect_uri": "redirect_uri", + "coss_callback_url": "coss_callback_url", + "completion_url": "completion_url", + "zoom_event_url": "zoom_event_url", + "scopes": [ + "scopes", + "scopes" + ], + "status": "active", + "last_error_code": "last_error_code", + "last_error_at": "last_error_at", + "secret_expires_at": "secret_expires_at", + "verified_at": "verified_at", + "connections": 1000000, + "created_at": "created_at", + "updated_at": "updated_at" + } + """; + + Server + .Given( + WireMock + .RequestBuilders.Request.Create() + .WithPath("/v1/scheduling/oauth_apps/id") + .UsingGet() + ) + .RespondWith( + WireMock + .ResponseBuilders.Response.Create() + .WithStatusCode(200) + .WithBody(mockResponse) + ); + + var response = await Client.Scheduling.OauthApps.GetAsync( + new GetOauthAppsRequest { Id = "id" } + ); + JsonAssert.AreEqual(response, mockResponse); + } + + [NUnit.Framework.Test] + public async Task MockServerTest_2() + { + const string mockResponse = """ + { + "object": "scheduling.oauth_app", + "id": "calapp_01kd2m9a0b1c2d3e4f5g6h7j8m", + "provider": "google", + "client_id": "1234567890-abc.apps.googleusercontent.com", + "tenant_id": null, + "redirect_uri": "https://example.com/oauth/google", + "coss_callback_url": "https://api.coss.com/scheduling/oauth/google/callback", + "completion_url": "https://example.com/calendar-connected", + "zoom_event_url": null, + "scopes": [ + "https://www.googleapis.com/auth/calendar.events.freebusy" + ], + "status": "active", + "last_error_code": null, + "last_error_at": null, + "secret_expires_at": null, + "verified_at": "2027-01-01T10:00:00.000Z", + "connections": 12, + "created_at": "2027-01-01T10:00:00.000Z", + "updated_at": "2027-01-01T10:00:00.000Z" + } + """; + + Server + .Given( + WireMock + .RequestBuilders.Request.Create() + .WithPath("/v1/scheduling/oauth_apps/calapp_01kd2m9a0b1c2d3e4f5g6h7j8m") + .UsingGet() + ) + .RespondWith( + WireMock + .ResponseBuilders.Response.Create() + .WithStatusCode(200) + .WithBody(mockResponse) + ); + + var response = await Client.Scheduling.OauthApps.GetAsync( + new GetOauthAppsRequest { Id = "calapp_01kd2m9a0b1c2d3e4f5g6h7j8m" } + ); + JsonAssert.AreEqual(response, mockResponse); + } +} diff --git a/sdks/dotnet/src/Coss.Test/Unit/MockServer/Scheduling/OauthApps/ListTest.cs b/sdks/dotnet/src/Coss.Test/Unit/MockServer/Scheduling/OauthApps/ListTest.cs new file mode 100644 index 000000000..e082b19f6 --- /dev/null +++ b/sdks/dotnet/src/Coss.Test/Unit/MockServer/Scheduling/OauthApps/ListTest.cs @@ -0,0 +1,138 @@ +using Coss.Test.Unit.MockServer; +using Coss.Test.Utils; +using NUnit.Framework; + +namespace Coss.Test.Unit.MockServer.Scheduling.OauthApps; + +[TestFixture] +[Parallelizable(ParallelScope.Self)] +public class ListTest : BaseMockServerTest +{ + [NUnit.Framework.Test] + public async Task MockServerTest_1() + { + const string mockResponse = """ + { + "object": "list", + "data": [ + { + "object": "scheduling.oauth_app", + "id": "id", + "provider": "google", + "client_id": "client_id", + "tenant_id": "tenant_id", + "redirect_uri": "redirect_uri", + "coss_callback_url": "coss_callback_url", + "completion_url": "completion_url", + "zoom_event_url": "zoom_event_url", + "scopes": [ + "scopes", + "scopes" + ], + "status": "active", + "last_error_code": "last_error_code", + "last_error_at": "last_error_at", + "secret_expires_at": "secret_expires_at", + "verified_at": "verified_at", + "connections": 1000000, + "created_at": "created_at", + "updated_at": "updated_at" + }, + { + "object": "scheduling.oauth_app", + "id": "id", + "provider": "google", + "client_id": "client_id", + "tenant_id": "tenant_id", + "redirect_uri": "redirect_uri", + "coss_callback_url": "coss_callback_url", + "completion_url": "completion_url", + "zoom_event_url": "zoom_event_url", + "scopes": [ + "scopes", + "scopes" + ], + "status": "active", + "last_error_code": "last_error_code", + "last_error_at": "last_error_at", + "secret_expires_at": "secret_expires_at", + "verified_at": "verified_at", + "connections": 1000000, + "created_at": "created_at", + "updated_at": "updated_at" + } + ], + "has_more": true + } + """; + + Server + .Given( + WireMock + .RequestBuilders.Request.Create() + .WithPath("/v1/scheduling/oauth_apps") + .UsingGet() + ) + .RespondWith( + WireMock + .ResponseBuilders.Response.Create() + .WithStatusCode(200) + .WithBody(mockResponse) + ); + + var response = await Client.Scheduling.OauthApps.ListAsync(); + JsonAssert.AreEqual(response, mockResponse); + } + + [NUnit.Framework.Test] + public async Task MockServerTest_2() + { + const string mockResponse = """ + { + "object": "list", + "data": [ + { + "object": "scheduling.oauth_app", + "id": "calapp_01kd2m9a0b1c2d3e4f5g6h7j8m", + "provider": "google", + "client_id": "1234567890-abc.apps.googleusercontent.com", + "tenant_id": null, + "redirect_uri": "https://example.com/oauth/google", + "coss_callback_url": "https://api.coss.com/scheduling/oauth/google/callback", + "completion_url": "https://example.com/calendar-connected", + "zoom_event_url": null, + "scopes": [ + "https://www.googleapis.com/auth/calendar.events.freebusy" + ], + "status": "active", + "last_error_code": null, + "last_error_at": null, + "secret_expires_at": null, + "verified_at": "2027-01-01T10:00:00.000Z", + "connections": 12, + "created_at": "2027-01-01T10:00:00.000Z", + "updated_at": "2027-01-01T10:00:00.000Z" + } + ], + "has_more": false + } + """; + + Server + .Given( + WireMock + .RequestBuilders.Request.Create() + .WithPath("/v1/scheduling/oauth_apps") + .UsingGet() + ) + .RespondWith( + WireMock + .ResponseBuilders.Response.Create() + .WithStatusCode(200) + .WithBody(mockResponse) + ); + + var response = await Client.Scheduling.OauthApps.ListAsync(); + JsonAssert.AreEqual(response, mockResponse); + } +} diff --git a/sdks/dotnet/src/Coss.Test/Unit/MockServer/Scheduling/OauthApps/UpdateTest.cs b/sdks/dotnet/src/Coss.Test/Unit/MockServer/Scheduling/OauthApps/UpdateTest.cs new file mode 100644 index 000000000..2051366d4 --- /dev/null +++ b/sdks/dotnet/src/Coss.Test/Unit/MockServer/Scheduling/OauthApps/UpdateTest.cs @@ -0,0 +1,141 @@ +using Coss.Scheduling; +using Coss.Test.Unit.MockServer; +using Coss.Test.Utils; +using NUnit.Framework; + +namespace Coss.Test.Unit.MockServer.Scheduling.OauthApps; + +[TestFixture] +[Parallelizable(ParallelScope.Self)] +public class UpdateTest : BaseMockServerTest +{ + [NUnit.Framework.Test] + public async Task MockServerTest_1() + { + const string requestJson = """ + { + "tenant_id": null, + "webhook_secret": null, + "redirect_uri": null, + "completion_url": null, + "secret_expires_at": null + } + """; + + const string mockResponse = """ + { + "object": "scheduling.oauth_app", + "id": "id", + "provider": "google", + "client_id": "client_id", + "tenant_id": "tenant_id", + "redirect_uri": "redirect_uri", + "coss_callback_url": "coss_callback_url", + "completion_url": "completion_url", + "zoom_event_url": "zoom_event_url", + "scopes": [ + "scopes", + "scopes" + ], + "status": "active", + "last_error_code": "last_error_code", + "last_error_at": "last_error_at", + "secret_expires_at": "secret_expires_at", + "verified_at": "verified_at", + "connections": 1000000, + "created_at": "created_at", + "updated_at": "updated_at" + } + """; + + Server + .Given( + WireMock + .RequestBuilders.Request.Create() + .WithPath("/v1/scheduling/oauth_apps/id") + .WithHeader("Content-Type", "application/json") + .UsingPatch() + .WithBodyAsJson(requestJson) + ) + .RespondWith( + WireMock + .ResponseBuilders.Response.Create() + .WithStatusCode(200) + .WithBody(mockResponse) + ); + + var response = await Client.Scheduling.OauthApps.UpdateAsync( + new UpdateOauthAppRequest + { + Id = "id", + ClientSecret = null, + TenantId = null, + WebhookSecret = null, + RedirectUri = null, + CompletionUrl = null, + SecretExpiresAt = null, + } + ); + JsonAssert.AreEqual(response, mockResponse); + } + + [NUnit.Framework.Test] + public async Task MockServerTest_2() + { + const string requestJson = """ + { + "client_secret": "GOCSPX-abcdefghijklmnopqrstuvwxyz" + } + """; + + const string mockResponse = """ + { + "object": "scheduling.oauth_app", + "id": "calapp_01kd2m9a0b1c2d3e4f5g6h7j8m", + "provider": "google", + "client_id": "1234567890-abc.apps.googleusercontent.com", + "tenant_id": null, + "redirect_uri": "https://example.com/oauth/google", + "coss_callback_url": "https://api.coss.com/scheduling/oauth/google/callback", + "completion_url": "https://example.com/calendar-connected", + "zoom_event_url": null, + "scopes": [ + "https://www.googleapis.com/auth/calendar.events.freebusy" + ], + "status": "active", + "last_error_code": null, + "last_error_at": null, + "secret_expires_at": null, + "verified_at": "2027-01-01T10:00:00.000Z", + "connections": 12, + "created_at": "2027-01-01T10:00:00.000Z", + "updated_at": "2027-01-01T10:00:00.000Z" + } + """; + + Server + .Given( + WireMock + .RequestBuilders.Request.Create() + .WithPath("/v1/scheduling/oauth_apps/calapp_01kd2m9a0b1c2d3e4f5g6h7j8m") + .WithHeader("Content-Type", "application/json") + .UsingPatch() + .WithBodyAsJson(requestJson) + ) + .RespondWith( + WireMock + .ResponseBuilders.Response.Create() + .WithStatusCode(200) + .WithBody(mockResponse) + ); + + var response = await Client.Scheduling.OauthApps.UpdateAsync( + new UpdateOauthAppRequest + { + Id = "calapp_01kd2m9a0b1c2d3e4f5g6h7j8m", + ClientSecret = "GOCSPX-abcdefghijklmnopqrstuvwxyz", + } + ); + JsonAssert.AreEqual(response, mockResponse); + } +} diff --git a/sdks/dotnet/src/Coss.Test/Unit/MockServer/Scheduling/OutOfOffice/ConflictsTest.cs b/sdks/dotnet/src/Coss.Test/Unit/MockServer/Scheduling/OutOfOffice/ConflictsTest.cs new file mode 100644 index 000000000..7b8023d22 --- /dev/null +++ b/sdks/dotnet/src/Coss.Test/Unit/MockServer/Scheduling/OutOfOffice/ConflictsTest.cs @@ -0,0 +1,110 @@ +using Coss.Scheduling; +using Coss.Test.Unit.MockServer; +using Coss.Test.Utils; +using NUnit.Framework; + +namespace Coss.Test.Unit.MockServer.Scheduling.OutOfOffice; + +[TestFixture] +[Parallelizable(ParallelScope.Self)] +public class ConflictsTest : BaseMockServerTest +{ + [NUnit.Framework.Test] + public async Task MockServerTest_1() + { + const string mockResponse = """ + { + "object": "list", + "data": [ + { + "object": "scheduling.out_of_office_conflict", + "booking": "booking", + "event_type": "event_type", + "title": "title", + "status": "held", + "start": "start", + "end": "end", + "series": "series", + "group_session": "group_session" + }, + { + "object": "scheduling.out_of_office_conflict", + "booking": "booking", + "event_type": "event_type", + "title": "title", + "status": "held", + "start": "start", + "end": "end", + "series": "series", + "group_session": "group_session" + } + ], + "has_more": true + } + """; + + Server + .Given( + WireMock + .RequestBuilders.Request.Create() + .WithPath("/v1/scheduling/out_of_office/id/conflicts") + .UsingGet() + ) + .RespondWith( + WireMock + .ResponseBuilders.Response.Create() + .WithStatusCode(200) + .WithBody(mockResponse) + ); + + var response = await Client.Scheduling.OutOfOffice.ConflictsAsync( + new ConflictsOutOfOfficeRequest { Id = "id" } + ); + JsonAssert.AreEqual(response, mockResponse); + } + + [NUnit.Framework.Test] + public async Task MockServerTest_2() + { + const string mockResponse = """ + { + "object": "list", + "data": [ + { + "object": "scheduling.out_of_office_conflict", + "booking": "book_01kd2m9a0b1c2d3e4f5g6h7j8m", + "event_type": "evtype_01kd2m9a0b1c2d3e4f5g6h7j8m", + "title": "Consultation", + "status": "confirmed", + "start": "2027-08-03T15:00:00.000Z", + "end": "2027-08-03T15:30:00.000Z", + "series": null, + "group_session": null + } + ], + "has_more": false + } + """; + + Server + .Given( + WireMock + .RequestBuilders.Request.Create() + .WithPath( + "/v1/scheduling/out_of_office/ooo_01kd2m9a0b1c2d3e4f5g6h7j8m/conflicts" + ) + .UsingGet() + ) + .RespondWith( + WireMock + .ResponseBuilders.Response.Create() + .WithStatusCode(200) + .WithBody(mockResponse) + ); + + var response = await Client.Scheduling.OutOfOffice.ConflictsAsync( + new ConflictsOutOfOfficeRequest { Id = "ooo_01kd2m9a0b1c2d3e4f5g6h7j8m" } + ); + JsonAssert.AreEqual(response, mockResponse); + } +} diff --git a/sdks/dotnet/src/Coss.Test/Unit/MockServer/Scheduling/OutOfOffice/CreateTest.cs b/sdks/dotnet/src/Coss.Test/Unit/MockServer/Scheduling/OutOfOffice/CreateTest.cs new file mode 100644 index 000000000..4376fcb1f --- /dev/null +++ b/sdks/dotnet/src/Coss.Test/Unit/MockServer/Scheduling/OutOfOffice/CreateTest.cs @@ -0,0 +1,195 @@ +using Coss.Scheduling; +using Coss.Test.Unit.MockServer; +using Coss.Test.Utils; +using NUnit.Framework; + +namespace Coss.Test.Unit.MockServer.Scheduling.OutOfOffice; + +[TestFixture] +[Parallelizable(ParallelScope.Self)] +public class CreateTest : BaseMockServerTest +{ + [NUnit.Framework.Test] + public async Task MockServerTest_1() + { + const string requestJson = """ + {} + """; + + const string mockResponse = """ + { + "object": "list", + "data": [ + { + "object": "scheduling.out_of_office", + "id": "id", + "host": "host", + "start": "start", + "end": "end", + "all_day": { + "start_date": "start_date", + "end_date": "end_date", + "time_zone": "time_zone" + }, + "reason": "reason", + "notes": "notes", + "public_message": "public_message", + "show_on_calendar": true, + "delegates": [ + "delegates", + "delegates" + ], + "existing_bookings": "leave", + "external_id": "external_id", + "group": "group", + "source": "api", + "created_at": "created_at", + "updated_at": "updated_at" + }, + { + "object": "scheduling.out_of_office", + "id": "id", + "host": "host", + "start": "start", + "end": "end", + "all_day": { + "start_date": "start_date", + "end_date": "end_date", + "time_zone": "time_zone" + }, + "reason": "reason", + "notes": "notes", + "public_message": "public_message", + "show_on_calendar": true, + "delegates": [ + "delegates", + "delegates" + ], + "existing_bookings": "leave", + "external_id": "external_id", + "group": "group", + "source": "api", + "created_at": "created_at", + "updated_at": "updated_at" + } + ], + "has_more": true + } + """; + + Server + .Given( + WireMock + .RequestBuilders.Request.Create() + .WithPath("/v1/scheduling/out_of_office") + .WithHeader("Content-Type", "application/json") + .UsingPost() + .WithBodyAsJson(requestJson) + ) + .RespondWith( + WireMock + .ResponseBuilders.Response.Create() + .WithStatusCode(200) + .WithBody(mockResponse) + ); + + var response = await Client.Scheduling.OutOfOffice.CreateAsync( + new CreateSchedulingOutOfOfficeRequest + { + Host = null, + Hosts = null, + HostFilter = null, + Start = null, + End = null, + StartDate = null, + EndDate = null, + TimeZone = null, + Delegates = null, + Reason = null, + Notes = null, + PublicMessage = null, + ShowOnCalendar = null, + ExistingBookings = null, + Reassign = null, + ExternalId = null, + } + ); + JsonAssert.AreEqual(response, mockResponse); + } + + [NUnit.Framework.Test] + public async Task MockServerTest_2() + { + const string requestJson = """ + { + "host": "doctor_482", + "start_date": "2027-08-02", + "end_date": "2027-08-13", + "reason": "vacation", + "public_message": "Back on the 16th." + } + """; + + const string mockResponse = """ + { + "object": "list", + "data": [ + { + "object": "scheduling.out_of_office", + "id": "ooo_01kd2m9a0b1c2d3e4f5g6h7j8m", + "host": "host_01kd2m9a0b1c2d3e4f5g6h7j8m", + "start": "2027-08-02T04:00:00.000Z", + "end": "2027-08-14T04:00:00.000Z", + "all_day": { + "start_date": "2027-08-02", + "end_date": "2027-08-13", + "time_zone": "America/New_York" + }, + "reason": "vacation", + "notes": null, + "public_message": "Back on the 16th.", + "show_on_calendar": true, + "delegates": [ + "host_01kd2m9a0b1c2d3e4f5g6h7j8n" + ], + "existing_bookings": "leave", + "external_id": null, + "group": null, + "source": "api", + "created_at": "2027-01-01T10:00:00.000Z", + "updated_at": "2027-01-01T10:00:00.000Z" + } + ], + "has_more": false + } + """; + + Server + .Given( + WireMock + .RequestBuilders.Request.Create() + .WithPath("/v1/scheduling/out_of_office") + .WithHeader("Content-Type", "application/json") + .UsingPost() + .WithBodyAsJson(requestJson) + ) + .RespondWith( + WireMock + .ResponseBuilders.Response.Create() + .WithStatusCode(200) + .WithBody(mockResponse) + ); + + var response = await Client.Scheduling.OutOfOffice.CreateAsync( + new CreateSchedulingOutOfOfficeRequest + { + Host = "doctor_482", + StartDate = "2027-08-02", + EndDate = "2027-08-13", + Reason = "vacation", + PublicMessage = "Back on the 16th.", + } + ); + JsonAssert.AreEqual(response, mockResponse); + } +} diff --git a/sdks/dotnet/src/Coss.Test/Unit/MockServer/Scheduling/OutOfOffice/GetTest.cs b/sdks/dotnet/src/Coss.Test/Unit/MockServer/Scheduling/OutOfOffice/GetTest.cs new file mode 100644 index 000000000..2707e5fea --- /dev/null +++ b/sdks/dotnet/src/Coss.Test/Unit/MockServer/Scheduling/OutOfOffice/GetTest.cs @@ -0,0 +1,114 @@ +using Coss.Scheduling; +using Coss.Test.Unit.MockServer; +using Coss.Test.Utils; +using NUnit.Framework; + +namespace Coss.Test.Unit.MockServer.Scheduling.OutOfOffice; + +[TestFixture] +[Parallelizable(ParallelScope.Self)] +public class GetTest : BaseMockServerTest +{ + [NUnit.Framework.Test] + public async Task MockServerTest_1() + { + const string mockResponse = """ + { + "object": "scheduling.out_of_office", + "id": "id", + "host": "host", + "start": "start", + "end": "end", + "all_day": { + "start_date": "start_date", + "end_date": "end_date", + "time_zone": "time_zone" + }, + "reason": "reason", + "notes": "notes", + "public_message": "public_message", + "show_on_calendar": true, + "delegates": [ + "delegates", + "delegates" + ], + "existing_bookings": "leave", + "external_id": "external_id", + "group": "group", + "source": "api", + "created_at": "created_at", + "updated_at": "updated_at" + } + """; + + Server + .Given( + WireMock + .RequestBuilders.Request.Create() + .WithPath("/v1/scheduling/out_of_office/id") + .UsingGet() + ) + .RespondWith( + WireMock + .ResponseBuilders.Response.Create() + .WithStatusCode(200) + .WithBody(mockResponse) + ); + + var response = await Client.Scheduling.OutOfOffice.GetAsync( + new GetOutOfOfficeRequest { Id = "id" } + ); + JsonAssert.AreEqual(response, mockResponse); + } + + [NUnit.Framework.Test] + public async Task MockServerTest_2() + { + const string mockResponse = """ + { + "object": "scheduling.out_of_office", + "id": "ooo_01kd2m9a0b1c2d3e4f5g6h7j8m", + "host": "host_01kd2m9a0b1c2d3e4f5g6h7j8m", + "start": "2027-08-02T04:00:00.000Z", + "end": "2027-08-14T04:00:00.000Z", + "all_day": { + "start_date": "2027-08-02", + "end_date": "2027-08-13", + "time_zone": "America/New_York" + }, + "reason": "vacation", + "notes": null, + "public_message": "Back on the 16th.", + "show_on_calendar": true, + "delegates": [ + "host_01kd2m9a0b1c2d3e4f5g6h7j8n" + ], + "existing_bookings": "leave", + "external_id": null, + "group": null, + "source": "api", + "created_at": "2027-01-01T10:00:00.000Z", + "updated_at": "2027-01-01T10:00:00.000Z" + } + """; + + Server + .Given( + WireMock + .RequestBuilders.Request.Create() + .WithPath("/v1/scheduling/out_of_office/ooo_01kd2m9a0b1c2d3e4f5g6h7j8m") + .UsingGet() + ) + .RespondWith( + WireMock + .ResponseBuilders.Response.Create() + .WithStatusCode(200) + .WithBody(mockResponse) + ); + + var response = await Client.Scheduling.OutOfOffice.GetAsync( + new GetOutOfOfficeRequest { Id = "ooo_01kd2m9a0b1c2d3e4f5g6h7j8m" } + ); + JsonAssert.AreEqual(response, mockResponse); + } +} diff --git a/sdks/dotnet/src/Coss.Test/Unit/MockServer/Scheduling/OutOfOffice/ListTest.cs b/sdks/dotnet/src/Coss.Test/Unit/MockServer/Scheduling/OutOfOffice/ListTest.cs new file mode 100644 index 000000000..807aac5d6 --- /dev/null +++ b/sdks/dotnet/src/Coss.Test/Unit/MockServer/Scheduling/OutOfOffice/ListTest.cs @@ -0,0 +1,156 @@ +using Coss.Scheduling; +using Coss.Test.Unit.MockServer; +using Coss.Test.Utils; +using NUnit.Framework; + +namespace Coss.Test.Unit.MockServer.Scheduling.OutOfOffice; + +[TestFixture] +[Parallelizable(ParallelScope.Self)] +public class ListTest : BaseMockServerTest +{ + [NUnit.Framework.Test] + public async Task MockServerTest_1() + { + const string mockResponse = """ + { + "object": "list", + "data": [ + { + "object": "scheduling.out_of_office", + "id": "id", + "host": "host", + "start": "start", + "end": "end", + "all_day": { + "start_date": "start_date", + "end_date": "end_date", + "time_zone": "time_zone" + }, + "reason": "reason", + "notes": "notes", + "public_message": "public_message", + "show_on_calendar": true, + "delegates": [ + "delegates", + "delegates" + ], + "existing_bookings": "leave", + "external_id": "external_id", + "group": "group", + "source": "api", + "created_at": "created_at", + "updated_at": "updated_at" + }, + { + "object": "scheduling.out_of_office", + "id": "id", + "host": "host", + "start": "start", + "end": "end", + "all_day": { + "start_date": "start_date", + "end_date": "end_date", + "time_zone": "time_zone" + }, + "reason": "reason", + "notes": "notes", + "public_message": "public_message", + "show_on_calendar": true, + "delegates": [ + "delegates", + "delegates" + ], + "existing_bookings": "leave", + "external_id": "external_id", + "group": "group", + "source": "api", + "created_at": "created_at", + "updated_at": "updated_at" + } + ], + "has_more": true + } + """; + + Server + .Given( + WireMock + .RequestBuilders.Request.Create() + .WithPath("/v1/scheduling/out_of_office") + .UsingGet() + ) + .RespondWith( + WireMock + .ResponseBuilders.Response.Create() + .WithStatusCode(200) + .WithBody(mockResponse) + ); + + var response = await Client.Scheduling.OutOfOffice.ListAsync(new ListOutOfOfficeRequest()); + JsonAssert.AreEqual(response, mockResponse); + } + + [NUnit.Framework.Test] + public async Task MockServerTest_2() + { + const string mockResponse = """ + { + "object": "list", + "data": [ + { + "object": "scheduling.out_of_office", + "id": "ooo_01kd2m9a0b1c2d3e4f5g6h7j8m", + "host": "host_01kd2m9a0b1c2d3e4f5g6h7j8m", + "start": "2027-08-02T04:00:00.000Z", + "end": "2027-08-14T04:00:00.000Z", + "all_day": { + "start_date": "2027-08-02", + "end_date": "2027-08-13", + "time_zone": "America/New_York" + }, + "reason": "vacation", + "notes": null, + "public_message": "Back on the 16th.", + "show_on_calendar": true, + "delegates": [ + "host_01kd2m9a0b1c2d3e4f5g6h7j8n" + ], + "existing_bookings": "leave", + "external_id": null, + "group": null, + "source": "api", + "created_at": "2027-01-01T10:00:00.000Z", + "updated_at": "2027-01-01T10:00:00.000Z" + } + ], + "has_more": false + } + """; + + Server + .Given( + WireMock + .RequestBuilders.Request.Create() + .WithPath("/v1/scheduling/out_of_office") + .WithParam("start_after", "2027-01-04T15:00:00.000Z") + .WithParam("start_before", "2027-01-04T15:00:00.000Z") + .UsingGet() + ) + .RespondWith( + WireMock + .ResponseBuilders.Response.Create() + .WithStatusCode(200) + .WithBody(mockResponse) + ); + + var response = await Client.Scheduling.OutOfOffice.ListAsync( + new ListOutOfOfficeRequest + { + StartAfter = "2027-01-04T15:00:00.000Z", + StartBefore = "2027-01-04T15:00:00.000Z", + } + ); + JsonAssert.AreEqual(response, mockResponse); + } +} diff --git a/sdks/dotnet/src/Coss.Test/Unit/MockServer/Scheduling/OutOfOffice/PutTest.cs b/sdks/dotnet/src/Coss.Test/Unit/MockServer/Scheduling/OutOfOffice/PutTest.cs new file mode 100644 index 000000000..728321efb --- /dev/null +++ b/sdks/dotnet/src/Coss.Test/Unit/MockServer/Scheduling/OutOfOffice/PutTest.cs @@ -0,0 +1,156 @@ +using Coss.Scheduling; +using Coss.Test.Unit.MockServer; +using Coss.Test.Utils; +using NUnit.Framework; + +namespace Coss.Test.Unit.MockServer.Scheduling.OutOfOffice; + +[TestFixture] +[Parallelizable(ParallelScope.Self)] +public class PutTest : BaseMockServerTest +{ + [NUnit.Framework.Test] + public async Task MockServerTest_1() + { + const string requestJson = """ + { + "host": "host" + } + """; + + const string mockResponse = """ + { + "object": "scheduling.out_of_office", + "id": "id", + "host": "host", + "start": "start", + "end": "end", + "all_day": { + "start_date": "start_date", + "end_date": "end_date", + "time_zone": "time_zone" + }, + "reason": "reason", + "notes": "notes", + "public_message": "public_message", + "show_on_calendar": true, + "delegates": [ + "delegates", + "delegates" + ], + "existing_bookings": "leave", + "external_id": "external_id", + "group": "group", + "source": "api", + "created_at": "created_at", + "updated_at": "updated_at" + } + """; + + Server + .Given( + WireMock + .RequestBuilders.Request.Create() + .WithPath("/v1/scheduling/out_of_office/by_external_id/external_id") + .WithHeader("Content-Type", "application/json") + .UsingPut() + .WithBodyAsJson(requestJson) + ) + .RespondWith( + WireMock + .ResponseBuilders.Response.Create() + .WithStatusCode(200) + .WithBody(mockResponse) + ); + + var response = await Client.Scheduling.OutOfOffice.PutAsync( + new PutSchedulingOutOfOfficeRequest + { + ExternalId = "external_id", + Host = "host", + Start = null, + End = null, + StartDate = null, + EndDate = null, + TimeZone = null, + Delegates = null, + Reason = null, + Notes = null, + PublicMessage = null, + ShowOnCalendar = null, + ExistingBookings = null, + Reassign = null, + } + ); + JsonAssert.AreEqual(response, mockResponse); + } + + [NUnit.Framework.Test] + public async Task MockServerTest_2() + { + const string requestJson = """ + { + "host": "doctor_482", + "start_date": "2027-08-02", + "end_date": "2027-08-13", + "reason": "vacation" + } + """; + + const string mockResponse = """ + { + "object": "scheduling.out_of_office", + "id": "ooo_01kd2m9a0b1c2d3e4f5g6h7j8m", + "host": "host_01kd2m9a0b1c2d3e4f5g6h7j8m", + "start": "2027-08-02T04:00:00.000Z", + "end": "2027-08-14T04:00:00.000Z", + "all_day": { + "start_date": "2027-08-02", + "end_date": "2027-08-13", + "time_zone": "America/New_York" + }, + "reason": "vacation", + "notes": null, + "public_message": "Back on the 16th.", + "show_on_calendar": true, + "delegates": [ + "host_01kd2m9a0b1c2d3e4f5g6h7j8n" + ], + "existing_bookings": "leave", + "external_id": null, + "group": null, + "source": "api", + "created_at": "2027-01-01T10:00:00.000Z", + "updated_at": "2027-01-01T10:00:00.000Z" + } + """; + + Server + .Given( + WireMock + .RequestBuilders.Request.Create() + .WithPath("/v1/scheduling/out_of_office/by_external_id/hr_leave_4471") + .WithHeader("Content-Type", "application/json") + .UsingPut() + .WithBodyAsJson(requestJson) + ) + .RespondWith( + WireMock + .ResponseBuilders.Response.Create() + .WithStatusCode(200) + .WithBody(mockResponse) + ); + + var response = await Client.Scheduling.OutOfOffice.PutAsync( + new PutSchedulingOutOfOfficeRequest + { + ExternalId = "hr_leave_4471", + Host = "doctor_482", + StartDate = "2027-08-02", + EndDate = "2027-08-13", + Reason = "vacation", + } + ); + JsonAssert.AreEqual(response, mockResponse); + } +} diff --git a/sdks/dotnet/src/Coss.Test/Unit/MockServer/Scheduling/OutOfOffice/RemoveTest.cs b/sdks/dotnet/src/Coss.Test/Unit/MockServer/Scheduling/OutOfOffice/RemoveTest.cs new file mode 100644 index 000000000..2c575f949 --- /dev/null +++ b/sdks/dotnet/src/Coss.Test/Unit/MockServer/Scheduling/OutOfOffice/RemoveTest.cs @@ -0,0 +1,73 @@ +using Coss.Scheduling; +using Coss.Test.Unit.MockServer; +using Coss.Test.Utils; +using NUnit.Framework; + +namespace Coss.Test.Unit.MockServer.Scheduling.OutOfOffice; + +[TestFixture] +[Parallelizable(ParallelScope.Self)] +public class RemoveTest : BaseMockServerTest +{ + [NUnit.Framework.Test] + public async Task MockServerTest_1() + { + const string mockResponse = """ + { + "object": "scheduling.out_of_office", + "id": "id", + "deleted": true + } + """; + + Server + .Given( + WireMock + .RequestBuilders.Request.Create() + .WithPath("/v1/scheduling/out_of_office/id") + .UsingDelete() + ) + .RespondWith( + WireMock + .ResponseBuilders.Response.Create() + .WithStatusCode(200) + .WithBody(mockResponse) + ); + + var response = await Client.Scheduling.OutOfOffice.RemoveAsync( + new RemoveOutOfOfficeRequest { Id = "id" } + ); + JsonAssert.AreEqual(response, mockResponse); + } + + [NUnit.Framework.Test] + public async Task MockServerTest_2() + { + const string mockResponse = """ + { + "object": "scheduling.out_of_office", + "id": "ooo_01kd2m9a0b1c2d3e4f5g6h7j8m", + "deleted": true + } + """; + + Server + .Given( + WireMock + .RequestBuilders.Request.Create() + .WithPath("/v1/scheduling/out_of_office/ooo_01kd2m9a0b1c2d3e4f5g6h7j8m") + .UsingDelete() + ) + .RespondWith( + WireMock + .ResponseBuilders.Response.Create() + .WithStatusCode(200) + .WithBody(mockResponse) + ); + + var response = await Client.Scheduling.OutOfOffice.RemoveAsync( + new RemoveOutOfOfficeRequest { Id = "ooo_01kd2m9a0b1c2d3e4f5g6h7j8m" } + ); + JsonAssert.AreEqual(response, mockResponse); + } +} diff --git a/sdks/dotnet/src/Coss.Test/Unit/MockServer/Scheduling/OutOfOffice/UpdateTest.cs b/sdks/dotnet/src/Coss.Test/Unit/MockServer/Scheduling/OutOfOffice/UpdateTest.cs new file mode 100644 index 000000000..0d84c3e63 --- /dev/null +++ b/sdks/dotnet/src/Coss.Test/Unit/MockServer/Scheduling/OutOfOffice/UpdateTest.cs @@ -0,0 +1,150 @@ +using Coss.Scheduling; +using Coss.Test.Unit.MockServer; +using Coss.Test.Utils; +using NUnit.Framework; + +namespace Coss.Test.Unit.MockServer.Scheduling.OutOfOffice; + +[TestFixture] +[Parallelizable(ParallelScope.Self)] +public class UpdateTest : BaseMockServerTest +{ + [NUnit.Framework.Test] + public async Task MockServerTest_1() + { + const string requestJson = """ + { + "notes": null, + "public_message": null + } + """; + + const string mockResponse = """ + { + "object": "scheduling.out_of_office", + "id": "id", + "host": "host", + "start": "start", + "end": "end", + "all_day": { + "start_date": "start_date", + "end_date": "end_date", + "time_zone": "time_zone" + }, + "reason": "reason", + "notes": "notes", + "public_message": "public_message", + "show_on_calendar": true, + "delegates": [ + "delegates", + "delegates" + ], + "existing_bookings": "leave", + "external_id": "external_id", + "group": "group", + "source": "api", + "created_at": "created_at", + "updated_at": "updated_at" + } + """; + + Server + .Given( + WireMock + .RequestBuilders.Request.Create() + .WithPath("/v1/scheduling/out_of_office/id") + .WithHeader("Content-Type", "application/json") + .UsingPatch() + .WithBodyAsJson(requestJson) + ) + .RespondWith( + WireMock + .ResponseBuilders.Response.Create() + .WithStatusCode(200) + .WithBody(mockResponse) + ); + + var response = await Client.Scheduling.OutOfOffice.UpdateAsync( + new UpdateSchedulingOutOfOfficeRequest + { + Id = "id", + Start = null, + End = null, + StartDate = null, + EndDate = null, + TimeZone = null, + Reason = null, + Notes = null, + PublicMessage = null, + ShowOnCalendar = null, + Delegates = null, + ExistingBookings = null, + Reassign = null, + } + ); + JsonAssert.AreEqual(response, mockResponse); + } + + [NUnit.Framework.Test] + public async Task MockServerTest_2() + { + const string requestJson = """ + { + "end_date": "2027-08-20" + } + """; + + const string mockResponse = """ + { + "object": "scheduling.out_of_office", + "id": "ooo_01kd2m9a0b1c2d3e4f5g6h7j8m", + "host": "host_01kd2m9a0b1c2d3e4f5g6h7j8m", + "start": "2027-08-02T04:00:00.000Z", + "end": "2027-08-14T04:00:00.000Z", + "all_day": { + "start_date": "2027-08-02", + "end_date": "2027-08-13", + "time_zone": "America/New_York" + }, + "reason": "vacation", + "notes": null, + "public_message": "Back on the 16th.", + "show_on_calendar": true, + "delegates": [ + "host_01kd2m9a0b1c2d3e4f5g6h7j8n" + ], + "existing_bookings": "leave", + "external_id": null, + "group": null, + "source": "api", + "created_at": "2027-01-01T10:00:00.000Z", + "updated_at": "2027-01-01T10:00:00.000Z" + } + """; + + Server + .Given( + WireMock + .RequestBuilders.Request.Create() + .WithPath("/v1/scheduling/out_of_office/ooo_01kd2m9a0b1c2d3e4f5g6h7j8m") + .WithHeader("Content-Type", "application/json") + .UsingPatch() + .WithBodyAsJson(requestJson) + ) + .RespondWith( + WireMock + .ResponseBuilders.Response.Create() + .WithStatusCode(200) + .WithBody(mockResponse) + ); + + var response = await Client.Scheduling.OutOfOffice.UpdateAsync( + new UpdateSchedulingOutOfOfficeRequest + { + Id = "ooo_01kd2m9a0b1c2d3e4f5g6h7j8m", + EndDate = "2027-08-20", + } + ); + JsonAssert.AreEqual(response, mockResponse); + } +} diff --git a/sdks/dotnet/src/Coss.Test/Unit/MockServer/Scheduling/Reassignments/CancelTest.cs b/sdks/dotnet/src/Coss.Test/Unit/MockServer/Scheduling/Reassignments/CancelTest.cs new file mode 100644 index 000000000..e069c69c2 --- /dev/null +++ b/sdks/dotnet/src/Coss.Test/Unit/MockServer/Scheduling/Reassignments/CancelTest.cs @@ -0,0 +1,103 @@ +using Coss.Scheduling; +using Coss.Test.Unit.MockServer; +using Coss.Test.Utils; +using NUnit.Framework; + +namespace Coss.Test.Unit.MockServer.Scheduling.Reassignments; + +[TestFixture] +[Parallelizable(ParallelScope.Self)] +public class CancelTest : BaseMockServerTest +{ + [NUnit.Framework.Test] + public async Task MockServerTest_1() + { + const string mockResponse = """ + { + "object": "scheduling.reassignment", + "id": "id", + "status": "pending", + "reason_code": "host_unavailable", + "out_of_office": "out_of_office", + "undo_of": "undo_of", + "counts": { + "total": 1.1, + "pending": 1.1, + "reassigned": 1.1, + "skipped": 1.1, + "no_candidate": 1.1, + "failed": 1.1, + "cancelled": 1.1 + }, + "created_at": "created_at", + "started_at": "started_at", + "finished_at": "finished_at" + } + """; + + Server + .Given( + WireMock + .RequestBuilders.Request.Create() + .WithPath("/v1/scheduling/reassignments/id/cancel") + .UsingPost() + ) + .RespondWith( + WireMock + .ResponseBuilders.Response.Create() + .WithStatusCode(200) + .WithBody(mockResponse) + ); + + var response = await Client.Scheduling.Reassignments.CancelAsync( + new CancelReassignmentsRequest { Id = "id" } + ); + JsonAssert.AreEqual(response, mockResponse); + } + + [NUnit.Framework.Test] + public async Task MockServerTest_2() + { + const string mockResponse = """ + { + "object": "scheduling.reassignment", + "id": "reasn_01kd2m9a0b1c2d3e4f5g6h7j8m", + "status": "completed", + "reason_code": "out_of_office", + "out_of_office": "ooo_01kd2m9a0b1c2d3e4f5g6h7j8m", + "undo_of": null, + "counts": { + "total": 12, + "pending": 0, + "reassigned": 11, + "skipped": 0, + "no_candidate": 1, + "failed": 0, + "cancelled": 0 + }, + "created_at": "2027-01-01T10:00:00.000Z", + "started_at": "2027-01-01T10:00:01.000Z", + "finished_at": "2027-01-01T10:00:09.000Z" + } + """; + + Server + .Given( + WireMock + .RequestBuilders.Request.Create() + .WithPath("/v1/scheduling/reassignments/id/cancel") + .UsingPost() + ) + .RespondWith( + WireMock + .ResponseBuilders.Response.Create() + .WithStatusCode(200) + .WithBody(mockResponse) + ); + + var response = await Client.Scheduling.Reassignments.CancelAsync( + new CancelReassignmentsRequest { Id = "id" } + ); + JsonAssert.AreEqual(response, mockResponse); + } +} diff --git a/sdks/dotnet/src/Coss.Test/Unit/MockServer/Scheduling/Reassignments/CreateTest.cs b/sdks/dotnet/src/Coss.Test/Unit/MockServer/Scheduling/Reassignments/CreateTest.cs new file mode 100644 index 000000000..9e4370962 --- /dev/null +++ b/sdks/dotnet/src/Coss.Test/Unit/MockServer/Scheduling/Reassignments/CreateTest.cs @@ -0,0 +1,160 @@ +using Coss; +using Coss.Scheduling; +using Coss.Test.Unit.MockServer; +using Coss.Test.Utils; +using NUnit.Framework; + +namespace Coss.Test.Unit.MockServer.Scheduling.Reassignments; + +[TestFixture] +[Parallelizable(ParallelScope.Self)] +public class CreateTest : BaseMockServerTest +{ + [NUnit.Framework.Test] + public async Task MockServerTest_1() + { + const string requestJson = """ + { + "selection": {}, + "reason_code": "host_unavailable" + } + """; + + const string mockResponse = """ + { + "object": "scheduling.reassignment", + "id": "id", + "status": "pending", + "reason_code": "host_unavailable", + "out_of_office": "out_of_office", + "undo_of": "undo_of", + "counts": { + "total": 1.1, + "pending": 1.1, + "reassigned": 1.1, + "skipped": 1.1, + "no_candidate": 1.1, + "failed": 1.1, + "cancelled": 1.1 + }, + "created_at": "created_at", + "started_at": "started_at", + "finished_at": "finished_at" + } + """; + + Server + .Given( + WireMock + .RequestBuilders.Request.Create() + .WithPath("/v1/scheduling/reassignments") + .WithHeader("Content-Type", "application/json") + .UsingPost() + .WithBodyAsJson(requestJson) + ) + .RespondWith( + WireMock + .ResponseBuilders.Response.Create() + .WithStatusCode(200) + .WithBody(mockResponse) + ); + + var response = await Client.Scheduling.Reassignments.CreateAsync( + new CreateSchedulingReassignmentRequest + { + Selection = new SchedulingReassignmentSelection + { + Host = null, + OutOfOffice = null, + BookingIds = null, + Series = null, + StartAfter = null, + StartBefore = null, + EventTypes = null, + ExternalConflict = null, + }, + Strategy = null, + ReasonCode = CreateSchedulingReassignmentRequestReasonCode.HostUnavailable, + Note = null, + Overrides = null, + Notify = null, + } + ); + JsonAssert.AreEqual(response, mockResponse); + } + + [NUnit.Framework.Test] + public async Task MockServerTest_2() + { + const string requestJson = """ + { + "selection": { + "out_of_office": "ooo_01kd2m9a0b1c2d3e4f5g6h7j8m" + }, + "strategy": { + "preferred_hosts": [ + "doctor_518" + ] + }, + "reason_code": "out_of_office" + } + """; + + const string mockResponse = """ + { + "object": "scheduling.reassignment", + "id": "reasn_01kd2m9a0b1c2d3e4f5g6h7j8m", + "status": "completed", + "reason_code": "out_of_office", + "out_of_office": "ooo_01kd2m9a0b1c2d3e4f5g6h7j8m", + "undo_of": null, + "counts": { + "total": 12, + "pending": 0, + "reassigned": 11, + "skipped": 0, + "no_candidate": 1, + "failed": 0, + "cancelled": 0 + }, + "created_at": "2027-01-01T10:00:00.000Z", + "started_at": "2027-01-01T10:00:01.000Z", + "finished_at": "2027-01-01T10:00:09.000Z" + } + """; + + Server + .Given( + WireMock + .RequestBuilders.Request.Create() + .WithPath("/v1/scheduling/reassignments") + .WithHeader("Idempotency-Key", "welcome-user-123") + .WithHeader("Content-Type", "application/json") + .UsingPost() + .WithBodyAsJson(requestJson) + ) + .RespondWith( + WireMock + .ResponseBuilders.Response.Create() + .WithStatusCode(200) + .WithBody(mockResponse) + ); + + var response = await Client.Scheduling.Reassignments.CreateAsync( + new CreateSchedulingReassignmentRequest + { + IdempotencyKey = "welcome-user-123", + Selection = new SchedulingReassignmentSelection + { + OutOfOffice = "ooo_01kd2m9a0b1c2d3e4f5g6h7j8m", + }, + Strategy = new SchedulingReassignmentStrategy + { + PreferredHosts = new List() { "doctor_518" }, + }, + ReasonCode = CreateSchedulingReassignmentRequestReasonCode.OutOfOffice, + } + ); + JsonAssert.AreEqual(response, mockResponse); + } +} diff --git a/sdks/dotnet/src/Coss.Test/Unit/MockServer/Scheduling/Reassignments/GetTest.cs b/sdks/dotnet/src/Coss.Test/Unit/MockServer/Scheduling/Reassignments/GetTest.cs new file mode 100644 index 000000000..68455570c --- /dev/null +++ b/sdks/dotnet/src/Coss.Test/Unit/MockServer/Scheduling/Reassignments/GetTest.cs @@ -0,0 +1,103 @@ +using Coss.Scheduling; +using Coss.Test.Unit.MockServer; +using Coss.Test.Utils; +using NUnit.Framework; + +namespace Coss.Test.Unit.MockServer.Scheduling.Reassignments; + +[TestFixture] +[Parallelizable(ParallelScope.Self)] +public class GetTest : BaseMockServerTest +{ + [NUnit.Framework.Test] + public async Task MockServerTest_1() + { + const string mockResponse = """ + { + "object": "scheduling.reassignment", + "id": "id", + "status": "pending", + "reason_code": "host_unavailable", + "out_of_office": "out_of_office", + "undo_of": "undo_of", + "counts": { + "total": 1.1, + "pending": 1.1, + "reassigned": 1.1, + "skipped": 1.1, + "no_candidate": 1.1, + "failed": 1.1, + "cancelled": 1.1 + }, + "created_at": "created_at", + "started_at": "started_at", + "finished_at": "finished_at" + } + """; + + Server + .Given( + WireMock + .RequestBuilders.Request.Create() + .WithPath("/v1/scheduling/reassignments/id") + .UsingGet() + ) + .RespondWith( + WireMock + .ResponseBuilders.Response.Create() + .WithStatusCode(200) + .WithBody(mockResponse) + ); + + var response = await Client.Scheduling.Reassignments.GetAsync( + new GetReassignmentsRequest { Id = "id" } + ); + JsonAssert.AreEqual(response, mockResponse); + } + + [NUnit.Framework.Test] + public async Task MockServerTest_2() + { + const string mockResponse = """ + { + "object": "scheduling.reassignment", + "id": "reasn_01kd2m9a0b1c2d3e4f5g6h7j8m", + "status": "completed", + "reason_code": "out_of_office", + "out_of_office": "ooo_01kd2m9a0b1c2d3e4f5g6h7j8m", + "undo_of": null, + "counts": { + "total": 12, + "pending": 0, + "reassigned": 11, + "skipped": 0, + "no_candidate": 1, + "failed": 0, + "cancelled": 0 + }, + "created_at": "2027-01-01T10:00:00.000Z", + "started_at": "2027-01-01T10:00:01.000Z", + "finished_at": "2027-01-01T10:00:09.000Z" + } + """; + + Server + .Given( + WireMock + .RequestBuilders.Request.Create() + .WithPath("/v1/scheduling/reassignments/id") + .UsingGet() + ) + .RespondWith( + WireMock + .ResponseBuilders.Response.Create() + .WithStatusCode(200) + .WithBody(mockResponse) + ); + + var response = await Client.Scheduling.Reassignments.GetAsync( + new GetReassignmentsRequest { Id = "id" } + ); + JsonAssert.AreEqual(response, mockResponse); + } +} diff --git a/sdks/dotnet/src/Coss.Test/Unit/MockServer/Scheduling/Reassignments/ItemsTest.cs b/sdks/dotnet/src/Coss.Test/Unit/MockServer/Scheduling/Reassignments/ItemsTest.cs new file mode 100644 index 000000000..82da62abb --- /dev/null +++ b/sdks/dotnet/src/Coss.Test/Unit/MockServer/Scheduling/Reassignments/ItemsTest.cs @@ -0,0 +1,102 @@ +using Coss.Scheduling; +using Coss.Test.Unit.MockServer; +using Coss.Test.Utils; +using NUnit.Framework; + +namespace Coss.Test.Unit.MockServer.Scheduling.Reassignments; + +[TestFixture] +[Parallelizable(ParallelScope.Self)] +public class ItemsTest : BaseMockServerTest +{ + [NUnit.Framework.Test] + public async Task MockServerTest_1() + { + const string mockResponse = """ + { + "object": "list", + "data": [ + { + "object": "scheduling.reassignment_item", + "id": "id", + "booking": "booking", + "from_host": "from_host", + "to_host": "to_host", + "outcome": "pending", + "error_code": "error_code" + }, + { + "object": "scheduling.reassignment_item", + "id": "id", + "booking": "booking", + "from_host": "from_host", + "to_host": "to_host", + "outcome": "pending", + "error_code": "error_code" + } + ], + "has_more": true + } + """; + + Server + .Given( + WireMock + .RequestBuilders.Request.Create() + .WithPath("/v1/scheduling/reassignments/id/items") + .UsingGet() + ) + .RespondWith( + WireMock + .ResponseBuilders.Response.Create() + .WithStatusCode(200) + .WithBody(mockResponse) + ); + + var response = await Client.Scheduling.Reassignments.ItemsAsync( + new ItemsReassignmentsRequest { Id = "id" } + ); + JsonAssert.AreEqual(response, mockResponse); + } + + [NUnit.Framework.Test] + public async Task MockServerTest_2() + { + const string mockResponse = """ + { + "object": "list", + "data": [ + { + "object": "scheduling.reassignment_item", + "id": "reasi_01kd2m9a0b1c2d3e4f5g6h7j8m", + "booking": "book_01kd2m9a0b1c2d3e4f5g6h7j8m", + "from_host": "host_01kd2m9a0b1c2d3e4f5g6h7j8m", + "to_host": "host_01kd2m9a0b1c2d3e4f5g6h7j8n", + "outcome": "reassigned", + "error_code": null + } + ], + "has_more": false + } + """; + + Server + .Given( + WireMock + .RequestBuilders.Request.Create() + .WithPath("/v1/scheduling/reassignments/id/items") + .UsingGet() + ) + .RespondWith( + WireMock + .ResponseBuilders.Response.Create() + .WithStatusCode(200) + .WithBody(mockResponse) + ); + + var response = await Client.Scheduling.Reassignments.ItemsAsync( + new ItemsReassignmentsRequest { Id = "id" } + ); + JsonAssert.AreEqual(response, mockResponse); + } +} diff --git a/sdks/dotnet/src/Coss.Test/Unit/MockServer/Scheduling/Reassignments/ListTest.cs b/sdks/dotnet/src/Coss.Test/Unit/MockServer/Scheduling/Reassignments/ListTest.cs new file mode 100644 index 000000000..0e93b570c --- /dev/null +++ b/sdks/dotnet/src/Coss.Test/Unit/MockServer/Scheduling/Reassignments/ListTest.cs @@ -0,0 +1,135 @@ +using Coss.Scheduling; +using Coss.Test.Unit.MockServer; +using Coss.Test.Utils; +using NUnit.Framework; + +namespace Coss.Test.Unit.MockServer.Scheduling.Reassignments; + +[TestFixture] +[Parallelizable(ParallelScope.Self)] +public class ListTest : BaseMockServerTest +{ + [NUnit.Framework.Test] + public async Task MockServerTest_1() + { + const string mockResponse = """ + { + "object": "list", + "data": [ + { + "object": "scheduling.reassignment", + "id": "id", + "status": "pending", + "reason_code": "host_unavailable", + "out_of_office": "out_of_office", + "undo_of": "undo_of", + "counts": { + "total": 1.1, + "pending": 1.1, + "reassigned": 1.1, + "skipped": 1.1, + "no_candidate": 1.1, + "failed": 1.1, + "cancelled": 1.1 + }, + "created_at": "created_at", + "started_at": "started_at", + "finished_at": "finished_at" + }, + { + "object": "scheduling.reassignment", + "id": "id", + "status": "pending", + "reason_code": "host_unavailable", + "out_of_office": "out_of_office", + "undo_of": "undo_of", + "counts": { + "total": 1.1, + "pending": 1.1, + "reassigned": 1.1, + "skipped": 1.1, + "no_candidate": 1.1, + "failed": 1.1, + "cancelled": 1.1 + }, + "created_at": "created_at", + "started_at": "started_at", + "finished_at": "finished_at" + } + ], + "has_more": true + } + """; + + Server + .Given( + WireMock + .RequestBuilders.Request.Create() + .WithPath("/v1/scheduling/reassignments") + .UsingGet() + ) + .RespondWith( + WireMock + .ResponseBuilders.Response.Create() + .WithStatusCode(200) + .WithBody(mockResponse) + ); + + var response = await Client.Scheduling.Reassignments.ListAsync( + new ListReassignmentsRequest() + ); + JsonAssert.AreEqual(response, mockResponse); + } + + [NUnit.Framework.Test] + public async Task MockServerTest_2() + { + const string mockResponse = """ + { + "object": "list", + "data": [ + { + "object": "scheduling.reassignment", + "id": "reasn_01kd2m9a0b1c2d3e4f5g6h7j8m", + "status": "completed", + "reason_code": "out_of_office", + "out_of_office": "ooo_01kd2m9a0b1c2d3e4f5g6h7j8m", + "undo_of": null, + "counts": { + "total": 12, + "pending": 0, + "reassigned": 11, + "skipped": 0, + "no_candidate": 1, + "failed": 0, + "cancelled": 0 + }, + "created_at": "2027-01-01T10:00:00.000Z", + "started_at": "2027-01-01T10:00:01.000Z", + "finished_at": "2027-01-01T10:00:09.000Z" + } + ], + "has_more": false + } + """; + + Server + .Given( + WireMock + .RequestBuilders.Request.Create() + .WithPath("/v1/scheduling/reassignments") + .UsingGet() + ) + .RespondWith( + WireMock + .ResponseBuilders.Response.Create() + .WithStatusCode(200) + .WithBody(mockResponse) + ); + + var response = await Client.Scheduling.Reassignments.ListAsync( + new ListReassignmentsRequest() + ); + JsonAssert.AreEqual(response, mockResponse); + } +} diff --git a/sdks/dotnet/src/Coss.Test/Unit/MockServer/Scheduling/Reassignments/PreviewTest.cs b/sdks/dotnet/src/Coss.Test/Unit/MockServer/Scheduling/Reassignments/PreviewTest.cs new file mode 100644 index 000000000..e1656db89 --- /dev/null +++ b/sdks/dotnet/src/Coss.Test/Unit/MockServer/Scheduling/Reassignments/PreviewTest.cs @@ -0,0 +1,165 @@ +using Coss; +using Coss.Scheduling; +using Coss.Test.Unit.MockServer; +using Coss.Test.Utils; +using NUnit.Framework; + +namespace Coss.Test.Unit.MockServer.Scheduling.Reassignments; + +[TestFixture] +[Parallelizable(ParallelScope.Self)] +public class PreviewTest : BaseMockServerTest +{ + [NUnit.Framework.Test] + public async Task MockServerTest_1() + { + const string requestJson = """ + { + "selection": {} + } + """; + + const string mockResponse = """ + { + "object": "scheduling.reassignment_preview", + "items": [ + { + "booking": "booking", + "event_type": "event_type", + "title": "title", + "status": "held", + "start": "start", + "end": "end", + "series": "series", + "group_session": "group_session", + "from_host": "from_host", + "to_host": "to_host", + "reason": "reason" + }, + { + "booking": "booking", + "event_type": "event_type", + "title": "title", + "status": "held", + "start": "start", + "end": "end", + "series": "series", + "group_session": "group_session", + "from_host": "from_host", + "to_host": "to_host", + "reason": "reason" + } + ], + "truncated": true + } + """; + + Server + .Given( + WireMock + .RequestBuilders.Request.Create() + .WithPath("/v1/scheduling/reassignments/preview") + .WithHeader("Content-Type", "application/json") + .UsingPost() + .WithBodyAsJson(requestJson) + ) + .RespondWith( + WireMock + .ResponseBuilders.Response.Create() + .WithStatusCode(200) + .WithBody(mockResponse) + ); + + var response = await Client.Scheduling.Reassignments.PreviewAsync( + new PreviewSchedulingReassignmentRequest + { + Selection = new SchedulingReassignmentSelection + { + Host = null, + OutOfOffice = null, + BookingIds = null, + Series = null, + StartAfter = null, + StartBefore = null, + EventTypes = null, + ExternalConflict = null, + }, + Strategy = null, + Overrides = null, + } + ); + JsonAssert.AreEqual(response, mockResponse); + } + + [NUnit.Framework.Test] + public async Task MockServerTest_2() + { + const string requestJson = """ + { + "selection": { + "host": "doctor_482", + "start_before": "2027-08-14T00:00:00.000Z" + }, + "strategy": { + "preferred_hosts": [ + "doctor_518" + ] + } + } + """; + + const string mockResponse = """ + { + "object": "scheduling.reassignment_preview", + "items": [ + { + "booking": "book_01kd2m9a0b1c2d3e4f5g6h7j8m", + "event_type": "evtype_01kd2m9a0b1c2d3e4f5g6h7j8m", + "title": "Consultation", + "status": "confirmed", + "start": "2027-08-03T15:00:00.000Z", + "end": "2027-08-03T15:30:00.000Z", + "series": null, + "group_session": null, + "from_host": "host_01kd2m9a0b1c2d3e4f5g6h7j8m", + "to_host": "host_01kd2m9a0b1c2d3e4f5g6h7j8n", + "reason": null + } + ], + "truncated": false + } + """; + + Server + .Given( + WireMock + .RequestBuilders.Request.Create() + .WithPath("/v1/scheduling/reassignments/preview") + .WithHeader("Content-Type", "application/json") + .UsingPost() + .WithBodyAsJson(requestJson) + ) + .RespondWith( + WireMock + .ResponseBuilders.Response.Create() + .WithStatusCode(200) + .WithBody(mockResponse) + ); + + var response = await Client.Scheduling.Reassignments.PreviewAsync( + new PreviewSchedulingReassignmentRequest + { + Selection = new SchedulingReassignmentSelection + { + Host = "doctor_482", + StartBefore = "2027-08-14T00:00:00.000Z", + }, + Strategy = new SchedulingReassignmentStrategy + { + PreferredHosts = new List() { "doctor_518" }, + }, + } + ); + JsonAssert.AreEqual(response, mockResponse); + } +} diff --git a/sdks/dotnet/src/Coss.Test/Unit/MockServer/Scheduling/Reassignments/UndoTest.cs b/sdks/dotnet/src/Coss.Test/Unit/MockServer/Scheduling/Reassignments/UndoTest.cs new file mode 100644 index 000000000..9bd205cd5 --- /dev/null +++ b/sdks/dotnet/src/Coss.Test/Unit/MockServer/Scheduling/Reassignments/UndoTest.cs @@ -0,0 +1,128 @@ +using Coss.Scheduling; +using Coss.Test.Unit.MockServer; +using Coss.Test.Utils; +using NUnit.Framework; + +namespace Coss.Test.Unit.MockServer.Scheduling.Reassignments; + +[TestFixture] +[Parallelizable(ParallelScope.Self)] +public class UndoTest : BaseMockServerTest +{ + [NUnit.Framework.Test] + public async Task MockServerTest_1() + { + const string requestJson = """ + {} + """; + + const string mockResponse = """ + { + "object": "scheduling.reassignment", + "id": "id", + "status": "pending", + "reason_code": "host_unavailable", + "out_of_office": "out_of_office", + "undo_of": "undo_of", + "counts": { + "total": 1.1, + "pending": 1.1, + "reassigned": 1.1, + "skipped": 1.1, + "no_candidate": 1.1, + "failed": 1.1, + "cancelled": 1.1 + }, + "created_at": "created_at", + "started_at": "started_at", + "finished_at": "finished_at" + } + """; + + Server + .Given( + WireMock + .RequestBuilders.Request.Create() + .WithPath("/v1/scheduling/reassignments/id/undo") + .WithHeader("Content-Type", "application/json") + .UsingPost() + .WithBodyAsJson(requestJson) + ) + .RespondWith( + WireMock + .ResponseBuilders.Response.Create() + .WithStatusCode(200) + .WithBody(mockResponse) + ); + + var response = await Client.Scheduling.Reassignments.UndoAsync( + new UndoSchedulingReassignmentRequest + { + Id = "id", + ReasonCode = null, + Note = null, + Overrides = null, + Notify = null, + } + ); + JsonAssert.AreEqual(response, mockResponse); + } + + [NUnit.Framework.Test] + public async Task MockServerTest_2() + { + const string requestJson = """ + { + "reason_code": "other" + } + """; + + const string mockResponse = """ + { + "object": "scheduling.reassignment", + "id": "reasn_01kd2m9a0b1c2d3e4f5g6h7j8m", + "status": "completed", + "reason_code": "out_of_office", + "out_of_office": "ooo_01kd2m9a0b1c2d3e4f5g6h7j8m", + "undo_of": null, + "counts": { + "total": 12, + "pending": 0, + "reassigned": 11, + "skipped": 0, + "no_candidate": 1, + "failed": 0, + "cancelled": 0 + }, + "created_at": "2027-01-01T10:00:00.000Z", + "started_at": "2027-01-01T10:00:01.000Z", + "finished_at": "2027-01-01T10:00:09.000Z" + } + """; + + Server + .Given( + WireMock + .RequestBuilders.Request.Create() + .WithPath("/v1/scheduling/reassignments/id/undo") + .WithHeader("Content-Type", "application/json") + .UsingPost() + .WithBodyAsJson(requestJson) + ) + .RespondWith( + WireMock + .ResponseBuilders.Response.Create() + .WithStatusCode(200) + .WithBody(mockResponse) + ); + + var response = await Client.Scheduling.Reassignments.UndoAsync( + new UndoSchedulingReassignmentRequest + { + Id = "id", + ReasonCode = UndoSchedulingReassignmentRequestReasonCode.Other, + } + ); + JsonAssert.AreEqual(response, mockResponse); + } +} diff --git a/sdks/dotnet/src/Coss.Test/Unit/MockServer/Scheduling/Series/CancelTest.cs b/sdks/dotnet/src/Coss.Test/Unit/MockServer/Scheduling/Series/CancelTest.cs index e3ee57e7c..d227b7b5a 100644 --- a/sdks/dotnet/src/Coss.Test/Unit/MockServer/Scheduling/Series/CancelTest.cs +++ b/sdks/dotnet/src/Coss.Test/Unit/MockServer/Scheduling/Series/CancelTest.cs @@ -205,9 +205,7 @@ public async Task MockServerTest_2() "locale": null } ], - "location": { - "type": "link" - }, + "location": null, "hold_expires_at": null, "approval_expires_at": null, "series": null, diff --git a/sdks/dotnet/src/Coss.Test/Unit/MockServer/Scheduling/Series/CreateTest.cs b/sdks/dotnet/src/Coss.Test/Unit/MockServer/Scheduling/Series/CreateTest.cs index e3f1721a7..1f0bf5d90 100644 --- a/sdks/dotnet/src/Coss.Test/Unit/MockServer/Scheduling/Series/CreateTest.cs +++ b/sdks/dotnet/src/Coss.Test/Unit/MockServer/Scheduling/Series/CreateTest.cs @@ -267,9 +267,7 @@ public async Task MockServerTest_2() "locale": null } ], - "location": { - "type": "link" - }, + "location": null, "hold_expires_at": null, "approval_expires_at": null, "series": null, diff --git a/sdks/dotnet/src/Coss.Test/Unit/MockServer/Scheduling/Sessions/CreateForManagerTest.cs b/sdks/dotnet/src/Coss.Test/Unit/MockServer/Scheduling/Sessions/CreateForManagerTest.cs new file mode 100644 index 000000000..4888e9f57 --- /dev/null +++ b/sdks/dotnet/src/Coss.Test/Unit/MockServer/Scheduling/Sessions/CreateForManagerTest.cs @@ -0,0 +1,108 @@ +using Coss.Scheduling; +using Coss.Test.Unit.MockServer; +using Coss.Test.Utils; +using NUnit.Framework; +using OneOf; + +namespace Coss.Test.Unit.MockServer.Scheduling.Sessions; + +[TestFixture] +[Parallelizable(ParallelScope.Self)] +public class CreateForManagerTest : BaseMockServerTest +{ + [NUnit.Framework.Test] + public async Task MockServerTest_1() + { + const string requestJson = """ + {} + """; + + const string mockResponse = """ + { + "object": "scheduling.session", + "id": "id", + "token": "token", + "url": "url", + "expires_at": "expires_at" + } + """; + + Server + .Given( + WireMock + .RequestBuilders.Request.Create() + .WithPath("/v1/scheduling/manager_sessions") + .WithHeader("Content-Type", "application/json") + .UsingPost() + .WithBodyAsJson(requestJson) + ) + .RespondWith( + WireMock + .ResponseBuilders.Response.Create() + .WithStatusCode(200) + .WithBody(mockResponse) + ); + + var response = await Client.Scheduling.Sessions.CreateForManagerAsync( + new CreateSchedulingManagerSessionRequest + { + Hosts = null, + HostFilter = null, + ExpiresIn = null, + ReadOnly = null, + } + ); + JsonAssert.AreEqual(response, mockResponse); + } + + [NUnit.Framework.Test] + public async Task MockServerTest_2() + { + const string requestJson = """ + { + "host_filter": { + "team": "cardiology" + }, + "expires_in": 3600 + } + """; + + const string mockResponse = """ + { + "object": "scheduling.session", + "id": "schs_01kd2m9a0b1c2d3e4f5g6h7j8m", + "token": "cossch_abc123", + "url": "https://example.test/h/schs_01kd2m9a0b1c2d3e4f5g6h7j8m#cossch_abc123", + "expires_at": "2027-01-01T11:00:00.000Z" + } + """; + + Server + .Given( + WireMock + .RequestBuilders.Request.Create() + .WithPath("/v1/scheduling/manager_sessions") + .WithHeader("Content-Type", "application/json") + .UsingPost() + .WithBodyAsJson(requestJson) + ) + .RespondWith( + WireMock + .ResponseBuilders.Response.Create() + .WithStatusCode(200) + .WithBody(mockResponse) + ); + + var response = await Client.Scheduling.Sessions.CreateForManagerAsync( + new CreateSchedulingManagerSessionRequest + { + HostFilter = new Dictionary>>() + { + { "team", "cardiology" }, + }, + ExpiresIn = 3600, + } + ); + JsonAssert.AreEqual(response, mockResponse); + } +} diff --git a/sdks/dotnet/src/Coss.Test/Unit/MockServer/Scheduling/Settings/GetTest.cs b/sdks/dotnet/src/Coss.Test/Unit/MockServer/Scheduling/Settings/GetTest.cs index e784e6ea2..be09d454d 100644 --- a/sdks/dotnet/src/Coss.Test/Unit/MockServer/Scheduling/Settings/GetTest.cs +++ b/sdks/dotnet/src/Coss.Test/Unit/MockServer/Scheduling/Settings/GetTest.cs @@ -26,8 +26,21 @@ public async Task MockServerTest_1() "height": 1000000, "data_url": "data_url" }, + "privacy_url": "privacy_url", "email_from": "email_from", "sms_from": "sms_from", + "name_host_in_attendee_emails": true, + "host_reassignment": "off", + "out_of_office_reasons": [ + { + "key": "key", + "label": "label" + }, + { + "key": "key", + "label": "label" + } + ], "calendar_failure_mode": "hide", "notifications": { "notifications": { @@ -138,8 +151,17 @@ public async Task MockServerTest_2() "brand_name": "Acme Health", "accent_color": null, "logo": null, + "privacy_url": null, "email_from": "appointments@example.com", "sms_from": null, + "name_host_in_attendee_emails": false, + "host_reassignment": "off", + "out_of_office_reasons": [ + { + "key": "key", + "label": "label" + } + ], "calendar_failure_mode": "hide", "notifications": { "reminder": { diff --git a/sdks/dotnet/src/Coss.Test/Unit/MockServer/Scheduling/Settings/UpdateTest.cs b/sdks/dotnet/src/Coss.Test/Unit/MockServer/Scheduling/Settings/UpdateTest.cs index 979355b0c..b220b5982 100644 --- a/sdks/dotnet/src/Coss.Test/Unit/MockServer/Scheduling/Settings/UpdateTest.cs +++ b/sdks/dotnet/src/Coss.Test/Unit/MockServer/Scheduling/Settings/UpdateTest.cs @@ -17,8 +17,10 @@ public async Task MockServerTest_1() "brand_name": null, "accent_color": null, "logo": null, + "privacy_url": null, "email_from": null, "sms_from": null, + "out_of_office_reasons": null, "notifications": null, "email_reply_to": null, "reminders": null @@ -40,8 +42,21 @@ public async Task MockServerTest_1() "height": 1000000, "data_url": "data_url" }, + "privacy_url": "privacy_url", "email_from": "email_from", "sms_from": "sms_from", + "name_host_in_attendee_emails": true, + "host_reassignment": "off", + "out_of_office_reasons": [ + { + "key": "key", + "label": "label" + }, + { + "key": "key", + "label": "label" + } + ], "calendar_failure_mode": "hide", "notifications": { "notifications": { @@ -145,9 +160,13 @@ public async Task MockServerTest_1() BrandName = null, AccentColor = null, Logo = null, + PrivacyUrl = null, EmailFrom = null, SmsFrom = null, CalendarFailureMode = null, + NameHostInAttendeeEmails = null, + HostReassignment = null, + OutOfOfficeReasons = null, Notifications = null, EmailReplyTo = null, Reminders = null, @@ -174,8 +193,17 @@ public async Task MockServerTest_2() "brand_name": "Acme Health", "accent_color": null, "logo": null, + "privacy_url": null, "email_from": "appointments@example.com", "sms_from": null, + "name_host_in_attendee_emails": false, + "host_reassignment": "off", + "out_of_office_reasons": [ + { + "key": "key", + "label": "label" + } + ], "calendar_failure_mode": "hide", "notifications": { "reminder": { diff --git a/sdks/dotnet/src/Coss/Core/Public/Version.cs b/sdks/dotnet/src/Coss/Core/Public/Version.cs index e0ed7aa66..fc9bc65e2 100644 --- a/sdks/dotnet/src/Coss/Core/Public/Version.cs +++ b/sdks/dotnet/src/Coss/Core/Public/Version.cs @@ -3,5 +3,5 @@ namespace Coss; [Serializable] internal class Version { - public const string Current = "0.3.0"; + public const string Current = "0.4.0"; } diff --git a/sdks/dotnet/src/Coss/Coss.csproj b/sdks/dotnet/src/Coss/Coss.csproj index d61f42a66..59590fd98 100644 --- a/sdks/dotnet/src/Coss/Coss.csproj +++ b/sdks/dotnet/src/Coss/Coss.csproj @@ -5,7 +5,7 @@ enable 12 enable - 0.3.0 + 0.4.0 $(Version) $(Version) README.md diff --git a/sdks/dotnet/src/Coss/CossClient.cs b/sdks/dotnet/src/Coss/CossClient.cs index 8bb25e86c..6bf952cd2 100644 --- a/sdks/dotnet/src/Coss/CossClient.cs +++ b/sdks/dotnet/src/Coss/CossClient.cs @@ -26,7 +26,7 @@ public CossClient( { "X-Fern-Language", "C#" }, { "X-Fern-SDK-Name", "Coss" }, { "X-Fern-SDK-Version", global::Coss.Version.Current }, - { "User-Agent", "coss-dotnet/0.3.0" }, + { "User-Agent", "coss-dotnet/0.4.0" }, } ); foreach (var header in platformHeaders) diff --git a/sdks/dotnet/src/Coss/Scheduling/Bookings/BookingsClient.cs b/sdks/dotnet/src/Coss/Scheduling/Bookings/BookingsClient.cs index 3b3d2495d..f48cd241b 100644 --- a/sdks/dotnet/src/Coss/Scheduling/Bookings/BookingsClient.cs +++ b/sdks/dotnet/src/Coss/Scheduling/Bookings/BookingsClient.cs @@ -13,6 +13,407 @@ internal BookingsClient(RawClient client) _client = client; } + private async Task> ReassignAsyncCore( + ReassignSchedulingBookingRequest request, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ) + { + var _queryString = new Coss.Core.QueryStringBuilder.Builder(capacity: 0) + .MergeAdditional(options?.AdditionalQueryParameters) + .Build(); + var _headers = await new Coss.Core.HeadersBuilder.Builder() + .Add(_client.Options.Headers) + .Add(_client.Options.AdditionalHeaders) + .AddIdempotencyHeader() + .Add(options?.AdditionalHeaders) + .BuildAsync() + .ConfigureAwait(false); + var response = await _client + .SendRequestAsync( + new JsonRequest + { + Method = HttpMethod.Post, + Path = string.Format( + "v1/scheduling/bookings/{0}/reassign", + ValueConvert.ToPathParameterString(request.Id) + ), + Body = request, + QueryString = _queryString, + Headers = _headers, + ContentType = "application/json", + Options = options, + RetriesDisabled = true, + }, + cancellationToken + ) + .ConfigureAwait(false); + if (response.StatusCode is >= 200 and < 400) + { + var responseBody = await response + .Raw.Content.ReadAsStringAsync(cancellationToken) + .ConfigureAwait(false); + try + { + var responseData = JsonUtils.Deserialize(responseBody)!; + return new WithRawResponse() + { + Data = responseData, + RawResponse = new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = response.Raw.RequestMessage?.RequestUri ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + }, + }; + } + catch (JsonException e) + { + throw new CossClientApiException( + "Failed to deserialize response", + response.StatusCode, + responseBody, + e, + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = response.Raw.RequestMessage?.RequestUri ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + } + } + { + var responseBody = await response + .Raw.Content.ReadAsStringAsync(cancellationToken) + .ConfigureAwait(false); + try + { + switch (response.StatusCode) + { + case 400: + throw new BadRequestError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 401: + throw new UnauthorizedError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 403: + throw new ForbiddenError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 404: + throw new NotFoundError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 415: + throw new UnsupportedMediaTypeError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 422: + throw new UnprocessableEntityError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 429: + throw new TooManyRequestsError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 500: + throw new InternalServerError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 503: + throw new ServiceUnavailableError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + } + } + catch (JsonException) + { + // unable to map error response, throwing generic error + } + throw new CossClientApiException( + $"Error with status code {response.StatusCode}", + response.StatusCode, + responseBody, + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = response.Raw.RequestMessage?.RequestUri ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + } + } + + private async Task< + WithRawResponse + > ReassignCandidatesAsyncCore( + ReassignCandidatesBookingsRequest request, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ) + { + var _queryString = new Coss.Core.QueryStringBuilder.Builder(capacity: 1) + .Add("from_host", request.FromHost) + .MergeAdditional(options?.AdditionalQueryParameters) + .Build(); + var _headers = await new Coss.Core.HeadersBuilder.Builder() + .Add(_client.Options.Headers) + .Add(_client.Options.AdditionalHeaders) + .Add(options?.AdditionalHeaders) + .BuildAsync() + .ConfigureAwait(false); + var response = await _client + .SendRequestAsync( + new JsonRequest + { + Method = HttpMethod.Get, + Path = string.Format( + "v1/scheduling/bookings/{0}/reassign_candidates", + ValueConvert.ToPathParameterString(request.Id) + ), + QueryString = _queryString, + Headers = _headers, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); + if (response.StatusCode is >= 200 and < 400) + { + var responseBody = await response + .Raw.Content.ReadAsStringAsync(cancellationToken) + .ConfigureAwait(false); + try + { + var responseData = JsonUtils.Deserialize( + responseBody + )!; + return new WithRawResponse() + { + Data = responseData, + RawResponse = new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = response.Raw.RequestMessage?.RequestUri ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + }, + }; + } + catch (JsonException e) + { + throw new CossClientApiException( + "Failed to deserialize response", + response.StatusCode, + responseBody, + e, + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = response.Raw.RequestMessage?.RequestUri ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + } + } + { + var responseBody = await response + .Raw.Content.ReadAsStringAsync(cancellationToken) + .ConfigureAwait(false); + try + { + switch (response.StatusCode) + { + case 400: + throw new BadRequestError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 401: + throw new UnauthorizedError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 403: + throw new ForbiddenError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 404: + throw new NotFoundError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 422: + throw new UnprocessableEntityError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 429: + throw new TooManyRequestsError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 500: + throw new InternalServerError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 503: + throw new ServiceUnavailableError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + } + } + catch (JsonException) + { + // unable to map error response, throwing generic error + } + throw new CossClientApiException( + $"Error with status code {response.StatusCode}", + response.StatusCode, + responseBody, + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = response.Raw.RequestMessage?.RequestUri ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + } + } + private async Task> ListAsyncCore( ListBookingsRequest request, RequestOptions? options = null, @@ -2138,6 +2539,52 @@ private async Task> UpdateLocationAsyncCore( } } + /// + /// Gives a booking to another host, keeping its id and time. Works for every kind: a group session moves as a whole, from any of its seats, and one that's already started changes for the record, with nobody told. Whoever leaves and joins is told, and the attendee unless you say not to. + /// + /// + /// await client.Scheduling.Bookings.ReassignAsync( + /// new ReassignSchedulingBookingRequest + /// { + /// Id = "book_01kd2m9a0b1c2d3e4f5g6h7j8m", + /// Changes = new List<ReassignSchedulingBookingRequestChangesItem>() + /// { + /// new ReassignSchedulingBookingRequestChangesItem { ToHost = "doctor_518" }, + /// }, + /// ReasonCode = ReassignSchedulingBookingRequestReasonCode.OutOfOffice, + /// } + /// ); + /// + public WithRawResponseTask ReassignAsync( + ReassignSchedulingBookingRequest request, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ) + { + return new WithRawResponseTask( + ReassignAsyncCore(request, options, cancellationToken) + ); + } + + /// + /// The environment's other active hosts: members of the event type first, in the order a pool would pick them, each saying whether they're free and why not. Things can change before you ask: reassigning decides again. + /// + /// + /// await client.Scheduling.Bookings.ReassignCandidatesAsync( + /// new ReassignCandidatesBookingsRequest { Id = "book_01kd2m9a0b1c2d3e4f5g6h7j8m" } + /// ); + /// + public WithRawResponseTask ReassignCandidatesAsync( + ReassignCandidatesBookingsRequest request, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ) + { + return new WithRawResponseTask( + ReassignCandidatesAsyncCore(request, options, cancellationToken) + ); + } + /// /// The environment's bookings, newest first. Answers aren't included. /// @@ -2360,11 +2807,11 @@ public WithRawResponseTask MarkNoShowAsync( /// new UpdateBookingLocationRequest /// { /// Id = "book_01kd2m9a0b1c2d3e4f5g6h7j8m", - /// Location = new SchedulingLocation( - /// new SchedulingLocation.Link( - /// new SchedulingLocationLink { Url = "https://meet.example.com/abc" } - /// ) - /// ), + /// Location = new SchedulingLocationZero + /// { + /// Type = SchedulingLocationZeroType.Link, + /// Url = "https://meet.example.com/abc", + /// }, /// } /// ); /// diff --git a/sdks/dotnet/src/Coss/Scheduling/Bookings/IBookingsClient.cs b/sdks/dotnet/src/Coss/Scheduling/Bookings/IBookingsClient.cs index da91e6190..2c03a52b2 100644 --- a/sdks/dotnet/src/Coss/Scheduling/Bookings/IBookingsClient.cs +++ b/sdks/dotnet/src/Coss/Scheduling/Bookings/IBookingsClient.cs @@ -4,6 +4,24 @@ namespace Coss.Scheduling; public partial interface IBookingsClient { + /// + /// Gives a booking to another host, keeping its id and time. Works for every kind: a group session moves as a whole, from any of its seats, and one that's already started changes for the record, with nobody told. Whoever leaves and joins is told, and the attendee unless you say not to. + /// + WithRawResponseTask ReassignAsync( + ReassignSchedulingBookingRequest request, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ); + + /// + /// The environment's other active hosts: members of the event type first, in the order a pool would pick them, each saying whether they're free and why not. Things can change before you ask: reassigning decides again. + /// + WithRawResponseTask ReassignCandidatesAsync( + ReassignCandidatesBookingsRequest request, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ); + /// /// The environment's bookings, newest first. Answers aren't included. /// diff --git a/sdks/dotnet/src/Coss/Scheduling/Bookings/Requests/ReassignCandidatesBookingsRequest.cs b/sdks/dotnet/src/Coss/Scheduling/Bookings/Requests/ReassignCandidatesBookingsRequest.cs new file mode 100644 index 000000000..c91ae14f1 --- /dev/null +++ b/sdks/dotnet/src/Coss/Scheduling/Bookings/Requests/ReassignCandidatesBookingsRequest.cs @@ -0,0 +1,26 @@ +using Coss.Core; +using global::System.Text.Json.Serialization; + +namespace Coss.Scheduling; + +[Serializable] +public record ReassignCandidatesBookingsRequest +{ + /// + /// The booking's id. + /// + [JsonIgnore] + public required string Id { get; set; } + + /// + /// The host who'd leave, when it could be several. + /// + [JsonIgnore] + public string? FromHost { get; set; } + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/sdks/dotnet/src/Coss/Scheduling/Bookings/Requests/ReassignSchedulingBookingRequest.cs b/sdks/dotnet/src/Coss/Scheduling/Bookings/Requests/ReassignSchedulingBookingRequest.cs new file mode 100644 index 000000000..26e43f72b --- /dev/null +++ b/sdks/dotnet/src/Coss/Scheduling/Bookings/Requests/ReassignSchedulingBookingRequest.cs @@ -0,0 +1,48 @@ +using Coss.Core; +using global::System.Text.Json.Serialization; + +namespace Coss.Scheduling; + +[Serializable] +public record ReassignSchedulingBookingRequest +{ + /// + /// The booking's id. + /// + [JsonIgnore] + public required string Id { get; set; } + + /// + /// A session or a one-on-one has one. A collective can change several. + /// + [JsonPropertyName("changes")] + public IEnumerable Changes { get; set; } = + new List(); + + [JsonPropertyName("reason_code")] + public required ReassignSchedulingBookingRequestReasonCode ReasonCode { get; set; } + + /// + /// Why, in your words: required with an override of someone's availability. Encrypted, and only in the booking's history. + /// + [Optional] + [JsonPropertyName("note")] + public string? Note { get; set; } + + /// + /// Go ahead anyway: `any_host` for someone who doesn't take this event type, and the rest for what a candidate's `reason` said. A host who already has something at this time can never be overridden. + /// + [Optional] + [JsonPropertyName("overrides")] + public IEnumerable? Overrides { get; set; } + + [Optional] + [JsonPropertyName("notify")] + public ReassignSchedulingBookingRequestNotify? Notify { get; set; } + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/sdks/dotnet/src/Coss/Scheduling/Bookings/Requests/UpdateBookingLocationRequest.cs b/sdks/dotnet/src/Coss/Scheduling/Bookings/Requests/UpdateBookingLocationRequest.cs index 13a009010..2c570dacf 100644 --- a/sdks/dotnet/src/Coss/Scheduling/Bookings/Requests/UpdateBookingLocationRequest.cs +++ b/sdks/dotnet/src/Coss/Scheduling/Bookings/Requests/UpdateBookingLocationRequest.cs @@ -1,6 +1,7 @@ using Coss; using Coss.Core; using global::System.Text.Json.Serialization; +using OneOf; namespace Coss.Scheduling; @@ -13,8 +14,16 @@ public record UpdateBookingLocationRequest [JsonIgnore] public required string Id { get; set; } + [Nullable] [JsonPropertyName("location")] - public required SchedulingLocation Location { get; set; } + public OneOf< + SchedulingLocationZero, + SchedulingLocationNumber, + SchedulingLocationAddress, + SchedulingLocationThree, + SchedulingLocationFour, + SchedulingLocationFive + >? Location { get; set; } /// public override string ToString() diff --git a/sdks/dotnet/src/Coss/Scheduling/Bookings/Types/ReassignSchedulingBookingRequestChangesItem.cs b/sdks/dotnet/src/Coss/Scheduling/Bookings/Types/ReassignSchedulingBookingRequestChangesItem.cs new file mode 100644 index 000000000..b6cc9c649 --- /dev/null +++ b/sdks/dotnet/src/Coss/Scheduling/Bookings/Types/ReassignSchedulingBookingRequestChangesItem.cs @@ -0,0 +1,54 @@ +using Coss; +using Coss.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace Coss.Scheduling; + +[Serializable] +public record ReassignSchedulingBookingRequestChangesItem : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + /// + /// The host leaving, by id or uid. Needed when it could be several. + /// + [Optional] + [JsonPropertyName("from_host")] + public string? FromHost { get; set; } + + /// + /// The host taking over, by id or uid. Or set `auto`. + /// + [Optional] + [JsonPropertyName("to_host")] + public string? ToHost { get; set; } + + /// + /// Let coss.com pick, as a pool would: the fairest who's free and fits what the booking was routed with. + /// + [Optional] + [JsonPropertyName("auto")] + public bool? Auto { get; set; } + + /// + /// With `auto`: try these first, in order. + /// + [Optional] + [JsonPropertyName("preferred_hosts")] + public IEnumerable? PreferredHosts { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/sdks/dotnet/src/Coss/Scheduling/Bookings/Types/ReassignSchedulingBookingRequestNotify.cs b/sdks/dotnet/src/Coss/Scheduling/Bookings/Types/ReassignSchedulingBookingRequestNotify.cs new file mode 100644 index 000000000..8c0eb007b --- /dev/null +++ b/sdks/dotnet/src/Coss/Scheduling/Bookings/Types/ReassignSchedulingBookingRequestNotify.cs @@ -0,0 +1,33 @@ +using Coss; +using Coss.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace Coss.Scheduling; + +[Serializable] +public record ReassignSchedulingBookingRequestNotify : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + /// + /// Tell the attendee. Default: true. + /// + [Optional] + [JsonPropertyName("attendee")] + public bool? Attendee { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/sdks/dotnet/src/Coss/Scheduling/Bookings/Types/ReassignSchedulingBookingRequestOverridesItem.cs b/sdks/dotnet/src/Coss/Scheduling/Bookings/Types/ReassignSchedulingBookingRequestOverridesItem.cs new file mode 100644 index 000000000..0e76c7f5a --- /dev/null +++ b/sdks/dotnet/src/Coss/Scheduling/Bookings/Types/ReassignSchedulingBookingRequestOverridesItem.cs @@ -0,0 +1,152 @@ +using Coss.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace Coss.Scheduling; + +[JsonConverter( + typeof(ReassignSchedulingBookingRequestOverridesItem.ReassignSchedulingBookingRequestOverridesItemSerializer) +)] +[Serializable] +public readonly record struct ReassignSchedulingBookingRequestOverridesItem : IStringEnum +{ + public static readonly ReassignSchedulingBookingRequestOverridesItem AnyHost = new( + Values.AnyHost + ); + + public static readonly ReassignSchedulingBookingRequestOverridesItem OutOfOffice = new( + Values.OutOfOffice + ); + + public static readonly ReassignSchedulingBookingRequestOverridesItem OutsideAvailability = new( + Values.OutsideAvailability + ); + + public static readonly ReassignSchedulingBookingRequestOverridesItem HostBusy = new( + Values.HostBusy + ); + + public static readonly ReassignSchedulingBookingRequestOverridesItem LimitReached = new( + Values.LimitReached + ); + + public static readonly ReassignSchedulingBookingRequestOverridesItem CalendarUnverified = new( + Values.CalendarUnverified + ); + + public ReassignSchedulingBookingRequestOverridesItem(string value) + { + Value = value; + } + + /// + /// The string value of the enum. + /// + public string Value { get; } + + /// + /// Create a string enum with the given value. + /// + public static ReassignSchedulingBookingRequestOverridesItem FromCustom(string value) + { + return new ReassignSchedulingBookingRequestOverridesItem(value); + } + + public bool Equals(string? other) + { + return Value.Equals(other); + } + + /// + /// Returns the string value of the enum. + /// + public override string ToString() + { + return Value; + } + + public static bool operator ==( + ReassignSchedulingBookingRequestOverridesItem value1, + string value2 + ) => value1.Value.Equals(value2); + + public static bool operator !=( + ReassignSchedulingBookingRequestOverridesItem value1, + string value2 + ) => !value1.Value.Equals(value2); + + public static explicit operator string(ReassignSchedulingBookingRequestOverridesItem value) => + value.Value; + + public static explicit operator ReassignSchedulingBookingRequestOverridesItem(string value) => + new(value); + + internal class ReassignSchedulingBookingRequestOverridesItemSerializer + : JsonConverter + { + public override ReassignSchedulingBookingRequestOverridesItem Read( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON value could not be read as a string." + ); + return new ReassignSchedulingBookingRequestOverridesItem(stringValue); + } + + public override void Write( + Utf8JsonWriter writer, + ReassignSchedulingBookingRequestOverridesItem value, + JsonSerializerOptions options + ) + { + writer.WriteStringValue(value.Value); + } + + public override ReassignSchedulingBookingRequestOverridesItem ReadAsPropertyName( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return new ReassignSchedulingBookingRequestOverridesItem(stringValue); + } + + public override void WriteAsPropertyName( + Utf8JsonWriter writer, + ReassignSchedulingBookingRequestOverridesItem value, + JsonSerializerOptions options + ) + { + writer.WritePropertyName(value.Value); + } + } + + /// + /// Constant strings for enum values + /// + [Serializable] + public static class Values + { + public const string AnyHost = "any_host"; + + public const string OutOfOffice = "out_of_office"; + + public const string OutsideAvailability = "outside_availability"; + + public const string HostBusy = "host_busy"; + + public const string LimitReached = "limit_reached"; + + public const string CalendarUnverified = "calendar_unverified"; + } +} diff --git a/sdks/dotnet/src/Coss/Scheduling/Bookings/Types/ReassignSchedulingBookingRequestReasonCode.cs b/sdks/dotnet/src/Coss/Scheduling/Bookings/Types/ReassignSchedulingBookingRequestReasonCode.cs new file mode 100644 index 000000000..aa202f832 --- /dev/null +++ b/sdks/dotnet/src/Coss/Scheduling/Bookings/Types/ReassignSchedulingBookingRequestReasonCode.cs @@ -0,0 +1,150 @@ +using Coss.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace Coss.Scheduling; + +[JsonConverter( + typeof(ReassignSchedulingBookingRequestReasonCode.ReassignSchedulingBookingRequestReasonCodeSerializer) +)] +[Serializable] +public readonly record struct ReassignSchedulingBookingRequestReasonCode : IStringEnum +{ + public static readonly ReassignSchedulingBookingRequestReasonCode HostUnavailable = new( + Values.HostUnavailable + ); + + public static readonly ReassignSchedulingBookingRequestReasonCode OutOfOffice = new( + Values.OutOfOffice + ); + + public static readonly ReassignSchedulingBookingRequestReasonCode Workload = new( + Values.Workload + ); + + public static readonly ReassignSchedulingBookingRequestReasonCode CustomerRequest = new( + Values.CustomerRequest + ); + + public static readonly ReassignSchedulingBookingRequestReasonCode Offboarding = new( + Values.Offboarding + ); + + public static readonly ReassignSchedulingBookingRequestReasonCode Other = new(Values.Other); + + public ReassignSchedulingBookingRequestReasonCode(string value) + { + Value = value; + } + + /// + /// The string value of the enum. + /// + public string Value { get; } + + /// + /// Create a string enum with the given value. + /// + public static ReassignSchedulingBookingRequestReasonCode FromCustom(string value) + { + return new ReassignSchedulingBookingRequestReasonCode(value); + } + + public bool Equals(string? other) + { + return Value.Equals(other); + } + + /// + /// Returns the string value of the enum. + /// + public override string ToString() + { + return Value; + } + + public static bool operator ==( + ReassignSchedulingBookingRequestReasonCode value1, + string value2 + ) => value1.Value.Equals(value2); + + public static bool operator !=( + ReassignSchedulingBookingRequestReasonCode value1, + string value2 + ) => !value1.Value.Equals(value2); + + public static explicit operator string(ReassignSchedulingBookingRequestReasonCode value) => + value.Value; + + public static explicit operator ReassignSchedulingBookingRequestReasonCode(string value) => + new(value); + + internal class ReassignSchedulingBookingRequestReasonCodeSerializer + : JsonConverter + { + public override ReassignSchedulingBookingRequestReasonCode Read( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON value could not be read as a string." + ); + return new ReassignSchedulingBookingRequestReasonCode(stringValue); + } + + public override void Write( + Utf8JsonWriter writer, + ReassignSchedulingBookingRequestReasonCode value, + JsonSerializerOptions options + ) + { + writer.WriteStringValue(value.Value); + } + + public override ReassignSchedulingBookingRequestReasonCode ReadAsPropertyName( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return new ReassignSchedulingBookingRequestReasonCode(stringValue); + } + + public override void WriteAsPropertyName( + Utf8JsonWriter writer, + ReassignSchedulingBookingRequestReasonCode value, + JsonSerializerOptions options + ) + { + writer.WritePropertyName(value.Value); + } + } + + /// + /// Constant strings for enum values + /// + [Serializable] + public static class Values + { + public const string HostUnavailable = "host_unavailable"; + + public const string OutOfOffice = "out_of_office"; + + public const string Workload = "workload"; + + public const string CustomerRequest = "customer_request"; + + public const string Offboarding = "offboarding"; + + public const string Other = "other"; + } +} diff --git a/sdks/dotnet/src/Coss/Scheduling/EventTypes/Requests/CreateEventTypeRequest.cs b/sdks/dotnet/src/Coss/Scheduling/EventTypes/Requests/CreateEventTypeRequest.cs index 587bedd7c..eb4bf7583 100644 --- a/sdks/dotnet/src/Coss/Scheduling/EventTypes/Requests/CreateEventTypeRequest.cs +++ b/sdks/dotnet/src/Coss/Scheduling/EventTypes/Requests/CreateEventTypeRequest.cs @@ -111,6 +111,13 @@ public Optional + /// Whether bookings of this event type can go to another host. Default: true. + /// + [Optional] + [JsonPropertyName("reassignment_enabled")] + public bool? ReassignmentEnabled { get; set; } + /// /// How long a booking can wait for approval before it's declined, in minutes. Default: 1440. /// @@ -172,7 +179,14 @@ public Optional [Optional] [JsonPropertyName("locations")] - public IEnumerable? Locations { get; set; } + public IEnumerable?>? Locations { get; set; } /// /// Pool members also include active hosts matching all of these attributes. diff --git a/sdks/dotnet/src/Coss/Scheduling/EventTypes/Requests/UpdateEventTypeRequest.cs b/sdks/dotnet/src/Coss/Scheduling/EventTypes/Requests/UpdateEventTypeRequest.cs index 4c7e8c245..1896e5b77 100644 --- a/sdks/dotnet/src/Coss/Scheduling/EventTypes/Requests/UpdateEventTypeRequest.cs +++ b/sdks/dotnet/src/Coss/Scheduling/EventTypes/Requests/UpdateEventTypeRequest.cs @@ -112,6 +112,13 @@ public Optional + /// Whether bookings of this event type can go to another host. Default: true. + /// + [Optional] + [JsonPropertyName("reassignment_enabled")] + public bool? ReassignmentEnabled { get; set; } + /// /// How long a booking can wait for approval before it's declined, in minutes. Default: 1440. /// @@ -173,7 +180,14 @@ public Optional [Optional] [JsonPropertyName("locations")] - public IEnumerable? Locations { get; set; } + public IEnumerable?>? Locations { get; set; } /// /// Pool members also include active hosts matching all of these attributes. diff --git a/sdks/dotnet/src/Coss/Scheduling/HolidayCalendars/HolidayCalendarsClient.cs b/sdks/dotnet/src/Coss/Scheduling/HolidayCalendars/HolidayCalendarsClient.cs new file mode 100644 index 000000000..d70477461 --- /dev/null +++ b/sdks/dotnet/src/Coss/Scheduling/HolidayCalendars/HolidayCalendarsClient.cs @@ -0,0 +1,1246 @@ +using Coss; +using Coss.Core; +using global::System.Text.Json; + +namespace Coss.Scheduling; + +public partial class HolidayCalendarsClient : IHolidayCalendarsClient +{ + private readonly RawClient _client; + + internal HolidayCalendarsClient(RawClient client) + { + _client = client; + } + + private async Task> ListAsyncCore( + RequestOptions? options = null, + CancellationToken cancellationToken = default + ) + { + var _queryString = new Coss.Core.QueryStringBuilder.Builder(capacity: 0) + .MergeAdditional(options?.AdditionalQueryParameters) + .Build(); + var _headers = await new Coss.Core.HeadersBuilder.Builder() + .Add(_client.Options.Headers) + .Add(_client.Options.AdditionalHeaders) + .Add(options?.AdditionalHeaders) + .BuildAsync() + .ConfigureAwait(false); + var response = await _client + .SendRequestAsync( + new JsonRequest + { + Method = HttpMethod.Get, + Path = "v1/scheduling/holiday_calendars", + QueryString = _queryString, + Headers = _headers, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); + if (response.StatusCode is >= 200 and < 400) + { + var responseBody = await response + .Raw.Content.ReadAsStringAsync(cancellationToken) + .ConfigureAwait(false); + try + { + var responseData = JsonUtils.Deserialize( + responseBody + )!; + return new WithRawResponse() + { + Data = responseData, + RawResponse = new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = response.Raw.RequestMessage?.RequestUri ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + }, + }; + } + catch (JsonException e) + { + throw new CossClientApiException( + "Failed to deserialize response", + response.StatusCode, + responseBody, + e, + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = response.Raw.RequestMessage?.RequestUri ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + } + } + { + var responseBody = await response + .Raw.Content.ReadAsStringAsync(cancellationToken) + .ConfigureAwait(false); + try + { + switch (response.StatusCode) + { + case 400: + throw new BadRequestError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 401: + throw new UnauthorizedError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 403: + throw new ForbiddenError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 429: + throw new TooManyRequestsError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 500: + throw new InternalServerError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 503: + throw new ServiceUnavailableError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + } + } + catch (JsonException) + { + // unable to map error response, throwing generic error + } + throw new CossClientApiException( + $"Error with status code {response.StatusCode}", + response.StatusCode, + responseBody, + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = response.Raw.RequestMessage?.RequestUri ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + } + } + + private async Task> CreateAsyncCore( + CreateSchedulingHolidayCalendarRequest request, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ) + { + var _queryString = new Coss.Core.QueryStringBuilder.Builder(capacity: 0) + .MergeAdditional(options?.AdditionalQueryParameters) + .Build(); + var _headers = await new Coss.Core.HeadersBuilder.Builder() + .Add(_client.Options.Headers) + .Add(_client.Options.AdditionalHeaders) + .AddIdempotencyHeader() + .Add(options?.AdditionalHeaders) + .BuildAsync() + .ConfigureAwait(false); + var response = await _client + .SendRequestAsync( + new JsonRequest + { + Method = HttpMethod.Post, + Path = "v1/scheduling/holiday_calendars", + Body = request, + QueryString = _queryString, + Headers = _headers, + ContentType = "application/json", + Options = options, + RetriesDisabled = true, + }, + cancellationToken + ) + .ConfigureAwait(false); + if (response.StatusCode is >= 200 and < 400) + { + var responseBody = await response + .Raw.Content.ReadAsStringAsync(cancellationToken) + .ConfigureAwait(false); + try + { + var responseData = JsonUtils.Deserialize(responseBody)!; + return new WithRawResponse() + { + Data = responseData, + RawResponse = new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = response.Raw.RequestMessage?.RequestUri ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + }, + }; + } + catch (JsonException e) + { + throw new CossClientApiException( + "Failed to deserialize response", + response.StatusCode, + responseBody, + e, + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = response.Raw.RequestMessage?.RequestUri ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + } + } + { + var responseBody = await response + .Raw.Content.ReadAsStringAsync(cancellationToken) + .ConfigureAwait(false); + try + { + switch (response.StatusCode) + { + case 400: + throw new BadRequestError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 401: + throw new UnauthorizedError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 403: + throw new ForbiddenError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 404: + throw new NotFoundError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 415: + throw new UnsupportedMediaTypeError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 422: + throw new UnprocessableEntityError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 429: + throw new TooManyRequestsError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 500: + throw new InternalServerError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 503: + throw new ServiceUnavailableError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + } + } + catch (JsonException) + { + // unable to map error response, throwing generic error + } + throw new CossClientApiException( + $"Error with status code {response.StatusCode}", + response.StatusCode, + responseBody, + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = response.Raw.RequestMessage?.RequestUri ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + } + } + + private async Task> GetAsyncCore( + GetHolidayCalendarsRequest request, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ) + { + var _queryString = new Coss.Core.QueryStringBuilder.Builder(capacity: 0) + .MergeAdditional(options?.AdditionalQueryParameters) + .Build(); + var _headers = await new Coss.Core.HeadersBuilder.Builder() + .Add(_client.Options.Headers) + .Add(_client.Options.AdditionalHeaders) + .Add(options?.AdditionalHeaders) + .BuildAsync() + .ConfigureAwait(false); + var response = await _client + .SendRequestAsync( + new JsonRequest + { + Method = HttpMethod.Get, + Path = string.Format( + "v1/scheduling/holiday_calendars/{0}", + ValueConvert.ToPathParameterString(request.Id) + ), + QueryString = _queryString, + Headers = _headers, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); + if (response.StatusCode is >= 200 and < 400) + { + var responseBody = await response + .Raw.Content.ReadAsStringAsync(cancellationToken) + .ConfigureAwait(false); + try + { + var responseData = JsonUtils.Deserialize(responseBody)!; + return new WithRawResponse() + { + Data = responseData, + RawResponse = new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = response.Raw.RequestMessage?.RequestUri ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + }, + }; + } + catch (JsonException e) + { + throw new CossClientApiException( + "Failed to deserialize response", + response.StatusCode, + responseBody, + e, + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = response.Raw.RequestMessage?.RequestUri ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + } + } + { + var responseBody = await response + .Raw.Content.ReadAsStringAsync(cancellationToken) + .ConfigureAwait(false); + try + { + switch (response.StatusCode) + { + case 400: + throw new BadRequestError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 401: + throw new UnauthorizedError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 403: + throw new ForbiddenError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 404: + throw new NotFoundError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 429: + throw new TooManyRequestsError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 500: + throw new InternalServerError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 503: + throw new ServiceUnavailableError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + } + } + catch (JsonException) + { + // unable to map error response, throwing generic error + } + throw new CossClientApiException( + $"Error with status code {response.StatusCode}", + response.StatusCode, + responseBody, + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = response.Raw.RequestMessage?.RequestUri ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + } + } + + private async Task> RemoveAsyncCore( + RemoveHolidayCalendarsRequest request, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ) + { + var _queryString = new Coss.Core.QueryStringBuilder.Builder(capacity: 0) + .MergeAdditional(options?.AdditionalQueryParameters) + .Build(); + var _headers = await new Coss.Core.HeadersBuilder.Builder() + .Add(_client.Options.Headers) + .Add(_client.Options.AdditionalHeaders) + .Add(options?.AdditionalHeaders) + .BuildAsync() + .ConfigureAwait(false); + var response = await _client + .SendRequestAsync( + new JsonRequest + { + Method = HttpMethod.Delete, + Path = string.Format( + "v1/scheduling/holiday_calendars/{0}", + ValueConvert.ToPathParameterString(request.Id) + ), + QueryString = _queryString, + Headers = _headers, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); + if (response.StatusCode is >= 200 and < 400) + { + var responseBody = await response + .Raw.Content.ReadAsStringAsync(cancellationToken) + .ConfigureAwait(false); + try + { + var responseData = JsonUtils.Deserialize( + responseBody + )!; + return new WithRawResponse() + { + Data = responseData, + RawResponse = new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = response.Raw.RequestMessage?.RequestUri ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + }, + }; + } + catch (JsonException e) + { + throw new CossClientApiException( + "Failed to deserialize response", + response.StatusCode, + responseBody, + e, + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = response.Raw.RequestMessage?.RequestUri ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + } + } + { + var responseBody = await response + .Raw.Content.ReadAsStringAsync(cancellationToken) + .ConfigureAwait(false); + try + { + switch (response.StatusCode) + { + case 400: + throw new BadRequestError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 401: + throw new UnauthorizedError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 403: + throw new ForbiddenError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 404: + throw new NotFoundError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 429: + throw new TooManyRequestsError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 500: + throw new InternalServerError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 503: + throw new ServiceUnavailableError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + } + } + catch (JsonException) + { + // unable to map error response, throwing generic error + } + throw new CossClientApiException( + $"Error with status code {response.StatusCode}", + response.StatusCode, + responseBody, + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = response.Raw.RequestMessage?.RequestUri ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + } + } + + private async Task> UpdateAsyncCore( + UpdateSchedulingHolidayCalendarRequest request, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ) + { + var _queryString = new Coss.Core.QueryStringBuilder.Builder(capacity: 0) + .MergeAdditional(options?.AdditionalQueryParameters) + .Build(); + var _headers = await new Coss.Core.HeadersBuilder.Builder() + .Add(_client.Options.Headers) + .Add(_client.Options.AdditionalHeaders) + .Add(options?.AdditionalHeaders) + .BuildAsync() + .ConfigureAwait(false); + var response = await _client + .SendRequestAsync( + new JsonRequest + { + Method = HttpMethodExtensions.Patch, + Path = string.Format( + "v1/scheduling/holiday_calendars/{0}", + ValueConvert.ToPathParameterString(request.Id) + ), + Body = request, + QueryString = _queryString, + Headers = _headers, + ContentType = "application/json", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); + if (response.StatusCode is >= 200 and < 400) + { + var responseBody = await response + .Raw.Content.ReadAsStringAsync(cancellationToken) + .ConfigureAwait(false); + try + { + var responseData = JsonUtils.Deserialize(responseBody)!; + return new WithRawResponse() + { + Data = responseData, + RawResponse = new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = response.Raw.RequestMessage?.RequestUri ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + }, + }; + } + catch (JsonException e) + { + throw new CossClientApiException( + "Failed to deserialize response", + response.StatusCode, + responseBody, + e, + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = response.Raw.RequestMessage?.RequestUri ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + } + } + { + var responseBody = await response + .Raw.Content.ReadAsStringAsync(cancellationToken) + .ConfigureAwait(false); + try + { + switch (response.StatusCode) + { + case 400: + throw new BadRequestError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 401: + throw new UnauthorizedError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 403: + throw new ForbiddenError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 404: + throw new NotFoundError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 415: + throw new UnsupportedMediaTypeError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 422: + throw new UnprocessableEntityError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 429: + throw new TooManyRequestsError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 500: + throw new InternalServerError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 503: + throw new ServiceUnavailableError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + } + } + catch (JsonException) + { + // unable to map error response, throwing generic error + } + throw new CossClientApiException( + $"Error with status code {response.StatusCode}", + response.StatusCode, + responseBody, + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = response.Raw.RequestMessage?.RequestUri ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + } + } + + private async Task> HolidaysAsyncCore( + HolidaysHolidayCalendarsRequest request, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ) + { + var _queryString = new Coss.Core.QueryStringBuilder.Builder(capacity: 0) + .MergeAdditional(options?.AdditionalQueryParameters) + .Build(); + var _headers = await new Coss.Core.HeadersBuilder.Builder() + .Add(_client.Options.Headers) + .Add(_client.Options.AdditionalHeaders) + .Add(options?.AdditionalHeaders) + .BuildAsync() + .ConfigureAwait(false); + var response = await _client + .SendRequestAsync( + new JsonRequest + { + Method = HttpMethod.Get, + Path = string.Format( + "v1/scheduling/holiday_calendars/{0}/holidays", + ValueConvert.ToPathParameterString(request.Id) + ), + QueryString = _queryString, + Headers = _headers, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); + if (response.StatusCode is >= 200 and < 400) + { + var responseBody = await response + .Raw.Content.ReadAsStringAsync(cancellationToken) + .ConfigureAwait(false); + try + { + var responseData = JsonUtils.Deserialize(responseBody)!; + return new WithRawResponse() + { + Data = responseData, + RawResponse = new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = response.Raw.RequestMessage?.RequestUri ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + }, + }; + } + catch (JsonException e) + { + throw new CossClientApiException( + "Failed to deserialize response", + response.StatusCode, + responseBody, + e, + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = response.Raw.RequestMessage?.RequestUri ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + } + } + { + var responseBody = await response + .Raw.Content.ReadAsStringAsync(cancellationToken) + .ConfigureAwait(false); + try + { + switch (response.StatusCode) + { + case 400: + throw new BadRequestError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 401: + throw new UnauthorizedError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 403: + throw new ForbiddenError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 404: + throw new NotFoundError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 429: + throw new TooManyRequestsError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 500: + throw new InternalServerError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 503: + throw new ServiceUnavailableError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + } + } + catch (JsonException) + { + // unable to map error response, throwing generic error + } + throw new CossClientApiException( + $"Error with status code {response.StatusCode}", + response.StatusCode, + responseBody, + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = response.Raw.RequestMessage?.RequestUri ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + } + } + + /// + /// By name. A feed's URL is never shown again. + /// + /// + /// await client.Scheduling.HolidayCalendars.ListAsync(); + /// + public WithRawResponseTask ListAsync( + RequestOptions? options = null, + CancellationToken cancellationToken = default + ) + { + return new WithRawResponseTask( + ListAsyncCore(options, cancellationToken) + ); + } + + /// + /// Applies a country's public holidays, or your own feed, to some hosts as ordinary out of office entries, kept up to date by coss.com. A host who removes one keeps it removed. + /// + /// + /// await client.Scheduling.HolidayCalendars.CreateAsync( + /// new CreateSchedulingHolidayCalendarRequest + /// { + /// Name = "UK team", + /// Country = "GB", + /// HostFilter = new Dictionary<string, OneOf<string, IEnumerable<string>>>() + /// { + /// { "team", "london" }, + /// }, + /// } + /// ); + /// + public WithRawResponseTask CreateAsync( + CreateSchedulingHolidayCalendarRequest request, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ) + { + return new WithRawResponseTask( + CreateAsyncCore(request, options, cancellationToken) + ); + } + + /// + /// With when it was last read, and why not if it couldn't be. + /// + /// + /// await client.Scheduling.HolidayCalendars.GetAsync(new GetHolidayCalendarsRequest { Id = "id" }); + /// + public WithRawResponseTask GetAsync( + GetHolidayCalendarsRequest request, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ) + { + return new WithRawResponseTask( + GetAsyncCore(request, options, cancellationToken) + ); + } + + /// + /// Hosts can be booked on its days again, shortly: past entries stay. + /// + /// + /// await client.Scheduling.HolidayCalendars.RemoveAsync( + /// new RemoveHolidayCalendarsRequest { Id = "id" } + /// ); + /// + public WithRawResponseTask RemoveAsync( + RemoveHolidayCalendarsRequest request, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ) + { + return new WithRawResponseTask( + RemoveAsyncCore(request, options, cancellationToken) + ); + } + + /// + /// Who it applies to, who covers and what happens to bookings. Takes effect shortly. + /// + /// + /// await client.Scheduling.HolidayCalendars.UpdateAsync( + /// new UpdateSchedulingHolidayCalendarRequest + /// { + /// Id = "id", + /// HostFilter = new Dictionary<string, OneOf<string, IEnumerable<string>>>() + /// { + /// { "team", "london" }, + /// }, + /// } + /// ); + /// + public WithRawResponseTask UpdateAsync( + UpdateSchedulingHolidayCalendarRequest request, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ) + { + return new WithRawResponseTask( + UpdateAsyncCore(request, options, cancellationToken) + ); + } + + /// + /// What's coming, with names, as last read. Empty until its first read. + /// + /// + /// await client.Scheduling.HolidayCalendars.HolidaysAsync( + /// new HolidaysHolidayCalendarsRequest { Id = "id" } + /// ); + /// + public WithRawResponseTask HolidaysAsync( + HolidaysHolidayCalendarsRequest request, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ) + { + return new WithRawResponseTask( + HolidaysAsyncCore(request, options, cancellationToken) + ); + } +} diff --git a/sdks/dotnet/src/Coss/Scheduling/HolidayCalendars/IHolidayCalendarsClient.cs b/sdks/dotnet/src/Coss/Scheduling/HolidayCalendars/IHolidayCalendarsClient.cs new file mode 100644 index 000000000..a46378c2e --- /dev/null +++ b/sdks/dotnet/src/Coss/Scheduling/HolidayCalendars/IHolidayCalendarsClient.cs @@ -0,0 +1,59 @@ +using Coss; + +namespace Coss.Scheduling; + +public partial interface IHolidayCalendarsClient +{ + /// + /// By name. A feed's URL is never shown again. + /// + WithRawResponseTask ListAsync( + RequestOptions? options = null, + CancellationToken cancellationToken = default + ); + + /// + /// Applies a country's public holidays, or your own feed, to some hosts as ordinary out of office entries, kept up to date by coss.com. A host who removes one keeps it removed. + /// + WithRawResponseTask CreateAsync( + CreateSchedulingHolidayCalendarRequest request, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ); + + /// + /// With when it was last read, and why not if it couldn't be. + /// + WithRawResponseTask GetAsync( + GetHolidayCalendarsRequest request, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ); + + /// + /// Hosts can be booked on its days again, shortly: past entries stay. + /// + WithRawResponseTask RemoveAsync( + RemoveHolidayCalendarsRequest request, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ); + + /// + /// Who it applies to, who covers and what happens to bookings. Takes effect shortly. + /// + WithRawResponseTask UpdateAsync( + UpdateSchedulingHolidayCalendarRequest request, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ); + + /// + /// What's coming, with names, as last read. Empty until its first read. + /// + WithRawResponseTask HolidaysAsync( + HolidaysHolidayCalendarsRequest request, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ); +} diff --git a/sdks/dotnet/src/Coss/Scheduling/HolidayCalendars/Requests/CreateSchedulingHolidayCalendarRequest.cs b/sdks/dotnet/src/Coss/Scheduling/HolidayCalendars/Requests/CreateSchedulingHolidayCalendarRequest.cs new file mode 100644 index 000000000..1d91b5382 --- /dev/null +++ b/sdks/dotnet/src/Coss/Scheduling/HolidayCalendars/Requests/CreateSchedulingHolidayCalendarRequest.cs @@ -0,0 +1,67 @@ +using Coss.Core; +using global::System.Text.Json.Serialization; +using OneOf; + +namespace Coss.Scheduling; + +[Serializable] +public record CreateSchedulingHolidayCalendarRequest +{ + [JsonPropertyName("name")] + public required string Name { get; set; } + + /// + /// A code from the list of holiday calendars, such as `GB`. + /// + [Optional] + [JsonPropertyName("country")] + public string? Country { get; set; } + + /// + /// Your own feed, https or webcal, read in live environments. Stored encrypted. + /// + [Optional] + [JsonPropertyName("ics_url")] + public string? IcsUrl { get; set; } + + /// + /// These hosts, by id or uid. + /// + [Optional] + [JsonPropertyName("hosts")] + public IEnumerable? Hosts { get; set; } + + /// + /// Everyone matching these attributes, asked again at every sync. + /// + [Optional] + [JsonPropertyName("host_filter")] + public Dictionary>>? HostFilter { get; set; } + + /// + /// Which regional holidays apply, matched against how the calendar names them, such as `England`. Without this, all of them do; empty, only nationwide ones. + /// + [Optional] + [JsonPropertyName("regions")] + public IEnumerable? Regions { get; set; } + + /// + /// Who can be booked in their place on those days, by id or uid, in order. + /// + [Optional] + [JsonPropertyName("delegates")] + public IEnumerable? Delegates { get; set; } + + /// + /// What happens to bookings already on a holiday. `leave` (the default) only reports them. `reassign` moves them. + /// + [Optional] + [JsonPropertyName("existing_bookings")] + public CreateSchedulingHolidayCalendarRequestExistingBookings? ExistingBookings { get; set; } + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/sdks/dotnet/src/Coss/Scheduling/HolidayCalendars/Requests/GetHolidayCalendarsRequest.cs b/sdks/dotnet/src/Coss/Scheduling/HolidayCalendars/Requests/GetHolidayCalendarsRequest.cs new file mode 100644 index 000000000..93cf199c5 --- /dev/null +++ b/sdks/dotnet/src/Coss/Scheduling/HolidayCalendars/Requests/GetHolidayCalendarsRequest.cs @@ -0,0 +1,20 @@ +using Coss.Core; +using global::System.Text.Json.Serialization; + +namespace Coss.Scheduling; + +[Serializable] +public record GetHolidayCalendarsRequest +{ + /// + /// The holiday calendar's id. + /// + [JsonIgnore] + public required string Id { get; set; } + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/sdks/dotnet/src/Coss/Scheduling/HolidayCalendars/Requests/HolidaysHolidayCalendarsRequest.cs b/sdks/dotnet/src/Coss/Scheduling/HolidayCalendars/Requests/HolidaysHolidayCalendarsRequest.cs new file mode 100644 index 000000000..0e68dba93 --- /dev/null +++ b/sdks/dotnet/src/Coss/Scheduling/HolidayCalendars/Requests/HolidaysHolidayCalendarsRequest.cs @@ -0,0 +1,20 @@ +using Coss.Core; +using global::System.Text.Json.Serialization; + +namespace Coss.Scheduling; + +[Serializable] +public record HolidaysHolidayCalendarsRequest +{ + /// + /// The holiday calendar's id. + /// + [JsonIgnore] + public required string Id { get; set; } + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/sdks/dotnet/src/Coss/Scheduling/HolidayCalendars/Requests/RemoveHolidayCalendarsRequest.cs b/sdks/dotnet/src/Coss/Scheduling/HolidayCalendars/Requests/RemoveHolidayCalendarsRequest.cs new file mode 100644 index 000000000..903988de3 --- /dev/null +++ b/sdks/dotnet/src/Coss/Scheduling/HolidayCalendars/Requests/RemoveHolidayCalendarsRequest.cs @@ -0,0 +1,20 @@ +using Coss.Core; +using global::System.Text.Json.Serialization; + +namespace Coss.Scheduling; + +[Serializable] +public record RemoveHolidayCalendarsRequest +{ + /// + /// The holiday calendar's id. + /// + [JsonIgnore] + public required string Id { get; set; } + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/sdks/dotnet/src/Coss/Scheduling/HolidayCalendars/Requests/UpdateSchedulingHolidayCalendarRequest.cs b/sdks/dotnet/src/Coss/Scheduling/HolidayCalendars/Requests/UpdateSchedulingHolidayCalendarRequest.cs new file mode 100644 index 000000000..787174ef6 --- /dev/null +++ b/sdks/dotnet/src/Coss/Scheduling/HolidayCalendars/Requests/UpdateSchedulingHolidayCalendarRequest.cs @@ -0,0 +1,60 @@ +using Coss.Core; +using global::System.Text.Json.Serialization; +using OneOf; + +namespace Coss.Scheduling; + +[Serializable] +public record UpdateSchedulingHolidayCalendarRequest +{ + /// + /// The holiday calendar's id. + /// + [JsonIgnore] + public required string Id { get; set; } + + [Optional] + [JsonPropertyName("name")] + public string? Name { get; set; } + + /// + /// These hosts, by id or uid. + /// + [Optional] + [JsonPropertyName("hosts")] + public IEnumerable? Hosts { get; set; } + + /// + /// Everyone matching these attributes, asked again at every sync. + /// + [Optional] + [JsonPropertyName("host_filter")] + public Dictionary>>? HostFilter { get; set; } + + /// + /// Which regional holidays apply, matched against how the calendar names them, such as `England`. Without this, all of them do; empty, only nationwide ones. + /// + [Optional] + [JsonPropertyName("regions")] + public IEnumerable? Regions { get; set; } + + /// + /// Who can be booked in their place on those days, by id or uid, in order. + /// + [Optional] + [JsonPropertyName("delegates")] + public IEnumerable? Delegates { get; set; } + + /// + /// What happens to bookings already on a holiday. `leave` (the default) only reports them. `reassign` moves them. + /// + [Optional] + [JsonPropertyName("existing_bookings")] + public UpdateSchedulingHolidayCalendarRequestExistingBookings? ExistingBookings { get; set; } + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/sdks/dotnet/src/Coss/Scheduling/HolidayCalendars/Types/CreateSchedulingHolidayCalendarRequestExistingBookings.cs b/sdks/dotnet/src/Coss/Scheduling/HolidayCalendars/Types/CreateSchedulingHolidayCalendarRequestExistingBookings.cs new file mode 100644 index 000000000..853ca38d8 --- /dev/null +++ b/sdks/dotnet/src/Coss/Scheduling/HolidayCalendars/Types/CreateSchedulingHolidayCalendarRequestExistingBookings.cs @@ -0,0 +1,130 @@ +using Coss.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace Coss.Scheduling; + +[JsonConverter( + typeof(CreateSchedulingHolidayCalendarRequestExistingBookings.CreateSchedulingHolidayCalendarRequestExistingBookingsSerializer) +)] +[Serializable] +public readonly record struct CreateSchedulingHolidayCalendarRequestExistingBookings : IStringEnum +{ + public static readonly CreateSchedulingHolidayCalendarRequestExistingBookings Leave = new( + Values.Leave + ); + + public static readonly CreateSchedulingHolidayCalendarRequestExistingBookings Reassign = new( + Values.Reassign + ); + + public CreateSchedulingHolidayCalendarRequestExistingBookings(string value) + { + Value = value; + } + + /// + /// The string value of the enum. + /// + public string Value { get; } + + /// + /// Create a string enum with the given value. + /// + public static CreateSchedulingHolidayCalendarRequestExistingBookings FromCustom(string value) + { + return new CreateSchedulingHolidayCalendarRequestExistingBookings(value); + } + + public bool Equals(string? other) + { + return Value.Equals(other); + } + + /// + /// Returns the string value of the enum. + /// + public override string ToString() + { + return Value; + } + + public static bool operator ==( + CreateSchedulingHolidayCalendarRequestExistingBookings value1, + string value2 + ) => value1.Value.Equals(value2); + + public static bool operator !=( + CreateSchedulingHolidayCalendarRequestExistingBookings value1, + string value2 + ) => !value1.Value.Equals(value2); + + public static explicit operator string( + CreateSchedulingHolidayCalendarRequestExistingBookings value + ) => value.Value; + + public static explicit operator CreateSchedulingHolidayCalendarRequestExistingBookings( + string value + ) => new(value); + + internal class CreateSchedulingHolidayCalendarRequestExistingBookingsSerializer + : JsonConverter + { + public override CreateSchedulingHolidayCalendarRequestExistingBookings Read( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON value could not be read as a string." + ); + return new CreateSchedulingHolidayCalendarRequestExistingBookings(stringValue); + } + + public override void Write( + Utf8JsonWriter writer, + CreateSchedulingHolidayCalendarRequestExistingBookings value, + JsonSerializerOptions options + ) + { + writer.WriteStringValue(value.Value); + } + + public override CreateSchedulingHolidayCalendarRequestExistingBookings ReadAsPropertyName( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return new CreateSchedulingHolidayCalendarRequestExistingBookings(stringValue); + } + + public override void WriteAsPropertyName( + Utf8JsonWriter writer, + CreateSchedulingHolidayCalendarRequestExistingBookings value, + JsonSerializerOptions options + ) + { + writer.WritePropertyName(value.Value); + } + } + + /// + /// Constant strings for enum values + /// + [Serializable] + public static class Values + { + public const string Leave = "leave"; + + public const string Reassign = "reassign"; + } +} diff --git a/sdks/dotnet/src/Coss/Scheduling/HolidayCalendars/Types/UpdateSchedulingHolidayCalendarRequestExistingBookings.cs b/sdks/dotnet/src/Coss/Scheduling/HolidayCalendars/Types/UpdateSchedulingHolidayCalendarRequestExistingBookings.cs new file mode 100644 index 000000000..01436c81a --- /dev/null +++ b/sdks/dotnet/src/Coss/Scheduling/HolidayCalendars/Types/UpdateSchedulingHolidayCalendarRequestExistingBookings.cs @@ -0,0 +1,130 @@ +using Coss.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace Coss.Scheduling; + +[JsonConverter( + typeof(UpdateSchedulingHolidayCalendarRequestExistingBookings.UpdateSchedulingHolidayCalendarRequestExistingBookingsSerializer) +)] +[Serializable] +public readonly record struct UpdateSchedulingHolidayCalendarRequestExistingBookings : IStringEnum +{ + public static readonly UpdateSchedulingHolidayCalendarRequestExistingBookings Leave = new( + Values.Leave + ); + + public static readonly UpdateSchedulingHolidayCalendarRequestExistingBookings Reassign = new( + Values.Reassign + ); + + public UpdateSchedulingHolidayCalendarRequestExistingBookings(string value) + { + Value = value; + } + + /// + /// The string value of the enum. + /// + public string Value { get; } + + /// + /// Create a string enum with the given value. + /// + public static UpdateSchedulingHolidayCalendarRequestExistingBookings FromCustom(string value) + { + return new UpdateSchedulingHolidayCalendarRequestExistingBookings(value); + } + + public bool Equals(string? other) + { + return Value.Equals(other); + } + + /// + /// Returns the string value of the enum. + /// + public override string ToString() + { + return Value; + } + + public static bool operator ==( + UpdateSchedulingHolidayCalendarRequestExistingBookings value1, + string value2 + ) => value1.Value.Equals(value2); + + public static bool operator !=( + UpdateSchedulingHolidayCalendarRequestExistingBookings value1, + string value2 + ) => !value1.Value.Equals(value2); + + public static explicit operator string( + UpdateSchedulingHolidayCalendarRequestExistingBookings value + ) => value.Value; + + public static explicit operator UpdateSchedulingHolidayCalendarRequestExistingBookings( + string value + ) => new(value); + + internal class UpdateSchedulingHolidayCalendarRequestExistingBookingsSerializer + : JsonConverter + { + public override UpdateSchedulingHolidayCalendarRequestExistingBookings Read( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON value could not be read as a string." + ); + return new UpdateSchedulingHolidayCalendarRequestExistingBookings(stringValue); + } + + public override void Write( + Utf8JsonWriter writer, + UpdateSchedulingHolidayCalendarRequestExistingBookings value, + JsonSerializerOptions options + ) + { + writer.WriteStringValue(value.Value); + } + + public override UpdateSchedulingHolidayCalendarRequestExistingBookings ReadAsPropertyName( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return new UpdateSchedulingHolidayCalendarRequestExistingBookings(stringValue); + } + + public override void WriteAsPropertyName( + Utf8JsonWriter writer, + UpdateSchedulingHolidayCalendarRequestExistingBookings value, + JsonSerializerOptions options + ) + { + writer.WritePropertyName(value.Value); + } + } + + /// + /// Constant strings for enum values + /// + [Serializable] + public static class Values + { + public const string Leave = "leave"; + + public const string Reassign = "reassign"; + } +} diff --git a/sdks/dotnet/src/Coss/Scheduling/ISchedulingClient.cs b/sdks/dotnet/src/Coss/Scheduling/ISchedulingClient.cs index a520fdd26..655c42fa1 100644 --- a/sdks/dotnet/src/Coss/Scheduling/ISchedulingClient.cs +++ b/sdks/dotnet/src/Coss/Scheduling/ISchedulingClient.cs @@ -3,16 +3,20 @@ namespace Coss.Scheduling; public partial interface ISchedulingClient { public IHostsClient Hosts { get; } + public IBookingsClient Bookings { get; } + public IReassignmentsClient Reassignments { get; } + public IHolidayCalendarsClient HolidayCalendars { get; } + public IOutOfOfficeClient OutOfOffice { get; } public ISchedulesClient Schedules { get; } public IEventTypesClient EventTypes { get; } public ISlotsClient Slots { get; } public IAvailabilityClient Availability { get; } - public IBookingsClient Bookings { get; } public IHoldsClient Holds { get; } public ISeriesClient Series { get; } public IAttendeesClient Attendees { get; } public ICalendarsClient Calendars { get; } public ICalendarDelegationsClient CalendarDelegations { get; } + public IOauthAppsClient OauthApps { get; } public ISessionsClient Sessions { get; } public ISettingsClient Settings { get; } } diff --git a/sdks/dotnet/src/Coss/Scheduling/OauthApps/IOauthAppsClient.cs b/sdks/dotnet/src/Coss/Scheduling/OauthApps/IOauthAppsClient.cs new file mode 100644 index 000000000..322ee963f --- /dev/null +++ b/sdks/dotnet/src/Coss/Scheduling/OauthApps/IOauthAppsClient.cs @@ -0,0 +1,50 @@ +using Coss; + +namespace Coss.Scheduling; + +public partial interface IOauthAppsClient +{ + /// + /// At most one per provider, with how many connections use each. + /// + WithRawResponseTask ListAsync( + RequestOptions? options = null, + CancellationToken cancellationToken = default + ); + + /// + /// New consents in this environment use it, so the consent screen shows your brand. Connections made before it stay on coss.com's app until their host consents again. On the Scale plan and above. Secrets are never returned. + /// + WithRawResponseTask CreateAsync( + CreateOauthAppRequest request, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ); + + /// + /// Its status, what to register at the provider, and how many connections use it. + /// + WithRawResponseTask GetAsync( + GetOauthAppsRequest request, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ); + + /// + /// Refused while connections use it (`oauth_app_in_use`), since only it can refresh their access: disconnect them first. New consents go back to coss.com's app. + /// + WithRawResponseTask DeleteAsync( + DeleteOauthAppsRequest request, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ); + + /// + /// A new client secret is tried on a connection before it replaces the old one, and ends an outage if it works. Its client ID can't change: a different app needs its hosts to consent again. + /// + WithRawResponseTask UpdateAsync( + UpdateOauthAppRequest request, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ); +} diff --git a/sdks/dotnet/src/Coss/Scheduling/OauthApps/OauthAppsClient.cs b/sdks/dotnet/src/Coss/Scheduling/OauthApps/OauthAppsClient.cs new file mode 100644 index 000000000..13efc4ab5 --- /dev/null +++ b/sdks/dotnet/src/Coss/Scheduling/OauthApps/OauthAppsClient.cs @@ -0,0 +1,1055 @@ +using Coss; +using Coss.Core; +using global::System.Text.Json; + +namespace Coss.Scheduling; + +public partial class OauthAppsClient : IOauthAppsClient +{ + private readonly RawClient _client; + + internal OauthAppsClient(RawClient client) + { + _client = client; + } + + private async Task> ListAsyncCore( + RequestOptions? options = null, + CancellationToken cancellationToken = default + ) + { + var _queryString = new Coss.Core.QueryStringBuilder.Builder(capacity: 0) + .MergeAdditional(options?.AdditionalQueryParameters) + .Build(); + var _headers = await new Coss.Core.HeadersBuilder.Builder() + .Add(_client.Options.Headers) + .Add(_client.Options.AdditionalHeaders) + .Add(options?.AdditionalHeaders) + .BuildAsync() + .ConfigureAwait(false); + var response = await _client + .SendRequestAsync( + new JsonRequest + { + Method = HttpMethod.Get, + Path = "v1/scheduling/oauth_apps", + QueryString = _queryString, + Headers = _headers, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); + if (response.StatusCode is >= 200 and < 400) + { + var responseBody = await response + .Raw.Content.ReadAsStringAsync(cancellationToken) + .ConfigureAwait(false); + try + { + var responseData = JsonUtils.Deserialize(responseBody)!; + return new WithRawResponse() + { + Data = responseData, + RawResponse = new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = response.Raw.RequestMessage?.RequestUri ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + }, + }; + } + catch (JsonException e) + { + throw new CossClientApiException( + "Failed to deserialize response", + response.StatusCode, + responseBody, + e, + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = response.Raw.RequestMessage?.RequestUri ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + } + } + { + var responseBody = await response + .Raw.Content.ReadAsStringAsync(cancellationToken) + .ConfigureAwait(false); + try + { + switch (response.StatusCode) + { + case 400: + throw new BadRequestError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 401: + throw new UnauthorizedError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 403: + throw new ForbiddenError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 429: + throw new TooManyRequestsError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 500: + throw new InternalServerError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 503: + throw new ServiceUnavailableError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + } + } + catch (JsonException) + { + // unable to map error response, throwing generic error + } + throw new CossClientApiException( + $"Error with status code {response.StatusCode}", + response.StatusCode, + responseBody, + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = response.Raw.RequestMessage?.RequestUri ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + } + } + + private async Task> CreateAsyncCore( + CreateOauthAppRequest request, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ) + { + var _queryString = new Coss.Core.QueryStringBuilder.Builder(capacity: 0) + .MergeAdditional(options?.AdditionalQueryParameters) + .Build(); + var _headers = await new Coss.Core.HeadersBuilder.Builder() + .Add(_client.Options.Headers) + .Add(_client.Options.AdditionalHeaders) + .AddIdempotencyHeader() + .Add(options?.AdditionalHeaders) + .BuildAsync() + .ConfigureAwait(false); + var response = await _client + .SendRequestAsync( + new JsonRequest + { + Method = HttpMethod.Post, + Path = "v1/scheduling/oauth_apps", + Body = request, + QueryString = _queryString, + Headers = _headers, + Options = options, + RetriesDisabled = true, + }, + cancellationToken + ) + .ConfigureAwait(false); + if (response.StatusCode is >= 200 and < 400) + { + var responseBody = await response + .Raw.Content.ReadAsStringAsync(cancellationToken) + .ConfigureAwait(false); + try + { + var responseData = JsonUtils.Deserialize(responseBody)!; + return new WithRawResponse() + { + Data = responseData, + RawResponse = new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = response.Raw.RequestMessage?.RequestUri ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + }, + }; + } + catch (JsonException e) + { + throw new CossClientApiException( + "Failed to deserialize response", + response.StatusCode, + responseBody, + e, + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = response.Raw.RequestMessage?.RequestUri ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + } + } + { + var responseBody = await response + .Raw.Content.ReadAsStringAsync(cancellationToken) + .ConfigureAwait(false); + try + { + switch (response.StatusCode) + { + case 400: + throw new BadRequestError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 401: + throw new UnauthorizedError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 402: + throw new PaymentRequiredError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 403: + throw new ForbiddenError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 415: + throw new UnsupportedMediaTypeError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 422: + throw new UnprocessableEntityError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 429: + throw new TooManyRequestsError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 500: + throw new InternalServerError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 503: + throw new ServiceUnavailableError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + } + } + catch (JsonException) + { + // unable to map error response, throwing generic error + } + throw new CossClientApiException( + $"Error with status code {response.StatusCode}", + response.StatusCode, + responseBody, + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = response.Raw.RequestMessage?.RequestUri ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + } + } + + private async Task> GetAsyncCore( + GetOauthAppsRequest request, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ) + { + var _queryString = new Coss.Core.QueryStringBuilder.Builder(capacity: 0) + .MergeAdditional(options?.AdditionalQueryParameters) + .Build(); + var _headers = await new Coss.Core.HeadersBuilder.Builder() + .Add(_client.Options.Headers) + .Add(_client.Options.AdditionalHeaders) + .Add(options?.AdditionalHeaders) + .BuildAsync() + .ConfigureAwait(false); + var response = await _client + .SendRequestAsync( + new JsonRequest + { + Method = HttpMethod.Get, + Path = string.Format( + "v1/scheduling/oauth_apps/{0}", + ValueConvert.ToPathParameterString(request.Id) + ), + QueryString = _queryString, + Headers = _headers, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); + if (response.StatusCode is >= 200 and < 400) + { + var responseBody = await response + .Raw.Content.ReadAsStringAsync(cancellationToken) + .ConfigureAwait(false); + try + { + var responseData = JsonUtils.Deserialize(responseBody)!; + return new WithRawResponse() + { + Data = responseData, + RawResponse = new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = response.Raw.RequestMessage?.RequestUri ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + }, + }; + } + catch (JsonException e) + { + throw new CossClientApiException( + "Failed to deserialize response", + response.StatusCode, + responseBody, + e, + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = response.Raw.RequestMessage?.RequestUri ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + } + } + { + var responseBody = await response + .Raw.Content.ReadAsStringAsync(cancellationToken) + .ConfigureAwait(false); + try + { + switch (response.StatusCode) + { + case 400: + throw new BadRequestError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 401: + throw new UnauthorizedError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 403: + throw new ForbiddenError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 404: + throw new NotFoundError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 429: + throw new TooManyRequestsError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 500: + throw new InternalServerError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 503: + throw new ServiceUnavailableError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + } + } + catch (JsonException) + { + // unable to map error response, throwing generic error + } + throw new CossClientApiException( + $"Error with status code {response.StatusCode}", + response.StatusCode, + responseBody, + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = response.Raw.RequestMessage?.RequestUri ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + } + } + + private async Task> DeleteAsyncCore( + DeleteOauthAppsRequest request, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ) + { + var _queryString = new Coss.Core.QueryStringBuilder.Builder(capacity: 0) + .MergeAdditional(options?.AdditionalQueryParameters) + .Build(); + var _headers = await new Coss.Core.HeadersBuilder.Builder() + .Add(_client.Options.Headers) + .Add(_client.Options.AdditionalHeaders) + .Add(options?.AdditionalHeaders) + .BuildAsync() + .ConfigureAwait(false); + var response = await _client + .SendRequestAsync( + new JsonRequest + { + Method = HttpMethod.Delete, + Path = string.Format( + "v1/scheduling/oauth_apps/{0}", + ValueConvert.ToPathParameterString(request.Id) + ), + QueryString = _queryString, + Headers = _headers, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); + if (response.StatusCode is >= 200 and < 400) + { + var responseBody = await response + .Raw.Content.ReadAsStringAsync(cancellationToken) + .ConfigureAwait(false); + try + { + var responseData = JsonUtils.Deserialize(responseBody)!; + return new WithRawResponse() + { + Data = responseData, + RawResponse = new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = response.Raw.RequestMessage?.RequestUri ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + }, + }; + } + catch (JsonException e) + { + throw new CossClientApiException( + "Failed to deserialize response", + response.StatusCode, + responseBody, + e, + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = response.Raw.RequestMessage?.RequestUri ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + } + } + { + var responseBody = await response + .Raw.Content.ReadAsStringAsync(cancellationToken) + .ConfigureAwait(false); + try + { + switch (response.StatusCode) + { + case 400: + throw new BadRequestError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 401: + throw new UnauthorizedError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 403: + throw new ForbiddenError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 404: + throw new NotFoundError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 422: + throw new UnprocessableEntityError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 429: + throw new TooManyRequestsError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 500: + throw new InternalServerError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 503: + throw new ServiceUnavailableError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + } + } + catch (JsonException) + { + // unable to map error response, throwing generic error + } + throw new CossClientApiException( + $"Error with status code {response.StatusCode}", + response.StatusCode, + responseBody, + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = response.Raw.RequestMessage?.RequestUri ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + } + } + + private async Task> UpdateAsyncCore( + UpdateOauthAppRequest request, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ) + { + var _queryString = new Coss.Core.QueryStringBuilder.Builder(capacity: 0) + .MergeAdditional(options?.AdditionalQueryParameters) + .Build(); + var _headers = await new Coss.Core.HeadersBuilder.Builder() + .Add(_client.Options.Headers) + .Add(_client.Options.AdditionalHeaders) + .Add(options?.AdditionalHeaders) + .BuildAsync() + .ConfigureAwait(false); + var response = await _client + .SendRequestAsync( + new JsonRequest + { + Method = HttpMethodExtensions.Patch, + Path = string.Format( + "v1/scheduling/oauth_apps/{0}", + ValueConvert.ToPathParameterString(request.Id) + ), + Body = request, + QueryString = _queryString, + Headers = _headers, + ContentType = "application/json", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); + if (response.StatusCode is >= 200 and < 400) + { + var responseBody = await response + .Raw.Content.ReadAsStringAsync(cancellationToken) + .ConfigureAwait(false); + try + { + var responseData = JsonUtils.Deserialize(responseBody)!; + return new WithRawResponse() + { + Data = responseData, + RawResponse = new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = response.Raw.RequestMessage?.RequestUri ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + }, + }; + } + catch (JsonException e) + { + throw new CossClientApiException( + "Failed to deserialize response", + response.StatusCode, + responseBody, + e, + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = response.Raw.RequestMessage?.RequestUri ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + } + } + { + var responseBody = await response + .Raw.Content.ReadAsStringAsync(cancellationToken) + .ConfigureAwait(false); + try + { + switch (response.StatusCode) + { + case 400: + throw new BadRequestError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 401: + throw new UnauthorizedError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 403: + throw new ForbiddenError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 404: + throw new NotFoundError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 415: + throw new UnsupportedMediaTypeError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 422: + throw new UnprocessableEntityError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 429: + throw new TooManyRequestsError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 500: + throw new InternalServerError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 503: + throw new ServiceUnavailableError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + } + } + catch (JsonException) + { + // unable to map error response, throwing generic error + } + throw new CossClientApiException( + $"Error with status code {response.StatusCode}", + response.StatusCode, + responseBody, + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = response.Raw.RequestMessage?.RequestUri ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + } + } + + /// + /// At most one per provider, with how many connections use each. + /// + /// + /// await client.Scheduling.OauthApps.ListAsync(); + /// + public WithRawResponseTask ListAsync( + RequestOptions? options = null, + CancellationToken cancellationToken = default + ) + { + return new WithRawResponseTask( + ListAsyncCore(options, cancellationToken) + ); + } + + /// + /// New consents in this environment use it, so the consent screen shows your brand. Connections made before it stay on coss.com's app until their host consents again. On the Scale plan and above. Secrets are never returned. + /// + /// + /// await client.Scheduling.OauthApps.CreateAsync( + /// new CreateOauthAppRequest( + /// new CreateOauthAppRequest.Google( + /// new CreateOauthAppRequestGoogle + /// { + /// ClientId = "client_id", + /// ClientSecret = "client_secret", + /// } + /// ) + /// ) + /// ); + /// + public WithRawResponseTask CreateAsync( + CreateOauthAppRequest request, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ) + { + return new WithRawResponseTask( + CreateAsyncCore(request, options, cancellationToken) + ); + } + + /// + /// Its status, what to register at the provider, and how many connections use it. + /// + /// + /// await client.Scheduling.OauthApps.GetAsync( + /// new GetOauthAppsRequest { Id = "calapp_01kd2m9a0b1c2d3e4f5g6h7j8m" } + /// ); + /// + public WithRawResponseTask GetAsync( + GetOauthAppsRequest request, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ) + { + return new WithRawResponseTask( + GetAsyncCore(request, options, cancellationToken) + ); + } + + /// + /// Refused while connections use it (`oauth_app_in_use`), since only it can refresh their access: disconnect them first. New consents go back to coss.com's app. + /// + /// + /// await client.Scheduling.OauthApps.DeleteAsync( + /// new DeleteOauthAppsRequest { Id = "calapp_01kd2m9a0b1c2d3e4f5g6h7j8m" } + /// ); + /// + public WithRawResponseTask DeleteAsync( + DeleteOauthAppsRequest request, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ) + { + return new WithRawResponseTask( + DeleteAsyncCore(request, options, cancellationToken) + ); + } + + /// + /// A new client secret is tried on a connection before it replaces the old one, and ends an outage if it works. Its client ID can't change: a different app needs its hosts to consent again. + /// + /// + /// await client.Scheduling.OauthApps.UpdateAsync( + /// new UpdateOauthAppRequest + /// { + /// Id = "calapp_01kd2m9a0b1c2d3e4f5g6h7j8m", + /// ClientSecret = "GOCSPX-abcdefghijklmnopqrstuvwxyz", + /// } + /// ); + /// + public WithRawResponseTask UpdateAsync( + UpdateOauthAppRequest request, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ) + { + return new WithRawResponseTask( + UpdateAsyncCore(request, options, cancellationToken) + ); + } +} diff --git a/sdks/dotnet/src/Coss/Scheduling/OauthApps/Requests/DeleteOauthAppsRequest.cs b/sdks/dotnet/src/Coss/Scheduling/OauthApps/Requests/DeleteOauthAppsRequest.cs new file mode 100644 index 000000000..587b221c8 --- /dev/null +++ b/sdks/dotnet/src/Coss/Scheduling/OauthApps/Requests/DeleteOauthAppsRequest.cs @@ -0,0 +1,20 @@ +using Coss.Core; +using global::System.Text.Json.Serialization; + +namespace Coss.Scheduling; + +[Serializable] +public record DeleteOauthAppsRequest +{ + /// + /// The OAuth app's id. + /// + [JsonIgnore] + public required string Id { get; set; } + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/sdks/dotnet/src/Coss/Scheduling/OauthApps/Requests/GetOauthAppsRequest.cs b/sdks/dotnet/src/Coss/Scheduling/OauthApps/Requests/GetOauthAppsRequest.cs new file mode 100644 index 000000000..c2aec5ff9 --- /dev/null +++ b/sdks/dotnet/src/Coss/Scheduling/OauthApps/Requests/GetOauthAppsRequest.cs @@ -0,0 +1,20 @@ +using Coss.Core; +using global::System.Text.Json.Serialization; + +namespace Coss.Scheduling; + +[Serializable] +public record GetOauthAppsRequest +{ + /// + /// The OAuth app's id. + /// + [JsonIgnore] + public required string Id { get; set; } + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/sdks/dotnet/src/Coss/Scheduling/OauthApps/Requests/UpdateOauthAppRequest.cs b/sdks/dotnet/src/Coss/Scheduling/OauthApps/Requests/UpdateOauthAppRequest.cs new file mode 100644 index 000000000..489eb9184 --- /dev/null +++ b/sdks/dotnet/src/Coss/Scheduling/OauthApps/Requests/UpdateOauthAppRequest.cs @@ -0,0 +1,62 @@ +using Coss.Core; +using global::System.Text.Json.Serialization; + +namespace Coss.Scheduling; + +[Serializable] +public record UpdateOauthAppRequest +{ + /// + /// The OAuth app's id. + /// + [JsonIgnore] + public required string Id { get; set; } + + /// + /// A new client secret. It's tried on a connection before it replaces the old one. + /// + [Optional] + [JsonPropertyName("client_secret")] + public string? ClientSecret { get; set; } + + /// + /// The Directory (tenant) ID, for an app that's only for your own tenant. Leave it out for a multi-tenant app. + /// + [Nullable, Optional] + [JsonPropertyName("tenant_id")] + public Optional TenantId { get; set; } + + /// + /// The Secret Token of your Zoom app, which signs its events at `zoom_event_url`. Never returned. + /// + [Nullable, Optional] + [JsonPropertyName("webhook_secret")] + public Optional WebhookSecret { get; set; } + + /// + /// A page on your own domain, registered with the provider, that forwards `code` and `state` to `coss_callback_url`. Google requires this for an external app, since it has to verify the redirect's domain as yours. Leave it out to use `coss_callback_url` directly. + /// + [Nullable, Optional] + [JsonPropertyName("redirect_uri")] + public Optional RedirectUri { get; set; } + + /// + /// Where the browser lands after a consent that didn't name a `return_url`, with `coss_calendar` set to `connected`, `denied` or `invalid`. Leave it out for a plain page saying what happened. + /// + [Nullable, Optional] + [JsonPropertyName("completion_url")] + public Optional CompletionUrl { get; set; } + + /// + /// When the client secret expires. Owners and admins are warned 14 days before. + /// + [Nullable, Optional] + [JsonPropertyName("secret_expires_at")] + public Optional SecretExpiresAt { get; set; } + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/sdks/dotnet/src/Coss/Scheduling/OutOfOffice/IOutOfOfficeClient.cs b/sdks/dotnet/src/Coss/Scheduling/OutOfOffice/IOutOfOfficeClient.cs new file mode 100644 index 000000000..3682d7582 --- /dev/null +++ b/sdks/dotnet/src/Coss/Scheduling/OutOfOffice/IOutOfOfficeClient.cs @@ -0,0 +1,69 @@ +using Coss; + +namespace Coss.Scheduling; + +public partial interface IOutOfOfficeClient +{ + /// + /// The environment's entries, newest first. + /// + WithRawResponseTask ListAsync( + ListOutOfOfficeRequest request, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ); + + /// + /// Marks one host, a list of hosts or everyone matching some attributes as away, for part of a day or for whole dates. They aren't offered during it. Existing bookings stay as they are: list them with the entry's conflicts. + /// + WithRawResponseTask CreateAsync( + CreateSchedulingOutOfOfficeRequest request, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ); + + /// + /// One entry. + /// + WithRawResponseTask GetAsync( + GetOutOfOfficeRequest request, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ); + + /// + /// The host can be booked in that time again, and any calendar event for it goes. + /// + WithRawResponseTask RemoveAsync( + RemoveOutOfOfficeRequest request, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ); + + /// + /// Changes what's given. An entry stays with its host. + /// + WithRawResponseTask UpdateAsync( + UpdateSchedulingOutOfOfficeRequest request, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ); + + /// + /// For syncing from a system of record such as an HR tool: send what it says, as often as you like, and there's one entry for it. Give every field you want to keep. + /// + WithRawResponseTask PutAsync( + PutSchedulingOutOfOfficeRequest request, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ); + + /// + /// Live bookings of the host that fall in the entry, soonest first. Entries never change them. + /// + WithRawResponseTask ConflictsAsync( + ConflictsOutOfOfficeRequest request, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ); +} diff --git a/sdks/dotnet/src/Coss/Scheduling/OutOfOffice/OutOfOfficeClient.cs b/sdks/dotnet/src/Coss/Scheduling/OutOfOffice/OutOfOfficeClient.cs new file mode 100644 index 000000000..f6bc8b964 --- /dev/null +++ b/sdks/dotnet/src/Coss/Scheduling/OutOfOffice/OutOfOfficeClient.cs @@ -0,0 +1,1525 @@ +using Coss; +using Coss.Core; +using global::System.Text.Json; + +namespace Coss.Scheduling; + +public partial class OutOfOfficeClient : IOutOfOfficeClient +{ + private readonly RawClient _client; + + internal OutOfOfficeClient(RawClient client) + { + _client = client; + } + + private async Task> ListAsyncCore( + ListOutOfOfficeRequest request, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ) + { + var _queryString = new Coss.Core.QueryStringBuilder.Builder(capacity: 6) + .Add("limit", request.Limit) + .Add("after", request.After) + .Add("host", request.Host) + .Add("start_after", request.StartAfter) + .Add("start_before", request.StartBefore) + .Add("group", request.Group) + .MergeAdditional(options?.AdditionalQueryParameters) + .Build(); + var _headers = await new Coss.Core.HeadersBuilder.Builder() + .Add(_client.Options.Headers) + .Add(_client.Options.AdditionalHeaders) + .Add(options?.AdditionalHeaders) + .BuildAsync() + .ConfigureAwait(false); + var response = await _client + .SendRequestAsync( + new JsonRequest + { + Method = HttpMethod.Get, + Path = "v1/scheduling/out_of_office", + QueryString = _queryString, + Headers = _headers, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); + if (response.StatusCode is >= 200 and < 400) + { + var responseBody = await response + .Raw.Content.ReadAsStringAsync(cancellationToken) + .ConfigureAwait(false); + try + { + var responseData = JsonUtils.Deserialize(responseBody)!; + return new WithRawResponse() + { + Data = responseData, + RawResponse = new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = response.Raw.RequestMessage?.RequestUri ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + }, + }; + } + catch (JsonException e) + { + throw new CossClientApiException( + "Failed to deserialize response", + response.StatusCode, + responseBody, + e, + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = response.Raw.RequestMessage?.RequestUri ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + } + } + { + var responseBody = await response + .Raw.Content.ReadAsStringAsync(cancellationToken) + .ConfigureAwait(false); + try + { + switch (response.StatusCode) + { + case 400: + throw new BadRequestError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 401: + throw new UnauthorizedError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 403: + throw new ForbiddenError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 404: + throw new NotFoundError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 422: + throw new UnprocessableEntityError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 429: + throw new TooManyRequestsError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 500: + throw new InternalServerError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 503: + throw new ServiceUnavailableError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + } + } + catch (JsonException) + { + // unable to map error response, throwing generic error + } + throw new CossClientApiException( + $"Error with status code {response.StatusCode}", + response.StatusCode, + responseBody, + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = response.Raw.RequestMessage?.RequestUri ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + } + } + + private async Task> CreateAsyncCore( + CreateSchedulingOutOfOfficeRequest request, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ) + { + var _queryString = new Coss.Core.QueryStringBuilder.Builder(capacity: 0) + .MergeAdditional(options?.AdditionalQueryParameters) + .Build(); + var _headers = await new Coss.Core.HeadersBuilder.Builder() + .Add(_client.Options.Headers) + .Add(_client.Options.AdditionalHeaders) + .AddIdempotencyHeader() + .Add(options?.AdditionalHeaders) + .BuildAsync() + .ConfigureAwait(false); + var response = await _client + .SendRequestAsync( + new JsonRequest + { + Method = HttpMethod.Post, + Path = "v1/scheduling/out_of_office", + Body = request, + QueryString = _queryString, + Headers = _headers, + ContentType = "application/json", + Options = options, + RetriesDisabled = true, + }, + cancellationToken + ) + .ConfigureAwait(false); + if (response.StatusCode is >= 200 and < 400) + { + var responseBody = await response + .Raw.Content.ReadAsStringAsync(cancellationToken) + .ConfigureAwait(false); + try + { + var responseData = JsonUtils.Deserialize(responseBody)!; + return new WithRawResponse() + { + Data = responseData, + RawResponse = new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = response.Raw.RequestMessage?.RequestUri ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + }, + }; + } + catch (JsonException e) + { + throw new CossClientApiException( + "Failed to deserialize response", + response.StatusCode, + responseBody, + e, + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = response.Raw.RequestMessage?.RequestUri ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + } + } + { + var responseBody = await response + .Raw.Content.ReadAsStringAsync(cancellationToken) + .ConfigureAwait(false); + try + { + switch (response.StatusCode) + { + case 400: + throw new BadRequestError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 401: + throw new UnauthorizedError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 403: + throw new ForbiddenError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 404: + throw new NotFoundError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 415: + throw new UnsupportedMediaTypeError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 422: + throw new UnprocessableEntityError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 429: + throw new TooManyRequestsError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 500: + throw new InternalServerError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 503: + throw new ServiceUnavailableError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + } + } + catch (JsonException) + { + // unable to map error response, throwing generic error + } + throw new CossClientApiException( + $"Error with status code {response.StatusCode}", + response.StatusCode, + responseBody, + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = response.Raw.RequestMessage?.RequestUri ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + } + } + + private async Task> GetAsyncCore( + GetOutOfOfficeRequest request, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ) + { + var _queryString = new Coss.Core.QueryStringBuilder.Builder(capacity: 0) + .MergeAdditional(options?.AdditionalQueryParameters) + .Build(); + var _headers = await new Coss.Core.HeadersBuilder.Builder() + .Add(_client.Options.Headers) + .Add(_client.Options.AdditionalHeaders) + .Add(options?.AdditionalHeaders) + .BuildAsync() + .ConfigureAwait(false); + var response = await _client + .SendRequestAsync( + new JsonRequest + { + Method = HttpMethod.Get, + Path = string.Format( + "v1/scheduling/out_of_office/{0}", + ValueConvert.ToPathParameterString(request.Id) + ), + QueryString = _queryString, + Headers = _headers, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); + if (response.StatusCode is >= 200 and < 400) + { + var responseBody = await response + .Raw.Content.ReadAsStringAsync(cancellationToken) + .ConfigureAwait(false); + try + { + var responseData = JsonUtils.Deserialize(responseBody)!; + return new WithRawResponse() + { + Data = responseData, + RawResponse = new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = response.Raw.RequestMessage?.RequestUri ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + }, + }; + } + catch (JsonException e) + { + throw new CossClientApiException( + "Failed to deserialize response", + response.StatusCode, + responseBody, + e, + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = response.Raw.RequestMessage?.RequestUri ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + } + } + { + var responseBody = await response + .Raw.Content.ReadAsStringAsync(cancellationToken) + .ConfigureAwait(false); + try + { + switch (response.StatusCode) + { + case 400: + throw new BadRequestError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 401: + throw new UnauthorizedError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 403: + throw new ForbiddenError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 404: + throw new NotFoundError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 429: + throw new TooManyRequestsError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 500: + throw new InternalServerError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 503: + throw new ServiceUnavailableError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + } + } + catch (JsonException) + { + // unable to map error response, throwing generic error + } + throw new CossClientApiException( + $"Error with status code {response.StatusCode}", + response.StatusCode, + responseBody, + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = response.Raw.RequestMessage?.RequestUri ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + } + } + + private async Task> RemoveAsyncCore( + RemoveOutOfOfficeRequest request, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ) + { + var _queryString = new Coss.Core.QueryStringBuilder.Builder(capacity: 0) + .MergeAdditional(options?.AdditionalQueryParameters) + .Build(); + var _headers = await new Coss.Core.HeadersBuilder.Builder() + .Add(_client.Options.Headers) + .Add(_client.Options.AdditionalHeaders) + .Add(options?.AdditionalHeaders) + .BuildAsync() + .ConfigureAwait(false); + var response = await _client + .SendRequestAsync( + new JsonRequest + { + Method = HttpMethod.Delete, + Path = string.Format( + "v1/scheduling/out_of_office/{0}", + ValueConvert.ToPathParameterString(request.Id) + ), + QueryString = _queryString, + Headers = _headers, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); + if (response.StatusCode is >= 200 and < 400) + { + var responseBody = await response + .Raw.Content.ReadAsStringAsync(cancellationToken) + .ConfigureAwait(false); + try + { + var responseData = JsonUtils.Deserialize( + responseBody + )!; + return new WithRawResponse() + { + Data = responseData, + RawResponse = new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = response.Raw.RequestMessage?.RequestUri ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + }, + }; + } + catch (JsonException e) + { + throw new CossClientApiException( + "Failed to deserialize response", + response.StatusCode, + responseBody, + e, + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = response.Raw.RequestMessage?.RequestUri ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + } + } + { + var responseBody = await response + .Raw.Content.ReadAsStringAsync(cancellationToken) + .ConfigureAwait(false); + try + { + switch (response.StatusCode) + { + case 400: + throw new BadRequestError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 401: + throw new UnauthorizedError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 403: + throw new ForbiddenError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 404: + throw new NotFoundError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 429: + throw new TooManyRequestsError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 500: + throw new InternalServerError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 503: + throw new ServiceUnavailableError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + } + } + catch (JsonException) + { + // unable to map error response, throwing generic error + } + throw new CossClientApiException( + $"Error with status code {response.StatusCode}", + response.StatusCode, + responseBody, + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = response.Raw.RequestMessage?.RequestUri ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + } + } + + private async Task> UpdateAsyncCore( + UpdateSchedulingOutOfOfficeRequest request, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ) + { + var _queryString = new Coss.Core.QueryStringBuilder.Builder(capacity: 0) + .MergeAdditional(options?.AdditionalQueryParameters) + .Build(); + var _headers = await new Coss.Core.HeadersBuilder.Builder() + .Add(_client.Options.Headers) + .Add(_client.Options.AdditionalHeaders) + .Add(options?.AdditionalHeaders) + .BuildAsync() + .ConfigureAwait(false); + var response = await _client + .SendRequestAsync( + new JsonRequest + { + Method = HttpMethodExtensions.Patch, + Path = string.Format( + "v1/scheduling/out_of_office/{0}", + ValueConvert.ToPathParameterString(request.Id) + ), + Body = request, + QueryString = _queryString, + Headers = _headers, + ContentType = "application/json", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); + if (response.StatusCode is >= 200 and < 400) + { + var responseBody = await response + .Raw.Content.ReadAsStringAsync(cancellationToken) + .ConfigureAwait(false); + try + { + var responseData = JsonUtils.Deserialize(responseBody)!; + return new WithRawResponse() + { + Data = responseData, + RawResponse = new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = response.Raw.RequestMessage?.RequestUri ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + }, + }; + } + catch (JsonException e) + { + throw new CossClientApiException( + "Failed to deserialize response", + response.StatusCode, + responseBody, + e, + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = response.Raw.RequestMessage?.RequestUri ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + } + } + { + var responseBody = await response + .Raw.Content.ReadAsStringAsync(cancellationToken) + .ConfigureAwait(false); + try + { + switch (response.StatusCode) + { + case 400: + throw new BadRequestError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 401: + throw new UnauthorizedError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 403: + throw new ForbiddenError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 404: + throw new NotFoundError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 415: + throw new UnsupportedMediaTypeError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 422: + throw new UnprocessableEntityError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 429: + throw new TooManyRequestsError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 500: + throw new InternalServerError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 503: + throw new ServiceUnavailableError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + } + } + catch (JsonException) + { + // unable to map error response, throwing generic error + } + throw new CossClientApiException( + $"Error with status code {response.StatusCode}", + response.StatusCode, + responseBody, + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = response.Raw.RequestMessage?.RequestUri ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + } + } + + private async Task> PutAsyncCore( + PutSchedulingOutOfOfficeRequest request, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ) + { + var _queryString = new Coss.Core.QueryStringBuilder.Builder(capacity: 0) + .MergeAdditional(options?.AdditionalQueryParameters) + .Build(); + var _headers = await new Coss.Core.HeadersBuilder.Builder() + .Add(_client.Options.Headers) + .Add(_client.Options.AdditionalHeaders) + .Add(options?.AdditionalHeaders) + .BuildAsync() + .ConfigureAwait(false); + var response = await _client + .SendRequestAsync( + new JsonRequest + { + Method = HttpMethod.Put, + Path = string.Format( + "v1/scheduling/out_of_office/by_external_id/{0}", + ValueConvert.ToPathParameterString(request.ExternalId) + ), + Body = request, + QueryString = _queryString, + Headers = _headers, + ContentType = "application/json", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); + if (response.StatusCode is >= 200 and < 400) + { + var responseBody = await response + .Raw.Content.ReadAsStringAsync(cancellationToken) + .ConfigureAwait(false); + try + { + var responseData = JsonUtils.Deserialize(responseBody)!; + return new WithRawResponse() + { + Data = responseData, + RawResponse = new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = response.Raw.RequestMessage?.RequestUri ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + }, + }; + } + catch (JsonException e) + { + throw new CossClientApiException( + "Failed to deserialize response", + response.StatusCode, + responseBody, + e, + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = response.Raw.RequestMessage?.RequestUri ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + } + } + { + var responseBody = await response + .Raw.Content.ReadAsStringAsync(cancellationToken) + .ConfigureAwait(false); + try + { + switch (response.StatusCode) + { + case 400: + throw new BadRequestError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 401: + throw new UnauthorizedError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 403: + throw new ForbiddenError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 404: + throw new NotFoundError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 415: + throw new UnsupportedMediaTypeError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 422: + throw new UnprocessableEntityError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 429: + throw new TooManyRequestsError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 500: + throw new InternalServerError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 503: + throw new ServiceUnavailableError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + } + } + catch (JsonException) + { + // unable to map error response, throwing generic error + } + throw new CossClientApiException( + $"Error with status code {response.StatusCode}", + response.StatusCode, + responseBody, + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = response.Raw.RequestMessage?.RequestUri ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + } + } + + private async Task> ConflictsAsyncCore( + ConflictsOutOfOfficeRequest request, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ) + { + var _queryString = new Coss.Core.QueryStringBuilder.Builder(capacity: 1) + .Add("limit", request.Limit) + .MergeAdditional(options?.AdditionalQueryParameters) + .Build(); + var _headers = await new Coss.Core.HeadersBuilder.Builder() + .Add(_client.Options.Headers) + .Add(_client.Options.AdditionalHeaders) + .Add(options?.AdditionalHeaders) + .BuildAsync() + .ConfigureAwait(false); + var response = await _client + .SendRequestAsync( + new JsonRequest + { + Method = HttpMethod.Get, + Path = string.Format( + "v1/scheduling/out_of_office/{0}/conflicts", + ValueConvert.ToPathParameterString(request.Id) + ), + QueryString = _queryString, + Headers = _headers, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); + if (response.StatusCode is >= 200 and < 400) + { + var responseBody = await response + .Raw.Content.ReadAsStringAsync(cancellationToken) + .ConfigureAwait(false); + try + { + var responseData = JsonUtils.Deserialize( + responseBody + )!; + return new WithRawResponse() + { + Data = responseData, + RawResponse = new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = response.Raw.RequestMessage?.RequestUri ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + }, + }; + } + catch (JsonException e) + { + throw new CossClientApiException( + "Failed to deserialize response", + response.StatusCode, + responseBody, + e, + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = response.Raw.RequestMessage?.RequestUri ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + } + } + { + var responseBody = await response + .Raw.Content.ReadAsStringAsync(cancellationToken) + .ConfigureAwait(false); + try + { + switch (response.StatusCode) + { + case 400: + throw new BadRequestError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 401: + throw new UnauthorizedError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 403: + throw new ForbiddenError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 404: + throw new NotFoundError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 422: + throw new UnprocessableEntityError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 429: + throw new TooManyRequestsError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 500: + throw new InternalServerError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 503: + throw new ServiceUnavailableError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + } + } + catch (JsonException) + { + // unable to map error response, throwing generic error + } + throw new CossClientApiException( + $"Error with status code {response.StatusCode}", + response.StatusCode, + responseBody, + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = response.Raw.RequestMessage?.RequestUri ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + } + } + + /// + /// The environment's entries, newest first. + /// + /// + /// await client.Scheduling.OutOfOffice.ListAsync( + /// new ListOutOfOfficeRequest + /// { + /// StartAfter = "2027-01-04T15:00:00.000Z", + /// StartBefore = "2027-01-04T15:00:00.000Z", + /// } + /// ); + /// + public WithRawResponseTask ListAsync( + ListOutOfOfficeRequest request, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ) + { + return new WithRawResponseTask( + ListAsyncCore(request, options, cancellationToken) + ); + } + + /// + /// Marks one host, a list of hosts or everyone matching some attributes as away, for part of a day or for whole dates. They aren't offered during it. Existing bookings stay as they are: list them with the entry's conflicts. + /// + /// + /// await client.Scheduling.OutOfOffice.CreateAsync( + /// new CreateSchedulingOutOfOfficeRequest + /// { + /// Host = "doctor_482", + /// StartDate = "2027-08-02", + /// EndDate = "2027-08-13", + /// Reason = "vacation", + /// PublicMessage = "Back on the 16th.", + /// } + /// ); + /// + public WithRawResponseTask CreateAsync( + CreateSchedulingOutOfOfficeRequest request, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ) + { + return new WithRawResponseTask( + CreateAsyncCore(request, options, cancellationToken) + ); + } + + /// + /// One entry. + /// + /// + /// await client.Scheduling.OutOfOffice.GetAsync( + /// new GetOutOfOfficeRequest { Id = "ooo_01kd2m9a0b1c2d3e4f5g6h7j8m" } + /// ); + /// + public WithRawResponseTask GetAsync( + GetOutOfOfficeRequest request, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ) + { + return new WithRawResponseTask( + GetAsyncCore(request, options, cancellationToken) + ); + } + + /// + /// The host can be booked in that time again, and any calendar event for it goes. + /// + /// + /// await client.Scheduling.OutOfOffice.RemoveAsync( + /// new RemoveOutOfOfficeRequest { Id = "ooo_01kd2m9a0b1c2d3e4f5g6h7j8m" } + /// ); + /// + public WithRawResponseTask RemoveAsync( + RemoveOutOfOfficeRequest request, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ) + { + return new WithRawResponseTask( + RemoveAsyncCore(request, options, cancellationToken) + ); + } + + /// + /// Changes what's given. An entry stays with its host. + /// + /// + /// await client.Scheduling.OutOfOffice.UpdateAsync( + /// new UpdateSchedulingOutOfOfficeRequest + /// { + /// Id = "ooo_01kd2m9a0b1c2d3e4f5g6h7j8m", + /// EndDate = "2027-08-20", + /// } + /// ); + /// + public WithRawResponseTask UpdateAsync( + UpdateSchedulingOutOfOfficeRequest request, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ) + { + return new WithRawResponseTask( + UpdateAsyncCore(request, options, cancellationToken) + ); + } + + /// + /// For syncing from a system of record such as an HR tool: send what it says, as often as you like, and there's one entry for it. Give every field you want to keep. + /// + /// + /// await client.Scheduling.OutOfOffice.PutAsync( + /// new PutSchedulingOutOfOfficeRequest + /// { + /// ExternalId = "hr_leave_4471", + /// Host = "doctor_482", + /// StartDate = "2027-08-02", + /// EndDate = "2027-08-13", + /// Reason = "vacation", + /// } + /// ); + /// + public WithRawResponseTask PutAsync( + PutSchedulingOutOfOfficeRequest request, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ) + { + return new WithRawResponseTask( + PutAsyncCore(request, options, cancellationToken) + ); + } + + /// + /// Live bookings of the host that fall in the entry, soonest first. Entries never change them. + /// + /// + /// await client.Scheduling.OutOfOffice.ConflictsAsync( + /// new ConflictsOutOfOfficeRequest { Id = "ooo_01kd2m9a0b1c2d3e4f5g6h7j8m" } + /// ); + /// + public WithRawResponseTask ConflictsAsync( + ConflictsOutOfOfficeRequest request, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ) + { + return new WithRawResponseTask( + ConflictsAsyncCore(request, options, cancellationToken) + ); + } +} diff --git a/sdks/dotnet/src/Coss/Scheduling/OutOfOffice/Requests/ConflictsOutOfOfficeRequest.cs b/sdks/dotnet/src/Coss/Scheduling/OutOfOffice/Requests/ConflictsOutOfOfficeRequest.cs new file mode 100644 index 000000000..d54087eb5 --- /dev/null +++ b/sdks/dotnet/src/Coss/Scheduling/OutOfOffice/Requests/ConflictsOutOfOfficeRequest.cs @@ -0,0 +1,23 @@ +using Coss.Core; +using global::System.Text.Json.Serialization; + +namespace Coss.Scheduling; + +[Serializable] +public record ConflictsOutOfOfficeRequest +{ + /// + /// The entry's id. + /// + [JsonIgnore] + public required string Id { get; set; } + + [JsonIgnore] + public int? Limit { get; set; } + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/sdks/dotnet/src/Coss/Scheduling/OutOfOffice/Requests/CreateSchedulingOutOfOfficeRequest.cs b/sdks/dotnet/src/Coss/Scheduling/OutOfOffice/Requests/CreateSchedulingOutOfOfficeRequest.cs new file mode 100644 index 000000000..29d1a53d3 --- /dev/null +++ b/sdks/dotnet/src/Coss/Scheduling/OutOfOffice/Requests/CreateSchedulingOutOfOfficeRequest.cs @@ -0,0 +1,127 @@ +using Coss.Core; +using global::System.Text.Json.Serialization; +using OneOf; + +namespace Coss.Scheduling; + +[Serializable] +public record CreateSchedulingOutOfOfficeRequest +{ + /// + /// One host, by id or uid. + /// + [Optional] + [JsonPropertyName("host")] + public string? Host { get; set; } + + /// + /// Several hosts, by id or uid. Each gets an entry of their own. + /// + [Optional] + [JsonPropertyName("hosts")] + public IEnumerable? Hosts { get; set; } + + /// + /// Every active host matching these attributes right now. A host added later isn't covered. + /// + [Optional] + [JsonPropertyName("host_filter")] + public Dictionary>>? HostFilter { get; set; } + + /// + /// An ISO 8601 instant with an offset. + /// + [Optional] + [JsonPropertyName("start")] + public string? Start { get; set; } + + /// + /// An ISO 8601 instant with an offset. + /// + [Optional] + [JsonPropertyName("end")] + public string? End { get; set; } + + /// + /// The first whole day away. Use instead of `start` and `end`. + /// + [Optional] + [JsonPropertyName("start_date")] + public string? StartDate { get; set; } + + /// + /// The last whole day away, which is included. + /// + [Optional] + [JsonPropertyName("end_date")] + public string? EndDate { get; set; } + + /// + /// What the dates mean in. Default: the host's zone when this is made. + /// + [Optional] + [JsonPropertyName("time_zone")] + public string? TimeZone { get; set; } + + /// + /// Who can be booked in this host's place during it, by id or uid, in the order to try them. They still have to fit how a booking's routed. + /// + [Optional] + [JsonPropertyName("delegates")] + public IEnumerable? Delegates { get; set; } + + /// + /// One of `unspecified`, `vacation`, `travel`, `sick`, `public_holiday`, `parental_leave`, `training` and `other`, or a key from the settings' `out_of_office_reasons`. Only people who manage this host see it: never bookers, webhooks or calendars. + /// + [Optional] + [JsonPropertyName("reason")] + public string? Reason { get; set; } + + /// + /// For people who manage this host. Encrypted, and never shown to a booker. + /// + [Optional] + [JsonPropertyName("notes")] + public string? Notes { get; set; } + + /// + /// Shown to bookers while this host is away. Can't contain a link. + /// + [Optional] + [JsonPropertyName("public_message")] + public string? PublicMessage { get; set; } + + /// + /// Put a private "Out of office" event on the host's calendar. Default: true. + /// + [Optional] + [JsonPropertyName("show_on_calendar")] + public bool? ShowOnCalendar { get; set; } + + /// + /// What happens to bookings already in the way. `leave` (the default) only reports them. `reassign` moves them, and any nobody can take stay where they are. + /// + [Optional] + [JsonPropertyName("existing_bookings")] + public CreateSchedulingOutOfOfficeRequestExistingBookings? ExistingBookings { get; set; } + + /// + /// With `existing_bookings: reassign`: who they go to. Default: the fairest who's free. + /// + [Optional] + [JsonPropertyName("reassign")] + public CreateSchedulingOutOfOfficeRequestReassign? Reassign { get; set; } + + /// + /// Your own id for this entry, unique in the environment. Needs one host. + /// + [Optional] + [JsonPropertyName("external_id")] + public string? ExternalId { get; set; } + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/sdks/dotnet/src/Coss/Scheduling/OutOfOffice/Requests/GetOutOfOfficeRequest.cs b/sdks/dotnet/src/Coss/Scheduling/OutOfOffice/Requests/GetOutOfOfficeRequest.cs new file mode 100644 index 000000000..d13595ebe --- /dev/null +++ b/sdks/dotnet/src/Coss/Scheduling/OutOfOffice/Requests/GetOutOfOfficeRequest.cs @@ -0,0 +1,20 @@ +using Coss.Core; +using global::System.Text.Json.Serialization; + +namespace Coss.Scheduling; + +[Serializable] +public record GetOutOfOfficeRequest +{ + /// + /// The entry's id. + /// + [JsonIgnore] + public required string Id { get; set; } + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/sdks/dotnet/src/Coss/Scheduling/OutOfOffice/Requests/ListOutOfOfficeRequest.cs b/sdks/dotnet/src/Coss/Scheduling/OutOfOffice/Requests/ListOutOfOfficeRequest.cs new file mode 100644 index 000000000..7181d7fc3 --- /dev/null +++ b/sdks/dotnet/src/Coss/Scheduling/OutOfOffice/Requests/ListOutOfOfficeRequest.cs @@ -0,0 +1,47 @@ +using Coss.Core; +using global::System.Text.Json.Serialization; + +namespace Coss.Scheduling; + +[Serializable] +public record ListOutOfOfficeRequest +{ + [JsonIgnore] + public int? Limit { get; set; } + + /// + /// The last id of the previous page. + /// + [JsonIgnore] + public string? After { get; set; } + + /// + /// One host's entries, by id or uid. + /// + [JsonIgnore] + public string? Host { get; set; } + + /// + /// Entries ending after this. + /// + [JsonIgnore] + public string? StartAfter { get; set; } + + /// + /// Entries starting before this. + /// + [JsonIgnore] + public string? StartBefore { get; set; } + + /// + /// The entries one request made. + /// + [JsonIgnore] + public string? Group { get; set; } + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/sdks/dotnet/src/Coss/Scheduling/OutOfOffice/Requests/PutSchedulingOutOfOfficeRequest.cs b/sdks/dotnet/src/Coss/Scheduling/OutOfOffice/Requests/PutSchedulingOutOfOfficeRequest.cs new file mode 100644 index 000000000..d75d5f825 --- /dev/null +++ b/sdks/dotnet/src/Coss/Scheduling/OutOfOffice/Requests/PutSchedulingOutOfOfficeRequest.cs @@ -0,0 +1,110 @@ +using Coss.Core; +using global::System.Text.Json.Serialization; + +namespace Coss.Scheduling; + +[Serializable] +public record PutSchedulingOutOfOfficeRequest +{ + /// + /// Your own id for the entry. + /// + [JsonIgnore] + public required string ExternalId { get; set; } + + /// + /// The host, by id or uid. + /// + [JsonPropertyName("host")] + public required string Host { get; set; } + + /// + /// An ISO 8601 instant with an offset. + /// + [Optional] + [JsonPropertyName("start")] + public string? Start { get; set; } + + /// + /// An ISO 8601 instant with an offset. + /// + [Optional] + [JsonPropertyName("end")] + public string? End { get; set; } + + /// + /// The first whole day away. Use instead of `start` and `end`. + /// + [Optional] + [JsonPropertyName("start_date")] + public string? StartDate { get; set; } + + /// + /// The last whole day away, which is included. + /// + [Optional] + [JsonPropertyName("end_date")] + public string? EndDate { get; set; } + + /// + /// What the dates mean in. Default: the host's zone when this is made. + /// + [Optional] + [JsonPropertyName("time_zone")] + public string? TimeZone { get; set; } + + /// + /// Who can be booked in this host's place during it, by id or uid, in the order to try them. They still have to fit how a booking's routed. + /// + [Optional] + [JsonPropertyName("delegates")] + public IEnumerable? Delegates { get; set; } + + /// + /// One of `unspecified`, `vacation`, `travel`, `sick`, `public_holiday`, `parental_leave`, `training` and `other`, or a key from the settings' `out_of_office_reasons`. Only people who manage this host see it: never bookers, webhooks or calendars. + /// + [Optional] + [JsonPropertyName("reason")] + public string? Reason { get; set; } + + /// + /// For people who manage this host. Encrypted, and never shown to a booker. + /// + [Optional] + [JsonPropertyName("notes")] + public string? Notes { get; set; } + + /// + /// Shown to bookers while this host is away. Can't contain a link. + /// + [Optional] + [JsonPropertyName("public_message")] + public string? PublicMessage { get; set; } + + /// + /// Put a private "Out of office" event on the host's calendar. Default: true. + /// + [Optional] + [JsonPropertyName("show_on_calendar")] + public bool? ShowOnCalendar { get; set; } + + /// + /// What happens to bookings already in the way. `leave` (the default) only reports them. `reassign` moves them, and any nobody can take stay where they are. + /// + [Optional] + [JsonPropertyName("existing_bookings")] + public PutSchedulingOutOfOfficeRequestExistingBookings? ExistingBookings { get; set; } + + /// + /// With `existing_bookings: reassign`: who they go to. Default: the fairest who's free. + /// + [Optional] + [JsonPropertyName("reassign")] + public PutSchedulingOutOfOfficeRequestReassign? Reassign { get; set; } + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/sdks/dotnet/src/Coss/Scheduling/OutOfOffice/Requests/RemoveOutOfOfficeRequest.cs b/sdks/dotnet/src/Coss/Scheduling/OutOfOffice/Requests/RemoveOutOfOfficeRequest.cs new file mode 100644 index 000000000..86da8b2c3 --- /dev/null +++ b/sdks/dotnet/src/Coss/Scheduling/OutOfOffice/Requests/RemoveOutOfOfficeRequest.cs @@ -0,0 +1,20 @@ +using Coss.Core; +using global::System.Text.Json.Serialization; + +namespace Coss.Scheduling; + +[Serializable] +public record RemoveOutOfOfficeRequest +{ + /// + /// The entry's id. + /// + [JsonIgnore] + public required string Id { get; set; } + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/sdks/dotnet/src/Coss/Scheduling/OutOfOffice/Requests/UpdateSchedulingOutOfOfficeRequest.cs b/sdks/dotnet/src/Coss/Scheduling/OutOfOffice/Requests/UpdateSchedulingOutOfOfficeRequest.cs new file mode 100644 index 000000000..51e30aa41 --- /dev/null +++ b/sdks/dotnet/src/Coss/Scheduling/OutOfOffice/Requests/UpdateSchedulingOutOfOfficeRequest.cs @@ -0,0 +1,95 @@ +using Coss.Core; +using global::System.Text.Json.Serialization; + +namespace Coss.Scheduling; + +[Serializable] +public record UpdateSchedulingOutOfOfficeRequest +{ + /// + /// The entry's id. + /// + [JsonIgnore] + public required string Id { get; set; } + + /// + /// An ISO 8601 instant with an offset. + /// + [Optional] + [JsonPropertyName("start")] + public string? Start { get; set; } + + /// + /// An ISO 8601 instant with an offset. + /// + [Optional] + [JsonPropertyName("end")] + public string? End { get; set; } + + /// + /// The first whole day away. Use instead of `start` and `end`. + /// + [Optional] + [JsonPropertyName("start_date")] + public string? StartDate { get; set; } + + /// + /// The last whole day away, which is included. + /// + [Optional] + [JsonPropertyName("end_date")] + public string? EndDate { get; set; } + + /// + /// What the dates mean in. Default: the host's zone when this is made. + /// + [Optional] + [JsonPropertyName("time_zone")] + public string? TimeZone { get; set; } + + /// + /// One of `unspecified`, `vacation`, `travel`, `sick`, `public_holiday`, `parental_leave`, `training` and `other`, or a key from the settings' `out_of_office_reasons`. Only people who manage this host see it: never bookers, webhooks or calendars. + /// + [Optional] + [JsonPropertyName("reason")] + public string? Reason { get; set; } + + [Nullable, Optional] + [JsonPropertyName("notes")] + public Optional Notes { get; set; } + + [Nullable, Optional] + [JsonPropertyName("public_message")] + public Optional PublicMessage { get; set; } + + [Optional] + [JsonPropertyName("show_on_calendar")] + public bool? ShowOnCalendar { get; set; } + + /// + /// Who can be booked in this host's place during it, by id or uid, in the order to try them. They still have to fit how a booking's routed. + /// + [Optional] + [JsonPropertyName("delegates")] + public IEnumerable? Delegates { get; set; } + + /// + /// What happens to bookings already in the way. `leave` (the default) only reports them. `reassign` moves them, and any nobody can take stay where they are. + /// + [Optional] + [JsonPropertyName("existing_bookings")] + public UpdateSchedulingOutOfOfficeRequestExistingBookings? ExistingBookings { get; set; } + + /// + /// With `existing_bookings: reassign`: who they go to. Default: the fairest who's free. + /// + [Optional] + [JsonPropertyName("reassign")] + public UpdateSchedulingOutOfOfficeRequestReassign? Reassign { get; set; } + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/sdks/dotnet/src/Coss/Scheduling/OutOfOffice/Types/CreateSchedulingOutOfOfficeRequestExistingBookings.cs b/sdks/dotnet/src/Coss/Scheduling/OutOfOffice/Types/CreateSchedulingOutOfOfficeRequestExistingBookings.cs new file mode 100644 index 000000000..f77d3fd80 --- /dev/null +++ b/sdks/dotnet/src/Coss/Scheduling/OutOfOffice/Types/CreateSchedulingOutOfOfficeRequestExistingBookings.cs @@ -0,0 +1,130 @@ +using Coss.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace Coss.Scheduling; + +[JsonConverter( + typeof(CreateSchedulingOutOfOfficeRequestExistingBookings.CreateSchedulingOutOfOfficeRequestExistingBookingsSerializer) +)] +[Serializable] +public readonly record struct CreateSchedulingOutOfOfficeRequestExistingBookings : IStringEnum +{ + public static readonly CreateSchedulingOutOfOfficeRequestExistingBookings Leave = new( + Values.Leave + ); + + public static readonly CreateSchedulingOutOfOfficeRequestExistingBookings Reassign = new( + Values.Reassign + ); + + public CreateSchedulingOutOfOfficeRequestExistingBookings(string value) + { + Value = value; + } + + /// + /// The string value of the enum. + /// + public string Value { get; } + + /// + /// Create a string enum with the given value. + /// + public static CreateSchedulingOutOfOfficeRequestExistingBookings FromCustom(string value) + { + return new CreateSchedulingOutOfOfficeRequestExistingBookings(value); + } + + public bool Equals(string? other) + { + return Value.Equals(other); + } + + /// + /// Returns the string value of the enum. + /// + public override string ToString() + { + return Value; + } + + public static bool operator ==( + CreateSchedulingOutOfOfficeRequestExistingBookings value1, + string value2 + ) => value1.Value.Equals(value2); + + public static bool operator !=( + CreateSchedulingOutOfOfficeRequestExistingBookings value1, + string value2 + ) => !value1.Value.Equals(value2); + + public static explicit operator string( + CreateSchedulingOutOfOfficeRequestExistingBookings value + ) => value.Value; + + public static explicit operator CreateSchedulingOutOfOfficeRequestExistingBookings( + string value + ) => new(value); + + internal class CreateSchedulingOutOfOfficeRequestExistingBookingsSerializer + : JsonConverter + { + public override CreateSchedulingOutOfOfficeRequestExistingBookings Read( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON value could not be read as a string." + ); + return new CreateSchedulingOutOfOfficeRequestExistingBookings(stringValue); + } + + public override void Write( + Utf8JsonWriter writer, + CreateSchedulingOutOfOfficeRequestExistingBookings value, + JsonSerializerOptions options + ) + { + writer.WriteStringValue(value.Value); + } + + public override CreateSchedulingOutOfOfficeRequestExistingBookings ReadAsPropertyName( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return new CreateSchedulingOutOfOfficeRequestExistingBookings(stringValue); + } + + public override void WriteAsPropertyName( + Utf8JsonWriter writer, + CreateSchedulingOutOfOfficeRequestExistingBookings value, + JsonSerializerOptions options + ) + { + writer.WritePropertyName(value.Value); + } + } + + /// + /// Constant strings for enum values + /// + [Serializable] + public static class Values + { + public const string Leave = "leave"; + + public const string Reassign = "reassign"; + } +} diff --git a/sdks/dotnet/src/Coss/Scheduling/OutOfOffice/Types/CreateSchedulingOutOfOfficeRequestReassign.cs b/sdks/dotnet/src/Coss/Scheduling/OutOfOffice/Types/CreateSchedulingOutOfOfficeRequestReassign.cs new file mode 100644 index 000000000..05ccca6f8 --- /dev/null +++ b/sdks/dotnet/src/Coss/Scheduling/OutOfOffice/Types/CreateSchedulingOutOfOfficeRequestReassign.cs @@ -0,0 +1,50 @@ +using Coss; +using Coss.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace Coss.Scheduling; + +/// +/// With `existing_bookings: reassign`: who they go to. Default: the fairest who's free. +/// +[Serializable] +public record CreateSchedulingOutOfOfficeRequestReassign : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + /// + /// Give them all to this host. + /// + [Optional] + [JsonPropertyName("to_host")] + public string? ToHost { get; set; } + + /// + /// Try these first, in order. + /// + [Optional] + [JsonPropertyName("preferred_hosts")] + public IEnumerable? PreferredHosts { get; set; } + + /// + /// After `preferred_hosts`: `auto` picks the fairest who's free (the default), `leave` keeps it where it is. + /// + [Optional] + [JsonPropertyName("otherwise")] + public CreateSchedulingOutOfOfficeRequestReassignOtherwise? Otherwise { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/sdks/dotnet/src/Coss/Scheduling/OutOfOffice/Types/CreateSchedulingOutOfOfficeRequestReassignOtherwise.cs b/sdks/dotnet/src/Coss/Scheduling/OutOfOffice/Types/CreateSchedulingOutOfOfficeRequestReassignOtherwise.cs new file mode 100644 index 000000000..96d9e0b61 --- /dev/null +++ b/sdks/dotnet/src/Coss/Scheduling/OutOfOffice/Types/CreateSchedulingOutOfOfficeRequestReassignOtherwise.cs @@ -0,0 +1,130 @@ +using Coss.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace Coss.Scheduling; + +[JsonConverter( + typeof(CreateSchedulingOutOfOfficeRequestReassignOtherwise.CreateSchedulingOutOfOfficeRequestReassignOtherwiseSerializer) +)] +[Serializable] +public readonly record struct CreateSchedulingOutOfOfficeRequestReassignOtherwise : IStringEnum +{ + public static readonly CreateSchedulingOutOfOfficeRequestReassignOtherwise Auto = new( + Values.Auto + ); + + public static readonly CreateSchedulingOutOfOfficeRequestReassignOtherwise Leave = new( + Values.Leave + ); + + public CreateSchedulingOutOfOfficeRequestReassignOtherwise(string value) + { + Value = value; + } + + /// + /// The string value of the enum. + /// + public string Value { get; } + + /// + /// Create a string enum with the given value. + /// + public static CreateSchedulingOutOfOfficeRequestReassignOtherwise FromCustom(string value) + { + return new CreateSchedulingOutOfOfficeRequestReassignOtherwise(value); + } + + public bool Equals(string? other) + { + return Value.Equals(other); + } + + /// + /// Returns the string value of the enum. + /// + public override string ToString() + { + return Value; + } + + public static bool operator ==( + CreateSchedulingOutOfOfficeRequestReassignOtherwise value1, + string value2 + ) => value1.Value.Equals(value2); + + public static bool operator !=( + CreateSchedulingOutOfOfficeRequestReassignOtherwise value1, + string value2 + ) => !value1.Value.Equals(value2); + + public static explicit operator string( + CreateSchedulingOutOfOfficeRequestReassignOtherwise value + ) => value.Value; + + public static explicit operator CreateSchedulingOutOfOfficeRequestReassignOtherwise( + string value + ) => new(value); + + internal class CreateSchedulingOutOfOfficeRequestReassignOtherwiseSerializer + : JsonConverter + { + public override CreateSchedulingOutOfOfficeRequestReassignOtherwise Read( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON value could not be read as a string." + ); + return new CreateSchedulingOutOfOfficeRequestReassignOtherwise(stringValue); + } + + public override void Write( + Utf8JsonWriter writer, + CreateSchedulingOutOfOfficeRequestReassignOtherwise value, + JsonSerializerOptions options + ) + { + writer.WriteStringValue(value.Value); + } + + public override CreateSchedulingOutOfOfficeRequestReassignOtherwise ReadAsPropertyName( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return new CreateSchedulingOutOfOfficeRequestReassignOtherwise(stringValue); + } + + public override void WriteAsPropertyName( + Utf8JsonWriter writer, + CreateSchedulingOutOfOfficeRequestReassignOtherwise value, + JsonSerializerOptions options + ) + { + writer.WritePropertyName(value.Value); + } + } + + /// + /// Constant strings for enum values + /// + [Serializable] + public static class Values + { + public const string Auto = "auto"; + + public const string Leave = "leave"; + } +} diff --git a/sdks/dotnet/src/Coss/Scheduling/OutOfOffice/Types/PutSchedulingOutOfOfficeRequestExistingBookings.cs b/sdks/dotnet/src/Coss/Scheduling/OutOfOffice/Types/PutSchedulingOutOfOfficeRequestExistingBookings.cs new file mode 100644 index 000000000..de4234855 --- /dev/null +++ b/sdks/dotnet/src/Coss/Scheduling/OutOfOffice/Types/PutSchedulingOutOfOfficeRequestExistingBookings.cs @@ -0,0 +1,128 @@ +using Coss.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace Coss.Scheduling; + +[JsonConverter( + typeof(PutSchedulingOutOfOfficeRequestExistingBookings.PutSchedulingOutOfOfficeRequestExistingBookingsSerializer) +)] +[Serializable] +public readonly record struct PutSchedulingOutOfOfficeRequestExistingBookings : IStringEnum +{ + public static readonly PutSchedulingOutOfOfficeRequestExistingBookings Leave = new( + Values.Leave + ); + + public static readonly PutSchedulingOutOfOfficeRequestExistingBookings Reassign = new( + Values.Reassign + ); + + public PutSchedulingOutOfOfficeRequestExistingBookings(string value) + { + Value = value; + } + + /// + /// The string value of the enum. + /// + public string Value { get; } + + /// + /// Create a string enum with the given value. + /// + public static PutSchedulingOutOfOfficeRequestExistingBookings FromCustom(string value) + { + return new PutSchedulingOutOfOfficeRequestExistingBookings(value); + } + + public bool Equals(string? other) + { + return Value.Equals(other); + } + + /// + /// Returns the string value of the enum. + /// + public override string ToString() + { + return Value; + } + + public static bool operator ==( + PutSchedulingOutOfOfficeRequestExistingBookings value1, + string value2 + ) => value1.Value.Equals(value2); + + public static bool operator !=( + PutSchedulingOutOfOfficeRequestExistingBookings value1, + string value2 + ) => !value1.Value.Equals(value2); + + public static explicit operator string(PutSchedulingOutOfOfficeRequestExistingBookings value) => + value.Value; + + public static explicit operator PutSchedulingOutOfOfficeRequestExistingBookings(string value) => + new(value); + + internal class PutSchedulingOutOfOfficeRequestExistingBookingsSerializer + : JsonConverter + { + public override PutSchedulingOutOfOfficeRequestExistingBookings Read( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON value could not be read as a string." + ); + return new PutSchedulingOutOfOfficeRequestExistingBookings(stringValue); + } + + public override void Write( + Utf8JsonWriter writer, + PutSchedulingOutOfOfficeRequestExistingBookings value, + JsonSerializerOptions options + ) + { + writer.WriteStringValue(value.Value); + } + + public override PutSchedulingOutOfOfficeRequestExistingBookings ReadAsPropertyName( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return new PutSchedulingOutOfOfficeRequestExistingBookings(stringValue); + } + + public override void WriteAsPropertyName( + Utf8JsonWriter writer, + PutSchedulingOutOfOfficeRequestExistingBookings value, + JsonSerializerOptions options + ) + { + writer.WritePropertyName(value.Value); + } + } + + /// + /// Constant strings for enum values + /// + [Serializable] + public static class Values + { + public const string Leave = "leave"; + + public const string Reassign = "reassign"; + } +} diff --git a/sdks/dotnet/src/Coss/Scheduling/OutOfOffice/Types/PutSchedulingOutOfOfficeRequestReassign.cs b/sdks/dotnet/src/Coss/Scheduling/OutOfOffice/Types/PutSchedulingOutOfOfficeRequestReassign.cs new file mode 100644 index 000000000..f209b80bb --- /dev/null +++ b/sdks/dotnet/src/Coss/Scheduling/OutOfOffice/Types/PutSchedulingOutOfOfficeRequestReassign.cs @@ -0,0 +1,50 @@ +using Coss; +using Coss.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace Coss.Scheduling; + +/// +/// With `existing_bookings: reassign`: who they go to. Default: the fairest who's free. +/// +[Serializable] +public record PutSchedulingOutOfOfficeRequestReassign : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + /// + /// Give them all to this host. + /// + [Optional] + [JsonPropertyName("to_host")] + public string? ToHost { get; set; } + + /// + /// Try these first, in order. + /// + [Optional] + [JsonPropertyName("preferred_hosts")] + public IEnumerable? PreferredHosts { get; set; } + + /// + /// After `preferred_hosts`: `auto` picks the fairest who's free (the default), `leave` keeps it where it is. + /// + [Optional] + [JsonPropertyName("otherwise")] + public PutSchedulingOutOfOfficeRequestReassignOtherwise? Otherwise { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/sdks/dotnet/src/Coss/Scheduling/OutOfOffice/Types/PutSchedulingOutOfOfficeRequestReassignOtherwise.cs b/sdks/dotnet/src/Coss/Scheduling/OutOfOffice/Types/PutSchedulingOutOfOfficeRequestReassignOtherwise.cs new file mode 100644 index 000000000..47cb8b4e2 --- /dev/null +++ b/sdks/dotnet/src/Coss/Scheduling/OutOfOffice/Types/PutSchedulingOutOfOfficeRequestReassignOtherwise.cs @@ -0,0 +1,128 @@ +using Coss.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace Coss.Scheduling; + +[JsonConverter( + typeof(PutSchedulingOutOfOfficeRequestReassignOtherwise.PutSchedulingOutOfOfficeRequestReassignOtherwiseSerializer) +)] +[Serializable] +public readonly record struct PutSchedulingOutOfOfficeRequestReassignOtherwise : IStringEnum +{ + public static readonly PutSchedulingOutOfOfficeRequestReassignOtherwise Auto = new(Values.Auto); + + public static readonly PutSchedulingOutOfOfficeRequestReassignOtherwise Leave = new( + Values.Leave + ); + + public PutSchedulingOutOfOfficeRequestReassignOtherwise(string value) + { + Value = value; + } + + /// + /// The string value of the enum. + /// + public string Value { get; } + + /// + /// Create a string enum with the given value. + /// + public static PutSchedulingOutOfOfficeRequestReassignOtherwise FromCustom(string value) + { + return new PutSchedulingOutOfOfficeRequestReassignOtherwise(value); + } + + public bool Equals(string? other) + { + return Value.Equals(other); + } + + /// + /// Returns the string value of the enum. + /// + public override string ToString() + { + return Value; + } + + public static bool operator ==( + PutSchedulingOutOfOfficeRequestReassignOtherwise value1, + string value2 + ) => value1.Value.Equals(value2); + + public static bool operator !=( + PutSchedulingOutOfOfficeRequestReassignOtherwise value1, + string value2 + ) => !value1.Value.Equals(value2); + + public static explicit operator string( + PutSchedulingOutOfOfficeRequestReassignOtherwise value + ) => value.Value; + + public static explicit operator PutSchedulingOutOfOfficeRequestReassignOtherwise( + string value + ) => new(value); + + internal class PutSchedulingOutOfOfficeRequestReassignOtherwiseSerializer + : JsonConverter + { + public override PutSchedulingOutOfOfficeRequestReassignOtherwise Read( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON value could not be read as a string." + ); + return new PutSchedulingOutOfOfficeRequestReassignOtherwise(stringValue); + } + + public override void Write( + Utf8JsonWriter writer, + PutSchedulingOutOfOfficeRequestReassignOtherwise value, + JsonSerializerOptions options + ) + { + writer.WriteStringValue(value.Value); + } + + public override PutSchedulingOutOfOfficeRequestReassignOtherwise ReadAsPropertyName( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return new PutSchedulingOutOfOfficeRequestReassignOtherwise(stringValue); + } + + public override void WriteAsPropertyName( + Utf8JsonWriter writer, + PutSchedulingOutOfOfficeRequestReassignOtherwise value, + JsonSerializerOptions options + ) + { + writer.WritePropertyName(value.Value); + } + } + + /// + /// Constant strings for enum values + /// + [Serializable] + public static class Values + { + public const string Auto = "auto"; + + public const string Leave = "leave"; + } +} diff --git a/sdks/dotnet/src/Coss/Scheduling/OutOfOffice/Types/UpdateSchedulingOutOfOfficeRequestExistingBookings.cs b/sdks/dotnet/src/Coss/Scheduling/OutOfOffice/Types/UpdateSchedulingOutOfOfficeRequestExistingBookings.cs new file mode 100644 index 000000000..1165fe017 --- /dev/null +++ b/sdks/dotnet/src/Coss/Scheduling/OutOfOffice/Types/UpdateSchedulingOutOfOfficeRequestExistingBookings.cs @@ -0,0 +1,130 @@ +using Coss.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace Coss.Scheduling; + +[JsonConverter( + typeof(UpdateSchedulingOutOfOfficeRequestExistingBookings.UpdateSchedulingOutOfOfficeRequestExistingBookingsSerializer) +)] +[Serializable] +public readonly record struct UpdateSchedulingOutOfOfficeRequestExistingBookings : IStringEnum +{ + public static readonly UpdateSchedulingOutOfOfficeRequestExistingBookings Leave = new( + Values.Leave + ); + + public static readonly UpdateSchedulingOutOfOfficeRequestExistingBookings Reassign = new( + Values.Reassign + ); + + public UpdateSchedulingOutOfOfficeRequestExistingBookings(string value) + { + Value = value; + } + + /// + /// The string value of the enum. + /// + public string Value { get; } + + /// + /// Create a string enum with the given value. + /// + public static UpdateSchedulingOutOfOfficeRequestExistingBookings FromCustom(string value) + { + return new UpdateSchedulingOutOfOfficeRequestExistingBookings(value); + } + + public bool Equals(string? other) + { + return Value.Equals(other); + } + + /// + /// Returns the string value of the enum. + /// + public override string ToString() + { + return Value; + } + + public static bool operator ==( + UpdateSchedulingOutOfOfficeRequestExistingBookings value1, + string value2 + ) => value1.Value.Equals(value2); + + public static bool operator !=( + UpdateSchedulingOutOfOfficeRequestExistingBookings value1, + string value2 + ) => !value1.Value.Equals(value2); + + public static explicit operator string( + UpdateSchedulingOutOfOfficeRequestExistingBookings value + ) => value.Value; + + public static explicit operator UpdateSchedulingOutOfOfficeRequestExistingBookings( + string value + ) => new(value); + + internal class UpdateSchedulingOutOfOfficeRequestExistingBookingsSerializer + : JsonConverter + { + public override UpdateSchedulingOutOfOfficeRequestExistingBookings Read( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON value could not be read as a string." + ); + return new UpdateSchedulingOutOfOfficeRequestExistingBookings(stringValue); + } + + public override void Write( + Utf8JsonWriter writer, + UpdateSchedulingOutOfOfficeRequestExistingBookings value, + JsonSerializerOptions options + ) + { + writer.WriteStringValue(value.Value); + } + + public override UpdateSchedulingOutOfOfficeRequestExistingBookings ReadAsPropertyName( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return new UpdateSchedulingOutOfOfficeRequestExistingBookings(stringValue); + } + + public override void WriteAsPropertyName( + Utf8JsonWriter writer, + UpdateSchedulingOutOfOfficeRequestExistingBookings value, + JsonSerializerOptions options + ) + { + writer.WritePropertyName(value.Value); + } + } + + /// + /// Constant strings for enum values + /// + [Serializable] + public static class Values + { + public const string Leave = "leave"; + + public const string Reassign = "reassign"; + } +} diff --git a/sdks/dotnet/src/Coss/Scheduling/OutOfOffice/Types/UpdateSchedulingOutOfOfficeRequestReassign.cs b/sdks/dotnet/src/Coss/Scheduling/OutOfOffice/Types/UpdateSchedulingOutOfOfficeRequestReassign.cs new file mode 100644 index 000000000..768df6669 --- /dev/null +++ b/sdks/dotnet/src/Coss/Scheduling/OutOfOffice/Types/UpdateSchedulingOutOfOfficeRequestReassign.cs @@ -0,0 +1,50 @@ +using Coss; +using Coss.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace Coss.Scheduling; + +/// +/// With `existing_bookings: reassign`: who they go to. Default: the fairest who's free. +/// +[Serializable] +public record UpdateSchedulingOutOfOfficeRequestReassign : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + /// + /// Give them all to this host. + /// + [Optional] + [JsonPropertyName("to_host")] + public string? ToHost { get; set; } + + /// + /// Try these first, in order. + /// + [Optional] + [JsonPropertyName("preferred_hosts")] + public IEnumerable? PreferredHosts { get; set; } + + /// + /// After `preferred_hosts`: `auto` picks the fairest who's free (the default), `leave` keeps it where it is. + /// + [Optional] + [JsonPropertyName("otherwise")] + public UpdateSchedulingOutOfOfficeRequestReassignOtherwise? Otherwise { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/sdks/dotnet/src/Coss/Scheduling/OutOfOffice/Types/UpdateSchedulingOutOfOfficeRequestReassignOtherwise.cs b/sdks/dotnet/src/Coss/Scheduling/OutOfOffice/Types/UpdateSchedulingOutOfOfficeRequestReassignOtherwise.cs new file mode 100644 index 000000000..54e315df7 --- /dev/null +++ b/sdks/dotnet/src/Coss/Scheduling/OutOfOffice/Types/UpdateSchedulingOutOfOfficeRequestReassignOtherwise.cs @@ -0,0 +1,130 @@ +using Coss.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace Coss.Scheduling; + +[JsonConverter( + typeof(UpdateSchedulingOutOfOfficeRequestReassignOtherwise.UpdateSchedulingOutOfOfficeRequestReassignOtherwiseSerializer) +)] +[Serializable] +public readonly record struct UpdateSchedulingOutOfOfficeRequestReassignOtherwise : IStringEnum +{ + public static readonly UpdateSchedulingOutOfOfficeRequestReassignOtherwise Auto = new( + Values.Auto + ); + + public static readonly UpdateSchedulingOutOfOfficeRequestReassignOtherwise Leave = new( + Values.Leave + ); + + public UpdateSchedulingOutOfOfficeRequestReassignOtherwise(string value) + { + Value = value; + } + + /// + /// The string value of the enum. + /// + public string Value { get; } + + /// + /// Create a string enum with the given value. + /// + public static UpdateSchedulingOutOfOfficeRequestReassignOtherwise FromCustom(string value) + { + return new UpdateSchedulingOutOfOfficeRequestReassignOtherwise(value); + } + + public bool Equals(string? other) + { + return Value.Equals(other); + } + + /// + /// Returns the string value of the enum. + /// + public override string ToString() + { + return Value; + } + + public static bool operator ==( + UpdateSchedulingOutOfOfficeRequestReassignOtherwise value1, + string value2 + ) => value1.Value.Equals(value2); + + public static bool operator !=( + UpdateSchedulingOutOfOfficeRequestReassignOtherwise value1, + string value2 + ) => !value1.Value.Equals(value2); + + public static explicit operator string( + UpdateSchedulingOutOfOfficeRequestReassignOtherwise value + ) => value.Value; + + public static explicit operator UpdateSchedulingOutOfOfficeRequestReassignOtherwise( + string value + ) => new(value); + + internal class UpdateSchedulingOutOfOfficeRequestReassignOtherwiseSerializer + : JsonConverter + { + public override UpdateSchedulingOutOfOfficeRequestReassignOtherwise Read( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON value could not be read as a string." + ); + return new UpdateSchedulingOutOfOfficeRequestReassignOtherwise(stringValue); + } + + public override void Write( + Utf8JsonWriter writer, + UpdateSchedulingOutOfOfficeRequestReassignOtherwise value, + JsonSerializerOptions options + ) + { + writer.WriteStringValue(value.Value); + } + + public override UpdateSchedulingOutOfOfficeRequestReassignOtherwise ReadAsPropertyName( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return new UpdateSchedulingOutOfOfficeRequestReassignOtherwise(stringValue); + } + + public override void WriteAsPropertyName( + Utf8JsonWriter writer, + UpdateSchedulingOutOfOfficeRequestReassignOtherwise value, + JsonSerializerOptions options + ) + { + writer.WritePropertyName(value.Value); + } + } + + /// + /// Constant strings for enum values + /// + [Serializable] + public static class Values + { + public const string Auto = "auto"; + + public const string Leave = "leave"; + } +} diff --git a/sdks/dotnet/src/Coss/Scheduling/Reassignments/IReassignmentsClient.cs b/sdks/dotnet/src/Coss/Scheduling/Reassignments/IReassignmentsClient.cs new file mode 100644 index 000000000..fbfb85cf8 --- /dev/null +++ b/sdks/dotnet/src/Coss/Scheduling/Reassignments/IReassignmentsClient.cs @@ -0,0 +1,69 @@ +using Coss; + +namespace Coss.Scheduling; + +public partial interface IReassignmentsClient +{ + /// + /// Who each booking would go to, and why not when nobody can take it, without moving anything. It works down them in order, so two can't both be promised the same free hour. Change any of it and start the run with `assignments`. Covers the first 500. Things can change before you start it: the run decides again. + /// + WithRawResponseTask PreviewAsync( + PreviewSchedulingReassignmentRequest request, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ); + + /// + /// Newest first, with how each is going. + /// + WithRawResponseTask ListAsync( + ListReassignmentsRequest request, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ); + + /// + /// Moves up to 5,000 bookings in the background, each on its own, so one that can't move never holds up the rest. Nothing's ever cancelled: a booking nobody can take stays where it is, and its item says so. It answers at once: follow the run by its id, or wait for `scheduling.reassignment.completed`. + /// + WithRawResponseTask CreateAsync( + CreateSchedulingReassignmentRequest request, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ); + + /// + /// How it's going. + /// + WithRawResponseTask GetAsync( + GetReassignmentsRequest request, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ); + + /// + /// Each booking it covers and what happened to it. A group session has one, for one of its seats. Empty until the worker's started on it. + /// + WithRawResponseTask ItemsAsync( + ItemsReassignmentsRequest request, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ); + + /// + /// Stops what hasn't happened yet. What's moved stays moved: undo it for that. Cancelling one that's finished changes nothing. + /// + WithRawResponseTask CancelAsync( + CancelReassignmentsRequest request, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ); + + /// + /// Gives back what a finished run moved, as a new run. A booking that's moved on since stays where it went, and a former host who's no longer free keeps it from going back, unless you pass `overrides`. + /// + WithRawResponseTask UndoAsync( + UndoSchedulingReassignmentRequest request, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ); +} diff --git a/sdks/dotnet/src/Coss/Scheduling/Reassignments/ReassignmentsClient.cs b/sdks/dotnet/src/Coss/Scheduling/Reassignments/ReassignmentsClient.cs new file mode 100644 index 000000000..180ff0c0a --- /dev/null +++ b/sdks/dotnet/src/Coss/Scheduling/Reassignments/ReassignmentsClient.cs @@ -0,0 +1,1520 @@ +using Coss; +using Coss.Core; +using global::System.Text.Json; + +namespace Coss.Scheduling; + +public partial class ReassignmentsClient : IReassignmentsClient +{ + private readonly RawClient _client; + + internal ReassignmentsClient(RawClient client) + { + _client = client; + } + + private async Task> PreviewAsyncCore( + PreviewSchedulingReassignmentRequest request, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ) + { + var _queryString = new Coss.Core.QueryStringBuilder.Builder(capacity: 0) + .MergeAdditional(options?.AdditionalQueryParameters) + .Build(); + var _headers = await new Coss.Core.HeadersBuilder.Builder() + .Add(_client.Options.Headers) + .Add(_client.Options.AdditionalHeaders) + .AddIdempotencyHeader() + .Add(options?.AdditionalHeaders) + .BuildAsync() + .ConfigureAwait(false); + var response = await _client + .SendRequestAsync( + new JsonRequest + { + Method = HttpMethod.Post, + Path = "v1/scheduling/reassignments/preview", + Body = request, + QueryString = _queryString, + Headers = _headers, + ContentType = "application/json", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); + if (response.StatusCode is >= 200 and < 400) + { + var responseBody = await response + .Raw.Content.ReadAsStringAsync(cancellationToken) + .ConfigureAwait(false); + try + { + var responseData = JsonUtils.Deserialize( + responseBody + )!; + return new WithRawResponse() + { + Data = responseData, + RawResponse = new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = response.Raw.RequestMessage?.RequestUri ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + }, + }; + } + catch (JsonException e) + { + throw new CossClientApiException( + "Failed to deserialize response", + response.StatusCode, + responseBody, + e, + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = response.Raw.RequestMessage?.RequestUri ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + } + } + { + var responseBody = await response + .Raw.Content.ReadAsStringAsync(cancellationToken) + .ConfigureAwait(false); + try + { + switch (response.StatusCode) + { + case 400: + throw new BadRequestError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 401: + throw new UnauthorizedError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 403: + throw new ForbiddenError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 404: + throw new NotFoundError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 415: + throw new UnsupportedMediaTypeError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 422: + throw new UnprocessableEntityError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 429: + throw new TooManyRequestsError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 500: + throw new InternalServerError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 503: + throw new ServiceUnavailableError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + } + } + catch (JsonException) + { + // unable to map error response, throwing generic error + } + throw new CossClientApiException( + $"Error with status code {response.StatusCode}", + response.StatusCode, + responseBody, + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = response.Raw.RequestMessage?.RequestUri ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + } + } + + private async Task> ListAsyncCore( + ListReassignmentsRequest request, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ) + { + var _queryString = new Coss.Core.QueryStringBuilder.Builder(capacity: 2) + .Add("limit", request.Limit) + .Add("after", request.After) + .MergeAdditional(options?.AdditionalQueryParameters) + .Build(); + var _headers = await new Coss.Core.HeadersBuilder.Builder() + .Add(_client.Options.Headers) + .Add(_client.Options.AdditionalHeaders) + .Add(options?.AdditionalHeaders) + .BuildAsync() + .ConfigureAwait(false); + var response = await _client + .SendRequestAsync( + new JsonRequest + { + Method = HttpMethod.Get, + Path = "v1/scheduling/reassignments", + QueryString = _queryString, + Headers = _headers, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); + if (response.StatusCode is >= 200 and < 400) + { + var responseBody = await response + .Raw.Content.ReadAsStringAsync(cancellationToken) + .ConfigureAwait(false); + try + { + var responseData = JsonUtils.Deserialize(responseBody)!; + return new WithRawResponse() + { + Data = responseData, + RawResponse = new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = response.Raw.RequestMessage?.RequestUri ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + }, + }; + } + catch (JsonException e) + { + throw new CossClientApiException( + "Failed to deserialize response", + response.StatusCode, + responseBody, + e, + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = response.Raw.RequestMessage?.RequestUri ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + } + } + { + var responseBody = await response + .Raw.Content.ReadAsStringAsync(cancellationToken) + .ConfigureAwait(false); + try + { + switch (response.StatusCode) + { + case 400: + throw new BadRequestError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 401: + throw new UnauthorizedError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 403: + throw new ForbiddenError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 422: + throw new UnprocessableEntityError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 429: + throw new TooManyRequestsError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 500: + throw new InternalServerError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 503: + throw new ServiceUnavailableError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + } + } + catch (JsonException) + { + // unable to map error response, throwing generic error + } + throw new CossClientApiException( + $"Error with status code {response.StatusCode}", + response.StatusCode, + responseBody, + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = response.Raw.RequestMessage?.RequestUri ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + } + } + + private async Task> CreateAsyncCore( + CreateSchedulingReassignmentRequest request, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ) + { + var _queryString = new Coss.Core.QueryStringBuilder.Builder(capacity: 0) + .MergeAdditional(options?.AdditionalQueryParameters) + .Build(); + var _headers = await new Coss.Core.HeadersBuilder.Builder() + .Add("Idempotency-Key", request.IdempotencyKey) + .Add(_client.Options.Headers) + .Add(_client.Options.AdditionalHeaders) + .AddIdempotencyHeader() + .Add(options?.AdditionalHeaders) + .BuildAsync() + .ConfigureAwait(false); + var response = await _client + .SendRequestAsync( + new JsonRequest + { + Method = HttpMethod.Post, + Path = "v1/scheduling/reassignments", + Body = request, + QueryString = _queryString, + Headers = _headers, + ContentType = "application/json", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); + if (response.StatusCode is >= 200 and < 400) + { + var responseBody = await response + .Raw.Content.ReadAsStringAsync(cancellationToken) + .ConfigureAwait(false); + try + { + var responseData = JsonUtils.Deserialize(responseBody)!; + return new WithRawResponse() + { + Data = responseData, + RawResponse = new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = response.Raw.RequestMessage?.RequestUri ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + }, + }; + } + catch (JsonException e) + { + throw new CossClientApiException( + "Failed to deserialize response", + response.StatusCode, + responseBody, + e, + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = response.Raw.RequestMessage?.RequestUri ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + } + } + { + var responseBody = await response + .Raw.Content.ReadAsStringAsync(cancellationToken) + .ConfigureAwait(false); + try + { + switch (response.StatusCode) + { + case 400: + throw new BadRequestError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 401: + throw new UnauthorizedError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 403: + throw new ForbiddenError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 404: + throw new NotFoundError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 409: + throw new ConflictError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 415: + throw new UnsupportedMediaTypeError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 422: + throw new UnprocessableEntityError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 429: + throw new TooManyRequestsError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 500: + throw new InternalServerError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 503: + throw new ServiceUnavailableError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + } + } + catch (JsonException) + { + // unable to map error response, throwing generic error + } + throw new CossClientApiException( + $"Error with status code {response.StatusCode}", + response.StatusCode, + responseBody, + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = response.Raw.RequestMessage?.RequestUri ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + } + } + + private async Task> GetAsyncCore( + GetReassignmentsRequest request, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ) + { + var _queryString = new Coss.Core.QueryStringBuilder.Builder(capacity: 0) + .MergeAdditional(options?.AdditionalQueryParameters) + .Build(); + var _headers = await new Coss.Core.HeadersBuilder.Builder() + .Add(_client.Options.Headers) + .Add(_client.Options.AdditionalHeaders) + .Add(options?.AdditionalHeaders) + .BuildAsync() + .ConfigureAwait(false); + var response = await _client + .SendRequestAsync( + new JsonRequest + { + Method = HttpMethod.Get, + Path = string.Format( + "v1/scheduling/reassignments/{0}", + ValueConvert.ToPathParameterString(request.Id) + ), + QueryString = _queryString, + Headers = _headers, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); + if (response.StatusCode is >= 200 and < 400) + { + var responseBody = await response + .Raw.Content.ReadAsStringAsync(cancellationToken) + .ConfigureAwait(false); + try + { + var responseData = JsonUtils.Deserialize(responseBody)!; + return new WithRawResponse() + { + Data = responseData, + RawResponse = new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = response.Raw.RequestMessage?.RequestUri ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + }, + }; + } + catch (JsonException e) + { + throw new CossClientApiException( + "Failed to deserialize response", + response.StatusCode, + responseBody, + e, + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = response.Raw.RequestMessage?.RequestUri ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + } + } + { + var responseBody = await response + .Raw.Content.ReadAsStringAsync(cancellationToken) + .ConfigureAwait(false); + try + { + switch (response.StatusCode) + { + case 400: + throw new BadRequestError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 401: + throw new UnauthorizedError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 403: + throw new ForbiddenError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 404: + throw new NotFoundError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 429: + throw new TooManyRequestsError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 500: + throw new InternalServerError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 503: + throw new ServiceUnavailableError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + } + } + catch (JsonException) + { + // unable to map error response, throwing generic error + } + throw new CossClientApiException( + $"Error with status code {response.StatusCode}", + response.StatusCode, + responseBody, + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = response.Raw.RequestMessage?.RequestUri ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + } + } + + private async Task> ItemsAsyncCore( + ItemsReassignmentsRequest request, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ) + { + var _queryString = new Coss.Core.QueryStringBuilder.Builder(capacity: 2) + .Add("limit", request.Limit) + .Add("after", request.After) + .MergeAdditional(options?.AdditionalQueryParameters) + .Build(); + var _headers = await new Coss.Core.HeadersBuilder.Builder() + .Add(_client.Options.Headers) + .Add(_client.Options.AdditionalHeaders) + .Add(options?.AdditionalHeaders) + .BuildAsync() + .ConfigureAwait(false); + var response = await _client + .SendRequestAsync( + new JsonRequest + { + Method = HttpMethod.Get, + Path = string.Format( + "v1/scheduling/reassignments/{0}/items", + ValueConvert.ToPathParameterString(request.Id) + ), + QueryString = _queryString, + Headers = _headers, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); + if (response.StatusCode is >= 200 and < 400) + { + var responseBody = await response + .Raw.Content.ReadAsStringAsync(cancellationToken) + .ConfigureAwait(false); + try + { + var responseData = JsonUtils.Deserialize( + responseBody + )!; + return new WithRawResponse() + { + Data = responseData, + RawResponse = new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = response.Raw.RequestMessage?.RequestUri ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + }, + }; + } + catch (JsonException e) + { + throw new CossClientApiException( + "Failed to deserialize response", + response.StatusCode, + responseBody, + e, + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = response.Raw.RequestMessage?.RequestUri ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + } + } + { + var responseBody = await response + .Raw.Content.ReadAsStringAsync(cancellationToken) + .ConfigureAwait(false); + try + { + switch (response.StatusCode) + { + case 400: + throw new BadRequestError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 401: + throw new UnauthorizedError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 403: + throw new ForbiddenError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 404: + throw new NotFoundError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 422: + throw new UnprocessableEntityError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 429: + throw new TooManyRequestsError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 500: + throw new InternalServerError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 503: + throw new ServiceUnavailableError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + } + } + catch (JsonException) + { + // unable to map error response, throwing generic error + } + throw new CossClientApiException( + $"Error with status code {response.StatusCode}", + response.StatusCode, + responseBody, + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = response.Raw.RequestMessage?.RequestUri ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + } + } + + private async Task> CancelAsyncCore( + CancelReassignmentsRequest request, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ) + { + var _queryString = new Coss.Core.QueryStringBuilder.Builder(capacity: 0) + .MergeAdditional(options?.AdditionalQueryParameters) + .Build(); + var _headers = await new Coss.Core.HeadersBuilder.Builder() + .Add(_client.Options.Headers) + .Add(_client.Options.AdditionalHeaders) + .AddIdempotencyHeader() + .Add(options?.AdditionalHeaders) + .BuildAsync() + .ConfigureAwait(false); + var response = await _client + .SendRequestAsync( + new JsonRequest + { + Method = HttpMethod.Post, + Path = string.Format( + "v1/scheduling/reassignments/{0}/cancel", + ValueConvert.ToPathParameterString(request.Id) + ), + QueryString = _queryString, + Headers = _headers, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); + if (response.StatusCode is >= 200 and < 400) + { + var responseBody = await response + .Raw.Content.ReadAsStringAsync(cancellationToken) + .ConfigureAwait(false); + try + { + var responseData = JsonUtils.Deserialize(responseBody)!; + return new WithRawResponse() + { + Data = responseData, + RawResponse = new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = response.Raw.RequestMessage?.RequestUri ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + }, + }; + } + catch (JsonException e) + { + throw new CossClientApiException( + "Failed to deserialize response", + response.StatusCode, + responseBody, + e, + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = response.Raw.RequestMessage?.RequestUri ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + } + } + { + var responseBody = await response + .Raw.Content.ReadAsStringAsync(cancellationToken) + .ConfigureAwait(false); + try + { + switch (response.StatusCode) + { + case 400: + throw new BadRequestError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 401: + throw new UnauthorizedError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 403: + throw new ForbiddenError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 404: + throw new NotFoundError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 429: + throw new TooManyRequestsError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 500: + throw new InternalServerError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 503: + throw new ServiceUnavailableError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + } + } + catch (JsonException) + { + // unable to map error response, throwing generic error + } + throw new CossClientApiException( + $"Error with status code {response.StatusCode}", + response.StatusCode, + responseBody, + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = response.Raw.RequestMessage?.RequestUri ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + } + } + + private async Task> UndoAsyncCore( + UndoSchedulingReassignmentRequest request, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ) + { + var _queryString = new Coss.Core.QueryStringBuilder.Builder(capacity: 0) + .MergeAdditional(options?.AdditionalQueryParameters) + .Build(); + var _headers = await new Coss.Core.HeadersBuilder.Builder() + .Add(_client.Options.Headers) + .Add(_client.Options.AdditionalHeaders) + .AddIdempotencyHeader() + .Add(options?.AdditionalHeaders) + .BuildAsync() + .ConfigureAwait(false); + var response = await _client + .SendRequestAsync( + new JsonRequest + { + Method = HttpMethod.Post, + Path = string.Format( + "v1/scheduling/reassignments/{0}/undo", + ValueConvert.ToPathParameterString(request.Id) + ), + Body = request, + QueryString = _queryString, + Headers = _headers, + ContentType = "application/json", + Options = options, + RetriesDisabled = true, + }, + cancellationToken + ) + .ConfigureAwait(false); + if (response.StatusCode is >= 200 and < 400) + { + var responseBody = await response + .Raw.Content.ReadAsStringAsync(cancellationToken) + .ConfigureAwait(false); + try + { + var responseData = JsonUtils.Deserialize(responseBody)!; + return new WithRawResponse() + { + Data = responseData, + RawResponse = new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = response.Raw.RequestMessage?.RequestUri ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + }, + }; + } + catch (JsonException e) + { + throw new CossClientApiException( + "Failed to deserialize response", + response.StatusCode, + responseBody, + e, + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = response.Raw.RequestMessage?.RequestUri ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + } + } + { + var responseBody = await response + .Raw.Content.ReadAsStringAsync(cancellationToken) + .ConfigureAwait(false); + try + { + switch (response.StatusCode) + { + case 400: + throw new BadRequestError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 401: + throw new UnauthorizedError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 403: + throw new ForbiddenError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 404: + throw new NotFoundError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 415: + throw new UnsupportedMediaTypeError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 422: + throw new UnprocessableEntityError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 429: + throw new TooManyRequestsError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 500: + throw new InternalServerError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 503: + throw new ServiceUnavailableError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + } + } + catch (JsonException) + { + // unable to map error response, throwing generic error + } + throw new CossClientApiException( + $"Error with status code {response.StatusCode}", + response.StatusCode, + responseBody, + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = response.Raw.RequestMessage?.RequestUri ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + } + } + + /// + /// Who each booking would go to, and why not when nobody can take it, without moving anything. It works down them in order, so two can't both be promised the same free hour. Change any of it and start the run with `assignments`. Covers the first 500. Things can change before you start it: the run decides again. + /// + /// + /// await client.Scheduling.Reassignments.PreviewAsync( + /// new PreviewSchedulingReassignmentRequest + /// { + /// Selection = new SchedulingReassignmentSelection + /// { + /// Host = "doctor_482", + /// StartBefore = "2027-08-14T00:00:00.000Z", + /// }, + /// Strategy = new SchedulingReassignmentStrategy + /// { + /// PreferredHosts = new List<string>() { "doctor_518" }, + /// }, + /// } + /// ); + /// + public WithRawResponseTask PreviewAsync( + PreviewSchedulingReassignmentRequest request, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ) + { + return new WithRawResponseTask( + PreviewAsyncCore(request, options, cancellationToken) + ); + } + + /// + /// Newest first, with how each is going. + /// + /// + /// await client.Scheduling.Reassignments.ListAsync(new ListReassignmentsRequest()); + /// + public WithRawResponseTask ListAsync( + ListReassignmentsRequest request, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ) + { + return new WithRawResponseTask( + ListAsyncCore(request, options, cancellationToken) + ); + } + + /// + /// Moves up to 5,000 bookings in the background, each on its own, so one that can't move never holds up the rest. Nothing's ever cancelled: a booking nobody can take stays where it is, and its item says so. It answers at once: follow the run by its id, or wait for `scheduling.reassignment.completed`. + /// + /// + /// await client.Scheduling.Reassignments.CreateAsync( + /// new CreateSchedulingReassignmentRequest + /// { + /// IdempotencyKey = "welcome-user-123", + /// Selection = new SchedulingReassignmentSelection + /// { + /// OutOfOffice = "ooo_01kd2m9a0b1c2d3e4f5g6h7j8m", + /// }, + /// Strategy = new SchedulingReassignmentStrategy + /// { + /// PreferredHosts = new List<string>() { "doctor_518" }, + /// }, + /// ReasonCode = CreateSchedulingReassignmentRequestReasonCode.OutOfOffice, + /// } + /// ); + /// + public WithRawResponseTask CreateAsync( + CreateSchedulingReassignmentRequest request, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ) + { + return new WithRawResponseTask( + CreateAsyncCore(request, options, cancellationToken) + ); + } + + /// + /// How it's going. + /// + /// + /// await client.Scheduling.Reassignments.GetAsync(new GetReassignmentsRequest { Id = "id" }); + /// + public WithRawResponseTask GetAsync( + GetReassignmentsRequest request, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ) + { + return new WithRawResponseTask( + GetAsyncCore(request, options, cancellationToken) + ); + } + + /// + /// Each booking it covers and what happened to it. A group session has one, for one of its seats. Empty until the worker's started on it. + /// + /// + /// await client.Scheduling.Reassignments.ItemsAsync(new ItemsReassignmentsRequest { Id = "id" }); + /// + public WithRawResponseTask ItemsAsync( + ItemsReassignmentsRequest request, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ) + { + return new WithRawResponseTask( + ItemsAsyncCore(request, options, cancellationToken) + ); + } + + /// + /// Stops what hasn't happened yet. What's moved stays moved: undo it for that. Cancelling one that's finished changes nothing. + /// + /// + /// await client.Scheduling.Reassignments.CancelAsync(new CancelReassignmentsRequest { Id = "id" }); + /// + public WithRawResponseTask CancelAsync( + CancelReassignmentsRequest request, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ) + { + return new WithRawResponseTask( + CancelAsyncCore(request, options, cancellationToken) + ); + } + + /// + /// Gives back what a finished run moved, as a new run. A booking that's moved on since stays where it went, and a former host who's no longer free keeps it from going back, unless you pass `overrides`. + /// + /// + /// await client.Scheduling.Reassignments.UndoAsync( + /// new UndoSchedulingReassignmentRequest + /// { + /// Id = "id", + /// ReasonCode = UndoSchedulingReassignmentRequestReasonCode.Other, + /// } + /// ); + /// + public WithRawResponseTask UndoAsync( + UndoSchedulingReassignmentRequest request, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ) + { + return new WithRawResponseTask( + UndoAsyncCore(request, options, cancellationToken) + ); + } +} diff --git a/sdks/dotnet/src/Coss/Scheduling/Reassignments/Requests/CancelReassignmentsRequest.cs b/sdks/dotnet/src/Coss/Scheduling/Reassignments/Requests/CancelReassignmentsRequest.cs new file mode 100644 index 000000000..887ff325d --- /dev/null +++ b/sdks/dotnet/src/Coss/Scheduling/Reassignments/Requests/CancelReassignmentsRequest.cs @@ -0,0 +1,20 @@ +using Coss.Core; +using global::System.Text.Json.Serialization; + +namespace Coss.Scheduling; + +[Serializable] +public record CancelReassignmentsRequest +{ + /// + /// The reassignment's id. + /// + [JsonIgnore] + public required string Id { get; set; } + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/sdks/dotnet/src/Coss/Scheduling/Reassignments/Requests/CreateSchedulingReassignmentRequest.cs b/sdks/dotnet/src/Coss/Scheduling/Reassignments/Requests/CreateSchedulingReassignmentRequest.cs new file mode 100644 index 000000000..a80146a61 --- /dev/null +++ b/sdks/dotnet/src/Coss/Scheduling/Reassignments/Requests/CreateSchedulingReassignmentRequest.cs @@ -0,0 +1,46 @@ +using Coss; +using Coss.Core; +using global::System.Text.Json.Serialization; + +namespace Coss.Scheduling; + +[Serializable] +public record CreateSchedulingReassignmentRequest +{ + /// + /// Makes retries safe: a repeated request with the same key and body returns the original run instead of starting another, for 24 hours. 1-256 characters. + /// + [JsonIgnore] + public string? IdempotencyKey { get; set; } + + [JsonPropertyName("selection")] + public required SchedulingReassignmentSelection Selection { get; set; } + + [Optional] + [JsonPropertyName("strategy")] + public SchedulingReassignmentStrategy? Strategy { get; set; } + + [JsonPropertyName("reason_code")] + public required CreateSchedulingReassignmentRequestReasonCode ReasonCode { get; set; } + + /// + /// Why, in your words: required with an override of someone's availability. + /// + [Optional] + [JsonPropertyName("note")] + public string? Note { get; set; } + + [Optional] + [JsonPropertyName("overrides")] + public IEnumerable? Overrides { get; set; } + + [Optional] + [JsonPropertyName("notify")] + public CreateSchedulingReassignmentRequestNotify? Notify { get; set; } + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/sdks/dotnet/src/Coss/Scheduling/Reassignments/Requests/GetReassignmentsRequest.cs b/sdks/dotnet/src/Coss/Scheduling/Reassignments/Requests/GetReassignmentsRequest.cs new file mode 100644 index 000000000..91274c887 --- /dev/null +++ b/sdks/dotnet/src/Coss/Scheduling/Reassignments/Requests/GetReassignmentsRequest.cs @@ -0,0 +1,20 @@ +using Coss.Core; +using global::System.Text.Json.Serialization; + +namespace Coss.Scheduling; + +[Serializable] +public record GetReassignmentsRequest +{ + /// + /// The reassignment's id. + /// + [JsonIgnore] + public required string Id { get; set; } + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/sdks/dotnet/src/Coss/Scheduling/Reassignments/Requests/ItemsReassignmentsRequest.cs b/sdks/dotnet/src/Coss/Scheduling/Reassignments/Requests/ItemsReassignmentsRequest.cs new file mode 100644 index 000000000..f803bef27 --- /dev/null +++ b/sdks/dotnet/src/Coss/Scheduling/Reassignments/Requests/ItemsReassignmentsRequest.cs @@ -0,0 +1,29 @@ +using Coss.Core; +using global::System.Text.Json.Serialization; + +namespace Coss.Scheduling; + +[Serializable] +public record ItemsReassignmentsRequest +{ + /// + /// The reassignment's id. + /// + [JsonIgnore] + public required string Id { get; set; } + + [JsonIgnore] + public int? Limit { get; set; } + + /// + /// The last id of the previous page. + /// + [JsonIgnore] + public string? After { get; set; } + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/sdks/dotnet/src/Coss/Scheduling/Reassignments/Requests/ListReassignmentsRequest.cs b/sdks/dotnet/src/Coss/Scheduling/Reassignments/Requests/ListReassignmentsRequest.cs new file mode 100644 index 000000000..3fdd9208a --- /dev/null +++ b/sdks/dotnet/src/Coss/Scheduling/Reassignments/Requests/ListReassignmentsRequest.cs @@ -0,0 +1,23 @@ +using Coss.Core; +using global::System.Text.Json.Serialization; + +namespace Coss.Scheduling; + +[Serializable] +public record ListReassignmentsRequest +{ + [JsonIgnore] + public int? Limit { get; set; } + + /// + /// The last id of the previous page. + /// + [JsonIgnore] + public string? After { get; set; } + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/sdks/dotnet/src/Coss/Scheduling/Reassignments/Requests/PreviewSchedulingReassignmentRequest.cs b/sdks/dotnet/src/Coss/Scheduling/Reassignments/Requests/PreviewSchedulingReassignmentRequest.cs new file mode 100644 index 000000000..ab58e7288 --- /dev/null +++ b/sdks/dotnet/src/Coss/Scheduling/Reassignments/Requests/PreviewSchedulingReassignmentRequest.cs @@ -0,0 +1,26 @@ +using Coss; +using Coss.Core; +using global::System.Text.Json.Serialization; + +namespace Coss.Scheduling; + +[Serializable] +public record PreviewSchedulingReassignmentRequest +{ + [JsonPropertyName("selection")] + public required SchedulingReassignmentSelection Selection { get; set; } + + [Optional] + [JsonPropertyName("strategy")] + public SchedulingReassignmentStrategy? Strategy { get; set; } + + [Optional] + [JsonPropertyName("overrides")] + public IEnumerable? Overrides { get; set; } + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/sdks/dotnet/src/Coss/Scheduling/Reassignments/Requests/UndoSchedulingReassignmentRequest.cs b/sdks/dotnet/src/Coss/Scheduling/Reassignments/Requests/UndoSchedulingReassignmentRequest.cs new file mode 100644 index 000000000..f52ec2d5c --- /dev/null +++ b/sdks/dotnet/src/Coss/Scheduling/Reassignments/Requests/UndoSchedulingReassignmentRequest.cs @@ -0,0 +1,36 @@ +using Coss.Core; +using global::System.Text.Json.Serialization; + +namespace Coss.Scheduling; + +[Serializable] +public record UndoSchedulingReassignmentRequest +{ + /// + /// The reassignment's id. + /// + [JsonIgnore] + public required string Id { get; set; } + + [Optional] + [JsonPropertyName("reason_code")] + public UndoSchedulingReassignmentRequestReasonCode? ReasonCode { get; set; } + + [Optional] + [JsonPropertyName("note")] + public string? Note { get; set; } + + [Optional] + [JsonPropertyName("overrides")] + public IEnumerable? Overrides { get; set; } + + [Optional] + [JsonPropertyName("notify")] + public UndoSchedulingReassignmentRequestNotify? Notify { get; set; } + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/sdks/dotnet/src/Coss/Scheduling/Reassignments/Types/CreateSchedulingReassignmentRequestNotify.cs b/sdks/dotnet/src/Coss/Scheduling/Reassignments/Types/CreateSchedulingReassignmentRequestNotify.cs new file mode 100644 index 000000000..c16e723d0 --- /dev/null +++ b/sdks/dotnet/src/Coss/Scheduling/Reassignments/Types/CreateSchedulingReassignmentRequestNotify.cs @@ -0,0 +1,40 @@ +using Coss; +using Coss.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace Coss.Scheduling; + +[Serializable] +public record CreateSchedulingReassignmentRequestNotify : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + /// + /// Tell attendees. Default: true. + /// + [Optional] + [JsonPropertyName("attendees")] + public bool? Attendees { get; set; } + + /// + /// `digest` (the default) sends each host one email for the run. + /// + [Optional] + [JsonPropertyName("hosts")] + public CreateSchedulingReassignmentRequestNotifyHosts? Hosts { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/sdks/dotnet/src/Coss/Scheduling/Reassignments/Types/CreateSchedulingReassignmentRequestNotifyHosts.cs b/sdks/dotnet/src/Coss/Scheduling/Reassignments/Types/CreateSchedulingReassignmentRequestNotifyHosts.cs new file mode 100644 index 000000000..4e7fcf628 --- /dev/null +++ b/sdks/dotnet/src/Coss/Scheduling/Reassignments/Types/CreateSchedulingReassignmentRequestNotifyHosts.cs @@ -0,0 +1,130 @@ +using Coss.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace Coss.Scheduling; + +[JsonConverter( + typeof(CreateSchedulingReassignmentRequestNotifyHosts.CreateSchedulingReassignmentRequestNotifyHostsSerializer) +)] +[Serializable] +public readonly record struct CreateSchedulingReassignmentRequestNotifyHosts : IStringEnum +{ + public static readonly CreateSchedulingReassignmentRequestNotifyHosts Digest = new( + Values.Digest + ); + + public static readonly CreateSchedulingReassignmentRequestNotifyHosts Each = new(Values.Each); + + public static readonly CreateSchedulingReassignmentRequestNotifyHosts None = new(Values.None); + + public CreateSchedulingReassignmentRequestNotifyHosts(string value) + { + Value = value; + } + + /// + /// The string value of the enum. + /// + public string Value { get; } + + /// + /// Create a string enum with the given value. + /// + public static CreateSchedulingReassignmentRequestNotifyHosts FromCustom(string value) + { + return new CreateSchedulingReassignmentRequestNotifyHosts(value); + } + + public bool Equals(string? other) + { + return Value.Equals(other); + } + + /// + /// Returns the string value of the enum. + /// + public override string ToString() + { + return Value; + } + + public static bool operator ==( + CreateSchedulingReassignmentRequestNotifyHosts value1, + string value2 + ) => value1.Value.Equals(value2); + + public static bool operator !=( + CreateSchedulingReassignmentRequestNotifyHosts value1, + string value2 + ) => !value1.Value.Equals(value2); + + public static explicit operator string(CreateSchedulingReassignmentRequestNotifyHosts value) => + value.Value; + + public static explicit operator CreateSchedulingReassignmentRequestNotifyHosts(string value) => + new(value); + + internal class CreateSchedulingReassignmentRequestNotifyHostsSerializer + : JsonConverter + { + public override CreateSchedulingReassignmentRequestNotifyHosts Read( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON value could not be read as a string." + ); + return new CreateSchedulingReassignmentRequestNotifyHosts(stringValue); + } + + public override void Write( + Utf8JsonWriter writer, + CreateSchedulingReassignmentRequestNotifyHosts value, + JsonSerializerOptions options + ) + { + writer.WriteStringValue(value.Value); + } + + public override CreateSchedulingReassignmentRequestNotifyHosts ReadAsPropertyName( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return new CreateSchedulingReassignmentRequestNotifyHosts(stringValue); + } + + public override void WriteAsPropertyName( + Utf8JsonWriter writer, + CreateSchedulingReassignmentRequestNotifyHosts value, + JsonSerializerOptions options + ) + { + writer.WritePropertyName(value.Value); + } + } + + /// + /// Constant strings for enum values + /// + [Serializable] + public static class Values + { + public const string Digest = "digest"; + + public const string Each = "each"; + + public const string None = "none"; + } +} diff --git a/sdks/dotnet/src/Coss/Scheduling/Reassignments/Types/CreateSchedulingReassignmentRequestOverridesItem.cs b/sdks/dotnet/src/Coss/Scheduling/Reassignments/Types/CreateSchedulingReassignmentRequestOverridesItem.cs new file mode 100644 index 000000000..1ecd82ed3 --- /dev/null +++ b/sdks/dotnet/src/Coss/Scheduling/Reassignments/Types/CreateSchedulingReassignmentRequestOverridesItem.cs @@ -0,0 +1,152 @@ +using Coss.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace Coss.Scheduling; + +[JsonConverter( + typeof(CreateSchedulingReassignmentRequestOverridesItem.CreateSchedulingReassignmentRequestOverridesItemSerializer) +)] +[Serializable] +public readonly record struct CreateSchedulingReassignmentRequestOverridesItem : IStringEnum +{ + public static readonly CreateSchedulingReassignmentRequestOverridesItem AnyHost = new( + Values.AnyHost + ); + + public static readonly CreateSchedulingReassignmentRequestOverridesItem OutOfOffice = new( + Values.OutOfOffice + ); + + public static readonly CreateSchedulingReassignmentRequestOverridesItem OutsideAvailability = + new(Values.OutsideAvailability); + + public static readonly CreateSchedulingReassignmentRequestOverridesItem HostBusy = new( + Values.HostBusy + ); + + public static readonly CreateSchedulingReassignmentRequestOverridesItem LimitReached = new( + Values.LimitReached + ); + + public static readonly CreateSchedulingReassignmentRequestOverridesItem CalendarUnverified = + new(Values.CalendarUnverified); + + public CreateSchedulingReassignmentRequestOverridesItem(string value) + { + Value = value; + } + + /// + /// The string value of the enum. + /// + public string Value { get; } + + /// + /// Create a string enum with the given value. + /// + public static CreateSchedulingReassignmentRequestOverridesItem FromCustom(string value) + { + return new CreateSchedulingReassignmentRequestOverridesItem(value); + } + + public bool Equals(string? other) + { + return Value.Equals(other); + } + + /// + /// Returns the string value of the enum. + /// + public override string ToString() + { + return Value; + } + + public static bool operator ==( + CreateSchedulingReassignmentRequestOverridesItem value1, + string value2 + ) => value1.Value.Equals(value2); + + public static bool operator !=( + CreateSchedulingReassignmentRequestOverridesItem value1, + string value2 + ) => !value1.Value.Equals(value2); + + public static explicit operator string( + CreateSchedulingReassignmentRequestOverridesItem value + ) => value.Value; + + public static explicit operator CreateSchedulingReassignmentRequestOverridesItem( + string value + ) => new(value); + + internal class CreateSchedulingReassignmentRequestOverridesItemSerializer + : JsonConverter + { + public override CreateSchedulingReassignmentRequestOverridesItem Read( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON value could not be read as a string." + ); + return new CreateSchedulingReassignmentRequestOverridesItem(stringValue); + } + + public override void Write( + Utf8JsonWriter writer, + CreateSchedulingReassignmentRequestOverridesItem value, + JsonSerializerOptions options + ) + { + writer.WriteStringValue(value.Value); + } + + public override CreateSchedulingReassignmentRequestOverridesItem ReadAsPropertyName( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return new CreateSchedulingReassignmentRequestOverridesItem(stringValue); + } + + public override void WriteAsPropertyName( + Utf8JsonWriter writer, + CreateSchedulingReassignmentRequestOverridesItem value, + JsonSerializerOptions options + ) + { + writer.WritePropertyName(value.Value); + } + } + + /// + /// Constant strings for enum values + /// + [Serializable] + public static class Values + { + public const string AnyHost = "any_host"; + + public const string OutOfOffice = "out_of_office"; + + public const string OutsideAvailability = "outside_availability"; + + public const string HostBusy = "host_busy"; + + public const string LimitReached = "limit_reached"; + + public const string CalendarUnverified = "calendar_unverified"; + } +} diff --git a/sdks/dotnet/src/Coss/Scheduling/Reassignments/Types/CreateSchedulingReassignmentRequestReasonCode.cs b/sdks/dotnet/src/Coss/Scheduling/Reassignments/Types/CreateSchedulingReassignmentRequestReasonCode.cs new file mode 100644 index 000000000..4fb6c129d --- /dev/null +++ b/sdks/dotnet/src/Coss/Scheduling/Reassignments/Types/CreateSchedulingReassignmentRequestReasonCode.cs @@ -0,0 +1,150 @@ +using Coss.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace Coss.Scheduling; + +[JsonConverter( + typeof(CreateSchedulingReassignmentRequestReasonCode.CreateSchedulingReassignmentRequestReasonCodeSerializer) +)] +[Serializable] +public readonly record struct CreateSchedulingReassignmentRequestReasonCode : IStringEnum +{ + public static readonly CreateSchedulingReassignmentRequestReasonCode HostUnavailable = new( + Values.HostUnavailable + ); + + public static readonly CreateSchedulingReassignmentRequestReasonCode OutOfOffice = new( + Values.OutOfOffice + ); + + public static readonly CreateSchedulingReassignmentRequestReasonCode Workload = new( + Values.Workload + ); + + public static readonly CreateSchedulingReassignmentRequestReasonCode CustomerRequest = new( + Values.CustomerRequest + ); + + public static readonly CreateSchedulingReassignmentRequestReasonCode Offboarding = new( + Values.Offboarding + ); + + public static readonly CreateSchedulingReassignmentRequestReasonCode Other = new(Values.Other); + + public CreateSchedulingReassignmentRequestReasonCode(string value) + { + Value = value; + } + + /// + /// The string value of the enum. + /// + public string Value { get; } + + /// + /// Create a string enum with the given value. + /// + public static CreateSchedulingReassignmentRequestReasonCode FromCustom(string value) + { + return new CreateSchedulingReassignmentRequestReasonCode(value); + } + + public bool Equals(string? other) + { + return Value.Equals(other); + } + + /// + /// Returns the string value of the enum. + /// + public override string ToString() + { + return Value; + } + + public static bool operator ==( + CreateSchedulingReassignmentRequestReasonCode value1, + string value2 + ) => value1.Value.Equals(value2); + + public static bool operator !=( + CreateSchedulingReassignmentRequestReasonCode value1, + string value2 + ) => !value1.Value.Equals(value2); + + public static explicit operator string(CreateSchedulingReassignmentRequestReasonCode value) => + value.Value; + + public static explicit operator CreateSchedulingReassignmentRequestReasonCode(string value) => + new(value); + + internal class CreateSchedulingReassignmentRequestReasonCodeSerializer + : JsonConverter + { + public override CreateSchedulingReassignmentRequestReasonCode Read( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON value could not be read as a string." + ); + return new CreateSchedulingReassignmentRequestReasonCode(stringValue); + } + + public override void Write( + Utf8JsonWriter writer, + CreateSchedulingReassignmentRequestReasonCode value, + JsonSerializerOptions options + ) + { + writer.WriteStringValue(value.Value); + } + + public override CreateSchedulingReassignmentRequestReasonCode ReadAsPropertyName( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return new CreateSchedulingReassignmentRequestReasonCode(stringValue); + } + + public override void WriteAsPropertyName( + Utf8JsonWriter writer, + CreateSchedulingReassignmentRequestReasonCode value, + JsonSerializerOptions options + ) + { + writer.WritePropertyName(value.Value); + } + } + + /// + /// Constant strings for enum values + /// + [Serializable] + public static class Values + { + public const string HostUnavailable = "host_unavailable"; + + public const string OutOfOffice = "out_of_office"; + + public const string Workload = "workload"; + + public const string CustomerRequest = "customer_request"; + + public const string Offboarding = "offboarding"; + + public const string Other = "other"; + } +} diff --git a/sdks/dotnet/src/Coss/Scheduling/Reassignments/Types/PreviewSchedulingReassignmentRequestOverridesItem.cs b/sdks/dotnet/src/Coss/Scheduling/Reassignments/Types/PreviewSchedulingReassignmentRequestOverridesItem.cs new file mode 100644 index 000000000..ad3e33071 --- /dev/null +++ b/sdks/dotnet/src/Coss/Scheduling/Reassignments/Types/PreviewSchedulingReassignmentRequestOverridesItem.cs @@ -0,0 +1,152 @@ +using Coss.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace Coss.Scheduling; + +[JsonConverter( + typeof(PreviewSchedulingReassignmentRequestOverridesItem.PreviewSchedulingReassignmentRequestOverridesItemSerializer) +)] +[Serializable] +public readonly record struct PreviewSchedulingReassignmentRequestOverridesItem : IStringEnum +{ + public static readonly PreviewSchedulingReassignmentRequestOverridesItem AnyHost = new( + Values.AnyHost + ); + + public static readonly PreviewSchedulingReassignmentRequestOverridesItem OutOfOffice = new( + Values.OutOfOffice + ); + + public static readonly PreviewSchedulingReassignmentRequestOverridesItem OutsideAvailability = + new(Values.OutsideAvailability); + + public static readonly PreviewSchedulingReassignmentRequestOverridesItem HostBusy = new( + Values.HostBusy + ); + + public static readonly PreviewSchedulingReassignmentRequestOverridesItem LimitReached = new( + Values.LimitReached + ); + + public static readonly PreviewSchedulingReassignmentRequestOverridesItem CalendarUnverified = + new(Values.CalendarUnverified); + + public PreviewSchedulingReassignmentRequestOverridesItem(string value) + { + Value = value; + } + + /// + /// The string value of the enum. + /// + public string Value { get; } + + /// + /// Create a string enum with the given value. + /// + public static PreviewSchedulingReassignmentRequestOverridesItem FromCustom(string value) + { + return new PreviewSchedulingReassignmentRequestOverridesItem(value); + } + + public bool Equals(string? other) + { + return Value.Equals(other); + } + + /// + /// Returns the string value of the enum. + /// + public override string ToString() + { + return Value; + } + + public static bool operator ==( + PreviewSchedulingReassignmentRequestOverridesItem value1, + string value2 + ) => value1.Value.Equals(value2); + + public static bool operator !=( + PreviewSchedulingReassignmentRequestOverridesItem value1, + string value2 + ) => !value1.Value.Equals(value2); + + public static explicit operator string( + PreviewSchedulingReassignmentRequestOverridesItem value + ) => value.Value; + + public static explicit operator PreviewSchedulingReassignmentRequestOverridesItem( + string value + ) => new(value); + + internal class PreviewSchedulingReassignmentRequestOverridesItemSerializer + : JsonConverter + { + public override PreviewSchedulingReassignmentRequestOverridesItem Read( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON value could not be read as a string." + ); + return new PreviewSchedulingReassignmentRequestOverridesItem(stringValue); + } + + public override void Write( + Utf8JsonWriter writer, + PreviewSchedulingReassignmentRequestOverridesItem value, + JsonSerializerOptions options + ) + { + writer.WriteStringValue(value.Value); + } + + public override PreviewSchedulingReassignmentRequestOverridesItem ReadAsPropertyName( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return new PreviewSchedulingReassignmentRequestOverridesItem(stringValue); + } + + public override void WriteAsPropertyName( + Utf8JsonWriter writer, + PreviewSchedulingReassignmentRequestOverridesItem value, + JsonSerializerOptions options + ) + { + writer.WritePropertyName(value.Value); + } + } + + /// + /// Constant strings for enum values + /// + [Serializable] + public static class Values + { + public const string AnyHost = "any_host"; + + public const string OutOfOffice = "out_of_office"; + + public const string OutsideAvailability = "outside_availability"; + + public const string HostBusy = "host_busy"; + + public const string LimitReached = "limit_reached"; + + public const string CalendarUnverified = "calendar_unverified"; + } +} diff --git a/sdks/dotnet/src/Coss/Scheduling/Reassignments/Types/UndoSchedulingReassignmentRequestNotify.cs b/sdks/dotnet/src/Coss/Scheduling/Reassignments/Types/UndoSchedulingReassignmentRequestNotify.cs new file mode 100644 index 000000000..a443c562a --- /dev/null +++ b/sdks/dotnet/src/Coss/Scheduling/Reassignments/Types/UndoSchedulingReassignmentRequestNotify.cs @@ -0,0 +1,40 @@ +using Coss; +using Coss.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace Coss.Scheduling; + +[Serializable] +public record UndoSchedulingReassignmentRequestNotify : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + /// + /// Tell attendees. Default: true. + /// + [Optional] + [JsonPropertyName("attendees")] + public bool? Attendees { get; set; } + + /// + /// `digest` (the default) sends each host one email for the run. + /// + [Optional] + [JsonPropertyName("hosts")] + public UndoSchedulingReassignmentRequestNotifyHosts? Hosts { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/sdks/dotnet/src/Coss/Scheduling/Reassignments/Types/UndoSchedulingReassignmentRequestNotifyHosts.cs b/sdks/dotnet/src/Coss/Scheduling/Reassignments/Types/UndoSchedulingReassignmentRequestNotifyHosts.cs new file mode 100644 index 000000000..3c8d51bcd --- /dev/null +++ b/sdks/dotnet/src/Coss/Scheduling/Reassignments/Types/UndoSchedulingReassignmentRequestNotifyHosts.cs @@ -0,0 +1,128 @@ +using Coss.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace Coss.Scheduling; + +[JsonConverter( + typeof(UndoSchedulingReassignmentRequestNotifyHosts.UndoSchedulingReassignmentRequestNotifyHostsSerializer) +)] +[Serializable] +public readonly record struct UndoSchedulingReassignmentRequestNotifyHosts : IStringEnum +{ + public static readonly UndoSchedulingReassignmentRequestNotifyHosts Digest = new(Values.Digest); + + public static readonly UndoSchedulingReassignmentRequestNotifyHosts Each = new(Values.Each); + + public static readonly UndoSchedulingReassignmentRequestNotifyHosts None = new(Values.None); + + public UndoSchedulingReassignmentRequestNotifyHosts(string value) + { + Value = value; + } + + /// + /// The string value of the enum. + /// + public string Value { get; } + + /// + /// Create a string enum with the given value. + /// + public static UndoSchedulingReassignmentRequestNotifyHosts FromCustom(string value) + { + return new UndoSchedulingReassignmentRequestNotifyHosts(value); + } + + public bool Equals(string? other) + { + return Value.Equals(other); + } + + /// + /// Returns the string value of the enum. + /// + public override string ToString() + { + return Value; + } + + public static bool operator ==( + UndoSchedulingReassignmentRequestNotifyHosts value1, + string value2 + ) => value1.Value.Equals(value2); + + public static bool operator !=( + UndoSchedulingReassignmentRequestNotifyHosts value1, + string value2 + ) => !value1.Value.Equals(value2); + + public static explicit operator string(UndoSchedulingReassignmentRequestNotifyHosts value) => + value.Value; + + public static explicit operator UndoSchedulingReassignmentRequestNotifyHosts(string value) => + new(value); + + internal class UndoSchedulingReassignmentRequestNotifyHostsSerializer + : JsonConverter + { + public override UndoSchedulingReassignmentRequestNotifyHosts Read( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON value could not be read as a string." + ); + return new UndoSchedulingReassignmentRequestNotifyHosts(stringValue); + } + + public override void Write( + Utf8JsonWriter writer, + UndoSchedulingReassignmentRequestNotifyHosts value, + JsonSerializerOptions options + ) + { + writer.WriteStringValue(value.Value); + } + + public override UndoSchedulingReassignmentRequestNotifyHosts ReadAsPropertyName( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return new UndoSchedulingReassignmentRequestNotifyHosts(stringValue); + } + + public override void WriteAsPropertyName( + Utf8JsonWriter writer, + UndoSchedulingReassignmentRequestNotifyHosts value, + JsonSerializerOptions options + ) + { + writer.WritePropertyName(value.Value); + } + } + + /// + /// Constant strings for enum values + /// + [Serializable] + public static class Values + { + public const string Digest = "digest"; + + public const string Each = "each"; + + public const string None = "none"; + } +} diff --git a/sdks/dotnet/src/Coss/Scheduling/Reassignments/Types/UndoSchedulingReassignmentRequestOverridesItem.cs b/sdks/dotnet/src/Coss/Scheduling/Reassignments/Types/UndoSchedulingReassignmentRequestOverridesItem.cs new file mode 100644 index 000000000..358177951 --- /dev/null +++ b/sdks/dotnet/src/Coss/Scheduling/Reassignments/Types/UndoSchedulingReassignmentRequestOverridesItem.cs @@ -0,0 +1,152 @@ +using Coss.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace Coss.Scheduling; + +[JsonConverter( + typeof(UndoSchedulingReassignmentRequestOverridesItem.UndoSchedulingReassignmentRequestOverridesItemSerializer) +)] +[Serializable] +public readonly record struct UndoSchedulingReassignmentRequestOverridesItem : IStringEnum +{ + public static readonly UndoSchedulingReassignmentRequestOverridesItem AnyHost = new( + Values.AnyHost + ); + + public static readonly UndoSchedulingReassignmentRequestOverridesItem OutOfOffice = new( + Values.OutOfOffice + ); + + public static readonly UndoSchedulingReassignmentRequestOverridesItem OutsideAvailability = new( + Values.OutsideAvailability + ); + + public static readonly UndoSchedulingReassignmentRequestOverridesItem HostBusy = new( + Values.HostBusy + ); + + public static readonly UndoSchedulingReassignmentRequestOverridesItem LimitReached = new( + Values.LimitReached + ); + + public static readonly UndoSchedulingReassignmentRequestOverridesItem CalendarUnverified = new( + Values.CalendarUnverified + ); + + public UndoSchedulingReassignmentRequestOverridesItem(string value) + { + Value = value; + } + + /// + /// The string value of the enum. + /// + public string Value { get; } + + /// + /// Create a string enum with the given value. + /// + public static UndoSchedulingReassignmentRequestOverridesItem FromCustom(string value) + { + return new UndoSchedulingReassignmentRequestOverridesItem(value); + } + + public bool Equals(string? other) + { + return Value.Equals(other); + } + + /// + /// Returns the string value of the enum. + /// + public override string ToString() + { + return Value; + } + + public static bool operator ==( + UndoSchedulingReassignmentRequestOverridesItem value1, + string value2 + ) => value1.Value.Equals(value2); + + public static bool operator !=( + UndoSchedulingReassignmentRequestOverridesItem value1, + string value2 + ) => !value1.Value.Equals(value2); + + public static explicit operator string(UndoSchedulingReassignmentRequestOverridesItem value) => + value.Value; + + public static explicit operator UndoSchedulingReassignmentRequestOverridesItem(string value) => + new(value); + + internal class UndoSchedulingReassignmentRequestOverridesItemSerializer + : JsonConverter + { + public override UndoSchedulingReassignmentRequestOverridesItem Read( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON value could not be read as a string." + ); + return new UndoSchedulingReassignmentRequestOverridesItem(stringValue); + } + + public override void Write( + Utf8JsonWriter writer, + UndoSchedulingReassignmentRequestOverridesItem value, + JsonSerializerOptions options + ) + { + writer.WriteStringValue(value.Value); + } + + public override UndoSchedulingReassignmentRequestOverridesItem ReadAsPropertyName( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return new UndoSchedulingReassignmentRequestOverridesItem(stringValue); + } + + public override void WriteAsPropertyName( + Utf8JsonWriter writer, + UndoSchedulingReassignmentRequestOverridesItem value, + JsonSerializerOptions options + ) + { + writer.WritePropertyName(value.Value); + } + } + + /// + /// Constant strings for enum values + /// + [Serializable] + public static class Values + { + public const string AnyHost = "any_host"; + + public const string OutOfOffice = "out_of_office"; + + public const string OutsideAvailability = "outside_availability"; + + public const string HostBusy = "host_busy"; + + public const string LimitReached = "limit_reached"; + + public const string CalendarUnverified = "calendar_unverified"; + } +} diff --git a/sdks/dotnet/src/Coss/Scheduling/Reassignments/Types/UndoSchedulingReassignmentRequestReasonCode.cs b/sdks/dotnet/src/Coss/Scheduling/Reassignments/Types/UndoSchedulingReassignmentRequestReasonCode.cs new file mode 100644 index 000000000..1be51b20f --- /dev/null +++ b/sdks/dotnet/src/Coss/Scheduling/Reassignments/Types/UndoSchedulingReassignmentRequestReasonCode.cs @@ -0,0 +1,150 @@ +using Coss.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace Coss.Scheduling; + +[JsonConverter( + typeof(UndoSchedulingReassignmentRequestReasonCode.UndoSchedulingReassignmentRequestReasonCodeSerializer) +)] +[Serializable] +public readonly record struct UndoSchedulingReassignmentRequestReasonCode : IStringEnum +{ + public static readonly UndoSchedulingReassignmentRequestReasonCode HostUnavailable = new( + Values.HostUnavailable + ); + + public static readonly UndoSchedulingReassignmentRequestReasonCode OutOfOffice = new( + Values.OutOfOffice + ); + + public static readonly UndoSchedulingReassignmentRequestReasonCode Workload = new( + Values.Workload + ); + + public static readonly UndoSchedulingReassignmentRequestReasonCode CustomerRequest = new( + Values.CustomerRequest + ); + + public static readonly UndoSchedulingReassignmentRequestReasonCode Offboarding = new( + Values.Offboarding + ); + + public static readonly UndoSchedulingReassignmentRequestReasonCode Other = new(Values.Other); + + public UndoSchedulingReassignmentRequestReasonCode(string value) + { + Value = value; + } + + /// + /// The string value of the enum. + /// + public string Value { get; } + + /// + /// Create a string enum with the given value. + /// + public static UndoSchedulingReassignmentRequestReasonCode FromCustom(string value) + { + return new UndoSchedulingReassignmentRequestReasonCode(value); + } + + public bool Equals(string? other) + { + return Value.Equals(other); + } + + /// + /// Returns the string value of the enum. + /// + public override string ToString() + { + return Value; + } + + public static bool operator ==( + UndoSchedulingReassignmentRequestReasonCode value1, + string value2 + ) => value1.Value.Equals(value2); + + public static bool operator !=( + UndoSchedulingReassignmentRequestReasonCode value1, + string value2 + ) => !value1.Value.Equals(value2); + + public static explicit operator string(UndoSchedulingReassignmentRequestReasonCode value) => + value.Value; + + public static explicit operator UndoSchedulingReassignmentRequestReasonCode(string value) => + new(value); + + internal class UndoSchedulingReassignmentRequestReasonCodeSerializer + : JsonConverter + { + public override UndoSchedulingReassignmentRequestReasonCode Read( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON value could not be read as a string." + ); + return new UndoSchedulingReassignmentRequestReasonCode(stringValue); + } + + public override void Write( + Utf8JsonWriter writer, + UndoSchedulingReassignmentRequestReasonCode value, + JsonSerializerOptions options + ) + { + writer.WriteStringValue(value.Value); + } + + public override UndoSchedulingReassignmentRequestReasonCode ReadAsPropertyName( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return new UndoSchedulingReassignmentRequestReasonCode(stringValue); + } + + public override void WriteAsPropertyName( + Utf8JsonWriter writer, + UndoSchedulingReassignmentRequestReasonCode value, + JsonSerializerOptions options + ) + { + writer.WritePropertyName(value.Value); + } + } + + /// + /// Constant strings for enum values + /// + [Serializable] + public static class Values + { + public const string HostUnavailable = "host_unavailable"; + + public const string OutOfOffice = "out_of_office"; + + public const string Workload = "workload"; + + public const string CustomerRequest = "customer_request"; + + public const string Offboarding = "offboarding"; + + public const string Other = "other"; + } +} diff --git a/sdks/dotnet/src/Coss/Scheduling/SchedulingClient.cs b/sdks/dotnet/src/Coss/Scheduling/SchedulingClient.cs index 7575695f8..22333e8fd 100644 --- a/sdks/dotnet/src/Coss/Scheduling/SchedulingClient.cs +++ b/sdks/dotnet/src/Coss/Scheduling/SchedulingClient.cs @@ -10,22 +10,34 @@ internal SchedulingClient(RawClient client) { _client = client; Hosts = new HostsClient(_client); + Bookings = new BookingsClient(_client); + Reassignments = new ReassignmentsClient(_client); + HolidayCalendars = new HolidayCalendarsClient(_client); + OutOfOffice = new OutOfOfficeClient(_client); Schedules = new SchedulesClient(_client); EventTypes = new EventTypesClient(_client); Slots = new SlotsClient(_client); Availability = new AvailabilityClient(_client); - Bookings = new BookingsClient(_client); Holds = new HoldsClient(_client); Series = new SeriesClient(_client); Attendees = new AttendeesClient(_client); Calendars = new CalendarsClient(_client); CalendarDelegations = new CalendarDelegationsClient(_client); + OauthApps = new OauthAppsClient(_client); Sessions = new SessionsClient(_client); Settings = new SettingsClient(_client); } public IHostsClient Hosts { get; } + public IBookingsClient Bookings { get; } + + public IReassignmentsClient Reassignments { get; } + + public IHolidayCalendarsClient HolidayCalendars { get; } + + public IOutOfOfficeClient OutOfOffice { get; } + public ISchedulesClient Schedules { get; } public IEventTypesClient EventTypes { get; } @@ -34,8 +46,6 @@ internal SchedulingClient(RawClient client) public IAvailabilityClient Availability { get; } - public IBookingsClient Bookings { get; } - public IHoldsClient Holds { get; } public ISeriesClient Series { get; } @@ -46,6 +56,8 @@ internal SchedulingClient(RawClient client) public ICalendarDelegationsClient CalendarDelegations { get; } + public IOauthAppsClient OauthApps { get; } + public ISessionsClient Sessions { get; } public ISettingsClient Settings { get; } diff --git a/sdks/dotnet/src/Coss/Scheduling/Sessions/ISessionsClient.cs b/sdks/dotnet/src/Coss/Scheduling/Sessions/ISessionsClient.cs index ac3b36b3f..4763e7f7a 100644 --- a/sdks/dotnet/src/Coss/Scheduling/Sessions/ISessionsClient.cs +++ b/sdks/dotnet/src/Coss/Scheduling/Sessions/ISessionsClient.cs @@ -4,6 +4,15 @@ namespace Coss.Scheduling; public partial interface ISessionsClient { + /// + /// Lets a team lead manage cover for the hosts you name, or those matching an attribute filter whenever it's asked: time off, bookings that need someone else, and moving them. It never sees attendees' details. Send the `url` to their browser, or embed it with `coss/scheduling`. + /// + WithRawResponseTask CreateForManagerAsync( + CreateSchedulingManagerSessionRequest request, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ); + /// /// Lets one host manage their own hours, calendars and locations, on coss.com's hosted page or your own UI. Send the `url` to their browser, or embed it with `coss/scheduling`. /// diff --git a/sdks/dotnet/src/Coss/Scheduling/Sessions/Requests/CreateSchedulingManagerSessionRequest.cs b/sdks/dotnet/src/Coss/Scheduling/Sessions/Requests/CreateSchedulingManagerSessionRequest.cs new file mode 100644 index 000000000..00cbba231 --- /dev/null +++ b/sdks/dotnet/src/Coss/Scheduling/Sessions/Requests/CreateSchedulingManagerSessionRequest.cs @@ -0,0 +1,40 @@ +using Coss.Core; +using global::System.Text.Json.Serialization; +using OneOf; + +namespace Coss.Scheduling; + +[Serializable] +public record CreateSchedulingManagerSessionRequest +{ + /// + /// The hosts this page can reach, by id or uid. + /// + [Optional] + [JsonPropertyName("hosts")] + public IEnumerable? Hosts { get; set; } + + /// + /// Everyone matching these attributes, asked again on every request. + /// + [Optional] + [JsonPropertyName("host_filter")] + public Dictionary>>? HostFilter { get; set; } + + /// + /// Seconds until it stops working. At most a day. + /// + [Optional] + [JsonPropertyName("expires_in")] + public int? ExpiresIn { get; set; } + + [Optional] + [JsonPropertyName("read_only")] + public bool? ReadOnly { get; set; } + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/sdks/dotnet/src/Coss/Scheduling/Sessions/SessionsClient.cs b/sdks/dotnet/src/Coss/Scheduling/Sessions/SessionsClient.cs index 5f56df73e..ac0911b70 100644 --- a/sdks/dotnet/src/Coss/Scheduling/Sessions/SessionsClient.cs +++ b/sdks/dotnet/src/Coss/Scheduling/Sessions/SessionsClient.cs @@ -13,6 +13,209 @@ internal SessionsClient(RawClient client) _client = client; } + private async Task> CreateForManagerAsyncCore( + CreateSchedulingManagerSessionRequest request, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ) + { + var _queryString = new Coss.Core.QueryStringBuilder.Builder(capacity: 0) + .MergeAdditional(options?.AdditionalQueryParameters) + .Build(); + var _headers = await new Coss.Core.HeadersBuilder.Builder() + .Add(_client.Options.Headers) + .Add(_client.Options.AdditionalHeaders) + .AddIdempotencyHeader() + .Add(options?.AdditionalHeaders) + .BuildAsync() + .ConfigureAwait(false); + var response = await _client + .SendRequestAsync( + new JsonRequest + { + Method = HttpMethod.Post, + Path = "v1/scheduling/manager_sessions", + Body = request, + QueryString = _queryString, + Headers = _headers, + ContentType = "application/json", + Options = options, + RetriesDisabled = true, + }, + cancellationToken + ) + .ConfigureAwait(false); + if (response.StatusCode is >= 200 and < 400) + { + var responseBody = await response + .Raw.Content.ReadAsStringAsync(cancellationToken) + .ConfigureAwait(false); + try + { + var responseData = JsonUtils.Deserialize(responseBody)!; + return new WithRawResponse() + { + Data = responseData, + RawResponse = new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = response.Raw.RequestMessage?.RequestUri ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + }, + }; + } + catch (JsonException e) + { + throw new CossClientApiException( + "Failed to deserialize response", + response.StatusCode, + responseBody, + e, + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = response.Raw.RequestMessage?.RequestUri ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + } + } + { + var responseBody = await response + .Raw.Content.ReadAsStringAsync(cancellationToken) + .ConfigureAwait(false); + try + { + switch (response.StatusCode) + { + case 400: + throw new BadRequestError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 401: + throw new UnauthorizedError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 403: + throw new ForbiddenError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 404: + throw new NotFoundError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 415: + throw new UnsupportedMediaTypeError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 422: + throw new UnprocessableEntityError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 429: + throw new TooManyRequestsError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 500: + throw new InternalServerError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 503: + throw new ServiceUnavailableError( + JsonUtils.Deserialize(responseBody), + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + } + } + catch (JsonException) + { + // unable to map error response, throwing generic error + } + throw new CossClientApiException( + $"Error with status code {response.StatusCode}", + response.StatusCode, + responseBody, + rawResponse: new Coss.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = response.Raw.RequestMessage?.RequestUri ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + } + } + private async Task> CreateForHostAsyncCore( CreateSchedulingHostSessionRequest request, RequestOptions? options = null, @@ -626,6 +829,32 @@ private async Task> CreateForBookingAsyncCore } } + /// + /// Lets a team lead manage cover for the hosts you name, or those matching an attribute filter whenever it's asked: time off, bookings that need someone else, and moving them. It never sees attendees' details. Send the `url` to their browser, or embed it with `coss/scheduling`. + /// + /// + /// await client.Scheduling.Sessions.CreateForManagerAsync( + /// new CreateSchedulingManagerSessionRequest + /// { + /// HostFilter = new Dictionary<string, OneOf<string, IEnumerable<string>>>() + /// { + /// { "team", "cardiology" }, + /// }, + /// ExpiresIn = 3600, + /// } + /// ); + /// + public WithRawResponseTask CreateForManagerAsync( + CreateSchedulingManagerSessionRequest request, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ) + { + return new WithRawResponseTask( + CreateForManagerAsyncCore(request, options, cancellationToken) + ); + } + /// /// Lets one host manage their own hours, calendars and locations, on coss.com's hosted page or your own UI. Send the `url` to their browser, or embed it with `coss/scheduling`. /// diff --git a/sdks/dotnet/src/Coss/Scheduling/Settings/Requests/UpdateSchedulingSettingsRequest.cs b/sdks/dotnet/src/Coss/Scheduling/Settings/Requests/UpdateSchedulingSettingsRequest.cs index e589f0128..d381a2831 100644 --- a/sdks/dotnet/src/Coss/Scheduling/Settings/Requests/UpdateSchedulingSettingsRequest.cs +++ b/sdks/dotnet/src/Coss/Scheduling/Settings/Requests/UpdateSchedulingSettingsRequest.cs @@ -35,6 +35,13 @@ public record UpdateSchedulingSettingsRequest [JsonPropertyName("logo")] public Optional Logo { get; set; } + /// + /// Your privacy policy, as an https URL, for hosts connecting a calendar through your own OAuth app. `null` removes it. + /// + [Nullable, Optional] + [JsonPropertyName("privacy_url")] + public Optional PrivacyUrl { get; set; } + /// /// Sender of booking emails, on a verified domain. `null`: coss.com's own address. /// @@ -56,6 +63,27 @@ public record UpdateSchedulingSettingsRequest [JsonPropertyName("calendar_failure_mode")] public UpdateSchedulingSettingsRequestCalendarFailureMode? CalendarFailureMode { get; set; } + /// + /// Name the new host when telling an attendee their booking has one. + /// + [Optional] + [JsonPropertyName("name_host_in_attendee_emails")] + public bool? NameHostInAttendeeEmails { get; set; } + + /// + /// Whether hosts can give their own bookings to someone else from their page. `eligible` lets them, to anyone free who takes that event type. + /// + [Optional] + [JsonPropertyName("host_reassignment")] + public UpdateSchedulingSettingsRequestHostReassignment? HostReassignment { get; set; } + + /// + /// Reasons of your own, on top of the preset ones. Hosts and managers see them. + /// + [Nullable, Optional] + [JsonPropertyName("out_of_office_reasons")] + public Optional?> OutOfOfficeReasons { get; set; } + /// /// Per event (`confirmed`, `pending_approval`, `rescheduled`, `cancelled`, `declined`, `reminder`), overriding the defaults. `null` restores them. /// diff --git a/sdks/dotnet/src/Coss/Scheduling/Settings/Types/UpdateSchedulingSettingsRequestHostReassignment.cs b/sdks/dotnet/src/Coss/Scheduling/Settings/Types/UpdateSchedulingSettingsRequestHostReassignment.cs new file mode 100644 index 000000000..0ee367e91 --- /dev/null +++ b/sdks/dotnet/src/Coss/Scheduling/Settings/Types/UpdateSchedulingSettingsRequestHostReassignment.cs @@ -0,0 +1,126 @@ +using Coss.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace Coss.Scheduling; + +[JsonConverter( + typeof(UpdateSchedulingSettingsRequestHostReassignment.UpdateSchedulingSettingsRequestHostReassignmentSerializer) +)] +[Serializable] +public readonly record struct UpdateSchedulingSettingsRequestHostReassignment : IStringEnum +{ + public static readonly UpdateSchedulingSettingsRequestHostReassignment Off = new(Values.Off); + + public static readonly UpdateSchedulingSettingsRequestHostReassignment Eligible = new( + Values.Eligible + ); + + public UpdateSchedulingSettingsRequestHostReassignment(string value) + { + Value = value; + } + + /// + /// The string value of the enum. + /// + public string Value { get; } + + /// + /// Create a string enum with the given value. + /// + public static UpdateSchedulingSettingsRequestHostReassignment FromCustom(string value) + { + return new UpdateSchedulingSettingsRequestHostReassignment(value); + } + + public bool Equals(string? other) + { + return Value.Equals(other); + } + + /// + /// Returns the string value of the enum. + /// + public override string ToString() + { + return Value; + } + + public static bool operator ==( + UpdateSchedulingSettingsRequestHostReassignment value1, + string value2 + ) => value1.Value.Equals(value2); + + public static bool operator !=( + UpdateSchedulingSettingsRequestHostReassignment value1, + string value2 + ) => !value1.Value.Equals(value2); + + public static explicit operator string(UpdateSchedulingSettingsRequestHostReassignment value) => + value.Value; + + public static explicit operator UpdateSchedulingSettingsRequestHostReassignment(string value) => + new(value); + + internal class UpdateSchedulingSettingsRequestHostReassignmentSerializer + : JsonConverter + { + public override UpdateSchedulingSettingsRequestHostReassignment Read( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON value could not be read as a string." + ); + return new UpdateSchedulingSettingsRequestHostReassignment(stringValue); + } + + public override void Write( + Utf8JsonWriter writer, + UpdateSchedulingSettingsRequestHostReassignment value, + JsonSerializerOptions options + ) + { + writer.WriteStringValue(value.Value); + } + + public override UpdateSchedulingSettingsRequestHostReassignment ReadAsPropertyName( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return new UpdateSchedulingSettingsRequestHostReassignment(stringValue); + } + + public override void WriteAsPropertyName( + Utf8JsonWriter writer, + UpdateSchedulingSettingsRequestHostReassignment value, + JsonSerializerOptions options + ) + { + writer.WritePropertyName(value.Value); + } + } + + /// + /// Constant strings for enum values + /// + [Serializable] + public static class Values + { + public const string Off = "off"; + + public const string Eligible = "eligible"; + } +} diff --git a/sdks/dotnet/src/Coss/Scheduling/Settings/Types/UpdateSchedulingSettingsRequestOutOfOfficeReasonsItem.cs b/sdks/dotnet/src/Coss/Scheduling/Settings/Types/UpdateSchedulingSettingsRequestOutOfOfficeReasonsItem.cs new file mode 100644 index 000000000..70497224c --- /dev/null +++ b/sdks/dotnet/src/Coss/Scheduling/Settings/Types/UpdateSchedulingSettingsRequestOutOfOfficeReasonsItem.cs @@ -0,0 +1,35 @@ +using Coss; +using Coss.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace Coss.Scheduling; + +[Serializable] +public record UpdateSchedulingSettingsRequestOutOfOfficeReasonsItem : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + /// + /// One of `unspecified`, `vacation`, `travel`, `sick`, `public_holiday`, `parental_leave`, `training` and `other`, or a key from the settings' `out_of_office_reasons`. Only people who manage this host see it: never bookers, webhooks or calendars. + /// + [JsonPropertyName("key")] + public required string Key { get; set; } + + [JsonPropertyName("label")] + public required string Label { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/sdks/dotnet/src/Coss/Types/CreateOauthAppRequest.cs b/sdks/dotnet/src/Coss/Types/CreateOauthAppRequest.cs new file mode 100644 index 000000000..8f6ecfba7 --- /dev/null +++ b/sdks/dotnet/src/Coss/Types/CreateOauthAppRequest.cs @@ -0,0 +1,360 @@ +// ReSharper disable NullableWarningSuppressionIsUsed +// ReSharper disable InconsistentNaming + +using Coss.Core; +using global::System.Text.Json; +using global::System.Text.Json.Nodes; +using global::System.Text.Json.Serialization; + +namespace Coss; + +[JsonConverter(typeof(CreateOauthAppRequest.JsonConverter))] +[Serializable] +public record CreateOauthAppRequest +{ + internal CreateOauthAppRequest(string type, object? value) + { + Provider = type; + Value = value; + } + + /// + /// Create an instance of CreateOauthAppRequest with . + /// + public CreateOauthAppRequest(CreateOauthAppRequest.Google value) + { + Provider = "google"; + Value = value.Value; + } + + /// + /// Create an instance of CreateOauthAppRequest with . + /// + public CreateOauthAppRequest(CreateOauthAppRequest.Microsoft value) + { + Provider = "microsoft"; + Value = value.Value; + } + + /// + /// Create an instance of CreateOauthAppRequest with . + /// + public CreateOauthAppRequest(CreateOauthAppRequest.Zoom value) + { + Provider = "zoom"; + Value = value.Value; + } + + /// + /// Discriminant value + /// + [JsonPropertyName("provider")] + public string Provider { get; internal set; } + + /// + /// Discriminated union value + /// + public object? Value { get; internal set; } + + /// + /// Returns true if is "google" + /// + public bool IsGoogle => Provider == "google"; + + /// + /// Returns true if is "microsoft" + /// + public bool IsMicrosoft => Provider == "microsoft"; + + /// + /// Returns true if is "zoom" + /// + public bool IsZoom => Provider == "zoom"; + + /// + /// Returns the value as a if is 'google', otherwise throws an exception. + /// + /// Thrown when is not 'google'. + public Coss.CreateOauthAppRequestGoogle AsGoogle() => + IsGoogle + ? (Coss.CreateOauthAppRequestGoogle)Value! + : throw new global::System.Exception("CreateOauthAppRequest.Provider is not 'google'"); + + /// + /// Returns the value as a if is 'microsoft', otherwise throws an exception. + /// + /// Thrown when is not 'microsoft'. + public Coss.CreateOauthAppRequestMicrosoft AsMicrosoft() => + IsMicrosoft + ? (Coss.CreateOauthAppRequestMicrosoft)Value! + : throw new global::System.Exception( + "CreateOauthAppRequest.Provider is not 'microsoft'" + ); + + /// + /// Returns the value as a if is 'zoom', otherwise throws an exception. + /// + /// Thrown when is not 'zoom'. + public Coss.CreateOauthAppRequestZoom AsZoom() => + IsZoom + ? (Coss.CreateOauthAppRequestZoom)Value! + : throw new global::System.Exception("CreateOauthAppRequest.Provider is not 'zoom'"); + + public T Match( + Func onGoogle, + Func onMicrosoft, + Func onZoom, + Func onUnknown_ + ) + { + return Provider switch + { + "google" => onGoogle(AsGoogle()), + "microsoft" => onMicrosoft(AsMicrosoft()), + "zoom" => onZoom(AsZoom()), + _ => onUnknown_(Provider, Value), + }; + } + + public void Visit( + Action onGoogle, + Action onMicrosoft, + Action onZoom, + Action onUnknown_ + ) + { + switch (Provider) + { + case "google": + onGoogle(AsGoogle()); + break; + case "microsoft": + onMicrosoft(AsMicrosoft()); + break; + case "zoom": + onZoom(AsZoom()); + break; + default: + onUnknown_(Provider, Value); + break; + } + } + + /// + /// Attempts to cast the value to a and returns true if successful. + /// + public bool TryAsGoogle(out Coss.CreateOauthAppRequestGoogle? value) + { + if (Provider == "google") + { + value = (Coss.CreateOauthAppRequestGoogle)Value!; + return true; + } + value = null; + return false; + } + + /// + /// Attempts to cast the value to a and returns true if successful. + /// + public bool TryAsMicrosoft(out Coss.CreateOauthAppRequestMicrosoft? value) + { + if (Provider == "microsoft") + { + value = (Coss.CreateOauthAppRequestMicrosoft)Value!; + return true; + } + value = null; + return false; + } + + /// + /// Attempts to cast the value to a and returns true if successful. + /// + public bool TryAsZoom(out Coss.CreateOauthAppRequestZoom? value) + { + if (Provider == "zoom") + { + value = (Coss.CreateOauthAppRequestZoom)Value!; + return true; + } + value = null; + return false; + } + + public override string ToString() => JsonUtils.Serialize(this); + + public static implicit operator CreateOauthAppRequest(CreateOauthAppRequest.Google value) => + new(value); + + public static implicit operator CreateOauthAppRequest(CreateOauthAppRequest.Microsoft value) => + new(value); + + public static implicit operator CreateOauthAppRequest(CreateOauthAppRequest.Zoom value) => + new(value); + + [Serializable] + internal sealed class JsonConverter : JsonConverter + { + public override bool CanConvert(global::System.Type typeToConvert) => + typeof(CreateOauthAppRequest).IsAssignableFrom(typeToConvert); + + public override CreateOauthAppRequest Read( + ref Utf8JsonReader reader, + global::System.Type typeToConvert, + JsonSerializerOptions options + ) + { + var json = JsonElement.ParseValue(ref reader); + if (!json.TryGetProperty("provider", out var discriminatorElement)) + { + throw new JsonException("Missing discriminator property 'provider'"); + } + if (discriminatorElement.ValueKind != JsonValueKind.String) + { + if (discriminatorElement.ValueKind == JsonValueKind.Null) + { + throw new JsonException("Discriminator property 'provider' is null"); + } + + throw new JsonException( + $"Discriminator property 'provider' is not a string, instead is {discriminatorElement.ToString()}" + ); + } + + var discriminator = + discriminatorElement.GetString() + ?? throw new JsonException("Discriminator property 'provider' is null"); + + // Strip the discriminant property to prevent it from leaking into AdditionalProperties + var jsonObject = System.Text.Json.Nodes.JsonObject.Create(json); + jsonObject?.Remove("provider"); + var jsonWithoutDiscriminator = + jsonObject != null ? JsonSerializer.SerializeToElement(jsonObject, options) : json; + + var value = discriminator switch + { + "google" => jsonWithoutDiscriminator.Deserialize( + options + ) + ?? throw new JsonException( + "Failed to deserialize Coss.CreateOauthAppRequestGoogle" + ), + "microsoft" => + jsonWithoutDiscriminator.Deserialize( + options + ) + ?? throw new JsonException( + "Failed to deserialize Coss.CreateOauthAppRequestMicrosoft" + ), + "zoom" => jsonWithoutDiscriminator.Deserialize( + options + ) + ?? throw new JsonException( + "Failed to deserialize Coss.CreateOauthAppRequestZoom" + ), + _ => json.Deserialize(options), + }; + return new CreateOauthAppRequest(discriminator, value); + } + + public override void Write( + Utf8JsonWriter writer, + CreateOauthAppRequest value, + JsonSerializerOptions options + ) + { + JsonNode json = + value.Provider switch + { + "google" => JsonSerializer.SerializeToNode(value.Value, options), + "microsoft" => JsonSerializer.SerializeToNode(value.Value, options), + "zoom" => JsonSerializer.SerializeToNode(value.Value, options), + _ => JsonSerializer.SerializeToNode(value.Value, options), + } ?? new JsonObject(); + json["provider"] = value.Provider; + json.WriteTo(writer, options); + } + + public override CreateOauthAppRequest ReadAsPropertyName( + ref Utf8JsonReader reader, + global::System.Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new JsonException("The JSON property name could not be read as a string."); + return new CreateOauthAppRequest(stringValue, stringValue); + } + + public override void WriteAsPropertyName( + Utf8JsonWriter writer, + CreateOauthAppRequest value, + JsonSerializerOptions options + ) + { + writer.WritePropertyName(value.Provider); + } + } + + /// + /// Discriminated union type for google + /// + [Serializable] + public struct Google + { + public Google(Coss.CreateOauthAppRequestGoogle value) + { + Value = value; + } + + internal Coss.CreateOauthAppRequestGoogle Value { get; set; } + + public override string ToString() => Value.ToString() ?? "null"; + + public static implicit operator CreateOauthAppRequest.Google( + Coss.CreateOauthAppRequestGoogle value + ) => new(value); + } + + /// + /// Discriminated union type for microsoft + /// + [Serializable] + public struct Microsoft + { + public Microsoft(Coss.CreateOauthAppRequestMicrosoft value) + { + Value = value; + } + + internal Coss.CreateOauthAppRequestMicrosoft Value { get; set; } + + public override string ToString() => Value.ToString() ?? "null"; + + public static implicit operator CreateOauthAppRequest.Microsoft( + Coss.CreateOauthAppRequestMicrosoft value + ) => new(value); + } + + /// + /// Discriminated union type for zoom + /// + [Serializable] + public struct Zoom + { + public Zoom(Coss.CreateOauthAppRequestZoom value) + { + Value = value; + } + + internal Coss.CreateOauthAppRequestZoom Value { get; set; } + + public override string ToString() => Value.ToString() ?? "null"; + + public static implicit operator CreateOauthAppRequest.Zoom( + Coss.CreateOauthAppRequestZoom value + ) => new(value); + } +} diff --git a/sdks/dotnet/src/Coss/Types/CreateOauthAppRequestGoogle.cs b/sdks/dotnet/src/Coss/Types/CreateOauthAppRequestGoogle.cs new file mode 100644 index 000000000..f0e50179a --- /dev/null +++ b/sdks/dotnet/src/Coss/Types/CreateOauthAppRequestGoogle.cs @@ -0,0 +1,58 @@ +using Coss.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace Coss; + +[Serializable] +public record CreateOauthAppRequestGoogle : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + /// + /// The app's client ID at the provider. + /// + [JsonPropertyName("client_id")] + public required string ClientId { get; set; } + + /// + /// The app's client secret. Never returned. + /// + [JsonPropertyName("client_secret")] + public required string ClientSecret { get; set; } + + /// + /// A page on your own domain, registered with the provider, that forwards `code` and `state` to `coss_callback_url`. Google requires this for an external app, since it has to verify the redirect's domain as yours. Leave it out to use `coss_callback_url` directly. + /// + [Optional] + [JsonPropertyName("redirect_uri")] + public string? RedirectUri { get; set; } + + /// + /// Where the browser lands after a consent that didn't name a `return_url`, with `coss_calendar` set to `connected`, `denied` or `invalid`. Leave it out for a plain page saying what happened. + /// + [Optional] + [JsonPropertyName("completion_url")] + public string? CompletionUrl { get; set; } + + /// + /// When the client secret expires. Owners and admins are warned 14 days before. + /// + [Optional] + [JsonPropertyName("secret_expires_at")] + public DateTime? SecretExpiresAt { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/sdks/dotnet/src/Coss/Types/CreateOauthAppRequestMicrosoft.cs b/sdks/dotnet/src/Coss/Types/CreateOauthAppRequestMicrosoft.cs new file mode 100644 index 000000000..108ae3a96 --- /dev/null +++ b/sdks/dotnet/src/Coss/Types/CreateOauthAppRequestMicrosoft.cs @@ -0,0 +1,65 @@ +using Coss.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace Coss; + +[Serializable] +public record CreateOauthAppRequestMicrosoft : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + /// + /// The app's client ID at the provider. + /// + [JsonPropertyName("client_id")] + public required string ClientId { get; set; } + + /// + /// The app's client secret. Never returned. + /// + [JsonPropertyName("client_secret")] + public required string ClientSecret { get; set; } + + /// + /// The Directory (tenant) ID, for an app that's only for your own tenant. Leave it out for a multi-tenant app. + /// + [Optional] + [JsonPropertyName("tenant_id")] + public string? TenantId { get; set; } + + /// + /// A page on your own domain, registered with the provider, that forwards `code` and `state` to `coss_callback_url`. Google requires this for an external app, since it has to verify the redirect's domain as yours. Leave it out to use `coss_callback_url` directly. + /// + [Optional] + [JsonPropertyName("redirect_uri")] + public string? RedirectUri { get; set; } + + /// + /// Where the browser lands after a consent that didn't name a `return_url`, with `coss_calendar` set to `connected`, `denied` or `invalid`. Leave it out for a plain page saying what happened. + /// + [Optional] + [JsonPropertyName("completion_url")] + public string? CompletionUrl { get; set; } + + /// + /// When the client secret expires. Owners and admins are warned 14 days before. + /// + [Optional] + [JsonPropertyName("secret_expires_at")] + public DateTime? SecretExpiresAt { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/sdks/dotnet/src/Coss/Types/CreateOauthAppRequestZoom.cs b/sdks/dotnet/src/Coss/Types/CreateOauthAppRequestZoom.cs new file mode 100644 index 000000000..14e6fd888 --- /dev/null +++ b/sdks/dotnet/src/Coss/Types/CreateOauthAppRequestZoom.cs @@ -0,0 +1,65 @@ +using Coss.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace Coss; + +[Serializable] +public record CreateOauthAppRequestZoom : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + /// + /// The app's client ID at the provider. + /// + [JsonPropertyName("client_id")] + public required string ClientId { get; set; } + + /// + /// The app's client secret. Never returned. + /// + [JsonPropertyName("client_secret")] + public required string ClientSecret { get; set; } + + /// + /// The Secret Token of your Zoom app, which signs its events at `zoom_event_url`. Never returned. + /// + [Optional] + [JsonPropertyName("webhook_secret")] + public string? WebhookSecret { get; set; } + + /// + /// A page on your own domain, registered with the provider, that forwards `code` and `state` to `coss_callback_url`. Google requires this for an external app, since it has to verify the redirect's domain as yours. Leave it out to use `coss_callback_url` directly. + /// + [Optional] + [JsonPropertyName("redirect_uri")] + public string? RedirectUri { get; set; } + + /// + /// Where the browser lands after a consent that didn't name a `return_url`, with `coss_calendar` set to `connected`, `denied` or `invalid`. Leave it out for a plain page saying what happened. + /// + [Optional] + [JsonPropertyName("completion_url")] + public string? CompletionUrl { get; set; } + + /// + /// When the client secret expires. Owners and admins are warned 14 days before. + /// + [Optional] + [JsonPropertyName("secret_expires_at")] + public DateTime? SecretExpiresAt { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/sdks/dotnet/src/Coss/Types/DeletedSchedulingHolidayCalendar.cs b/sdks/dotnet/src/Coss/Types/DeletedSchedulingHolidayCalendar.cs new file mode 100644 index 000000000..621439be0 --- /dev/null +++ b/sdks/dotnet/src/Coss/Types/DeletedSchedulingHolidayCalendar.cs @@ -0,0 +1,31 @@ +using Coss.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace Coss; + +[Serializable] +public record DeletedSchedulingHolidayCalendar : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + [JsonPropertyName("id")] + public required string Id { get; set; } + + [JsonPropertyName("deleted")] + public required bool Deleted { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/sdks/dotnet/src/Coss/Types/DeletedSchedulingOauthApp.cs b/sdks/dotnet/src/Coss/Types/DeletedSchedulingOauthApp.cs new file mode 100644 index 000000000..35cba6792 --- /dev/null +++ b/sdks/dotnet/src/Coss/Types/DeletedSchedulingOauthApp.cs @@ -0,0 +1,34 @@ +using Coss.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace Coss; + +[Serializable] +public record DeletedSchedulingOauthApp : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + [JsonPropertyName("object")] + public required DeletedSchedulingOauthAppObject Object { get; set; } + + [JsonPropertyName("id")] + public required string Id { get; set; } + + [JsonPropertyName("deleted")] + public required bool Deleted { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/sdks/dotnet/src/Coss/Types/DeletedSchedulingOauthAppObject.cs b/sdks/dotnet/src/Coss/Types/DeletedSchedulingOauthAppObject.cs new file mode 100644 index 000000000..158a2c6d3 --- /dev/null +++ b/sdks/dotnet/src/Coss/Types/DeletedSchedulingOauthAppObject.cs @@ -0,0 +1,114 @@ +using Coss.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace Coss; + +[JsonConverter(typeof(DeletedSchedulingOauthAppObject.DeletedSchedulingOauthAppObjectSerializer))] +[Serializable] +public readonly record struct DeletedSchedulingOauthAppObject : IStringEnum +{ + public static readonly DeletedSchedulingOauthAppObject SchedulingOauthApp = new( + Values.SchedulingOauthApp + ); + + public DeletedSchedulingOauthAppObject(string value) + { + Value = value; + } + + /// + /// The string value of the enum. + /// + public string Value { get; } + + /// + /// Create a string enum with the given value. + /// + public static DeletedSchedulingOauthAppObject FromCustom(string value) + { + return new DeletedSchedulingOauthAppObject(value); + } + + public bool Equals(string? other) + { + return Value.Equals(other); + } + + /// + /// Returns the string value of the enum. + /// + public override string ToString() + { + return Value; + } + + public static bool operator ==(DeletedSchedulingOauthAppObject value1, string value2) => + value1.Value.Equals(value2); + + public static bool operator !=(DeletedSchedulingOauthAppObject value1, string value2) => + !value1.Value.Equals(value2); + + public static explicit operator string(DeletedSchedulingOauthAppObject value) => value.Value; + + public static explicit operator DeletedSchedulingOauthAppObject(string value) => new(value); + + internal class DeletedSchedulingOauthAppObjectSerializer + : JsonConverter + { + public override DeletedSchedulingOauthAppObject Read( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON value could not be read as a string." + ); + return new DeletedSchedulingOauthAppObject(stringValue); + } + + public override void Write( + Utf8JsonWriter writer, + DeletedSchedulingOauthAppObject value, + JsonSerializerOptions options + ) + { + writer.WriteStringValue(value.Value); + } + + public override DeletedSchedulingOauthAppObject ReadAsPropertyName( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return new DeletedSchedulingOauthAppObject(stringValue); + } + + public override void WriteAsPropertyName( + Utf8JsonWriter writer, + DeletedSchedulingOauthAppObject value, + JsonSerializerOptions options + ) + { + writer.WritePropertyName(value.Value); + } + } + + /// + /// Constant strings for enum values + /// + [Serializable] + public static class Values + { + public const string SchedulingOauthApp = "scheduling.oauth_app"; + } +} diff --git a/sdks/dotnet/src/Coss/Types/DeletedSchedulingOutOfOffice.cs b/sdks/dotnet/src/Coss/Types/DeletedSchedulingOutOfOffice.cs new file mode 100644 index 000000000..25ee61f9d --- /dev/null +++ b/sdks/dotnet/src/Coss/Types/DeletedSchedulingOutOfOffice.cs @@ -0,0 +1,34 @@ +using Coss.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace Coss; + +[Serializable] +public record DeletedSchedulingOutOfOffice : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + [JsonPropertyName("object")] + public required DeletedSchedulingOutOfOfficeObject Object { get; set; } + + [JsonPropertyName("id")] + public required string Id { get; set; } + + [JsonPropertyName("deleted")] + public required bool Deleted { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/sdks/dotnet/src/Coss/Types/DeletedSchedulingOutOfOfficeObject.cs b/sdks/dotnet/src/Coss/Types/DeletedSchedulingOutOfOfficeObject.cs new file mode 100644 index 000000000..e0c5efb30 --- /dev/null +++ b/sdks/dotnet/src/Coss/Types/DeletedSchedulingOutOfOfficeObject.cs @@ -0,0 +1,116 @@ +using Coss.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace Coss; + +[JsonConverter( + typeof(DeletedSchedulingOutOfOfficeObject.DeletedSchedulingOutOfOfficeObjectSerializer) +)] +[Serializable] +public readonly record struct DeletedSchedulingOutOfOfficeObject : IStringEnum +{ + public static readonly DeletedSchedulingOutOfOfficeObject SchedulingOutOfOffice = new( + Values.SchedulingOutOfOffice + ); + + public DeletedSchedulingOutOfOfficeObject(string value) + { + Value = value; + } + + /// + /// The string value of the enum. + /// + public string Value { get; } + + /// + /// Create a string enum with the given value. + /// + public static DeletedSchedulingOutOfOfficeObject FromCustom(string value) + { + return new DeletedSchedulingOutOfOfficeObject(value); + } + + public bool Equals(string? other) + { + return Value.Equals(other); + } + + /// + /// Returns the string value of the enum. + /// + public override string ToString() + { + return Value; + } + + public static bool operator ==(DeletedSchedulingOutOfOfficeObject value1, string value2) => + value1.Value.Equals(value2); + + public static bool operator !=(DeletedSchedulingOutOfOfficeObject value1, string value2) => + !value1.Value.Equals(value2); + + public static explicit operator string(DeletedSchedulingOutOfOfficeObject value) => value.Value; + + public static explicit operator DeletedSchedulingOutOfOfficeObject(string value) => new(value); + + internal class DeletedSchedulingOutOfOfficeObjectSerializer + : JsonConverter + { + public override DeletedSchedulingOutOfOfficeObject Read( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON value could not be read as a string." + ); + return new DeletedSchedulingOutOfOfficeObject(stringValue); + } + + public override void Write( + Utf8JsonWriter writer, + DeletedSchedulingOutOfOfficeObject value, + JsonSerializerOptions options + ) + { + writer.WriteStringValue(value.Value); + } + + public override DeletedSchedulingOutOfOfficeObject ReadAsPropertyName( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return new DeletedSchedulingOutOfOfficeObject(stringValue); + } + + public override void WriteAsPropertyName( + Utf8JsonWriter writer, + DeletedSchedulingOutOfOfficeObject value, + JsonSerializerOptions options + ) + { + writer.WritePropertyName(value.Value); + } + } + + /// + /// Constant strings for enum values + /// + [Serializable] + public static class Values + { + public const string SchedulingOutOfOffice = "scheduling.out_of_office"; + } +} diff --git a/sdks/dotnet/src/Coss/Types/SchedulingBooking.cs b/sdks/dotnet/src/Coss/Types/SchedulingBooking.cs index c68ee1409..e905c8ea0 100644 --- a/sdks/dotnet/src/Coss/Types/SchedulingBooking.cs +++ b/sdks/dotnet/src/Coss/Types/SchedulingBooking.cs @@ -1,6 +1,7 @@ using Coss.Core; using global::System.Text.Json; using global::System.Text.Json.Serialization; +using OneOf; namespace Coss; @@ -60,8 +61,16 @@ public record SchedulingBooking : IJsonOnDeserialized public IEnumerable Attendees { get; set; } = new List(); + [Nullable] [JsonPropertyName("location")] - public required SchedulingLocation Location { get; set; } + public OneOf< + SchedulingLocationZero, + SchedulingLocationNumber, + SchedulingLocationAddress, + SchedulingLocationThree, + SchedulingLocationFour, + SchedulingLocationFive + >? Location { get; set; } /// /// When a `held` booking gives up its slot. `null` otherwise. diff --git a/sdks/dotnet/src/Coss/Types/SchedulingBookingCancelledBy.cs b/sdks/dotnet/src/Coss/Types/SchedulingBookingCancelledBy.cs index 0ea9004cf..95f487d09 100644 --- a/sdks/dotnet/src/Coss/Types/SchedulingBookingCancelledBy.cs +++ b/sdks/dotnet/src/Coss/Types/SchedulingBookingCancelledBy.cs @@ -18,6 +18,8 @@ namespace Coss; public static readonly SchedulingBookingCancelledBy ManageSession = new(Values.ManageSession); + public static readonly SchedulingBookingCancelledBy ManagerSession = new(Values.ManagerSession); + public static readonly SchedulingBookingCancelledBy System = new(Values.System); public SchedulingBookingCancelledBy(string value) @@ -127,6 +129,8 @@ public static class Values public const string ManageSession = "manage_session"; + public const string ManagerSession = "manager_session"; + public const string System = "system"; } } diff --git a/sdks/dotnet/src/Coss/Types/SchedulingBookingEventActorKind.cs b/sdks/dotnet/src/Coss/Types/SchedulingBookingEventActorKind.cs index efc7ad503..93608ccca 100644 --- a/sdks/dotnet/src/Coss/Types/SchedulingBookingEventActorKind.cs +++ b/sdks/dotnet/src/Coss/Types/SchedulingBookingEventActorKind.cs @@ -22,6 +22,10 @@ namespace Coss; Values.ManageSession ); + public static readonly SchedulingBookingEventActorKind ManagerSession = new( + Values.ManagerSession + ); + public static readonly SchedulingBookingEventActorKind System = new(Values.System); public SchedulingBookingEventActorKind(string value) @@ -131,6 +135,8 @@ public static class Values public const string ManageSession = "manage_session"; + public const string ManagerSession = "manager_session"; + public const string System = "system"; } } diff --git a/sdks/dotnet/src/Coss/Types/SchedulingBookingWebhookData.cs b/sdks/dotnet/src/Coss/Types/SchedulingBookingWebhookData.cs index e43d06c9e..5b1f2a761 100644 --- a/sdks/dotnet/src/Coss/Types/SchedulingBookingWebhookData.cs +++ b/sdks/dotnet/src/Coss/Types/SchedulingBookingWebhookData.cs @@ -70,6 +70,20 @@ public record SchedulingBookingWebhookData : IJsonOnDeserialized [JsonPropertyName("previous_start")] public string? PreviousStart { get; set; } + /// + /// On `scheduling.booking.reassigned`: who had it before. + /// + [Optional] + [JsonPropertyName("previous_host_ids")] + public IEnumerable? PreviousHostIds { get; set; } + + /// + /// On `scheduling.booking.reassigned`: the bulk reassignment it was part of. + /// + [Optional] + [JsonPropertyName("reassignment_id")] + public string? ReassignmentId { get; set; } + /// /// `scheduling.booking.reminder`: which reminder this is. /// diff --git a/sdks/dotnet/src/Coss/Types/SchedulingBookingWebhookEventType.cs b/sdks/dotnet/src/Coss/Types/SchedulingBookingWebhookEventType.cs index af4e6d20e..bca6bcf4b 100644 --- a/sdks/dotnet/src/Coss/Types/SchedulingBookingWebhookEventType.cs +++ b/sdks/dotnet/src/Coss/Types/SchedulingBookingWebhookEventType.cs @@ -48,6 +48,10 @@ namespace Coss; Values.SchedulingBookingLocationReady ); + public static readonly SchedulingBookingWebhookEventType SchedulingBookingReassigned = new( + Values.SchedulingBookingReassigned + ); + public static readonly SchedulingBookingWebhookEventType SchedulingBookingStarted = new( Values.SchedulingBookingStarted ); @@ -180,6 +184,8 @@ public static class Values public const string SchedulingBookingLocationReady = "scheduling.booking.location_ready"; + public const string SchedulingBookingReassigned = "scheduling.booking.reassigned"; + public const string SchedulingBookingStarted = "scheduling.booking.started"; public const string SchedulingBookingEnded = "scheduling.booking.ended"; diff --git a/sdks/dotnet/src/Coss/Types/SchedulingCalendarConnection.cs b/sdks/dotnet/src/Coss/Types/SchedulingCalendarConnection.cs index 7fc9cc833..8fc304d0f 100644 --- a/sdks/dotnet/src/Coss/Types/SchedulingCalendarConnection.cs +++ b/sdks/dotnet/src/Coss/Types/SchedulingCalendarConnection.cs @@ -41,6 +41,13 @@ public record SchedulingCalendarConnection : IJsonOnDeserialized [JsonPropertyName("status")] public required SchedulingCalendarConnectionStatus Status { get; set; } + /// + /// Your own OAuth app this connection's access came through. `null`: coss.com's, or no consent was involved. + /// + [Nullable] + [JsonPropertyName("oauth_app")] + public string? OauthApp { get; set; } + /// /// The calendar delegation that manages this connection. It can't be disconnected or reconnected by itself. /// diff --git a/sdks/dotnet/src/Coss/Types/SchedulingEventType.cs b/sdks/dotnet/src/Coss/Types/SchedulingEventType.cs index 2ee9ada27..7625151ed 100644 --- a/sdks/dotnet/src/Coss/Types/SchedulingEventType.cs +++ b/sdks/dotnet/src/Coss/Types/SchedulingEventType.cs @@ -119,6 +119,12 @@ public OneOf< [JsonPropertyName("requires_approval")] public required bool RequiresApproval { get; set; } + /// + /// Whether bookings of this event type can go to another host. + /// + [JsonPropertyName("reassignment_enabled")] + public required bool ReassignmentEnabled { get; set; } + /// /// How long a booking can wait for approval before it's declined, in minutes. /// @@ -172,7 +178,22 @@ public OneOf< /// Where bookings can meet. A browser only chooses among these. /// [JsonPropertyName("locations")] - public IEnumerable Locations { get; set; } = new List(); + public IEnumerable?> Locations { get; set; } = + new List?>(); /// /// Pool members also include active hosts matching all of these attributes. `null`: only `hosts`. diff --git a/sdks/dotnet/src/Coss/Types/SchedulingHolidayCalendar.cs b/sdks/dotnet/src/Coss/Types/SchedulingHolidayCalendar.cs new file mode 100644 index 000000000..e8e88ece6 --- /dev/null +++ b/sdks/dotnet/src/Coss/Types/SchedulingHolidayCalendar.cs @@ -0,0 +1,77 @@ +using Coss.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; +using OneOf; + +namespace Coss; + +[Serializable] +public record SchedulingHolidayCalendar : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + [JsonPropertyName("object")] + public required SchedulingHolidayCalendarObject Object { get; set; } + + [JsonPropertyName("id")] + public required string Id { get; set; } + + [JsonPropertyName("name")] + public required string Name { get; set; } + + [JsonPropertyName("source")] + public required SchedulingHolidayCalendarSource Source { get; set; } + + [Nullable] + [JsonPropertyName("country")] + public string? Country { get; set; } + + [Nullable] + [JsonPropertyName("hosts")] + public IEnumerable? Hosts { get; set; } + + [Nullable] + [JsonPropertyName("host_filter")] + public Dictionary>?>? HostFilter { get; set; } + + [Nullable] + [JsonPropertyName("regions")] + public IEnumerable? Regions { get; set; } + + [JsonPropertyName("delegates")] + public IEnumerable Delegates { get; set; } = new List(); + + [JsonPropertyName("existing_bookings")] + public required SchedulingHolidayCalendarExistingBookings ExistingBookings { get; set; } + + [Nullable] + [JsonPropertyName("last_read_at")] + public string? LastReadAt { get; set; } + + /// + /// Why its feed couldn't be read. + /// + [Nullable] + [JsonPropertyName("last_error")] + public string? LastError { get; set; } + + [JsonPropertyName("created_at")] + public required string CreatedAt { get; set; } + + [JsonPropertyName("updated_at")] + public required string UpdatedAt { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/sdks/dotnet/src/Coss/Types/SchedulingHolidayCalendarExistingBookings.cs b/sdks/dotnet/src/Coss/Types/SchedulingHolidayCalendarExistingBookings.cs new file mode 100644 index 000000000..4cc57ca32 --- /dev/null +++ b/sdks/dotnet/src/Coss/Types/SchedulingHolidayCalendarExistingBookings.cs @@ -0,0 +1,126 @@ +using Coss.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace Coss; + +[JsonConverter( + typeof(SchedulingHolidayCalendarExistingBookings.SchedulingHolidayCalendarExistingBookingsSerializer) +)] +[Serializable] +public readonly record struct SchedulingHolidayCalendarExistingBookings : IStringEnum +{ + public static readonly SchedulingHolidayCalendarExistingBookings Leave = new(Values.Leave); + + public static readonly SchedulingHolidayCalendarExistingBookings Reassign = new( + Values.Reassign + ); + + public SchedulingHolidayCalendarExistingBookings(string value) + { + Value = value; + } + + /// + /// The string value of the enum. + /// + public string Value { get; } + + /// + /// Create a string enum with the given value. + /// + public static SchedulingHolidayCalendarExistingBookings FromCustom(string value) + { + return new SchedulingHolidayCalendarExistingBookings(value); + } + + public bool Equals(string? other) + { + return Value.Equals(other); + } + + /// + /// Returns the string value of the enum. + /// + public override string ToString() + { + return Value; + } + + public static bool operator ==( + SchedulingHolidayCalendarExistingBookings value1, + string value2 + ) => value1.Value.Equals(value2); + + public static bool operator !=( + SchedulingHolidayCalendarExistingBookings value1, + string value2 + ) => !value1.Value.Equals(value2); + + public static explicit operator string(SchedulingHolidayCalendarExistingBookings value) => + value.Value; + + public static explicit operator SchedulingHolidayCalendarExistingBookings(string value) => + new(value); + + internal class SchedulingHolidayCalendarExistingBookingsSerializer + : JsonConverter + { + public override SchedulingHolidayCalendarExistingBookings Read( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON value could not be read as a string." + ); + return new SchedulingHolidayCalendarExistingBookings(stringValue); + } + + public override void Write( + Utf8JsonWriter writer, + SchedulingHolidayCalendarExistingBookings value, + JsonSerializerOptions options + ) + { + writer.WriteStringValue(value.Value); + } + + public override SchedulingHolidayCalendarExistingBookings ReadAsPropertyName( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return new SchedulingHolidayCalendarExistingBookings(stringValue); + } + + public override void WriteAsPropertyName( + Utf8JsonWriter writer, + SchedulingHolidayCalendarExistingBookings value, + JsonSerializerOptions options + ) + { + writer.WritePropertyName(value.Value); + } + } + + /// + /// Constant strings for enum values + /// + [Serializable] + public static class Values + { + public const string Leave = "leave"; + + public const string Reassign = "reassign"; + } +} diff --git a/sdks/dotnet/src/Coss/Types/SchedulingHolidayCalendarList.cs b/sdks/dotnet/src/Coss/Types/SchedulingHolidayCalendarList.cs new file mode 100644 index 000000000..728d13b7d --- /dev/null +++ b/sdks/dotnet/src/Coss/Types/SchedulingHolidayCalendarList.cs @@ -0,0 +1,35 @@ +using Coss.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace Coss; + +[Serializable] +public record SchedulingHolidayCalendarList : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + [JsonPropertyName("object")] + public required SchedulingHolidayCalendarListObject Object { get; set; } + + [JsonPropertyName("data")] + public IEnumerable Data { get; set; } = + new List(); + + [JsonPropertyName("has_more")] + public required bool HasMore { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/sdks/dotnet/src/Coss/Types/SchedulingHolidayCalendarListObject.cs b/sdks/dotnet/src/Coss/Types/SchedulingHolidayCalendarListObject.cs new file mode 100644 index 000000000..334e00680 --- /dev/null +++ b/sdks/dotnet/src/Coss/Types/SchedulingHolidayCalendarListObject.cs @@ -0,0 +1,115 @@ +using Coss.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace Coss; + +[JsonConverter( + typeof(SchedulingHolidayCalendarListObject.SchedulingHolidayCalendarListObjectSerializer) +)] +[Serializable] +public readonly record struct SchedulingHolidayCalendarListObject : IStringEnum +{ + public static readonly SchedulingHolidayCalendarListObject List = new(Values.List); + + public SchedulingHolidayCalendarListObject(string value) + { + Value = value; + } + + /// + /// The string value of the enum. + /// + public string Value { get; } + + /// + /// Create a string enum with the given value. + /// + public static SchedulingHolidayCalendarListObject FromCustom(string value) + { + return new SchedulingHolidayCalendarListObject(value); + } + + public bool Equals(string? other) + { + return Value.Equals(other); + } + + /// + /// Returns the string value of the enum. + /// + public override string ToString() + { + return Value; + } + + public static bool operator ==(SchedulingHolidayCalendarListObject value1, string value2) => + value1.Value.Equals(value2); + + public static bool operator !=(SchedulingHolidayCalendarListObject value1, string value2) => + !value1.Value.Equals(value2); + + public static explicit operator string(SchedulingHolidayCalendarListObject value) => + value.Value; + + public static explicit operator SchedulingHolidayCalendarListObject(string value) => new(value); + + internal class SchedulingHolidayCalendarListObjectSerializer + : JsonConverter + { + public override SchedulingHolidayCalendarListObject Read( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON value could not be read as a string." + ); + return new SchedulingHolidayCalendarListObject(stringValue); + } + + public override void Write( + Utf8JsonWriter writer, + SchedulingHolidayCalendarListObject value, + JsonSerializerOptions options + ) + { + writer.WriteStringValue(value.Value); + } + + public override SchedulingHolidayCalendarListObject ReadAsPropertyName( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return new SchedulingHolidayCalendarListObject(stringValue); + } + + public override void WriteAsPropertyName( + Utf8JsonWriter writer, + SchedulingHolidayCalendarListObject value, + JsonSerializerOptions options + ) + { + writer.WritePropertyName(value.Value); + } + } + + /// + /// Constant strings for enum values + /// + [Serializable] + public static class Values + { + public const string List = "list"; + } +} diff --git a/sdks/dotnet/src/Coss/Types/SchedulingHolidayCalendarObject.cs b/sdks/dotnet/src/Coss/Types/SchedulingHolidayCalendarObject.cs new file mode 100644 index 000000000..12181b5a7 --- /dev/null +++ b/sdks/dotnet/src/Coss/Types/SchedulingHolidayCalendarObject.cs @@ -0,0 +1,114 @@ +using Coss.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace Coss; + +[JsonConverter(typeof(SchedulingHolidayCalendarObject.SchedulingHolidayCalendarObjectSerializer))] +[Serializable] +public readonly record struct SchedulingHolidayCalendarObject : IStringEnum +{ + public static readonly SchedulingHolidayCalendarObject SchedulingHolidayCalendar = new( + Values.SchedulingHolidayCalendar + ); + + public SchedulingHolidayCalendarObject(string value) + { + Value = value; + } + + /// + /// The string value of the enum. + /// + public string Value { get; } + + /// + /// Create a string enum with the given value. + /// + public static SchedulingHolidayCalendarObject FromCustom(string value) + { + return new SchedulingHolidayCalendarObject(value); + } + + public bool Equals(string? other) + { + return Value.Equals(other); + } + + /// + /// Returns the string value of the enum. + /// + public override string ToString() + { + return Value; + } + + public static bool operator ==(SchedulingHolidayCalendarObject value1, string value2) => + value1.Value.Equals(value2); + + public static bool operator !=(SchedulingHolidayCalendarObject value1, string value2) => + !value1.Value.Equals(value2); + + public static explicit operator string(SchedulingHolidayCalendarObject value) => value.Value; + + public static explicit operator SchedulingHolidayCalendarObject(string value) => new(value); + + internal class SchedulingHolidayCalendarObjectSerializer + : JsonConverter + { + public override SchedulingHolidayCalendarObject Read( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON value could not be read as a string." + ); + return new SchedulingHolidayCalendarObject(stringValue); + } + + public override void Write( + Utf8JsonWriter writer, + SchedulingHolidayCalendarObject value, + JsonSerializerOptions options + ) + { + writer.WriteStringValue(value.Value); + } + + public override SchedulingHolidayCalendarObject ReadAsPropertyName( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return new SchedulingHolidayCalendarObject(stringValue); + } + + public override void WriteAsPropertyName( + Utf8JsonWriter writer, + SchedulingHolidayCalendarObject value, + JsonSerializerOptions options + ) + { + writer.WritePropertyName(value.Value); + } + } + + /// + /// Constant strings for enum values + /// + [Serializable] + public static class Values + { + public const string SchedulingHolidayCalendar = "scheduling.holiday_calendar"; + } +} diff --git a/sdks/dotnet/src/Coss/Types/SchedulingHolidayCalendarSource.cs b/sdks/dotnet/src/Coss/Types/SchedulingHolidayCalendarSource.cs new file mode 100644 index 000000000..ebb26bdc8 --- /dev/null +++ b/sdks/dotnet/src/Coss/Types/SchedulingHolidayCalendarSource.cs @@ -0,0 +1,116 @@ +using Coss.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace Coss; + +[JsonConverter(typeof(SchedulingHolidayCalendarSource.SchedulingHolidayCalendarSourceSerializer))] +[Serializable] +public readonly record struct SchedulingHolidayCalendarSource : IStringEnum +{ + public static readonly SchedulingHolidayCalendarSource Country = new(Values.Country); + + public static readonly SchedulingHolidayCalendarSource Ics = new(Values.Ics); + + public SchedulingHolidayCalendarSource(string value) + { + Value = value; + } + + /// + /// The string value of the enum. + /// + public string Value { get; } + + /// + /// Create a string enum with the given value. + /// + public static SchedulingHolidayCalendarSource FromCustom(string value) + { + return new SchedulingHolidayCalendarSource(value); + } + + public bool Equals(string? other) + { + return Value.Equals(other); + } + + /// + /// Returns the string value of the enum. + /// + public override string ToString() + { + return Value; + } + + public static bool operator ==(SchedulingHolidayCalendarSource value1, string value2) => + value1.Value.Equals(value2); + + public static bool operator !=(SchedulingHolidayCalendarSource value1, string value2) => + !value1.Value.Equals(value2); + + public static explicit operator string(SchedulingHolidayCalendarSource value) => value.Value; + + public static explicit operator SchedulingHolidayCalendarSource(string value) => new(value); + + internal class SchedulingHolidayCalendarSourceSerializer + : JsonConverter + { + public override SchedulingHolidayCalendarSource Read( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON value could not be read as a string." + ); + return new SchedulingHolidayCalendarSource(stringValue); + } + + public override void Write( + Utf8JsonWriter writer, + SchedulingHolidayCalendarSource value, + JsonSerializerOptions options + ) + { + writer.WriteStringValue(value.Value); + } + + public override SchedulingHolidayCalendarSource ReadAsPropertyName( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return new SchedulingHolidayCalendarSource(stringValue); + } + + public override void WriteAsPropertyName( + Utf8JsonWriter writer, + SchedulingHolidayCalendarSource value, + JsonSerializerOptions options + ) + { + writer.WritePropertyName(value.Value); + } + } + + /// + /// Constant strings for enum values + /// + [Serializable] + public static class Values + { + public const string Country = "country"; + + public const string Ics = "ics"; + } +} diff --git a/sdks/dotnet/src/Coss/Types/SchedulingHolidayList.cs b/sdks/dotnet/src/Coss/Types/SchedulingHolidayList.cs new file mode 100644 index 000000000..ddc655d06 --- /dev/null +++ b/sdks/dotnet/src/Coss/Types/SchedulingHolidayList.cs @@ -0,0 +1,35 @@ +using Coss.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace Coss; + +[Serializable] +public record SchedulingHolidayList : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + [JsonPropertyName("object")] + public required SchedulingHolidayListObject Object { get; set; } + + [JsonPropertyName("data")] + public IEnumerable Data { get; set; } = + new List(); + + [JsonPropertyName("has_more")] + public required bool HasMore { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/sdks/dotnet/src/Coss/Types/SchedulingHolidayListDataItem.cs b/sdks/dotnet/src/Coss/Types/SchedulingHolidayListDataItem.cs new file mode 100644 index 000000000..765085f8b --- /dev/null +++ b/sdks/dotnet/src/Coss/Types/SchedulingHolidayListDataItem.cs @@ -0,0 +1,35 @@ +using Coss.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace Coss; + +[Serializable] +public record SchedulingHolidayListDataItem : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + [JsonPropertyName("date")] + public required string Date { get; set; } + + [JsonPropertyName("name")] + public required string Name { get; set; } + + [Nullable] + [JsonPropertyName("region")] + public string? Region { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/sdks/dotnet/src/Coss/Types/SchedulingHolidayListObject.cs b/sdks/dotnet/src/Coss/Types/SchedulingHolidayListObject.cs new file mode 100644 index 000000000..aeec9fc55 --- /dev/null +++ b/sdks/dotnet/src/Coss/Types/SchedulingHolidayListObject.cs @@ -0,0 +1,112 @@ +using Coss.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace Coss; + +[JsonConverter(typeof(SchedulingHolidayListObject.SchedulingHolidayListObjectSerializer))] +[Serializable] +public readonly record struct SchedulingHolidayListObject : IStringEnum +{ + public static readonly SchedulingHolidayListObject List = new(Values.List); + + public SchedulingHolidayListObject(string value) + { + Value = value; + } + + /// + /// The string value of the enum. + /// + public string Value { get; } + + /// + /// Create a string enum with the given value. + /// + public static SchedulingHolidayListObject FromCustom(string value) + { + return new SchedulingHolidayListObject(value); + } + + public bool Equals(string? other) + { + return Value.Equals(other); + } + + /// + /// Returns the string value of the enum. + /// + public override string ToString() + { + return Value; + } + + public static bool operator ==(SchedulingHolidayListObject value1, string value2) => + value1.Value.Equals(value2); + + public static bool operator !=(SchedulingHolidayListObject value1, string value2) => + !value1.Value.Equals(value2); + + public static explicit operator string(SchedulingHolidayListObject value) => value.Value; + + public static explicit operator SchedulingHolidayListObject(string value) => new(value); + + internal class SchedulingHolidayListObjectSerializer + : JsonConverter + { + public override SchedulingHolidayListObject Read( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON value could not be read as a string." + ); + return new SchedulingHolidayListObject(stringValue); + } + + public override void Write( + Utf8JsonWriter writer, + SchedulingHolidayListObject value, + JsonSerializerOptions options + ) + { + writer.WriteStringValue(value.Value); + } + + public override SchedulingHolidayListObject ReadAsPropertyName( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return new SchedulingHolidayListObject(stringValue); + } + + public override void WriteAsPropertyName( + Utf8JsonWriter writer, + SchedulingHolidayListObject value, + JsonSerializerOptions options + ) + { + writer.WritePropertyName(value.Value); + } + } + + /// + /// Constant strings for enum values + /// + [Serializable] + public static class Values + { + public const string List = "list"; + } +} diff --git a/sdks/dotnet/src/Coss/Types/SchedulingLocation.cs b/sdks/dotnet/src/Coss/Types/SchedulingLocation.cs deleted file mode 100644 index b4df48ea4..000000000 --- a/sdks/dotnet/src/Coss/Types/SchedulingLocation.cs +++ /dev/null @@ -1,571 +0,0 @@ -// ReSharper disable NullableWarningSuppressionIsUsed -// ReSharper disable InconsistentNaming - -using Coss.Core; -using global::System.Text.Json; -using global::System.Text.Json.Nodes; -using global::System.Text.Json.Serialization; - -namespace Coss; - -/// -/// Where a booking meets. `link`, `phone` and `in_person` carry their details, and on an event type, left blank, use the booked host's own if they have one; `google_meet`, `microsoft_teams` and `zoom` get a meeting made on the host's connected account. -/// -[JsonConverter(typeof(SchedulingLocation.JsonConverter))] -[Serializable] -public record SchedulingLocation -{ - internal SchedulingLocation(string type, object? value) - { - Type = type; - Value = value; - } - - /// - /// Create an instance of SchedulingLocation with . - /// - public SchedulingLocation(SchedulingLocation.Link value) - { - Type = "link"; - Value = value.Value; - } - - /// - /// Create an instance of SchedulingLocation with . - /// - public SchedulingLocation(SchedulingLocation.Phone value) - { - Type = "phone"; - Value = value.Value; - } - - /// - /// Create an instance of SchedulingLocation with . - /// - public SchedulingLocation(SchedulingLocation.InPerson value) - { - Type = "in_person"; - Value = value.Value; - } - - /// - /// Create an instance of SchedulingLocation with . - /// - public SchedulingLocation(SchedulingLocation.GoogleMeet value) - { - Type = "google_meet"; - Value = value.Value; - } - - /// - /// Create an instance of SchedulingLocation with . - /// - public SchedulingLocation(SchedulingLocation.MicrosoftTeams value) - { - Type = "microsoft_teams"; - Value = value.Value; - } - - /// - /// Create an instance of SchedulingLocation with . - /// - public SchedulingLocation(SchedulingLocation.Zoom value) - { - Type = "zoom"; - Value = value.Value; - } - - /// - /// Discriminant value - /// - [JsonPropertyName("type")] - public string Type { get; internal set; } - - /// - /// Discriminated union value - /// - public object? Value { get; internal set; } - - /// - /// Returns true if is "link" - /// - public bool IsLink => Type == "link"; - - /// - /// Returns true if is "phone" - /// - public bool IsPhone => Type == "phone"; - - /// - /// Returns true if is "in_person" - /// - public bool IsInPerson => Type == "in_person"; - - /// - /// Returns true if is "google_meet" - /// - public bool IsGoogleMeet => Type == "google_meet"; - - /// - /// Returns true if is "microsoft_teams" - /// - public bool IsMicrosoftTeams => Type == "microsoft_teams"; - - /// - /// Returns true if is "zoom" - /// - public bool IsZoom => Type == "zoom"; - - /// - /// Returns the value as a if is 'link', otherwise throws an exception. - /// - /// Thrown when is not 'link'. - public Coss.SchedulingLocationLink AsLink() => - IsLink - ? (Coss.SchedulingLocationLink)Value! - : throw new global::System.Exception("SchedulingLocation.Type is not 'link'"); - - /// - /// Returns the value as a if is 'phone', otherwise throws an exception. - /// - /// Thrown when is not 'phone'. - public Coss.SchedulingLocationPhone AsPhone() => - IsPhone - ? (Coss.SchedulingLocationPhone)Value! - : throw new global::System.Exception("SchedulingLocation.Type is not 'phone'"); - - /// - /// Returns the value as a if is 'in_person', otherwise throws an exception. - /// - /// Thrown when is not 'in_person'. - public Coss.SchedulingLocationInPerson AsInPerson() => - IsInPerson - ? (Coss.SchedulingLocationInPerson)Value! - : throw new global::System.Exception("SchedulingLocation.Type is not 'in_person'"); - - /// - /// Returns the value as a if is 'google_meet', otherwise throws an exception. - /// - /// Thrown when is not 'google_meet'. - public Coss.SchedulingLocationGoogleMeet AsGoogleMeet() => - IsGoogleMeet - ? (Coss.SchedulingLocationGoogleMeet)Value! - : throw new global::System.Exception("SchedulingLocation.Type is not 'google_meet'"); - - /// - /// Returns the value as a if is 'microsoft_teams', otherwise throws an exception. - /// - /// Thrown when is not 'microsoft_teams'. - public Coss.SchedulingLocationMicrosoftTeams AsMicrosoftTeams() => - IsMicrosoftTeams - ? (Coss.SchedulingLocationMicrosoftTeams)Value! - : throw new global::System.Exception( - "SchedulingLocation.Type is not 'microsoft_teams'" - ); - - /// - /// Returns the value as a if is 'zoom', otherwise throws an exception. - /// - /// Thrown when is not 'zoom'. - public Coss.SchedulingLocationZoom AsZoom() => - IsZoom - ? (Coss.SchedulingLocationZoom)Value! - : throw new global::System.Exception("SchedulingLocation.Type is not 'zoom'"); - - public T Match( - Func onLink, - Func onPhone, - Func onInPerson, - Func onGoogleMeet, - Func onMicrosoftTeams, - Func onZoom, - Func onUnknown_ - ) - { - return Type switch - { - "link" => onLink(AsLink()), - "phone" => onPhone(AsPhone()), - "in_person" => onInPerson(AsInPerson()), - "google_meet" => onGoogleMeet(AsGoogleMeet()), - "microsoft_teams" => onMicrosoftTeams(AsMicrosoftTeams()), - "zoom" => onZoom(AsZoom()), - _ => onUnknown_(Type, Value), - }; - } - - public void Visit( - Action onLink, - Action onPhone, - Action onInPerson, - Action onGoogleMeet, - Action onMicrosoftTeams, - Action onZoom, - Action onUnknown_ - ) - { - switch (Type) - { - case "link": - onLink(AsLink()); - break; - case "phone": - onPhone(AsPhone()); - break; - case "in_person": - onInPerson(AsInPerson()); - break; - case "google_meet": - onGoogleMeet(AsGoogleMeet()); - break; - case "microsoft_teams": - onMicrosoftTeams(AsMicrosoftTeams()); - break; - case "zoom": - onZoom(AsZoom()); - break; - default: - onUnknown_(Type, Value); - break; - } - } - - /// - /// Attempts to cast the value to a and returns true if successful. - /// - public bool TryAsLink(out Coss.SchedulingLocationLink? value) - { - if (Type == "link") - { - value = (Coss.SchedulingLocationLink)Value!; - return true; - } - value = null; - return false; - } - - /// - /// Attempts to cast the value to a and returns true if successful. - /// - public bool TryAsPhone(out Coss.SchedulingLocationPhone? value) - { - if (Type == "phone") - { - value = (Coss.SchedulingLocationPhone)Value!; - return true; - } - value = null; - return false; - } - - /// - /// Attempts to cast the value to a and returns true if successful. - /// - public bool TryAsInPerson(out Coss.SchedulingLocationInPerson? value) - { - if (Type == "in_person") - { - value = (Coss.SchedulingLocationInPerson)Value!; - return true; - } - value = null; - return false; - } - - /// - /// Attempts to cast the value to a and returns true if successful. - /// - public bool TryAsGoogleMeet(out Coss.SchedulingLocationGoogleMeet? value) - { - if (Type == "google_meet") - { - value = (Coss.SchedulingLocationGoogleMeet)Value!; - return true; - } - value = null; - return false; - } - - /// - /// Attempts to cast the value to a and returns true if successful. - /// - public bool TryAsMicrosoftTeams(out Coss.SchedulingLocationMicrosoftTeams? value) - { - if (Type == "microsoft_teams") - { - value = (Coss.SchedulingLocationMicrosoftTeams)Value!; - return true; - } - value = null; - return false; - } - - /// - /// Attempts to cast the value to a and returns true if successful. - /// - public bool TryAsZoom(out Coss.SchedulingLocationZoom? value) - { - if (Type == "zoom") - { - value = (Coss.SchedulingLocationZoom)Value!; - return true; - } - value = null; - return false; - } - - public override string ToString() => JsonUtils.Serialize(this); - - public static implicit operator SchedulingLocation(SchedulingLocation.Link value) => new(value); - - public static implicit operator SchedulingLocation(SchedulingLocation.Phone value) => - new(value); - - public static implicit operator SchedulingLocation(SchedulingLocation.InPerson value) => - new(value); - - public static implicit operator SchedulingLocation(SchedulingLocation.GoogleMeet value) => - new(value); - - public static implicit operator SchedulingLocation(SchedulingLocation.MicrosoftTeams value) => - new(value); - - public static implicit operator SchedulingLocation(SchedulingLocation.Zoom value) => new(value); - - [Serializable] - internal sealed class JsonConverter : JsonConverter - { - public override bool CanConvert(global::System.Type typeToConvert) => - typeof(SchedulingLocation).IsAssignableFrom(typeToConvert); - - public override SchedulingLocation Read( - ref Utf8JsonReader reader, - global::System.Type typeToConvert, - JsonSerializerOptions options - ) - { - var json = JsonElement.ParseValue(ref reader); - if (!json.TryGetProperty("type", out var discriminatorElement)) - { - throw new JsonException("Missing discriminator property 'type'"); - } - if (discriminatorElement.ValueKind != JsonValueKind.String) - { - if (discriminatorElement.ValueKind == JsonValueKind.Null) - { - throw new JsonException("Discriminator property 'type' is null"); - } - - throw new JsonException( - $"Discriminator property 'type' is not a string, instead is {discriminatorElement.ToString()}" - ); - } - - var discriminator = - discriminatorElement.GetString() - ?? throw new JsonException("Discriminator property 'type' is null"); - - // Strip the discriminant property to prevent it from leaking into AdditionalProperties - var jsonObject = System.Text.Json.Nodes.JsonObject.Create(json); - jsonObject?.Remove("type"); - var jsonWithoutDiscriminator = - jsonObject != null ? JsonSerializer.SerializeToElement(jsonObject, options) : json; - - var value = discriminator switch - { - "link" => jsonWithoutDiscriminator.Deserialize( - options - ) ?? throw new JsonException("Failed to deserialize Coss.SchedulingLocationLink"), - "phone" => jsonWithoutDiscriminator.Deserialize( - options - ) ?? throw new JsonException("Failed to deserialize Coss.SchedulingLocationPhone"), - "in_person" => - jsonWithoutDiscriminator.Deserialize(options) - ?? throw new JsonException( - "Failed to deserialize Coss.SchedulingLocationInPerson" - ), - "google_meet" => - jsonWithoutDiscriminator.Deserialize( - options - ) - ?? throw new JsonException( - "Failed to deserialize Coss.SchedulingLocationGoogleMeet" - ), - "microsoft_teams" => - jsonWithoutDiscriminator.Deserialize( - options - ) - ?? throw new JsonException( - "Failed to deserialize Coss.SchedulingLocationMicrosoftTeams" - ), - "zoom" => jsonWithoutDiscriminator.Deserialize( - options - ) ?? throw new JsonException("Failed to deserialize Coss.SchedulingLocationZoom"), - _ => json.Deserialize(options), - }; - return new SchedulingLocation(discriminator, value); - } - - public override void Write( - Utf8JsonWriter writer, - SchedulingLocation value, - JsonSerializerOptions options - ) - { - JsonNode json = - value.Type switch - { - "link" => JsonSerializer.SerializeToNode(value.Value, options), - "phone" => JsonSerializer.SerializeToNode(value.Value, options), - "in_person" => JsonSerializer.SerializeToNode(value.Value, options), - "google_meet" => JsonSerializer.SerializeToNode(value.Value, options), - "microsoft_teams" => JsonSerializer.SerializeToNode(value.Value, options), - "zoom" => JsonSerializer.SerializeToNode(value.Value, options), - _ => JsonSerializer.SerializeToNode(value.Value, options), - } ?? new JsonObject(); - json["type"] = value.Type; - json.WriteTo(writer, options); - } - - public override SchedulingLocation ReadAsPropertyName( - ref Utf8JsonReader reader, - global::System.Type typeToConvert, - JsonSerializerOptions options - ) - { - var stringValue = - reader.GetString() - ?? throw new JsonException("The JSON property name could not be read as a string."); - return new SchedulingLocation(stringValue, stringValue); - } - - public override void WriteAsPropertyName( - Utf8JsonWriter writer, - SchedulingLocation value, - JsonSerializerOptions options - ) - { - writer.WritePropertyName(value.Type); - } - } - - /// - /// Discriminated union type for link - /// - [Serializable] - public struct Link - { - public Link(Coss.SchedulingLocationLink value) - { - Value = value; - } - - internal Coss.SchedulingLocationLink Value { get; set; } - - public override string ToString() => Value.ToString() ?? "null"; - - public static implicit operator SchedulingLocation.Link( - Coss.SchedulingLocationLink value - ) => new(value); - } - - /// - /// Discriminated union type for phone - /// - [Serializable] - public struct Phone - { - public Phone(Coss.SchedulingLocationPhone value) - { - Value = value; - } - - internal Coss.SchedulingLocationPhone Value { get; set; } - - public override string ToString() => Value.ToString() ?? "null"; - - public static implicit operator SchedulingLocation.Phone( - Coss.SchedulingLocationPhone value - ) => new(value); - } - - /// - /// Discriminated union type for in_person - /// - [Serializable] - public struct InPerson - { - public InPerson(Coss.SchedulingLocationInPerson value) - { - Value = value; - } - - internal Coss.SchedulingLocationInPerson Value { get; set; } - - public override string ToString() => Value.ToString() ?? "null"; - - public static implicit operator SchedulingLocation.InPerson( - Coss.SchedulingLocationInPerson value - ) => new(value); - } - - /// - /// Discriminated union type for google_meet - /// - [Serializable] - public struct GoogleMeet - { - public GoogleMeet(Coss.SchedulingLocationGoogleMeet value) - { - Value = value; - } - - internal Coss.SchedulingLocationGoogleMeet Value { get; set; } - - public override string ToString() => Value.ToString() ?? "null"; - - public static implicit operator SchedulingLocation.GoogleMeet( - Coss.SchedulingLocationGoogleMeet value - ) => new(value); - } - - /// - /// Discriminated union type for microsoft_teams - /// - [Serializable] - public struct MicrosoftTeams - { - public MicrosoftTeams(Coss.SchedulingLocationMicrosoftTeams value) - { - Value = value; - } - - internal Coss.SchedulingLocationMicrosoftTeams Value { get; set; } - - public override string ToString() => Value.ToString() ?? "null"; - - public static implicit operator SchedulingLocation.MicrosoftTeams( - Coss.SchedulingLocationMicrosoftTeams value - ) => new(value); - } - - /// - /// Discriminated union type for zoom - /// - [Serializable] - public struct Zoom - { - public Zoom(Coss.SchedulingLocationZoom value) - { - Value = value; - } - - internal Coss.SchedulingLocationZoom Value { get; set; } - - public override string ToString() => Value.ToString() ?? "null"; - - public static implicit operator SchedulingLocation.Zoom( - Coss.SchedulingLocationZoom value - ) => new(value); - } -} diff --git a/sdks/dotnet/src/Coss/Types/SchedulingLocationInPerson.cs b/sdks/dotnet/src/Coss/Types/SchedulingLocationAddress.cs similarity index 84% rename from sdks/dotnet/src/Coss/Types/SchedulingLocationInPerson.cs rename to sdks/dotnet/src/Coss/Types/SchedulingLocationAddress.cs index 6d115f8bf..4be4c2712 100644 --- a/sdks/dotnet/src/Coss/Types/SchedulingLocationInPerson.cs +++ b/sdks/dotnet/src/Coss/Types/SchedulingLocationAddress.cs @@ -5,12 +5,15 @@ namespace Coss; [Serializable] -public record SchedulingLocationInPerson : IJsonOnDeserialized +public record SchedulingLocationAddress : IJsonOnDeserialized { [JsonExtensionData] private readonly IDictionary _extensionData = new Dictionary(); + [JsonPropertyName("type")] + public required SchedulingLocationAddressType Type { get; set; } + /// /// The address to meet at. `null` on an event type means the booking supplies its own. /// diff --git a/sdks/dotnet/src/Coss/Types/SchedulingLocationAddressType.cs b/sdks/dotnet/src/Coss/Types/SchedulingLocationAddressType.cs new file mode 100644 index 000000000..47e41fed3 --- /dev/null +++ b/sdks/dotnet/src/Coss/Types/SchedulingLocationAddressType.cs @@ -0,0 +1,112 @@ +using Coss.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace Coss; + +[JsonConverter(typeof(SchedulingLocationAddressType.SchedulingLocationAddressTypeSerializer))] +[Serializable] +public readonly record struct SchedulingLocationAddressType : IStringEnum +{ + public static readonly SchedulingLocationAddressType InPerson = new(Values.InPerson); + + public SchedulingLocationAddressType(string value) + { + Value = value; + } + + /// + /// The string value of the enum. + /// + public string Value { get; } + + /// + /// Create a string enum with the given value. + /// + public static SchedulingLocationAddressType FromCustom(string value) + { + return new SchedulingLocationAddressType(value); + } + + public bool Equals(string? other) + { + return Value.Equals(other); + } + + /// + /// Returns the string value of the enum. + /// + public override string ToString() + { + return Value; + } + + public static bool operator ==(SchedulingLocationAddressType value1, string value2) => + value1.Value.Equals(value2); + + public static bool operator !=(SchedulingLocationAddressType value1, string value2) => + !value1.Value.Equals(value2); + + public static explicit operator string(SchedulingLocationAddressType value) => value.Value; + + public static explicit operator SchedulingLocationAddressType(string value) => new(value); + + internal class SchedulingLocationAddressTypeSerializer + : JsonConverter + { + public override SchedulingLocationAddressType Read( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON value could not be read as a string." + ); + return new SchedulingLocationAddressType(stringValue); + } + + public override void Write( + Utf8JsonWriter writer, + SchedulingLocationAddressType value, + JsonSerializerOptions options + ) + { + writer.WriteStringValue(value.Value); + } + + public override SchedulingLocationAddressType ReadAsPropertyName( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return new SchedulingLocationAddressType(stringValue); + } + + public override void WriteAsPropertyName( + Utf8JsonWriter writer, + SchedulingLocationAddressType value, + JsonSerializerOptions options + ) + { + writer.WritePropertyName(value.Value); + } + } + + /// + /// Constant strings for enum values + /// + [Serializable] + public static class Values + { + public const string InPerson = "in_person"; + } +} diff --git a/sdks/dotnet/src/Coss/Types/SchedulingLocationZoom.cs b/sdks/dotnet/src/Coss/Types/SchedulingLocationFive.cs similarity index 84% rename from sdks/dotnet/src/Coss/Types/SchedulingLocationZoom.cs rename to sdks/dotnet/src/Coss/Types/SchedulingLocationFive.cs index c84a1eba7..b8a48ad23 100644 --- a/sdks/dotnet/src/Coss/Types/SchedulingLocationZoom.cs +++ b/sdks/dotnet/src/Coss/Types/SchedulingLocationFive.cs @@ -5,12 +5,15 @@ namespace Coss; [Serializable] -public record SchedulingLocationZoom : IJsonOnDeserialized +public record SchedulingLocationFive : IJsonOnDeserialized { [JsonExtensionData] private readonly IDictionary _extensionData = new Dictionary(); + [JsonPropertyName("type")] + public required SchedulingLocationFiveType Type { get; set; } + /// /// The meeting's link, once it's created on the host's Zoom account. /// diff --git a/sdks/dotnet/src/Coss/Types/SchedulingLocationFiveType.cs b/sdks/dotnet/src/Coss/Types/SchedulingLocationFiveType.cs new file mode 100644 index 000000000..fc0844291 --- /dev/null +++ b/sdks/dotnet/src/Coss/Types/SchedulingLocationFiveType.cs @@ -0,0 +1,111 @@ +using Coss.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace Coss; + +[JsonConverter(typeof(SchedulingLocationFiveType.SchedulingLocationFiveTypeSerializer))] +[Serializable] +public readonly record struct SchedulingLocationFiveType : IStringEnum +{ + public static readonly SchedulingLocationFiveType Zoom = new(Values.Zoom); + + public SchedulingLocationFiveType(string value) + { + Value = value; + } + + /// + /// The string value of the enum. + /// + public string Value { get; } + + /// + /// Create a string enum with the given value. + /// + public static SchedulingLocationFiveType FromCustom(string value) + { + return new SchedulingLocationFiveType(value); + } + + public bool Equals(string? other) + { + return Value.Equals(other); + } + + /// + /// Returns the string value of the enum. + /// + public override string ToString() + { + return Value; + } + + public static bool operator ==(SchedulingLocationFiveType value1, string value2) => + value1.Value.Equals(value2); + + public static bool operator !=(SchedulingLocationFiveType value1, string value2) => + !value1.Value.Equals(value2); + + public static explicit operator string(SchedulingLocationFiveType value) => value.Value; + + public static explicit operator SchedulingLocationFiveType(string value) => new(value); + + internal class SchedulingLocationFiveTypeSerializer : JsonConverter + { + public override SchedulingLocationFiveType Read( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON value could not be read as a string." + ); + return new SchedulingLocationFiveType(stringValue); + } + + public override void Write( + Utf8JsonWriter writer, + SchedulingLocationFiveType value, + JsonSerializerOptions options + ) + { + writer.WriteStringValue(value.Value); + } + + public override SchedulingLocationFiveType ReadAsPropertyName( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return new SchedulingLocationFiveType(stringValue); + } + + public override void WriteAsPropertyName( + Utf8JsonWriter writer, + SchedulingLocationFiveType value, + JsonSerializerOptions options + ) + { + writer.WritePropertyName(value.Value); + } + } + + /// + /// Constant strings for enum values + /// + [Serializable] + public static class Values + { + public const string Zoom = "zoom"; + } +} diff --git a/sdks/dotnet/src/Coss/Types/SchedulingLocationGoogleMeet.cs b/sdks/dotnet/src/Coss/Types/SchedulingLocationFour.cs similarity index 79% rename from sdks/dotnet/src/Coss/Types/SchedulingLocationGoogleMeet.cs rename to sdks/dotnet/src/Coss/Types/SchedulingLocationFour.cs index 53c1c9036..8349b1425 100644 --- a/sdks/dotnet/src/Coss/Types/SchedulingLocationGoogleMeet.cs +++ b/sdks/dotnet/src/Coss/Types/SchedulingLocationFour.cs @@ -5,12 +5,15 @@ namespace Coss; [Serializable] -public record SchedulingLocationGoogleMeet : IJsonOnDeserialized +public record SchedulingLocationFour : IJsonOnDeserialized { [JsonExtensionData] private readonly IDictionary _extensionData = new Dictionary(); + [JsonPropertyName("type")] + public required SchedulingLocationFourType Type { get; set; } + [JsonIgnore] public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); diff --git a/sdks/dotnet/src/Coss/Types/SchedulingLocationFourType.cs b/sdks/dotnet/src/Coss/Types/SchedulingLocationFourType.cs new file mode 100644 index 000000000..26ca7ed5e --- /dev/null +++ b/sdks/dotnet/src/Coss/Types/SchedulingLocationFourType.cs @@ -0,0 +1,111 @@ +using Coss.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace Coss; + +[JsonConverter(typeof(SchedulingLocationFourType.SchedulingLocationFourTypeSerializer))] +[Serializable] +public readonly record struct SchedulingLocationFourType : IStringEnum +{ + public static readonly SchedulingLocationFourType MicrosoftTeams = new(Values.MicrosoftTeams); + + public SchedulingLocationFourType(string value) + { + Value = value; + } + + /// + /// The string value of the enum. + /// + public string Value { get; } + + /// + /// Create a string enum with the given value. + /// + public static SchedulingLocationFourType FromCustom(string value) + { + return new SchedulingLocationFourType(value); + } + + public bool Equals(string? other) + { + return Value.Equals(other); + } + + /// + /// Returns the string value of the enum. + /// + public override string ToString() + { + return Value; + } + + public static bool operator ==(SchedulingLocationFourType value1, string value2) => + value1.Value.Equals(value2); + + public static bool operator !=(SchedulingLocationFourType value1, string value2) => + !value1.Value.Equals(value2); + + public static explicit operator string(SchedulingLocationFourType value) => value.Value; + + public static explicit operator SchedulingLocationFourType(string value) => new(value); + + internal class SchedulingLocationFourTypeSerializer : JsonConverter + { + public override SchedulingLocationFourType Read( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON value could not be read as a string." + ); + return new SchedulingLocationFourType(stringValue); + } + + public override void Write( + Utf8JsonWriter writer, + SchedulingLocationFourType value, + JsonSerializerOptions options + ) + { + writer.WriteStringValue(value.Value); + } + + public override SchedulingLocationFourType ReadAsPropertyName( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return new SchedulingLocationFourType(stringValue); + } + + public override void WriteAsPropertyName( + Utf8JsonWriter writer, + SchedulingLocationFourType value, + JsonSerializerOptions options + ) + { + writer.WritePropertyName(value.Value); + } + } + + /// + /// Constant strings for enum values + /// + [Serializable] + public static class Values + { + public const string MicrosoftTeams = "microsoft_teams"; + } +} diff --git a/sdks/dotnet/src/Coss/Types/SchedulingLocationPhone.cs b/sdks/dotnet/src/Coss/Types/SchedulingLocationNumber.cs similarity index 84% rename from sdks/dotnet/src/Coss/Types/SchedulingLocationPhone.cs rename to sdks/dotnet/src/Coss/Types/SchedulingLocationNumber.cs index 308b71c45..e5de2808e 100644 --- a/sdks/dotnet/src/Coss/Types/SchedulingLocationPhone.cs +++ b/sdks/dotnet/src/Coss/Types/SchedulingLocationNumber.cs @@ -5,12 +5,15 @@ namespace Coss; [Serializable] -public record SchedulingLocationPhone : IJsonOnDeserialized +public record SchedulingLocationNumber : IJsonOnDeserialized { [JsonExtensionData] private readonly IDictionary _extensionData = new Dictionary(); + [JsonPropertyName("type")] + public required SchedulingLocationNumberType Type { get; set; } + /// /// The phone number to call. `null` on an event type means the booking supplies its own. /// diff --git a/sdks/dotnet/src/Coss/Types/SchedulingLocationNumberType.cs b/sdks/dotnet/src/Coss/Types/SchedulingLocationNumberType.cs new file mode 100644 index 000000000..590d7b8b1 --- /dev/null +++ b/sdks/dotnet/src/Coss/Types/SchedulingLocationNumberType.cs @@ -0,0 +1,112 @@ +using Coss.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace Coss; + +[JsonConverter(typeof(SchedulingLocationNumberType.SchedulingLocationNumberTypeSerializer))] +[Serializable] +public readonly record struct SchedulingLocationNumberType : IStringEnum +{ + public static readonly SchedulingLocationNumberType Phone = new(Values.Phone); + + public SchedulingLocationNumberType(string value) + { + Value = value; + } + + /// + /// The string value of the enum. + /// + public string Value { get; } + + /// + /// Create a string enum with the given value. + /// + public static SchedulingLocationNumberType FromCustom(string value) + { + return new SchedulingLocationNumberType(value); + } + + public bool Equals(string? other) + { + return Value.Equals(other); + } + + /// + /// Returns the string value of the enum. + /// + public override string ToString() + { + return Value; + } + + public static bool operator ==(SchedulingLocationNumberType value1, string value2) => + value1.Value.Equals(value2); + + public static bool operator !=(SchedulingLocationNumberType value1, string value2) => + !value1.Value.Equals(value2); + + public static explicit operator string(SchedulingLocationNumberType value) => value.Value; + + public static explicit operator SchedulingLocationNumberType(string value) => new(value); + + internal class SchedulingLocationNumberTypeSerializer + : JsonConverter + { + public override SchedulingLocationNumberType Read( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON value could not be read as a string." + ); + return new SchedulingLocationNumberType(stringValue); + } + + public override void Write( + Utf8JsonWriter writer, + SchedulingLocationNumberType value, + JsonSerializerOptions options + ) + { + writer.WriteStringValue(value.Value); + } + + public override SchedulingLocationNumberType ReadAsPropertyName( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return new SchedulingLocationNumberType(stringValue); + } + + public override void WriteAsPropertyName( + Utf8JsonWriter writer, + SchedulingLocationNumberType value, + JsonSerializerOptions options + ) + { + writer.WritePropertyName(value.Value); + } + } + + /// + /// Constant strings for enum values + /// + [Serializable] + public static class Values + { + public const string Phone = "phone"; + } +} diff --git a/sdks/dotnet/src/Coss/Types/SchedulingLocationMicrosoftTeams.cs b/sdks/dotnet/src/Coss/Types/SchedulingLocationThree.cs similarity index 79% rename from sdks/dotnet/src/Coss/Types/SchedulingLocationMicrosoftTeams.cs rename to sdks/dotnet/src/Coss/Types/SchedulingLocationThree.cs index 582f3d0cc..8d49772b0 100644 --- a/sdks/dotnet/src/Coss/Types/SchedulingLocationMicrosoftTeams.cs +++ b/sdks/dotnet/src/Coss/Types/SchedulingLocationThree.cs @@ -5,12 +5,15 @@ namespace Coss; [Serializable] -public record SchedulingLocationMicrosoftTeams : IJsonOnDeserialized +public record SchedulingLocationThree : IJsonOnDeserialized { [JsonExtensionData] private readonly IDictionary _extensionData = new Dictionary(); + [JsonPropertyName("type")] + public required SchedulingLocationThreeType Type { get; set; } + [JsonIgnore] public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); diff --git a/sdks/dotnet/src/Coss/Types/SchedulingLocationThreeType.cs b/sdks/dotnet/src/Coss/Types/SchedulingLocationThreeType.cs new file mode 100644 index 000000000..62d841446 --- /dev/null +++ b/sdks/dotnet/src/Coss/Types/SchedulingLocationThreeType.cs @@ -0,0 +1,112 @@ +using Coss.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace Coss; + +[JsonConverter(typeof(SchedulingLocationThreeType.SchedulingLocationThreeTypeSerializer))] +[Serializable] +public readonly record struct SchedulingLocationThreeType : IStringEnum +{ + public static readonly SchedulingLocationThreeType GoogleMeet = new(Values.GoogleMeet); + + public SchedulingLocationThreeType(string value) + { + Value = value; + } + + /// + /// The string value of the enum. + /// + public string Value { get; } + + /// + /// Create a string enum with the given value. + /// + public static SchedulingLocationThreeType FromCustom(string value) + { + return new SchedulingLocationThreeType(value); + } + + public bool Equals(string? other) + { + return Value.Equals(other); + } + + /// + /// Returns the string value of the enum. + /// + public override string ToString() + { + return Value; + } + + public static bool operator ==(SchedulingLocationThreeType value1, string value2) => + value1.Value.Equals(value2); + + public static bool operator !=(SchedulingLocationThreeType value1, string value2) => + !value1.Value.Equals(value2); + + public static explicit operator string(SchedulingLocationThreeType value) => value.Value; + + public static explicit operator SchedulingLocationThreeType(string value) => new(value); + + internal class SchedulingLocationThreeTypeSerializer + : JsonConverter + { + public override SchedulingLocationThreeType Read( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON value could not be read as a string." + ); + return new SchedulingLocationThreeType(stringValue); + } + + public override void Write( + Utf8JsonWriter writer, + SchedulingLocationThreeType value, + JsonSerializerOptions options + ) + { + writer.WriteStringValue(value.Value); + } + + public override SchedulingLocationThreeType ReadAsPropertyName( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return new SchedulingLocationThreeType(stringValue); + } + + public override void WriteAsPropertyName( + Utf8JsonWriter writer, + SchedulingLocationThreeType value, + JsonSerializerOptions options + ) + { + writer.WritePropertyName(value.Value); + } + } + + /// + /// Constant strings for enum values + /// + [Serializable] + public static class Values + { + public const string GoogleMeet = "google_meet"; + } +} diff --git a/sdks/dotnet/src/Coss/Types/SchedulingLocationLink.cs b/sdks/dotnet/src/Coss/Types/SchedulingLocationZero.cs similarity index 84% rename from sdks/dotnet/src/Coss/Types/SchedulingLocationLink.cs rename to sdks/dotnet/src/Coss/Types/SchedulingLocationZero.cs index 36da1741f..1ac76cf3d 100644 --- a/sdks/dotnet/src/Coss/Types/SchedulingLocationLink.cs +++ b/sdks/dotnet/src/Coss/Types/SchedulingLocationZero.cs @@ -5,12 +5,15 @@ namespace Coss; [Serializable] -public record SchedulingLocationLink : IJsonOnDeserialized +public record SchedulingLocationZero : IJsonOnDeserialized { [JsonExtensionData] private readonly IDictionary _extensionData = new Dictionary(); + [JsonPropertyName("type")] + public required SchedulingLocationZeroType Type { get; set; } + /// /// The meeting link. `null` on an event type means the booking supplies its own. /// diff --git a/sdks/dotnet/src/Coss/Types/SchedulingLocationZeroType.cs b/sdks/dotnet/src/Coss/Types/SchedulingLocationZeroType.cs new file mode 100644 index 000000000..92bf43c82 --- /dev/null +++ b/sdks/dotnet/src/Coss/Types/SchedulingLocationZeroType.cs @@ -0,0 +1,111 @@ +using Coss.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace Coss; + +[JsonConverter(typeof(SchedulingLocationZeroType.SchedulingLocationZeroTypeSerializer))] +[Serializable] +public readonly record struct SchedulingLocationZeroType : IStringEnum +{ + public static readonly SchedulingLocationZeroType Link = new(Values.Link); + + public SchedulingLocationZeroType(string value) + { + Value = value; + } + + /// + /// The string value of the enum. + /// + public string Value { get; } + + /// + /// Create a string enum with the given value. + /// + public static SchedulingLocationZeroType FromCustom(string value) + { + return new SchedulingLocationZeroType(value); + } + + public bool Equals(string? other) + { + return Value.Equals(other); + } + + /// + /// Returns the string value of the enum. + /// + public override string ToString() + { + return Value; + } + + public static bool operator ==(SchedulingLocationZeroType value1, string value2) => + value1.Value.Equals(value2); + + public static bool operator !=(SchedulingLocationZeroType value1, string value2) => + !value1.Value.Equals(value2); + + public static explicit operator string(SchedulingLocationZeroType value) => value.Value; + + public static explicit operator SchedulingLocationZeroType(string value) => new(value); + + internal class SchedulingLocationZeroTypeSerializer : JsonConverter + { + public override SchedulingLocationZeroType Read( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON value could not be read as a string." + ); + return new SchedulingLocationZeroType(stringValue); + } + + public override void Write( + Utf8JsonWriter writer, + SchedulingLocationZeroType value, + JsonSerializerOptions options + ) + { + writer.WriteStringValue(value.Value); + } + + public override SchedulingLocationZeroType ReadAsPropertyName( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return new SchedulingLocationZeroType(stringValue); + } + + public override void WriteAsPropertyName( + Utf8JsonWriter writer, + SchedulingLocationZeroType value, + JsonSerializerOptions options + ) + { + writer.WritePropertyName(value.Value); + } + } + + /// + /// Constant strings for enum values + /// + [Serializable] + public static class Values + { + public const string Link = "link"; + } +} diff --git a/sdks/dotnet/src/Coss/Types/SchedulingOauthApp.cs b/sdks/dotnet/src/Coss/Types/SchedulingOauthApp.cs new file mode 100644 index 000000000..c19561e50 --- /dev/null +++ b/sdks/dotnet/src/Coss/Types/SchedulingOauthApp.cs @@ -0,0 +1,105 @@ +using Coss.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace Coss; + +[Serializable] +public record SchedulingOauthApp : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + [JsonPropertyName("object")] + public required SchedulingOauthAppObject Object { get; set; } + + [JsonPropertyName("id")] + public required string Id { get; set; } + + [JsonPropertyName("provider")] + public required SchedulingOauthAppProvider Provider { get; set; } + + [JsonPropertyName("client_id")] + public required string ClientId { get; set; } + + [Nullable] + [JsonPropertyName("tenant_id")] + public string? TenantId { get; set; } + + [Nullable] + [JsonPropertyName("redirect_uri")] + public string? RedirectUri { get; set; } + + /// + /// Register this with the provider if `redirect_uri` isn't set. If it is, that page forwards `code` and `state` here. + /// + [JsonPropertyName("coss_callback_url")] + public required string CossCallbackUrl { get; set; } + + [Nullable] + [JsonPropertyName("completion_url")] + public string? CompletionUrl { get; set; } + + /// + /// Zoom only: the Event notification endpoint URL for your app's deauthorization events. + /// + [Nullable] + [JsonPropertyName("zoom_event_url")] + public string? ZoomEventUrl { get; set; } + + /// + /// What to enable on your app at the provider. + /// + [JsonPropertyName("scopes")] + public IEnumerable Scopes { get; set; } = new List(); + + /// + /// `failing`: the provider refused the app's credentials. New consents are refused, and calendars connected through it can't be read until they work again. + /// + [JsonPropertyName("status")] + public required SchedulingOauthAppStatus Status { get; set; } + + [Nullable] + [JsonPropertyName("last_error_code")] + public string? LastErrorCode { get; set; } + + [Nullable] + [JsonPropertyName("last_error_at")] + public string? LastErrorAt { get; set; } + + [Nullable] + [JsonPropertyName("secret_expires_at")] + public string? SecretExpiresAt { get; set; } + + /// + /// When a consent first completed through this app, which proves its secret. + /// + [Nullable] + [JsonPropertyName("verified_at")] + public string? VerifiedAt { get; set; } + + /// + /// Calendar connections using this app. It can't be deleted while there are any. + /// + [JsonPropertyName("connections")] + public required long Connections { get; set; } + + [JsonPropertyName("created_at")] + public required string CreatedAt { get; set; } + + [JsonPropertyName("updated_at")] + public required string UpdatedAt { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/sdks/dotnet/src/Coss/Types/SchedulingOauthAppList.cs b/sdks/dotnet/src/Coss/Types/SchedulingOauthAppList.cs new file mode 100644 index 000000000..40881b3c9 --- /dev/null +++ b/sdks/dotnet/src/Coss/Types/SchedulingOauthAppList.cs @@ -0,0 +1,34 @@ +using Coss.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace Coss; + +[Serializable] +public record SchedulingOauthAppList : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + [JsonPropertyName("object")] + public required SchedulingOauthAppListObject Object { get; set; } + + [JsonPropertyName("data")] + public IEnumerable Data { get; set; } = new List(); + + [JsonPropertyName("has_more")] + public required bool HasMore { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/sdks/dotnet/src/Coss/Types/SchedulingOauthAppListObject.cs b/sdks/dotnet/src/Coss/Types/SchedulingOauthAppListObject.cs new file mode 100644 index 000000000..54eda483c --- /dev/null +++ b/sdks/dotnet/src/Coss/Types/SchedulingOauthAppListObject.cs @@ -0,0 +1,112 @@ +using Coss.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace Coss; + +[JsonConverter(typeof(SchedulingOauthAppListObject.SchedulingOauthAppListObjectSerializer))] +[Serializable] +public readonly record struct SchedulingOauthAppListObject : IStringEnum +{ + public static readonly SchedulingOauthAppListObject List = new(Values.List); + + public SchedulingOauthAppListObject(string value) + { + Value = value; + } + + /// + /// The string value of the enum. + /// + public string Value { get; } + + /// + /// Create a string enum with the given value. + /// + public static SchedulingOauthAppListObject FromCustom(string value) + { + return new SchedulingOauthAppListObject(value); + } + + public bool Equals(string? other) + { + return Value.Equals(other); + } + + /// + /// Returns the string value of the enum. + /// + public override string ToString() + { + return Value; + } + + public static bool operator ==(SchedulingOauthAppListObject value1, string value2) => + value1.Value.Equals(value2); + + public static bool operator !=(SchedulingOauthAppListObject value1, string value2) => + !value1.Value.Equals(value2); + + public static explicit operator string(SchedulingOauthAppListObject value) => value.Value; + + public static explicit operator SchedulingOauthAppListObject(string value) => new(value); + + internal class SchedulingOauthAppListObjectSerializer + : JsonConverter + { + public override SchedulingOauthAppListObject Read( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON value could not be read as a string." + ); + return new SchedulingOauthAppListObject(stringValue); + } + + public override void Write( + Utf8JsonWriter writer, + SchedulingOauthAppListObject value, + JsonSerializerOptions options + ) + { + writer.WriteStringValue(value.Value); + } + + public override SchedulingOauthAppListObject ReadAsPropertyName( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return new SchedulingOauthAppListObject(stringValue); + } + + public override void WriteAsPropertyName( + Utf8JsonWriter writer, + SchedulingOauthAppListObject value, + JsonSerializerOptions options + ) + { + writer.WritePropertyName(value.Value); + } + } + + /// + /// Constant strings for enum values + /// + [Serializable] + public static class Values + { + public const string List = "list"; + } +} diff --git a/sdks/dotnet/src/Coss/Types/SchedulingOauthAppObject.cs b/sdks/dotnet/src/Coss/Types/SchedulingOauthAppObject.cs new file mode 100644 index 000000000..daf380a91 --- /dev/null +++ b/sdks/dotnet/src/Coss/Types/SchedulingOauthAppObject.cs @@ -0,0 +1,113 @@ +using Coss.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace Coss; + +[JsonConverter(typeof(SchedulingOauthAppObject.SchedulingOauthAppObjectSerializer))] +[Serializable] +public readonly record struct SchedulingOauthAppObject : IStringEnum +{ + public static readonly SchedulingOauthAppObject SchedulingOauthApp = new( + Values.SchedulingOauthApp + ); + + public SchedulingOauthAppObject(string value) + { + Value = value; + } + + /// + /// The string value of the enum. + /// + public string Value { get; } + + /// + /// Create a string enum with the given value. + /// + public static SchedulingOauthAppObject FromCustom(string value) + { + return new SchedulingOauthAppObject(value); + } + + public bool Equals(string? other) + { + return Value.Equals(other); + } + + /// + /// Returns the string value of the enum. + /// + public override string ToString() + { + return Value; + } + + public static bool operator ==(SchedulingOauthAppObject value1, string value2) => + value1.Value.Equals(value2); + + public static bool operator !=(SchedulingOauthAppObject value1, string value2) => + !value1.Value.Equals(value2); + + public static explicit operator string(SchedulingOauthAppObject value) => value.Value; + + public static explicit operator SchedulingOauthAppObject(string value) => new(value); + + internal class SchedulingOauthAppObjectSerializer : JsonConverter + { + public override SchedulingOauthAppObject Read( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON value could not be read as a string." + ); + return new SchedulingOauthAppObject(stringValue); + } + + public override void Write( + Utf8JsonWriter writer, + SchedulingOauthAppObject value, + JsonSerializerOptions options + ) + { + writer.WriteStringValue(value.Value); + } + + public override SchedulingOauthAppObject ReadAsPropertyName( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return new SchedulingOauthAppObject(stringValue); + } + + public override void WriteAsPropertyName( + Utf8JsonWriter writer, + SchedulingOauthAppObject value, + JsonSerializerOptions options + ) + { + writer.WritePropertyName(value.Value); + } + } + + /// + /// Constant strings for enum values + /// + [Serializable] + public static class Values + { + public const string SchedulingOauthApp = "scheduling.oauth_app"; + } +} diff --git a/sdks/dotnet/src/Coss/Types/SchedulingOauthAppProvider.cs b/sdks/dotnet/src/Coss/Types/SchedulingOauthAppProvider.cs new file mode 100644 index 000000000..aa80bb8c1 --- /dev/null +++ b/sdks/dotnet/src/Coss/Types/SchedulingOauthAppProvider.cs @@ -0,0 +1,119 @@ +using Coss.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace Coss; + +[JsonConverter(typeof(SchedulingOauthAppProvider.SchedulingOauthAppProviderSerializer))] +[Serializable] +public readonly record struct SchedulingOauthAppProvider : IStringEnum +{ + public static readonly SchedulingOauthAppProvider Google = new(Values.Google); + + public static readonly SchedulingOauthAppProvider Microsoft = new(Values.Microsoft); + + public static readonly SchedulingOauthAppProvider Zoom = new(Values.Zoom); + + public SchedulingOauthAppProvider(string value) + { + Value = value; + } + + /// + /// The string value of the enum. + /// + public string Value { get; } + + /// + /// Create a string enum with the given value. + /// + public static SchedulingOauthAppProvider FromCustom(string value) + { + return new SchedulingOauthAppProvider(value); + } + + public bool Equals(string? other) + { + return Value.Equals(other); + } + + /// + /// Returns the string value of the enum. + /// + public override string ToString() + { + return Value; + } + + public static bool operator ==(SchedulingOauthAppProvider value1, string value2) => + value1.Value.Equals(value2); + + public static bool operator !=(SchedulingOauthAppProvider value1, string value2) => + !value1.Value.Equals(value2); + + public static explicit operator string(SchedulingOauthAppProvider value) => value.Value; + + public static explicit operator SchedulingOauthAppProvider(string value) => new(value); + + internal class SchedulingOauthAppProviderSerializer : JsonConverter + { + public override SchedulingOauthAppProvider Read( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON value could not be read as a string." + ); + return new SchedulingOauthAppProvider(stringValue); + } + + public override void Write( + Utf8JsonWriter writer, + SchedulingOauthAppProvider value, + JsonSerializerOptions options + ) + { + writer.WriteStringValue(value.Value); + } + + public override SchedulingOauthAppProvider ReadAsPropertyName( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return new SchedulingOauthAppProvider(stringValue); + } + + public override void WriteAsPropertyName( + Utf8JsonWriter writer, + SchedulingOauthAppProvider value, + JsonSerializerOptions options + ) + { + writer.WritePropertyName(value.Value); + } + } + + /// + /// Constant strings for enum values + /// + [Serializable] + public static class Values + { + public const string Google = "google"; + + public const string Microsoft = "microsoft"; + + public const string Zoom = "zoom"; + } +} diff --git a/sdks/dotnet/src/Coss/Types/SchedulingOauthAppStatus.cs b/sdks/dotnet/src/Coss/Types/SchedulingOauthAppStatus.cs new file mode 100644 index 000000000..36b47d4f2 --- /dev/null +++ b/sdks/dotnet/src/Coss/Types/SchedulingOauthAppStatus.cs @@ -0,0 +1,115 @@ +using Coss.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace Coss; + +[JsonConverter(typeof(SchedulingOauthAppStatus.SchedulingOauthAppStatusSerializer))] +[Serializable] +public readonly record struct SchedulingOauthAppStatus : IStringEnum +{ + public static readonly SchedulingOauthAppStatus Active = new(Values.Active); + + public static readonly SchedulingOauthAppStatus Failing = new(Values.Failing); + + public SchedulingOauthAppStatus(string value) + { + Value = value; + } + + /// + /// The string value of the enum. + /// + public string Value { get; } + + /// + /// Create a string enum with the given value. + /// + public static SchedulingOauthAppStatus FromCustom(string value) + { + return new SchedulingOauthAppStatus(value); + } + + public bool Equals(string? other) + { + return Value.Equals(other); + } + + /// + /// Returns the string value of the enum. + /// + public override string ToString() + { + return Value; + } + + public static bool operator ==(SchedulingOauthAppStatus value1, string value2) => + value1.Value.Equals(value2); + + public static bool operator !=(SchedulingOauthAppStatus value1, string value2) => + !value1.Value.Equals(value2); + + public static explicit operator string(SchedulingOauthAppStatus value) => value.Value; + + public static explicit operator SchedulingOauthAppStatus(string value) => new(value); + + internal class SchedulingOauthAppStatusSerializer : JsonConverter + { + public override SchedulingOauthAppStatus Read( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON value could not be read as a string." + ); + return new SchedulingOauthAppStatus(stringValue); + } + + public override void Write( + Utf8JsonWriter writer, + SchedulingOauthAppStatus value, + JsonSerializerOptions options + ) + { + writer.WriteStringValue(value.Value); + } + + public override SchedulingOauthAppStatus ReadAsPropertyName( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return new SchedulingOauthAppStatus(stringValue); + } + + public override void WriteAsPropertyName( + Utf8JsonWriter writer, + SchedulingOauthAppStatus value, + JsonSerializerOptions options + ) + { + writer.WritePropertyName(value.Value); + } + } + + /// + /// Constant strings for enum values + /// + [Serializable] + public static class Values + { + public const string Active = "active"; + + public const string Failing = "failing"; + } +} diff --git a/sdks/dotnet/src/Coss/Types/SchedulingOauthAppWebhookEvent.cs b/sdks/dotnet/src/Coss/Types/SchedulingOauthAppWebhookEvent.cs new file mode 100644 index 000000000..bcf3480a7 --- /dev/null +++ b/sdks/dotnet/src/Coss/Types/SchedulingOauthAppWebhookEvent.cs @@ -0,0 +1,52 @@ +using Coss.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace Coss; + +[Serializable] +public record SchedulingOauthAppWebhookEvent : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + /// + /// The event id. + /// + [JsonPropertyName("id")] + public required string Id { get; set; } + + [JsonPropertyName("object")] + public required SchedulingOauthAppWebhookEventObject Object { get; set; } + + /// + /// The API version this payload is rendered in: the endpoint's. + /// + [JsonPropertyName("api_version")] + public required string ApiVersion { get; set; } + + /// + /// When the event was created. + /// + [JsonPropertyName("created_at")] + public required DateTime CreatedAt { get; set; } + + [JsonPropertyName("type")] + public required SchedulingOauthAppWebhookEventType Type { get; set; } + + [JsonPropertyName("data")] + public required SchedulingOauthAppWebhookEventData Data { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/sdks/dotnet/src/Coss/Types/SchedulingOauthAppWebhookEventData.cs b/sdks/dotnet/src/Coss/Types/SchedulingOauthAppWebhookEventData.cs new file mode 100644 index 000000000..9b24d5b45 --- /dev/null +++ b/sdks/dotnet/src/Coss/Types/SchedulingOauthAppWebhookEventData.cs @@ -0,0 +1,41 @@ +using Coss.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace Coss; + +[Serializable] +public record SchedulingOauthAppWebhookEventData : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + [JsonPropertyName("oauth_app_id")] + public required string OauthAppId { get; set; } + + [JsonPropertyName("provider")] + public required string Provider { get; set; } + + /// + /// What the provider said, when it refused. + /// + [Nullable] + [JsonPropertyName("code")] + public string? Code { get; set; } + + [JsonPropertyName("occurred_at")] + public required string OccurredAt { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/sdks/dotnet/src/Coss/Types/SchedulingOauthAppWebhookEventObject.cs b/sdks/dotnet/src/Coss/Types/SchedulingOauthAppWebhookEventObject.cs new file mode 100644 index 000000000..a23aaa0a3 --- /dev/null +++ b/sdks/dotnet/src/Coss/Types/SchedulingOauthAppWebhookEventObject.cs @@ -0,0 +1,116 @@ +using Coss.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace Coss; + +[JsonConverter( + typeof(SchedulingOauthAppWebhookEventObject.SchedulingOauthAppWebhookEventObjectSerializer) +)] +[Serializable] +public readonly record struct SchedulingOauthAppWebhookEventObject : IStringEnum +{ + public static readonly SchedulingOauthAppWebhookEventObject Event = new(Values.Event); + + public SchedulingOauthAppWebhookEventObject(string value) + { + Value = value; + } + + /// + /// The string value of the enum. + /// + public string Value { get; } + + /// + /// Create a string enum with the given value. + /// + public static SchedulingOauthAppWebhookEventObject FromCustom(string value) + { + return new SchedulingOauthAppWebhookEventObject(value); + } + + public bool Equals(string? other) + { + return Value.Equals(other); + } + + /// + /// Returns the string value of the enum. + /// + public override string ToString() + { + return Value; + } + + public static bool operator ==(SchedulingOauthAppWebhookEventObject value1, string value2) => + value1.Value.Equals(value2); + + public static bool operator !=(SchedulingOauthAppWebhookEventObject value1, string value2) => + !value1.Value.Equals(value2); + + public static explicit operator string(SchedulingOauthAppWebhookEventObject value) => + value.Value; + + public static explicit operator SchedulingOauthAppWebhookEventObject(string value) => + new(value); + + internal class SchedulingOauthAppWebhookEventObjectSerializer + : JsonConverter + { + public override SchedulingOauthAppWebhookEventObject Read( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON value could not be read as a string." + ); + return new SchedulingOauthAppWebhookEventObject(stringValue); + } + + public override void Write( + Utf8JsonWriter writer, + SchedulingOauthAppWebhookEventObject value, + JsonSerializerOptions options + ) + { + writer.WriteStringValue(value.Value); + } + + public override SchedulingOauthAppWebhookEventObject ReadAsPropertyName( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return new SchedulingOauthAppWebhookEventObject(stringValue); + } + + public override void WriteAsPropertyName( + Utf8JsonWriter writer, + SchedulingOauthAppWebhookEventObject value, + JsonSerializerOptions options + ) + { + writer.WritePropertyName(value.Value); + } + } + + /// + /// Constant strings for enum values + /// + [Serializable] + public static class Values + { + public const string Event = "event"; + } +} diff --git a/sdks/dotnet/src/Coss/Types/SchedulingOauthAppWebhookEventType.cs b/sdks/dotnet/src/Coss/Types/SchedulingOauthAppWebhookEventType.cs new file mode 100644 index 000000000..29b814482 --- /dev/null +++ b/sdks/dotnet/src/Coss/Types/SchedulingOauthAppWebhookEventType.cs @@ -0,0 +1,122 @@ +using Coss.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace Coss; + +[JsonConverter( + typeof(SchedulingOauthAppWebhookEventType.SchedulingOauthAppWebhookEventTypeSerializer) +)] +[Serializable] +public readonly record struct SchedulingOauthAppWebhookEventType : IStringEnum +{ + public static readonly SchedulingOauthAppWebhookEventType SchedulingOauthAppFailing = new( + Values.SchedulingOauthAppFailing + ); + + public static readonly SchedulingOauthAppWebhookEventType SchedulingOauthAppRestored = new( + Values.SchedulingOauthAppRestored + ); + + public SchedulingOauthAppWebhookEventType(string value) + { + Value = value; + } + + /// + /// The string value of the enum. + /// + public string Value { get; } + + /// + /// Create a string enum with the given value. + /// + public static SchedulingOauthAppWebhookEventType FromCustom(string value) + { + return new SchedulingOauthAppWebhookEventType(value); + } + + public bool Equals(string? other) + { + return Value.Equals(other); + } + + /// + /// Returns the string value of the enum. + /// + public override string ToString() + { + return Value; + } + + public static bool operator ==(SchedulingOauthAppWebhookEventType value1, string value2) => + value1.Value.Equals(value2); + + public static bool operator !=(SchedulingOauthAppWebhookEventType value1, string value2) => + !value1.Value.Equals(value2); + + public static explicit operator string(SchedulingOauthAppWebhookEventType value) => value.Value; + + public static explicit operator SchedulingOauthAppWebhookEventType(string value) => new(value); + + internal class SchedulingOauthAppWebhookEventTypeSerializer + : JsonConverter + { + public override SchedulingOauthAppWebhookEventType Read( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON value could not be read as a string." + ); + return new SchedulingOauthAppWebhookEventType(stringValue); + } + + public override void Write( + Utf8JsonWriter writer, + SchedulingOauthAppWebhookEventType value, + JsonSerializerOptions options + ) + { + writer.WriteStringValue(value.Value); + } + + public override SchedulingOauthAppWebhookEventType ReadAsPropertyName( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return new SchedulingOauthAppWebhookEventType(stringValue); + } + + public override void WriteAsPropertyName( + Utf8JsonWriter writer, + SchedulingOauthAppWebhookEventType value, + JsonSerializerOptions options + ) + { + writer.WritePropertyName(value.Value); + } + } + + /// + /// Constant strings for enum values + /// + [Serializable] + public static class Values + { + public const string SchedulingOauthAppFailing = "scheduling.oauth_app.failing"; + + public const string SchedulingOauthAppRestored = "scheduling.oauth_app.restored"; + } +} diff --git a/sdks/dotnet/src/Coss/Types/SchedulingOutOfOffice.cs b/sdks/dotnet/src/Coss/Types/SchedulingOutOfOffice.cs new file mode 100644 index 000000000..6e39ef75d --- /dev/null +++ b/sdks/dotnet/src/Coss/Types/SchedulingOutOfOffice.cs @@ -0,0 +1,90 @@ +using Coss.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace Coss; + +[Serializable] +public record SchedulingOutOfOffice : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + [JsonPropertyName("object")] + public required SchedulingOutOfOfficeObject Object { get; set; } + + [JsonPropertyName("id")] + public required string Id { get; set; } + + [JsonPropertyName("host")] + public required string Host { get; set; } + + [JsonPropertyName("start")] + public required string Start { get; set; } + + [JsonPropertyName("end")] + public required string End { get; set; } + + /// + /// How it was given, when it was as whole dates. + /// + [Nullable] + [JsonPropertyName("all_day")] + public SchedulingOutOfOfficeAllDay? AllDay { get; set; } + + [JsonPropertyName("reason")] + public required string Reason { get; set; } + + [Nullable] + [JsonPropertyName("notes")] + public string? Notes { get; set; } + + [Nullable] + [JsonPropertyName("public_message")] + public string? PublicMessage { get; set; } + + [JsonPropertyName("show_on_calendar")] + public required bool ShowOnCalendar { get; set; } + + /// + /// Who can be booked in their place. + /// + [JsonPropertyName("delegates")] + public IEnumerable Delegates { get; set; } = new List(); + + [JsonPropertyName("existing_bookings")] + public required SchedulingOutOfOfficeExistingBookings ExistingBookings { get; set; } + + [Nullable] + [JsonPropertyName("external_id")] + public string? ExternalId { get; set; } + + /// + /// Shared by the entries one request made for several hosts. + /// + [Nullable] + [JsonPropertyName("group")] + public string? Group { get; set; } + + [JsonPropertyName("source")] + public required SchedulingOutOfOfficeSource Source { get; set; } + + [JsonPropertyName("created_at")] + public required string CreatedAt { get; set; } + + [JsonPropertyName("updated_at")] + public required string UpdatedAt { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/sdks/dotnet/src/Coss/Types/SchedulingOutOfOfficeAllDay.cs b/sdks/dotnet/src/Coss/Types/SchedulingOutOfOfficeAllDay.cs new file mode 100644 index 000000000..caf4f7898 --- /dev/null +++ b/sdks/dotnet/src/Coss/Types/SchedulingOutOfOfficeAllDay.cs @@ -0,0 +1,37 @@ +using Coss.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace Coss; + +/// +/// How it was given, when it was as whole dates. +/// +[Serializable] +public record SchedulingOutOfOfficeAllDay : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + [JsonPropertyName("start_date")] + public required string StartDate { get; set; } + + [JsonPropertyName("end_date")] + public required string EndDate { get; set; } + + [JsonPropertyName("time_zone")] + public required string TimeZone { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/sdks/dotnet/src/Coss/Types/SchedulingOutOfOfficeConflict.cs b/sdks/dotnet/src/Coss/Types/SchedulingOutOfOfficeConflict.cs new file mode 100644 index 000000000..95f426f35 --- /dev/null +++ b/sdks/dotnet/src/Coss/Types/SchedulingOutOfOfficeConflict.cs @@ -0,0 +1,54 @@ +using Coss.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace Coss; + +[Serializable] +public record SchedulingOutOfOfficeConflict : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + [JsonPropertyName("object")] + public required SchedulingOutOfOfficeConflictObject Object { get; set; } + + [JsonPropertyName("booking")] + public required string Booking { get; set; } + + [JsonPropertyName("event_type")] + public required string EventType { get; set; } + + [JsonPropertyName("title")] + public required string Title { get; set; } + + [JsonPropertyName("status")] + public required SchedulingOutOfOfficeConflictStatus Status { get; set; } + + [JsonPropertyName("start")] + public required string Start { get; set; } + + [JsonPropertyName("end")] + public required string End { get; set; } + + [Nullable] + [JsonPropertyName("series")] + public string? Series { get; set; } + + [Nullable] + [JsonPropertyName("group_session")] + public string? GroupSession { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/sdks/dotnet/src/Coss/Types/SchedulingOutOfOfficeConflictList.cs b/sdks/dotnet/src/Coss/Types/SchedulingOutOfOfficeConflictList.cs new file mode 100644 index 000000000..6a35e41f8 --- /dev/null +++ b/sdks/dotnet/src/Coss/Types/SchedulingOutOfOfficeConflictList.cs @@ -0,0 +1,35 @@ +using Coss.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace Coss; + +[Serializable] +public record SchedulingOutOfOfficeConflictList : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + [JsonPropertyName("object")] + public required SchedulingOutOfOfficeConflictListObject Object { get; set; } + + [JsonPropertyName("data")] + public IEnumerable Data { get; set; } = + new List(); + + [JsonPropertyName("has_more")] + public required bool HasMore { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/sdks/dotnet/src/Coss/Types/SchedulingOutOfOfficeConflictListObject.cs b/sdks/dotnet/src/Coss/Types/SchedulingOutOfOfficeConflictListObject.cs new file mode 100644 index 000000000..5dbd2cb1d --- /dev/null +++ b/sdks/dotnet/src/Coss/Types/SchedulingOutOfOfficeConflictListObject.cs @@ -0,0 +1,116 @@ +using Coss.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace Coss; + +[JsonConverter( + typeof(SchedulingOutOfOfficeConflictListObject.SchedulingOutOfOfficeConflictListObjectSerializer) +)] +[Serializable] +public readonly record struct SchedulingOutOfOfficeConflictListObject : IStringEnum +{ + public static readonly SchedulingOutOfOfficeConflictListObject List = new(Values.List); + + public SchedulingOutOfOfficeConflictListObject(string value) + { + Value = value; + } + + /// + /// The string value of the enum. + /// + public string Value { get; } + + /// + /// Create a string enum with the given value. + /// + public static SchedulingOutOfOfficeConflictListObject FromCustom(string value) + { + return new SchedulingOutOfOfficeConflictListObject(value); + } + + public bool Equals(string? other) + { + return Value.Equals(other); + } + + /// + /// Returns the string value of the enum. + /// + public override string ToString() + { + return Value; + } + + public static bool operator ==(SchedulingOutOfOfficeConflictListObject value1, string value2) => + value1.Value.Equals(value2); + + public static bool operator !=(SchedulingOutOfOfficeConflictListObject value1, string value2) => + !value1.Value.Equals(value2); + + public static explicit operator string(SchedulingOutOfOfficeConflictListObject value) => + value.Value; + + public static explicit operator SchedulingOutOfOfficeConflictListObject(string value) => + new(value); + + internal class SchedulingOutOfOfficeConflictListObjectSerializer + : JsonConverter + { + public override SchedulingOutOfOfficeConflictListObject Read( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON value could not be read as a string." + ); + return new SchedulingOutOfOfficeConflictListObject(stringValue); + } + + public override void Write( + Utf8JsonWriter writer, + SchedulingOutOfOfficeConflictListObject value, + JsonSerializerOptions options + ) + { + writer.WriteStringValue(value.Value); + } + + public override SchedulingOutOfOfficeConflictListObject ReadAsPropertyName( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return new SchedulingOutOfOfficeConflictListObject(stringValue); + } + + public override void WriteAsPropertyName( + Utf8JsonWriter writer, + SchedulingOutOfOfficeConflictListObject value, + JsonSerializerOptions options + ) + { + writer.WritePropertyName(value.Value); + } + } + + /// + /// Constant strings for enum values + /// + [Serializable] + public static class Values + { + public const string List = "list"; + } +} diff --git a/sdks/dotnet/src/Coss/Types/SchedulingOutOfOfficeConflictObject.cs b/sdks/dotnet/src/Coss/Types/SchedulingOutOfOfficeConflictObject.cs new file mode 100644 index 000000000..83d2a895b --- /dev/null +++ b/sdks/dotnet/src/Coss/Types/SchedulingOutOfOfficeConflictObject.cs @@ -0,0 +1,117 @@ +using Coss.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace Coss; + +[JsonConverter( + typeof(SchedulingOutOfOfficeConflictObject.SchedulingOutOfOfficeConflictObjectSerializer) +)] +[Serializable] +public readonly record struct SchedulingOutOfOfficeConflictObject : IStringEnum +{ + public static readonly SchedulingOutOfOfficeConflictObject SchedulingOutOfOfficeConflict = new( + Values.SchedulingOutOfOfficeConflict + ); + + public SchedulingOutOfOfficeConflictObject(string value) + { + Value = value; + } + + /// + /// The string value of the enum. + /// + public string Value { get; } + + /// + /// Create a string enum with the given value. + /// + public static SchedulingOutOfOfficeConflictObject FromCustom(string value) + { + return new SchedulingOutOfOfficeConflictObject(value); + } + + public bool Equals(string? other) + { + return Value.Equals(other); + } + + /// + /// Returns the string value of the enum. + /// + public override string ToString() + { + return Value; + } + + public static bool operator ==(SchedulingOutOfOfficeConflictObject value1, string value2) => + value1.Value.Equals(value2); + + public static bool operator !=(SchedulingOutOfOfficeConflictObject value1, string value2) => + !value1.Value.Equals(value2); + + public static explicit operator string(SchedulingOutOfOfficeConflictObject value) => + value.Value; + + public static explicit operator SchedulingOutOfOfficeConflictObject(string value) => new(value); + + internal class SchedulingOutOfOfficeConflictObjectSerializer + : JsonConverter + { + public override SchedulingOutOfOfficeConflictObject Read( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON value could not be read as a string." + ); + return new SchedulingOutOfOfficeConflictObject(stringValue); + } + + public override void Write( + Utf8JsonWriter writer, + SchedulingOutOfOfficeConflictObject value, + JsonSerializerOptions options + ) + { + writer.WriteStringValue(value.Value); + } + + public override SchedulingOutOfOfficeConflictObject ReadAsPropertyName( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return new SchedulingOutOfOfficeConflictObject(stringValue); + } + + public override void WriteAsPropertyName( + Utf8JsonWriter writer, + SchedulingOutOfOfficeConflictObject value, + JsonSerializerOptions options + ) + { + writer.WritePropertyName(value.Value); + } + } + + /// + /// Constant strings for enum values + /// + [Serializable] + public static class Values + { + public const string SchedulingOutOfOfficeConflict = "scheduling.out_of_office_conflict"; + } +} diff --git a/sdks/dotnet/src/Coss/Types/SchedulingOutOfOfficeConflictStatus.cs b/sdks/dotnet/src/Coss/Types/SchedulingOutOfOfficeConflictStatus.cs new file mode 100644 index 000000000..157df2081 --- /dev/null +++ b/sdks/dotnet/src/Coss/Types/SchedulingOutOfOfficeConflictStatus.cs @@ -0,0 +1,133 @@ +using Coss.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace Coss; + +[JsonConverter( + typeof(SchedulingOutOfOfficeConflictStatus.SchedulingOutOfOfficeConflictStatusSerializer) +)] +[Serializable] +public readonly record struct SchedulingOutOfOfficeConflictStatus : IStringEnum +{ + public static readonly SchedulingOutOfOfficeConflictStatus Held = new(Values.Held); + + public static readonly SchedulingOutOfOfficeConflictStatus PendingApproval = new( + Values.PendingApproval + ); + + public static readonly SchedulingOutOfOfficeConflictStatus Confirmed = new(Values.Confirmed); + + public static readonly SchedulingOutOfOfficeConflictStatus Cancelled = new(Values.Cancelled); + + public static readonly SchedulingOutOfOfficeConflictStatus Declined = new(Values.Declined); + + public SchedulingOutOfOfficeConflictStatus(string value) + { + Value = value; + } + + /// + /// The string value of the enum. + /// + public string Value { get; } + + /// + /// Create a string enum with the given value. + /// + public static SchedulingOutOfOfficeConflictStatus FromCustom(string value) + { + return new SchedulingOutOfOfficeConflictStatus(value); + } + + public bool Equals(string? other) + { + return Value.Equals(other); + } + + /// + /// Returns the string value of the enum. + /// + public override string ToString() + { + return Value; + } + + public static bool operator ==(SchedulingOutOfOfficeConflictStatus value1, string value2) => + value1.Value.Equals(value2); + + public static bool operator !=(SchedulingOutOfOfficeConflictStatus value1, string value2) => + !value1.Value.Equals(value2); + + public static explicit operator string(SchedulingOutOfOfficeConflictStatus value) => + value.Value; + + public static explicit operator SchedulingOutOfOfficeConflictStatus(string value) => new(value); + + internal class SchedulingOutOfOfficeConflictStatusSerializer + : JsonConverter + { + public override SchedulingOutOfOfficeConflictStatus Read( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON value could not be read as a string." + ); + return new SchedulingOutOfOfficeConflictStatus(stringValue); + } + + public override void Write( + Utf8JsonWriter writer, + SchedulingOutOfOfficeConflictStatus value, + JsonSerializerOptions options + ) + { + writer.WriteStringValue(value.Value); + } + + public override SchedulingOutOfOfficeConflictStatus ReadAsPropertyName( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return new SchedulingOutOfOfficeConflictStatus(stringValue); + } + + public override void WriteAsPropertyName( + Utf8JsonWriter writer, + SchedulingOutOfOfficeConflictStatus value, + JsonSerializerOptions options + ) + { + writer.WritePropertyName(value.Value); + } + } + + /// + /// Constant strings for enum values + /// + [Serializable] + public static class Values + { + public const string Held = "held"; + + public const string PendingApproval = "pending_approval"; + + public const string Confirmed = "confirmed"; + + public const string Cancelled = "cancelled"; + + public const string Declined = "declined"; + } +} diff --git a/sdks/dotnet/src/Coss/Types/SchedulingOutOfOfficeExistingBookings.cs b/sdks/dotnet/src/Coss/Types/SchedulingOutOfOfficeExistingBookings.cs new file mode 100644 index 000000000..6e74f1b96 --- /dev/null +++ b/sdks/dotnet/src/Coss/Types/SchedulingOutOfOfficeExistingBookings.cs @@ -0,0 +1,120 @@ +using Coss.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace Coss; + +[JsonConverter( + typeof(SchedulingOutOfOfficeExistingBookings.SchedulingOutOfOfficeExistingBookingsSerializer) +)] +[Serializable] +public readonly record struct SchedulingOutOfOfficeExistingBookings : IStringEnum +{ + public static readonly SchedulingOutOfOfficeExistingBookings Leave = new(Values.Leave); + + public static readonly SchedulingOutOfOfficeExistingBookings Reassign = new(Values.Reassign); + + public SchedulingOutOfOfficeExistingBookings(string value) + { + Value = value; + } + + /// + /// The string value of the enum. + /// + public string Value { get; } + + /// + /// Create a string enum with the given value. + /// + public static SchedulingOutOfOfficeExistingBookings FromCustom(string value) + { + return new SchedulingOutOfOfficeExistingBookings(value); + } + + public bool Equals(string? other) + { + return Value.Equals(other); + } + + /// + /// Returns the string value of the enum. + /// + public override string ToString() + { + return Value; + } + + public static bool operator ==(SchedulingOutOfOfficeExistingBookings value1, string value2) => + value1.Value.Equals(value2); + + public static bool operator !=(SchedulingOutOfOfficeExistingBookings value1, string value2) => + !value1.Value.Equals(value2); + + public static explicit operator string(SchedulingOutOfOfficeExistingBookings value) => + value.Value; + + public static explicit operator SchedulingOutOfOfficeExistingBookings(string value) => + new(value); + + internal class SchedulingOutOfOfficeExistingBookingsSerializer + : JsonConverter + { + public override SchedulingOutOfOfficeExistingBookings Read( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON value could not be read as a string." + ); + return new SchedulingOutOfOfficeExistingBookings(stringValue); + } + + public override void Write( + Utf8JsonWriter writer, + SchedulingOutOfOfficeExistingBookings value, + JsonSerializerOptions options + ) + { + writer.WriteStringValue(value.Value); + } + + public override SchedulingOutOfOfficeExistingBookings ReadAsPropertyName( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return new SchedulingOutOfOfficeExistingBookings(stringValue); + } + + public override void WriteAsPropertyName( + Utf8JsonWriter writer, + SchedulingOutOfOfficeExistingBookings value, + JsonSerializerOptions options + ) + { + writer.WritePropertyName(value.Value); + } + } + + /// + /// Constant strings for enum values + /// + [Serializable] + public static class Values + { + public const string Leave = "leave"; + + public const string Reassign = "reassign"; + } +} diff --git a/sdks/dotnet/src/Coss/Types/SchedulingOutOfOfficeList.cs b/sdks/dotnet/src/Coss/Types/SchedulingOutOfOfficeList.cs new file mode 100644 index 000000000..55cd25a1d --- /dev/null +++ b/sdks/dotnet/src/Coss/Types/SchedulingOutOfOfficeList.cs @@ -0,0 +1,35 @@ +using Coss.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace Coss; + +[Serializable] +public record SchedulingOutOfOfficeList : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + [JsonPropertyName("object")] + public required SchedulingOutOfOfficeListObject Object { get; set; } + + [JsonPropertyName("data")] + public IEnumerable Data { get; set; } = + new List(); + + [JsonPropertyName("has_more")] + public required bool HasMore { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/sdks/dotnet/src/Coss/Types/SchedulingOutOfOfficeListObject.cs b/sdks/dotnet/src/Coss/Types/SchedulingOutOfOfficeListObject.cs new file mode 100644 index 000000000..cbb868dcb --- /dev/null +++ b/sdks/dotnet/src/Coss/Types/SchedulingOutOfOfficeListObject.cs @@ -0,0 +1,112 @@ +using Coss.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace Coss; + +[JsonConverter(typeof(SchedulingOutOfOfficeListObject.SchedulingOutOfOfficeListObjectSerializer))] +[Serializable] +public readonly record struct SchedulingOutOfOfficeListObject : IStringEnum +{ + public static readonly SchedulingOutOfOfficeListObject List = new(Values.List); + + public SchedulingOutOfOfficeListObject(string value) + { + Value = value; + } + + /// + /// The string value of the enum. + /// + public string Value { get; } + + /// + /// Create a string enum with the given value. + /// + public static SchedulingOutOfOfficeListObject FromCustom(string value) + { + return new SchedulingOutOfOfficeListObject(value); + } + + public bool Equals(string? other) + { + return Value.Equals(other); + } + + /// + /// Returns the string value of the enum. + /// + public override string ToString() + { + return Value; + } + + public static bool operator ==(SchedulingOutOfOfficeListObject value1, string value2) => + value1.Value.Equals(value2); + + public static bool operator !=(SchedulingOutOfOfficeListObject value1, string value2) => + !value1.Value.Equals(value2); + + public static explicit operator string(SchedulingOutOfOfficeListObject value) => value.Value; + + public static explicit operator SchedulingOutOfOfficeListObject(string value) => new(value); + + internal class SchedulingOutOfOfficeListObjectSerializer + : JsonConverter + { + public override SchedulingOutOfOfficeListObject Read( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON value could not be read as a string." + ); + return new SchedulingOutOfOfficeListObject(stringValue); + } + + public override void Write( + Utf8JsonWriter writer, + SchedulingOutOfOfficeListObject value, + JsonSerializerOptions options + ) + { + writer.WriteStringValue(value.Value); + } + + public override SchedulingOutOfOfficeListObject ReadAsPropertyName( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return new SchedulingOutOfOfficeListObject(stringValue); + } + + public override void WriteAsPropertyName( + Utf8JsonWriter writer, + SchedulingOutOfOfficeListObject value, + JsonSerializerOptions options + ) + { + writer.WritePropertyName(value.Value); + } + } + + /// + /// Constant strings for enum values + /// + [Serializable] + public static class Values + { + public const string List = "list"; + } +} diff --git a/sdks/dotnet/src/Coss/Types/SchedulingOutOfOfficeObject.cs b/sdks/dotnet/src/Coss/Types/SchedulingOutOfOfficeObject.cs new file mode 100644 index 000000000..d92f1bfbd --- /dev/null +++ b/sdks/dotnet/src/Coss/Types/SchedulingOutOfOfficeObject.cs @@ -0,0 +1,114 @@ +using Coss.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace Coss; + +[JsonConverter(typeof(SchedulingOutOfOfficeObject.SchedulingOutOfOfficeObjectSerializer))] +[Serializable] +public readonly record struct SchedulingOutOfOfficeObject : IStringEnum +{ + public static readonly SchedulingOutOfOfficeObject SchedulingOutOfOffice = new( + Values.SchedulingOutOfOffice + ); + + public SchedulingOutOfOfficeObject(string value) + { + Value = value; + } + + /// + /// The string value of the enum. + /// + public string Value { get; } + + /// + /// Create a string enum with the given value. + /// + public static SchedulingOutOfOfficeObject FromCustom(string value) + { + return new SchedulingOutOfOfficeObject(value); + } + + public bool Equals(string? other) + { + return Value.Equals(other); + } + + /// + /// Returns the string value of the enum. + /// + public override string ToString() + { + return Value; + } + + public static bool operator ==(SchedulingOutOfOfficeObject value1, string value2) => + value1.Value.Equals(value2); + + public static bool operator !=(SchedulingOutOfOfficeObject value1, string value2) => + !value1.Value.Equals(value2); + + public static explicit operator string(SchedulingOutOfOfficeObject value) => value.Value; + + public static explicit operator SchedulingOutOfOfficeObject(string value) => new(value); + + internal class SchedulingOutOfOfficeObjectSerializer + : JsonConverter + { + public override SchedulingOutOfOfficeObject Read( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON value could not be read as a string." + ); + return new SchedulingOutOfOfficeObject(stringValue); + } + + public override void Write( + Utf8JsonWriter writer, + SchedulingOutOfOfficeObject value, + JsonSerializerOptions options + ) + { + writer.WriteStringValue(value.Value); + } + + public override SchedulingOutOfOfficeObject ReadAsPropertyName( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return new SchedulingOutOfOfficeObject(stringValue); + } + + public override void WriteAsPropertyName( + Utf8JsonWriter writer, + SchedulingOutOfOfficeObject value, + JsonSerializerOptions options + ) + { + writer.WritePropertyName(value.Value); + } + } + + /// + /// Constant strings for enum values + /// + [Serializable] + public static class Values + { + public const string SchedulingOutOfOffice = "scheduling.out_of_office"; + } +} diff --git a/sdks/dotnet/src/Coss/Types/SchedulingOutOfOfficeSource.cs b/sdks/dotnet/src/Coss/Types/SchedulingOutOfOfficeSource.cs new file mode 100644 index 000000000..f985655d3 --- /dev/null +++ b/sdks/dotnet/src/Coss/Types/SchedulingOutOfOfficeSource.cs @@ -0,0 +1,128 @@ +using Coss.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace Coss; + +[JsonConverter(typeof(SchedulingOutOfOfficeSource.SchedulingOutOfOfficeSourceSerializer))] +[Serializable] +public readonly record struct SchedulingOutOfOfficeSource : IStringEnum +{ + public static readonly SchedulingOutOfOfficeSource Api = new(Values.Api); + + public static readonly SchedulingOutOfOfficeSource Host = new(Values.Host); + + public static readonly SchedulingOutOfOfficeSource Manager = new(Values.Manager); + + public static readonly SchedulingOutOfOfficeSource Dashboard = new(Values.Dashboard); + + public static readonly SchedulingOutOfOfficeSource Holiday = new(Values.Holiday); + + public SchedulingOutOfOfficeSource(string value) + { + Value = value; + } + + /// + /// The string value of the enum. + /// + public string Value { get; } + + /// + /// Create a string enum with the given value. + /// + public static SchedulingOutOfOfficeSource FromCustom(string value) + { + return new SchedulingOutOfOfficeSource(value); + } + + public bool Equals(string? other) + { + return Value.Equals(other); + } + + /// + /// Returns the string value of the enum. + /// + public override string ToString() + { + return Value; + } + + public static bool operator ==(SchedulingOutOfOfficeSource value1, string value2) => + value1.Value.Equals(value2); + + public static bool operator !=(SchedulingOutOfOfficeSource value1, string value2) => + !value1.Value.Equals(value2); + + public static explicit operator string(SchedulingOutOfOfficeSource value) => value.Value; + + public static explicit operator SchedulingOutOfOfficeSource(string value) => new(value); + + internal class SchedulingOutOfOfficeSourceSerializer + : JsonConverter + { + public override SchedulingOutOfOfficeSource Read( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON value could not be read as a string." + ); + return new SchedulingOutOfOfficeSource(stringValue); + } + + public override void Write( + Utf8JsonWriter writer, + SchedulingOutOfOfficeSource value, + JsonSerializerOptions options + ) + { + writer.WriteStringValue(value.Value); + } + + public override SchedulingOutOfOfficeSource ReadAsPropertyName( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return new SchedulingOutOfOfficeSource(stringValue); + } + + public override void WriteAsPropertyName( + Utf8JsonWriter writer, + SchedulingOutOfOfficeSource value, + JsonSerializerOptions options + ) + { + writer.WritePropertyName(value.Value); + } + } + + /// + /// Constant strings for enum values + /// + [Serializable] + public static class Values + { + public const string Api = "api"; + + public const string Host = "host"; + + public const string Manager = "manager"; + + public const string Dashboard = "dashboard"; + + public const string Holiday = "holiday"; + } +} diff --git a/sdks/dotnet/src/Coss/Types/SchedulingOutOfOfficeWebhookEvent.cs b/sdks/dotnet/src/Coss/Types/SchedulingOutOfOfficeWebhookEvent.cs new file mode 100644 index 000000000..7d9ae26a5 --- /dev/null +++ b/sdks/dotnet/src/Coss/Types/SchedulingOutOfOfficeWebhookEvent.cs @@ -0,0 +1,52 @@ +using Coss.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace Coss; + +[Serializable] +public record SchedulingOutOfOfficeWebhookEvent : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + /// + /// The event id. + /// + [JsonPropertyName("id")] + public required string Id { get; set; } + + [JsonPropertyName("object")] + public required SchedulingOutOfOfficeWebhookEventObject Object { get; set; } + + /// + /// The API version this payload is rendered in: the endpoint's. + /// + [JsonPropertyName("api_version")] + public required string ApiVersion { get; set; } + + /// + /// When the event was created. + /// + [JsonPropertyName("created_at")] + public required DateTime CreatedAt { get; set; } + + [JsonPropertyName("type")] + public required SchedulingOutOfOfficeWebhookEventType Type { get; set; } + + [JsonPropertyName("data")] + public required SchedulingOutOfOfficeWebhookEventData Data { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/sdks/dotnet/src/Coss/Types/SchedulingOutOfOfficeWebhookEventData.cs b/sdks/dotnet/src/Coss/Types/SchedulingOutOfOfficeWebhookEventData.cs new file mode 100644 index 000000000..c470ec3d7 --- /dev/null +++ b/sdks/dotnet/src/Coss/Types/SchedulingOutOfOfficeWebhookEventData.cs @@ -0,0 +1,44 @@ +using Coss.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace Coss; + +[Serializable] +public record SchedulingOutOfOfficeWebhookEventData : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + [JsonPropertyName("out_of_office_id")] + public required string OutOfOfficeId { get; set; } + + [JsonPropertyName("host_id")] + public required string HostId { get; set; } + + [JsonPropertyName("start")] + public required string Start { get; set; } + + [JsonPropertyName("end")] + public required string End { get; set; } + + [Nullable] + [JsonPropertyName("group")] + public string? Group { get; set; } + + [JsonPropertyName("occurred_at")] + public required string OccurredAt { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/sdks/dotnet/src/Coss/Types/SchedulingOutOfOfficeWebhookEventObject.cs b/sdks/dotnet/src/Coss/Types/SchedulingOutOfOfficeWebhookEventObject.cs new file mode 100644 index 000000000..08355e140 --- /dev/null +++ b/sdks/dotnet/src/Coss/Types/SchedulingOutOfOfficeWebhookEventObject.cs @@ -0,0 +1,116 @@ +using Coss.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace Coss; + +[JsonConverter( + typeof(SchedulingOutOfOfficeWebhookEventObject.SchedulingOutOfOfficeWebhookEventObjectSerializer) +)] +[Serializable] +public readonly record struct SchedulingOutOfOfficeWebhookEventObject : IStringEnum +{ + public static readonly SchedulingOutOfOfficeWebhookEventObject Event = new(Values.Event); + + public SchedulingOutOfOfficeWebhookEventObject(string value) + { + Value = value; + } + + /// + /// The string value of the enum. + /// + public string Value { get; } + + /// + /// Create a string enum with the given value. + /// + public static SchedulingOutOfOfficeWebhookEventObject FromCustom(string value) + { + return new SchedulingOutOfOfficeWebhookEventObject(value); + } + + public bool Equals(string? other) + { + return Value.Equals(other); + } + + /// + /// Returns the string value of the enum. + /// + public override string ToString() + { + return Value; + } + + public static bool operator ==(SchedulingOutOfOfficeWebhookEventObject value1, string value2) => + value1.Value.Equals(value2); + + public static bool operator !=(SchedulingOutOfOfficeWebhookEventObject value1, string value2) => + !value1.Value.Equals(value2); + + public static explicit operator string(SchedulingOutOfOfficeWebhookEventObject value) => + value.Value; + + public static explicit operator SchedulingOutOfOfficeWebhookEventObject(string value) => + new(value); + + internal class SchedulingOutOfOfficeWebhookEventObjectSerializer + : JsonConverter + { + public override SchedulingOutOfOfficeWebhookEventObject Read( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON value could not be read as a string." + ); + return new SchedulingOutOfOfficeWebhookEventObject(stringValue); + } + + public override void Write( + Utf8JsonWriter writer, + SchedulingOutOfOfficeWebhookEventObject value, + JsonSerializerOptions options + ) + { + writer.WriteStringValue(value.Value); + } + + public override SchedulingOutOfOfficeWebhookEventObject ReadAsPropertyName( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return new SchedulingOutOfOfficeWebhookEventObject(stringValue); + } + + public override void WriteAsPropertyName( + Utf8JsonWriter writer, + SchedulingOutOfOfficeWebhookEventObject value, + JsonSerializerOptions options + ) + { + writer.WritePropertyName(value.Value); + } + } + + /// + /// Constant strings for enum values + /// + [Serializable] + public static class Values + { + public const string Event = "event"; + } +} diff --git a/sdks/dotnet/src/Coss/Types/SchedulingOutOfOfficeWebhookEventType.cs b/sdks/dotnet/src/Coss/Types/SchedulingOutOfOfficeWebhookEventType.cs new file mode 100644 index 000000000..4eaf111db --- /dev/null +++ b/sdks/dotnet/src/Coss/Types/SchedulingOutOfOfficeWebhookEventType.cs @@ -0,0 +1,142 @@ +using Coss.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace Coss; + +[JsonConverter( + typeof(SchedulingOutOfOfficeWebhookEventType.SchedulingOutOfOfficeWebhookEventTypeSerializer) +)] +[Serializable] +public readonly record struct SchedulingOutOfOfficeWebhookEventType : IStringEnum +{ + public static readonly SchedulingOutOfOfficeWebhookEventType SchedulingOutOfOfficeCreated = new( + Values.SchedulingOutOfOfficeCreated + ); + + public static readonly SchedulingOutOfOfficeWebhookEventType SchedulingOutOfOfficeUpdated = new( + Values.SchedulingOutOfOfficeUpdated + ); + + public static readonly SchedulingOutOfOfficeWebhookEventType SchedulingOutOfOfficeDeleted = new( + Values.SchedulingOutOfOfficeDeleted + ); + + public static readonly SchedulingOutOfOfficeWebhookEventType SchedulingOutOfOfficeStarted = new( + Values.SchedulingOutOfOfficeStarted + ); + + public static readonly SchedulingOutOfOfficeWebhookEventType SchedulingOutOfOfficeEnded = new( + Values.SchedulingOutOfOfficeEnded + ); + + public SchedulingOutOfOfficeWebhookEventType(string value) + { + Value = value; + } + + /// + /// The string value of the enum. + /// + public string Value { get; } + + /// + /// Create a string enum with the given value. + /// + public static SchedulingOutOfOfficeWebhookEventType FromCustom(string value) + { + return new SchedulingOutOfOfficeWebhookEventType(value); + } + + public bool Equals(string? other) + { + return Value.Equals(other); + } + + /// + /// Returns the string value of the enum. + /// + public override string ToString() + { + return Value; + } + + public static bool operator ==(SchedulingOutOfOfficeWebhookEventType value1, string value2) => + value1.Value.Equals(value2); + + public static bool operator !=(SchedulingOutOfOfficeWebhookEventType value1, string value2) => + !value1.Value.Equals(value2); + + public static explicit operator string(SchedulingOutOfOfficeWebhookEventType value) => + value.Value; + + public static explicit operator SchedulingOutOfOfficeWebhookEventType(string value) => + new(value); + + internal class SchedulingOutOfOfficeWebhookEventTypeSerializer + : JsonConverter + { + public override SchedulingOutOfOfficeWebhookEventType Read( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON value could not be read as a string." + ); + return new SchedulingOutOfOfficeWebhookEventType(stringValue); + } + + public override void Write( + Utf8JsonWriter writer, + SchedulingOutOfOfficeWebhookEventType value, + JsonSerializerOptions options + ) + { + writer.WriteStringValue(value.Value); + } + + public override SchedulingOutOfOfficeWebhookEventType ReadAsPropertyName( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return new SchedulingOutOfOfficeWebhookEventType(stringValue); + } + + public override void WriteAsPropertyName( + Utf8JsonWriter writer, + SchedulingOutOfOfficeWebhookEventType value, + JsonSerializerOptions options + ) + { + writer.WritePropertyName(value.Value); + } + } + + /// + /// Constant strings for enum values + /// + [Serializable] + public static class Values + { + public const string SchedulingOutOfOfficeCreated = "scheduling.out_of_office.created"; + + public const string SchedulingOutOfOfficeUpdated = "scheduling.out_of_office.updated"; + + public const string SchedulingOutOfOfficeDeleted = "scheduling.out_of_office.deleted"; + + public const string SchedulingOutOfOfficeStarted = "scheduling.out_of_office.started"; + + public const string SchedulingOutOfOfficeEnded = "scheduling.out_of_office.ended"; + } +} diff --git a/sdks/dotnet/src/Coss/Types/SchedulingReassignCandidate.cs b/sdks/dotnet/src/Coss/Types/SchedulingReassignCandidate.cs new file mode 100644 index 000000000..fcbe61605 --- /dev/null +++ b/sdks/dotnet/src/Coss/Types/SchedulingReassignCandidate.cs @@ -0,0 +1,79 @@ +using Coss.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace Coss; + +[Serializable] +public record SchedulingReassignCandidate : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + [JsonPropertyName("object")] + public required SchedulingReassignCandidateObject Object { get; set; } + + [JsonPropertyName("host")] + public required string Host { get; set; } + + [Nullable] + [JsonPropertyName("uid")] + public string? Uid { get; set; } + + [JsonPropertyName("name")] + public required string Name { get; set; } + + /// + /// Takes this event type, and fits what the booking was routed with. Otherwise it needs `any_host`. + /// + [JsonPropertyName("member")] + public required bool Member { get; set; } + + [JsonPropertyName("available")] + public required bool Available { get; set; } + + /// + /// Why they aren't available, the first of `reasons`. + /// + [Nullable] + [JsonPropertyName("reason")] + public string? Reason { get; set; } + + /// + /// Everything in the way, each needing its override. `already_claimed` can't be overridden. + /// + [JsonPropertyName("reasons")] + public IEnumerable Reasons { get; set; } = new List(); + + /// + /// Their live bookings in the week from this one. + /// + [JsonPropertyName("load")] + public required double Load { get; set; } + + /// + /// Their place in who a pool would pick next, from 1. Null for a non-member. + /// + [Nullable] + [JsonPropertyName("rank")] + public double? Rank { get; set; } + + /// + /// They haven't connected what this booking's meeting needs, so it'd have none. + /// + [JsonPropertyName("meeting_provider_missing")] + public required bool MeetingProviderMissing { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/sdks/dotnet/src/Coss/Types/SchedulingReassignCandidateList.cs b/sdks/dotnet/src/Coss/Types/SchedulingReassignCandidateList.cs new file mode 100644 index 000000000..3bd29f80f --- /dev/null +++ b/sdks/dotnet/src/Coss/Types/SchedulingReassignCandidateList.cs @@ -0,0 +1,35 @@ +using Coss.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace Coss; + +[Serializable] +public record SchedulingReassignCandidateList : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + [JsonPropertyName("object")] + public required SchedulingReassignCandidateListObject Object { get; set; } + + [JsonPropertyName("data")] + public IEnumerable Data { get; set; } = + new List(); + + [JsonPropertyName("has_more")] + public required bool HasMore { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/sdks/dotnet/src/Coss/Types/SchedulingReassignCandidateListObject.cs b/sdks/dotnet/src/Coss/Types/SchedulingReassignCandidateListObject.cs new file mode 100644 index 000000000..5596c45cc --- /dev/null +++ b/sdks/dotnet/src/Coss/Types/SchedulingReassignCandidateListObject.cs @@ -0,0 +1,116 @@ +using Coss.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace Coss; + +[JsonConverter( + typeof(SchedulingReassignCandidateListObject.SchedulingReassignCandidateListObjectSerializer) +)] +[Serializable] +public readonly record struct SchedulingReassignCandidateListObject : IStringEnum +{ + public static readonly SchedulingReassignCandidateListObject List = new(Values.List); + + public SchedulingReassignCandidateListObject(string value) + { + Value = value; + } + + /// + /// The string value of the enum. + /// + public string Value { get; } + + /// + /// Create a string enum with the given value. + /// + public static SchedulingReassignCandidateListObject FromCustom(string value) + { + return new SchedulingReassignCandidateListObject(value); + } + + public bool Equals(string? other) + { + return Value.Equals(other); + } + + /// + /// Returns the string value of the enum. + /// + public override string ToString() + { + return Value; + } + + public static bool operator ==(SchedulingReassignCandidateListObject value1, string value2) => + value1.Value.Equals(value2); + + public static bool operator !=(SchedulingReassignCandidateListObject value1, string value2) => + !value1.Value.Equals(value2); + + public static explicit operator string(SchedulingReassignCandidateListObject value) => + value.Value; + + public static explicit operator SchedulingReassignCandidateListObject(string value) => + new(value); + + internal class SchedulingReassignCandidateListObjectSerializer + : JsonConverter + { + public override SchedulingReassignCandidateListObject Read( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON value could not be read as a string." + ); + return new SchedulingReassignCandidateListObject(stringValue); + } + + public override void Write( + Utf8JsonWriter writer, + SchedulingReassignCandidateListObject value, + JsonSerializerOptions options + ) + { + writer.WriteStringValue(value.Value); + } + + public override SchedulingReassignCandidateListObject ReadAsPropertyName( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return new SchedulingReassignCandidateListObject(stringValue); + } + + public override void WriteAsPropertyName( + Utf8JsonWriter writer, + SchedulingReassignCandidateListObject value, + JsonSerializerOptions options + ) + { + writer.WritePropertyName(value.Value); + } + } + + /// + /// Constant strings for enum values + /// + [Serializable] + public static class Values + { + public const string List = "list"; + } +} diff --git a/sdks/dotnet/src/Coss/Types/SchedulingReassignCandidateObject.cs b/sdks/dotnet/src/Coss/Types/SchedulingReassignCandidateObject.cs new file mode 100644 index 000000000..f2e2f5c72 --- /dev/null +++ b/sdks/dotnet/src/Coss/Types/SchedulingReassignCandidateObject.cs @@ -0,0 +1,116 @@ +using Coss.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace Coss; + +[JsonConverter( + typeof(SchedulingReassignCandidateObject.SchedulingReassignCandidateObjectSerializer) +)] +[Serializable] +public readonly record struct SchedulingReassignCandidateObject : IStringEnum +{ + public static readonly SchedulingReassignCandidateObject SchedulingReassignCandidate = new( + Values.SchedulingReassignCandidate + ); + + public SchedulingReassignCandidateObject(string value) + { + Value = value; + } + + /// + /// The string value of the enum. + /// + public string Value { get; } + + /// + /// Create a string enum with the given value. + /// + public static SchedulingReassignCandidateObject FromCustom(string value) + { + return new SchedulingReassignCandidateObject(value); + } + + public bool Equals(string? other) + { + return Value.Equals(other); + } + + /// + /// Returns the string value of the enum. + /// + public override string ToString() + { + return Value; + } + + public static bool operator ==(SchedulingReassignCandidateObject value1, string value2) => + value1.Value.Equals(value2); + + public static bool operator !=(SchedulingReassignCandidateObject value1, string value2) => + !value1.Value.Equals(value2); + + public static explicit operator string(SchedulingReassignCandidateObject value) => value.Value; + + public static explicit operator SchedulingReassignCandidateObject(string value) => new(value); + + internal class SchedulingReassignCandidateObjectSerializer + : JsonConverter + { + public override SchedulingReassignCandidateObject Read( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON value could not be read as a string." + ); + return new SchedulingReassignCandidateObject(stringValue); + } + + public override void Write( + Utf8JsonWriter writer, + SchedulingReassignCandidateObject value, + JsonSerializerOptions options + ) + { + writer.WriteStringValue(value.Value); + } + + public override SchedulingReassignCandidateObject ReadAsPropertyName( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return new SchedulingReassignCandidateObject(stringValue); + } + + public override void WriteAsPropertyName( + Utf8JsonWriter writer, + SchedulingReassignCandidateObject value, + JsonSerializerOptions options + ) + { + writer.WritePropertyName(value.Value); + } + } + + /// + /// Constant strings for enum values + /// + [Serializable] + public static class Values + { + public const string SchedulingReassignCandidate = "scheduling.reassign_candidate"; + } +} diff --git a/sdks/dotnet/src/Coss/Types/SchedulingReassignment.cs b/sdks/dotnet/src/Coss/Types/SchedulingReassignment.cs new file mode 100644 index 000000000..02fb03c74 --- /dev/null +++ b/sdks/dotnet/src/Coss/Types/SchedulingReassignment.cs @@ -0,0 +1,59 @@ +using Coss.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace Coss; + +[Serializable] +public record SchedulingReassignment : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + [JsonPropertyName("object")] + public required SchedulingReassignmentObject Object { get; set; } + + [JsonPropertyName("id")] + public required string Id { get; set; } + + [JsonPropertyName("status")] + public required SchedulingReassignmentStatus Status { get; set; } + + [JsonPropertyName("reason_code")] + public required SchedulingReassignmentReasonCode ReasonCode { get; set; } + + [Nullable] + [JsonPropertyName("out_of_office")] + public string? OutOfOffice { get; set; } + + [Nullable] + [JsonPropertyName("undo_of")] + public string? UndoOf { get; set; } + + [JsonPropertyName("counts")] + public required SchedulingReassignmentCounts Counts { get; set; } + + [JsonPropertyName("created_at")] + public required string CreatedAt { get; set; } + + [Nullable] + [JsonPropertyName("started_at")] + public string? StartedAt { get; set; } + + [Nullable] + [JsonPropertyName("finished_at")] + public string? FinishedAt { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/sdks/dotnet/src/Coss/Types/SchedulingReassignmentCounts.cs b/sdks/dotnet/src/Coss/Types/SchedulingReassignmentCounts.cs new file mode 100644 index 000000000..043e894f4 --- /dev/null +++ b/sdks/dotnet/src/Coss/Types/SchedulingReassignmentCounts.cs @@ -0,0 +1,52 @@ +using Coss.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace Coss; + +[Serializable] +public record SchedulingReassignmentCounts : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + [JsonPropertyName("total")] + public required double Total { get; set; } + + [JsonPropertyName("pending")] + public required double Pending { get; set; } + + [JsonPropertyName("reassigned")] + public required double Reassigned { get; set; } + + /// + /// They'd moved on since it was selected. + /// + [JsonPropertyName("skipped")] + public required double Skipped { get; set; } + + /// + /// Nobody could take them: they stayed. + /// + [JsonPropertyName("no_candidate")] + public required double NoCandidate { get; set; } + + [JsonPropertyName("failed")] + public required double Failed { get; set; } + + [JsonPropertyName("cancelled")] + public required double Cancelled { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/sdks/dotnet/src/Coss/Types/SchedulingReassignmentItem.cs b/sdks/dotnet/src/Coss/Types/SchedulingReassignmentItem.cs new file mode 100644 index 000000000..3c7a5e469 --- /dev/null +++ b/sdks/dotnet/src/Coss/Types/SchedulingReassignmentItem.cs @@ -0,0 +1,49 @@ +using Coss.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace Coss; + +[Serializable] +public record SchedulingReassignmentItem : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + [JsonPropertyName("object")] + public required SchedulingReassignmentItemObject Object { get; set; } + + [JsonPropertyName("id")] + public required string Id { get; set; } + + [JsonPropertyName("booking")] + public required string Booking { get; set; } + + [Nullable] + [JsonPropertyName("from_host")] + public string? FromHost { get; set; } + + [Nullable] + [JsonPropertyName("to_host")] + public string? ToHost { get; set; } + + [JsonPropertyName("outcome")] + public required SchedulingReassignmentItemOutcome Outcome { get; set; } + + [Nullable] + [JsonPropertyName("error_code")] + public string? ErrorCode { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/sdks/dotnet/src/Coss/Types/SchedulingReassignmentItemList.cs b/sdks/dotnet/src/Coss/Types/SchedulingReassignmentItemList.cs new file mode 100644 index 000000000..bbb2d4220 --- /dev/null +++ b/sdks/dotnet/src/Coss/Types/SchedulingReassignmentItemList.cs @@ -0,0 +1,35 @@ +using Coss.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace Coss; + +[Serializable] +public record SchedulingReassignmentItemList : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + [JsonPropertyName("object")] + public required SchedulingReassignmentItemListObject Object { get; set; } + + [JsonPropertyName("data")] + public IEnumerable Data { get; set; } = + new List(); + + [JsonPropertyName("has_more")] + public required bool HasMore { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/sdks/dotnet/src/Coss/Types/SchedulingReassignmentItemListObject.cs b/sdks/dotnet/src/Coss/Types/SchedulingReassignmentItemListObject.cs new file mode 100644 index 000000000..b61698339 --- /dev/null +++ b/sdks/dotnet/src/Coss/Types/SchedulingReassignmentItemListObject.cs @@ -0,0 +1,116 @@ +using Coss.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace Coss; + +[JsonConverter( + typeof(SchedulingReassignmentItemListObject.SchedulingReassignmentItemListObjectSerializer) +)] +[Serializable] +public readonly record struct SchedulingReassignmentItemListObject : IStringEnum +{ + public static readonly SchedulingReassignmentItemListObject List = new(Values.List); + + public SchedulingReassignmentItemListObject(string value) + { + Value = value; + } + + /// + /// The string value of the enum. + /// + public string Value { get; } + + /// + /// Create a string enum with the given value. + /// + public static SchedulingReassignmentItemListObject FromCustom(string value) + { + return new SchedulingReassignmentItemListObject(value); + } + + public bool Equals(string? other) + { + return Value.Equals(other); + } + + /// + /// Returns the string value of the enum. + /// + public override string ToString() + { + return Value; + } + + public static bool operator ==(SchedulingReassignmentItemListObject value1, string value2) => + value1.Value.Equals(value2); + + public static bool operator !=(SchedulingReassignmentItemListObject value1, string value2) => + !value1.Value.Equals(value2); + + public static explicit operator string(SchedulingReassignmentItemListObject value) => + value.Value; + + public static explicit operator SchedulingReassignmentItemListObject(string value) => + new(value); + + internal class SchedulingReassignmentItemListObjectSerializer + : JsonConverter + { + public override SchedulingReassignmentItemListObject Read( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON value could not be read as a string." + ); + return new SchedulingReassignmentItemListObject(stringValue); + } + + public override void Write( + Utf8JsonWriter writer, + SchedulingReassignmentItemListObject value, + JsonSerializerOptions options + ) + { + writer.WriteStringValue(value.Value); + } + + public override SchedulingReassignmentItemListObject ReadAsPropertyName( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return new SchedulingReassignmentItemListObject(stringValue); + } + + public override void WriteAsPropertyName( + Utf8JsonWriter writer, + SchedulingReassignmentItemListObject value, + JsonSerializerOptions options + ) + { + writer.WritePropertyName(value.Value); + } + } + + /// + /// Constant strings for enum values + /// + [Serializable] + public static class Values + { + public const string List = "list"; + } +} diff --git a/sdks/dotnet/src/Coss/Types/SchedulingReassignmentItemObject.cs b/sdks/dotnet/src/Coss/Types/SchedulingReassignmentItemObject.cs new file mode 100644 index 000000000..d74a73c6f --- /dev/null +++ b/sdks/dotnet/src/Coss/Types/SchedulingReassignmentItemObject.cs @@ -0,0 +1,114 @@ +using Coss.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace Coss; + +[JsonConverter(typeof(SchedulingReassignmentItemObject.SchedulingReassignmentItemObjectSerializer))] +[Serializable] +public readonly record struct SchedulingReassignmentItemObject : IStringEnum +{ + public static readonly SchedulingReassignmentItemObject SchedulingReassignmentItem = new( + Values.SchedulingReassignmentItem + ); + + public SchedulingReassignmentItemObject(string value) + { + Value = value; + } + + /// + /// The string value of the enum. + /// + public string Value { get; } + + /// + /// Create a string enum with the given value. + /// + public static SchedulingReassignmentItemObject FromCustom(string value) + { + return new SchedulingReassignmentItemObject(value); + } + + public bool Equals(string? other) + { + return Value.Equals(other); + } + + /// + /// Returns the string value of the enum. + /// + public override string ToString() + { + return Value; + } + + public static bool operator ==(SchedulingReassignmentItemObject value1, string value2) => + value1.Value.Equals(value2); + + public static bool operator !=(SchedulingReassignmentItemObject value1, string value2) => + !value1.Value.Equals(value2); + + public static explicit operator string(SchedulingReassignmentItemObject value) => value.Value; + + public static explicit operator SchedulingReassignmentItemObject(string value) => new(value); + + internal class SchedulingReassignmentItemObjectSerializer + : JsonConverter + { + public override SchedulingReassignmentItemObject Read( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON value could not be read as a string." + ); + return new SchedulingReassignmentItemObject(stringValue); + } + + public override void Write( + Utf8JsonWriter writer, + SchedulingReassignmentItemObject value, + JsonSerializerOptions options + ) + { + writer.WriteStringValue(value.Value); + } + + public override SchedulingReassignmentItemObject ReadAsPropertyName( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return new SchedulingReassignmentItemObject(stringValue); + } + + public override void WriteAsPropertyName( + Utf8JsonWriter writer, + SchedulingReassignmentItemObject value, + JsonSerializerOptions options + ) + { + writer.WritePropertyName(value.Value); + } + } + + /// + /// Constant strings for enum values + /// + [Serializable] + public static class Values + { + public const string SchedulingReassignmentItem = "scheduling.reassignment_item"; + } +} diff --git a/sdks/dotnet/src/Coss/Types/SchedulingReassignmentItemOutcome.cs b/sdks/dotnet/src/Coss/Types/SchedulingReassignmentItemOutcome.cs new file mode 100644 index 000000000..ba89f84cd --- /dev/null +++ b/sdks/dotnet/src/Coss/Types/SchedulingReassignmentItemOutcome.cs @@ -0,0 +1,136 @@ +using Coss.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace Coss; + +[JsonConverter( + typeof(SchedulingReassignmentItemOutcome.SchedulingReassignmentItemOutcomeSerializer) +)] +[Serializable] +public readonly record struct SchedulingReassignmentItemOutcome : IStringEnum +{ + public static readonly SchedulingReassignmentItemOutcome Pending = new(Values.Pending); + + public static readonly SchedulingReassignmentItemOutcome Reassigned = new(Values.Reassigned); + + public static readonly SchedulingReassignmentItemOutcome SkippedChanged = new( + Values.SkippedChanged + ); + + public static readonly SchedulingReassignmentItemOutcome NoCandidate = new(Values.NoCandidate); + + public static readonly SchedulingReassignmentItemOutcome Failed = new(Values.Failed); + + public static readonly SchedulingReassignmentItemOutcome Cancelled = new(Values.Cancelled); + + public SchedulingReassignmentItemOutcome(string value) + { + Value = value; + } + + /// + /// The string value of the enum. + /// + public string Value { get; } + + /// + /// Create a string enum with the given value. + /// + public static SchedulingReassignmentItemOutcome FromCustom(string value) + { + return new SchedulingReassignmentItemOutcome(value); + } + + public bool Equals(string? other) + { + return Value.Equals(other); + } + + /// + /// Returns the string value of the enum. + /// + public override string ToString() + { + return Value; + } + + public static bool operator ==(SchedulingReassignmentItemOutcome value1, string value2) => + value1.Value.Equals(value2); + + public static bool operator !=(SchedulingReassignmentItemOutcome value1, string value2) => + !value1.Value.Equals(value2); + + public static explicit operator string(SchedulingReassignmentItemOutcome value) => value.Value; + + public static explicit operator SchedulingReassignmentItemOutcome(string value) => new(value); + + internal class SchedulingReassignmentItemOutcomeSerializer + : JsonConverter + { + public override SchedulingReassignmentItemOutcome Read( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON value could not be read as a string." + ); + return new SchedulingReassignmentItemOutcome(stringValue); + } + + public override void Write( + Utf8JsonWriter writer, + SchedulingReassignmentItemOutcome value, + JsonSerializerOptions options + ) + { + writer.WriteStringValue(value.Value); + } + + public override SchedulingReassignmentItemOutcome ReadAsPropertyName( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return new SchedulingReassignmentItemOutcome(stringValue); + } + + public override void WriteAsPropertyName( + Utf8JsonWriter writer, + SchedulingReassignmentItemOutcome value, + JsonSerializerOptions options + ) + { + writer.WritePropertyName(value.Value); + } + } + + /// + /// Constant strings for enum values + /// + [Serializable] + public static class Values + { + public const string Pending = "pending"; + + public const string Reassigned = "reassigned"; + + public const string SkippedChanged = "skipped_changed"; + + public const string NoCandidate = "no_candidate"; + + public const string Failed = "failed"; + + public const string Cancelled = "cancelled"; + } +} diff --git a/sdks/dotnet/src/Coss/Types/SchedulingReassignmentList.cs b/sdks/dotnet/src/Coss/Types/SchedulingReassignmentList.cs new file mode 100644 index 000000000..104ee3757 --- /dev/null +++ b/sdks/dotnet/src/Coss/Types/SchedulingReassignmentList.cs @@ -0,0 +1,35 @@ +using Coss.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace Coss; + +[Serializable] +public record SchedulingReassignmentList : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + [JsonPropertyName("object")] + public required SchedulingReassignmentListObject Object { get; set; } + + [JsonPropertyName("data")] + public IEnumerable Data { get; set; } = + new List(); + + [JsonPropertyName("has_more")] + public required bool HasMore { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/sdks/dotnet/src/Coss/Types/SchedulingReassignmentListObject.cs b/sdks/dotnet/src/Coss/Types/SchedulingReassignmentListObject.cs new file mode 100644 index 000000000..0180dd5e5 --- /dev/null +++ b/sdks/dotnet/src/Coss/Types/SchedulingReassignmentListObject.cs @@ -0,0 +1,112 @@ +using Coss.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace Coss; + +[JsonConverter(typeof(SchedulingReassignmentListObject.SchedulingReassignmentListObjectSerializer))] +[Serializable] +public readonly record struct SchedulingReassignmentListObject : IStringEnum +{ + public static readonly SchedulingReassignmentListObject List = new(Values.List); + + public SchedulingReassignmentListObject(string value) + { + Value = value; + } + + /// + /// The string value of the enum. + /// + public string Value { get; } + + /// + /// Create a string enum with the given value. + /// + public static SchedulingReassignmentListObject FromCustom(string value) + { + return new SchedulingReassignmentListObject(value); + } + + public bool Equals(string? other) + { + return Value.Equals(other); + } + + /// + /// Returns the string value of the enum. + /// + public override string ToString() + { + return Value; + } + + public static bool operator ==(SchedulingReassignmentListObject value1, string value2) => + value1.Value.Equals(value2); + + public static bool operator !=(SchedulingReassignmentListObject value1, string value2) => + !value1.Value.Equals(value2); + + public static explicit operator string(SchedulingReassignmentListObject value) => value.Value; + + public static explicit operator SchedulingReassignmentListObject(string value) => new(value); + + internal class SchedulingReassignmentListObjectSerializer + : JsonConverter + { + public override SchedulingReassignmentListObject Read( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON value could not be read as a string." + ); + return new SchedulingReassignmentListObject(stringValue); + } + + public override void Write( + Utf8JsonWriter writer, + SchedulingReassignmentListObject value, + JsonSerializerOptions options + ) + { + writer.WriteStringValue(value.Value); + } + + public override SchedulingReassignmentListObject ReadAsPropertyName( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return new SchedulingReassignmentListObject(stringValue); + } + + public override void WriteAsPropertyName( + Utf8JsonWriter writer, + SchedulingReassignmentListObject value, + JsonSerializerOptions options + ) + { + writer.WritePropertyName(value.Value); + } + } + + /// + /// Constant strings for enum values + /// + [Serializable] + public static class Values + { + public const string List = "list"; + } +} diff --git a/sdks/dotnet/src/Coss/Types/SchedulingReassignmentObject.cs b/sdks/dotnet/src/Coss/Types/SchedulingReassignmentObject.cs new file mode 100644 index 000000000..10359e7eb --- /dev/null +++ b/sdks/dotnet/src/Coss/Types/SchedulingReassignmentObject.cs @@ -0,0 +1,114 @@ +using Coss.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace Coss; + +[JsonConverter(typeof(SchedulingReassignmentObject.SchedulingReassignmentObjectSerializer))] +[Serializable] +public readonly record struct SchedulingReassignmentObject : IStringEnum +{ + public static readonly SchedulingReassignmentObject SchedulingReassignment = new( + Values.SchedulingReassignment + ); + + public SchedulingReassignmentObject(string value) + { + Value = value; + } + + /// + /// The string value of the enum. + /// + public string Value { get; } + + /// + /// Create a string enum with the given value. + /// + public static SchedulingReassignmentObject FromCustom(string value) + { + return new SchedulingReassignmentObject(value); + } + + public bool Equals(string? other) + { + return Value.Equals(other); + } + + /// + /// Returns the string value of the enum. + /// + public override string ToString() + { + return Value; + } + + public static bool operator ==(SchedulingReassignmentObject value1, string value2) => + value1.Value.Equals(value2); + + public static bool operator !=(SchedulingReassignmentObject value1, string value2) => + !value1.Value.Equals(value2); + + public static explicit operator string(SchedulingReassignmentObject value) => value.Value; + + public static explicit operator SchedulingReassignmentObject(string value) => new(value); + + internal class SchedulingReassignmentObjectSerializer + : JsonConverter + { + public override SchedulingReassignmentObject Read( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON value could not be read as a string." + ); + return new SchedulingReassignmentObject(stringValue); + } + + public override void Write( + Utf8JsonWriter writer, + SchedulingReassignmentObject value, + JsonSerializerOptions options + ) + { + writer.WriteStringValue(value.Value); + } + + public override SchedulingReassignmentObject ReadAsPropertyName( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return new SchedulingReassignmentObject(stringValue); + } + + public override void WriteAsPropertyName( + Utf8JsonWriter writer, + SchedulingReassignmentObject value, + JsonSerializerOptions options + ) + { + writer.WritePropertyName(value.Value); + } + } + + /// + /// Constant strings for enum values + /// + [Serializable] + public static class Values + { + public const string SchedulingReassignment = "scheduling.reassignment"; + } +} diff --git a/sdks/dotnet/src/Coss/Types/SchedulingReassignmentPreview.cs b/sdks/dotnet/src/Coss/Types/SchedulingReassignmentPreview.cs new file mode 100644 index 000000000..bc812a969 --- /dev/null +++ b/sdks/dotnet/src/Coss/Types/SchedulingReassignmentPreview.cs @@ -0,0 +1,38 @@ +using Coss.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace Coss; + +[Serializable] +public record SchedulingReassignmentPreview : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + [JsonPropertyName("object")] + public required SchedulingReassignmentPreviewObject Object { get; set; } + + [JsonPropertyName("items")] + public IEnumerable Items { get; set; } = + new List(); + + /// + /// There are more than a preview covers. + /// + [JsonPropertyName("truncated")] + public required bool Truncated { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/sdks/dotnet/src/Coss/Types/SchedulingReassignmentPreviewItemsItem.cs b/sdks/dotnet/src/Coss/Types/SchedulingReassignmentPreviewItemsItem.cs new file mode 100644 index 000000000..7a59cbe16 --- /dev/null +++ b/sdks/dotnet/src/Coss/Types/SchedulingReassignmentPreviewItemsItem.cs @@ -0,0 +1,69 @@ +using Coss.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace Coss; + +[Serializable] +public record SchedulingReassignmentPreviewItemsItem : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + [JsonPropertyName("booking")] + public required string Booking { get; set; } + + [JsonPropertyName("event_type")] + public required string EventType { get; set; } + + [JsonPropertyName("title")] + public required string Title { get; set; } + + [JsonPropertyName("status")] + public required SchedulingReassignmentPreviewItemsItemStatus Status { get; set; } + + [JsonPropertyName("start")] + public required string Start { get; set; } + + [JsonPropertyName("end")] + public required string End { get; set; } + + [Nullable] + [JsonPropertyName("series")] + public string? Series { get; set; } + + [Nullable] + [JsonPropertyName("group_session")] + public string? GroupSession { get; set; } + + [Nullable] + [JsonPropertyName("from_host")] + public string? FromHost { get; set; } + + /// + /// Null when nobody could take it. + /// + [Nullable] + [JsonPropertyName("to_host")] + public string? ToHost { get; set; } + + /// + /// Why it would stay where it is. + /// + [Nullable] + [JsonPropertyName("reason")] + public string? Reason { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/sdks/dotnet/src/Coss/Types/SchedulingReassignmentPreviewItemsItemStatus.cs b/sdks/dotnet/src/Coss/Types/SchedulingReassignmentPreviewItemsItemStatus.cs new file mode 100644 index 000000000..da4f3d66a --- /dev/null +++ b/sdks/dotnet/src/Coss/Types/SchedulingReassignmentPreviewItemsItemStatus.cs @@ -0,0 +1,144 @@ +using Coss.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace Coss; + +[JsonConverter( + typeof(SchedulingReassignmentPreviewItemsItemStatus.SchedulingReassignmentPreviewItemsItemStatusSerializer) +)] +[Serializable] +public readonly record struct SchedulingReassignmentPreviewItemsItemStatus : IStringEnum +{ + public static readonly SchedulingReassignmentPreviewItemsItemStatus Held = new(Values.Held); + + public static readonly SchedulingReassignmentPreviewItemsItemStatus PendingApproval = new( + Values.PendingApproval + ); + + public static readonly SchedulingReassignmentPreviewItemsItemStatus Confirmed = new( + Values.Confirmed + ); + + public static readonly SchedulingReassignmentPreviewItemsItemStatus Cancelled = new( + Values.Cancelled + ); + + public static readonly SchedulingReassignmentPreviewItemsItemStatus Declined = new( + Values.Declined + ); + + public SchedulingReassignmentPreviewItemsItemStatus(string value) + { + Value = value; + } + + /// + /// The string value of the enum. + /// + public string Value { get; } + + /// + /// Create a string enum with the given value. + /// + public static SchedulingReassignmentPreviewItemsItemStatus FromCustom(string value) + { + return new SchedulingReassignmentPreviewItemsItemStatus(value); + } + + public bool Equals(string? other) + { + return Value.Equals(other); + } + + /// + /// Returns the string value of the enum. + /// + public override string ToString() + { + return Value; + } + + public static bool operator ==( + SchedulingReassignmentPreviewItemsItemStatus value1, + string value2 + ) => value1.Value.Equals(value2); + + public static bool operator !=( + SchedulingReassignmentPreviewItemsItemStatus value1, + string value2 + ) => !value1.Value.Equals(value2); + + public static explicit operator string(SchedulingReassignmentPreviewItemsItemStatus value) => + value.Value; + + public static explicit operator SchedulingReassignmentPreviewItemsItemStatus(string value) => + new(value); + + internal class SchedulingReassignmentPreviewItemsItemStatusSerializer + : JsonConverter + { + public override SchedulingReassignmentPreviewItemsItemStatus Read( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON value could not be read as a string." + ); + return new SchedulingReassignmentPreviewItemsItemStatus(stringValue); + } + + public override void Write( + Utf8JsonWriter writer, + SchedulingReassignmentPreviewItemsItemStatus value, + JsonSerializerOptions options + ) + { + writer.WriteStringValue(value.Value); + } + + public override SchedulingReassignmentPreviewItemsItemStatus ReadAsPropertyName( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return new SchedulingReassignmentPreviewItemsItemStatus(stringValue); + } + + public override void WriteAsPropertyName( + Utf8JsonWriter writer, + SchedulingReassignmentPreviewItemsItemStatus value, + JsonSerializerOptions options + ) + { + writer.WritePropertyName(value.Value); + } + } + + /// + /// Constant strings for enum values + /// + [Serializable] + public static class Values + { + public const string Held = "held"; + + public const string PendingApproval = "pending_approval"; + + public const string Confirmed = "confirmed"; + + public const string Cancelled = "cancelled"; + + public const string Declined = "declined"; + } +} diff --git a/sdks/dotnet/src/Coss/Types/SchedulingReassignmentPreviewObject.cs b/sdks/dotnet/src/Coss/Types/SchedulingReassignmentPreviewObject.cs new file mode 100644 index 000000000..b8b466268 --- /dev/null +++ b/sdks/dotnet/src/Coss/Types/SchedulingReassignmentPreviewObject.cs @@ -0,0 +1,117 @@ +using Coss.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace Coss; + +[JsonConverter( + typeof(SchedulingReassignmentPreviewObject.SchedulingReassignmentPreviewObjectSerializer) +)] +[Serializable] +public readonly record struct SchedulingReassignmentPreviewObject : IStringEnum +{ + public static readonly SchedulingReassignmentPreviewObject SchedulingReassignmentPreview = new( + Values.SchedulingReassignmentPreview + ); + + public SchedulingReassignmentPreviewObject(string value) + { + Value = value; + } + + /// + /// The string value of the enum. + /// + public string Value { get; } + + /// + /// Create a string enum with the given value. + /// + public static SchedulingReassignmentPreviewObject FromCustom(string value) + { + return new SchedulingReassignmentPreviewObject(value); + } + + public bool Equals(string? other) + { + return Value.Equals(other); + } + + /// + /// Returns the string value of the enum. + /// + public override string ToString() + { + return Value; + } + + public static bool operator ==(SchedulingReassignmentPreviewObject value1, string value2) => + value1.Value.Equals(value2); + + public static bool operator !=(SchedulingReassignmentPreviewObject value1, string value2) => + !value1.Value.Equals(value2); + + public static explicit operator string(SchedulingReassignmentPreviewObject value) => + value.Value; + + public static explicit operator SchedulingReassignmentPreviewObject(string value) => new(value); + + internal class SchedulingReassignmentPreviewObjectSerializer + : JsonConverter + { + public override SchedulingReassignmentPreviewObject Read( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON value could not be read as a string." + ); + return new SchedulingReassignmentPreviewObject(stringValue); + } + + public override void Write( + Utf8JsonWriter writer, + SchedulingReassignmentPreviewObject value, + JsonSerializerOptions options + ) + { + writer.WriteStringValue(value.Value); + } + + public override SchedulingReassignmentPreviewObject ReadAsPropertyName( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return new SchedulingReassignmentPreviewObject(stringValue); + } + + public override void WriteAsPropertyName( + Utf8JsonWriter writer, + SchedulingReassignmentPreviewObject value, + JsonSerializerOptions options + ) + { + writer.WritePropertyName(value.Value); + } + } + + /// + /// Constant strings for enum values + /// + [Serializable] + public static class Values + { + public const string SchedulingReassignmentPreview = "scheduling.reassignment_preview"; + } +} diff --git a/sdks/dotnet/src/Coss/Types/SchedulingReassignmentReasonCode.cs b/sdks/dotnet/src/Coss/Types/SchedulingReassignmentReasonCode.cs new file mode 100644 index 000000000..46fb5543c --- /dev/null +++ b/sdks/dotnet/src/Coss/Types/SchedulingReassignmentReasonCode.cs @@ -0,0 +1,136 @@ +using Coss.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace Coss; + +[JsonConverter(typeof(SchedulingReassignmentReasonCode.SchedulingReassignmentReasonCodeSerializer))] +[Serializable] +public readonly record struct SchedulingReassignmentReasonCode : IStringEnum +{ + public static readonly SchedulingReassignmentReasonCode HostUnavailable = new( + Values.HostUnavailable + ); + + public static readonly SchedulingReassignmentReasonCode OutOfOffice = new(Values.OutOfOffice); + + public static readonly SchedulingReassignmentReasonCode Workload = new(Values.Workload); + + public static readonly SchedulingReassignmentReasonCode CustomerRequest = new( + Values.CustomerRequest + ); + + public static readonly SchedulingReassignmentReasonCode Offboarding = new(Values.Offboarding); + + public static readonly SchedulingReassignmentReasonCode Other = new(Values.Other); + + public SchedulingReassignmentReasonCode(string value) + { + Value = value; + } + + /// + /// The string value of the enum. + /// + public string Value { get; } + + /// + /// Create a string enum with the given value. + /// + public static SchedulingReassignmentReasonCode FromCustom(string value) + { + return new SchedulingReassignmentReasonCode(value); + } + + public bool Equals(string? other) + { + return Value.Equals(other); + } + + /// + /// Returns the string value of the enum. + /// + public override string ToString() + { + return Value; + } + + public static bool operator ==(SchedulingReassignmentReasonCode value1, string value2) => + value1.Value.Equals(value2); + + public static bool operator !=(SchedulingReassignmentReasonCode value1, string value2) => + !value1.Value.Equals(value2); + + public static explicit operator string(SchedulingReassignmentReasonCode value) => value.Value; + + public static explicit operator SchedulingReassignmentReasonCode(string value) => new(value); + + internal class SchedulingReassignmentReasonCodeSerializer + : JsonConverter + { + public override SchedulingReassignmentReasonCode Read( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON value could not be read as a string." + ); + return new SchedulingReassignmentReasonCode(stringValue); + } + + public override void Write( + Utf8JsonWriter writer, + SchedulingReassignmentReasonCode value, + JsonSerializerOptions options + ) + { + writer.WriteStringValue(value.Value); + } + + public override SchedulingReassignmentReasonCode ReadAsPropertyName( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return new SchedulingReassignmentReasonCode(stringValue); + } + + public override void WriteAsPropertyName( + Utf8JsonWriter writer, + SchedulingReassignmentReasonCode value, + JsonSerializerOptions options + ) + { + writer.WritePropertyName(value.Value); + } + } + + /// + /// Constant strings for enum values + /// + [Serializable] + public static class Values + { + public const string HostUnavailable = "host_unavailable"; + + public const string OutOfOffice = "out_of_office"; + + public const string Workload = "workload"; + + public const string CustomerRequest = "customer_request"; + + public const string Offboarding = "offboarding"; + + public const string Other = "other"; + } +} diff --git a/sdks/dotnet/src/Coss/Types/SchedulingReassignmentSelection.cs b/sdks/dotnet/src/Coss/Types/SchedulingReassignmentSelection.cs new file mode 100644 index 000000000..6b0551c3c --- /dev/null +++ b/sdks/dotnet/src/Coss/Types/SchedulingReassignmentSelection.cs @@ -0,0 +1,75 @@ +using Coss.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace Coss; + +[Serializable] +public record SchedulingReassignmentSelection : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + /// + /// This host's bookings, by id or uid. + /// + [Optional] + [JsonPropertyName("host")] + public string? Host { get; set; } + + /// + /// The bookings that fall in this entry. + /// + [Optional] + [JsonPropertyName("out_of_office")] + public string? OutOfOffice { get; set; } + + [Optional] + [JsonPropertyName("booking_ids")] + public IEnumerable? BookingIds { get; set; } + + /// + /// A series' occurrences still to come. + /// + [Optional] + [JsonPropertyName("series")] + public string? Series { get; set; } + + /// + /// An ISO 8601 instant with an offset. + /// + [Optional] + [JsonPropertyName("start_after")] + public string? StartAfter { get; set; } + + /// + /// An ISO 8601 instant with an offset. + /// + [Optional] + [JsonPropertyName("start_before")] + public string? StartBefore { get; set; } + + [Optional] + [JsonPropertyName("event_types")] + public IEnumerable? EventTypes { get; set; } + + /// + /// Only those with something else on the host's calendar at that time. + /// + [Optional] + [JsonPropertyName("external_conflict")] + public bool? ExternalConflict { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/sdks/dotnet/src/Coss/Types/SchedulingReassignmentStatus.cs b/sdks/dotnet/src/Coss/Types/SchedulingReassignmentStatus.cs new file mode 100644 index 000000000..b394f46d8 --- /dev/null +++ b/sdks/dotnet/src/Coss/Types/SchedulingReassignmentStatus.cs @@ -0,0 +1,124 @@ +using Coss.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace Coss; + +[JsonConverter(typeof(SchedulingReassignmentStatus.SchedulingReassignmentStatusSerializer))] +[Serializable] +public readonly record struct SchedulingReassignmentStatus : IStringEnum +{ + public static readonly SchedulingReassignmentStatus Pending = new(Values.Pending); + + public static readonly SchedulingReassignmentStatus Running = new(Values.Running); + + public static readonly SchedulingReassignmentStatus Completed = new(Values.Completed); + + public static readonly SchedulingReassignmentStatus Cancelled = new(Values.Cancelled); + + public SchedulingReassignmentStatus(string value) + { + Value = value; + } + + /// + /// The string value of the enum. + /// + public string Value { get; } + + /// + /// Create a string enum with the given value. + /// + public static SchedulingReassignmentStatus FromCustom(string value) + { + return new SchedulingReassignmentStatus(value); + } + + public bool Equals(string? other) + { + return Value.Equals(other); + } + + /// + /// Returns the string value of the enum. + /// + public override string ToString() + { + return Value; + } + + public static bool operator ==(SchedulingReassignmentStatus value1, string value2) => + value1.Value.Equals(value2); + + public static bool operator !=(SchedulingReassignmentStatus value1, string value2) => + !value1.Value.Equals(value2); + + public static explicit operator string(SchedulingReassignmentStatus value) => value.Value; + + public static explicit operator SchedulingReassignmentStatus(string value) => new(value); + + internal class SchedulingReassignmentStatusSerializer + : JsonConverter + { + public override SchedulingReassignmentStatus Read( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON value could not be read as a string." + ); + return new SchedulingReassignmentStatus(stringValue); + } + + public override void Write( + Utf8JsonWriter writer, + SchedulingReassignmentStatus value, + JsonSerializerOptions options + ) + { + writer.WriteStringValue(value.Value); + } + + public override SchedulingReassignmentStatus ReadAsPropertyName( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return new SchedulingReassignmentStatus(stringValue); + } + + public override void WriteAsPropertyName( + Utf8JsonWriter writer, + SchedulingReassignmentStatus value, + JsonSerializerOptions options + ) + { + writer.WritePropertyName(value.Value); + } + } + + /// + /// Constant strings for enum values + /// + [Serializable] + public static class Values + { + public const string Pending = "pending"; + + public const string Running = "running"; + + public const string Completed = "completed"; + + public const string Cancelled = "cancelled"; + } +} diff --git a/sdks/dotnet/src/Coss/Types/SchedulingReassignmentStrategy.cs b/sdks/dotnet/src/Coss/Types/SchedulingReassignmentStrategy.cs new file mode 100644 index 000000000..41a4823fd --- /dev/null +++ b/sdks/dotnet/src/Coss/Types/SchedulingReassignmentStrategy.cs @@ -0,0 +1,53 @@ +using Coss.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace Coss; + +[Serializable] +public record SchedulingReassignmentStrategy : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + /// + /// Give them all to this host. + /// + [Optional] + [JsonPropertyName("to_host")] + public string? ToHost { get; set; } + + /// + /// Try these first, in order. + /// + [Optional] + [JsonPropertyName("preferred_hosts")] + public IEnumerable? PreferredHosts { get; set; } + + /// + /// After `preferred_hosts`: `auto` picks the fairest who's free, `leave` keeps it where it is. + /// + [Optional] + [JsonPropertyName("otherwise")] + public SchedulingReassignmentStrategyOtherwise? Otherwise { get; set; } + + /// + /// Who each goes to: a preview, with your changes. + /// + [Optional] + [JsonPropertyName("assignments")] + public IEnumerable? Assignments { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/sdks/dotnet/src/Coss/Types/SchedulingReassignmentStrategyAssignmentsItem.cs b/sdks/dotnet/src/Coss/Types/SchedulingReassignmentStrategyAssignmentsItem.cs new file mode 100644 index 000000000..e599a4685 --- /dev/null +++ b/sdks/dotnet/src/Coss/Types/SchedulingReassignmentStrategyAssignmentsItem.cs @@ -0,0 +1,35 @@ +using Coss.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace Coss; + +[Serializable] +public record SchedulingReassignmentStrategyAssignmentsItem : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + [JsonPropertyName("booking")] + public required string Booking { get; set; } + + [JsonPropertyName("to_host")] + public required string ToHost { get; set; } + + [Optional] + [JsonPropertyName("from_host")] + public string? FromHost { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/sdks/dotnet/src/Coss/Types/SchedulingReassignmentStrategyOtherwise.cs b/sdks/dotnet/src/Coss/Types/SchedulingReassignmentStrategyOtherwise.cs new file mode 100644 index 000000000..389499239 --- /dev/null +++ b/sdks/dotnet/src/Coss/Types/SchedulingReassignmentStrategyOtherwise.cs @@ -0,0 +1,120 @@ +using Coss.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace Coss; + +[JsonConverter( + typeof(SchedulingReassignmentStrategyOtherwise.SchedulingReassignmentStrategyOtherwiseSerializer) +)] +[Serializable] +public readonly record struct SchedulingReassignmentStrategyOtherwise : IStringEnum +{ + public static readonly SchedulingReassignmentStrategyOtherwise Auto = new(Values.Auto); + + public static readonly SchedulingReassignmentStrategyOtherwise Leave = new(Values.Leave); + + public SchedulingReassignmentStrategyOtherwise(string value) + { + Value = value; + } + + /// + /// The string value of the enum. + /// + public string Value { get; } + + /// + /// Create a string enum with the given value. + /// + public static SchedulingReassignmentStrategyOtherwise FromCustom(string value) + { + return new SchedulingReassignmentStrategyOtherwise(value); + } + + public bool Equals(string? other) + { + return Value.Equals(other); + } + + /// + /// Returns the string value of the enum. + /// + public override string ToString() + { + return Value; + } + + public static bool operator ==(SchedulingReassignmentStrategyOtherwise value1, string value2) => + value1.Value.Equals(value2); + + public static bool operator !=(SchedulingReassignmentStrategyOtherwise value1, string value2) => + !value1.Value.Equals(value2); + + public static explicit operator string(SchedulingReassignmentStrategyOtherwise value) => + value.Value; + + public static explicit operator SchedulingReassignmentStrategyOtherwise(string value) => + new(value); + + internal class SchedulingReassignmentStrategyOtherwiseSerializer + : JsonConverter + { + public override SchedulingReassignmentStrategyOtherwise Read( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON value could not be read as a string." + ); + return new SchedulingReassignmentStrategyOtherwise(stringValue); + } + + public override void Write( + Utf8JsonWriter writer, + SchedulingReassignmentStrategyOtherwise value, + JsonSerializerOptions options + ) + { + writer.WriteStringValue(value.Value); + } + + public override SchedulingReassignmentStrategyOtherwise ReadAsPropertyName( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return new SchedulingReassignmentStrategyOtherwise(stringValue); + } + + public override void WriteAsPropertyName( + Utf8JsonWriter writer, + SchedulingReassignmentStrategyOtherwise value, + JsonSerializerOptions options + ) + { + writer.WritePropertyName(value.Value); + } + } + + /// + /// Constant strings for enum values + /// + [Serializable] + public static class Values + { + public const string Auto = "auto"; + + public const string Leave = "leave"; + } +} diff --git a/sdks/dotnet/src/Coss/Types/SchedulingReassignmentWebhookEvent.cs b/sdks/dotnet/src/Coss/Types/SchedulingReassignmentWebhookEvent.cs new file mode 100644 index 000000000..33c09547d --- /dev/null +++ b/sdks/dotnet/src/Coss/Types/SchedulingReassignmentWebhookEvent.cs @@ -0,0 +1,52 @@ +using Coss.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace Coss; + +[Serializable] +public record SchedulingReassignmentWebhookEvent : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + /// + /// The event id. + /// + [JsonPropertyName("id")] + public required string Id { get; set; } + + [JsonPropertyName("object")] + public required SchedulingReassignmentWebhookEventObject Object { get; set; } + + /// + /// The API version this payload is rendered in: the endpoint's. + /// + [JsonPropertyName("api_version")] + public required string ApiVersion { get; set; } + + /// + /// When the event was created. + /// + [JsonPropertyName("created_at")] + public required DateTime CreatedAt { get; set; } + + [JsonPropertyName("type")] + public required SchedulingReassignmentWebhookEventType Type { get; set; } + + [JsonPropertyName("data")] + public required SchedulingReassignmentWebhookEventData Data { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/sdks/dotnet/src/Coss/Types/SchedulingReassignmentWebhookEventData.cs b/sdks/dotnet/src/Coss/Types/SchedulingReassignmentWebhookEventData.cs new file mode 100644 index 000000000..2ff32ac79 --- /dev/null +++ b/sdks/dotnet/src/Coss/Types/SchedulingReassignmentWebhookEventData.cs @@ -0,0 +1,41 @@ +using Coss.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace Coss; + +[Serializable] +public record SchedulingReassignmentWebhookEventData : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + [JsonPropertyName("reassignment_id")] + public required string ReassignmentId { get; set; } + + [JsonPropertyName("status")] + public required SchedulingReassignmentWebhookEventDataStatus Status { get; set; } + + [Nullable] + [JsonPropertyName("out_of_office_id")] + public string? OutOfOfficeId { get; set; } + + [JsonPropertyName("counts")] + public required SchedulingReassignmentWebhookEventDataCounts Counts { get; set; } + + [JsonPropertyName("occurred_at")] + public required string OccurredAt { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/sdks/dotnet/src/Coss/Types/SchedulingReassignmentWebhookEventDataCounts.cs b/sdks/dotnet/src/Coss/Types/SchedulingReassignmentWebhookEventDataCounts.cs new file mode 100644 index 000000000..3e49eb03c --- /dev/null +++ b/sdks/dotnet/src/Coss/Types/SchedulingReassignmentWebhookEventDataCounts.cs @@ -0,0 +1,52 @@ +using Coss.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace Coss; + +[Serializable] +public record SchedulingReassignmentWebhookEventDataCounts : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + [JsonPropertyName("total")] + public required double Total { get; set; } + + [JsonPropertyName("pending")] + public required double Pending { get; set; } + + [JsonPropertyName("reassigned")] + public required double Reassigned { get; set; } + + /// + /// They'd moved on since it was selected. + /// + [JsonPropertyName("skipped")] + public required double Skipped { get; set; } + + /// + /// Nobody could take them: they stayed. + /// + [JsonPropertyName("no_candidate")] + public required double NoCandidate { get; set; } + + [JsonPropertyName("failed")] + public required double Failed { get; set; } + + [JsonPropertyName("cancelled")] + public required double Cancelled { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/sdks/dotnet/src/Coss/Types/SchedulingReassignmentWebhookEventDataStatus.cs b/sdks/dotnet/src/Coss/Types/SchedulingReassignmentWebhookEventDataStatus.cs new file mode 100644 index 000000000..b80598cc2 --- /dev/null +++ b/sdks/dotnet/src/Coss/Types/SchedulingReassignmentWebhookEventDataStatus.cs @@ -0,0 +1,128 @@ +using Coss.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace Coss; + +[JsonConverter( + typeof(SchedulingReassignmentWebhookEventDataStatus.SchedulingReassignmentWebhookEventDataStatusSerializer) +)] +[Serializable] +public readonly record struct SchedulingReassignmentWebhookEventDataStatus : IStringEnum +{ + public static readonly SchedulingReassignmentWebhookEventDataStatus Completed = new( + Values.Completed + ); + + public static readonly SchedulingReassignmentWebhookEventDataStatus Cancelled = new( + Values.Cancelled + ); + + public SchedulingReassignmentWebhookEventDataStatus(string value) + { + Value = value; + } + + /// + /// The string value of the enum. + /// + public string Value { get; } + + /// + /// Create a string enum with the given value. + /// + public static SchedulingReassignmentWebhookEventDataStatus FromCustom(string value) + { + return new SchedulingReassignmentWebhookEventDataStatus(value); + } + + public bool Equals(string? other) + { + return Value.Equals(other); + } + + /// + /// Returns the string value of the enum. + /// + public override string ToString() + { + return Value; + } + + public static bool operator ==( + SchedulingReassignmentWebhookEventDataStatus value1, + string value2 + ) => value1.Value.Equals(value2); + + public static bool operator !=( + SchedulingReassignmentWebhookEventDataStatus value1, + string value2 + ) => !value1.Value.Equals(value2); + + public static explicit operator string(SchedulingReassignmentWebhookEventDataStatus value) => + value.Value; + + public static explicit operator SchedulingReassignmentWebhookEventDataStatus(string value) => + new(value); + + internal class SchedulingReassignmentWebhookEventDataStatusSerializer + : JsonConverter + { + public override SchedulingReassignmentWebhookEventDataStatus Read( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON value could not be read as a string." + ); + return new SchedulingReassignmentWebhookEventDataStatus(stringValue); + } + + public override void Write( + Utf8JsonWriter writer, + SchedulingReassignmentWebhookEventDataStatus value, + JsonSerializerOptions options + ) + { + writer.WriteStringValue(value.Value); + } + + public override SchedulingReassignmentWebhookEventDataStatus ReadAsPropertyName( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return new SchedulingReassignmentWebhookEventDataStatus(stringValue); + } + + public override void WriteAsPropertyName( + Utf8JsonWriter writer, + SchedulingReassignmentWebhookEventDataStatus value, + JsonSerializerOptions options + ) + { + writer.WritePropertyName(value.Value); + } + } + + /// + /// Constant strings for enum values + /// + [Serializable] + public static class Values + { + public const string Completed = "completed"; + + public const string Cancelled = "cancelled"; + } +} diff --git a/sdks/dotnet/src/Coss/Types/SchedulingReassignmentWebhookEventObject.cs b/sdks/dotnet/src/Coss/Types/SchedulingReassignmentWebhookEventObject.cs new file mode 100644 index 000000000..27dedfd3e --- /dev/null +++ b/sdks/dotnet/src/Coss/Types/SchedulingReassignmentWebhookEventObject.cs @@ -0,0 +1,120 @@ +using Coss.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace Coss; + +[JsonConverter( + typeof(SchedulingReassignmentWebhookEventObject.SchedulingReassignmentWebhookEventObjectSerializer) +)] +[Serializable] +public readonly record struct SchedulingReassignmentWebhookEventObject : IStringEnum +{ + public static readonly SchedulingReassignmentWebhookEventObject Event = new(Values.Event); + + public SchedulingReassignmentWebhookEventObject(string value) + { + Value = value; + } + + /// + /// The string value of the enum. + /// + public string Value { get; } + + /// + /// Create a string enum with the given value. + /// + public static SchedulingReassignmentWebhookEventObject FromCustom(string value) + { + return new SchedulingReassignmentWebhookEventObject(value); + } + + public bool Equals(string? other) + { + return Value.Equals(other); + } + + /// + /// Returns the string value of the enum. + /// + public override string ToString() + { + return Value; + } + + public static bool operator ==( + SchedulingReassignmentWebhookEventObject value1, + string value2 + ) => value1.Value.Equals(value2); + + public static bool operator !=( + SchedulingReassignmentWebhookEventObject value1, + string value2 + ) => !value1.Value.Equals(value2); + + public static explicit operator string(SchedulingReassignmentWebhookEventObject value) => + value.Value; + + public static explicit operator SchedulingReassignmentWebhookEventObject(string value) => + new(value); + + internal class SchedulingReassignmentWebhookEventObjectSerializer + : JsonConverter + { + public override SchedulingReassignmentWebhookEventObject Read( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON value could not be read as a string." + ); + return new SchedulingReassignmentWebhookEventObject(stringValue); + } + + public override void Write( + Utf8JsonWriter writer, + SchedulingReassignmentWebhookEventObject value, + JsonSerializerOptions options + ) + { + writer.WriteStringValue(value.Value); + } + + public override SchedulingReassignmentWebhookEventObject ReadAsPropertyName( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return new SchedulingReassignmentWebhookEventObject(stringValue); + } + + public override void WriteAsPropertyName( + Utf8JsonWriter writer, + SchedulingReassignmentWebhookEventObject value, + JsonSerializerOptions options + ) + { + writer.WritePropertyName(value.Value); + } + } + + /// + /// Constant strings for enum values + /// + [Serializable] + public static class Values + { + public const string Event = "event"; + } +} diff --git a/sdks/dotnet/src/Coss/Types/SchedulingReassignmentWebhookEventType.cs b/sdks/dotnet/src/Coss/Types/SchedulingReassignmentWebhookEventType.cs new file mode 100644 index 000000000..5cda3c2e2 --- /dev/null +++ b/sdks/dotnet/src/Coss/Types/SchedulingReassignmentWebhookEventType.cs @@ -0,0 +1,117 @@ +using Coss.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace Coss; + +[JsonConverter( + typeof(SchedulingReassignmentWebhookEventType.SchedulingReassignmentWebhookEventTypeSerializer) +)] +[Serializable] +public readonly record struct SchedulingReassignmentWebhookEventType : IStringEnum +{ + public static readonly SchedulingReassignmentWebhookEventType SchedulingReassignmentCompleted = + new(Values.SchedulingReassignmentCompleted); + + public SchedulingReassignmentWebhookEventType(string value) + { + Value = value; + } + + /// + /// The string value of the enum. + /// + public string Value { get; } + + /// + /// Create a string enum with the given value. + /// + public static SchedulingReassignmentWebhookEventType FromCustom(string value) + { + return new SchedulingReassignmentWebhookEventType(value); + } + + public bool Equals(string? other) + { + return Value.Equals(other); + } + + /// + /// Returns the string value of the enum. + /// + public override string ToString() + { + return Value; + } + + public static bool operator ==(SchedulingReassignmentWebhookEventType value1, string value2) => + value1.Value.Equals(value2); + + public static bool operator !=(SchedulingReassignmentWebhookEventType value1, string value2) => + !value1.Value.Equals(value2); + + public static explicit operator string(SchedulingReassignmentWebhookEventType value) => + value.Value; + + public static explicit operator SchedulingReassignmentWebhookEventType(string value) => + new(value); + + internal class SchedulingReassignmentWebhookEventTypeSerializer + : JsonConverter + { + public override SchedulingReassignmentWebhookEventType Read( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON value could not be read as a string." + ); + return new SchedulingReassignmentWebhookEventType(stringValue); + } + + public override void Write( + Utf8JsonWriter writer, + SchedulingReassignmentWebhookEventType value, + JsonSerializerOptions options + ) + { + writer.WriteStringValue(value.Value); + } + + public override SchedulingReassignmentWebhookEventType ReadAsPropertyName( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return new SchedulingReassignmentWebhookEventType(stringValue); + } + + public override void WriteAsPropertyName( + Utf8JsonWriter writer, + SchedulingReassignmentWebhookEventType value, + JsonSerializerOptions options + ) + { + writer.WritePropertyName(value.Value); + } + } + + /// + /// Constant strings for enum values + /// + [Serializable] + public static class Values + { + public const string SchedulingReassignmentCompleted = "scheduling.reassignment.completed"; + } +} diff --git a/sdks/dotnet/src/Coss/Types/SchedulingSettings.cs b/sdks/dotnet/src/Coss/Types/SchedulingSettings.cs index e85cbc21c..4c062ae1e 100644 --- a/sdks/dotnet/src/Coss/Types/SchedulingSettings.cs +++ b/sdks/dotnet/src/Coss/Types/SchedulingSettings.cs @@ -41,6 +41,13 @@ public record SchedulingSettings : IJsonOnDeserialized [JsonPropertyName("logo")] public SchedulingSettingsLogo? Logo { get; set; } + /// + /// Your privacy policy, linked on a host's page beside what connecting a calendar does, once this environment has its own OAuth app and a `brand_name`. + /// + [Nullable] + [JsonPropertyName("privacy_url")] + public string? PrivacyUrl { get; set; } + /// /// Sender of booking emails, on a verified domain. /// @@ -55,6 +62,25 @@ public record SchedulingSettings : IJsonOnDeserialized [JsonPropertyName("sms_from")] public string? SmsFrom { get; set; } + /// + /// Name the new host when telling an attendee their booking has one. + /// + [JsonPropertyName("name_host_in_attendee_emails")] + public required bool NameHostInAttendeeEmails { get; set; } + + /// + /// Whether hosts can give their own bookings to someone else from their page. `eligible` lets them, to anyone free who takes that event type. + /// + [JsonPropertyName("host_reassignment")] + public required SchedulingSettingsHostReassignment HostReassignment { get; set; } + + /// + /// Reasons of your own for time away, on top of the preset ones. + /// + [JsonPropertyName("out_of_office_reasons")] + public IEnumerable OutOfOfficeReasons { get; set; } = + new List(); + /// /// When a host's calendar can't be read: `hide` stops offering them, `last_known` keeps offering their last known times. /// diff --git a/sdks/dotnet/src/Coss/Types/SchedulingSettingsHostReassignment.cs b/sdks/dotnet/src/Coss/Types/SchedulingSettingsHostReassignment.cs new file mode 100644 index 000000000..3e16f9894 --- /dev/null +++ b/sdks/dotnet/src/Coss/Types/SchedulingSettingsHostReassignment.cs @@ -0,0 +1,118 @@ +using Coss.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace Coss; + +[JsonConverter( + typeof(SchedulingSettingsHostReassignment.SchedulingSettingsHostReassignmentSerializer) +)] +[Serializable] +public readonly record struct SchedulingSettingsHostReassignment : IStringEnum +{ + public static readonly SchedulingSettingsHostReassignment Off = new(Values.Off); + + public static readonly SchedulingSettingsHostReassignment Eligible = new(Values.Eligible); + + public SchedulingSettingsHostReassignment(string value) + { + Value = value; + } + + /// + /// The string value of the enum. + /// + public string Value { get; } + + /// + /// Create a string enum with the given value. + /// + public static SchedulingSettingsHostReassignment FromCustom(string value) + { + return new SchedulingSettingsHostReassignment(value); + } + + public bool Equals(string? other) + { + return Value.Equals(other); + } + + /// + /// Returns the string value of the enum. + /// + public override string ToString() + { + return Value; + } + + public static bool operator ==(SchedulingSettingsHostReassignment value1, string value2) => + value1.Value.Equals(value2); + + public static bool operator !=(SchedulingSettingsHostReassignment value1, string value2) => + !value1.Value.Equals(value2); + + public static explicit operator string(SchedulingSettingsHostReassignment value) => value.Value; + + public static explicit operator SchedulingSettingsHostReassignment(string value) => new(value); + + internal class SchedulingSettingsHostReassignmentSerializer + : JsonConverter + { + public override SchedulingSettingsHostReassignment Read( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON value could not be read as a string." + ); + return new SchedulingSettingsHostReassignment(stringValue); + } + + public override void Write( + Utf8JsonWriter writer, + SchedulingSettingsHostReassignment value, + JsonSerializerOptions options + ) + { + writer.WriteStringValue(value.Value); + } + + public override SchedulingSettingsHostReassignment ReadAsPropertyName( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return new SchedulingSettingsHostReassignment(stringValue); + } + + public override void WriteAsPropertyName( + Utf8JsonWriter writer, + SchedulingSettingsHostReassignment value, + JsonSerializerOptions options + ) + { + writer.WritePropertyName(value.Value); + } + } + + /// + /// Constant strings for enum values + /// + [Serializable] + public static class Values + { + public const string Off = "off"; + + public const string Eligible = "eligible"; + } +} diff --git a/sdks/dotnet/src/Coss/Types/SchedulingSettingsOutOfOfficeReasonsItem.cs b/sdks/dotnet/src/Coss/Types/SchedulingSettingsOutOfOfficeReasonsItem.cs new file mode 100644 index 000000000..9b606a14d --- /dev/null +++ b/sdks/dotnet/src/Coss/Types/SchedulingSettingsOutOfOfficeReasonsItem.cs @@ -0,0 +1,31 @@ +using Coss.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace Coss; + +[Serializable] +public record SchedulingSettingsOutOfOfficeReasonsItem : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + [JsonPropertyName("key")] + public required string Key { get; set; } + + [JsonPropertyName("label")] + public required string Label { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/sdks/dotnet/src/Coss/Types/SchedulingSlotExplanation.cs b/sdks/dotnet/src/Coss/Types/SchedulingSlotExplanation.cs index be0094508..2e670c8dc 100644 --- a/sdks/dotnet/src/Coss/Types/SchedulingSlotExplanation.cs +++ b/sdks/dotnet/src/Coss/Types/SchedulingSlotExplanation.cs @@ -33,7 +33,7 @@ public record SchedulingSlotExplanation : IJsonOnDeserialized public required bool Available { get; set; } /// - /// Why it can't: `not_on_grid`, `too_soon`, `outside_booking_window`, `calendar_unverified`, `outside_availability`, `host_busy`, `already_claimed`, `limit_reached` or `session_full`, or `event_type_inactive` or `no_hosts`. `null` when it can. With several hosts refused, the first one's reason: see `hosts`. + /// Why it can't: `not_on_grid`, `too_soon`, `outside_booking_window`, `out_of_office`, `outside_coverage`, `calendar_unverified`, `outside_availability`, `host_busy`, `already_claimed`, `limit_reached` or `session_full`, or `event_type_inactive` or `no_hosts`. `null` when it can. With several hosts refused, the first one's reason: see `hosts`. /// [Nullable] [JsonPropertyName("reason")] diff --git a/sdks/dotnet/src/Coss/Types/SchedulingSlotExplanationHostsItem.cs b/sdks/dotnet/src/Coss/Types/SchedulingSlotExplanationHostsItem.cs index e3844526c..258c7e280 100644 --- a/sdks/dotnet/src/Coss/Types/SchedulingSlotExplanationHostsItem.cs +++ b/sdks/dotnet/src/Coss/Types/SchedulingSlotExplanationHostsItem.cs @@ -30,7 +30,7 @@ public record SchedulingSlotExplanationHostsItem : IJsonOnDeserialized public required bool Available { get; set; } /// - /// Why not: `not_on_grid`, `too_soon`, `outside_booking_window`, `calendar_unverified`, `outside_availability`, `host_busy`, `already_claimed`, `limit_reached` or `session_full`. `null` when they could. + /// Why not: `not_on_grid`, `too_soon`, `outside_booking_window`, `out_of_office`, `outside_coverage`, `calendar_unverified`, `outside_availability`, `host_busy`, `already_claimed`, `limit_reached` or `session_full`. `null` when they could. /// [Nullable] [JsonPropertyName("reason")] diff --git a/sdks/dotnet/src/Coss/Types/WebhookTestEvent.cs b/sdks/dotnet/src/Coss/Types/WebhookTestEvent.cs index 1353b1f03..ec64a65ff 100644 --- a/sdks/dotnet/src/Coss/Types/WebhookTestEvent.cs +++ b/sdks/dotnet/src/Coss/Types/WebhookTestEvent.cs @@ -34,7 +34,10 @@ public required OneOf< FormSubmissionWebhookEvent, SchedulingBookingWebhookEvent, SchedulingCalendarWebhookEvent, - SchedulingCalendarDelegationWebhookEvent + SchedulingOutOfOfficeWebhookEvent, + SchedulingReassignmentWebhookEvent, + SchedulingCalendarDelegationWebhookEvent, + SchedulingOauthAppWebhookEvent > Event { get; set; } /// diff --git a/sdks/dotnet/src/Coss/WebhookEndpoints/Types/CreateWebhookEndpointRequestEventTypesItem.cs b/sdks/dotnet/src/Coss/WebhookEndpoints/Types/CreateWebhookEndpointRequestEventTypesItem.cs index 6c8fea2c6..1c07ffded 100644 --- a/sdks/dotnet/src/Coss/WebhookEndpoints/Types/CreateWebhookEndpointRequestEventTypesItem.cs +++ b/sdks/dotnet/src/Coss/WebhookEndpoints/Types/CreateWebhookEndpointRequestEventTypesItem.cs @@ -322,6 +322,9 @@ namespace Coss; public static readonly CreateWebhookEndpointRequestEventTypesItem SchedulingBookingLocationReady = new(Values.SchedulingBookingLocationReady); + public static readonly CreateWebhookEndpointRequestEventTypesItem SchedulingBookingReassigned = + new(Values.SchedulingBookingReassigned); + public static readonly CreateWebhookEndpointRequestEventTypesItem SchedulingBookingStarted = new(Values.SchedulingBookingStarted); @@ -347,6 +350,30 @@ namespace Coss; public static readonly CreateWebhookEndpointRequestEventTypesItem SchedulingCalendarDelegationRestored = new(Values.SchedulingCalendarDelegationRestored); + public static readonly CreateWebhookEndpointRequestEventTypesItem SchedulingOutOfOfficeCreated = + new(Values.SchedulingOutOfOfficeCreated); + + public static readonly CreateWebhookEndpointRequestEventTypesItem SchedulingOutOfOfficeUpdated = + new(Values.SchedulingOutOfOfficeUpdated); + + public static readonly CreateWebhookEndpointRequestEventTypesItem SchedulingOutOfOfficeDeleted = + new(Values.SchedulingOutOfOfficeDeleted); + + public static readonly CreateWebhookEndpointRequestEventTypesItem SchedulingOutOfOfficeStarted = + new(Values.SchedulingOutOfOfficeStarted); + + public static readonly CreateWebhookEndpointRequestEventTypesItem SchedulingOutOfOfficeEnded = + new(Values.SchedulingOutOfOfficeEnded); + + public static readonly CreateWebhookEndpointRequestEventTypesItem SchedulingReassignmentCompleted = + new(Values.SchedulingReassignmentCompleted); + + public static readonly CreateWebhookEndpointRequestEventTypesItem SchedulingOauthAppFailing = + new(Values.SchedulingOauthAppFailing); + + public static readonly CreateWebhookEndpointRequestEventTypesItem SchedulingOauthAppRestored = + new(Values.SchedulingOauthAppRestored); + public CreateWebhookEndpointRequestEventTypesItem(string value) { Value = value; @@ -619,6 +646,8 @@ public static class Values public const string SchedulingBookingLocationReady = "scheduling.booking.location_ready"; + public const string SchedulingBookingReassigned = "scheduling.booking.reassigned"; + public const string SchedulingBookingStarted = "scheduling.booking.started"; public const string SchedulingBookingEnded = "scheduling.booking.ended"; @@ -636,5 +665,21 @@ public static class Values public const string SchedulingCalendarDelegationRestored = "scheduling.calendar_delegation.restored"; + + public const string SchedulingOutOfOfficeCreated = "scheduling.out_of_office.created"; + + public const string SchedulingOutOfOfficeUpdated = "scheduling.out_of_office.updated"; + + public const string SchedulingOutOfOfficeDeleted = "scheduling.out_of_office.deleted"; + + public const string SchedulingOutOfOfficeStarted = "scheduling.out_of_office.started"; + + public const string SchedulingOutOfOfficeEnded = "scheduling.out_of_office.ended"; + + public const string SchedulingReassignmentCompleted = "scheduling.reassignment.completed"; + + public const string SchedulingOauthAppFailing = "scheduling.oauth_app.failing"; + + public const string SchedulingOauthAppRestored = "scheduling.oauth_app.restored"; } } diff --git a/sdks/dotnet/src/Coss/WebhookEndpoints/Types/UpdateWebhookEndpointRequestEventTypesItem.cs b/sdks/dotnet/src/Coss/WebhookEndpoints/Types/UpdateWebhookEndpointRequestEventTypesItem.cs index fcaad318f..e7feddbe9 100644 --- a/sdks/dotnet/src/Coss/WebhookEndpoints/Types/UpdateWebhookEndpointRequestEventTypesItem.cs +++ b/sdks/dotnet/src/Coss/WebhookEndpoints/Types/UpdateWebhookEndpointRequestEventTypesItem.cs @@ -322,6 +322,9 @@ namespace Coss; public static readonly UpdateWebhookEndpointRequestEventTypesItem SchedulingBookingLocationReady = new(Values.SchedulingBookingLocationReady); + public static readonly UpdateWebhookEndpointRequestEventTypesItem SchedulingBookingReassigned = + new(Values.SchedulingBookingReassigned); + public static readonly UpdateWebhookEndpointRequestEventTypesItem SchedulingBookingStarted = new(Values.SchedulingBookingStarted); @@ -347,6 +350,30 @@ namespace Coss; public static readonly UpdateWebhookEndpointRequestEventTypesItem SchedulingCalendarDelegationRestored = new(Values.SchedulingCalendarDelegationRestored); + public static readonly UpdateWebhookEndpointRequestEventTypesItem SchedulingOutOfOfficeCreated = + new(Values.SchedulingOutOfOfficeCreated); + + public static readonly UpdateWebhookEndpointRequestEventTypesItem SchedulingOutOfOfficeUpdated = + new(Values.SchedulingOutOfOfficeUpdated); + + public static readonly UpdateWebhookEndpointRequestEventTypesItem SchedulingOutOfOfficeDeleted = + new(Values.SchedulingOutOfOfficeDeleted); + + public static readonly UpdateWebhookEndpointRequestEventTypesItem SchedulingOutOfOfficeStarted = + new(Values.SchedulingOutOfOfficeStarted); + + public static readonly UpdateWebhookEndpointRequestEventTypesItem SchedulingOutOfOfficeEnded = + new(Values.SchedulingOutOfOfficeEnded); + + public static readonly UpdateWebhookEndpointRequestEventTypesItem SchedulingReassignmentCompleted = + new(Values.SchedulingReassignmentCompleted); + + public static readonly UpdateWebhookEndpointRequestEventTypesItem SchedulingOauthAppFailing = + new(Values.SchedulingOauthAppFailing); + + public static readonly UpdateWebhookEndpointRequestEventTypesItem SchedulingOauthAppRestored = + new(Values.SchedulingOauthAppRestored); + public UpdateWebhookEndpointRequestEventTypesItem(string value) { Value = value; @@ -619,6 +646,8 @@ public static class Values public const string SchedulingBookingLocationReady = "scheduling.booking.location_ready"; + public const string SchedulingBookingReassigned = "scheduling.booking.reassigned"; + public const string SchedulingBookingStarted = "scheduling.booking.started"; public const string SchedulingBookingEnded = "scheduling.booking.ended"; @@ -636,5 +665,21 @@ public static class Values public const string SchedulingCalendarDelegationRestored = "scheduling.calendar_delegation.restored"; + + public const string SchedulingOutOfOfficeCreated = "scheduling.out_of_office.created"; + + public const string SchedulingOutOfOfficeUpdated = "scheduling.out_of_office.updated"; + + public const string SchedulingOutOfOfficeDeleted = "scheduling.out_of_office.deleted"; + + public const string SchedulingOutOfOfficeStarted = "scheduling.out_of_office.started"; + + public const string SchedulingOutOfOfficeEnded = "scheduling.out_of_office.ended"; + + public const string SchedulingReassignmentCompleted = "scheduling.reassignment.completed"; + + public const string SchedulingOauthAppFailing = "scheduling.oauth_app.failing"; + + public const string SchedulingOauthAppRestored = "scheduling.oauth_app.restored"; } } diff --git a/sdks/dotnet/src/Coss/WebhookEvents/Types/CreateTestWebhookEventRequestType.cs b/sdks/dotnet/src/Coss/WebhookEvents/Types/CreateTestWebhookEventRequestType.cs index d4b94178b..29056eae8 100644 --- a/sdks/dotnet/src/Coss/WebhookEvents/Types/CreateTestWebhookEventRequestType.cs +++ b/sdks/dotnet/src/Coss/WebhookEvents/Types/CreateTestWebhookEventRequestType.cs @@ -322,6 +322,10 @@ namespace Coss; Values.SchedulingBookingLocationReady ); + public static readonly CreateTestWebhookEventRequestType SchedulingBookingReassigned = new( + Values.SchedulingBookingReassigned + ); + public static readonly CreateTestWebhookEventRequestType SchedulingBookingStarted = new( Values.SchedulingBookingStarted ); @@ -352,6 +356,38 @@ namespace Coss; public static readonly CreateTestWebhookEventRequestType SchedulingCalendarDelegationRestored = new(Values.SchedulingCalendarDelegationRestored); + public static readonly CreateTestWebhookEventRequestType SchedulingOutOfOfficeCreated = new( + Values.SchedulingOutOfOfficeCreated + ); + + public static readonly CreateTestWebhookEventRequestType SchedulingOutOfOfficeUpdated = new( + Values.SchedulingOutOfOfficeUpdated + ); + + public static readonly CreateTestWebhookEventRequestType SchedulingOutOfOfficeDeleted = new( + Values.SchedulingOutOfOfficeDeleted + ); + + public static readonly CreateTestWebhookEventRequestType SchedulingOutOfOfficeStarted = new( + Values.SchedulingOutOfOfficeStarted + ); + + public static readonly CreateTestWebhookEventRequestType SchedulingOutOfOfficeEnded = new( + Values.SchedulingOutOfOfficeEnded + ); + + public static readonly CreateTestWebhookEventRequestType SchedulingReassignmentCompleted = new( + Values.SchedulingReassignmentCompleted + ); + + public static readonly CreateTestWebhookEventRequestType SchedulingOauthAppFailing = new( + Values.SchedulingOauthAppFailing + ); + + public static readonly CreateTestWebhookEventRequestType SchedulingOauthAppRestored = new( + Values.SchedulingOauthAppRestored + ); + public CreateTestWebhookEventRequestType(string value) { Value = value; @@ -618,6 +654,8 @@ public static class Values public const string SchedulingBookingLocationReady = "scheduling.booking.location_ready"; + public const string SchedulingBookingReassigned = "scheduling.booking.reassigned"; + public const string SchedulingBookingStarted = "scheduling.booking.started"; public const string SchedulingBookingEnded = "scheduling.booking.ended"; @@ -635,5 +673,21 @@ public static class Values public const string SchedulingCalendarDelegationRestored = "scheduling.calendar_delegation.restored"; + + public const string SchedulingOutOfOfficeCreated = "scheduling.out_of_office.created"; + + public const string SchedulingOutOfOfficeUpdated = "scheduling.out_of_office.updated"; + + public const string SchedulingOutOfOfficeDeleted = "scheduling.out_of_office.deleted"; + + public const string SchedulingOutOfOfficeStarted = "scheduling.out_of_office.started"; + + public const string SchedulingOutOfOfficeEnded = "scheduling.out_of_office.ended"; + + public const string SchedulingReassignmentCompleted = "scheduling.reassignment.completed"; + + public const string SchedulingOauthAppFailing = "scheduling.oauth_app.failing"; + + public const string SchedulingOauthAppRestored = "scheduling.oauth_app.restored"; } } diff --git a/sdks/dotnet/src/Coss/WebhookListeners/Types/CreateWebhookListenerRequestEventTypesItem.cs b/sdks/dotnet/src/Coss/WebhookListeners/Types/CreateWebhookListenerRequestEventTypesItem.cs index d8c620074..ffa85cac8 100644 --- a/sdks/dotnet/src/Coss/WebhookListeners/Types/CreateWebhookListenerRequestEventTypesItem.cs +++ b/sdks/dotnet/src/Coss/WebhookListeners/Types/CreateWebhookListenerRequestEventTypesItem.cs @@ -322,6 +322,9 @@ namespace Coss; public static readonly CreateWebhookListenerRequestEventTypesItem SchedulingBookingLocationReady = new(Values.SchedulingBookingLocationReady); + public static readonly CreateWebhookListenerRequestEventTypesItem SchedulingBookingReassigned = + new(Values.SchedulingBookingReassigned); + public static readonly CreateWebhookListenerRequestEventTypesItem SchedulingBookingStarted = new(Values.SchedulingBookingStarted); @@ -347,6 +350,30 @@ namespace Coss; public static readonly CreateWebhookListenerRequestEventTypesItem SchedulingCalendarDelegationRestored = new(Values.SchedulingCalendarDelegationRestored); + public static readonly CreateWebhookListenerRequestEventTypesItem SchedulingOutOfOfficeCreated = + new(Values.SchedulingOutOfOfficeCreated); + + public static readonly CreateWebhookListenerRequestEventTypesItem SchedulingOutOfOfficeUpdated = + new(Values.SchedulingOutOfOfficeUpdated); + + public static readonly CreateWebhookListenerRequestEventTypesItem SchedulingOutOfOfficeDeleted = + new(Values.SchedulingOutOfOfficeDeleted); + + public static readonly CreateWebhookListenerRequestEventTypesItem SchedulingOutOfOfficeStarted = + new(Values.SchedulingOutOfOfficeStarted); + + public static readonly CreateWebhookListenerRequestEventTypesItem SchedulingOutOfOfficeEnded = + new(Values.SchedulingOutOfOfficeEnded); + + public static readonly CreateWebhookListenerRequestEventTypesItem SchedulingReassignmentCompleted = + new(Values.SchedulingReassignmentCompleted); + + public static readonly CreateWebhookListenerRequestEventTypesItem SchedulingOauthAppFailing = + new(Values.SchedulingOauthAppFailing); + + public static readonly CreateWebhookListenerRequestEventTypesItem SchedulingOauthAppRestored = + new(Values.SchedulingOauthAppRestored); + public CreateWebhookListenerRequestEventTypesItem(string value) { Value = value; @@ -619,6 +646,8 @@ public static class Values public const string SchedulingBookingLocationReady = "scheduling.booking.location_ready"; + public const string SchedulingBookingReassigned = "scheduling.booking.reassigned"; + public const string SchedulingBookingStarted = "scheduling.booking.started"; public const string SchedulingBookingEnded = "scheduling.booking.ended"; @@ -636,5 +665,21 @@ public static class Values public const string SchedulingCalendarDelegationRestored = "scheduling.calendar_delegation.restored"; + + public const string SchedulingOutOfOfficeCreated = "scheduling.out_of_office.created"; + + public const string SchedulingOutOfOfficeUpdated = "scheduling.out_of_office.updated"; + + public const string SchedulingOutOfOfficeDeleted = "scheduling.out_of_office.deleted"; + + public const string SchedulingOutOfOfficeStarted = "scheduling.out_of_office.started"; + + public const string SchedulingOutOfOfficeEnded = "scheduling.out_of_office.ended"; + + public const string SchedulingReassignmentCompleted = "scheduling.reassignment.completed"; + + public const string SchedulingOauthAppFailing = "scheduling.oauth_app.failing"; + + public const string SchedulingOauthAppRestored = "scheduling.oauth_app.restored"; } } diff --git a/sdks/go/CHANGELOG.md b/sdks/go/CHANGELOG.md index 8ba8118a4..4152bfb5e 100644 --- a/sdks/go/CHANGELOG.md +++ b/sdks/go/CHANGELOG.md @@ -1,5 +1,10 @@ # Changelog +## 0.4.0 + +- Regenerated from the API's OpenAPI document at 2eb77126153a. What changed in the API: the + [API changelog](https://coss.com/docs/api-reference/changelog). + ## 0.3.0 - Regenerated from the API's OpenAPI document at 820256d03a44. What changed in the API: the diff --git a/sdks/go/core/request_option.go b/sdks/go/core/request_option.go index 25368b216..7e63b7911 100644 --- a/sdks/go/core/request_option.go +++ b/sdks/go/core/request_option.go @@ -70,8 +70,8 @@ func (r *RequestOptions) cloneHeader() http.Header { headers := r.HTTPHeader.Clone() headers.Set("X-Fern-Language", "Go") headers.Set("X-Fern-SDK-Name", "github.com/cosscom/coss-go") - headers.Set("X-Fern-SDK-Version", "v0.3.0") - headers.Set("User-Agent", "coss-go/0.3.0") + headers.Set("X-Fern-SDK-Version", "v0.4.0") + headers.Set("User-Agent", "coss-go/0.4.0") return headers } diff --git a/sdks/go/reference.md b/sdks/go/reference.md index 756cb86ce..92079dd43 100644 --- a/sdks/go/reference.md +++ b/sdks/go/reference.md @@ -17781,8 +17781,8 @@ client.Scheduling.Hosts.Update(
-## Scheduling Schedules -
client.Scheduling.Schedules.List(Host) -> *coss.SchedulingScheduleList +## Scheduling Bookings +
client.Scheduling.Bookings.Reassign(ID, request) -> *coss.SchedulingBooking
@@ -17794,7 +17794,7 @@ client.Scheduling.Hosts.Update(
-All of the host's schedules, oldest first. +Gives a booking to another host, keeping its id and time. Works for every kind: a group session moves as a whole, from any of its seats, and one that's already started changes for the record, with nobody told. Whoever leaves and joins is told, and the attendee unless you say not to.
@@ -17809,10 +17809,18 @@ All of the host's schedules, oldest first.
```go -request := &scheduling.ListSchedulesRequest{ - Host: "host_01kd2m9a0b1c2d3e4f5g6h7j8m", +request := &scheduling.ReassignSchedulingBookingRequest{ + ID: "book_01kd2m9a0b1c2d3e4f5g6h7j8m", + Changes: []*scheduling.ReassignSchedulingBookingRequestChangesItem{ + &scheduling.ReassignSchedulingBookingRequestChangesItem{ + ToHost: coss.String( + "doctor_518", + ), + }, + }, + ReasonCode: scheduling.ReassignSchedulingBookingRequestReasonCodeOutOfOffice, } -client.Scheduling.Schedules.List( +client.Scheduling.Bookings.Reassign( context.TODO(), request, ) @@ -17830,96 +17838,39 @@ client.Scheduling.Schedules.List(
-**host:** `string` — The host's id or uid. +**id:** `string` — The booking's id.
-
-
- - - - -
-
client.Scheduling.Schedules.Create(Host, request) -> *coss.SchedulingSchedule
-#### 📝 Description - -
-
+**changes:** `[]*scheduling.ReassignSchedulingBookingRequestChangesItem` — A session or a one-on-one has one. A collective can change several. + +
+
-A host's weekly hours and date overrides, in local time. The first one is the host's default. -
-
+**reasonCode:** `scheduling.ReassignSchedulingBookingRequestReasonCode` +
-#### 🔌 Usage - -
-
-
-```go -request := &scheduling.CreateSchedulesRequest{ - Host: "host_01kd2m9a0b1c2d3e4f5g6h7j8m", - Body: &coss.UpsertScheduleRequest{ - Name: coss.String( - "Clinic hours", - ), - Rules: []*coss.SchedulingWeeklyRule{ - &coss.SchedulingWeeklyRule{ - Days: []int{ - 1, - 2, - 3, - 4, - 5, - }, - Start: "09:00", - End: "17:00", - }, - }, - Overrides: []*coss.SchedulingScheduleOverride{ - &coss.SchedulingScheduleOverride{ - Date: "2027-12-24", - Ranges: []*coss.SchedulingScheduleOverrideRangesItem{ - &coss.SchedulingScheduleOverrideRangesItem{ - Start: "start", - End: "end", - }, - }, - }, - }, - }, -} -client.Scheduling.Schedules.Create( - context.TODO(), - request, -) -``` -
-
+**note:** `*string` — Why, in your words: required with an override of someone's availability. Encrypted, and only in the booking's history. +
-#### ⚙️ Parameters -
-
-
- -**host:** `string` — The host's id or uid. +**overrides:** `[]scheduling.ReassignSchedulingBookingRequestOverridesItem` — Go ahead anyway: `any_host` for someone who doesn't take this event type, and the rest for what a candidate's `reason` said. A host who already has something at this time can never be overridden.
@@ -17927,7 +17878,7 @@ client.Scheduling.Schedules.Create(
-**request:** `*coss.UpsertScheduleRequest` +**notify:** `*scheduling.ReassignSchedulingBookingRequestNotify`
@@ -17939,7 +17890,7 @@ client.Scheduling.Schedules.Create(
-
client.Scheduling.Schedules.Get(Host, ScheduleID) -> *coss.SchedulingSchedule +
client.Scheduling.Bookings.ReassignCandidates(ID) -> *coss.SchedulingReassignCandidateList
@@ -17951,7 +17902,7 @@ client.Scheduling.Schedules.Create(
-One of the host's schedules. +The environment's other active hosts: members of the event type first, in the order a pool would pick them, each saying whether they're free and why not. Things can change before you ask: reassigning decides again.
@@ -17966,11 +17917,10 @@ One of the host's schedules.
```go -request := &scheduling.GetSchedulesRequest{ - Host: "host_01kd2m9a0b1c2d3e4f5g6h7j8m", - ScheduleID: "sched_01kd2m9a0b1c2d3e4f5g6h7j8m", +request := &scheduling.ReassignCandidatesBookingsRequest{ + ID: "book_01kd2m9a0b1c2d3e4f5g6h7j8m", } -client.Scheduling.Schedules.Get( +client.Scheduling.Bookings.ReassignCandidates( context.TODO(), request, ) @@ -17988,7 +17938,7 @@ client.Scheduling.Schedules.Get(
-**host:** `string` — The host's id or uid. +**id:** `string` — The booking's id.
@@ -17996,7 +17946,7 @@ client.Scheduling.Schedules.Get(
-**scheduleID:** `string` — The schedule's id. +**fromHost:** `*string` — The host who'd leave, when it could be several.
@@ -18008,7 +17958,7 @@ client.Scheduling.Schedules.Get(
-
client.Scheduling.Schedules.Update(Host, ScheduleID, request) -> *coss.SchedulingSchedule +
client.Scheduling.Bookings.List() -> *coss.SchedulingBookingList
@@ -18020,7 +17970,7 @@ client.Scheduling.Schedules.Get(
-Replaces its weekly rules, and its overrides when given. Existing bookings stay: a schedule only decides what's offered next. +The environment's bookings, newest first. Answers aren't included.
@@ -18035,40 +17985,15 @@ Replaces its weekly rules, and its overrides when given. Existing bookings stay:
```go -request := &scheduling.UpdateSchedulesRequest{ - Host: "host_01kd2m9a0b1c2d3e4f5g6h7j8m", - ScheduleID: "sched_01kd2m9a0b1c2d3e4f5g6h7j8m", - Body: &coss.UpsertScheduleRequest{ - Name: coss.String( - "Clinic hours", - ), - Rules: []*coss.SchedulingWeeklyRule{ - &coss.SchedulingWeeklyRule{ - Days: []int{ - 1, - 2, - 3, - 4, - 5, - }, - Start: "09:00", - End: "17:00", - }, - }, - Overrides: []*coss.SchedulingScheduleOverride{ - &coss.SchedulingScheduleOverride{ - Date: "2027-12-24", - Ranges: []*coss.SchedulingScheduleOverrideRangesItem{ - &coss.SchedulingScheduleOverrideRangesItem{ - Start: "start", - End: "end", - }, - }, - }, - }, - }, +request := &scheduling.ListBookingsRequest{ + StartAfter: coss.String( + "2027-01-04T15:00:00.000Z", + ), + StartBefore: coss.String( + "2027-01-04T15:00:00.000Z", + ), } -client.Scheduling.Schedules.Update( +client.Scheduling.Bookings.List( context.TODO(), request, ) @@ -18086,7 +18011,7 @@ client.Scheduling.Schedules.Update(
-**host:** `string` — The host's id or uid. +**limit:** `*int`
@@ -18094,7 +18019,7 @@ client.Scheduling.Schedules.Update(
-**scheduleID:** `string` — The schedule's id. +**after:** `*string` — The last id of the previous page.
@@ -18102,68 +18027,39 @@ client.Scheduling.Schedules.Update(
-**request:** `*coss.UpsertScheduleRequest` +**host:** `*string`
-
-
- - - - -
-
client.Scheduling.Schedules.Remove(Host, ScheduleID) -> *coss.DeletedSchedulingSchedule
-#### 📝 Description - -
-
+**eventType:** `*string` + +
+
-Refused for the host's default schedule. -
-
+**status:** `*scheduling.ListBookingsRequestStatus` +
-#### 🔌 Usage - -
-
-
-```go -request := &scheduling.RemoveSchedulesRequest{ - Host: "host_01kd2m9a0b1c2d3e4f5g6h7j8m", - ScheduleID: "sched_01kd2m9a0b1c2d3e4f5g6h7j8m", -} -client.Scheduling.Schedules.Remove( - context.TODO(), - request, -) -``` -
-
+**attendeeUID:** `*string` +
-#### ⚙️ Parameters -
-
-
- -**host:** `string` — The host's id or uid. +**startAfter:** `*string` — An ISO 8601 instant with an offset.
@@ -18171,7 +18067,7 @@ client.Scheduling.Schedules.Remove(
-**scheduleID:** `string` — The schedule's id. +**startBefore:** `*string` — An ISO 8601 instant with an offset.
@@ -18183,8 +18079,7 @@ client.Scheduling.Schedules.Remove(
-## Scheduling EventTypes -
client.Scheduling.EventTypes.List() -> *coss.SchedulingEventTypeList +
client.Scheduling.Bookings.Create(request) -> *coss.SchedulingBooking
@@ -18196,7 +18091,7 @@ client.Scheduling.Schedules.Remove(
-The environment's event types, newest first. +Books a slot, or joins a group session. Without a `host`, a pool chooses fairly among those free. An event type that requires approval answers with a `pending_approval` booking.
@@ -18211,8 +18106,26 @@ The environment's event types, newest first.
```go -request := &scheduling.ListEventTypesRequest{} -client.Scheduling.EventTypes.List( +request := &scheduling.CreateBookingRequest{ + IdempotencyKey: coss.String( + "welcome-user-123", + ), + EventType: "evtype_01kd2m9a0b1c2d3e4f5g6h7j8m", + Start: "2027-01-04T15:00:00.000Z", + Attendee: &coss.SchedulingAttendeeInput{ + UID: coss.String( + "patient_77", + ), + Name: coss.String( + "Sam Lee", + ), + Email: coss.String( + "sam@example.com", + ), + TimeZone: "UTC", + }, +} +client.Scheduling.Bookings.Create( context.TODO(), request, ) @@ -18230,7 +18143,7 @@ client.Scheduling.EventTypes.List(
-**limit:** `*int` +**idempotencyKey:** `*string` — Makes retries safe: a repeated request with the same key and body returns the original booking instead of creating another, for 24 hours. A refused request keeps no key. 1-256 characters.
@@ -18238,80 +18151,55 @@ client.Scheduling.EventTypes.List(
-**after:** `*string` — The last id of the previous page. +**eventType:** `string` — The event type's id or uid.
-
-
+
+
+**start:** `string` — An ISO 8601 instant with an offset. +
-
-
client.Scheduling.EventTypes.Create(request) -> *coss.SchedulingEventType
-#### 📝 Description +**host:** `*string` — A specific host (id or uid). Default: chosen fairly from those free. + +
+
+**attributes:** `map[string]*scheduling.CreateBookingRequestAttributesValue` — Only choose among pool hosts matching all of these. + +
+
+
-What can be booked: `one_on_one` with one host, `pool` for any free host, `collective` when every required host must be free, or `group` for a session with seats. -
-
+**durationMinutes:** `*int` — One of the event type's `duration_options`. + -#### 🔌 Usage -
+**attendee:** `*coss.SchedulingAttendeeInput` + +
+
+
-```go -request := &scheduling.CreateEventTypeRequest{ - Kind: scheduling.CreateEventTypeRequestKindOneOnOne.Ptr(), - Title: "Initial consultation", - DurationMinutes: 30, - BufferAfterMinutes: coss.Int( - 10, - ), - MinNoticeMinutes: coss.Int( - 120, - ), - Hosts: []*coss.SchedulingEventTypeHostInput{ - &coss.SchedulingEventTypeHostInput{ - Host: "doctor_482", - }, - }, -} -client.Scheduling.EventTypes.Create( - context.TODO(), - request, -) -``` -
-
- - - -#### ⚙️ Parameters - -
-
- -
-
- -**uid:** `*string` — Your own id for this event type, unique in the environment, accepted wherever its id is. +**guests:** `[]*coss.SchedulingGuestInput` — Up to the event type's `max_guests`.
@@ -18319,7 +18207,7 @@ client.Scheduling.EventTypes.Create(
-**kind:** `*scheduling.CreateEventTypeRequestKind` — Who a booking needs. `one_on_one`: one host. `pool`: any one of its hosts. `collective`: every `required` host, plus at most one `member`. `group`: one host, with attendees taking seats up to `capacity`. Fixed once created. +**answers:** `map[string]*scheduling.CreateBookingRequestAnswersValue` — Answers to the event type's questions. Stored encrypted, and returned only by retrieving the booking.
@@ -18327,7 +18215,7 @@ client.Scheduling.EventTypes.Create(
-**description:** `*string` — Plain text about the event type, shown on hosted booking pages and never in emails. Links, and anything shaped like a domain, must be on your organization's verified domains or their subdomains, and use `https`. `null` removes it. +**location:** `*scheduling.CreateBookingRequestLocation` — One of the event type's `locations`, with your link filled in if it has none.
@@ -18335,191 +18223,128 @@ client.Scheduling.EventTypes.Create(
-**title:** `string` — Shown to attendees and in emails. Host calendars show it only with `host_calendar_details: full`. +**metadata:** `map[string]string` — Your own key-value pairs. Don't put sensitive data here.
- -
-
- -**durationMinutes:** `int` — How long a booking lasts by default, in minutes. -
-
-
-**durationOptions:** `[]int` — Other lengths an attendee may choose, in minutes. Empty: only `duration_minutes`. -
+
+
client.Scheduling.Bookings.Get(ID) -> *coss.SchedulingBooking
-**stepMinutes:** `*int` — How far apart slots start. Default: the duration. - -
-
+#### 📝 Description
-**gridTimeZone:** `*string` — The zone slots align in. Default: each host's own. - -
-
-
-**bufferBeforeMinutes:** `*int` — Minutes kept free before each booking. Default: 0. - +A booking with its attendees and their answers.
- -
-
- -**bufferAfterMinutes:** `*int` — Minutes kept free after each booking. Default: 0. -
-
-
- -**minNoticeMinutes:** `*int` — Slots starting sooner than this many minutes from now aren't offered. Default: 0. - -
-
+#### 🔌 Usage
-**bookingWindow:** `*coss.SchedulingBookingWindow` - -
-
-
-**limits:** `[]*coss.SchedulingLimit` — Caps on bookings per day or week. Default: none. - +```go +request := &scheduling.GetBookingsRequest{ + ID: "book_01kd2m9a0b1c2d3e4f5g6h7j8m", +} +client.Scheduling.Bookings.Get( + context.TODO(), + request, +) +```
- -
-
- -**capacity:** `*int` — Attendees per session. Required for, and only allowed on, `group`. -
+#### ⚙️ Parameters +
-**requiresApproval:** `*bool` — Bookings start as `pending_approval`, holding the time until approved or declined. Default: `false`. - -
-
-
-**approvalTTLMinutes:** `*int` — How long a booking can wait for approval before it's declined, in minutes. Default: 1440. +**id:** `string` — The booking's id.
- -
-
- -**holdTTLSeconds:** `*int` — How long a hold keeps its slot, in seconds. Default: 600. -
-
-
-**cancelNoticeMinutes:** `*int` — Attendees can't cancel closer to the start than this. API keys can. -
+
+
client.Scheduling.Bookings.Reschedule(ID, request) -> *coss.SchedulingBooking
-**rescheduleNoticeMinutes:** `*int` — Attendees can't reschedule closer to the start than this. API keys can. Default: 0. - -
-
+#### 📝 Description
-**maxGuests:** `*int` — How many people an attendee can add to a booking. Default: 0. Guests are emailed about it. Not on `group`. - -
-
-
-**maxActiveBookingsPerAttendee:** `*int` — How many upcoming bookings of this event type one person can have at a time, known by `uid` or email. Default: `null`, no limit. Past this, booking answers `attendee_limit_reached`. Guests don't count, and each occurrence of a series does. - +Moves it to a new time, keeping its id. The old time stays booked if the new one isn't free.
- -
-
- -**hostCalendarDetails:** `*scheduling.CreateEventTypeRequestHostCalendarDetails` — What hosts' calendars say about a booking. `neutral` (the default): a private event titled "Appointment". `full`: a private event with this title and the attendee's name, plus names, emails and phone numbers in its description, which go to the host's calendar provider. Never answers. Refused in HIPAA mode. -
+#### 🔌 Usage +
-**questions:** `[]*coss.SchedulingQuestion` — What attendees are asked when booking. Keys must be unique. - -
-
-
-**locations:** `[]*coss.SchedulingLocation` — Where bookings can meet. A browser only chooses among these. A `group` event type can't use `zoom`. - +```go +request := &scheduling.RescheduleBookingRequest{ + ID: "book_01kd2m9a0b1c2d3e4f5g6h7j8m", + Start: "2027-01-05T15:00:00.000Z", +} +client.Scheduling.Bookings.Reschedule( + context.TODO(), + request, +) +```
- -
-
- -**hostFilter:** `map[string]*scheduling.CreateEventTypeRequestHostFilterValue` — Pool members also include active hosts matching all of these attributes. -
+#### ⚙️ Parameters +
-**notifications:** `map[string]*scheduling.CreateEventTypeRequestNotificationsValue` — Per event, overriding your settings for this event type. - -
-
-
-**reminders:** `[]*coss.SchedulingReminderInput` — Replaces your settings' `reminders` for this event type. `null` inherits them; an empty list means none. +**id:** `string` — The booking's id.
@@ -18527,7 +18352,7 @@ client.Scheduling.EventTypes.Create(
-**metadata:** `map[string]string` — Your own key-value pairs. +**start:** `string` — The new start. The old time stays booked unless this one's free.
@@ -18535,7 +18360,7 @@ client.Scheduling.EventTypes.Create(
-**hosts:** `[]*coss.SchedulingEventTypeHostInput` — Who can be booked. `one_on_one` and `group` take one; `collective` needs at least one `required` host. +**host:** `*string` — Move a pool booking to this host. Default: its current hosts.
@@ -18547,7 +18372,7 @@ client.Scheduling.EventTypes.Create(
-
client.Scheduling.EventTypes.Get(EventType) -> *coss.SchedulingEventType +
client.Scheduling.Bookings.Cancel(ID, request) -> *coss.SchedulingBooking
@@ -18559,7 +18384,7 @@ client.Scheduling.EventTypes.Create(
-An event type by its id or your uid. +Frees the time and removes the calendar event. A cancelled booking stays charged.
@@ -18574,10 +18399,13 @@ An event type by its id or your uid.
```go -request := &scheduling.GetEventTypesRequest{ - EventType: "evtype_01kd2m9a0b1c2d3e4f5g6h7j8m", +request := &scheduling.CancelSchedulingBookingRequest{ + ID: "book_01kd2m9a0b1c2d3e4f5g6h7j8m", + Reason: coss.String( + "Feeling better", + ), } -client.Scheduling.EventTypes.Get( +client.Scheduling.Bookings.Cancel( context.TODO(), request, ) @@ -18595,7 +18423,15 @@ client.Scheduling.EventTypes.Get(
-**eventType:** `string` — The event type's id or uid. +**id:** `string` — The booking's id. + +
+
+ +
+
+ +**reason:** `*string` — Why it's being cancelled. Only retrieving this booking returns it: it's never in webhooks, logs or emails.
@@ -18607,7 +18443,7 @@ client.Scheduling.EventTypes.Get(
-
client.Scheduling.EventTypes.Update(EventType, request) -> *coss.SchedulingEventType +
client.Scheduling.Bookings.Events(ID) -> *coss.SchedulingBookingEventList
@@ -18619,7 +18455,7 @@ client.Scheduling.EventTypes.Get(
-Changes what's given. Existing bookings keep what they were booked with. Set `status` to `archived` to stop new bookings. +What's happened to a booking, oldest first, and who did it. There's no personal data in here.
@@ -18634,13 +18470,10 @@ Changes what's given. Existing bookings keep what they were booked with. Set `st
```go -request := &scheduling.UpdateEventTypeRequest{ - EventType: "evtype_01kd2m9a0b1c2d3e4f5g6h7j8m", - MinNoticeMinutes: coss.Int( - 240, - ), +request := &scheduling.EventsBookingsRequest{ + ID: "book_01kd2m9a0b1c2d3e4f5g6h7j8m", } -client.Scheduling.EventTypes.Update( +client.Scheduling.Bookings.Events( context.TODO(), request, ) @@ -18658,7 +18491,7 @@ client.Scheduling.EventTypes.Update(
-**eventType:** `string` — The event type's id or uid. +**id:** `string` — The booking's id.
@@ -18666,7 +18499,7 @@ client.Scheduling.EventTypes.Update(
-**uid:** `*string` — Your own id for this event type. `null` removes it. +**limit:** `*int`
@@ -18674,119 +18507,2726 @@ client.Scheduling.EventTypes.Update(
-**description:** `*string` — Plain text about the event type, shown on hosted booking pages and never in emails. Links, and anything shaped like a domain, must be on your organization's verified domains or their subdomains, and use `https`. `null` removes it. +**after:** `*string` — The last id of the previous page.
+
+
-
-
-**title:** `*string` — Shown to attendees and in emails. Host calendars show it only with `host_calendar_details: full`. -
+
+
client.Scheduling.Bookings.Approve(ID) -> *coss.SchedulingBooking
-**durationMinutes:** `*int` — How long a booking lasts by default, in minutes. - -
-
+#### 📝 Description
-**durationOptions:** `[]int` — Other lengths an attendee may choose, in minutes. Empty: only `duration_minutes`. - -
-
-
-**stepMinutes:** `*int` — How far apart slots start. Default: the duration. - +Confirms a `pending_approval` booking. +
+
+#### 🔌 Usage +
-**gridTimeZone:** `*string` — The zone slots align in. Default: each host's own. - -
-
-
-**bufferBeforeMinutes:** `*int` — Minutes kept free before each booking. Default: 0. - +```go +request := &scheduling.ApproveBookingsRequest{ + ID: "book_01kd2m9a0b1c2d3e4f5g6h7j8m", +} +client.Scheduling.Bookings.Approve( + context.TODO(), + request, +) +``` +
+
+ + + +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `string` — The booking's id. + +
+
+
+
+ + + + +
+ +
client.Scheduling.Bookings.Decline(ID) -> *coss.SchedulingBooking +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Refuses a `pending_approval` booking and frees the time. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &scheduling.DeclineBookingsRequest{ + ID: "book_01kd2m9a0b1c2d3e4f5g6h7j8m", +} +client.Scheduling.Bookings.Decline( + context.TODO(), + request, +) +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `string` — The booking's id. + +
+
+
+
+ + +
+
+
+ +
client.Scheduling.Bookings.Notifications(ID) -> *coss.SchedulingBookingNotificationList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +What's been queued for this booking and what became of it, newest first, including why something wasn't sent. It never says who it went to. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &scheduling.NotificationsBookingsRequest{ + ID: "book_01kd2m9a0b1c2d3e4f5g6h7j8m", +} +client.Scheduling.Bookings.Notifications( + context.TODO(), + request, +) +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `string` — The booking's id. + +
+
+ +
+
+ +**limit:** `*int` + +
+
+ +
+
+ +**after:** `*string` — The last id of the previous page. + +
+
+
+
+ + +
+
+
+ +
client.Scheduling.Bookings.MarkNoShow(ID) -> *coss.SchedulingBooking +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Records that the attendee didn't come, once the booking has started. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &scheduling.MarkNoShowBookingsRequest{ + ID: "book_01kd2m9a0b1c2d3e4f5g6h7j8m", +} +client.Scheduling.Bookings.MarkNoShow( + context.TODO(), + request, +) +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `string` — The booking's id. + +
+
+
+
+ + +
+
+
+ +
client.Scheduling.Bookings.UpdateLocation(ID, request) -> *coss.SchedulingBooking +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Where it happens, such as the meeting link you made after the `scheduling.booking.confirmed` webhook. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &scheduling.UpdateBookingLocationRequest{ + ID: "book_01kd2m9a0b1c2d3e4f5g6h7j8m", + Location: &coss.SchedulingLocation{ + SchedulingLocationZero: &coss.SchedulingLocationZero{ + Type: coss.SchedulingLocationZeroTypeLink, + URL: coss.String( + "https://meet.example.com/abc", + ), + }, + }, +} +client.Scheduling.Bookings.UpdateLocation( + context.TODO(), + request, +) +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `string` — The booking's id. + +
+
+ +
+
+ +**location:** `*coss.SchedulingLocation` + +
+
+
+
+ + +
+
+
+ +## Scheduling Reassignments +
client.Scheduling.Reassignments.Preview(request) -> *coss.SchedulingReassignmentPreview +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Who each booking would go to, and why not when nobody can take it, without moving anything. It works down them in order, so two can't both be promised the same free hour. Change any of it and start the run with `assignments`. Covers the first 500. Things can change before you start it: the run decides again. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &scheduling.PreviewSchedulingReassignmentRequest{ + Selection: &coss.SchedulingReassignmentSelection{ + Host: coss.String( + "doctor_482", + ), + StartBefore: coss.String( + "2027-08-14T00:00:00.000Z", + ), + }, + Strategy: &coss.SchedulingReassignmentStrategy{ + PreferredHosts: []string{ + "doctor_518", + }, + }, +} +client.Scheduling.Reassignments.Preview( + context.TODO(), + request, +) +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**selection:** `*coss.SchedulingReassignmentSelection` + +
+
+ +
+
+ +**strategy:** `*coss.SchedulingReassignmentStrategy` + +
+
+ +
+
+ +**overrides:** `[]scheduling.PreviewSchedulingReassignmentRequestOverridesItem` + +
+
+
+
+ + +
+
+
+ +
client.Scheduling.Reassignments.List() -> *coss.SchedulingReassignmentList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Newest first, with how each is going. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &scheduling.ListReassignmentsRequest{} +client.Scheduling.Reassignments.List( + context.TODO(), + request, +) +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**limit:** `*int` + +
+
+ +
+
+ +**after:** `*string` — The last id of the previous page. + +
+
+
+
+ + +
+
+
+ +
client.Scheduling.Reassignments.Create(request) -> *coss.SchedulingReassignment +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Moves up to 5,000 bookings in the background, each on its own, so one that can't move never holds up the rest. Nothing's ever cancelled: a booking nobody can take stays where it is, and its item says so. It answers at once: follow the run by its id, or wait for `scheduling.reassignment.completed`. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &scheduling.CreateSchedulingReassignmentRequest{ + IdempotencyKey: coss.String( + "welcome-user-123", + ), + Selection: &coss.SchedulingReassignmentSelection{ + OutOfOffice: coss.String( + "ooo_01kd2m9a0b1c2d3e4f5g6h7j8m", + ), + }, + Strategy: &coss.SchedulingReassignmentStrategy{ + PreferredHosts: []string{ + "doctor_518", + }, + }, + ReasonCode: scheduling.CreateSchedulingReassignmentRequestReasonCodeOutOfOffice, +} +client.Scheduling.Reassignments.Create( + context.TODO(), + request, +) +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**idempotencyKey:** `*string` — Makes retries safe: a repeated request with the same key and body returns the original run instead of starting another, for 24 hours. 1-256 characters. + +
+
+ +
+
+ +**selection:** `*coss.SchedulingReassignmentSelection` + +
+
+ +
+
+ +**strategy:** `*coss.SchedulingReassignmentStrategy` + +
+
+ +
+
+ +**reasonCode:** `scheduling.CreateSchedulingReassignmentRequestReasonCode` + +
+
+ +
+
+ +**note:** `*string` — Why, in your words: required with an override of someone's availability. + +
+
+ +
+
+ +**overrides:** `[]scheduling.CreateSchedulingReassignmentRequestOverridesItem` + +
+
+ +
+
+ +**notify:** `*scheduling.CreateSchedulingReassignmentRequestNotify` + +
+
+
+
+ + +
+
+
+ +
client.Scheduling.Reassignments.Get(ID) -> *coss.SchedulingReassignment +
+
+ +#### 📝 Description + +
+
+ +
+
+ +How it's going. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &scheduling.GetReassignmentsRequest{ + ID: "id", +} +client.Scheduling.Reassignments.Get( + context.TODO(), + request, +) +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `string` — The reassignment's id. + +
+
+
+
+ + +
+
+
+ +
client.Scheduling.Reassignments.Items(ID) -> *coss.SchedulingReassignmentItemList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Each booking it covers and what happened to it. A group session has one, for one of its seats. Empty until the worker's started on it. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &scheduling.ItemsReassignmentsRequest{ + ID: "id", +} +client.Scheduling.Reassignments.Items( + context.TODO(), + request, +) +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `string` — The reassignment's id. + +
+
+ +
+
+ +**limit:** `*int` + +
+
+ +
+
+ +**after:** `*string` — The last id of the previous page. + +
+
+
+
+ + +
+
+
+ +
client.Scheduling.Reassignments.Cancel(ID) -> *coss.SchedulingReassignment +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Stops what hasn't happened yet. What's moved stays moved: undo it for that. Cancelling one that's finished changes nothing. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &scheduling.CancelReassignmentsRequest{ + ID: "id", +} +client.Scheduling.Reassignments.Cancel( + context.TODO(), + request, +) +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `string` — The reassignment's id. + +
+
+
+
+ + +
+
+
+ +
client.Scheduling.Reassignments.Undo(ID, request) -> *coss.SchedulingReassignment +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Gives back what a finished run moved, as a new run. A booking that's moved on since stays where it went, and a former host who's no longer free keeps it from going back, unless you pass `overrides`. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &scheduling.UndoSchedulingReassignmentRequest{ + ID: "id", + ReasonCode: scheduling.UndoSchedulingReassignmentRequestReasonCodeOther.Ptr(), +} +client.Scheduling.Reassignments.Undo( + context.TODO(), + request, +) +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `string` — The reassignment's id. + +
+
+ +
+
+ +**reasonCode:** `*scheduling.UndoSchedulingReassignmentRequestReasonCode` + +
+
+ +
+
+ +**note:** `*string` + +
+
+ +
+
+ +**overrides:** `[]scheduling.UndoSchedulingReassignmentRequestOverridesItem` + +
+
+ +
+
+ +**notify:** `*scheduling.UndoSchedulingReassignmentRequestNotify` + +
+
+
+
+ + +
+
+
+ +## Scheduling HolidayCalendars +
client.Scheduling.HolidayCalendars.List() -> *coss.SchedulingHolidayCalendarList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +By name. A feed's URL is never shown again. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +client.Scheduling.HolidayCalendars.List( + context.TODO(), +) +``` +
+
+
+
+ + +
+
+
+ +
client.Scheduling.HolidayCalendars.Create(request) -> *coss.SchedulingHolidayCalendar +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Applies a country's public holidays, or your own feed, to some hosts as ordinary out of office entries, kept up to date by coss.com. A host who removes one keeps it removed. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &scheduling.CreateSchedulingHolidayCalendarRequest{ + Name: "UK team", + Country: coss.String( + "GB", + ), + HostFilter: map[string]*scheduling.CreateSchedulingHolidayCalendarRequestHostFilterValue{ + "team": &scheduling.CreateSchedulingHolidayCalendarRequestHostFilterValue{ + String: "london", + }, + }, +} +client.Scheduling.HolidayCalendars.Create( + context.TODO(), + request, +) +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**name:** `string` + +
+
+ +
+
+ +**country:** `*string` — A code from the list of holiday calendars, such as `GB`. + +
+
+ +
+
+ +**icsURL:** `*string` — Your own feed, https or webcal, read in live environments. Stored encrypted. + +
+
+ +
+
+ +**hosts:** `[]string` — These hosts, by id or uid. + +
+
+ +
+
+ +**hostFilter:** `map[string]*scheduling.CreateSchedulingHolidayCalendarRequestHostFilterValue` — Everyone matching these attributes, asked again at every sync. + +
+
+ +
+
+ +**regions:** `[]string` — Which regional holidays apply, matched against how the calendar names them, such as `England`. Without this, all of them do; empty, only nationwide ones. + +
+
+ +
+
+ +**delegates:** `[]string` — Who can be booked in their place on those days, by id or uid, in order. + +
+
+ +
+
+ +**existingBookings:** `*scheduling.CreateSchedulingHolidayCalendarRequestExistingBookings` — What happens to bookings already on a holiday. `leave` (the default) only reports them. `reassign` moves them. + +
+
+
+
+ + +
+
+
+ +
client.Scheduling.HolidayCalendars.Get(ID) -> *coss.SchedulingHolidayCalendar +
+
+ +#### 📝 Description + +
+
+ +
+
+ +With when it was last read, and why not if it couldn't be. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &scheduling.GetHolidayCalendarsRequest{ + ID: "id", +} +client.Scheduling.HolidayCalendars.Get( + context.TODO(), + request, +) +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `string` — The holiday calendar's id. + +
+
+
+
+ + +
+
+
+ +
client.Scheduling.HolidayCalendars.Remove(ID) -> *coss.DeletedSchedulingHolidayCalendar +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Hosts can be booked on its days again, shortly: past entries stay. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &scheduling.RemoveHolidayCalendarsRequest{ + ID: "id", +} +client.Scheduling.HolidayCalendars.Remove( + context.TODO(), + request, +) +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `string` — The holiday calendar's id. + +
+
+
+
+ + +
+
+
+ +
client.Scheduling.HolidayCalendars.Update(ID, request) -> *coss.SchedulingHolidayCalendar +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Who it applies to, who covers and what happens to bookings. Takes effect shortly. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &scheduling.UpdateSchedulingHolidayCalendarRequest{ + ID: "id", + HostFilter: map[string]*scheduling.UpdateSchedulingHolidayCalendarRequestHostFilterValue{ + "team": &scheduling.UpdateSchedulingHolidayCalendarRequestHostFilterValue{ + String: "london", + }, + }, +} +client.Scheduling.HolidayCalendars.Update( + context.TODO(), + request, +) +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `string` — The holiday calendar's id. + +
+
+ +
+
+ +**name:** `*string` + +
+
+ +
+
+ +**hosts:** `[]string` — These hosts, by id or uid. + +
+
+ +
+
+ +**hostFilter:** `map[string]*scheduling.UpdateSchedulingHolidayCalendarRequestHostFilterValue` — Everyone matching these attributes, asked again at every sync. + +
+
+ +
+
+ +**regions:** `[]string` — Which regional holidays apply, matched against how the calendar names them, such as `England`. Without this, all of them do; empty, only nationwide ones. + +
+
+ +
+
+ +**delegates:** `[]string` — Who can be booked in their place on those days, by id or uid, in order. + +
+
+ +
+
+ +**existingBookings:** `*scheduling.UpdateSchedulingHolidayCalendarRequestExistingBookings` — What happens to bookings already on a holiday. `leave` (the default) only reports them. `reassign` moves them. + +
+
+
+
+ + +
+
+
+ +
client.Scheduling.HolidayCalendars.Holidays(ID) -> *coss.SchedulingHolidayList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +What's coming, with names, as last read. Empty until its first read. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &scheduling.HolidaysHolidayCalendarsRequest{ + ID: "id", +} +client.Scheduling.HolidayCalendars.Holidays( + context.TODO(), + request, +) +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `string` — The holiday calendar's id. + +
+
+
+
+ + +
+
+
+ +## Scheduling OutOfOffice +
client.Scheduling.OutOfOffice.List() -> *coss.SchedulingOutOfOfficeList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +The environment's entries, newest first. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &scheduling.ListOutOfOfficeRequest{ + StartAfter: coss.String( + "2027-01-04T15:00:00.000Z", + ), + StartBefore: coss.String( + "2027-01-04T15:00:00.000Z", + ), +} +client.Scheduling.OutOfOffice.List( + context.TODO(), + request, +) +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**limit:** `*int` + +
+
+ +
+
+ +**after:** `*string` — The last id of the previous page. + +
+
+ +
+
+ +**host:** `*string` — One host's entries, by id or uid. + +
+
+ +
+
+ +**startAfter:** `*string` — Entries ending after this. + +
+
+ +
+
+ +**startBefore:** `*string` — Entries starting before this. + +
+
+ +
+
+ +**group:** `*string` — The entries one request made. + +
+
+
+
+ + +
+
+
+ +
client.Scheduling.OutOfOffice.Create(request) -> *coss.SchedulingOutOfOfficeList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Marks one host, a list of hosts or everyone matching some attributes as away, for part of a day or for whole dates. They aren't offered during it. Existing bookings stay as they are: list them with the entry's conflicts. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &scheduling.CreateSchedulingOutOfOfficeRequest{ + Host: coss.String( + "doctor_482", + ), + StartDate: coss.String( + "2027-08-02", + ), + EndDate: coss.String( + "2027-08-13", + ), + Reason: coss.String( + "vacation", + ), + PublicMessage: coss.String( + "Back on the 16th.", + ), +} +client.Scheduling.OutOfOffice.Create( + context.TODO(), + request, +) +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**host:** `*string` — One host, by id or uid. + +
+
+ +
+
+ +**hosts:** `[]string` — Several hosts, by id or uid. Each gets an entry of their own. + +
+
+ +
+
+ +**hostFilter:** `map[string]*scheduling.CreateSchedulingOutOfOfficeRequestHostFilterValue` — Every active host matching these attributes right now. A host added later isn't covered. + +
+
+ +
+
+ +**start:** `*string` — An ISO 8601 instant with an offset. + +
+
+ +
+
+ +**end:** `*string` — An ISO 8601 instant with an offset. + +
+
+ +
+
+ +**startDate:** `*string` — The first whole day away. Use instead of `start` and `end`. + +
+
+ +
+
+ +**endDate:** `*string` — The last whole day away, which is included. + +
+
+ +
+
+ +**timeZone:** `*string` — What the dates mean in. Default: the host's zone when this is made. + +
+
+ +
+
+ +**delegates:** `[]string` — Who can be booked in this host's place during it, by id or uid, in the order to try them. They still have to fit how a booking's routed. + +
+
+ +
+
+ +**reason:** `*string` — One of `unspecified`, `vacation`, `travel`, `sick`, `public_holiday`, `parental_leave`, `training` and `other`, or a key from the settings' `out_of_office_reasons`. Only people who manage this host see it: never bookers, webhooks or calendars. + +
+
+ +
+
+ +**notes:** `*string` — For people who manage this host. Encrypted, and never shown to a booker. + +
+
+ +
+
+ +**publicMessage:** `*string` — Shown to bookers while this host is away. Can't contain a link. + +
+
+ +
+
+ +**showOnCalendar:** `*bool` — Put a private "Out of office" event on the host's calendar. Default: true. + +
+
+ +
+
+ +**existingBookings:** `*scheduling.CreateSchedulingOutOfOfficeRequestExistingBookings` — What happens to bookings already in the way. `leave` (the default) only reports them. `reassign` moves them, and any nobody can take stay where they are. + +
+
+ +
+
+ +**reassign:** `*scheduling.CreateSchedulingOutOfOfficeRequestReassign` — With `existing_bookings: reassign`: who they go to. Default: the fairest who's free. + +
+
+ +
+
+ +**externalID:** `*string` — Your own id for this entry, unique in the environment. Needs one host. + +
+
+
+
+ + +
+
+
+ +
client.Scheduling.OutOfOffice.Get(ID) -> *coss.SchedulingOutOfOffice +
+
+ +#### 📝 Description + +
+
+ +
+
+ +One entry. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &scheduling.GetOutOfOfficeRequest{ + ID: "ooo_01kd2m9a0b1c2d3e4f5g6h7j8m", +} +client.Scheduling.OutOfOffice.Get( + context.TODO(), + request, +) +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `string` — The entry's id. + +
+
+
+
+ + +
+
+
+ +
client.Scheduling.OutOfOffice.Remove(ID) -> *coss.DeletedSchedulingOutOfOffice +
+
+ +#### 📝 Description + +
+
+ +
+
+ +The host can be booked in that time again, and any calendar event for it goes. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &scheduling.RemoveOutOfOfficeRequest{ + ID: "ooo_01kd2m9a0b1c2d3e4f5g6h7j8m", +} +client.Scheduling.OutOfOffice.Remove( + context.TODO(), + request, +) +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `string` — The entry's id. + +
+
+
+
+ + +
+
+
+ +
client.Scheduling.OutOfOffice.Update(ID, request) -> *coss.SchedulingOutOfOffice +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Changes what's given. An entry stays with its host. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &scheduling.UpdateSchedulingOutOfOfficeRequest{ + ID: "ooo_01kd2m9a0b1c2d3e4f5g6h7j8m", + EndDate: coss.String( + "2027-08-20", + ), +} +client.Scheduling.OutOfOffice.Update( + context.TODO(), + request, +) +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `string` — The entry's id. + +
+
+ +
+
+ +**start:** `*string` — An ISO 8601 instant with an offset. + +
+
+ +
+
+ +**end:** `*string` — An ISO 8601 instant with an offset. + +
+
+ +
+
+ +**startDate:** `*string` — The first whole day away. Use instead of `start` and `end`. + +
+
+ +
+
+ +**endDate:** `*string` — The last whole day away, which is included. + +
+
+ +
+
+ +**timeZone:** `*string` — What the dates mean in. Default: the host's zone when this is made. + +
+
+ +
+
+ +**reason:** `*string` — One of `unspecified`, `vacation`, `travel`, `sick`, `public_holiday`, `parental_leave`, `training` and `other`, or a key from the settings' `out_of_office_reasons`. Only people who manage this host see it: never bookers, webhooks or calendars. + +
+
+ +
+
+ +**notes:** `*string` + +
+
+ +
+
+ +**publicMessage:** `*string` + +
+
+ +
+
+ +**showOnCalendar:** `*bool` + +
+
+ +
+
+ +**delegates:** `[]string` — Who can be booked in this host's place during it, by id or uid, in the order to try them. They still have to fit how a booking's routed. + +
+
+ +
+
+ +**existingBookings:** `*scheduling.UpdateSchedulingOutOfOfficeRequestExistingBookings` — What happens to bookings already in the way. `leave` (the default) only reports them. `reassign` moves them, and any nobody can take stay where they are. + +
+
+ +
+
+ +**reassign:** `*scheduling.UpdateSchedulingOutOfOfficeRequestReassign` — With `existing_bookings: reassign`: who they go to. Default: the fairest who's free. + +
+
+
+
+ + +
+
+
+ +
client.Scheduling.OutOfOffice.Put(ExternalID, request) -> *coss.SchedulingOutOfOffice +
+
+ +#### 📝 Description + +
+
+ +
+
+ +For syncing from a system of record such as an HR tool: send what it says, as often as you like, and there's one entry for it. Give every field you want to keep. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &scheduling.PutSchedulingOutOfOfficeRequest{ + ExternalID: "hr_leave_4471", + Host: "doctor_482", + StartDate: coss.String( + "2027-08-02", + ), + EndDate: coss.String( + "2027-08-13", + ), + Reason: coss.String( + "vacation", + ), +} +client.Scheduling.OutOfOffice.Put( + context.TODO(), + request, +) +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**externalID:** `string` — Your own id for the entry. + +
+
+ +
+
+ +**host:** `string` — The host, by id or uid. + +
+
+ +
+
+ +**start:** `*string` — An ISO 8601 instant with an offset. + +
+
+ +
+
+ +**end:** `*string` — An ISO 8601 instant with an offset. + +
+
+ +
+
+ +**startDate:** `*string` — The first whole day away. Use instead of `start` and `end`. + +
+
+ +
+
+ +**endDate:** `*string` — The last whole day away, which is included. + +
+
+ +
+
+ +**timeZone:** `*string` — What the dates mean in. Default: the host's zone when this is made. + +
+
+ +
+
+ +**delegates:** `[]string` — Who can be booked in this host's place during it, by id or uid, in the order to try them. They still have to fit how a booking's routed. + +
+
+ +
+
+ +**reason:** `*string` — One of `unspecified`, `vacation`, `travel`, `sick`, `public_holiday`, `parental_leave`, `training` and `other`, or a key from the settings' `out_of_office_reasons`. Only people who manage this host see it: never bookers, webhooks or calendars. + +
+
+ +
+
+ +**notes:** `*string` — For people who manage this host. Encrypted, and never shown to a booker. + +
+
+ +
+
+ +**publicMessage:** `*string` — Shown to bookers while this host is away. Can't contain a link. + +
+
+ +
+
+ +**showOnCalendar:** `*bool` — Put a private "Out of office" event on the host's calendar. Default: true. + +
+
+ +
+
+ +**existingBookings:** `*scheduling.PutSchedulingOutOfOfficeRequestExistingBookings` — What happens to bookings already in the way. `leave` (the default) only reports them. `reassign` moves them, and any nobody can take stay where they are. + +
+
+ +
+
+ +**reassign:** `*scheduling.PutSchedulingOutOfOfficeRequestReassign` — With `existing_bookings: reassign`: who they go to. Default: the fairest who's free. + +
+
+
+
+ + +
+
+
+ +
client.Scheduling.OutOfOffice.Conflicts(ID) -> *coss.SchedulingOutOfOfficeConflictList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Live bookings of the host that fall in the entry, soonest first. Entries never change them. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &scheduling.ConflictsOutOfOfficeRequest{ + ID: "ooo_01kd2m9a0b1c2d3e4f5g6h7j8m", +} +client.Scheduling.OutOfOffice.Conflicts( + context.TODO(), + request, +) +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `string` — The entry's id. + +
+
+ +
+
+ +**limit:** `*int` + +
+
+
+
+ + +
+
+
+ +## Scheduling Schedules +
client.Scheduling.Schedules.List(Host) -> *coss.SchedulingScheduleList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +All of the host's schedules, oldest first. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &scheduling.ListSchedulesRequest{ + Host: "host_01kd2m9a0b1c2d3e4f5g6h7j8m", +} +client.Scheduling.Schedules.List( + context.TODO(), + request, +) +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**host:** `string` — The host's id or uid. + +
+
+
+
+ + +
+
+
+ +
client.Scheduling.Schedules.Create(Host, request) -> *coss.SchedulingSchedule +
+
+ +#### 📝 Description + +
+
+ +
+
+ +A host's weekly hours and date overrides, in local time. The first one is the host's default. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &scheduling.CreateSchedulesRequest{ + Host: "host_01kd2m9a0b1c2d3e4f5g6h7j8m", + Body: &coss.UpsertScheduleRequest{ + Name: coss.String( + "Clinic hours", + ), + Rules: []*coss.SchedulingWeeklyRule{ + &coss.SchedulingWeeklyRule{ + Days: []int{ + 1, + 2, + 3, + 4, + 5, + }, + Start: "09:00", + End: "17:00", + }, + }, + Overrides: []*coss.SchedulingScheduleOverride{ + &coss.SchedulingScheduleOverride{ + Date: "2027-12-24", + Ranges: []*coss.SchedulingScheduleOverrideRangesItem{ + &coss.SchedulingScheduleOverrideRangesItem{ + Start: "start", + End: "end", + }, + }, + }, + }, + }, +} +client.Scheduling.Schedules.Create( + context.TODO(), + request, +) +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**host:** `string` — The host's id or uid. + +
+
+ +
+
+ +**request:** `*coss.UpsertScheduleRequest` + +
+
+
+
+ + +
+
+
+ +
client.Scheduling.Schedules.Get(Host, ScheduleID) -> *coss.SchedulingSchedule +
+
+ +#### 📝 Description + +
+
+ +
+
+ +One of the host's schedules. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &scheduling.GetSchedulesRequest{ + Host: "host_01kd2m9a0b1c2d3e4f5g6h7j8m", + ScheduleID: "sched_01kd2m9a0b1c2d3e4f5g6h7j8m", +} +client.Scheduling.Schedules.Get( + context.TODO(), + request, +) +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**host:** `string` — The host's id or uid. +
-**bufferAfterMinutes:** `*int` — Minutes kept free after each booking. Default: 0. +**scheduleID:** `string` — The schedule's id.
+
+
+ + +
+
+
+
client.Scheduling.Schedules.Update(Host, ScheduleID, request) -> *coss.SchedulingSchedule
-**minNoticeMinutes:** `*int` — Slots starting sooner than this many minutes from now aren't offered. Default: 0. +#### 📝 Description + +
+
+ +
+
+ +Replaces its weekly rules, and its overrides when given. Existing bookings stay: a schedule only decides what's offered next. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &scheduling.UpdateSchedulesRequest{ + Host: "host_01kd2m9a0b1c2d3e4f5g6h7j8m", + ScheduleID: "sched_01kd2m9a0b1c2d3e4f5g6h7j8m", + Body: &coss.UpsertScheduleRequest{ + Name: coss.String( + "Clinic hours", + ), + Rules: []*coss.SchedulingWeeklyRule{ + &coss.SchedulingWeeklyRule{ + Days: []int{ + 1, + 2, + 3, + 4, + 5, + }, + Start: "09:00", + End: "17:00", + }, + }, + Overrides: []*coss.SchedulingScheduleOverride{ + &coss.SchedulingScheduleOverride{ + Date: "2027-12-24", + Ranges: []*coss.SchedulingScheduleOverrideRangesItem{ + &coss.SchedulingScheduleOverrideRangesItem{ + Start: "start", + End: "end", + }, + }, + }, + }, + }, +} +client.Scheduling.Schedules.Update( + context.TODO(), + request, +) +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**host:** `string` — The host's id or uid. + +
+
+ +
+
+ +**scheduleID:** `string` — The schedule's id. + +
+
+ +
+
+ +**request:** `*coss.UpsertScheduleRequest` + +
+
+
+
+ + +
+
+
+ +
client.Scheduling.Schedules.Remove(Host, ScheduleID) -> *coss.DeletedSchedulingSchedule +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Refused for the host's default schedule. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &scheduling.RemoveSchedulesRequest{ + Host: "host_01kd2m9a0b1c2d3e4f5g6h7j8m", + ScheduleID: "sched_01kd2m9a0b1c2d3e4f5g6h7j8m", +} +client.Scheduling.Schedules.Remove( + context.TODO(), + request, +) +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**host:** `string` — The host's id or uid. + +
+
+ +
+
+ +**scheduleID:** `string` — The schedule's id. + +
+
+
+
+ + +
+
+
+ +## Scheduling EventTypes +
client.Scheduling.EventTypes.List() -> *coss.SchedulingEventTypeList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +The environment's event types, newest first. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &scheduling.ListEventTypesRequest{} +client.Scheduling.EventTypes.List( + context.TODO(), + request, +) +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**limit:** `*int` + +
+
+ +
+
+ +**after:** `*string` — The last id of the previous page.
+
+
+ + +
+
+
+ +
client.Scheduling.EventTypes.Create(request) -> *coss.SchedulingEventType +
+
+ +#### 📝 Description
-**bookingWindow:** `*coss.SchedulingBookingWindow` - -
-
-
-**limits:** `[]*coss.SchedulingLimit` — Caps on bookings per day or week. Default: none. - +What can be booked: `one_on_one` with one host, `pool` for any free host, `collective` when every required host must be free, or `group` for a session with seats.
+
+
+ +#### 🔌 Usage
-**capacity:** `*int` — Attendees per session. Required for, and only allowed on, `group`. - -
-
-
-**requiresApproval:** `*bool` — Bookings start as `pending_approval`, holding the time until approved or declined. Default: `false`. - +```go +request := &scheduling.CreateEventTypeRequest{ + Kind: scheduling.CreateEventTypeRequestKindOneOnOne.Ptr(), + Title: "Initial consultation", + DurationMinutes: 30, + BufferAfterMinutes: coss.Int( + 10, + ), + MinNoticeMinutes: coss.Int( + 120, + ), + Hosts: []*coss.SchedulingEventTypeHostInput{ + &coss.SchedulingEventTypeHostInput{ + Host: "doctor_482", + }, + }, +} +client.Scheduling.EventTypes.Create( + context.TODO(), + request, +) +``` +
+
+#### ⚙️ Parameters +
-**approvalTTLMinutes:** `*int` — How long a booking can wait for approval before it's declined, in minutes. Default: 1440. - -
-
-
-**holdTTLSeconds:** `*int` — How long a hold keeps its slot, in seconds. Default: 600. +**uid:** `*string` — Your own id for this event type, unique in the environment, accepted wherever its id is.
@@ -18794,7 +21234,7 @@ client.Scheduling.EventTypes.Update(
-**cancelNoticeMinutes:** `*int` — Attendees can't cancel closer to the start than this. API keys can. +**kind:** `*scheduling.CreateEventTypeRequestKind` — Who a booking needs. `one_on_one`: one host. `pool`: any one of its hosts. `collective`: every `required` host, plus at most one `member`. `group`: one host, with attendees taking seats up to `capacity`. Fixed once created.
@@ -18802,7 +21242,7 @@ client.Scheduling.EventTypes.Update(
-**rescheduleNoticeMinutes:** `*int` — Attendees can't reschedule closer to the start than this. API keys can. Default: 0. +**description:** `*string` — Plain text about the event type, shown on hosted booking pages and never in emails. Links, and anything shaped like a domain, must be on your organization's verified domains or their subdomains, and use `https`. `null` removes it.
@@ -18810,7 +21250,7 @@ client.Scheduling.EventTypes.Update(
-**maxGuests:** `*int` — How many people an attendee can add to a booking. Default: 0. Guests are emailed about it. Not on `group`. +**title:** `string` — Shown to attendees and in emails. Host calendars show it only with `host_calendar_details: full`.
@@ -18818,7 +21258,7 @@ client.Scheduling.EventTypes.Update(
-**maxActiveBookingsPerAttendee:** `*int` — How many upcoming bookings of this event type one person can have at a time, known by `uid` or email. Default: `null`, no limit. Past this, booking answers `attendee_limit_reached`. Guests don't count, and each occurrence of a series does. +**durationMinutes:** `int` — How long a booking lasts by default, in minutes.
@@ -18826,7 +21266,7 @@ client.Scheduling.EventTypes.Update(
-**hostCalendarDetails:** `*scheduling.UpdateEventTypeRequestHostCalendarDetails` — What hosts' calendars say about a booking. `neutral` (the default): a private event titled "Appointment". `full`: a private event with this title and the attendee's name, plus names, emails and phone numbers in its description, which go to the host's calendar provider. Never answers. Refused in HIPAA mode. +**durationOptions:** `[]int` — Other lengths an attendee may choose, in minutes. Empty: only `duration_minutes`.
@@ -18834,7 +21274,7 @@ client.Scheduling.EventTypes.Update(
-**questions:** `[]*coss.SchedulingQuestion` — What attendees are asked when booking. Keys must be unique. +**stepMinutes:** `*int` — How far apart slots start. Default: the duration.
@@ -18842,7 +21282,7 @@ client.Scheduling.EventTypes.Update(
-**locations:** `[]*coss.SchedulingLocation` — Where bookings can meet. A browser only chooses among these. A `group` event type can't use `zoom`. +**gridTimeZone:** `*string` — The zone slots align in. Default: each host's own.
@@ -18850,7 +21290,7 @@ client.Scheduling.EventTypes.Update(
-**hostFilter:** `map[string]*scheduling.UpdateEventTypeRequestHostFilterValue` — Pool members also include active hosts matching all of these attributes. +**bufferBeforeMinutes:** `*int` — Minutes kept free before each booking. Default: 0.
@@ -18858,7 +21298,7 @@ client.Scheduling.EventTypes.Update(
-**notifications:** `map[string]*scheduling.UpdateEventTypeRequestNotificationsValue` — Per event, overriding your settings for this event type. +**bufferAfterMinutes:** `*int` — Minutes kept free after each booking. Default: 0.
@@ -18866,7 +21306,7 @@ client.Scheduling.EventTypes.Update(
-**reminders:** `[]*coss.SchedulingReminderInput` — Replaces your settings' `reminders` for this event type. `null` inherits them; an empty list means none. +**minNoticeMinutes:** `*int` — Slots starting sooner than this many minutes from now aren't offered. Default: 0.
@@ -18874,7 +21314,7 @@ client.Scheduling.EventTypes.Update(
-**metadata:** `map[string]string` — Your own key-value pairs. +**bookingWindow:** `*coss.SchedulingBookingWindow`
@@ -18882,7 +21322,7 @@ client.Scheduling.EventTypes.Update(
-**status:** `*scheduling.UpdateEventTypeRequestStatus` — `archived` stops new bookings, and keeps existing ones. +**limits:** `[]*coss.SchedulingLimit` — Caps on bookings per day or week. Default: none.
@@ -18890,70 +21330,31 @@ client.Scheduling.EventTypes.Update(
-**hosts:** `[]*coss.SchedulingEventTypeHostInput` — Replaces the assigned hosts. Removed hosts keep their existing bookings. +**capacity:** `*int` — Attendees per session. Required for, and only allowed on, `group`.
- - - - - - -
- -## Scheduling Slots -
client.Scheduling.Slots.List(EventType) -> *coss.SchedulingSlotList -
-
- -#### 📝 Description
-
-
- -Starts an attendee can book between `start` and `end` (at most 62 days), as UTC instants to show in their own time zone. A host whose calendar can't be read isn't offered. -
-
+**requiresApproval:** `*bool` — Bookings start as `pending_approval`, holding the time until approved or declined. Default: `false`. +
-#### 🔌 Usage - -
-
-
-```go -request := &scheduling.ListSlotsRequest{ - EventType: "evtype_01kd2m9a0b1c2d3e4f5g6h7j8m", - Start: "2027-01-04T15:00:00.000Z", - End: "2027-01-04T15:00:00.000Z", -} -client.Scheduling.Slots.List( - context.TODO(), - request, -) -``` -
-
+**reassignmentEnabled:** `*bool` — Whether bookings of this event type can go to another host. Default: true. +
-#### ⚙️ Parameters - -
-
-
-**eventType:** `string` — The event type's id or uid. +**approvalTTLMinutes:** `*int` — How long a booking can wait for approval before it's declined, in minutes. Default: 1440.
@@ -18961,7 +21362,7 @@ client.Scheduling.Slots.List(
-**start:** `string` — An ISO 8601 instant with an offset. +**holdTTLSeconds:** `*int` — How long a hold keeps its slot, in seconds. Default: 600.
@@ -18969,7 +21370,7 @@ client.Scheduling.Slots.List(
-**end:** `string` — An ISO 8601 instant with an offset. +**cancelNoticeMinutes:** `*int` — Attendees can't cancel closer to the start than this. API keys can.
@@ -18977,7 +21378,7 @@ client.Scheduling.Slots.List(
-**host:** `*string` — Only this host's slots (id or uid). +**rescheduleNoticeMinutes:** `*int` — Attendees can't reschedule closer to the start than this. API keys can. Default: 0.
@@ -18985,7 +21386,7 @@ client.Scheduling.Slots.List(
-**durationMinutes:** `*int` +**maxGuests:** `*int` — How many people an attendee can add to a booking. Default: 0. Guests are emailed about it. Not on `group`.
@@ -18993,68 +21394,39 @@ client.Scheduling.Slots.List(
-**attributes:** `*string` — A JSON object narrowing a pool, such as `{"licensed_in":"CA"}`. +**maxActiveBookingsPerAttendee:** `*int` — How many upcoming bookings of this event type one person can have at a time, known by `uid` or email. Default: `null`, no limit. Past this, booking answers `attendee_limit_reached`. Guests don't count, and each occurrence of a series does.
-
-
- - -
-
-
-
client.Scheduling.Slots.Explain(EventType) -> *coss.SchedulingSlotExplanation
-#### 📝 Description - -
-
+**hostCalendarDetails:** `*scheduling.CreateEventTypeRequestHostCalendarDetails` — What hosts' calendars say about a booking. `neutral` (the default): a private event titled "Appointment". `full`: a private event with this title and the attendee's name, plus names, emails and phone numbers in its description, which go to the host's calendar provider. Never answers. Refused in HIPAA mode. + +
+
-Why one start can or can't be booked right now, host by host, decided the same way a booking is. For support and debugging: it says when a host is busy, so don't show it to attendees. -
-
+**questions:** `[]*coss.SchedulingQuestion` — What attendees are asked when booking. Keys must be unique. +
-#### 🔌 Usage - -
-
-
-```go -request := &scheduling.ExplainSlotsRequest{ - EventType: "evtype_01kd2m9a0b1c2d3e4f5g6h7j8m", - Start: "2027-01-04T15:00:00.000Z", -} -client.Scheduling.Slots.Explain( - context.TODO(), - request, -) -``` -
-
+**locations:** `[]*coss.SchedulingLocation` — Where bookings can meet. A browser only chooses among these. A `group` event type can't use `zoom`. +
-#### ⚙️ Parameters - -
-
-
-**eventType:** `string` — The event type's id or uid. +**hostFilter:** `map[string]*scheduling.CreateEventTypeRequestHostFilterValue` — Pool members also include active hosts matching all of these attributes.
@@ -19062,7 +21434,7 @@ client.Scheduling.Slots.Explain(
-**start:** `string` — An ISO 8601 instant with an offset. +**notifications:** `map[string]*scheduling.CreateEventTypeRequestNotificationsValue` — Per event, overriding your settings for this event type.
@@ -19070,7 +21442,7 @@ client.Scheduling.Slots.Explain(
-**host:** `*string` — Only this host (id or uid). +**reminders:** `[]*coss.SchedulingReminderInput` — Replaces your settings' `reminders` for this event type. `null` inherits them; an empty list means none.
@@ -19078,7 +21450,7 @@ client.Scheduling.Slots.Explain(
-**durationMinutes:** `*int` +**metadata:** `map[string]string` — Your own key-value pairs.
@@ -19086,7 +21458,7 @@ client.Scheduling.Slots.Explain(
-**attributes:** `*string` — A JSON object narrowing a pool, such as `{"licensed_in":"CA"}`. +**hosts:** `[]*coss.SchedulingEventTypeHostInput` — Who can be booked. `one_on_one` and `group` take one; `collective` needs at least one `required` host.
@@ -19098,8 +21470,7 @@ client.Scheduling.Slots.Explain(
-## Scheduling Availability -
client.Scheduling.Availability.Search(request) -> *coss.SchedulingAvailabilitySearchResult +
client.Scheduling.EventTypes.Get(EventType) -> *coss.SchedulingEventType
@@ -19111,7 +21482,7 @@ client.Scheduling.Slots.Explain(
-For "who's free" pages: each matching host's soonest slots, soonest first, across up to 500 hosts. +An event type by its id or your uid.
@@ -19126,17 +21497,10 @@ For "who's free" pages: each matching host's soonest slots, soonest first, acros
```go -request := &scheduling.AvailabilitySearchRequest{ +request := &scheduling.GetEventTypesRequest{ EventType: "evtype_01kd2m9a0b1c2d3e4f5g6h7j8m", - Start: "2027-01-04T00:00:00.000Z", - End: "2027-01-18T00:00:00.000Z", - Attributes: map[string]*scheduling.AvailabilitySearchRequestAttributesValue{ - "licensed_in": &scheduling.AvailabilitySearchRequestAttributesValue{ - String: "CA", - }, - }, } -client.Scheduling.Availability.Search( +client.Scheduling.EventTypes.Get( context.TODO(), request, ) @@ -19154,55 +21518,7 @@ client.Scheduling.Availability.Search(
-**eventType:** `string` — The event type's id or uid. - -
-
- -
-
- -**start:** `string` — An ISO 8601 instant with an offset. - -
-
- -
-
- -**end:** `string` — An ISO 8601 instant with an offset. - -
-
- -
-
- -**attributes:** `map[string]*scheduling.AvailabilitySearchRequestAttributesValue` — Only hosts matching all of these. - -
-
- -
-
- -**hosts:** `[]string` — Only these hosts (ids or uids). Default: everyone the event type could offer. - -
-
- -
-
- -**slotsPerHost:** `*int` — How many of each host's soonest slots to return. - -
-
- -
-
- -**limit:** `*int` — Hosts to return, soonest availability first. +**eventType:** `string` — The event type's id or uid.
@@ -19214,8 +21530,7 @@ client.Scheduling.Availability.Search(
-## Scheduling Bookings -
client.Scheduling.Bookings.List() -> *coss.SchedulingBookingList +
client.Scheduling.EventTypes.Update(EventType, request) -> *coss.SchedulingEventType
@@ -19227,7 +21542,7 @@ client.Scheduling.Availability.Search(
-The environment's bookings, newest first. Answers aren't included. +Changes what's given. Existing bookings keep what they were booked with. Set `status` to `archived` to stop new bookings.
@@ -19242,15 +21557,13 @@ The environment's bookings, newest first. Answers aren't included.
```go -request := &scheduling.ListBookingsRequest{ - StartAfter: coss.String( - "2027-01-04T15:00:00.000Z", - ), - StartBefore: coss.String( - "2027-01-04T15:00:00.000Z", +request := &scheduling.UpdateEventTypeRequest{ + EventType: "evtype_01kd2m9a0b1c2d3e4f5g6h7j8m", + MinNoticeMinutes: coss.Int( + 240, ), } -client.Scheduling.Bookings.List( +client.Scheduling.EventTypes.Update( context.TODO(), request, ) @@ -19268,7 +21581,7 @@ client.Scheduling.Bookings.List(
-**limit:** `*int` +**eventType:** `string` — The event type's id or uid.
@@ -19276,7 +21589,7 @@ client.Scheduling.Bookings.List(
-**after:** `*string` — The last id of the previous page. +**uid:** `*string` — Your own id for this event type. `null` removes it.
@@ -19284,7 +21597,7 @@ client.Scheduling.Bookings.List(
-**host:** `*string` +**description:** `*string` — Plain text about the event type, shown on hosted booking pages and never in emails. Links, and anything shaped like a domain, must be on your organization's verified domains or their subdomains, and use `https`. `null` removes it.
@@ -19292,7 +21605,7 @@ client.Scheduling.Bookings.List(
-**eventType:** `*string` +**title:** `*string` — Shown to attendees and in emails. Host calendars show it only with `host_calendar_details: full`.
@@ -19300,7 +21613,7 @@ client.Scheduling.Bookings.List(
-**status:** `*scheduling.ListBookingsRequestStatus` +**durationMinutes:** `*int` — How long a booking lasts by default, in minutes.
@@ -19308,7 +21621,7 @@ client.Scheduling.Bookings.List(
-**attendeeUID:** `*string` +**durationOptions:** `[]int` — Other lengths an attendee may choose, in minutes. Empty: only `duration_minutes`.
@@ -19316,7 +21629,7 @@ client.Scheduling.Bookings.List(
-**startAfter:** `*string` — An ISO 8601 instant with an offset. +**stepMinutes:** `*int` — How far apart slots start. Default: the duration.
@@ -19324,83 +21637,47 @@ client.Scheduling.Bookings.List(
-**startBefore:** `*string` — An ISO 8601 instant with an offset. +**gridTimeZone:** `*string` — The zone slots align in. Default: each host's own.
-
-
+
+
+**bufferBeforeMinutes:** `*int` — Minutes kept free before each booking. Default: 0. +
-
-
client.Scheduling.Bookings.Create(request) -> *coss.SchedulingBooking
-#### 📝 Description - -
-
+**bufferAfterMinutes:** `*int` — Minutes kept free after each booking. Default: 0. + +
+
-Books a slot, or joins a group session. Without a `host`, a pool chooses fairly among those free. An event type that requires approval answers with a `pending_approval` booking. -
-
+**minNoticeMinutes:** `*int` — Slots starting sooner than this many minutes from now aren't offered. Default: 0. +
-#### 🔌 Usage - -
-
-
-```go -request := &scheduling.CreateBookingRequest{ - IdempotencyKey: coss.String( - "welcome-user-123", - ), - EventType: "evtype_01kd2m9a0b1c2d3e4f5g6h7j8m", - Start: "2027-01-04T15:00:00.000Z", - Attendee: &coss.SchedulingAttendeeInput{ - UID: coss.String( - "patient_77", - ), - Name: coss.String( - "Sam Lee", - ), - Email: coss.String( - "sam@example.com", - ), - TimeZone: "UTC", - }, -} -client.Scheduling.Bookings.Create( - context.TODO(), - request, -) -``` -
-
+**bookingWindow:** `*coss.SchedulingBookingWindow` +
-#### ⚙️ Parameters - -
-
-
-**idempotencyKey:** `*string` — Makes retries safe: a repeated request with the same key and body returns the original booking instead of creating another, for 24 hours. A refused request keeps no key. 1-256 characters. +**limits:** `[]*coss.SchedulingLimit` — Caps on bookings per day or week. Default: none.
@@ -19408,7 +21685,7 @@ client.Scheduling.Bookings.Create(
-**eventType:** `string` — The event type's id or uid. +**capacity:** `*int` — Attendees per session. Required for, and only allowed on, `group`.
@@ -19416,7 +21693,7 @@ client.Scheduling.Bookings.Create(
-**start:** `string` — An ISO 8601 instant with an offset. +**requiresApproval:** `*bool` — Bookings start as `pending_approval`, holding the time until approved or declined. Default: `false`.
@@ -19424,7 +21701,7 @@ client.Scheduling.Bookings.Create(
-**host:** `*string` — A specific host (id or uid). Default: chosen fairly from those free. +**reassignmentEnabled:** `*bool` — Whether bookings of this event type can go to another host. Default: true.
@@ -19432,7 +21709,7 @@ client.Scheduling.Bookings.Create(
-**attributes:** `map[string]*scheduling.CreateBookingRequestAttributesValue` — Only choose among pool hosts matching all of these. +**approvalTTLMinutes:** `*int` — How long a booking can wait for approval before it's declined, in minutes. Default: 1440.
@@ -19440,7 +21717,7 @@ client.Scheduling.Bookings.Create(
-**durationMinutes:** `*int` — One of the event type's `duration_options`. +**holdTTLSeconds:** `*int` — How long a hold keeps its slot, in seconds. Default: 600.
@@ -19448,7 +21725,7 @@ client.Scheduling.Bookings.Create(
-**attendee:** `*coss.SchedulingAttendeeInput` +**cancelNoticeMinutes:** `*int` — Attendees can't cancel closer to the start than this. API keys can.
@@ -19456,7 +21733,7 @@ client.Scheduling.Bookings.Create(
-**guests:** `[]*coss.SchedulingGuestInput` — Up to the event type's `max_guests`. +**rescheduleNoticeMinutes:** `*int` — Attendees can't reschedule closer to the start than this. API keys can. Default: 0.
@@ -19464,7 +21741,7 @@ client.Scheduling.Bookings.Create(
-**answers:** `map[string]*scheduling.CreateBookingRequestAnswersValue` — Answers to the event type's questions. Stored encrypted, and returned only by retrieving the booking. +**maxGuests:** `*int` — How many people an attendee can add to a booking. Default: 0. Guests are emailed about it. Not on `group`.
@@ -19472,7 +21749,7 @@ client.Scheduling.Bookings.Create(
-**location:** `*scheduling.CreateBookingRequestLocation` — One of the event type's `locations`, with your link filled in if it has none. +**maxActiveBookingsPerAttendee:** `*int` — How many upcoming bookings of this event type one person can have at a time, known by `uid` or email. Default: `null`, no limit. Past this, booking answers `attendee_limit_reached`. Guests don't count, and each occurrence of a series does.
@@ -19480,67 +21757,71 @@ client.Scheduling.Bookings.Create(
-**metadata:** `map[string]string` — Your own key-value pairs. Don't put sensitive data here. +**hostCalendarDetails:** `*scheduling.UpdateEventTypeRequestHostCalendarDetails` — What hosts' calendars say about a booking. `neutral` (the default): a private event titled "Appointment". `full`: a private event with this title and the attendee's name, plus names, emails and phone numbers in its description, which go to the host's calendar provider. Never answers. Refused in HIPAA mode.
-
-
+
+
+**questions:** `[]*coss.SchedulingQuestion` — What attendees are asked when booking. Keys must be unique. +
-
-
client.Scheduling.Bookings.Get(ID) -> *coss.SchedulingBooking
-#### 📝 Description +**locations:** `[]*coss.SchedulingLocation` — Where bookings can meet. A browser only chooses among these. A `group` event type can't use `zoom`. + +
+
+**hostFilter:** `map[string]*scheduling.UpdateEventTypeRequestHostFilterValue` — Pool members also include active hosts matching all of these attributes. + +
+
+
-A booking with its attendees and their answers. -
-
+**notifications:** `map[string]*scheduling.UpdateEventTypeRequestNotificationsValue` — Per event, overriding your settings for this event type. + -#### 🔌 Usage -
+**reminders:** `[]*coss.SchedulingReminderInput` — Replaces your settings' `reminders` for this event type. `null` inherits them; an empty list means none. + +
+
+
-```go -request := &scheduling.GetBookingsRequest{ - ID: "book_01kd2m9a0b1c2d3e4f5g6h7j8m", -} -client.Scheduling.Bookings.Get( - context.TODO(), - request, -) -``` -
-
+**metadata:** `map[string]string` — Your own key-value pairs. + -#### ⚙️ Parameters -
+**status:** `*scheduling.UpdateEventTypeRequestStatus` — `archived` stops new bookings, and keeps existing ones. + +
+
+
-**id:** `string` — The booking's id. +**hosts:** `[]*coss.SchedulingEventTypeHostInput` — Replaces the assigned hosts. Removed hosts keep their existing bookings.
@@ -19552,7 +21833,8 @@ client.Scheduling.Bookings.Get(
-
client.Scheduling.Bookings.Reschedule(ID, request) -> *coss.SchedulingBooking +## Scheduling Slots +
client.Scheduling.Slots.List(EventType) -> *coss.SchedulingSlotList
@@ -19564,7 +21846,7 @@ client.Scheduling.Bookings.Get(
-Moves it to a new time, keeping its id. The old time stays booked if the new one isn't free. +Starts an attendee can book between `start` and `end` (at most 62 days), as UTC instants to show in their own time zone. A host whose calendar can't be read isn't offered.
@@ -19579,11 +21861,12 @@ Moves it to a new time, keeping its id. The old time stays booked if the new one
```go -request := &scheduling.RescheduleBookingRequest{ - ID: "book_01kd2m9a0b1c2d3e4f5g6h7j8m", - Start: "2027-01-05T15:00:00.000Z", +request := &scheduling.ListSlotsRequest{ + EventType: "evtype_01kd2m9a0b1c2d3e4f5g6h7j8m", + Start: "2027-01-04T15:00:00.000Z", + End: "2027-01-04T15:00:00.000Z", } -client.Scheduling.Bookings.Reschedule( +client.Scheduling.Slots.List( context.TODO(), request, ) @@ -19601,7 +21884,7 @@ client.Scheduling.Bookings.Reschedule(
-**id:** `string` — The booking's id. +**eventType:** `string` — The event type's id or uid.
@@ -19609,7 +21892,7 @@ client.Scheduling.Bookings.Reschedule(
-**start:** `string` — The new start. The old time stays booked unless this one's free. +**start:** `string` — An ISO 8601 instant with an offset.
@@ -19617,7 +21900,31 @@ client.Scheduling.Bookings.Reschedule(
-**host:** `*string` — Move a pool booking to this host. Default: its current hosts. +**end:** `string` — An ISO 8601 instant with an offset. + +
+
+ +
+
+ +**host:** `*string` — Only this host's slots (id or uid). + +
+
+ +
+
+ +**durationMinutes:** `*int` + +
+
+ +
+
+ +**attributes:** `*string` — A JSON object narrowing a pool, such as `{"licensed_in":"CA"}`.
@@ -19629,7 +21936,7 @@ client.Scheduling.Bookings.Reschedule(
-
client.Scheduling.Bookings.Cancel(ID, request) -> *coss.SchedulingBooking +
client.Scheduling.Slots.Explain(EventType) -> *coss.SchedulingSlotExplanation
@@ -19641,7 +21948,7 @@ client.Scheduling.Bookings.Reschedule(
-Frees the time and removes the calendar event. A cancelled booking stays charged. +Why one start can or can't be booked right now, host by host, decided the same way a booking is. For support and debugging: it says when a host is busy, so don't show it to attendees.
@@ -19656,13 +21963,11 @@ Frees the time and removes the calendar event. A cancelled booking stays charged
```go -request := &scheduling.CancelSchedulingBookingRequest{ - ID: "book_01kd2m9a0b1c2d3e4f5g6h7j8m", - Reason: coss.String( - "Feeling better", - ), +request := &scheduling.ExplainSlotsRequest{ + EventType: "evtype_01kd2m9a0b1c2d3e4f5g6h7j8m", + Start: "2027-01-04T15:00:00.000Z", } -client.Scheduling.Bookings.Cancel( +client.Scheduling.Slots.Explain( context.TODO(), request, ) @@ -19680,7 +21985,7 @@ client.Scheduling.Bookings.Cancel(
-**id:** `string` — The booking's id. +**eventType:** `string` — The event type's id or uid.
@@ -19688,7 +21993,31 @@ client.Scheduling.Bookings.Cancel(
-**reason:** `*string` — Why it's being cancelled. Only retrieving this booking returns it: it's never in webhooks, logs or emails. +**start:** `string` — An ISO 8601 instant with an offset. + +
+
+ +
+
+ +**host:** `*string` — Only this host (id or uid). + +
+
+ +
+
+ +**durationMinutes:** `*int` + +
+
+ +
+
+ +**attributes:** `*string` — A JSON object narrowing a pool, such as `{"licensed_in":"CA"}`.
@@ -19700,7 +22029,8 @@ client.Scheduling.Bookings.Cancel(
-
client.Scheduling.Bookings.Events(ID) -> *coss.SchedulingBookingEventList +## Scheduling Availability +
client.Scheduling.Availability.Search(request) -> *coss.SchedulingAvailabilitySearchResult
@@ -19712,7 +22042,7 @@ client.Scheduling.Bookings.Cancel(
-What's happened to a booking, oldest first, and who did it. There's no personal data in here. +For "who's free" pages: each matching host's soonest slots, soonest first, across up to 500 hosts.
@@ -19727,10 +22057,17 @@ What's happened to a booking, oldest first, and who did it. There's no personal
```go -request := &scheduling.EventsBookingsRequest{ - ID: "book_01kd2m9a0b1c2d3e4f5g6h7j8m", +request := &scheduling.AvailabilitySearchRequest{ + EventType: "evtype_01kd2m9a0b1c2d3e4f5g6h7j8m", + Start: "2027-01-04T00:00:00.000Z", + End: "2027-01-18T00:00:00.000Z", + Attributes: map[string]*scheduling.AvailabilitySearchRequestAttributesValue{ + "licensed_in": &scheduling.AvailabilitySearchRequestAttributesValue{ + String: "CA", + }, + }, } -client.Scheduling.Bookings.Events( +client.Scheduling.Availability.Search( context.TODO(), request, ) @@ -19748,7 +22085,7 @@ client.Scheduling.Bookings.Events(
-**id:** `string` — The booking's id. +**eventType:** `string` — The event type's id or uid.
@@ -19756,7 +22093,7 @@ client.Scheduling.Bookings.Events(
-**limit:** `*int` +**start:** `string` — An ISO 8601 instant with an offset.
@@ -19764,7 +22101,39 @@ client.Scheduling.Bookings.Events(
-**after:** `*string` — The last id of the previous page. +**end:** `string` — An ISO 8601 instant with an offset. + +
+
+ +
+
+ +**attributes:** `map[string]*scheduling.AvailabilitySearchRequestAttributesValue` — Only hosts matching all of these. + +
+
+ +
+
+ +**hosts:** `[]string` — Only these hosts (ids or uids). Default: everyone the event type could offer. + +
+
+ +
+
+ +**slotsPerHost:** `*int` — How many of each host's soonest slots to return. + +
+
+ +
+
+ +**limit:** `*int` — Hosts to return, soonest availability first.
@@ -19776,7 +22145,8 @@ client.Scheduling.Bookings.Events(
-
client.Scheduling.Bookings.Approve(ID) -> *coss.SchedulingBooking +## Scheduling Holds +
client.Scheduling.Holds.Create(request) -> *coss.SchedulingBooking
@@ -19788,7 +22158,7 @@ client.Scheduling.Bookings.Events(
-Confirms a `pending_approval` booking. +Keeps a slot for a while (the event type's `hold_ttl_seconds`) so you can take payment, then confirm it. Answers with a `held` booking, which isn't charged and sends nothing.
@@ -19803,10 +22173,20 @@ Confirms a `pending_approval` booking.
```go -request := &scheduling.ApproveBookingsRequest{ - ID: "book_01kd2m9a0b1c2d3e4f5g6h7j8m", +request := &scheduling.CreateHoldRequest{ + IdempotencyKey: coss.String( + "welcome-user-123", + ), + EventType: "evtype_01kd2m9a0b1c2d3e4f5g6h7j8m", + Start: "2027-01-04T15:00:00.000Z", + Attendee: &coss.SchedulingAttendeeInput{ + UID: coss.String( + "patient_77", + ), + TimeZone: "UTC", + }, } -client.Scheduling.Bookings.Approve( +client.Scheduling.Holds.Create( context.TODO(), request, ) @@ -19824,67 +22204,87 @@ client.Scheduling.Bookings.Approve(
-**id:** `string` — The booking's id. +**idempotencyKey:** `*string` — Makes retries safe: a repeated request with the same key and body returns the original booking instead of creating another, for 24 hours. A refused request keeps no key. 1-256 characters.
-
-
+
+
+**eventType:** `string` — The event type's id or uid. +
-
-
client.Scheduling.Bookings.Decline(ID) -> *coss.SchedulingBooking
-#### 📝 Description +**start:** `string` — An ISO 8601 instant with an offset. + +
+
+**host:** `*string` — A specific host (id or uid). Default: chosen fairly from those free. + +
+
+
-Refuses a `pending_approval` booking and frees the time. +**attributes:** `map[string]*scheduling.CreateHoldRequestAttributesValue` — Only choose among pool hosts matching all of these. +
+ +
+
+ +**durationMinutes:** `*int` — One of the event type's `duration_options`. +
-#### 🔌 Usage -
+**attendee:** `*coss.SchedulingAttendeeInput` + +
+
+
-```go -request := &scheduling.DeclineBookingsRequest{ - ID: "book_01kd2m9a0b1c2d3e4f5g6h7j8m", -} -client.Scheduling.Bookings.Decline( - context.TODO(), - request, -) -``` +**guests:** `[]*coss.SchedulingGuestInput` — Up to the event type's `max_guests`. +
+ +
+
+ +**answers:** `map[string]*scheduling.CreateHoldRequestAnswersValue` — Answers to the event type's questions. Stored encrypted, and returned only by retrieving the booking. +
-#### ⚙️ Parameters -
+**location:** `*scheduling.CreateHoldRequestLocation` — One of the event type's `locations`, with your link filled in if it has none. + +
+
+
-**id:** `string` — The booking's id. +**metadata:** `map[string]string` — Your own key-value pairs. Don't put sensitive data here.
@@ -19896,7 +22296,7 @@ client.Scheduling.Bookings.Decline(
-
client.Scheduling.Bookings.Notifications(ID) -> *coss.SchedulingBookingNotificationList +
client.Scheduling.Holds.Confirm(ID, request) -> *coss.SchedulingBooking
@@ -19908,7 +22308,7 @@ client.Scheduling.Bookings.Decline(
-What's been queued for this booking and what became of it, newest first, including why something wasn't sent. It never says who it went to. +Turns a hold into a booking. Always succeeds before the hold expires. Repeating it is safe.
@@ -19923,10 +22323,13 @@ What's been queued for this booking and what became of it, newest first, includi
```go -request := &scheduling.NotificationsBookingsRequest{ +request := &scheduling.ConfirmHoldRequest{ ID: "book_01kd2m9a0b1c2d3e4f5g6h7j8m", + IfStillFree: coss.Bool( + true, + ), } -client.Scheduling.Bookings.Notifications( +client.Scheduling.Holds.Confirm( context.TODO(), request, ) @@ -19952,15 +22355,7 @@ client.Scheduling.Bookings.Notifications(
-**limit:** `*int` - -
-
- -
-
- -**after:** `*string` — The last id of the previous page. +**ifStillFree:** `*bool` — After the hold expired, book anyway if nobody else took the slot. Default: refuse with `hold_expired`.
@@ -19972,7 +22367,7 @@ client.Scheduling.Bookings.Notifications(
-
client.Scheduling.Bookings.MarkNoShow(ID) -> *coss.SchedulingBooking +
client.Scheduling.Holds.Release(ID) -> *coss.SchedulingBooking
@@ -19984,7 +22379,7 @@ client.Scheduling.Bookings.Notifications(
-Records that the attendee didn't come, once the booking has started. +Gives the slot back early.
@@ -19999,10 +22394,10 @@ Records that the attendee didn't come, once the booking has started.
```go -request := &scheduling.MarkNoShowBookingsRequest{ +request := &scheduling.ReleaseHoldsRequest{ ID: "book_01kd2m9a0b1c2d3e4f5g6h7j8m", } -client.Scheduling.Bookings.MarkNoShow( +client.Scheduling.Holds.Release( context.TODO(), request, ) @@ -20032,7 +22427,8 @@ client.Scheduling.Bookings.MarkNoShow(
-
client.Scheduling.Bookings.UpdateLocation(ID, request) -> *coss.SchedulingBooking +## Scheduling Series +
client.Scheduling.Series.Create(request) -> *coss.SchedulingSeries
@@ -20044,7 +22440,7 @@ client.Scheduling.Bookings.MarkNoShow(
-Where it happens, such as the meeting link you made after the `scheduling.booking.confirmed` webhook. +Books up to 52 occurrences, keeping the attendee's local time across DST changes. Each one is an ordinary booking that can move on its own, and a pool keeps one host throughout.
@@ -20059,17 +22455,29 @@ Where it happens, such as the meeting link you made after the `scheduling.bookin
```go -request := &scheduling.UpdateBookingLocationRequest{ - ID: "book_01kd2m9a0b1c2d3e4f5g6h7j8m", - Location: &coss.SchedulingLocation{ - Link: &coss.SchedulingLocationLink{ - URL: coss.String( - "https://meet.example.com/abc", +request := &scheduling.CreateSeriesBody{ + IdempotencyKey: coss.String( + "welcome-user-123", + ), + Body: &coss.CreateSeriesRequest{ + EventType: "evtype_01kd2m9a0b1c2d3e4f5g6h7j8m", + Start: "2027-01-04T15:00:00.000Z", + Attendee: &coss.SchedulingAttendeeInput{ + UID: coss.String( + "patient_77", + ), + TimeZone: "America/New_York", + }, + Recurrence: &coss.CreateSeriesRequestRecurrence{ + Frequency: coss.CreateSeriesRequestRecurrenceFrequencyWeekly, + Interval: coss.Int( + 1, ), + Count: 12, }, }, } -client.Scheduling.Bookings.UpdateLocation( +client.Scheduling.Series.Create( context.TODO(), request, ) @@ -20087,7 +22495,7 @@ client.Scheduling.Bookings.UpdateLocation(
-**id:** `string` — The booking's id. +**idempotencyKey:** `*string` — Makes retries safe: a repeated request with the same key and body returns the original booking instead of creating another, for 24 hours. A refused request keeps no key. 1-256 characters.
@@ -20095,7 +22503,7 @@ client.Scheduling.Bookings.UpdateLocation(
-**location:** `*coss.SchedulingLocation` +**request:** `*coss.CreateSeriesRequest`
@@ -20107,8 +22515,7 @@ client.Scheduling.Bookings.UpdateLocation(
-## Scheduling Holds -
client.Scheduling.Holds.Create(request) -> *coss.SchedulingBooking +
client.Scheduling.Series.Preview(request) -> *coss.SchedulingSeriesPreview
@@ -20120,7 +22527,7 @@ client.Scheduling.Bookings.UpdateLocation(
-Keeps a slot for a while (the event type's `hold_ttl_seconds`) so you can take payment, then confirm it. Answers with a `held` booking, which isn't charged and sends nothing. +Which occurrences would be free, without booking anything.
@@ -20135,20 +22542,24 @@ Keeps a slot for a while (the event type's `hold_ttl_seconds`) so you can take p
```go -request := &scheduling.CreateHoldRequest{ - IdempotencyKey: coss.String( - "welcome-user-123", - ), +request := &coss.CreateSeriesRequest{ EventType: "evtype_01kd2m9a0b1c2d3e4f5g6h7j8m", Start: "2027-01-04T15:00:00.000Z", Attendee: &coss.SchedulingAttendeeInput{ UID: coss.String( "patient_77", ), - TimeZone: "UTC", + TimeZone: "America/New_York", + }, + Recurrence: &coss.CreateSeriesRequestRecurrence{ + Frequency: coss.CreateSeriesRequestRecurrenceFrequencyWeekly, + Interval: coss.Int( + 1, + ), + Count: 12, }, } -client.Scheduling.Holds.Create( +client.Scheduling.Series.Preview( context.TODO(), request, ) @@ -20166,79 +22577,70 @@ client.Scheduling.Holds.Create(
-**idempotencyKey:** `*string` — Makes retries safe: a repeated request with the same key and body returns the original booking instead of creating another, for 24 hours. A refused request keeps no key. 1-256 characters. +**request:** `*coss.CreateSeriesRequest`
- -
-
- -**eventType:** `string` — The event type's id or uid. -
-
-
-**start:** `string` — An ISO 8601 instant with an offset. -
+
+
client.Scheduling.Series.Cancel(ID, request) -> *coss.SchedulingCancelledSeries
-**host:** `*string` — A specific host (id or uid). Default: chosen fairly from those free. - -
-
+#### 📝 Description
-**attributes:** `map[string]*scheduling.CreateHoldRequestAttributesValue` — Only choose among pool hosts matching all of these. - -
-
-
-**durationMinutes:** `*int` — One of the event type's `duration_options`. - +Cancels the occurrences from `from_index` on, or all of them. +
+
+#### 🔌 Usage +
-**attendee:** `*coss.SchedulingAttendeeInput` - -
-
-
-**guests:** `[]*coss.SchedulingGuestInput` — Up to the event type's `max_guests`. - +```go +request := &scheduling.CancelSeriesRequest{ + ID: "series_01kd2m9a0b1c2d3e4f5g6h7j8m", + FromIndex: coss.Int64( + int64(4), + ), +} +client.Scheduling.Series.Cancel( + context.TODO(), + request, +) +``` +
+
+#### ⚙️ Parameters +
-**answers:** `map[string]*scheduling.CreateHoldRequestAnswersValue` — Answers to the event type's questions. Stored encrypted, and returned only by retrieving the booking. - -
-
-
-**location:** `*scheduling.CreateHoldRequestLocation` — One of the event type's `locations`, with your link filled in if it has none. +**id:** `string` — The series' id.
@@ -20246,7 +22648,7 @@ client.Scheduling.Holds.Create(
-**metadata:** `map[string]string` — Your own key-value pairs. Don't put sensitive data here. +**fromIndex:** `*int64` — Cancel this occurrence and those after it. Default: all of them.
@@ -20258,7 +22660,8 @@ client.Scheduling.Holds.Create(
-
client.Scheduling.Holds.Confirm(ID, request) -> *coss.SchedulingBooking +## Scheduling Attendees +
client.Scheduling.Attendees.Erase(UID) -> *coss.SchedulingAttendeeErasure
@@ -20270,7 +22673,7 @@ client.Scheduling.Holds.Create(
-Turns a hold into a booking. Always succeeds before the hold expires. Repeating it is safe. +Removes this person's details and answers from every booking now, and ends any booker session fixed to them. The bookings themselves stay.
@@ -20285,13 +22688,10 @@ Turns a hold into a booking. Always succeeds before the hold expires. Repeating
```go -request := &scheduling.ConfirmHoldRequest{ - ID: "book_01kd2m9a0b1c2d3e4f5g6h7j8m", - IfStillFree: coss.Bool( - true, - ), +request := &scheduling.EraseAttendeesRequest{ + UID: "patient_77", } -client.Scheduling.Holds.Confirm( +client.Scheduling.Attendees.Erase( context.TODO(), request, ) @@ -20309,15 +22709,7 @@ client.Scheduling.Holds.Confirm(
-**id:** `string` — The booking's id. - -
-
- -
-
- -**ifStillFree:** `*bool` — After the hold expired, book anyway if nobody else took the slot. Default: refuse with `hold_expired`. +**uid:** `string` — Your id for the attendee.
@@ -20329,7 +22721,7 @@ client.Scheduling.Holds.Confirm(
-
client.Scheduling.Holds.Release(ID) -> *coss.SchedulingBooking +
client.Scheduling.Attendees.EraseByEmail(request) -> *coss.SchedulingAttendeeErasureByEmail
@@ -20341,7 +22733,7 @@ client.Scheduling.Holds.Confirm(
-Gives the slot back early. +Removes this address's details and answers from every booking now, for someone you have no `uid` for, such as a guest. The bookings themselves stay.
@@ -20356,10 +22748,10 @@ Gives the slot back early.
```go -request := &scheduling.ReleaseHoldsRequest{ - ID: "book_01kd2m9a0b1c2d3e4f5g6h7j8m", +request := &scheduling.EraseSchedulingAttendeeByEmailRequest{ + Email: "sam@example.com", } -client.Scheduling.Holds.Release( +client.Scheduling.Attendees.EraseByEmail( context.TODO(), request, ) @@ -20377,7 +22769,7 @@ client.Scheduling.Holds.Release(
-**id:** `string` — The booking's id. +**email:** `string` — The address to forget, an attendee's or a guest's.
@@ -20389,8 +22781,8 @@ client.Scheduling.Holds.Release(
-## Scheduling Series -
client.Scheduling.Series.Create(request) -> *coss.SchedulingSeries +## Scheduling Calendars +
client.Scheduling.Calendars.Authorize(Host, request) -> *coss.SchedulingCalendarAuthorization
@@ -20402,7 +22794,7 @@ client.Scheduling.Holds.Release(
-Books up to 52 occurrences, keeping the attendee's local time across DST changes. Each one is an ordinary booking that can move on its own, and a pool keeps one host throughout. +A URL for the host to give consent at Google or Microsoft. Open it in a new window: providers refuse to be framed. Coss.com reads only busy times, and writes events with a neutral title unless the event type's `host_calendar_details` is `full`.
@@ -20417,29 +22809,11 @@ Books up to 52 occurrences, keeping the attendee's local time across DST changes
```go -request := &scheduling.CreateSeriesBody{ - IdempotencyKey: coss.String( - "welcome-user-123", - ), - Body: &coss.CreateSeriesRequest{ - EventType: "evtype_01kd2m9a0b1c2d3e4f5g6h7j8m", - Start: "2027-01-04T15:00:00.000Z", - Attendee: &coss.SchedulingAttendeeInput{ - UID: coss.String( - "patient_77", - ), - TimeZone: "America/New_York", - }, - Recurrence: &coss.CreateSeriesRequestRecurrence{ - Frequency: coss.CreateSeriesRequestRecurrenceFrequencyWeekly, - Interval: coss.Int( - 1, - ), - Count: 12, - }, - }, +request := &scheduling.AuthorizeCalendarRequest{ + Host: "host_01kd2m9a0b1c2d3e4f5g6h7j8m", + Provider: scheduling.AuthorizeCalendarRequestProviderGoogle, } -client.Scheduling.Series.Create( +client.Scheduling.Calendars.Authorize( context.TODO(), request, ) @@ -20457,7 +22831,7 @@ client.Scheduling.Series.Create(
-**idempotencyKey:** `*string` — Makes retries safe: a repeated request with the same key and body returns the original booking instead of creating another, for 24 hours. A refused request keeps no key. 1-256 characters. +**host:** `string` — The host's id or uid.
@@ -20465,7 +22839,15 @@ client.Scheduling.Series.Create(
-**request:** `*coss.CreateSeriesRequest` +**provider:** `scheduling.AuthorizeCalendarRequestProvider` — Whose consent page to open. CalDAV connects with a password instead. + +
+
+ +
+
+ +**returnURL:** `*string` — Where to send the browser afterwards, on one of the environment's allowed origins. `coss_calendar` says what happened: `connected`, `denied` or `invalid`.
@@ -20477,7 +22859,7 @@ client.Scheduling.Series.Create(
-
client.Scheduling.Series.Preview(request) -> *coss.SchedulingSeriesPreview +
client.Scheduling.Calendars.List(Host) -> *coss.SchedulingCalendarConnectionList
@@ -20489,7 +22871,7 @@ client.Scheduling.Series.Create(
-Which occurrences would be free, without booking anything. +With each connection's calendars and which of them count.
@@ -20504,24 +22886,10 @@ Which occurrences would be free, without booking anything.
```go -request := &coss.CreateSeriesRequest{ - EventType: "evtype_01kd2m9a0b1c2d3e4f5g6h7j8m", - Start: "2027-01-04T15:00:00.000Z", - Attendee: &coss.SchedulingAttendeeInput{ - UID: coss.String( - "patient_77", - ), - TimeZone: "America/New_York", - }, - Recurrence: &coss.CreateSeriesRequestRecurrence{ - Frequency: coss.CreateSeriesRequestRecurrenceFrequencyWeekly, - Interval: coss.Int( - 1, - ), - Count: 12, - }, +request := &scheduling.ListCalendarsRequest{ + Host: "host_01kd2m9a0b1c2d3e4f5g6h7j8m", } -client.Scheduling.Series.Preview( +client.Scheduling.Calendars.List( context.TODO(), request, ) @@ -20539,7 +22907,7 @@ client.Scheduling.Series.Preview(
-**request:** `*coss.CreateSeriesRequest` +**host:** `string` — The host's id or uid.
@@ -20551,7 +22919,7 @@ client.Scheduling.Series.Preview(
-
client.Scheduling.Series.Cancel(ID, request) -> *coss.SchedulingCancelledSeries +
client.Scheduling.Calendars.Connect(Host, request) -> *coss.SchedulingCalendarConnection
@@ -20563,7 +22931,7 @@ client.Scheduling.Series.Preview(
-Cancels the occurrences from `from_index` on, or all of them. +CalDAV (Apple and others) with an app password, or, in sandbox environments, a `simulated` calendar whose busy times you set yourself. Google and Microsoft use `authorize`.
@@ -20578,13 +22946,17 @@ Cancels the occurrences from `from_index` on, or all of them.
```go -request := &scheduling.CancelSeriesRequest{ - ID: "series_01kd2m9a0b1c2d3e4f5g6h7j8m", - FromIndex: coss.Int64( - int64(4), - ), +request := &scheduling.ConnectCalendarsRequest{ + Host: "host_01kd2m9a0b1c2d3e4f5g6h7j8m", + Body: &coss.CreateCalendarConnectionRequest{ + Caldav: &coss.CreateCalendarConnectionRequestCaldav{ + URL: "url", + Username: "username", + Password: "password", + }, + }, } -client.Scheduling.Series.Cancel( +client.Scheduling.Calendars.Connect( context.TODO(), request, ) @@ -20602,7 +22974,7 @@ client.Scheduling.Series.Cancel(
-**id:** `string` — The series' id. +**host:** `string` — The host's id or uid.
@@ -20610,7 +22982,7 @@ client.Scheduling.Series.Cancel(
-**fromIndex:** `*int64` — Cancel this occurrence and those after it. Default: all of them. +**request:** `*coss.CreateCalendarConnectionRequest`
@@ -20622,8 +22994,7 @@ client.Scheduling.Series.Cancel(
-## Scheduling Attendees -
client.Scheduling.Attendees.Erase(UID) -> *coss.SchedulingAttendeeErasure +
client.Scheduling.Calendars.Disconnect(Host, ID) -> *coss.DeletedSchedulingCalendarConnection
@@ -20635,7 +23006,7 @@ client.Scheduling.Series.Cancel(
-Removes this person's details and answers from every booking now, and ends any booker session fixed to them. The bookings themselves stay. +Revokes coss.com's access and deletes every busy time read through it. One a calendar delegation manages is refused (`calendar_managed`).
@@ -20650,10 +23021,11 @@ Removes this person's details and answers from every booking now, and ends any b
```go -request := &scheduling.EraseAttendeesRequest{ - UID: "patient_77", +request := &scheduling.DisconnectCalendarsRequest{ + Host: "host_01kd2m9a0b1c2d3e4f5g6h7j8m", + ID: "calconn_01kd2m9a0b1c2d3e4f5g6h7j8m", } -client.Scheduling.Attendees.Erase( +client.Scheduling.Calendars.Disconnect( context.TODO(), request, ) @@ -20671,7 +23043,15 @@ client.Scheduling.Attendees.Erase(
-**uid:** `string` — Your id for the attendee. +**host:** `string` — The host's id or uid. + +
+
+ +
+
+ +**id:** `string` — The connection's id.
@@ -20683,7 +23063,7 @@ client.Scheduling.Attendees.Erase(
-
client.Scheduling.Attendees.EraseByEmail(request) -> *coss.SchedulingAttendeeErasureByEmail +
client.Scheduling.Calendars.Update(Host, CalendarID, request) -> *coss.SchedulingCalendarConnectionList
@@ -20695,7 +23075,7 @@ client.Scheduling.Attendees.Erase(
-Removes this address's details and answers from every booking now, for someone you have no `uid` for, such as a guest. The bookings themselves stay. +Whether its busy times block slots, and whether bookings are written to it.
@@ -20710,10 +23090,14 @@ Removes this address's details and answers from every booking now, for someone y
```go -request := &scheduling.EraseSchedulingAttendeeByEmailRequest{ - Email: "sam@example.com", +request := &scheduling.UpdateCalendarRequest{ + Host: "host_01kd2m9a0b1c2d3e4f5g6h7j8m", + CalendarID: "cal_01kd2m9a0b1c2d3e4f5g6h7j8m", + ReadBusy: coss.Bool( + true, + ), } -client.Scheduling.Attendees.EraseByEmail( +client.Scheduling.Calendars.Update( context.TODO(), request, ) @@ -20731,7 +23115,31 @@ client.Scheduling.Attendees.EraseByEmail(
-**email:** `string` — The address to forget, an attendee's or a guest's. +**host:** `string` — The host's id or uid. + +
+
+ +
+
+ +**calendarID:** `string` — The calendar's id. + +
+
+ +
+
+ +**readBusy:** `*bool` — Whether this calendar's busy times block slots. + +
+
+ +
+
+ +**writeTarget:** `*bool` — Bookings are written to one calendar; setting this moves it here.
@@ -20743,8 +23151,7 @@ client.Scheduling.Attendees.EraseByEmail(
-## Scheduling Calendars -
client.Scheduling.Calendars.Authorize(Host, request) -> *coss.SchedulingCalendarAuthorization +
client.Scheduling.Calendars.SetSimulatedBusy(Host, request) -> error
@@ -20756,7 +23163,7 @@ client.Scheduling.Attendees.EraseByEmail(
-A URL for the host to give consent at Google or Microsoft. Open it in a new window: providers refuse to be framed. Coss.com reads only busy times, and writes events with a neutral title unless the event type's `host_calendar_details` is `full`. +Sandbox environments only: test how bookings react to a busy calendar.
@@ -20771,11 +23178,16 @@ A URL for the host to give consent at Google or Microsoft. Open it in a new wind
```go -request := &scheduling.AuthorizeCalendarRequest{ +request := &scheduling.SetSimulatedBusyRequest{ Host: "host_01kd2m9a0b1c2d3e4f5g6h7j8m", - Provider: scheduling.AuthorizeCalendarRequestProviderGoogle, + Intervals: []*scheduling.SetSimulatedBusyRequestIntervalsItem{ + &scheduling.SetSimulatedBusyRequestIntervalsItem{ + Start: "2027-01-04T15:00:00.000Z", + End: "2027-01-04T16:00:00.000Z", + }, + }, } -client.Scheduling.Calendars.Authorize( +client.Scheduling.Calendars.SetSimulatedBusy( context.TODO(), request, ) @@ -20785,32 +23197,66 @@ client.Scheduling.Calendars.Authorize(
-#### ⚙️ Parameters +#### ⚙️ Parameters + +
+
+ +
+
+ +**host:** `string` — The host's id or uid. + +
+
+ +
+
+ +**intervals:** `[]*scheduling.SetSimulatedBusyRequestIntervalsItem` — The simulated calendar's busy times. + +
+
+
+
+ + + + +
+## Scheduling CalendarDelegations +
client.Scheduling.CalendarDelegations.List() -> *coss.SchedulingCalendarDelegationList
+#### 📝 Description +
-**host:** `string` — The host's id or uid. - -
-
-
-**provider:** `scheduling.AuthorizeCalendarRequestProvider` — Whose consent page to open. CalDAV connects with a password instead. - +With how many hosts each has connected. +
+
+#### 🔌 Usage +
-**returnURL:** `*string` — Where to send the browser afterwards, on one of the environment's allowed origins. `coss_calendar` says what happened: `connected`, `denied` or `invalid`. - +
+
+ +```go +client.Scheduling.CalendarDelegations.List( + context.TODO(), +) +```
@@ -20821,7 +23267,7 @@ client.Scheduling.Calendars.Authorize(
-
client.Scheduling.Calendars.List(Host) -> *coss.SchedulingCalendarConnectionList +
client.Scheduling.CalendarDelegations.Create(request) -> *coss.SchedulingCalendarDelegation
@@ -20833,7 +23279,7 @@ client.Scheduling.Calendars.Authorize(
-With each connection's calendars and which of them count. +An admin authorizes once, and every host on the domain gets their calendar with no consent screen. It stays `pending`: authorize what it returns, then verify it. Credentials are never returned.
@@ -20848,10 +23294,13 @@ With each connection's calendars and which of them count.
```go -request := &scheduling.ListCalendarsRequest{ - Host: "host_01kd2m9a0b1c2d3e4f5g6h7j8m", +request := &coss.CreateCalendarDelegationRequest{ + Google: &coss.CreateCalendarDelegationRequestGoogle{ + Domain: "domain", + ServiceAccountKey: "service_account_key", + }, } -client.Scheduling.Calendars.List( +client.Scheduling.CalendarDelegations.Create( context.TODO(), request, ) @@ -20869,7 +23318,7 @@ client.Scheduling.Calendars.List(
-**host:** `string` — The host's id or uid. +**request:** `*coss.CreateCalendarDelegationRequest`
@@ -20881,7 +23330,7 @@ client.Scheduling.Calendars.List(
-
client.Scheduling.Calendars.Connect(Host, request) -> *coss.SchedulingCalendarConnection +
client.Scheduling.CalendarDelegations.Get(ID) -> *coss.SchedulingCalendarDelegation
@@ -20893,7 +23342,7 @@ client.Scheduling.Calendars.List(
-CalDAV (Apple and others) with an app password, or, in sandbox environments, a `simulated` calendar whose busy times you set yourself. Google and Microsoft use `authorize`. +Its status, what to authorize, and how many hosts it has connected.
@@ -20908,17 +23357,10 @@ CalDAV (Apple and others) with an app password, or, in sandbox environments, a `
```go -request := &scheduling.ConnectCalendarsRequest{ - Host: "host_01kd2m9a0b1c2d3e4f5g6h7j8m", - Body: &coss.CreateCalendarConnectionRequest{ - Caldav: &coss.CreateCalendarConnectionRequestCaldav{ - URL: "url", - Username: "username", - Password: "password", - }, - }, +request := &scheduling.GetCalendarDelegationsRequest{ + ID: "caldlg_01kd2m9a0b1c2d3e4f5g6h7j8m", } -client.Scheduling.Calendars.Connect( +client.Scheduling.CalendarDelegations.Get( context.TODO(), request, ) @@ -20936,15 +23378,7 @@ client.Scheduling.Calendars.Connect(
-**host:** `string` — The host's id or uid. - -
-
- -
-
- -**request:** `*coss.CreateCalendarConnectionRequest` +**id:** `string` — The delegation's id.
@@ -20956,7 +23390,7 @@ client.Scheduling.Calendars.Connect(
-
client.Scheduling.Calendars.Disconnect(Host, ID) -> *coss.DeletedSchedulingCalendarConnection +
client.Scheduling.CalendarDelegations.Delete(ID) -> *coss.DeletedSchedulingCalendarDelegation
@@ -20968,7 +23402,7 @@ client.Scheduling.Calendars.Connect(
-Revokes coss.com's access and deletes every busy time read through it. One a calendar delegation manages is refused (`calendar_managed`). +Its hosts lose these calendars within minutes. They stay bookable with no conflict check, and events already written stay on their calendars, out of reach of later moves or cancellations.
@@ -20983,11 +23417,10 @@ Revokes coss.com's access and deletes every busy time read through it. One a cal
```go -request := &scheduling.DisconnectCalendarsRequest{ - Host: "host_01kd2m9a0b1c2d3e4f5g6h7j8m", - ID: "calconn_01kd2m9a0b1c2d3e4f5g6h7j8m", +request := &scheduling.DeleteCalendarDelegationsRequest{ + ID: "caldlg_01kd2m9a0b1c2d3e4f5g6h7j8m", } -client.Scheduling.Calendars.Disconnect( +client.Scheduling.CalendarDelegations.Delete( context.TODO(), request, ) @@ -21005,15 +23438,7 @@ client.Scheduling.Calendars.Disconnect(
-**host:** `string` — The host's id or uid. - -
-
- -
-
- -**id:** `string` — The connection's id. +**id:** `string` — The delegation's id.
@@ -21025,7 +23450,7 @@ client.Scheduling.Calendars.Disconnect(
-
client.Scheduling.Calendars.Update(Host, CalendarID, request) -> *coss.SchedulingCalendarConnectionList +
client.Scheduling.CalendarDelegations.Update(ID, request) -> *coss.SchedulingCalendarDelegation
@@ -21037,7 +23462,7 @@ client.Scheduling.Calendars.Disconnect(
-Whether its busy times block slots, and whether bookings are written to it. +New credentials are tried on the verified mailbox before they replace the old ones, and end an outage if they work.
@@ -21052,14 +23477,13 @@ Whether its busy times block slots, and whether bookings are written to it.
```go -request := &scheduling.UpdateCalendarRequest{ - Host: "host_01kd2m9a0b1c2d3e4f5g6h7j8m", - CalendarID: "cal_01kd2m9a0b1c2d3e4f5g6h7j8m", - ReadBusy: coss.Bool( - true, +request := &scheduling.UpdateCalendarDelegationRequest{ + ID: "caldlg_01kd2m9a0b1c2d3e4f5g6h7j8m", + MatchHostEmail: coss.Bool( + false, ), } -client.Scheduling.Calendars.Update( +client.Scheduling.CalendarDelegations.Update( context.TODO(), request, ) @@ -21077,7 +23501,7 @@ client.Scheduling.Calendars.Update(
-**host:** `string` — The host's id or uid. +**id:** `string` — The delegation's id.
@@ -21085,7 +23509,7 @@ client.Scheduling.Calendars.Update(
-**calendarID:** `string` — The calendar's id. +**matchHostEmail:** `*bool` — Whether a host's `email` picks their mailbox when `calendar_account` isn't set. Turn it off if end users can type their own email into your app: otherwise one could name a colleague's address and reach that calendar.
@@ -21093,7 +23517,7 @@ client.Scheduling.Calendars.Update(
-**readBusy:** `*bool` — Whether this calendar's busy times block slots. +**serviceAccountKey:** `*string` — A new key. It's tried on the verified mailbox before it replaces the old one.
@@ -21101,7 +23525,15 @@ client.Scheduling.Calendars.Update(
-**writeTarget:** `*bool` — Bookings are written to one calendar; setting this moves it here. +**clientSecret:** `*string` — A new client secret. It's tried on the verified mailbox before it replaces the old one. + +
+
+ +
+
+ +**secretExpiresAt:** `*time.Time` — When the Entra client secret expires. Owners and admins are warned 14 days before.
@@ -21113,7 +23545,7 @@ client.Scheduling.Calendars.Update(
-
client.Scheduling.Calendars.SetSimulatedBusy(Host, request) -> error +
client.Scheduling.CalendarDelegations.Verify(ID, request) -> *coss.SchedulingCalendarDelegation
@@ -21125,7 +23557,7 @@ client.Scheduling.Calendars.Update(
-Sandbox environments only: test how bookings react to a busy calendar. +Tries one real mailbox. Passing makes it `active`, and its hosts start connecting. Google can take up to 24 hours to apply a new authorization, so a refusal may just need time.
@@ -21140,16 +23572,11 @@ Sandbox environments only: test how bookings react to a busy calendar.
```go -request := &scheduling.SetSimulatedBusyRequest{ - Host: "host_01kd2m9a0b1c2d3e4f5g6h7j8m", - Intervals: []*scheduling.SetSimulatedBusyRequestIntervalsItem{ - &scheduling.SetSimulatedBusyRequestIntervalsItem{ - Start: "2027-01-04T15:00:00.000Z", - End: "2027-01-04T16:00:00.000Z", - }, - }, +request := &scheduling.VerifyCalendarDelegationRequest{ + ID: "caldlg_01kd2m9a0b1c2d3e4f5g6h7j8m", + Account: "ana@example.com", } -client.Scheduling.Calendars.SetSimulatedBusy( +client.Scheduling.CalendarDelegations.Verify( context.TODO(), request, ) @@ -21167,7 +23594,7 @@ client.Scheduling.Calendars.SetSimulatedBusy(
-**host:** `string` — The host's id or uid. +**id:** `string` — The delegation's id.
@@ -21175,7 +23602,7 @@ client.Scheduling.Calendars.SetSimulatedBusy(
-**intervals:** `[]*scheduling.SetSimulatedBusyRequestIntervalsItem` — The simulated calendar's busy times. +**account:** `string` — A real mailbox on the domain to try. In Microsoft 365, a user principal name.
@@ -21187,8 +23614,8 @@ client.Scheduling.Calendars.SetSimulatedBusy(
-## Scheduling CalendarDelegations -
client.Scheduling.CalendarDelegations.List() -> *coss.SchedulingCalendarDelegationList +## Scheduling OauthApps +
client.Scheduling.OauthApps.List() -> *coss.SchedulingOauthAppList
@@ -21200,7 +23627,7 @@ client.Scheduling.Calendars.SetSimulatedBusy(
-With how many hosts each has connected. +At most one per provider, with how many connections use each.
@@ -21215,7 +23642,7 @@ With how many hosts each has connected.
```go -client.Scheduling.CalendarDelegations.List( +client.Scheduling.OauthApps.List( context.TODO(), ) ``` @@ -21229,7 +23656,7 @@ client.Scheduling.CalendarDelegations.List(
-
client.Scheduling.CalendarDelegations.Create(request) -> *coss.SchedulingCalendarDelegation +
client.Scheduling.OauthApps.Create(request) -> *coss.SchedulingOauthApp
@@ -21241,7 +23668,7 @@ client.Scheduling.CalendarDelegations.List(
-An admin authorizes once, and every host on the domain gets their calendar with no consent screen. It stays `pending`: authorize what it returns, then verify it. Credentials are never returned. +New consents in this environment use it, so the consent screen shows your brand. Connections made before it stay on coss.com's app until their host consents again. On the Scale plan and above. Secrets are never returned.
@@ -21256,13 +23683,13 @@ An admin authorizes once, and every host on the domain gets their calendar with
```go -request := &coss.CreateCalendarDelegationRequest{ - Google: &coss.CreateCalendarDelegationRequestGoogle{ - Domain: "domain", - ServiceAccountKey: "service_account_key", +request := &coss.CreateOauthAppRequest{ + Google: &coss.CreateOauthAppRequestGoogle{ + ClientID: "client_id", + ClientSecret: "client_secret", }, } -client.Scheduling.CalendarDelegations.Create( +client.Scheduling.OauthApps.Create( context.TODO(), request, ) @@ -21280,7 +23707,7 @@ client.Scheduling.CalendarDelegations.Create(
-**request:** `*coss.CreateCalendarDelegationRequest` +**request:** `*coss.CreateOauthAppRequest`
@@ -21292,7 +23719,7 @@ client.Scheduling.CalendarDelegations.Create(
-
client.Scheduling.CalendarDelegations.Get(ID) -> *coss.SchedulingCalendarDelegation +
client.Scheduling.OauthApps.Get(ID) -> *coss.SchedulingOauthApp
@@ -21304,7 +23731,7 @@ client.Scheduling.CalendarDelegations.Create(
-Its status, what to authorize, and how many hosts it has connected. +Its status, what to register at the provider, and how many connections use it.
@@ -21319,10 +23746,10 @@ Its status, what to authorize, and how many hosts it has connected.
```go -request := &scheduling.GetCalendarDelegationsRequest{ - ID: "caldlg_01kd2m9a0b1c2d3e4f5g6h7j8m", +request := &scheduling.GetOauthAppsRequest{ + ID: "calapp_01kd2m9a0b1c2d3e4f5g6h7j8m", } -client.Scheduling.CalendarDelegations.Get( +client.Scheduling.OauthApps.Get( context.TODO(), request, ) @@ -21340,7 +23767,7 @@ client.Scheduling.CalendarDelegations.Get(
-**id:** `string` — The delegation's id. +**id:** `string` — The OAuth app's id.
@@ -21352,7 +23779,7 @@ client.Scheduling.CalendarDelegations.Get(
-
client.Scheduling.CalendarDelegations.Delete(ID) -> *coss.DeletedSchedulingCalendarDelegation +
client.Scheduling.OauthApps.Delete(ID) -> *coss.DeletedSchedulingOauthApp
@@ -21364,7 +23791,7 @@ client.Scheduling.CalendarDelegations.Get(
-Its hosts lose these calendars within minutes. They stay bookable with no conflict check, and events already written stay on their calendars, out of reach of later moves or cancellations. +Refused while connections use it (`oauth_app_in_use`), since only it can refresh their access: disconnect them first. New consents go back to coss.com's app.
@@ -21379,10 +23806,10 @@ Its hosts lose these calendars within minutes. They stay bookable with no confli
```go -request := &scheduling.DeleteCalendarDelegationsRequest{ - ID: "caldlg_01kd2m9a0b1c2d3e4f5g6h7j8m", +request := &scheduling.DeleteOauthAppsRequest{ + ID: "calapp_01kd2m9a0b1c2d3e4f5g6h7j8m", } -client.Scheduling.CalendarDelegations.Delete( +client.Scheduling.OauthApps.Delete( context.TODO(), request, ) @@ -21400,7 +23827,7 @@ client.Scheduling.CalendarDelegations.Delete(
-**id:** `string` — The delegation's id. +**id:** `string` — The OAuth app's id.
@@ -21412,7 +23839,7 @@ client.Scheduling.CalendarDelegations.Delete(
-
client.Scheduling.CalendarDelegations.Update(ID, request) -> *coss.SchedulingCalendarDelegation +
client.Scheduling.OauthApps.Update(ID, request) -> *coss.SchedulingOauthApp
@@ -21424,7 +23851,7 @@ client.Scheduling.CalendarDelegations.Delete(
-New credentials are tried on the verified mailbox before they replace the old ones, and end an outage if they work. +A new client secret is tried on a connection before it replaces the old one, and ends an outage if it works. Its client ID can't change: a different app needs its hosts to consent again.
@@ -21439,13 +23866,13 @@ New credentials are tried on the verified mailbox before they replace the old on
```go -request := &scheduling.UpdateCalendarDelegationRequest{ - ID: "caldlg_01kd2m9a0b1c2d3e4f5g6h7j8m", - MatchHostEmail: coss.Bool( - false, +request := &scheduling.UpdateOauthAppRequest{ + ID: "calapp_01kd2m9a0b1c2d3e4f5g6h7j8m", + ClientSecret: coss.String( + "GOCSPX-abcdefghijklmnopqrstuvwxyz", ), } -client.Scheduling.CalendarDelegations.Update( +client.Scheduling.OauthApps.Update( context.TODO(), request, ) @@ -21463,7 +23890,7 @@ client.Scheduling.CalendarDelegations.Update(
-**id:** `string` — The delegation's id. +**id:** `string` — The OAuth app's id.
@@ -21471,7 +23898,7 @@ client.Scheduling.CalendarDelegations.Update(
-**matchHostEmail:** `*bool` — Whether a host's `email` picks their mailbox when `calendar_account` isn't set. Turn it off if end users can type their own email into your app: otherwise one could name a colleague's address and reach that calendar. +**clientSecret:** `*string` — A new client secret. It's tried on a connection before it replaces the old one.
@@ -21479,7 +23906,7 @@ client.Scheduling.CalendarDelegations.Update(
-**serviceAccountKey:** `*string` — A new key. It's tried on the verified mailbox before it replaces the old one. +**tenantID:** `*string` — The Directory (tenant) ID, for an app that's only for your own tenant. Leave it out for a multi-tenant app.
@@ -21487,7 +23914,7 @@ client.Scheduling.CalendarDelegations.Update(
-**clientSecret:** `*string` — A new client secret. It's tried on the verified mailbox before it replaces the old one. +**webhookSecret:** `*string` — The Secret Token of your Zoom app, which signs its events at `zoom_event_url`. Never returned.
@@ -21495,7 +23922,23 @@ client.Scheduling.CalendarDelegations.Update(
-**secretExpiresAt:** `*time.Time` — When the Entra client secret expires. Owners and admins are warned 14 days before. +**redirectURI:** `*string` — A page on your own domain, registered with the provider, that forwards `code` and `state` to `coss_callback_url`. Google requires this for an external app, since it has to verify the redirect's domain as yours. Leave it out to use `coss_callback_url` directly. + +
+
+ +
+
+ +**completionURL:** `*string` — Where the browser lands after a consent that didn't name a `return_url`, with `coss_calendar` set to `connected`, `denied` or `invalid`. Leave it out for a plain page saying what happened. + +
+
+ +
+
+ +**secretExpiresAt:** `*time.Time` — When the client secret expires. Owners and admins are warned 14 days before.
@@ -21507,7 +23950,8 @@ client.Scheduling.CalendarDelegations.Update(
-
client.Scheduling.CalendarDelegations.Verify(ID, request) -> *coss.SchedulingCalendarDelegation +## Scheduling Sessions +
client.Scheduling.Sessions.CreateForManager(request) -> *coss.SchedulingSession
@@ -21519,7 +23963,7 @@ client.Scheduling.CalendarDelegations.Update(
-Tries one real mailbox. Passing makes it `active`, and its hosts start connecting. Google can take up to 24 hours to apply a new authorization, so a refusal may just need time. +Lets a team lead manage cover for the hosts you name, or those matching an attribute filter whenever it's asked: time off, bookings that need someone else, and moving them. It never sees attendees' details. Send the `url` to their browser, or embed it with `coss/scheduling`.
@@ -21534,11 +23978,17 @@ Tries one real mailbox. Passing makes it `active`, and its hosts start connectin
```go -request := &scheduling.VerifyCalendarDelegationRequest{ - ID: "caldlg_01kd2m9a0b1c2d3e4f5g6h7j8m", - Account: "ana@example.com", +request := &scheduling.CreateSchedulingManagerSessionRequest{ + HostFilter: map[string]*scheduling.CreateSchedulingManagerSessionRequestHostFilterValue{ + "team": &scheduling.CreateSchedulingManagerSessionRequestHostFilterValue{ + String: "cardiology", + }, + }, + ExpiresIn: coss.Int( + 3600, + ), } -client.Scheduling.CalendarDelegations.Verify( +client.Scheduling.Sessions.CreateForManager( context.TODO(), request, ) @@ -21556,7 +24006,7 @@ client.Scheduling.CalendarDelegations.Verify(
-**id:** `string` — The delegation's id. +**hosts:** `[]string` — The hosts this page can reach, by id or uid.
@@ -21564,7 +24014,23 @@ client.Scheduling.CalendarDelegations.Verify(
-**account:** `string` — A real mailbox on the domain to try. In Microsoft 365, a user principal name. +**hostFilter:** `map[string]*scheduling.CreateSchedulingManagerSessionRequestHostFilterValue` — Everyone matching these attributes, asked again on every request. + +
+
+ +
+
+ +**expiresIn:** `*int` — Seconds until it stops working. At most a day. + +
+
+ +
+
+ +**readOnly:** `*bool`
@@ -21576,7 +24042,6 @@ client.Scheduling.CalendarDelegations.Verify(
-## Scheduling Sessions
client.Scheduling.Sessions.CreateForHost(Host, request) -> *coss.SchedulingSession
@@ -21941,6 +24406,14 @@ client.Scheduling.Settings.Update(
+**privacyURL:** `*string` — Your privacy policy, as an https URL, for hosts connecting a calendar through your own OAuth app. `null` removes it. + +
+
+ +
+
+ **emailFrom:** `*string` — Sender of booking emails, on a verified domain. `null`: coss.com's own address.
@@ -21965,6 +24438,30 @@ client.Scheduling.Settings.Update(
+**nameHostInAttendeeEmails:** `*bool` — Name the new host when telling an attendee their booking has one. + +
+
+ +
+
+ +**hostReassignment:** `*scheduling.UpdateSchedulingSettingsRequestHostReassignment` — Whether hosts can give their own bookings to someone else from their page. `eligible` lets them, to anyone free who takes that event type. + +
+
+ +
+
+ +**outOfOfficeReasons:** `[]*scheduling.UpdateSchedulingSettingsRequestOutOfOfficeReasonsItem` — Reasons of your own, on top of the preset ones. Hosts and managers see them. + +
+
+ +
+
+ **notifications:** `map[string]*scheduling.UpdateSchedulingSettingsRequestNotificationsValue` — Per event (`confirmed`, `pending_approval`, `rescheduled`, `cancelled`, `declined`, `reminder`), overriding the defaults. `null` restores them.
diff --git a/sdks/go/scheduling/bookings.go b/sdks/go/scheduling/bookings.go index 8b300a03d..8d805f54c 100644 --- a/sdks/go/scheduling/bookings.go +++ b/sdks/go/scheduling/bookings.go @@ -516,6 +516,141 @@ func (n *NotificationsBookingsRequest) SetAfter(after *string) { n.require(notificationsBookingsRequestFieldAfter) } +var ( + reassignSchedulingBookingRequestFieldID = big.NewInt(1 << 0) + reassignSchedulingBookingRequestFieldChanges = big.NewInt(1 << 1) + reassignSchedulingBookingRequestFieldReasonCode = big.NewInt(1 << 2) + reassignSchedulingBookingRequestFieldNote = big.NewInt(1 << 3) + reassignSchedulingBookingRequestFieldOverrides = big.NewInt(1 << 4) + reassignSchedulingBookingRequestFieldNotify = big.NewInt(1 << 5) +) + +type ReassignSchedulingBookingRequest struct { + // The booking's id. + ID string `json:"-" url:"-"` + // A session or a one-on-one has one. A collective can change several. + Changes []*ReassignSchedulingBookingRequestChangesItem `json:"changes" url:"-"` + ReasonCode ReassignSchedulingBookingRequestReasonCode `json:"reason_code" url:"-"` + // Why, in your words: required with an override of someone's availability. Encrypted, and only in the booking's history. + Note *string `json:"note,omitempty" url:"-"` + // Go ahead anyway: `any_host` for someone who doesn't take this event type, and the rest for what a candidate's `reason` said. A host who already has something at this time can never be overridden. + Overrides []ReassignSchedulingBookingRequestOverridesItem `json:"overrides,omitempty" url:"-"` + Notify *ReassignSchedulingBookingRequestNotify `json:"notify,omitempty" url:"-"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (r *ReassignSchedulingBookingRequest) require(field *big.Int) { + next := new(big.Int) + if r.explicitFields != nil { + next.Set(r.explicitFields) + } + next.Or(next, field) + r.explicitFields = next +} + +// SetID sets the ID field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *ReassignSchedulingBookingRequest) SetID(id string) { + r.ID = id + r.require(reassignSchedulingBookingRequestFieldID) +} + +// SetChanges sets the Changes field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *ReassignSchedulingBookingRequest) SetChanges(changes []*ReassignSchedulingBookingRequestChangesItem) { + r.Changes = changes + r.require(reassignSchedulingBookingRequestFieldChanges) +} + +// SetReasonCode sets the ReasonCode field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *ReassignSchedulingBookingRequest) SetReasonCode(reasonCode ReassignSchedulingBookingRequestReasonCode) { + r.ReasonCode = reasonCode + r.require(reassignSchedulingBookingRequestFieldReasonCode) +} + +// SetNote sets the Note field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *ReassignSchedulingBookingRequest) SetNote(note *string) { + r.Note = note + r.require(reassignSchedulingBookingRequestFieldNote) +} + +// SetOverrides sets the Overrides field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *ReassignSchedulingBookingRequest) SetOverrides(overrides []ReassignSchedulingBookingRequestOverridesItem) { + r.Overrides = overrides + r.require(reassignSchedulingBookingRequestFieldOverrides) +} + +// SetNotify sets the Notify field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *ReassignSchedulingBookingRequest) SetNotify(notify *ReassignSchedulingBookingRequestNotify) { + r.Notify = notify + r.require(reassignSchedulingBookingRequestFieldNotify) +} + +func (r *ReassignSchedulingBookingRequest) UnmarshalJSON(data []byte) error { + type unmarshaler ReassignSchedulingBookingRequest + var body unmarshaler + if err := json.Unmarshal(data, &body); err != nil { + return err + } + *r = ReassignSchedulingBookingRequest(body) + return nil +} + +func (r *ReassignSchedulingBookingRequest) MarshalJSON() ([]byte, error) { + type embed ReassignSchedulingBookingRequest + var marshaler = struct { + embed + }{ + embed: embed(*r), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, r.explicitFields) + return json.Marshal(explicitMarshaler) +} + +var ( + reassignCandidatesBookingsRequestFieldID = big.NewInt(1 << 0) + reassignCandidatesBookingsRequestFieldFromHost = big.NewInt(1 << 1) +) + +type ReassignCandidatesBookingsRequest struct { + // The booking's id. + ID string `json:"-" url:"-"` + // The host who'd leave, when it could be several. + FromHost *string `json:"-" url:"from_host,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (r *ReassignCandidatesBookingsRequest) require(field *big.Int) { + next := new(big.Int) + if r.explicitFields != nil { + next.Set(r.explicitFields) + } + next.Or(next, field) + r.explicitFields = next +} + +// SetID sets the ID field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *ReassignCandidatesBookingsRequest) SetID(id string) { + r.ID = id + r.require(reassignCandidatesBookingsRequestFieldID) +} + +// SetFromHost sets the FromHost field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *ReassignCandidatesBookingsRequest) SetFromHost(fromHost *string) { + r.FromHost = fromHost + r.require(reassignCandidatesBookingsRequestFieldFromHost) +} + var ( rescheduleBookingRequestFieldID = big.NewInt(1 << 0) rescheduleBookingRequestFieldStart = big.NewInt(1 << 1) @@ -1493,6 +1628,299 @@ func (l ListBookingsRequestStatus) Ptr() *ListBookingsRequestStatus { return &l } +var ( + reassignSchedulingBookingRequestChangesItemFieldFromHost = big.NewInt(1 << 0) + reassignSchedulingBookingRequestChangesItemFieldToHost = big.NewInt(1 << 1) + reassignSchedulingBookingRequestChangesItemFieldAuto = big.NewInt(1 << 2) + reassignSchedulingBookingRequestChangesItemFieldPreferredHosts = big.NewInt(1 << 3) +) + +type ReassignSchedulingBookingRequestChangesItem struct { + // The host leaving, by id or uid. Needed when it could be several. + FromHost *string `json:"from_host,omitempty" url:"from_host,omitempty"` + // The host taking over, by id or uid. Or set `auto`. + ToHost *string `json:"to_host,omitempty" url:"to_host,omitempty"` + // Let coss.com pick, as a pool would: the fairest who's free and fits what the booking was routed with. + Auto *bool `json:"auto,omitempty" url:"auto,omitempty"` + // With `auto`: try these first, in order. + PreferredHosts []string `json:"preferred_hosts,omitempty" url:"preferred_hosts,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + + extraProperties map[string]interface{} + rawJSON json.RawMessage +} + +func (r *ReassignSchedulingBookingRequestChangesItem) GetFromHost() *string { + if r == nil { + return nil + } + return r.FromHost +} + +func (r *ReassignSchedulingBookingRequestChangesItem) GetToHost() *string { + if r == nil { + return nil + } + return r.ToHost +} + +func (r *ReassignSchedulingBookingRequestChangesItem) GetAuto() *bool { + if r == nil { + return nil + } + return r.Auto +} + +func (r *ReassignSchedulingBookingRequestChangesItem) GetPreferredHosts() []string { + if r == nil { + return nil + } + return r.PreferredHosts +} + +func (r *ReassignSchedulingBookingRequestChangesItem) GetExtraProperties() map[string]interface{} { + if r == nil { + return nil + } + return r.extraProperties +} + +func (r *ReassignSchedulingBookingRequestChangesItem) require(field *big.Int) { + next := new(big.Int) + if r.explicitFields != nil { + next.Set(r.explicitFields) + } + next.Or(next, field) + r.explicitFields = next +} + +// SetFromHost sets the FromHost field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *ReassignSchedulingBookingRequestChangesItem) SetFromHost(fromHost *string) { + r.FromHost = fromHost + r.require(reassignSchedulingBookingRequestChangesItemFieldFromHost) +} + +// SetToHost sets the ToHost field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *ReassignSchedulingBookingRequestChangesItem) SetToHost(toHost *string) { + r.ToHost = toHost + r.require(reassignSchedulingBookingRequestChangesItemFieldToHost) +} + +// SetAuto sets the Auto field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *ReassignSchedulingBookingRequestChangesItem) SetAuto(auto *bool) { + r.Auto = auto + r.require(reassignSchedulingBookingRequestChangesItemFieldAuto) +} + +// SetPreferredHosts sets the PreferredHosts field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *ReassignSchedulingBookingRequestChangesItem) SetPreferredHosts(preferredHosts []string) { + r.PreferredHosts = preferredHosts + r.require(reassignSchedulingBookingRequestChangesItemFieldPreferredHosts) +} + +func (r *ReassignSchedulingBookingRequestChangesItem) UnmarshalJSON(data []byte) error { + type unmarshaler ReassignSchedulingBookingRequestChangesItem + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *r = ReassignSchedulingBookingRequestChangesItem(value) + extraProperties, err := internal.ExtractExtraProperties(data, *r) + if err != nil { + return err + } + r.extraProperties = extraProperties + r.rawJSON = json.RawMessage(data) + return nil +} + +func (r *ReassignSchedulingBookingRequestChangesItem) MarshalJSON() ([]byte, error) { + type embed ReassignSchedulingBookingRequestChangesItem + var marshaler = struct { + embed + }{ + embed: embed(*r), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, r.explicitFields) + return json.Marshal(explicitMarshaler) +} + +func (r *ReassignSchedulingBookingRequestChangesItem) String() string { + if r == nil { + return "" + } + if len(r.rawJSON) > 0 { + if value, err := internal.StringifyJSON(r.rawJSON); err == nil { + return value + } + } + if value, err := internal.StringifyJSON(r); err == nil { + return value + } + return fmt.Sprintf("%#v", r) +} + +var ( + reassignSchedulingBookingRequestNotifyFieldAttendee = big.NewInt(1 << 0) +) + +type ReassignSchedulingBookingRequestNotify struct { + // Tell the attendee. Default: true. + Attendee *bool `json:"attendee,omitempty" url:"attendee,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + + extraProperties map[string]interface{} + rawJSON json.RawMessage +} + +func (r *ReassignSchedulingBookingRequestNotify) GetAttendee() *bool { + if r == nil { + return nil + } + return r.Attendee +} + +func (r *ReassignSchedulingBookingRequestNotify) GetExtraProperties() map[string]interface{} { + if r == nil { + return nil + } + return r.extraProperties +} + +func (r *ReassignSchedulingBookingRequestNotify) require(field *big.Int) { + next := new(big.Int) + if r.explicitFields != nil { + next.Set(r.explicitFields) + } + next.Or(next, field) + r.explicitFields = next +} + +// SetAttendee sets the Attendee field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *ReassignSchedulingBookingRequestNotify) SetAttendee(attendee *bool) { + r.Attendee = attendee + r.require(reassignSchedulingBookingRequestNotifyFieldAttendee) +} + +func (r *ReassignSchedulingBookingRequestNotify) UnmarshalJSON(data []byte) error { + type unmarshaler ReassignSchedulingBookingRequestNotify + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *r = ReassignSchedulingBookingRequestNotify(value) + extraProperties, err := internal.ExtractExtraProperties(data, *r) + if err != nil { + return err + } + r.extraProperties = extraProperties + r.rawJSON = json.RawMessage(data) + return nil +} + +func (r *ReassignSchedulingBookingRequestNotify) MarshalJSON() ([]byte, error) { + type embed ReassignSchedulingBookingRequestNotify + var marshaler = struct { + embed + }{ + embed: embed(*r), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, r.explicitFields) + return json.Marshal(explicitMarshaler) +} + +func (r *ReassignSchedulingBookingRequestNotify) String() string { + if r == nil { + return "" + } + if len(r.rawJSON) > 0 { + if value, err := internal.StringifyJSON(r.rawJSON); err == nil { + return value + } + } + if value, err := internal.StringifyJSON(r); err == nil { + return value + } + return fmt.Sprintf("%#v", r) +} + +type ReassignSchedulingBookingRequestOverridesItem string + +const ( + ReassignSchedulingBookingRequestOverridesItemAnyHost ReassignSchedulingBookingRequestOverridesItem = "any_host" + ReassignSchedulingBookingRequestOverridesItemOutOfOffice ReassignSchedulingBookingRequestOverridesItem = "out_of_office" + ReassignSchedulingBookingRequestOverridesItemOutsideAvailability ReassignSchedulingBookingRequestOverridesItem = "outside_availability" + ReassignSchedulingBookingRequestOverridesItemHostBusy ReassignSchedulingBookingRequestOverridesItem = "host_busy" + ReassignSchedulingBookingRequestOverridesItemLimitReached ReassignSchedulingBookingRequestOverridesItem = "limit_reached" + ReassignSchedulingBookingRequestOverridesItemCalendarUnverified ReassignSchedulingBookingRequestOverridesItem = "calendar_unverified" +) + +func NewReassignSchedulingBookingRequestOverridesItemFromString(s string) (ReassignSchedulingBookingRequestOverridesItem, error) { + switch s { + case "any_host": + return ReassignSchedulingBookingRequestOverridesItemAnyHost, nil + case "out_of_office": + return ReassignSchedulingBookingRequestOverridesItemOutOfOffice, nil + case "outside_availability": + return ReassignSchedulingBookingRequestOverridesItemOutsideAvailability, nil + case "host_busy": + return ReassignSchedulingBookingRequestOverridesItemHostBusy, nil + case "limit_reached": + return ReassignSchedulingBookingRequestOverridesItemLimitReached, nil + case "calendar_unverified": + return ReassignSchedulingBookingRequestOverridesItemCalendarUnverified, nil + } + var t ReassignSchedulingBookingRequestOverridesItem + return "", fmt.Errorf("%s is not a valid %T", s, t) +} + +func (r ReassignSchedulingBookingRequestOverridesItem) Ptr() *ReassignSchedulingBookingRequestOverridesItem { + return &r +} + +type ReassignSchedulingBookingRequestReasonCode string + +const ( + ReassignSchedulingBookingRequestReasonCodeHostUnavailable ReassignSchedulingBookingRequestReasonCode = "host_unavailable" + ReassignSchedulingBookingRequestReasonCodeOutOfOffice ReassignSchedulingBookingRequestReasonCode = "out_of_office" + ReassignSchedulingBookingRequestReasonCodeWorkload ReassignSchedulingBookingRequestReasonCode = "workload" + ReassignSchedulingBookingRequestReasonCodeCustomerRequest ReassignSchedulingBookingRequestReasonCode = "customer_request" + ReassignSchedulingBookingRequestReasonCodeOffboarding ReassignSchedulingBookingRequestReasonCode = "offboarding" + ReassignSchedulingBookingRequestReasonCodeOther ReassignSchedulingBookingRequestReasonCode = "other" +) + +func NewReassignSchedulingBookingRequestReasonCodeFromString(s string) (ReassignSchedulingBookingRequestReasonCode, error) { + switch s { + case "host_unavailable": + return ReassignSchedulingBookingRequestReasonCodeHostUnavailable, nil + case "out_of_office": + return ReassignSchedulingBookingRequestReasonCodeOutOfOffice, nil + case "workload": + return ReassignSchedulingBookingRequestReasonCodeWorkload, nil + case "customer_request": + return ReassignSchedulingBookingRequestReasonCodeCustomerRequest, nil + case "offboarding": + return ReassignSchedulingBookingRequestReasonCodeOffboarding, nil + case "other": + return ReassignSchedulingBookingRequestReasonCodeOther, nil + } + var t ReassignSchedulingBookingRequestReasonCode + return "", fmt.Errorf("%s is not a valid %T", s, t) +} + +func (r ReassignSchedulingBookingRequestReasonCode) Ptr() *ReassignSchedulingBookingRequestReasonCode { + return &r +} + var ( updateBookingLocationRequestFieldID = big.NewInt(1 << 0) updateBookingLocationRequestFieldLocation = big.NewInt(1 << 1) @@ -1501,7 +1929,7 @@ var ( type UpdateBookingLocationRequest struct { // The booking's id. ID string `json:"-" url:"-"` - Location *cossgo.SchedulingLocation `json:"location" url:"-"` + Location *cossgo.SchedulingLocation `json:"location,omitempty" url:"-"` // Private bitmask of fields set to an explicit value and therefore not to be omitted explicitFields *big.Int `json:"-" url:"-"` diff --git a/sdks/go/scheduling/bookings/client.go b/sdks/go/scheduling/bookings/client.go index 1da683255..19719d2e0 100644 --- a/sdks/go/scheduling/bookings/client.go +++ b/sdks/go/scheduling/bookings/client.go @@ -43,6 +43,68 @@ func NewClient(options *core.RequestOptions) *Client { } } +// Gives a booking to another host, keeping its id and time. Works for every kind: a group session moves as a whole, from any of its seats, and one that's already started changes for the record, with nobody told. Whoever leaves and joins is told, and the attendee unless you say not to. +// +// Example: +// +// request := &scheduling.ReassignSchedulingBookingRequest{ +// ID: "book_01kd2m9a0b1c2d3e4f5g6h7j8m", +// Changes: []*scheduling.ReassignSchedulingBookingRequestChangesItem{ +// &scheduling.ReassignSchedulingBookingRequestChangesItem{ +// ToHost: coss.String( +// "doctor_518", +// ), +// }, +// }, +// ReasonCode: scheduling.ReassignSchedulingBookingRequestReasonCodeOutOfOffice, +// } +// client.Scheduling.Bookings.Reassign( +// context.TODO(), +// request, +// ) +func (c *Client) Reassign( + ctx context.Context, + request *scheduling.ReassignSchedulingBookingRequest, + opts ...option.RequestOption, +) (*coss.SchedulingBooking, error) { + response, err := c.WithRawResponse.Reassign( + ctx, + request, + opts..., + ) + if err != nil { + return nil, err + } + return response.Body, nil +} + +// The environment's other active hosts: members of the event type first, in the order a pool would pick them, each saying whether they're free and why not. Things can change before you ask: reassigning decides again. +// +// Example: +// +// request := &scheduling.ReassignCandidatesBookingsRequest{ +// ID: "book_01kd2m9a0b1c2d3e4f5g6h7j8m", +// } +// client.Scheduling.Bookings.ReassignCandidates( +// context.TODO(), +// request, +// ) +func (c *Client) ReassignCandidates( + ctx context.Context, + request *scheduling.ReassignCandidatesBookingsRequest, + opts ...option.RequestOption, +) (*coss.SchedulingReassignCandidateList, error) { + response, err := c.WithRawResponse.ReassignCandidates( + ctx, + request, + opts..., + ) + if err != nil { + return nil, err + } + return response.Body, nil +} + // The environment's bookings, newest first. Answers aren't included. // // Example: @@ -345,7 +407,8 @@ func (c *Client) MarkNoShow( // request := &scheduling.UpdateBookingLocationRequest{ // ID: "book_01kd2m9a0b1c2d3e4f5g6h7j8m", // Location: &coss.SchedulingLocation{ -// Link: &coss.SchedulingLocationLink{ +// SchedulingLocationZero: &coss.SchedulingLocationZero{ +// Type: coss.SchedulingLocationZeroTypeLink, // URL: coss.String( // "https://meet.example.com/abc", // ), diff --git a/sdks/go/scheduling/bookings/raw_client.go b/sdks/go/scheduling/bookings/raw_client.go index 5d7c1c394..31ddc68e6 100644 --- a/sdks/go/scheduling/bookings/raw_client.go +++ b/sdks/go/scheduling/bookings/raw_client.go @@ -33,6 +33,107 @@ func NewRawClient(options *core.RequestOptions) *RawClient { } } +func (r *RawClient) Reassign( + ctx context.Context, + request *scheduling.ReassignSchedulingBookingRequest, + opts ...option.RequestOption, +) (*core.Response[*coss.SchedulingBooking], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "https://api.coss.com", + ) + endpointURL := internal.EncodeURL( + baseURL+"/v1/scheduling/bookings/%v/reassign", + request.ID, + ) + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + headers.Add("Content-Type", "application/json") + core.SetIdempotencyKeyHeader(headers) + + var response *coss.SchedulingBooking + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodPost, + Headers: headers, + MaxAttempts: options.MaxAttempts, + DisableRetries: true, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Request: request, + Response: &response, + ErrorDecoder: internal.NewErrorDecoder(scheduling.ErrorCodes), + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*coss.SchedulingBooking]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} + +func (r *RawClient) ReassignCandidates( + ctx context.Context, + request *scheduling.ReassignCandidatesBookingsRequest, + opts ...option.RequestOption, +) (*core.Response[*coss.SchedulingReassignCandidateList], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "https://api.coss.com", + ) + endpointURL := internal.EncodeURL( + baseURL+"/v1/scheduling/bookings/%v/reassign_candidates", + request.ID, + ) + queryParams, err := internal.QueryValues(request) + if err != nil { + return nil, err + } + if len(queryParams) > 0 { + endpointURL += "?" + queryParams.Encode() + } + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *coss.SchedulingReassignCandidateList + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + DisableRetries: options.DisableRetries, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + ErrorDecoder: internal.NewErrorDecoder(scheduling.ErrorCodes), + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*coss.SchedulingReassignCandidateList]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} + func (r *RawClient) List( ctx context.Context, request *scheduling.ListBookingsRequest, diff --git a/sdks/go/scheduling/bookings_test.go b/sdks/go/scheduling/bookings_test.go index 4d5c39246..034518825 100644 --- a/sdks/go/scheduling/bookings_test.go +++ b/sdks/go/scheduling/bookings_test.go @@ -1273,6 +1273,330 @@ func TestSettersMarkExplicitNotificationsBookingsRequest(t *testing.T) { } +func TestSettersReassignSchedulingBookingRequest(t *testing.T) { + t.Run("SetID", func(t *testing.T) { + obj := &ReassignSchedulingBookingRequest{} + var fernTestValueID string + obj.SetID(fernTestValueID) + assert.Equal(t, fernTestValueID, obj.ID) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetChanges", func(t *testing.T) { + obj := &ReassignSchedulingBookingRequest{} + var fernTestValueChanges []*ReassignSchedulingBookingRequestChangesItem + obj.SetChanges(fernTestValueChanges) + assert.Equal(t, fernTestValueChanges, obj.Changes) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetReasonCode", func(t *testing.T) { + obj := &ReassignSchedulingBookingRequest{} + var fernTestValueReasonCode ReassignSchedulingBookingRequestReasonCode + obj.SetReasonCode(fernTestValueReasonCode) + assert.Equal(t, fernTestValueReasonCode, obj.ReasonCode) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetNote", func(t *testing.T) { + obj := &ReassignSchedulingBookingRequest{} + var fernTestValueNote *string + obj.SetNote(fernTestValueNote) + assert.Equal(t, fernTestValueNote, obj.Note) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetOverrides", func(t *testing.T) { + obj := &ReassignSchedulingBookingRequest{} + var fernTestValueOverrides []ReassignSchedulingBookingRequestOverridesItem + obj.SetOverrides(fernTestValueOverrides) + assert.Equal(t, fernTestValueOverrides, obj.Overrides) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetNotify", func(t *testing.T) { + obj := &ReassignSchedulingBookingRequest{} + var fernTestValueNotify *ReassignSchedulingBookingRequestNotify + obj.SetNotify(fernTestValueNotify) + assert.Equal(t, fernTestValueNotify, obj.Notify) + assert.NotNil(t, obj.explicitFields) + }) + +} + +func TestSettersMarkExplicitReassignSchedulingBookingRequest(t *testing.T) { + t.Run("SetID_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &ReassignSchedulingBookingRequest{} + var fernTestValueID string + + // Act + obj.SetID(fernTestValueID) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetChanges_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &ReassignSchedulingBookingRequest{} + var fernTestValueChanges []*ReassignSchedulingBookingRequestChangesItem + + // Act + obj.SetChanges(fernTestValueChanges) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetReasonCode_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &ReassignSchedulingBookingRequest{} + var fernTestValueReasonCode ReassignSchedulingBookingRequestReasonCode + + // Act + obj.SetReasonCode(fernTestValueReasonCode) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetNote_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &ReassignSchedulingBookingRequest{} + var fernTestValueNote *string + + // Act + obj.SetNote(fernTestValueNote) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetOverrides_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &ReassignSchedulingBookingRequest{} + var fernTestValueOverrides []ReassignSchedulingBookingRequestOverridesItem + + // Act + obj.SetOverrides(fernTestValueOverrides) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetNotify_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &ReassignSchedulingBookingRequest{} + var fernTestValueNotify *ReassignSchedulingBookingRequestNotify + + // Act + obj.SetNotify(fernTestValueNotify) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + +} + +func TestSettersReassignCandidatesBookingsRequest(t *testing.T) { + t.Run("SetID", func(t *testing.T) { + obj := &ReassignCandidatesBookingsRequest{} + var fernTestValueID string + obj.SetID(fernTestValueID) + assert.Equal(t, fernTestValueID, obj.ID) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetFromHost", func(t *testing.T) { + obj := &ReassignCandidatesBookingsRequest{} + var fernTestValueFromHost *string + obj.SetFromHost(fernTestValueFromHost) + assert.Equal(t, fernTestValueFromHost, obj.FromHost) + assert.NotNil(t, obj.explicitFields) + }) + +} + +func TestSettersMarkExplicitReassignCandidatesBookingsRequest(t *testing.T) { + t.Run("SetID_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &ReassignCandidatesBookingsRequest{} + var fernTestValueID string + + // Act + obj.SetID(fernTestValueID) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetFromHost_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &ReassignCandidatesBookingsRequest{} + var fernTestValueFromHost *string + + // Act + obj.SetFromHost(fernTestValueFromHost) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + +} + func TestSettersRescheduleBookingRequest(t *testing.T) { t.Run("SetID", func(t *testing.T) { obj := &RescheduleBookingRequest{} @@ -1717,83 +2041,245 @@ func TestGettersCreateBookingRequestLocation(t *testing.T) { t.Run("GetZoom_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &CreateBookingRequestLocation{} - obj.Zoom = nil + obj := &CreateBookingRequestLocation{} + obj.Zoom = nil + + // Act & Assert + assert.Nil(t, obj.GetZoom(), "getter should return nil when property is nil") + }) + + t.Run("GetZoom_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *CreateBookingRequestLocation + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetZoom() // Should return zero value + }) + +} + +func TestSettersCreateBookingRequestLocationInPerson(t *testing.T) { + t.Run("SetAddress", func(t *testing.T) { + obj := &CreateBookingRequestLocationInPerson{} + var fernTestValueAddress *string + obj.SetAddress(fernTestValueAddress) + assert.Equal(t, fernTestValueAddress, obj.Address) + assert.NotNil(t, obj.explicitFields) + }) + +} + +func TestGettersCreateBookingRequestLocationInPerson(t *testing.T) { + t.Run("GetAddress", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &CreateBookingRequestLocationInPerson{} + var expected *string + obj.Address = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetAddress(), "getter should return the property value") + }) + + t.Run("GetAddress_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &CreateBookingRequestLocationInPerson{} + obj.Address = nil + + // Act & Assert + assert.Nil(t, obj.GetAddress(), "getter should return nil when property is nil") + }) + + t.Run("GetAddress_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *CreateBookingRequestLocationInPerson + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetAddress() // Should return zero value + }) + +} + +func TestSettersMarkExplicitCreateBookingRequestLocationInPerson(t *testing.T) { + t.Run("SetAddress_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &CreateBookingRequestLocationInPerson{} + var fernTestValueAddress *string + + // Act + obj.SetAddress(fernTestValueAddress) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + +} + +func TestSettersCreateBookingRequestLocationLink(t *testing.T) { + t.Run("SetURL", func(t *testing.T) { + obj := &CreateBookingRequestLocationLink{} + var fernTestValueURL *string + obj.SetURL(fernTestValueURL) + assert.Equal(t, fernTestValueURL, obj.URL) + assert.NotNil(t, obj.explicitFields) + }) + +} + +func TestGettersCreateBookingRequestLocationLink(t *testing.T) { + t.Run("GetURL", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &CreateBookingRequestLocationLink{} + var expected *string + obj.URL = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetURL(), "getter should return the property value") + }) + + t.Run("GetURL_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &CreateBookingRequestLocationLink{} + obj.URL = nil // Act & Assert - assert.Nil(t, obj.GetZoom(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetURL(), "getter should return nil when property is nil") }) - t.Run("GetZoom_NilReceiver", func(t *testing.T) { + t.Run("GetURL_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *CreateBookingRequestLocation + var obj *CreateBookingRequestLocationLink // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetZoom() // Should return zero value + _ = obj.GetURL() // Should return zero value }) } -func TestSettersCreateBookingRequestLocationInPerson(t *testing.T) { - t.Run("SetAddress", func(t *testing.T) { - obj := &CreateBookingRequestLocationInPerson{} - var fernTestValueAddress *string - obj.SetAddress(fernTestValueAddress) - assert.Equal(t, fernTestValueAddress, obj.Address) +func TestSettersMarkExplicitCreateBookingRequestLocationLink(t *testing.T) { + t.Run("SetURL_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &CreateBookingRequestLocationLink{} + var fernTestValueURL *string + + // Act + obj.SetURL(fernTestValueURL) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + +} + +func TestSettersCreateBookingRequestLocationPhone(t *testing.T) { + t.Run("SetNumber", func(t *testing.T) { + obj := &CreateBookingRequestLocationPhone{} + var fernTestValueNumber *string + obj.SetNumber(fernTestValueNumber) + assert.Equal(t, fernTestValueNumber, obj.Number) assert.NotNil(t, obj.explicitFields) }) } -func TestGettersCreateBookingRequestLocationInPerson(t *testing.T) { - t.Run("GetAddress", func(t *testing.T) { +func TestGettersCreateBookingRequestLocationPhone(t *testing.T) { + t.Run("GetNumber", func(t *testing.T) { t.Parallel() // Arrange - obj := &CreateBookingRequestLocationInPerson{} + obj := &CreateBookingRequestLocationPhone{} var expected *string - obj.Address = expected + obj.Number = expected // Act & Assert - assert.Equal(t, expected, obj.GetAddress(), "getter should return the property value") + assert.Equal(t, expected, obj.GetNumber(), "getter should return the property value") }) - t.Run("GetAddress_NilValue", func(t *testing.T) { + t.Run("GetNumber_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &CreateBookingRequestLocationInPerson{} - obj.Address = nil + obj := &CreateBookingRequestLocationPhone{} + obj.Number = nil // Act & Assert - assert.Nil(t, obj.GetAddress(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetNumber(), "getter should return nil when property is nil") }) - t.Run("GetAddress_NilReceiver", func(t *testing.T) { + t.Run("GetNumber_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *CreateBookingRequestLocationInPerson + var obj *CreateBookingRequestLocationPhone // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetAddress() // Should return zero value + _ = obj.GetNumber() // Should return zero value }) } -func TestSettersMarkExplicitCreateBookingRequestLocationInPerson(t *testing.T) { - t.Run("SetAddress_MarksExplicit", func(t *testing.T) { +func TestSettersMarkExplicitCreateBookingRequestLocationPhone(t *testing.T) { + t.Run("SetNumber_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &CreateBookingRequestLocationInPerson{} - var fernTestValueAddress *string + obj := &CreateBookingRequestLocationPhone{} + var fernTestValueNumber *string // Act - obj.SetAddress(fernTestValueAddress) + obj.SetNumber(fernTestValueNumber) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -1819,9 +2305,9 @@ func TestSettersMarkExplicitCreateBookingRequestLocationInPerson(t *testing.T) { } -func TestSettersCreateBookingRequestLocationLink(t *testing.T) { +func TestSettersCreateBookingRequestLocationZoom(t *testing.T) { t.Run("SetURL", func(t *testing.T) { - obj := &CreateBookingRequestLocationLink{} + obj := &CreateBookingRequestLocationZoom{} var fernTestValueURL *string obj.SetURL(fernTestValueURL) assert.Equal(t, fernTestValueURL, obj.URL) @@ -1830,11 +2316,11 @@ func TestSettersCreateBookingRequestLocationLink(t *testing.T) { } -func TestGettersCreateBookingRequestLocationLink(t *testing.T) { +func TestGettersCreateBookingRequestLocationZoom(t *testing.T) { t.Run("GetURL", func(t *testing.T) { t.Parallel() // Arrange - obj := &CreateBookingRequestLocationLink{} + obj := &CreateBookingRequestLocationZoom{} var expected *string obj.URL = expected @@ -1845,7 +2331,7 @@ func TestGettersCreateBookingRequestLocationLink(t *testing.T) { t.Run("GetURL_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &CreateBookingRequestLocationLink{} + obj := &CreateBookingRequestLocationZoom{} obj.URL = nil // Act & Assert @@ -1854,7 +2340,7 @@ func TestGettersCreateBookingRequestLocationLink(t *testing.T) { t.Run("GetURL_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *CreateBookingRequestLocationLink + var obj *CreateBookingRequestLocationZoom // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -1866,11 +2352,11 @@ func TestGettersCreateBookingRequestLocationLink(t *testing.T) { } -func TestSettersMarkExplicitCreateBookingRequestLocationLink(t *testing.T) { +func TestSettersMarkExplicitCreateBookingRequestLocationZoom(t *testing.T) { t.Run("SetURL_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &CreateBookingRequestLocationLink{} + obj := &CreateBookingRequestLocationZoom{} var fernTestValueURL *string // Act @@ -1900,62 +2386,278 @@ func TestSettersMarkExplicitCreateBookingRequestLocationLink(t *testing.T) { } -func TestSettersCreateBookingRequestLocationPhone(t *testing.T) { - t.Run("SetNumber", func(t *testing.T) { - obj := &CreateBookingRequestLocationPhone{} - var fernTestValueNumber *string - obj.SetNumber(fernTestValueNumber) - assert.Equal(t, fernTestValueNumber, obj.Number) +func TestSettersReassignSchedulingBookingRequestChangesItem(t *testing.T) { + t.Run("SetFromHost", func(t *testing.T) { + obj := &ReassignSchedulingBookingRequestChangesItem{} + var fernTestValueFromHost *string + obj.SetFromHost(fernTestValueFromHost) + assert.Equal(t, fernTestValueFromHost, obj.FromHost) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetToHost", func(t *testing.T) { + obj := &ReassignSchedulingBookingRequestChangesItem{} + var fernTestValueToHost *string + obj.SetToHost(fernTestValueToHost) + assert.Equal(t, fernTestValueToHost, obj.ToHost) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetAuto", func(t *testing.T) { + obj := &ReassignSchedulingBookingRequestChangesItem{} + var fernTestValueAuto *bool + obj.SetAuto(fernTestValueAuto) + assert.Equal(t, fernTestValueAuto, obj.Auto) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetPreferredHosts", func(t *testing.T) { + obj := &ReassignSchedulingBookingRequestChangesItem{} + var fernTestValuePreferredHosts []string + obj.SetPreferredHosts(fernTestValuePreferredHosts) + assert.Equal(t, fernTestValuePreferredHosts, obj.PreferredHosts) assert.NotNil(t, obj.explicitFields) }) } -func TestGettersCreateBookingRequestLocationPhone(t *testing.T) { - t.Run("GetNumber", func(t *testing.T) { +func TestGettersReassignSchedulingBookingRequestChangesItem(t *testing.T) { + t.Run("GetFromHost", func(t *testing.T) { t.Parallel() // Arrange - obj := &CreateBookingRequestLocationPhone{} + obj := &ReassignSchedulingBookingRequestChangesItem{} var expected *string - obj.Number = expected + obj.FromHost = expected // Act & Assert - assert.Equal(t, expected, obj.GetNumber(), "getter should return the property value") + assert.Equal(t, expected, obj.GetFromHost(), "getter should return the property value") }) - t.Run("GetNumber_NilValue", func(t *testing.T) { + t.Run("GetFromHost_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &CreateBookingRequestLocationPhone{} - obj.Number = nil + obj := &ReassignSchedulingBookingRequestChangesItem{} + obj.FromHost = nil // Act & Assert - assert.Nil(t, obj.GetNumber(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetFromHost(), "getter should return nil when property is nil") }) - t.Run("GetNumber_NilReceiver", func(t *testing.T) { + t.Run("GetFromHost_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *CreateBookingRequestLocationPhone + var obj *ReassignSchedulingBookingRequestChangesItem // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetNumber() // Should return zero value + _ = obj.GetFromHost() // Should return zero value + }) + + t.Run("GetToHost", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &ReassignSchedulingBookingRequestChangesItem{} + var expected *string + obj.ToHost = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetToHost(), "getter should return the property value") + }) + + t.Run("GetToHost_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &ReassignSchedulingBookingRequestChangesItem{} + obj.ToHost = nil + + // Act & Assert + assert.Nil(t, obj.GetToHost(), "getter should return nil when property is nil") + }) + + t.Run("GetToHost_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *ReassignSchedulingBookingRequestChangesItem + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetToHost() // Should return zero value + }) + + t.Run("GetAuto", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &ReassignSchedulingBookingRequestChangesItem{} + var expected *bool + obj.Auto = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetAuto(), "getter should return the property value") + }) + + t.Run("GetAuto_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &ReassignSchedulingBookingRequestChangesItem{} + obj.Auto = nil + + // Act & Assert + assert.Nil(t, obj.GetAuto(), "getter should return nil when property is nil") + }) + + t.Run("GetAuto_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *ReassignSchedulingBookingRequestChangesItem + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetAuto() // Should return zero value + }) + + t.Run("GetPreferredHosts", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &ReassignSchedulingBookingRequestChangesItem{} + var expected []string + obj.PreferredHosts = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetPreferredHosts(), "getter should return the property value") + }) + + t.Run("GetPreferredHosts_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &ReassignSchedulingBookingRequestChangesItem{} + obj.PreferredHosts = nil + + // Act & Assert + assert.Nil(t, obj.GetPreferredHosts(), "getter should return nil when property is nil") + }) + + t.Run("GetPreferredHosts_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *ReassignSchedulingBookingRequestChangesItem + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetPreferredHosts() // Should return zero value + }) + +} + +func TestSettersMarkExplicitReassignSchedulingBookingRequestChangesItem(t *testing.T) { + t.Run("SetFromHost_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &ReassignSchedulingBookingRequestChangesItem{} + var fernTestValueFromHost *string + + // Act + obj.SetFromHost(fernTestValueFromHost) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetToHost_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &ReassignSchedulingBookingRequestChangesItem{} + var fernTestValueToHost *string + + // Act + obj.SetToHost(fernTestValueToHost) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip }) -} + t.Run("SetAuto_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &ReassignSchedulingBookingRequestChangesItem{} + var fernTestValueAuto *bool -func TestSettersMarkExplicitCreateBookingRequestLocationPhone(t *testing.T) { - t.Run("SetNumber_MarksExplicit", func(t *testing.T) { + // Act + obj.SetAuto(fernTestValueAuto) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetPreferredHosts_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &CreateBookingRequestLocationPhone{} - var fernTestValueNumber *string + obj := &ReassignSchedulingBookingRequestChangesItem{} + var fernTestValuePreferredHosts []string // Act - obj.SetNumber(fernTestValueNumber) + obj.SetPreferredHosts(fernTestValuePreferredHosts) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -1981,62 +2683,62 @@ func TestSettersMarkExplicitCreateBookingRequestLocationPhone(t *testing.T) { } -func TestSettersCreateBookingRequestLocationZoom(t *testing.T) { - t.Run("SetURL", func(t *testing.T) { - obj := &CreateBookingRequestLocationZoom{} - var fernTestValueURL *string - obj.SetURL(fernTestValueURL) - assert.Equal(t, fernTestValueURL, obj.URL) +func TestSettersReassignSchedulingBookingRequestNotify(t *testing.T) { + t.Run("SetAttendee", func(t *testing.T) { + obj := &ReassignSchedulingBookingRequestNotify{} + var fernTestValueAttendee *bool + obj.SetAttendee(fernTestValueAttendee) + assert.Equal(t, fernTestValueAttendee, obj.Attendee) assert.NotNil(t, obj.explicitFields) }) } -func TestGettersCreateBookingRequestLocationZoom(t *testing.T) { - t.Run("GetURL", func(t *testing.T) { +func TestGettersReassignSchedulingBookingRequestNotify(t *testing.T) { + t.Run("GetAttendee", func(t *testing.T) { t.Parallel() // Arrange - obj := &CreateBookingRequestLocationZoom{} - var expected *string - obj.URL = expected + obj := &ReassignSchedulingBookingRequestNotify{} + var expected *bool + obj.Attendee = expected // Act & Assert - assert.Equal(t, expected, obj.GetURL(), "getter should return the property value") + assert.Equal(t, expected, obj.GetAttendee(), "getter should return the property value") }) - t.Run("GetURL_NilValue", func(t *testing.T) { + t.Run("GetAttendee_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &CreateBookingRequestLocationZoom{} - obj.URL = nil + obj := &ReassignSchedulingBookingRequestNotify{} + obj.Attendee = nil // Act & Assert - assert.Nil(t, obj.GetURL(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetAttendee(), "getter should return nil when property is nil") }) - t.Run("GetURL_NilReceiver", func(t *testing.T) { + t.Run("GetAttendee_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *CreateBookingRequestLocationZoom + var obj *ReassignSchedulingBookingRequestNotify // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetURL() // Should return zero value + _ = obj.GetAttendee() // Should return zero value }) } -func TestSettersMarkExplicitCreateBookingRequestLocationZoom(t *testing.T) { - t.Run("SetURL_MarksExplicit", func(t *testing.T) { +func TestSettersMarkExplicitReassignSchedulingBookingRequestNotify(t *testing.T) { + t.Run("SetAttendee_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &CreateBookingRequestLocationZoom{} - var fernTestValueURL *string + obj := &ReassignSchedulingBookingRequestNotify{} + var fernTestValueAttendee *bool // Act - obj.SetURL(fernTestValueURL) + obj.SetAttendee(fernTestValueAttendee) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -2344,6 +3046,72 @@ func TestJSONMarshalingCreateBookingRequestLocationZoom(t *testing.T) { }) } +func TestJSONMarshalingReassignSchedulingBookingRequestChangesItem(t *testing.T) { + t.Run("MarshalUnmarshal", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &ReassignSchedulingBookingRequestChangesItem{} + + // Act - Marshal to JSON + data, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed") + assert.NotNil(t, data, "marshaled data should not be nil") + assert.NotEmpty(t, data, "marshaled data should not be empty") + + // Unmarshal back and verify round-trip + var unmarshaled ReassignSchedulingBookingRequestChangesItem + err = json.Unmarshal(data, &unmarshaled) + assert.NoError(t, err, "round-trip unmarshal should succeed") + }) + + t.Run("UnmarshalInvalidJSON", func(t *testing.T) { + t.Parallel() + var obj ReassignSchedulingBookingRequestChangesItem + err := json.Unmarshal([]byte(`{invalid json}`), &obj) + assert.Error(t, err, "unmarshaling invalid JSON should return an error") + }) + + t.Run("UnmarshalEmptyObject", func(t *testing.T) { + t.Parallel() + var obj ReassignSchedulingBookingRequestChangesItem + err := json.Unmarshal([]byte(`{}`), &obj) + assert.NoError(t, err, "unmarshaling empty object should succeed") + }) +} + +func TestJSONMarshalingReassignSchedulingBookingRequestNotify(t *testing.T) { + t.Run("MarshalUnmarshal", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &ReassignSchedulingBookingRequestNotify{} + + // Act - Marshal to JSON + data, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed") + assert.NotNil(t, data, "marshaled data should not be nil") + assert.NotEmpty(t, data, "marshaled data should not be empty") + + // Unmarshal back and verify round-trip + var unmarshaled ReassignSchedulingBookingRequestNotify + err = json.Unmarshal(data, &unmarshaled) + assert.NoError(t, err, "round-trip unmarshal should succeed") + }) + + t.Run("UnmarshalInvalidJSON", func(t *testing.T) { + t.Parallel() + var obj ReassignSchedulingBookingRequestNotify + err := json.Unmarshal([]byte(`{invalid json}`), &obj) + assert.Error(t, err, "unmarshaling invalid JSON should return an error") + }) + + t.Run("UnmarshalEmptyObject", func(t *testing.T) { + t.Parallel() + var obj ReassignSchedulingBookingRequestNotify + err := json.Unmarshal([]byte(`{}`), &obj) + assert.NoError(t, err, "unmarshaling empty object should succeed") + }) +} + func TestOptionalNullableRoundTripCreateBookingRequestLocationInPerson(t *testing.T) { optionalNullableKeys := []string{ "address", @@ -2612,6 +3380,38 @@ func TestStringCreateBookingRequestLocationZoom(t *testing.T) { }) } +func TestStringReassignSchedulingBookingRequestChangesItem(t *testing.T) { + t.Run("StringMethod", func(t *testing.T) { + t.Parallel() + obj := &ReassignSchedulingBookingRequestChangesItem{} + result := obj.String() + assert.NotEmpty(t, result, "String() should return a non-empty representation") + }) + + t.Run("StringMethod_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *ReassignSchedulingBookingRequestChangesItem + result := obj.String() + assert.Equal(t, "", result, "String() should return for nil receiver") + }) +} + +func TestStringReassignSchedulingBookingRequestNotify(t *testing.T) { + t.Run("StringMethod", func(t *testing.T) { + t.Parallel() + obj := &ReassignSchedulingBookingRequestNotify{} + result := obj.String() + assert.NotEmpty(t, result, "String() should return a non-empty representation") + }) + + t.Run("StringMethod_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *ReassignSchedulingBookingRequestNotify + result := obj.String() + assert.Equal(t, "", result, "String() should return for nil receiver") + }) +} + func TestEnumListBookingsRequestStatus(t *testing.T) { t.Run("NewFromString_held", func(t *testing.T) { t.Parallel() @@ -2662,6 +3462,120 @@ func TestEnumListBookingsRequestStatus(t *testing.T) { }) } +func TestEnumReassignSchedulingBookingRequestOverridesItem(t *testing.T) { + t.Run("NewFromString_any_host", func(t *testing.T) { + t.Parallel() + val, err := NewReassignSchedulingBookingRequestOverridesItemFromString("any_host") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, ReassignSchedulingBookingRequestOverridesItem("any_host"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_out_of_office", func(t *testing.T) { + t.Parallel() + val, err := NewReassignSchedulingBookingRequestOverridesItemFromString("out_of_office") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, ReassignSchedulingBookingRequestOverridesItem("out_of_office"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_outside_availability", func(t *testing.T) { + t.Parallel() + val, err := NewReassignSchedulingBookingRequestOverridesItemFromString("outside_availability") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, ReassignSchedulingBookingRequestOverridesItem("outside_availability"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_host_busy", func(t *testing.T) { + t.Parallel() + val, err := NewReassignSchedulingBookingRequestOverridesItemFromString("host_busy") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, ReassignSchedulingBookingRequestOverridesItem("host_busy"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_limit_reached", func(t *testing.T) { + t.Parallel() + val, err := NewReassignSchedulingBookingRequestOverridesItemFromString("limit_reached") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, ReassignSchedulingBookingRequestOverridesItem("limit_reached"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_calendar_unverified", func(t *testing.T) { + t.Parallel() + val, err := NewReassignSchedulingBookingRequestOverridesItemFromString("calendar_unverified") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, ReassignSchedulingBookingRequestOverridesItem("calendar_unverified"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_Invalid", func(t *testing.T) { + _, err := NewReassignSchedulingBookingRequestOverridesItemFromString("invalid_value_that_does_not_exist") + assert.Error(t, err) + }) + + t.Run("Ptr", func(t *testing.T) { + val, err := NewReassignSchedulingBookingRequestOverridesItemFromString("any_host") + assert.NoError(t, err) + ptr := val.Ptr() + assert.NotNil(t, ptr) + assert.Equal(t, val, *ptr) + }) +} + +func TestEnumReassignSchedulingBookingRequestReasonCode(t *testing.T) { + t.Run("NewFromString_host_unavailable", func(t *testing.T) { + t.Parallel() + val, err := NewReassignSchedulingBookingRequestReasonCodeFromString("host_unavailable") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, ReassignSchedulingBookingRequestReasonCode("host_unavailable"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_out_of_office", func(t *testing.T) { + t.Parallel() + val, err := NewReassignSchedulingBookingRequestReasonCodeFromString("out_of_office") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, ReassignSchedulingBookingRequestReasonCode("out_of_office"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_workload", func(t *testing.T) { + t.Parallel() + val, err := NewReassignSchedulingBookingRequestReasonCodeFromString("workload") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, ReassignSchedulingBookingRequestReasonCode("workload"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_customer_request", func(t *testing.T) { + t.Parallel() + val, err := NewReassignSchedulingBookingRequestReasonCodeFromString("customer_request") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, ReassignSchedulingBookingRequestReasonCode("customer_request"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_offboarding", func(t *testing.T) { + t.Parallel() + val, err := NewReassignSchedulingBookingRequestReasonCodeFromString("offboarding") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, ReassignSchedulingBookingRequestReasonCode("offboarding"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_other", func(t *testing.T) { + t.Parallel() + val, err := NewReassignSchedulingBookingRequestReasonCodeFromString("other") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, ReassignSchedulingBookingRequestReasonCode("other"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_Invalid", func(t *testing.T) { + _, err := NewReassignSchedulingBookingRequestReasonCodeFromString("invalid_value_that_does_not_exist") + assert.Error(t, err) + }) + + t.Run("Ptr", func(t *testing.T) { + val, err := NewReassignSchedulingBookingRequestReasonCodeFromString("host_unavailable") + assert.NoError(t, err) + ptr := val.Ptr() + assert.NotNil(t, ptr) + assert.Equal(t, val, *ptr) + }) +} + func TestExtraPropertiesCreateBookingRequestLocationGoogleMeet(t *testing.T) { t.Run("GetExtraProperties", func(t *testing.T) { t.Parallel() @@ -2799,3 +3713,49 @@ func TestExtraPropertiesCreateBookingRequestLocationZoom(t *testing.T) { assert.Nil(t, extraProps, "nil receiver should return nil without panicking") }) } + +func TestExtraPropertiesReassignSchedulingBookingRequestChangesItem(t *testing.T) { + t.Run("GetExtraProperties", func(t *testing.T) { + t.Parallel() + obj := &ReassignSchedulingBookingRequestChangesItem{} + // Should not panic when calling GetExtraProperties() + defer func() { + if r := recover(); r != nil { + t.Errorf("GetExtraProperties() panicked: %v", r) + } + }() + extraProps := obj.GetExtraProperties() + // Result can be nil or an empty/non-empty map + _ = extraProps + }) + + t.Run("GetExtraProperties_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *ReassignSchedulingBookingRequestChangesItem + extraProps := obj.GetExtraProperties() + assert.Nil(t, extraProps, "nil receiver should return nil without panicking") + }) +} + +func TestExtraPropertiesReassignSchedulingBookingRequestNotify(t *testing.T) { + t.Run("GetExtraProperties", func(t *testing.T) { + t.Parallel() + obj := &ReassignSchedulingBookingRequestNotify{} + // Should not panic when calling GetExtraProperties() + defer func() { + if r := recover(); r != nil { + t.Errorf("GetExtraProperties() panicked: %v", r) + } + }() + extraProps := obj.GetExtraProperties() + // Result can be nil or an empty/non-empty map + _ = extraProps + }) + + t.Run("GetExtraProperties_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *ReassignSchedulingBookingRequestNotify + extraProps := obj.GetExtraProperties() + assert.Nil(t, extraProps, "nil receiver should return nil without panicking") + }) +} diff --git a/sdks/go/scheduling/client/client.go b/sdks/go/scheduling/client/client.go index a65fcdf5e..f66797594 100644 --- a/sdks/go/scheduling/client/client.go +++ b/sdks/go/scheduling/client/client.go @@ -14,7 +14,11 @@ import ( calendars "github.com/cosscom/coss-go/scheduling/calendars" eventtypes "github.com/cosscom/coss-go/scheduling/eventtypes" holds "github.com/cosscom/coss-go/scheduling/holds" + holidaycalendars "github.com/cosscom/coss-go/scheduling/holidaycalendars" hosts "github.com/cosscom/coss-go/scheduling/hosts" + oauthapps "github.com/cosscom/coss-go/scheduling/oauthapps" + outofoffice "github.com/cosscom/coss-go/scheduling/outofoffice" + reassignments "github.com/cosscom/coss-go/scheduling/reassignments" schedules "github.com/cosscom/coss-go/scheduling/schedules" series "github.com/cosscom/coss-go/scheduling/series" sessions "github.com/cosscom/coss-go/scheduling/sessions" @@ -24,16 +28,20 @@ import ( type Client struct { Hosts *hosts.Client + Bookings *bookings.Client + Reassignments *reassignments.Client + HolidayCalendars *holidaycalendars.Client + OutOfOffice *outofoffice.Client Schedules *schedules.Client EventTypes *eventtypes.Client Slots *slots.Client Availability *availability.Client - Bookings *bookings.Client Holds *holds.Client Series *series.Client Attendees *attendees.Client Calendars *calendars.Client CalendarDelegations *calendardelegations.Client + OauthApps *oauthapps.Client Sessions *sessions.Client Settings *settings.Client @@ -52,16 +60,20 @@ func NewClient(options *core.RequestOptions) *Client { } return &Client{ Hosts: hosts.NewClient(options), + Bookings: bookings.NewClient(options), + Reassignments: reassignments.NewClient(options), + HolidayCalendars: holidaycalendars.NewClient(options), + OutOfOffice: outofoffice.NewClient(options), Schedules: schedules.NewClient(options), EventTypes: eventtypes.NewClient(options), Slots: slots.NewClient(options), Availability: availability.NewClient(options), - Bookings: bookings.NewClient(options), Holds: holds.NewClient(options), Series: series.NewClient(options), Attendees: attendees.NewClient(options), Calendars: calendars.NewClient(options), CalendarDelegations: calendardelegations.NewClient(options), + OauthApps: oauthapps.NewClient(options), Sessions: sessions.NewClient(options), Settings: settings.NewClient(options), options: options, diff --git a/sdks/go/scheduling/event_types.go b/sdks/go/scheduling/event_types.go index 5351b4183..e8dcc6910 100644 --- a/sdks/go/scheduling/event_types.go +++ b/sdks/go/scheduling/event_types.go @@ -26,20 +26,21 @@ var ( createEventTypeRequestFieldLimits = big.NewInt(1 << 12) createEventTypeRequestFieldCapacity = big.NewInt(1 << 13) createEventTypeRequestFieldRequiresApproval = big.NewInt(1 << 14) - createEventTypeRequestFieldApprovalTTLMinutes = big.NewInt(1 << 15) - createEventTypeRequestFieldHoldTTLSeconds = big.NewInt(1 << 16) - createEventTypeRequestFieldCancelNoticeMinutes = big.NewInt(1 << 17) - createEventTypeRequestFieldRescheduleNoticeMinutes = big.NewInt(1 << 18) - createEventTypeRequestFieldMaxGuests = big.NewInt(1 << 19) - createEventTypeRequestFieldMaxActiveBookingsPerAttendee = big.NewInt(1 << 20) - createEventTypeRequestFieldHostCalendarDetails = big.NewInt(1 << 21) - createEventTypeRequestFieldQuestions = big.NewInt(1 << 22) - createEventTypeRequestFieldLocations = big.NewInt(1 << 23) - createEventTypeRequestFieldHostFilter = big.NewInt(1 << 24) - createEventTypeRequestFieldNotifications = big.NewInt(1 << 25) - createEventTypeRequestFieldReminders = big.NewInt(1 << 26) - createEventTypeRequestFieldMetadata = big.NewInt(1 << 27) - createEventTypeRequestFieldHosts = big.NewInt(1 << 28) + createEventTypeRequestFieldReassignmentEnabled = big.NewInt(1 << 15) + createEventTypeRequestFieldApprovalTTLMinutes = big.NewInt(1 << 16) + createEventTypeRequestFieldHoldTTLSeconds = big.NewInt(1 << 17) + createEventTypeRequestFieldCancelNoticeMinutes = big.NewInt(1 << 18) + createEventTypeRequestFieldRescheduleNoticeMinutes = big.NewInt(1 << 19) + createEventTypeRequestFieldMaxGuests = big.NewInt(1 << 20) + createEventTypeRequestFieldMaxActiveBookingsPerAttendee = big.NewInt(1 << 21) + createEventTypeRequestFieldHostCalendarDetails = big.NewInt(1 << 22) + createEventTypeRequestFieldQuestions = big.NewInt(1 << 23) + createEventTypeRequestFieldLocations = big.NewInt(1 << 24) + createEventTypeRequestFieldHostFilter = big.NewInt(1 << 25) + createEventTypeRequestFieldNotifications = big.NewInt(1 << 26) + createEventTypeRequestFieldReminders = big.NewInt(1 << 27) + createEventTypeRequestFieldMetadata = big.NewInt(1 << 28) + createEventTypeRequestFieldHosts = big.NewInt(1 << 29) ) type CreateEventTypeRequest struct { @@ -72,6 +73,8 @@ type CreateEventTypeRequest struct { Capacity *int `json:"capacity,omitempty" url:"-"` // Bookings start as `pending_approval`, holding the time until approved or declined. Default: `false`. RequiresApproval *bool `json:"requires_approval,omitempty" url:"-"` + // Whether bookings of this event type can go to another host. Default: true. + ReassignmentEnabled *bool `json:"reassignment_enabled,omitempty" url:"-"` // How long a booking can wait for approval before it's declined, in minutes. Default: 1440. ApprovalTTLMinutes *int `json:"approval_ttl_minutes,omitempty" url:"-"` // How long a hold keeps its slot, in seconds. Default: 600. @@ -219,6 +222,13 @@ func (c *CreateEventTypeRequest) SetRequiresApproval(requiresApproval *bool) { c.require(createEventTypeRequestFieldRequiresApproval) } +// SetReassignmentEnabled sets the ReassignmentEnabled field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreateEventTypeRequest) SetReassignmentEnabled(reassignmentEnabled *bool) { + c.ReassignmentEnabled = reassignmentEnabled + c.require(createEventTypeRequestFieldReassignmentEnabled) +} + // SetApprovalTTLMinutes sets the ApprovalTTLMinutes field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. func (c *CreateEventTypeRequest) SetApprovalTTLMinutes(approvalTTLMinutes *int) { @@ -877,21 +887,22 @@ var ( updateEventTypeRequestFieldLimits = big.NewInt(1 << 12) updateEventTypeRequestFieldCapacity = big.NewInt(1 << 13) updateEventTypeRequestFieldRequiresApproval = big.NewInt(1 << 14) - updateEventTypeRequestFieldApprovalTTLMinutes = big.NewInt(1 << 15) - updateEventTypeRequestFieldHoldTTLSeconds = big.NewInt(1 << 16) - updateEventTypeRequestFieldCancelNoticeMinutes = big.NewInt(1 << 17) - updateEventTypeRequestFieldRescheduleNoticeMinutes = big.NewInt(1 << 18) - updateEventTypeRequestFieldMaxGuests = big.NewInt(1 << 19) - updateEventTypeRequestFieldMaxActiveBookingsPerAttendee = big.NewInt(1 << 20) - updateEventTypeRequestFieldHostCalendarDetails = big.NewInt(1 << 21) - updateEventTypeRequestFieldQuestions = big.NewInt(1 << 22) - updateEventTypeRequestFieldLocations = big.NewInt(1 << 23) - updateEventTypeRequestFieldHostFilter = big.NewInt(1 << 24) - updateEventTypeRequestFieldNotifications = big.NewInt(1 << 25) - updateEventTypeRequestFieldReminders = big.NewInt(1 << 26) - updateEventTypeRequestFieldMetadata = big.NewInt(1 << 27) - updateEventTypeRequestFieldStatus = big.NewInt(1 << 28) - updateEventTypeRequestFieldHosts = big.NewInt(1 << 29) + updateEventTypeRequestFieldReassignmentEnabled = big.NewInt(1 << 15) + updateEventTypeRequestFieldApprovalTTLMinutes = big.NewInt(1 << 16) + updateEventTypeRequestFieldHoldTTLSeconds = big.NewInt(1 << 17) + updateEventTypeRequestFieldCancelNoticeMinutes = big.NewInt(1 << 18) + updateEventTypeRequestFieldRescheduleNoticeMinutes = big.NewInt(1 << 19) + updateEventTypeRequestFieldMaxGuests = big.NewInt(1 << 20) + updateEventTypeRequestFieldMaxActiveBookingsPerAttendee = big.NewInt(1 << 21) + updateEventTypeRequestFieldHostCalendarDetails = big.NewInt(1 << 22) + updateEventTypeRequestFieldQuestions = big.NewInt(1 << 23) + updateEventTypeRequestFieldLocations = big.NewInt(1 << 24) + updateEventTypeRequestFieldHostFilter = big.NewInt(1 << 25) + updateEventTypeRequestFieldNotifications = big.NewInt(1 << 26) + updateEventTypeRequestFieldReminders = big.NewInt(1 << 27) + updateEventTypeRequestFieldMetadata = big.NewInt(1 << 28) + updateEventTypeRequestFieldStatus = big.NewInt(1 << 29) + updateEventTypeRequestFieldHosts = big.NewInt(1 << 30) ) type UpdateEventTypeRequest struct { @@ -924,6 +935,8 @@ type UpdateEventTypeRequest struct { Capacity *int `json:"capacity,omitempty" url:"-"` // Bookings start as `pending_approval`, holding the time until approved or declined. Default: `false`. RequiresApproval *bool `json:"requires_approval,omitempty" url:"-"` + // Whether bookings of this event type can go to another host. Default: true. + ReassignmentEnabled *bool `json:"reassignment_enabled,omitempty" url:"-"` // How long a booking can wait for approval before it's declined, in minutes. Default: 1440. ApprovalTTLMinutes *int `json:"approval_ttl_minutes,omitempty" url:"-"` // How long a hold keeps its slot, in seconds. Default: 600. @@ -1073,6 +1086,13 @@ func (u *UpdateEventTypeRequest) SetRequiresApproval(requiresApproval *bool) { u.require(updateEventTypeRequestFieldRequiresApproval) } +// SetReassignmentEnabled sets the ReassignmentEnabled field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (u *UpdateEventTypeRequest) SetReassignmentEnabled(reassignmentEnabled *bool) { + u.ReassignmentEnabled = reassignmentEnabled + u.require(updateEventTypeRequestFieldReassignmentEnabled) +} + // SetApprovalTTLMinutes sets the ApprovalTTLMinutes field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. func (u *UpdateEventTypeRequest) SetApprovalTTLMinutes(approvalTTLMinutes *int) { diff --git a/sdks/go/scheduling/event_types_test.go b/sdks/go/scheduling/event_types_test.go index 26f5a1853..68302ff5c 100644 --- a/sdks/go/scheduling/event_types_test.go +++ b/sdks/go/scheduling/event_types_test.go @@ -131,6 +131,14 @@ func TestSettersCreateEventTypeRequest(t *testing.T) { assert.NotNil(t, obj.explicitFields) }) + t.Run("SetReassignmentEnabled", func(t *testing.T) { + obj := &CreateEventTypeRequest{} + var fernTestValueReassignmentEnabled *bool + obj.SetReassignmentEnabled(fernTestValueReassignmentEnabled) + assert.Equal(t, fernTestValueReassignmentEnabled, obj.ReassignmentEnabled) + assert.NotNil(t, obj.explicitFields) + }) + t.Run("SetApprovalTTLMinutes", func(t *testing.T) { obj := &CreateEventTypeRequest{} var fernTestValueApprovalTTLMinutes *int @@ -711,6 +719,37 @@ func TestSettersMarkExplicitCreateEventTypeRequest(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) + t.Run("SetReassignmentEnabled_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &CreateEventTypeRequest{} + var fernTestValueReassignmentEnabled *bool + + // Act + obj.SetReassignmentEnabled(fernTestValueReassignmentEnabled) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + t.Run("SetApprovalTTLMinutes_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange @@ -1965,6 +2004,14 @@ func TestSettersUpdateEventTypeRequest(t *testing.T) { assert.NotNil(t, obj.explicitFields) }) + t.Run("SetReassignmentEnabled", func(t *testing.T) { + obj := &UpdateEventTypeRequest{} + var fernTestValueReassignmentEnabled *bool + obj.SetReassignmentEnabled(fernTestValueReassignmentEnabled) + assert.Equal(t, fernTestValueReassignmentEnabled, obj.ReassignmentEnabled) + assert.NotNil(t, obj.explicitFields) + }) + t.Run("SetApprovalTTLMinutes", func(t *testing.T) { obj := &UpdateEventTypeRequest{} var fernTestValueApprovalTTLMinutes *int @@ -2553,6 +2600,37 @@ func TestSettersMarkExplicitUpdateEventTypeRequest(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) + t.Run("SetReassignmentEnabled_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &UpdateEventTypeRequest{} + var fernTestValueReassignmentEnabled *bool + + // Act + obj.SetReassignmentEnabled(fernTestValueReassignmentEnabled) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + t.Run("SetApprovalTTLMinutes_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange diff --git a/sdks/go/scheduling/holiday_calendars.go b/sdks/go/scheduling/holiday_calendars.go new file mode 100644 index 000000000..5ebbe7b71 --- /dev/null +++ b/sdks/go/scheduling/holiday_calendars.go @@ -0,0 +1,490 @@ +// Code generated by Fern. DO NOT EDIT. + +package scheduling + +import ( + json "encoding/json" + fmt "fmt" + internal "github.com/cosscom/coss-go/internal" + big "math/big" +) + +var ( + createSchedulingHolidayCalendarRequestFieldName = big.NewInt(1 << 0) + createSchedulingHolidayCalendarRequestFieldCountry = big.NewInt(1 << 1) + createSchedulingHolidayCalendarRequestFieldIcsURL = big.NewInt(1 << 2) + createSchedulingHolidayCalendarRequestFieldHosts = big.NewInt(1 << 3) + createSchedulingHolidayCalendarRequestFieldHostFilter = big.NewInt(1 << 4) + createSchedulingHolidayCalendarRequestFieldRegions = big.NewInt(1 << 5) + createSchedulingHolidayCalendarRequestFieldDelegates = big.NewInt(1 << 6) + createSchedulingHolidayCalendarRequestFieldExistingBookings = big.NewInt(1 << 7) +) + +type CreateSchedulingHolidayCalendarRequest struct { + Name string `json:"name" url:"-"` + // A code from the list of holiday calendars, such as `GB`. + Country *string `json:"country,omitempty" url:"-"` + // Your own feed, https or webcal, read in live environments. Stored encrypted. + IcsURL *string `json:"ics_url,omitempty" url:"-"` + // These hosts, by id or uid. + Hosts []string `json:"hosts,omitempty" url:"-"` + // Everyone matching these attributes, asked again at every sync. + HostFilter map[string]*CreateSchedulingHolidayCalendarRequestHostFilterValue `json:"host_filter,omitempty" url:"-"` + // Which regional holidays apply, matched against how the calendar names them, such as `England`. Without this, all of them do; empty, only nationwide ones. + Regions []string `json:"regions,omitempty" url:"-"` + // Who can be booked in their place on those days, by id or uid, in order. + Delegates []string `json:"delegates,omitempty" url:"-"` + // What happens to bookings already on a holiday. `leave` (the default) only reports them. `reassign` moves them. + ExistingBookings *CreateSchedulingHolidayCalendarRequestExistingBookings `json:"existing_bookings,omitempty" url:"-"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (c *CreateSchedulingHolidayCalendarRequest) require(field *big.Int) { + next := new(big.Int) + if c.explicitFields != nil { + next.Set(c.explicitFields) + } + next.Or(next, field) + c.explicitFields = next +} + +// SetName sets the Name field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreateSchedulingHolidayCalendarRequest) SetName(name string) { + c.Name = name + c.require(createSchedulingHolidayCalendarRequestFieldName) +} + +// SetCountry sets the Country field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreateSchedulingHolidayCalendarRequest) SetCountry(country *string) { + c.Country = country + c.require(createSchedulingHolidayCalendarRequestFieldCountry) +} + +// SetIcsURL sets the IcsURL field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreateSchedulingHolidayCalendarRequest) SetIcsURL(icsURL *string) { + c.IcsURL = icsURL + c.require(createSchedulingHolidayCalendarRequestFieldIcsURL) +} + +// SetHosts sets the Hosts field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreateSchedulingHolidayCalendarRequest) SetHosts(hosts []string) { + c.Hosts = hosts + c.require(createSchedulingHolidayCalendarRequestFieldHosts) +} + +// SetHostFilter sets the HostFilter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreateSchedulingHolidayCalendarRequest) SetHostFilter(hostFilter map[string]*CreateSchedulingHolidayCalendarRequestHostFilterValue) { + c.HostFilter = hostFilter + c.require(createSchedulingHolidayCalendarRequestFieldHostFilter) +} + +// SetRegions sets the Regions field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreateSchedulingHolidayCalendarRequest) SetRegions(regions []string) { + c.Regions = regions + c.require(createSchedulingHolidayCalendarRequestFieldRegions) +} + +// SetDelegates sets the Delegates field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreateSchedulingHolidayCalendarRequest) SetDelegates(delegates []string) { + c.Delegates = delegates + c.require(createSchedulingHolidayCalendarRequestFieldDelegates) +} + +// SetExistingBookings sets the ExistingBookings field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreateSchedulingHolidayCalendarRequest) SetExistingBookings(existingBookings *CreateSchedulingHolidayCalendarRequestExistingBookings) { + c.ExistingBookings = existingBookings + c.require(createSchedulingHolidayCalendarRequestFieldExistingBookings) +} + +func (c *CreateSchedulingHolidayCalendarRequest) UnmarshalJSON(data []byte) error { + type unmarshaler CreateSchedulingHolidayCalendarRequest + var body unmarshaler + if err := json.Unmarshal(data, &body); err != nil { + return err + } + *c = CreateSchedulingHolidayCalendarRequest(body) + return nil +} + +func (c *CreateSchedulingHolidayCalendarRequest) MarshalJSON() ([]byte, error) { + type embed CreateSchedulingHolidayCalendarRequest + var marshaler = struct { + embed + }{ + embed: embed(*c), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, c.explicitFields) + return json.Marshal(explicitMarshaler) +} + +var ( + getHolidayCalendarsRequestFieldID = big.NewInt(1 << 0) +) + +type GetHolidayCalendarsRequest struct { + // The holiday calendar's id. + ID string `json:"-" url:"-"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (g *GetHolidayCalendarsRequest) require(field *big.Int) { + next := new(big.Int) + if g.explicitFields != nil { + next.Set(g.explicitFields) + } + next.Or(next, field) + g.explicitFields = next +} + +// SetID sets the ID field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (g *GetHolidayCalendarsRequest) SetID(id string) { + g.ID = id + g.require(getHolidayCalendarsRequestFieldID) +} + +var ( + holidaysHolidayCalendarsRequestFieldID = big.NewInt(1 << 0) +) + +type HolidaysHolidayCalendarsRequest struct { + // The holiday calendar's id. + ID string `json:"-" url:"-"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (h *HolidaysHolidayCalendarsRequest) require(field *big.Int) { + next := new(big.Int) + if h.explicitFields != nil { + next.Set(h.explicitFields) + } + next.Or(next, field) + h.explicitFields = next +} + +// SetID sets the ID field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (h *HolidaysHolidayCalendarsRequest) SetID(id string) { + h.ID = id + h.require(holidaysHolidayCalendarsRequestFieldID) +} + +var ( + removeHolidayCalendarsRequestFieldID = big.NewInt(1 << 0) +) + +type RemoveHolidayCalendarsRequest struct { + // The holiday calendar's id. + ID string `json:"-" url:"-"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (r *RemoveHolidayCalendarsRequest) require(field *big.Int) { + next := new(big.Int) + if r.explicitFields != nil { + next.Set(r.explicitFields) + } + next.Or(next, field) + r.explicitFields = next +} + +// SetID sets the ID field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoveHolidayCalendarsRequest) SetID(id string) { + r.ID = id + r.require(removeHolidayCalendarsRequestFieldID) +} + +// What happens to bookings already on a holiday. `leave` (the default) only reports them. `reassign` moves them. +type CreateSchedulingHolidayCalendarRequestExistingBookings string + +const ( + CreateSchedulingHolidayCalendarRequestExistingBookingsLeave CreateSchedulingHolidayCalendarRequestExistingBookings = "leave" + CreateSchedulingHolidayCalendarRequestExistingBookingsReassign CreateSchedulingHolidayCalendarRequestExistingBookings = "reassign" +) + +func NewCreateSchedulingHolidayCalendarRequestExistingBookingsFromString(s string) (CreateSchedulingHolidayCalendarRequestExistingBookings, error) { + switch s { + case "leave": + return CreateSchedulingHolidayCalendarRequestExistingBookingsLeave, nil + case "reassign": + return CreateSchedulingHolidayCalendarRequestExistingBookingsReassign, nil + } + var t CreateSchedulingHolidayCalendarRequestExistingBookings + return "", fmt.Errorf("%s is not a valid %T", s, t) +} + +func (c CreateSchedulingHolidayCalendarRequestExistingBookings) Ptr() *CreateSchedulingHolidayCalendarRequestExistingBookings { + return &c +} + +type CreateSchedulingHolidayCalendarRequestHostFilterValue struct { + String string + StringList []string + + typ string +} + +func (c *CreateSchedulingHolidayCalendarRequestHostFilterValue) GetString() string { + if c == nil { + return "" + } + return c.String +} + +func (c *CreateSchedulingHolidayCalendarRequestHostFilterValue) GetStringList() []string { + if c == nil { + return nil + } + return c.StringList +} + +func (c *CreateSchedulingHolidayCalendarRequestHostFilterValue) UnmarshalJSON(data []byte) error { + var valueString string + if err := json.Unmarshal(data, &valueString); err == nil { + c.typ = "String" + c.String = valueString + return nil + } + var valueStringList []string + if err := json.Unmarshal(data, &valueStringList); err == nil { + c.typ = "StringList" + c.StringList = valueStringList + return nil + } + return fmt.Errorf("%s cannot be deserialized as a %T", data, c) +} + +func (c CreateSchedulingHolidayCalendarRequestHostFilterValue) MarshalJSON() ([]byte, error) { + if c.typ == "String" || c.String != "" { + return json.Marshal(c.String) + } + if c.typ == "StringList" || c.StringList != nil { + return json.Marshal(c.StringList) + } + return nil, fmt.Errorf("type %T does not include a non-empty union type", c) +} + +type CreateSchedulingHolidayCalendarRequestHostFilterValueVisitor interface { + VisitString(string) error + VisitStringList([]string) error +} + +func (c *CreateSchedulingHolidayCalendarRequestHostFilterValue) Accept(visitor CreateSchedulingHolidayCalendarRequestHostFilterValueVisitor) error { + if c.typ == "String" || c.String != "" { + return visitor.VisitString(c.String) + } + if c.typ == "StringList" || c.StringList != nil { + return visitor.VisitStringList(c.StringList) + } + return fmt.Errorf("type %T does not include a non-empty union type", c) +} + +// What happens to bookings already on a holiday. `leave` (the default) only reports them. `reassign` moves them. +type UpdateSchedulingHolidayCalendarRequestExistingBookings string + +const ( + UpdateSchedulingHolidayCalendarRequestExistingBookingsLeave UpdateSchedulingHolidayCalendarRequestExistingBookings = "leave" + UpdateSchedulingHolidayCalendarRequestExistingBookingsReassign UpdateSchedulingHolidayCalendarRequestExistingBookings = "reassign" +) + +func NewUpdateSchedulingHolidayCalendarRequestExistingBookingsFromString(s string) (UpdateSchedulingHolidayCalendarRequestExistingBookings, error) { + switch s { + case "leave": + return UpdateSchedulingHolidayCalendarRequestExistingBookingsLeave, nil + case "reassign": + return UpdateSchedulingHolidayCalendarRequestExistingBookingsReassign, nil + } + var t UpdateSchedulingHolidayCalendarRequestExistingBookings + return "", fmt.Errorf("%s is not a valid %T", s, t) +} + +func (u UpdateSchedulingHolidayCalendarRequestExistingBookings) Ptr() *UpdateSchedulingHolidayCalendarRequestExistingBookings { + return &u +} + +type UpdateSchedulingHolidayCalendarRequestHostFilterValue struct { + String string + StringList []string + + typ string +} + +func (u *UpdateSchedulingHolidayCalendarRequestHostFilterValue) GetString() string { + if u == nil { + return "" + } + return u.String +} + +func (u *UpdateSchedulingHolidayCalendarRequestHostFilterValue) GetStringList() []string { + if u == nil { + return nil + } + return u.StringList +} + +func (u *UpdateSchedulingHolidayCalendarRequestHostFilterValue) UnmarshalJSON(data []byte) error { + var valueString string + if err := json.Unmarshal(data, &valueString); err == nil { + u.typ = "String" + u.String = valueString + return nil + } + var valueStringList []string + if err := json.Unmarshal(data, &valueStringList); err == nil { + u.typ = "StringList" + u.StringList = valueStringList + return nil + } + return fmt.Errorf("%s cannot be deserialized as a %T", data, u) +} + +func (u UpdateSchedulingHolidayCalendarRequestHostFilterValue) MarshalJSON() ([]byte, error) { + if u.typ == "String" || u.String != "" { + return json.Marshal(u.String) + } + if u.typ == "StringList" || u.StringList != nil { + return json.Marshal(u.StringList) + } + return nil, fmt.Errorf("type %T does not include a non-empty union type", u) +} + +type UpdateSchedulingHolidayCalendarRequestHostFilterValueVisitor interface { + VisitString(string) error + VisitStringList([]string) error +} + +func (u *UpdateSchedulingHolidayCalendarRequestHostFilterValue) Accept(visitor UpdateSchedulingHolidayCalendarRequestHostFilterValueVisitor) error { + if u.typ == "String" || u.String != "" { + return visitor.VisitString(u.String) + } + if u.typ == "StringList" || u.StringList != nil { + return visitor.VisitStringList(u.StringList) + } + return fmt.Errorf("type %T does not include a non-empty union type", u) +} + +var ( + updateSchedulingHolidayCalendarRequestFieldID = big.NewInt(1 << 0) + updateSchedulingHolidayCalendarRequestFieldName = big.NewInt(1 << 1) + updateSchedulingHolidayCalendarRequestFieldHosts = big.NewInt(1 << 2) + updateSchedulingHolidayCalendarRequestFieldHostFilter = big.NewInt(1 << 3) + updateSchedulingHolidayCalendarRequestFieldRegions = big.NewInt(1 << 4) + updateSchedulingHolidayCalendarRequestFieldDelegates = big.NewInt(1 << 5) + updateSchedulingHolidayCalendarRequestFieldExistingBookings = big.NewInt(1 << 6) +) + +type UpdateSchedulingHolidayCalendarRequest struct { + // The holiday calendar's id. + ID string `json:"-" url:"-"` + Name *string `json:"name,omitempty" url:"-"` + // These hosts, by id or uid. + Hosts []string `json:"hosts,omitempty" url:"-"` + // Everyone matching these attributes, asked again at every sync. + HostFilter map[string]*UpdateSchedulingHolidayCalendarRequestHostFilterValue `json:"host_filter,omitempty" url:"-"` + // Which regional holidays apply, matched against how the calendar names them, such as `England`. Without this, all of them do; empty, only nationwide ones. + Regions []string `json:"regions,omitempty" url:"-"` + // Who can be booked in their place on those days, by id or uid, in order. + Delegates []string `json:"delegates,omitempty" url:"-"` + // What happens to bookings already on a holiday. `leave` (the default) only reports them. `reassign` moves them. + ExistingBookings *UpdateSchedulingHolidayCalendarRequestExistingBookings `json:"existing_bookings,omitempty" url:"-"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (u *UpdateSchedulingHolidayCalendarRequest) require(field *big.Int) { + next := new(big.Int) + if u.explicitFields != nil { + next.Set(u.explicitFields) + } + next.Or(next, field) + u.explicitFields = next +} + +// SetID sets the ID field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (u *UpdateSchedulingHolidayCalendarRequest) SetID(id string) { + u.ID = id + u.require(updateSchedulingHolidayCalendarRequestFieldID) +} + +// SetName sets the Name field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (u *UpdateSchedulingHolidayCalendarRequest) SetName(name *string) { + u.Name = name + u.require(updateSchedulingHolidayCalendarRequestFieldName) +} + +// SetHosts sets the Hosts field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (u *UpdateSchedulingHolidayCalendarRequest) SetHosts(hosts []string) { + u.Hosts = hosts + u.require(updateSchedulingHolidayCalendarRequestFieldHosts) +} + +// SetHostFilter sets the HostFilter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (u *UpdateSchedulingHolidayCalendarRequest) SetHostFilter(hostFilter map[string]*UpdateSchedulingHolidayCalendarRequestHostFilterValue) { + u.HostFilter = hostFilter + u.require(updateSchedulingHolidayCalendarRequestFieldHostFilter) +} + +// SetRegions sets the Regions field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (u *UpdateSchedulingHolidayCalendarRequest) SetRegions(regions []string) { + u.Regions = regions + u.require(updateSchedulingHolidayCalendarRequestFieldRegions) +} + +// SetDelegates sets the Delegates field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (u *UpdateSchedulingHolidayCalendarRequest) SetDelegates(delegates []string) { + u.Delegates = delegates + u.require(updateSchedulingHolidayCalendarRequestFieldDelegates) +} + +// SetExistingBookings sets the ExistingBookings field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (u *UpdateSchedulingHolidayCalendarRequest) SetExistingBookings(existingBookings *UpdateSchedulingHolidayCalendarRequestExistingBookings) { + u.ExistingBookings = existingBookings + u.require(updateSchedulingHolidayCalendarRequestFieldExistingBookings) +} + +func (u *UpdateSchedulingHolidayCalendarRequest) UnmarshalJSON(data []byte) error { + type unmarshaler UpdateSchedulingHolidayCalendarRequest + var body unmarshaler + if err := json.Unmarshal(data, &body); err != nil { + return err + } + *u = UpdateSchedulingHolidayCalendarRequest(body) + return nil +} + +func (u *UpdateSchedulingHolidayCalendarRequest) MarshalJSON() ([]byte, error) { + type embed UpdateSchedulingHolidayCalendarRequest + var marshaler = struct { + embed + }{ + embed: embed(*u), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, u.explicitFields) + return json.Marshal(explicitMarshaler) +} diff --git a/sdks/go/scheduling/holiday_calendars_test.go b/sdks/go/scheduling/holiday_calendars_test.go new file mode 100644 index 000000000..214885882 --- /dev/null +++ b/sdks/go/scheduling/holiday_calendars_test.go @@ -0,0 +1,918 @@ +// Code generated by Fern. DO NOT EDIT. + +package scheduling + +import ( + json "encoding/json" + assert "github.com/stretchr/testify/assert" + require "github.com/stretchr/testify/require" + testing "testing" +) + +func TestSettersCreateSchedulingHolidayCalendarRequest(t *testing.T) { + t.Run("SetName", func(t *testing.T) { + obj := &CreateSchedulingHolidayCalendarRequest{} + var fernTestValueName string + obj.SetName(fernTestValueName) + assert.Equal(t, fernTestValueName, obj.Name) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetCountry", func(t *testing.T) { + obj := &CreateSchedulingHolidayCalendarRequest{} + var fernTestValueCountry *string + obj.SetCountry(fernTestValueCountry) + assert.Equal(t, fernTestValueCountry, obj.Country) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetIcsURL", func(t *testing.T) { + obj := &CreateSchedulingHolidayCalendarRequest{} + var fernTestValueIcsURL *string + obj.SetIcsURL(fernTestValueIcsURL) + assert.Equal(t, fernTestValueIcsURL, obj.IcsURL) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetHosts", func(t *testing.T) { + obj := &CreateSchedulingHolidayCalendarRequest{} + var fernTestValueHosts []string + obj.SetHosts(fernTestValueHosts) + assert.Equal(t, fernTestValueHosts, obj.Hosts) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetHostFilter", func(t *testing.T) { + obj := &CreateSchedulingHolidayCalendarRequest{} + var fernTestValueHostFilter map[string]*CreateSchedulingHolidayCalendarRequestHostFilterValue + obj.SetHostFilter(fernTestValueHostFilter) + assert.Equal(t, fernTestValueHostFilter, obj.HostFilter) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetRegions", func(t *testing.T) { + obj := &CreateSchedulingHolidayCalendarRequest{} + var fernTestValueRegions []string + obj.SetRegions(fernTestValueRegions) + assert.Equal(t, fernTestValueRegions, obj.Regions) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetDelegates", func(t *testing.T) { + obj := &CreateSchedulingHolidayCalendarRequest{} + var fernTestValueDelegates []string + obj.SetDelegates(fernTestValueDelegates) + assert.Equal(t, fernTestValueDelegates, obj.Delegates) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetExistingBookings", func(t *testing.T) { + obj := &CreateSchedulingHolidayCalendarRequest{} + var fernTestValueExistingBookings *CreateSchedulingHolidayCalendarRequestExistingBookings + obj.SetExistingBookings(fernTestValueExistingBookings) + assert.Equal(t, fernTestValueExistingBookings, obj.ExistingBookings) + assert.NotNil(t, obj.explicitFields) + }) + +} + +func TestSettersMarkExplicitCreateSchedulingHolidayCalendarRequest(t *testing.T) { + t.Run("SetName_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &CreateSchedulingHolidayCalendarRequest{} + var fernTestValueName string + + // Act + obj.SetName(fernTestValueName) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetCountry_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &CreateSchedulingHolidayCalendarRequest{} + var fernTestValueCountry *string + + // Act + obj.SetCountry(fernTestValueCountry) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetIcsURL_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &CreateSchedulingHolidayCalendarRequest{} + var fernTestValueIcsURL *string + + // Act + obj.SetIcsURL(fernTestValueIcsURL) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetHosts_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &CreateSchedulingHolidayCalendarRequest{} + var fernTestValueHosts []string + + // Act + obj.SetHosts(fernTestValueHosts) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetHostFilter_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &CreateSchedulingHolidayCalendarRequest{} + var fernTestValueHostFilter map[string]*CreateSchedulingHolidayCalendarRequestHostFilterValue + + // Act + obj.SetHostFilter(fernTestValueHostFilter) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetRegions_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &CreateSchedulingHolidayCalendarRequest{} + var fernTestValueRegions []string + + // Act + obj.SetRegions(fernTestValueRegions) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetDelegates_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &CreateSchedulingHolidayCalendarRequest{} + var fernTestValueDelegates []string + + // Act + obj.SetDelegates(fernTestValueDelegates) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetExistingBookings_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &CreateSchedulingHolidayCalendarRequest{} + var fernTestValueExistingBookings *CreateSchedulingHolidayCalendarRequestExistingBookings + + // Act + obj.SetExistingBookings(fernTestValueExistingBookings) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + +} + +func TestSettersGetHolidayCalendarsRequest(t *testing.T) { + t.Run("SetID", func(t *testing.T) { + obj := &GetHolidayCalendarsRequest{} + var fernTestValueID string + obj.SetID(fernTestValueID) + assert.Equal(t, fernTestValueID, obj.ID) + assert.NotNil(t, obj.explicitFields) + }) + +} + +func TestSettersMarkExplicitGetHolidayCalendarsRequest(t *testing.T) { + t.Run("SetID_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &GetHolidayCalendarsRequest{} + var fernTestValueID string + + // Act + obj.SetID(fernTestValueID) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + +} + +func TestSettersHolidaysHolidayCalendarsRequest(t *testing.T) { + t.Run("SetID", func(t *testing.T) { + obj := &HolidaysHolidayCalendarsRequest{} + var fernTestValueID string + obj.SetID(fernTestValueID) + assert.Equal(t, fernTestValueID, obj.ID) + assert.NotNil(t, obj.explicitFields) + }) + +} + +func TestSettersMarkExplicitHolidaysHolidayCalendarsRequest(t *testing.T) { + t.Run("SetID_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &HolidaysHolidayCalendarsRequest{} + var fernTestValueID string + + // Act + obj.SetID(fernTestValueID) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + +} + +func TestSettersRemoveHolidayCalendarsRequest(t *testing.T) { + t.Run("SetID", func(t *testing.T) { + obj := &RemoveHolidayCalendarsRequest{} + var fernTestValueID string + obj.SetID(fernTestValueID) + assert.Equal(t, fernTestValueID, obj.ID) + assert.NotNil(t, obj.explicitFields) + }) + +} + +func TestSettersMarkExplicitRemoveHolidayCalendarsRequest(t *testing.T) { + t.Run("SetID_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RemoveHolidayCalendarsRequest{} + var fernTestValueID string + + // Act + obj.SetID(fernTestValueID) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + +} + +func TestGettersCreateSchedulingHolidayCalendarRequestHostFilterValue(t *testing.T) { + t.Run("GetString", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &CreateSchedulingHolidayCalendarRequestHostFilterValue{} + var expected string + obj.String = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetString(), "getter should return the property value") + }) + + t.Run("GetString_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *CreateSchedulingHolidayCalendarRequestHostFilterValue + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetString() // Should return zero value + }) + + t.Run("GetStringList", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &CreateSchedulingHolidayCalendarRequestHostFilterValue{} + var expected []string + obj.StringList = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetStringList(), "getter should return the property value") + }) + + t.Run("GetStringList_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &CreateSchedulingHolidayCalendarRequestHostFilterValue{} + obj.StringList = nil + + // Act & Assert + assert.Nil(t, obj.GetStringList(), "getter should return nil when property is nil") + }) + + t.Run("GetStringList_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *CreateSchedulingHolidayCalendarRequestHostFilterValue + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetStringList() // Should return zero value + }) + +} + +func TestGettersUpdateSchedulingHolidayCalendarRequestHostFilterValue(t *testing.T) { + t.Run("GetString", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &UpdateSchedulingHolidayCalendarRequestHostFilterValue{} + var expected string + obj.String = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetString(), "getter should return the property value") + }) + + t.Run("GetString_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *UpdateSchedulingHolidayCalendarRequestHostFilterValue + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetString() // Should return zero value + }) + + t.Run("GetStringList", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &UpdateSchedulingHolidayCalendarRequestHostFilterValue{} + var expected []string + obj.StringList = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetStringList(), "getter should return the property value") + }) + + t.Run("GetStringList_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &UpdateSchedulingHolidayCalendarRequestHostFilterValue{} + obj.StringList = nil + + // Act & Assert + assert.Nil(t, obj.GetStringList(), "getter should return nil when property is nil") + }) + + t.Run("GetStringList_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *UpdateSchedulingHolidayCalendarRequestHostFilterValue + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetStringList() // Should return zero value + }) + +} + +func TestSettersUpdateSchedulingHolidayCalendarRequest(t *testing.T) { + t.Run("SetID", func(t *testing.T) { + obj := &UpdateSchedulingHolidayCalendarRequest{} + var fernTestValueID string + obj.SetID(fernTestValueID) + assert.Equal(t, fernTestValueID, obj.ID) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetName", func(t *testing.T) { + obj := &UpdateSchedulingHolidayCalendarRequest{} + var fernTestValueName *string + obj.SetName(fernTestValueName) + assert.Equal(t, fernTestValueName, obj.Name) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetHosts", func(t *testing.T) { + obj := &UpdateSchedulingHolidayCalendarRequest{} + var fernTestValueHosts []string + obj.SetHosts(fernTestValueHosts) + assert.Equal(t, fernTestValueHosts, obj.Hosts) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetHostFilter", func(t *testing.T) { + obj := &UpdateSchedulingHolidayCalendarRequest{} + var fernTestValueHostFilter map[string]*UpdateSchedulingHolidayCalendarRequestHostFilterValue + obj.SetHostFilter(fernTestValueHostFilter) + assert.Equal(t, fernTestValueHostFilter, obj.HostFilter) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetRegions", func(t *testing.T) { + obj := &UpdateSchedulingHolidayCalendarRequest{} + var fernTestValueRegions []string + obj.SetRegions(fernTestValueRegions) + assert.Equal(t, fernTestValueRegions, obj.Regions) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetDelegates", func(t *testing.T) { + obj := &UpdateSchedulingHolidayCalendarRequest{} + var fernTestValueDelegates []string + obj.SetDelegates(fernTestValueDelegates) + assert.Equal(t, fernTestValueDelegates, obj.Delegates) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetExistingBookings", func(t *testing.T) { + obj := &UpdateSchedulingHolidayCalendarRequest{} + var fernTestValueExistingBookings *UpdateSchedulingHolidayCalendarRequestExistingBookings + obj.SetExistingBookings(fernTestValueExistingBookings) + assert.Equal(t, fernTestValueExistingBookings, obj.ExistingBookings) + assert.NotNil(t, obj.explicitFields) + }) + +} + +func TestSettersMarkExplicitUpdateSchedulingHolidayCalendarRequest(t *testing.T) { + t.Run("SetID_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &UpdateSchedulingHolidayCalendarRequest{} + var fernTestValueID string + + // Act + obj.SetID(fernTestValueID) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetName_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &UpdateSchedulingHolidayCalendarRequest{} + var fernTestValueName *string + + // Act + obj.SetName(fernTestValueName) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetHosts_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &UpdateSchedulingHolidayCalendarRequest{} + var fernTestValueHosts []string + + // Act + obj.SetHosts(fernTestValueHosts) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetHostFilter_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &UpdateSchedulingHolidayCalendarRequest{} + var fernTestValueHostFilter map[string]*UpdateSchedulingHolidayCalendarRequestHostFilterValue + + // Act + obj.SetHostFilter(fernTestValueHostFilter) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetRegions_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &UpdateSchedulingHolidayCalendarRequest{} + var fernTestValueRegions []string + + // Act + obj.SetRegions(fernTestValueRegions) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetDelegates_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &UpdateSchedulingHolidayCalendarRequest{} + var fernTestValueDelegates []string + + // Act + obj.SetDelegates(fernTestValueDelegates) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetExistingBookings_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &UpdateSchedulingHolidayCalendarRequest{} + var fernTestValueExistingBookings *UpdateSchedulingHolidayCalendarRequestExistingBookings + + // Act + obj.SetExistingBookings(fernTestValueExistingBookings) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + +} + +func TestEnumCreateSchedulingHolidayCalendarRequestExistingBookings(t *testing.T) { + t.Run("NewFromString_leave", func(t *testing.T) { + t.Parallel() + val, err := NewCreateSchedulingHolidayCalendarRequestExistingBookingsFromString("leave") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, CreateSchedulingHolidayCalendarRequestExistingBookings("leave"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_reassign", func(t *testing.T) { + t.Parallel() + val, err := NewCreateSchedulingHolidayCalendarRequestExistingBookingsFromString("reassign") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, CreateSchedulingHolidayCalendarRequestExistingBookings("reassign"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_Invalid", func(t *testing.T) { + _, err := NewCreateSchedulingHolidayCalendarRequestExistingBookingsFromString("invalid_value_that_does_not_exist") + assert.Error(t, err) + }) + + t.Run("Ptr", func(t *testing.T) { + val, err := NewCreateSchedulingHolidayCalendarRequestExistingBookingsFromString("leave") + assert.NoError(t, err) + ptr := val.Ptr() + assert.NotNil(t, ptr) + assert.Equal(t, val, *ptr) + }) +} + +func TestEnumUpdateSchedulingHolidayCalendarRequestExistingBookings(t *testing.T) { + t.Run("NewFromString_leave", func(t *testing.T) { + t.Parallel() + val, err := NewUpdateSchedulingHolidayCalendarRequestExistingBookingsFromString("leave") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, UpdateSchedulingHolidayCalendarRequestExistingBookings("leave"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_reassign", func(t *testing.T) { + t.Parallel() + val, err := NewUpdateSchedulingHolidayCalendarRequestExistingBookingsFromString("reassign") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, UpdateSchedulingHolidayCalendarRequestExistingBookings("reassign"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_Invalid", func(t *testing.T) { + _, err := NewUpdateSchedulingHolidayCalendarRequestExistingBookingsFromString("invalid_value_that_does_not_exist") + assert.Error(t, err) + }) + + t.Run("Ptr", func(t *testing.T) { + val, err := NewUpdateSchedulingHolidayCalendarRequestExistingBookingsFromString("leave") + assert.NoError(t, err) + ptr := val.Ptr() + assert.NotNil(t, ptr) + assert.Equal(t, val, *ptr) + }) +} diff --git a/sdks/go/scheduling/holidaycalendars/client.go b/sdks/go/scheduling/holidaycalendars/client.go new file mode 100644 index 000000000..2dab7870c --- /dev/null +++ b/sdks/go/scheduling/holidaycalendars/client.go @@ -0,0 +1,213 @@ +// Code generated by Fern. DO NOT EDIT. + +package holidaycalendars + +import ( + context "context" + os "os" + + coss "github.com/cosscom/coss-go" + core "github.com/cosscom/coss-go/core" + internal "github.com/cosscom/coss-go/internal" + option "github.com/cosscom/coss-go/option" + scheduling "github.com/cosscom/coss-go/scheduling" +) + +type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions + baseURL string + caller *internal.Caller +} + +func NewClient(options *core.RequestOptions) *Client { + if options.APIKey == "" { + options.APIKey = os.Getenv("COSS_API_KEY") + } + if options.APIVersion == nil { + apiVersionDefault := "2026-10-10" + options.APIVersion = &apiVersionDefault + } + return &Client{ + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + DisableRetries: options.DisableRetries, + }, + ), + } +} + +// By name. A feed's URL is never shown again. +// +// Example: +// +// client.Scheduling.HolidayCalendars.List( +// context.TODO(), +// ) +func (c *Client) List( + ctx context.Context, + opts ...option.RequestOption, +) (*coss.SchedulingHolidayCalendarList, error) { + response, err := c.WithRawResponse.List( + ctx, + opts..., + ) + if err != nil { + return nil, err + } + return response.Body, nil +} + +// Applies a country's public holidays, or your own feed, to some hosts as ordinary out of office entries, kept up to date by coss.com. A host who removes one keeps it removed. +// +// Example: +// +// request := &scheduling.CreateSchedulingHolidayCalendarRequest{ +// Name: "UK team", +// Country: coss.String( +// "GB", +// ), +// HostFilter: map[string]*scheduling.CreateSchedulingHolidayCalendarRequestHostFilterValue{ +// "team": &scheduling.CreateSchedulingHolidayCalendarRequestHostFilterValue{ +// String: "london", +// }, +// }, +// } +// client.Scheduling.HolidayCalendars.Create( +// context.TODO(), +// request, +// ) +func (c *Client) Create( + ctx context.Context, + request *scheduling.CreateSchedulingHolidayCalendarRequest, + opts ...option.RequestOption, +) (*coss.SchedulingHolidayCalendar, error) { + response, err := c.WithRawResponse.Create( + ctx, + request, + opts..., + ) + if err != nil { + return nil, err + } + return response.Body, nil +} + +// With when it was last read, and why not if it couldn't be. +// +// Example: +// +// request := &scheduling.GetHolidayCalendarsRequest{ +// ID: "id", +// } +// client.Scheduling.HolidayCalendars.Get( +// context.TODO(), +// request, +// ) +func (c *Client) Get( + ctx context.Context, + request *scheduling.GetHolidayCalendarsRequest, + opts ...option.RequestOption, +) (*coss.SchedulingHolidayCalendar, error) { + response, err := c.WithRawResponse.Get( + ctx, + request, + opts..., + ) + if err != nil { + return nil, err + } + return response.Body, nil +} + +// Hosts can be booked on its days again, shortly: past entries stay. +// +// Example: +// +// request := &scheduling.RemoveHolidayCalendarsRequest{ +// ID: "id", +// } +// client.Scheduling.HolidayCalendars.Remove( +// context.TODO(), +// request, +// ) +func (c *Client) Remove( + ctx context.Context, + request *scheduling.RemoveHolidayCalendarsRequest, + opts ...option.RequestOption, +) (*coss.DeletedSchedulingHolidayCalendar, error) { + response, err := c.WithRawResponse.Remove( + ctx, + request, + opts..., + ) + if err != nil { + return nil, err + } + return response.Body, nil +} + +// Who it applies to, who covers and what happens to bookings. Takes effect shortly. +// +// Example: +// +// request := &scheduling.UpdateSchedulingHolidayCalendarRequest{ +// ID: "id", +// HostFilter: map[string]*scheduling.UpdateSchedulingHolidayCalendarRequestHostFilterValue{ +// "team": &scheduling.UpdateSchedulingHolidayCalendarRequestHostFilterValue{ +// String: "london", +// }, +// }, +// } +// client.Scheduling.HolidayCalendars.Update( +// context.TODO(), +// request, +// ) +func (c *Client) Update( + ctx context.Context, + request *scheduling.UpdateSchedulingHolidayCalendarRequest, + opts ...option.RequestOption, +) (*coss.SchedulingHolidayCalendar, error) { + response, err := c.WithRawResponse.Update( + ctx, + request, + opts..., + ) + if err != nil { + return nil, err + } + return response.Body, nil +} + +// What's coming, with names, as last read. Empty until its first read. +// +// Example: +// +// request := &scheduling.HolidaysHolidayCalendarsRequest{ +// ID: "id", +// } +// client.Scheduling.HolidayCalendars.Holidays( +// context.TODO(), +// request, +// ) +func (c *Client) Holidays( + ctx context.Context, + request *scheduling.HolidaysHolidayCalendarsRequest, + opts ...option.RequestOption, +) (*coss.SchedulingHolidayList, error) { + response, err := c.WithRawResponse.Holidays( + ctx, + request, + opts..., + ) + if err != nil { + return nil, err + } + return response.Body, nil +} diff --git a/sdks/go/scheduling/holidaycalendars/raw_client.go b/sdks/go/scheduling/holidaycalendars/raw_client.go new file mode 100644 index 000000000..afe7dd1c5 --- /dev/null +++ b/sdks/go/scheduling/holidaycalendars/raw_client.go @@ -0,0 +1,303 @@ +// Code generated by Fern. DO NOT EDIT. + +package holidaycalendars + +import ( + context "context" + http "net/http" + + coss "github.com/cosscom/coss-go" + core "github.com/cosscom/coss-go/core" + internal "github.com/cosscom/coss-go/internal" + option "github.com/cosscom/coss-go/option" + scheduling "github.com/cosscom/coss-go/scheduling" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + DisableRetries: options.DisableRetries, + }, + ), + } +} + +func (r *RawClient) List( + ctx context.Context, + opts ...option.RequestOption, +) (*core.Response[*coss.SchedulingHolidayCalendarList], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "https://api.coss.com", + ) + endpointURL := baseURL + "/v1/scheduling/holiday_calendars" + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *coss.SchedulingHolidayCalendarList + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + DisableRetries: options.DisableRetries, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + ErrorDecoder: internal.NewErrorDecoder(scheduling.ErrorCodes), + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*coss.SchedulingHolidayCalendarList]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} + +func (r *RawClient) Create( + ctx context.Context, + request *scheduling.CreateSchedulingHolidayCalendarRequest, + opts ...option.RequestOption, +) (*core.Response[*coss.SchedulingHolidayCalendar], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "https://api.coss.com", + ) + endpointURL := baseURL + "/v1/scheduling/holiday_calendars" + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + headers.Add("Content-Type", "application/json") + core.SetIdempotencyKeyHeader(headers) + + var response *coss.SchedulingHolidayCalendar + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodPost, + Headers: headers, + MaxAttempts: options.MaxAttempts, + DisableRetries: true, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Request: request, + Response: &response, + ErrorDecoder: internal.NewErrorDecoder(scheduling.ErrorCodes), + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*coss.SchedulingHolidayCalendar]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} + +func (r *RawClient) Get( + ctx context.Context, + request *scheduling.GetHolidayCalendarsRequest, + opts ...option.RequestOption, +) (*core.Response[*coss.SchedulingHolidayCalendar], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "https://api.coss.com", + ) + endpointURL := internal.EncodeURL( + baseURL+"/v1/scheduling/holiday_calendars/%v", + request.ID, + ) + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *coss.SchedulingHolidayCalendar + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + DisableRetries: options.DisableRetries, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + ErrorDecoder: internal.NewErrorDecoder(scheduling.ErrorCodes), + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*coss.SchedulingHolidayCalendar]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} + +func (r *RawClient) Remove( + ctx context.Context, + request *scheduling.RemoveHolidayCalendarsRequest, + opts ...option.RequestOption, +) (*core.Response[*coss.DeletedSchedulingHolidayCalendar], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "https://api.coss.com", + ) + endpointURL := internal.EncodeURL( + baseURL+"/v1/scheduling/holiday_calendars/%v", + request.ID, + ) + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *coss.DeletedSchedulingHolidayCalendar + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodDelete, + Headers: headers, + MaxAttempts: options.MaxAttempts, + DisableRetries: options.DisableRetries, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + ErrorDecoder: internal.NewErrorDecoder(scheduling.ErrorCodes), + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*coss.DeletedSchedulingHolidayCalendar]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} + +func (r *RawClient) Update( + ctx context.Context, + request *scheduling.UpdateSchedulingHolidayCalendarRequest, + opts ...option.RequestOption, +) (*core.Response[*coss.SchedulingHolidayCalendar], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "https://api.coss.com", + ) + endpointURL := internal.EncodeURL( + baseURL+"/v1/scheduling/holiday_calendars/%v", + request.ID, + ) + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + headers.Add("Content-Type", "application/json") + var response *coss.SchedulingHolidayCalendar + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodPatch, + Headers: headers, + MaxAttempts: options.MaxAttempts, + DisableRetries: options.DisableRetries, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Request: request, + Response: &response, + ErrorDecoder: internal.NewErrorDecoder(scheduling.ErrorCodes), + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*coss.SchedulingHolidayCalendar]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} + +func (r *RawClient) Holidays( + ctx context.Context, + request *scheduling.HolidaysHolidayCalendarsRequest, + opts ...option.RequestOption, +) (*core.Response[*coss.SchedulingHolidayList], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "https://api.coss.com", + ) + endpointURL := internal.EncodeURL( + baseURL+"/v1/scheduling/holiday_calendars/%v/holidays", + request.ID, + ) + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *coss.SchedulingHolidayList + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + DisableRetries: options.DisableRetries, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + ErrorDecoder: internal.NewErrorDecoder(scheduling.ErrorCodes), + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*coss.SchedulingHolidayList]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} diff --git a/sdks/go/scheduling/oauth_apps.go b/sdks/go/scheduling/oauth_apps.go new file mode 100644 index 000000000..c6554b30c --- /dev/null +++ b/sdks/go/scheduling/oauth_apps.go @@ -0,0 +1,183 @@ +// Code generated by Fern. DO NOT EDIT. + +package scheduling + +import ( + json "encoding/json" + internal "github.com/cosscom/coss-go/internal" + big "math/big" + time "time" +) + +var ( + deleteOauthAppsRequestFieldID = big.NewInt(1 << 0) +) + +type DeleteOauthAppsRequest struct { + // The OAuth app's id. + ID string `json:"-" url:"-"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (d *DeleteOauthAppsRequest) require(field *big.Int) { + next := new(big.Int) + if d.explicitFields != nil { + next.Set(d.explicitFields) + } + next.Or(next, field) + d.explicitFields = next +} + +// SetID sets the ID field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DeleteOauthAppsRequest) SetID(id string) { + d.ID = id + d.require(deleteOauthAppsRequestFieldID) +} + +var ( + getOauthAppsRequestFieldID = big.NewInt(1 << 0) +) + +type GetOauthAppsRequest struct { + // The OAuth app's id. + ID string `json:"-" url:"-"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (g *GetOauthAppsRequest) require(field *big.Int) { + next := new(big.Int) + if g.explicitFields != nil { + next.Set(g.explicitFields) + } + next.Or(next, field) + g.explicitFields = next +} + +// SetID sets the ID field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (g *GetOauthAppsRequest) SetID(id string) { + g.ID = id + g.require(getOauthAppsRequestFieldID) +} + +var ( + updateOauthAppRequestFieldID = big.NewInt(1 << 0) + updateOauthAppRequestFieldClientSecret = big.NewInt(1 << 1) + updateOauthAppRequestFieldTenantID = big.NewInt(1 << 2) + updateOauthAppRequestFieldWebhookSecret = big.NewInt(1 << 3) + updateOauthAppRequestFieldRedirectURI = big.NewInt(1 << 4) + updateOauthAppRequestFieldCompletionURL = big.NewInt(1 << 5) + updateOauthAppRequestFieldSecretExpiresAt = big.NewInt(1 << 6) +) + +type UpdateOauthAppRequest struct { + // The OAuth app's id. + ID string `json:"-" url:"-"` + // A new client secret. It's tried on a connection before it replaces the old one. + ClientSecret *string `json:"client_secret,omitempty" url:"-"` + // The Directory (tenant) ID, for an app that's only for your own tenant. Leave it out for a multi-tenant app. + TenantID *string `json:"tenant_id,omitempty" url:"-"` + // The Secret Token of your Zoom app, which signs its events at `zoom_event_url`. Never returned. + WebhookSecret *string `json:"webhook_secret,omitempty" url:"-"` + // A page on your own domain, registered with the provider, that forwards `code` and `state` to `coss_callback_url`. Google requires this for an external app, since it has to verify the redirect's domain as yours. Leave it out to use `coss_callback_url` directly. + RedirectURI *string `json:"redirect_uri,omitempty" url:"-"` + // Where the browser lands after a consent that didn't name a `return_url`, with `coss_calendar` set to `connected`, `denied` or `invalid`. Leave it out for a plain page saying what happened. + CompletionURL *string `json:"completion_url,omitempty" url:"-"` + // When the client secret expires. Owners and admins are warned 14 days before. + SecretExpiresAt *time.Time `json:"secret_expires_at,omitempty" url:"-"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (u *UpdateOauthAppRequest) require(field *big.Int) { + next := new(big.Int) + if u.explicitFields != nil { + next.Set(u.explicitFields) + } + next.Or(next, field) + u.explicitFields = next +} + +// SetID sets the ID field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (u *UpdateOauthAppRequest) SetID(id string) { + u.ID = id + u.require(updateOauthAppRequestFieldID) +} + +// SetClientSecret sets the ClientSecret field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (u *UpdateOauthAppRequest) SetClientSecret(clientSecret *string) { + u.ClientSecret = clientSecret + u.require(updateOauthAppRequestFieldClientSecret) +} + +// SetTenantID sets the TenantID field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (u *UpdateOauthAppRequest) SetTenantID(tenantID *string) { + u.TenantID = tenantID + u.require(updateOauthAppRequestFieldTenantID) +} + +// SetWebhookSecret sets the WebhookSecret field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (u *UpdateOauthAppRequest) SetWebhookSecret(webhookSecret *string) { + u.WebhookSecret = webhookSecret + u.require(updateOauthAppRequestFieldWebhookSecret) +} + +// SetRedirectURI sets the RedirectURI field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (u *UpdateOauthAppRequest) SetRedirectURI(redirectURI *string) { + u.RedirectURI = redirectURI + u.require(updateOauthAppRequestFieldRedirectURI) +} + +// SetCompletionURL sets the CompletionURL field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (u *UpdateOauthAppRequest) SetCompletionURL(completionURL *string) { + u.CompletionURL = completionURL + u.require(updateOauthAppRequestFieldCompletionURL) +} + +// SetSecretExpiresAt sets the SecretExpiresAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (u *UpdateOauthAppRequest) SetSecretExpiresAt(secretExpiresAt *time.Time) { + u.SecretExpiresAt = secretExpiresAt + u.require(updateOauthAppRequestFieldSecretExpiresAt) +} + +func (u *UpdateOauthAppRequest) UnmarshalJSON(data []byte) error { + type embed UpdateOauthAppRequest + var body = struct { + embed + SecretExpiresAt *internal.DateTime `json:"secret_expires_at,omitempty"` + }{ + embed: embed(*u), + } + if err := json.Unmarshal(data, &body); err != nil { + return err + } + *u = UpdateOauthAppRequest(body.embed) + u.SecretExpiresAt = body.SecretExpiresAt.TimePtr() + return nil +} + +func (u *UpdateOauthAppRequest) MarshalJSON() ([]byte, error) { + type embed UpdateOauthAppRequest + var marshaler = struct { + embed + SecretExpiresAt *internal.DateTime `json:"secret_expires_at,omitempty"` + }{ + embed: embed(*u), + SecretExpiresAt: internal.NewOptionalDateTime(u.SecretExpiresAt), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, u.explicitFields) + return json.Marshal(explicitMarshaler) +} diff --git a/sdks/go/scheduling/oauth_apps_test.go b/sdks/go/scheduling/oauth_apps_test.go new file mode 100644 index 000000000..95fd39c11 --- /dev/null +++ b/sdks/go/scheduling/oauth_apps_test.go @@ -0,0 +1,380 @@ +// Code generated by Fern. DO NOT EDIT. + +package scheduling + +import ( + json "encoding/json" + assert "github.com/stretchr/testify/assert" + require "github.com/stretchr/testify/require" + testing "testing" + time "time" +) + +func TestSettersDeleteOauthAppsRequest(t *testing.T) { + t.Run("SetID", func(t *testing.T) { + obj := &DeleteOauthAppsRequest{} + var fernTestValueID string + obj.SetID(fernTestValueID) + assert.Equal(t, fernTestValueID, obj.ID) + assert.NotNil(t, obj.explicitFields) + }) + +} + +func TestSettersMarkExplicitDeleteOauthAppsRequest(t *testing.T) { + t.Run("SetID_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DeleteOauthAppsRequest{} + var fernTestValueID string + + // Act + obj.SetID(fernTestValueID) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + +} + +func TestSettersGetOauthAppsRequest(t *testing.T) { + t.Run("SetID", func(t *testing.T) { + obj := &GetOauthAppsRequest{} + var fernTestValueID string + obj.SetID(fernTestValueID) + assert.Equal(t, fernTestValueID, obj.ID) + assert.NotNil(t, obj.explicitFields) + }) + +} + +func TestSettersMarkExplicitGetOauthAppsRequest(t *testing.T) { + t.Run("SetID_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &GetOauthAppsRequest{} + var fernTestValueID string + + // Act + obj.SetID(fernTestValueID) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + +} + +func TestSettersUpdateOauthAppRequest(t *testing.T) { + t.Run("SetID", func(t *testing.T) { + obj := &UpdateOauthAppRequest{} + var fernTestValueID string + obj.SetID(fernTestValueID) + assert.Equal(t, fernTestValueID, obj.ID) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetClientSecret", func(t *testing.T) { + obj := &UpdateOauthAppRequest{} + var fernTestValueClientSecret *string + obj.SetClientSecret(fernTestValueClientSecret) + assert.Equal(t, fernTestValueClientSecret, obj.ClientSecret) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetTenantID", func(t *testing.T) { + obj := &UpdateOauthAppRequest{} + var fernTestValueTenantID *string + obj.SetTenantID(fernTestValueTenantID) + assert.Equal(t, fernTestValueTenantID, obj.TenantID) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetWebhookSecret", func(t *testing.T) { + obj := &UpdateOauthAppRequest{} + var fernTestValueWebhookSecret *string + obj.SetWebhookSecret(fernTestValueWebhookSecret) + assert.Equal(t, fernTestValueWebhookSecret, obj.WebhookSecret) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetRedirectURI", func(t *testing.T) { + obj := &UpdateOauthAppRequest{} + var fernTestValueRedirectURI *string + obj.SetRedirectURI(fernTestValueRedirectURI) + assert.Equal(t, fernTestValueRedirectURI, obj.RedirectURI) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetCompletionURL", func(t *testing.T) { + obj := &UpdateOauthAppRequest{} + var fernTestValueCompletionURL *string + obj.SetCompletionURL(fernTestValueCompletionURL) + assert.Equal(t, fernTestValueCompletionURL, obj.CompletionURL) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetSecretExpiresAt", func(t *testing.T) { + obj := &UpdateOauthAppRequest{} + var fernTestValueSecretExpiresAt *time.Time + obj.SetSecretExpiresAt(fernTestValueSecretExpiresAt) + assert.Equal(t, fernTestValueSecretExpiresAt, obj.SecretExpiresAt) + assert.NotNil(t, obj.explicitFields) + }) + +} + +func TestSettersMarkExplicitUpdateOauthAppRequest(t *testing.T) { + t.Run("SetID_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &UpdateOauthAppRequest{} + var fernTestValueID string + + // Act + obj.SetID(fernTestValueID) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetClientSecret_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &UpdateOauthAppRequest{} + var fernTestValueClientSecret *string + + // Act + obj.SetClientSecret(fernTestValueClientSecret) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetTenantID_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &UpdateOauthAppRequest{} + var fernTestValueTenantID *string + + // Act + obj.SetTenantID(fernTestValueTenantID) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetWebhookSecret_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &UpdateOauthAppRequest{} + var fernTestValueWebhookSecret *string + + // Act + obj.SetWebhookSecret(fernTestValueWebhookSecret) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetRedirectURI_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &UpdateOauthAppRequest{} + var fernTestValueRedirectURI *string + + // Act + obj.SetRedirectURI(fernTestValueRedirectURI) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetCompletionURL_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &UpdateOauthAppRequest{} + var fernTestValueCompletionURL *string + + // Act + obj.SetCompletionURL(fernTestValueCompletionURL) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetSecretExpiresAt_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &UpdateOauthAppRequest{} + var fernTestValueSecretExpiresAt *time.Time + + // Act + obj.SetSecretExpiresAt(fernTestValueSecretExpiresAt) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + +} diff --git a/sdks/go/scheduling/oauthapps/client.go b/sdks/go/scheduling/oauthapps/client.go new file mode 100644 index 000000000..b6dc9b6ed --- /dev/null +++ b/sdks/go/scheduling/oauthapps/client.go @@ -0,0 +1,179 @@ +// Code generated by Fern. DO NOT EDIT. + +package oauthapps + +import ( + context "context" + os "os" + + coss "github.com/cosscom/coss-go" + core "github.com/cosscom/coss-go/core" + internal "github.com/cosscom/coss-go/internal" + option "github.com/cosscom/coss-go/option" + scheduling "github.com/cosscom/coss-go/scheduling" +) + +type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions + baseURL string + caller *internal.Caller +} + +func NewClient(options *core.RequestOptions) *Client { + if options.APIKey == "" { + options.APIKey = os.Getenv("COSS_API_KEY") + } + if options.APIVersion == nil { + apiVersionDefault := "2026-10-10" + options.APIVersion = &apiVersionDefault + } + return &Client{ + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + DisableRetries: options.DisableRetries, + }, + ), + } +} + +// At most one per provider, with how many connections use each. +// +// Example: +// +// client.Scheduling.OauthApps.List( +// context.TODO(), +// ) +func (c *Client) List( + ctx context.Context, + opts ...option.RequestOption, +) (*coss.SchedulingOauthAppList, error) { + response, err := c.WithRawResponse.List( + ctx, + opts..., + ) + if err != nil { + return nil, err + } + return response.Body, nil +} + +// New consents in this environment use it, so the consent screen shows your brand. Connections made before it stay on coss.com's app until their host consents again. On the Scale plan and above. Secrets are never returned. +// +// Example: +// +// request := &coss.CreateOauthAppRequest{ +// Google: &coss.CreateOauthAppRequestGoogle{ +// ClientID: "client_id", +// ClientSecret: "client_secret", +// }, +// } +// client.Scheduling.OauthApps.Create( +// context.TODO(), +// request, +// ) +func (c *Client) Create( + ctx context.Context, + request *coss.CreateOauthAppRequest, + opts ...option.RequestOption, +) (*coss.SchedulingOauthApp, error) { + response, err := c.WithRawResponse.Create( + ctx, + request, + opts..., + ) + if err != nil { + return nil, err + } + return response.Body, nil +} + +// Its status, what to register at the provider, and how many connections use it. +// +// Example: +// +// request := &scheduling.GetOauthAppsRequest{ +// ID: "calapp_01kd2m9a0b1c2d3e4f5g6h7j8m", +// } +// client.Scheduling.OauthApps.Get( +// context.TODO(), +// request, +// ) +func (c *Client) Get( + ctx context.Context, + request *scheduling.GetOauthAppsRequest, + opts ...option.RequestOption, +) (*coss.SchedulingOauthApp, error) { + response, err := c.WithRawResponse.Get( + ctx, + request, + opts..., + ) + if err != nil { + return nil, err + } + return response.Body, nil +} + +// Refused while connections use it (`oauth_app_in_use`), since only it can refresh their access: disconnect them first. New consents go back to coss.com's app. +// +// Example: +// +// request := &scheduling.DeleteOauthAppsRequest{ +// ID: "calapp_01kd2m9a0b1c2d3e4f5g6h7j8m", +// } +// client.Scheduling.OauthApps.Delete( +// context.TODO(), +// request, +// ) +func (c *Client) Delete( + ctx context.Context, + request *scheduling.DeleteOauthAppsRequest, + opts ...option.RequestOption, +) (*coss.DeletedSchedulingOauthApp, error) { + response, err := c.WithRawResponse.Delete( + ctx, + request, + opts..., + ) + if err != nil { + return nil, err + } + return response.Body, nil +} + +// A new client secret is tried on a connection before it replaces the old one, and ends an outage if it works. Its client ID can't change: a different app needs its hosts to consent again. +// +// Example: +// +// request := &scheduling.UpdateOauthAppRequest{ +// ID: "calapp_01kd2m9a0b1c2d3e4f5g6h7j8m", +// ClientSecret: coss.String( +// "GOCSPX-abcdefghijklmnopqrstuvwxyz", +// ), +// } +// client.Scheduling.OauthApps.Update( +// context.TODO(), +// request, +// ) +func (c *Client) Update( + ctx context.Context, + request *scheduling.UpdateOauthAppRequest, + opts ...option.RequestOption, +) (*coss.SchedulingOauthApp, error) { + response, err := c.WithRawResponse.Update( + ctx, + request, + opts..., + ) + if err != nil { + return nil, err + } + return response.Body, nil +} diff --git a/sdks/go/scheduling/oauthapps/raw_client.go b/sdks/go/scheduling/oauthapps/raw_client.go new file mode 100644 index 000000000..6104c2134 --- /dev/null +++ b/sdks/go/scheduling/oauthapps/raw_client.go @@ -0,0 +1,257 @@ +// Code generated by Fern. DO NOT EDIT. + +package oauthapps + +import ( + context "context" + http "net/http" + + coss "github.com/cosscom/coss-go" + core "github.com/cosscom/coss-go/core" + internal "github.com/cosscom/coss-go/internal" + option "github.com/cosscom/coss-go/option" + scheduling "github.com/cosscom/coss-go/scheduling" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + DisableRetries: options.DisableRetries, + }, + ), + } +} + +func (r *RawClient) List( + ctx context.Context, + opts ...option.RequestOption, +) (*core.Response[*coss.SchedulingOauthAppList], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "https://api.coss.com", + ) + endpointURL := baseURL + "/v1/scheduling/oauth_apps" + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *coss.SchedulingOauthAppList + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + DisableRetries: options.DisableRetries, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + ErrorDecoder: internal.NewErrorDecoder(scheduling.ErrorCodes), + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*coss.SchedulingOauthAppList]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} + +func (r *RawClient) Create( + ctx context.Context, + request *coss.CreateOauthAppRequest, + opts ...option.RequestOption, +) (*core.Response[*coss.SchedulingOauthApp], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "https://api.coss.com", + ) + endpointURL := baseURL + "/v1/scheduling/oauth_apps" + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + core.SetIdempotencyKeyHeader(headers) + + var response *coss.SchedulingOauthApp + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodPost, + Headers: headers, + MaxAttempts: options.MaxAttempts, + DisableRetries: true, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Request: request, + Response: &response, + ErrorDecoder: internal.NewErrorDecoder(scheduling.ErrorCodes), + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*coss.SchedulingOauthApp]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} + +func (r *RawClient) Get( + ctx context.Context, + request *scheduling.GetOauthAppsRequest, + opts ...option.RequestOption, +) (*core.Response[*coss.SchedulingOauthApp], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "https://api.coss.com", + ) + endpointURL := internal.EncodeURL( + baseURL+"/v1/scheduling/oauth_apps/%v", + request.ID, + ) + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *coss.SchedulingOauthApp + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + DisableRetries: options.DisableRetries, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + ErrorDecoder: internal.NewErrorDecoder(scheduling.ErrorCodes), + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*coss.SchedulingOauthApp]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} + +func (r *RawClient) Delete( + ctx context.Context, + request *scheduling.DeleteOauthAppsRequest, + opts ...option.RequestOption, +) (*core.Response[*coss.DeletedSchedulingOauthApp], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "https://api.coss.com", + ) + endpointURL := internal.EncodeURL( + baseURL+"/v1/scheduling/oauth_apps/%v", + request.ID, + ) + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *coss.DeletedSchedulingOauthApp + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodDelete, + Headers: headers, + MaxAttempts: options.MaxAttempts, + DisableRetries: options.DisableRetries, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + ErrorDecoder: internal.NewErrorDecoder(scheduling.ErrorCodes), + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*coss.DeletedSchedulingOauthApp]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} + +func (r *RawClient) Update( + ctx context.Context, + request *scheduling.UpdateOauthAppRequest, + opts ...option.RequestOption, +) (*core.Response[*coss.SchedulingOauthApp], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "https://api.coss.com", + ) + endpointURL := internal.EncodeURL( + baseURL+"/v1/scheduling/oauth_apps/%v", + request.ID, + ) + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + headers.Add("Content-Type", "application/json") + var response *coss.SchedulingOauthApp + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodPatch, + Headers: headers, + MaxAttempts: options.MaxAttempts, + DisableRetries: options.DisableRetries, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Request: request, + Response: &response, + ErrorDecoder: internal.NewErrorDecoder(scheduling.ErrorCodes), + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*coss.SchedulingOauthApp]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} diff --git a/sdks/go/scheduling/out_of_office.go b/sdks/go/scheduling/out_of_office.go new file mode 100644 index 000000000..a91186725 --- /dev/null +++ b/sdks/go/scheduling/out_of_office.go @@ -0,0 +1,1290 @@ +// Code generated by Fern. DO NOT EDIT. + +package scheduling + +import ( + json "encoding/json" + fmt "fmt" + internal "github.com/cosscom/coss-go/internal" + big "math/big" +) + +var ( + conflictsOutOfOfficeRequestFieldID = big.NewInt(1 << 0) + conflictsOutOfOfficeRequestFieldLimit = big.NewInt(1 << 1) +) + +type ConflictsOutOfOfficeRequest struct { + // The entry's id. + ID string `json:"-" url:"-"` + Limit *int `json:"-" url:"limit,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (c *ConflictsOutOfOfficeRequest) require(field *big.Int) { + next := new(big.Int) + if c.explicitFields != nil { + next.Set(c.explicitFields) + } + next.Or(next, field) + c.explicitFields = next +} + +// SetID sets the ID field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ConflictsOutOfOfficeRequest) SetID(id string) { + c.ID = id + c.require(conflictsOutOfOfficeRequestFieldID) +} + +// SetLimit sets the Limit field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ConflictsOutOfOfficeRequest) SetLimit(limit *int) { + c.Limit = limit + c.require(conflictsOutOfOfficeRequestFieldLimit) +} + +var ( + createSchedulingOutOfOfficeRequestFieldHost = big.NewInt(1 << 0) + createSchedulingOutOfOfficeRequestFieldHosts = big.NewInt(1 << 1) + createSchedulingOutOfOfficeRequestFieldHostFilter = big.NewInt(1 << 2) + createSchedulingOutOfOfficeRequestFieldStart = big.NewInt(1 << 3) + createSchedulingOutOfOfficeRequestFieldEnd = big.NewInt(1 << 4) + createSchedulingOutOfOfficeRequestFieldStartDate = big.NewInt(1 << 5) + createSchedulingOutOfOfficeRequestFieldEndDate = big.NewInt(1 << 6) + createSchedulingOutOfOfficeRequestFieldTimeZone = big.NewInt(1 << 7) + createSchedulingOutOfOfficeRequestFieldDelegates = big.NewInt(1 << 8) + createSchedulingOutOfOfficeRequestFieldReason = big.NewInt(1 << 9) + createSchedulingOutOfOfficeRequestFieldNotes = big.NewInt(1 << 10) + createSchedulingOutOfOfficeRequestFieldPublicMessage = big.NewInt(1 << 11) + createSchedulingOutOfOfficeRequestFieldShowOnCalendar = big.NewInt(1 << 12) + createSchedulingOutOfOfficeRequestFieldExistingBookings = big.NewInt(1 << 13) + createSchedulingOutOfOfficeRequestFieldReassign = big.NewInt(1 << 14) + createSchedulingOutOfOfficeRequestFieldExternalID = big.NewInt(1 << 15) +) + +type CreateSchedulingOutOfOfficeRequest struct { + // One host, by id or uid. + Host *string `json:"host,omitempty" url:"-"` + // Several hosts, by id or uid. Each gets an entry of their own. + Hosts []string `json:"hosts,omitempty" url:"-"` + // Every active host matching these attributes right now. A host added later isn't covered. + HostFilter map[string]*CreateSchedulingOutOfOfficeRequestHostFilterValue `json:"host_filter,omitempty" url:"-"` + // An ISO 8601 instant with an offset. + Start *string `json:"start,omitempty" url:"-"` + // An ISO 8601 instant with an offset. + End *string `json:"end,omitempty" url:"-"` + // The first whole day away. Use instead of `start` and `end`. + StartDate *string `json:"start_date,omitempty" url:"-"` + // The last whole day away, which is included. + EndDate *string `json:"end_date,omitempty" url:"-"` + // What the dates mean in. Default: the host's zone when this is made. + TimeZone *string `json:"time_zone,omitempty" url:"-"` + // Who can be booked in this host's place during it, by id or uid, in the order to try them. They still have to fit how a booking's routed. + Delegates []string `json:"delegates,omitempty" url:"-"` + // One of `unspecified`, `vacation`, `travel`, `sick`, `public_holiday`, `parental_leave`, `training` and `other`, or a key from the settings' `out_of_office_reasons`. Only people who manage this host see it: never bookers, webhooks or calendars. + Reason *string `json:"reason,omitempty" url:"-"` + // For people who manage this host. Encrypted, and never shown to a booker. + Notes *string `json:"notes,omitempty" url:"-"` + // Shown to bookers while this host is away. Can't contain a link. + PublicMessage *string `json:"public_message,omitempty" url:"-"` + // Put a private "Out of office" event on the host's calendar. Default: true. + ShowOnCalendar *bool `json:"show_on_calendar,omitempty" url:"-"` + // What happens to bookings already in the way. `leave` (the default) only reports them. `reassign` moves them, and any nobody can take stay where they are. + ExistingBookings *CreateSchedulingOutOfOfficeRequestExistingBookings `json:"existing_bookings,omitempty" url:"-"` + // With `existing_bookings: reassign`: who they go to. Default: the fairest who's free. + Reassign *CreateSchedulingOutOfOfficeRequestReassign `json:"reassign,omitempty" url:"-"` + // Your own id for this entry, unique in the environment. Needs one host. + ExternalID *string `json:"external_id,omitempty" url:"-"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (c *CreateSchedulingOutOfOfficeRequest) require(field *big.Int) { + next := new(big.Int) + if c.explicitFields != nil { + next.Set(c.explicitFields) + } + next.Or(next, field) + c.explicitFields = next +} + +// SetHost sets the Host field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreateSchedulingOutOfOfficeRequest) SetHost(host *string) { + c.Host = host + c.require(createSchedulingOutOfOfficeRequestFieldHost) +} + +// SetHosts sets the Hosts field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreateSchedulingOutOfOfficeRequest) SetHosts(hosts []string) { + c.Hosts = hosts + c.require(createSchedulingOutOfOfficeRequestFieldHosts) +} + +// SetHostFilter sets the HostFilter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreateSchedulingOutOfOfficeRequest) SetHostFilter(hostFilter map[string]*CreateSchedulingOutOfOfficeRequestHostFilterValue) { + c.HostFilter = hostFilter + c.require(createSchedulingOutOfOfficeRequestFieldHostFilter) +} + +// SetStart sets the Start field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreateSchedulingOutOfOfficeRequest) SetStart(start *string) { + c.Start = start + c.require(createSchedulingOutOfOfficeRequestFieldStart) +} + +// SetEnd sets the End field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreateSchedulingOutOfOfficeRequest) SetEnd(end *string) { + c.End = end + c.require(createSchedulingOutOfOfficeRequestFieldEnd) +} + +// SetStartDate sets the StartDate field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreateSchedulingOutOfOfficeRequest) SetStartDate(startDate *string) { + c.StartDate = startDate + c.require(createSchedulingOutOfOfficeRequestFieldStartDate) +} + +// SetEndDate sets the EndDate field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreateSchedulingOutOfOfficeRequest) SetEndDate(endDate *string) { + c.EndDate = endDate + c.require(createSchedulingOutOfOfficeRequestFieldEndDate) +} + +// SetTimeZone sets the TimeZone field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreateSchedulingOutOfOfficeRequest) SetTimeZone(timeZone *string) { + c.TimeZone = timeZone + c.require(createSchedulingOutOfOfficeRequestFieldTimeZone) +} + +// SetDelegates sets the Delegates field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreateSchedulingOutOfOfficeRequest) SetDelegates(delegates []string) { + c.Delegates = delegates + c.require(createSchedulingOutOfOfficeRequestFieldDelegates) +} + +// SetReason sets the Reason field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreateSchedulingOutOfOfficeRequest) SetReason(reason *string) { + c.Reason = reason + c.require(createSchedulingOutOfOfficeRequestFieldReason) +} + +// SetNotes sets the Notes field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreateSchedulingOutOfOfficeRequest) SetNotes(notes *string) { + c.Notes = notes + c.require(createSchedulingOutOfOfficeRequestFieldNotes) +} + +// SetPublicMessage sets the PublicMessage field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreateSchedulingOutOfOfficeRequest) SetPublicMessage(publicMessage *string) { + c.PublicMessage = publicMessage + c.require(createSchedulingOutOfOfficeRequestFieldPublicMessage) +} + +// SetShowOnCalendar sets the ShowOnCalendar field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreateSchedulingOutOfOfficeRequest) SetShowOnCalendar(showOnCalendar *bool) { + c.ShowOnCalendar = showOnCalendar + c.require(createSchedulingOutOfOfficeRequestFieldShowOnCalendar) +} + +// SetExistingBookings sets the ExistingBookings field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreateSchedulingOutOfOfficeRequest) SetExistingBookings(existingBookings *CreateSchedulingOutOfOfficeRequestExistingBookings) { + c.ExistingBookings = existingBookings + c.require(createSchedulingOutOfOfficeRequestFieldExistingBookings) +} + +// SetReassign sets the Reassign field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreateSchedulingOutOfOfficeRequest) SetReassign(reassign *CreateSchedulingOutOfOfficeRequestReassign) { + c.Reassign = reassign + c.require(createSchedulingOutOfOfficeRequestFieldReassign) +} + +// SetExternalID sets the ExternalID field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreateSchedulingOutOfOfficeRequest) SetExternalID(externalID *string) { + c.ExternalID = externalID + c.require(createSchedulingOutOfOfficeRequestFieldExternalID) +} + +func (c *CreateSchedulingOutOfOfficeRequest) UnmarshalJSON(data []byte) error { + type unmarshaler CreateSchedulingOutOfOfficeRequest + var body unmarshaler + if err := json.Unmarshal(data, &body); err != nil { + return err + } + *c = CreateSchedulingOutOfOfficeRequest(body) + return nil +} + +func (c *CreateSchedulingOutOfOfficeRequest) MarshalJSON() ([]byte, error) { + type embed CreateSchedulingOutOfOfficeRequest + var marshaler = struct { + embed + }{ + embed: embed(*c), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, c.explicitFields) + return json.Marshal(explicitMarshaler) +} + +var ( + getOutOfOfficeRequestFieldID = big.NewInt(1 << 0) +) + +type GetOutOfOfficeRequest struct { + // The entry's id. + ID string `json:"-" url:"-"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (g *GetOutOfOfficeRequest) require(field *big.Int) { + next := new(big.Int) + if g.explicitFields != nil { + next.Set(g.explicitFields) + } + next.Or(next, field) + g.explicitFields = next +} + +// SetID sets the ID field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (g *GetOutOfOfficeRequest) SetID(id string) { + g.ID = id + g.require(getOutOfOfficeRequestFieldID) +} + +var ( + listOutOfOfficeRequestFieldLimit = big.NewInt(1 << 0) + listOutOfOfficeRequestFieldAfter = big.NewInt(1 << 1) + listOutOfOfficeRequestFieldHost = big.NewInt(1 << 2) + listOutOfOfficeRequestFieldStartAfter = big.NewInt(1 << 3) + listOutOfOfficeRequestFieldStartBefore = big.NewInt(1 << 4) + listOutOfOfficeRequestFieldGroup = big.NewInt(1 << 5) +) + +type ListOutOfOfficeRequest struct { + Limit *int `json:"-" url:"limit,omitempty"` + // The last id of the previous page. + After *string `json:"-" url:"after,omitempty"` + // One host's entries, by id or uid. + Host *string `json:"-" url:"host,omitempty"` + // Entries ending after this. + StartAfter *string `json:"-" url:"start_after,omitempty"` + // Entries starting before this. + StartBefore *string `json:"-" url:"start_before,omitempty"` + // The entries one request made. + Group *string `json:"-" url:"group,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (l *ListOutOfOfficeRequest) require(field *big.Int) { + next := new(big.Int) + if l.explicitFields != nil { + next.Set(l.explicitFields) + } + next.Or(next, field) + l.explicitFields = next +} + +// SetLimit sets the Limit field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *ListOutOfOfficeRequest) SetLimit(limit *int) { + l.Limit = limit + l.require(listOutOfOfficeRequestFieldLimit) +} + +// SetAfter sets the After field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *ListOutOfOfficeRequest) SetAfter(after *string) { + l.After = after + l.require(listOutOfOfficeRequestFieldAfter) +} + +// SetHost sets the Host field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *ListOutOfOfficeRequest) SetHost(host *string) { + l.Host = host + l.require(listOutOfOfficeRequestFieldHost) +} + +// SetStartAfter sets the StartAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *ListOutOfOfficeRequest) SetStartAfter(startAfter *string) { + l.StartAfter = startAfter + l.require(listOutOfOfficeRequestFieldStartAfter) +} + +// SetStartBefore sets the StartBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *ListOutOfOfficeRequest) SetStartBefore(startBefore *string) { + l.StartBefore = startBefore + l.require(listOutOfOfficeRequestFieldStartBefore) +} + +// SetGroup sets the Group field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *ListOutOfOfficeRequest) SetGroup(group *string) { + l.Group = group + l.require(listOutOfOfficeRequestFieldGroup) +} + +var ( + putSchedulingOutOfOfficeRequestFieldExternalID = big.NewInt(1 << 0) + putSchedulingOutOfOfficeRequestFieldHost = big.NewInt(1 << 1) + putSchedulingOutOfOfficeRequestFieldStart = big.NewInt(1 << 2) + putSchedulingOutOfOfficeRequestFieldEnd = big.NewInt(1 << 3) + putSchedulingOutOfOfficeRequestFieldStartDate = big.NewInt(1 << 4) + putSchedulingOutOfOfficeRequestFieldEndDate = big.NewInt(1 << 5) + putSchedulingOutOfOfficeRequestFieldTimeZone = big.NewInt(1 << 6) + putSchedulingOutOfOfficeRequestFieldDelegates = big.NewInt(1 << 7) + putSchedulingOutOfOfficeRequestFieldReason = big.NewInt(1 << 8) + putSchedulingOutOfOfficeRequestFieldNotes = big.NewInt(1 << 9) + putSchedulingOutOfOfficeRequestFieldPublicMessage = big.NewInt(1 << 10) + putSchedulingOutOfOfficeRequestFieldShowOnCalendar = big.NewInt(1 << 11) + putSchedulingOutOfOfficeRequestFieldExistingBookings = big.NewInt(1 << 12) + putSchedulingOutOfOfficeRequestFieldReassign = big.NewInt(1 << 13) +) + +type PutSchedulingOutOfOfficeRequest struct { + // Your own id for the entry. + ExternalID string `json:"-" url:"-"` + // The host, by id or uid. + Host string `json:"host" url:"-"` + // An ISO 8601 instant with an offset. + Start *string `json:"start,omitempty" url:"-"` + // An ISO 8601 instant with an offset. + End *string `json:"end,omitempty" url:"-"` + // The first whole day away. Use instead of `start` and `end`. + StartDate *string `json:"start_date,omitempty" url:"-"` + // The last whole day away, which is included. + EndDate *string `json:"end_date,omitempty" url:"-"` + // What the dates mean in. Default: the host's zone when this is made. + TimeZone *string `json:"time_zone,omitempty" url:"-"` + // Who can be booked in this host's place during it, by id or uid, in the order to try them. They still have to fit how a booking's routed. + Delegates []string `json:"delegates,omitempty" url:"-"` + // One of `unspecified`, `vacation`, `travel`, `sick`, `public_holiday`, `parental_leave`, `training` and `other`, or a key from the settings' `out_of_office_reasons`. Only people who manage this host see it: never bookers, webhooks or calendars. + Reason *string `json:"reason,omitempty" url:"-"` + // For people who manage this host. Encrypted, and never shown to a booker. + Notes *string `json:"notes,omitempty" url:"-"` + // Shown to bookers while this host is away. Can't contain a link. + PublicMessage *string `json:"public_message,omitempty" url:"-"` + // Put a private "Out of office" event on the host's calendar. Default: true. + ShowOnCalendar *bool `json:"show_on_calendar,omitempty" url:"-"` + // What happens to bookings already in the way. `leave` (the default) only reports them. `reassign` moves them, and any nobody can take stay where they are. + ExistingBookings *PutSchedulingOutOfOfficeRequestExistingBookings `json:"existing_bookings,omitempty" url:"-"` + // With `existing_bookings: reassign`: who they go to. Default: the fairest who's free. + Reassign *PutSchedulingOutOfOfficeRequestReassign `json:"reassign,omitempty" url:"-"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (p *PutSchedulingOutOfOfficeRequest) require(field *big.Int) { + next := new(big.Int) + if p.explicitFields != nil { + next.Set(p.explicitFields) + } + next.Or(next, field) + p.explicitFields = next +} + +// SetExternalID sets the ExternalID field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PutSchedulingOutOfOfficeRequest) SetExternalID(externalID string) { + p.ExternalID = externalID + p.require(putSchedulingOutOfOfficeRequestFieldExternalID) +} + +// SetHost sets the Host field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PutSchedulingOutOfOfficeRequest) SetHost(host string) { + p.Host = host + p.require(putSchedulingOutOfOfficeRequestFieldHost) +} + +// SetStart sets the Start field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PutSchedulingOutOfOfficeRequest) SetStart(start *string) { + p.Start = start + p.require(putSchedulingOutOfOfficeRequestFieldStart) +} + +// SetEnd sets the End field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PutSchedulingOutOfOfficeRequest) SetEnd(end *string) { + p.End = end + p.require(putSchedulingOutOfOfficeRequestFieldEnd) +} + +// SetStartDate sets the StartDate field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PutSchedulingOutOfOfficeRequest) SetStartDate(startDate *string) { + p.StartDate = startDate + p.require(putSchedulingOutOfOfficeRequestFieldStartDate) +} + +// SetEndDate sets the EndDate field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PutSchedulingOutOfOfficeRequest) SetEndDate(endDate *string) { + p.EndDate = endDate + p.require(putSchedulingOutOfOfficeRequestFieldEndDate) +} + +// SetTimeZone sets the TimeZone field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PutSchedulingOutOfOfficeRequest) SetTimeZone(timeZone *string) { + p.TimeZone = timeZone + p.require(putSchedulingOutOfOfficeRequestFieldTimeZone) +} + +// SetDelegates sets the Delegates field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PutSchedulingOutOfOfficeRequest) SetDelegates(delegates []string) { + p.Delegates = delegates + p.require(putSchedulingOutOfOfficeRequestFieldDelegates) +} + +// SetReason sets the Reason field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PutSchedulingOutOfOfficeRequest) SetReason(reason *string) { + p.Reason = reason + p.require(putSchedulingOutOfOfficeRequestFieldReason) +} + +// SetNotes sets the Notes field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PutSchedulingOutOfOfficeRequest) SetNotes(notes *string) { + p.Notes = notes + p.require(putSchedulingOutOfOfficeRequestFieldNotes) +} + +// SetPublicMessage sets the PublicMessage field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PutSchedulingOutOfOfficeRequest) SetPublicMessage(publicMessage *string) { + p.PublicMessage = publicMessage + p.require(putSchedulingOutOfOfficeRequestFieldPublicMessage) +} + +// SetShowOnCalendar sets the ShowOnCalendar field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PutSchedulingOutOfOfficeRequest) SetShowOnCalendar(showOnCalendar *bool) { + p.ShowOnCalendar = showOnCalendar + p.require(putSchedulingOutOfOfficeRequestFieldShowOnCalendar) +} + +// SetExistingBookings sets the ExistingBookings field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PutSchedulingOutOfOfficeRequest) SetExistingBookings(existingBookings *PutSchedulingOutOfOfficeRequestExistingBookings) { + p.ExistingBookings = existingBookings + p.require(putSchedulingOutOfOfficeRequestFieldExistingBookings) +} + +// SetReassign sets the Reassign field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PutSchedulingOutOfOfficeRequest) SetReassign(reassign *PutSchedulingOutOfOfficeRequestReassign) { + p.Reassign = reassign + p.require(putSchedulingOutOfOfficeRequestFieldReassign) +} + +func (p *PutSchedulingOutOfOfficeRequest) UnmarshalJSON(data []byte) error { + type unmarshaler PutSchedulingOutOfOfficeRequest + var body unmarshaler + if err := json.Unmarshal(data, &body); err != nil { + return err + } + *p = PutSchedulingOutOfOfficeRequest(body) + return nil +} + +func (p *PutSchedulingOutOfOfficeRequest) MarshalJSON() ([]byte, error) { + type embed PutSchedulingOutOfOfficeRequest + var marshaler = struct { + embed + }{ + embed: embed(*p), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, p.explicitFields) + return json.Marshal(explicitMarshaler) +} + +var ( + removeOutOfOfficeRequestFieldID = big.NewInt(1 << 0) +) + +type RemoveOutOfOfficeRequest struct { + // The entry's id. + ID string `json:"-" url:"-"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (r *RemoveOutOfOfficeRequest) require(field *big.Int) { + next := new(big.Int) + if r.explicitFields != nil { + next.Set(r.explicitFields) + } + next.Or(next, field) + r.explicitFields = next +} + +// SetID sets the ID field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RemoveOutOfOfficeRequest) SetID(id string) { + r.ID = id + r.require(removeOutOfOfficeRequestFieldID) +} + +// What happens to bookings already in the way. `leave` (the default) only reports them. `reassign` moves them, and any nobody can take stay where they are. +type CreateSchedulingOutOfOfficeRequestExistingBookings string + +const ( + CreateSchedulingOutOfOfficeRequestExistingBookingsLeave CreateSchedulingOutOfOfficeRequestExistingBookings = "leave" + CreateSchedulingOutOfOfficeRequestExistingBookingsReassign CreateSchedulingOutOfOfficeRequestExistingBookings = "reassign" +) + +func NewCreateSchedulingOutOfOfficeRequestExistingBookingsFromString(s string) (CreateSchedulingOutOfOfficeRequestExistingBookings, error) { + switch s { + case "leave": + return CreateSchedulingOutOfOfficeRequestExistingBookingsLeave, nil + case "reassign": + return CreateSchedulingOutOfOfficeRequestExistingBookingsReassign, nil + } + var t CreateSchedulingOutOfOfficeRequestExistingBookings + return "", fmt.Errorf("%s is not a valid %T", s, t) +} + +func (c CreateSchedulingOutOfOfficeRequestExistingBookings) Ptr() *CreateSchedulingOutOfOfficeRequestExistingBookings { + return &c +} + +type CreateSchedulingOutOfOfficeRequestHostFilterValue struct { + String string + StringList []string + + typ string +} + +func (c *CreateSchedulingOutOfOfficeRequestHostFilterValue) GetString() string { + if c == nil { + return "" + } + return c.String +} + +func (c *CreateSchedulingOutOfOfficeRequestHostFilterValue) GetStringList() []string { + if c == nil { + return nil + } + return c.StringList +} + +func (c *CreateSchedulingOutOfOfficeRequestHostFilterValue) UnmarshalJSON(data []byte) error { + var valueString string + if err := json.Unmarshal(data, &valueString); err == nil { + c.typ = "String" + c.String = valueString + return nil + } + var valueStringList []string + if err := json.Unmarshal(data, &valueStringList); err == nil { + c.typ = "StringList" + c.StringList = valueStringList + return nil + } + return fmt.Errorf("%s cannot be deserialized as a %T", data, c) +} + +func (c CreateSchedulingOutOfOfficeRequestHostFilterValue) MarshalJSON() ([]byte, error) { + if c.typ == "String" || c.String != "" { + return json.Marshal(c.String) + } + if c.typ == "StringList" || c.StringList != nil { + return json.Marshal(c.StringList) + } + return nil, fmt.Errorf("type %T does not include a non-empty union type", c) +} + +type CreateSchedulingOutOfOfficeRequestHostFilterValueVisitor interface { + VisitString(string) error + VisitStringList([]string) error +} + +func (c *CreateSchedulingOutOfOfficeRequestHostFilterValue) Accept(visitor CreateSchedulingOutOfOfficeRequestHostFilterValueVisitor) error { + if c.typ == "String" || c.String != "" { + return visitor.VisitString(c.String) + } + if c.typ == "StringList" || c.StringList != nil { + return visitor.VisitStringList(c.StringList) + } + return fmt.Errorf("type %T does not include a non-empty union type", c) +} + +var ( + createSchedulingOutOfOfficeRequestReassignFieldToHost = big.NewInt(1 << 0) + createSchedulingOutOfOfficeRequestReassignFieldPreferredHosts = big.NewInt(1 << 1) + createSchedulingOutOfOfficeRequestReassignFieldOtherwise = big.NewInt(1 << 2) +) + +// With `existing_bookings: reassign`: who they go to. Default: the fairest who's free. +type CreateSchedulingOutOfOfficeRequestReassign struct { + // Give them all to this host. + ToHost *string `json:"to_host,omitempty" url:"to_host,omitempty"` + // Try these first, in order. + PreferredHosts []string `json:"preferred_hosts,omitempty" url:"preferred_hosts,omitempty"` + // After `preferred_hosts`: `auto` picks the fairest who's free (the default), `leave` keeps it where it is. + Otherwise *CreateSchedulingOutOfOfficeRequestReassignOtherwise `json:"otherwise,omitempty" url:"otherwise,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + + extraProperties map[string]interface{} + rawJSON json.RawMessage +} + +func (c *CreateSchedulingOutOfOfficeRequestReassign) GetToHost() *string { + if c == nil { + return nil + } + return c.ToHost +} + +func (c *CreateSchedulingOutOfOfficeRequestReassign) GetPreferredHosts() []string { + if c == nil { + return nil + } + return c.PreferredHosts +} + +func (c *CreateSchedulingOutOfOfficeRequestReassign) GetOtherwise() *CreateSchedulingOutOfOfficeRequestReassignOtherwise { + if c == nil { + return nil + } + return c.Otherwise +} + +func (c *CreateSchedulingOutOfOfficeRequestReassign) GetExtraProperties() map[string]interface{} { + if c == nil { + return nil + } + return c.extraProperties +} + +func (c *CreateSchedulingOutOfOfficeRequestReassign) require(field *big.Int) { + next := new(big.Int) + if c.explicitFields != nil { + next.Set(c.explicitFields) + } + next.Or(next, field) + c.explicitFields = next +} + +// SetToHost sets the ToHost field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreateSchedulingOutOfOfficeRequestReassign) SetToHost(toHost *string) { + c.ToHost = toHost + c.require(createSchedulingOutOfOfficeRequestReassignFieldToHost) +} + +// SetPreferredHosts sets the PreferredHosts field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreateSchedulingOutOfOfficeRequestReassign) SetPreferredHosts(preferredHosts []string) { + c.PreferredHosts = preferredHosts + c.require(createSchedulingOutOfOfficeRequestReassignFieldPreferredHosts) +} + +// SetOtherwise sets the Otherwise field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreateSchedulingOutOfOfficeRequestReassign) SetOtherwise(otherwise *CreateSchedulingOutOfOfficeRequestReassignOtherwise) { + c.Otherwise = otherwise + c.require(createSchedulingOutOfOfficeRequestReassignFieldOtherwise) +} + +func (c *CreateSchedulingOutOfOfficeRequestReassign) UnmarshalJSON(data []byte) error { + type unmarshaler CreateSchedulingOutOfOfficeRequestReassign + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *c = CreateSchedulingOutOfOfficeRequestReassign(value) + extraProperties, err := internal.ExtractExtraProperties(data, *c) + if err != nil { + return err + } + c.extraProperties = extraProperties + c.rawJSON = json.RawMessage(data) + return nil +} + +func (c *CreateSchedulingOutOfOfficeRequestReassign) MarshalJSON() ([]byte, error) { + type embed CreateSchedulingOutOfOfficeRequestReassign + var marshaler = struct { + embed + }{ + embed: embed(*c), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, c.explicitFields) + return json.Marshal(explicitMarshaler) +} + +func (c *CreateSchedulingOutOfOfficeRequestReassign) String() string { + if c == nil { + return "" + } + if len(c.rawJSON) > 0 { + if value, err := internal.StringifyJSON(c.rawJSON); err == nil { + return value + } + } + if value, err := internal.StringifyJSON(c); err == nil { + return value + } + return fmt.Sprintf("%#v", c) +} + +// After `preferred_hosts`: `auto` picks the fairest who's free (the default), `leave` keeps it where it is. +type CreateSchedulingOutOfOfficeRequestReassignOtherwise string + +const ( + CreateSchedulingOutOfOfficeRequestReassignOtherwiseAuto CreateSchedulingOutOfOfficeRequestReassignOtherwise = "auto" + CreateSchedulingOutOfOfficeRequestReassignOtherwiseLeave CreateSchedulingOutOfOfficeRequestReassignOtherwise = "leave" +) + +func NewCreateSchedulingOutOfOfficeRequestReassignOtherwiseFromString(s string) (CreateSchedulingOutOfOfficeRequestReassignOtherwise, error) { + switch s { + case "auto": + return CreateSchedulingOutOfOfficeRequestReassignOtherwiseAuto, nil + case "leave": + return CreateSchedulingOutOfOfficeRequestReassignOtherwiseLeave, nil + } + var t CreateSchedulingOutOfOfficeRequestReassignOtherwise + return "", fmt.Errorf("%s is not a valid %T", s, t) +} + +func (c CreateSchedulingOutOfOfficeRequestReassignOtherwise) Ptr() *CreateSchedulingOutOfOfficeRequestReassignOtherwise { + return &c +} + +// What happens to bookings already in the way. `leave` (the default) only reports them. `reassign` moves them, and any nobody can take stay where they are. +type PutSchedulingOutOfOfficeRequestExistingBookings string + +const ( + PutSchedulingOutOfOfficeRequestExistingBookingsLeave PutSchedulingOutOfOfficeRequestExistingBookings = "leave" + PutSchedulingOutOfOfficeRequestExistingBookingsReassign PutSchedulingOutOfOfficeRequestExistingBookings = "reassign" +) + +func NewPutSchedulingOutOfOfficeRequestExistingBookingsFromString(s string) (PutSchedulingOutOfOfficeRequestExistingBookings, error) { + switch s { + case "leave": + return PutSchedulingOutOfOfficeRequestExistingBookingsLeave, nil + case "reassign": + return PutSchedulingOutOfOfficeRequestExistingBookingsReassign, nil + } + var t PutSchedulingOutOfOfficeRequestExistingBookings + return "", fmt.Errorf("%s is not a valid %T", s, t) +} + +func (p PutSchedulingOutOfOfficeRequestExistingBookings) Ptr() *PutSchedulingOutOfOfficeRequestExistingBookings { + return &p +} + +var ( + putSchedulingOutOfOfficeRequestReassignFieldToHost = big.NewInt(1 << 0) + putSchedulingOutOfOfficeRequestReassignFieldPreferredHosts = big.NewInt(1 << 1) + putSchedulingOutOfOfficeRequestReassignFieldOtherwise = big.NewInt(1 << 2) +) + +// With `existing_bookings: reassign`: who they go to. Default: the fairest who's free. +type PutSchedulingOutOfOfficeRequestReassign struct { + // Give them all to this host. + ToHost *string `json:"to_host,omitempty" url:"to_host,omitempty"` + // Try these first, in order. + PreferredHosts []string `json:"preferred_hosts,omitempty" url:"preferred_hosts,omitempty"` + // After `preferred_hosts`: `auto` picks the fairest who's free (the default), `leave` keeps it where it is. + Otherwise *PutSchedulingOutOfOfficeRequestReassignOtherwise `json:"otherwise,omitempty" url:"otherwise,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + + extraProperties map[string]interface{} + rawJSON json.RawMessage +} + +func (p *PutSchedulingOutOfOfficeRequestReassign) GetToHost() *string { + if p == nil { + return nil + } + return p.ToHost +} + +func (p *PutSchedulingOutOfOfficeRequestReassign) GetPreferredHosts() []string { + if p == nil { + return nil + } + return p.PreferredHosts +} + +func (p *PutSchedulingOutOfOfficeRequestReassign) GetOtherwise() *PutSchedulingOutOfOfficeRequestReassignOtherwise { + if p == nil { + return nil + } + return p.Otherwise +} + +func (p *PutSchedulingOutOfOfficeRequestReassign) GetExtraProperties() map[string]interface{} { + if p == nil { + return nil + } + return p.extraProperties +} + +func (p *PutSchedulingOutOfOfficeRequestReassign) require(field *big.Int) { + next := new(big.Int) + if p.explicitFields != nil { + next.Set(p.explicitFields) + } + next.Or(next, field) + p.explicitFields = next +} + +// SetToHost sets the ToHost field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PutSchedulingOutOfOfficeRequestReassign) SetToHost(toHost *string) { + p.ToHost = toHost + p.require(putSchedulingOutOfOfficeRequestReassignFieldToHost) +} + +// SetPreferredHosts sets the PreferredHosts field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PutSchedulingOutOfOfficeRequestReassign) SetPreferredHosts(preferredHosts []string) { + p.PreferredHosts = preferredHosts + p.require(putSchedulingOutOfOfficeRequestReassignFieldPreferredHosts) +} + +// SetOtherwise sets the Otherwise field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PutSchedulingOutOfOfficeRequestReassign) SetOtherwise(otherwise *PutSchedulingOutOfOfficeRequestReassignOtherwise) { + p.Otherwise = otherwise + p.require(putSchedulingOutOfOfficeRequestReassignFieldOtherwise) +} + +func (p *PutSchedulingOutOfOfficeRequestReassign) UnmarshalJSON(data []byte) error { + type unmarshaler PutSchedulingOutOfOfficeRequestReassign + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *p = PutSchedulingOutOfOfficeRequestReassign(value) + extraProperties, err := internal.ExtractExtraProperties(data, *p) + if err != nil { + return err + } + p.extraProperties = extraProperties + p.rawJSON = json.RawMessage(data) + return nil +} + +func (p *PutSchedulingOutOfOfficeRequestReassign) MarshalJSON() ([]byte, error) { + type embed PutSchedulingOutOfOfficeRequestReassign + var marshaler = struct { + embed + }{ + embed: embed(*p), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, p.explicitFields) + return json.Marshal(explicitMarshaler) +} + +func (p *PutSchedulingOutOfOfficeRequestReassign) String() string { + if p == nil { + return "" + } + if len(p.rawJSON) > 0 { + if value, err := internal.StringifyJSON(p.rawJSON); err == nil { + return value + } + } + if value, err := internal.StringifyJSON(p); err == nil { + return value + } + return fmt.Sprintf("%#v", p) +} + +// After `preferred_hosts`: `auto` picks the fairest who's free (the default), `leave` keeps it where it is. +type PutSchedulingOutOfOfficeRequestReassignOtherwise string + +const ( + PutSchedulingOutOfOfficeRequestReassignOtherwiseAuto PutSchedulingOutOfOfficeRequestReassignOtherwise = "auto" + PutSchedulingOutOfOfficeRequestReassignOtherwiseLeave PutSchedulingOutOfOfficeRequestReassignOtherwise = "leave" +) + +func NewPutSchedulingOutOfOfficeRequestReassignOtherwiseFromString(s string) (PutSchedulingOutOfOfficeRequestReassignOtherwise, error) { + switch s { + case "auto": + return PutSchedulingOutOfOfficeRequestReassignOtherwiseAuto, nil + case "leave": + return PutSchedulingOutOfOfficeRequestReassignOtherwiseLeave, nil + } + var t PutSchedulingOutOfOfficeRequestReassignOtherwise + return "", fmt.Errorf("%s is not a valid %T", s, t) +} + +func (p PutSchedulingOutOfOfficeRequestReassignOtherwise) Ptr() *PutSchedulingOutOfOfficeRequestReassignOtherwise { + return &p +} + +// What happens to bookings already in the way. `leave` (the default) only reports them. `reassign` moves them, and any nobody can take stay where they are. +type UpdateSchedulingOutOfOfficeRequestExistingBookings string + +const ( + UpdateSchedulingOutOfOfficeRequestExistingBookingsLeave UpdateSchedulingOutOfOfficeRequestExistingBookings = "leave" + UpdateSchedulingOutOfOfficeRequestExistingBookingsReassign UpdateSchedulingOutOfOfficeRequestExistingBookings = "reassign" +) + +func NewUpdateSchedulingOutOfOfficeRequestExistingBookingsFromString(s string) (UpdateSchedulingOutOfOfficeRequestExistingBookings, error) { + switch s { + case "leave": + return UpdateSchedulingOutOfOfficeRequestExistingBookingsLeave, nil + case "reassign": + return UpdateSchedulingOutOfOfficeRequestExistingBookingsReassign, nil + } + var t UpdateSchedulingOutOfOfficeRequestExistingBookings + return "", fmt.Errorf("%s is not a valid %T", s, t) +} + +func (u UpdateSchedulingOutOfOfficeRequestExistingBookings) Ptr() *UpdateSchedulingOutOfOfficeRequestExistingBookings { + return &u +} + +var ( + updateSchedulingOutOfOfficeRequestReassignFieldToHost = big.NewInt(1 << 0) + updateSchedulingOutOfOfficeRequestReassignFieldPreferredHosts = big.NewInt(1 << 1) + updateSchedulingOutOfOfficeRequestReassignFieldOtherwise = big.NewInt(1 << 2) +) + +// With `existing_bookings: reassign`: who they go to. Default: the fairest who's free. +type UpdateSchedulingOutOfOfficeRequestReassign struct { + // Give them all to this host. + ToHost *string `json:"to_host,omitempty" url:"to_host,omitempty"` + // Try these first, in order. + PreferredHosts []string `json:"preferred_hosts,omitempty" url:"preferred_hosts,omitempty"` + // After `preferred_hosts`: `auto` picks the fairest who's free (the default), `leave` keeps it where it is. + Otherwise *UpdateSchedulingOutOfOfficeRequestReassignOtherwise `json:"otherwise,omitempty" url:"otherwise,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + + extraProperties map[string]interface{} + rawJSON json.RawMessage +} + +func (u *UpdateSchedulingOutOfOfficeRequestReassign) GetToHost() *string { + if u == nil { + return nil + } + return u.ToHost +} + +func (u *UpdateSchedulingOutOfOfficeRequestReassign) GetPreferredHosts() []string { + if u == nil { + return nil + } + return u.PreferredHosts +} + +func (u *UpdateSchedulingOutOfOfficeRequestReassign) GetOtherwise() *UpdateSchedulingOutOfOfficeRequestReassignOtherwise { + if u == nil { + return nil + } + return u.Otherwise +} + +func (u *UpdateSchedulingOutOfOfficeRequestReassign) GetExtraProperties() map[string]interface{} { + if u == nil { + return nil + } + return u.extraProperties +} + +func (u *UpdateSchedulingOutOfOfficeRequestReassign) require(field *big.Int) { + next := new(big.Int) + if u.explicitFields != nil { + next.Set(u.explicitFields) + } + next.Or(next, field) + u.explicitFields = next +} + +// SetToHost sets the ToHost field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (u *UpdateSchedulingOutOfOfficeRequestReassign) SetToHost(toHost *string) { + u.ToHost = toHost + u.require(updateSchedulingOutOfOfficeRequestReassignFieldToHost) +} + +// SetPreferredHosts sets the PreferredHosts field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (u *UpdateSchedulingOutOfOfficeRequestReassign) SetPreferredHosts(preferredHosts []string) { + u.PreferredHosts = preferredHosts + u.require(updateSchedulingOutOfOfficeRequestReassignFieldPreferredHosts) +} + +// SetOtherwise sets the Otherwise field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (u *UpdateSchedulingOutOfOfficeRequestReassign) SetOtherwise(otherwise *UpdateSchedulingOutOfOfficeRequestReassignOtherwise) { + u.Otherwise = otherwise + u.require(updateSchedulingOutOfOfficeRequestReassignFieldOtherwise) +} + +func (u *UpdateSchedulingOutOfOfficeRequestReassign) UnmarshalJSON(data []byte) error { + type unmarshaler UpdateSchedulingOutOfOfficeRequestReassign + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *u = UpdateSchedulingOutOfOfficeRequestReassign(value) + extraProperties, err := internal.ExtractExtraProperties(data, *u) + if err != nil { + return err + } + u.extraProperties = extraProperties + u.rawJSON = json.RawMessage(data) + return nil +} + +func (u *UpdateSchedulingOutOfOfficeRequestReassign) MarshalJSON() ([]byte, error) { + type embed UpdateSchedulingOutOfOfficeRequestReassign + var marshaler = struct { + embed + }{ + embed: embed(*u), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, u.explicitFields) + return json.Marshal(explicitMarshaler) +} + +func (u *UpdateSchedulingOutOfOfficeRequestReassign) String() string { + if u == nil { + return "" + } + if len(u.rawJSON) > 0 { + if value, err := internal.StringifyJSON(u.rawJSON); err == nil { + return value + } + } + if value, err := internal.StringifyJSON(u); err == nil { + return value + } + return fmt.Sprintf("%#v", u) +} + +// After `preferred_hosts`: `auto` picks the fairest who's free (the default), `leave` keeps it where it is. +type UpdateSchedulingOutOfOfficeRequestReassignOtherwise string + +const ( + UpdateSchedulingOutOfOfficeRequestReassignOtherwiseAuto UpdateSchedulingOutOfOfficeRequestReassignOtherwise = "auto" + UpdateSchedulingOutOfOfficeRequestReassignOtherwiseLeave UpdateSchedulingOutOfOfficeRequestReassignOtherwise = "leave" +) + +func NewUpdateSchedulingOutOfOfficeRequestReassignOtherwiseFromString(s string) (UpdateSchedulingOutOfOfficeRequestReassignOtherwise, error) { + switch s { + case "auto": + return UpdateSchedulingOutOfOfficeRequestReassignOtherwiseAuto, nil + case "leave": + return UpdateSchedulingOutOfOfficeRequestReassignOtherwiseLeave, nil + } + var t UpdateSchedulingOutOfOfficeRequestReassignOtherwise + return "", fmt.Errorf("%s is not a valid %T", s, t) +} + +func (u UpdateSchedulingOutOfOfficeRequestReassignOtherwise) Ptr() *UpdateSchedulingOutOfOfficeRequestReassignOtherwise { + return &u +} + +var ( + updateSchedulingOutOfOfficeRequestFieldID = big.NewInt(1 << 0) + updateSchedulingOutOfOfficeRequestFieldStart = big.NewInt(1 << 1) + updateSchedulingOutOfOfficeRequestFieldEnd = big.NewInt(1 << 2) + updateSchedulingOutOfOfficeRequestFieldStartDate = big.NewInt(1 << 3) + updateSchedulingOutOfOfficeRequestFieldEndDate = big.NewInt(1 << 4) + updateSchedulingOutOfOfficeRequestFieldTimeZone = big.NewInt(1 << 5) + updateSchedulingOutOfOfficeRequestFieldReason = big.NewInt(1 << 6) + updateSchedulingOutOfOfficeRequestFieldNotes = big.NewInt(1 << 7) + updateSchedulingOutOfOfficeRequestFieldPublicMessage = big.NewInt(1 << 8) + updateSchedulingOutOfOfficeRequestFieldShowOnCalendar = big.NewInt(1 << 9) + updateSchedulingOutOfOfficeRequestFieldDelegates = big.NewInt(1 << 10) + updateSchedulingOutOfOfficeRequestFieldExistingBookings = big.NewInt(1 << 11) + updateSchedulingOutOfOfficeRequestFieldReassign = big.NewInt(1 << 12) +) + +type UpdateSchedulingOutOfOfficeRequest struct { + // The entry's id. + ID string `json:"-" url:"-"` + // An ISO 8601 instant with an offset. + Start *string `json:"start,omitempty" url:"-"` + // An ISO 8601 instant with an offset. + End *string `json:"end,omitempty" url:"-"` + // The first whole day away. Use instead of `start` and `end`. + StartDate *string `json:"start_date,omitempty" url:"-"` + // The last whole day away, which is included. + EndDate *string `json:"end_date,omitempty" url:"-"` + // What the dates mean in. Default: the host's zone when this is made. + TimeZone *string `json:"time_zone,omitempty" url:"-"` + // One of `unspecified`, `vacation`, `travel`, `sick`, `public_holiday`, `parental_leave`, `training` and `other`, or a key from the settings' `out_of_office_reasons`. Only people who manage this host see it: never bookers, webhooks or calendars. + Reason *string `json:"reason,omitempty" url:"-"` + Notes *string `json:"notes,omitempty" url:"-"` + PublicMessage *string `json:"public_message,omitempty" url:"-"` + ShowOnCalendar *bool `json:"show_on_calendar,omitempty" url:"-"` + // Who can be booked in this host's place during it, by id or uid, in the order to try them. They still have to fit how a booking's routed. + Delegates []string `json:"delegates,omitempty" url:"-"` + // What happens to bookings already in the way. `leave` (the default) only reports them. `reassign` moves them, and any nobody can take stay where they are. + ExistingBookings *UpdateSchedulingOutOfOfficeRequestExistingBookings `json:"existing_bookings,omitempty" url:"-"` + // With `existing_bookings: reassign`: who they go to. Default: the fairest who's free. + Reassign *UpdateSchedulingOutOfOfficeRequestReassign `json:"reassign,omitempty" url:"-"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (u *UpdateSchedulingOutOfOfficeRequest) require(field *big.Int) { + next := new(big.Int) + if u.explicitFields != nil { + next.Set(u.explicitFields) + } + next.Or(next, field) + u.explicitFields = next +} + +// SetID sets the ID field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (u *UpdateSchedulingOutOfOfficeRequest) SetID(id string) { + u.ID = id + u.require(updateSchedulingOutOfOfficeRequestFieldID) +} + +// SetStart sets the Start field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (u *UpdateSchedulingOutOfOfficeRequest) SetStart(start *string) { + u.Start = start + u.require(updateSchedulingOutOfOfficeRequestFieldStart) +} + +// SetEnd sets the End field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (u *UpdateSchedulingOutOfOfficeRequest) SetEnd(end *string) { + u.End = end + u.require(updateSchedulingOutOfOfficeRequestFieldEnd) +} + +// SetStartDate sets the StartDate field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (u *UpdateSchedulingOutOfOfficeRequest) SetStartDate(startDate *string) { + u.StartDate = startDate + u.require(updateSchedulingOutOfOfficeRequestFieldStartDate) +} + +// SetEndDate sets the EndDate field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (u *UpdateSchedulingOutOfOfficeRequest) SetEndDate(endDate *string) { + u.EndDate = endDate + u.require(updateSchedulingOutOfOfficeRequestFieldEndDate) +} + +// SetTimeZone sets the TimeZone field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (u *UpdateSchedulingOutOfOfficeRequest) SetTimeZone(timeZone *string) { + u.TimeZone = timeZone + u.require(updateSchedulingOutOfOfficeRequestFieldTimeZone) +} + +// SetReason sets the Reason field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (u *UpdateSchedulingOutOfOfficeRequest) SetReason(reason *string) { + u.Reason = reason + u.require(updateSchedulingOutOfOfficeRequestFieldReason) +} + +// SetNotes sets the Notes field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (u *UpdateSchedulingOutOfOfficeRequest) SetNotes(notes *string) { + u.Notes = notes + u.require(updateSchedulingOutOfOfficeRequestFieldNotes) +} + +// SetPublicMessage sets the PublicMessage field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (u *UpdateSchedulingOutOfOfficeRequest) SetPublicMessage(publicMessage *string) { + u.PublicMessage = publicMessage + u.require(updateSchedulingOutOfOfficeRequestFieldPublicMessage) +} + +// SetShowOnCalendar sets the ShowOnCalendar field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (u *UpdateSchedulingOutOfOfficeRequest) SetShowOnCalendar(showOnCalendar *bool) { + u.ShowOnCalendar = showOnCalendar + u.require(updateSchedulingOutOfOfficeRequestFieldShowOnCalendar) +} + +// SetDelegates sets the Delegates field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (u *UpdateSchedulingOutOfOfficeRequest) SetDelegates(delegates []string) { + u.Delegates = delegates + u.require(updateSchedulingOutOfOfficeRequestFieldDelegates) +} + +// SetExistingBookings sets the ExistingBookings field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (u *UpdateSchedulingOutOfOfficeRequest) SetExistingBookings(existingBookings *UpdateSchedulingOutOfOfficeRequestExistingBookings) { + u.ExistingBookings = existingBookings + u.require(updateSchedulingOutOfOfficeRequestFieldExistingBookings) +} + +// SetReassign sets the Reassign field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (u *UpdateSchedulingOutOfOfficeRequest) SetReassign(reassign *UpdateSchedulingOutOfOfficeRequestReassign) { + u.Reassign = reassign + u.require(updateSchedulingOutOfOfficeRequestFieldReassign) +} + +func (u *UpdateSchedulingOutOfOfficeRequest) UnmarshalJSON(data []byte) error { + type unmarshaler UpdateSchedulingOutOfOfficeRequest + var body unmarshaler + if err := json.Unmarshal(data, &body); err != nil { + return err + } + *u = UpdateSchedulingOutOfOfficeRequest(body) + return nil +} + +func (u *UpdateSchedulingOutOfOfficeRequest) MarshalJSON() ([]byte, error) { + type embed UpdateSchedulingOutOfOfficeRequest + var marshaler = struct { + embed + }{ + embed: embed(*u), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, u.explicitFields) + return json.Marshal(explicitMarshaler) +} diff --git a/sdks/go/scheduling/out_of_office_test.go b/sdks/go/scheduling/out_of_office_test.go new file mode 100644 index 000000000..a59fe9947 --- /dev/null +++ b/sdks/go/scheduling/out_of_office_test.go @@ -0,0 +1,3243 @@ +// Code generated by Fern. DO NOT EDIT. + +package scheduling + +import ( + json "encoding/json" + assert "github.com/stretchr/testify/assert" + require "github.com/stretchr/testify/require" + testing "testing" +) + +func TestSettersConflictsOutOfOfficeRequest(t *testing.T) { + t.Run("SetID", func(t *testing.T) { + obj := &ConflictsOutOfOfficeRequest{} + var fernTestValueID string + obj.SetID(fernTestValueID) + assert.Equal(t, fernTestValueID, obj.ID) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetLimit", func(t *testing.T) { + obj := &ConflictsOutOfOfficeRequest{} + var fernTestValueLimit *int + obj.SetLimit(fernTestValueLimit) + assert.Equal(t, fernTestValueLimit, obj.Limit) + assert.NotNil(t, obj.explicitFields) + }) + +} + +func TestSettersMarkExplicitConflictsOutOfOfficeRequest(t *testing.T) { + t.Run("SetID_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &ConflictsOutOfOfficeRequest{} + var fernTestValueID string + + // Act + obj.SetID(fernTestValueID) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetLimit_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &ConflictsOutOfOfficeRequest{} + var fernTestValueLimit *int + + // Act + obj.SetLimit(fernTestValueLimit) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + +} + +func TestSettersCreateSchedulingOutOfOfficeRequest(t *testing.T) { + t.Run("SetHost", func(t *testing.T) { + obj := &CreateSchedulingOutOfOfficeRequest{} + var fernTestValueHost *string + obj.SetHost(fernTestValueHost) + assert.Equal(t, fernTestValueHost, obj.Host) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetHosts", func(t *testing.T) { + obj := &CreateSchedulingOutOfOfficeRequest{} + var fernTestValueHosts []string + obj.SetHosts(fernTestValueHosts) + assert.Equal(t, fernTestValueHosts, obj.Hosts) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetHostFilter", func(t *testing.T) { + obj := &CreateSchedulingOutOfOfficeRequest{} + var fernTestValueHostFilter map[string]*CreateSchedulingOutOfOfficeRequestHostFilterValue + obj.SetHostFilter(fernTestValueHostFilter) + assert.Equal(t, fernTestValueHostFilter, obj.HostFilter) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetStart", func(t *testing.T) { + obj := &CreateSchedulingOutOfOfficeRequest{} + var fernTestValueStart *string + obj.SetStart(fernTestValueStart) + assert.Equal(t, fernTestValueStart, obj.Start) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetEnd", func(t *testing.T) { + obj := &CreateSchedulingOutOfOfficeRequest{} + var fernTestValueEnd *string + obj.SetEnd(fernTestValueEnd) + assert.Equal(t, fernTestValueEnd, obj.End) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetStartDate", func(t *testing.T) { + obj := &CreateSchedulingOutOfOfficeRequest{} + var fernTestValueStartDate *string + obj.SetStartDate(fernTestValueStartDate) + assert.Equal(t, fernTestValueStartDate, obj.StartDate) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetEndDate", func(t *testing.T) { + obj := &CreateSchedulingOutOfOfficeRequest{} + var fernTestValueEndDate *string + obj.SetEndDate(fernTestValueEndDate) + assert.Equal(t, fernTestValueEndDate, obj.EndDate) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetTimeZone", func(t *testing.T) { + obj := &CreateSchedulingOutOfOfficeRequest{} + var fernTestValueTimeZone *string + obj.SetTimeZone(fernTestValueTimeZone) + assert.Equal(t, fernTestValueTimeZone, obj.TimeZone) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetDelegates", func(t *testing.T) { + obj := &CreateSchedulingOutOfOfficeRequest{} + var fernTestValueDelegates []string + obj.SetDelegates(fernTestValueDelegates) + assert.Equal(t, fernTestValueDelegates, obj.Delegates) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetReason", func(t *testing.T) { + obj := &CreateSchedulingOutOfOfficeRequest{} + var fernTestValueReason *string + obj.SetReason(fernTestValueReason) + assert.Equal(t, fernTestValueReason, obj.Reason) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetNotes", func(t *testing.T) { + obj := &CreateSchedulingOutOfOfficeRequest{} + var fernTestValueNotes *string + obj.SetNotes(fernTestValueNotes) + assert.Equal(t, fernTestValueNotes, obj.Notes) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetPublicMessage", func(t *testing.T) { + obj := &CreateSchedulingOutOfOfficeRequest{} + var fernTestValuePublicMessage *string + obj.SetPublicMessage(fernTestValuePublicMessage) + assert.Equal(t, fernTestValuePublicMessage, obj.PublicMessage) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetShowOnCalendar", func(t *testing.T) { + obj := &CreateSchedulingOutOfOfficeRequest{} + var fernTestValueShowOnCalendar *bool + obj.SetShowOnCalendar(fernTestValueShowOnCalendar) + assert.Equal(t, fernTestValueShowOnCalendar, obj.ShowOnCalendar) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetExistingBookings", func(t *testing.T) { + obj := &CreateSchedulingOutOfOfficeRequest{} + var fernTestValueExistingBookings *CreateSchedulingOutOfOfficeRequestExistingBookings + obj.SetExistingBookings(fernTestValueExistingBookings) + assert.Equal(t, fernTestValueExistingBookings, obj.ExistingBookings) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetReassign", func(t *testing.T) { + obj := &CreateSchedulingOutOfOfficeRequest{} + var fernTestValueReassign *CreateSchedulingOutOfOfficeRequestReassign + obj.SetReassign(fernTestValueReassign) + assert.Equal(t, fernTestValueReassign, obj.Reassign) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetExternalID", func(t *testing.T) { + obj := &CreateSchedulingOutOfOfficeRequest{} + var fernTestValueExternalID *string + obj.SetExternalID(fernTestValueExternalID) + assert.Equal(t, fernTestValueExternalID, obj.ExternalID) + assert.NotNil(t, obj.explicitFields) + }) + +} + +func TestSettersMarkExplicitCreateSchedulingOutOfOfficeRequest(t *testing.T) { + t.Run("SetHost_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &CreateSchedulingOutOfOfficeRequest{} + var fernTestValueHost *string + + // Act + obj.SetHost(fernTestValueHost) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetHosts_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &CreateSchedulingOutOfOfficeRequest{} + var fernTestValueHosts []string + + // Act + obj.SetHosts(fernTestValueHosts) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetHostFilter_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &CreateSchedulingOutOfOfficeRequest{} + var fernTestValueHostFilter map[string]*CreateSchedulingOutOfOfficeRequestHostFilterValue + + // Act + obj.SetHostFilter(fernTestValueHostFilter) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetStart_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &CreateSchedulingOutOfOfficeRequest{} + var fernTestValueStart *string + + // Act + obj.SetStart(fernTestValueStart) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetEnd_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &CreateSchedulingOutOfOfficeRequest{} + var fernTestValueEnd *string + + // Act + obj.SetEnd(fernTestValueEnd) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetStartDate_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &CreateSchedulingOutOfOfficeRequest{} + var fernTestValueStartDate *string + + // Act + obj.SetStartDate(fernTestValueStartDate) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetEndDate_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &CreateSchedulingOutOfOfficeRequest{} + var fernTestValueEndDate *string + + // Act + obj.SetEndDate(fernTestValueEndDate) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetTimeZone_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &CreateSchedulingOutOfOfficeRequest{} + var fernTestValueTimeZone *string + + // Act + obj.SetTimeZone(fernTestValueTimeZone) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetDelegates_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &CreateSchedulingOutOfOfficeRequest{} + var fernTestValueDelegates []string + + // Act + obj.SetDelegates(fernTestValueDelegates) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetReason_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &CreateSchedulingOutOfOfficeRequest{} + var fernTestValueReason *string + + // Act + obj.SetReason(fernTestValueReason) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetNotes_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &CreateSchedulingOutOfOfficeRequest{} + var fernTestValueNotes *string + + // Act + obj.SetNotes(fernTestValueNotes) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetPublicMessage_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &CreateSchedulingOutOfOfficeRequest{} + var fernTestValuePublicMessage *string + + // Act + obj.SetPublicMessage(fernTestValuePublicMessage) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetShowOnCalendar_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &CreateSchedulingOutOfOfficeRequest{} + var fernTestValueShowOnCalendar *bool + + // Act + obj.SetShowOnCalendar(fernTestValueShowOnCalendar) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetExistingBookings_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &CreateSchedulingOutOfOfficeRequest{} + var fernTestValueExistingBookings *CreateSchedulingOutOfOfficeRequestExistingBookings + + // Act + obj.SetExistingBookings(fernTestValueExistingBookings) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetReassign_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &CreateSchedulingOutOfOfficeRequest{} + var fernTestValueReassign *CreateSchedulingOutOfOfficeRequestReassign + + // Act + obj.SetReassign(fernTestValueReassign) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetExternalID_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &CreateSchedulingOutOfOfficeRequest{} + var fernTestValueExternalID *string + + // Act + obj.SetExternalID(fernTestValueExternalID) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + +} + +func TestSettersGetOutOfOfficeRequest(t *testing.T) { + t.Run("SetID", func(t *testing.T) { + obj := &GetOutOfOfficeRequest{} + var fernTestValueID string + obj.SetID(fernTestValueID) + assert.Equal(t, fernTestValueID, obj.ID) + assert.NotNil(t, obj.explicitFields) + }) + +} + +func TestSettersMarkExplicitGetOutOfOfficeRequest(t *testing.T) { + t.Run("SetID_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &GetOutOfOfficeRequest{} + var fernTestValueID string + + // Act + obj.SetID(fernTestValueID) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + +} + +func TestSettersListOutOfOfficeRequest(t *testing.T) { + t.Run("SetLimit", func(t *testing.T) { + obj := &ListOutOfOfficeRequest{} + var fernTestValueLimit *int + obj.SetLimit(fernTestValueLimit) + assert.Equal(t, fernTestValueLimit, obj.Limit) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetAfter", func(t *testing.T) { + obj := &ListOutOfOfficeRequest{} + var fernTestValueAfter *string + obj.SetAfter(fernTestValueAfter) + assert.Equal(t, fernTestValueAfter, obj.After) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetHost", func(t *testing.T) { + obj := &ListOutOfOfficeRequest{} + var fernTestValueHost *string + obj.SetHost(fernTestValueHost) + assert.Equal(t, fernTestValueHost, obj.Host) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetStartAfter", func(t *testing.T) { + obj := &ListOutOfOfficeRequest{} + var fernTestValueStartAfter *string + obj.SetStartAfter(fernTestValueStartAfter) + assert.Equal(t, fernTestValueStartAfter, obj.StartAfter) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetStartBefore", func(t *testing.T) { + obj := &ListOutOfOfficeRequest{} + var fernTestValueStartBefore *string + obj.SetStartBefore(fernTestValueStartBefore) + assert.Equal(t, fernTestValueStartBefore, obj.StartBefore) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetGroup", func(t *testing.T) { + obj := &ListOutOfOfficeRequest{} + var fernTestValueGroup *string + obj.SetGroup(fernTestValueGroup) + assert.Equal(t, fernTestValueGroup, obj.Group) + assert.NotNil(t, obj.explicitFields) + }) + +} + +func TestSettersMarkExplicitListOutOfOfficeRequest(t *testing.T) { + t.Run("SetLimit_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &ListOutOfOfficeRequest{} + var fernTestValueLimit *int + + // Act + obj.SetLimit(fernTestValueLimit) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetAfter_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &ListOutOfOfficeRequest{} + var fernTestValueAfter *string + + // Act + obj.SetAfter(fernTestValueAfter) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetHost_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &ListOutOfOfficeRequest{} + var fernTestValueHost *string + + // Act + obj.SetHost(fernTestValueHost) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetStartAfter_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &ListOutOfOfficeRequest{} + var fernTestValueStartAfter *string + + // Act + obj.SetStartAfter(fernTestValueStartAfter) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetStartBefore_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &ListOutOfOfficeRequest{} + var fernTestValueStartBefore *string + + // Act + obj.SetStartBefore(fernTestValueStartBefore) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetGroup_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &ListOutOfOfficeRequest{} + var fernTestValueGroup *string + + // Act + obj.SetGroup(fernTestValueGroup) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + +} + +func TestSettersPutSchedulingOutOfOfficeRequest(t *testing.T) { + t.Run("SetExternalID", func(t *testing.T) { + obj := &PutSchedulingOutOfOfficeRequest{} + var fernTestValueExternalID string + obj.SetExternalID(fernTestValueExternalID) + assert.Equal(t, fernTestValueExternalID, obj.ExternalID) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetHost", func(t *testing.T) { + obj := &PutSchedulingOutOfOfficeRequest{} + var fernTestValueHost string + obj.SetHost(fernTestValueHost) + assert.Equal(t, fernTestValueHost, obj.Host) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetStart", func(t *testing.T) { + obj := &PutSchedulingOutOfOfficeRequest{} + var fernTestValueStart *string + obj.SetStart(fernTestValueStart) + assert.Equal(t, fernTestValueStart, obj.Start) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetEnd", func(t *testing.T) { + obj := &PutSchedulingOutOfOfficeRequest{} + var fernTestValueEnd *string + obj.SetEnd(fernTestValueEnd) + assert.Equal(t, fernTestValueEnd, obj.End) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetStartDate", func(t *testing.T) { + obj := &PutSchedulingOutOfOfficeRequest{} + var fernTestValueStartDate *string + obj.SetStartDate(fernTestValueStartDate) + assert.Equal(t, fernTestValueStartDate, obj.StartDate) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetEndDate", func(t *testing.T) { + obj := &PutSchedulingOutOfOfficeRequest{} + var fernTestValueEndDate *string + obj.SetEndDate(fernTestValueEndDate) + assert.Equal(t, fernTestValueEndDate, obj.EndDate) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetTimeZone", func(t *testing.T) { + obj := &PutSchedulingOutOfOfficeRequest{} + var fernTestValueTimeZone *string + obj.SetTimeZone(fernTestValueTimeZone) + assert.Equal(t, fernTestValueTimeZone, obj.TimeZone) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetDelegates", func(t *testing.T) { + obj := &PutSchedulingOutOfOfficeRequest{} + var fernTestValueDelegates []string + obj.SetDelegates(fernTestValueDelegates) + assert.Equal(t, fernTestValueDelegates, obj.Delegates) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetReason", func(t *testing.T) { + obj := &PutSchedulingOutOfOfficeRequest{} + var fernTestValueReason *string + obj.SetReason(fernTestValueReason) + assert.Equal(t, fernTestValueReason, obj.Reason) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetNotes", func(t *testing.T) { + obj := &PutSchedulingOutOfOfficeRequest{} + var fernTestValueNotes *string + obj.SetNotes(fernTestValueNotes) + assert.Equal(t, fernTestValueNotes, obj.Notes) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetPublicMessage", func(t *testing.T) { + obj := &PutSchedulingOutOfOfficeRequest{} + var fernTestValuePublicMessage *string + obj.SetPublicMessage(fernTestValuePublicMessage) + assert.Equal(t, fernTestValuePublicMessage, obj.PublicMessage) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetShowOnCalendar", func(t *testing.T) { + obj := &PutSchedulingOutOfOfficeRequest{} + var fernTestValueShowOnCalendar *bool + obj.SetShowOnCalendar(fernTestValueShowOnCalendar) + assert.Equal(t, fernTestValueShowOnCalendar, obj.ShowOnCalendar) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetExistingBookings", func(t *testing.T) { + obj := &PutSchedulingOutOfOfficeRequest{} + var fernTestValueExistingBookings *PutSchedulingOutOfOfficeRequestExistingBookings + obj.SetExistingBookings(fernTestValueExistingBookings) + assert.Equal(t, fernTestValueExistingBookings, obj.ExistingBookings) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetReassign", func(t *testing.T) { + obj := &PutSchedulingOutOfOfficeRequest{} + var fernTestValueReassign *PutSchedulingOutOfOfficeRequestReassign + obj.SetReassign(fernTestValueReassign) + assert.Equal(t, fernTestValueReassign, obj.Reassign) + assert.NotNil(t, obj.explicitFields) + }) + +} + +func TestSettersMarkExplicitPutSchedulingOutOfOfficeRequest(t *testing.T) { + t.Run("SetExternalID_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &PutSchedulingOutOfOfficeRequest{} + var fernTestValueExternalID string + + // Act + obj.SetExternalID(fernTestValueExternalID) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetHost_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &PutSchedulingOutOfOfficeRequest{} + var fernTestValueHost string + + // Act + obj.SetHost(fernTestValueHost) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetStart_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &PutSchedulingOutOfOfficeRequest{} + var fernTestValueStart *string + + // Act + obj.SetStart(fernTestValueStart) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetEnd_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &PutSchedulingOutOfOfficeRequest{} + var fernTestValueEnd *string + + // Act + obj.SetEnd(fernTestValueEnd) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetStartDate_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &PutSchedulingOutOfOfficeRequest{} + var fernTestValueStartDate *string + + // Act + obj.SetStartDate(fernTestValueStartDate) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetEndDate_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &PutSchedulingOutOfOfficeRequest{} + var fernTestValueEndDate *string + + // Act + obj.SetEndDate(fernTestValueEndDate) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetTimeZone_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &PutSchedulingOutOfOfficeRequest{} + var fernTestValueTimeZone *string + + // Act + obj.SetTimeZone(fernTestValueTimeZone) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetDelegates_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &PutSchedulingOutOfOfficeRequest{} + var fernTestValueDelegates []string + + // Act + obj.SetDelegates(fernTestValueDelegates) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetReason_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &PutSchedulingOutOfOfficeRequest{} + var fernTestValueReason *string + + // Act + obj.SetReason(fernTestValueReason) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetNotes_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &PutSchedulingOutOfOfficeRequest{} + var fernTestValueNotes *string + + // Act + obj.SetNotes(fernTestValueNotes) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetPublicMessage_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &PutSchedulingOutOfOfficeRequest{} + var fernTestValuePublicMessage *string + + // Act + obj.SetPublicMessage(fernTestValuePublicMessage) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetShowOnCalendar_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &PutSchedulingOutOfOfficeRequest{} + var fernTestValueShowOnCalendar *bool + + // Act + obj.SetShowOnCalendar(fernTestValueShowOnCalendar) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetExistingBookings_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &PutSchedulingOutOfOfficeRequest{} + var fernTestValueExistingBookings *PutSchedulingOutOfOfficeRequestExistingBookings + + // Act + obj.SetExistingBookings(fernTestValueExistingBookings) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetReassign_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &PutSchedulingOutOfOfficeRequest{} + var fernTestValueReassign *PutSchedulingOutOfOfficeRequestReassign + + // Act + obj.SetReassign(fernTestValueReassign) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + +} + +func TestSettersRemoveOutOfOfficeRequest(t *testing.T) { + t.Run("SetID", func(t *testing.T) { + obj := &RemoveOutOfOfficeRequest{} + var fernTestValueID string + obj.SetID(fernTestValueID) + assert.Equal(t, fernTestValueID, obj.ID) + assert.NotNil(t, obj.explicitFields) + }) + +} + +func TestSettersMarkExplicitRemoveOutOfOfficeRequest(t *testing.T) { + t.Run("SetID_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RemoveOutOfOfficeRequest{} + var fernTestValueID string + + // Act + obj.SetID(fernTestValueID) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + +} + +func TestGettersCreateSchedulingOutOfOfficeRequestHostFilterValue(t *testing.T) { + t.Run("GetString", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &CreateSchedulingOutOfOfficeRequestHostFilterValue{} + var expected string + obj.String = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetString(), "getter should return the property value") + }) + + t.Run("GetString_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *CreateSchedulingOutOfOfficeRequestHostFilterValue + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetString() // Should return zero value + }) + + t.Run("GetStringList", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &CreateSchedulingOutOfOfficeRequestHostFilterValue{} + var expected []string + obj.StringList = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetStringList(), "getter should return the property value") + }) + + t.Run("GetStringList_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &CreateSchedulingOutOfOfficeRequestHostFilterValue{} + obj.StringList = nil + + // Act & Assert + assert.Nil(t, obj.GetStringList(), "getter should return nil when property is nil") + }) + + t.Run("GetStringList_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *CreateSchedulingOutOfOfficeRequestHostFilterValue + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetStringList() // Should return zero value + }) + +} + +func TestSettersCreateSchedulingOutOfOfficeRequestReassign(t *testing.T) { + t.Run("SetToHost", func(t *testing.T) { + obj := &CreateSchedulingOutOfOfficeRequestReassign{} + var fernTestValueToHost *string + obj.SetToHost(fernTestValueToHost) + assert.Equal(t, fernTestValueToHost, obj.ToHost) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetPreferredHosts", func(t *testing.T) { + obj := &CreateSchedulingOutOfOfficeRequestReassign{} + var fernTestValuePreferredHosts []string + obj.SetPreferredHosts(fernTestValuePreferredHosts) + assert.Equal(t, fernTestValuePreferredHosts, obj.PreferredHosts) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetOtherwise", func(t *testing.T) { + obj := &CreateSchedulingOutOfOfficeRequestReassign{} + var fernTestValueOtherwise *CreateSchedulingOutOfOfficeRequestReassignOtherwise + obj.SetOtherwise(fernTestValueOtherwise) + assert.Equal(t, fernTestValueOtherwise, obj.Otherwise) + assert.NotNil(t, obj.explicitFields) + }) + +} + +func TestGettersCreateSchedulingOutOfOfficeRequestReassign(t *testing.T) { + t.Run("GetToHost", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &CreateSchedulingOutOfOfficeRequestReassign{} + var expected *string + obj.ToHost = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetToHost(), "getter should return the property value") + }) + + t.Run("GetToHost_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &CreateSchedulingOutOfOfficeRequestReassign{} + obj.ToHost = nil + + // Act & Assert + assert.Nil(t, obj.GetToHost(), "getter should return nil when property is nil") + }) + + t.Run("GetToHost_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *CreateSchedulingOutOfOfficeRequestReassign + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetToHost() // Should return zero value + }) + + t.Run("GetPreferredHosts", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &CreateSchedulingOutOfOfficeRequestReassign{} + var expected []string + obj.PreferredHosts = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetPreferredHosts(), "getter should return the property value") + }) + + t.Run("GetPreferredHosts_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &CreateSchedulingOutOfOfficeRequestReassign{} + obj.PreferredHosts = nil + + // Act & Assert + assert.Nil(t, obj.GetPreferredHosts(), "getter should return nil when property is nil") + }) + + t.Run("GetPreferredHosts_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *CreateSchedulingOutOfOfficeRequestReassign + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetPreferredHosts() // Should return zero value + }) + + t.Run("GetOtherwise", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &CreateSchedulingOutOfOfficeRequestReassign{} + var expected *CreateSchedulingOutOfOfficeRequestReassignOtherwise + obj.Otherwise = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetOtherwise(), "getter should return the property value") + }) + + t.Run("GetOtherwise_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &CreateSchedulingOutOfOfficeRequestReassign{} + obj.Otherwise = nil + + // Act & Assert + assert.Nil(t, obj.GetOtherwise(), "getter should return nil when property is nil") + }) + + t.Run("GetOtherwise_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *CreateSchedulingOutOfOfficeRequestReassign + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetOtherwise() // Should return zero value + }) + +} + +func TestSettersMarkExplicitCreateSchedulingOutOfOfficeRequestReassign(t *testing.T) { + t.Run("SetToHost_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &CreateSchedulingOutOfOfficeRequestReassign{} + var fernTestValueToHost *string + + // Act + obj.SetToHost(fernTestValueToHost) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetPreferredHosts_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &CreateSchedulingOutOfOfficeRequestReassign{} + var fernTestValuePreferredHosts []string + + // Act + obj.SetPreferredHosts(fernTestValuePreferredHosts) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetOtherwise_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &CreateSchedulingOutOfOfficeRequestReassign{} + var fernTestValueOtherwise *CreateSchedulingOutOfOfficeRequestReassignOtherwise + + // Act + obj.SetOtherwise(fernTestValueOtherwise) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + +} + +func TestSettersPutSchedulingOutOfOfficeRequestReassign(t *testing.T) { + t.Run("SetToHost", func(t *testing.T) { + obj := &PutSchedulingOutOfOfficeRequestReassign{} + var fernTestValueToHost *string + obj.SetToHost(fernTestValueToHost) + assert.Equal(t, fernTestValueToHost, obj.ToHost) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetPreferredHosts", func(t *testing.T) { + obj := &PutSchedulingOutOfOfficeRequestReassign{} + var fernTestValuePreferredHosts []string + obj.SetPreferredHosts(fernTestValuePreferredHosts) + assert.Equal(t, fernTestValuePreferredHosts, obj.PreferredHosts) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetOtherwise", func(t *testing.T) { + obj := &PutSchedulingOutOfOfficeRequestReassign{} + var fernTestValueOtherwise *PutSchedulingOutOfOfficeRequestReassignOtherwise + obj.SetOtherwise(fernTestValueOtherwise) + assert.Equal(t, fernTestValueOtherwise, obj.Otherwise) + assert.NotNil(t, obj.explicitFields) + }) + +} + +func TestGettersPutSchedulingOutOfOfficeRequestReassign(t *testing.T) { + t.Run("GetToHost", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &PutSchedulingOutOfOfficeRequestReassign{} + var expected *string + obj.ToHost = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetToHost(), "getter should return the property value") + }) + + t.Run("GetToHost_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &PutSchedulingOutOfOfficeRequestReassign{} + obj.ToHost = nil + + // Act & Assert + assert.Nil(t, obj.GetToHost(), "getter should return nil when property is nil") + }) + + t.Run("GetToHost_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *PutSchedulingOutOfOfficeRequestReassign + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetToHost() // Should return zero value + }) + + t.Run("GetPreferredHosts", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &PutSchedulingOutOfOfficeRequestReassign{} + var expected []string + obj.PreferredHosts = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetPreferredHosts(), "getter should return the property value") + }) + + t.Run("GetPreferredHosts_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &PutSchedulingOutOfOfficeRequestReassign{} + obj.PreferredHosts = nil + + // Act & Assert + assert.Nil(t, obj.GetPreferredHosts(), "getter should return nil when property is nil") + }) + + t.Run("GetPreferredHosts_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *PutSchedulingOutOfOfficeRequestReassign + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetPreferredHosts() // Should return zero value + }) + + t.Run("GetOtherwise", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &PutSchedulingOutOfOfficeRequestReassign{} + var expected *PutSchedulingOutOfOfficeRequestReassignOtherwise + obj.Otherwise = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetOtherwise(), "getter should return the property value") + }) + + t.Run("GetOtherwise_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &PutSchedulingOutOfOfficeRequestReassign{} + obj.Otherwise = nil + + // Act & Assert + assert.Nil(t, obj.GetOtherwise(), "getter should return nil when property is nil") + }) + + t.Run("GetOtherwise_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *PutSchedulingOutOfOfficeRequestReassign + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetOtherwise() // Should return zero value + }) + +} + +func TestSettersMarkExplicitPutSchedulingOutOfOfficeRequestReassign(t *testing.T) { + t.Run("SetToHost_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &PutSchedulingOutOfOfficeRequestReassign{} + var fernTestValueToHost *string + + // Act + obj.SetToHost(fernTestValueToHost) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetPreferredHosts_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &PutSchedulingOutOfOfficeRequestReassign{} + var fernTestValuePreferredHosts []string + + // Act + obj.SetPreferredHosts(fernTestValuePreferredHosts) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetOtherwise_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &PutSchedulingOutOfOfficeRequestReassign{} + var fernTestValueOtherwise *PutSchedulingOutOfOfficeRequestReassignOtherwise + + // Act + obj.SetOtherwise(fernTestValueOtherwise) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + +} + +func TestSettersUpdateSchedulingOutOfOfficeRequestReassign(t *testing.T) { + t.Run("SetToHost", func(t *testing.T) { + obj := &UpdateSchedulingOutOfOfficeRequestReassign{} + var fernTestValueToHost *string + obj.SetToHost(fernTestValueToHost) + assert.Equal(t, fernTestValueToHost, obj.ToHost) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetPreferredHosts", func(t *testing.T) { + obj := &UpdateSchedulingOutOfOfficeRequestReassign{} + var fernTestValuePreferredHosts []string + obj.SetPreferredHosts(fernTestValuePreferredHosts) + assert.Equal(t, fernTestValuePreferredHosts, obj.PreferredHosts) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetOtherwise", func(t *testing.T) { + obj := &UpdateSchedulingOutOfOfficeRequestReassign{} + var fernTestValueOtherwise *UpdateSchedulingOutOfOfficeRequestReassignOtherwise + obj.SetOtherwise(fernTestValueOtherwise) + assert.Equal(t, fernTestValueOtherwise, obj.Otherwise) + assert.NotNil(t, obj.explicitFields) + }) + +} + +func TestGettersUpdateSchedulingOutOfOfficeRequestReassign(t *testing.T) { + t.Run("GetToHost", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &UpdateSchedulingOutOfOfficeRequestReassign{} + var expected *string + obj.ToHost = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetToHost(), "getter should return the property value") + }) + + t.Run("GetToHost_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &UpdateSchedulingOutOfOfficeRequestReassign{} + obj.ToHost = nil + + // Act & Assert + assert.Nil(t, obj.GetToHost(), "getter should return nil when property is nil") + }) + + t.Run("GetToHost_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *UpdateSchedulingOutOfOfficeRequestReassign + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetToHost() // Should return zero value + }) + + t.Run("GetPreferredHosts", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &UpdateSchedulingOutOfOfficeRequestReassign{} + var expected []string + obj.PreferredHosts = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetPreferredHosts(), "getter should return the property value") + }) + + t.Run("GetPreferredHosts_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &UpdateSchedulingOutOfOfficeRequestReassign{} + obj.PreferredHosts = nil + + // Act & Assert + assert.Nil(t, obj.GetPreferredHosts(), "getter should return nil when property is nil") + }) + + t.Run("GetPreferredHosts_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *UpdateSchedulingOutOfOfficeRequestReassign + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetPreferredHosts() // Should return zero value + }) + + t.Run("GetOtherwise", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &UpdateSchedulingOutOfOfficeRequestReassign{} + var expected *UpdateSchedulingOutOfOfficeRequestReassignOtherwise + obj.Otherwise = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetOtherwise(), "getter should return the property value") + }) + + t.Run("GetOtherwise_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &UpdateSchedulingOutOfOfficeRequestReassign{} + obj.Otherwise = nil + + // Act & Assert + assert.Nil(t, obj.GetOtherwise(), "getter should return nil when property is nil") + }) + + t.Run("GetOtherwise_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *UpdateSchedulingOutOfOfficeRequestReassign + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetOtherwise() // Should return zero value + }) + +} + +func TestSettersMarkExplicitUpdateSchedulingOutOfOfficeRequestReassign(t *testing.T) { + t.Run("SetToHost_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &UpdateSchedulingOutOfOfficeRequestReassign{} + var fernTestValueToHost *string + + // Act + obj.SetToHost(fernTestValueToHost) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetPreferredHosts_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &UpdateSchedulingOutOfOfficeRequestReassign{} + var fernTestValuePreferredHosts []string + + // Act + obj.SetPreferredHosts(fernTestValuePreferredHosts) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetOtherwise_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &UpdateSchedulingOutOfOfficeRequestReassign{} + var fernTestValueOtherwise *UpdateSchedulingOutOfOfficeRequestReassignOtherwise + + // Act + obj.SetOtherwise(fernTestValueOtherwise) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + +} + +func TestSettersUpdateSchedulingOutOfOfficeRequest(t *testing.T) { + t.Run("SetID", func(t *testing.T) { + obj := &UpdateSchedulingOutOfOfficeRequest{} + var fernTestValueID string + obj.SetID(fernTestValueID) + assert.Equal(t, fernTestValueID, obj.ID) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetStart", func(t *testing.T) { + obj := &UpdateSchedulingOutOfOfficeRequest{} + var fernTestValueStart *string + obj.SetStart(fernTestValueStart) + assert.Equal(t, fernTestValueStart, obj.Start) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetEnd", func(t *testing.T) { + obj := &UpdateSchedulingOutOfOfficeRequest{} + var fernTestValueEnd *string + obj.SetEnd(fernTestValueEnd) + assert.Equal(t, fernTestValueEnd, obj.End) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetStartDate", func(t *testing.T) { + obj := &UpdateSchedulingOutOfOfficeRequest{} + var fernTestValueStartDate *string + obj.SetStartDate(fernTestValueStartDate) + assert.Equal(t, fernTestValueStartDate, obj.StartDate) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetEndDate", func(t *testing.T) { + obj := &UpdateSchedulingOutOfOfficeRequest{} + var fernTestValueEndDate *string + obj.SetEndDate(fernTestValueEndDate) + assert.Equal(t, fernTestValueEndDate, obj.EndDate) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetTimeZone", func(t *testing.T) { + obj := &UpdateSchedulingOutOfOfficeRequest{} + var fernTestValueTimeZone *string + obj.SetTimeZone(fernTestValueTimeZone) + assert.Equal(t, fernTestValueTimeZone, obj.TimeZone) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetReason", func(t *testing.T) { + obj := &UpdateSchedulingOutOfOfficeRequest{} + var fernTestValueReason *string + obj.SetReason(fernTestValueReason) + assert.Equal(t, fernTestValueReason, obj.Reason) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetNotes", func(t *testing.T) { + obj := &UpdateSchedulingOutOfOfficeRequest{} + var fernTestValueNotes *string + obj.SetNotes(fernTestValueNotes) + assert.Equal(t, fernTestValueNotes, obj.Notes) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetPublicMessage", func(t *testing.T) { + obj := &UpdateSchedulingOutOfOfficeRequest{} + var fernTestValuePublicMessage *string + obj.SetPublicMessage(fernTestValuePublicMessage) + assert.Equal(t, fernTestValuePublicMessage, obj.PublicMessage) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetShowOnCalendar", func(t *testing.T) { + obj := &UpdateSchedulingOutOfOfficeRequest{} + var fernTestValueShowOnCalendar *bool + obj.SetShowOnCalendar(fernTestValueShowOnCalendar) + assert.Equal(t, fernTestValueShowOnCalendar, obj.ShowOnCalendar) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetDelegates", func(t *testing.T) { + obj := &UpdateSchedulingOutOfOfficeRequest{} + var fernTestValueDelegates []string + obj.SetDelegates(fernTestValueDelegates) + assert.Equal(t, fernTestValueDelegates, obj.Delegates) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetExistingBookings", func(t *testing.T) { + obj := &UpdateSchedulingOutOfOfficeRequest{} + var fernTestValueExistingBookings *UpdateSchedulingOutOfOfficeRequestExistingBookings + obj.SetExistingBookings(fernTestValueExistingBookings) + assert.Equal(t, fernTestValueExistingBookings, obj.ExistingBookings) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetReassign", func(t *testing.T) { + obj := &UpdateSchedulingOutOfOfficeRequest{} + var fernTestValueReassign *UpdateSchedulingOutOfOfficeRequestReassign + obj.SetReassign(fernTestValueReassign) + assert.Equal(t, fernTestValueReassign, obj.Reassign) + assert.NotNil(t, obj.explicitFields) + }) + +} + +func TestSettersMarkExplicitUpdateSchedulingOutOfOfficeRequest(t *testing.T) { + t.Run("SetID_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &UpdateSchedulingOutOfOfficeRequest{} + var fernTestValueID string + + // Act + obj.SetID(fernTestValueID) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetStart_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &UpdateSchedulingOutOfOfficeRequest{} + var fernTestValueStart *string + + // Act + obj.SetStart(fernTestValueStart) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetEnd_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &UpdateSchedulingOutOfOfficeRequest{} + var fernTestValueEnd *string + + // Act + obj.SetEnd(fernTestValueEnd) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetStartDate_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &UpdateSchedulingOutOfOfficeRequest{} + var fernTestValueStartDate *string + + // Act + obj.SetStartDate(fernTestValueStartDate) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetEndDate_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &UpdateSchedulingOutOfOfficeRequest{} + var fernTestValueEndDate *string + + // Act + obj.SetEndDate(fernTestValueEndDate) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetTimeZone_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &UpdateSchedulingOutOfOfficeRequest{} + var fernTestValueTimeZone *string + + // Act + obj.SetTimeZone(fernTestValueTimeZone) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetReason_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &UpdateSchedulingOutOfOfficeRequest{} + var fernTestValueReason *string + + // Act + obj.SetReason(fernTestValueReason) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetNotes_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &UpdateSchedulingOutOfOfficeRequest{} + var fernTestValueNotes *string + + // Act + obj.SetNotes(fernTestValueNotes) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetPublicMessage_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &UpdateSchedulingOutOfOfficeRequest{} + var fernTestValuePublicMessage *string + + // Act + obj.SetPublicMessage(fernTestValuePublicMessage) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetShowOnCalendar_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &UpdateSchedulingOutOfOfficeRequest{} + var fernTestValueShowOnCalendar *bool + + // Act + obj.SetShowOnCalendar(fernTestValueShowOnCalendar) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetDelegates_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &UpdateSchedulingOutOfOfficeRequest{} + var fernTestValueDelegates []string + + // Act + obj.SetDelegates(fernTestValueDelegates) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetExistingBookings_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &UpdateSchedulingOutOfOfficeRequest{} + var fernTestValueExistingBookings *UpdateSchedulingOutOfOfficeRequestExistingBookings + + // Act + obj.SetExistingBookings(fernTestValueExistingBookings) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetReassign_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &UpdateSchedulingOutOfOfficeRequest{} + var fernTestValueReassign *UpdateSchedulingOutOfOfficeRequestReassign + + // Act + obj.SetReassign(fernTestValueReassign) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + +} + +func TestJSONMarshalingCreateSchedulingOutOfOfficeRequestReassign(t *testing.T) { + t.Run("MarshalUnmarshal", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &CreateSchedulingOutOfOfficeRequestReassign{} + + // Act - Marshal to JSON + data, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed") + assert.NotNil(t, data, "marshaled data should not be nil") + assert.NotEmpty(t, data, "marshaled data should not be empty") + + // Unmarshal back and verify round-trip + var unmarshaled CreateSchedulingOutOfOfficeRequestReassign + err = json.Unmarshal(data, &unmarshaled) + assert.NoError(t, err, "round-trip unmarshal should succeed") + }) + + t.Run("UnmarshalInvalidJSON", func(t *testing.T) { + t.Parallel() + var obj CreateSchedulingOutOfOfficeRequestReassign + err := json.Unmarshal([]byte(`{invalid json}`), &obj) + assert.Error(t, err, "unmarshaling invalid JSON should return an error") + }) + + t.Run("UnmarshalEmptyObject", func(t *testing.T) { + t.Parallel() + var obj CreateSchedulingOutOfOfficeRequestReassign + err := json.Unmarshal([]byte(`{}`), &obj) + assert.NoError(t, err, "unmarshaling empty object should succeed") + }) +} + +func TestJSONMarshalingPutSchedulingOutOfOfficeRequestReassign(t *testing.T) { + t.Run("MarshalUnmarshal", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &PutSchedulingOutOfOfficeRequestReassign{} + + // Act - Marshal to JSON + data, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed") + assert.NotNil(t, data, "marshaled data should not be nil") + assert.NotEmpty(t, data, "marshaled data should not be empty") + + // Unmarshal back and verify round-trip + var unmarshaled PutSchedulingOutOfOfficeRequestReassign + err = json.Unmarshal(data, &unmarshaled) + assert.NoError(t, err, "round-trip unmarshal should succeed") + }) + + t.Run("UnmarshalInvalidJSON", func(t *testing.T) { + t.Parallel() + var obj PutSchedulingOutOfOfficeRequestReassign + err := json.Unmarshal([]byte(`{invalid json}`), &obj) + assert.Error(t, err, "unmarshaling invalid JSON should return an error") + }) + + t.Run("UnmarshalEmptyObject", func(t *testing.T) { + t.Parallel() + var obj PutSchedulingOutOfOfficeRequestReassign + err := json.Unmarshal([]byte(`{}`), &obj) + assert.NoError(t, err, "unmarshaling empty object should succeed") + }) +} + +func TestJSONMarshalingUpdateSchedulingOutOfOfficeRequestReassign(t *testing.T) { + t.Run("MarshalUnmarshal", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &UpdateSchedulingOutOfOfficeRequestReassign{} + + // Act - Marshal to JSON + data, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed") + assert.NotNil(t, data, "marshaled data should not be nil") + assert.NotEmpty(t, data, "marshaled data should not be empty") + + // Unmarshal back and verify round-trip + var unmarshaled UpdateSchedulingOutOfOfficeRequestReassign + err = json.Unmarshal(data, &unmarshaled) + assert.NoError(t, err, "round-trip unmarshal should succeed") + }) + + t.Run("UnmarshalInvalidJSON", func(t *testing.T) { + t.Parallel() + var obj UpdateSchedulingOutOfOfficeRequestReassign + err := json.Unmarshal([]byte(`{invalid json}`), &obj) + assert.Error(t, err, "unmarshaling invalid JSON should return an error") + }) + + t.Run("UnmarshalEmptyObject", func(t *testing.T) { + t.Parallel() + var obj UpdateSchedulingOutOfOfficeRequestReassign + err := json.Unmarshal([]byte(`{}`), &obj) + assert.NoError(t, err, "unmarshaling empty object should succeed") + }) +} + +func TestStringCreateSchedulingOutOfOfficeRequestReassign(t *testing.T) { + t.Run("StringMethod", func(t *testing.T) { + t.Parallel() + obj := &CreateSchedulingOutOfOfficeRequestReassign{} + result := obj.String() + assert.NotEmpty(t, result, "String() should return a non-empty representation") + }) + + t.Run("StringMethod_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *CreateSchedulingOutOfOfficeRequestReassign + result := obj.String() + assert.Equal(t, "", result, "String() should return for nil receiver") + }) +} + +func TestStringPutSchedulingOutOfOfficeRequestReassign(t *testing.T) { + t.Run("StringMethod", func(t *testing.T) { + t.Parallel() + obj := &PutSchedulingOutOfOfficeRequestReassign{} + result := obj.String() + assert.NotEmpty(t, result, "String() should return a non-empty representation") + }) + + t.Run("StringMethod_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *PutSchedulingOutOfOfficeRequestReassign + result := obj.String() + assert.Equal(t, "", result, "String() should return for nil receiver") + }) +} + +func TestStringUpdateSchedulingOutOfOfficeRequestReassign(t *testing.T) { + t.Run("StringMethod", func(t *testing.T) { + t.Parallel() + obj := &UpdateSchedulingOutOfOfficeRequestReassign{} + result := obj.String() + assert.NotEmpty(t, result, "String() should return a non-empty representation") + }) + + t.Run("StringMethod_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *UpdateSchedulingOutOfOfficeRequestReassign + result := obj.String() + assert.Equal(t, "", result, "String() should return for nil receiver") + }) +} + +func TestEnumCreateSchedulingOutOfOfficeRequestExistingBookings(t *testing.T) { + t.Run("NewFromString_leave", func(t *testing.T) { + t.Parallel() + val, err := NewCreateSchedulingOutOfOfficeRequestExistingBookingsFromString("leave") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, CreateSchedulingOutOfOfficeRequestExistingBookings("leave"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_reassign", func(t *testing.T) { + t.Parallel() + val, err := NewCreateSchedulingOutOfOfficeRequestExistingBookingsFromString("reassign") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, CreateSchedulingOutOfOfficeRequestExistingBookings("reassign"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_Invalid", func(t *testing.T) { + _, err := NewCreateSchedulingOutOfOfficeRequestExistingBookingsFromString("invalid_value_that_does_not_exist") + assert.Error(t, err) + }) + + t.Run("Ptr", func(t *testing.T) { + val, err := NewCreateSchedulingOutOfOfficeRequestExistingBookingsFromString("leave") + assert.NoError(t, err) + ptr := val.Ptr() + assert.NotNil(t, ptr) + assert.Equal(t, val, *ptr) + }) +} + +func TestEnumCreateSchedulingOutOfOfficeRequestReassignOtherwise(t *testing.T) { + t.Run("NewFromString_auto", func(t *testing.T) { + t.Parallel() + val, err := NewCreateSchedulingOutOfOfficeRequestReassignOtherwiseFromString("auto") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, CreateSchedulingOutOfOfficeRequestReassignOtherwise("auto"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_leave", func(t *testing.T) { + t.Parallel() + val, err := NewCreateSchedulingOutOfOfficeRequestReassignOtherwiseFromString("leave") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, CreateSchedulingOutOfOfficeRequestReassignOtherwise("leave"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_Invalid", func(t *testing.T) { + _, err := NewCreateSchedulingOutOfOfficeRequestReassignOtherwiseFromString("invalid_value_that_does_not_exist") + assert.Error(t, err) + }) + + t.Run("Ptr", func(t *testing.T) { + val, err := NewCreateSchedulingOutOfOfficeRequestReassignOtherwiseFromString("auto") + assert.NoError(t, err) + ptr := val.Ptr() + assert.NotNil(t, ptr) + assert.Equal(t, val, *ptr) + }) +} + +func TestEnumPutSchedulingOutOfOfficeRequestExistingBookings(t *testing.T) { + t.Run("NewFromString_leave", func(t *testing.T) { + t.Parallel() + val, err := NewPutSchedulingOutOfOfficeRequestExistingBookingsFromString("leave") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, PutSchedulingOutOfOfficeRequestExistingBookings("leave"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_reassign", func(t *testing.T) { + t.Parallel() + val, err := NewPutSchedulingOutOfOfficeRequestExistingBookingsFromString("reassign") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, PutSchedulingOutOfOfficeRequestExistingBookings("reassign"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_Invalid", func(t *testing.T) { + _, err := NewPutSchedulingOutOfOfficeRequestExistingBookingsFromString("invalid_value_that_does_not_exist") + assert.Error(t, err) + }) + + t.Run("Ptr", func(t *testing.T) { + val, err := NewPutSchedulingOutOfOfficeRequestExistingBookingsFromString("leave") + assert.NoError(t, err) + ptr := val.Ptr() + assert.NotNil(t, ptr) + assert.Equal(t, val, *ptr) + }) +} + +func TestEnumPutSchedulingOutOfOfficeRequestReassignOtherwise(t *testing.T) { + t.Run("NewFromString_auto", func(t *testing.T) { + t.Parallel() + val, err := NewPutSchedulingOutOfOfficeRequestReassignOtherwiseFromString("auto") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, PutSchedulingOutOfOfficeRequestReassignOtherwise("auto"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_leave", func(t *testing.T) { + t.Parallel() + val, err := NewPutSchedulingOutOfOfficeRequestReassignOtherwiseFromString("leave") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, PutSchedulingOutOfOfficeRequestReassignOtherwise("leave"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_Invalid", func(t *testing.T) { + _, err := NewPutSchedulingOutOfOfficeRequestReassignOtherwiseFromString("invalid_value_that_does_not_exist") + assert.Error(t, err) + }) + + t.Run("Ptr", func(t *testing.T) { + val, err := NewPutSchedulingOutOfOfficeRequestReassignOtherwiseFromString("auto") + assert.NoError(t, err) + ptr := val.Ptr() + assert.NotNil(t, ptr) + assert.Equal(t, val, *ptr) + }) +} + +func TestEnumUpdateSchedulingOutOfOfficeRequestExistingBookings(t *testing.T) { + t.Run("NewFromString_leave", func(t *testing.T) { + t.Parallel() + val, err := NewUpdateSchedulingOutOfOfficeRequestExistingBookingsFromString("leave") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, UpdateSchedulingOutOfOfficeRequestExistingBookings("leave"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_reassign", func(t *testing.T) { + t.Parallel() + val, err := NewUpdateSchedulingOutOfOfficeRequestExistingBookingsFromString("reassign") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, UpdateSchedulingOutOfOfficeRequestExistingBookings("reassign"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_Invalid", func(t *testing.T) { + _, err := NewUpdateSchedulingOutOfOfficeRequestExistingBookingsFromString("invalid_value_that_does_not_exist") + assert.Error(t, err) + }) + + t.Run("Ptr", func(t *testing.T) { + val, err := NewUpdateSchedulingOutOfOfficeRequestExistingBookingsFromString("leave") + assert.NoError(t, err) + ptr := val.Ptr() + assert.NotNil(t, ptr) + assert.Equal(t, val, *ptr) + }) +} + +func TestEnumUpdateSchedulingOutOfOfficeRequestReassignOtherwise(t *testing.T) { + t.Run("NewFromString_auto", func(t *testing.T) { + t.Parallel() + val, err := NewUpdateSchedulingOutOfOfficeRequestReassignOtherwiseFromString("auto") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, UpdateSchedulingOutOfOfficeRequestReassignOtherwise("auto"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_leave", func(t *testing.T) { + t.Parallel() + val, err := NewUpdateSchedulingOutOfOfficeRequestReassignOtherwiseFromString("leave") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, UpdateSchedulingOutOfOfficeRequestReassignOtherwise("leave"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_Invalid", func(t *testing.T) { + _, err := NewUpdateSchedulingOutOfOfficeRequestReassignOtherwiseFromString("invalid_value_that_does_not_exist") + assert.Error(t, err) + }) + + t.Run("Ptr", func(t *testing.T) { + val, err := NewUpdateSchedulingOutOfOfficeRequestReassignOtherwiseFromString("auto") + assert.NoError(t, err) + ptr := val.Ptr() + assert.NotNil(t, ptr) + assert.Equal(t, val, *ptr) + }) +} + +func TestExtraPropertiesCreateSchedulingOutOfOfficeRequestReassign(t *testing.T) { + t.Run("GetExtraProperties", func(t *testing.T) { + t.Parallel() + obj := &CreateSchedulingOutOfOfficeRequestReassign{} + // Should not panic when calling GetExtraProperties() + defer func() { + if r := recover(); r != nil { + t.Errorf("GetExtraProperties() panicked: %v", r) + } + }() + extraProps := obj.GetExtraProperties() + // Result can be nil or an empty/non-empty map + _ = extraProps + }) + + t.Run("GetExtraProperties_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *CreateSchedulingOutOfOfficeRequestReassign + extraProps := obj.GetExtraProperties() + assert.Nil(t, extraProps, "nil receiver should return nil without panicking") + }) +} + +func TestExtraPropertiesPutSchedulingOutOfOfficeRequestReassign(t *testing.T) { + t.Run("GetExtraProperties", func(t *testing.T) { + t.Parallel() + obj := &PutSchedulingOutOfOfficeRequestReassign{} + // Should not panic when calling GetExtraProperties() + defer func() { + if r := recover(); r != nil { + t.Errorf("GetExtraProperties() panicked: %v", r) + } + }() + extraProps := obj.GetExtraProperties() + // Result can be nil or an empty/non-empty map + _ = extraProps + }) + + t.Run("GetExtraProperties_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *PutSchedulingOutOfOfficeRequestReassign + extraProps := obj.GetExtraProperties() + assert.Nil(t, extraProps, "nil receiver should return nil without panicking") + }) +} + +func TestExtraPropertiesUpdateSchedulingOutOfOfficeRequestReassign(t *testing.T) { + t.Run("GetExtraProperties", func(t *testing.T) { + t.Parallel() + obj := &UpdateSchedulingOutOfOfficeRequestReassign{} + // Should not panic when calling GetExtraProperties() + defer func() { + if r := recover(); r != nil { + t.Errorf("GetExtraProperties() panicked: %v", r) + } + }() + extraProps := obj.GetExtraProperties() + // Result can be nil or an empty/non-empty map + _ = extraProps + }) + + t.Run("GetExtraProperties_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *UpdateSchedulingOutOfOfficeRequestReassign + extraProps := obj.GetExtraProperties() + assert.Nil(t, extraProps, "nil receiver should return nil without panicking") + }) +} diff --git a/sdks/go/scheduling/outofoffice/client.go b/sdks/go/scheduling/outofoffice/client.go new file mode 100644 index 000000000..249545557 --- /dev/null +++ b/sdks/go/scheduling/outofoffice/client.go @@ -0,0 +1,265 @@ +// Code generated by Fern. DO NOT EDIT. + +package outofoffice + +import ( + context "context" + os "os" + + coss "github.com/cosscom/coss-go" + core "github.com/cosscom/coss-go/core" + internal "github.com/cosscom/coss-go/internal" + option "github.com/cosscom/coss-go/option" + scheduling "github.com/cosscom/coss-go/scheduling" +) + +type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions + baseURL string + caller *internal.Caller +} + +func NewClient(options *core.RequestOptions) *Client { + if options.APIKey == "" { + options.APIKey = os.Getenv("COSS_API_KEY") + } + if options.APIVersion == nil { + apiVersionDefault := "2026-10-10" + options.APIVersion = &apiVersionDefault + } + return &Client{ + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + DisableRetries: options.DisableRetries, + }, + ), + } +} + +// The environment's entries, newest first. +// +// Example: +// +// request := &scheduling.ListOutOfOfficeRequest{ +// StartAfter: coss.String( +// "2027-01-04T15:00:00.000Z", +// ), +// StartBefore: coss.String( +// "2027-01-04T15:00:00.000Z", +// ), +// } +// client.Scheduling.OutOfOffice.List( +// context.TODO(), +// request, +// ) +func (c *Client) List( + ctx context.Context, + request *scheduling.ListOutOfOfficeRequest, + opts ...option.RequestOption, +) (*coss.SchedulingOutOfOfficeList, error) { + response, err := c.WithRawResponse.List( + ctx, + request, + opts..., + ) + if err != nil { + return nil, err + } + return response.Body, nil +} + +// Marks one host, a list of hosts or everyone matching some attributes as away, for part of a day or for whole dates. They aren't offered during it. Existing bookings stay as they are: list them with the entry's conflicts. +// +// Example: +// +// request := &scheduling.CreateSchedulingOutOfOfficeRequest{ +// Host: coss.String( +// "doctor_482", +// ), +// StartDate: coss.String( +// "2027-08-02", +// ), +// EndDate: coss.String( +// "2027-08-13", +// ), +// Reason: coss.String( +// "vacation", +// ), +// PublicMessage: coss.String( +// "Back on the 16th.", +// ), +// } +// client.Scheduling.OutOfOffice.Create( +// context.TODO(), +// request, +// ) +func (c *Client) Create( + ctx context.Context, + request *scheduling.CreateSchedulingOutOfOfficeRequest, + opts ...option.RequestOption, +) (*coss.SchedulingOutOfOfficeList, error) { + response, err := c.WithRawResponse.Create( + ctx, + request, + opts..., + ) + if err != nil { + return nil, err + } + return response.Body, nil +} + +// One entry. +// +// Example: +// +// request := &scheduling.GetOutOfOfficeRequest{ +// ID: "ooo_01kd2m9a0b1c2d3e4f5g6h7j8m", +// } +// client.Scheduling.OutOfOffice.Get( +// context.TODO(), +// request, +// ) +func (c *Client) Get( + ctx context.Context, + request *scheduling.GetOutOfOfficeRequest, + opts ...option.RequestOption, +) (*coss.SchedulingOutOfOffice, error) { + response, err := c.WithRawResponse.Get( + ctx, + request, + opts..., + ) + if err != nil { + return nil, err + } + return response.Body, nil +} + +// The host can be booked in that time again, and any calendar event for it goes. +// +// Example: +// +// request := &scheduling.RemoveOutOfOfficeRequest{ +// ID: "ooo_01kd2m9a0b1c2d3e4f5g6h7j8m", +// } +// client.Scheduling.OutOfOffice.Remove( +// context.TODO(), +// request, +// ) +func (c *Client) Remove( + ctx context.Context, + request *scheduling.RemoveOutOfOfficeRequest, + opts ...option.RequestOption, +) (*coss.DeletedSchedulingOutOfOffice, error) { + response, err := c.WithRawResponse.Remove( + ctx, + request, + opts..., + ) + if err != nil { + return nil, err + } + return response.Body, nil +} + +// Changes what's given. An entry stays with its host. +// +// Example: +// +// request := &scheduling.UpdateSchedulingOutOfOfficeRequest{ +// ID: "ooo_01kd2m9a0b1c2d3e4f5g6h7j8m", +// EndDate: coss.String( +// "2027-08-20", +// ), +// } +// client.Scheduling.OutOfOffice.Update( +// context.TODO(), +// request, +// ) +func (c *Client) Update( + ctx context.Context, + request *scheduling.UpdateSchedulingOutOfOfficeRequest, + opts ...option.RequestOption, +) (*coss.SchedulingOutOfOffice, error) { + response, err := c.WithRawResponse.Update( + ctx, + request, + opts..., + ) + if err != nil { + return nil, err + } + return response.Body, nil +} + +// For syncing from a system of record such as an HR tool: send what it says, as often as you like, and there's one entry for it. Give every field you want to keep. +// +// Example: +// +// request := &scheduling.PutSchedulingOutOfOfficeRequest{ +// ExternalID: "hr_leave_4471", +// Host: "doctor_482", +// StartDate: coss.String( +// "2027-08-02", +// ), +// EndDate: coss.String( +// "2027-08-13", +// ), +// Reason: coss.String( +// "vacation", +// ), +// } +// client.Scheduling.OutOfOffice.Put( +// context.TODO(), +// request, +// ) +func (c *Client) Put( + ctx context.Context, + request *scheduling.PutSchedulingOutOfOfficeRequest, + opts ...option.RequestOption, +) (*coss.SchedulingOutOfOffice, error) { + response, err := c.WithRawResponse.Put( + ctx, + request, + opts..., + ) + if err != nil { + return nil, err + } + return response.Body, nil +} + +// Live bookings of the host that fall in the entry, soonest first. Entries never change them. +// +// Example: +// +// request := &scheduling.ConflictsOutOfOfficeRequest{ +// ID: "ooo_01kd2m9a0b1c2d3e4f5g6h7j8m", +// } +// client.Scheduling.OutOfOffice.Conflicts( +// context.TODO(), +// request, +// ) +func (c *Client) Conflicts( + ctx context.Context, + request *scheduling.ConflictsOutOfOfficeRequest, + opts ...option.RequestOption, +) (*coss.SchedulingOutOfOfficeConflictList, error) { + response, err := c.WithRawResponse.Conflicts( + ctx, + request, + opts..., + ) + if err != nil { + return nil, err + } + return response.Body, nil +} diff --git a/sdks/go/scheduling/outofoffice/raw_client.go b/sdks/go/scheduling/outofoffice/raw_client.go new file mode 100644 index 000000000..088435f6a --- /dev/null +++ b/sdks/go/scheduling/outofoffice/raw_client.go @@ -0,0 +1,365 @@ +// Code generated by Fern. DO NOT EDIT. + +package outofoffice + +import ( + context "context" + http "net/http" + + coss "github.com/cosscom/coss-go" + core "github.com/cosscom/coss-go/core" + internal "github.com/cosscom/coss-go/internal" + option "github.com/cosscom/coss-go/option" + scheduling "github.com/cosscom/coss-go/scheduling" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + DisableRetries: options.DisableRetries, + }, + ), + } +} + +func (r *RawClient) List( + ctx context.Context, + request *scheduling.ListOutOfOfficeRequest, + opts ...option.RequestOption, +) (*core.Response[*coss.SchedulingOutOfOfficeList], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "https://api.coss.com", + ) + endpointURL := baseURL + "/v1/scheduling/out_of_office" + queryParams, err := internal.QueryValues(request) + if err != nil { + return nil, err + } + if len(queryParams) > 0 { + endpointURL += "?" + queryParams.Encode() + } + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *coss.SchedulingOutOfOfficeList + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + DisableRetries: options.DisableRetries, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + ErrorDecoder: internal.NewErrorDecoder(scheduling.ErrorCodes), + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*coss.SchedulingOutOfOfficeList]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} + +func (r *RawClient) Create( + ctx context.Context, + request *scheduling.CreateSchedulingOutOfOfficeRequest, + opts ...option.RequestOption, +) (*core.Response[*coss.SchedulingOutOfOfficeList], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "https://api.coss.com", + ) + endpointURL := baseURL + "/v1/scheduling/out_of_office" + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + headers.Add("Content-Type", "application/json") + core.SetIdempotencyKeyHeader(headers) + + var response *coss.SchedulingOutOfOfficeList + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodPost, + Headers: headers, + MaxAttempts: options.MaxAttempts, + DisableRetries: true, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Request: request, + Response: &response, + ErrorDecoder: internal.NewErrorDecoder(scheduling.ErrorCodes), + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*coss.SchedulingOutOfOfficeList]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} + +func (r *RawClient) Get( + ctx context.Context, + request *scheduling.GetOutOfOfficeRequest, + opts ...option.RequestOption, +) (*core.Response[*coss.SchedulingOutOfOffice], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "https://api.coss.com", + ) + endpointURL := internal.EncodeURL( + baseURL+"/v1/scheduling/out_of_office/%v", + request.ID, + ) + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *coss.SchedulingOutOfOffice + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + DisableRetries: options.DisableRetries, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + ErrorDecoder: internal.NewErrorDecoder(scheduling.ErrorCodes), + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*coss.SchedulingOutOfOffice]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} + +func (r *RawClient) Remove( + ctx context.Context, + request *scheduling.RemoveOutOfOfficeRequest, + opts ...option.RequestOption, +) (*core.Response[*coss.DeletedSchedulingOutOfOffice], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "https://api.coss.com", + ) + endpointURL := internal.EncodeURL( + baseURL+"/v1/scheduling/out_of_office/%v", + request.ID, + ) + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *coss.DeletedSchedulingOutOfOffice + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodDelete, + Headers: headers, + MaxAttempts: options.MaxAttempts, + DisableRetries: options.DisableRetries, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + ErrorDecoder: internal.NewErrorDecoder(scheduling.ErrorCodes), + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*coss.DeletedSchedulingOutOfOffice]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} + +func (r *RawClient) Update( + ctx context.Context, + request *scheduling.UpdateSchedulingOutOfOfficeRequest, + opts ...option.RequestOption, +) (*core.Response[*coss.SchedulingOutOfOffice], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "https://api.coss.com", + ) + endpointURL := internal.EncodeURL( + baseURL+"/v1/scheduling/out_of_office/%v", + request.ID, + ) + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + headers.Add("Content-Type", "application/json") + var response *coss.SchedulingOutOfOffice + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodPatch, + Headers: headers, + MaxAttempts: options.MaxAttempts, + DisableRetries: options.DisableRetries, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Request: request, + Response: &response, + ErrorDecoder: internal.NewErrorDecoder(scheduling.ErrorCodes), + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*coss.SchedulingOutOfOffice]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} + +func (r *RawClient) Put( + ctx context.Context, + request *scheduling.PutSchedulingOutOfOfficeRequest, + opts ...option.RequestOption, +) (*core.Response[*coss.SchedulingOutOfOffice], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "https://api.coss.com", + ) + endpointURL := internal.EncodeURL( + baseURL+"/v1/scheduling/out_of_office/by_external_id/%v", + request.ExternalID, + ) + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + headers.Add("Content-Type", "application/json") + var response *coss.SchedulingOutOfOffice + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodPut, + Headers: headers, + MaxAttempts: options.MaxAttempts, + DisableRetries: options.DisableRetries, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Request: request, + Response: &response, + ErrorDecoder: internal.NewErrorDecoder(scheduling.ErrorCodes), + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*coss.SchedulingOutOfOffice]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} + +func (r *RawClient) Conflicts( + ctx context.Context, + request *scheduling.ConflictsOutOfOfficeRequest, + opts ...option.RequestOption, +) (*core.Response[*coss.SchedulingOutOfOfficeConflictList], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "https://api.coss.com", + ) + endpointURL := internal.EncodeURL( + baseURL+"/v1/scheduling/out_of_office/%v/conflicts", + request.ID, + ) + queryParams, err := internal.QueryValues(request) + if err != nil { + return nil, err + } + if len(queryParams) > 0 { + endpointURL += "?" + queryParams.Encode() + } + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *coss.SchedulingOutOfOfficeConflictList + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + DisableRetries: options.DisableRetries, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + ErrorDecoder: internal.NewErrorDecoder(scheduling.ErrorCodes), + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*coss.SchedulingOutOfOfficeConflictList]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} diff --git a/sdks/go/scheduling/reassignments.go b/sdks/go/scheduling/reassignments.go new file mode 100644 index 000000000..192614008 --- /dev/null +++ b/sdks/go/scheduling/reassignments.go @@ -0,0 +1,836 @@ +// Code generated by Fern. DO NOT EDIT. + +package scheduling + +import ( + json "encoding/json" + fmt "fmt" + cossgo "github.com/cosscom/coss-go" + internal "github.com/cosscom/coss-go/internal" + big "math/big" +) + +var ( + cancelReassignmentsRequestFieldID = big.NewInt(1 << 0) +) + +type CancelReassignmentsRequest struct { + // The reassignment's id. + ID string `json:"-" url:"-"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (c *CancelReassignmentsRequest) require(field *big.Int) { + next := new(big.Int) + if c.explicitFields != nil { + next.Set(c.explicitFields) + } + next.Or(next, field) + c.explicitFields = next +} + +// SetID sets the ID field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CancelReassignmentsRequest) SetID(id string) { + c.ID = id + c.require(cancelReassignmentsRequestFieldID) +} + +var ( + createSchedulingReassignmentRequestFieldIdempotencyKey = big.NewInt(1 << 0) + createSchedulingReassignmentRequestFieldSelection = big.NewInt(1 << 1) + createSchedulingReassignmentRequestFieldStrategy = big.NewInt(1 << 2) + createSchedulingReassignmentRequestFieldReasonCode = big.NewInt(1 << 3) + createSchedulingReassignmentRequestFieldNote = big.NewInt(1 << 4) + createSchedulingReassignmentRequestFieldOverrides = big.NewInt(1 << 5) + createSchedulingReassignmentRequestFieldNotify = big.NewInt(1 << 6) +) + +type CreateSchedulingReassignmentRequest struct { + // Makes retries safe: a repeated request with the same key and body returns the original run instead of starting another, for 24 hours. 1-256 characters. + IdempotencyKey *string `json:"-" url:"-"` + Selection *cossgo.SchedulingReassignmentSelection `json:"selection" url:"-"` + Strategy *cossgo.SchedulingReassignmentStrategy `json:"strategy,omitempty" url:"-"` + ReasonCode CreateSchedulingReassignmentRequestReasonCode `json:"reason_code" url:"-"` + // Why, in your words: required with an override of someone's availability. + Note *string `json:"note,omitempty" url:"-"` + Overrides []CreateSchedulingReassignmentRequestOverridesItem `json:"overrides,omitempty" url:"-"` + Notify *CreateSchedulingReassignmentRequestNotify `json:"notify,omitempty" url:"-"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (c *CreateSchedulingReassignmentRequest) require(field *big.Int) { + next := new(big.Int) + if c.explicitFields != nil { + next.Set(c.explicitFields) + } + next.Or(next, field) + c.explicitFields = next +} + +// SetIdempotencyKey sets the IdempotencyKey field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreateSchedulingReassignmentRequest) SetIdempotencyKey(idempotencyKey *string) { + c.IdempotencyKey = idempotencyKey + c.require(createSchedulingReassignmentRequestFieldIdempotencyKey) +} + +// SetSelection sets the Selection field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreateSchedulingReassignmentRequest) SetSelection(selection *cossgo.SchedulingReassignmentSelection) { + c.Selection = selection + c.require(createSchedulingReassignmentRequestFieldSelection) +} + +// SetStrategy sets the Strategy field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreateSchedulingReassignmentRequest) SetStrategy(strategy *cossgo.SchedulingReassignmentStrategy) { + c.Strategy = strategy + c.require(createSchedulingReassignmentRequestFieldStrategy) +} + +// SetReasonCode sets the ReasonCode field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreateSchedulingReassignmentRequest) SetReasonCode(reasonCode CreateSchedulingReassignmentRequestReasonCode) { + c.ReasonCode = reasonCode + c.require(createSchedulingReassignmentRequestFieldReasonCode) +} + +// SetNote sets the Note field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreateSchedulingReassignmentRequest) SetNote(note *string) { + c.Note = note + c.require(createSchedulingReassignmentRequestFieldNote) +} + +// SetOverrides sets the Overrides field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreateSchedulingReassignmentRequest) SetOverrides(overrides []CreateSchedulingReassignmentRequestOverridesItem) { + c.Overrides = overrides + c.require(createSchedulingReassignmentRequestFieldOverrides) +} + +// SetNotify sets the Notify field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreateSchedulingReassignmentRequest) SetNotify(notify *CreateSchedulingReassignmentRequestNotify) { + c.Notify = notify + c.require(createSchedulingReassignmentRequestFieldNotify) +} + +func (c *CreateSchedulingReassignmentRequest) UnmarshalJSON(data []byte) error { + type unmarshaler CreateSchedulingReassignmentRequest + var body unmarshaler + if err := json.Unmarshal(data, &body); err != nil { + return err + } + *c = CreateSchedulingReassignmentRequest(body) + return nil +} + +func (c *CreateSchedulingReassignmentRequest) MarshalJSON() ([]byte, error) { + type embed CreateSchedulingReassignmentRequest + var marshaler = struct { + embed + }{ + embed: embed(*c), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, c.explicitFields) + return json.Marshal(explicitMarshaler) +} + +var ( + getReassignmentsRequestFieldID = big.NewInt(1 << 0) +) + +type GetReassignmentsRequest struct { + // The reassignment's id. + ID string `json:"-" url:"-"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (g *GetReassignmentsRequest) require(field *big.Int) { + next := new(big.Int) + if g.explicitFields != nil { + next.Set(g.explicitFields) + } + next.Or(next, field) + g.explicitFields = next +} + +// SetID sets the ID field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (g *GetReassignmentsRequest) SetID(id string) { + g.ID = id + g.require(getReassignmentsRequestFieldID) +} + +var ( + itemsReassignmentsRequestFieldID = big.NewInt(1 << 0) + itemsReassignmentsRequestFieldLimit = big.NewInt(1 << 1) + itemsReassignmentsRequestFieldAfter = big.NewInt(1 << 2) +) + +type ItemsReassignmentsRequest struct { + // The reassignment's id. + ID string `json:"-" url:"-"` + Limit *int `json:"-" url:"limit,omitempty"` + // The last id of the previous page. + After *string `json:"-" url:"after,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (i *ItemsReassignmentsRequest) require(field *big.Int) { + next := new(big.Int) + if i.explicitFields != nil { + next.Set(i.explicitFields) + } + next.Or(next, field) + i.explicitFields = next +} + +// SetID sets the ID field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *ItemsReassignmentsRequest) SetID(id string) { + i.ID = id + i.require(itemsReassignmentsRequestFieldID) +} + +// SetLimit sets the Limit field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *ItemsReassignmentsRequest) SetLimit(limit *int) { + i.Limit = limit + i.require(itemsReassignmentsRequestFieldLimit) +} + +// SetAfter sets the After field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (i *ItemsReassignmentsRequest) SetAfter(after *string) { + i.After = after + i.require(itemsReassignmentsRequestFieldAfter) +} + +var ( + listReassignmentsRequestFieldLimit = big.NewInt(1 << 0) + listReassignmentsRequestFieldAfter = big.NewInt(1 << 1) +) + +type ListReassignmentsRequest struct { + Limit *int `json:"-" url:"limit,omitempty"` + // The last id of the previous page. + After *string `json:"-" url:"after,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (l *ListReassignmentsRequest) require(field *big.Int) { + next := new(big.Int) + if l.explicitFields != nil { + next.Set(l.explicitFields) + } + next.Or(next, field) + l.explicitFields = next +} + +// SetLimit sets the Limit field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *ListReassignmentsRequest) SetLimit(limit *int) { + l.Limit = limit + l.require(listReassignmentsRequestFieldLimit) +} + +// SetAfter sets the After field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *ListReassignmentsRequest) SetAfter(after *string) { + l.After = after + l.require(listReassignmentsRequestFieldAfter) +} + +var ( + previewSchedulingReassignmentRequestFieldSelection = big.NewInt(1 << 0) + previewSchedulingReassignmentRequestFieldStrategy = big.NewInt(1 << 1) + previewSchedulingReassignmentRequestFieldOverrides = big.NewInt(1 << 2) +) + +type PreviewSchedulingReassignmentRequest struct { + Selection *cossgo.SchedulingReassignmentSelection `json:"selection" url:"-"` + Strategy *cossgo.SchedulingReassignmentStrategy `json:"strategy,omitempty" url:"-"` + Overrides []PreviewSchedulingReassignmentRequestOverridesItem `json:"overrides,omitempty" url:"-"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (p *PreviewSchedulingReassignmentRequest) require(field *big.Int) { + next := new(big.Int) + if p.explicitFields != nil { + next.Set(p.explicitFields) + } + next.Or(next, field) + p.explicitFields = next +} + +// SetSelection sets the Selection field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PreviewSchedulingReassignmentRequest) SetSelection(selection *cossgo.SchedulingReassignmentSelection) { + p.Selection = selection + p.require(previewSchedulingReassignmentRequestFieldSelection) +} + +// SetStrategy sets the Strategy field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PreviewSchedulingReassignmentRequest) SetStrategy(strategy *cossgo.SchedulingReassignmentStrategy) { + p.Strategy = strategy + p.require(previewSchedulingReassignmentRequestFieldStrategy) +} + +// SetOverrides sets the Overrides field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PreviewSchedulingReassignmentRequest) SetOverrides(overrides []PreviewSchedulingReassignmentRequestOverridesItem) { + p.Overrides = overrides + p.require(previewSchedulingReassignmentRequestFieldOverrides) +} + +func (p *PreviewSchedulingReassignmentRequest) UnmarshalJSON(data []byte) error { + type unmarshaler PreviewSchedulingReassignmentRequest + var body unmarshaler + if err := json.Unmarshal(data, &body); err != nil { + return err + } + *p = PreviewSchedulingReassignmentRequest(body) + return nil +} + +func (p *PreviewSchedulingReassignmentRequest) MarshalJSON() ([]byte, error) { + type embed PreviewSchedulingReassignmentRequest + var marshaler = struct { + embed + }{ + embed: embed(*p), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, p.explicitFields) + return json.Marshal(explicitMarshaler) +} + +var ( + createSchedulingReassignmentRequestNotifyFieldAttendees = big.NewInt(1 << 0) + createSchedulingReassignmentRequestNotifyFieldHosts = big.NewInt(1 << 1) +) + +type CreateSchedulingReassignmentRequestNotify struct { + // Tell attendees. Default: true. + Attendees *bool `json:"attendees,omitempty" url:"attendees,omitempty"` + // `digest` (the default) sends each host one email for the run. + Hosts *CreateSchedulingReassignmentRequestNotifyHosts `json:"hosts,omitempty" url:"hosts,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + + extraProperties map[string]interface{} + rawJSON json.RawMessage +} + +func (c *CreateSchedulingReassignmentRequestNotify) GetAttendees() *bool { + if c == nil { + return nil + } + return c.Attendees +} + +func (c *CreateSchedulingReassignmentRequestNotify) GetHosts() *CreateSchedulingReassignmentRequestNotifyHosts { + if c == nil { + return nil + } + return c.Hosts +} + +func (c *CreateSchedulingReassignmentRequestNotify) GetExtraProperties() map[string]interface{} { + if c == nil { + return nil + } + return c.extraProperties +} + +func (c *CreateSchedulingReassignmentRequestNotify) require(field *big.Int) { + next := new(big.Int) + if c.explicitFields != nil { + next.Set(c.explicitFields) + } + next.Or(next, field) + c.explicitFields = next +} + +// SetAttendees sets the Attendees field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreateSchedulingReassignmentRequestNotify) SetAttendees(attendees *bool) { + c.Attendees = attendees + c.require(createSchedulingReassignmentRequestNotifyFieldAttendees) +} + +// SetHosts sets the Hosts field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreateSchedulingReassignmentRequestNotify) SetHosts(hosts *CreateSchedulingReassignmentRequestNotifyHosts) { + c.Hosts = hosts + c.require(createSchedulingReassignmentRequestNotifyFieldHosts) +} + +func (c *CreateSchedulingReassignmentRequestNotify) UnmarshalJSON(data []byte) error { + type unmarshaler CreateSchedulingReassignmentRequestNotify + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *c = CreateSchedulingReassignmentRequestNotify(value) + extraProperties, err := internal.ExtractExtraProperties(data, *c) + if err != nil { + return err + } + c.extraProperties = extraProperties + c.rawJSON = json.RawMessage(data) + return nil +} + +func (c *CreateSchedulingReassignmentRequestNotify) MarshalJSON() ([]byte, error) { + type embed CreateSchedulingReassignmentRequestNotify + var marshaler = struct { + embed + }{ + embed: embed(*c), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, c.explicitFields) + return json.Marshal(explicitMarshaler) +} + +func (c *CreateSchedulingReassignmentRequestNotify) String() string { + if c == nil { + return "" + } + if len(c.rawJSON) > 0 { + if value, err := internal.StringifyJSON(c.rawJSON); err == nil { + return value + } + } + if value, err := internal.StringifyJSON(c); err == nil { + return value + } + return fmt.Sprintf("%#v", c) +} + +// `digest` (the default) sends each host one email for the run. +type CreateSchedulingReassignmentRequestNotifyHosts string + +const ( + CreateSchedulingReassignmentRequestNotifyHostsDigest CreateSchedulingReassignmentRequestNotifyHosts = "digest" + CreateSchedulingReassignmentRequestNotifyHostsEach CreateSchedulingReassignmentRequestNotifyHosts = "each" + CreateSchedulingReassignmentRequestNotifyHostsNone CreateSchedulingReassignmentRequestNotifyHosts = "none" +) + +func NewCreateSchedulingReassignmentRequestNotifyHostsFromString(s string) (CreateSchedulingReassignmentRequestNotifyHosts, error) { + switch s { + case "digest": + return CreateSchedulingReassignmentRequestNotifyHostsDigest, nil + case "each": + return CreateSchedulingReassignmentRequestNotifyHostsEach, nil + case "none": + return CreateSchedulingReassignmentRequestNotifyHostsNone, nil + } + var t CreateSchedulingReassignmentRequestNotifyHosts + return "", fmt.Errorf("%s is not a valid %T", s, t) +} + +func (c CreateSchedulingReassignmentRequestNotifyHosts) Ptr() *CreateSchedulingReassignmentRequestNotifyHosts { + return &c +} + +type CreateSchedulingReassignmentRequestOverridesItem string + +const ( + CreateSchedulingReassignmentRequestOverridesItemAnyHost CreateSchedulingReassignmentRequestOverridesItem = "any_host" + CreateSchedulingReassignmentRequestOverridesItemOutOfOffice CreateSchedulingReassignmentRequestOverridesItem = "out_of_office" + CreateSchedulingReassignmentRequestOverridesItemOutsideAvailability CreateSchedulingReassignmentRequestOverridesItem = "outside_availability" + CreateSchedulingReassignmentRequestOverridesItemHostBusy CreateSchedulingReassignmentRequestOverridesItem = "host_busy" + CreateSchedulingReassignmentRequestOverridesItemLimitReached CreateSchedulingReassignmentRequestOverridesItem = "limit_reached" + CreateSchedulingReassignmentRequestOverridesItemCalendarUnverified CreateSchedulingReassignmentRequestOverridesItem = "calendar_unverified" +) + +func NewCreateSchedulingReassignmentRequestOverridesItemFromString(s string) (CreateSchedulingReassignmentRequestOverridesItem, error) { + switch s { + case "any_host": + return CreateSchedulingReassignmentRequestOverridesItemAnyHost, nil + case "out_of_office": + return CreateSchedulingReassignmentRequestOverridesItemOutOfOffice, nil + case "outside_availability": + return CreateSchedulingReassignmentRequestOverridesItemOutsideAvailability, nil + case "host_busy": + return CreateSchedulingReassignmentRequestOverridesItemHostBusy, nil + case "limit_reached": + return CreateSchedulingReassignmentRequestOverridesItemLimitReached, nil + case "calendar_unverified": + return CreateSchedulingReassignmentRequestOverridesItemCalendarUnverified, nil + } + var t CreateSchedulingReassignmentRequestOverridesItem + return "", fmt.Errorf("%s is not a valid %T", s, t) +} + +func (c CreateSchedulingReassignmentRequestOverridesItem) Ptr() *CreateSchedulingReassignmentRequestOverridesItem { + return &c +} + +type CreateSchedulingReassignmentRequestReasonCode string + +const ( + CreateSchedulingReassignmentRequestReasonCodeHostUnavailable CreateSchedulingReassignmentRequestReasonCode = "host_unavailable" + CreateSchedulingReassignmentRequestReasonCodeOutOfOffice CreateSchedulingReassignmentRequestReasonCode = "out_of_office" + CreateSchedulingReassignmentRequestReasonCodeWorkload CreateSchedulingReassignmentRequestReasonCode = "workload" + CreateSchedulingReassignmentRequestReasonCodeCustomerRequest CreateSchedulingReassignmentRequestReasonCode = "customer_request" + CreateSchedulingReassignmentRequestReasonCodeOffboarding CreateSchedulingReassignmentRequestReasonCode = "offboarding" + CreateSchedulingReassignmentRequestReasonCodeOther CreateSchedulingReassignmentRequestReasonCode = "other" +) + +func NewCreateSchedulingReassignmentRequestReasonCodeFromString(s string) (CreateSchedulingReassignmentRequestReasonCode, error) { + switch s { + case "host_unavailable": + return CreateSchedulingReassignmentRequestReasonCodeHostUnavailable, nil + case "out_of_office": + return CreateSchedulingReassignmentRequestReasonCodeOutOfOffice, nil + case "workload": + return CreateSchedulingReassignmentRequestReasonCodeWorkload, nil + case "customer_request": + return CreateSchedulingReassignmentRequestReasonCodeCustomerRequest, nil + case "offboarding": + return CreateSchedulingReassignmentRequestReasonCodeOffboarding, nil + case "other": + return CreateSchedulingReassignmentRequestReasonCodeOther, nil + } + var t CreateSchedulingReassignmentRequestReasonCode + return "", fmt.Errorf("%s is not a valid %T", s, t) +} + +func (c CreateSchedulingReassignmentRequestReasonCode) Ptr() *CreateSchedulingReassignmentRequestReasonCode { + return &c +} + +type PreviewSchedulingReassignmentRequestOverridesItem string + +const ( + PreviewSchedulingReassignmentRequestOverridesItemAnyHost PreviewSchedulingReassignmentRequestOverridesItem = "any_host" + PreviewSchedulingReassignmentRequestOverridesItemOutOfOffice PreviewSchedulingReassignmentRequestOverridesItem = "out_of_office" + PreviewSchedulingReassignmentRequestOverridesItemOutsideAvailability PreviewSchedulingReassignmentRequestOverridesItem = "outside_availability" + PreviewSchedulingReassignmentRequestOverridesItemHostBusy PreviewSchedulingReassignmentRequestOverridesItem = "host_busy" + PreviewSchedulingReassignmentRequestOverridesItemLimitReached PreviewSchedulingReassignmentRequestOverridesItem = "limit_reached" + PreviewSchedulingReassignmentRequestOverridesItemCalendarUnverified PreviewSchedulingReassignmentRequestOverridesItem = "calendar_unverified" +) + +func NewPreviewSchedulingReassignmentRequestOverridesItemFromString(s string) (PreviewSchedulingReassignmentRequestOverridesItem, error) { + switch s { + case "any_host": + return PreviewSchedulingReassignmentRequestOverridesItemAnyHost, nil + case "out_of_office": + return PreviewSchedulingReassignmentRequestOverridesItemOutOfOffice, nil + case "outside_availability": + return PreviewSchedulingReassignmentRequestOverridesItemOutsideAvailability, nil + case "host_busy": + return PreviewSchedulingReassignmentRequestOverridesItemHostBusy, nil + case "limit_reached": + return PreviewSchedulingReassignmentRequestOverridesItemLimitReached, nil + case "calendar_unverified": + return PreviewSchedulingReassignmentRequestOverridesItemCalendarUnverified, nil + } + var t PreviewSchedulingReassignmentRequestOverridesItem + return "", fmt.Errorf("%s is not a valid %T", s, t) +} + +func (p PreviewSchedulingReassignmentRequestOverridesItem) Ptr() *PreviewSchedulingReassignmentRequestOverridesItem { + return &p +} + +var ( + undoSchedulingReassignmentRequestNotifyFieldAttendees = big.NewInt(1 << 0) + undoSchedulingReassignmentRequestNotifyFieldHosts = big.NewInt(1 << 1) +) + +type UndoSchedulingReassignmentRequestNotify struct { + // Tell attendees. Default: true. + Attendees *bool `json:"attendees,omitempty" url:"attendees,omitempty"` + // `digest` (the default) sends each host one email for the run. + Hosts *UndoSchedulingReassignmentRequestNotifyHosts `json:"hosts,omitempty" url:"hosts,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + + extraProperties map[string]interface{} + rawJSON json.RawMessage +} + +func (u *UndoSchedulingReassignmentRequestNotify) GetAttendees() *bool { + if u == nil { + return nil + } + return u.Attendees +} + +func (u *UndoSchedulingReassignmentRequestNotify) GetHosts() *UndoSchedulingReassignmentRequestNotifyHosts { + if u == nil { + return nil + } + return u.Hosts +} + +func (u *UndoSchedulingReassignmentRequestNotify) GetExtraProperties() map[string]interface{} { + if u == nil { + return nil + } + return u.extraProperties +} + +func (u *UndoSchedulingReassignmentRequestNotify) require(field *big.Int) { + next := new(big.Int) + if u.explicitFields != nil { + next.Set(u.explicitFields) + } + next.Or(next, field) + u.explicitFields = next +} + +// SetAttendees sets the Attendees field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (u *UndoSchedulingReassignmentRequestNotify) SetAttendees(attendees *bool) { + u.Attendees = attendees + u.require(undoSchedulingReassignmentRequestNotifyFieldAttendees) +} + +// SetHosts sets the Hosts field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (u *UndoSchedulingReassignmentRequestNotify) SetHosts(hosts *UndoSchedulingReassignmentRequestNotifyHosts) { + u.Hosts = hosts + u.require(undoSchedulingReassignmentRequestNotifyFieldHosts) +} + +func (u *UndoSchedulingReassignmentRequestNotify) UnmarshalJSON(data []byte) error { + type unmarshaler UndoSchedulingReassignmentRequestNotify + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *u = UndoSchedulingReassignmentRequestNotify(value) + extraProperties, err := internal.ExtractExtraProperties(data, *u) + if err != nil { + return err + } + u.extraProperties = extraProperties + u.rawJSON = json.RawMessage(data) + return nil +} + +func (u *UndoSchedulingReassignmentRequestNotify) MarshalJSON() ([]byte, error) { + type embed UndoSchedulingReassignmentRequestNotify + var marshaler = struct { + embed + }{ + embed: embed(*u), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, u.explicitFields) + return json.Marshal(explicitMarshaler) +} + +func (u *UndoSchedulingReassignmentRequestNotify) String() string { + if u == nil { + return "" + } + if len(u.rawJSON) > 0 { + if value, err := internal.StringifyJSON(u.rawJSON); err == nil { + return value + } + } + if value, err := internal.StringifyJSON(u); err == nil { + return value + } + return fmt.Sprintf("%#v", u) +} + +// `digest` (the default) sends each host one email for the run. +type UndoSchedulingReassignmentRequestNotifyHosts string + +const ( + UndoSchedulingReassignmentRequestNotifyHostsDigest UndoSchedulingReassignmentRequestNotifyHosts = "digest" + UndoSchedulingReassignmentRequestNotifyHostsEach UndoSchedulingReassignmentRequestNotifyHosts = "each" + UndoSchedulingReassignmentRequestNotifyHostsNone UndoSchedulingReassignmentRequestNotifyHosts = "none" +) + +func NewUndoSchedulingReassignmentRequestNotifyHostsFromString(s string) (UndoSchedulingReassignmentRequestNotifyHosts, error) { + switch s { + case "digest": + return UndoSchedulingReassignmentRequestNotifyHostsDigest, nil + case "each": + return UndoSchedulingReassignmentRequestNotifyHostsEach, nil + case "none": + return UndoSchedulingReassignmentRequestNotifyHostsNone, nil + } + var t UndoSchedulingReassignmentRequestNotifyHosts + return "", fmt.Errorf("%s is not a valid %T", s, t) +} + +func (u UndoSchedulingReassignmentRequestNotifyHosts) Ptr() *UndoSchedulingReassignmentRequestNotifyHosts { + return &u +} + +type UndoSchedulingReassignmentRequestOverridesItem string + +const ( + UndoSchedulingReassignmentRequestOverridesItemAnyHost UndoSchedulingReassignmentRequestOverridesItem = "any_host" + UndoSchedulingReassignmentRequestOverridesItemOutOfOffice UndoSchedulingReassignmentRequestOverridesItem = "out_of_office" + UndoSchedulingReassignmentRequestOverridesItemOutsideAvailability UndoSchedulingReassignmentRequestOverridesItem = "outside_availability" + UndoSchedulingReassignmentRequestOverridesItemHostBusy UndoSchedulingReassignmentRequestOverridesItem = "host_busy" + UndoSchedulingReassignmentRequestOverridesItemLimitReached UndoSchedulingReassignmentRequestOverridesItem = "limit_reached" + UndoSchedulingReassignmentRequestOverridesItemCalendarUnverified UndoSchedulingReassignmentRequestOverridesItem = "calendar_unverified" +) + +func NewUndoSchedulingReassignmentRequestOverridesItemFromString(s string) (UndoSchedulingReassignmentRequestOverridesItem, error) { + switch s { + case "any_host": + return UndoSchedulingReassignmentRequestOverridesItemAnyHost, nil + case "out_of_office": + return UndoSchedulingReassignmentRequestOverridesItemOutOfOffice, nil + case "outside_availability": + return UndoSchedulingReassignmentRequestOverridesItemOutsideAvailability, nil + case "host_busy": + return UndoSchedulingReassignmentRequestOverridesItemHostBusy, nil + case "limit_reached": + return UndoSchedulingReassignmentRequestOverridesItemLimitReached, nil + case "calendar_unverified": + return UndoSchedulingReassignmentRequestOverridesItemCalendarUnverified, nil + } + var t UndoSchedulingReassignmentRequestOverridesItem + return "", fmt.Errorf("%s is not a valid %T", s, t) +} + +func (u UndoSchedulingReassignmentRequestOverridesItem) Ptr() *UndoSchedulingReassignmentRequestOverridesItem { + return &u +} + +type UndoSchedulingReassignmentRequestReasonCode string + +const ( + UndoSchedulingReassignmentRequestReasonCodeHostUnavailable UndoSchedulingReassignmentRequestReasonCode = "host_unavailable" + UndoSchedulingReassignmentRequestReasonCodeOutOfOffice UndoSchedulingReassignmentRequestReasonCode = "out_of_office" + UndoSchedulingReassignmentRequestReasonCodeWorkload UndoSchedulingReassignmentRequestReasonCode = "workload" + UndoSchedulingReassignmentRequestReasonCodeCustomerRequest UndoSchedulingReassignmentRequestReasonCode = "customer_request" + UndoSchedulingReassignmentRequestReasonCodeOffboarding UndoSchedulingReassignmentRequestReasonCode = "offboarding" + UndoSchedulingReassignmentRequestReasonCodeOther UndoSchedulingReassignmentRequestReasonCode = "other" +) + +func NewUndoSchedulingReassignmentRequestReasonCodeFromString(s string) (UndoSchedulingReassignmentRequestReasonCode, error) { + switch s { + case "host_unavailable": + return UndoSchedulingReassignmentRequestReasonCodeHostUnavailable, nil + case "out_of_office": + return UndoSchedulingReassignmentRequestReasonCodeOutOfOffice, nil + case "workload": + return UndoSchedulingReassignmentRequestReasonCodeWorkload, nil + case "customer_request": + return UndoSchedulingReassignmentRequestReasonCodeCustomerRequest, nil + case "offboarding": + return UndoSchedulingReassignmentRequestReasonCodeOffboarding, nil + case "other": + return UndoSchedulingReassignmentRequestReasonCodeOther, nil + } + var t UndoSchedulingReassignmentRequestReasonCode + return "", fmt.Errorf("%s is not a valid %T", s, t) +} + +func (u UndoSchedulingReassignmentRequestReasonCode) Ptr() *UndoSchedulingReassignmentRequestReasonCode { + return &u +} + +var ( + undoSchedulingReassignmentRequestFieldID = big.NewInt(1 << 0) + undoSchedulingReassignmentRequestFieldReasonCode = big.NewInt(1 << 1) + undoSchedulingReassignmentRequestFieldNote = big.NewInt(1 << 2) + undoSchedulingReassignmentRequestFieldOverrides = big.NewInt(1 << 3) + undoSchedulingReassignmentRequestFieldNotify = big.NewInt(1 << 4) +) + +type UndoSchedulingReassignmentRequest struct { + // The reassignment's id. + ID string `json:"-" url:"-"` + ReasonCode *UndoSchedulingReassignmentRequestReasonCode `json:"reason_code,omitempty" url:"-"` + Note *string `json:"note,omitempty" url:"-"` + Overrides []UndoSchedulingReassignmentRequestOverridesItem `json:"overrides,omitempty" url:"-"` + Notify *UndoSchedulingReassignmentRequestNotify `json:"notify,omitempty" url:"-"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (u *UndoSchedulingReassignmentRequest) require(field *big.Int) { + next := new(big.Int) + if u.explicitFields != nil { + next.Set(u.explicitFields) + } + next.Or(next, field) + u.explicitFields = next +} + +// SetID sets the ID field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (u *UndoSchedulingReassignmentRequest) SetID(id string) { + u.ID = id + u.require(undoSchedulingReassignmentRequestFieldID) +} + +// SetReasonCode sets the ReasonCode field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (u *UndoSchedulingReassignmentRequest) SetReasonCode(reasonCode *UndoSchedulingReassignmentRequestReasonCode) { + u.ReasonCode = reasonCode + u.require(undoSchedulingReassignmentRequestFieldReasonCode) +} + +// SetNote sets the Note field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (u *UndoSchedulingReassignmentRequest) SetNote(note *string) { + u.Note = note + u.require(undoSchedulingReassignmentRequestFieldNote) +} + +// SetOverrides sets the Overrides field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (u *UndoSchedulingReassignmentRequest) SetOverrides(overrides []UndoSchedulingReassignmentRequestOverridesItem) { + u.Overrides = overrides + u.require(undoSchedulingReassignmentRequestFieldOverrides) +} + +// SetNotify sets the Notify field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (u *UndoSchedulingReassignmentRequest) SetNotify(notify *UndoSchedulingReassignmentRequestNotify) { + u.Notify = notify + u.require(undoSchedulingReassignmentRequestFieldNotify) +} + +func (u *UndoSchedulingReassignmentRequest) UnmarshalJSON(data []byte) error { + type unmarshaler UndoSchedulingReassignmentRequest + var body unmarshaler + if err := json.Unmarshal(data, &body); err != nil { + return err + } + *u = UndoSchedulingReassignmentRequest(body) + return nil +} + +func (u *UndoSchedulingReassignmentRequest) MarshalJSON() ([]byte, error) { + type embed UndoSchedulingReassignmentRequest + var marshaler = struct { + embed + }{ + embed: embed(*u), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, u.explicitFields) + return json.Marshal(explicitMarshaler) +} diff --git a/sdks/go/scheduling/reassignments/client.go b/sdks/go/scheduling/reassignments/client.go new file mode 100644 index 000000000..319fbb445 --- /dev/null +++ b/sdks/go/scheduling/reassignments/client.go @@ -0,0 +1,257 @@ +// Code generated by Fern. DO NOT EDIT. + +package reassignments + +import ( + context "context" + os "os" + + coss "github.com/cosscom/coss-go" + core "github.com/cosscom/coss-go/core" + internal "github.com/cosscom/coss-go/internal" + option "github.com/cosscom/coss-go/option" + scheduling "github.com/cosscom/coss-go/scheduling" +) + +type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions + baseURL string + caller *internal.Caller +} + +func NewClient(options *core.RequestOptions) *Client { + if options.APIKey == "" { + options.APIKey = os.Getenv("COSS_API_KEY") + } + if options.APIVersion == nil { + apiVersionDefault := "2026-10-10" + options.APIVersion = &apiVersionDefault + } + return &Client{ + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + DisableRetries: options.DisableRetries, + }, + ), + } +} + +// Who each booking would go to, and why not when nobody can take it, without moving anything. It works down them in order, so two can't both be promised the same free hour. Change any of it and start the run with `assignments`. Covers the first 500. Things can change before you start it: the run decides again. +// +// Example: +// +// request := &scheduling.PreviewSchedulingReassignmentRequest{ +// Selection: &coss.SchedulingReassignmentSelection{ +// Host: coss.String( +// "doctor_482", +// ), +// StartBefore: coss.String( +// "2027-08-14T00:00:00.000Z", +// ), +// }, +// Strategy: &coss.SchedulingReassignmentStrategy{ +// PreferredHosts: []string{ +// "doctor_518", +// }, +// }, +// } +// client.Scheduling.Reassignments.Preview( +// context.TODO(), +// request, +// ) +func (c *Client) Preview( + ctx context.Context, + request *scheduling.PreviewSchedulingReassignmentRequest, + opts ...option.RequestOption, +) (*coss.SchedulingReassignmentPreview, error) { + response, err := c.WithRawResponse.Preview( + ctx, + request, + opts..., + ) + if err != nil { + return nil, err + } + return response.Body, nil +} + +// Newest first, with how each is going. +// +// Example: +// +// request := &scheduling.ListReassignmentsRequest{} +// client.Scheduling.Reassignments.List( +// context.TODO(), +// request, +// ) +func (c *Client) List( + ctx context.Context, + request *scheduling.ListReassignmentsRequest, + opts ...option.RequestOption, +) (*coss.SchedulingReassignmentList, error) { + response, err := c.WithRawResponse.List( + ctx, + request, + opts..., + ) + if err != nil { + return nil, err + } + return response.Body, nil +} + +// Moves up to 5,000 bookings in the background, each on its own, so one that can't move never holds up the rest. Nothing's ever cancelled: a booking nobody can take stays where it is, and its item says so. It answers at once: follow the run by its id, or wait for `scheduling.reassignment.completed`. +// +// Example: +// +// request := &scheduling.CreateSchedulingReassignmentRequest{ +// IdempotencyKey: coss.String( +// "welcome-user-123", +// ), +// Selection: &coss.SchedulingReassignmentSelection{ +// OutOfOffice: coss.String( +// "ooo_01kd2m9a0b1c2d3e4f5g6h7j8m", +// ), +// }, +// Strategy: &coss.SchedulingReassignmentStrategy{ +// PreferredHosts: []string{ +// "doctor_518", +// }, +// }, +// ReasonCode: scheduling.CreateSchedulingReassignmentRequestReasonCodeOutOfOffice, +// } +// client.Scheduling.Reassignments.Create( +// context.TODO(), +// request, +// ) +func (c *Client) Create( + ctx context.Context, + request *scheduling.CreateSchedulingReassignmentRequest, + opts ...option.RequestOption, +) (*coss.SchedulingReassignment, error) { + response, err := c.WithRawResponse.Create( + ctx, + request, + opts..., + ) + if err != nil { + return nil, err + } + return response.Body, nil +} + +// How it's going. +// +// Example: +// +// request := &scheduling.GetReassignmentsRequest{ +// ID: "id", +// } +// client.Scheduling.Reassignments.Get( +// context.TODO(), +// request, +// ) +func (c *Client) Get( + ctx context.Context, + request *scheduling.GetReassignmentsRequest, + opts ...option.RequestOption, +) (*coss.SchedulingReassignment, error) { + response, err := c.WithRawResponse.Get( + ctx, + request, + opts..., + ) + if err != nil { + return nil, err + } + return response.Body, nil +} + +// Each booking it covers and what happened to it. A group session has one, for one of its seats. Empty until the worker's started on it. +// +// Example: +// +// request := &scheduling.ItemsReassignmentsRequest{ +// ID: "id", +// } +// client.Scheduling.Reassignments.Items( +// context.TODO(), +// request, +// ) +func (c *Client) Items( + ctx context.Context, + request *scheduling.ItemsReassignmentsRequest, + opts ...option.RequestOption, +) (*coss.SchedulingReassignmentItemList, error) { + response, err := c.WithRawResponse.Items( + ctx, + request, + opts..., + ) + if err != nil { + return nil, err + } + return response.Body, nil +} + +// Stops what hasn't happened yet. What's moved stays moved: undo it for that. Cancelling one that's finished changes nothing. +// +// Example: +// +// request := &scheduling.CancelReassignmentsRequest{ +// ID: "id", +// } +// client.Scheduling.Reassignments.Cancel( +// context.TODO(), +// request, +// ) +func (c *Client) Cancel( + ctx context.Context, + request *scheduling.CancelReassignmentsRequest, + opts ...option.RequestOption, +) (*coss.SchedulingReassignment, error) { + response, err := c.WithRawResponse.Cancel( + ctx, + request, + opts..., + ) + if err != nil { + return nil, err + } + return response.Body, nil +} + +// Gives back what a finished run moved, as a new run. A booking that's moved on since stays where it went, and a former host who's no longer free keeps it from going back, unless you pass `overrides`. +// +// Example: +// +// request := &scheduling.UndoSchedulingReassignmentRequest{ +// ID: "id", +// ReasonCode: scheduling.UndoSchedulingReassignmentRequestReasonCodeOther.Ptr(), +// } +// client.Scheduling.Reassignments.Undo( +// context.TODO(), +// request, +// ) +func (c *Client) Undo( + ctx context.Context, + request *scheduling.UndoSchedulingReassignmentRequest, + opts ...option.RequestOption, +) (*coss.SchedulingReassignment, error) { + response, err := c.WithRawResponse.Undo( + ctx, + request, + opts..., + ) + if err != nil { + return nil, err + } + return response.Body, nil +} diff --git a/sdks/go/scheduling/reassignments/raw_client.go b/sdks/go/scheduling/reassignments/raw_client.go new file mode 100644 index 000000000..28bc5f420 --- /dev/null +++ b/sdks/go/scheduling/reassignments/raw_client.go @@ -0,0 +1,371 @@ +// Code generated by Fern. DO NOT EDIT. + +package reassignments + +import ( + context "context" + http "net/http" + + coss "github.com/cosscom/coss-go" + core "github.com/cosscom/coss-go/core" + internal "github.com/cosscom/coss-go/internal" + option "github.com/cosscom/coss-go/option" + scheduling "github.com/cosscom/coss-go/scheduling" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + DisableRetries: options.DisableRetries, + }, + ), + } +} + +func (r *RawClient) Preview( + ctx context.Context, + request *scheduling.PreviewSchedulingReassignmentRequest, + opts ...option.RequestOption, +) (*core.Response[*coss.SchedulingReassignmentPreview], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "https://api.coss.com", + ) + endpointURL := baseURL + "/v1/scheduling/reassignments/preview" + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + headers.Add("Content-Type", "application/json") + core.SetIdempotencyKeyHeader(headers) + + var response *coss.SchedulingReassignmentPreview + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodPost, + Headers: headers, + MaxAttempts: options.MaxAttempts, + DisableRetries: options.DisableRetries, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Request: request, + Response: &response, + ErrorDecoder: internal.NewErrorDecoder(scheduling.ErrorCodes), + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*coss.SchedulingReassignmentPreview]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} + +func (r *RawClient) List( + ctx context.Context, + request *scheduling.ListReassignmentsRequest, + opts ...option.RequestOption, +) (*core.Response[*coss.SchedulingReassignmentList], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "https://api.coss.com", + ) + endpointURL := baseURL + "/v1/scheduling/reassignments" + queryParams, err := internal.QueryValues(request) + if err != nil { + return nil, err + } + if len(queryParams) > 0 { + endpointURL += "?" + queryParams.Encode() + } + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *coss.SchedulingReassignmentList + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + DisableRetries: options.DisableRetries, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + ErrorDecoder: internal.NewErrorDecoder(scheduling.ErrorCodes), + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*coss.SchedulingReassignmentList]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} + +func (r *RawClient) Create( + ctx context.Context, + request *scheduling.CreateSchedulingReassignmentRequest, + opts ...option.RequestOption, +) (*core.Response[*coss.SchedulingReassignment], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "https://api.coss.com", + ) + endpointURL := baseURL + "/v1/scheduling/reassignments" + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + if request.IdempotencyKey != nil { + headers.Add("Idempotency-Key", *request.IdempotencyKey) + } + headers.Add("Content-Type", "application/json") + core.SetIdempotencyKeyHeader(headers) + + var response *coss.SchedulingReassignment + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodPost, + Headers: headers, + MaxAttempts: options.MaxAttempts, + DisableRetries: options.DisableRetries, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Request: request, + Response: &response, + ErrorDecoder: internal.NewErrorDecoder(scheduling.ErrorCodes), + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*coss.SchedulingReassignment]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} + +func (r *RawClient) Get( + ctx context.Context, + request *scheduling.GetReassignmentsRequest, + opts ...option.RequestOption, +) (*core.Response[*coss.SchedulingReassignment], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "https://api.coss.com", + ) + endpointURL := internal.EncodeURL( + baseURL+"/v1/scheduling/reassignments/%v", + request.ID, + ) + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *coss.SchedulingReassignment + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + DisableRetries: options.DisableRetries, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + ErrorDecoder: internal.NewErrorDecoder(scheduling.ErrorCodes), + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*coss.SchedulingReassignment]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} + +func (r *RawClient) Items( + ctx context.Context, + request *scheduling.ItemsReassignmentsRequest, + opts ...option.RequestOption, +) (*core.Response[*coss.SchedulingReassignmentItemList], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "https://api.coss.com", + ) + endpointURL := internal.EncodeURL( + baseURL+"/v1/scheduling/reassignments/%v/items", + request.ID, + ) + queryParams, err := internal.QueryValues(request) + if err != nil { + return nil, err + } + if len(queryParams) > 0 { + endpointURL += "?" + queryParams.Encode() + } + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *coss.SchedulingReassignmentItemList + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + DisableRetries: options.DisableRetries, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + ErrorDecoder: internal.NewErrorDecoder(scheduling.ErrorCodes), + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*coss.SchedulingReassignmentItemList]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} + +func (r *RawClient) Cancel( + ctx context.Context, + request *scheduling.CancelReassignmentsRequest, + opts ...option.RequestOption, +) (*core.Response[*coss.SchedulingReassignment], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "https://api.coss.com", + ) + endpointURL := internal.EncodeURL( + baseURL+"/v1/scheduling/reassignments/%v/cancel", + request.ID, + ) + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + core.SetIdempotencyKeyHeader(headers) + + var response *coss.SchedulingReassignment + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodPost, + Headers: headers, + MaxAttempts: options.MaxAttempts, + DisableRetries: options.DisableRetries, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + ErrorDecoder: internal.NewErrorDecoder(scheduling.ErrorCodes), + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*coss.SchedulingReassignment]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} + +func (r *RawClient) Undo( + ctx context.Context, + request *scheduling.UndoSchedulingReassignmentRequest, + opts ...option.RequestOption, +) (*core.Response[*coss.SchedulingReassignment], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "https://api.coss.com", + ) + endpointURL := internal.EncodeURL( + baseURL+"/v1/scheduling/reassignments/%v/undo", + request.ID, + ) + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + headers.Add("Content-Type", "application/json") + core.SetIdempotencyKeyHeader(headers) + + var response *coss.SchedulingReassignment + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodPost, + Headers: headers, + MaxAttempts: options.MaxAttempts, + DisableRetries: true, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Request: request, + Response: &response, + ErrorDecoder: internal.NewErrorDecoder(scheduling.ErrorCodes), + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*coss.SchedulingReassignment]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} diff --git a/sdks/go/scheduling/reassignments_test.go b/sdks/go/scheduling/reassignments_test.go new file mode 100644 index 000000000..b67783941 --- /dev/null +++ b/sdks/go/scheduling/reassignments_test.go @@ -0,0 +1,1718 @@ +// Code generated by Fern. DO NOT EDIT. + +package scheduling + +import ( + json "encoding/json" + cossgo "github.com/cosscom/coss-go" + assert "github.com/stretchr/testify/assert" + require "github.com/stretchr/testify/require" + testing "testing" +) + +func TestSettersCancelReassignmentsRequest(t *testing.T) { + t.Run("SetID", func(t *testing.T) { + obj := &CancelReassignmentsRequest{} + var fernTestValueID string + obj.SetID(fernTestValueID) + assert.Equal(t, fernTestValueID, obj.ID) + assert.NotNil(t, obj.explicitFields) + }) + +} + +func TestSettersMarkExplicitCancelReassignmentsRequest(t *testing.T) { + t.Run("SetID_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &CancelReassignmentsRequest{} + var fernTestValueID string + + // Act + obj.SetID(fernTestValueID) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + +} + +func TestSettersCreateSchedulingReassignmentRequest(t *testing.T) { + t.Run("SetIdempotencyKey", func(t *testing.T) { + obj := &CreateSchedulingReassignmentRequest{} + var fernTestValueIdempotencyKey *string + obj.SetIdempotencyKey(fernTestValueIdempotencyKey) + assert.Equal(t, fernTestValueIdempotencyKey, obj.IdempotencyKey) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetSelection", func(t *testing.T) { + obj := &CreateSchedulingReassignmentRequest{} + var fernTestValueSelection *cossgo.SchedulingReassignmentSelection + obj.SetSelection(fernTestValueSelection) + assert.Equal(t, fernTestValueSelection, obj.Selection) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetStrategy", func(t *testing.T) { + obj := &CreateSchedulingReassignmentRequest{} + var fernTestValueStrategy *cossgo.SchedulingReassignmentStrategy + obj.SetStrategy(fernTestValueStrategy) + assert.Equal(t, fernTestValueStrategy, obj.Strategy) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetReasonCode", func(t *testing.T) { + obj := &CreateSchedulingReassignmentRequest{} + var fernTestValueReasonCode CreateSchedulingReassignmentRequestReasonCode + obj.SetReasonCode(fernTestValueReasonCode) + assert.Equal(t, fernTestValueReasonCode, obj.ReasonCode) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetNote", func(t *testing.T) { + obj := &CreateSchedulingReassignmentRequest{} + var fernTestValueNote *string + obj.SetNote(fernTestValueNote) + assert.Equal(t, fernTestValueNote, obj.Note) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetOverrides", func(t *testing.T) { + obj := &CreateSchedulingReassignmentRequest{} + var fernTestValueOverrides []CreateSchedulingReassignmentRequestOverridesItem + obj.SetOverrides(fernTestValueOverrides) + assert.Equal(t, fernTestValueOverrides, obj.Overrides) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetNotify", func(t *testing.T) { + obj := &CreateSchedulingReassignmentRequest{} + var fernTestValueNotify *CreateSchedulingReassignmentRequestNotify + obj.SetNotify(fernTestValueNotify) + assert.Equal(t, fernTestValueNotify, obj.Notify) + assert.NotNil(t, obj.explicitFields) + }) + +} + +func TestSettersMarkExplicitCreateSchedulingReassignmentRequest(t *testing.T) { + t.Run("SetIdempotencyKey_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &CreateSchedulingReassignmentRequest{} + var fernTestValueIdempotencyKey *string + + // Act + obj.SetIdempotencyKey(fernTestValueIdempotencyKey) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetSelection_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &CreateSchedulingReassignmentRequest{} + var fernTestValueSelection *cossgo.SchedulingReassignmentSelection + + // Act + obj.SetSelection(fernTestValueSelection) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetStrategy_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &CreateSchedulingReassignmentRequest{} + var fernTestValueStrategy *cossgo.SchedulingReassignmentStrategy + + // Act + obj.SetStrategy(fernTestValueStrategy) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetReasonCode_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &CreateSchedulingReassignmentRequest{} + var fernTestValueReasonCode CreateSchedulingReassignmentRequestReasonCode + + // Act + obj.SetReasonCode(fernTestValueReasonCode) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetNote_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &CreateSchedulingReassignmentRequest{} + var fernTestValueNote *string + + // Act + obj.SetNote(fernTestValueNote) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetOverrides_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &CreateSchedulingReassignmentRequest{} + var fernTestValueOverrides []CreateSchedulingReassignmentRequestOverridesItem + + // Act + obj.SetOverrides(fernTestValueOverrides) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetNotify_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &CreateSchedulingReassignmentRequest{} + var fernTestValueNotify *CreateSchedulingReassignmentRequestNotify + + // Act + obj.SetNotify(fernTestValueNotify) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + +} + +func TestSettersGetReassignmentsRequest(t *testing.T) { + t.Run("SetID", func(t *testing.T) { + obj := &GetReassignmentsRequest{} + var fernTestValueID string + obj.SetID(fernTestValueID) + assert.Equal(t, fernTestValueID, obj.ID) + assert.NotNil(t, obj.explicitFields) + }) + +} + +func TestSettersMarkExplicitGetReassignmentsRequest(t *testing.T) { + t.Run("SetID_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &GetReassignmentsRequest{} + var fernTestValueID string + + // Act + obj.SetID(fernTestValueID) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + +} + +func TestSettersItemsReassignmentsRequest(t *testing.T) { + t.Run("SetID", func(t *testing.T) { + obj := &ItemsReassignmentsRequest{} + var fernTestValueID string + obj.SetID(fernTestValueID) + assert.Equal(t, fernTestValueID, obj.ID) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetLimit", func(t *testing.T) { + obj := &ItemsReassignmentsRequest{} + var fernTestValueLimit *int + obj.SetLimit(fernTestValueLimit) + assert.Equal(t, fernTestValueLimit, obj.Limit) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetAfter", func(t *testing.T) { + obj := &ItemsReassignmentsRequest{} + var fernTestValueAfter *string + obj.SetAfter(fernTestValueAfter) + assert.Equal(t, fernTestValueAfter, obj.After) + assert.NotNil(t, obj.explicitFields) + }) + +} + +func TestSettersMarkExplicitItemsReassignmentsRequest(t *testing.T) { + t.Run("SetID_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &ItemsReassignmentsRequest{} + var fernTestValueID string + + // Act + obj.SetID(fernTestValueID) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetLimit_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &ItemsReassignmentsRequest{} + var fernTestValueLimit *int + + // Act + obj.SetLimit(fernTestValueLimit) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetAfter_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &ItemsReassignmentsRequest{} + var fernTestValueAfter *string + + // Act + obj.SetAfter(fernTestValueAfter) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + +} + +func TestSettersListReassignmentsRequest(t *testing.T) { + t.Run("SetLimit", func(t *testing.T) { + obj := &ListReassignmentsRequest{} + var fernTestValueLimit *int + obj.SetLimit(fernTestValueLimit) + assert.Equal(t, fernTestValueLimit, obj.Limit) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetAfter", func(t *testing.T) { + obj := &ListReassignmentsRequest{} + var fernTestValueAfter *string + obj.SetAfter(fernTestValueAfter) + assert.Equal(t, fernTestValueAfter, obj.After) + assert.NotNil(t, obj.explicitFields) + }) + +} + +func TestSettersMarkExplicitListReassignmentsRequest(t *testing.T) { + t.Run("SetLimit_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &ListReassignmentsRequest{} + var fernTestValueLimit *int + + // Act + obj.SetLimit(fernTestValueLimit) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetAfter_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &ListReassignmentsRequest{} + var fernTestValueAfter *string + + // Act + obj.SetAfter(fernTestValueAfter) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + +} + +func TestSettersPreviewSchedulingReassignmentRequest(t *testing.T) { + t.Run("SetSelection", func(t *testing.T) { + obj := &PreviewSchedulingReassignmentRequest{} + var fernTestValueSelection *cossgo.SchedulingReassignmentSelection + obj.SetSelection(fernTestValueSelection) + assert.Equal(t, fernTestValueSelection, obj.Selection) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetStrategy", func(t *testing.T) { + obj := &PreviewSchedulingReassignmentRequest{} + var fernTestValueStrategy *cossgo.SchedulingReassignmentStrategy + obj.SetStrategy(fernTestValueStrategy) + assert.Equal(t, fernTestValueStrategy, obj.Strategy) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetOverrides", func(t *testing.T) { + obj := &PreviewSchedulingReassignmentRequest{} + var fernTestValueOverrides []PreviewSchedulingReassignmentRequestOverridesItem + obj.SetOverrides(fernTestValueOverrides) + assert.Equal(t, fernTestValueOverrides, obj.Overrides) + assert.NotNil(t, obj.explicitFields) + }) + +} + +func TestSettersMarkExplicitPreviewSchedulingReassignmentRequest(t *testing.T) { + t.Run("SetSelection_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &PreviewSchedulingReassignmentRequest{} + var fernTestValueSelection *cossgo.SchedulingReassignmentSelection + + // Act + obj.SetSelection(fernTestValueSelection) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetStrategy_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &PreviewSchedulingReassignmentRequest{} + var fernTestValueStrategy *cossgo.SchedulingReassignmentStrategy + + // Act + obj.SetStrategy(fernTestValueStrategy) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetOverrides_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &PreviewSchedulingReassignmentRequest{} + var fernTestValueOverrides []PreviewSchedulingReassignmentRequestOverridesItem + + // Act + obj.SetOverrides(fernTestValueOverrides) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + +} + +func TestSettersCreateSchedulingReassignmentRequestNotify(t *testing.T) { + t.Run("SetAttendees", func(t *testing.T) { + obj := &CreateSchedulingReassignmentRequestNotify{} + var fernTestValueAttendees *bool + obj.SetAttendees(fernTestValueAttendees) + assert.Equal(t, fernTestValueAttendees, obj.Attendees) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetHosts", func(t *testing.T) { + obj := &CreateSchedulingReassignmentRequestNotify{} + var fernTestValueHosts *CreateSchedulingReassignmentRequestNotifyHosts + obj.SetHosts(fernTestValueHosts) + assert.Equal(t, fernTestValueHosts, obj.Hosts) + assert.NotNil(t, obj.explicitFields) + }) + +} + +func TestGettersCreateSchedulingReassignmentRequestNotify(t *testing.T) { + t.Run("GetAttendees", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &CreateSchedulingReassignmentRequestNotify{} + var expected *bool + obj.Attendees = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetAttendees(), "getter should return the property value") + }) + + t.Run("GetAttendees_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &CreateSchedulingReassignmentRequestNotify{} + obj.Attendees = nil + + // Act & Assert + assert.Nil(t, obj.GetAttendees(), "getter should return nil when property is nil") + }) + + t.Run("GetAttendees_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *CreateSchedulingReassignmentRequestNotify + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetAttendees() // Should return zero value + }) + + t.Run("GetHosts", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &CreateSchedulingReassignmentRequestNotify{} + var expected *CreateSchedulingReassignmentRequestNotifyHosts + obj.Hosts = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetHosts(), "getter should return the property value") + }) + + t.Run("GetHosts_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &CreateSchedulingReassignmentRequestNotify{} + obj.Hosts = nil + + // Act & Assert + assert.Nil(t, obj.GetHosts(), "getter should return nil when property is nil") + }) + + t.Run("GetHosts_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *CreateSchedulingReassignmentRequestNotify + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetHosts() // Should return zero value + }) + +} + +func TestSettersMarkExplicitCreateSchedulingReassignmentRequestNotify(t *testing.T) { + t.Run("SetAttendees_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &CreateSchedulingReassignmentRequestNotify{} + var fernTestValueAttendees *bool + + // Act + obj.SetAttendees(fernTestValueAttendees) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetHosts_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &CreateSchedulingReassignmentRequestNotify{} + var fernTestValueHosts *CreateSchedulingReassignmentRequestNotifyHosts + + // Act + obj.SetHosts(fernTestValueHosts) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + +} + +func TestSettersUndoSchedulingReassignmentRequestNotify(t *testing.T) { + t.Run("SetAttendees", func(t *testing.T) { + obj := &UndoSchedulingReassignmentRequestNotify{} + var fernTestValueAttendees *bool + obj.SetAttendees(fernTestValueAttendees) + assert.Equal(t, fernTestValueAttendees, obj.Attendees) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetHosts", func(t *testing.T) { + obj := &UndoSchedulingReassignmentRequestNotify{} + var fernTestValueHosts *UndoSchedulingReassignmentRequestNotifyHosts + obj.SetHosts(fernTestValueHosts) + assert.Equal(t, fernTestValueHosts, obj.Hosts) + assert.NotNil(t, obj.explicitFields) + }) + +} + +func TestGettersUndoSchedulingReassignmentRequestNotify(t *testing.T) { + t.Run("GetAttendees", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &UndoSchedulingReassignmentRequestNotify{} + var expected *bool + obj.Attendees = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetAttendees(), "getter should return the property value") + }) + + t.Run("GetAttendees_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &UndoSchedulingReassignmentRequestNotify{} + obj.Attendees = nil + + // Act & Assert + assert.Nil(t, obj.GetAttendees(), "getter should return nil when property is nil") + }) + + t.Run("GetAttendees_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *UndoSchedulingReassignmentRequestNotify + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetAttendees() // Should return zero value + }) + + t.Run("GetHosts", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &UndoSchedulingReassignmentRequestNotify{} + var expected *UndoSchedulingReassignmentRequestNotifyHosts + obj.Hosts = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetHosts(), "getter should return the property value") + }) + + t.Run("GetHosts_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &UndoSchedulingReassignmentRequestNotify{} + obj.Hosts = nil + + // Act & Assert + assert.Nil(t, obj.GetHosts(), "getter should return nil when property is nil") + }) + + t.Run("GetHosts_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *UndoSchedulingReassignmentRequestNotify + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetHosts() // Should return zero value + }) + +} + +func TestSettersMarkExplicitUndoSchedulingReassignmentRequestNotify(t *testing.T) { + t.Run("SetAttendees_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &UndoSchedulingReassignmentRequestNotify{} + var fernTestValueAttendees *bool + + // Act + obj.SetAttendees(fernTestValueAttendees) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetHosts_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &UndoSchedulingReassignmentRequestNotify{} + var fernTestValueHosts *UndoSchedulingReassignmentRequestNotifyHosts + + // Act + obj.SetHosts(fernTestValueHosts) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + +} + +func TestSettersUndoSchedulingReassignmentRequest(t *testing.T) { + t.Run("SetID", func(t *testing.T) { + obj := &UndoSchedulingReassignmentRequest{} + var fernTestValueID string + obj.SetID(fernTestValueID) + assert.Equal(t, fernTestValueID, obj.ID) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetReasonCode", func(t *testing.T) { + obj := &UndoSchedulingReassignmentRequest{} + var fernTestValueReasonCode *UndoSchedulingReassignmentRequestReasonCode + obj.SetReasonCode(fernTestValueReasonCode) + assert.Equal(t, fernTestValueReasonCode, obj.ReasonCode) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetNote", func(t *testing.T) { + obj := &UndoSchedulingReassignmentRequest{} + var fernTestValueNote *string + obj.SetNote(fernTestValueNote) + assert.Equal(t, fernTestValueNote, obj.Note) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetOverrides", func(t *testing.T) { + obj := &UndoSchedulingReassignmentRequest{} + var fernTestValueOverrides []UndoSchedulingReassignmentRequestOverridesItem + obj.SetOverrides(fernTestValueOverrides) + assert.Equal(t, fernTestValueOverrides, obj.Overrides) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetNotify", func(t *testing.T) { + obj := &UndoSchedulingReassignmentRequest{} + var fernTestValueNotify *UndoSchedulingReassignmentRequestNotify + obj.SetNotify(fernTestValueNotify) + assert.Equal(t, fernTestValueNotify, obj.Notify) + assert.NotNil(t, obj.explicitFields) + }) + +} + +func TestSettersMarkExplicitUndoSchedulingReassignmentRequest(t *testing.T) { + t.Run("SetID_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &UndoSchedulingReassignmentRequest{} + var fernTestValueID string + + // Act + obj.SetID(fernTestValueID) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetReasonCode_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &UndoSchedulingReassignmentRequest{} + var fernTestValueReasonCode *UndoSchedulingReassignmentRequestReasonCode + + // Act + obj.SetReasonCode(fernTestValueReasonCode) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetNote_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &UndoSchedulingReassignmentRequest{} + var fernTestValueNote *string + + // Act + obj.SetNote(fernTestValueNote) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetOverrides_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &UndoSchedulingReassignmentRequest{} + var fernTestValueOverrides []UndoSchedulingReassignmentRequestOverridesItem + + // Act + obj.SetOverrides(fernTestValueOverrides) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetNotify_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &UndoSchedulingReassignmentRequest{} + var fernTestValueNotify *UndoSchedulingReassignmentRequestNotify + + // Act + obj.SetNotify(fernTestValueNotify) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + +} + +func TestJSONMarshalingCreateSchedulingReassignmentRequestNotify(t *testing.T) { + t.Run("MarshalUnmarshal", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &CreateSchedulingReassignmentRequestNotify{} + + // Act - Marshal to JSON + data, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed") + assert.NotNil(t, data, "marshaled data should not be nil") + assert.NotEmpty(t, data, "marshaled data should not be empty") + + // Unmarshal back and verify round-trip + var unmarshaled CreateSchedulingReassignmentRequestNotify + err = json.Unmarshal(data, &unmarshaled) + assert.NoError(t, err, "round-trip unmarshal should succeed") + }) + + t.Run("UnmarshalInvalidJSON", func(t *testing.T) { + t.Parallel() + var obj CreateSchedulingReassignmentRequestNotify + err := json.Unmarshal([]byte(`{invalid json}`), &obj) + assert.Error(t, err, "unmarshaling invalid JSON should return an error") + }) + + t.Run("UnmarshalEmptyObject", func(t *testing.T) { + t.Parallel() + var obj CreateSchedulingReassignmentRequestNotify + err := json.Unmarshal([]byte(`{}`), &obj) + assert.NoError(t, err, "unmarshaling empty object should succeed") + }) +} + +func TestJSONMarshalingUndoSchedulingReassignmentRequestNotify(t *testing.T) { + t.Run("MarshalUnmarshal", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &UndoSchedulingReassignmentRequestNotify{} + + // Act - Marshal to JSON + data, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed") + assert.NotNil(t, data, "marshaled data should not be nil") + assert.NotEmpty(t, data, "marshaled data should not be empty") + + // Unmarshal back and verify round-trip + var unmarshaled UndoSchedulingReassignmentRequestNotify + err = json.Unmarshal(data, &unmarshaled) + assert.NoError(t, err, "round-trip unmarshal should succeed") + }) + + t.Run("UnmarshalInvalidJSON", func(t *testing.T) { + t.Parallel() + var obj UndoSchedulingReassignmentRequestNotify + err := json.Unmarshal([]byte(`{invalid json}`), &obj) + assert.Error(t, err, "unmarshaling invalid JSON should return an error") + }) + + t.Run("UnmarshalEmptyObject", func(t *testing.T) { + t.Parallel() + var obj UndoSchedulingReassignmentRequestNotify + err := json.Unmarshal([]byte(`{}`), &obj) + assert.NoError(t, err, "unmarshaling empty object should succeed") + }) +} + +func TestStringCreateSchedulingReassignmentRequestNotify(t *testing.T) { + t.Run("StringMethod", func(t *testing.T) { + t.Parallel() + obj := &CreateSchedulingReassignmentRequestNotify{} + result := obj.String() + assert.NotEmpty(t, result, "String() should return a non-empty representation") + }) + + t.Run("StringMethod_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *CreateSchedulingReassignmentRequestNotify + result := obj.String() + assert.Equal(t, "", result, "String() should return for nil receiver") + }) +} + +func TestStringUndoSchedulingReassignmentRequestNotify(t *testing.T) { + t.Run("StringMethod", func(t *testing.T) { + t.Parallel() + obj := &UndoSchedulingReassignmentRequestNotify{} + result := obj.String() + assert.NotEmpty(t, result, "String() should return a non-empty representation") + }) + + t.Run("StringMethod_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *UndoSchedulingReassignmentRequestNotify + result := obj.String() + assert.Equal(t, "", result, "String() should return for nil receiver") + }) +} + +func TestEnumCreateSchedulingReassignmentRequestNotifyHosts(t *testing.T) { + t.Run("NewFromString_digest", func(t *testing.T) { + t.Parallel() + val, err := NewCreateSchedulingReassignmentRequestNotifyHostsFromString("digest") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, CreateSchedulingReassignmentRequestNotifyHosts("digest"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_each", func(t *testing.T) { + t.Parallel() + val, err := NewCreateSchedulingReassignmentRequestNotifyHostsFromString("each") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, CreateSchedulingReassignmentRequestNotifyHosts("each"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_none", func(t *testing.T) { + t.Parallel() + val, err := NewCreateSchedulingReassignmentRequestNotifyHostsFromString("none") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, CreateSchedulingReassignmentRequestNotifyHosts("none"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_Invalid", func(t *testing.T) { + _, err := NewCreateSchedulingReassignmentRequestNotifyHostsFromString("invalid_value_that_does_not_exist") + assert.Error(t, err) + }) + + t.Run("Ptr", func(t *testing.T) { + val, err := NewCreateSchedulingReassignmentRequestNotifyHostsFromString("digest") + assert.NoError(t, err) + ptr := val.Ptr() + assert.NotNil(t, ptr) + assert.Equal(t, val, *ptr) + }) +} + +func TestEnumCreateSchedulingReassignmentRequestOverridesItem(t *testing.T) { + t.Run("NewFromString_any_host", func(t *testing.T) { + t.Parallel() + val, err := NewCreateSchedulingReassignmentRequestOverridesItemFromString("any_host") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, CreateSchedulingReassignmentRequestOverridesItem("any_host"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_out_of_office", func(t *testing.T) { + t.Parallel() + val, err := NewCreateSchedulingReassignmentRequestOverridesItemFromString("out_of_office") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, CreateSchedulingReassignmentRequestOverridesItem("out_of_office"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_outside_availability", func(t *testing.T) { + t.Parallel() + val, err := NewCreateSchedulingReassignmentRequestOverridesItemFromString("outside_availability") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, CreateSchedulingReassignmentRequestOverridesItem("outside_availability"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_host_busy", func(t *testing.T) { + t.Parallel() + val, err := NewCreateSchedulingReassignmentRequestOverridesItemFromString("host_busy") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, CreateSchedulingReassignmentRequestOverridesItem("host_busy"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_limit_reached", func(t *testing.T) { + t.Parallel() + val, err := NewCreateSchedulingReassignmentRequestOverridesItemFromString("limit_reached") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, CreateSchedulingReassignmentRequestOverridesItem("limit_reached"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_calendar_unverified", func(t *testing.T) { + t.Parallel() + val, err := NewCreateSchedulingReassignmentRequestOverridesItemFromString("calendar_unverified") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, CreateSchedulingReassignmentRequestOverridesItem("calendar_unverified"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_Invalid", func(t *testing.T) { + _, err := NewCreateSchedulingReassignmentRequestOverridesItemFromString("invalid_value_that_does_not_exist") + assert.Error(t, err) + }) + + t.Run("Ptr", func(t *testing.T) { + val, err := NewCreateSchedulingReassignmentRequestOverridesItemFromString("any_host") + assert.NoError(t, err) + ptr := val.Ptr() + assert.NotNil(t, ptr) + assert.Equal(t, val, *ptr) + }) +} + +func TestEnumCreateSchedulingReassignmentRequestReasonCode(t *testing.T) { + t.Run("NewFromString_host_unavailable", func(t *testing.T) { + t.Parallel() + val, err := NewCreateSchedulingReassignmentRequestReasonCodeFromString("host_unavailable") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, CreateSchedulingReassignmentRequestReasonCode("host_unavailable"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_out_of_office", func(t *testing.T) { + t.Parallel() + val, err := NewCreateSchedulingReassignmentRequestReasonCodeFromString("out_of_office") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, CreateSchedulingReassignmentRequestReasonCode("out_of_office"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_workload", func(t *testing.T) { + t.Parallel() + val, err := NewCreateSchedulingReassignmentRequestReasonCodeFromString("workload") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, CreateSchedulingReassignmentRequestReasonCode("workload"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_customer_request", func(t *testing.T) { + t.Parallel() + val, err := NewCreateSchedulingReassignmentRequestReasonCodeFromString("customer_request") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, CreateSchedulingReassignmentRequestReasonCode("customer_request"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_offboarding", func(t *testing.T) { + t.Parallel() + val, err := NewCreateSchedulingReassignmentRequestReasonCodeFromString("offboarding") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, CreateSchedulingReassignmentRequestReasonCode("offboarding"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_other", func(t *testing.T) { + t.Parallel() + val, err := NewCreateSchedulingReassignmentRequestReasonCodeFromString("other") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, CreateSchedulingReassignmentRequestReasonCode("other"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_Invalid", func(t *testing.T) { + _, err := NewCreateSchedulingReassignmentRequestReasonCodeFromString("invalid_value_that_does_not_exist") + assert.Error(t, err) + }) + + t.Run("Ptr", func(t *testing.T) { + val, err := NewCreateSchedulingReassignmentRequestReasonCodeFromString("host_unavailable") + assert.NoError(t, err) + ptr := val.Ptr() + assert.NotNil(t, ptr) + assert.Equal(t, val, *ptr) + }) +} + +func TestEnumPreviewSchedulingReassignmentRequestOverridesItem(t *testing.T) { + t.Run("NewFromString_any_host", func(t *testing.T) { + t.Parallel() + val, err := NewPreviewSchedulingReassignmentRequestOverridesItemFromString("any_host") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, PreviewSchedulingReassignmentRequestOverridesItem("any_host"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_out_of_office", func(t *testing.T) { + t.Parallel() + val, err := NewPreviewSchedulingReassignmentRequestOverridesItemFromString("out_of_office") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, PreviewSchedulingReassignmentRequestOverridesItem("out_of_office"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_outside_availability", func(t *testing.T) { + t.Parallel() + val, err := NewPreviewSchedulingReassignmentRequestOverridesItemFromString("outside_availability") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, PreviewSchedulingReassignmentRequestOverridesItem("outside_availability"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_host_busy", func(t *testing.T) { + t.Parallel() + val, err := NewPreviewSchedulingReassignmentRequestOverridesItemFromString("host_busy") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, PreviewSchedulingReassignmentRequestOverridesItem("host_busy"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_limit_reached", func(t *testing.T) { + t.Parallel() + val, err := NewPreviewSchedulingReassignmentRequestOverridesItemFromString("limit_reached") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, PreviewSchedulingReassignmentRequestOverridesItem("limit_reached"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_calendar_unverified", func(t *testing.T) { + t.Parallel() + val, err := NewPreviewSchedulingReassignmentRequestOverridesItemFromString("calendar_unverified") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, PreviewSchedulingReassignmentRequestOverridesItem("calendar_unverified"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_Invalid", func(t *testing.T) { + _, err := NewPreviewSchedulingReassignmentRequestOverridesItemFromString("invalid_value_that_does_not_exist") + assert.Error(t, err) + }) + + t.Run("Ptr", func(t *testing.T) { + val, err := NewPreviewSchedulingReassignmentRequestOverridesItemFromString("any_host") + assert.NoError(t, err) + ptr := val.Ptr() + assert.NotNil(t, ptr) + assert.Equal(t, val, *ptr) + }) +} + +func TestEnumUndoSchedulingReassignmentRequestNotifyHosts(t *testing.T) { + t.Run("NewFromString_digest", func(t *testing.T) { + t.Parallel() + val, err := NewUndoSchedulingReassignmentRequestNotifyHostsFromString("digest") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, UndoSchedulingReassignmentRequestNotifyHosts("digest"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_each", func(t *testing.T) { + t.Parallel() + val, err := NewUndoSchedulingReassignmentRequestNotifyHostsFromString("each") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, UndoSchedulingReassignmentRequestNotifyHosts("each"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_none", func(t *testing.T) { + t.Parallel() + val, err := NewUndoSchedulingReassignmentRequestNotifyHostsFromString("none") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, UndoSchedulingReassignmentRequestNotifyHosts("none"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_Invalid", func(t *testing.T) { + _, err := NewUndoSchedulingReassignmentRequestNotifyHostsFromString("invalid_value_that_does_not_exist") + assert.Error(t, err) + }) + + t.Run("Ptr", func(t *testing.T) { + val, err := NewUndoSchedulingReassignmentRequestNotifyHostsFromString("digest") + assert.NoError(t, err) + ptr := val.Ptr() + assert.NotNil(t, ptr) + assert.Equal(t, val, *ptr) + }) +} + +func TestEnumUndoSchedulingReassignmentRequestOverridesItem(t *testing.T) { + t.Run("NewFromString_any_host", func(t *testing.T) { + t.Parallel() + val, err := NewUndoSchedulingReassignmentRequestOverridesItemFromString("any_host") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, UndoSchedulingReassignmentRequestOverridesItem("any_host"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_out_of_office", func(t *testing.T) { + t.Parallel() + val, err := NewUndoSchedulingReassignmentRequestOverridesItemFromString("out_of_office") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, UndoSchedulingReassignmentRequestOverridesItem("out_of_office"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_outside_availability", func(t *testing.T) { + t.Parallel() + val, err := NewUndoSchedulingReassignmentRequestOverridesItemFromString("outside_availability") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, UndoSchedulingReassignmentRequestOverridesItem("outside_availability"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_host_busy", func(t *testing.T) { + t.Parallel() + val, err := NewUndoSchedulingReassignmentRequestOverridesItemFromString("host_busy") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, UndoSchedulingReassignmentRequestOverridesItem("host_busy"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_limit_reached", func(t *testing.T) { + t.Parallel() + val, err := NewUndoSchedulingReassignmentRequestOverridesItemFromString("limit_reached") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, UndoSchedulingReassignmentRequestOverridesItem("limit_reached"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_calendar_unverified", func(t *testing.T) { + t.Parallel() + val, err := NewUndoSchedulingReassignmentRequestOverridesItemFromString("calendar_unverified") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, UndoSchedulingReassignmentRequestOverridesItem("calendar_unverified"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_Invalid", func(t *testing.T) { + _, err := NewUndoSchedulingReassignmentRequestOverridesItemFromString("invalid_value_that_does_not_exist") + assert.Error(t, err) + }) + + t.Run("Ptr", func(t *testing.T) { + val, err := NewUndoSchedulingReassignmentRequestOverridesItemFromString("any_host") + assert.NoError(t, err) + ptr := val.Ptr() + assert.NotNil(t, ptr) + assert.Equal(t, val, *ptr) + }) +} + +func TestEnumUndoSchedulingReassignmentRequestReasonCode(t *testing.T) { + t.Run("NewFromString_host_unavailable", func(t *testing.T) { + t.Parallel() + val, err := NewUndoSchedulingReassignmentRequestReasonCodeFromString("host_unavailable") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, UndoSchedulingReassignmentRequestReasonCode("host_unavailable"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_out_of_office", func(t *testing.T) { + t.Parallel() + val, err := NewUndoSchedulingReassignmentRequestReasonCodeFromString("out_of_office") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, UndoSchedulingReassignmentRequestReasonCode("out_of_office"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_workload", func(t *testing.T) { + t.Parallel() + val, err := NewUndoSchedulingReassignmentRequestReasonCodeFromString("workload") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, UndoSchedulingReassignmentRequestReasonCode("workload"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_customer_request", func(t *testing.T) { + t.Parallel() + val, err := NewUndoSchedulingReassignmentRequestReasonCodeFromString("customer_request") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, UndoSchedulingReassignmentRequestReasonCode("customer_request"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_offboarding", func(t *testing.T) { + t.Parallel() + val, err := NewUndoSchedulingReassignmentRequestReasonCodeFromString("offboarding") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, UndoSchedulingReassignmentRequestReasonCode("offboarding"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_other", func(t *testing.T) { + t.Parallel() + val, err := NewUndoSchedulingReassignmentRequestReasonCodeFromString("other") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, UndoSchedulingReassignmentRequestReasonCode("other"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_Invalid", func(t *testing.T) { + _, err := NewUndoSchedulingReassignmentRequestReasonCodeFromString("invalid_value_that_does_not_exist") + assert.Error(t, err) + }) + + t.Run("Ptr", func(t *testing.T) { + val, err := NewUndoSchedulingReassignmentRequestReasonCodeFromString("host_unavailable") + assert.NoError(t, err) + ptr := val.Ptr() + assert.NotNil(t, ptr) + assert.Equal(t, val, *ptr) + }) +} + +func TestExtraPropertiesCreateSchedulingReassignmentRequestNotify(t *testing.T) { + t.Run("GetExtraProperties", func(t *testing.T) { + t.Parallel() + obj := &CreateSchedulingReassignmentRequestNotify{} + // Should not panic when calling GetExtraProperties() + defer func() { + if r := recover(); r != nil { + t.Errorf("GetExtraProperties() panicked: %v", r) + } + }() + extraProps := obj.GetExtraProperties() + // Result can be nil or an empty/non-empty map + _ = extraProps + }) + + t.Run("GetExtraProperties_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *CreateSchedulingReassignmentRequestNotify + extraProps := obj.GetExtraProperties() + assert.Nil(t, extraProps, "nil receiver should return nil without panicking") + }) +} + +func TestExtraPropertiesUndoSchedulingReassignmentRequestNotify(t *testing.T) { + t.Run("GetExtraProperties", func(t *testing.T) { + t.Parallel() + obj := &UndoSchedulingReassignmentRequestNotify{} + // Should not panic when calling GetExtraProperties() + defer func() { + if r := recover(); r != nil { + t.Errorf("GetExtraProperties() panicked: %v", r) + } + }() + extraProps := obj.GetExtraProperties() + // Result can be nil or an empty/non-empty map + _ = extraProps + }) + + t.Run("GetExtraProperties_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *UndoSchedulingReassignmentRequestNotify + extraProps := obj.GetExtraProperties() + assert.Nil(t, extraProps, "nil receiver should return nil without panicking") + }) +} diff --git a/sdks/go/scheduling/sessions.go b/sdks/go/scheduling/sessions.go index 28a504446..1219f02db 100644 --- a/sdks/go/scheduling/sessions.go +++ b/sdks/go/scheduling/sessions.go @@ -195,6 +195,84 @@ func (c *CreateSchedulingHostSessionRequest) MarshalJSON() ([]byte, error) { return json.Marshal(explicitMarshaler) } +var ( + createSchedulingManagerSessionRequestFieldHosts = big.NewInt(1 << 0) + createSchedulingManagerSessionRequestFieldHostFilter = big.NewInt(1 << 1) + createSchedulingManagerSessionRequestFieldExpiresIn = big.NewInt(1 << 2) + createSchedulingManagerSessionRequestFieldReadOnly = big.NewInt(1 << 3) +) + +type CreateSchedulingManagerSessionRequest struct { + // The hosts this page can reach, by id or uid. + Hosts []string `json:"hosts,omitempty" url:"-"` + // Everyone matching these attributes, asked again on every request. + HostFilter map[string]*CreateSchedulingManagerSessionRequestHostFilterValue `json:"host_filter,omitempty" url:"-"` + // Seconds until it stops working. At most a day. + ExpiresIn *int `json:"expires_in,omitempty" url:"-"` + ReadOnly *bool `json:"read_only,omitempty" url:"-"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (c *CreateSchedulingManagerSessionRequest) require(field *big.Int) { + next := new(big.Int) + if c.explicitFields != nil { + next.Set(c.explicitFields) + } + next.Or(next, field) + c.explicitFields = next +} + +// SetHosts sets the Hosts field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreateSchedulingManagerSessionRequest) SetHosts(hosts []string) { + c.Hosts = hosts + c.require(createSchedulingManagerSessionRequestFieldHosts) +} + +// SetHostFilter sets the HostFilter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreateSchedulingManagerSessionRequest) SetHostFilter(hostFilter map[string]*CreateSchedulingManagerSessionRequestHostFilterValue) { + c.HostFilter = hostFilter + c.require(createSchedulingManagerSessionRequestFieldHostFilter) +} + +// SetExpiresIn sets the ExpiresIn field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreateSchedulingManagerSessionRequest) SetExpiresIn(expiresIn *int) { + c.ExpiresIn = expiresIn + c.require(createSchedulingManagerSessionRequestFieldExpiresIn) +} + +// SetReadOnly sets the ReadOnly field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreateSchedulingManagerSessionRequest) SetReadOnly(readOnly *bool) { + c.ReadOnly = readOnly + c.require(createSchedulingManagerSessionRequestFieldReadOnly) +} + +func (c *CreateSchedulingManagerSessionRequest) UnmarshalJSON(data []byte) error { + type unmarshaler CreateSchedulingManagerSessionRequest + var body unmarshaler + if err := json.Unmarshal(data, &body); err != nil { + return err + } + *c = CreateSchedulingManagerSessionRequest(body) + return nil +} + +func (c *CreateSchedulingManagerSessionRequest) MarshalJSON() ([]byte, error) { + type embed CreateSchedulingManagerSessionRequest + var marshaler = struct { + embed + }{ + embed: embed(*c), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, c.explicitFields) + return json.Marshal(explicitMarshaler) +} + var ( createSchedulingBookerSessionRequestAttendeeFieldUID = big.NewInt(1 << 0) createSchedulingBookerSessionRequestAttendeeFieldName = big.NewInt(1 << 1) @@ -429,3 +507,65 @@ func (c *CreateSchedulingBookerSessionRequestAttributesValue) Accept(visitor Cre } return fmt.Errorf("type %T does not include a non-empty union type", c) } + +type CreateSchedulingManagerSessionRequestHostFilterValue struct { + String string + StringList []string + + typ string +} + +func (c *CreateSchedulingManagerSessionRequestHostFilterValue) GetString() string { + if c == nil { + return "" + } + return c.String +} + +func (c *CreateSchedulingManagerSessionRequestHostFilterValue) GetStringList() []string { + if c == nil { + return nil + } + return c.StringList +} + +func (c *CreateSchedulingManagerSessionRequestHostFilterValue) UnmarshalJSON(data []byte) error { + var valueString string + if err := json.Unmarshal(data, &valueString); err == nil { + c.typ = "String" + c.String = valueString + return nil + } + var valueStringList []string + if err := json.Unmarshal(data, &valueStringList); err == nil { + c.typ = "StringList" + c.StringList = valueStringList + return nil + } + return fmt.Errorf("%s cannot be deserialized as a %T", data, c) +} + +func (c CreateSchedulingManagerSessionRequestHostFilterValue) MarshalJSON() ([]byte, error) { + if c.typ == "String" || c.String != "" { + return json.Marshal(c.String) + } + if c.typ == "StringList" || c.StringList != nil { + return json.Marshal(c.StringList) + } + return nil, fmt.Errorf("type %T does not include a non-empty union type", c) +} + +type CreateSchedulingManagerSessionRequestHostFilterValueVisitor interface { + VisitString(string) error + VisitStringList([]string) error +} + +func (c *CreateSchedulingManagerSessionRequestHostFilterValue) Accept(visitor CreateSchedulingManagerSessionRequestHostFilterValueVisitor) error { + if c.typ == "String" || c.String != "" { + return visitor.VisitString(c.String) + } + if c.typ == "StringList" || c.StringList != nil { + return visitor.VisitStringList(c.StringList) + } + return fmt.Errorf("type %T does not include a non-empty union type", c) +} diff --git a/sdks/go/scheduling/sessions/client.go b/sdks/go/scheduling/sessions/client.go index c0aa8e556..5d89dd210 100644 --- a/sdks/go/scheduling/sessions/client.go +++ b/sdks/go/scheduling/sessions/client.go @@ -43,6 +43,40 @@ func NewClient(options *core.RequestOptions) *Client { } } +// Lets a team lead manage cover for the hosts you name, or those matching an attribute filter whenever it's asked: time off, bookings that need someone else, and moving them. It never sees attendees' details. Send the `url` to their browser, or embed it with `coss/scheduling`. +// +// Example: +// +// request := &scheduling.CreateSchedulingManagerSessionRequest{ +// HostFilter: map[string]*scheduling.CreateSchedulingManagerSessionRequestHostFilterValue{ +// "team": &scheduling.CreateSchedulingManagerSessionRequestHostFilterValue{ +// String: "cardiology", +// }, +// }, +// ExpiresIn: coss.Int( +// 3600, +// ), +// } +// client.Scheduling.Sessions.CreateForManager( +// context.TODO(), +// request, +// ) +func (c *Client) CreateForManager( + ctx context.Context, + request *scheduling.CreateSchedulingManagerSessionRequest, + opts ...option.RequestOption, +) (*coss.SchedulingSession, error) { + response, err := c.WithRawResponse.CreateForManager( + ctx, + request, + opts..., + ) + if err != nil { + return nil, err + } + return response.Body, nil +} + // Lets one host manage their own hours, calendars and locations, on coss.com's hosted page or your own UI. Send the `url` to their browser, or embed it with `coss/scheduling`. // // Example: diff --git a/sdks/go/scheduling/sessions/raw_client.go b/sdks/go/scheduling/sessions/raw_client.go index 1427c72ab..3f28ee892 100644 --- a/sdks/go/scheduling/sessions/raw_client.go +++ b/sdks/go/scheduling/sessions/raw_client.go @@ -33,6 +33,52 @@ func NewRawClient(options *core.RequestOptions) *RawClient { } } +func (r *RawClient) CreateForManager( + ctx context.Context, + request *scheduling.CreateSchedulingManagerSessionRequest, + opts ...option.RequestOption, +) (*core.Response[*coss.SchedulingSession], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "https://api.coss.com", + ) + endpointURL := baseURL + "/v1/scheduling/manager_sessions" + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + headers.Add("Content-Type", "application/json") + core.SetIdempotencyKeyHeader(headers) + + var response *coss.SchedulingSession + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodPost, + Headers: headers, + MaxAttempts: options.MaxAttempts, + DisableRetries: true, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Request: request, + Response: &response, + ErrorDecoder: internal.NewErrorDecoder(scheduling.ErrorCodes), + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*coss.SchedulingSession]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} + func (r *RawClient) CreateForHost( ctx context.Context, request *scheduling.CreateSchedulingHostSessionRequest, diff --git a/sdks/go/scheduling/sessions_test.go b/sdks/go/scheduling/sessions_test.go index eaba7a58f..86eee2479 100644 --- a/sdks/go/scheduling/sessions_test.go +++ b/sdks/go/scheduling/sessions_test.go @@ -378,6 +378,168 @@ func TestSettersMarkExplicitCreateSchedulingHostSessionRequest(t *testing.T) { } +func TestSettersCreateSchedulingManagerSessionRequest(t *testing.T) { + t.Run("SetHosts", func(t *testing.T) { + obj := &CreateSchedulingManagerSessionRequest{} + var fernTestValueHosts []string + obj.SetHosts(fernTestValueHosts) + assert.Equal(t, fernTestValueHosts, obj.Hosts) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetHostFilter", func(t *testing.T) { + obj := &CreateSchedulingManagerSessionRequest{} + var fernTestValueHostFilter map[string]*CreateSchedulingManagerSessionRequestHostFilterValue + obj.SetHostFilter(fernTestValueHostFilter) + assert.Equal(t, fernTestValueHostFilter, obj.HostFilter) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetExpiresIn", func(t *testing.T) { + obj := &CreateSchedulingManagerSessionRequest{} + var fernTestValueExpiresIn *int + obj.SetExpiresIn(fernTestValueExpiresIn) + assert.Equal(t, fernTestValueExpiresIn, obj.ExpiresIn) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetReadOnly", func(t *testing.T) { + obj := &CreateSchedulingManagerSessionRequest{} + var fernTestValueReadOnly *bool + obj.SetReadOnly(fernTestValueReadOnly) + assert.Equal(t, fernTestValueReadOnly, obj.ReadOnly) + assert.NotNil(t, obj.explicitFields) + }) + +} + +func TestSettersMarkExplicitCreateSchedulingManagerSessionRequest(t *testing.T) { + t.Run("SetHosts_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &CreateSchedulingManagerSessionRequest{} + var fernTestValueHosts []string + + // Act + obj.SetHosts(fernTestValueHosts) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetHostFilter_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &CreateSchedulingManagerSessionRequest{} + var fernTestValueHostFilter map[string]*CreateSchedulingManagerSessionRequestHostFilterValue + + // Act + obj.SetHostFilter(fernTestValueHostFilter) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetExpiresIn_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &CreateSchedulingManagerSessionRequest{} + var fernTestValueExpiresIn *int + + // Act + obj.SetExpiresIn(fernTestValueExpiresIn) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetReadOnly_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &CreateSchedulingManagerSessionRequest{} + var fernTestValueReadOnly *bool + + // Act + obj.SetReadOnly(fernTestValueReadOnly) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + +} + func TestSettersCreateSchedulingBookerSessionRequestAttendee(t *testing.T) { t.Run("SetUID", func(t *testing.T) { obj := &CreateSchedulingBookerSessionRequestAttendee{} @@ -868,6 +1030,65 @@ func TestGettersCreateSchedulingBookerSessionRequestAttributesValue(t *testing.T } +func TestGettersCreateSchedulingManagerSessionRequestHostFilterValue(t *testing.T) { + t.Run("GetString", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &CreateSchedulingManagerSessionRequestHostFilterValue{} + var expected string + obj.String = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetString(), "getter should return the property value") + }) + + t.Run("GetString_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *CreateSchedulingManagerSessionRequestHostFilterValue + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetString() // Should return zero value + }) + + t.Run("GetStringList", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &CreateSchedulingManagerSessionRequestHostFilterValue{} + var expected []string + obj.StringList = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetStringList(), "getter should return the property value") + }) + + t.Run("GetStringList_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &CreateSchedulingManagerSessionRequestHostFilterValue{} + obj.StringList = nil + + // Act & Assert + assert.Nil(t, obj.GetStringList(), "getter should return nil when property is nil") + }) + + t.Run("GetStringList_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *CreateSchedulingManagerSessionRequestHostFilterValue + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetStringList() // Should return zero value + }) + +} + func TestJSONMarshalingCreateSchedulingBookerSessionRequestAttendee(t *testing.T) { t.Run("MarshalUnmarshal", func(t *testing.T) { t.Parallel() diff --git a/sdks/go/scheduling/settings.go b/sdks/go/scheduling/settings.go index 9d62129ae..435bcf5fb 100644 --- a/sdks/go/scheduling/settings.go +++ b/sdks/go/scheduling/settings.go @@ -33,6 +33,29 @@ func (u UpdateSchedulingSettingsRequestCalendarFailureMode) Ptr() *UpdateSchedul return &u } +// Whether hosts can give their own bookings to someone else from their page. `eligible` lets them, to anyone free who takes that event type. +type UpdateSchedulingSettingsRequestHostReassignment string + +const ( + UpdateSchedulingSettingsRequestHostReassignmentOff UpdateSchedulingSettingsRequestHostReassignment = "off" + UpdateSchedulingSettingsRequestHostReassignmentEligible UpdateSchedulingSettingsRequestHostReassignment = "eligible" +) + +func NewUpdateSchedulingSettingsRequestHostReassignmentFromString(s string) (UpdateSchedulingSettingsRequestHostReassignment, error) { + switch s { + case "off": + return UpdateSchedulingSettingsRequestHostReassignmentOff, nil + case "eligible": + return UpdateSchedulingSettingsRequestHostReassignmentEligible, nil + } + var t UpdateSchedulingSettingsRequestHostReassignment + return "", fmt.Errorf("%s is not a valid %T", s, t) +} + +func (u UpdateSchedulingSettingsRequestHostReassignment) Ptr() *UpdateSchedulingSettingsRequestHostReassignment { + return &u +} + var ( updateSchedulingSettingsRequestLogoFieldContent = big.NewInt(1 << 0) ) @@ -243,16 +266,123 @@ func (u *UpdateSchedulingSettingsRequestNotificationsValue) String() string { } var ( - updateSchedulingSettingsRequestFieldAllowedOrigins = big.NewInt(1 << 0) - updateSchedulingSettingsRequestFieldBrandName = big.NewInt(1 << 1) - updateSchedulingSettingsRequestFieldAccentColor = big.NewInt(1 << 2) - updateSchedulingSettingsRequestFieldLogo = big.NewInt(1 << 3) - updateSchedulingSettingsRequestFieldEmailFrom = big.NewInt(1 << 4) - updateSchedulingSettingsRequestFieldSmsFrom = big.NewInt(1 << 5) - updateSchedulingSettingsRequestFieldCalendarFailureMode = big.NewInt(1 << 6) - updateSchedulingSettingsRequestFieldNotifications = big.NewInt(1 << 7) - updateSchedulingSettingsRequestFieldEmailReplyTo = big.NewInt(1 << 8) - updateSchedulingSettingsRequestFieldReminders = big.NewInt(1 << 9) + updateSchedulingSettingsRequestOutOfOfficeReasonsItemFieldKey = big.NewInt(1 << 0) + updateSchedulingSettingsRequestOutOfOfficeReasonsItemFieldLabel = big.NewInt(1 << 1) +) + +type UpdateSchedulingSettingsRequestOutOfOfficeReasonsItem struct { + // One of `unspecified`, `vacation`, `travel`, `sick`, `public_holiday`, `parental_leave`, `training` and `other`, or a key from the settings' `out_of_office_reasons`. Only people who manage this host see it: never bookers, webhooks or calendars. + Key string `json:"key" url:"key"` + Label string `json:"label" url:"label"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + + extraProperties map[string]interface{} + rawJSON json.RawMessage +} + +func (u *UpdateSchedulingSettingsRequestOutOfOfficeReasonsItem) GetKey() string { + if u == nil { + return "" + } + return u.Key +} + +func (u *UpdateSchedulingSettingsRequestOutOfOfficeReasonsItem) GetLabel() string { + if u == nil { + return "" + } + return u.Label +} + +func (u *UpdateSchedulingSettingsRequestOutOfOfficeReasonsItem) GetExtraProperties() map[string]interface{} { + if u == nil { + return nil + } + return u.extraProperties +} + +func (u *UpdateSchedulingSettingsRequestOutOfOfficeReasonsItem) require(field *big.Int) { + next := new(big.Int) + if u.explicitFields != nil { + next.Set(u.explicitFields) + } + next.Or(next, field) + u.explicitFields = next +} + +// SetKey sets the Key field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (u *UpdateSchedulingSettingsRequestOutOfOfficeReasonsItem) SetKey(key string) { + u.Key = key + u.require(updateSchedulingSettingsRequestOutOfOfficeReasonsItemFieldKey) +} + +// SetLabel sets the Label field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (u *UpdateSchedulingSettingsRequestOutOfOfficeReasonsItem) SetLabel(label string) { + u.Label = label + u.require(updateSchedulingSettingsRequestOutOfOfficeReasonsItemFieldLabel) +} + +func (u *UpdateSchedulingSettingsRequestOutOfOfficeReasonsItem) UnmarshalJSON(data []byte) error { + type unmarshaler UpdateSchedulingSettingsRequestOutOfOfficeReasonsItem + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *u = UpdateSchedulingSettingsRequestOutOfOfficeReasonsItem(value) + extraProperties, err := internal.ExtractExtraProperties(data, *u) + if err != nil { + return err + } + u.extraProperties = extraProperties + u.rawJSON = json.RawMessage(data) + return nil +} + +func (u *UpdateSchedulingSettingsRequestOutOfOfficeReasonsItem) MarshalJSON() ([]byte, error) { + type embed UpdateSchedulingSettingsRequestOutOfOfficeReasonsItem + var marshaler = struct { + embed + }{ + embed: embed(*u), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, u.explicitFields) + return json.Marshal(explicitMarshaler) +} + +func (u *UpdateSchedulingSettingsRequestOutOfOfficeReasonsItem) String() string { + if u == nil { + return "" + } + if len(u.rawJSON) > 0 { + if value, err := internal.StringifyJSON(u.rawJSON); err == nil { + return value + } + } + if value, err := internal.StringifyJSON(u); err == nil { + return value + } + return fmt.Sprintf("%#v", u) +} + +var ( + updateSchedulingSettingsRequestFieldAllowedOrigins = big.NewInt(1 << 0) + updateSchedulingSettingsRequestFieldBrandName = big.NewInt(1 << 1) + updateSchedulingSettingsRequestFieldAccentColor = big.NewInt(1 << 2) + updateSchedulingSettingsRequestFieldLogo = big.NewInt(1 << 3) + updateSchedulingSettingsRequestFieldPrivacyURL = big.NewInt(1 << 4) + updateSchedulingSettingsRequestFieldEmailFrom = big.NewInt(1 << 5) + updateSchedulingSettingsRequestFieldSmsFrom = big.NewInt(1 << 6) + updateSchedulingSettingsRequestFieldCalendarFailureMode = big.NewInt(1 << 7) + updateSchedulingSettingsRequestFieldNameHostInAttendeeEmails = big.NewInt(1 << 8) + updateSchedulingSettingsRequestFieldHostReassignment = big.NewInt(1 << 9) + updateSchedulingSettingsRequestFieldOutOfOfficeReasons = big.NewInt(1 << 10) + updateSchedulingSettingsRequestFieldNotifications = big.NewInt(1 << 11) + updateSchedulingSettingsRequestFieldEmailReplyTo = big.NewInt(1 << 12) + updateSchedulingSettingsRequestFieldReminders = big.NewInt(1 << 13) ) type UpdateSchedulingSettingsRequest struct { @@ -264,12 +394,20 @@ type UpdateSchedulingSettingsRequest struct { AccentColor *string `json:"accent_color,omitempty" url:"-"` // Your logo, a PNG or JPEG. `null` removes it. Logo *UpdateSchedulingSettingsRequestLogo `json:"logo,omitempty" url:"-"` + // Your privacy policy, as an https URL, for hosts connecting a calendar through your own OAuth app. `null` removes it. + PrivacyURL *string `json:"privacy_url,omitempty" url:"-"` // Sender of booking emails, on a verified domain. `null`: coss.com's own address. EmailFrom *string `json:"email_from,omitempty" url:"-"` // Your approved number for SMS reminders, in E.164. `null`: no SMS is sent. SmsFrom *string `json:"sms_from,omitempty" url:"-"` // When a host's calendar can't be read: `hide` stops offering them, `last_known` keeps offering their last known times. CalendarFailureMode *UpdateSchedulingSettingsRequestCalendarFailureMode `json:"calendar_failure_mode,omitempty" url:"-"` + // Name the new host when telling an attendee their booking has one. + NameHostInAttendeeEmails *bool `json:"name_host_in_attendee_emails,omitempty" url:"-"` + // Whether hosts can give their own bookings to someone else from their page. `eligible` lets them, to anyone free who takes that event type. + HostReassignment *UpdateSchedulingSettingsRequestHostReassignment `json:"host_reassignment,omitempty" url:"-"` + // Reasons of your own, on top of the preset ones. Hosts and managers see them. + OutOfOfficeReasons []*UpdateSchedulingSettingsRequestOutOfOfficeReasonsItem `json:"out_of_office_reasons,omitempty" url:"-"` // Per event (`confirmed`, `pending_approval`, `rescheduled`, `cancelled`, `declined`, `reminder`), overriding the defaults. `null` restores them. Notifications map[string]*UpdateSchedulingSettingsRequestNotificationsValue `json:"notifications,omitempty" url:"-"` // Where replies go, for emails from `email_from`. @@ -318,6 +456,13 @@ func (u *UpdateSchedulingSettingsRequest) SetLogo(logo *UpdateSchedulingSettings u.require(updateSchedulingSettingsRequestFieldLogo) } +// SetPrivacyURL sets the PrivacyURL field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (u *UpdateSchedulingSettingsRequest) SetPrivacyURL(privacyURL *string) { + u.PrivacyURL = privacyURL + u.require(updateSchedulingSettingsRequestFieldPrivacyURL) +} + // SetEmailFrom sets the EmailFrom field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. func (u *UpdateSchedulingSettingsRequest) SetEmailFrom(emailFrom *string) { @@ -339,6 +484,27 @@ func (u *UpdateSchedulingSettingsRequest) SetCalendarFailureMode(calendarFailure u.require(updateSchedulingSettingsRequestFieldCalendarFailureMode) } +// SetNameHostInAttendeeEmails sets the NameHostInAttendeeEmails field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (u *UpdateSchedulingSettingsRequest) SetNameHostInAttendeeEmails(nameHostInAttendeeEmails *bool) { + u.NameHostInAttendeeEmails = nameHostInAttendeeEmails + u.require(updateSchedulingSettingsRequestFieldNameHostInAttendeeEmails) +} + +// SetHostReassignment sets the HostReassignment field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (u *UpdateSchedulingSettingsRequest) SetHostReassignment(hostReassignment *UpdateSchedulingSettingsRequestHostReassignment) { + u.HostReassignment = hostReassignment + u.require(updateSchedulingSettingsRequestFieldHostReassignment) +} + +// SetOutOfOfficeReasons sets the OutOfOfficeReasons field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (u *UpdateSchedulingSettingsRequest) SetOutOfOfficeReasons(outOfOfficeReasons []*UpdateSchedulingSettingsRequestOutOfOfficeReasonsItem) { + u.OutOfOfficeReasons = outOfOfficeReasons + u.require(updateSchedulingSettingsRequestFieldOutOfOfficeReasons) +} + // SetNotifications sets the Notifications field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. func (u *UpdateSchedulingSettingsRequest) SetNotifications(notifications map[string]*UpdateSchedulingSettingsRequestNotificationsValue) { diff --git a/sdks/go/scheduling/settings_test.go b/sdks/go/scheduling/settings_test.go index 9410127e9..8d30b16a0 100644 --- a/sdks/go/scheduling/settings_test.go +++ b/sdks/go/scheduling/settings_test.go @@ -306,6 +306,139 @@ func TestSettersMarkExplicitUpdateSchedulingSettingsRequestNotificationsValue(t } +func TestSettersUpdateSchedulingSettingsRequestOutOfOfficeReasonsItem(t *testing.T) { + t.Run("SetKey", func(t *testing.T) { + obj := &UpdateSchedulingSettingsRequestOutOfOfficeReasonsItem{} + var fernTestValueKey string + obj.SetKey(fernTestValueKey) + assert.Equal(t, fernTestValueKey, obj.Key) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetLabel", func(t *testing.T) { + obj := &UpdateSchedulingSettingsRequestOutOfOfficeReasonsItem{} + var fernTestValueLabel string + obj.SetLabel(fernTestValueLabel) + assert.Equal(t, fernTestValueLabel, obj.Label) + assert.NotNil(t, obj.explicitFields) + }) + +} + +func TestGettersUpdateSchedulingSettingsRequestOutOfOfficeReasonsItem(t *testing.T) { + t.Run("GetKey", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &UpdateSchedulingSettingsRequestOutOfOfficeReasonsItem{} + var expected string + obj.Key = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetKey(), "getter should return the property value") + }) + + t.Run("GetKey_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *UpdateSchedulingSettingsRequestOutOfOfficeReasonsItem + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetKey() // Should return zero value + }) + + t.Run("GetLabel", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &UpdateSchedulingSettingsRequestOutOfOfficeReasonsItem{} + var expected string + obj.Label = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetLabel(), "getter should return the property value") + }) + + t.Run("GetLabel_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *UpdateSchedulingSettingsRequestOutOfOfficeReasonsItem + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetLabel() // Should return zero value + }) + +} + +func TestSettersMarkExplicitUpdateSchedulingSettingsRequestOutOfOfficeReasonsItem(t *testing.T) { + t.Run("SetKey_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &UpdateSchedulingSettingsRequestOutOfOfficeReasonsItem{} + var fernTestValueKey string + + // Act + obj.SetKey(fernTestValueKey) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetLabel_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &UpdateSchedulingSettingsRequestOutOfOfficeReasonsItem{} + var fernTestValueLabel string + + // Act + obj.SetLabel(fernTestValueLabel) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + +} + func TestSettersUpdateSchedulingSettingsRequest(t *testing.T) { t.Run("SetAllowedOrigins", func(t *testing.T) { obj := &UpdateSchedulingSettingsRequest{} @@ -339,6 +472,14 @@ func TestSettersUpdateSchedulingSettingsRequest(t *testing.T) { assert.NotNil(t, obj.explicitFields) }) + t.Run("SetPrivacyURL", func(t *testing.T) { + obj := &UpdateSchedulingSettingsRequest{} + var fernTestValuePrivacyURL *string + obj.SetPrivacyURL(fernTestValuePrivacyURL) + assert.Equal(t, fernTestValuePrivacyURL, obj.PrivacyURL) + assert.NotNil(t, obj.explicitFields) + }) + t.Run("SetEmailFrom", func(t *testing.T) { obj := &UpdateSchedulingSettingsRequest{} var fernTestValueEmailFrom *string @@ -363,6 +504,30 @@ func TestSettersUpdateSchedulingSettingsRequest(t *testing.T) { assert.NotNil(t, obj.explicitFields) }) + t.Run("SetNameHostInAttendeeEmails", func(t *testing.T) { + obj := &UpdateSchedulingSettingsRequest{} + var fernTestValueNameHostInAttendeeEmails *bool + obj.SetNameHostInAttendeeEmails(fernTestValueNameHostInAttendeeEmails) + assert.Equal(t, fernTestValueNameHostInAttendeeEmails, obj.NameHostInAttendeeEmails) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetHostReassignment", func(t *testing.T) { + obj := &UpdateSchedulingSettingsRequest{} + var fernTestValueHostReassignment *UpdateSchedulingSettingsRequestHostReassignment + obj.SetHostReassignment(fernTestValueHostReassignment) + assert.Equal(t, fernTestValueHostReassignment, obj.HostReassignment) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetOutOfOfficeReasons", func(t *testing.T) { + obj := &UpdateSchedulingSettingsRequest{} + var fernTestValueOutOfOfficeReasons []*UpdateSchedulingSettingsRequestOutOfOfficeReasonsItem + obj.SetOutOfOfficeReasons(fernTestValueOutOfOfficeReasons) + assert.Equal(t, fernTestValueOutOfOfficeReasons, obj.OutOfOfficeReasons) + assert.NotNil(t, obj.explicitFields) + }) + t.Run("SetNotifications", func(t *testing.T) { obj := &UpdateSchedulingSettingsRequest{} var fernTestValueNotifications map[string]*UpdateSchedulingSettingsRequestNotificationsValue @@ -514,6 +679,37 @@ func TestSettersMarkExplicitUpdateSchedulingSettingsRequest(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) + t.Run("SetPrivacyURL_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &UpdateSchedulingSettingsRequest{} + var fernTestValuePrivacyURL *string + + // Act + obj.SetPrivacyURL(fernTestValuePrivacyURL) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + t.Run("SetEmailFrom_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange @@ -607,6 +803,99 @@ func TestSettersMarkExplicitUpdateSchedulingSettingsRequest(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) + t.Run("SetNameHostInAttendeeEmails_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &UpdateSchedulingSettingsRequest{} + var fernTestValueNameHostInAttendeeEmails *bool + + // Act + obj.SetNameHostInAttendeeEmails(fernTestValueNameHostInAttendeeEmails) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetHostReassignment_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &UpdateSchedulingSettingsRequest{} + var fernTestValueHostReassignment *UpdateSchedulingSettingsRequestHostReassignment + + // Act + obj.SetHostReassignment(fernTestValueHostReassignment) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetOutOfOfficeReasons_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &UpdateSchedulingSettingsRequest{} + var fernTestValueOutOfOfficeReasons []*UpdateSchedulingSettingsRequestOutOfOfficeReasonsItem + + // Act + obj.SetOutOfOfficeReasons(fernTestValueOutOfOfficeReasons) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + t.Run("SetNotifications_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange @@ -768,6 +1057,39 @@ func TestJSONMarshalingUpdateSchedulingSettingsRequestNotificationsValue(t *test }) } +func TestJSONMarshalingUpdateSchedulingSettingsRequestOutOfOfficeReasonsItem(t *testing.T) { + t.Run("MarshalUnmarshal", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &UpdateSchedulingSettingsRequestOutOfOfficeReasonsItem{} + + // Act - Marshal to JSON + data, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed") + assert.NotNil(t, data, "marshaled data should not be nil") + assert.NotEmpty(t, data, "marshaled data should not be empty") + + // Unmarshal back and verify round-trip + var unmarshaled UpdateSchedulingSettingsRequestOutOfOfficeReasonsItem + err = json.Unmarshal(data, &unmarshaled) + assert.NoError(t, err, "round-trip unmarshal should succeed") + }) + + t.Run("UnmarshalInvalidJSON", func(t *testing.T) { + t.Parallel() + var obj UpdateSchedulingSettingsRequestOutOfOfficeReasonsItem + err := json.Unmarshal([]byte(`{invalid json}`), &obj) + assert.Error(t, err, "unmarshaling invalid JSON should return an error") + }) + + t.Run("UnmarshalEmptyObject", func(t *testing.T) { + t.Parallel() + var obj UpdateSchedulingSettingsRequestOutOfOfficeReasonsItem + err := json.Unmarshal([]byte(`{}`), &obj) + assert.NoError(t, err, "unmarshaling empty object should succeed") + }) +} + func TestStringUpdateSchedulingSettingsRequestLogo(t *testing.T) { t.Run("StringMethod", func(t *testing.T) { t.Parallel() @@ -800,6 +1122,22 @@ func TestStringUpdateSchedulingSettingsRequestNotificationsValue(t *testing.T) { }) } +func TestStringUpdateSchedulingSettingsRequestOutOfOfficeReasonsItem(t *testing.T) { + t.Run("StringMethod", func(t *testing.T) { + t.Parallel() + obj := &UpdateSchedulingSettingsRequestOutOfOfficeReasonsItem{} + result := obj.String() + assert.NotEmpty(t, result, "String() should return a non-empty representation") + }) + + t.Run("StringMethod_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *UpdateSchedulingSettingsRequestOutOfOfficeReasonsItem + result := obj.String() + assert.Equal(t, "", result, "String() should return for nil receiver") + }) +} + func TestEnumUpdateSchedulingSettingsRequestCalendarFailureMode(t *testing.T) { t.Run("NewFromString_hide", func(t *testing.T) { t.Parallel() @@ -829,6 +1167,35 @@ func TestEnumUpdateSchedulingSettingsRequestCalendarFailureMode(t *testing.T) { }) } +func TestEnumUpdateSchedulingSettingsRequestHostReassignment(t *testing.T) { + t.Run("NewFromString_off", func(t *testing.T) { + t.Parallel() + val, err := NewUpdateSchedulingSettingsRequestHostReassignmentFromString("off") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, UpdateSchedulingSettingsRequestHostReassignment("off"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_eligible", func(t *testing.T) { + t.Parallel() + val, err := NewUpdateSchedulingSettingsRequestHostReassignmentFromString("eligible") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, UpdateSchedulingSettingsRequestHostReassignment("eligible"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_Invalid", func(t *testing.T) { + _, err := NewUpdateSchedulingSettingsRequestHostReassignmentFromString("invalid_value_that_does_not_exist") + assert.Error(t, err) + }) + + t.Run("Ptr", func(t *testing.T) { + val, err := NewUpdateSchedulingSettingsRequestHostReassignmentFromString("off") + assert.NoError(t, err) + ptr := val.Ptr() + assert.NotNil(t, ptr) + assert.Equal(t, val, *ptr) + }) +} + func TestExtraPropertiesUpdateSchedulingSettingsRequestLogo(t *testing.T) { t.Run("GetExtraProperties", func(t *testing.T) { t.Parallel() @@ -874,3 +1241,26 @@ func TestExtraPropertiesUpdateSchedulingSettingsRequestNotificationsValue(t *tes assert.Nil(t, extraProps, "nil receiver should return nil without panicking") }) } + +func TestExtraPropertiesUpdateSchedulingSettingsRequestOutOfOfficeReasonsItem(t *testing.T) { + t.Run("GetExtraProperties", func(t *testing.T) { + t.Parallel() + obj := &UpdateSchedulingSettingsRequestOutOfOfficeReasonsItem{} + // Should not panic when calling GetExtraProperties() + defer func() { + if r := recover(); r != nil { + t.Errorf("GetExtraProperties() panicked: %v", r) + } + }() + extraProps := obj.GetExtraProperties() + // Result can be nil or an empty/non-empty map + _ = extraProps + }) + + t.Run("GetExtraProperties_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *UpdateSchedulingSettingsRequestOutOfOfficeReasonsItem + extraProps := obj.GetExtraProperties() + assert.Nil(t, extraProps, "nil receiver should return nil without panicking") + }) +} diff --git a/sdks/go/types.go b/sdks/go/types.go index eb4e77465..cc7f3c4ea 100644 --- a/sdks/go/types.go +++ b/sdks/go/types.go @@ -8922,145 +8922,226 @@ func (c *CreateCalendarDelegationRequestMicrosoft) String() string { return fmt.Sprintf("%#v", c) } -var ( - createSeriesRequestFieldEventType = big.NewInt(1 << 0) - createSeriesRequestFieldStart = big.NewInt(1 << 1) - createSeriesRequestFieldHost = big.NewInt(1 << 2) - createSeriesRequestFieldAttributes = big.NewInt(1 << 3) - createSeriesRequestFieldDurationMinutes = big.NewInt(1 << 4) - createSeriesRequestFieldAttendee = big.NewInt(1 << 5) - createSeriesRequestFieldGuests = big.NewInt(1 << 6) - createSeriesRequestFieldAnswers = big.NewInt(1 << 7) - createSeriesRequestFieldLocation = big.NewInt(1 << 8) - createSeriesRequestFieldMetadata = big.NewInt(1 << 9) - createSeriesRequestFieldRecurrence = big.NewInt(1 << 10) - createSeriesRequestFieldOnConflict = big.NewInt(1 << 11) -) - -type CreateSeriesRequest struct { - // The event type's id or uid. - EventType string `json:"event_type" url:"event_type"` - // An ISO 8601 instant with an offset. - Start string `json:"start" url:"start"` - // A specific host (id or uid). Default: chosen fairly from those free. - Host *string `json:"host,omitempty" url:"host,omitempty"` - // Only choose among pool hosts matching all of these. - Attributes map[string]*CreateSeriesRequestAttributesValue `json:"attributes,omitempty" url:"attributes,omitempty"` - // One of the event type's `duration_options`. - DurationMinutes *int `json:"duration_minutes,omitempty" url:"duration_minutes,omitempty"` - Attendee *SchedulingAttendeeInput `json:"attendee" url:"attendee"` - // Up to the event type's `max_guests`. - Guests []*SchedulingGuestInput `json:"guests,omitempty" url:"guests,omitempty"` - // Answers to the event type's questions. Stored encrypted, and returned only by retrieving the booking. - Answers map[string]*CreateSeriesRequestAnswersValue `json:"answers,omitempty" url:"answers,omitempty"` - // One of the event type's `locations`, with your link filled in if it has none. - Location *CreateSeriesRequestLocation `json:"location,omitempty" url:"location,omitempty"` - // Your own key-value pairs. Don't put sensitive data here. - Metadata map[string]string `json:"metadata,omitempty" url:"metadata,omitempty"` - // How often the booking repeats, at the attendee's local time. - Recurrence *CreateSeriesRequestRecurrence `json:"recurrence" url:"recurrence"` - // If an occurrence isn't free: book nothing, or book the rest and report it. - OnConflict *CreateSeriesRequestOnConflict `json:"on_conflict,omitempty" url:"on_conflict,omitempty"` - - // Private bitmask of fields set to an explicit value and therefore not to be omitted - explicitFields *big.Int `json:"-" url:"-"` +type CreateOauthAppRequest struct { + Provider string + Google *CreateOauthAppRequestGoogle + Microsoft *CreateOauthAppRequestMicrosoft + Zoom *CreateOauthAppRequestZoom - extraProperties map[string]interface{} - rawJSON json.RawMessage + rawJSON json.RawMessage } -func (c *CreateSeriesRequest) GetEventType() string { +func (c *CreateOauthAppRequest) GetProvider() string { if c == nil { return "" } - return c.EventType + return c.Provider } -func (c *CreateSeriesRequest) GetStart() string { +func (c *CreateOauthAppRequest) GetGoogle() *CreateOauthAppRequestGoogle { if c == nil { - return "" + return nil } - return c.Start + return c.Google } -func (c *CreateSeriesRequest) GetHost() *string { +func (c *CreateOauthAppRequest) GetMicrosoft() *CreateOauthAppRequestMicrosoft { if c == nil { return nil } - return c.Host + return c.Microsoft } -func (c *CreateSeriesRequest) GetAttributes() map[string]*CreateSeriesRequestAttributesValue { +func (c *CreateOauthAppRequest) GetZoom() *CreateOauthAppRequestZoom { if c == nil { return nil } - return c.Attributes + return c.Zoom } -func (c *CreateSeriesRequest) GetDurationMinutes() *int { - if c == nil { - return nil +func (c *CreateOauthAppRequest) UnmarshalJSON(data []byte) error { + var unmarshaler struct { + Provider string `json:"provider"` } - return c.DurationMinutes + if err := json.Unmarshal(data, &unmarshaler); err != nil { + return err + } + c.Provider = unmarshaler.Provider + if unmarshaler.Provider == "" { + return fmt.Errorf("%T did not include discriminant provider", c) + } + switch unmarshaler.Provider { + case "google": + value := new(CreateOauthAppRequestGoogle) + if err := json.Unmarshal(data, &value); err != nil { + return err + } + c.Google = value + case "microsoft": + value := new(CreateOauthAppRequestMicrosoft) + if err := json.Unmarshal(data, &value); err != nil { + return err + } + c.Microsoft = value + case "zoom": + value := new(CreateOauthAppRequestZoom) + if err := json.Unmarshal(data, &value); err != nil { + return err + } + c.Zoom = value + } + c.rawJSON = json.RawMessage(data) + return nil } -func (c *CreateSeriesRequest) GetAttendee() *SchedulingAttendeeInput { - if c == nil { - return nil +func (c CreateOauthAppRequest) MarshalJSON() ([]byte, error) { + if err := c.validate(); err != nil { + return nil, err } - return c.Attendee + if c.Google != nil { + return internal.MarshalJSONWithExtraProperty(c.Google, "provider", "google") + } + if c.Microsoft != nil { + return internal.MarshalJSONWithExtraProperty(c.Microsoft, "provider", "microsoft") + } + if c.Zoom != nil { + return internal.MarshalJSONWithExtraProperty(c.Zoom, "provider", "zoom") + } + if len(c.rawJSON) > 0 { + return c.rawJSON, nil + } + return nil, fmt.Errorf("type %T does not define a non-empty union type", c) } -func (c *CreateSeriesRequest) GetGuests() []*SchedulingGuestInput { +type CreateOauthAppRequestVisitor interface { + VisitGoogle(*CreateOauthAppRequestGoogle) error + VisitMicrosoft(*CreateOauthAppRequestMicrosoft) error + VisitZoom(*CreateOauthAppRequestZoom) error +} + +func (c *CreateOauthAppRequest) Accept(visitor CreateOauthAppRequestVisitor) error { + if c.Google != nil { + return visitor.VisitGoogle(c.Google) + } + if c.Microsoft != nil { + return visitor.VisitMicrosoft(c.Microsoft) + } + if c.Zoom != nil { + return visitor.VisitZoom(c.Zoom) + } + return fmt.Errorf("type %T does not define a non-empty union type", c) +} + +func (c *CreateOauthAppRequest) validate() error { if c == nil { - return nil + return fmt.Errorf("type %T is nil", c) } - return c.Guests + var fields []string + if c.Google != nil { + fields = append(fields, "google") + } + if c.Microsoft != nil { + fields = append(fields, "microsoft") + } + if c.Zoom != nil { + fields = append(fields, "zoom") + } + if len(fields) == 0 { + if c.Provider != "" { + if len(c.rawJSON) > 0 { + return nil + } + return fmt.Errorf("type %T defines a discriminant set to %q but the field is not set", c, c.Provider) + } + return fmt.Errorf("type %T is empty", c) + } + if len(fields) > 1 { + return fmt.Errorf("type %T defines values for %s, but only one value is allowed", c, fields) + } + if c.Provider != "" { + field := fields[0] + if c.Provider != field { + return fmt.Errorf( + "type %T defines a discriminant set to %q, but it does not match the %T field; either remove or update the discriminant to match", + c, + c.Provider, + c, + ) + } + } + return nil } -func (c *CreateSeriesRequest) GetAnswers() map[string]*CreateSeriesRequestAnswersValue { +var ( + createOauthAppRequestGoogleFieldClientID = big.NewInt(1 << 0) + createOauthAppRequestGoogleFieldClientSecret = big.NewInt(1 << 1) + createOauthAppRequestGoogleFieldRedirectURI = big.NewInt(1 << 2) + createOauthAppRequestGoogleFieldCompletionURL = big.NewInt(1 << 3) + createOauthAppRequestGoogleFieldSecretExpiresAt = big.NewInt(1 << 4) +) + +type CreateOauthAppRequestGoogle struct { + // The app's client ID at the provider. + ClientID string `json:"client_id" url:"client_id"` + // The app's client secret. Never returned. + ClientSecret string `json:"client_secret" url:"client_secret"` + // A page on your own domain, registered with the provider, that forwards `code` and `state` to `coss_callback_url`. Google requires this for an external app, since it has to verify the redirect's domain as yours. Leave it out to use `coss_callback_url` directly. + RedirectURI *string `json:"redirect_uri,omitempty" url:"redirect_uri,omitempty"` + // Where the browser lands after a consent that didn't name a `return_url`, with `coss_calendar` set to `connected`, `denied` or `invalid`. Leave it out for a plain page saying what happened. + CompletionURL *string `json:"completion_url,omitempty" url:"completion_url,omitempty"` + // When the client secret expires. Owners and admins are warned 14 days before. + SecretExpiresAt *time.Time `json:"secret_expires_at,omitempty" url:"secret_expires_at,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + + extraProperties map[string]interface{} + rawJSON json.RawMessage +} + +func (c *CreateOauthAppRequestGoogle) GetClientID() string { if c == nil { - return nil + return "" } - return c.Answers + return c.ClientID } -func (c *CreateSeriesRequest) GetLocation() *CreateSeriesRequestLocation { +func (c *CreateOauthAppRequestGoogle) GetClientSecret() string { if c == nil { - return nil + return "" } - return c.Location + return c.ClientSecret } -func (c *CreateSeriesRequest) GetMetadata() map[string]string { +func (c *CreateOauthAppRequestGoogle) GetRedirectURI() *string { if c == nil { return nil } - return c.Metadata + return c.RedirectURI } -func (c *CreateSeriesRequest) GetRecurrence() *CreateSeriesRequestRecurrence { +func (c *CreateOauthAppRequestGoogle) GetCompletionURL() *string { if c == nil { return nil } - return c.Recurrence + return c.CompletionURL } -func (c *CreateSeriesRequest) GetOnConflict() *CreateSeriesRequestOnConflict { +func (c *CreateOauthAppRequestGoogle) GetSecretExpiresAt() *time.Time { if c == nil { return nil } - return c.OnConflict + return c.SecretExpiresAt } -func (c *CreateSeriesRequest) GetExtraProperties() map[string]interface{} { +func (c *CreateOauthAppRequestGoogle) GetExtraProperties() map[string]interface{} { if c == nil { return nil } return c.extraProperties } -func (c *CreateSeriesRequest) require(field *big.Int) { +func (c *CreateOauthAppRequestGoogle) require(field *big.Int) { next := new(big.Int) if c.explicitFields != nil { next.Set(c.explicitFields) @@ -9069,97 +9150,54 @@ func (c *CreateSeriesRequest) require(field *big.Int) { c.explicitFields = next } -// SetEventType sets the EventType field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (c *CreateSeriesRequest) SetEventType(eventType string) { - c.EventType = eventType - c.require(createSeriesRequestFieldEventType) -} - -// SetStart sets the Start field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (c *CreateSeriesRequest) SetStart(start string) { - c.Start = start - c.require(createSeriesRequestFieldStart) -} - -// SetHost sets the Host field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (c *CreateSeriesRequest) SetHost(host *string) { - c.Host = host - c.require(createSeriesRequestFieldHost) -} - -// SetAttributes sets the Attributes field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (c *CreateSeriesRequest) SetAttributes(attributes map[string]*CreateSeriesRequestAttributesValue) { - c.Attributes = attributes - c.require(createSeriesRequestFieldAttributes) -} - -// SetDurationMinutes sets the DurationMinutes field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (c *CreateSeriesRequest) SetDurationMinutes(durationMinutes *int) { - c.DurationMinutes = durationMinutes - c.require(createSeriesRequestFieldDurationMinutes) -} - -// SetAttendee sets the Attendee field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (c *CreateSeriesRequest) SetAttendee(attendee *SchedulingAttendeeInput) { - c.Attendee = attendee - c.require(createSeriesRequestFieldAttendee) -} - -// SetGuests sets the Guests field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (c *CreateSeriesRequest) SetGuests(guests []*SchedulingGuestInput) { - c.Guests = guests - c.require(createSeriesRequestFieldGuests) -} - -// SetAnswers sets the Answers field and marks it as non-optional; +// SetClientID sets the ClientID field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (c *CreateSeriesRequest) SetAnswers(answers map[string]*CreateSeriesRequestAnswersValue) { - c.Answers = answers - c.require(createSeriesRequestFieldAnswers) +func (c *CreateOauthAppRequestGoogle) SetClientID(clientID string) { + c.ClientID = clientID + c.require(createOauthAppRequestGoogleFieldClientID) } -// SetLocation sets the Location field and marks it as non-optional; +// SetClientSecret sets the ClientSecret field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (c *CreateSeriesRequest) SetLocation(location *CreateSeriesRequestLocation) { - c.Location = location - c.require(createSeriesRequestFieldLocation) +func (c *CreateOauthAppRequestGoogle) SetClientSecret(clientSecret string) { + c.ClientSecret = clientSecret + c.require(createOauthAppRequestGoogleFieldClientSecret) } -// SetMetadata sets the Metadata field and marks it as non-optional; +// SetRedirectURI sets the RedirectURI field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (c *CreateSeriesRequest) SetMetadata(metadata map[string]string) { - c.Metadata = metadata - c.require(createSeriesRequestFieldMetadata) +func (c *CreateOauthAppRequestGoogle) SetRedirectURI(redirectURI *string) { + c.RedirectURI = redirectURI + c.require(createOauthAppRequestGoogleFieldRedirectURI) } -// SetRecurrence sets the Recurrence field and marks it as non-optional; +// SetCompletionURL sets the CompletionURL field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (c *CreateSeriesRequest) SetRecurrence(recurrence *CreateSeriesRequestRecurrence) { - c.Recurrence = recurrence - c.require(createSeriesRequestFieldRecurrence) +func (c *CreateOauthAppRequestGoogle) SetCompletionURL(completionURL *string) { + c.CompletionURL = completionURL + c.require(createOauthAppRequestGoogleFieldCompletionURL) } -// SetOnConflict sets the OnConflict field and marks it as non-optional; +// SetSecretExpiresAt sets the SecretExpiresAt field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (c *CreateSeriesRequest) SetOnConflict(onConflict *CreateSeriesRequestOnConflict) { - c.OnConflict = onConflict - c.require(createSeriesRequestFieldOnConflict) +func (c *CreateOauthAppRequestGoogle) SetSecretExpiresAt(secretExpiresAt *time.Time) { + c.SecretExpiresAt = secretExpiresAt + c.require(createOauthAppRequestGoogleFieldSecretExpiresAt) } -func (c *CreateSeriesRequest) UnmarshalJSON(data []byte) error { - type unmarshaler CreateSeriesRequest - var value unmarshaler - if err := json.Unmarshal(data, &value); err != nil { +func (c *CreateOauthAppRequestGoogle) UnmarshalJSON(data []byte) error { + type embed CreateOauthAppRequestGoogle + var unmarshaler = struct { + embed + SecretExpiresAt *internal.DateTime `json:"secret_expires_at,omitempty"` + }{ + embed: embed(*c), + } + if err := json.Unmarshal(data, &unmarshaler); err != nil { return err } - *c = CreateSeriesRequest(value) + *c = CreateOauthAppRequestGoogle(unmarshaler.embed) + c.SecretExpiresAt = unmarshaler.SecretExpiresAt.TimePtr() extraProperties, err := internal.ExtractExtraProperties(data, *c) if err != nil { return err @@ -9169,18 +9207,20 @@ func (c *CreateSeriesRequest) UnmarshalJSON(data []byte) error { return nil } -func (c *CreateSeriesRequest) MarshalJSON() ([]byte, error) { - type embed CreateSeriesRequest +func (c *CreateOauthAppRequestGoogle) MarshalJSON() ([]byte, error) { + type embed CreateOauthAppRequestGoogle var marshaler = struct { embed + SecretExpiresAt *internal.DateTime `json:"secret_expires_at,omitempty"` }{ - embed: embed(*c), + embed: embed(*c), + SecretExpiresAt: internal.NewOptionalDateTime(c.SecretExpiresAt), } explicitMarshaler := internal.HandleExplicitFields(marshaler, c.explicitFields) return json.Marshal(explicitMarshaler) } -func (c *CreateSeriesRequest) String() string { +func (c *CreateOauthAppRequestGoogle) String() string { if c == nil { return "" } @@ -9195,385 +9235,329 @@ func (c *CreateSeriesRequest) String() string { return fmt.Sprintf("%#v", c) } -type CreateSeriesRequestAnswersValue struct { - String string - StringList []string +var ( + createOauthAppRequestMicrosoftFieldClientID = big.NewInt(1 << 0) + createOauthAppRequestMicrosoftFieldClientSecret = big.NewInt(1 << 1) + createOauthAppRequestMicrosoftFieldTenantID = big.NewInt(1 << 2) + createOauthAppRequestMicrosoftFieldRedirectURI = big.NewInt(1 << 3) + createOauthAppRequestMicrosoftFieldCompletionURL = big.NewInt(1 << 4) + createOauthAppRequestMicrosoftFieldSecretExpiresAt = big.NewInt(1 << 5) +) - typ string +type CreateOauthAppRequestMicrosoft struct { + // The app's client ID at the provider. + ClientID string `json:"client_id" url:"client_id"` + // The app's client secret. Never returned. + ClientSecret string `json:"client_secret" url:"client_secret"` + // The Directory (tenant) ID, for an app that's only for your own tenant. Leave it out for a multi-tenant app. + TenantID *string `json:"tenant_id,omitempty" url:"tenant_id,omitempty"` + // A page on your own domain, registered with the provider, that forwards `code` and `state` to `coss_callback_url`. Google requires this for an external app, since it has to verify the redirect's domain as yours. Leave it out to use `coss_callback_url` directly. + RedirectURI *string `json:"redirect_uri,omitempty" url:"redirect_uri,omitempty"` + // Where the browser lands after a consent that didn't name a `return_url`, with `coss_calendar` set to `connected`, `denied` or `invalid`. Leave it out for a plain page saying what happened. + CompletionURL *string `json:"completion_url,omitempty" url:"completion_url,omitempty"` + // When the client secret expires. Owners and admins are warned 14 days before. + SecretExpiresAt *time.Time `json:"secret_expires_at,omitempty" url:"secret_expires_at,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + + extraProperties map[string]interface{} + rawJSON json.RawMessage } -func (c *CreateSeriesRequestAnswersValue) GetString() string { +func (c *CreateOauthAppRequestMicrosoft) GetClientID() string { if c == nil { return "" } - return c.String + return c.ClientID } -func (c *CreateSeriesRequestAnswersValue) GetStringList() []string { +func (c *CreateOauthAppRequestMicrosoft) GetClientSecret() string { if c == nil { - return nil + return "" } - return c.StringList + return c.ClientSecret } -func (c *CreateSeriesRequestAnswersValue) UnmarshalJSON(data []byte) error { - var valueString string - if err := json.Unmarshal(data, &valueString); err == nil { - c.typ = "String" - c.String = valueString +func (c *CreateOauthAppRequestMicrosoft) GetTenantID() *string { + if c == nil { return nil } - var valueStringList []string - if err := json.Unmarshal(data, &valueStringList); err == nil { - c.typ = "StringList" - c.StringList = valueStringList + return c.TenantID +} + +func (c *CreateOauthAppRequestMicrosoft) GetRedirectURI() *string { + if c == nil { return nil } - return fmt.Errorf("%s cannot be deserialized as a %T", data, c) + return c.RedirectURI } -func (c CreateSeriesRequestAnswersValue) MarshalJSON() ([]byte, error) { - if c.typ == "String" || c.String != "" { - return json.Marshal(c.String) - } - if c.typ == "StringList" || c.StringList != nil { - return json.Marshal(c.StringList) +func (c *CreateOauthAppRequestMicrosoft) GetCompletionURL() *string { + if c == nil { + return nil } - return nil, fmt.Errorf("type %T does not include a non-empty union type", c) + return c.CompletionURL } -type CreateSeriesRequestAnswersValueVisitor interface { - VisitString(string) error - VisitStringList([]string) error +func (c *CreateOauthAppRequestMicrosoft) GetSecretExpiresAt() *time.Time { + if c == nil { + return nil + } + return c.SecretExpiresAt } -func (c *CreateSeriesRequestAnswersValue) Accept(visitor CreateSeriesRequestAnswersValueVisitor) error { - if c.typ == "String" || c.String != "" { - return visitor.VisitString(c.String) +func (c *CreateOauthAppRequestMicrosoft) GetExtraProperties() map[string]interface{} { + if c == nil { + return nil } - if c.typ == "StringList" || c.StringList != nil { - return visitor.VisitStringList(c.StringList) + return c.extraProperties +} + +func (c *CreateOauthAppRequestMicrosoft) require(field *big.Int) { + next := new(big.Int) + if c.explicitFields != nil { + next.Set(c.explicitFields) } - return fmt.Errorf("type %T does not include a non-empty union type", c) + next.Or(next, field) + c.explicitFields = next } -type CreateSeriesRequestAttributesValue struct { - String string - StringList []string +// SetClientID sets the ClientID field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreateOauthAppRequestMicrosoft) SetClientID(clientID string) { + c.ClientID = clientID + c.require(createOauthAppRequestMicrosoftFieldClientID) +} - typ string +// SetClientSecret sets the ClientSecret field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreateOauthAppRequestMicrosoft) SetClientSecret(clientSecret string) { + c.ClientSecret = clientSecret + c.require(createOauthAppRequestMicrosoftFieldClientSecret) } -func (c *CreateSeriesRequestAttributesValue) GetString() string { - if c == nil { - return "" - } - return c.String +// SetTenantID sets the TenantID field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreateOauthAppRequestMicrosoft) SetTenantID(tenantID *string) { + c.TenantID = tenantID + c.require(createOauthAppRequestMicrosoftFieldTenantID) } -func (c *CreateSeriesRequestAttributesValue) GetStringList() []string { - if c == nil { - return nil - } - return c.StringList +// SetRedirectURI sets the RedirectURI field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreateOauthAppRequestMicrosoft) SetRedirectURI(redirectURI *string) { + c.RedirectURI = redirectURI + c.require(createOauthAppRequestMicrosoftFieldRedirectURI) } -func (c *CreateSeriesRequestAttributesValue) UnmarshalJSON(data []byte) error { - var valueString string - if err := json.Unmarshal(data, &valueString); err == nil { - c.typ = "String" - c.String = valueString - return nil - } - var valueStringList []string - if err := json.Unmarshal(data, &valueStringList); err == nil { - c.typ = "StringList" - c.StringList = valueStringList - return nil - } - return fmt.Errorf("%s cannot be deserialized as a %T", data, c) +// SetCompletionURL sets the CompletionURL field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreateOauthAppRequestMicrosoft) SetCompletionURL(completionURL *string) { + c.CompletionURL = completionURL + c.require(createOauthAppRequestMicrosoftFieldCompletionURL) } -func (c CreateSeriesRequestAttributesValue) MarshalJSON() ([]byte, error) { - if c.typ == "String" || c.String != "" { - return json.Marshal(c.String) +// SetSecretExpiresAt sets the SecretExpiresAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreateOauthAppRequestMicrosoft) SetSecretExpiresAt(secretExpiresAt *time.Time) { + c.SecretExpiresAt = secretExpiresAt + c.require(createOauthAppRequestMicrosoftFieldSecretExpiresAt) +} + +func (c *CreateOauthAppRequestMicrosoft) UnmarshalJSON(data []byte) error { + type embed CreateOauthAppRequestMicrosoft + var unmarshaler = struct { + embed + SecretExpiresAt *internal.DateTime `json:"secret_expires_at,omitempty"` + }{ + embed: embed(*c), } - if c.typ == "StringList" || c.StringList != nil { - return json.Marshal(c.StringList) + if err := json.Unmarshal(data, &unmarshaler); err != nil { + return err } - return nil, fmt.Errorf("type %T does not include a non-empty union type", c) + *c = CreateOauthAppRequestMicrosoft(unmarshaler.embed) + c.SecretExpiresAt = unmarshaler.SecretExpiresAt.TimePtr() + extraProperties, err := internal.ExtractExtraProperties(data, *c) + if err != nil { + return err + } + c.extraProperties = extraProperties + c.rawJSON = json.RawMessage(data) + return nil } -type CreateSeriesRequestAttributesValueVisitor interface { - VisitString(string) error - VisitStringList([]string) error +func (c *CreateOauthAppRequestMicrosoft) MarshalJSON() ([]byte, error) { + type embed CreateOauthAppRequestMicrosoft + var marshaler = struct { + embed + SecretExpiresAt *internal.DateTime `json:"secret_expires_at,omitempty"` + }{ + embed: embed(*c), + SecretExpiresAt: internal.NewOptionalDateTime(c.SecretExpiresAt), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, c.explicitFields) + return json.Marshal(explicitMarshaler) } -func (c *CreateSeriesRequestAttributesValue) Accept(visitor CreateSeriesRequestAttributesValueVisitor) error { - if c.typ == "String" || c.String != "" { - return visitor.VisitString(c.String) +func (c *CreateOauthAppRequestMicrosoft) String() string { + if c == nil { + return "" } - if c.typ == "StringList" || c.StringList != nil { - return visitor.VisitStringList(c.StringList) + if len(c.rawJSON) > 0 { + if value, err := internal.StringifyJSON(c.rawJSON); err == nil { + return value + } } - return fmt.Errorf("type %T does not include a non-empty union type", c) + if value, err := internal.StringifyJSON(c); err == nil { + return value + } + return fmt.Sprintf("%#v", c) } -// One of the event type's `locations`, with your link filled in if it has none. -type CreateSeriesRequestLocation struct { - Type string - Link *CreateSeriesRequestLocationLink - Phone *CreateSeriesRequestLocationPhone - InPerson *CreateSeriesRequestLocationInPerson - GoogleMeet *CreateSeriesRequestLocationGoogleMeet - MicrosoftTeams *CreateSeriesRequestLocationMicrosoftTeams - Zoom *CreateSeriesRequestLocationZoom +var ( + createOauthAppRequestZoomFieldClientID = big.NewInt(1 << 0) + createOauthAppRequestZoomFieldClientSecret = big.NewInt(1 << 1) + createOauthAppRequestZoomFieldWebhookSecret = big.NewInt(1 << 2) + createOauthAppRequestZoomFieldRedirectURI = big.NewInt(1 << 3) + createOauthAppRequestZoomFieldCompletionURL = big.NewInt(1 << 4) + createOauthAppRequestZoomFieldSecretExpiresAt = big.NewInt(1 << 5) +) - rawJSON json.RawMessage +type CreateOauthAppRequestZoom struct { + // The app's client ID at the provider. + ClientID string `json:"client_id" url:"client_id"` + // The app's client secret. Never returned. + ClientSecret string `json:"client_secret" url:"client_secret"` + // The Secret Token of your Zoom app, which signs its events at `zoom_event_url`. Never returned. + WebhookSecret *string `json:"webhook_secret,omitempty" url:"webhook_secret,omitempty"` + // A page on your own domain, registered with the provider, that forwards `code` and `state` to `coss_callback_url`. Google requires this for an external app, since it has to verify the redirect's domain as yours. Leave it out to use `coss_callback_url` directly. + RedirectURI *string `json:"redirect_uri,omitempty" url:"redirect_uri,omitempty"` + // Where the browser lands after a consent that didn't name a `return_url`, with `coss_calendar` set to `connected`, `denied` or `invalid`. Leave it out for a plain page saying what happened. + CompletionURL *string `json:"completion_url,omitempty" url:"completion_url,omitempty"` + // When the client secret expires. Owners and admins are warned 14 days before. + SecretExpiresAt *time.Time `json:"secret_expires_at,omitempty" url:"secret_expires_at,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + + extraProperties map[string]interface{} + rawJSON json.RawMessage } -func (c *CreateSeriesRequestLocation) GetType() string { +func (c *CreateOauthAppRequestZoom) GetClientID() string { if c == nil { return "" } - return c.Type + return c.ClientID } -func (c *CreateSeriesRequestLocation) GetLink() *CreateSeriesRequestLocationLink { +func (c *CreateOauthAppRequestZoom) GetClientSecret() string { if c == nil { - return nil + return "" } - return c.Link + return c.ClientSecret } -func (c *CreateSeriesRequestLocation) GetPhone() *CreateSeriesRequestLocationPhone { +func (c *CreateOauthAppRequestZoom) GetWebhookSecret() *string { if c == nil { return nil } - return c.Phone + return c.WebhookSecret } -func (c *CreateSeriesRequestLocation) GetInPerson() *CreateSeriesRequestLocationInPerson { +func (c *CreateOauthAppRequestZoom) GetRedirectURI() *string { if c == nil { return nil } - return c.InPerson + return c.RedirectURI } -func (c *CreateSeriesRequestLocation) GetGoogleMeet() *CreateSeriesRequestLocationGoogleMeet { +func (c *CreateOauthAppRequestZoom) GetCompletionURL() *string { if c == nil { return nil } - return c.GoogleMeet + return c.CompletionURL } -func (c *CreateSeriesRequestLocation) GetMicrosoftTeams() *CreateSeriesRequestLocationMicrosoftTeams { +func (c *CreateOauthAppRequestZoom) GetSecretExpiresAt() *time.Time { if c == nil { return nil } - return c.MicrosoftTeams + return c.SecretExpiresAt } -func (c *CreateSeriesRequestLocation) GetZoom() *CreateSeriesRequestLocationZoom { +func (c *CreateOauthAppRequestZoom) GetExtraProperties() map[string]interface{} { if c == nil { return nil } - return c.Zoom + return c.extraProperties } -func (c *CreateSeriesRequestLocation) UnmarshalJSON(data []byte) error { - var unmarshaler struct { - Type string `json:"type"` - } - if err := json.Unmarshal(data, &unmarshaler); err != nil { - return err - } - c.Type = unmarshaler.Type - if unmarshaler.Type == "" { - return fmt.Errorf("%T did not include discriminant type", c) +func (c *CreateOauthAppRequestZoom) require(field *big.Int) { + next := new(big.Int) + if c.explicitFields != nil { + next.Set(c.explicitFields) } - switch unmarshaler.Type { - case "link": - value := new(CreateSeriesRequestLocationLink) - if err := json.Unmarshal(data, &value); err != nil { - return err - } - c.Link = value - case "phone": - value := new(CreateSeriesRequestLocationPhone) - if err := json.Unmarshal(data, &value); err != nil { - return err - } - c.Phone = value - case "in_person": - value := new(CreateSeriesRequestLocationInPerson) - if err := json.Unmarshal(data, &value); err != nil { - return err - } - c.InPerson = value - case "google_meet": - value := new(CreateSeriesRequestLocationGoogleMeet) - if err := json.Unmarshal(data, &value); err != nil { - return err - } - c.GoogleMeet = value - case "microsoft_teams": - value := new(CreateSeriesRequestLocationMicrosoftTeams) - if err := json.Unmarshal(data, &value); err != nil { - return err - } - c.MicrosoftTeams = value - case "zoom": - value := new(CreateSeriesRequestLocationZoom) - if err := json.Unmarshal(data, &value); err != nil { - return err - } - c.Zoom = value - } - c.rawJSON = json.RawMessage(data) - return nil + next.Or(next, field) + c.explicitFields = next } -func (c CreateSeriesRequestLocation) MarshalJSON() ([]byte, error) { - if err := c.validate(); err != nil { - return nil, err - } - if c.Link != nil { - return internal.MarshalJSONWithExtraProperty(c.Link, "type", "link") - } - if c.Phone != nil { - return internal.MarshalJSONWithExtraProperty(c.Phone, "type", "phone") - } - if c.InPerson != nil { - return internal.MarshalJSONWithExtraProperty(c.InPerson, "type", "in_person") - } - if c.GoogleMeet != nil { - return internal.MarshalJSONWithExtraProperty(c.GoogleMeet, "type", "google_meet") - } - if c.MicrosoftTeams != nil { - return internal.MarshalJSONWithExtraProperty(c.MicrosoftTeams, "type", "microsoft_teams") - } - if c.Zoom != nil { - return internal.MarshalJSONWithExtraProperty(c.Zoom, "type", "zoom") - } - if len(c.rawJSON) > 0 { - return c.rawJSON, nil - } - return nil, fmt.Errorf("type %T does not define a non-empty union type", c) +// SetClientID sets the ClientID field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreateOauthAppRequestZoom) SetClientID(clientID string) { + c.ClientID = clientID + c.require(createOauthAppRequestZoomFieldClientID) } -type CreateSeriesRequestLocationVisitor interface { - VisitLink(*CreateSeriesRequestLocationLink) error - VisitPhone(*CreateSeriesRequestLocationPhone) error - VisitInPerson(*CreateSeriesRequestLocationInPerson) error - VisitGoogleMeet(*CreateSeriesRequestLocationGoogleMeet) error - VisitMicrosoftTeams(*CreateSeriesRequestLocationMicrosoftTeams) error - VisitZoom(*CreateSeriesRequestLocationZoom) error +// SetClientSecret sets the ClientSecret field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreateOauthAppRequestZoom) SetClientSecret(clientSecret string) { + c.ClientSecret = clientSecret + c.require(createOauthAppRequestZoomFieldClientSecret) } -func (c *CreateSeriesRequestLocation) Accept(visitor CreateSeriesRequestLocationVisitor) error { - if c.Link != nil { - return visitor.VisitLink(c.Link) - } - if c.Phone != nil { - return visitor.VisitPhone(c.Phone) - } - if c.InPerson != nil { - return visitor.VisitInPerson(c.InPerson) - } - if c.GoogleMeet != nil { - return visitor.VisitGoogleMeet(c.GoogleMeet) - } - if c.MicrosoftTeams != nil { - return visitor.VisitMicrosoftTeams(c.MicrosoftTeams) - } - if c.Zoom != nil { - return visitor.VisitZoom(c.Zoom) - } - return fmt.Errorf("type %T does not define a non-empty union type", c) +// SetWebhookSecret sets the WebhookSecret field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreateOauthAppRequestZoom) SetWebhookSecret(webhookSecret *string) { + c.WebhookSecret = webhookSecret + c.require(createOauthAppRequestZoomFieldWebhookSecret) } -func (c *CreateSeriesRequestLocation) validate() error { - if c == nil { - return fmt.Errorf("type %T is nil", c) - } - var fields []string - if c.Link != nil { - fields = append(fields, "link") - } - if c.Phone != nil { - fields = append(fields, "phone") - } - if c.InPerson != nil { - fields = append(fields, "in_person") - } - if c.GoogleMeet != nil { - fields = append(fields, "google_meet") - } - if c.MicrosoftTeams != nil { - fields = append(fields, "microsoft_teams") - } - if c.Zoom != nil { - fields = append(fields, "zoom") - } - if len(fields) == 0 { - if c.Type != "" { - if len(c.rawJSON) > 0 { - return nil - } - return fmt.Errorf("type %T defines a discriminant set to %q but the field is not set", c, c.Type) - } - return fmt.Errorf("type %T is empty", c) - } - if len(fields) > 1 { - return fmt.Errorf("type %T defines values for %s, but only one value is allowed", c, fields) - } - if c.Type != "" { - field := fields[0] - if c.Type != field { - return fmt.Errorf( - "type %T defines a discriminant set to %q, but it does not match the %T field; either remove or update the discriminant to match", - c, - c.Type, - c, - ) - } - } - return nil +// SetRedirectURI sets the RedirectURI field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreateOauthAppRequestZoom) SetRedirectURI(redirectURI *string) { + c.RedirectURI = redirectURI + c.require(createOauthAppRequestZoomFieldRedirectURI) } -type CreateSeriesRequestLocationGoogleMeet struct { - - // Private bitmask of fields set to an explicit value and therefore not to be omitted - explicitFields *big.Int `json:"-" url:"-"` - - extraProperties map[string]interface{} - rawJSON json.RawMessage +// SetCompletionURL sets the CompletionURL field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreateOauthAppRequestZoom) SetCompletionURL(completionURL *string) { + c.CompletionURL = completionURL + c.require(createOauthAppRequestZoomFieldCompletionURL) } -func (c *CreateSeriesRequestLocationGoogleMeet) GetExtraProperties() map[string]interface{} { - if c == nil { - return nil - } - return c.extraProperties +// SetSecretExpiresAt sets the SecretExpiresAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreateOauthAppRequestZoom) SetSecretExpiresAt(secretExpiresAt *time.Time) { + c.SecretExpiresAt = secretExpiresAt + c.require(createOauthAppRequestZoomFieldSecretExpiresAt) } -func (c *CreateSeriesRequestLocationGoogleMeet) require(field *big.Int) { - next := new(big.Int) - if c.explicitFields != nil { - next.Set(c.explicitFields) +func (c *CreateOauthAppRequestZoom) UnmarshalJSON(data []byte) error { + type embed CreateOauthAppRequestZoom + var unmarshaler = struct { + embed + SecretExpiresAt *internal.DateTime `json:"secret_expires_at,omitempty"` + }{ + embed: embed(*c), } - next.Or(next, field) - c.explicitFields = next -} - -func (c *CreateSeriesRequestLocationGoogleMeet) UnmarshalJSON(data []byte) error { - type unmarshaler CreateSeriesRequestLocationGoogleMeet - var value unmarshaler - if err := json.Unmarshal(data, &value); err != nil { + if err := json.Unmarshal(data, &unmarshaler); err != nil { return err } - *c = CreateSeriesRequestLocationGoogleMeet(value) + *c = CreateOauthAppRequestZoom(unmarshaler.embed) + c.SecretExpiresAt = unmarshaler.SecretExpiresAt.TimePtr() extraProperties, err := internal.ExtractExtraProperties(data, *c) if err != nil { return err @@ -9583,18 +9567,20 @@ func (c *CreateSeriesRequestLocationGoogleMeet) UnmarshalJSON(data []byte) error return nil } -func (c *CreateSeriesRequestLocationGoogleMeet) MarshalJSON() ([]byte, error) { - type embed CreateSeriesRequestLocationGoogleMeet +func (c *CreateOauthAppRequestZoom) MarshalJSON() ([]byte, error) { + type embed CreateOauthAppRequestZoom var marshaler = struct { embed + SecretExpiresAt *internal.DateTime `json:"secret_expires_at,omitempty"` }{ - embed: embed(*c), + embed: embed(*c), + SecretExpiresAt: internal.NewOptionalDateTime(c.SecretExpiresAt), } explicitMarshaler := internal.HandleExplicitFields(marshaler, c.explicitFields) return json.Marshal(explicitMarshaler) } -func (c *CreateSeriesRequestLocationGoogleMeet) String() string { +func (c *CreateOauthAppRequestZoom) String() string { if c == nil { return "" } @@ -9610,17 +9596,44 @@ func (c *CreateSeriesRequestLocationGoogleMeet) String() string { } var ( - createSeriesRequestLocationInPersonFieldAddress = big.NewInt(1 << 0) + createSeriesRequestFieldEventType = big.NewInt(1 << 0) + createSeriesRequestFieldStart = big.NewInt(1 << 1) + createSeriesRequestFieldHost = big.NewInt(1 << 2) + createSeriesRequestFieldAttributes = big.NewInt(1 << 3) + createSeriesRequestFieldDurationMinutes = big.NewInt(1 << 4) + createSeriesRequestFieldAttendee = big.NewInt(1 << 5) + createSeriesRequestFieldGuests = big.NewInt(1 << 6) + createSeriesRequestFieldAnswers = big.NewInt(1 << 7) + createSeriesRequestFieldLocation = big.NewInt(1 << 8) + createSeriesRequestFieldMetadata = big.NewInt(1 << 9) + createSeriesRequestFieldRecurrence = big.NewInt(1 << 10) + createSeriesRequestFieldOnConflict = big.NewInt(1 << 11) ) -// createSeriesRequestLocationInPersonNullableFields maps the wire names of CreateSeriesRequestLocationInPerson's nullable fields (required or optional) to their field bits. -var createSeriesRequestLocationInPersonNullableFields = map[string]*big.Int{ - "address": createSeriesRequestLocationInPersonFieldAddress, -} - -type CreateSeriesRequestLocationInPerson struct { - // The address to meet at. `null` on an event type means the booking supplies its own. - Address *string `json:"address,omitempty" url:"address,omitempty"` +type CreateSeriesRequest struct { + // The event type's id or uid. + EventType string `json:"event_type" url:"event_type"` + // An ISO 8601 instant with an offset. + Start string `json:"start" url:"start"` + // A specific host (id or uid). Default: chosen fairly from those free. + Host *string `json:"host,omitempty" url:"host,omitempty"` + // Only choose among pool hosts matching all of these. + Attributes map[string]*CreateSeriesRequestAttributesValue `json:"attributes,omitempty" url:"attributes,omitempty"` + // One of the event type's `duration_options`. + DurationMinutes *int `json:"duration_minutes,omitempty" url:"duration_minutes,omitempty"` + Attendee *SchedulingAttendeeInput `json:"attendee" url:"attendee"` + // Up to the event type's `max_guests`. + Guests []*SchedulingGuestInput `json:"guests,omitempty" url:"guests,omitempty"` + // Answers to the event type's questions. Stored encrypted, and returned only by retrieving the booking. + Answers map[string]*CreateSeriesRequestAnswersValue `json:"answers,omitempty" url:"answers,omitempty"` + // One of the event type's `locations`, with your link filled in if it has none. + Location *CreateSeriesRequestLocation `json:"location,omitempty" url:"location,omitempty"` + // Your own key-value pairs. Don't put sensitive data here. + Metadata map[string]string `json:"metadata,omitempty" url:"metadata,omitempty"` + // How often the booking repeats, at the attendee's local time. + Recurrence *CreateSeriesRequestRecurrence `json:"recurrence" url:"recurrence"` + // If an occurrence isn't free: book nothing, or book the rest and report it. + OnConflict *CreateSeriesRequestOnConflict `json:"on_conflict,omitempty" url:"on_conflict,omitempty"` // Private bitmask of fields set to an explicit value and therefore not to be omitted explicitFields *big.Int `json:"-" url:"-"` @@ -9629,120 +9642,98 @@ type CreateSeriesRequestLocationInPerson struct { rawJSON json.RawMessage } -func (c *CreateSeriesRequestLocationInPerson) GetAddress() *string { +func (c *CreateSeriesRequest) GetEventType() string { if c == nil { - return nil + return "" } - return c.Address + return c.EventType } -func (c *CreateSeriesRequestLocationInPerson) GetExtraProperties() map[string]interface{} { +func (c *CreateSeriesRequest) GetStart() string { if c == nil { - return nil + return "" } - return c.extraProperties + return c.Start } -func (c *CreateSeriesRequestLocationInPerson) require(field *big.Int) { - next := new(big.Int) - if c.explicitFields != nil { - next.Set(c.explicitFields) +func (c *CreateSeriesRequest) GetHost() *string { + if c == nil { + return nil } - next.Or(next, field) - c.explicitFields = next + return c.Host } -// SetAddress sets the Address field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (c *CreateSeriesRequestLocationInPerson) SetAddress(address *string) { - c.Address = address - c.require(createSeriesRequestLocationInPersonFieldAddress) +func (c *CreateSeriesRequest) GetAttributes() map[string]*CreateSeriesRequestAttributesValue { + if c == nil { + return nil + } + return c.Attributes } -func (c *CreateSeriesRequestLocationInPerson) UnmarshalJSON(data []byte) error { - type unmarshaler CreateSeriesRequestLocationInPerson - var value unmarshaler - if err := json.Unmarshal(data, &value); err != nil { - return err - } - *c = CreateSeriesRequestLocationInPerson(value) - extraProperties, err := internal.ExtractExtraProperties(data, *c) - if err != nil { - return err - } - c.extraProperties = extraProperties - presentFields, err := internal.ExplicitFieldsFromJSON(data, createSeriesRequestLocationInPersonNullableFields) - if err != nil { - return err - } - if presentFields != nil { - c.require(presentFields) +func (c *CreateSeriesRequest) GetDurationMinutes() *int { + if c == nil { + return nil } - c.rawJSON = json.RawMessage(data) - return nil + return c.DurationMinutes } -func (c *CreateSeriesRequestLocationInPerson) MarshalJSON() ([]byte, error) { - type embed CreateSeriesRequestLocationInPerson - var marshaler = struct { - embed - }{ - embed: embed(*c), +func (c *CreateSeriesRequest) GetAttendee() *SchedulingAttendeeInput { + if c == nil { + return nil } - explicitMarshaler := internal.HandleExplicitFields(marshaler, c.explicitFields) - return json.Marshal(explicitMarshaler) + return c.Attendee } -func (c *CreateSeriesRequestLocationInPerson) String() string { +func (c *CreateSeriesRequest) GetGuests() []*SchedulingGuestInput { if c == nil { - return "" - } - if len(c.rawJSON) > 0 { - if value, err := internal.StringifyJSON(c.rawJSON); err == nil { - return value - } - } - if value, err := internal.StringifyJSON(c); err == nil { - return value + return nil } - return fmt.Sprintf("%#v", c) + return c.Guests } -var ( - createSeriesRequestLocationLinkFieldURL = big.NewInt(1 << 0) -) - -// createSeriesRequestLocationLinkNullableFields maps the wire names of CreateSeriesRequestLocationLink's nullable fields (required or optional) to their field bits. -var createSeriesRequestLocationLinkNullableFields = map[string]*big.Int{ - "url": createSeriesRequestLocationLinkFieldURL, +func (c *CreateSeriesRequest) GetAnswers() map[string]*CreateSeriesRequestAnswersValue { + if c == nil { + return nil + } + return c.Answers } -type CreateSeriesRequestLocationLink struct { - // The meeting link. `null` on an event type means the booking supplies its own. - URL *string `json:"url,omitempty" url:"url,omitempty"` +func (c *CreateSeriesRequest) GetLocation() *CreateSeriesRequestLocation { + if c == nil { + return nil + } + return c.Location +} - // Private bitmask of fields set to an explicit value and therefore not to be omitted - explicitFields *big.Int `json:"-" url:"-"` +func (c *CreateSeriesRequest) GetMetadata() map[string]string { + if c == nil { + return nil + } + return c.Metadata +} - extraProperties map[string]interface{} - rawJSON json.RawMessage +func (c *CreateSeriesRequest) GetRecurrence() *CreateSeriesRequestRecurrence { + if c == nil { + return nil + } + return c.Recurrence } -func (c *CreateSeriesRequestLocationLink) GetURL() *string { +func (c *CreateSeriesRequest) GetOnConflict() *CreateSeriesRequestOnConflict { if c == nil { return nil } - return c.URL + return c.OnConflict } -func (c *CreateSeriesRequestLocationLink) GetExtraProperties() map[string]interface{} { +func (c *CreateSeriesRequest) GetExtraProperties() map[string]interface{} { if c == nil { return nil } return c.extraProperties } -func (c *CreateSeriesRequestLocationLink) require(field *big.Int) { +func (c *CreateSeriesRequest) require(field *big.Int) { next := new(big.Int) if c.explicitFields != nil { next.Set(c.explicitFields) @@ -9751,94 +9742,97 @@ func (c *CreateSeriesRequestLocationLink) require(field *big.Int) { c.explicitFields = next } -// SetURL sets the URL field and marks it as non-optional; +// SetEventType sets the EventType field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (c *CreateSeriesRequestLocationLink) SetURL(url *string) { - c.URL = url - c.require(createSeriesRequestLocationLinkFieldURL) +func (c *CreateSeriesRequest) SetEventType(eventType string) { + c.EventType = eventType + c.require(createSeriesRequestFieldEventType) } -func (c *CreateSeriesRequestLocationLink) UnmarshalJSON(data []byte) error { - type unmarshaler CreateSeriesRequestLocationLink - var value unmarshaler - if err := json.Unmarshal(data, &value); err != nil { - return err - } - *c = CreateSeriesRequestLocationLink(value) - extraProperties, err := internal.ExtractExtraProperties(data, *c) - if err != nil { - return err - } - c.extraProperties = extraProperties - presentFields, err := internal.ExplicitFieldsFromJSON(data, createSeriesRequestLocationLinkNullableFields) - if err != nil { - return err - } - if presentFields != nil { - c.require(presentFields) - } - c.rawJSON = json.RawMessage(data) - return nil +// SetStart sets the Start field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreateSeriesRequest) SetStart(start string) { + c.Start = start + c.require(createSeriesRequestFieldStart) } -func (c *CreateSeriesRequestLocationLink) MarshalJSON() ([]byte, error) { - type embed CreateSeriesRequestLocationLink - var marshaler = struct { - embed - }{ - embed: embed(*c), - } - explicitMarshaler := internal.HandleExplicitFields(marshaler, c.explicitFields) - return json.Marshal(explicitMarshaler) +// SetHost sets the Host field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreateSeriesRequest) SetHost(host *string) { + c.Host = host + c.require(createSeriesRequestFieldHost) } -func (c *CreateSeriesRequestLocationLink) String() string { - if c == nil { - return "" - } - if len(c.rawJSON) > 0 { - if value, err := internal.StringifyJSON(c.rawJSON); err == nil { - return value - } - } - if value, err := internal.StringifyJSON(c); err == nil { - return value - } - return fmt.Sprintf("%#v", c) +// SetAttributes sets the Attributes field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreateSeriesRequest) SetAttributes(attributes map[string]*CreateSeriesRequestAttributesValue) { + c.Attributes = attributes + c.require(createSeriesRequestFieldAttributes) } -type CreateSeriesRequestLocationMicrosoftTeams struct { +// SetDurationMinutes sets the DurationMinutes field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreateSeriesRequest) SetDurationMinutes(durationMinutes *int) { + c.DurationMinutes = durationMinutes + c.require(createSeriesRequestFieldDurationMinutes) +} - // Private bitmask of fields set to an explicit value and therefore not to be omitted - explicitFields *big.Int `json:"-" url:"-"` +// SetAttendee sets the Attendee field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreateSeriesRequest) SetAttendee(attendee *SchedulingAttendeeInput) { + c.Attendee = attendee + c.require(createSeriesRequestFieldAttendee) +} - extraProperties map[string]interface{} - rawJSON json.RawMessage +// SetGuests sets the Guests field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreateSeriesRequest) SetGuests(guests []*SchedulingGuestInput) { + c.Guests = guests + c.require(createSeriesRequestFieldGuests) } -func (c *CreateSeriesRequestLocationMicrosoftTeams) GetExtraProperties() map[string]interface{} { - if c == nil { - return nil - } - return c.extraProperties +// SetAnswers sets the Answers field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreateSeriesRequest) SetAnswers(answers map[string]*CreateSeriesRequestAnswersValue) { + c.Answers = answers + c.require(createSeriesRequestFieldAnswers) } -func (c *CreateSeriesRequestLocationMicrosoftTeams) require(field *big.Int) { - next := new(big.Int) - if c.explicitFields != nil { - next.Set(c.explicitFields) - } - next.Or(next, field) - c.explicitFields = next +// SetLocation sets the Location field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreateSeriesRequest) SetLocation(location *CreateSeriesRequestLocation) { + c.Location = location + c.require(createSeriesRequestFieldLocation) } -func (c *CreateSeriesRequestLocationMicrosoftTeams) UnmarshalJSON(data []byte) error { - type unmarshaler CreateSeriesRequestLocationMicrosoftTeams +// SetMetadata sets the Metadata field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreateSeriesRequest) SetMetadata(metadata map[string]string) { + c.Metadata = metadata + c.require(createSeriesRequestFieldMetadata) +} + +// SetRecurrence sets the Recurrence field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreateSeriesRequest) SetRecurrence(recurrence *CreateSeriesRequestRecurrence) { + c.Recurrence = recurrence + c.require(createSeriesRequestFieldRecurrence) +} + +// SetOnConflict sets the OnConflict field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreateSeriesRequest) SetOnConflict(onConflict *CreateSeriesRequestOnConflict) { + c.OnConflict = onConflict + c.require(createSeriesRequestFieldOnConflict) +} + +func (c *CreateSeriesRequest) UnmarshalJSON(data []byte) error { + type unmarshaler CreateSeriesRequest var value unmarshaler if err := json.Unmarshal(data, &value); err != nil { return err } - *c = CreateSeriesRequestLocationMicrosoftTeams(value) + *c = CreateSeriesRequest(value) extraProperties, err := internal.ExtractExtraProperties(data, *c) if err != nil { return err @@ -9848,8 +9842,8 @@ func (c *CreateSeriesRequestLocationMicrosoftTeams) UnmarshalJSON(data []byte) e return nil } -func (c *CreateSeriesRequestLocationMicrosoftTeams) MarshalJSON() ([]byte, error) { - type embed CreateSeriesRequestLocationMicrosoftTeams +func (c *CreateSeriesRequest) MarshalJSON() ([]byte, error) { + type embed CreateSeriesRequest var marshaler = struct { embed }{ @@ -9859,7 +9853,7 @@ func (c *CreateSeriesRequestLocationMicrosoftTeams) MarshalJSON() ([]byte, error return json.Marshal(explicitMarshaler) } -func (c *CreateSeriesRequestLocationMicrosoftTeams) String() string { +func (c *CreateSeriesRequest) String() string { if c == nil { return "" } @@ -9874,41 +9868,370 @@ func (c *CreateSeriesRequestLocationMicrosoftTeams) String() string { return fmt.Sprintf("%#v", c) } -var ( - createSeriesRequestLocationPhoneFieldNumber = big.NewInt(1 << 0) -) +type CreateSeriesRequestAnswersValue struct { + String string + StringList []string -// createSeriesRequestLocationPhoneNullableFields maps the wire names of CreateSeriesRequestLocationPhone's nullable fields (required or optional) to their field bits. -var createSeriesRequestLocationPhoneNullableFields = map[string]*big.Int{ - "number": createSeriesRequestLocationPhoneFieldNumber, + typ string } -type CreateSeriesRequestLocationPhone struct { - // The phone number to call. `null` on an event type means the booking supplies its own. - Number *string `json:"number,omitempty" url:"number,omitempty"` +func (c *CreateSeriesRequestAnswersValue) GetString() string { + if c == nil { + return "" + } + return c.String +} - // Private bitmask of fields set to an explicit value and therefore not to be omitted - explicitFields *big.Int `json:"-" url:"-"` +func (c *CreateSeriesRequestAnswersValue) GetStringList() []string { + if c == nil { + return nil + } + return c.StringList +} - extraProperties map[string]interface{} - rawJSON json.RawMessage +func (c *CreateSeriesRequestAnswersValue) UnmarshalJSON(data []byte) error { + var valueString string + if err := json.Unmarshal(data, &valueString); err == nil { + c.typ = "String" + c.String = valueString + return nil + } + var valueStringList []string + if err := json.Unmarshal(data, &valueStringList); err == nil { + c.typ = "StringList" + c.StringList = valueStringList + return nil + } + return fmt.Errorf("%s cannot be deserialized as a %T", data, c) } -func (c *CreateSeriesRequestLocationPhone) GetNumber() *string { +func (c CreateSeriesRequestAnswersValue) MarshalJSON() ([]byte, error) { + if c.typ == "String" || c.String != "" { + return json.Marshal(c.String) + } + if c.typ == "StringList" || c.StringList != nil { + return json.Marshal(c.StringList) + } + return nil, fmt.Errorf("type %T does not include a non-empty union type", c) +} + +type CreateSeriesRequestAnswersValueVisitor interface { + VisitString(string) error + VisitStringList([]string) error +} + +func (c *CreateSeriesRequestAnswersValue) Accept(visitor CreateSeriesRequestAnswersValueVisitor) error { + if c.typ == "String" || c.String != "" { + return visitor.VisitString(c.String) + } + if c.typ == "StringList" || c.StringList != nil { + return visitor.VisitStringList(c.StringList) + } + return fmt.Errorf("type %T does not include a non-empty union type", c) +} + +type CreateSeriesRequestAttributesValue struct { + String string + StringList []string + + typ string +} + +func (c *CreateSeriesRequestAttributesValue) GetString() string { + if c == nil { + return "" + } + return c.String +} + +func (c *CreateSeriesRequestAttributesValue) GetStringList() []string { if c == nil { return nil } - return c.Number + return c.StringList } -func (c *CreateSeriesRequestLocationPhone) GetExtraProperties() map[string]interface{} { +func (c *CreateSeriesRequestAttributesValue) UnmarshalJSON(data []byte) error { + var valueString string + if err := json.Unmarshal(data, &valueString); err == nil { + c.typ = "String" + c.String = valueString + return nil + } + var valueStringList []string + if err := json.Unmarshal(data, &valueStringList); err == nil { + c.typ = "StringList" + c.StringList = valueStringList + return nil + } + return fmt.Errorf("%s cannot be deserialized as a %T", data, c) +} + +func (c CreateSeriesRequestAttributesValue) MarshalJSON() ([]byte, error) { + if c.typ == "String" || c.String != "" { + return json.Marshal(c.String) + } + if c.typ == "StringList" || c.StringList != nil { + return json.Marshal(c.StringList) + } + return nil, fmt.Errorf("type %T does not include a non-empty union type", c) +} + +type CreateSeriesRequestAttributesValueVisitor interface { + VisitString(string) error + VisitStringList([]string) error +} + +func (c *CreateSeriesRequestAttributesValue) Accept(visitor CreateSeriesRequestAttributesValueVisitor) error { + if c.typ == "String" || c.String != "" { + return visitor.VisitString(c.String) + } + if c.typ == "StringList" || c.StringList != nil { + return visitor.VisitStringList(c.StringList) + } + return fmt.Errorf("type %T does not include a non-empty union type", c) +} + +// One of the event type's `locations`, with your link filled in if it has none. +type CreateSeriesRequestLocation struct { + Type string + Link *CreateSeriesRequestLocationLink + Phone *CreateSeriesRequestLocationPhone + InPerson *CreateSeriesRequestLocationInPerson + GoogleMeet *CreateSeriesRequestLocationGoogleMeet + MicrosoftTeams *CreateSeriesRequestLocationMicrosoftTeams + Zoom *CreateSeriesRequestLocationZoom + + rawJSON json.RawMessage +} + +func (c *CreateSeriesRequestLocation) GetType() string { + if c == nil { + return "" + } + return c.Type +} + +func (c *CreateSeriesRequestLocation) GetLink() *CreateSeriesRequestLocationLink { + if c == nil { + return nil + } + return c.Link +} + +func (c *CreateSeriesRequestLocation) GetPhone() *CreateSeriesRequestLocationPhone { + if c == nil { + return nil + } + return c.Phone +} + +func (c *CreateSeriesRequestLocation) GetInPerson() *CreateSeriesRequestLocationInPerson { + if c == nil { + return nil + } + return c.InPerson +} + +func (c *CreateSeriesRequestLocation) GetGoogleMeet() *CreateSeriesRequestLocationGoogleMeet { + if c == nil { + return nil + } + return c.GoogleMeet +} + +func (c *CreateSeriesRequestLocation) GetMicrosoftTeams() *CreateSeriesRequestLocationMicrosoftTeams { + if c == nil { + return nil + } + return c.MicrosoftTeams +} + +func (c *CreateSeriesRequestLocation) GetZoom() *CreateSeriesRequestLocationZoom { + if c == nil { + return nil + } + return c.Zoom +} + +func (c *CreateSeriesRequestLocation) UnmarshalJSON(data []byte) error { + var unmarshaler struct { + Type string `json:"type"` + } + if err := json.Unmarshal(data, &unmarshaler); err != nil { + return err + } + c.Type = unmarshaler.Type + if unmarshaler.Type == "" { + return fmt.Errorf("%T did not include discriminant type", c) + } + switch unmarshaler.Type { + case "link": + value := new(CreateSeriesRequestLocationLink) + if err := json.Unmarshal(data, &value); err != nil { + return err + } + c.Link = value + case "phone": + value := new(CreateSeriesRequestLocationPhone) + if err := json.Unmarshal(data, &value); err != nil { + return err + } + c.Phone = value + case "in_person": + value := new(CreateSeriesRequestLocationInPerson) + if err := json.Unmarshal(data, &value); err != nil { + return err + } + c.InPerson = value + case "google_meet": + value := new(CreateSeriesRequestLocationGoogleMeet) + if err := json.Unmarshal(data, &value); err != nil { + return err + } + c.GoogleMeet = value + case "microsoft_teams": + value := new(CreateSeriesRequestLocationMicrosoftTeams) + if err := json.Unmarshal(data, &value); err != nil { + return err + } + c.MicrosoftTeams = value + case "zoom": + value := new(CreateSeriesRequestLocationZoom) + if err := json.Unmarshal(data, &value); err != nil { + return err + } + c.Zoom = value + } + c.rawJSON = json.RawMessage(data) + return nil +} + +func (c CreateSeriesRequestLocation) MarshalJSON() ([]byte, error) { + if err := c.validate(); err != nil { + return nil, err + } + if c.Link != nil { + return internal.MarshalJSONWithExtraProperty(c.Link, "type", "link") + } + if c.Phone != nil { + return internal.MarshalJSONWithExtraProperty(c.Phone, "type", "phone") + } + if c.InPerson != nil { + return internal.MarshalJSONWithExtraProperty(c.InPerson, "type", "in_person") + } + if c.GoogleMeet != nil { + return internal.MarshalJSONWithExtraProperty(c.GoogleMeet, "type", "google_meet") + } + if c.MicrosoftTeams != nil { + return internal.MarshalJSONWithExtraProperty(c.MicrosoftTeams, "type", "microsoft_teams") + } + if c.Zoom != nil { + return internal.MarshalJSONWithExtraProperty(c.Zoom, "type", "zoom") + } + if len(c.rawJSON) > 0 { + return c.rawJSON, nil + } + return nil, fmt.Errorf("type %T does not define a non-empty union type", c) +} + +type CreateSeriesRequestLocationVisitor interface { + VisitLink(*CreateSeriesRequestLocationLink) error + VisitPhone(*CreateSeriesRequestLocationPhone) error + VisitInPerson(*CreateSeriesRequestLocationInPerson) error + VisitGoogleMeet(*CreateSeriesRequestLocationGoogleMeet) error + VisitMicrosoftTeams(*CreateSeriesRequestLocationMicrosoftTeams) error + VisitZoom(*CreateSeriesRequestLocationZoom) error +} + +func (c *CreateSeriesRequestLocation) Accept(visitor CreateSeriesRequestLocationVisitor) error { + if c.Link != nil { + return visitor.VisitLink(c.Link) + } + if c.Phone != nil { + return visitor.VisitPhone(c.Phone) + } + if c.InPerson != nil { + return visitor.VisitInPerson(c.InPerson) + } + if c.GoogleMeet != nil { + return visitor.VisitGoogleMeet(c.GoogleMeet) + } + if c.MicrosoftTeams != nil { + return visitor.VisitMicrosoftTeams(c.MicrosoftTeams) + } + if c.Zoom != nil { + return visitor.VisitZoom(c.Zoom) + } + return fmt.Errorf("type %T does not define a non-empty union type", c) +} + +func (c *CreateSeriesRequestLocation) validate() error { + if c == nil { + return fmt.Errorf("type %T is nil", c) + } + var fields []string + if c.Link != nil { + fields = append(fields, "link") + } + if c.Phone != nil { + fields = append(fields, "phone") + } + if c.InPerson != nil { + fields = append(fields, "in_person") + } + if c.GoogleMeet != nil { + fields = append(fields, "google_meet") + } + if c.MicrosoftTeams != nil { + fields = append(fields, "microsoft_teams") + } + if c.Zoom != nil { + fields = append(fields, "zoom") + } + if len(fields) == 0 { + if c.Type != "" { + if len(c.rawJSON) > 0 { + return nil + } + return fmt.Errorf("type %T defines a discriminant set to %q but the field is not set", c, c.Type) + } + return fmt.Errorf("type %T is empty", c) + } + if len(fields) > 1 { + return fmt.Errorf("type %T defines values for %s, but only one value is allowed", c, fields) + } + if c.Type != "" { + field := fields[0] + if c.Type != field { + return fmt.Errorf( + "type %T defines a discriminant set to %q, but it does not match the %T field; either remove or update the discriminant to match", + c, + c.Type, + c, + ) + } + } + return nil +} + +type CreateSeriesRequestLocationGoogleMeet struct { + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + + extraProperties map[string]interface{} + rawJSON json.RawMessage +} + +func (c *CreateSeriesRequestLocationGoogleMeet) GetExtraProperties() map[string]interface{} { if c == nil { return nil } return c.extraProperties } -func (c *CreateSeriesRequestLocationPhone) require(field *big.Int) { +func (c *CreateSeriesRequestLocationGoogleMeet) require(field *big.Int) { next := new(big.Int) if c.explicitFields != nil { next.Set(c.explicitFields) @@ -9917,38 +10240,24 @@ func (c *CreateSeriesRequestLocationPhone) require(field *big.Int) { c.explicitFields = next } -// SetNumber sets the Number field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (c *CreateSeriesRequestLocationPhone) SetNumber(number *string) { - c.Number = number - c.require(createSeriesRequestLocationPhoneFieldNumber) -} - -func (c *CreateSeriesRequestLocationPhone) UnmarshalJSON(data []byte) error { - type unmarshaler CreateSeriesRequestLocationPhone +func (c *CreateSeriesRequestLocationGoogleMeet) UnmarshalJSON(data []byte) error { + type unmarshaler CreateSeriesRequestLocationGoogleMeet var value unmarshaler if err := json.Unmarshal(data, &value); err != nil { return err } - *c = CreateSeriesRequestLocationPhone(value) + *c = CreateSeriesRequestLocationGoogleMeet(value) extraProperties, err := internal.ExtractExtraProperties(data, *c) if err != nil { return err } c.extraProperties = extraProperties - presentFields, err := internal.ExplicitFieldsFromJSON(data, createSeriesRequestLocationPhoneNullableFields) - if err != nil { - return err - } - if presentFields != nil { - c.require(presentFields) - } c.rawJSON = json.RawMessage(data) return nil } -func (c *CreateSeriesRequestLocationPhone) MarshalJSON() ([]byte, error) { - type embed CreateSeriesRequestLocationPhone +func (c *CreateSeriesRequestLocationGoogleMeet) MarshalJSON() ([]byte, error) { + type embed CreateSeriesRequestLocationGoogleMeet var marshaler = struct { embed }{ @@ -9958,7 +10267,7 @@ func (c *CreateSeriesRequestLocationPhone) MarshalJSON() ([]byte, error) { return json.Marshal(explicitMarshaler) } -func (c *CreateSeriesRequestLocationPhone) String() string { +func (c *CreateSeriesRequestLocationGoogleMeet) String() string { if c == nil { return "" } @@ -9974,17 +10283,17 @@ func (c *CreateSeriesRequestLocationPhone) String() string { } var ( - createSeriesRequestLocationZoomFieldURL = big.NewInt(1 << 0) + createSeriesRequestLocationInPersonFieldAddress = big.NewInt(1 << 0) ) -// createSeriesRequestLocationZoomNullableFields maps the wire names of CreateSeriesRequestLocationZoom's nullable fields (required or optional) to their field bits. -var createSeriesRequestLocationZoomNullableFields = map[string]*big.Int{ - "url": createSeriesRequestLocationZoomFieldURL, +// createSeriesRequestLocationInPersonNullableFields maps the wire names of CreateSeriesRequestLocationInPerson's nullable fields (required or optional) to their field bits. +var createSeriesRequestLocationInPersonNullableFields = map[string]*big.Int{ + "address": createSeriesRequestLocationInPersonFieldAddress, } -type CreateSeriesRequestLocationZoom struct { - // The meeting's link, once it's created on the host's Zoom account. - URL *string `json:"url,omitempty" url:"url,omitempty"` +type CreateSeriesRequestLocationInPerson struct { + // The address to meet at. `null` on an event type means the booking supplies its own. + Address *string `json:"address,omitempty" url:"address,omitempty"` // Private bitmask of fields set to an explicit value and therefore not to be omitted explicitFields *big.Int `json:"-" url:"-"` @@ -9993,21 +10302,21 @@ type CreateSeriesRequestLocationZoom struct { rawJSON json.RawMessage } -func (c *CreateSeriesRequestLocationZoom) GetURL() *string { +func (c *CreateSeriesRequestLocationInPerson) GetAddress() *string { if c == nil { return nil } - return c.URL + return c.Address } -func (c *CreateSeriesRequestLocationZoom) GetExtraProperties() map[string]interface{} { +func (c *CreateSeriesRequestLocationInPerson) GetExtraProperties() map[string]interface{} { if c == nil { return nil } return c.extraProperties } -func (c *CreateSeriesRequestLocationZoom) require(field *big.Int) { +func (c *CreateSeriesRequestLocationInPerson) require(field *big.Int) { next := new(big.Int) if c.explicitFields != nil { next.Set(c.explicitFields) @@ -10016,26 +10325,26 @@ func (c *CreateSeriesRequestLocationZoom) require(field *big.Int) { c.explicitFields = next } -// SetURL sets the URL field and marks it as non-optional; +// SetAddress sets the Address field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (c *CreateSeriesRequestLocationZoom) SetURL(url *string) { - c.URL = url - c.require(createSeriesRequestLocationZoomFieldURL) +func (c *CreateSeriesRequestLocationInPerson) SetAddress(address *string) { + c.Address = address + c.require(createSeriesRequestLocationInPersonFieldAddress) } -func (c *CreateSeriesRequestLocationZoom) UnmarshalJSON(data []byte) error { - type unmarshaler CreateSeriesRequestLocationZoom +func (c *CreateSeriesRequestLocationInPerson) UnmarshalJSON(data []byte) error { + type unmarshaler CreateSeriesRequestLocationInPerson var value unmarshaler if err := json.Unmarshal(data, &value); err != nil { return err } - *c = CreateSeriesRequestLocationZoom(value) + *c = CreateSeriesRequestLocationInPerson(value) extraProperties, err := internal.ExtractExtraProperties(data, *c) if err != nil { return err } c.extraProperties = extraProperties - presentFields, err := internal.ExplicitFieldsFromJSON(data, createSeriesRequestLocationZoomNullableFields) + presentFields, err := internal.ExplicitFieldsFromJSON(data, createSeriesRequestLocationInPersonNullableFields) if err != nil { return err } @@ -10046,8 +10355,8 @@ func (c *CreateSeriesRequestLocationZoom) UnmarshalJSON(data []byte) error { return nil } -func (c *CreateSeriesRequestLocationZoom) MarshalJSON() ([]byte, error) { - type embed CreateSeriesRequestLocationZoom +func (c *CreateSeriesRequestLocationInPerson) MarshalJSON() ([]byte, error) { + type embed CreateSeriesRequestLocationInPerson var marshaler = struct { embed }{ @@ -10057,7 +10366,7 @@ func (c *CreateSeriesRequestLocationZoom) MarshalJSON() ([]byte, error) { return json.Marshal(explicitMarshaler) } -func (c *CreateSeriesRequestLocationZoom) String() string { +func (c *CreateSeriesRequestLocationInPerson) String() string { if c == nil { return "" } @@ -10072,43 +10381,18 @@ func (c *CreateSeriesRequestLocationZoom) String() string { return fmt.Sprintf("%#v", c) } -// If an occurrence isn't free: book nothing, or book the rest and report it. -type CreateSeriesRequestOnConflict string - -const ( - CreateSeriesRequestOnConflictReject CreateSeriesRequestOnConflict = "reject" - CreateSeriesRequestOnConflictSkip CreateSeriesRequestOnConflict = "skip" +var ( + createSeriesRequestLocationLinkFieldURL = big.NewInt(1 << 0) ) -func NewCreateSeriesRequestOnConflictFromString(s string) (CreateSeriesRequestOnConflict, error) { - switch s { - case "reject": - return CreateSeriesRequestOnConflictReject, nil - case "skip": - return CreateSeriesRequestOnConflictSkip, nil - } - var t CreateSeriesRequestOnConflict - return "", fmt.Errorf("%s is not a valid %T", s, t) -} - -func (c CreateSeriesRequestOnConflict) Ptr() *CreateSeriesRequestOnConflict { - return &c +// createSeriesRequestLocationLinkNullableFields maps the wire names of CreateSeriesRequestLocationLink's nullable fields (required or optional) to their field bits. +var createSeriesRequestLocationLinkNullableFields = map[string]*big.Int{ + "url": createSeriesRequestLocationLinkFieldURL, } -var ( - createSeriesRequestRecurrenceFieldFrequency = big.NewInt(1 << 0) - createSeriesRequestRecurrenceFieldInterval = big.NewInt(1 << 1) - createSeriesRequestRecurrenceFieldCount = big.NewInt(1 << 2) -) - -// How often the booking repeats, at the attendee's local time. -type CreateSeriesRequestRecurrence struct { - // Repeat weekly or monthly. - Frequency CreateSeriesRequestRecurrenceFrequency `json:"frequency" url:"frequency"` - // Every this many weeks or months. Default: 1. - Interval *int `json:"interval,omitempty" url:"interval,omitempty"` - // Occurrences in total, the first included. - Count int `json:"count" url:"count"` +type CreateSeriesRequestLocationLink struct { + // The meeting link. `null` on an event type means the booking supplies its own. + URL *string `json:"url,omitempty" url:"url,omitempty"` // Private bitmask of fields set to an explicit value and therefore not to be omitted explicitFields *big.Int `json:"-" url:"-"` @@ -10117,35 +10401,21 @@ type CreateSeriesRequestRecurrence struct { rawJSON json.RawMessage } -func (c *CreateSeriesRequestRecurrence) GetFrequency() CreateSeriesRequestRecurrenceFrequency { - if c == nil { - return "" - } - return c.Frequency -} - -func (c *CreateSeriesRequestRecurrence) GetInterval() *int { +func (c *CreateSeriesRequestLocationLink) GetURL() *string { if c == nil { return nil } - return c.Interval -} - -func (c *CreateSeriesRequestRecurrence) GetCount() int { - if c == nil { - return 0 - } - return c.Count + return c.URL } -func (c *CreateSeriesRequestRecurrence) GetExtraProperties() map[string]interface{} { +func (c *CreateSeriesRequestLocationLink) GetExtraProperties() map[string]interface{} { if c == nil { return nil } return c.extraProperties } -func (c *CreateSeriesRequestRecurrence) require(field *big.Int) { +func (c *CreateSeriesRequestLocationLink) require(field *big.Int) { next := new(big.Int) if c.explicitFields != nil { next.Set(c.explicitFields) @@ -10154,29 +10424,432 @@ func (c *CreateSeriesRequestRecurrence) require(field *big.Int) { c.explicitFields = next } -// SetFrequency sets the Frequency field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (c *CreateSeriesRequestRecurrence) SetFrequency(frequency CreateSeriesRequestRecurrenceFrequency) { - c.Frequency = frequency - c.require(createSeriesRequestRecurrenceFieldFrequency) -} - -// SetInterval sets the Interval field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (c *CreateSeriesRequestRecurrence) SetInterval(interval *int) { - c.Interval = interval - c.require(createSeriesRequestRecurrenceFieldInterval) -} - -// SetCount sets the Count field and marks it as non-optional; +// SetURL sets the URL field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (c *CreateSeriesRequestRecurrence) SetCount(count int) { - c.Count = count - c.require(createSeriesRequestRecurrenceFieldCount) +func (c *CreateSeriesRequestLocationLink) SetURL(url *string) { + c.URL = url + c.require(createSeriesRequestLocationLinkFieldURL) } -func (c *CreateSeriesRequestRecurrence) UnmarshalJSON(data []byte) error { - type unmarshaler CreateSeriesRequestRecurrence +func (c *CreateSeriesRequestLocationLink) UnmarshalJSON(data []byte) error { + type unmarshaler CreateSeriesRequestLocationLink + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *c = CreateSeriesRequestLocationLink(value) + extraProperties, err := internal.ExtractExtraProperties(data, *c) + if err != nil { + return err + } + c.extraProperties = extraProperties + presentFields, err := internal.ExplicitFieldsFromJSON(data, createSeriesRequestLocationLinkNullableFields) + if err != nil { + return err + } + if presentFields != nil { + c.require(presentFields) + } + c.rawJSON = json.RawMessage(data) + return nil +} + +func (c *CreateSeriesRequestLocationLink) MarshalJSON() ([]byte, error) { + type embed CreateSeriesRequestLocationLink + var marshaler = struct { + embed + }{ + embed: embed(*c), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, c.explicitFields) + return json.Marshal(explicitMarshaler) +} + +func (c *CreateSeriesRequestLocationLink) String() string { + if c == nil { + return "" + } + if len(c.rawJSON) > 0 { + if value, err := internal.StringifyJSON(c.rawJSON); err == nil { + return value + } + } + if value, err := internal.StringifyJSON(c); err == nil { + return value + } + return fmt.Sprintf("%#v", c) +} + +type CreateSeriesRequestLocationMicrosoftTeams struct { + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + + extraProperties map[string]interface{} + rawJSON json.RawMessage +} + +func (c *CreateSeriesRequestLocationMicrosoftTeams) GetExtraProperties() map[string]interface{} { + if c == nil { + return nil + } + return c.extraProperties +} + +func (c *CreateSeriesRequestLocationMicrosoftTeams) require(field *big.Int) { + next := new(big.Int) + if c.explicitFields != nil { + next.Set(c.explicitFields) + } + next.Or(next, field) + c.explicitFields = next +} + +func (c *CreateSeriesRequestLocationMicrosoftTeams) UnmarshalJSON(data []byte) error { + type unmarshaler CreateSeriesRequestLocationMicrosoftTeams + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *c = CreateSeriesRequestLocationMicrosoftTeams(value) + extraProperties, err := internal.ExtractExtraProperties(data, *c) + if err != nil { + return err + } + c.extraProperties = extraProperties + c.rawJSON = json.RawMessage(data) + return nil +} + +func (c *CreateSeriesRequestLocationMicrosoftTeams) MarshalJSON() ([]byte, error) { + type embed CreateSeriesRequestLocationMicrosoftTeams + var marshaler = struct { + embed + }{ + embed: embed(*c), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, c.explicitFields) + return json.Marshal(explicitMarshaler) +} + +func (c *CreateSeriesRequestLocationMicrosoftTeams) String() string { + if c == nil { + return "" + } + if len(c.rawJSON) > 0 { + if value, err := internal.StringifyJSON(c.rawJSON); err == nil { + return value + } + } + if value, err := internal.StringifyJSON(c); err == nil { + return value + } + return fmt.Sprintf("%#v", c) +} + +var ( + createSeriesRequestLocationPhoneFieldNumber = big.NewInt(1 << 0) +) + +// createSeriesRequestLocationPhoneNullableFields maps the wire names of CreateSeriesRequestLocationPhone's nullable fields (required or optional) to their field bits. +var createSeriesRequestLocationPhoneNullableFields = map[string]*big.Int{ + "number": createSeriesRequestLocationPhoneFieldNumber, +} + +type CreateSeriesRequestLocationPhone struct { + // The phone number to call. `null` on an event type means the booking supplies its own. + Number *string `json:"number,omitempty" url:"number,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + + extraProperties map[string]interface{} + rawJSON json.RawMessage +} + +func (c *CreateSeriesRequestLocationPhone) GetNumber() *string { + if c == nil { + return nil + } + return c.Number +} + +func (c *CreateSeriesRequestLocationPhone) GetExtraProperties() map[string]interface{} { + if c == nil { + return nil + } + return c.extraProperties +} + +func (c *CreateSeriesRequestLocationPhone) require(field *big.Int) { + next := new(big.Int) + if c.explicitFields != nil { + next.Set(c.explicitFields) + } + next.Or(next, field) + c.explicitFields = next +} + +// SetNumber sets the Number field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreateSeriesRequestLocationPhone) SetNumber(number *string) { + c.Number = number + c.require(createSeriesRequestLocationPhoneFieldNumber) +} + +func (c *CreateSeriesRequestLocationPhone) UnmarshalJSON(data []byte) error { + type unmarshaler CreateSeriesRequestLocationPhone + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *c = CreateSeriesRequestLocationPhone(value) + extraProperties, err := internal.ExtractExtraProperties(data, *c) + if err != nil { + return err + } + c.extraProperties = extraProperties + presentFields, err := internal.ExplicitFieldsFromJSON(data, createSeriesRequestLocationPhoneNullableFields) + if err != nil { + return err + } + if presentFields != nil { + c.require(presentFields) + } + c.rawJSON = json.RawMessage(data) + return nil +} + +func (c *CreateSeriesRequestLocationPhone) MarshalJSON() ([]byte, error) { + type embed CreateSeriesRequestLocationPhone + var marshaler = struct { + embed + }{ + embed: embed(*c), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, c.explicitFields) + return json.Marshal(explicitMarshaler) +} + +func (c *CreateSeriesRequestLocationPhone) String() string { + if c == nil { + return "" + } + if len(c.rawJSON) > 0 { + if value, err := internal.StringifyJSON(c.rawJSON); err == nil { + return value + } + } + if value, err := internal.StringifyJSON(c); err == nil { + return value + } + return fmt.Sprintf("%#v", c) +} + +var ( + createSeriesRequestLocationZoomFieldURL = big.NewInt(1 << 0) +) + +// createSeriesRequestLocationZoomNullableFields maps the wire names of CreateSeriesRequestLocationZoom's nullable fields (required or optional) to their field bits. +var createSeriesRequestLocationZoomNullableFields = map[string]*big.Int{ + "url": createSeriesRequestLocationZoomFieldURL, +} + +type CreateSeriesRequestLocationZoom struct { + // The meeting's link, once it's created on the host's Zoom account. + URL *string `json:"url,omitempty" url:"url,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + + extraProperties map[string]interface{} + rawJSON json.RawMessage +} + +func (c *CreateSeriesRequestLocationZoom) GetURL() *string { + if c == nil { + return nil + } + return c.URL +} + +func (c *CreateSeriesRequestLocationZoom) GetExtraProperties() map[string]interface{} { + if c == nil { + return nil + } + return c.extraProperties +} + +func (c *CreateSeriesRequestLocationZoom) require(field *big.Int) { + next := new(big.Int) + if c.explicitFields != nil { + next.Set(c.explicitFields) + } + next.Or(next, field) + c.explicitFields = next +} + +// SetURL sets the URL field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreateSeriesRequestLocationZoom) SetURL(url *string) { + c.URL = url + c.require(createSeriesRequestLocationZoomFieldURL) +} + +func (c *CreateSeriesRequestLocationZoom) UnmarshalJSON(data []byte) error { + type unmarshaler CreateSeriesRequestLocationZoom + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *c = CreateSeriesRequestLocationZoom(value) + extraProperties, err := internal.ExtractExtraProperties(data, *c) + if err != nil { + return err + } + c.extraProperties = extraProperties + presentFields, err := internal.ExplicitFieldsFromJSON(data, createSeriesRequestLocationZoomNullableFields) + if err != nil { + return err + } + if presentFields != nil { + c.require(presentFields) + } + c.rawJSON = json.RawMessage(data) + return nil +} + +func (c *CreateSeriesRequestLocationZoom) MarshalJSON() ([]byte, error) { + type embed CreateSeriesRequestLocationZoom + var marshaler = struct { + embed + }{ + embed: embed(*c), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, c.explicitFields) + return json.Marshal(explicitMarshaler) +} + +func (c *CreateSeriesRequestLocationZoom) String() string { + if c == nil { + return "" + } + if len(c.rawJSON) > 0 { + if value, err := internal.StringifyJSON(c.rawJSON); err == nil { + return value + } + } + if value, err := internal.StringifyJSON(c); err == nil { + return value + } + return fmt.Sprintf("%#v", c) +} + +// If an occurrence isn't free: book nothing, or book the rest and report it. +type CreateSeriesRequestOnConflict string + +const ( + CreateSeriesRequestOnConflictReject CreateSeriesRequestOnConflict = "reject" + CreateSeriesRequestOnConflictSkip CreateSeriesRequestOnConflict = "skip" +) + +func NewCreateSeriesRequestOnConflictFromString(s string) (CreateSeriesRequestOnConflict, error) { + switch s { + case "reject": + return CreateSeriesRequestOnConflictReject, nil + case "skip": + return CreateSeriesRequestOnConflictSkip, nil + } + var t CreateSeriesRequestOnConflict + return "", fmt.Errorf("%s is not a valid %T", s, t) +} + +func (c CreateSeriesRequestOnConflict) Ptr() *CreateSeriesRequestOnConflict { + return &c +} + +var ( + createSeriesRequestRecurrenceFieldFrequency = big.NewInt(1 << 0) + createSeriesRequestRecurrenceFieldInterval = big.NewInt(1 << 1) + createSeriesRequestRecurrenceFieldCount = big.NewInt(1 << 2) +) + +// How often the booking repeats, at the attendee's local time. +type CreateSeriesRequestRecurrence struct { + // Repeat weekly or monthly. + Frequency CreateSeriesRequestRecurrenceFrequency `json:"frequency" url:"frequency"` + // Every this many weeks or months. Default: 1. + Interval *int `json:"interval,omitempty" url:"interval,omitempty"` + // Occurrences in total, the first included. + Count int `json:"count" url:"count"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + + extraProperties map[string]interface{} + rawJSON json.RawMessage +} + +func (c *CreateSeriesRequestRecurrence) GetFrequency() CreateSeriesRequestRecurrenceFrequency { + if c == nil { + return "" + } + return c.Frequency +} + +func (c *CreateSeriesRequestRecurrence) GetInterval() *int { + if c == nil { + return nil + } + return c.Interval +} + +func (c *CreateSeriesRequestRecurrence) GetCount() int { + if c == nil { + return 0 + } + return c.Count +} + +func (c *CreateSeriesRequestRecurrence) GetExtraProperties() map[string]interface{} { + if c == nil { + return nil + } + return c.extraProperties +} + +func (c *CreateSeriesRequestRecurrence) require(field *big.Int) { + next := new(big.Int) + if c.explicitFields != nil { + next.Set(c.explicitFields) + } + next.Or(next, field) + c.explicitFields = next +} + +// SetFrequency sets the Frequency field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreateSeriesRequestRecurrence) SetFrequency(frequency CreateSeriesRequestRecurrenceFrequency) { + c.Frequency = frequency + c.require(createSeriesRequestRecurrenceFieldFrequency) +} + +// SetInterval sets the Interval field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreateSeriesRequestRecurrence) SetInterval(interval *int) { + c.Interval = interval + c.require(createSeriesRequestRecurrenceFieldInterval) +} + +// SetCount sets the Count field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreateSeriesRequestRecurrence) SetCount(count int) { + c.Count = count + c.require(createSeriesRequestRecurrenceFieldCount) +} + +func (c *CreateSeriesRequestRecurrence) UnmarshalJSON(data []byte) error { + type unmarshaler CreateSeriesRequestRecurrence var value unmarshaler if err := json.Unmarshal(data, &value); err != nil { return err @@ -13408,6 +14081,108 @@ func (d DeletedSchedulingCalendarDelegationObject) Ptr() *DeletedSchedulingCalen return &d } +var ( + deletedSchedulingHolidayCalendarFieldID = big.NewInt(1 << 0) + deletedSchedulingHolidayCalendarFieldDeleted = big.NewInt(1 << 1) +) + +type DeletedSchedulingHolidayCalendar struct { + ID string `json:"id" url:"id"` + Deleted bool `json:"deleted" url:"deleted"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + + extraProperties map[string]interface{} + rawJSON json.RawMessage +} + +func (d *DeletedSchedulingHolidayCalendar) GetID() string { + if d == nil { + return "" + } + return d.ID +} + +func (d *DeletedSchedulingHolidayCalendar) GetDeleted() bool { + if d == nil { + return false + } + return d.Deleted +} + +func (d *DeletedSchedulingHolidayCalendar) GetExtraProperties() map[string]interface{} { + if d == nil { + return nil + } + return d.extraProperties +} + +func (d *DeletedSchedulingHolidayCalendar) require(field *big.Int) { + next := new(big.Int) + if d.explicitFields != nil { + next.Set(d.explicitFields) + } + next.Or(next, field) + d.explicitFields = next +} + +// SetID sets the ID field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DeletedSchedulingHolidayCalendar) SetID(id string) { + d.ID = id + d.require(deletedSchedulingHolidayCalendarFieldID) +} + +// SetDeleted sets the Deleted field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DeletedSchedulingHolidayCalendar) SetDeleted(deleted bool) { + d.Deleted = deleted + d.require(deletedSchedulingHolidayCalendarFieldDeleted) +} + +func (d *DeletedSchedulingHolidayCalendar) UnmarshalJSON(data []byte) error { + type unmarshaler DeletedSchedulingHolidayCalendar + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *d = DeletedSchedulingHolidayCalendar(value) + extraProperties, err := internal.ExtractExtraProperties(data, *d) + if err != nil { + return err + } + d.extraProperties = extraProperties + d.rawJSON = json.RawMessage(data) + return nil +} + +func (d *DeletedSchedulingHolidayCalendar) MarshalJSON() ([]byte, error) { + type embed DeletedSchedulingHolidayCalendar + var marshaler = struct { + embed + }{ + embed: embed(*d), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, d.explicitFields) + return json.Marshal(explicitMarshaler) +} + +func (d *DeletedSchedulingHolidayCalendar) String() string { + if d == nil { + return "" + } + if len(d.rawJSON) > 0 { + if value, err := internal.StringifyJSON(d.rawJSON); err == nil { + return value + } + } + if value, err := internal.StringifyJSON(d); err == nil { + return value + } + return fmt.Sprintf("%#v", d) +} + var ( deletedSchedulingHostFieldObject = big.NewInt(1 << 0) deletedSchedulingHostFieldID = big.NewInt(1 << 1) @@ -13545,6 +14320,280 @@ func (d DeletedSchedulingHostObject) Ptr() *DeletedSchedulingHostObject { return &d } +var ( + deletedSchedulingOauthAppFieldObject = big.NewInt(1 << 0) + deletedSchedulingOauthAppFieldID = big.NewInt(1 << 1) + deletedSchedulingOauthAppFieldDeleted = big.NewInt(1 << 2) +) + +type DeletedSchedulingOauthApp struct { + Object DeletedSchedulingOauthAppObject `json:"object" url:"object"` + ID string `json:"id" url:"id"` + Deleted bool `json:"deleted" url:"deleted"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + + extraProperties map[string]interface{} + rawJSON json.RawMessage +} + +func (d *DeletedSchedulingOauthApp) GetObject() DeletedSchedulingOauthAppObject { + if d == nil { + return "" + } + return d.Object +} + +func (d *DeletedSchedulingOauthApp) GetID() string { + if d == nil { + return "" + } + return d.ID +} + +func (d *DeletedSchedulingOauthApp) GetDeleted() bool { + if d == nil { + return false + } + return d.Deleted +} + +func (d *DeletedSchedulingOauthApp) GetExtraProperties() map[string]interface{} { + if d == nil { + return nil + } + return d.extraProperties +} + +func (d *DeletedSchedulingOauthApp) require(field *big.Int) { + next := new(big.Int) + if d.explicitFields != nil { + next.Set(d.explicitFields) + } + next.Or(next, field) + d.explicitFields = next +} + +// SetObject sets the Object field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DeletedSchedulingOauthApp) SetObject(object DeletedSchedulingOauthAppObject) { + d.Object = object + d.require(deletedSchedulingOauthAppFieldObject) +} + +// SetID sets the ID field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DeletedSchedulingOauthApp) SetID(id string) { + d.ID = id + d.require(deletedSchedulingOauthAppFieldID) +} + +// SetDeleted sets the Deleted field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DeletedSchedulingOauthApp) SetDeleted(deleted bool) { + d.Deleted = deleted + d.require(deletedSchedulingOauthAppFieldDeleted) +} + +func (d *DeletedSchedulingOauthApp) UnmarshalJSON(data []byte) error { + type unmarshaler DeletedSchedulingOauthApp + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *d = DeletedSchedulingOauthApp(value) + extraProperties, err := internal.ExtractExtraProperties(data, *d) + if err != nil { + return err + } + d.extraProperties = extraProperties + d.rawJSON = json.RawMessage(data) + return nil +} + +func (d *DeletedSchedulingOauthApp) MarshalJSON() ([]byte, error) { + type embed DeletedSchedulingOauthApp + var marshaler = struct { + embed + }{ + embed: embed(*d), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, d.explicitFields) + return json.Marshal(explicitMarshaler) +} + +func (d *DeletedSchedulingOauthApp) String() string { + if d == nil { + return "" + } + if len(d.rawJSON) > 0 { + if value, err := internal.StringifyJSON(d.rawJSON); err == nil { + return value + } + } + if value, err := internal.StringifyJSON(d); err == nil { + return value + } + return fmt.Sprintf("%#v", d) +} + +type DeletedSchedulingOauthAppObject string + +const ( + DeletedSchedulingOauthAppObjectSchedulingOauthApp DeletedSchedulingOauthAppObject = "scheduling.oauth_app" +) + +func NewDeletedSchedulingOauthAppObjectFromString(s string) (DeletedSchedulingOauthAppObject, error) { + switch s { + case "scheduling.oauth_app": + return DeletedSchedulingOauthAppObjectSchedulingOauthApp, nil + } + var t DeletedSchedulingOauthAppObject + return "", fmt.Errorf("%s is not a valid %T", s, t) +} + +func (d DeletedSchedulingOauthAppObject) Ptr() *DeletedSchedulingOauthAppObject { + return &d +} + +var ( + deletedSchedulingOutOfOfficeFieldObject = big.NewInt(1 << 0) + deletedSchedulingOutOfOfficeFieldID = big.NewInt(1 << 1) + deletedSchedulingOutOfOfficeFieldDeleted = big.NewInt(1 << 2) +) + +type DeletedSchedulingOutOfOffice struct { + Object DeletedSchedulingOutOfOfficeObject `json:"object" url:"object"` + ID string `json:"id" url:"id"` + Deleted bool `json:"deleted" url:"deleted"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + + extraProperties map[string]interface{} + rawJSON json.RawMessage +} + +func (d *DeletedSchedulingOutOfOffice) GetObject() DeletedSchedulingOutOfOfficeObject { + if d == nil { + return "" + } + return d.Object +} + +func (d *DeletedSchedulingOutOfOffice) GetID() string { + if d == nil { + return "" + } + return d.ID +} + +func (d *DeletedSchedulingOutOfOffice) GetDeleted() bool { + if d == nil { + return false + } + return d.Deleted +} + +func (d *DeletedSchedulingOutOfOffice) GetExtraProperties() map[string]interface{} { + if d == nil { + return nil + } + return d.extraProperties +} + +func (d *DeletedSchedulingOutOfOffice) require(field *big.Int) { + next := new(big.Int) + if d.explicitFields != nil { + next.Set(d.explicitFields) + } + next.Or(next, field) + d.explicitFields = next +} + +// SetObject sets the Object field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DeletedSchedulingOutOfOffice) SetObject(object DeletedSchedulingOutOfOfficeObject) { + d.Object = object + d.require(deletedSchedulingOutOfOfficeFieldObject) +} + +// SetID sets the ID field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DeletedSchedulingOutOfOffice) SetID(id string) { + d.ID = id + d.require(deletedSchedulingOutOfOfficeFieldID) +} + +// SetDeleted sets the Deleted field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DeletedSchedulingOutOfOffice) SetDeleted(deleted bool) { + d.Deleted = deleted + d.require(deletedSchedulingOutOfOfficeFieldDeleted) +} + +func (d *DeletedSchedulingOutOfOffice) UnmarshalJSON(data []byte) error { + type unmarshaler DeletedSchedulingOutOfOffice + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *d = DeletedSchedulingOutOfOffice(value) + extraProperties, err := internal.ExtractExtraProperties(data, *d) + if err != nil { + return err + } + d.extraProperties = extraProperties + d.rawJSON = json.RawMessage(data) + return nil +} + +func (d *DeletedSchedulingOutOfOffice) MarshalJSON() ([]byte, error) { + type embed DeletedSchedulingOutOfOffice + var marshaler = struct { + embed + }{ + embed: embed(*d), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, d.explicitFields) + return json.Marshal(explicitMarshaler) +} + +func (d *DeletedSchedulingOutOfOffice) String() string { + if d == nil { + return "" + } + if len(d.rawJSON) > 0 { + if value, err := internal.StringifyJSON(d.rawJSON); err == nil { + return value + } + } + if value, err := internal.StringifyJSON(d); err == nil { + return value + } + return fmt.Sprintf("%#v", d) +} + +type DeletedSchedulingOutOfOfficeObject string + +const ( + DeletedSchedulingOutOfOfficeObjectSchedulingOutOfOffice DeletedSchedulingOutOfOfficeObject = "scheduling.out_of_office" +) + +func NewDeletedSchedulingOutOfOfficeObjectFromString(s string) (DeletedSchedulingOutOfOfficeObject, error) { + switch s { + case "scheduling.out_of_office": + return DeletedSchedulingOutOfOfficeObjectSchedulingOutOfOffice, nil + } + var t DeletedSchedulingOutOfOfficeObject + return "", fmt.Errorf("%s is not a valid %T", s, t) +} + +func (d DeletedSchedulingOutOfOfficeObject) Ptr() *DeletedSchedulingOutOfOfficeObject { + return &d +} + var ( deletedSchedulingScheduleFieldObject = big.NewInt(1 << 0) deletedSchedulingScheduleFieldID = big.NewInt(1 << 1) @@ -43562,6 +44611,7 @@ var ( // schedulingBookingNullableFields maps the wire names of SchedulingBooking's nullable fields (required or optional) to their field bits. var schedulingBookingNullableFields = map[string]*big.Int{ + "location": schedulingBookingFieldLocation, "hold_expires_at": schedulingBookingFieldHoldExpiresAt, "approval_expires_at": schedulingBookingFieldApprovalExpiresAt, "series": schedulingBookingFieldSeries, @@ -43591,7 +44641,7 @@ type SchedulingBooking struct { Hosts []string `json:"hosts" url:"hosts"` // Who's booked: the attendee first, then any guests they added. A group session's seat is its own booking. Attendees []*SchedulingBookingAttendeesItem `json:"attendees" url:"attendees"` - Location *SchedulingLocation `json:"location" url:"location"` + Location *SchedulingLocation `json:"location,omitempty" url:"location,omitempty"` // When a `held` booking gives up its slot. `null` otherwise. HoldExpiresAt *string `json:"hold_expires_at,omitempty" url:"hold_expires_at,omitempty"` // When a `pending_approval` booking is declined if nobody decides. `null` otherwise. @@ -44354,12 +45404,13 @@ func (s SchedulingBookingAttendeesItemRole) Ptr() *SchedulingBookingAttendeesIte type SchedulingBookingCancelledBy string const ( - SchedulingBookingCancelledByAPIKey SchedulingBookingCancelledBy = "api_key" - SchedulingBookingCancelledByUser SchedulingBookingCancelledBy = "user" - SchedulingBookingCancelledByHostSession SchedulingBookingCancelledBy = "host_session" - SchedulingBookingCancelledByBookerSession SchedulingBookingCancelledBy = "booker_session" - SchedulingBookingCancelledByManageSession SchedulingBookingCancelledBy = "manage_session" - SchedulingBookingCancelledBySystem SchedulingBookingCancelledBy = "system" + SchedulingBookingCancelledByAPIKey SchedulingBookingCancelledBy = "api_key" + SchedulingBookingCancelledByUser SchedulingBookingCancelledBy = "user" + SchedulingBookingCancelledByHostSession SchedulingBookingCancelledBy = "host_session" + SchedulingBookingCancelledByBookerSession SchedulingBookingCancelledBy = "booker_session" + SchedulingBookingCancelledByManageSession SchedulingBookingCancelledBy = "manage_session" + SchedulingBookingCancelledByManagerSession SchedulingBookingCancelledBy = "manager_session" + SchedulingBookingCancelledBySystem SchedulingBookingCancelledBy = "system" ) func NewSchedulingBookingCancelledByFromString(s string) (SchedulingBookingCancelledBy, error) { @@ -44374,6 +45425,8 @@ func NewSchedulingBookingCancelledByFromString(s string) (SchedulingBookingCance return SchedulingBookingCancelledByBookerSession, nil case "manage_session": return SchedulingBookingCancelledByManageSession, nil + case "manager_session": + return SchedulingBookingCancelledByManagerSession, nil case "system": return SchedulingBookingCancelledBySystem, nil } @@ -44691,12 +45744,13 @@ func (s *SchedulingBookingEventActor) String() string { type SchedulingBookingEventActorKind string const ( - SchedulingBookingEventActorKindAPIKey SchedulingBookingEventActorKind = "api_key" - SchedulingBookingEventActorKindUser SchedulingBookingEventActorKind = "user" - SchedulingBookingEventActorKindHostSession SchedulingBookingEventActorKind = "host_session" - SchedulingBookingEventActorKindBookerSession SchedulingBookingEventActorKind = "booker_session" - SchedulingBookingEventActorKindManageSession SchedulingBookingEventActorKind = "manage_session" - SchedulingBookingEventActorKindSystem SchedulingBookingEventActorKind = "system" + SchedulingBookingEventActorKindAPIKey SchedulingBookingEventActorKind = "api_key" + SchedulingBookingEventActorKindUser SchedulingBookingEventActorKind = "user" + SchedulingBookingEventActorKindHostSession SchedulingBookingEventActorKind = "host_session" + SchedulingBookingEventActorKindBookerSession SchedulingBookingEventActorKind = "booker_session" + SchedulingBookingEventActorKindManageSession SchedulingBookingEventActorKind = "manage_session" + SchedulingBookingEventActorKindManagerSession SchedulingBookingEventActorKind = "manager_session" + SchedulingBookingEventActorKindSystem SchedulingBookingEventActorKind = "system" ) func NewSchedulingBookingEventActorKindFromString(s string) (SchedulingBookingEventActorKind, error) { @@ -44711,6 +45765,8 @@ func NewSchedulingBookingEventActorKindFromString(s string) (SchedulingBookingEv return SchedulingBookingEventActorKindBookerSession, nil case "manage_session": return SchedulingBookingEventActorKindManageSession, nil + case "manager_session": + return SchedulingBookingEventActorKindManagerSession, nil case "system": return SchedulingBookingEventActorKindSystem, nil } @@ -45990,13 +47046,15 @@ var ( schedulingCalendarConnectionFieldProvider = big.NewInt(1 << 3) schedulingCalendarConnectionFieldAccount = big.NewInt(1 << 4) schedulingCalendarConnectionFieldStatus = big.NewInt(1 << 5) - schedulingCalendarConnectionFieldDelegation = big.NewInt(1 << 6) - schedulingCalendarConnectionFieldCalendars = big.NewInt(1 << 7) - schedulingCalendarConnectionFieldCreatedAt = big.NewInt(1 << 8) + schedulingCalendarConnectionFieldOauthApp = big.NewInt(1 << 6) + schedulingCalendarConnectionFieldDelegation = big.NewInt(1 << 7) + schedulingCalendarConnectionFieldCalendars = big.NewInt(1 << 8) + schedulingCalendarConnectionFieldCreatedAt = big.NewInt(1 << 9) ) // schedulingCalendarConnectionNullableFields maps the wire names of SchedulingCalendarConnection's nullable fields (required or optional) to their field bits. var schedulingCalendarConnectionNullableFields = map[string]*big.Int{ + "oauth_app": schedulingCalendarConnectionFieldOauthApp, "delegation": schedulingCalendarConnectionFieldDelegation, } @@ -46011,6 +47069,8 @@ type SchedulingCalendarConnection struct { Account string `json:"account" url:"account"` // `needs_reauth`: access was lost, and this host isn't offered until it's back. Status SchedulingCalendarConnectionStatus `json:"status" url:"status"` + // Your own OAuth app this connection's access came through. `null`: coss.com's, or no consent was involved. + OauthApp *string `json:"oauth_app,omitempty" url:"oauth_app,omitempty"` // The calendar delegation that manages this connection. It can't be disconnected or reconnected by itself. Delegation *string `json:"delegation,omitempty" url:"delegation,omitempty"` // The account's calendars. @@ -46066,6 +47126,13 @@ func (s *SchedulingCalendarConnection) GetStatus() SchedulingCalendarConnectionS return s.Status } +func (s *SchedulingCalendarConnection) GetOauthApp() *string { + if s == nil { + return nil + } + return s.OauthApp +} + func (s *SchedulingCalendarConnection) GetDelegation() *string { if s == nil { return nil @@ -46145,6 +47212,13 @@ func (s *SchedulingCalendarConnection) SetStatus(status SchedulingCalendarConnec s.require(schedulingCalendarConnectionFieldStatus) } +// SetOauthApp sets the OauthApp field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingCalendarConnection) SetOauthApp(oauthApp *string) { + s.OauthApp = oauthApp + s.require(schedulingCalendarConnectionFieldOauthApp) +} + // SetDelegation sets the Delegation field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. func (s *SchedulingCalendarConnection) SetDelegation(delegation *string) { @@ -47317,22 +48391,23 @@ var ( schedulingEventTypeFieldLimits = big.NewInt(1 << 15) schedulingEventTypeFieldCapacity = big.NewInt(1 << 16) schedulingEventTypeFieldRequiresApproval = big.NewInt(1 << 17) - schedulingEventTypeFieldApprovalTTLMinutes = big.NewInt(1 << 18) - schedulingEventTypeFieldHoldTTLSeconds = big.NewInt(1 << 19) - schedulingEventTypeFieldCancelNoticeMinutes = big.NewInt(1 << 20) - schedulingEventTypeFieldRescheduleNoticeMinutes = big.NewInt(1 << 21) - schedulingEventTypeFieldMaxGuests = big.NewInt(1 << 22) - schedulingEventTypeFieldMaxActiveBookingsPerAttendee = big.NewInt(1 << 23) - schedulingEventTypeFieldHostCalendarDetails = big.NewInt(1 << 24) - schedulingEventTypeFieldQuestions = big.NewInt(1 << 25) - schedulingEventTypeFieldLocations = big.NewInt(1 << 26) - schedulingEventTypeFieldHostFilter = big.NewInt(1 << 27) - schedulingEventTypeFieldNotifications = big.NewInt(1 << 28) - schedulingEventTypeFieldReminders = big.NewInt(1 << 29) - schedulingEventTypeFieldHosts = big.NewInt(1 << 30) - schedulingEventTypeFieldMetadata = big.NewInt(1 << 31) - schedulingEventTypeFieldCreatedAt = big.NewInt(1 << 32) - schedulingEventTypeFieldUpdatedAt = big.NewInt(1 << 33) + schedulingEventTypeFieldReassignmentEnabled = big.NewInt(1 << 18) + schedulingEventTypeFieldApprovalTTLMinutes = big.NewInt(1 << 19) + schedulingEventTypeFieldHoldTTLSeconds = big.NewInt(1 << 20) + schedulingEventTypeFieldCancelNoticeMinutes = big.NewInt(1 << 21) + schedulingEventTypeFieldRescheduleNoticeMinutes = big.NewInt(1 << 22) + schedulingEventTypeFieldMaxGuests = big.NewInt(1 << 23) + schedulingEventTypeFieldMaxActiveBookingsPerAttendee = big.NewInt(1 << 24) + schedulingEventTypeFieldHostCalendarDetails = big.NewInt(1 << 25) + schedulingEventTypeFieldQuestions = big.NewInt(1 << 26) + schedulingEventTypeFieldLocations = big.NewInt(1 << 27) + schedulingEventTypeFieldHostFilter = big.NewInt(1 << 28) + schedulingEventTypeFieldNotifications = big.NewInt(1 << 29) + schedulingEventTypeFieldReminders = big.NewInt(1 << 30) + schedulingEventTypeFieldHosts = big.NewInt(1 << 31) + schedulingEventTypeFieldMetadata = big.NewInt(1 << 32) + schedulingEventTypeFieldCreatedAt = big.NewInt(1 << 33) + schedulingEventTypeFieldUpdatedAt = big.NewInt(1 << 34) ) // schedulingEventTypeNullableFields maps the wire names of SchedulingEventType's nullable fields (required or optional) to their field bits. @@ -47382,6 +48457,8 @@ type SchedulingEventType struct { Capacity *float64 `json:"capacity,omitempty" url:"capacity,omitempty"` // Whether bookings start as `pending_approval`, holding the time until approved or declined. RequiresApproval bool `json:"requires_approval" url:"requires_approval"` + // Whether bookings of this event type can go to another host. + ReassignmentEnabled bool `json:"reassignment_enabled" url:"reassignment_enabled"` // How long a booking can wait for approval before it's declined, in minutes. ApprovalTTLMinutes float64 `json:"approval_ttl_minutes" url:"approval_ttl_minutes"` // How long a hold keeps its slot, in seconds. @@ -47546,6 +48623,13 @@ func (s *SchedulingEventType) GetRequiresApproval() bool { return s.RequiresApproval } +func (s *SchedulingEventType) GetReassignmentEnabled() bool { + if s == nil { + return false + } + return s.ReassignmentEnabled +} + func (s *SchedulingEventType) GetApprovalTTLMinutes() float64 { if s == nil { return 0 @@ -47800,6 +48884,13 @@ func (s *SchedulingEventType) SetRequiresApproval(requiresApproval bool) { s.require(schedulingEventTypeFieldRequiresApproval) } +// SetReassignmentEnabled sets the ReassignmentEnabled field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingEventType) SetReassignmentEnabled(reassignmentEnabled bool) { + s.ReassignmentEnabled = reassignmentEnabled + s.require(schedulingEventTypeFieldReassignmentEnabled) +} + // SetApprovalTTLMinutes sets the ApprovalTTLMinutes field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. func (s *SchedulingEventType) SetApprovalTTLMinutes(approvalTTLMinutes float64) { @@ -47870,61 +48961,3892 @@ func (s *SchedulingEventType) SetHostFilter(hostFilter map[string]*SchedulingEve s.require(schedulingEventTypeFieldHostFilter) } -// SetNotifications sets the Notifications field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (s *SchedulingEventType) SetNotifications(notifications map[string]*SchedulingEventTypeNotificationsValue) { - s.Notifications = notifications - s.require(schedulingEventTypeFieldNotifications) +// SetNotifications sets the Notifications field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingEventType) SetNotifications(notifications map[string]*SchedulingEventTypeNotificationsValue) { + s.Notifications = notifications + s.require(schedulingEventTypeFieldNotifications) +} + +// SetReminders sets the Reminders field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingEventType) SetReminders(reminders []*SchedulingReminder) { + s.Reminders = reminders + s.require(schedulingEventTypeFieldReminders) +} + +// SetHosts sets the Hosts field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingEventType) SetHosts(hosts []*SchedulingEventTypeHostsItem) { + s.Hosts = hosts + s.require(schedulingEventTypeFieldHosts) +} + +// SetMetadata sets the Metadata field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingEventType) SetMetadata(metadata map[string]string) { + s.Metadata = metadata + s.require(schedulingEventTypeFieldMetadata) +} + +// SetCreatedAt sets the CreatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingEventType) SetCreatedAt(createdAt string) { + s.CreatedAt = createdAt + s.require(schedulingEventTypeFieldCreatedAt) +} + +// SetUpdatedAt sets the UpdatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingEventType) SetUpdatedAt(updatedAt string) { + s.UpdatedAt = updatedAt + s.require(schedulingEventTypeFieldUpdatedAt) +} + +func (s *SchedulingEventType) UnmarshalJSON(data []byte) error { + type unmarshaler SchedulingEventType + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *s = SchedulingEventType(value) + extraProperties, err := internal.ExtractExtraProperties(data, *s) + if err != nil { + return err + } + s.extraProperties = extraProperties + presentFields, err := internal.ExplicitFieldsFromJSON(data, schedulingEventTypeNullableFields) + if err != nil { + return err + } + if presentFields != nil { + s.require(presentFields) + } + s.rawJSON = json.RawMessage(data) + return nil +} + +func (s *SchedulingEventType) MarshalJSON() ([]byte, error) { + type embed SchedulingEventType + var marshaler = struct { + embed + }{ + embed: embed(*s), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, s.explicitFields) + return json.Marshal(explicitMarshaler) +} + +func (s *SchedulingEventType) String() string { + if s == nil { + return "" + } + if len(s.rawJSON) > 0 { + if value, err := internal.StringifyJSON(s.rawJSON); err == nil { + return value + } + } + if value, err := internal.StringifyJSON(s); err == nil { + return value + } + return fmt.Sprintf("%#v", s) +} + +// What hosts' calendars say about a booking. `neutral`: a private event titled "Appointment". `full`: a private event with this title and the attendee's and guests' details. +type SchedulingEventTypeHostCalendarDetails string + +const ( + SchedulingEventTypeHostCalendarDetailsNeutral SchedulingEventTypeHostCalendarDetails = "neutral" + SchedulingEventTypeHostCalendarDetailsFull SchedulingEventTypeHostCalendarDetails = "full" +) + +func NewSchedulingEventTypeHostCalendarDetailsFromString(s string) (SchedulingEventTypeHostCalendarDetails, error) { + switch s { + case "neutral": + return SchedulingEventTypeHostCalendarDetailsNeutral, nil + case "full": + return SchedulingEventTypeHostCalendarDetailsFull, nil + } + var t SchedulingEventTypeHostCalendarDetails + return "", fmt.Errorf("%s is not a valid %T", s, t) +} + +func (s SchedulingEventTypeHostCalendarDetails) Ptr() *SchedulingEventTypeHostCalendarDetails { + return &s +} + +type SchedulingEventTypeHostFilterValue struct { + String string + StringList []string + + typ string +} + +func (s *SchedulingEventTypeHostFilterValue) GetString() string { + if s == nil { + return "" + } + return s.String +} + +func (s *SchedulingEventTypeHostFilterValue) GetStringList() []string { + if s == nil { + return nil + } + return s.StringList +} + +func (s *SchedulingEventTypeHostFilterValue) UnmarshalJSON(data []byte) error { + var valueString string + if err := json.Unmarshal(data, &valueString); err == nil { + s.typ = "String" + s.String = valueString + return nil + } + var valueStringList []string + if err := json.Unmarshal(data, &valueStringList); err == nil { + s.typ = "StringList" + s.StringList = valueStringList + return nil + } + return fmt.Errorf("%s cannot be deserialized as a %T", data, s) +} + +func (s SchedulingEventTypeHostFilterValue) MarshalJSON() ([]byte, error) { + if s.typ == "String" || s.String != "" { + return json.Marshal(s.String) + } + if s.typ == "StringList" || s.StringList != nil { + return json.Marshal(s.StringList) + } + return nil, fmt.Errorf("type %T does not include a non-empty union type", s) +} + +type SchedulingEventTypeHostFilterValueVisitor interface { + VisitString(string) error + VisitStringList([]string) error +} + +func (s *SchedulingEventTypeHostFilterValue) Accept(visitor SchedulingEventTypeHostFilterValueVisitor) error { + if s.typ == "String" || s.String != "" { + return visitor.VisitString(s.String) + } + if s.typ == "StringList" || s.StringList != nil { + return visitor.VisitStringList(s.StringList) + } + return fmt.Errorf("type %T does not include a non-empty union type", s) +} + +var ( + schedulingEventTypeHostInputFieldHost = big.NewInt(1 << 0) + schedulingEventTypeHostInputFieldRole = big.NewInt(1 << 1) + schedulingEventTypeHostInputFieldWeight = big.NewInt(1 << 2) + schedulingEventTypeHostInputFieldSchedule = big.NewInt(1 << 3) +) + +// schedulingEventTypeHostInputNullableFields maps the wire names of SchedulingEventTypeHostInput's nullable fields (required or optional) to their field bits. +var schedulingEventTypeHostInputNullableFields = map[string]*big.Int{ + "schedule": schedulingEventTypeHostInputFieldSchedule, +} + +type SchedulingEventTypeHostInput struct { + // The host's id or uid. + Host string `json:"host" url:"host"` + // `required` hosts must all be free; one `member` is chosen for a booking. + Role *SchedulingEventTypeHostInputRole `json:"role,omitempty" url:"role,omitempty"` + // Share of a pool's bookings relative to other members. + Weight *int `json:"weight,omitempty" url:"weight,omitempty"` + // A schedule of this host's. Default: their default schedule. + Schedule *string `json:"schedule,omitempty" url:"schedule,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + + extraProperties map[string]interface{} + rawJSON json.RawMessage +} + +func (s *SchedulingEventTypeHostInput) GetHost() string { + if s == nil { + return "" + } + return s.Host +} + +func (s *SchedulingEventTypeHostInput) GetRole() *SchedulingEventTypeHostInputRole { + if s == nil { + return nil + } + return s.Role +} + +func (s *SchedulingEventTypeHostInput) GetWeight() *int { + if s == nil { + return nil + } + return s.Weight +} + +func (s *SchedulingEventTypeHostInput) GetSchedule() *string { + if s == nil { + return nil + } + return s.Schedule +} + +func (s *SchedulingEventTypeHostInput) GetExtraProperties() map[string]interface{} { + if s == nil { + return nil + } + return s.extraProperties +} + +func (s *SchedulingEventTypeHostInput) require(field *big.Int) { + next := new(big.Int) + if s.explicitFields != nil { + next.Set(s.explicitFields) + } + next.Or(next, field) + s.explicitFields = next +} + +// SetHost sets the Host field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingEventTypeHostInput) SetHost(host string) { + s.Host = host + s.require(schedulingEventTypeHostInputFieldHost) +} + +// SetRole sets the Role field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingEventTypeHostInput) SetRole(role *SchedulingEventTypeHostInputRole) { + s.Role = role + s.require(schedulingEventTypeHostInputFieldRole) +} + +// SetWeight sets the Weight field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingEventTypeHostInput) SetWeight(weight *int) { + s.Weight = weight + s.require(schedulingEventTypeHostInputFieldWeight) +} + +// SetSchedule sets the Schedule field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingEventTypeHostInput) SetSchedule(schedule *string) { + s.Schedule = schedule + s.require(schedulingEventTypeHostInputFieldSchedule) +} + +func (s *SchedulingEventTypeHostInput) UnmarshalJSON(data []byte) error { + type unmarshaler SchedulingEventTypeHostInput + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *s = SchedulingEventTypeHostInput(value) + extraProperties, err := internal.ExtractExtraProperties(data, *s) + if err != nil { + return err + } + s.extraProperties = extraProperties + presentFields, err := internal.ExplicitFieldsFromJSON(data, schedulingEventTypeHostInputNullableFields) + if err != nil { + return err + } + if presentFields != nil { + s.require(presentFields) + } + s.rawJSON = json.RawMessage(data) + return nil +} + +func (s *SchedulingEventTypeHostInput) MarshalJSON() ([]byte, error) { + type embed SchedulingEventTypeHostInput + var marshaler = struct { + embed + }{ + embed: embed(*s), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, s.explicitFields) + return json.Marshal(explicitMarshaler) +} + +func (s *SchedulingEventTypeHostInput) String() string { + if s == nil { + return "" + } + if len(s.rawJSON) > 0 { + if value, err := internal.StringifyJSON(s.rawJSON); err == nil { + return value + } + } + if value, err := internal.StringifyJSON(s); err == nil { + return value + } + return fmt.Sprintf("%#v", s) +} + +// `required` hosts must all be free; one `member` is chosen for a booking. +type SchedulingEventTypeHostInputRole string + +const ( + SchedulingEventTypeHostInputRoleRequired SchedulingEventTypeHostInputRole = "required" + SchedulingEventTypeHostInputRoleMember SchedulingEventTypeHostInputRole = "member" +) + +func NewSchedulingEventTypeHostInputRoleFromString(s string) (SchedulingEventTypeHostInputRole, error) { + switch s { + case "required": + return SchedulingEventTypeHostInputRoleRequired, nil + case "member": + return SchedulingEventTypeHostInputRoleMember, nil + } + var t SchedulingEventTypeHostInputRole + return "", fmt.Errorf("%s is not a valid %T", s, t) +} + +func (s SchedulingEventTypeHostInputRole) Ptr() *SchedulingEventTypeHostInputRole { + return &s +} + +var ( + schedulingEventTypeHostsItemFieldHost = big.NewInt(1 << 0) + schedulingEventTypeHostsItemFieldRole = big.NewInt(1 << 1) + schedulingEventTypeHostsItemFieldWeight = big.NewInt(1 << 2) + schedulingEventTypeHostsItemFieldSchedule = big.NewInt(1 << 3) +) + +// schedulingEventTypeHostsItemNullableFields maps the wire names of SchedulingEventTypeHostsItem's nullable fields (required or optional) to their field bits. +var schedulingEventTypeHostsItemNullableFields = map[string]*big.Int{ + "schedule": schedulingEventTypeHostsItemFieldSchedule, +} + +type SchedulingEventTypeHostsItem struct { + // The host's id. + Host string `json:"host" url:"host"` + // `required` hosts must all be free; one `member` is chosen for a booking. + Role SchedulingEventTypeHostsItemRole `json:"role" url:"role"` + // Share of a pool's bookings relative to other members. + Weight float64 `json:"weight" url:"weight"` + // The id of the schedule used for this event type. `null`: the host's default schedule. + Schedule *string `json:"schedule,omitempty" url:"schedule,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + + extraProperties map[string]interface{} + rawJSON json.RawMessage +} + +func (s *SchedulingEventTypeHostsItem) GetHost() string { + if s == nil { + return "" + } + return s.Host +} + +func (s *SchedulingEventTypeHostsItem) GetRole() SchedulingEventTypeHostsItemRole { + if s == nil { + return "" + } + return s.Role +} + +func (s *SchedulingEventTypeHostsItem) GetWeight() float64 { + if s == nil { + return 0 + } + return s.Weight +} + +func (s *SchedulingEventTypeHostsItem) GetSchedule() *string { + if s == nil { + return nil + } + return s.Schedule +} + +func (s *SchedulingEventTypeHostsItem) GetExtraProperties() map[string]interface{} { + if s == nil { + return nil + } + return s.extraProperties +} + +func (s *SchedulingEventTypeHostsItem) require(field *big.Int) { + next := new(big.Int) + if s.explicitFields != nil { + next.Set(s.explicitFields) + } + next.Or(next, field) + s.explicitFields = next +} + +// SetHost sets the Host field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingEventTypeHostsItem) SetHost(host string) { + s.Host = host + s.require(schedulingEventTypeHostsItemFieldHost) +} + +// SetRole sets the Role field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingEventTypeHostsItem) SetRole(role SchedulingEventTypeHostsItemRole) { + s.Role = role + s.require(schedulingEventTypeHostsItemFieldRole) +} + +// SetWeight sets the Weight field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingEventTypeHostsItem) SetWeight(weight float64) { + s.Weight = weight + s.require(schedulingEventTypeHostsItemFieldWeight) +} + +// SetSchedule sets the Schedule field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingEventTypeHostsItem) SetSchedule(schedule *string) { + s.Schedule = schedule + s.require(schedulingEventTypeHostsItemFieldSchedule) +} + +func (s *SchedulingEventTypeHostsItem) UnmarshalJSON(data []byte) error { + type unmarshaler SchedulingEventTypeHostsItem + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *s = SchedulingEventTypeHostsItem(value) + extraProperties, err := internal.ExtractExtraProperties(data, *s) + if err != nil { + return err + } + s.extraProperties = extraProperties + presentFields, err := internal.ExplicitFieldsFromJSON(data, schedulingEventTypeHostsItemNullableFields) + if err != nil { + return err + } + if presentFields != nil { + s.require(presentFields) + } + s.rawJSON = json.RawMessage(data) + return nil +} + +func (s *SchedulingEventTypeHostsItem) MarshalJSON() ([]byte, error) { + type embed SchedulingEventTypeHostsItem + var marshaler = struct { + embed + }{ + embed: embed(*s), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, s.explicitFields) + return json.Marshal(explicitMarshaler) +} + +func (s *SchedulingEventTypeHostsItem) String() string { + if s == nil { + return "" + } + if len(s.rawJSON) > 0 { + if value, err := internal.StringifyJSON(s.rawJSON); err == nil { + return value + } + } + if value, err := internal.StringifyJSON(s); err == nil { + return value + } + return fmt.Sprintf("%#v", s) +} + +// `required` hosts must all be free; one `member` is chosen for a booking. +type SchedulingEventTypeHostsItemRole string + +const ( + SchedulingEventTypeHostsItemRoleRequired SchedulingEventTypeHostsItemRole = "required" + SchedulingEventTypeHostsItemRoleMember SchedulingEventTypeHostsItemRole = "member" +) + +func NewSchedulingEventTypeHostsItemRoleFromString(s string) (SchedulingEventTypeHostsItemRole, error) { + switch s { + case "required": + return SchedulingEventTypeHostsItemRoleRequired, nil + case "member": + return SchedulingEventTypeHostsItemRoleMember, nil + } + var t SchedulingEventTypeHostsItemRole + return "", fmt.Errorf("%s is not a valid %T", s, t) +} + +func (s SchedulingEventTypeHostsItemRole) Ptr() *SchedulingEventTypeHostsItemRole { + return &s +} + +// Who a booking needs. `one_on_one`: one host. `pool`: any one of its hosts. `collective`: every `required` host, plus at most one `member`. `group`: one host, with attendees taking seats up to `capacity`. +type SchedulingEventTypeKind string + +const ( + SchedulingEventTypeKindOneOnOne SchedulingEventTypeKind = "one_on_one" + SchedulingEventTypeKindPool SchedulingEventTypeKind = "pool" + SchedulingEventTypeKindCollective SchedulingEventTypeKind = "collective" + SchedulingEventTypeKindGroup SchedulingEventTypeKind = "group" +) + +func NewSchedulingEventTypeKindFromString(s string) (SchedulingEventTypeKind, error) { + switch s { + case "one_on_one": + return SchedulingEventTypeKindOneOnOne, nil + case "pool": + return SchedulingEventTypeKindPool, nil + case "collective": + return SchedulingEventTypeKindCollective, nil + case "group": + return SchedulingEventTypeKindGroup, nil + } + var t SchedulingEventTypeKind + return "", fmt.Errorf("%s is not a valid %T", s, t) +} + +func (s SchedulingEventTypeKind) Ptr() *SchedulingEventTypeKind { + return &s +} + +var ( + schedulingEventTypeListFieldObject = big.NewInt(1 << 0) + schedulingEventTypeListFieldData = big.NewInt(1 << 1) + schedulingEventTypeListFieldHasMore = big.NewInt(1 << 2) +) + +type SchedulingEventTypeList struct { + Object SchedulingEventTypeListObject `json:"object" url:"object"` + Data []*SchedulingEventType `json:"data" url:"data"` + HasMore bool `json:"has_more" url:"has_more"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + + extraProperties map[string]interface{} + rawJSON json.RawMessage +} + +func (s *SchedulingEventTypeList) GetObject() SchedulingEventTypeListObject { + if s == nil { + return "" + } + return s.Object +} + +func (s *SchedulingEventTypeList) GetData() []*SchedulingEventType { + if s == nil { + return nil + } + return s.Data +} + +func (s *SchedulingEventTypeList) GetHasMore() bool { + if s == nil { + return false + } + return s.HasMore +} + +func (s *SchedulingEventTypeList) GetExtraProperties() map[string]interface{} { + if s == nil { + return nil + } + return s.extraProperties +} + +func (s *SchedulingEventTypeList) require(field *big.Int) { + next := new(big.Int) + if s.explicitFields != nil { + next.Set(s.explicitFields) + } + next.Or(next, field) + s.explicitFields = next +} + +// SetObject sets the Object field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingEventTypeList) SetObject(object SchedulingEventTypeListObject) { + s.Object = object + s.require(schedulingEventTypeListFieldObject) +} + +// SetData sets the Data field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingEventTypeList) SetData(data []*SchedulingEventType) { + s.Data = data + s.require(schedulingEventTypeListFieldData) +} + +// SetHasMore sets the HasMore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingEventTypeList) SetHasMore(hasMore bool) { + s.HasMore = hasMore + s.require(schedulingEventTypeListFieldHasMore) +} + +func (s *SchedulingEventTypeList) UnmarshalJSON(data []byte) error { + type unmarshaler SchedulingEventTypeList + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *s = SchedulingEventTypeList(value) + extraProperties, err := internal.ExtractExtraProperties(data, *s) + if err != nil { + return err + } + s.extraProperties = extraProperties + s.rawJSON = json.RawMessage(data) + return nil +} + +func (s *SchedulingEventTypeList) MarshalJSON() ([]byte, error) { + type embed SchedulingEventTypeList + var marshaler = struct { + embed + }{ + embed: embed(*s), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, s.explicitFields) + return json.Marshal(explicitMarshaler) +} + +func (s *SchedulingEventTypeList) String() string { + if s == nil { + return "" + } + if len(s.rawJSON) > 0 { + if value, err := internal.StringifyJSON(s.rawJSON); err == nil { + return value + } + } + if value, err := internal.StringifyJSON(s); err == nil { + return value + } + return fmt.Sprintf("%#v", s) +} + +type SchedulingEventTypeListObject string + +const ( + SchedulingEventTypeListObjectList SchedulingEventTypeListObject = "list" +) + +func NewSchedulingEventTypeListObjectFromString(s string) (SchedulingEventTypeListObject, error) { + switch s { + case "list": + return SchedulingEventTypeListObjectList, nil + } + var t SchedulingEventTypeListObject + return "", fmt.Errorf("%s is not a valid %T", s, t) +} + +func (s SchedulingEventTypeListObject) Ptr() *SchedulingEventTypeListObject { + return &s +} + +var ( + schedulingEventTypeNotificationsValueFieldEmailAttendee = big.NewInt(1 << 0) + schedulingEventTypeNotificationsValueFieldEmailHost = big.NewInt(1 << 1) + schedulingEventTypeNotificationsValueFieldSmsAttendee = big.NewInt(1 << 2) +) + +type SchedulingEventTypeNotificationsValue struct { + EmailAttendee *bool `json:"email_attendee,omitempty" url:"email_attendee,omitempty"` + EmailHost *bool `json:"email_host,omitempty" url:"email_host,omitempty"` + SmsAttendee *bool `json:"sms_attendee,omitempty" url:"sms_attendee,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + + extraProperties map[string]interface{} + rawJSON json.RawMessage +} + +func (s *SchedulingEventTypeNotificationsValue) GetEmailAttendee() *bool { + if s == nil { + return nil + } + return s.EmailAttendee +} + +func (s *SchedulingEventTypeNotificationsValue) GetEmailHost() *bool { + if s == nil { + return nil + } + return s.EmailHost +} + +func (s *SchedulingEventTypeNotificationsValue) GetSmsAttendee() *bool { + if s == nil { + return nil + } + return s.SmsAttendee +} + +func (s *SchedulingEventTypeNotificationsValue) GetExtraProperties() map[string]interface{} { + if s == nil { + return nil + } + return s.extraProperties +} + +func (s *SchedulingEventTypeNotificationsValue) require(field *big.Int) { + next := new(big.Int) + if s.explicitFields != nil { + next.Set(s.explicitFields) + } + next.Or(next, field) + s.explicitFields = next +} + +// SetEmailAttendee sets the EmailAttendee field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingEventTypeNotificationsValue) SetEmailAttendee(emailAttendee *bool) { + s.EmailAttendee = emailAttendee + s.require(schedulingEventTypeNotificationsValueFieldEmailAttendee) +} + +// SetEmailHost sets the EmailHost field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingEventTypeNotificationsValue) SetEmailHost(emailHost *bool) { + s.EmailHost = emailHost + s.require(schedulingEventTypeNotificationsValueFieldEmailHost) +} + +// SetSmsAttendee sets the SmsAttendee field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingEventTypeNotificationsValue) SetSmsAttendee(smsAttendee *bool) { + s.SmsAttendee = smsAttendee + s.require(schedulingEventTypeNotificationsValueFieldSmsAttendee) +} + +func (s *SchedulingEventTypeNotificationsValue) UnmarshalJSON(data []byte) error { + type unmarshaler SchedulingEventTypeNotificationsValue + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *s = SchedulingEventTypeNotificationsValue(value) + extraProperties, err := internal.ExtractExtraProperties(data, *s) + if err != nil { + return err + } + s.extraProperties = extraProperties + s.rawJSON = json.RawMessage(data) + return nil +} + +func (s *SchedulingEventTypeNotificationsValue) MarshalJSON() ([]byte, error) { + type embed SchedulingEventTypeNotificationsValue + var marshaler = struct { + embed + }{ + embed: embed(*s), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, s.explicitFields) + return json.Marshal(explicitMarshaler) +} + +func (s *SchedulingEventTypeNotificationsValue) String() string { + if s == nil { + return "" + } + if len(s.rawJSON) > 0 { + if value, err := internal.StringifyJSON(s.rawJSON); err == nil { + return value + } + } + if value, err := internal.StringifyJSON(s); err == nil { + return value + } + return fmt.Sprintf("%#v", s) +} + +type SchedulingEventTypeObject string + +const ( + SchedulingEventTypeObjectSchedulingEventType SchedulingEventTypeObject = "scheduling.event_type" +) + +func NewSchedulingEventTypeObjectFromString(s string) (SchedulingEventTypeObject, error) { + switch s { + case "scheduling.event_type": + return SchedulingEventTypeObjectSchedulingEventType, nil + } + var t SchedulingEventTypeObject + return "", fmt.Errorf("%s is not a valid %T", s, t) +} + +func (s SchedulingEventTypeObject) Ptr() *SchedulingEventTypeObject { + return &s +} + +// `active`: can be booked. `archived`: new bookings answer `not_found`; existing ones stay. +type SchedulingEventTypeStatus string + +const ( + SchedulingEventTypeStatusActive SchedulingEventTypeStatus = "active" + SchedulingEventTypeStatusArchived SchedulingEventTypeStatus = "archived" +) + +func NewSchedulingEventTypeStatusFromString(s string) (SchedulingEventTypeStatus, error) { + switch s { + case "active": + return SchedulingEventTypeStatusActive, nil + case "archived": + return SchedulingEventTypeStatusArchived, nil + } + var t SchedulingEventTypeStatus + return "", fmt.Errorf("%s is not a valid %T", s, t) +} + +func (s SchedulingEventTypeStatus) Ptr() *SchedulingEventTypeStatus { + return &s +} + +var ( + schedulingGuestInputFieldEmail = big.NewInt(1 << 0) + schedulingGuestInputFieldName = big.NewInt(1 << 1) +) + +// Someone else coming along. They're emailed about the booking, with no manage link. +type SchedulingGuestInput struct { + // Where they're emailed about the booking. + Email string `json:"email" url:"email"` + // Their name, if you have it. + Name *string `json:"name,omitempty" url:"name,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + + extraProperties map[string]interface{} + rawJSON json.RawMessage +} + +func (s *SchedulingGuestInput) GetEmail() string { + if s == nil { + return "" + } + return s.Email +} + +func (s *SchedulingGuestInput) GetName() *string { + if s == nil { + return nil + } + return s.Name +} + +func (s *SchedulingGuestInput) GetExtraProperties() map[string]interface{} { + if s == nil { + return nil + } + return s.extraProperties +} + +func (s *SchedulingGuestInput) require(field *big.Int) { + next := new(big.Int) + if s.explicitFields != nil { + next.Set(s.explicitFields) + } + next.Or(next, field) + s.explicitFields = next +} + +// SetEmail sets the Email field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingGuestInput) SetEmail(email string) { + s.Email = email + s.require(schedulingGuestInputFieldEmail) +} + +// SetName sets the Name field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingGuestInput) SetName(name *string) { + s.Name = name + s.require(schedulingGuestInputFieldName) +} + +func (s *SchedulingGuestInput) UnmarshalJSON(data []byte) error { + type unmarshaler SchedulingGuestInput + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *s = SchedulingGuestInput(value) + extraProperties, err := internal.ExtractExtraProperties(data, *s) + if err != nil { + return err + } + s.extraProperties = extraProperties + s.rawJSON = json.RawMessage(data) + return nil +} + +func (s *SchedulingGuestInput) MarshalJSON() ([]byte, error) { + type embed SchedulingGuestInput + var marshaler = struct { + embed + }{ + embed: embed(*s), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, s.explicitFields) + return json.Marshal(explicitMarshaler) +} + +func (s *SchedulingGuestInput) String() string { + if s == nil { + return "" + } + if len(s.rawJSON) > 0 { + if value, err := internal.StringifyJSON(s.rawJSON); err == nil { + return value + } + } + if value, err := internal.StringifyJSON(s); err == nil { + return value + } + return fmt.Sprintf("%#v", s) +} + +var ( + schedulingHolidayCalendarFieldObject = big.NewInt(1 << 0) + schedulingHolidayCalendarFieldID = big.NewInt(1 << 1) + schedulingHolidayCalendarFieldName = big.NewInt(1 << 2) + schedulingHolidayCalendarFieldSource = big.NewInt(1 << 3) + schedulingHolidayCalendarFieldCountry = big.NewInt(1 << 4) + schedulingHolidayCalendarFieldHosts = big.NewInt(1 << 5) + schedulingHolidayCalendarFieldHostFilter = big.NewInt(1 << 6) + schedulingHolidayCalendarFieldRegions = big.NewInt(1 << 7) + schedulingHolidayCalendarFieldDelegates = big.NewInt(1 << 8) + schedulingHolidayCalendarFieldExistingBookings = big.NewInt(1 << 9) + schedulingHolidayCalendarFieldLastReadAt = big.NewInt(1 << 10) + schedulingHolidayCalendarFieldLastError = big.NewInt(1 << 11) + schedulingHolidayCalendarFieldCreatedAt = big.NewInt(1 << 12) + schedulingHolidayCalendarFieldUpdatedAt = big.NewInt(1 << 13) +) + +// schedulingHolidayCalendarNullableFields maps the wire names of SchedulingHolidayCalendar's nullable fields (required or optional) to their field bits. +var schedulingHolidayCalendarNullableFields = map[string]*big.Int{ + "country": schedulingHolidayCalendarFieldCountry, + "hosts": schedulingHolidayCalendarFieldHosts, + "host_filter": schedulingHolidayCalendarFieldHostFilter, + "regions": schedulingHolidayCalendarFieldRegions, + "last_read_at": schedulingHolidayCalendarFieldLastReadAt, + "last_error": schedulingHolidayCalendarFieldLastError, +} + +type SchedulingHolidayCalendar struct { + Object SchedulingHolidayCalendarObject `json:"object" url:"object"` + ID string `json:"id" url:"id"` + Name string `json:"name" url:"name"` + Source SchedulingHolidayCalendarSource `json:"source" url:"source"` + Country *string `json:"country,omitempty" url:"country,omitempty"` + Hosts []string `json:"hosts,omitempty" url:"hosts,omitempty"` + HostFilter map[string]*SchedulingHolidayCalendarHostFilterValue `json:"host_filter,omitempty" url:"host_filter,omitempty"` + Regions []string `json:"regions,omitempty" url:"regions,omitempty"` + Delegates []string `json:"delegates" url:"delegates"` + ExistingBookings SchedulingHolidayCalendarExistingBookings `json:"existing_bookings" url:"existing_bookings"` + LastReadAt *string `json:"last_read_at,omitempty" url:"last_read_at,omitempty"` + // Why its feed couldn't be read. + LastError *string `json:"last_error,omitempty" url:"last_error,omitempty"` + CreatedAt string `json:"created_at" url:"created_at"` + UpdatedAt string `json:"updated_at" url:"updated_at"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + + extraProperties map[string]interface{} + rawJSON json.RawMessage +} + +func (s *SchedulingHolidayCalendar) GetObject() SchedulingHolidayCalendarObject { + if s == nil { + return "" + } + return s.Object +} + +func (s *SchedulingHolidayCalendar) GetID() string { + if s == nil { + return "" + } + return s.ID +} + +func (s *SchedulingHolidayCalendar) GetName() string { + if s == nil { + return "" + } + return s.Name +} + +func (s *SchedulingHolidayCalendar) GetSource() SchedulingHolidayCalendarSource { + if s == nil { + return "" + } + return s.Source +} + +func (s *SchedulingHolidayCalendar) GetCountry() *string { + if s == nil { + return nil + } + return s.Country +} + +func (s *SchedulingHolidayCalendar) GetHosts() []string { + if s == nil { + return nil + } + return s.Hosts +} + +func (s *SchedulingHolidayCalendar) GetHostFilter() map[string]*SchedulingHolidayCalendarHostFilterValue { + if s == nil { + return nil + } + return s.HostFilter +} + +func (s *SchedulingHolidayCalendar) GetRegions() []string { + if s == nil { + return nil + } + return s.Regions +} + +func (s *SchedulingHolidayCalendar) GetDelegates() []string { + if s == nil { + return nil + } + return s.Delegates +} + +func (s *SchedulingHolidayCalendar) GetExistingBookings() SchedulingHolidayCalendarExistingBookings { + if s == nil { + return "" + } + return s.ExistingBookings +} + +func (s *SchedulingHolidayCalendar) GetLastReadAt() *string { + if s == nil { + return nil + } + return s.LastReadAt +} + +func (s *SchedulingHolidayCalendar) GetLastError() *string { + if s == nil { + return nil + } + return s.LastError +} + +func (s *SchedulingHolidayCalendar) GetCreatedAt() string { + if s == nil { + return "" + } + return s.CreatedAt +} + +func (s *SchedulingHolidayCalendar) GetUpdatedAt() string { + if s == nil { + return "" + } + return s.UpdatedAt +} + +func (s *SchedulingHolidayCalendar) GetExtraProperties() map[string]interface{} { + if s == nil { + return nil + } + return s.extraProperties +} + +func (s *SchedulingHolidayCalendar) require(field *big.Int) { + next := new(big.Int) + if s.explicitFields != nil { + next.Set(s.explicitFields) + } + next.Or(next, field) + s.explicitFields = next +} + +// SetObject sets the Object field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingHolidayCalendar) SetObject(object SchedulingHolidayCalendarObject) { + s.Object = object + s.require(schedulingHolidayCalendarFieldObject) +} + +// SetID sets the ID field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingHolidayCalendar) SetID(id string) { + s.ID = id + s.require(schedulingHolidayCalendarFieldID) +} + +// SetName sets the Name field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingHolidayCalendar) SetName(name string) { + s.Name = name + s.require(schedulingHolidayCalendarFieldName) +} + +// SetSource sets the Source field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingHolidayCalendar) SetSource(source SchedulingHolidayCalendarSource) { + s.Source = source + s.require(schedulingHolidayCalendarFieldSource) +} + +// SetCountry sets the Country field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingHolidayCalendar) SetCountry(country *string) { + s.Country = country + s.require(schedulingHolidayCalendarFieldCountry) +} + +// SetHosts sets the Hosts field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingHolidayCalendar) SetHosts(hosts []string) { + s.Hosts = hosts + s.require(schedulingHolidayCalendarFieldHosts) +} + +// SetHostFilter sets the HostFilter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingHolidayCalendar) SetHostFilter(hostFilter map[string]*SchedulingHolidayCalendarHostFilterValue) { + s.HostFilter = hostFilter + s.require(schedulingHolidayCalendarFieldHostFilter) +} + +// SetRegions sets the Regions field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingHolidayCalendar) SetRegions(regions []string) { + s.Regions = regions + s.require(schedulingHolidayCalendarFieldRegions) +} + +// SetDelegates sets the Delegates field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingHolidayCalendar) SetDelegates(delegates []string) { + s.Delegates = delegates + s.require(schedulingHolidayCalendarFieldDelegates) +} + +// SetExistingBookings sets the ExistingBookings field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingHolidayCalendar) SetExistingBookings(existingBookings SchedulingHolidayCalendarExistingBookings) { + s.ExistingBookings = existingBookings + s.require(schedulingHolidayCalendarFieldExistingBookings) +} + +// SetLastReadAt sets the LastReadAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingHolidayCalendar) SetLastReadAt(lastReadAt *string) { + s.LastReadAt = lastReadAt + s.require(schedulingHolidayCalendarFieldLastReadAt) +} + +// SetLastError sets the LastError field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingHolidayCalendar) SetLastError(lastError *string) { + s.LastError = lastError + s.require(schedulingHolidayCalendarFieldLastError) +} + +// SetCreatedAt sets the CreatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingHolidayCalendar) SetCreatedAt(createdAt string) { + s.CreatedAt = createdAt + s.require(schedulingHolidayCalendarFieldCreatedAt) +} + +// SetUpdatedAt sets the UpdatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingHolidayCalendar) SetUpdatedAt(updatedAt string) { + s.UpdatedAt = updatedAt + s.require(schedulingHolidayCalendarFieldUpdatedAt) +} + +func (s *SchedulingHolidayCalendar) UnmarshalJSON(data []byte) error { + type unmarshaler SchedulingHolidayCalendar + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *s = SchedulingHolidayCalendar(value) + extraProperties, err := internal.ExtractExtraProperties(data, *s) + if err != nil { + return err + } + s.extraProperties = extraProperties + presentFields, err := internal.ExplicitFieldsFromJSON(data, schedulingHolidayCalendarNullableFields) + if err != nil { + return err + } + if presentFields != nil { + s.require(presentFields) + } + s.rawJSON = json.RawMessage(data) + return nil +} + +func (s *SchedulingHolidayCalendar) MarshalJSON() ([]byte, error) { + type embed SchedulingHolidayCalendar + var marshaler = struct { + embed + }{ + embed: embed(*s), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, s.explicitFields) + return json.Marshal(explicitMarshaler) +} + +func (s *SchedulingHolidayCalendar) String() string { + if s == nil { + return "" + } + if len(s.rawJSON) > 0 { + if value, err := internal.StringifyJSON(s.rawJSON); err == nil { + return value + } + } + if value, err := internal.StringifyJSON(s); err == nil { + return value + } + return fmt.Sprintf("%#v", s) +} + +type SchedulingHolidayCalendarExistingBookings string + +const ( + SchedulingHolidayCalendarExistingBookingsLeave SchedulingHolidayCalendarExistingBookings = "leave" + SchedulingHolidayCalendarExistingBookingsReassign SchedulingHolidayCalendarExistingBookings = "reassign" +) + +func NewSchedulingHolidayCalendarExistingBookingsFromString(s string) (SchedulingHolidayCalendarExistingBookings, error) { + switch s { + case "leave": + return SchedulingHolidayCalendarExistingBookingsLeave, nil + case "reassign": + return SchedulingHolidayCalendarExistingBookingsReassign, nil + } + var t SchedulingHolidayCalendarExistingBookings + return "", fmt.Errorf("%s is not a valid %T", s, t) +} + +func (s SchedulingHolidayCalendarExistingBookings) Ptr() *SchedulingHolidayCalendarExistingBookings { + return &s +} + +type SchedulingHolidayCalendarHostFilterValue struct { + String string + StringList []string + + typ string +} + +func (s *SchedulingHolidayCalendarHostFilterValue) GetString() string { + if s == nil { + return "" + } + return s.String +} + +func (s *SchedulingHolidayCalendarHostFilterValue) GetStringList() []string { + if s == nil { + return nil + } + return s.StringList +} + +func (s *SchedulingHolidayCalendarHostFilterValue) UnmarshalJSON(data []byte) error { + var valueString string + if err := json.Unmarshal(data, &valueString); err == nil { + s.typ = "String" + s.String = valueString + return nil + } + var valueStringList []string + if err := json.Unmarshal(data, &valueStringList); err == nil { + s.typ = "StringList" + s.StringList = valueStringList + return nil + } + return fmt.Errorf("%s cannot be deserialized as a %T", data, s) +} + +func (s SchedulingHolidayCalendarHostFilterValue) MarshalJSON() ([]byte, error) { + if s.typ == "String" || s.String != "" { + return json.Marshal(s.String) + } + if s.typ == "StringList" || s.StringList != nil { + return json.Marshal(s.StringList) + } + return nil, fmt.Errorf("type %T does not include a non-empty union type", s) +} + +type SchedulingHolidayCalendarHostFilterValueVisitor interface { + VisitString(string) error + VisitStringList([]string) error +} + +func (s *SchedulingHolidayCalendarHostFilterValue) Accept(visitor SchedulingHolidayCalendarHostFilterValueVisitor) error { + if s.typ == "String" || s.String != "" { + return visitor.VisitString(s.String) + } + if s.typ == "StringList" || s.StringList != nil { + return visitor.VisitStringList(s.StringList) + } + return fmt.Errorf("type %T does not include a non-empty union type", s) +} + +var ( + schedulingHolidayCalendarListFieldObject = big.NewInt(1 << 0) + schedulingHolidayCalendarListFieldData = big.NewInt(1 << 1) + schedulingHolidayCalendarListFieldHasMore = big.NewInt(1 << 2) +) + +type SchedulingHolidayCalendarList struct { + Object SchedulingHolidayCalendarListObject `json:"object" url:"object"` + Data []*SchedulingHolidayCalendar `json:"data" url:"data"` + HasMore bool `json:"has_more" url:"has_more"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + + extraProperties map[string]interface{} + rawJSON json.RawMessage +} + +func (s *SchedulingHolidayCalendarList) GetObject() SchedulingHolidayCalendarListObject { + if s == nil { + return "" + } + return s.Object +} + +func (s *SchedulingHolidayCalendarList) GetData() []*SchedulingHolidayCalendar { + if s == nil { + return nil + } + return s.Data +} + +func (s *SchedulingHolidayCalendarList) GetHasMore() bool { + if s == nil { + return false + } + return s.HasMore +} + +func (s *SchedulingHolidayCalendarList) GetExtraProperties() map[string]interface{} { + if s == nil { + return nil + } + return s.extraProperties +} + +func (s *SchedulingHolidayCalendarList) require(field *big.Int) { + next := new(big.Int) + if s.explicitFields != nil { + next.Set(s.explicitFields) + } + next.Or(next, field) + s.explicitFields = next +} + +// SetObject sets the Object field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingHolidayCalendarList) SetObject(object SchedulingHolidayCalendarListObject) { + s.Object = object + s.require(schedulingHolidayCalendarListFieldObject) +} + +// SetData sets the Data field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingHolidayCalendarList) SetData(data []*SchedulingHolidayCalendar) { + s.Data = data + s.require(schedulingHolidayCalendarListFieldData) +} + +// SetHasMore sets the HasMore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingHolidayCalendarList) SetHasMore(hasMore bool) { + s.HasMore = hasMore + s.require(schedulingHolidayCalendarListFieldHasMore) +} + +func (s *SchedulingHolidayCalendarList) UnmarshalJSON(data []byte) error { + type unmarshaler SchedulingHolidayCalendarList + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *s = SchedulingHolidayCalendarList(value) + extraProperties, err := internal.ExtractExtraProperties(data, *s) + if err != nil { + return err + } + s.extraProperties = extraProperties + s.rawJSON = json.RawMessage(data) + return nil +} + +func (s *SchedulingHolidayCalendarList) MarshalJSON() ([]byte, error) { + type embed SchedulingHolidayCalendarList + var marshaler = struct { + embed + }{ + embed: embed(*s), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, s.explicitFields) + return json.Marshal(explicitMarshaler) +} + +func (s *SchedulingHolidayCalendarList) String() string { + if s == nil { + return "" + } + if len(s.rawJSON) > 0 { + if value, err := internal.StringifyJSON(s.rawJSON); err == nil { + return value + } + } + if value, err := internal.StringifyJSON(s); err == nil { + return value + } + return fmt.Sprintf("%#v", s) +} + +type SchedulingHolidayCalendarListObject string + +const ( + SchedulingHolidayCalendarListObjectList SchedulingHolidayCalendarListObject = "list" +) + +func NewSchedulingHolidayCalendarListObjectFromString(s string) (SchedulingHolidayCalendarListObject, error) { + switch s { + case "list": + return SchedulingHolidayCalendarListObjectList, nil + } + var t SchedulingHolidayCalendarListObject + return "", fmt.Errorf("%s is not a valid %T", s, t) +} + +func (s SchedulingHolidayCalendarListObject) Ptr() *SchedulingHolidayCalendarListObject { + return &s +} + +type SchedulingHolidayCalendarObject string + +const ( + SchedulingHolidayCalendarObjectSchedulingHolidayCalendar SchedulingHolidayCalendarObject = "scheduling.holiday_calendar" +) + +func NewSchedulingHolidayCalendarObjectFromString(s string) (SchedulingHolidayCalendarObject, error) { + switch s { + case "scheduling.holiday_calendar": + return SchedulingHolidayCalendarObjectSchedulingHolidayCalendar, nil + } + var t SchedulingHolidayCalendarObject + return "", fmt.Errorf("%s is not a valid %T", s, t) +} + +func (s SchedulingHolidayCalendarObject) Ptr() *SchedulingHolidayCalendarObject { + return &s +} + +type SchedulingHolidayCalendarSource string + +const ( + SchedulingHolidayCalendarSourceCountry SchedulingHolidayCalendarSource = "country" + SchedulingHolidayCalendarSourceIcs SchedulingHolidayCalendarSource = "ics" +) + +func NewSchedulingHolidayCalendarSourceFromString(s string) (SchedulingHolidayCalendarSource, error) { + switch s { + case "country": + return SchedulingHolidayCalendarSourceCountry, nil + case "ics": + return SchedulingHolidayCalendarSourceIcs, nil + } + var t SchedulingHolidayCalendarSource + return "", fmt.Errorf("%s is not a valid %T", s, t) +} + +func (s SchedulingHolidayCalendarSource) Ptr() *SchedulingHolidayCalendarSource { + return &s +} + +var ( + schedulingHolidayListFieldObject = big.NewInt(1 << 0) + schedulingHolidayListFieldData = big.NewInt(1 << 1) + schedulingHolidayListFieldHasMore = big.NewInt(1 << 2) +) + +type SchedulingHolidayList struct { + Object SchedulingHolidayListObject `json:"object" url:"object"` + Data []*SchedulingHolidayListDataItem `json:"data" url:"data"` + HasMore bool `json:"has_more" url:"has_more"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + + extraProperties map[string]interface{} + rawJSON json.RawMessage +} + +func (s *SchedulingHolidayList) GetObject() SchedulingHolidayListObject { + if s == nil { + return "" + } + return s.Object +} + +func (s *SchedulingHolidayList) GetData() []*SchedulingHolidayListDataItem { + if s == nil { + return nil + } + return s.Data +} + +func (s *SchedulingHolidayList) GetHasMore() bool { + if s == nil { + return false + } + return s.HasMore +} + +func (s *SchedulingHolidayList) GetExtraProperties() map[string]interface{} { + if s == nil { + return nil + } + return s.extraProperties +} + +func (s *SchedulingHolidayList) require(field *big.Int) { + next := new(big.Int) + if s.explicitFields != nil { + next.Set(s.explicitFields) + } + next.Or(next, field) + s.explicitFields = next +} + +// SetObject sets the Object field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingHolidayList) SetObject(object SchedulingHolidayListObject) { + s.Object = object + s.require(schedulingHolidayListFieldObject) +} + +// SetData sets the Data field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingHolidayList) SetData(data []*SchedulingHolidayListDataItem) { + s.Data = data + s.require(schedulingHolidayListFieldData) +} + +// SetHasMore sets the HasMore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingHolidayList) SetHasMore(hasMore bool) { + s.HasMore = hasMore + s.require(schedulingHolidayListFieldHasMore) +} + +func (s *SchedulingHolidayList) UnmarshalJSON(data []byte) error { + type unmarshaler SchedulingHolidayList + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *s = SchedulingHolidayList(value) + extraProperties, err := internal.ExtractExtraProperties(data, *s) + if err != nil { + return err + } + s.extraProperties = extraProperties + s.rawJSON = json.RawMessage(data) + return nil +} + +func (s *SchedulingHolidayList) MarshalJSON() ([]byte, error) { + type embed SchedulingHolidayList + var marshaler = struct { + embed + }{ + embed: embed(*s), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, s.explicitFields) + return json.Marshal(explicitMarshaler) +} + +func (s *SchedulingHolidayList) String() string { + if s == nil { + return "" + } + if len(s.rawJSON) > 0 { + if value, err := internal.StringifyJSON(s.rawJSON); err == nil { + return value + } + } + if value, err := internal.StringifyJSON(s); err == nil { + return value + } + return fmt.Sprintf("%#v", s) +} + +var ( + schedulingHolidayListDataItemFieldDate = big.NewInt(1 << 0) + schedulingHolidayListDataItemFieldName = big.NewInt(1 << 1) + schedulingHolidayListDataItemFieldRegion = big.NewInt(1 << 2) +) + +// schedulingHolidayListDataItemNullableFields maps the wire names of SchedulingHolidayListDataItem's nullable fields (required or optional) to their field bits. +var schedulingHolidayListDataItemNullableFields = map[string]*big.Int{ + "region": schedulingHolidayListDataItemFieldRegion, +} + +type SchedulingHolidayListDataItem struct { + Date string `json:"date" url:"date"` + Name string `json:"name" url:"name"` + Region *string `json:"region,omitempty" url:"region,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + + extraProperties map[string]interface{} + rawJSON json.RawMessage +} + +func (s *SchedulingHolidayListDataItem) GetDate() string { + if s == nil { + return "" + } + return s.Date +} + +func (s *SchedulingHolidayListDataItem) GetName() string { + if s == nil { + return "" + } + return s.Name +} + +func (s *SchedulingHolidayListDataItem) GetRegion() *string { + if s == nil { + return nil + } + return s.Region +} + +func (s *SchedulingHolidayListDataItem) GetExtraProperties() map[string]interface{} { + if s == nil { + return nil + } + return s.extraProperties +} + +func (s *SchedulingHolidayListDataItem) require(field *big.Int) { + next := new(big.Int) + if s.explicitFields != nil { + next.Set(s.explicitFields) + } + next.Or(next, field) + s.explicitFields = next +} + +// SetDate sets the Date field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingHolidayListDataItem) SetDate(date string) { + s.Date = date + s.require(schedulingHolidayListDataItemFieldDate) +} + +// SetName sets the Name field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingHolidayListDataItem) SetName(name string) { + s.Name = name + s.require(schedulingHolidayListDataItemFieldName) +} + +// SetRegion sets the Region field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingHolidayListDataItem) SetRegion(region *string) { + s.Region = region + s.require(schedulingHolidayListDataItemFieldRegion) +} + +func (s *SchedulingHolidayListDataItem) UnmarshalJSON(data []byte) error { + type unmarshaler SchedulingHolidayListDataItem + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *s = SchedulingHolidayListDataItem(value) + extraProperties, err := internal.ExtractExtraProperties(data, *s) + if err != nil { + return err + } + s.extraProperties = extraProperties + presentFields, err := internal.ExplicitFieldsFromJSON(data, schedulingHolidayListDataItemNullableFields) + if err != nil { + return err + } + if presentFields != nil { + s.require(presentFields) + } + s.rawJSON = json.RawMessage(data) + return nil +} + +func (s *SchedulingHolidayListDataItem) MarshalJSON() ([]byte, error) { + type embed SchedulingHolidayListDataItem + var marshaler = struct { + embed + }{ + embed: embed(*s), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, s.explicitFields) + return json.Marshal(explicitMarshaler) +} + +func (s *SchedulingHolidayListDataItem) String() string { + if s == nil { + return "" + } + if len(s.rawJSON) > 0 { + if value, err := internal.StringifyJSON(s.rawJSON); err == nil { + return value + } + } + if value, err := internal.StringifyJSON(s); err == nil { + return value + } + return fmt.Sprintf("%#v", s) +} + +type SchedulingHolidayListObject string + +const ( + SchedulingHolidayListObjectList SchedulingHolidayListObject = "list" +) + +func NewSchedulingHolidayListObjectFromString(s string) (SchedulingHolidayListObject, error) { + switch s { + case "list": + return SchedulingHolidayListObjectList, nil + } + var t SchedulingHolidayListObject + return "", fmt.Errorf("%s is not a valid %T", s, t) +} + +func (s SchedulingHolidayListObject) Ptr() *SchedulingHolidayListObject { + return &s +} + +var ( + schedulingHostFieldObject = big.NewInt(1 << 0) + schedulingHostFieldID = big.NewInt(1 << 1) + schedulingHostFieldUID = big.NewInt(1 << 2) + schedulingHostFieldName = big.NewInt(1 << 3) + schedulingHostFieldEmail = big.NewInt(1 << 4) + schedulingHostFieldPhone = big.NewInt(1 << 5) + schedulingHostFieldCalendarAccount = big.NewInt(1 << 6) + schedulingHostFieldTimeZone = big.NewInt(1 << 7) + schedulingHostFieldLocale = big.NewInt(1 << 8) + schedulingHostFieldAttributes = big.NewInt(1 << 9) + schedulingHostFieldLocations = big.NewInt(1 << 10) + schedulingHostFieldMetadata = big.NewInt(1 << 11) + schedulingHostFieldStatus = big.NewInt(1 << 12) + schedulingHostFieldCreatedAt = big.NewInt(1 << 13) + schedulingHostFieldUpdatedAt = big.NewInt(1 << 14) +) + +// schedulingHostNullableFields maps the wire names of SchedulingHost's nullable fields (required or optional) to their field bits. +var schedulingHostNullableFields = map[string]*big.Int{ + "uid": schedulingHostFieldUID, + "email": schedulingHostFieldEmail, + "phone": schedulingHostFieldPhone, + "calendar_account": schedulingHostFieldCalendarAccount, + "locale": schedulingHostFieldLocale, +} + +type SchedulingHost struct { + Object SchedulingHostObject `json:"object" url:"object"` + ID string `json:"id" url:"id"` + // Your own id for this host, unique in the environment, accepted wherever a host id is. `null` when none is set. + UID *string `json:"uid,omitempty" url:"uid,omitempty"` + // The host's name. + Name string `json:"name" url:"name"` + // Where this host's notifications go. `null` when none is set. Not an identity, and need not be unique. + Email *string `json:"email,omitempty" url:"email,omitempty"` + // Where this host's SMS reminders go, in E.164. `null` when none is set. + Phone *string `json:"phone,omitempty" url:"phone,omitempty"` + // The mailbox a calendar delegation connects for this host, when it isn't `email`. `null` when none is set. + CalendarAccount *string `json:"calendar_account,omitempty" url:"calendar_account,omitempty"` + // The host's IANA time zone. Their schedules default to it, and limits count days and weeks in it. + TimeZone string `json:"time_zone" url:"time_zone"` + // What this host's notifications are written in. `null`: English. + Locale *string `json:"locale,omitempty" url:"locale,omitempty"` + // What pools filter hosts by, as strings or lists of strings. + Attributes map[string]*SchedulingHostAttributesValue `json:"attributes" url:"attributes"` + // This host's own office, meeting link and phone number. An event type's location that leaves its value blank uses them. + Locations []*SchedulingHostLocation `json:"locations" url:"locations"` + // Your own key-value pairs. + Metadata map[string]string `json:"metadata" url:"metadata"` + // `active`: can be offered. `disabled`: isn't offered, and keeps its existing bookings. + Status SchedulingHostStatus `json:"status" url:"status"` + CreatedAt string `json:"created_at" url:"created_at"` + UpdatedAt string `json:"updated_at" url:"updated_at"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + + extraProperties map[string]interface{} + rawJSON json.RawMessage +} + +func (s *SchedulingHost) GetObject() SchedulingHostObject { + if s == nil { + return "" + } + return s.Object +} + +func (s *SchedulingHost) GetID() string { + if s == nil { + return "" + } + return s.ID +} + +func (s *SchedulingHost) GetUID() *string { + if s == nil { + return nil + } + return s.UID +} + +func (s *SchedulingHost) GetName() string { + if s == nil { + return "" + } + return s.Name +} + +func (s *SchedulingHost) GetEmail() *string { + if s == nil { + return nil + } + return s.Email +} + +func (s *SchedulingHost) GetPhone() *string { + if s == nil { + return nil + } + return s.Phone +} + +func (s *SchedulingHost) GetCalendarAccount() *string { + if s == nil { + return nil + } + return s.CalendarAccount +} + +func (s *SchedulingHost) GetTimeZone() string { + if s == nil { + return "" + } + return s.TimeZone +} + +func (s *SchedulingHost) GetLocale() *string { + if s == nil { + return nil + } + return s.Locale +} + +func (s *SchedulingHost) GetAttributes() map[string]*SchedulingHostAttributesValue { + if s == nil { + return nil + } + return s.Attributes +} + +func (s *SchedulingHost) GetLocations() []*SchedulingHostLocation { + if s == nil { + return nil + } + return s.Locations +} + +func (s *SchedulingHost) GetMetadata() map[string]string { + if s == nil { + return nil + } + return s.Metadata +} + +func (s *SchedulingHost) GetStatus() SchedulingHostStatus { + if s == nil { + return "" + } + return s.Status +} + +func (s *SchedulingHost) GetCreatedAt() string { + if s == nil { + return "" + } + return s.CreatedAt +} + +func (s *SchedulingHost) GetUpdatedAt() string { + if s == nil { + return "" + } + return s.UpdatedAt +} + +func (s *SchedulingHost) GetExtraProperties() map[string]interface{} { + if s == nil { + return nil + } + return s.extraProperties +} + +func (s *SchedulingHost) require(field *big.Int) { + next := new(big.Int) + if s.explicitFields != nil { + next.Set(s.explicitFields) + } + next.Or(next, field) + s.explicitFields = next +} + +// SetObject sets the Object field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingHost) SetObject(object SchedulingHostObject) { + s.Object = object + s.require(schedulingHostFieldObject) +} + +// SetID sets the ID field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingHost) SetID(id string) { + s.ID = id + s.require(schedulingHostFieldID) +} + +// SetUID sets the UID field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingHost) SetUID(uid *string) { + s.UID = uid + s.require(schedulingHostFieldUID) +} + +// SetName sets the Name field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingHost) SetName(name string) { + s.Name = name + s.require(schedulingHostFieldName) +} + +// SetEmail sets the Email field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingHost) SetEmail(email *string) { + s.Email = email + s.require(schedulingHostFieldEmail) +} + +// SetPhone sets the Phone field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingHost) SetPhone(phone *string) { + s.Phone = phone + s.require(schedulingHostFieldPhone) +} + +// SetCalendarAccount sets the CalendarAccount field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingHost) SetCalendarAccount(calendarAccount *string) { + s.CalendarAccount = calendarAccount + s.require(schedulingHostFieldCalendarAccount) +} + +// SetTimeZone sets the TimeZone field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingHost) SetTimeZone(timeZone string) { + s.TimeZone = timeZone + s.require(schedulingHostFieldTimeZone) +} + +// SetLocale sets the Locale field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingHost) SetLocale(locale *string) { + s.Locale = locale + s.require(schedulingHostFieldLocale) +} + +// SetAttributes sets the Attributes field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingHost) SetAttributes(attributes map[string]*SchedulingHostAttributesValue) { + s.Attributes = attributes + s.require(schedulingHostFieldAttributes) +} + +// SetLocations sets the Locations field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingHost) SetLocations(locations []*SchedulingHostLocation) { + s.Locations = locations + s.require(schedulingHostFieldLocations) +} + +// SetMetadata sets the Metadata field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingHost) SetMetadata(metadata map[string]string) { + s.Metadata = metadata + s.require(schedulingHostFieldMetadata) +} + +// SetStatus sets the Status field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingHost) SetStatus(status SchedulingHostStatus) { + s.Status = status + s.require(schedulingHostFieldStatus) +} + +// SetCreatedAt sets the CreatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingHost) SetCreatedAt(createdAt string) { + s.CreatedAt = createdAt + s.require(schedulingHostFieldCreatedAt) +} + +// SetUpdatedAt sets the UpdatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingHost) SetUpdatedAt(updatedAt string) { + s.UpdatedAt = updatedAt + s.require(schedulingHostFieldUpdatedAt) +} + +func (s *SchedulingHost) UnmarshalJSON(data []byte) error { + type unmarshaler SchedulingHost + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *s = SchedulingHost(value) + extraProperties, err := internal.ExtractExtraProperties(data, *s) + if err != nil { + return err + } + s.extraProperties = extraProperties + presentFields, err := internal.ExplicitFieldsFromJSON(data, schedulingHostNullableFields) + if err != nil { + return err + } + if presentFields != nil { + s.require(presentFields) + } + s.rawJSON = json.RawMessage(data) + return nil +} + +func (s *SchedulingHost) MarshalJSON() ([]byte, error) { + type embed SchedulingHost + var marshaler = struct { + embed + }{ + embed: embed(*s), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, s.explicitFields) + return json.Marshal(explicitMarshaler) +} + +func (s *SchedulingHost) String() string { + if s == nil { + return "" + } + if len(s.rawJSON) > 0 { + if value, err := internal.StringifyJSON(s.rawJSON); err == nil { + return value + } + } + if value, err := internal.StringifyJSON(s); err == nil { + return value + } + return fmt.Sprintf("%#v", s) +} + +type SchedulingHostAttributesValue struct { + String string + StringList []string + + typ string +} + +func (s *SchedulingHostAttributesValue) GetString() string { + if s == nil { + return "" + } + return s.String +} + +func (s *SchedulingHostAttributesValue) GetStringList() []string { + if s == nil { + return nil + } + return s.StringList +} + +func (s *SchedulingHostAttributesValue) UnmarshalJSON(data []byte) error { + var valueString string + if err := json.Unmarshal(data, &valueString); err == nil { + s.typ = "String" + s.String = valueString + return nil + } + var valueStringList []string + if err := json.Unmarshal(data, &valueStringList); err == nil { + s.typ = "StringList" + s.StringList = valueStringList + return nil + } + return fmt.Errorf("%s cannot be deserialized as a %T", data, s) +} + +func (s SchedulingHostAttributesValue) MarshalJSON() ([]byte, error) { + if s.typ == "String" || s.String != "" { + return json.Marshal(s.String) + } + if s.typ == "StringList" || s.StringList != nil { + return json.Marshal(s.StringList) + } + return nil, fmt.Errorf("type %T does not include a non-empty union type", s) +} + +type SchedulingHostAttributesValueVisitor interface { + VisitString(string) error + VisitStringList([]string) error +} + +func (s *SchedulingHostAttributesValue) Accept(visitor SchedulingHostAttributesValueVisitor) error { + if s.typ == "String" || s.String != "" { + return visitor.VisitString(s.String) + } + if s.typ == "StringList" || s.StringList != nil { + return visitor.VisitStringList(s.StringList) + } + return fmt.Errorf("type %T does not include a non-empty union type", s) +} + +var ( + schedulingHostListFieldObject = big.NewInt(1 << 0) + schedulingHostListFieldData = big.NewInt(1 << 1) + schedulingHostListFieldHasMore = big.NewInt(1 << 2) +) + +type SchedulingHostList struct { + Object SchedulingHostListObject `json:"object" url:"object"` + Data []*SchedulingHost `json:"data" url:"data"` + HasMore bool `json:"has_more" url:"has_more"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + + extraProperties map[string]interface{} + rawJSON json.RawMessage +} + +func (s *SchedulingHostList) GetObject() SchedulingHostListObject { + if s == nil { + return "" + } + return s.Object +} + +func (s *SchedulingHostList) GetData() []*SchedulingHost { + if s == nil { + return nil + } + return s.Data +} + +func (s *SchedulingHostList) GetHasMore() bool { + if s == nil { + return false + } + return s.HasMore +} + +func (s *SchedulingHostList) GetExtraProperties() map[string]interface{} { + if s == nil { + return nil + } + return s.extraProperties +} + +func (s *SchedulingHostList) require(field *big.Int) { + next := new(big.Int) + if s.explicitFields != nil { + next.Set(s.explicitFields) + } + next.Or(next, field) + s.explicitFields = next +} + +// SetObject sets the Object field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingHostList) SetObject(object SchedulingHostListObject) { + s.Object = object + s.require(schedulingHostListFieldObject) +} + +// SetData sets the Data field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingHostList) SetData(data []*SchedulingHost) { + s.Data = data + s.require(schedulingHostListFieldData) +} + +// SetHasMore sets the HasMore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingHostList) SetHasMore(hasMore bool) { + s.HasMore = hasMore + s.require(schedulingHostListFieldHasMore) +} + +func (s *SchedulingHostList) UnmarshalJSON(data []byte) error { + type unmarshaler SchedulingHostList + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *s = SchedulingHostList(value) + extraProperties, err := internal.ExtractExtraProperties(data, *s) + if err != nil { + return err + } + s.extraProperties = extraProperties + s.rawJSON = json.RawMessage(data) + return nil +} + +func (s *SchedulingHostList) MarshalJSON() ([]byte, error) { + type embed SchedulingHostList + var marshaler = struct { + embed + }{ + embed: embed(*s), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, s.explicitFields) + return json.Marshal(explicitMarshaler) +} + +func (s *SchedulingHostList) String() string { + if s == nil { + return "" + } + if len(s.rawJSON) > 0 { + if value, err := internal.StringifyJSON(s.rawJSON); err == nil { + return value + } + } + if value, err := internal.StringifyJSON(s); err == nil { + return value + } + return fmt.Sprintf("%#v", s) +} + +type SchedulingHostListObject string + +const ( + SchedulingHostListObjectList SchedulingHostListObject = "list" +) + +func NewSchedulingHostListObjectFromString(s string) (SchedulingHostListObject, error) { + switch s { + case "list": + return SchedulingHostListObjectList, nil + } + var t SchedulingHostListObject + return "", fmt.Errorf("%s is not a valid %T", s, t) +} + +func (s SchedulingHostListObject) Ptr() *SchedulingHostListObject { + return &s +} + +// Where this host meets. A host has at most one of each type. +type SchedulingHostLocation struct { + Type string + Link *SchedulingHostLocationLink + Phone *SchedulingHostLocationPhone + InPerson *SchedulingHostLocationInPerson + + rawJSON json.RawMessage +} + +func (s *SchedulingHostLocation) GetType() string { + if s == nil { + return "" + } + return s.Type +} + +func (s *SchedulingHostLocation) GetLink() *SchedulingHostLocationLink { + if s == nil { + return nil + } + return s.Link +} + +func (s *SchedulingHostLocation) GetPhone() *SchedulingHostLocationPhone { + if s == nil { + return nil + } + return s.Phone +} + +func (s *SchedulingHostLocation) GetInPerson() *SchedulingHostLocationInPerson { + if s == nil { + return nil + } + return s.InPerson +} + +func (s *SchedulingHostLocation) UnmarshalJSON(data []byte) error { + var unmarshaler struct { + Type string `json:"type"` + } + if err := json.Unmarshal(data, &unmarshaler); err != nil { + return err + } + s.Type = unmarshaler.Type + if unmarshaler.Type == "" { + return fmt.Errorf("%T did not include discriminant type", s) + } + switch unmarshaler.Type { + case "link": + value := new(SchedulingHostLocationLink) + if err := json.Unmarshal(data, &value); err != nil { + return err + } + s.Link = value + case "phone": + value := new(SchedulingHostLocationPhone) + if err := json.Unmarshal(data, &value); err != nil { + return err + } + s.Phone = value + case "in_person": + value := new(SchedulingHostLocationInPerson) + if err := json.Unmarshal(data, &value); err != nil { + return err + } + s.InPerson = value + } + s.rawJSON = json.RawMessage(data) + return nil +} + +func (s SchedulingHostLocation) MarshalJSON() ([]byte, error) { + if err := s.validate(); err != nil { + return nil, err + } + if s.Link != nil { + return internal.MarshalJSONWithExtraProperty(s.Link, "type", "link") + } + if s.Phone != nil { + return internal.MarshalJSONWithExtraProperty(s.Phone, "type", "phone") + } + if s.InPerson != nil { + return internal.MarshalJSONWithExtraProperty(s.InPerson, "type", "in_person") + } + if len(s.rawJSON) > 0 { + return s.rawJSON, nil + } + return nil, fmt.Errorf("type %T does not define a non-empty union type", s) +} + +type SchedulingHostLocationVisitor interface { + VisitLink(*SchedulingHostLocationLink) error + VisitPhone(*SchedulingHostLocationPhone) error + VisitInPerson(*SchedulingHostLocationInPerson) error +} + +func (s *SchedulingHostLocation) Accept(visitor SchedulingHostLocationVisitor) error { + if s.Link != nil { + return visitor.VisitLink(s.Link) + } + if s.Phone != nil { + return visitor.VisitPhone(s.Phone) + } + if s.InPerson != nil { + return visitor.VisitInPerson(s.InPerson) + } + return fmt.Errorf("type %T does not define a non-empty union type", s) +} + +func (s *SchedulingHostLocation) validate() error { + if s == nil { + return fmt.Errorf("type %T is nil", s) + } + var fields []string + if s.Link != nil { + fields = append(fields, "link") + } + if s.Phone != nil { + fields = append(fields, "phone") + } + if s.InPerson != nil { + fields = append(fields, "in_person") + } + if len(fields) == 0 { + if s.Type != "" { + if len(s.rawJSON) > 0 { + return nil + } + return fmt.Errorf("type %T defines a discriminant set to %q but the field is not set", s, s.Type) + } + return fmt.Errorf("type %T is empty", s) + } + if len(fields) > 1 { + return fmt.Errorf("type %T defines values for %s, but only one value is allowed", s, fields) + } + if s.Type != "" { + field := fields[0] + if s.Type != field { + return fmt.Errorf( + "type %T defines a discriminant set to %q, but it does not match the %T field; either remove or update the discriminant to match", + s, + s.Type, + s, + ) + } + } + return nil +} + +var ( + schedulingHostLocationInPersonFieldAddress = big.NewInt(1 << 0) +) + +type SchedulingHostLocationInPerson struct { + // The address. It can't contain a link. + Address string `json:"address" url:"address"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + + extraProperties map[string]interface{} + rawJSON json.RawMessage +} + +func (s *SchedulingHostLocationInPerson) GetAddress() string { + if s == nil { + return "" + } + return s.Address +} + +func (s *SchedulingHostLocationInPerson) GetExtraProperties() map[string]interface{} { + if s == nil { + return nil + } + return s.extraProperties +} + +func (s *SchedulingHostLocationInPerson) require(field *big.Int) { + next := new(big.Int) + if s.explicitFields != nil { + next.Set(s.explicitFields) + } + next.Or(next, field) + s.explicitFields = next +} + +// SetAddress sets the Address field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingHostLocationInPerson) SetAddress(address string) { + s.Address = address + s.require(schedulingHostLocationInPersonFieldAddress) +} + +func (s *SchedulingHostLocationInPerson) UnmarshalJSON(data []byte) error { + type unmarshaler SchedulingHostLocationInPerson + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *s = SchedulingHostLocationInPerson(value) + extraProperties, err := internal.ExtractExtraProperties(data, *s) + if err != nil { + return err + } + s.extraProperties = extraProperties + s.rawJSON = json.RawMessage(data) + return nil +} + +func (s *SchedulingHostLocationInPerson) MarshalJSON() ([]byte, error) { + type embed SchedulingHostLocationInPerson + var marshaler = struct { + embed + }{ + embed: embed(*s), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, s.explicitFields) + return json.Marshal(explicitMarshaler) +} + +func (s *SchedulingHostLocationInPerson) String() string { + if s == nil { + return "" + } + if len(s.rawJSON) > 0 { + if value, err := internal.StringifyJSON(s.rawJSON); err == nil { + return value + } + } + if value, err := internal.StringifyJSON(s); err == nil { + return value + } + return fmt.Sprintf("%#v", s) +} + +var ( + schedulingHostLocationLinkFieldURL = big.NewInt(1 << 0) +) + +type SchedulingHostLocationLink struct { + // The link, which must be `https`. + URL string `json:"url" url:"url"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + + extraProperties map[string]interface{} + rawJSON json.RawMessage +} + +func (s *SchedulingHostLocationLink) GetURL() string { + if s == nil { + return "" + } + return s.URL +} + +func (s *SchedulingHostLocationLink) GetExtraProperties() map[string]interface{} { + if s == nil { + return nil + } + return s.extraProperties +} + +func (s *SchedulingHostLocationLink) require(field *big.Int) { + next := new(big.Int) + if s.explicitFields != nil { + next.Set(s.explicitFields) + } + next.Or(next, field) + s.explicitFields = next +} + +// SetURL sets the URL field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingHostLocationLink) SetURL(url string) { + s.URL = url + s.require(schedulingHostLocationLinkFieldURL) +} + +func (s *SchedulingHostLocationLink) UnmarshalJSON(data []byte) error { + type unmarshaler SchedulingHostLocationLink + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *s = SchedulingHostLocationLink(value) + extraProperties, err := internal.ExtractExtraProperties(data, *s) + if err != nil { + return err + } + s.extraProperties = extraProperties + s.rawJSON = json.RawMessage(data) + return nil +} + +func (s *SchedulingHostLocationLink) MarshalJSON() ([]byte, error) { + type embed SchedulingHostLocationLink + var marshaler = struct { + embed + }{ + embed: embed(*s), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, s.explicitFields) + return json.Marshal(explicitMarshaler) +} + +func (s *SchedulingHostLocationLink) String() string { + if s == nil { + return "" + } + if len(s.rawJSON) > 0 { + if value, err := internal.StringifyJSON(s.rawJSON); err == nil { + return value + } + } + if value, err := internal.StringifyJSON(s); err == nil { + return value + } + return fmt.Sprintf("%#v", s) +} + +var ( + schedulingHostLocationPhoneFieldNumber = big.NewInt(1 << 0) +) + +type SchedulingHostLocationPhone struct { + // The number, in E.164 format. + Number string `json:"number" url:"number"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + + extraProperties map[string]interface{} + rawJSON json.RawMessage +} + +func (s *SchedulingHostLocationPhone) GetNumber() string { + if s == nil { + return "" + } + return s.Number +} + +func (s *SchedulingHostLocationPhone) GetExtraProperties() map[string]interface{} { + if s == nil { + return nil + } + return s.extraProperties +} + +func (s *SchedulingHostLocationPhone) require(field *big.Int) { + next := new(big.Int) + if s.explicitFields != nil { + next.Set(s.explicitFields) + } + next.Or(next, field) + s.explicitFields = next +} + +// SetNumber sets the Number field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingHostLocationPhone) SetNumber(number string) { + s.Number = number + s.require(schedulingHostLocationPhoneFieldNumber) +} + +func (s *SchedulingHostLocationPhone) UnmarshalJSON(data []byte) error { + type unmarshaler SchedulingHostLocationPhone + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *s = SchedulingHostLocationPhone(value) + extraProperties, err := internal.ExtractExtraProperties(data, *s) + if err != nil { + return err + } + s.extraProperties = extraProperties + s.rawJSON = json.RawMessage(data) + return nil +} + +func (s *SchedulingHostLocationPhone) MarshalJSON() ([]byte, error) { + type embed SchedulingHostLocationPhone + var marshaler = struct { + embed + }{ + embed: embed(*s), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, s.explicitFields) + return json.Marshal(explicitMarshaler) +} + +func (s *SchedulingHostLocationPhone) String() string { + if s == nil { + return "" + } + if len(s.rawJSON) > 0 { + if value, err := internal.StringifyJSON(s.rawJSON); err == nil { + return value + } + } + if value, err := internal.StringifyJSON(s); err == nil { + return value + } + return fmt.Sprintf("%#v", s) +} + +type SchedulingHostObject string + +const ( + SchedulingHostObjectSchedulingHost SchedulingHostObject = "scheduling.host" +) + +func NewSchedulingHostObjectFromString(s string) (SchedulingHostObject, error) { + switch s { + case "scheduling.host": + return SchedulingHostObjectSchedulingHost, nil + } + var t SchedulingHostObject + return "", fmt.Errorf("%s is not a valid %T", s, t) +} + +func (s SchedulingHostObject) Ptr() *SchedulingHostObject { + return &s +} + +// `active`: can be offered. `disabled`: isn't offered, and keeps its existing bookings. +type SchedulingHostStatus string + +const ( + SchedulingHostStatusActive SchedulingHostStatus = "active" + SchedulingHostStatusDisabled SchedulingHostStatus = "disabled" +) + +func NewSchedulingHostStatusFromString(s string) (SchedulingHostStatus, error) { + switch s { + case "active": + return SchedulingHostStatusActive, nil + case "disabled": + return SchedulingHostStatusDisabled, nil + } + var t SchedulingHostStatus + return "", fmt.Errorf("%s is not a valid %T", s, t) +} + +func (s SchedulingHostStatus) Ptr() *SchedulingHostStatus { + return &s +} + +var ( + schedulingLimitFieldPeriod = big.NewInt(1 << 0) + schedulingLimitFieldMax = big.NewInt(1 << 1) + schedulingLimitFieldScope = big.NewInt(1 << 2) +) + +// A cap on bookings in a day or a week. +type SchedulingLimit struct { + // In the host's time zone. + Period SchedulingLimitPeriod `json:"period" url:"period"` + // The most bookings allowed in one period. + Max int `json:"max" url:"max"` + // Count this event type's bookings, or all of the host's. + Scope *SchedulingLimitScope `json:"scope,omitempty" url:"scope,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + + extraProperties map[string]interface{} + rawJSON json.RawMessage +} + +func (s *SchedulingLimit) GetPeriod() SchedulingLimitPeriod { + if s == nil { + return "" + } + return s.Period +} + +func (s *SchedulingLimit) GetMax() int { + if s == nil { + return 0 + } + return s.Max +} + +func (s *SchedulingLimit) GetScope() *SchedulingLimitScope { + if s == nil { + return nil + } + return s.Scope +} + +func (s *SchedulingLimit) GetExtraProperties() map[string]interface{} { + if s == nil { + return nil + } + return s.extraProperties +} + +func (s *SchedulingLimit) require(field *big.Int) { + next := new(big.Int) + if s.explicitFields != nil { + next.Set(s.explicitFields) + } + next.Or(next, field) + s.explicitFields = next +} + +// SetPeriod sets the Period field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingLimit) SetPeriod(period SchedulingLimitPeriod) { + s.Period = period + s.require(schedulingLimitFieldPeriod) +} + +// SetMax sets the Max field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingLimit) SetMax(max int) { + s.Max = max + s.require(schedulingLimitFieldMax) +} + +// SetScope sets the Scope field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingLimit) SetScope(scope *SchedulingLimitScope) { + s.Scope = scope + s.require(schedulingLimitFieldScope) +} + +func (s *SchedulingLimit) UnmarshalJSON(data []byte) error { + type unmarshaler SchedulingLimit + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *s = SchedulingLimit(value) + extraProperties, err := internal.ExtractExtraProperties(data, *s) + if err != nil { + return err + } + s.extraProperties = extraProperties + s.rawJSON = json.RawMessage(data) + return nil +} + +func (s *SchedulingLimit) MarshalJSON() ([]byte, error) { + type embed SchedulingLimit + var marshaler = struct { + embed + }{ + embed: embed(*s), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, s.explicitFields) + return json.Marshal(explicitMarshaler) +} + +func (s *SchedulingLimit) String() string { + if s == nil { + return "" + } + if len(s.rawJSON) > 0 { + if value, err := internal.StringifyJSON(s.rawJSON); err == nil { + return value + } + } + if value, err := internal.StringifyJSON(s); err == nil { + return value + } + return fmt.Sprintf("%#v", s) +} + +// In the host's time zone. +type SchedulingLimitPeriod string + +const ( + SchedulingLimitPeriodDay SchedulingLimitPeriod = "day" + SchedulingLimitPeriodWeek SchedulingLimitPeriod = "week" +) + +func NewSchedulingLimitPeriodFromString(s string) (SchedulingLimitPeriod, error) { + switch s { + case "day": + return SchedulingLimitPeriodDay, nil + case "week": + return SchedulingLimitPeriodWeek, nil + } + var t SchedulingLimitPeriod + return "", fmt.Errorf("%s is not a valid %T", s, t) +} + +func (s SchedulingLimitPeriod) Ptr() *SchedulingLimitPeriod { + return &s +} + +// Count this event type's bookings, or all of the host's. +type SchedulingLimitScope string + +const ( + SchedulingLimitScopeEventType SchedulingLimitScope = "event_type" + SchedulingLimitScopeHost SchedulingLimitScope = "host" +) + +func NewSchedulingLimitScopeFromString(s string) (SchedulingLimitScope, error) { + switch s { + case "event_type": + return SchedulingLimitScopeEventType, nil + case "host": + return SchedulingLimitScopeHost, nil + } + var t SchedulingLimitScope + return "", fmt.Errorf("%s is not a valid %T", s, t) +} + +func (s SchedulingLimitScope) Ptr() *SchedulingLimitScope { + return &s +} + +// Where a booking meets. `link`, `phone` and `in_person` carry their details, and on an event type, left blank, use the booked host's own if they have one; `google_meet`, `microsoft_teams` and `zoom` get a meeting made on the host's connected account. +type SchedulingLocation struct { + SchedulingLocationZero *SchedulingLocationZero + SchedulingLocationNumber *SchedulingLocationNumber + SchedulingLocationAddress *SchedulingLocationAddress + SchedulingLocationThree *SchedulingLocationThree + SchedulingLocationFour *SchedulingLocationFour + SchedulingLocationFive *SchedulingLocationFive + + typ string +} + +func (s *SchedulingLocation) GetSchedulingLocationZero() *SchedulingLocationZero { + if s == nil { + return nil + } + return s.SchedulingLocationZero +} + +func (s *SchedulingLocation) GetSchedulingLocationNumber() *SchedulingLocationNumber { + if s == nil { + return nil + } + return s.SchedulingLocationNumber +} + +func (s *SchedulingLocation) GetSchedulingLocationAddress() *SchedulingLocationAddress { + if s == nil { + return nil + } + return s.SchedulingLocationAddress +} + +func (s *SchedulingLocation) GetSchedulingLocationThree() *SchedulingLocationThree { + if s == nil { + return nil + } + return s.SchedulingLocationThree +} + +func (s *SchedulingLocation) GetSchedulingLocationFour() *SchedulingLocationFour { + if s == nil { + return nil + } + return s.SchedulingLocationFour +} + +func (s *SchedulingLocation) GetSchedulingLocationFive() *SchedulingLocationFive { + if s == nil { + return nil + } + return s.SchedulingLocationFive +} + +func (s *SchedulingLocation) UnmarshalJSON(data []byte) error { + if internal.MatchesObjectKeys(data, []string{"type", "url"}, []string{"type"}) { + valueSchedulingLocationZero := new(SchedulingLocationZero) + if err := json.Unmarshal(data, &valueSchedulingLocationZero); err == nil { + s.typ = "SchedulingLocationZero" + s.SchedulingLocationZero = valueSchedulingLocationZero + return nil + } + } + if internal.MatchesObjectKeys(data, []string{"type", "number"}, []string{"type"}) { + valueSchedulingLocationNumber := new(SchedulingLocationNumber) + if err := json.Unmarshal(data, &valueSchedulingLocationNumber); err == nil { + s.typ = "SchedulingLocationNumber" + s.SchedulingLocationNumber = valueSchedulingLocationNumber + return nil + } + } + if internal.MatchesObjectKeys(data, []string{"type", "address"}, []string{"type"}) { + valueSchedulingLocationAddress := new(SchedulingLocationAddress) + if err := json.Unmarshal(data, &valueSchedulingLocationAddress); err == nil { + s.typ = "SchedulingLocationAddress" + s.SchedulingLocationAddress = valueSchedulingLocationAddress + return nil + } + } + if internal.MatchesObjectKeys(data, []string{"type"}, []string{"type"}) { + valueSchedulingLocationThree := new(SchedulingLocationThree) + if err := json.Unmarshal(data, &valueSchedulingLocationThree); err == nil { + s.typ = "SchedulingLocationThree" + s.SchedulingLocationThree = valueSchedulingLocationThree + return nil + } + } + if internal.MatchesObjectKeys(data, []string{"type"}, []string{"type"}) { + valueSchedulingLocationFour := new(SchedulingLocationFour) + if err := json.Unmarshal(data, &valueSchedulingLocationFour); err == nil { + s.typ = "SchedulingLocationFour" + s.SchedulingLocationFour = valueSchedulingLocationFour + return nil + } + } + if internal.MatchesObjectKeys(data, []string{"type", "url"}, []string{"type"}) { + valueSchedulingLocationFive := new(SchedulingLocationFive) + if err := json.Unmarshal(data, &valueSchedulingLocationFive); err == nil { + s.typ = "SchedulingLocationFive" + s.SchedulingLocationFive = valueSchedulingLocationFive + return nil + } + } + if internal.HasObjectKeys(data, []string{"type"}) { + valueSchedulingLocationZero := new(SchedulingLocationZero) + if err := json.Unmarshal(data, &valueSchedulingLocationZero); err == nil { + s.typ = "SchedulingLocationZero" + s.SchedulingLocationZero = valueSchedulingLocationZero + return nil + } + } + if internal.HasObjectKeys(data, []string{"type"}) { + valueSchedulingLocationNumber := new(SchedulingLocationNumber) + if err := json.Unmarshal(data, &valueSchedulingLocationNumber); err == nil { + s.typ = "SchedulingLocationNumber" + s.SchedulingLocationNumber = valueSchedulingLocationNumber + return nil + } + } + if internal.HasObjectKeys(data, []string{"type"}) { + valueSchedulingLocationAddress := new(SchedulingLocationAddress) + if err := json.Unmarshal(data, &valueSchedulingLocationAddress); err == nil { + s.typ = "SchedulingLocationAddress" + s.SchedulingLocationAddress = valueSchedulingLocationAddress + return nil + } + } + if internal.HasObjectKeys(data, []string{"type"}) { + valueSchedulingLocationThree := new(SchedulingLocationThree) + if err := json.Unmarshal(data, &valueSchedulingLocationThree); err == nil { + s.typ = "SchedulingLocationThree" + s.SchedulingLocationThree = valueSchedulingLocationThree + return nil + } + } + if internal.HasObjectKeys(data, []string{"type"}) { + valueSchedulingLocationFour := new(SchedulingLocationFour) + if err := json.Unmarshal(data, &valueSchedulingLocationFour); err == nil { + s.typ = "SchedulingLocationFour" + s.SchedulingLocationFour = valueSchedulingLocationFour + return nil + } + } + if internal.HasObjectKeys(data, []string{"type"}) { + valueSchedulingLocationFive := new(SchedulingLocationFive) + if err := json.Unmarshal(data, &valueSchedulingLocationFive); err == nil { + s.typ = "SchedulingLocationFive" + s.SchedulingLocationFive = valueSchedulingLocationFive + return nil + } + } + valueSchedulingLocationZero := new(SchedulingLocationZero) + if err := json.Unmarshal(data, &valueSchedulingLocationZero); err == nil { + s.typ = "SchedulingLocationZero" + s.SchedulingLocationZero = valueSchedulingLocationZero + return nil + } + valueSchedulingLocationNumber := new(SchedulingLocationNumber) + if err := json.Unmarshal(data, &valueSchedulingLocationNumber); err == nil { + s.typ = "SchedulingLocationNumber" + s.SchedulingLocationNumber = valueSchedulingLocationNumber + return nil + } + valueSchedulingLocationAddress := new(SchedulingLocationAddress) + if err := json.Unmarshal(data, &valueSchedulingLocationAddress); err == nil { + s.typ = "SchedulingLocationAddress" + s.SchedulingLocationAddress = valueSchedulingLocationAddress + return nil + } + valueSchedulingLocationThree := new(SchedulingLocationThree) + if err := json.Unmarshal(data, &valueSchedulingLocationThree); err == nil { + s.typ = "SchedulingLocationThree" + s.SchedulingLocationThree = valueSchedulingLocationThree + return nil + } + valueSchedulingLocationFour := new(SchedulingLocationFour) + if err := json.Unmarshal(data, &valueSchedulingLocationFour); err == nil { + s.typ = "SchedulingLocationFour" + s.SchedulingLocationFour = valueSchedulingLocationFour + return nil + } + valueSchedulingLocationFive := new(SchedulingLocationFive) + if err := json.Unmarshal(data, &valueSchedulingLocationFive); err == nil { + s.typ = "SchedulingLocationFive" + s.SchedulingLocationFive = valueSchedulingLocationFive + return nil + } + return fmt.Errorf("%s cannot be deserialized as a %T", data, s) +} + +func (s SchedulingLocation) MarshalJSON() ([]byte, error) { + if s.typ == "SchedulingLocationZero" || s.SchedulingLocationZero != nil { + return json.Marshal(s.SchedulingLocationZero) + } + if s.typ == "SchedulingLocationNumber" || s.SchedulingLocationNumber != nil { + return json.Marshal(s.SchedulingLocationNumber) + } + if s.typ == "SchedulingLocationAddress" || s.SchedulingLocationAddress != nil { + return json.Marshal(s.SchedulingLocationAddress) + } + if s.typ == "SchedulingLocationThree" || s.SchedulingLocationThree != nil { + return json.Marshal(s.SchedulingLocationThree) + } + if s.typ == "SchedulingLocationFour" || s.SchedulingLocationFour != nil { + return json.Marshal(s.SchedulingLocationFour) + } + if s.typ == "SchedulingLocationFive" || s.SchedulingLocationFive != nil { + return json.Marshal(s.SchedulingLocationFive) + } + return nil, fmt.Errorf("type %T does not include a non-empty union type", s) +} + +type SchedulingLocationVisitor interface { + VisitSchedulingLocationZero(*SchedulingLocationZero) error + VisitSchedulingLocationNumber(*SchedulingLocationNumber) error + VisitSchedulingLocationAddress(*SchedulingLocationAddress) error + VisitSchedulingLocationThree(*SchedulingLocationThree) error + VisitSchedulingLocationFour(*SchedulingLocationFour) error + VisitSchedulingLocationFive(*SchedulingLocationFive) error +} + +func (s *SchedulingLocation) Accept(visitor SchedulingLocationVisitor) error { + if s.typ == "SchedulingLocationZero" || s.SchedulingLocationZero != nil { + return visitor.VisitSchedulingLocationZero(s.SchedulingLocationZero) + } + if s.typ == "SchedulingLocationNumber" || s.SchedulingLocationNumber != nil { + return visitor.VisitSchedulingLocationNumber(s.SchedulingLocationNumber) + } + if s.typ == "SchedulingLocationAddress" || s.SchedulingLocationAddress != nil { + return visitor.VisitSchedulingLocationAddress(s.SchedulingLocationAddress) + } + if s.typ == "SchedulingLocationThree" || s.SchedulingLocationThree != nil { + return visitor.VisitSchedulingLocationThree(s.SchedulingLocationThree) + } + if s.typ == "SchedulingLocationFour" || s.SchedulingLocationFour != nil { + return visitor.VisitSchedulingLocationFour(s.SchedulingLocationFour) + } + if s.typ == "SchedulingLocationFive" || s.SchedulingLocationFive != nil { + return visitor.VisitSchedulingLocationFive(s.SchedulingLocationFive) + } + return fmt.Errorf("type %T does not include a non-empty union type", s) +} + +var ( + schedulingLocationAddressFieldType = big.NewInt(1 << 0) + schedulingLocationAddressFieldAddress = big.NewInt(1 << 1) +) + +// schedulingLocationAddressNullableFields maps the wire names of SchedulingLocationAddress's nullable fields (required or optional) to their field bits. +var schedulingLocationAddressNullableFields = map[string]*big.Int{ + "address": schedulingLocationAddressFieldAddress, +} + +type SchedulingLocationAddress struct { + Type SchedulingLocationAddressType `json:"type" url:"type"` + // The address to meet at. `null` on an event type means the booking supplies its own. + Address *string `json:"address,omitempty" url:"address,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + + extraProperties map[string]interface{} + rawJSON json.RawMessage +} + +func (s *SchedulingLocationAddress) GetType() SchedulingLocationAddressType { + if s == nil { + return "" + } + return s.Type +} + +func (s *SchedulingLocationAddress) GetAddress() *string { + if s == nil { + return nil + } + return s.Address +} + +func (s *SchedulingLocationAddress) GetExtraProperties() map[string]interface{} { + if s == nil { + return nil + } + return s.extraProperties +} + +func (s *SchedulingLocationAddress) require(field *big.Int) { + next := new(big.Int) + if s.explicitFields != nil { + next.Set(s.explicitFields) + } + next.Or(next, field) + s.explicitFields = next +} + +// SetType sets the Type field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingLocationAddress) SetType(type_ SchedulingLocationAddressType) { + s.Type = type_ + s.require(schedulingLocationAddressFieldType) +} + +// SetAddress sets the Address field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingLocationAddress) SetAddress(address *string) { + s.Address = address + s.require(schedulingLocationAddressFieldAddress) +} + +func (s *SchedulingLocationAddress) UnmarshalJSON(data []byte) error { + type unmarshaler SchedulingLocationAddress + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *s = SchedulingLocationAddress(value) + extraProperties, err := internal.ExtractExtraProperties(data, *s) + if err != nil { + return err + } + s.extraProperties = extraProperties + presentFields, err := internal.ExplicitFieldsFromJSON(data, schedulingLocationAddressNullableFields) + if err != nil { + return err + } + if presentFields != nil { + s.require(presentFields) + } + s.rawJSON = json.RawMessage(data) + return nil +} + +func (s *SchedulingLocationAddress) MarshalJSON() ([]byte, error) { + type embed SchedulingLocationAddress + var marshaler = struct { + embed + }{ + embed: embed(*s), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, s.explicitFields) + return json.Marshal(explicitMarshaler) +} + +func (s *SchedulingLocationAddress) String() string { + if s == nil { + return "" + } + if len(s.rawJSON) > 0 { + if value, err := internal.StringifyJSON(s.rawJSON); err == nil { + return value + } + } + if value, err := internal.StringifyJSON(s); err == nil { + return value + } + return fmt.Sprintf("%#v", s) +} + +type SchedulingLocationAddressType string + +const ( + SchedulingLocationAddressTypeInPerson SchedulingLocationAddressType = "in_person" +) + +func NewSchedulingLocationAddressTypeFromString(s string) (SchedulingLocationAddressType, error) { + switch s { + case "in_person": + return SchedulingLocationAddressTypeInPerson, nil + } + var t SchedulingLocationAddressType + return "", fmt.Errorf("%s is not a valid %T", s, t) +} + +func (s SchedulingLocationAddressType) Ptr() *SchedulingLocationAddressType { + return &s +} + +var ( + schedulingLocationFiveFieldType = big.NewInt(1 << 0) + schedulingLocationFiveFieldURL = big.NewInt(1 << 1) +) + +// schedulingLocationFiveNullableFields maps the wire names of SchedulingLocationFive's nullable fields (required or optional) to their field bits. +var schedulingLocationFiveNullableFields = map[string]*big.Int{ + "url": schedulingLocationFiveFieldURL, +} + +type SchedulingLocationFive struct { + Type SchedulingLocationFiveType `json:"type" url:"type"` + // The meeting's link, once it's created on the host's Zoom account. + URL *string `json:"url,omitempty" url:"url,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + + extraProperties map[string]interface{} + rawJSON json.RawMessage +} + +func (s *SchedulingLocationFive) GetType() SchedulingLocationFiveType { + if s == nil { + return "" + } + return s.Type +} + +func (s *SchedulingLocationFive) GetURL() *string { + if s == nil { + return nil + } + return s.URL +} + +func (s *SchedulingLocationFive) GetExtraProperties() map[string]interface{} { + if s == nil { + return nil + } + return s.extraProperties +} + +func (s *SchedulingLocationFive) require(field *big.Int) { + next := new(big.Int) + if s.explicitFields != nil { + next.Set(s.explicitFields) + } + next.Or(next, field) + s.explicitFields = next +} + +// SetType sets the Type field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingLocationFive) SetType(type_ SchedulingLocationFiveType) { + s.Type = type_ + s.require(schedulingLocationFiveFieldType) +} + +// SetURL sets the URL field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingLocationFive) SetURL(url *string) { + s.URL = url + s.require(schedulingLocationFiveFieldURL) +} + +func (s *SchedulingLocationFive) UnmarshalJSON(data []byte) error { + type unmarshaler SchedulingLocationFive + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *s = SchedulingLocationFive(value) + extraProperties, err := internal.ExtractExtraProperties(data, *s) + if err != nil { + return err + } + s.extraProperties = extraProperties + presentFields, err := internal.ExplicitFieldsFromJSON(data, schedulingLocationFiveNullableFields) + if err != nil { + return err + } + if presentFields != nil { + s.require(presentFields) + } + s.rawJSON = json.RawMessage(data) + return nil +} + +func (s *SchedulingLocationFive) MarshalJSON() ([]byte, error) { + type embed SchedulingLocationFive + var marshaler = struct { + embed + }{ + embed: embed(*s), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, s.explicitFields) + return json.Marshal(explicitMarshaler) +} + +func (s *SchedulingLocationFive) String() string { + if s == nil { + return "" + } + if len(s.rawJSON) > 0 { + if value, err := internal.StringifyJSON(s.rawJSON); err == nil { + return value + } + } + if value, err := internal.StringifyJSON(s); err == nil { + return value + } + return fmt.Sprintf("%#v", s) +} + +type SchedulingLocationFiveType string + +const ( + SchedulingLocationFiveTypeZoom SchedulingLocationFiveType = "zoom" +) + +func NewSchedulingLocationFiveTypeFromString(s string) (SchedulingLocationFiveType, error) { + switch s { + case "zoom": + return SchedulingLocationFiveTypeZoom, nil + } + var t SchedulingLocationFiveType + return "", fmt.Errorf("%s is not a valid %T", s, t) +} + +func (s SchedulingLocationFiveType) Ptr() *SchedulingLocationFiveType { + return &s +} + +var ( + schedulingLocationFourFieldType = big.NewInt(1 << 0) +) + +type SchedulingLocationFour struct { + Type SchedulingLocationFourType `json:"type" url:"type"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + + extraProperties map[string]interface{} + rawJSON json.RawMessage +} + +func (s *SchedulingLocationFour) GetType() SchedulingLocationFourType { + if s == nil { + return "" + } + return s.Type +} + +func (s *SchedulingLocationFour) GetExtraProperties() map[string]interface{} { + if s == nil { + return nil + } + return s.extraProperties +} + +func (s *SchedulingLocationFour) require(field *big.Int) { + next := new(big.Int) + if s.explicitFields != nil { + next.Set(s.explicitFields) + } + next.Or(next, field) + s.explicitFields = next +} + +// SetType sets the Type field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingLocationFour) SetType(type_ SchedulingLocationFourType) { + s.Type = type_ + s.require(schedulingLocationFourFieldType) +} + +func (s *SchedulingLocationFour) UnmarshalJSON(data []byte) error { + type unmarshaler SchedulingLocationFour + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *s = SchedulingLocationFour(value) + extraProperties, err := internal.ExtractExtraProperties(data, *s) + if err != nil { + return err + } + s.extraProperties = extraProperties + s.rawJSON = json.RawMessage(data) + return nil +} + +func (s *SchedulingLocationFour) MarshalJSON() ([]byte, error) { + type embed SchedulingLocationFour + var marshaler = struct { + embed + }{ + embed: embed(*s), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, s.explicitFields) + return json.Marshal(explicitMarshaler) +} + +func (s *SchedulingLocationFour) String() string { + if s == nil { + return "" + } + if len(s.rawJSON) > 0 { + if value, err := internal.StringifyJSON(s.rawJSON); err == nil { + return value + } + } + if value, err := internal.StringifyJSON(s); err == nil { + return value + } + return fmt.Sprintf("%#v", s) +} + +type SchedulingLocationFourType string + +const ( + SchedulingLocationFourTypeMicrosoftTeams SchedulingLocationFourType = "microsoft_teams" +) + +func NewSchedulingLocationFourTypeFromString(s string) (SchedulingLocationFourType, error) { + switch s { + case "microsoft_teams": + return SchedulingLocationFourTypeMicrosoftTeams, nil + } + var t SchedulingLocationFourType + return "", fmt.Errorf("%s is not a valid %T", s, t) +} + +func (s SchedulingLocationFourType) Ptr() *SchedulingLocationFourType { + return &s +} + +var ( + schedulingLocationNumberFieldType = big.NewInt(1 << 0) + schedulingLocationNumberFieldNumber = big.NewInt(1 << 1) +) + +// schedulingLocationNumberNullableFields maps the wire names of SchedulingLocationNumber's nullable fields (required or optional) to their field bits. +var schedulingLocationNumberNullableFields = map[string]*big.Int{ + "number": schedulingLocationNumberFieldNumber, +} + +type SchedulingLocationNumber struct { + Type SchedulingLocationNumberType `json:"type" url:"type"` + // The phone number to call. `null` on an event type means the booking supplies its own. + Number *string `json:"number,omitempty" url:"number,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + + extraProperties map[string]interface{} + rawJSON json.RawMessage +} + +func (s *SchedulingLocationNumber) GetType() SchedulingLocationNumberType { + if s == nil { + return "" + } + return s.Type +} + +func (s *SchedulingLocationNumber) GetNumber() *string { + if s == nil { + return nil + } + return s.Number +} + +func (s *SchedulingLocationNumber) GetExtraProperties() map[string]interface{} { + if s == nil { + return nil + } + return s.extraProperties +} + +func (s *SchedulingLocationNumber) require(field *big.Int) { + next := new(big.Int) + if s.explicitFields != nil { + next.Set(s.explicitFields) + } + next.Or(next, field) + s.explicitFields = next +} + +// SetType sets the Type field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingLocationNumber) SetType(type_ SchedulingLocationNumberType) { + s.Type = type_ + s.require(schedulingLocationNumberFieldType) +} + +// SetNumber sets the Number field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingLocationNumber) SetNumber(number *string) { + s.Number = number + s.require(schedulingLocationNumberFieldNumber) +} + +func (s *SchedulingLocationNumber) UnmarshalJSON(data []byte) error { + type unmarshaler SchedulingLocationNumber + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *s = SchedulingLocationNumber(value) + extraProperties, err := internal.ExtractExtraProperties(data, *s) + if err != nil { + return err + } + s.extraProperties = extraProperties + presentFields, err := internal.ExplicitFieldsFromJSON(data, schedulingLocationNumberNullableFields) + if err != nil { + return err + } + if presentFields != nil { + s.require(presentFields) + } + s.rawJSON = json.RawMessage(data) + return nil +} + +func (s *SchedulingLocationNumber) MarshalJSON() ([]byte, error) { + type embed SchedulingLocationNumber + var marshaler = struct { + embed + }{ + embed: embed(*s), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, s.explicitFields) + return json.Marshal(explicitMarshaler) +} + +func (s *SchedulingLocationNumber) String() string { + if s == nil { + return "" + } + if len(s.rawJSON) > 0 { + if value, err := internal.StringifyJSON(s.rawJSON); err == nil { + return value + } + } + if value, err := internal.StringifyJSON(s); err == nil { + return value + } + return fmt.Sprintf("%#v", s) +} + +type SchedulingLocationNumberType string + +const ( + SchedulingLocationNumberTypePhone SchedulingLocationNumberType = "phone" +) + +func NewSchedulingLocationNumberTypeFromString(s string) (SchedulingLocationNumberType, error) { + switch s { + case "phone": + return SchedulingLocationNumberTypePhone, nil + } + var t SchedulingLocationNumberType + return "", fmt.Errorf("%s is not a valid %T", s, t) +} + +func (s SchedulingLocationNumberType) Ptr() *SchedulingLocationNumberType { + return &s +} + +var ( + schedulingLocationThreeFieldType = big.NewInt(1 << 0) +) + +type SchedulingLocationThree struct { + Type SchedulingLocationThreeType `json:"type" url:"type"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + + extraProperties map[string]interface{} + rawJSON json.RawMessage +} + +func (s *SchedulingLocationThree) GetType() SchedulingLocationThreeType { + if s == nil { + return "" + } + return s.Type +} + +func (s *SchedulingLocationThree) GetExtraProperties() map[string]interface{} { + if s == nil { + return nil + } + return s.extraProperties +} + +func (s *SchedulingLocationThree) require(field *big.Int) { + next := new(big.Int) + if s.explicitFields != nil { + next.Set(s.explicitFields) + } + next.Or(next, field) + s.explicitFields = next +} + +// SetType sets the Type field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingLocationThree) SetType(type_ SchedulingLocationThreeType) { + s.Type = type_ + s.require(schedulingLocationThreeFieldType) +} + +func (s *SchedulingLocationThree) UnmarshalJSON(data []byte) error { + type unmarshaler SchedulingLocationThree + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *s = SchedulingLocationThree(value) + extraProperties, err := internal.ExtractExtraProperties(data, *s) + if err != nil { + return err + } + s.extraProperties = extraProperties + s.rawJSON = json.RawMessage(data) + return nil +} + +func (s *SchedulingLocationThree) MarshalJSON() ([]byte, error) { + type embed SchedulingLocationThree + var marshaler = struct { + embed + }{ + embed: embed(*s), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, s.explicitFields) + return json.Marshal(explicitMarshaler) +} + +func (s *SchedulingLocationThree) String() string { + if s == nil { + return "" + } + if len(s.rawJSON) > 0 { + if value, err := internal.StringifyJSON(s.rawJSON); err == nil { + return value + } + } + if value, err := internal.StringifyJSON(s); err == nil { + return value + } + return fmt.Sprintf("%#v", s) +} + +type SchedulingLocationThreeType string + +const ( + SchedulingLocationThreeTypeGoogleMeet SchedulingLocationThreeType = "google_meet" +) + +func NewSchedulingLocationThreeTypeFromString(s string) (SchedulingLocationThreeType, error) { + switch s { + case "google_meet": + return SchedulingLocationThreeTypeGoogleMeet, nil + } + var t SchedulingLocationThreeType + return "", fmt.Errorf("%s is not a valid %T", s, t) +} + +func (s SchedulingLocationThreeType) Ptr() *SchedulingLocationThreeType { + return &s +} + +var ( + schedulingLocationZeroFieldType = big.NewInt(1 << 0) + schedulingLocationZeroFieldURL = big.NewInt(1 << 1) +) + +// schedulingLocationZeroNullableFields maps the wire names of SchedulingLocationZero's nullable fields (required or optional) to their field bits. +var schedulingLocationZeroNullableFields = map[string]*big.Int{ + "url": schedulingLocationZeroFieldURL, +} + +type SchedulingLocationZero struct { + Type SchedulingLocationZeroType `json:"type" url:"type"` + // The meeting link. `null` on an event type means the booking supplies its own. + URL *string `json:"url,omitempty" url:"url,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + + extraProperties map[string]interface{} + rawJSON json.RawMessage +} + +func (s *SchedulingLocationZero) GetType() SchedulingLocationZeroType { + if s == nil { + return "" + } + return s.Type } -// SetReminders sets the Reminders field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (s *SchedulingEventType) SetReminders(reminders []*SchedulingReminder) { - s.Reminders = reminders - s.require(schedulingEventTypeFieldReminders) +func (s *SchedulingLocationZero) GetURL() *string { + if s == nil { + return nil + } + return s.URL } -// SetHosts sets the Hosts field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (s *SchedulingEventType) SetHosts(hosts []*SchedulingEventTypeHostsItem) { - s.Hosts = hosts - s.require(schedulingEventTypeFieldHosts) +func (s *SchedulingLocationZero) GetExtraProperties() map[string]interface{} { + if s == nil { + return nil + } + return s.extraProperties } -// SetMetadata sets the Metadata field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (s *SchedulingEventType) SetMetadata(metadata map[string]string) { - s.Metadata = metadata - s.require(schedulingEventTypeFieldMetadata) +func (s *SchedulingLocationZero) require(field *big.Int) { + next := new(big.Int) + if s.explicitFields != nil { + next.Set(s.explicitFields) + } + next.Or(next, field) + s.explicitFields = next } -// SetCreatedAt sets the CreatedAt field and marks it as non-optional; +// SetType sets the Type field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (s *SchedulingEventType) SetCreatedAt(createdAt string) { - s.CreatedAt = createdAt - s.require(schedulingEventTypeFieldCreatedAt) +func (s *SchedulingLocationZero) SetType(type_ SchedulingLocationZeroType) { + s.Type = type_ + s.require(schedulingLocationZeroFieldType) } -// SetUpdatedAt sets the UpdatedAt field and marks it as non-optional; +// SetURL sets the URL field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (s *SchedulingEventType) SetUpdatedAt(updatedAt string) { - s.UpdatedAt = updatedAt - s.require(schedulingEventTypeFieldUpdatedAt) +func (s *SchedulingLocationZero) SetURL(url *string) { + s.URL = url + s.require(schedulingLocationZeroFieldURL) } -func (s *SchedulingEventType) UnmarshalJSON(data []byte) error { - type unmarshaler SchedulingEventType +func (s *SchedulingLocationZero) UnmarshalJSON(data []byte) error { + type unmarshaler SchedulingLocationZero var value unmarshaler if err := json.Unmarshal(data, &value); err != nil { return err } - *s = SchedulingEventType(value) + *s = SchedulingLocationZero(value) extraProperties, err := internal.ExtractExtraProperties(data, *s) if err != nil { return err } s.extraProperties = extraProperties - presentFields, err := internal.ExplicitFieldsFromJSON(data, schedulingEventTypeNullableFields) + presentFields, err := internal.ExplicitFieldsFromJSON(data, schedulingLocationZeroNullableFields) if err != nil { return err } @@ -47935,8 +52857,8 @@ func (s *SchedulingEventType) UnmarshalJSON(data []byte) error { return nil } -func (s *SchedulingEventType) MarshalJSON() ([]byte, error) { - type embed SchedulingEventType +func (s *SchedulingLocationZero) MarshalJSON() ([]byte, error) { + type embed SchedulingLocationZero var marshaler = struct { embed }{ @@ -47946,7 +52868,7 @@ func (s *SchedulingEventType) MarshalJSON() ([]byte, error) { return json.Marshal(explicitMarshaler) } -func (s *SchedulingEventType) String() string { +func (s *SchedulingLocationZero) String() string { if s == nil { return "" } @@ -47961,156 +52883,225 @@ func (s *SchedulingEventType) String() string { return fmt.Sprintf("%#v", s) } -// What hosts' calendars say about a booking. `neutral`: a private event titled "Appointment". `full`: a private event with this title and the attendee's and guests' details. -type SchedulingEventTypeHostCalendarDetails string +type SchedulingLocationZeroType string const ( - SchedulingEventTypeHostCalendarDetailsNeutral SchedulingEventTypeHostCalendarDetails = "neutral" - SchedulingEventTypeHostCalendarDetailsFull SchedulingEventTypeHostCalendarDetails = "full" + SchedulingLocationZeroTypeLink SchedulingLocationZeroType = "link" ) -func NewSchedulingEventTypeHostCalendarDetailsFromString(s string) (SchedulingEventTypeHostCalendarDetails, error) { +func NewSchedulingLocationZeroTypeFromString(s string) (SchedulingLocationZeroType, error) { switch s { - case "neutral": - return SchedulingEventTypeHostCalendarDetailsNeutral, nil - case "full": - return SchedulingEventTypeHostCalendarDetailsFull, nil + case "link": + return SchedulingLocationZeroTypeLink, nil } - var t SchedulingEventTypeHostCalendarDetails + var t SchedulingLocationZeroType return "", fmt.Errorf("%s is not a valid %T", s, t) } -func (s SchedulingEventTypeHostCalendarDetails) Ptr() *SchedulingEventTypeHostCalendarDetails { +func (s SchedulingLocationZeroType) Ptr() *SchedulingLocationZeroType { return &s } -type SchedulingEventTypeHostFilterValue struct { - String string - StringList []string +var ( + schedulingOauthAppFieldObject = big.NewInt(1 << 0) + schedulingOauthAppFieldID = big.NewInt(1 << 1) + schedulingOauthAppFieldProvider = big.NewInt(1 << 2) + schedulingOauthAppFieldClientID = big.NewInt(1 << 3) + schedulingOauthAppFieldTenantID = big.NewInt(1 << 4) + schedulingOauthAppFieldRedirectURI = big.NewInt(1 << 5) + schedulingOauthAppFieldCossCallbackURL = big.NewInt(1 << 6) + schedulingOauthAppFieldCompletionURL = big.NewInt(1 << 7) + schedulingOauthAppFieldZoomEventURL = big.NewInt(1 << 8) + schedulingOauthAppFieldScopes = big.NewInt(1 << 9) + schedulingOauthAppFieldStatus = big.NewInt(1 << 10) + schedulingOauthAppFieldLastErrorCode = big.NewInt(1 << 11) + schedulingOauthAppFieldLastErrorAt = big.NewInt(1 << 12) + schedulingOauthAppFieldSecretExpiresAt = big.NewInt(1 << 13) + schedulingOauthAppFieldVerifiedAt = big.NewInt(1 << 14) + schedulingOauthAppFieldConnections = big.NewInt(1 << 15) + schedulingOauthAppFieldCreatedAt = big.NewInt(1 << 16) + schedulingOauthAppFieldUpdatedAt = big.NewInt(1 << 17) +) + +// schedulingOauthAppNullableFields maps the wire names of SchedulingOauthApp's nullable fields (required or optional) to their field bits. +var schedulingOauthAppNullableFields = map[string]*big.Int{ + "tenant_id": schedulingOauthAppFieldTenantID, + "redirect_uri": schedulingOauthAppFieldRedirectURI, + "completion_url": schedulingOauthAppFieldCompletionURL, + "zoom_event_url": schedulingOauthAppFieldZoomEventURL, + "last_error_code": schedulingOauthAppFieldLastErrorCode, + "last_error_at": schedulingOauthAppFieldLastErrorAt, + "secret_expires_at": schedulingOauthAppFieldSecretExpiresAt, + "verified_at": schedulingOauthAppFieldVerifiedAt, +} + +type SchedulingOauthApp struct { + Object SchedulingOauthAppObject `json:"object" url:"object"` + ID string `json:"id" url:"id"` + Provider SchedulingOauthAppProvider `json:"provider" url:"provider"` + ClientID string `json:"client_id" url:"client_id"` + TenantID *string `json:"tenant_id,omitempty" url:"tenant_id,omitempty"` + RedirectURI *string `json:"redirect_uri,omitempty" url:"redirect_uri,omitempty"` + // Register this with the provider if `redirect_uri` isn't set. If it is, that page forwards `code` and `state` here. + CossCallbackURL string `json:"coss_callback_url" url:"coss_callback_url"` + CompletionURL *string `json:"completion_url,omitempty" url:"completion_url,omitempty"` + // Zoom only: the Event notification endpoint URL for your app's deauthorization events. + ZoomEventURL *string `json:"zoom_event_url,omitempty" url:"zoom_event_url,omitempty"` + // What to enable on your app at the provider. + Scopes []string `json:"scopes" url:"scopes"` + // `failing`: the provider refused the app's credentials. New consents are refused, and calendars connected through it can't be read until they work again. + Status SchedulingOauthAppStatus `json:"status" url:"status"` + LastErrorCode *string `json:"last_error_code,omitempty" url:"last_error_code,omitempty"` + LastErrorAt *string `json:"last_error_at,omitempty" url:"last_error_at,omitempty"` + SecretExpiresAt *string `json:"secret_expires_at,omitempty" url:"secret_expires_at,omitempty"` + // When a consent first completed through this app, which proves its secret. + VerifiedAt *string `json:"verified_at,omitempty" url:"verified_at,omitempty"` + // Calendar connections using this app. It can't be deleted while there are any. + Connections int64 `json:"connections" url:"connections"` + CreatedAt string `json:"created_at" url:"created_at"` + UpdatedAt string `json:"updated_at" url:"updated_at"` - typ string + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + + extraProperties map[string]interface{} + rawJSON json.RawMessage } -func (s *SchedulingEventTypeHostFilterValue) GetString() string { +func (s *SchedulingOauthApp) GetObject() SchedulingOauthAppObject { if s == nil { return "" } - return s.String + return s.Object } -func (s *SchedulingEventTypeHostFilterValue) GetStringList() []string { +func (s *SchedulingOauthApp) GetID() string { if s == nil { - return nil + return "" } - return s.StringList + return s.ID } -func (s *SchedulingEventTypeHostFilterValue) UnmarshalJSON(data []byte) error { - var valueString string - if err := json.Unmarshal(data, &valueString); err == nil { - s.typ = "String" - s.String = valueString - return nil - } - var valueStringList []string - if err := json.Unmarshal(data, &valueStringList); err == nil { - s.typ = "StringList" - s.StringList = valueStringList - return nil +func (s *SchedulingOauthApp) GetProvider() SchedulingOauthAppProvider { + if s == nil { + return "" } - return fmt.Errorf("%s cannot be deserialized as a %T", data, s) + return s.Provider } -func (s SchedulingEventTypeHostFilterValue) MarshalJSON() ([]byte, error) { - if s.typ == "String" || s.String != "" { - return json.Marshal(s.String) - } - if s.typ == "StringList" || s.StringList != nil { - return json.Marshal(s.StringList) +func (s *SchedulingOauthApp) GetClientID() string { + if s == nil { + return "" } - return nil, fmt.Errorf("type %T does not include a non-empty union type", s) + return s.ClientID } -type SchedulingEventTypeHostFilterValueVisitor interface { - VisitString(string) error - VisitStringList([]string) error +func (s *SchedulingOauthApp) GetTenantID() *string { + if s == nil { + return nil + } + return s.TenantID } -func (s *SchedulingEventTypeHostFilterValue) Accept(visitor SchedulingEventTypeHostFilterValueVisitor) error { - if s.typ == "String" || s.String != "" { - return visitor.VisitString(s.String) - } - if s.typ == "StringList" || s.StringList != nil { - return visitor.VisitStringList(s.StringList) +func (s *SchedulingOauthApp) GetRedirectURI() *string { + if s == nil { + return nil } - return fmt.Errorf("type %T does not include a non-empty union type", s) + return s.RedirectURI } -var ( - schedulingEventTypeHostInputFieldHost = big.NewInt(1 << 0) - schedulingEventTypeHostInputFieldRole = big.NewInt(1 << 1) - schedulingEventTypeHostInputFieldWeight = big.NewInt(1 << 2) - schedulingEventTypeHostInputFieldSchedule = big.NewInt(1 << 3) -) - -// schedulingEventTypeHostInputNullableFields maps the wire names of SchedulingEventTypeHostInput's nullable fields (required or optional) to their field bits. -var schedulingEventTypeHostInputNullableFields = map[string]*big.Int{ - "schedule": schedulingEventTypeHostInputFieldSchedule, +func (s *SchedulingOauthApp) GetCossCallbackURL() string { + if s == nil { + return "" + } + return s.CossCallbackURL } -type SchedulingEventTypeHostInput struct { - // The host's id or uid. - Host string `json:"host" url:"host"` - // `required` hosts must all be free; one `member` is chosen for a booking. - Role *SchedulingEventTypeHostInputRole `json:"role,omitempty" url:"role,omitempty"` - // Share of a pool's bookings relative to other members. - Weight *int `json:"weight,omitempty" url:"weight,omitempty"` - // A schedule of this host's. Default: their default schedule. - Schedule *string `json:"schedule,omitempty" url:"schedule,omitempty"` +func (s *SchedulingOauthApp) GetCompletionURL() *string { + if s == nil { + return nil + } + return s.CompletionURL +} - // Private bitmask of fields set to an explicit value and therefore not to be omitted - explicitFields *big.Int `json:"-" url:"-"` +func (s *SchedulingOauthApp) GetZoomEventURL() *string { + if s == nil { + return nil + } + return s.ZoomEventURL +} - extraProperties map[string]interface{} - rawJSON json.RawMessage +func (s *SchedulingOauthApp) GetScopes() []string { + if s == nil { + return nil + } + return s.Scopes } -func (s *SchedulingEventTypeHostInput) GetHost() string { +func (s *SchedulingOauthApp) GetStatus() SchedulingOauthAppStatus { if s == nil { return "" } - return s.Host + return s.Status } -func (s *SchedulingEventTypeHostInput) GetRole() *SchedulingEventTypeHostInputRole { +func (s *SchedulingOauthApp) GetLastErrorCode() *string { if s == nil { return nil } - return s.Role + return s.LastErrorCode } -func (s *SchedulingEventTypeHostInput) GetWeight() *int { +func (s *SchedulingOauthApp) GetLastErrorAt() *string { if s == nil { return nil } - return s.Weight + return s.LastErrorAt } -func (s *SchedulingEventTypeHostInput) GetSchedule() *string { +func (s *SchedulingOauthApp) GetSecretExpiresAt() *string { if s == nil { return nil } - return s.Schedule + return s.SecretExpiresAt } -func (s *SchedulingEventTypeHostInput) GetExtraProperties() map[string]interface{} { +func (s *SchedulingOauthApp) GetVerifiedAt() *string { + if s == nil { + return nil + } + return s.VerifiedAt +} + +func (s *SchedulingOauthApp) GetConnections() int64 { + if s == nil { + return 0 + } + return s.Connections +} + +func (s *SchedulingOauthApp) GetCreatedAt() string { + if s == nil { + return "" + } + return s.CreatedAt +} + +func (s *SchedulingOauthApp) GetUpdatedAt() string { + if s == nil { + return "" + } + return s.UpdatedAt +} + +func (s *SchedulingOauthApp) GetExtraProperties() map[string]interface{} { if s == nil { return nil } return s.extraProperties } -func (s *SchedulingEventTypeHostInput) require(field *big.Int) { +func (s *SchedulingOauthApp) require(field *big.Int) { next := new(big.Int) if s.explicitFields != nil { next.Set(s.explicitFields) @@ -48119,47 +53110,145 @@ func (s *SchedulingEventTypeHostInput) require(field *big.Int) { s.explicitFields = next } -// SetHost sets the Host field and marks it as non-optional; +// SetObject sets the Object field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (s *SchedulingEventTypeHostInput) SetHost(host string) { - s.Host = host - s.require(schedulingEventTypeHostInputFieldHost) +func (s *SchedulingOauthApp) SetObject(object SchedulingOauthAppObject) { + s.Object = object + s.require(schedulingOauthAppFieldObject) } -// SetRole sets the Role field and marks it as non-optional; +// SetID sets the ID field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (s *SchedulingEventTypeHostInput) SetRole(role *SchedulingEventTypeHostInputRole) { - s.Role = role - s.require(schedulingEventTypeHostInputFieldRole) +func (s *SchedulingOauthApp) SetID(id string) { + s.ID = id + s.require(schedulingOauthAppFieldID) } -// SetWeight sets the Weight field and marks it as non-optional; +// SetProvider sets the Provider field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (s *SchedulingEventTypeHostInput) SetWeight(weight *int) { - s.Weight = weight - s.require(schedulingEventTypeHostInputFieldWeight) +func (s *SchedulingOauthApp) SetProvider(provider SchedulingOauthAppProvider) { + s.Provider = provider + s.require(schedulingOauthAppFieldProvider) } -// SetSchedule sets the Schedule field and marks it as non-optional; +// SetClientID sets the ClientID field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (s *SchedulingEventTypeHostInput) SetSchedule(schedule *string) { - s.Schedule = schedule - s.require(schedulingEventTypeHostInputFieldSchedule) +func (s *SchedulingOauthApp) SetClientID(clientID string) { + s.ClientID = clientID + s.require(schedulingOauthAppFieldClientID) } -func (s *SchedulingEventTypeHostInput) UnmarshalJSON(data []byte) error { - type unmarshaler SchedulingEventTypeHostInput +// SetTenantID sets the TenantID field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingOauthApp) SetTenantID(tenantID *string) { + s.TenantID = tenantID + s.require(schedulingOauthAppFieldTenantID) +} + +// SetRedirectURI sets the RedirectURI field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingOauthApp) SetRedirectURI(redirectURI *string) { + s.RedirectURI = redirectURI + s.require(schedulingOauthAppFieldRedirectURI) +} + +// SetCossCallbackURL sets the CossCallbackURL field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingOauthApp) SetCossCallbackURL(cossCallbackURL string) { + s.CossCallbackURL = cossCallbackURL + s.require(schedulingOauthAppFieldCossCallbackURL) +} + +// SetCompletionURL sets the CompletionURL field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingOauthApp) SetCompletionURL(completionURL *string) { + s.CompletionURL = completionURL + s.require(schedulingOauthAppFieldCompletionURL) +} + +// SetZoomEventURL sets the ZoomEventURL field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingOauthApp) SetZoomEventURL(zoomEventURL *string) { + s.ZoomEventURL = zoomEventURL + s.require(schedulingOauthAppFieldZoomEventURL) +} + +// SetScopes sets the Scopes field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingOauthApp) SetScopes(scopes []string) { + s.Scopes = scopes + s.require(schedulingOauthAppFieldScopes) +} + +// SetStatus sets the Status field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingOauthApp) SetStatus(status SchedulingOauthAppStatus) { + s.Status = status + s.require(schedulingOauthAppFieldStatus) +} + +// SetLastErrorCode sets the LastErrorCode field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingOauthApp) SetLastErrorCode(lastErrorCode *string) { + s.LastErrorCode = lastErrorCode + s.require(schedulingOauthAppFieldLastErrorCode) +} + +// SetLastErrorAt sets the LastErrorAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingOauthApp) SetLastErrorAt(lastErrorAt *string) { + s.LastErrorAt = lastErrorAt + s.require(schedulingOauthAppFieldLastErrorAt) +} + +// SetSecretExpiresAt sets the SecretExpiresAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingOauthApp) SetSecretExpiresAt(secretExpiresAt *string) { + s.SecretExpiresAt = secretExpiresAt + s.require(schedulingOauthAppFieldSecretExpiresAt) +} + +// SetVerifiedAt sets the VerifiedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingOauthApp) SetVerifiedAt(verifiedAt *string) { + s.VerifiedAt = verifiedAt + s.require(schedulingOauthAppFieldVerifiedAt) +} + +// SetConnections sets the Connections field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingOauthApp) SetConnections(connections int64) { + s.Connections = connections + s.require(schedulingOauthAppFieldConnections) +} + +// SetCreatedAt sets the CreatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingOauthApp) SetCreatedAt(createdAt string) { + s.CreatedAt = createdAt + s.require(schedulingOauthAppFieldCreatedAt) +} + +// SetUpdatedAt sets the UpdatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingOauthApp) SetUpdatedAt(updatedAt string) { + s.UpdatedAt = updatedAt + s.require(schedulingOauthAppFieldUpdatedAt) +} + +func (s *SchedulingOauthApp) UnmarshalJSON(data []byte) error { + type unmarshaler SchedulingOauthApp var value unmarshaler if err := json.Unmarshal(data, &value); err != nil { return err } - *s = SchedulingEventTypeHostInput(value) + *s = SchedulingOauthApp(value) extraProperties, err := internal.ExtractExtraProperties(data, *s) if err != nil { return err } s.extraProperties = extraProperties - presentFields, err := internal.ExplicitFieldsFromJSON(data, schedulingEventTypeHostInputNullableFields) + presentFields, err := internal.ExplicitFieldsFromJSON(data, schedulingOauthAppNullableFields) if err != nil { return err } @@ -48170,8 +53259,8 @@ func (s *SchedulingEventTypeHostInput) UnmarshalJSON(data []byte) error { return nil } -func (s *SchedulingEventTypeHostInput) MarshalJSON() ([]byte, error) { - type embed SchedulingEventTypeHostInput +func (s *SchedulingOauthApp) MarshalJSON() ([]byte, error) { + type embed SchedulingOauthApp var marshaler = struct { embed }{ @@ -48181,7 +53270,7 @@ func (s *SchedulingEventTypeHostInput) MarshalJSON() ([]byte, error) { return json.Marshal(explicitMarshaler) } -func (s *SchedulingEventTypeHostInput) String() string { +func (s *SchedulingOauthApp) String() string { if s == nil { return "" } @@ -48196,50 +53285,16 @@ func (s *SchedulingEventTypeHostInput) String() string { return fmt.Sprintf("%#v", s) } -// `required` hosts must all be free; one `member` is chosen for a booking. -type SchedulingEventTypeHostInputRole string - -const ( - SchedulingEventTypeHostInputRoleRequired SchedulingEventTypeHostInputRole = "required" - SchedulingEventTypeHostInputRoleMember SchedulingEventTypeHostInputRole = "member" -) - -func NewSchedulingEventTypeHostInputRoleFromString(s string) (SchedulingEventTypeHostInputRole, error) { - switch s { - case "required": - return SchedulingEventTypeHostInputRoleRequired, nil - case "member": - return SchedulingEventTypeHostInputRoleMember, nil - } - var t SchedulingEventTypeHostInputRole - return "", fmt.Errorf("%s is not a valid %T", s, t) -} - -func (s SchedulingEventTypeHostInputRole) Ptr() *SchedulingEventTypeHostInputRole { - return &s -} - var ( - schedulingEventTypeHostsItemFieldHost = big.NewInt(1 << 0) - schedulingEventTypeHostsItemFieldRole = big.NewInt(1 << 1) - schedulingEventTypeHostsItemFieldWeight = big.NewInt(1 << 2) - schedulingEventTypeHostsItemFieldSchedule = big.NewInt(1 << 3) + schedulingOauthAppListFieldObject = big.NewInt(1 << 0) + schedulingOauthAppListFieldData = big.NewInt(1 << 1) + schedulingOauthAppListFieldHasMore = big.NewInt(1 << 2) ) -// schedulingEventTypeHostsItemNullableFields maps the wire names of SchedulingEventTypeHostsItem's nullable fields (required or optional) to their field bits. -var schedulingEventTypeHostsItemNullableFields = map[string]*big.Int{ - "schedule": schedulingEventTypeHostsItemFieldSchedule, -} - -type SchedulingEventTypeHostsItem struct { - // The host's id. - Host string `json:"host" url:"host"` - // `required` hosts must all be free; one `member` is chosen for a booking. - Role SchedulingEventTypeHostsItemRole `json:"role" url:"role"` - // Share of a pool's bookings relative to other members. - Weight float64 `json:"weight" url:"weight"` - // The id of the schedule used for this event type. `null`: the host's default schedule. - Schedule *string `json:"schedule,omitempty" url:"schedule,omitempty"` +type SchedulingOauthAppList struct { + Object SchedulingOauthAppListObject `json:"object" url:"object"` + Data []*SchedulingOauthApp `json:"data" url:"data"` + HasMore bool `json:"has_more" url:"has_more"` // Private bitmask of fields set to an explicit value and therefore not to be omitted explicitFields *big.Int `json:"-" url:"-"` @@ -48248,42 +53303,35 @@ type SchedulingEventTypeHostsItem struct { rawJSON json.RawMessage } -func (s *SchedulingEventTypeHostsItem) GetHost() string { - if s == nil { - return "" - } - return s.Host -} - -func (s *SchedulingEventTypeHostsItem) GetRole() SchedulingEventTypeHostsItemRole { +func (s *SchedulingOauthAppList) GetObject() SchedulingOauthAppListObject { if s == nil { return "" } - return s.Role + return s.Object } -func (s *SchedulingEventTypeHostsItem) GetWeight() float64 { +func (s *SchedulingOauthAppList) GetData() []*SchedulingOauthApp { if s == nil { - return 0 + return nil } - return s.Weight + return s.Data } -func (s *SchedulingEventTypeHostsItem) GetSchedule() *string { +func (s *SchedulingOauthAppList) GetHasMore() bool { if s == nil { - return nil + return false } - return s.Schedule + return s.HasMore } -func (s *SchedulingEventTypeHostsItem) GetExtraProperties() map[string]interface{} { +func (s *SchedulingOauthAppList) GetExtraProperties() map[string]interface{} { if s == nil { return nil } return s.extraProperties } -func (s *SchedulingEventTypeHostsItem) require(field *big.Int) { +func (s *SchedulingOauthAppList) require(field *big.Int) { next := new(big.Int) if s.explicitFields != nil { next.Set(s.explicitFields) @@ -48292,59 +53340,45 @@ func (s *SchedulingEventTypeHostsItem) require(field *big.Int) { s.explicitFields = next } -// SetHost sets the Host field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (s *SchedulingEventTypeHostsItem) SetHost(host string) { - s.Host = host - s.require(schedulingEventTypeHostsItemFieldHost) -} - -// SetRole sets the Role field and marks it as non-optional; +// SetObject sets the Object field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (s *SchedulingEventTypeHostsItem) SetRole(role SchedulingEventTypeHostsItemRole) { - s.Role = role - s.require(schedulingEventTypeHostsItemFieldRole) +func (s *SchedulingOauthAppList) SetObject(object SchedulingOauthAppListObject) { + s.Object = object + s.require(schedulingOauthAppListFieldObject) } -// SetWeight sets the Weight field and marks it as non-optional; +// SetData sets the Data field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (s *SchedulingEventTypeHostsItem) SetWeight(weight float64) { - s.Weight = weight - s.require(schedulingEventTypeHostsItemFieldWeight) +func (s *SchedulingOauthAppList) SetData(data []*SchedulingOauthApp) { + s.Data = data + s.require(schedulingOauthAppListFieldData) } -// SetSchedule sets the Schedule field and marks it as non-optional; +// SetHasMore sets the HasMore field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (s *SchedulingEventTypeHostsItem) SetSchedule(schedule *string) { - s.Schedule = schedule - s.require(schedulingEventTypeHostsItemFieldSchedule) +func (s *SchedulingOauthAppList) SetHasMore(hasMore bool) { + s.HasMore = hasMore + s.require(schedulingOauthAppListFieldHasMore) } -func (s *SchedulingEventTypeHostsItem) UnmarshalJSON(data []byte) error { - type unmarshaler SchedulingEventTypeHostsItem +func (s *SchedulingOauthAppList) UnmarshalJSON(data []byte) error { + type unmarshaler SchedulingOauthAppList var value unmarshaler if err := json.Unmarshal(data, &value); err != nil { return err } - *s = SchedulingEventTypeHostsItem(value) + *s = SchedulingOauthAppList(value) extraProperties, err := internal.ExtractExtraProperties(data, *s) if err != nil { return err } s.extraProperties = extraProperties - presentFields, err := internal.ExplicitFieldsFromJSON(data, schedulingEventTypeHostsItemNullableFields) - if err != nil { - return err - } - if presentFields != nil { - s.require(presentFields) - } s.rawJSON = json.RawMessage(data) return nil } -func (s *SchedulingEventTypeHostsItem) MarshalJSON() ([]byte, error) { - type embed SchedulingEventTypeHostsItem +func (s *SchedulingOauthAppList) MarshalJSON() ([]byte, error) { + type embed SchedulingOauthAppList var marshaler = struct { embed }{ @@ -48354,7 +53388,7 @@ func (s *SchedulingEventTypeHostsItem) MarshalJSON() ([]byte, error) { return json.Marshal(explicitMarshaler) } -func (s *SchedulingEventTypeHostsItem) String() string { +func (s *SchedulingOauthAppList) String() string { if s == nil { return "" } @@ -48369,105 +53403,277 @@ func (s *SchedulingEventTypeHostsItem) String() string { return fmt.Sprintf("%#v", s) } -// `required` hosts must all be free; one `member` is chosen for a booking. -type SchedulingEventTypeHostsItemRole string +type SchedulingOauthAppListObject string const ( - SchedulingEventTypeHostsItemRoleRequired SchedulingEventTypeHostsItemRole = "required" - SchedulingEventTypeHostsItemRoleMember SchedulingEventTypeHostsItemRole = "member" + SchedulingOauthAppListObjectList SchedulingOauthAppListObject = "list" ) -func NewSchedulingEventTypeHostsItemRoleFromString(s string) (SchedulingEventTypeHostsItemRole, error) { +func NewSchedulingOauthAppListObjectFromString(s string) (SchedulingOauthAppListObject, error) { switch s { - case "required": - return SchedulingEventTypeHostsItemRoleRequired, nil - case "member": - return SchedulingEventTypeHostsItemRoleMember, nil + case "list": + return SchedulingOauthAppListObjectList, nil } - var t SchedulingEventTypeHostsItemRole + var t SchedulingOauthAppListObject return "", fmt.Errorf("%s is not a valid %T", s, t) } -func (s SchedulingEventTypeHostsItemRole) Ptr() *SchedulingEventTypeHostsItemRole { +func (s SchedulingOauthAppListObject) Ptr() *SchedulingOauthAppListObject { return &s } -// Who a booking needs. `one_on_one`: one host. `pool`: any one of its hosts. `collective`: every `required` host, plus at most one `member`. `group`: one host, with attendees taking seats up to `capacity`. -type SchedulingEventTypeKind string +type SchedulingOauthAppObject string const ( - SchedulingEventTypeKindOneOnOne SchedulingEventTypeKind = "one_on_one" - SchedulingEventTypeKindPool SchedulingEventTypeKind = "pool" - SchedulingEventTypeKindCollective SchedulingEventTypeKind = "collective" - SchedulingEventTypeKindGroup SchedulingEventTypeKind = "group" + SchedulingOauthAppObjectSchedulingOauthApp SchedulingOauthAppObject = "scheduling.oauth_app" ) -func NewSchedulingEventTypeKindFromString(s string) (SchedulingEventTypeKind, error) { +func NewSchedulingOauthAppObjectFromString(s string) (SchedulingOauthAppObject, error) { switch s { - case "one_on_one": - return SchedulingEventTypeKindOneOnOne, nil - case "pool": - return SchedulingEventTypeKindPool, nil - case "collective": - return SchedulingEventTypeKindCollective, nil - case "group": - return SchedulingEventTypeKindGroup, nil + case "scheduling.oauth_app": + return SchedulingOauthAppObjectSchedulingOauthApp, nil + } + var t SchedulingOauthAppObject + return "", fmt.Errorf("%s is not a valid %T", s, t) +} + +func (s SchedulingOauthAppObject) Ptr() *SchedulingOauthAppObject { + return &s +} + +type SchedulingOauthAppProvider string + +const ( + SchedulingOauthAppProviderGoogle SchedulingOauthAppProvider = "google" + SchedulingOauthAppProviderMicrosoft SchedulingOauthAppProvider = "microsoft" + SchedulingOauthAppProviderZoom SchedulingOauthAppProvider = "zoom" +) + +func NewSchedulingOauthAppProviderFromString(s string) (SchedulingOauthAppProvider, error) { + switch s { + case "google": + return SchedulingOauthAppProviderGoogle, nil + case "microsoft": + return SchedulingOauthAppProviderMicrosoft, nil + case "zoom": + return SchedulingOauthAppProviderZoom, nil + } + var t SchedulingOauthAppProvider + return "", fmt.Errorf("%s is not a valid %T", s, t) +} + +func (s SchedulingOauthAppProvider) Ptr() *SchedulingOauthAppProvider { + return &s +} + +// `failing`: the provider refused the app's credentials. New consents are refused, and calendars connected through it can't be read until they work again. +type SchedulingOauthAppStatus string + +const ( + SchedulingOauthAppStatusActive SchedulingOauthAppStatus = "active" + SchedulingOauthAppStatusFailing SchedulingOauthAppStatus = "failing" +) + +func NewSchedulingOauthAppStatusFromString(s string) (SchedulingOauthAppStatus, error) { + switch s { + case "active": + return SchedulingOauthAppStatusActive, nil + case "failing": + return SchedulingOauthAppStatusFailing, nil + } + var t SchedulingOauthAppStatus + return "", fmt.Errorf("%s is not a valid %T", s, t) +} + +func (s SchedulingOauthAppStatus) Ptr() *SchedulingOauthAppStatus { + return &s +} + +var ( + schedulingOutOfOfficeFieldObject = big.NewInt(1 << 0) + schedulingOutOfOfficeFieldID = big.NewInt(1 << 1) + schedulingOutOfOfficeFieldHost = big.NewInt(1 << 2) + schedulingOutOfOfficeFieldStart = big.NewInt(1 << 3) + schedulingOutOfOfficeFieldEnd = big.NewInt(1 << 4) + schedulingOutOfOfficeFieldAllDay = big.NewInt(1 << 5) + schedulingOutOfOfficeFieldReason = big.NewInt(1 << 6) + schedulingOutOfOfficeFieldNotes = big.NewInt(1 << 7) + schedulingOutOfOfficeFieldPublicMessage = big.NewInt(1 << 8) + schedulingOutOfOfficeFieldShowOnCalendar = big.NewInt(1 << 9) + schedulingOutOfOfficeFieldDelegates = big.NewInt(1 << 10) + schedulingOutOfOfficeFieldExistingBookings = big.NewInt(1 << 11) + schedulingOutOfOfficeFieldExternalID = big.NewInt(1 << 12) + schedulingOutOfOfficeFieldGroup = big.NewInt(1 << 13) + schedulingOutOfOfficeFieldSource = big.NewInt(1 << 14) + schedulingOutOfOfficeFieldCreatedAt = big.NewInt(1 << 15) + schedulingOutOfOfficeFieldUpdatedAt = big.NewInt(1 << 16) +) + +// schedulingOutOfOfficeNullableFields maps the wire names of SchedulingOutOfOffice's nullable fields (required or optional) to their field bits. +var schedulingOutOfOfficeNullableFields = map[string]*big.Int{ + "all_day": schedulingOutOfOfficeFieldAllDay, + "notes": schedulingOutOfOfficeFieldNotes, + "public_message": schedulingOutOfOfficeFieldPublicMessage, + "external_id": schedulingOutOfOfficeFieldExternalID, + "group": schedulingOutOfOfficeFieldGroup, +} + +type SchedulingOutOfOffice struct { + Object SchedulingOutOfOfficeObject `json:"object" url:"object"` + ID string `json:"id" url:"id"` + Host string `json:"host" url:"host"` + Start string `json:"start" url:"start"` + End string `json:"end" url:"end"` + // How it was given, when it was as whole dates. + AllDay *SchedulingOutOfOfficeAllDay `json:"all_day,omitempty" url:"all_day,omitempty"` + Reason string `json:"reason" url:"reason"` + Notes *string `json:"notes,omitempty" url:"notes,omitempty"` + PublicMessage *string `json:"public_message,omitempty" url:"public_message,omitempty"` + ShowOnCalendar bool `json:"show_on_calendar" url:"show_on_calendar"` + // Who can be booked in their place. + Delegates []string `json:"delegates" url:"delegates"` + ExistingBookings SchedulingOutOfOfficeExistingBookings `json:"existing_bookings" url:"existing_bookings"` + ExternalID *string `json:"external_id,omitempty" url:"external_id,omitempty"` + // Shared by the entries one request made for several hosts. + Group *string `json:"group,omitempty" url:"group,omitempty"` + Source SchedulingOutOfOfficeSource `json:"source" url:"source"` + CreatedAt string `json:"created_at" url:"created_at"` + UpdatedAt string `json:"updated_at" url:"updated_at"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + + extraProperties map[string]interface{} + rawJSON json.RawMessage +} + +func (s *SchedulingOutOfOffice) GetObject() SchedulingOutOfOfficeObject { + if s == nil { + return "" + } + return s.Object +} + +func (s *SchedulingOutOfOffice) GetID() string { + if s == nil { + return "" + } + return s.ID +} + +func (s *SchedulingOutOfOffice) GetHost() string { + if s == nil { + return "" + } + return s.Host +} + +func (s *SchedulingOutOfOffice) GetStart() string { + if s == nil { + return "" + } + return s.Start +} + +func (s *SchedulingOutOfOffice) GetEnd() string { + if s == nil { + return "" + } + return s.End +} + +func (s *SchedulingOutOfOffice) GetAllDay() *SchedulingOutOfOfficeAllDay { + if s == nil { + return nil + } + return s.AllDay +} + +func (s *SchedulingOutOfOffice) GetReason() string { + if s == nil { + return "" + } + return s.Reason +} + +func (s *SchedulingOutOfOffice) GetNotes() *string { + if s == nil { + return nil } - var t SchedulingEventTypeKind - return "", fmt.Errorf("%s is not a valid %T", s, t) + return s.Notes } -func (s SchedulingEventTypeKind) Ptr() *SchedulingEventTypeKind { - return &s +func (s *SchedulingOutOfOffice) GetPublicMessage() *string { + if s == nil { + return nil + } + return s.PublicMessage } -var ( - schedulingEventTypeListFieldObject = big.NewInt(1 << 0) - schedulingEventTypeListFieldData = big.NewInt(1 << 1) - schedulingEventTypeListFieldHasMore = big.NewInt(1 << 2) -) +func (s *SchedulingOutOfOffice) GetShowOnCalendar() bool { + if s == nil { + return false + } + return s.ShowOnCalendar +} -type SchedulingEventTypeList struct { - Object SchedulingEventTypeListObject `json:"object" url:"object"` - Data []*SchedulingEventType `json:"data" url:"data"` - HasMore bool `json:"has_more" url:"has_more"` +func (s *SchedulingOutOfOffice) GetDelegates() []string { + if s == nil { + return nil + } + return s.Delegates +} - // Private bitmask of fields set to an explicit value and therefore not to be omitted - explicitFields *big.Int `json:"-" url:"-"` +func (s *SchedulingOutOfOffice) GetExistingBookings() SchedulingOutOfOfficeExistingBookings { + if s == nil { + return "" + } + return s.ExistingBookings +} - extraProperties map[string]interface{} - rawJSON json.RawMessage +func (s *SchedulingOutOfOffice) GetExternalID() *string { + if s == nil { + return nil + } + return s.ExternalID } -func (s *SchedulingEventTypeList) GetObject() SchedulingEventTypeListObject { +func (s *SchedulingOutOfOffice) GetGroup() *string { + if s == nil { + return nil + } + return s.Group +} + +func (s *SchedulingOutOfOffice) GetSource() SchedulingOutOfOfficeSource { if s == nil { return "" } - return s.Object + return s.Source } -func (s *SchedulingEventTypeList) GetData() []*SchedulingEventType { +func (s *SchedulingOutOfOffice) GetCreatedAt() string { if s == nil { - return nil + return "" } - return s.Data + return s.CreatedAt } -func (s *SchedulingEventTypeList) GetHasMore() bool { +func (s *SchedulingOutOfOffice) GetUpdatedAt() string { if s == nil { - return false + return "" } - return s.HasMore + return s.UpdatedAt } -func (s *SchedulingEventTypeList) GetExtraProperties() map[string]interface{} { +func (s *SchedulingOutOfOffice) GetExtraProperties() map[string]interface{} { if s == nil { return nil } return s.extraProperties } -func (s *SchedulingEventTypeList) require(field *big.Int) { +func (s *SchedulingOutOfOffice) require(field *big.Int) { next := new(big.Int) if s.explicitFields != nil { next.Set(s.explicitFields) @@ -48478,180 +53684,148 @@ func (s *SchedulingEventTypeList) require(field *big.Int) { // SetObject sets the Object field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (s *SchedulingEventTypeList) SetObject(object SchedulingEventTypeListObject) { +func (s *SchedulingOutOfOffice) SetObject(object SchedulingOutOfOfficeObject) { s.Object = object - s.require(schedulingEventTypeListFieldObject) + s.require(schedulingOutOfOfficeFieldObject) } -// SetData sets the Data field and marks it as non-optional; +// SetID sets the ID field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (s *SchedulingEventTypeList) SetData(data []*SchedulingEventType) { - s.Data = data - s.require(schedulingEventTypeListFieldData) +func (s *SchedulingOutOfOffice) SetID(id string) { + s.ID = id + s.require(schedulingOutOfOfficeFieldID) } -// SetHasMore sets the HasMore field and marks it as non-optional; +// SetHost sets the Host field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (s *SchedulingEventTypeList) SetHasMore(hasMore bool) { - s.HasMore = hasMore - s.require(schedulingEventTypeListFieldHasMore) +func (s *SchedulingOutOfOffice) SetHost(host string) { + s.Host = host + s.require(schedulingOutOfOfficeFieldHost) } -func (s *SchedulingEventTypeList) UnmarshalJSON(data []byte) error { - type unmarshaler SchedulingEventTypeList - var value unmarshaler - if err := json.Unmarshal(data, &value); err != nil { - return err - } - *s = SchedulingEventTypeList(value) - extraProperties, err := internal.ExtractExtraProperties(data, *s) - if err != nil { - return err - } - s.extraProperties = extraProperties - s.rawJSON = json.RawMessage(data) - return nil +// SetStart sets the Start field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingOutOfOffice) SetStart(start string) { + s.Start = start + s.require(schedulingOutOfOfficeFieldStart) } -func (s *SchedulingEventTypeList) MarshalJSON() ([]byte, error) { - type embed SchedulingEventTypeList - var marshaler = struct { - embed - }{ - embed: embed(*s), - } - explicitMarshaler := internal.HandleExplicitFields(marshaler, s.explicitFields) - return json.Marshal(explicitMarshaler) +// SetEnd sets the End field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingOutOfOffice) SetEnd(end string) { + s.End = end + s.require(schedulingOutOfOfficeFieldEnd) } -func (s *SchedulingEventTypeList) String() string { - if s == nil { - return "" - } - if len(s.rawJSON) > 0 { - if value, err := internal.StringifyJSON(s.rawJSON); err == nil { - return value - } - } - if value, err := internal.StringifyJSON(s); err == nil { - return value - } - return fmt.Sprintf("%#v", s) +// SetAllDay sets the AllDay field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingOutOfOffice) SetAllDay(allDay *SchedulingOutOfOfficeAllDay) { + s.AllDay = allDay + s.require(schedulingOutOfOfficeFieldAllDay) } -type SchedulingEventTypeListObject string - -const ( - SchedulingEventTypeListObjectList SchedulingEventTypeListObject = "list" -) - -func NewSchedulingEventTypeListObjectFromString(s string) (SchedulingEventTypeListObject, error) { - switch s { - case "list": - return SchedulingEventTypeListObjectList, nil - } - var t SchedulingEventTypeListObject - return "", fmt.Errorf("%s is not a valid %T", s, t) +// SetReason sets the Reason field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingOutOfOffice) SetReason(reason string) { + s.Reason = reason + s.require(schedulingOutOfOfficeFieldReason) } -func (s SchedulingEventTypeListObject) Ptr() *SchedulingEventTypeListObject { - return &s +// SetNotes sets the Notes field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingOutOfOffice) SetNotes(notes *string) { + s.Notes = notes + s.require(schedulingOutOfOfficeFieldNotes) } -var ( - schedulingEventTypeNotificationsValueFieldEmailAttendee = big.NewInt(1 << 0) - schedulingEventTypeNotificationsValueFieldEmailHost = big.NewInt(1 << 1) - schedulingEventTypeNotificationsValueFieldSmsAttendee = big.NewInt(1 << 2) -) - -type SchedulingEventTypeNotificationsValue struct { - EmailAttendee *bool `json:"email_attendee,omitempty" url:"email_attendee,omitempty"` - EmailHost *bool `json:"email_host,omitempty" url:"email_host,omitempty"` - SmsAttendee *bool `json:"sms_attendee,omitempty" url:"sms_attendee,omitempty"` - - // Private bitmask of fields set to an explicit value and therefore not to be omitted - explicitFields *big.Int `json:"-" url:"-"` - - extraProperties map[string]interface{} - rawJSON json.RawMessage +// SetPublicMessage sets the PublicMessage field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingOutOfOffice) SetPublicMessage(publicMessage *string) { + s.PublicMessage = publicMessage + s.require(schedulingOutOfOfficeFieldPublicMessage) } -func (s *SchedulingEventTypeNotificationsValue) GetEmailAttendee() *bool { - if s == nil { - return nil - } - return s.EmailAttendee +// SetShowOnCalendar sets the ShowOnCalendar field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingOutOfOffice) SetShowOnCalendar(showOnCalendar bool) { + s.ShowOnCalendar = showOnCalendar + s.require(schedulingOutOfOfficeFieldShowOnCalendar) } -func (s *SchedulingEventTypeNotificationsValue) GetEmailHost() *bool { - if s == nil { - return nil - } - return s.EmailHost +// SetDelegates sets the Delegates field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingOutOfOffice) SetDelegates(delegates []string) { + s.Delegates = delegates + s.require(schedulingOutOfOfficeFieldDelegates) } -func (s *SchedulingEventTypeNotificationsValue) GetSmsAttendee() *bool { - if s == nil { - return nil - } - return s.SmsAttendee +// SetExistingBookings sets the ExistingBookings field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingOutOfOffice) SetExistingBookings(existingBookings SchedulingOutOfOfficeExistingBookings) { + s.ExistingBookings = existingBookings + s.require(schedulingOutOfOfficeFieldExistingBookings) } -func (s *SchedulingEventTypeNotificationsValue) GetExtraProperties() map[string]interface{} { - if s == nil { - return nil - } - return s.extraProperties +// SetExternalID sets the ExternalID field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingOutOfOffice) SetExternalID(externalID *string) { + s.ExternalID = externalID + s.require(schedulingOutOfOfficeFieldExternalID) } -func (s *SchedulingEventTypeNotificationsValue) require(field *big.Int) { - next := new(big.Int) - if s.explicitFields != nil { - next.Set(s.explicitFields) - } - next.Or(next, field) - s.explicitFields = next +// SetGroup sets the Group field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingOutOfOffice) SetGroup(group *string) { + s.Group = group + s.require(schedulingOutOfOfficeFieldGroup) } -// SetEmailAttendee sets the EmailAttendee field and marks it as non-optional; +// SetSource sets the Source field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (s *SchedulingEventTypeNotificationsValue) SetEmailAttendee(emailAttendee *bool) { - s.EmailAttendee = emailAttendee - s.require(schedulingEventTypeNotificationsValueFieldEmailAttendee) +func (s *SchedulingOutOfOffice) SetSource(source SchedulingOutOfOfficeSource) { + s.Source = source + s.require(schedulingOutOfOfficeFieldSource) } -// SetEmailHost sets the EmailHost field and marks it as non-optional; +// SetCreatedAt sets the CreatedAt field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (s *SchedulingEventTypeNotificationsValue) SetEmailHost(emailHost *bool) { - s.EmailHost = emailHost - s.require(schedulingEventTypeNotificationsValueFieldEmailHost) +func (s *SchedulingOutOfOffice) SetCreatedAt(createdAt string) { + s.CreatedAt = createdAt + s.require(schedulingOutOfOfficeFieldCreatedAt) } -// SetSmsAttendee sets the SmsAttendee field and marks it as non-optional; +// SetUpdatedAt sets the UpdatedAt field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (s *SchedulingEventTypeNotificationsValue) SetSmsAttendee(smsAttendee *bool) { - s.SmsAttendee = smsAttendee - s.require(schedulingEventTypeNotificationsValueFieldSmsAttendee) +func (s *SchedulingOutOfOffice) SetUpdatedAt(updatedAt string) { + s.UpdatedAt = updatedAt + s.require(schedulingOutOfOfficeFieldUpdatedAt) } -func (s *SchedulingEventTypeNotificationsValue) UnmarshalJSON(data []byte) error { - type unmarshaler SchedulingEventTypeNotificationsValue +func (s *SchedulingOutOfOffice) UnmarshalJSON(data []byte) error { + type unmarshaler SchedulingOutOfOffice var value unmarshaler if err := json.Unmarshal(data, &value); err != nil { return err } - *s = SchedulingEventTypeNotificationsValue(value) + *s = SchedulingOutOfOffice(value) extraProperties, err := internal.ExtractExtraProperties(data, *s) if err != nil { return err } s.extraProperties = extraProperties + presentFields, err := internal.ExplicitFieldsFromJSON(data, schedulingOutOfOfficeNullableFields) + if err != nil { + return err + } + if presentFields != nil { + s.require(presentFields) + } s.rawJSON = json.RawMessage(data) return nil } -func (s *SchedulingEventTypeNotificationsValue) MarshalJSON() ([]byte, error) { - type embed SchedulingEventTypeNotificationsValue +func (s *SchedulingOutOfOffice) MarshalJSON() ([]byte, error) { + type embed SchedulingOutOfOffice var marshaler = struct { embed }{ @@ -48661,7 +53835,7 @@ func (s *SchedulingEventTypeNotificationsValue) MarshalJSON() ([]byte, error) { return json.Marshal(explicitMarshaler) } -func (s *SchedulingEventTypeNotificationsValue) String() string { +func (s *SchedulingOutOfOffice) String() string { if s == nil { return "" } @@ -48676,59 +53850,17 @@ func (s *SchedulingEventTypeNotificationsValue) String() string { return fmt.Sprintf("%#v", s) } -type SchedulingEventTypeObject string - -const ( - SchedulingEventTypeObjectSchedulingEventType SchedulingEventTypeObject = "scheduling.event_type" -) - -func NewSchedulingEventTypeObjectFromString(s string) (SchedulingEventTypeObject, error) { - switch s { - case "scheduling.event_type": - return SchedulingEventTypeObjectSchedulingEventType, nil - } - var t SchedulingEventTypeObject - return "", fmt.Errorf("%s is not a valid %T", s, t) -} - -func (s SchedulingEventTypeObject) Ptr() *SchedulingEventTypeObject { - return &s -} - -// `active`: can be booked. `archived`: new bookings answer `not_found`; existing ones stay. -type SchedulingEventTypeStatus string - -const ( - SchedulingEventTypeStatusActive SchedulingEventTypeStatus = "active" - SchedulingEventTypeStatusArchived SchedulingEventTypeStatus = "archived" -) - -func NewSchedulingEventTypeStatusFromString(s string) (SchedulingEventTypeStatus, error) { - switch s { - case "active": - return SchedulingEventTypeStatusActive, nil - case "archived": - return SchedulingEventTypeStatusArchived, nil - } - var t SchedulingEventTypeStatus - return "", fmt.Errorf("%s is not a valid %T", s, t) -} - -func (s SchedulingEventTypeStatus) Ptr() *SchedulingEventTypeStatus { - return &s -} - var ( - schedulingGuestInputFieldEmail = big.NewInt(1 << 0) - schedulingGuestInputFieldName = big.NewInt(1 << 1) + schedulingOutOfOfficeAllDayFieldStartDate = big.NewInt(1 << 0) + schedulingOutOfOfficeAllDayFieldEndDate = big.NewInt(1 << 1) + schedulingOutOfOfficeAllDayFieldTimeZone = big.NewInt(1 << 2) ) -// Someone else coming along. They're emailed about the booking, with no manage link. -type SchedulingGuestInput struct { - // Where they're emailed about the booking. - Email string `json:"email" url:"email"` - // Their name, if you have it. - Name *string `json:"name,omitempty" url:"name,omitempty"` +// How it was given, when it was as whole dates. +type SchedulingOutOfOfficeAllDay struct { + StartDate string `json:"start_date" url:"start_date"` + EndDate string `json:"end_date" url:"end_date"` + TimeZone string `json:"time_zone" url:"time_zone"` // Private bitmask of fields set to an explicit value and therefore not to be omitted explicitFields *big.Int `json:"-" url:"-"` @@ -48737,28 +53869,35 @@ type SchedulingGuestInput struct { rawJSON json.RawMessage } -func (s *SchedulingGuestInput) GetEmail() string { +func (s *SchedulingOutOfOfficeAllDay) GetStartDate() string { if s == nil { return "" } - return s.Email + return s.StartDate } -func (s *SchedulingGuestInput) GetName() *string { +func (s *SchedulingOutOfOfficeAllDay) GetEndDate() string { if s == nil { - return nil + return "" } - return s.Name + return s.EndDate } -func (s *SchedulingGuestInput) GetExtraProperties() map[string]interface{} { +func (s *SchedulingOutOfOfficeAllDay) GetTimeZone() string { + if s == nil { + return "" + } + return s.TimeZone +} + +func (s *SchedulingOutOfOfficeAllDay) GetExtraProperties() map[string]interface{} { if s == nil { return nil } return s.extraProperties } -func (s *SchedulingGuestInput) require(field *big.Int) { +func (s *SchedulingOutOfOfficeAllDay) require(field *big.Int) { next := new(big.Int) if s.explicitFields != nil { next.Set(s.explicitFields) @@ -48767,27 +53906,34 @@ func (s *SchedulingGuestInput) require(field *big.Int) { s.explicitFields = next } -// SetEmail sets the Email field and marks it as non-optional; +// SetStartDate sets the StartDate field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (s *SchedulingGuestInput) SetEmail(email string) { - s.Email = email - s.require(schedulingGuestInputFieldEmail) +func (s *SchedulingOutOfOfficeAllDay) SetStartDate(startDate string) { + s.StartDate = startDate + s.require(schedulingOutOfOfficeAllDayFieldStartDate) } -// SetName sets the Name field and marks it as non-optional; +// SetEndDate sets the EndDate field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (s *SchedulingGuestInput) SetName(name *string) { - s.Name = name - s.require(schedulingGuestInputFieldName) +func (s *SchedulingOutOfOfficeAllDay) SetEndDate(endDate string) { + s.EndDate = endDate + s.require(schedulingOutOfOfficeAllDayFieldEndDate) } -func (s *SchedulingGuestInput) UnmarshalJSON(data []byte) error { - type unmarshaler SchedulingGuestInput +// SetTimeZone sets the TimeZone field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingOutOfOfficeAllDay) SetTimeZone(timeZone string) { + s.TimeZone = timeZone + s.require(schedulingOutOfOfficeAllDayFieldTimeZone) +} + +func (s *SchedulingOutOfOfficeAllDay) UnmarshalJSON(data []byte) error { + type unmarshaler SchedulingOutOfOfficeAllDay var value unmarshaler if err := json.Unmarshal(data, &value); err != nil { return err } - *s = SchedulingGuestInput(value) + *s = SchedulingOutOfOfficeAllDay(value) extraProperties, err := internal.ExtractExtraProperties(data, *s) if err != nil { return err @@ -48797,8 +53943,8 @@ func (s *SchedulingGuestInput) UnmarshalJSON(data []byte) error { return nil } -func (s *SchedulingGuestInput) MarshalJSON() ([]byte, error) { - type embed SchedulingGuestInput +func (s *SchedulingOutOfOfficeAllDay) MarshalJSON() ([]byte, error) { + type embed SchedulingOutOfOfficeAllDay var marshaler = struct { embed }{ @@ -48808,7 +53954,7 @@ func (s *SchedulingGuestInput) MarshalJSON() ([]byte, error) { return json.Marshal(explicitMarshaler) } -func (s *SchedulingGuestInput) String() string { +func (s *SchedulingOutOfOfficeAllDay) String() string { if s == nil { return "" } @@ -48824,59 +53970,33 @@ func (s *SchedulingGuestInput) String() string { } var ( - schedulingHostFieldObject = big.NewInt(1 << 0) - schedulingHostFieldID = big.NewInt(1 << 1) - schedulingHostFieldUID = big.NewInt(1 << 2) - schedulingHostFieldName = big.NewInt(1 << 3) - schedulingHostFieldEmail = big.NewInt(1 << 4) - schedulingHostFieldPhone = big.NewInt(1 << 5) - schedulingHostFieldCalendarAccount = big.NewInt(1 << 6) - schedulingHostFieldTimeZone = big.NewInt(1 << 7) - schedulingHostFieldLocale = big.NewInt(1 << 8) - schedulingHostFieldAttributes = big.NewInt(1 << 9) - schedulingHostFieldLocations = big.NewInt(1 << 10) - schedulingHostFieldMetadata = big.NewInt(1 << 11) - schedulingHostFieldStatus = big.NewInt(1 << 12) - schedulingHostFieldCreatedAt = big.NewInt(1 << 13) - schedulingHostFieldUpdatedAt = big.NewInt(1 << 14) -) - -// schedulingHostNullableFields maps the wire names of SchedulingHost's nullable fields (required or optional) to their field bits. -var schedulingHostNullableFields = map[string]*big.Int{ - "uid": schedulingHostFieldUID, - "email": schedulingHostFieldEmail, - "phone": schedulingHostFieldPhone, - "calendar_account": schedulingHostFieldCalendarAccount, - "locale": schedulingHostFieldLocale, -} - -type SchedulingHost struct { - Object SchedulingHostObject `json:"object" url:"object"` - ID string `json:"id" url:"id"` - // Your own id for this host, unique in the environment, accepted wherever a host id is. `null` when none is set. - UID *string `json:"uid,omitempty" url:"uid,omitempty"` - // The host's name. - Name string `json:"name" url:"name"` - // Where this host's notifications go. `null` when none is set. Not an identity, and need not be unique. - Email *string `json:"email,omitempty" url:"email,omitempty"` - // Where this host's SMS reminders go, in E.164. `null` when none is set. - Phone *string `json:"phone,omitempty" url:"phone,omitempty"` - // The mailbox a calendar delegation connects for this host, when it isn't `email`. `null` when none is set. - CalendarAccount *string `json:"calendar_account,omitempty" url:"calendar_account,omitempty"` - // The host's IANA time zone. Their schedules default to it, and limits count days and weeks in it. - TimeZone string `json:"time_zone" url:"time_zone"` - // What this host's notifications are written in. `null`: English. - Locale *string `json:"locale,omitempty" url:"locale,omitempty"` - // What pools filter hosts by, as strings or lists of strings. - Attributes map[string]*SchedulingHostAttributesValue `json:"attributes" url:"attributes"` - // This host's own office, meeting link and phone number. An event type's location that leaves its value blank uses them. - Locations []*SchedulingHostLocation `json:"locations" url:"locations"` - // Your own key-value pairs. - Metadata map[string]string `json:"metadata" url:"metadata"` - // `active`: can be offered. `disabled`: isn't offered, and keeps its existing bookings. - Status SchedulingHostStatus `json:"status" url:"status"` - CreatedAt string `json:"created_at" url:"created_at"` - UpdatedAt string `json:"updated_at" url:"updated_at"` + schedulingOutOfOfficeConflictFieldObject = big.NewInt(1 << 0) + schedulingOutOfOfficeConflictFieldBooking = big.NewInt(1 << 1) + schedulingOutOfOfficeConflictFieldEventType = big.NewInt(1 << 2) + schedulingOutOfOfficeConflictFieldTitle = big.NewInt(1 << 3) + schedulingOutOfOfficeConflictFieldStatus = big.NewInt(1 << 4) + schedulingOutOfOfficeConflictFieldStart = big.NewInt(1 << 5) + schedulingOutOfOfficeConflictFieldEnd = big.NewInt(1 << 6) + schedulingOutOfOfficeConflictFieldSeries = big.NewInt(1 << 7) + schedulingOutOfOfficeConflictFieldGroupSession = big.NewInt(1 << 8) +) + +// schedulingOutOfOfficeConflictNullableFields maps the wire names of SchedulingOutOfOfficeConflict's nullable fields (required or optional) to their field bits. +var schedulingOutOfOfficeConflictNullableFields = map[string]*big.Int{ + "series": schedulingOutOfOfficeConflictFieldSeries, + "group_session": schedulingOutOfOfficeConflictFieldGroupSession, +} + +type SchedulingOutOfOfficeConflict struct { + Object SchedulingOutOfOfficeConflictObject `json:"object" url:"object"` + Booking string `json:"booking" url:"booking"` + EventType string `json:"event_type" url:"event_type"` + Title string `json:"title" url:"title"` + Status SchedulingOutOfOfficeConflictStatus `json:"status" url:"status"` + Start string `json:"start" url:"start"` + End string `json:"end" url:"end"` + Series *string `json:"series,omitempty" url:"series,omitempty"` + GroupSession *string `json:"group_session,omitempty" url:"group_session,omitempty"` // Private bitmask of fields set to an explicit value and therefore not to be omitted explicitFields *big.Int `json:"-" url:"-"` @@ -48885,119 +54005,77 @@ type SchedulingHost struct { rawJSON json.RawMessage } -func (s *SchedulingHost) GetObject() SchedulingHostObject { +func (s *SchedulingOutOfOfficeConflict) GetObject() SchedulingOutOfOfficeConflictObject { if s == nil { return "" } return s.Object } -func (s *SchedulingHost) GetID() string { +func (s *SchedulingOutOfOfficeConflict) GetBooking() string { if s == nil { return "" } - return s.ID -} - -func (s *SchedulingHost) GetUID() *string { - if s == nil { - return nil - } - return s.UID + return s.Booking } -func (s *SchedulingHost) GetName() string { +func (s *SchedulingOutOfOfficeConflict) GetEventType() string { if s == nil { return "" } - return s.Name -} - -func (s *SchedulingHost) GetEmail() *string { - if s == nil { - return nil - } - return s.Email -} - -func (s *SchedulingHost) GetPhone() *string { - if s == nil { - return nil - } - return s.Phone + return s.EventType } -func (s *SchedulingHost) GetCalendarAccount() *string { +func (s *SchedulingOutOfOfficeConflict) GetTitle() string { if s == nil { - return nil + return "" } - return s.CalendarAccount + return s.Title } -func (s *SchedulingHost) GetTimeZone() string { +func (s *SchedulingOutOfOfficeConflict) GetStatus() SchedulingOutOfOfficeConflictStatus { if s == nil { return "" } - return s.TimeZone + return s.Status } -func (s *SchedulingHost) GetLocale() *string { +func (s *SchedulingOutOfOfficeConflict) GetStart() string { if s == nil { - return nil + return "" } - return s.Locale + return s.Start } -func (s *SchedulingHost) GetAttributes() map[string]*SchedulingHostAttributesValue { +func (s *SchedulingOutOfOfficeConflict) GetEnd() string { if s == nil { - return nil + return "" } - return s.Attributes + return s.End } -func (s *SchedulingHost) GetLocations() []*SchedulingHostLocation { +func (s *SchedulingOutOfOfficeConflict) GetSeries() *string { if s == nil { return nil } - return s.Locations + return s.Series } -func (s *SchedulingHost) GetMetadata() map[string]string { +func (s *SchedulingOutOfOfficeConflict) GetGroupSession() *string { if s == nil { return nil } - return s.Metadata -} - -func (s *SchedulingHost) GetStatus() SchedulingHostStatus { - if s == nil { - return "" - } - return s.Status -} - -func (s *SchedulingHost) GetCreatedAt() string { - if s == nil { - return "" - } - return s.CreatedAt -} - -func (s *SchedulingHost) GetUpdatedAt() string { - if s == nil { - return "" - } - return s.UpdatedAt + return s.GroupSession } -func (s *SchedulingHost) GetExtraProperties() map[string]interface{} { +func (s *SchedulingOutOfOfficeConflict) GetExtraProperties() map[string]interface{} { if s == nil { return nil } return s.extraProperties } -func (s *SchedulingHost) require(field *big.Int) { +func (s *SchedulingOutOfOfficeConflict) require(field *big.Int) { next := new(big.Int) if s.explicitFields != nil { next.Set(s.explicitFields) @@ -49008,134 +54086,210 @@ func (s *SchedulingHost) require(field *big.Int) { // SetObject sets the Object field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (s *SchedulingHost) SetObject(object SchedulingHostObject) { +func (s *SchedulingOutOfOfficeConflict) SetObject(object SchedulingOutOfOfficeConflictObject) { s.Object = object - s.require(schedulingHostFieldObject) + s.require(schedulingOutOfOfficeConflictFieldObject) } -// SetID sets the ID field and marks it as non-optional; +// SetBooking sets the Booking field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (s *SchedulingHost) SetID(id string) { - s.ID = id - s.require(schedulingHostFieldID) +func (s *SchedulingOutOfOfficeConflict) SetBooking(booking string) { + s.Booking = booking + s.require(schedulingOutOfOfficeConflictFieldBooking) } -// SetUID sets the UID field and marks it as non-optional; +// SetEventType sets the EventType field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (s *SchedulingHost) SetUID(uid *string) { - s.UID = uid - s.require(schedulingHostFieldUID) +func (s *SchedulingOutOfOfficeConflict) SetEventType(eventType string) { + s.EventType = eventType + s.require(schedulingOutOfOfficeConflictFieldEventType) } -// SetName sets the Name field and marks it as non-optional; +// SetTitle sets the Title field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (s *SchedulingHost) SetName(name string) { - s.Name = name - s.require(schedulingHostFieldName) +func (s *SchedulingOutOfOfficeConflict) SetTitle(title string) { + s.Title = title + s.require(schedulingOutOfOfficeConflictFieldTitle) } -// SetEmail sets the Email field and marks it as non-optional; +// SetStatus sets the Status field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (s *SchedulingHost) SetEmail(email *string) { - s.Email = email - s.require(schedulingHostFieldEmail) +func (s *SchedulingOutOfOfficeConflict) SetStatus(status SchedulingOutOfOfficeConflictStatus) { + s.Status = status + s.require(schedulingOutOfOfficeConflictFieldStatus) } -// SetPhone sets the Phone field and marks it as non-optional; +// SetStart sets the Start field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (s *SchedulingHost) SetPhone(phone *string) { - s.Phone = phone - s.require(schedulingHostFieldPhone) +func (s *SchedulingOutOfOfficeConflict) SetStart(start string) { + s.Start = start + s.require(schedulingOutOfOfficeConflictFieldStart) +} + +// SetEnd sets the End field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingOutOfOfficeConflict) SetEnd(end string) { + s.End = end + s.require(schedulingOutOfOfficeConflictFieldEnd) +} + +// SetSeries sets the Series field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingOutOfOfficeConflict) SetSeries(series *string) { + s.Series = series + s.require(schedulingOutOfOfficeConflictFieldSeries) +} + +// SetGroupSession sets the GroupSession field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingOutOfOfficeConflict) SetGroupSession(groupSession *string) { + s.GroupSession = groupSession + s.require(schedulingOutOfOfficeConflictFieldGroupSession) +} + +func (s *SchedulingOutOfOfficeConflict) UnmarshalJSON(data []byte) error { + type unmarshaler SchedulingOutOfOfficeConflict + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *s = SchedulingOutOfOfficeConflict(value) + extraProperties, err := internal.ExtractExtraProperties(data, *s) + if err != nil { + return err + } + s.extraProperties = extraProperties + presentFields, err := internal.ExplicitFieldsFromJSON(data, schedulingOutOfOfficeConflictNullableFields) + if err != nil { + return err + } + if presentFields != nil { + s.require(presentFields) + } + s.rawJSON = json.RawMessage(data) + return nil +} + +func (s *SchedulingOutOfOfficeConflict) MarshalJSON() ([]byte, error) { + type embed SchedulingOutOfOfficeConflict + var marshaler = struct { + embed + }{ + embed: embed(*s), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, s.explicitFields) + return json.Marshal(explicitMarshaler) +} + +func (s *SchedulingOutOfOfficeConflict) String() string { + if s == nil { + return "" + } + if len(s.rawJSON) > 0 { + if value, err := internal.StringifyJSON(s.rawJSON); err == nil { + return value + } + } + if value, err := internal.StringifyJSON(s); err == nil { + return value + } + return fmt.Sprintf("%#v", s) } -// SetCalendarAccount sets the CalendarAccount field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (s *SchedulingHost) SetCalendarAccount(calendarAccount *string) { - s.CalendarAccount = calendarAccount - s.require(schedulingHostFieldCalendarAccount) +var ( + schedulingOutOfOfficeConflictListFieldObject = big.NewInt(1 << 0) + schedulingOutOfOfficeConflictListFieldData = big.NewInt(1 << 1) + schedulingOutOfOfficeConflictListFieldHasMore = big.NewInt(1 << 2) +) + +type SchedulingOutOfOfficeConflictList struct { + Object SchedulingOutOfOfficeConflictListObject `json:"object" url:"object"` + Data []*SchedulingOutOfOfficeConflict `json:"data" url:"data"` + HasMore bool `json:"has_more" url:"has_more"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + + extraProperties map[string]interface{} + rawJSON json.RawMessage } -// SetTimeZone sets the TimeZone field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (s *SchedulingHost) SetTimeZone(timeZone string) { - s.TimeZone = timeZone - s.require(schedulingHostFieldTimeZone) +func (s *SchedulingOutOfOfficeConflictList) GetObject() SchedulingOutOfOfficeConflictListObject { + if s == nil { + return "" + } + return s.Object } -// SetLocale sets the Locale field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (s *SchedulingHost) SetLocale(locale *string) { - s.Locale = locale - s.require(schedulingHostFieldLocale) +func (s *SchedulingOutOfOfficeConflictList) GetData() []*SchedulingOutOfOfficeConflict { + if s == nil { + return nil + } + return s.Data } -// SetAttributes sets the Attributes field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (s *SchedulingHost) SetAttributes(attributes map[string]*SchedulingHostAttributesValue) { - s.Attributes = attributes - s.require(schedulingHostFieldAttributes) +func (s *SchedulingOutOfOfficeConflictList) GetHasMore() bool { + if s == nil { + return false + } + return s.HasMore } -// SetLocations sets the Locations field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (s *SchedulingHost) SetLocations(locations []*SchedulingHostLocation) { - s.Locations = locations - s.require(schedulingHostFieldLocations) +func (s *SchedulingOutOfOfficeConflictList) GetExtraProperties() map[string]interface{} { + if s == nil { + return nil + } + return s.extraProperties } -// SetMetadata sets the Metadata field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (s *SchedulingHost) SetMetadata(metadata map[string]string) { - s.Metadata = metadata - s.require(schedulingHostFieldMetadata) +func (s *SchedulingOutOfOfficeConflictList) require(field *big.Int) { + next := new(big.Int) + if s.explicitFields != nil { + next.Set(s.explicitFields) + } + next.Or(next, field) + s.explicitFields = next } -// SetStatus sets the Status field and marks it as non-optional; +// SetObject sets the Object field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (s *SchedulingHost) SetStatus(status SchedulingHostStatus) { - s.Status = status - s.require(schedulingHostFieldStatus) +func (s *SchedulingOutOfOfficeConflictList) SetObject(object SchedulingOutOfOfficeConflictListObject) { + s.Object = object + s.require(schedulingOutOfOfficeConflictListFieldObject) } -// SetCreatedAt sets the CreatedAt field and marks it as non-optional; +// SetData sets the Data field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (s *SchedulingHost) SetCreatedAt(createdAt string) { - s.CreatedAt = createdAt - s.require(schedulingHostFieldCreatedAt) +func (s *SchedulingOutOfOfficeConflictList) SetData(data []*SchedulingOutOfOfficeConflict) { + s.Data = data + s.require(schedulingOutOfOfficeConflictListFieldData) } -// SetUpdatedAt sets the UpdatedAt field and marks it as non-optional; +// SetHasMore sets the HasMore field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (s *SchedulingHost) SetUpdatedAt(updatedAt string) { - s.UpdatedAt = updatedAt - s.require(schedulingHostFieldUpdatedAt) +func (s *SchedulingOutOfOfficeConflictList) SetHasMore(hasMore bool) { + s.HasMore = hasMore + s.require(schedulingOutOfOfficeConflictListFieldHasMore) } -func (s *SchedulingHost) UnmarshalJSON(data []byte) error { - type unmarshaler SchedulingHost +func (s *SchedulingOutOfOfficeConflictList) UnmarshalJSON(data []byte) error { + type unmarshaler SchedulingOutOfOfficeConflictList var value unmarshaler if err := json.Unmarshal(data, &value); err != nil { return err } - *s = SchedulingHost(value) + *s = SchedulingOutOfOfficeConflictList(value) extraProperties, err := internal.ExtractExtraProperties(data, *s) if err != nil { return err } s.extraProperties = extraProperties - presentFields, err := internal.ExplicitFieldsFromJSON(data, schedulingHostNullableFields) - if err != nil { - return err - } - if presentFields != nil { - s.require(presentFields) - } s.rawJSON = json.RawMessage(data) return nil } -func (s *SchedulingHost) MarshalJSON() ([]byte, error) { - type embed SchedulingHost +func (s *SchedulingOutOfOfficeConflictList) MarshalJSON() ([]byte, error) { + type embed SchedulingOutOfOfficeConflictList var marshaler = struct { embed }{ @@ -49145,7 +54299,7 @@ func (s *SchedulingHost) MarshalJSON() ([]byte, error) { return json.Marshal(explicitMarshaler) } -func (s *SchedulingHost) String() string { +func (s *SchedulingOutOfOfficeConflictList) String() string { if s == nil { return "" } @@ -49160,78 +54314,107 @@ func (s *SchedulingHost) String() string { return fmt.Sprintf("%#v", s) } -type SchedulingHostAttributesValue struct { - String string - StringList []string +type SchedulingOutOfOfficeConflictListObject string - typ string -} +const ( + SchedulingOutOfOfficeConflictListObjectList SchedulingOutOfOfficeConflictListObject = "list" +) -func (s *SchedulingHostAttributesValue) GetString() string { - if s == nil { - return "" +func NewSchedulingOutOfOfficeConflictListObjectFromString(s string) (SchedulingOutOfOfficeConflictListObject, error) { + switch s { + case "list": + return SchedulingOutOfOfficeConflictListObjectList, nil } - return s.String + var t SchedulingOutOfOfficeConflictListObject + return "", fmt.Errorf("%s is not a valid %T", s, t) } -func (s *SchedulingHostAttributesValue) GetStringList() []string { - if s == nil { - return nil - } - return s.StringList +func (s SchedulingOutOfOfficeConflictListObject) Ptr() *SchedulingOutOfOfficeConflictListObject { + return &s } -func (s *SchedulingHostAttributesValue) UnmarshalJSON(data []byte) error { - var valueString string - if err := json.Unmarshal(data, &valueString); err == nil { - s.typ = "String" - s.String = valueString - return nil - } - var valueStringList []string - if err := json.Unmarshal(data, &valueStringList); err == nil { - s.typ = "StringList" - s.StringList = valueStringList - return nil +type SchedulingOutOfOfficeConflictObject string + +const ( + SchedulingOutOfOfficeConflictObjectSchedulingOutOfOfficeConflict SchedulingOutOfOfficeConflictObject = "scheduling.out_of_office_conflict" +) + +func NewSchedulingOutOfOfficeConflictObjectFromString(s string) (SchedulingOutOfOfficeConflictObject, error) { + switch s { + case "scheduling.out_of_office_conflict": + return SchedulingOutOfOfficeConflictObjectSchedulingOutOfOfficeConflict, nil } - return fmt.Errorf("%s cannot be deserialized as a %T", data, s) + var t SchedulingOutOfOfficeConflictObject + return "", fmt.Errorf("%s is not a valid %T", s, t) } -func (s SchedulingHostAttributesValue) MarshalJSON() ([]byte, error) { - if s.typ == "String" || s.String != "" { - return json.Marshal(s.String) - } - if s.typ == "StringList" || s.StringList != nil { - return json.Marshal(s.StringList) +func (s SchedulingOutOfOfficeConflictObject) Ptr() *SchedulingOutOfOfficeConflictObject { + return &s +} + +type SchedulingOutOfOfficeConflictStatus string + +const ( + SchedulingOutOfOfficeConflictStatusHeld SchedulingOutOfOfficeConflictStatus = "held" + SchedulingOutOfOfficeConflictStatusPendingApproval SchedulingOutOfOfficeConflictStatus = "pending_approval" + SchedulingOutOfOfficeConflictStatusConfirmed SchedulingOutOfOfficeConflictStatus = "confirmed" + SchedulingOutOfOfficeConflictStatusCancelled SchedulingOutOfOfficeConflictStatus = "cancelled" + SchedulingOutOfOfficeConflictStatusDeclined SchedulingOutOfOfficeConflictStatus = "declined" +) + +func NewSchedulingOutOfOfficeConflictStatusFromString(s string) (SchedulingOutOfOfficeConflictStatus, error) { + switch s { + case "held": + return SchedulingOutOfOfficeConflictStatusHeld, nil + case "pending_approval": + return SchedulingOutOfOfficeConflictStatusPendingApproval, nil + case "confirmed": + return SchedulingOutOfOfficeConflictStatusConfirmed, nil + case "cancelled": + return SchedulingOutOfOfficeConflictStatusCancelled, nil + case "declined": + return SchedulingOutOfOfficeConflictStatusDeclined, nil } - return nil, fmt.Errorf("type %T does not include a non-empty union type", s) + var t SchedulingOutOfOfficeConflictStatus + return "", fmt.Errorf("%s is not a valid %T", s, t) } -type SchedulingHostAttributesValueVisitor interface { - VisitString(string) error - VisitStringList([]string) error +func (s SchedulingOutOfOfficeConflictStatus) Ptr() *SchedulingOutOfOfficeConflictStatus { + return &s } -func (s *SchedulingHostAttributesValue) Accept(visitor SchedulingHostAttributesValueVisitor) error { - if s.typ == "String" || s.String != "" { - return visitor.VisitString(s.String) - } - if s.typ == "StringList" || s.StringList != nil { - return visitor.VisitStringList(s.StringList) +type SchedulingOutOfOfficeExistingBookings string + +const ( + SchedulingOutOfOfficeExistingBookingsLeave SchedulingOutOfOfficeExistingBookings = "leave" + SchedulingOutOfOfficeExistingBookingsReassign SchedulingOutOfOfficeExistingBookings = "reassign" +) + +func NewSchedulingOutOfOfficeExistingBookingsFromString(s string) (SchedulingOutOfOfficeExistingBookings, error) { + switch s { + case "leave": + return SchedulingOutOfOfficeExistingBookingsLeave, nil + case "reassign": + return SchedulingOutOfOfficeExistingBookingsReassign, nil } - return fmt.Errorf("type %T does not include a non-empty union type", s) + var t SchedulingOutOfOfficeExistingBookings + return "", fmt.Errorf("%s is not a valid %T", s, t) +} + +func (s SchedulingOutOfOfficeExistingBookings) Ptr() *SchedulingOutOfOfficeExistingBookings { + return &s } var ( - schedulingHostListFieldObject = big.NewInt(1 << 0) - schedulingHostListFieldData = big.NewInt(1 << 1) - schedulingHostListFieldHasMore = big.NewInt(1 << 2) + schedulingOutOfOfficeListFieldObject = big.NewInt(1 << 0) + schedulingOutOfOfficeListFieldData = big.NewInt(1 << 1) + schedulingOutOfOfficeListFieldHasMore = big.NewInt(1 << 2) ) -type SchedulingHostList struct { - Object SchedulingHostListObject `json:"object" url:"object"` - Data []*SchedulingHost `json:"data" url:"data"` - HasMore bool `json:"has_more" url:"has_more"` +type SchedulingOutOfOfficeList struct { + Object SchedulingOutOfOfficeListObject `json:"object" url:"object"` + Data []*SchedulingOutOfOffice `json:"data" url:"data"` + HasMore bool `json:"has_more" url:"has_more"` // Private bitmask of fields set to an explicit value and therefore not to be omitted explicitFields *big.Int `json:"-" url:"-"` @@ -49240,35 +54423,35 @@ type SchedulingHostList struct { rawJSON json.RawMessage } -func (s *SchedulingHostList) GetObject() SchedulingHostListObject { +func (s *SchedulingOutOfOfficeList) GetObject() SchedulingOutOfOfficeListObject { if s == nil { return "" } return s.Object } -func (s *SchedulingHostList) GetData() []*SchedulingHost { +func (s *SchedulingOutOfOfficeList) GetData() []*SchedulingOutOfOffice { if s == nil { return nil } return s.Data } -func (s *SchedulingHostList) GetHasMore() bool { +func (s *SchedulingOutOfOfficeList) GetHasMore() bool { if s == nil { return false } return s.HasMore } -func (s *SchedulingHostList) GetExtraProperties() map[string]interface{} { +func (s *SchedulingOutOfOfficeList) GetExtraProperties() map[string]interface{} { if s == nil { return nil } return s.extraProperties } -func (s *SchedulingHostList) require(field *big.Int) { +func (s *SchedulingOutOfOfficeList) require(field *big.Int) { next := new(big.Int) if s.explicitFields != nil { next.Set(s.explicitFields) @@ -49279,32 +54462,32 @@ func (s *SchedulingHostList) require(field *big.Int) { // SetObject sets the Object field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (s *SchedulingHostList) SetObject(object SchedulingHostListObject) { +func (s *SchedulingOutOfOfficeList) SetObject(object SchedulingOutOfOfficeListObject) { s.Object = object - s.require(schedulingHostListFieldObject) + s.require(schedulingOutOfOfficeListFieldObject) } // SetData sets the Data field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (s *SchedulingHostList) SetData(data []*SchedulingHost) { +func (s *SchedulingOutOfOfficeList) SetData(data []*SchedulingOutOfOffice) { s.Data = data - s.require(schedulingHostListFieldData) + s.require(schedulingOutOfOfficeListFieldData) } // SetHasMore sets the HasMore field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (s *SchedulingHostList) SetHasMore(hasMore bool) { +func (s *SchedulingOutOfOfficeList) SetHasMore(hasMore bool) { s.HasMore = hasMore - s.require(schedulingHostListFieldHasMore) + s.require(schedulingOutOfOfficeListFieldHasMore) } -func (s *SchedulingHostList) UnmarshalJSON(data []byte) error { - type unmarshaler SchedulingHostList +func (s *SchedulingOutOfOfficeList) UnmarshalJSON(data []byte) error { + type unmarshaler SchedulingOutOfOfficeList var value unmarshaler if err := json.Unmarshal(data, &value); err != nil { return err } - *s = SchedulingHostList(value) + *s = SchedulingOutOfOfficeList(value) extraProperties, err := internal.ExtractExtraProperties(data, *s) if err != nil { return err @@ -49314,8 +54497,8 @@ func (s *SchedulingHostList) UnmarshalJSON(data []byte) error { return nil } -func (s *SchedulingHostList) MarshalJSON() ([]byte, error) { - type embed SchedulingHostList +func (s *SchedulingOutOfOfficeList) MarshalJSON() ([]byte, error) { + type embed SchedulingOutOfOfficeList var marshaler = struct { embed }{ @@ -49325,7 +54508,7 @@ func (s *SchedulingHostList) MarshalJSON() ([]byte, error) { return json.Marshal(explicitMarshaler) } -func (s *SchedulingHostList) String() string { +func (s *SchedulingOutOfOfficeList) String() string { if s == nil { return "" } @@ -49340,206 +54523,404 @@ func (s *SchedulingHostList) String() string { return fmt.Sprintf("%#v", s) } -type SchedulingHostListObject string +type SchedulingOutOfOfficeListObject string const ( - SchedulingHostListObjectList SchedulingHostListObject = "list" + SchedulingOutOfOfficeListObjectList SchedulingOutOfOfficeListObject = "list" ) -func NewSchedulingHostListObjectFromString(s string) (SchedulingHostListObject, error) { +func NewSchedulingOutOfOfficeListObjectFromString(s string) (SchedulingOutOfOfficeListObject, error) { switch s { case "list": - return SchedulingHostListObjectList, nil + return SchedulingOutOfOfficeListObjectList, nil } - var t SchedulingHostListObject + var t SchedulingOutOfOfficeListObject return "", fmt.Errorf("%s is not a valid %T", s, t) } -func (s SchedulingHostListObject) Ptr() *SchedulingHostListObject { +func (s SchedulingOutOfOfficeListObject) Ptr() *SchedulingOutOfOfficeListObject { return &s } -// Where this host meets. A host has at most one of each type. -type SchedulingHostLocation struct { - Type string - Link *SchedulingHostLocationLink - Phone *SchedulingHostLocationPhone - InPerson *SchedulingHostLocationInPerson +type SchedulingOutOfOfficeObject string - rawJSON json.RawMessage +const ( + SchedulingOutOfOfficeObjectSchedulingOutOfOffice SchedulingOutOfOfficeObject = "scheduling.out_of_office" +) + +func NewSchedulingOutOfOfficeObjectFromString(s string) (SchedulingOutOfOfficeObject, error) { + switch s { + case "scheduling.out_of_office": + return SchedulingOutOfOfficeObjectSchedulingOutOfOffice, nil + } + var t SchedulingOutOfOfficeObject + return "", fmt.Errorf("%s is not a valid %T", s, t) } -func (s *SchedulingHostLocation) GetType() string { +func (s SchedulingOutOfOfficeObject) Ptr() *SchedulingOutOfOfficeObject { + return &s +} + +type SchedulingOutOfOfficeSource string + +const ( + SchedulingOutOfOfficeSourceAPI SchedulingOutOfOfficeSource = "api" + SchedulingOutOfOfficeSourceHost SchedulingOutOfOfficeSource = "host" + SchedulingOutOfOfficeSourceManager SchedulingOutOfOfficeSource = "manager" + SchedulingOutOfOfficeSourceDashboard SchedulingOutOfOfficeSource = "dashboard" + SchedulingOutOfOfficeSourceHoliday SchedulingOutOfOfficeSource = "holiday" +) + +func NewSchedulingOutOfOfficeSourceFromString(s string) (SchedulingOutOfOfficeSource, error) { + switch s { + case "api": + return SchedulingOutOfOfficeSourceAPI, nil + case "host": + return SchedulingOutOfOfficeSourceHost, nil + case "manager": + return SchedulingOutOfOfficeSourceManager, nil + case "dashboard": + return SchedulingOutOfOfficeSourceDashboard, nil + case "holiday": + return SchedulingOutOfOfficeSourceHoliday, nil + } + var t SchedulingOutOfOfficeSource + return "", fmt.Errorf("%s is not a valid %T", s, t) +} + +func (s SchedulingOutOfOfficeSource) Ptr() *SchedulingOutOfOfficeSource { + return &s +} + +var ( + schedulingQuestionFieldKey = big.NewInt(1 << 0) + schedulingQuestionFieldType = big.NewInt(1 << 1) + schedulingQuestionFieldLabel = big.NewInt(1 << 2) + schedulingQuestionFieldRequired = big.NewInt(1 << 3) + schedulingQuestionFieldOptions = big.NewInt(1 << 4) +) + +// Something attendees are asked when booking. Answers are encrypted, and come back only when you retrieve one booking. +type SchedulingQuestion struct { + // The answer's key in `answers`. Unique within the event type. + Key string `json:"key" url:"key"` + // How it's asked and which answers are valid. + Type SchedulingQuestionType `json:"type" url:"type"` + // The question as attendees see it. + Label string `json:"label" url:"label"` + // Whether a booking must answer it. + Required *bool `json:"required,omitempty" url:"required,omitempty"` + // The choices of a `select`, `radio` or `checkbox` question. `select` and `radio` need at least one. + Options []string `json:"options,omitempty" url:"options,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + + extraProperties map[string]interface{} + rawJSON json.RawMessage +} + +func (s *SchedulingQuestion) GetKey() string { + if s == nil { + return "" + } + return s.Key +} + +func (s *SchedulingQuestion) GetType() SchedulingQuestionType { if s == nil { return "" } return s.Type } -func (s *SchedulingHostLocation) GetLink() *SchedulingHostLocationLink { +func (s *SchedulingQuestion) GetLabel() string { + if s == nil { + return "" + } + return s.Label +} + +func (s *SchedulingQuestion) GetRequired() *bool { if s == nil { return nil } - return s.Link + return s.Required } -func (s *SchedulingHostLocation) GetPhone() *SchedulingHostLocationPhone { +func (s *SchedulingQuestion) GetOptions() []string { if s == nil { return nil } - return s.Phone + return s.Options } -func (s *SchedulingHostLocation) GetInPerson() *SchedulingHostLocationInPerson { +func (s *SchedulingQuestion) GetExtraProperties() map[string]interface{} { if s == nil { return nil } - return s.InPerson + return s.extraProperties } -func (s *SchedulingHostLocation) UnmarshalJSON(data []byte) error { - var unmarshaler struct { - Type string `json:"type"` +func (s *SchedulingQuestion) require(field *big.Int) { + next := new(big.Int) + if s.explicitFields != nil { + next.Set(s.explicitFields) } - if err := json.Unmarshal(data, &unmarshaler); err != nil { + next.Or(next, field) + s.explicitFields = next +} + +// SetKey sets the Key field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingQuestion) SetKey(key string) { + s.Key = key + s.require(schedulingQuestionFieldKey) +} + +// SetType sets the Type field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingQuestion) SetType(type_ SchedulingQuestionType) { + s.Type = type_ + s.require(schedulingQuestionFieldType) +} + +// SetLabel sets the Label field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingQuestion) SetLabel(label string) { + s.Label = label + s.require(schedulingQuestionFieldLabel) +} + +// SetRequired sets the Required field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingQuestion) SetRequired(required *bool) { + s.Required = required + s.require(schedulingQuestionFieldRequired) +} + +// SetOptions sets the Options field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingQuestion) SetOptions(options []string) { + s.Options = options + s.require(schedulingQuestionFieldOptions) +} + +func (s *SchedulingQuestion) UnmarshalJSON(data []byte) error { + type unmarshaler SchedulingQuestion + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { return err } - s.Type = unmarshaler.Type - if unmarshaler.Type == "" { - return fmt.Errorf("%T did not include discriminant type", s) - } - switch unmarshaler.Type { - case "link": - value := new(SchedulingHostLocationLink) - if err := json.Unmarshal(data, &value); err != nil { - return err - } - s.Link = value - case "phone": - value := new(SchedulingHostLocationPhone) - if err := json.Unmarshal(data, &value); err != nil { - return err - } - s.Phone = value - case "in_person": - value := new(SchedulingHostLocationInPerson) - if err := json.Unmarshal(data, &value); err != nil { - return err - } - s.InPerson = value + *s = SchedulingQuestion(value) + extraProperties, err := internal.ExtractExtraProperties(data, *s) + if err != nil { + return err } + s.extraProperties = extraProperties s.rawJSON = json.RawMessage(data) return nil } -func (s SchedulingHostLocation) MarshalJSON() ([]byte, error) { - if err := s.validate(); err != nil { - return nil, err +func (s *SchedulingQuestion) MarshalJSON() ([]byte, error) { + type embed SchedulingQuestion + var marshaler = struct { + embed + }{ + embed: embed(*s), } - if s.Link != nil { - return internal.MarshalJSONWithExtraProperty(s.Link, "type", "link") + explicitMarshaler := internal.HandleExplicitFields(marshaler, s.explicitFields) + return json.Marshal(explicitMarshaler) +} + +func (s *SchedulingQuestion) String() string { + if s == nil { + return "" } - if s.Phone != nil { - return internal.MarshalJSONWithExtraProperty(s.Phone, "type", "phone") + if len(s.rawJSON) > 0 { + if value, err := internal.StringifyJSON(s.rawJSON); err == nil { + return value + } } - if s.InPerson != nil { - return internal.MarshalJSONWithExtraProperty(s.InPerson, "type", "in_person") + if value, err := internal.StringifyJSON(s); err == nil { + return value } - if len(s.rawJSON) > 0 { - return s.rawJSON, nil + return fmt.Sprintf("%#v", s) +} + +// How it's asked and which answers are valid. +type SchedulingQuestionType string + +const ( + SchedulingQuestionTypeText SchedulingQuestionType = "text" + SchedulingQuestionTypeTextarea SchedulingQuestionType = "textarea" + SchedulingQuestionTypeSelect SchedulingQuestionType = "select" + SchedulingQuestionTypeRadio SchedulingQuestionType = "radio" + SchedulingQuestionTypeCheckbox SchedulingQuestionType = "checkbox" + SchedulingQuestionTypePhone SchedulingQuestionType = "phone" + SchedulingQuestionTypeEmail SchedulingQuestionType = "email" + SchedulingQuestionTypeNumber SchedulingQuestionType = "number" +) + +func NewSchedulingQuestionTypeFromString(s string) (SchedulingQuestionType, error) { + switch s { + case "text": + return SchedulingQuestionTypeText, nil + case "textarea": + return SchedulingQuestionTypeTextarea, nil + case "select": + return SchedulingQuestionTypeSelect, nil + case "radio": + return SchedulingQuestionTypeRadio, nil + case "checkbox": + return SchedulingQuestionTypeCheckbox, nil + case "phone": + return SchedulingQuestionTypePhone, nil + case "email": + return SchedulingQuestionTypeEmail, nil + case "number": + return SchedulingQuestionTypeNumber, nil } - return nil, fmt.Errorf("type %T does not define a non-empty union type", s) + var t SchedulingQuestionType + return "", fmt.Errorf("%s is not a valid %T", s, t) } -type SchedulingHostLocationVisitor interface { - VisitLink(*SchedulingHostLocationLink) error - VisitPhone(*SchedulingHostLocationPhone) error - VisitInPerson(*SchedulingHostLocationInPerson) error +func (s SchedulingQuestionType) Ptr() *SchedulingQuestionType { + return &s } -func (s *SchedulingHostLocation) Accept(visitor SchedulingHostLocationVisitor) error { - if s.Link != nil { - return visitor.VisitLink(s.Link) - } - if s.Phone != nil { - return visitor.VisitPhone(s.Phone) - } - if s.InPerson != nil { - return visitor.VisitInPerson(s.InPerson) - } - return fmt.Errorf("type %T does not define a non-empty union type", s) +var ( + schedulingReassignCandidateFieldObject = big.NewInt(1 << 0) + schedulingReassignCandidateFieldHost = big.NewInt(1 << 1) + schedulingReassignCandidateFieldUID = big.NewInt(1 << 2) + schedulingReassignCandidateFieldName = big.NewInt(1 << 3) + schedulingReassignCandidateFieldMember = big.NewInt(1 << 4) + schedulingReassignCandidateFieldAvailable = big.NewInt(1 << 5) + schedulingReassignCandidateFieldReason = big.NewInt(1 << 6) + schedulingReassignCandidateFieldReasons = big.NewInt(1 << 7) + schedulingReassignCandidateFieldLoad = big.NewInt(1 << 8) + schedulingReassignCandidateFieldRank = big.NewInt(1 << 9) + schedulingReassignCandidateFieldMeetingProviderMissing = big.NewInt(1 << 10) +) + +// schedulingReassignCandidateNullableFields maps the wire names of SchedulingReassignCandidate's nullable fields (required or optional) to their field bits. +var schedulingReassignCandidateNullableFields = map[string]*big.Int{ + "uid": schedulingReassignCandidateFieldUID, + "reason": schedulingReassignCandidateFieldReason, + "rank": schedulingReassignCandidateFieldRank, +} + +type SchedulingReassignCandidate struct { + Object SchedulingReassignCandidateObject `json:"object" url:"object"` + Host string `json:"host" url:"host"` + UID *string `json:"uid,omitempty" url:"uid,omitempty"` + Name string `json:"name" url:"name"` + // Takes this event type, and fits what the booking was routed with. Otherwise it needs `any_host`. + Member bool `json:"member" url:"member"` + Available bool `json:"available" url:"available"` + // Why they aren't available, the first of `reasons`. + Reason *string `json:"reason,omitempty" url:"reason,omitempty"` + // Everything in the way, each needing its override. `already_claimed` can't be overridden. + Reasons []string `json:"reasons" url:"reasons"` + // Their live bookings in the week from this one. + Load float64 `json:"load" url:"load"` + // Their place in who a pool would pick next, from 1. Null for a non-member. + Rank *float64 `json:"rank,omitempty" url:"rank,omitempty"` + // They haven't connected what this booking's meeting needs, so it'd have none. + MeetingProviderMissing bool `json:"meeting_provider_missing" url:"meeting_provider_missing"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + + extraProperties map[string]interface{} + rawJSON json.RawMessage } -func (s *SchedulingHostLocation) validate() error { +func (s *SchedulingReassignCandidate) GetObject() SchedulingReassignCandidateObject { if s == nil { - return fmt.Errorf("type %T is nil", s) - } - var fields []string - if s.Link != nil { - fields = append(fields, "link") + return "" } - if s.Phone != nil { - fields = append(fields, "phone") + return s.Object +} + +func (s *SchedulingReassignCandidate) GetHost() string { + if s == nil { + return "" } - if s.InPerson != nil { - fields = append(fields, "in_person") + return s.Host +} + +func (s *SchedulingReassignCandidate) GetUID() *string { + if s == nil { + return nil } - if len(fields) == 0 { - if s.Type != "" { - if len(s.rawJSON) > 0 { - return nil - } - return fmt.Errorf("type %T defines a discriminant set to %q but the field is not set", s, s.Type) - } - return fmt.Errorf("type %T is empty", s) + return s.UID +} + +func (s *SchedulingReassignCandidate) GetName() string { + if s == nil { + return "" } - if len(fields) > 1 { - return fmt.Errorf("type %T defines values for %s, but only one value is allowed", s, fields) + return s.Name +} + +func (s *SchedulingReassignCandidate) GetMember() bool { + if s == nil { + return false } - if s.Type != "" { - field := fields[0] - if s.Type != field { - return fmt.Errorf( - "type %T defines a discriminant set to %q, but it does not match the %T field; either remove or update the discriminant to match", - s, - s.Type, - s, - ) - } + return s.Member +} + +func (s *SchedulingReassignCandidate) GetAvailable() bool { + if s == nil { + return false } - return nil + return s.Available } -var ( - schedulingHostLocationInPersonFieldAddress = big.NewInt(1 << 0) -) +func (s *SchedulingReassignCandidate) GetReason() *string { + if s == nil { + return nil + } + return s.Reason +} -type SchedulingHostLocationInPerson struct { - // The address. It can't contain a link. - Address string `json:"address" url:"address"` +func (s *SchedulingReassignCandidate) GetReasons() []string { + if s == nil { + return nil + } + return s.Reasons +} - // Private bitmask of fields set to an explicit value and therefore not to be omitted - explicitFields *big.Int `json:"-" url:"-"` +func (s *SchedulingReassignCandidate) GetLoad() float64 { + if s == nil { + return 0 + } + return s.Load +} - extraProperties map[string]interface{} - rawJSON json.RawMessage +func (s *SchedulingReassignCandidate) GetRank() *float64 { + if s == nil { + return nil + } + return s.Rank } -func (s *SchedulingHostLocationInPerson) GetAddress() string { +func (s *SchedulingReassignCandidate) GetMeetingProviderMissing() bool { if s == nil { - return "" + return false } - return s.Address + return s.MeetingProviderMissing } -func (s *SchedulingHostLocationInPerson) GetExtraProperties() map[string]interface{} { +func (s *SchedulingReassignCandidate) GetExtraProperties() map[string]interface{} { if s == nil { return nil } return s.extraProperties } -func (s *SchedulingHostLocationInPerson) require(field *big.Int) { +func (s *SchedulingReassignCandidate) require(field *big.Int) { next := new(big.Int) if s.explicitFields != nil { next.Set(s.explicitFields) @@ -49548,31 +54929,108 @@ func (s *SchedulingHostLocationInPerson) require(field *big.Int) { s.explicitFields = next } -// SetAddress sets the Address field and marks it as non-optional; +// SetObject sets the Object field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (s *SchedulingHostLocationInPerson) SetAddress(address string) { - s.Address = address - s.require(schedulingHostLocationInPersonFieldAddress) +func (s *SchedulingReassignCandidate) SetObject(object SchedulingReassignCandidateObject) { + s.Object = object + s.require(schedulingReassignCandidateFieldObject) } -func (s *SchedulingHostLocationInPerson) UnmarshalJSON(data []byte) error { - type unmarshaler SchedulingHostLocationInPerson +// SetHost sets the Host field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingReassignCandidate) SetHost(host string) { + s.Host = host + s.require(schedulingReassignCandidateFieldHost) +} + +// SetUID sets the UID field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingReassignCandidate) SetUID(uid *string) { + s.UID = uid + s.require(schedulingReassignCandidateFieldUID) +} + +// SetName sets the Name field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingReassignCandidate) SetName(name string) { + s.Name = name + s.require(schedulingReassignCandidateFieldName) +} + +// SetMember sets the Member field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingReassignCandidate) SetMember(member bool) { + s.Member = member + s.require(schedulingReassignCandidateFieldMember) +} + +// SetAvailable sets the Available field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingReassignCandidate) SetAvailable(available bool) { + s.Available = available + s.require(schedulingReassignCandidateFieldAvailable) +} + +// SetReason sets the Reason field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingReassignCandidate) SetReason(reason *string) { + s.Reason = reason + s.require(schedulingReassignCandidateFieldReason) +} + +// SetReasons sets the Reasons field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingReassignCandidate) SetReasons(reasons []string) { + s.Reasons = reasons + s.require(schedulingReassignCandidateFieldReasons) +} + +// SetLoad sets the Load field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingReassignCandidate) SetLoad(load float64) { + s.Load = load + s.require(schedulingReassignCandidateFieldLoad) +} + +// SetRank sets the Rank field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingReassignCandidate) SetRank(rank *float64) { + s.Rank = rank + s.require(schedulingReassignCandidateFieldRank) +} + +// SetMeetingProviderMissing sets the MeetingProviderMissing field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingReassignCandidate) SetMeetingProviderMissing(meetingProviderMissing bool) { + s.MeetingProviderMissing = meetingProviderMissing + s.require(schedulingReassignCandidateFieldMeetingProviderMissing) +} + +func (s *SchedulingReassignCandidate) UnmarshalJSON(data []byte) error { + type unmarshaler SchedulingReassignCandidate var value unmarshaler if err := json.Unmarshal(data, &value); err != nil { return err } - *s = SchedulingHostLocationInPerson(value) + *s = SchedulingReassignCandidate(value) extraProperties, err := internal.ExtractExtraProperties(data, *s) if err != nil { return err } s.extraProperties = extraProperties + presentFields, err := internal.ExplicitFieldsFromJSON(data, schedulingReassignCandidateNullableFields) + if err != nil { + return err + } + if presentFields != nil { + s.require(presentFields) + } s.rawJSON = json.RawMessage(data) return nil } -func (s *SchedulingHostLocationInPerson) MarshalJSON() ([]byte, error) { - type embed SchedulingHostLocationInPerson +func (s *SchedulingReassignCandidate) MarshalJSON() ([]byte, error) { + type embed SchedulingReassignCandidate var marshaler = struct { embed }{ @@ -49582,7 +55040,7 @@ func (s *SchedulingHostLocationInPerson) MarshalJSON() ([]byte, error) { return json.Marshal(explicitMarshaler) } -func (s *SchedulingHostLocationInPerson) String() string { +func (s *SchedulingReassignCandidate) String() string { if s == nil { return "" } @@ -49598,12 +55056,15 @@ func (s *SchedulingHostLocationInPerson) String() string { } var ( - schedulingHostLocationLinkFieldURL = big.NewInt(1 << 0) + schedulingReassignCandidateListFieldObject = big.NewInt(1 << 0) + schedulingReassignCandidateListFieldData = big.NewInt(1 << 1) + schedulingReassignCandidateListFieldHasMore = big.NewInt(1 << 2) ) -type SchedulingHostLocationLink struct { - // The link, which must be `https`. - URL string `json:"url" url:"url"` +type SchedulingReassignCandidateList struct { + Object SchedulingReassignCandidateListObject `json:"object" url:"object"` + Data []*SchedulingReassignCandidate `json:"data" url:"data"` + HasMore bool `json:"has_more" url:"has_more"` // Private bitmask of fields set to an explicit value and therefore not to be omitted explicitFields *big.Int `json:"-" url:"-"` @@ -49612,21 +55073,35 @@ type SchedulingHostLocationLink struct { rawJSON json.RawMessage } -func (s *SchedulingHostLocationLink) GetURL() string { +func (s *SchedulingReassignCandidateList) GetObject() SchedulingReassignCandidateListObject { if s == nil { return "" } - return s.URL + return s.Object } -func (s *SchedulingHostLocationLink) GetExtraProperties() map[string]interface{} { +func (s *SchedulingReassignCandidateList) GetData() []*SchedulingReassignCandidate { + if s == nil { + return nil + } + return s.Data +} + +func (s *SchedulingReassignCandidateList) GetHasMore() bool { + if s == nil { + return false + } + return s.HasMore +} + +func (s *SchedulingReassignCandidateList) GetExtraProperties() map[string]interface{} { if s == nil { return nil } return s.extraProperties } -func (s *SchedulingHostLocationLink) require(field *big.Int) { +func (s *SchedulingReassignCandidateList) require(field *big.Int) { next := new(big.Int) if s.explicitFields != nil { next.Set(s.explicitFields) @@ -49635,20 +55110,34 @@ func (s *SchedulingHostLocationLink) require(field *big.Int) { s.explicitFields = next } -// SetURL sets the URL field and marks it as non-optional; +// SetObject sets the Object field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (s *SchedulingHostLocationLink) SetURL(url string) { - s.URL = url - s.require(schedulingHostLocationLinkFieldURL) +func (s *SchedulingReassignCandidateList) SetObject(object SchedulingReassignCandidateListObject) { + s.Object = object + s.require(schedulingReassignCandidateListFieldObject) } -func (s *SchedulingHostLocationLink) UnmarshalJSON(data []byte) error { - type unmarshaler SchedulingHostLocationLink +// SetData sets the Data field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingReassignCandidateList) SetData(data []*SchedulingReassignCandidate) { + s.Data = data + s.require(schedulingReassignCandidateListFieldData) +} + +// SetHasMore sets the HasMore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingReassignCandidateList) SetHasMore(hasMore bool) { + s.HasMore = hasMore + s.require(schedulingReassignCandidateListFieldHasMore) +} + +func (s *SchedulingReassignCandidateList) UnmarshalJSON(data []byte) error { + type unmarshaler SchedulingReassignCandidateList var value unmarshaler if err := json.Unmarshal(data, &value); err != nil { return err } - *s = SchedulingHostLocationLink(value) + *s = SchedulingReassignCandidateList(value) extraProperties, err := internal.ExtractExtraProperties(data, *s) if err != nil { return err @@ -49658,8 +55147,8 @@ func (s *SchedulingHostLocationLink) UnmarshalJSON(data []byte) error { return nil } -func (s *SchedulingHostLocationLink) MarshalJSON() ([]byte, error) { - type embed SchedulingHostLocationLink +func (s *SchedulingReassignCandidateList) MarshalJSON() ([]byte, error) { + type embed SchedulingReassignCandidateList var marshaler = struct { embed }{ @@ -49669,7 +55158,7 @@ func (s *SchedulingHostLocationLink) MarshalJSON() ([]byte, error) { return json.Marshal(explicitMarshaler) } -func (s *SchedulingHostLocationLink) String() string { +func (s *SchedulingReassignCandidateList) String() string { if s == nil { return "" } @@ -49684,13 +55173,76 @@ func (s *SchedulingHostLocationLink) String() string { return fmt.Sprintf("%#v", s) } -var ( - schedulingHostLocationPhoneFieldNumber = big.NewInt(1 << 0) +type SchedulingReassignCandidateListObject string + +const ( + SchedulingReassignCandidateListObjectList SchedulingReassignCandidateListObject = "list" ) -type SchedulingHostLocationPhone struct { - // The number, in E.164 format. - Number string `json:"number" url:"number"` +func NewSchedulingReassignCandidateListObjectFromString(s string) (SchedulingReassignCandidateListObject, error) { + switch s { + case "list": + return SchedulingReassignCandidateListObjectList, nil + } + var t SchedulingReassignCandidateListObject + return "", fmt.Errorf("%s is not a valid %T", s, t) +} + +func (s SchedulingReassignCandidateListObject) Ptr() *SchedulingReassignCandidateListObject { + return &s +} + +type SchedulingReassignCandidateObject string + +const ( + SchedulingReassignCandidateObjectSchedulingReassignCandidate SchedulingReassignCandidateObject = "scheduling.reassign_candidate" +) + +func NewSchedulingReassignCandidateObjectFromString(s string) (SchedulingReassignCandidateObject, error) { + switch s { + case "scheduling.reassign_candidate": + return SchedulingReassignCandidateObjectSchedulingReassignCandidate, nil + } + var t SchedulingReassignCandidateObject + return "", fmt.Errorf("%s is not a valid %T", s, t) +} + +func (s SchedulingReassignCandidateObject) Ptr() *SchedulingReassignCandidateObject { + return &s +} + +var ( + schedulingReassignmentFieldObject = big.NewInt(1 << 0) + schedulingReassignmentFieldID = big.NewInt(1 << 1) + schedulingReassignmentFieldStatus = big.NewInt(1 << 2) + schedulingReassignmentFieldReasonCode = big.NewInt(1 << 3) + schedulingReassignmentFieldOutOfOffice = big.NewInt(1 << 4) + schedulingReassignmentFieldUndoOf = big.NewInt(1 << 5) + schedulingReassignmentFieldCounts = big.NewInt(1 << 6) + schedulingReassignmentFieldCreatedAt = big.NewInt(1 << 7) + schedulingReassignmentFieldStartedAt = big.NewInt(1 << 8) + schedulingReassignmentFieldFinishedAt = big.NewInt(1 << 9) +) + +// schedulingReassignmentNullableFields maps the wire names of SchedulingReassignment's nullable fields (required or optional) to their field bits. +var schedulingReassignmentNullableFields = map[string]*big.Int{ + "out_of_office": schedulingReassignmentFieldOutOfOffice, + "undo_of": schedulingReassignmentFieldUndoOf, + "started_at": schedulingReassignmentFieldStartedAt, + "finished_at": schedulingReassignmentFieldFinishedAt, +} + +type SchedulingReassignment struct { + Object SchedulingReassignmentObject `json:"object" url:"object"` + ID string `json:"id" url:"id"` + Status SchedulingReassignmentStatus `json:"status" url:"status"` + ReasonCode SchedulingReassignmentReasonCode `json:"reason_code" url:"reason_code"` + OutOfOffice *string `json:"out_of_office,omitempty" url:"out_of_office,omitempty"` + UndoOf *string `json:"undo_of,omitempty" url:"undo_of,omitempty"` + Counts *SchedulingReassignmentCounts `json:"counts" url:"counts"` + CreatedAt string `json:"created_at" url:"created_at"` + StartedAt *string `json:"started_at,omitempty" url:"started_at,omitempty"` + FinishedAt *string `json:"finished_at,omitempty" url:"finished_at,omitempty"` // Private bitmask of fields set to an explicit value and therefore not to be omitted explicitFields *big.Int `json:"-" url:"-"` @@ -49699,21 +55251,84 @@ type SchedulingHostLocationPhone struct { rawJSON json.RawMessage } -func (s *SchedulingHostLocationPhone) GetNumber() string { +func (s *SchedulingReassignment) GetObject() SchedulingReassignmentObject { if s == nil { return "" } - return s.Number + return s.Object } -func (s *SchedulingHostLocationPhone) GetExtraProperties() map[string]interface{} { +func (s *SchedulingReassignment) GetID() string { + if s == nil { + return "" + } + return s.ID +} + +func (s *SchedulingReassignment) GetStatus() SchedulingReassignmentStatus { + if s == nil { + return "" + } + return s.Status +} + +func (s *SchedulingReassignment) GetReasonCode() SchedulingReassignmentReasonCode { + if s == nil { + return "" + } + return s.ReasonCode +} + +func (s *SchedulingReassignment) GetOutOfOffice() *string { + if s == nil { + return nil + } + return s.OutOfOffice +} + +func (s *SchedulingReassignment) GetUndoOf() *string { + if s == nil { + return nil + } + return s.UndoOf +} + +func (s *SchedulingReassignment) GetCounts() *SchedulingReassignmentCounts { + if s == nil { + return nil + } + return s.Counts +} + +func (s *SchedulingReassignment) GetCreatedAt() string { + if s == nil { + return "" + } + return s.CreatedAt +} + +func (s *SchedulingReassignment) GetStartedAt() *string { + if s == nil { + return nil + } + return s.StartedAt +} + +func (s *SchedulingReassignment) GetFinishedAt() *string { + if s == nil { + return nil + } + return s.FinishedAt +} + +func (s *SchedulingReassignment) GetExtraProperties() map[string]interface{} { if s == nil { return nil } return s.extraProperties } -func (s *SchedulingHostLocationPhone) require(field *big.Int) { +func (s *SchedulingReassignment) require(field *big.Int) { next := new(big.Int) if s.explicitFields != nil { next.Set(s.explicitFields) @@ -49722,31 +55337,101 @@ func (s *SchedulingHostLocationPhone) require(field *big.Int) { s.explicitFields = next } -// SetNumber sets the Number field and marks it as non-optional; +// SetObject sets the Object field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (s *SchedulingHostLocationPhone) SetNumber(number string) { - s.Number = number - s.require(schedulingHostLocationPhoneFieldNumber) +func (s *SchedulingReassignment) SetObject(object SchedulingReassignmentObject) { + s.Object = object + s.require(schedulingReassignmentFieldObject) } -func (s *SchedulingHostLocationPhone) UnmarshalJSON(data []byte) error { - type unmarshaler SchedulingHostLocationPhone +// SetID sets the ID field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingReassignment) SetID(id string) { + s.ID = id + s.require(schedulingReassignmentFieldID) +} + +// SetStatus sets the Status field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingReassignment) SetStatus(status SchedulingReassignmentStatus) { + s.Status = status + s.require(schedulingReassignmentFieldStatus) +} + +// SetReasonCode sets the ReasonCode field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingReassignment) SetReasonCode(reasonCode SchedulingReassignmentReasonCode) { + s.ReasonCode = reasonCode + s.require(schedulingReassignmentFieldReasonCode) +} + +// SetOutOfOffice sets the OutOfOffice field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingReassignment) SetOutOfOffice(outOfOffice *string) { + s.OutOfOffice = outOfOffice + s.require(schedulingReassignmentFieldOutOfOffice) +} + +// SetUndoOf sets the UndoOf field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingReassignment) SetUndoOf(undoOf *string) { + s.UndoOf = undoOf + s.require(schedulingReassignmentFieldUndoOf) +} + +// SetCounts sets the Counts field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingReassignment) SetCounts(counts *SchedulingReassignmentCounts) { + s.Counts = counts + s.require(schedulingReassignmentFieldCounts) +} + +// SetCreatedAt sets the CreatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingReassignment) SetCreatedAt(createdAt string) { + s.CreatedAt = createdAt + s.require(schedulingReassignmentFieldCreatedAt) +} + +// SetStartedAt sets the StartedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingReassignment) SetStartedAt(startedAt *string) { + s.StartedAt = startedAt + s.require(schedulingReassignmentFieldStartedAt) +} + +// SetFinishedAt sets the FinishedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingReassignment) SetFinishedAt(finishedAt *string) { + s.FinishedAt = finishedAt + s.require(schedulingReassignmentFieldFinishedAt) +} + +func (s *SchedulingReassignment) UnmarshalJSON(data []byte) error { + type unmarshaler SchedulingReassignment var value unmarshaler if err := json.Unmarshal(data, &value); err != nil { return err } - *s = SchedulingHostLocationPhone(value) + *s = SchedulingReassignment(value) extraProperties, err := internal.ExtractExtraProperties(data, *s) if err != nil { return err } s.extraProperties = extraProperties + presentFields, err := internal.ExplicitFieldsFromJSON(data, schedulingReassignmentNullableFields) + if err != nil { + return err + } + if presentFields != nil { + s.require(presentFields) + } s.rawJSON = json.RawMessage(data) return nil } -func (s *SchedulingHostLocationPhone) MarshalJSON() ([]byte, error) { - type embed SchedulingHostLocationPhone +func (s *SchedulingReassignment) MarshalJSON() ([]byte, error) { + type embed SchedulingReassignment var marshaler = struct { embed }{ @@ -49756,7 +55441,7 @@ func (s *SchedulingHostLocationPhone) MarshalJSON() ([]byte, error) { return json.Marshal(explicitMarshaler) } -func (s *SchedulingHostLocationPhone) String() string { +func (s *SchedulingReassignment) String() string { if s == nil { return "" } @@ -49771,99 +55456,91 @@ func (s *SchedulingHostLocationPhone) String() string { return fmt.Sprintf("%#v", s) } -type SchedulingHostObject string +var ( + schedulingReassignmentCountsFieldTotal = big.NewInt(1 << 0) + schedulingReassignmentCountsFieldPending = big.NewInt(1 << 1) + schedulingReassignmentCountsFieldReassigned = big.NewInt(1 << 2) + schedulingReassignmentCountsFieldSkipped = big.NewInt(1 << 3) + schedulingReassignmentCountsFieldNoCandidate = big.NewInt(1 << 4) + schedulingReassignmentCountsFieldFailed = big.NewInt(1 << 5) + schedulingReassignmentCountsFieldCancelled = big.NewInt(1 << 6) +) + +type SchedulingReassignmentCounts struct { + Total float64 `json:"total" url:"total"` + Pending float64 `json:"pending" url:"pending"` + Reassigned float64 `json:"reassigned" url:"reassigned"` + // They'd moved on since it was selected. + Skipped float64 `json:"skipped" url:"skipped"` + // Nobody could take them: they stayed. + NoCandidate float64 `json:"no_candidate" url:"no_candidate"` + Failed float64 `json:"failed" url:"failed"` + Cancelled float64 `json:"cancelled" url:"cancelled"` -const ( - SchedulingHostObjectSchedulingHost SchedulingHostObject = "scheduling.host" -) + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` -func NewSchedulingHostObjectFromString(s string) (SchedulingHostObject, error) { - switch s { - case "scheduling.host": - return SchedulingHostObjectSchedulingHost, nil - } - var t SchedulingHostObject - return "", fmt.Errorf("%s is not a valid %T", s, t) + extraProperties map[string]interface{} + rawJSON json.RawMessage } -func (s SchedulingHostObject) Ptr() *SchedulingHostObject { - return &s +func (s *SchedulingReassignmentCounts) GetTotal() float64 { + if s == nil { + return 0 + } + return s.Total } -// `active`: can be offered. `disabled`: isn't offered, and keeps its existing bookings. -type SchedulingHostStatus string - -const ( - SchedulingHostStatusActive SchedulingHostStatus = "active" - SchedulingHostStatusDisabled SchedulingHostStatus = "disabled" -) - -func NewSchedulingHostStatusFromString(s string) (SchedulingHostStatus, error) { - switch s { - case "active": - return SchedulingHostStatusActive, nil - case "disabled": - return SchedulingHostStatusDisabled, nil +func (s *SchedulingReassignmentCounts) GetPending() float64 { + if s == nil { + return 0 } - var t SchedulingHostStatus - return "", fmt.Errorf("%s is not a valid %T", s, t) + return s.Pending } -func (s SchedulingHostStatus) Ptr() *SchedulingHostStatus { - return &s +func (s *SchedulingReassignmentCounts) GetReassigned() float64 { + if s == nil { + return 0 + } + return s.Reassigned } -var ( - schedulingLimitFieldPeriod = big.NewInt(1 << 0) - schedulingLimitFieldMax = big.NewInt(1 << 1) - schedulingLimitFieldScope = big.NewInt(1 << 2) -) - -// A cap on bookings in a day or a week. -type SchedulingLimit struct { - // In the host's time zone. - Period SchedulingLimitPeriod `json:"period" url:"period"` - // The most bookings allowed in one period. - Max int `json:"max" url:"max"` - // Count this event type's bookings, or all of the host's. - Scope *SchedulingLimitScope `json:"scope,omitempty" url:"scope,omitempty"` - - // Private bitmask of fields set to an explicit value and therefore not to be omitted - explicitFields *big.Int `json:"-" url:"-"` - - extraProperties map[string]interface{} - rawJSON json.RawMessage +func (s *SchedulingReassignmentCounts) GetSkipped() float64 { + if s == nil { + return 0 + } + return s.Skipped } -func (s *SchedulingLimit) GetPeriod() SchedulingLimitPeriod { +func (s *SchedulingReassignmentCounts) GetNoCandidate() float64 { if s == nil { - return "" + return 0 } - return s.Period + return s.NoCandidate } -func (s *SchedulingLimit) GetMax() int { +func (s *SchedulingReassignmentCounts) GetFailed() float64 { if s == nil { return 0 } - return s.Max + return s.Failed } -func (s *SchedulingLimit) GetScope() *SchedulingLimitScope { +func (s *SchedulingReassignmentCounts) GetCancelled() float64 { if s == nil { - return nil + return 0 } - return s.Scope + return s.Cancelled } -func (s *SchedulingLimit) GetExtraProperties() map[string]interface{} { +func (s *SchedulingReassignmentCounts) GetExtraProperties() map[string]interface{} { if s == nil { return nil } return s.extraProperties } -func (s *SchedulingLimit) require(field *big.Int) { +func (s *SchedulingReassignmentCounts) require(field *big.Int) { next := new(big.Int) if s.explicitFields != nil { next.Set(s.explicitFields) @@ -49872,34 +55549,62 @@ func (s *SchedulingLimit) require(field *big.Int) { s.explicitFields = next } -// SetPeriod sets the Period field and marks it as non-optional; +// SetTotal sets the Total field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (s *SchedulingLimit) SetPeriod(period SchedulingLimitPeriod) { - s.Period = period - s.require(schedulingLimitFieldPeriod) +func (s *SchedulingReassignmentCounts) SetTotal(total float64) { + s.Total = total + s.require(schedulingReassignmentCountsFieldTotal) } -// SetMax sets the Max field and marks it as non-optional; +// SetPending sets the Pending field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (s *SchedulingLimit) SetMax(max int) { - s.Max = max - s.require(schedulingLimitFieldMax) +func (s *SchedulingReassignmentCounts) SetPending(pending float64) { + s.Pending = pending + s.require(schedulingReassignmentCountsFieldPending) } -// SetScope sets the Scope field and marks it as non-optional; +// SetReassigned sets the Reassigned field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (s *SchedulingLimit) SetScope(scope *SchedulingLimitScope) { - s.Scope = scope - s.require(schedulingLimitFieldScope) +func (s *SchedulingReassignmentCounts) SetReassigned(reassigned float64) { + s.Reassigned = reassigned + s.require(schedulingReassignmentCountsFieldReassigned) } -func (s *SchedulingLimit) UnmarshalJSON(data []byte) error { - type unmarshaler SchedulingLimit +// SetSkipped sets the Skipped field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingReassignmentCounts) SetSkipped(skipped float64) { + s.Skipped = skipped + s.require(schedulingReassignmentCountsFieldSkipped) +} + +// SetNoCandidate sets the NoCandidate field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingReassignmentCounts) SetNoCandidate(noCandidate float64) { + s.NoCandidate = noCandidate + s.require(schedulingReassignmentCountsFieldNoCandidate) +} + +// SetFailed sets the Failed field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingReassignmentCounts) SetFailed(failed float64) { + s.Failed = failed + s.require(schedulingReassignmentCountsFieldFailed) +} + +// SetCancelled sets the Cancelled field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingReassignmentCounts) SetCancelled(cancelled float64) { + s.Cancelled = cancelled + s.require(schedulingReassignmentCountsFieldCancelled) +} + +func (s *SchedulingReassignmentCounts) UnmarshalJSON(data []byte) error { + type unmarshaler SchedulingReassignmentCounts var value unmarshaler if err := json.Unmarshal(data, &value); err != nil { return err } - *s = SchedulingLimit(value) + *s = SchedulingReassignmentCounts(value) extraProperties, err := internal.ExtractExtraProperties(data, *s) if err != nil { return err @@ -49909,8 +55614,8 @@ func (s *SchedulingLimit) UnmarshalJSON(data []byte) error { return nil } -func (s *SchedulingLimit) MarshalJSON() ([]byte, error) { - type embed SchedulingLimit +func (s *SchedulingReassignmentCounts) MarshalJSON() ([]byte, error) { + type embed SchedulingReassignmentCounts var marshaler = struct { embed }{ @@ -49920,7 +55625,7 @@ func (s *SchedulingLimit) MarshalJSON() ([]byte, error) { return json.Marshal(explicitMarshaler) } -func (s *SchedulingLimit) String() string { +func (s *SchedulingReassignmentCounts) String() string { if s == nil { return "" } @@ -49935,276 +55640,212 @@ func (s *SchedulingLimit) String() string { return fmt.Sprintf("%#v", s) } -// In the host's time zone. -type SchedulingLimitPeriod string - -const ( - SchedulingLimitPeriodDay SchedulingLimitPeriod = "day" - SchedulingLimitPeriodWeek SchedulingLimitPeriod = "week" -) +var ( + schedulingReassignmentItemFieldObject = big.NewInt(1 << 0) + schedulingReassignmentItemFieldID = big.NewInt(1 << 1) + schedulingReassignmentItemFieldBooking = big.NewInt(1 << 2) + schedulingReassignmentItemFieldFromHost = big.NewInt(1 << 3) + schedulingReassignmentItemFieldToHost = big.NewInt(1 << 4) + schedulingReassignmentItemFieldOutcome = big.NewInt(1 << 5) + schedulingReassignmentItemFieldErrorCode = big.NewInt(1 << 6) +) + +// schedulingReassignmentItemNullableFields maps the wire names of SchedulingReassignmentItem's nullable fields (required or optional) to their field bits. +var schedulingReassignmentItemNullableFields = map[string]*big.Int{ + "from_host": schedulingReassignmentItemFieldFromHost, + "to_host": schedulingReassignmentItemFieldToHost, + "error_code": schedulingReassignmentItemFieldErrorCode, +} + +type SchedulingReassignmentItem struct { + Object SchedulingReassignmentItemObject `json:"object" url:"object"` + ID string `json:"id" url:"id"` + Booking string `json:"booking" url:"booking"` + FromHost *string `json:"from_host,omitempty" url:"from_host,omitempty"` + ToHost *string `json:"to_host,omitempty" url:"to_host,omitempty"` + Outcome SchedulingReassignmentItemOutcome `json:"outcome" url:"outcome"` + ErrorCode *string `json:"error_code,omitempty" url:"error_code,omitempty"` -func NewSchedulingLimitPeriodFromString(s string) (SchedulingLimitPeriod, error) { - switch s { - case "day": - return SchedulingLimitPeriodDay, nil - case "week": - return SchedulingLimitPeriodWeek, nil - } - var t SchedulingLimitPeriod - return "", fmt.Errorf("%s is not a valid %T", s, t) -} + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` -func (s SchedulingLimitPeriod) Ptr() *SchedulingLimitPeriod { - return &s + extraProperties map[string]interface{} + rawJSON json.RawMessage } -// Count this event type's bookings, or all of the host's. -type SchedulingLimitScope string - -const ( - SchedulingLimitScopeEventType SchedulingLimitScope = "event_type" - SchedulingLimitScopeHost SchedulingLimitScope = "host" -) - -func NewSchedulingLimitScopeFromString(s string) (SchedulingLimitScope, error) { - switch s { - case "event_type": - return SchedulingLimitScopeEventType, nil - case "host": - return SchedulingLimitScopeHost, nil +func (s *SchedulingReassignmentItem) GetObject() SchedulingReassignmentItemObject { + if s == nil { + return "" } - var t SchedulingLimitScope - return "", fmt.Errorf("%s is not a valid %T", s, t) -} - -func (s SchedulingLimitScope) Ptr() *SchedulingLimitScope { - return &s -} - -// Where a booking meets. `link`, `phone` and `in_person` carry their details, and on an event type, left blank, use the booked host's own if they have one; `google_meet`, `microsoft_teams` and `zoom` get a meeting made on the host's connected account. -type SchedulingLocation struct { - Type string - Link *SchedulingLocationLink - Phone *SchedulingLocationPhone - InPerson *SchedulingLocationInPerson - GoogleMeet *SchedulingLocationGoogleMeet - MicrosoftTeams *SchedulingLocationMicrosoftTeams - Zoom *SchedulingLocationZoom - - rawJSON json.RawMessage + return s.Object } -func (s *SchedulingLocation) GetType() string { +func (s *SchedulingReassignmentItem) GetID() string { if s == nil { return "" } - return s.Type + return s.ID } -func (s *SchedulingLocation) GetLink() *SchedulingLocationLink { +func (s *SchedulingReassignmentItem) GetBooking() string { if s == nil { - return nil + return "" } - return s.Link + return s.Booking } -func (s *SchedulingLocation) GetPhone() *SchedulingLocationPhone { +func (s *SchedulingReassignmentItem) GetFromHost() *string { if s == nil { return nil } - return s.Phone + return s.FromHost } -func (s *SchedulingLocation) GetInPerson() *SchedulingLocationInPerson { +func (s *SchedulingReassignmentItem) GetToHost() *string { if s == nil { return nil } - return s.InPerson + return s.ToHost } -func (s *SchedulingLocation) GetGoogleMeet() *SchedulingLocationGoogleMeet { +func (s *SchedulingReassignmentItem) GetOutcome() SchedulingReassignmentItemOutcome { if s == nil { - return nil + return "" } - return s.GoogleMeet + return s.Outcome } -func (s *SchedulingLocation) GetMicrosoftTeams() *SchedulingLocationMicrosoftTeams { +func (s *SchedulingReassignmentItem) GetErrorCode() *string { if s == nil { return nil } - return s.MicrosoftTeams + return s.ErrorCode } -func (s *SchedulingLocation) GetZoom() *SchedulingLocationZoom { +func (s *SchedulingReassignmentItem) GetExtraProperties() map[string]interface{} { if s == nil { return nil } - return s.Zoom + return s.extraProperties } -func (s *SchedulingLocation) UnmarshalJSON(data []byte) error { - var unmarshaler struct { - Type string `json:"type"` - } - if err := json.Unmarshal(data, &unmarshaler); err != nil { - return err - } - s.Type = unmarshaler.Type - if unmarshaler.Type == "" { - return fmt.Errorf("%T did not include discriminant type", s) - } - switch unmarshaler.Type { - case "link": - value := new(SchedulingLocationLink) - if err := json.Unmarshal(data, &value); err != nil { - return err - } - s.Link = value - case "phone": - value := new(SchedulingLocationPhone) - if err := json.Unmarshal(data, &value); err != nil { - return err - } - s.Phone = value - case "in_person": - value := new(SchedulingLocationInPerson) - if err := json.Unmarshal(data, &value); err != nil { - return err - } - s.InPerson = value - case "google_meet": - value := new(SchedulingLocationGoogleMeet) - if err := json.Unmarshal(data, &value); err != nil { - return err - } - s.GoogleMeet = value - case "microsoft_teams": - value := new(SchedulingLocationMicrosoftTeams) - if err := json.Unmarshal(data, &value); err != nil { - return err - } - s.MicrosoftTeams = value - case "zoom": - value := new(SchedulingLocationZoom) - if err := json.Unmarshal(data, &value); err != nil { - return err - } - s.Zoom = value +func (s *SchedulingReassignmentItem) require(field *big.Int) { + next := new(big.Int) + if s.explicitFields != nil { + next.Set(s.explicitFields) } - s.rawJSON = json.RawMessage(data) - return nil + next.Or(next, field) + s.explicitFields = next +} + +// SetObject sets the Object field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingReassignmentItem) SetObject(object SchedulingReassignmentItemObject) { + s.Object = object + s.require(schedulingReassignmentItemFieldObject) +} + +// SetID sets the ID field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingReassignmentItem) SetID(id string) { + s.ID = id + s.require(schedulingReassignmentItemFieldID) +} + +// SetBooking sets the Booking field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingReassignmentItem) SetBooking(booking string) { + s.Booking = booking + s.require(schedulingReassignmentItemFieldBooking) } -func (s SchedulingLocation) MarshalJSON() ([]byte, error) { - if err := s.validate(); err != nil { - return nil, err - } - if s.Link != nil { - return internal.MarshalJSONWithExtraProperty(s.Link, "type", "link") - } - if s.Phone != nil { - return internal.MarshalJSONWithExtraProperty(s.Phone, "type", "phone") - } - if s.InPerson != nil { - return internal.MarshalJSONWithExtraProperty(s.InPerson, "type", "in_person") - } - if s.GoogleMeet != nil { - return internal.MarshalJSONWithExtraProperty(s.GoogleMeet, "type", "google_meet") - } - if s.MicrosoftTeams != nil { - return internal.MarshalJSONWithExtraProperty(s.MicrosoftTeams, "type", "microsoft_teams") - } - if s.Zoom != nil { - return internal.MarshalJSONWithExtraProperty(s.Zoom, "type", "zoom") - } - if len(s.rawJSON) > 0 { - return s.rawJSON, nil - } - return nil, fmt.Errorf("type %T does not define a non-empty union type", s) +// SetFromHost sets the FromHost field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingReassignmentItem) SetFromHost(fromHost *string) { + s.FromHost = fromHost + s.require(schedulingReassignmentItemFieldFromHost) } -type SchedulingLocationVisitor interface { - VisitLink(*SchedulingLocationLink) error - VisitPhone(*SchedulingLocationPhone) error - VisitInPerson(*SchedulingLocationInPerson) error - VisitGoogleMeet(*SchedulingLocationGoogleMeet) error - VisitMicrosoftTeams(*SchedulingLocationMicrosoftTeams) error - VisitZoom(*SchedulingLocationZoom) error +// SetToHost sets the ToHost field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingReassignmentItem) SetToHost(toHost *string) { + s.ToHost = toHost + s.require(schedulingReassignmentItemFieldToHost) } -func (s *SchedulingLocation) Accept(visitor SchedulingLocationVisitor) error { - if s.Link != nil { - return visitor.VisitLink(s.Link) - } - if s.Phone != nil { - return visitor.VisitPhone(s.Phone) +// SetOutcome sets the Outcome field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingReassignmentItem) SetOutcome(outcome SchedulingReassignmentItemOutcome) { + s.Outcome = outcome + s.require(schedulingReassignmentItemFieldOutcome) +} + +// SetErrorCode sets the ErrorCode field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingReassignmentItem) SetErrorCode(errorCode *string) { + s.ErrorCode = errorCode + s.require(schedulingReassignmentItemFieldErrorCode) +} + +func (s *SchedulingReassignmentItem) UnmarshalJSON(data []byte) error { + type unmarshaler SchedulingReassignmentItem + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err } - if s.InPerson != nil { - return visitor.VisitInPerson(s.InPerson) + *s = SchedulingReassignmentItem(value) + extraProperties, err := internal.ExtractExtraProperties(data, *s) + if err != nil { + return err } - if s.GoogleMeet != nil { - return visitor.VisitGoogleMeet(s.GoogleMeet) + s.extraProperties = extraProperties + presentFields, err := internal.ExplicitFieldsFromJSON(data, schedulingReassignmentItemNullableFields) + if err != nil { + return err } - if s.MicrosoftTeams != nil { - return visitor.VisitMicrosoftTeams(s.MicrosoftTeams) + if presentFields != nil { + s.require(presentFields) } - if s.Zoom != nil { - return visitor.VisitZoom(s.Zoom) + s.rawJSON = json.RawMessage(data) + return nil +} + +func (s *SchedulingReassignmentItem) MarshalJSON() ([]byte, error) { + type embed SchedulingReassignmentItem + var marshaler = struct { + embed + }{ + embed: embed(*s), } - return fmt.Errorf("type %T does not define a non-empty union type", s) + explicitMarshaler := internal.HandleExplicitFields(marshaler, s.explicitFields) + return json.Marshal(explicitMarshaler) } -func (s *SchedulingLocation) validate() error { +func (s *SchedulingReassignmentItem) String() string { if s == nil { - return fmt.Errorf("type %T is nil", s) - } - var fields []string - if s.Link != nil { - fields = append(fields, "link") - } - if s.Phone != nil { - fields = append(fields, "phone") - } - if s.InPerson != nil { - fields = append(fields, "in_person") - } - if s.GoogleMeet != nil { - fields = append(fields, "google_meet") - } - if s.MicrosoftTeams != nil { - fields = append(fields, "microsoft_teams") - } - if s.Zoom != nil { - fields = append(fields, "zoom") + return "" } - if len(fields) == 0 { - if s.Type != "" { - if len(s.rawJSON) > 0 { - return nil - } - return fmt.Errorf("type %T defines a discriminant set to %q but the field is not set", s, s.Type) + if len(s.rawJSON) > 0 { + if value, err := internal.StringifyJSON(s.rawJSON); err == nil { + return value } - return fmt.Errorf("type %T is empty", s) - } - if len(fields) > 1 { - return fmt.Errorf("type %T defines values for %s, but only one value is allowed", s, fields) } - if s.Type != "" { - field := fields[0] - if s.Type != field { - return fmt.Errorf( - "type %T defines a discriminant set to %q, but it does not match the %T field; either remove or update the discriminant to match", - s, - s.Type, - s, - ) - } + if value, err := internal.StringifyJSON(s); err == nil { + return value } - return nil + return fmt.Sprintf("%#v", s) } -type SchedulingLocationGoogleMeet struct { +var ( + schedulingReassignmentItemListFieldObject = big.NewInt(1 << 0) + schedulingReassignmentItemListFieldData = big.NewInt(1 << 1) + schedulingReassignmentItemListFieldHasMore = big.NewInt(1 << 2) +) + +type SchedulingReassignmentItemList struct { + Object SchedulingReassignmentItemListObject `json:"object" url:"object"` + Data []*SchedulingReassignmentItem `json:"data" url:"data"` + HasMore bool `json:"has_more" url:"has_more"` // Private bitmask of fields set to an explicit value and therefore not to be omitted explicitFields *big.Int `json:"-" url:"-"` @@ -50213,14 +55854,35 @@ type SchedulingLocationGoogleMeet struct { rawJSON json.RawMessage } -func (s *SchedulingLocationGoogleMeet) GetExtraProperties() map[string]interface{} { +func (s *SchedulingReassignmentItemList) GetObject() SchedulingReassignmentItemListObject { + if s == nil { + return "" + } + return s.Object +} + +func (s *SchedulingReassignmentItemList) GetData() []*SchedulingReassignmentItem { + if s == nil { + return nil + } + return s.Data +} + +func (s *SchedulingReassignmentItemList) GetHasMore() bool { + if s == nil { + return false + } + return s.HasMore +} + +func (s *SchedulingReassignmentItemList) GetExtraProperties() map[string]interface{} { if s == nil { return nil } return s.extraProperties } -func (s *SchedulingLocationGoogleMeet) require(field *big.Int) { +func (s *SchedulingReassignmentItemList) require(field *big.Int) { next := new(big.Int) if s.explicitFields != nil { next.Set(s.explicitFields) @@ -50229,13 +55891,34 @@ func (s *SchedulingLocationGoogleMeet) require(field *big.Int) { s.explicitFields = next } -func (s *SchedulingLocationGoogleMeet) UnmarshalJSON(data []byte) error { - type unmarshaler SchedulingLocationGoogleMeet +// SetObject sets the Object field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingReassignmentItemList) SetObject(object SchedulingReassignmentItemListObject) { + s.Object = object + s.require(schedulingReassignmentItemListFieldObject) +} + +// SetData sets the Data field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingReassignmentItemList) SetData(data []*SchedulingReassignmentItem) { + s.Data = data + s.require(schedulingReassignmentItemListFieldData) +} + +// SetHasMore sets the HasMore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingReassignmentItemList) SetHasMore(hasMore bool) { + s.HasMore = hasMore + s.require(schedulingReassignmentItemListFieldHasMore) +} + +func (s *SchedulingReassignmentItemList) UnmarshalJSON(data []byte) error { + type unmarshaler SchedulingReassignmentItemList var value unmarshaler if err := json.Unmarshal(data, &value); err != nil { return err } - *s = SchedulingLocationGoogleMeet(value) + *s = SchedulingReassignmentItemList(value) extraProperties, err := internal.ExtractExtraProperties(data, *s) if err != nil { return err @@ -50245,8 +55928,8 @@ func (s *SchedulingLocationGoogleMeet) UnmarshalJSON(data []byte) error { return nil } -func (s *SchedulingLocationGoogleMeet) MarshalJSON() ([]byte, error) { - type embed SchedulingLocationGoogleMeet +func (s *SchedulingReassignmentItemList) MarshalJSON() ([]byte, error) { + type embed SchedulingReassignmentItemList var marshaler = struct { embed }{ @@ -50256,7 +55939,7 @@ func (s *SchedulingLocationGoogleMeet) MarshalJSON() ([]byte, error) { return json.Marshal(explicitMarshaler) } -func (s *SchedulingLocationGoogleMeet) String() string { +func (s *SchedulingReassignmentItemList) String() string { if s == nil { return "" } @@ -50271,18 +55954,88 @@ func (s *SchedulingLocationGoogleMeet) String() string { return fmt.Sprintf("%#v", s) } -var ( - schedulingLocationInPersonFieldAddress = big.NewInt(1 << 0) +type SchedulingReassignmentItemListObject string + +const ( + SchedulingReassignmentItemListObjectList SchedulingReassignmentItemListObject = "list" ) -// schedulingLocationInPersonNullableFields maps the wire names of SchedulingLocationInPerson's nullable fields (required or optional) to their field bits. -var schedulingLocationInPersonNullableFields = map[string]*big.Int{ - "address": schedulingLocationInPersonFieldAddress, +func NewSchedulingReassignmentItemListObjectFromString(s string) (SchedulingReassignmentItemListObject, error) { + switch s { + case "list": + return SchedulingReassignmentItemListObjectList, nil + } + var t SchedulingReassignmentItemListObject + return "", fmt.Errorf("%s is not a valid %T", s, t) } -type SchedulingLocationInPerson struct { - // The address to meet at. `null` on an event type means the booking supplies its own. - Address *string `json:"address,omitempty" url:"address,omitempty"` +func (s SchedulingReassignmentItemListObject) Ptr() *SchedulingReassignmentItemListObject { + return &s +} + +type SchedulingReassignmentItemObject string + +const ( + SchedulingReassignmentItemObjectSchedulingReassignmentItem SchedulingReassignmentItemObject = "scheduling.reassignment_item" +) + +func NewSchedulingReassignmentItemObjectFromString(s string) (SchedulingReassignmentItemObject, error) { + switch s { + case "scheduling.reassignment_item": + return SchedulingReassignmentItemObjectSchedulingReassignmentItem, nil + } + var t SchedulingReassignmentItemObject + return "", fmt.Errorf("%s is not a valid %T", s, t) +} + +func (s SchedulingReassignmentItemObject) Ptr() *SchedulingReassignmentItemObject { + return &s +} + +type SchedulingReassignmentItemOutcome string + +const ( + SchedulingReassignmentItemOutcomePending SchedulingReassignmentItemOutcome = "pending" + SchedulingReassignmentItemOutcomeReassigned SchedulingReassignmentItemOutcome = "reassigned" + SchedulingReassignmentItemOutcomeSkippedChanged SchedulingReassignmentItemOutcome = "skipped_changed" + SchedulingReassignmentItemOutcomeNoCandidate SchedulingReassignmentItemOutcome = "no_candidate" + SchedulingReassignmentItemOutcomeFailed SchedulingReassignmentItemOutcome = "failed" + SchedulingReassignmentItemOutcomeCancelled SchedulingReassignmentItemOutcome = "cancelled" +) + +func NewSchedulingReassignmentItemOutcomeFromString(s string) (SchedulingReassignmentItemOutcome, error) { + switch s { + case "pending": + return SchedulingReassignmentItemOutcomePending, nil + case "reassigned": + return SchedulingReassignmentItemOutcomeReassigned, nil + case "skipped_changed": + return SchedulingReassignmentItemOutcomeSkippedChanged, nil + case "no_candidate": + return SchedulingReassignmentItemOutcomeNoCandidate, nil + case "failed": + return SchedulingReassignmentItemOutcomeFailed, nil + case "cancelled": + return SchedulingReassignmentItemOutcomeCancelled, nil + } + var t SchedulingReassignmentItemOutcome + return "", fmt.Errorf("%s is not a valid %T", s, t) +} + +func (s SchedulingReassignmentItemOutcome) Ptr() *SchedulingReassignmentItemOutcome { + return &s +} + +var ( + schedulingReassignmentListFieldObject = big.NewInt(1 << 0) + schedulingReassignmentListFieldData = big.NewInt(1 << 1) + schedulingReassignmentListFieldHasMore = big.NewInt(1 << 2) +) + +type SchedulingReassignmentList struct { + Object SchedulingReassignmentListObject `json:"object" url:"object"` + Data []*SchedulingReassignment `json:"data" url:"data"` + HasMore bool `json:"has_more" url:"has_more"` // Private bitmask of fields set to an explicit value and therefore not to be omitted explicitFields *big.Int `json:"-" url:"-"` @@ -50291,21 +56044,35 @@ type SchedulingLocationInPerson struct { rawJSON json.RawMessage } -func (s *SchedulingLocationInPerson) GetAddress() *string { +func (s *SchedulingReassignmentList) GetObject() SchedulingReassignmentListObject { + if s == nil { + return "" + } + return s.Object +} + +func (s *SchedulingReassignmentList) GetData() []*SchedulingReassignment { if s == nil { return nil } - return s.Address + return s.Data +} + +func (s *SchedulingReassignmentList) GetHasMore() bool { + if s == nil { + return false + } + return s.HasMore } -func (s *SchedulingLocationInPerson) GetExtraProperties() map[string]interface{} { +func (s *SchedulingReassignmentList) GetExtraProperties() map[string]interface{} { if s == nil { return nil } return s.extraProperties } -func (s *SchedulingLocationInPerson) require(field *big.Int) { +func (s *SchedulingReassignmentList) require(field *big.Int) { next := new(big.Int) if s.explicitFields != nil { next.Set(s.explicitFields) @@ -50314,38 +56081,45 @@ func (s *SchedulingLocationInPerson) require(field *big.Int) { s.explicitFields = next } -// SetAddress sets the Address field and marks it as non-optional; +// SetObject sets the Object field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (s *SchedulingLocationInPerson) SetAddress(address *string) { - s.Address = address - s.require(schedulingLocationInPersonFieldAddress) +func (s *SchedulingReassignmentList) SetObject(object SchedulingReassignmentListObject) { + s.Object = object + s.require(schedulingReassignmentListFieldObject) +} + +// SetData sets the Data field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingReassignmentList) SetData(data []*SchedulingReassignment) { + s.Data = data + s.require(schedulingReassignmentListFieldData) +} + +// SetHasMore sets the HasMore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingReassignmentList) SetHasMore(hasMore bool) { + s.HasMore = hasMore + s.require(schedulingReassignmentListFieldHasMore) } -func (s *SchedulingLocationInPerson) UnmarshalJSON(data []byte) error { - type unmarshaler SchedulingLocationInPerson +func (s *SchedulingReassignmentList) UnmarshalJSON(data []byte) error { + type unmarshaler SchedulingReassignmentList var value unmarshaler if err := json.Unmarshal(data, &value); err != nil { return err } - *s = SchedulingLocationInPerson(value) + *s = SchedulingReassignmentList(value) extraProperties, err := internal.ExtractExtraProperties(data, *s) if err != nil { return err } s.extraProperties = extraProperties - presentFields, err := internal.ExplicitFieldsFromJSON(data, schedulingLocationInPersonNullableFields) - if err != nil { - return err - } - if presentFields != nil { - s.require(presentFields) - } s.rawJSON = json.RawMessage(data) return nil } -func (s *SchedulingLocationInPerson) MarshalJSON() ([]byte, error) { - type embed SchedulingLocationInPerson +func (s *SchedulingReassignmentList) MarshalJSON() ([]byte, error) { + type embed SchedulingReassignmentList var marshaler = struct { embed }{ @@ -50355,7 +56129,7 @@ func (s *SchedulingLocationInPerson) MarshalJSON() ([]byte, error) { return json.Marshal(explicitMarshaler) } -func (s *SchedulingLocationInPerson) String() string { +func (s *SchedulingReassignmentList) String() string { if s == nil { return "" } @@ -50370,18 +56144,55 @@ func (s *SchedulingLocationInPerson) String() string { return fmt.Sprintf("%#v", s) } -var ( - schedulingLocationLinkFieldURL = big.NewInt(1 << 0) +type SchedulingReassignmentListObject string + +const ( + SchedulingReassignmentListObjectList SchedulingReassignmentListObject = "list" +) + +func NewSchedulingReassignmentListObjectFromString(s string) (SchedulingReassignmentListObject, error) { + switch s { + case "list": + return SchedulingReassignmentListObjectList, nil + } + var t SchedulingReassignmentListObject + return "", fmt.Errorf("%s is not a valid %T", s, t) +} + +func (s SchedulingReassignmentListObject) Ptr() *SchedulingReassignmentListObject { + return &s +} + +type SchedulingReassignmentObject string + +const ( + SchedulingReassignmentObjectSchedulingReassignment SchedulingReassignmentObject = "scheduling.reassignment" ) -// schedulingLocationLinkNullableFields maps the wire names of SchedulingLocationLink's nullable fields (required or optional) to their field bits. -var schedulingLocationLinkNullableFields = map[string]*big.Int{ - "url": schedulingLocationLinkFieldURL, +func NewSchedulingReassignmentObjectFromString(s string) (SchedulingReassignmentObject, error) { + switch s { + case "scheduling.reassignment": + return SchedulingReassignmentObjectSchedulingReassignment, nil + } + var t SchedulingReassignmentObject + return "", fmt.Errorf("%s is not a valid %T", s, t) } -type SchedulingLocationLink struct { - // The meeting link. `null` on an event type means the booking supplies its own. - URL *string `json:"url,omitempty" url:"url,omitempty"` +func (s SchedulingReassignmentObject) Ptr() *SchedulingReassignmentObject { + return &s +} + +var ( + schedulingReassignmentPreviewFieldObject = big.NewInt(1 << 0) + schedulingReassignmentPreviewFieldItems = big.NewInt(1 << 1) + schedulingReassignmentPreviewFieldTruncated = big.NewInt(1 << 2) +) + +type SchedulingReassignmentPreview struct { + Object SchedulingReassignmentPreviewObject `json:"object" url:"object"` + Items []*SchedulingReassignmentPreviewItemsItem `json:"items" url:"items"` + // There are more than a preview covers. + Truncated bool `json:"truncated" url:"truncated"` // Private bitmask of fields set to an explicit value and therefore not to be omitted explicitFields *big.Int `json:"-" url:"-"` @@ -50390,21 +56201,35 @@ type SchedulingLocationLink struct { rawJSON json.RawMessage } -func (s *SchedulingLocationLink) GetURL() *string { +func (s *SchedulingReassignmentPreview) GetObject() SchedulingReassignmentPreviewObject { + if s == nil { + return "" + } + return s.Object +} + +func (s *SchedulingReassignmentPreview) GetItems() []*SchedulingReassignmentPreviewItemsItem { if s == nil { return nil } - return s.URL + return s.Items +} + +func (s *SchedulingReassignmentPreview) GetTruncated() bool { + if s == nil { + return false + } + return s.Truncated } -func (s *SchedulingLocationLink) GetExtraProperties() map[string]interface{} { +func (s *SchedulingReassignmentPreview) GetExtraProperties() map[string]interface{} { if s == nil { return nil } return s.extraProperties } -func (s *SchedulingLocationLink) require(field *big.Int) { +func (s *SchedulingReassignmentPreview) require(field *big.Int) { next := new(big.Int) if s.explicitFields != nil { next.Set(s.explicitFields) @@ -50413,38 +56238,45 @@ func (s *SchedulingLocationLink) require(field *big.Int) { s.explicitFields = next } -// SetURL sets the URL field and marks it as non-optional; +// SetObject sets the Object field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (s *SchedulingLocationLink) SetURL(url *string) { - s.URL = url - s.require(schedulingLocationLinkFieldURL) +func (s *SchedulingReassignmentPreview) SetObject(object SchedulingReassignmentPreviewObject) { + s.Object = object + s.require(schedulingReassignmentPreviewFieldObject) } -func (s *SchedulingLocationLink) UnmarshalJSON(data []byte) error { - type unmarshaler SchedulingLocationLink +// SetItems sets the Items field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingReassignmentPreview) SetItems(items []*SchedulingReassignmentPreviewItemsItem) { + s.Items = items + s.require(schedulingReassignmentPreviewFieldItems) +} + +// SetTruncated sets the Truncated field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingReassignmentPreview) SetTruncated(truncated bool) { + s.Truncated = truncated + s.require(schedulingReassignmentPreviewFieldTruncated) +} + +func (s *SchedulingReassignmentPreview) UnmarshalJSON(data []byte) error { + type unmarshaler SchedulingReassignmentPreview var value unmarshaler if err := json.Unmarshal(data, &value); err != nil { return err } - *s = SchedulingLocationLink(value) + *s = SchedulingReassignmentPreview(value) extraProperties, err := internal.ExtractExtraProperties(data, *s) if err != nil { return err } s.extraProperties = extraProperties - presentFields, err := internal.ExplicitFieldsFromJSON(data, schedulingLocationLinkNullableFields) - if err != nil { - return err - } - if presentFields != nil { - s.require(presentFields) - } s.rawJSON = json.RawMessage(data) return nil } -func (s *SchedulingLocationLink) MarshalJSON() ([]byte, error) { - type embed SchedulingLocationLink +func (s *SchedulingReassignmentPreview) MarshalJSON() ([]byte, error) { + type embed SchedulingReassignmentPreview var marshaler = struct { embed }{ @@ -50454,7 +56286,7 @@ func (s *SchedulingLocationLink) MarshalJSON() ([]byte, error) { return json.Marshal(explicitMarshaler) } -func (s *SchedulingLocationLink) String() string { +func (s *SchedulingReassignmentPreview) String() string { if s == nil { return "" } @@ -50469,7 +56301,43 @@ func (s *SchedulingLocationLink) String() string { return fmt.Sprintf("%#v", s) } -type SchedulingLocationMicrosoftTeams struct { +var ( + schedulingReassignmentPreviewItemsItemFieldBooking = big.NewInt(1 << 0) + schedulingReassignmentPreviewItemsItemFieldEventType = big.NewInt(1 << 1) + schedulingReassignmentPreviewItemsItemFieldTitle = big.NewInt(1 << 2) + schedulingReassignmentPreviewItemsItemFieldStatus = big.NewInt(1 << 3) + schedulingReassignmentPreviewItemsItemFieldStart = big.NewInt(1 << 4) + schedulingReassignmentPreviewItemsItemFieldEnd = big.NewInt(1 << 5) + schedulingReassignmentPreviewItemsItemFieldSeries = big.NewInt(1 << 6) + schedulingReassignmentPreviewItemsItemFieldGroupSession = big.NewInt(1 << 7) + schedulingReassignmentPreviewItemsItemFieldFromHost = big.NewInt(1 << 8) + schedulingReassignmentPreviewItemsItemFieldToHost = big.NewInt(1 << 9) + schedulingReassignmentPreviewItemsItemFieldReason = big.NewInt(1 << 10) +) + +// schedulingReassignmentPreviewItemsItemNullableFields maps the wire names of SchedulingReassignmentPreviewItemsItem's nullable fields (required or optional) to their field bits. +var schedulingReassignmentPreviewItemsItemNullableFields = map[string]*big.Int{ + "series": schedulingReassignmentPreviewItemsItemFieldSeries, + "group_session": schedulingReassignmentPreviewItemsItemFieldGroupSession, + "from_host": schedulingReassignmentPreviewItemsItemFieldFromHost, + "to_host": schedulingReassignmentPreviewItemsItemFieldToHost, + "reason": schedulingReassignmentPreviewItemsItemFieldReason, +} + +type SchedulingReassignmentPreviewItemsItem struct { + Booking string `json:"booking" url:"booking"` + EventType string `json:"event_type" url:"event_type"` + Title string `json:"title" url:"title"` + Status SchedulingReassignmentPreviewItemsItemStatus `json:"status" url:"status"` + Start string `json:"start" url:"start"` + End string `json:"end" url:"end"` + Series *string `json:"series,omitempty" url:"series,omitempty"` + GroupSession *string `json:"group_session,omitempty" url:"group_session,omitempty"` + FromHost *string `json:"from_host,omitempty" url:"from_host,omitempty"` + // Null when nobody could take it. + ToHost *string `json:"to_host,omitempty" url:"to_host,omitempty"` + // Why it would stay where it is. + Reason *string `json:"reason,omitempty" url:"reason,omitempty"` // Private bitmask of fields set to an explicit value and therefore not to be omitted explicitFields *big.Int `json:"-" url:"-"` @@ -50478,14 +56346,91 @@ type SchedulingLocationMicrosoftTeams struct { rawJSON json.RawMessage } -func (s *SchedulingLocationMicrosoftTeams) GetExtraProperties() map[string]interface{} { +func (s *SchedulingReassignmentPreviewItemsItem) GetBooking() string { + if s == nil { + return "" + } + return s.Booking +} + +func (s *SchedulingReassignmentPreviewItemsItem) GetEventType() string { + if s == nil { + return "" + } + return s.EventType +} + +func (s *SchedulingReassignmentPreviewItemsItem) GetTitle() string { + if s == nil { + return "" + } + return s.Title +} + +func (s *SchedulingReassignmentPreviewItemsItem) GetStatus() SchedulingReassignmentPreviewItemsItemStatus { + if s == nil { + return "" + } + return s.Status +} + +func (s *SchedulingReassignmentPreviewItemsItem) GetStart() string { + if s == nil { + return "" + } + return s.Start +} + +func (s *SchedulingReassignmentPreviewItemsItem) GetEnd() string { + if s == nil { + return "" + } + return s.End +} + +func (s *SchedulingReassignmentPreviewItemsItem) GetSeries() *string { + if s == nil { + return nil + } + return s.Series +} + +func (s *SchedulingReassignmentPreviewItemsItem) GetGroupSession() *string { + if s == nil { + return nil + } + return s.GroupSession +} + +func (s *SchedulingReassignmentPreviewItemsItem) GetFromHost() *string { + if s == nil { + return nil + } + return s.FromHost +} + +func (s *SchedulingReassignmentPreviewItemsItem) GetToHost() *string { + if s == nil { + return nil + } + return s.ToHost +} + +func (s *SchedulingReassignmentPreviewItemsItem) GetReason() *string { + if s == nil { + return nil + } + return s.Reason +} + +func (s *SchedulingReassignmentPreviewItemsItem) GetExtraProperties() map[string]interface{} { if s == nil { return nil } return s.extraProperties } -func (s *SchedulingLocationMicrosoftTeams) require(field *big.Int) { +func (s *SchedulingReassignmentPreviewItemsItem) require(field *big.Int) { next := new(big.Int) if s.explicitFields != nil { next.Set(s.explicitFields) @@ -50494,24 +56439,108 @@ func (s *SchedulingLocationMicrosoftTeams) require(field *big.Int) { s.explicitFields = next } -func (s *SchedulingLocationMicrosoftTeams) UnmarshalJSON(data []byte) error { - type unmarshaler SchedulingLocationMicrosoftTeams +// SetBooking sets the Booking field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingReassignmentPreviewItemsItem) SetBooking(booking string) { + s.Booking = booking + s.require(schedulingReassignmentPreviewItemsItemFieldBooking) +} + +// SetEventType sets the EventType field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingReassignmentPreviewItemsItem) SetEventType(eventType string) { + s.EventType = eventType + s.require(schedulingReassignmentPreviewItemsItemFieldEventType) +} + +// SetTitle sets the Title field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingReassignmentPreviewItemsItem) SetTitle(title string) { + s.Title = title + s.require(schedulingReassignmentPreviewItemsItemFieldTitle) +} + +// SetStatus sets the Status field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingReassignmentPreviewItemsItem) SetStatus(status SchedulingReassignmentPreviewItemsItemStatus) { + s.Status = status + s.require(schedulingReassignmentPreviewItemsItemFieldStatus) +} + +// SetStart sets the Start field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingReassignmentPreviewItemsItem) SetStart(start string) { + s.Start = start + s.require(schedulingReassignmentPreviewItemsItemFieldStart) +} + +// SetEnd sets the End field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingReassignmentPreviewItemsItem) SetEnd(end string) { + s.End = end + s.require(schedulingReassignmentPreviewItemsItemFieldEnd) +} + +// SetSeries sets the Series field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingReassignmentPreviewItemsItem) SetSeries(series *string) { + s.Series = series + s.require(schedulingReassignmentPreviewItemsItemFieldSeries) +} + +// SetGroupSession sets the GroupSession field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingReassignmentPreviewItemsItem) SetGroupSession(groupSession *string) { + s.GroupSession = groupSession + s.require(schedulingReassignmentPreviewItemsItemFieldGroupSession) +} + +// SetFromHost sets the FromHost field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingReassignmentPreviewItemsItem) SetFromHost(fromHost *string) { + s.FromHost = fromHost + s.require(schedulingReassignmentPreviewItemsItemFieldFromHost) +} + +// SetToHost sets the ToHost field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingReassignmentPreviewItemsItem) SetToHost(toHost *string) { + s.ToHost = toHost + s.require(schedulingReassignmentPreviewItemsItemFieldToHost) +} + +// SetReason sets the Reason field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingReassignmentPreviewItemsItem) SetReason(reason *string) { + s.Reason = reason + s.require(schedulingReassignmentPreviewItemsItemFieldReason) +} + +func (s *SchedulingReassignmentPreviewItemsItem) UnmarshalJSON(data []byte) error { + type unmarshaler SchedulingReassignmentPreviewItemsItem var value unmarshaler if err := json.Unmarshal(data, &value); err != nil { return err } - *s = SchedulingLocationMicrosoftTeams(value) + *s = SchedulingReassignmentPreviewItemsItem(value) extraProperties, err := internal.ExtractExtraProperties(data, *s) if err != nil { return err } s.extraProperties = extraProperties + presentFields, err := internal.ExplicitFieldsFromJSON(data, schedulingReassignmentPreviewItemsItemNullableFields) + if err != nil { + return err + } + if presentFields != nil { + s.require(presentFields) + } s.rawJSON = json.RawMessage(data) return nil } -func (s *SchedulingLocationMicrosoftTeams) MarshalJSON() ([]byte, error) { - type embed SchedulingLocationMicrosoftTeams +func (s *SchedulingReassignmentPreviewItemsItem) MarshalJSON() ([]byte, error) { + type embed SchedulingReassignmentPreviewItemsItem var marshaler = struct { embed }{ @@ -50521,7 +56550,7 @@ func (s *SchedulingLocationMicrosoftTeams) MarshalJSON() ([]byte, error) { return json.Marshal(explicitMarshaler) } -func (s *SchedulingLocationMicrosoftTeams) String() string { +func (s *SchedulingReassignmentPreviewItemsItem) String() string { if s == nil { return "" } @@ -50536,18 +56565,116 @@ func (s *SchedulingLocationMicrosoftTeams) String() string { return fmt.Sprintf("%#v", s) } -var ( - schedulingLocationPhoneFieldNumber = big.NewInt(1 << 0) +type SchedulingReassignmentPreviewItemsItemStatus string + +const ( + SchedulingReassignmentPreviewItemsItemStatusHeld SchedulingReassignmentPreviewItemsItemStatus = "held" + SchedulingReassignmentPreviewItemsItemStatusPendingApproval SchedulingReassignmentPreviewItemsItemStatus = "pending_approval" + SchedulingReassignmentPreviewItemsItemStatusConfirmed SchedulingReassignmentPreviewItemsItemStatus = "confirmed" + SchedulingReassignmentPreviewItemsItemStatusCancelled SchedulingReassignmentPreviewItemsItemStatus = "cancelled" + SchedulingReassignmentPreviewItemsItemStatusDeclined SchedulingReassignmentPreviewItemsItemStatus = "declined" ) -// schedulingLocationPhoneNullableFields maps the wire names of SchedulingLocationPhone's nullable fields (required or optional) to their field bits. -var schedulingLocationPhoneNullableFields = map[string]*big.Int{ - "number": schedulingLocationPhoneFieldNumber, +func NewSchedulingReassignmentPreviewItemsItemStatusFromString(s string) (SchedulingReassignmentPreviewItemsItemStatus, error) { + switch s { + case "held": + return SchedulingReassignmentPreviewItemsItemStatusHeld, nil + case "pending_approval": + return SchedulingReassignmentPreviewItemsItemStatusPendingApproval, nil + case "confirmed": + return SchedulingReassignmentPreviewItemsItemStatusConfirmed, nil + case "cancelled": + return SchedulingReassignmentPreviewItemsItemStatusCancelled, nil + case "declined": + return SchedulingReassignmentPreviewItemsItemStatusDeclined, nil + } + var t SchedulingReassignmentPreviewItemsItemStatus + return "", fmt.Errorf("%s is not a valid %T", s, t) } -type SchedulingLocationPhone struct { - // The phone number to call. `null` on an event type means the booking supplies its own. - Number *string `json:"number,omitempty" url:"number,omitempty"` +func (s SchedulingReassignmentPreviewItemsItemStatus) Ptr() *SchedulingReassignmentPreviewItemsItemStatus { + return &s +} + +type SchedulingReassignmentPreviewObject string + +const ( + SchedulingReassignmentPreviewObjectSchedulingReassignmentPreview SchedulingReassignmentPreviewObject = "scheduling.reassignment_preview" +) + +func NewSchedulingReassignmentPreviewObjectFromString(s string) (SchedulingReassignmentPreviewObject, error) { + switch s { + case "scheduling.reassignment_preview": + return SchedulingReassignmentPreviewObjectSchedulingReassignmentPreview, nil + } + var t SchedulingReassignmentPreviewObject + return "", fmt.Errorf("%s is not a valid %T", s, t) +} + +func (s SchedulingReassignmentPreviewObject) Ptr() *SchedulingReassignmentPreviewObject { + return &s +} + +type SchedulingReassignmentReasonCode string + +const ( + SchedulingReassignmentReasonCodeHostUnavailable SchedulingReassignmentReasonCode = "host_unavailable" + SchedulingReassignmentReasonCodeOutOfOffice SchedulingReassignmentReasonCode = "out_of_office" + SchedulingReassignmentReasonCodeWorkload SchedulingReassignmentReasonCode = "workload" + SchedulingReassignmentReasonCodeCustomerRequest SchedulingReassignmentReasonCode = "customer_request" + SchedulingReassignmentReasonCodeOffboarding SchedulingReassignmentReasonCode = "offboarding" + SchedulingReassignmentReasonCodeOther SchedulingReassignmentReasonCode = "other" +) + +func NewSchedulingReassignmentReasonCodeFromString(s string) (SchedulingReassignmentReasonCode, error) { + switch s { + case "host_unavailable": + return SchedulingReassignmentReasonCodeHostUnavailable, nil + case "out_of_office": + return SchedulingReassignmentReasonCodeOutOfOffice, nil + case "workload": + return SchedulingReassignmentReasonCodeWorkload, nil + case "customer_request": + return SchedulingReassignmentReasonCodeCustomerRequest, nil + case "offboarding": + return SchedulingReassignmentReasonCodeOffboarding, nil + case "other": + return SchedulingReassignmentReasonCodeOther, nil + } + var t SchedulingReassignmentReasonCode + return "", fmt.Errorf("%s is not a valid %T", s, t) +} + +func (s SchedulingReassignmentReasonCode) Ptr() *SchedulingReassignmentReasonCode { + return &s +} + +var ( + schedulingReassignmentSelectionFieldHost = big.NewInt(1 << 0) + schedulingReassignmentSelectionFieldOutOfOffice = big.NewInt(1 << 1) + schedulingReassignmentSelectionFieldBookingIDs = big.NewInt(1 << 2) + schedulingReassignmentSelectionFieldSeries = big.NewInt(1 << 3) + schedulingReassignmentSelectionFieldStartAfter = big.NewInt(1 << 4) + schedulingReassignmentSelectionFieldStartBefore = big.NewInt(1 << 5) + schedulingReassignmentSelectionFieldEventTypes = big.NewInt(1 << 6) + schedulingReassignmentSelectionFieldExternalConflict = big.NewInt(1 << 7) +) + +type SchedulingReassignmentSelection struct { + // This host's bookings, by id or uid. + Host *string `json:"host,omitempty" url:"host,omitempty"` + // The bookings that fall in this entry. + OutOfOffice *string `json:"out_of_office,omitempty" url:"out_of_office,omitempty"` + BookingIDs []string `json:"booking_ids,omitempty" url:"booking_ids,omitempty"` + // A series' occurrences still to come. + Series *string `json:"series,omitempty" url:"series,omitempty"` + // An ISO 8601 instant with an offset. + StartAfter *string `json:"start_after,omitempty" url:"start_after,omitempty"` + // An ISO 8601 instant with an offset. + StartBefore *string `json:"start_before,omitempty" url:"start_before,omitempty"` + EventTypes []string `json:"event_types,omitempty" url:"event_types,omitempty"` + // Only those with something else on the host's calendar at that time. + ExternalConflict *bool `json:"external_conflict,omitempty" url:"external_conflict,omitempty"` // Private bitmask of fields set to an explicit value and therefore not to be omitted explicitFields *big.Int `json:"-" url:"-"` @@ -50556,21 +56683,70 @@ type SchedulingLocationPhone struct { rawJSON json.RawMessage } -func (s *SchedulingLocationPhone) GetNumber() *string { +func (s *SchedulingReassignmentSelection) GetHost() *string { if s == nil { return nil } - return s.Number + return s.Host +} + +func (s *SchedulingReassignmentSelection) GetOutOfOffice() *string { + if s == nil { + return nil + } + return s.OutOfOffice } -func (s *SchedulingLocationPhone) GetExtraProperties() map[string]interface{} { +func (s *SchedulingReassignmentSelection) GetBookingIDs() []string { + if s == nil { + return nil + } + return s.BookingIDs +} + +func (s *SchedulingReassignmentSelection) GetSeries() *string { + if s == nil { + return nil + } + return s.Series +} + +func (s *SchedulingReassignmentSelection) GetStartAfter() *string { + if s == nil { + return nil + } + return s.StartAfter +} + +func (s *SchedulingReassignmentSelection) GetStartBefore() *string { + if s == nil { + return nil + } + return s.StartBefore +} + +func (s *SchedulingReassignmentSelection) GetEventTypes() []string { + if s == nil { + return nil + } + return s.EventTypes +} + +func (s *SchedulingReassignmentSelection) GetExternalConflict() *bool { + if s == nil { + return nil + } + return s.ExternalConflict +} + +func (s *SchedulingReassignmentSelection) GetExtraProperties() map[string]interface{} { if s == nil { return nil } return s.extraProperties } -func (s *SchedulingLocationPhone) require(field *big.Int) { +func (s *SchedulingReassignmentSelection) require(field *big.Int) { next := new(big.Int) if s.explicitFields != nil { next.Set(s.explicitFields) @@ -50579,38 +56755,80 @@ func (s *SchedulingLocationPhone) require(field *big.Int) { s.explicitFields = next } -// SetNumber sets the Number field and marks it as non-optional; +// SetHost sets the Host field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (s *SchedulingLocationPhone) SetNumber(number *string) { - s.Number = number - s.require(schedulingLocationPhoneFieldNumber) +func (s *SchedulingReassignmentSelection) SetHost(host *string) { + s.Host = host + s.require(schedulingReassignmentSelectionFieldHost) +} + +// SetOutOfOffice sets the OutOfOffice field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingReassignmentSelection) SetOutOfOffice(outOfOffice *string) { + s.OutOfOffice = outOfOffice + s.require(schedulingReassignmentSelectionFieldOutOfOffice) +} + +// SetBookingIDs sets the BookingIDs field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingReassignmentSelection) SetBookingIDs(bookingIDs []string) { + s.BookingIDs = bookingIDs + s.require(schedulingReassignmentSelectionFieldBookingIDs) +} + +// SetSeries sets the Series field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingReassignmentSelection) SetSeries(series *string) { + s.Series = series + s.require(schedulingReassignmentSelectionFieldSeries) +} + +// SetStartAfter sets the StartAfter field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingReassignmentSelection) SetStartAfter(startAfter *string) { + s.StartAfter = startAfter + s.require(schedulingReassignmentSelectionFieldStartAfter) +} + +// SetStartBefore sets the StartBefore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingReassignmentSelection) SetStartBefore(startBefore *string) { + s.StartBefore = startBefore + s.require(schedulingReassignmentSelectionFieldStartBefore) +} + +// SetEventTypes sets the EventTypes field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingReassignmentSelection) SetEventTypes(eventTypes []string) { + s.EventTypes = eventTypes + s.require(schedulingReassignmentSelectionFieldEventTypes) +} + +// SetExternalConflict sets the ExternalConflict field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingReassignmentSelection) SetExternalConflict(externalConflict *bool) { + s.ExternalConflict = externalConflict + s.require(schedulingReassignmentSelectionFieldExternalConflict) } -func (s *SchedulingLocationPhone) UnmarshalJSON(data []byte) error { - type unmarshaler SchedulingLocationPhone +func (s *SchedulingReassignmentSelection) UnmarshalJSON(data []byte) error { + type unmarshaler SchedulingReassignmentSelection var value unmarshaler if err := json.Unmarshal(data, &value); err != nil { return err } - *s = SchedulingLocationPhone(value) + *s = SchedulingReassignmentSelection(value) extraProperties, err := internal.ExtractExtraProperties(data, *s) if err != nil { return err } s.extraProperties = extraProperties - presentFields, err := internal.ExplicitFieldsFromJSON(data, schedulingLocationPhoneNullableFields) - if err != nil { - return err - } - if presentFields != nil { - s.require(presentFields) - } s.rawJSON = json.RawMessage(data) return nil } -func (s *SchedulingLocationPhone) MarshalJSON() ([]byte, error) { - type embed SchedulingLocationPhone +func (s *SchedulingReassignmentSelection) MarshalJSON() ([]byte, error) { + type embed SchedulingReassignmentSelection var marshaler = struct { embed }{ @@ -50620,7 +56838,7 @@ func (s *SchedulingLocationPhone) MarshalJSON() ([]byte, error) { return json.Marshal(explicitMarshaler) } -func (s *SchedulingLocationPhone) String() string { +func (s *SchedulingReassignmentSelection) String() string { if s == nil { return "" } @@ -50635,18 +56853,50 @@ func (s *SchedulingLocationPhone) String() string { return fmt.Sprintf("%#v", s) } -var ( - schedulingLocationZoomFieldURL = big.NewInt(1 << 0) +type SchedulingReassignmentStatus string + +const ( + SchedulingReassignmentStatusPending SchedulingReassignmentStatus = "pending" + SchedulingReassignmentStatusRunning SchedulingReassignmentStatus = "running" + SchedulingReassignmentStatusCompleted SchedulingReassignmentStatus = "completed" + SchedulingReassignmentStatusCancelled SchedulingReassignmentStatus = "cancelled" ) -// schedulingLocationZoomNullableFields maps the wire names of SchedulingLocationZoom's nullable fields (required or optional) to their field bits. -var schedulingLocationZoomNullableFields = map[string]*big.Int{ - "url": schedulingLocationZoomFieldURL, +func NewSchedulingReassignmentStatusFromString(s string) (SchedulingReassignmentStatus, error) { + switch s { + case "pending": + return SchedulingReassignmentStatusPending, nil + case "running": + return SchedulingReassignmentStatusRunning, nil + case "completed": + return SchedulingReassignmentStatusCompleted, nil + case "cancelled": + return SchedulingReassignmentStatusCancelled, nil + } + var t SchedulingReassignmentStatus + return "", fmt.Errorf("%s is not a valid %T", s, t) +} + +func (s SchedulingReassignmentStatus) Ptr() *SchedulingReassignmentStatus { + return &s } -type SchedulingLocationZoom struct { - // The meeting's link, once it's created on the host's Zoom account. - URL *string `json:"url,omitempty" url:"url,omitempty"` +var ( + schedulingReassignmentStrategyFieldToHost = big.NewInt(1 << 0) + schedulingReassignmentStrategyFieldPreferredHosts = big.NewInt(1 << 1) + schedulingReassignmentStrategyFieldOtherwise = big.NewInt(1 << 2) + schedulingReassignmentStrategyFieldAssignments = big.NewInt(1 << 3) +) + +type SchedulingReassignmentStrategy struct { + // Give them all to this host. + ToHost *string `json:"to_host,omitempty" url:"to_host,omitempty"` + // Try these first, in order. + PreferredHosts []string `json:"preferred_hosts,omitempty" url:"preferred_hosts,omitempty"` + // After `preferred_hosts`: `auto` picks the fairest who's free, `leave` keeps it where it is. + Otherwise *SchedulingReassignmentStrategyOtherwise `json:"otherwise,omitempty" url:"otherwise,omitempty"` + // Who each goes to: a preview, with your changes. + Assignments []*SchedulingReassignmentStrategyAssignmentsItem `json:"assignments,omitempty" url:"assignments,omitempty"` // Private bitmask of fields set to an explicit value and therefore not to be omitted explicitFields *big.Int `json:"-" url:"-"` @@ -50655,21 +56905,42 @@ type SchedulingLocationZoom struct { rawJSON json.RawMessage } -func (s *SchedulingLocationZoom) GetURL() *string { +func (s *SchedulingReassignmentStrategy) GetToHost() *string { if s == nil { return nil } - return s.URL + return s.ToHost } -func (s *SchedulingLocationZoom) GetExtraProperties() map[string]interface{} { +func (s *SchedulingReassignmentStrategy) GetPreferredHosts() []string { + if s == nil { + return nil + } + return s.PreferredHosts +} + +func (s *SchedulingReassignmentStrategy) GetOtherwise() *SchedulingReassignmentStrategyOtherwise { + if s == nil { + return nil + } + return s.Otherwise +} + +func (s *SchedulingReassignmentStrategy) GetAssignments() []*SchedulingReassignmentStrategyAssignmentsItem { + if s == nil { + return nil + } + return s.Assignments +} + +func (s *SchedulingReassignmentStrategy) GetExtraProperties() map[string]interface{} { if s == nil { return nil } return s.extraProperties } -func (s *SchedulingLocationZoom) require(field *big.Int) { +func (s *SchedulingReassignmentStrategy) require(field *big.Int) { next := new(big.Int) if s.explicitFields != nil { next.Set(s.explicitFields) @@ -50678,38 +56949,52 @@ func (s *SchedulingLocationZoom) require(field *big.Int) { s.explicitFields = next } -// SetURL sets the URL field and marks it as non-optional; +// SetToHost sets the ToHost field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (s *SchedulingLocationZoom) SetURL(url *string) { - s.URL = url - s.require(schedulingLocationZoomFieldURL) +func (s *SchedulingReassignmentStrategy) SetToHost(toHost *string) { + s.ToHost = toHost + s.require(schedulingReassignmentStrategyFieldToHost) } -func (s *SchedulingLocationZoom) UnmarshalJSON(data []byte) error { - type unmarshaler SchedulingLocationZoom +// SetPreferredHosts sets the PreferredHosts field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingReassignmentStrategy) SetPreferredHosts(preferredHosts []string) { + s.PreferredHosts = preferredHosts + s.require(schedulingReassignmentStrategyFieldPreferredHosts) +} + +// SetOtherwise sets the Otherwise field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingReassignmentStrategy) SetOtherwise(otherwise *SchedulingReassignmentStrategyOtherwise) { + s.Otherwise = otherwise + s.require(schedulingReassignmentStrategyFieldOtherwise) +} + +// SetAssignments sets the Assignments field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingReassignmentStrategy) SetAssignments(assignments []*SchedulingReassignmentStrategyAssignmentsItem) { + s.Assignments = assignments + s.require(schedulingReassignmentStrategyFieldAssignments) +} + +func (s *SchedulingReassignmentStrategy) UnmarshalJSON(data []byte) error { + type unmarshaler SchedulingReassignmentStrategy var value unmarshaler if err := json.Unmarshal(data, &value); err != nil { return err } - *s = SchedulingLocationZoom(value) + *s = SchedulingReassignmentStrategy(value) extraProperties, err := internal.ExtractExtraProperties(data, *s) if err != nil { return err } s.extraProperties = extraProperties - presentFields, err := internal.ExplicitFieldsFromJSON(data, schedulingLocationZoomNullableFields) - if err != nil { - return err - } - if presentFields != nil { - s.require(presentFields) - } s.rawJSON = json.RawMessage(data) return nil } -func (s *SchedulingLocationZoom) MarshalJSON() ([]byte, error) { - type embed SchedulingLocationZoom +func (s *SchedulingReassignmentStrategy) MarshalJSON() ([]byte, error) { + type embed SchedulingReassignmentStrategy var marshaler = struct { embed }{ @@ -50719,7 +57004,7 @@ func (s *SchedulingLocationZoom) MarshalJSON() ([]byte, error) { return json.Marshal(explicitMarshaler) } -func (s *SchedulingLocationZoom) String() string { +func (s *SchedulingReassignmentStrategy) String() string { if s == nil { return "" } @@ -50735,25 +57020,15 @@ func (s *SchedulingLocationZoom) String() string { } var ( - schedulingQuestionFieldKey = big.NewInt(1 << 0) - schedulingQuestionFieldType = big.NewInt(1 << 1) - schedulingQuestionFieldLabel = big.NewInt(1 << 2) - schedulingQuestionFieldRequired = big.NewInt(1 << 3) - schedulingQuestionFieldOptions = big.NewInt(1 << 4) + schedulingReassignmentStrategyAssignmentsItemFieldBooking = big.NewInt(1 << 0) + schedulingReassignmentStrategyAssignmentsItemFieldToHost = big.NewInt(1 << 1) + schedulingReassignmentStrategyAssignmentsItemFieldFromHost = big.NewInt(1 << 2) ) -// Something attendees are asked when booking. Answers are encrypted, and come back only when you retrieve one booking. -type SchedulingQuestion struct { - // The answer's key in `answers`. Unique within the event type. - Key string `json:"key" url:"key"` - // How it's asked and which answers are valid. - Type SchedulingQuestionType `json:"type" url:"type"` - // The question as attendees see it. - Label string `json:"label" url:"label"` - // Whether a booking must answer it. - Required *bool `json:"required,omitempty" url:"required,omitempty"` - // The choices of a `select`, `radio` or `checkbox` question. `select` and `radio` need at least one. - Options []string `json:"options,omitempty" url:"options,omitempty"` +type SchedulingReassignmentStrategyAssignmentsItem struct { + Booking string `json:"booking" url:"booking"` + ToHost string `json:"to_host" url:"to_host"` + FromHost *string `json:"from_host,omitempty" url:"from_host,omitempty"` // Private bitmask of fields set to an explicit value and therefore not to be omitted explicitFields *big.Int `json:"-" url:"-"` @@ -50762,49 +57037,35 @@ type SchedulingQuestion struct { rawJSON json.RawMessage } -func (s *SchedulingQuestion) GetKey() string { - if s == nil { - return "" - } - return s.Key -} - -func (s *SchedulingQuestion) GetType() SchedulingQuestionType { +func (s *SchedulingReassignmentStrategyAssignmentsItem) GetBooking() string { if s == nil { return "" } - return s.Type + return s.Booking } -func (s *SchedulingQuestion) GetLabel() string { +func (s *SchedulingReassignmentStrategyAssignmentsItem) GetToHost() string { if s == nil { return "" } - return s.Label -} - -func (s *SchedulingQuestion) GetRequired() *bool { - if s == nil { - return nil - } - return s.Required + return s.ToHost } -func (s *SchedulingQuestion) GetOptions() []string { +func (s *SchedulingReassignmentStrategyAssignmentsItem) GetFromHost() *string { if s == nil { return nil } - return s.Options + return s.FromHost } -func (s *SchedulingQuestion) GetExtraProperties() map[string]interface{} { +func (s *SchedulingReassignmentStrategyAssignmentsItem) GetExtraProperties() map[string]interface{} { if s == nil { return nil } return s.extraProperties } -func (s *SchedulingQuestion) require(field *big.Int) { +func (s *SchedulingReassignmentStrategyAssignmentsItem) require(field *big.Int) { next := new(big.Int) if s.explicitFields != nil { next.Set(s.explicitFields) @@ -50813,48 +57074,34 @@ func (s *SchedulingQuestion) require(field *big.Int) { s.explicitFields = next } -// SetKey sets the Key field and marks it as non-optional; +// SetBooking sets the Booking field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (s *SchedulingQuestion) SetKey(key string) { - s.Key = key - s.require(schedulingQuestionFieldKey) +func (s *SchedulingReassignmentStrategyAssignmentsItem) SetBooking(booking string) { + s.Booking = booking + s.require(schedulingReassignmentStrategyAssignmentsItemFieldBooking) } -// SetType sets the Type field and marks it as non-optional; +// SetToHost sets the ToHost field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (s *SchedulingQuestion) SetType(type_ SchedulingQuestionType) { - s.Type = type_ - s.require(schedulingQuestionFieldType) +func (s *SchedulingReassignmentStrategyAssignmentsItem) SetToHost(toHost string) { + s.ToHost = toHost + s.require(schedulingReassignmentStrategyAssignmentsItemFieldToHost) } -// SetLabel sets the Label field and marks it as non-optional; +// SetFromHost sets the FromHost field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (s *SchedulingQuestion) SetLabel(label string) { - s.Label = label - s.require(schedulingQuestionFieldLabel) +func (s *SchedulingReassignmentStrategyAssignmentsItem) SetFromHost(fromHost *string) { + s.FromHost = fromHost + s.require(schedulingReassignmentStrategyAssignmentsItemFieldFromHost) } -// SetRequired sets the Required field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (s *SchedulingQuestion) SetRequired(required *bool) { - s.Required = required - s.require(schedulingQuestionFieldRequired) -} - -// SetOptions sets the Options field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (s *SchedulingQuestion) SetOptions(options []string) { - s.Options = options - s.require(schedulingQuestionFieldOptions) -} - -func (s *SchedulingQuestion) UnmarshalJSON(data []byte) error { - type unmarshaler SchedulingQuestion +func (s *SchedulingReassignmentStrategyAssignmentsItem) UnmarshalJSON(data []byte) error { + type unmarshaler SchedulingReassignmentStrategyAssignmentsItem var value unmarshaler if err := json.Unmarshal(data, &value); err != nil { return err } - *s = SchedulingQuestion(value) + *s = SchedulingReassignmentStrategyAssignmentsItem(value) extraProperties, err := internal.ExtractExtraProperties(data, *s) if err != nil { return err @@ -50864,8 +57111,8 @@ func (s *SchedulingQuestion) UnmarshalJSON(data []byte) error { return nil } -func (s *SchedulingQuestion) MarshalJSON() ([]byte, error) { - type embed SchedulingQuestion +func (s *SchedulingReassignmentStrategyAssignmentsItem) MarshalJSON() ([]byte, error) { + type embed SchedulingReassignmentStrategyAssignmentsItem var marshaler = struct { embed }{ @@ -50875,7 +57122,7 @@ func (s *SchedulingQuestion) MarshalJSON() ([]byte, error) { return json.Marshal(explicitMarshaler) } -func (s *SchedulingQuestion) String() string { +func (s *SchedulingReassignmentStrategyAssignmentsItem) String() string { if s == nil { return "" } @@ -50890,44 +57137,26 @@ func (s *SchedulingQuestion) String() string { return fmt.Sprintf("%#v", s) } -// How it's asked and which answers are valid. -type SchedulingQuestionType string +// After `preferred_hosts`: `auto` picks the fairest who's free, `leave` keeps it where it is. +type SchedulingReassignmentStrategyOtherwise string const ( - SchedulingQuestionTypeText SchedulingQuestionType = "text" - SchedulingQuestionTypeTextarea SchedulingQuestionType = "textarea" - SchedulingQuestionTypeSelect SchedulingQuestionType = "select" - SchedulingQuestionTypeRadio SchedulingQuestionType = "radio" - SchedulingQuestionTypeCheckbox SchedulingQuestionType = "checkbox" - SchedulingQuestionTypePhone SchedulingQuestionType = "phone" - SchedulingQuestionTypeEmail SchedulingQuestionType = "email" - SchedulingQuestionTypeNumber SchedulingQuestionType = "number" + SchedulingReassignmentStrategyOtherwiseAuto SchedulingReassignmentStrategyOtherwise = "auto" + SchedulingReassignmentStrategyOtherwiseLeave SchedulingReassignmentStrategyOtherwise = "leave" ) -func NewSchedulingQuestionTypeFromString(s string) (SchedulingQuestionType, error) { +func NewSchedulingReassignmentStrategyOtherwiseFromString(s string) (SchedulingReassignmentStrategyOtherwise, error) { switch s { - case "text": - return SchedulingQuestionTypeText, nil - case "textarea": - return SchedulingQuestionTypeTextarea, nil - case "select": - return SchedulingQuestionTypeSelect, nil - case "radio": - return SchedulingQuestionTypeRadio, nil - case "checkbox": - return SchedulingQuestionTypeCheckbox, nil - case "phone": - return SchedulingQuestionTypePhone, nil - case "email": - return SchedulingQuestionTypeEmail, nil - case "number": - return SchedulingQuestionTypeNumber, nil + case "auto": + return SchedulingReassignmentStrategyOtherwiseAuto, nil + case "leave": + return SchedulingReassignmentStrategyOtherwiseLeave, nil } - var t SchedulingQuestionType + var t SchedulingReassignmentStrategyOtherwise return "", fmt.Errorf("%s is not a valid %T", s, t) } -func (s SchedulingQuestionType) Ptr() *SchedulingQuestionType { +func (s SchedulingReassignmentStrategyOtherwise) Ptr() *SchedulingReassignmentStrategyOtherwise { return &s } @@ -53866,17 +60095,21 @@ func (s SchedulingSessionObject) Ptr() *SchedulingSessionObject { } var ( - schedulingSettingsFieldObject = big.NewInt(1 << 0) - schedulingSettingsFieldAllowedOrigins = big.NewInt(1 << 1) - schedulingSettingsFieldBrandName = big.NewInt(1 << 2) - schedulingSettingsFieldAccentColor = big.NewInt(1 << 3) - schedulingSettingsFieldLogo = big.NewInt(1 << 4) - schedulingSettingsFieldEmailFrom = big.NewInt(1 << 5) - schedulingSettingsFieldSmsFrom = big.NewInt(1 << 6) - schedulingSettingsFieldCalendarFailureMode = big.NewInt(1 << 7) - schedulingSettingsFieldNotifications = big.NewInt(1 << 8) - schedulingSettingsFieldEmailReplyTo = big.NewInt(1 << 9) - schedulingSettingsFieldReminders = big.NewInt(1 << 10) + schedulingSettingsFieldObject = big.NewInt(1 << 0) + schedulingSettingsFieldAllowedOrigins = big.NewInt(1 << 1) + schedulingSettingsFieldBrandName = big.NewInt(1 << 2) + schedulingSettingsFieldAccentColor = big.NewInt(1 << 3) + schedulingSettingsFieldLogo = big.NewInt(1 << 4) + schedulingSettingsFieldPrivacyURL = big.NewInt(1 << 5) + schedulingSettingsFieldEmailFrom = big.NewInt(1 << 6) + schedulingSettingsFieldSmsFrom = big.NewInt(1 << 7) + schedulingSettingsFieldNameHostInAttendeeEmails = big.NewInt(1 << 8) + schedulingSettingsFieldHostReassignment = big.NewInt(1 << 9) + schedulingSettingsFieldOutOfOfficeReasons = big.NewInt(1 << 10) + schedulingSettingsFieldCalendarFailureMode = big.NewInt(1 << 11) + schedulingSettingsFieldNotifications = big.NewInt(1 << 12) + schedulingSettingsFieldEmailReplyTo = big.NewInt(1 << 13) + schedulingSettingsFieldReminders = big.NewInt(1 << 14) ) // schedulingSettingsNullableFields maps the wire names of SchedulingSettings's nullable fields (required or optional) to their field bits. @@ -53884,6 +60117,7 @@ var schedulingSettingsNullableFields = map[string]*big.Int{ "brand_name": schedulingSettingsFieldBrandName, "accent_color": schedulingSettingsFieldAccentColor, "logo": schedulingSettingsFieldLogo, + "privacy_url": schedulingSettingsFieldPrivacyURL, "email_from": schedulingSettingsFieldEmailFrom, "sms_from": schedulingSettingsFieldSmsFrom, "notifications": schedulingSettingsFieldNotifications, @@ -53901,10 +60135,18 @@ type SchedulingSettings struct { AccentColor *string `json:"accent_color,omitempty" url:"accent_color,omitempty"` // At the top of the hosted pages, and of emails sent from `email_from`. Logo *SchedulingSettingsLogo `json:"logo,omitempty" url:"logo,omitempty"` + // Your privacy policy, linked on a host's page beside what connecting a calendar does, once this environment has its own OAuth app and a `brand_name`. + PrivacyURL *string `json:"privacy_url,omitempty" url:"privacy_url,omitempty"` // Sender of booking emails, on a verified domain. EmailFrom *string `json:"email_from,omitempty" url:"email_from,omitempty"` // Your approved number for SMS reminders. Without one, no SMS is sent. SmsFrom *string `json:"sms_from,omitempty" url:"sms_from,omitempty"` + // Name the new host when telling an attendee their booking has one. + NameHostInAttendeeEmails bool `json:"name_host_in_attendee_emails" url:"name_host_in_attendee_emails"` + // Whether hosts can give their own bookings to someone else from their page. `eligible` lets them, to anyone free who takes that event type. + HostReassignment SchedulingSettingsHostReassignment `json:"host_reassignment" url:"host_reassignment"` + // Reasons of your own for time away, on top of the preset ones. + OutOfOfficeReasons []*SchedulingSettingsOutOfOfficeReasonsItem `json:"out_of_office_reasons" url:"out_of_office_reasons"` // When a host's calendar can't be read: `hide` stops offering them, `last_known` keeps offering their last known times. CalendarFailureMode SchedulingSettingsCalendarFailureMode `json:"calendar_failure_mode" url:"calendar_failure_mode"` // Per event, overriding the defaults. @@ -53955,6 +60197,13 @@ func (s *SchedulingSettings) GetLogo() *SchedulingSettingsLogo { return s.Logo } +func (s *SchedulingSettings) GetPrivacyURL() *string { + if s == nil { + return nil + } + return s.PrivacyURL +} + func (s *SchedulingSettings) GetEmailFrom() *string { if s == nil { return nil @@ -53969,6 +60218,27 @@ func (s *SchedulingSettings) GetSmsFrom() *string { return s.SmsFrom } +func (s *SchedulingSettings) GetNameHostInAttendeeEmails() bool { + if s == nil { + return false + } + return s.NameHostInAttendeeEmails +} + +func (s *SchedulingSettings) GetHostReassignment() SchedulingSettingsHostReassignment { + if s == nil { + return "" + } + return s.HostReassignment +} + +func (s *SchedulingSettings) GetOutOfOfficeReasons() []*SchedulingSettingsOutOfOfficeReasonsItem { + if s == nil { + return nil + } + return s.OutOfOfficeReasons +} + func (s *SchedulingSettings) GetCalendarFailureMode() SchedulingSettingsCalendarFailureMode { if s == nil { return "" @@ -54048,6 +60318,13 @@ func (s *SchedulingSettings) SetLogo(logo *SchedulingSettingsLogo) { s.require(schedulingSettingsFieldLogo) } +// SetPrivacyURL sets the PrivacyURL field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingSettings) SetPrivacyURL(privacyURL *string) { + s.PrivacyURL = privacyURL + s.require(schedulingSettingsFieldPrivacyURL) +} + // SetEmailFrom sets the EmailFrom field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. func (s *SchedulingSettings) SetEmailFrom(emailFrom *string) { @@ -54062,6 +60339,27 @@ func (s *SchedulingSettings) SetSmsFrom(smsFrom *string) { s.require(schedulingSettingsFieldSmsFrom) } +// SetNameHostInAttendeeEmails sets the NameHostInAttendeeEmails field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingSettings) SetNameHostInAttendeeEmails(nameHostInAttendeeEmails bool) { + s.NameHostInAttendeeEmails = nameHostInAttendeeEmails + s.require(schedulingSettingsFieldNameHostInAttendeeEmails) +} + +// SetHostReassignment sets the HostReassignment field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingSettings) SetHostReassignment(hostReassignment SchedulingSettingsHostReassignment) { + s.HostReassignment = hostReassignment + s.require(schedulingSettingsFieldHostReassignment) +} + +// SetOutOfOfficeReasons sets the OutOfOfficeReasons field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingSettings) SetOutOfOfficeReasons(outOfOfficeReasons []*SchedulingSettingsOutOfOfficeReasonsItem) { + s.OutOfOfficeReasons = outOfOfficeReasons + s.require(schedulingSettingsFieldOutOfOfficeReasons) +} + // SetCalendarFailureMode sets the CalendarFailureMode field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. func (s *SchedulingSettings) SetCalendarFailureMode(calendarFailureMode SchedulingSettingsCalendarFailureMode) { @@ -54162,6 +60460,29 @@ func (s SchedulingSettingsCalendarFailureMode) Ptr() *SchedulingSettingsCalendar return &s } +// Whether hosts can give their own bookings to someone else from their page. `eligible` lets them, to anyone free who takes that event type. +type SchedulingSettingsHostReassignment string + +const ( + SchedulingSettingsHostReassignmentOff SchedulingSettingsHostReassignment = "off" + SchedulingSettingsHostReassignmentEligible SchedulingSettingsHostReassignment = "eligible" +) + +func NewSchedulingSettingsHostReassignmentFromString(s string) (SchedulingSettingsHostReassignment, error) { + switch s { + case "off": + return SchedulingSettingsHostReassignmentOff, nil + case "eligible": + return SchedulingSettingsHostReassignmentEligible, nil + } + var t SchedulingSettingsHostReassignment + return "", fmt.Errorf("%s is not a valid %T", s, t) +} + +func (s SchedulingSettingsHostReassignment) Ptr() *SchedulingSettingsHostReassignment { + return &s +} + var ( schedulingSettingsLogoFieldContentType = big.NewInt(1 << 0) schedulingSettingsLogoFieldWidth = big.NewInt(1 << 1) @@ -54464,6 +60785,108 @@ func (s SchedulingSettingsObject) Ptr() *SchedulingSettingsObject { return &s } +var ( + schedulingSettingsOutOfOfficeReasonsItemFieldKey = big.NewInt(1 << 0) + schedulingSettingsOutOfOfficeReasonsItemFieldLabel = big.NewInt(1 << 1) +) + +type SchedulingSettingsOutOfOfficeReasonsItem struct { + Key string `json:"key" url:"key"` + Label string `json:"label" url:"label"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + + extraProperties map[string]interface{} + rawJSON json.RawMessage +} + +func (s *SchedulingSettingsOutOfOfficeReasonsItem) GetKey() string { + if s == nil { + return "" + } + return s.Key +} + +func (s *SchedulingSettingsOutOfOfficeReasonsItem) GetLabel() string { + if s == nil { + return "" + } + return s.Label +} + +func (s *SchedulingSettingsOutOfOfficeReasonsItem) GetExtraProperties() map[string]interface{} { + if s == nil { + return nil + } + return s.extraProperties +} + +func (s *SchedulingSettingsOutOfOfficeReasonsItem) require(field *big.Int) { + next := new(big.Int) + if s.explicitFields != nil { + next.Set(s.explicitFields) + } + next.Or(next, field) + s.explicitFields = next +} + +// SetKey sets the Key field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingSettingsOutOfOfficeReasonsItem) SetKey(key string) { + s.Key = key + s.require(schedulingSettingsOutOfOfficeReasonsItemFieldKey) +} + +// SetLabel sets the Label field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingSettingsOutOfOfficeReasonsItem) SetLabel(label string) { + s.Label = label + s.require(schedulingSettingsOutOfOfficeReasonsItemFieldLabel) +} + +func (s *SchedulingSettingsOutOfOfficeReasonsItem) UnmarshalJSON(data []byte) error { + type unmarshaler SchedulingSettingsOutOfOfficeReasonsItem + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *s = SchedulingSettingsOutOfOfficeReasonsItem(value) + extraProperties, err := internal.ExtractExtraProperties(data, *s) + if err != nil { + return err + } + s.extraProperties = extraProperties + s.rawJSON = json.RawMessage(data) + return nil +} + +func (s *SchedulingSettingsOutOfOfficeReasonsItem) MarshalJSON() ([]byte, error) { + type embed SchedulingSettingsOutOfOfficeReasonsItem + var marshaler = struct { + embed + }{ + embed: embed(*s), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, s.explicitFields) + return json.Marshal(explicitMarshaler) +} + +func (s *SchedulingSettingsOutOfOfficeReasonsItem) String() string { + if s == nil { + return "" + } + if len(s.rawJSON) > 0 { + if value, err := internal.StringifyJSON(s.rawJSON); err == nil { + return value + } + } + if value, err := internal.StringifyJSON(s); err == nil { + return value + } + return fmt.Sprintf("%#v", s) +} + var ( schedulingSlotFieldStart = big.NewInt(1 << 0) schedulingSlotFieldEnd = big.NewInt(1 << 1) @@ -54636,7 +61059,7 @@ type SchedulingSlotExplanation struct { End string `json:"end" url:"end"` // Whether it can be booked right now. Available bool `json:"available" url:"available"` - // Why it can't: `not_on_grid`, `too_soon`, `outside_booking_window`, `calendar_unverified`, `outside_availability`, `host_busy`, `already_claimed`, `limit_reached` or `session_full`, or `event_type_inactive` or `no_hosts`. `null` when it can. With several hosts refused, the first one's reason: see `hosts`. + // Why it can't: `not_on_grid`, `too_soon`, `outside_booking_window`, `out_of_office`, `outside_coverage`, `calendar_unverified`, `outside_availability`, `host_busy`, `already_claimed`, `limit_reached` or `session_full`, or `event_type_inactive` or `no_hosts`. `null` when it can. With several hosts refused, the first one's reason: see `hosts`. Reason *string `json:"reason,omitempty" url:"reason,omitempty"` // Everyone who could take this event type, narrowed by the query. Hosts []*SchedulingSlotExplanationHostsItem `json:"hosts" url:"hosts"` @@ -54818,7 +61241,7 @@ type SchedulingSlotExplanationHostsItem struct { Role SchedulingSlotExplanationHostsItemRole `json:"role" url:"role"` // Whether this host could take it. Available bool `json:"available" url:"available"` - // Why not: `not_on_grid`, `too_soon`, `outside_booking_window`, `calendar_unverified`, `outside_availability`, `host_busy`, `already_claimed`, `limit_reached` or `session_full`. `null` when they could. + // Why not: `not_on_grid`, `too_soon`, `outside_booking_window`, `out_of_office`, `outside_coverage`, `calendar_unverified`, `outside_availability`, `host_busy`, `already_claimed`, `limit_reached` or `session_full`. `null` when they could. Reason *string `json:"reason,omitempty" url:"reason,omitempty"` // With `calendar_unverified`: `calendar_needs_reauth`, `calendar_stale` or `calendar_not_covered`. CalendarReason *string `json:"calendar_reason,omitempty" url:"calendar_reason,omitempty"` diff --git a/sdks/go/types_test.go b/sdks/go/types_test.go index e523f2894..d013f469e 100644 --- a/sdks/go/types_test.go +++ b/sdks/go/types_test.go @@ -15068,493 +15068,331 @@ func TestSettersMarkExplicitCreateCalendarDelegationRequestMicrosoft(t *testing. } -func TestSettersCreateSeriesRequest(t *testing.T) { - t.Run("SetEventType", func(t *testing.T) { - obj := &CreateSeriesRequest{} - var fernTestValueEventType string - obj.SetEventType(fernTestValueEventType) - assert.Equal(t, fernTestValueEventType, obj.EventType) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetStart", func(t *testing.T) { - obj := &CreateSeriesRequest{} - var fernTestValueStart string - obj.SetStart(fernTestValueStart) - assert.Equal(t, fernTestValueStart, obj.Start) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetHost", func(t *testing.T) { - obj := &CreateSeriesRequest{} - var fernTestValueHost *string - obj.SetHost(fernTestValueHost) - assert.Equal(t, fernTestValueHost, obj.Host) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetAttributes", func(t *testing.T) { - obj := &CreateSeriesRequest{} - var fernTestValueAttributes map[string]*CreateSeriesRequestAttributesValue - obj.SetAttributes(fernTestValueAttributes) - assert.Equal(t, fernTestValueAttributes, obj.Attributes) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetDurationMinutes", func(t *testing.T) { - obj := &CreateSeriesRequest{} - var fernTestValueDurationMinutes *int - obj.SetDurationMinutes(fernTestValueDurationMinutes) - assert.Equal(t, fernTestValueDurationMinutes, obj.DurationMinutes) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetAttendee", func(t *testing.T) { - obj := &CreateSeriesRequest{} - var fernTestValueAttendee *SchedulingAttendeeInput - obj.SetAttendee(fernTestValueAttendee) - assert.Equal(t, fernTestValueAttendee, obj.Attendee) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetGuests", func(t *testing.T) { - obj := &CreateSeriesRequest{} - var fernTestValueGuests []*SchedulingGuestInput - obj.SetGuests(fernTestValueGuests) - assert.Equal(t, fernTestValueGuests, obj.Guests) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetAnswers", func(t *testing.T) { - obj := &CreateSeriesRequest{} - var fernTestValueAnswers map[string]*CreateSeriesRequestAnswersValue - obj.SetAnswers(fernTestValueAnswers) - assert.Equal(t, fernTestValueAnswers, obj.Answers) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetLocation", func(t *testing.T) { - obj := &CreateSeriesRequest{} - var fernTestValueLocation *CreateSeriesRequestLocation - obj.SetLocation(fernTestValueLocation) - assert.Equal(t, fernTestValueLocation, obj.Location) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetMetadata", func(t *testing.T) { - obj := &CreateSeriesRequest{} - var fernTestValueMetadata map[string]string - obj.SetMetadata(fernTestValueMetadata) - assert.Equal(t, fernTestValueMetadata, obj.Metadata) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetRecurrence", func(t *testing.T) { - obj := &CreateSeriesRequest{} - var fernTestValueRecurrence *CreateSeriesRequestRecurrence - obj.SetRecurrence(fernTestValueRecurrence) - assert.Equal(t, fernTestValueRecurrence, obj.Recurrence) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetOnConflict", func(t *testing.T) { - obj := &CreateSeriesRequest{} - var fernTestValueOnConflict *CreateSeriesRequestOnConflict - obj.SetOnConflict(fernTestValueOnConflict) - assert.Equal(t, fernTestValueOnConflict, obj.OnConflict) - assert.NotNil(t, obj.explicitFields) - }) - -} - -func TestGettersCreateSeriesRequest(t *testing.T) { - t.Run("GetEventType", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &CreateSeriesRequest{} - var expected string - obj.EventType = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetEventType(), "getter should return the property value") - }) - - t.Run("GetEventType_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *CreateSeriesRequest - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetEventType() // Should return zero value - }) - - t.Run("GetStart", func(t *testing.T) { +func TestGettersCreateOauthAppRequest(t *testing.T) { + t.Run("GetProvider", func(t *testing.T) { t.Parallel() // Arrange - obj := &CreateSeriesRequest{} + obj := &CreateOauthAppRequest{} var expected string - obj.Start = expected + obj.Provider = expected // Act & Assert - assert.Equal(t, expected, obj.GetStart(), "getter should return the property value") + assert.Equal(t, expected, obj.GetProvider(), "getter should return the property value") }) - t.Run("GetStart_NilReceiver", func(t *testing.T) { + t.Run("GetProvider_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *CreateSeriesRequest + var obj *CreateOauthAppRequest // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetStart() // Should return zero value + _ = obj.GetProvider() // Should return zero value }) - t.Run("GetHost", func(t *testing.T) { + t.Run("GetGoogle", func(t *testing.T) { t.Parallel() // Arrange - obj := &CreateSeriesRequest{} - var expected *string - obj.Host = expected + obj := &CreateOauthAppRequest{} + var expected *CreateOauthAppRequestGoogle + obj.Google = expected // Act & Assert - assert.Equal(t, expected, obj.GetHost(), "getter should return the property value") + assert.Equal(t, expected, obj.GetGoogle(), "getter should return the property value") }) - t.Run("GetHost_NilValue", func(t *testing.T) { + t.Run("GetGoogle_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &CreateSeriesRequest{} - obj.Host = nil + obj := &CreateOauthAppRequest{} + obj.Google = nil // Act & Assert - assert.Nil(t, obj.GetHost(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetGoogle(), "getter should return nil when property is nil") }) - t.Run("GetHost_NilReceiver", func(t *testing.T) { + t.Run("GetGoogle_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *CreateSeriesRequest + var obj *CreateOauthAppRequest // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetHost() // Should return zero value + _ = obj.GetGoogle() // Should return zero value }) - t.Run("GetAttributes", func(t *testing.T) { + t.Run("GetMicrosoft", func(t *testing.T) { t.Parallel() // Arrange - obj := &CreateSeriesRequest{} - var expected map[string]*CreateSeriesRequestAttributesValue - obj.Attributes = expected + obj := &CreateOauthAppRequest{} + var expected *CreateOauthAppRequestMicrosoft + obj.Microsoft = expected // Act & Assert - assert.Equal(t, expected, obj.GetAttributes(), "getter should return the property value") + assert.Equal(t, expected, obj.GetMicrosoft(), "getter should return the property value") }) - t.Run("GetAttributes_NilValue", func(t *testing.T) { + t.Run("GetMicrosoft_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &CreateSeriesRequest{} - obj.Attributes = nil + obj := &CreateOauthAppRequest{} + obj.Microsoft = nil // Act & Assert - assert.Nil(t, obj.GetAttributes(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetMicrosoft(), "getter should return nil when property is nil") }) - t.Run("GetAttributes_NilReceiver", func(t *testing.T) { + t.Run("GetMicrosoft_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *CreateSeriesRequest + var obj *CreateOauthAppRequest // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetAttributes() // Should return zero value + _ = obj.GetMicrosoft() // Should return zero value }) - t.Run("GetDurationMinutes", func(t *testing.T) { + t.Run("GetZoom", func(t *testing.T) { t.Parallel() // Arrange - obj := &CreateSeriesRequest{} - var expected *int - obj.DurationMinutes = expected + obj := &CreateOauthAppRequest{} + var expected *CreateOauthAppRequestZoom + obj.Zoom = expected // Act & Assert - assert.Equal(t, expected, obj.GetDurationMinutes(), "getter should return the property value") + assert.Equal(t, expected, obj.GetZoom(), "getter should return the property value") }) - t.Run("GetDurationMinutes_NilValue", func(t *testing.T) { + t.Run("GetZoom_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &CreateSeriesRequest{} - obj.DurationMinutes = nil + obj := &CreateOauthAppRequest{} + obj.Zoom = nil // Act & Assert - assert.Nil(t, obj.GetDurationMinutes(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetZoom(), "getter should return nil when property is nil") }) - t.Run("GetDurationMinutes_NilReceiver", func(t *testing.T) { + t.Run("GetZoom_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *CreateSeriesRequest + var obj *CreateOauthAppRequest // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetDurationMinutes() // Should return zero value - }) - - t.Run("GetAttendee", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &CreateSeriesRequest{} - var expected *SchedulingAttendeeInput - obj.Attendee = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetAttendee(), "getter should return the property value") + _ = obj.GetZoom() // Should return zero value }) - t.Run("GetAttendee_NilValue", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &CreateSeriesRequest{} - obj.Attendee = nil +} - // Act & Assert - assert.Nil(t, obj.GetAttendee(), "getter should return nil when property is nil") +func TestSettersCreateOauthAppRequestGoogle(t *testing.T) { + t.Run("SetClientID", func(t *testing.T) { + obj := &CreateOauthAppRequestGoogle{} + var fernTestValueClientID string + obj.SetClientID(fernTestValueClientID) + assert.Equal(t, fernTestValueClientID, obj.ClientID) + assert.NotNil(t, obj.explicitFields) }) - t.Run("GetAttendee_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *CreateSeriesRequest - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetAttendee() // Should return zero value + t.Run("SetClientSecret", func(t *testing.T) { + obj := &CreateOauthAppRequestGoogle{} + var fernTestValueClientSecret string + obj.SetClientSecret(fernTestValueClientSecret) + assert.Equal(t, fernTestValueClientSecret, obj.ClientSecret) + assert.NotNil(t, obj.explicitFields) }) - t.Run("GetGuests", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &CreateSeriesRequest{} - var expected []*SchedulingGuestInput - obj.Guests = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetGuests(), "getter should return the property value") + t.Run("SetRedirectURI", func(t *testing.T) { + obj := &CreateOauthAppRequestGoogle{} + var fernTestValueRedirectURI *string + obj.SetRedirectURI(fernTestValueRedirectURI) + assert.Equal(t, fernTestValueRedirectURI, obj.RedirectURI) + assert.NotNil(t, obj.explicitFields) }) - t.Run("GetGuests_NilValue", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &CreateSeriesRequest{} - obj.Guests = nil - - // Act & Assert - assert.Nil(t, obj.GetGuests(), "getter should return nil when property is nil") + t.Run("SetCompletionURL", func(t *testing.T) { + obj := &CreateOauthAppRequestGoogle{} + var fernTestValueCompletionURL *string + obj.SetCompletionURL(fernTestValueCompletionURL) + assert.Equal(t, fernTestValueCompletionURL, obj.CompletionURL) + assert.NotNil(t, obj.explicitFields) }) - t.Run("GetGuests_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *CreateSeriesRequest - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetGuests() // Should return zero value + t.Run("SetSecretExpiresAt", func(t *testing.T) { + obj := &CreateOauthAppRequestGoogle{} + var fernTestValueSecretExpiresAt *time.Time + obj.SetSecretExpiresAt(fernTestValueSecretExpiresAt) + assert.Equal(t, fernTestValueSecretExpiresAt, obj.SecretExpiresAt) + assert.NotNil(t, obj.explicitFields) }) - t.Run("GetAnswers", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &CreateSeriesRequest{} - var expected map[string]*CreateSeriesRequestAnswersValue - obj.Answers = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetAnswers(), "getter should return the property value") - }) +} - t.Run("GetAnswers_NilValue", func(t *testing.T) { +func TestGettersCreateOauthAppRequestGoogle(t *testing.T) { + t.Run("GetClientID", func(t *testing.T) { t.Parallel() // Arrange - obj := &CreateSeriesRequest{} - obj.Answers = nil + obj := &CreateOauthAppRequestGoogle{} + var expected string + obj.ClientID = expected // Act & Assert - assert.Nil(t, obj.GetAnswers(), "getter should return nil when property is nil") + assert.Equal(t, expected, obj.GetClientID(), "getter should return the property value") }) - t.Run("GetAnswers_NilReceiver", func(t *testing.T) { + t.Run("GetClientID_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *CreateSeriesRequest + var obj *CreateOauthAppRequestGoogle // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetAnswers() // Should return zero value - }) - - t.Run("GetLocation", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &CreateSeriesRequest{} - var expected *CreateSeriesRequestLocation - obj.Location = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetLocation(), "getter should return the property value") + _ = obj.GetClientID() // Should return zero value }) - t.Run("GetLocation_NilValue", func(t *testing.T) { + t.Run("GetClientSecret", func(t *testing.T) { t.Parallel() // Arrange - obj := &CreateSeriesRequest{} - obj.Location = nil + obj := &CreateOauthAppRequestGoogle{} + var expected string + obj.ClientSecret = expected // Act & Assert - assert.Nil(t, obj.GetLocation(), "getter should return nil when property is nil") + assert.Equal(t, expected, obj.GetClientSecret(), "getter should return the property value") }) - t.Run("GetLocation_NilReceiver", func(t *testing.T) { + t.Run("GetClientSecret_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *CreateSeriesRequest + var obj *CreateOauthAppRequestGoogle // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetLocation() // Should return zero value + _ = obj.GetClientSecret() // Should return zero value }) - t.Run("GetMetadata", func(t *testing.T) { + t.Run("GetRedirectURI", func(t *testing.T) { t.Parallel() // Arrange - obj := &CreateSeriesRequest{} - var expected map[string]string - obj.Metadata = expected + obj := &CreateOauthAppRequestGoogle{} + var expected *string + obj.RedirectURI = expected // Act & Assert - assert.Equal(t, expected, obj.GetMetadata(), "getter should return the property value") + assert.Equal(t, expected, obj.GetRedirectURI(), "getter should return the property value") }) - t.Run("GetMetadata_NilValue", func(t *testing.T) { + t.Run("GetRedirectURI_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &CreateSeriesRequest{} - obj.Metadata = nil + obj := &CreateOauthAppRequestGoogle{} + obj.RedirectURI = nil // Act & Assert - assert.Nil(t, obj.GetMetadata(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetRedirectURI(), "getter should return nil when property is nil") }) - t.Run("GetMetadata_NilReceiver", func(t *testing.T) { + t.Run("GetRedirectURI_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *CreateSeriesRequest + var obj *CreateOauthAppRequestGoogle // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetMetadata() // Should return zero value + _ = obj.GetRedirectURI() // Should return zero value }) - t.Run("GetRecurrence", func(t *testing.T) { + t.Run("GetCompletionURL", func(t *testing.T) { t.Parallel() // Arrange - obj := &CreateSeriesRequest{} - var expected *CreateSeriesRequestRecurrence - obj.Recurrence = expected + obj := &CreateOauthAppRequestGoogle{} + var expected *string + obj.CompletionURL = expected // Act & Assert - assert.Equal(t, expected, obj.GetRecurrence(), "getter should return the property value") + assert.Equal(t, expected, obj.GetCompletionURL(), "getter should return the property value") }) - t.Run("GetRecurrence_NilValue", func(t *testing.T) { + t.Run("GetCompletionURL_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &CreateSeriesRequest{} - obj.Recurrence = nil + obj := &CreateOauthAppRequestGoogle{} + obj.CompletionURL = nil // Act & Assert - assert.Nil(t, obj.GetRecurrence(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetCompletionURL(), "getter should return nil when property is nil") }) - t.Run("GetRecurrence_NilReceiver", func(t *testing.T) { + t.Run("GetCompletionURL_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *CreateSeriesRequest + var obj *CreateOauthAppRequestGoogle // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetRecurrence() // Should return zero value + _ = obj.GetCompletionURL() // Should return zero value }) - t.Run("GetOnConflict", func(t *testing.T) { + t.Run("GetSecretExpiresAt", func(t *testing.T) { t.Parallel() // Arrange - obj := &CreateSeriesRequest{} - var expected *CreateSeriesRequestOnConflict - obj.OnConflict = expected + obj := &CreateOauthAppRequestGoogle{} + var expected *time.Time + obj.SecretExpiresAt = expected // Act & Assert - assert.Equal(t, expected, obj.GetOnConflict(), "getter should return the property value") + assert.Equal(t, expected, obj.GetSecretExpiresAt(), "getter should return the property value") }) - t.Run("GetOnConflict_NilValue", func(t *testing.T) { + t.Run("GetSecretExpiresAt_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &CreateSeriesRequest{} - obj.OnConflict = nil + obj := &CreateOauthAppRequestGoogle{} + obj.SecretExpiresAt = nil // Act & Assert - assert.Nil(t, obj.GetOnConflict(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetSecretExpiresAt(), "getter should return nil when property is nil") }) - t.Run("GetOnConflict_NilReceiver", func(t *testing.T) { + t.Run("GetSecretExpiresAt_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *CreateSeriesRequest + var obj *CreateOauthAppRequestGoogle // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetOnConflict() // Should return zero value + _ = obj.GetSecretExpiresAt() // Should return zero value }) } -func TestSettersMarkExplicitCreateSeriesRequest(t *testing.T) { - t.Run("SetEventType_MarksExplicit", func(t *testing.T) { +func TestSettersMarkExplicitCreateOauthAppRequestGoogle(t *testing.T) { + t.Run("SetClientID_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &CreateSeriesRequest{} - var fernTestValueEventType string + obj := &CreateOauthAppRequestGoogle{} + var fernTestValueClientID string // Act - obj.SetEventType(fernTestValueEventType) + obj.SetClientID(fernTestValueClientID) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -15578,14 +15416,14 @@ func TestSettersMarkExplicitCreateSeriesRequest(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetStart_MarksExplicit", func(t *testing.T) { + t.Run("SetClientSecret_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &CreateSeriesRequest{} - var fernTestValueStart string + obj := &CreateOauthAppRequestGoogle{} + var fernTestValueClientSecret string // Act - obj.SetStart(fernTestValueStart) + obj.SetClientSecret(fernTestValueClientSecret) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -15609,14 +15447,14 @@ func TestSettersMarkExplicitCreateSeriesRequest(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetHost_MarksExplicit", func(t *testing.T) { + t.Run("SetRedirectURI_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &CreateSeriesRequest{} - var fernTestValueHost *string + obj := &CreateOauthAppRequestGoogle{} + var fernTestValueRedirectURI *string // Act - obj.SetHost(fernTestValueHost) + obj.SetRedirectURI(fernTestValueRedirectURI) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -15640,14 +15478,14 @@ func TestSettersMarkExplicitCreateSeriesRequest(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetAttributes_MarksExplicit", func(t *testing.T) { + t.Run("SetCompletionURL_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &CreateSeriesRequest{} - var fernTestValueAttributes map[string]*CreateSeriesRequestAttributesValue + obj := &CreateOauthAppRequestGoogle{} + var fernTestValueCompletionURL *string // Act - obj.SetAttributes(fernTestValueAttributes) + obj.SetCompletionURL(fernTestValueCompletionURL) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -15671,14 +15509,14 @@ func TestSettersMarkExplicitCreateSeriesRequest(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetDurationMinutes_MarksExplicit", func(t *testing.T) { + t.Run("SetSecretExpiresAt_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &CreateSeriesRequest{} - var fernTestValueDurationMinutes *int + obj := &CreateOauthAppRequestGoogle{} + var fernTestValueSecretExpiresAt *time.Time // Act - obj.SetDurationMinutes(fernTestValueDurationMinutes) + obj.SetSecretExpiresAt(fernTestValueSecretExpiresAt) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -15702,45 +15540,249 @@ func TestSettersMarkExplicitCreateSeriesRequest(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetAttendee_MarksExplicit", func(t *testing.T) { +} + +func TestSettersCreateOauthAppRequestMicrosoft(t *testing.T) { + t.Run("SetClientID", func(t *testing.T) { + obj := &CreateOauthAppRequestMicrosoft{} + var fernTestValueClientID string + obj.SetClientID(fernTestValueClientID) + assert.Equal(t, fernTestValueClientID, obj.ClientID) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetClientSecret", func(t *testing.T) { + obj := &CreateOauthAppRequestMicrosoft{} + var fernTestValueClientSecret string + obj.SetClientSecret(fernTestValueClientSecret) + assert.Equal(t, fernTestValueClientSecret, obj.ClientSecret) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetTenantID", func(t *testing.T) { + obj := &CreateOauthAppRequestMicrosoft{} + var fernTestValueTenantID *string + obj.SetTenantID(fernTestValueTenantID) + assert.Equal(t, fernTestValueTenantID, obj.TenantID) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetRedirectURI", func(t *testing.T) { + obj := &CreateOauthAppRequestMicrosoft{} + var fernTestValueRedirectURI *string + obj.SetRedirectURI(fernTestValueRedirectURI) + assert.Equal(t, fernTestValueRedirectURI, obj.RedirectURI) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetCompletionURL", func(t *testing.T) { + obj := &CreateOauthAppRequestMicrosoft{} + var fernTestValueCompletionURL *string + obj.SetCompletionURL(fernTestValueCompletionURL) + assert.Equal(t, fernTestValueCompletionURL, obj.CompletionURL) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetSecretExpiresAt", func(t *testing.T) { + obj := &CreateOauthAppRequestMicrosoft{} + var fernTestValueSecretExpiresAt *time.Time + obj.SetSecretExpiresAt(fernTestValueSecretExpiresAt) + assert.Equal(t, fernTestValueSecretExpiresAt, obj.SecretExpiresAt) + assert.NotNil(t, obj.explicitFields) + }) + +} + +func TestGettersCreateOauthAppRequestMicrosoft(t *testing.T) { + t.Run("GetClientID", func(t *testing.T) { t.Parallel() // Arrange - obj := &CreateSeriesRequest{} - var fernTestValueAttendee *SchedulingAttendeeInput + obj := &CreateOauthAppRequestMicrosoft{} + var expected string + obj.ClientID = expected - // Act - obj.SetAttendee(fernTestValueAttendee) + // Act & Assert + assert.Equal(t, expected, obj.GetClientID(), "getter should return the property value") + }) - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") + t.Run("GetClientID_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *CreateOauthAppRequestMicrosoft + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetClientID() // Should return zero value + }) - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } + t.Run("GetClientSecret", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &CreateOauthAppRequestMicrosoft{} + var expected string + obj.ClientSecret = expected - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip + // Act & Assert + assert.Equal(t, expected, obj.GetClientSecret(), "getter should return the property value") }) - t.Run("SetGuests_MarksExplicit", func(t *testing.T) { + t.Run("GetClientSecret_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *CreateOauthAppRequestMicrosoft + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetClientSecret() // Should return zero value + }) + + t.Run("GetTenantID", func(t *testing.T) { t.Parallel() // Arrange - obj := &CreateSeriesRequest{} - var fernTestValueGuests []*SchedulingGuestInput + obj := &CreateOauthAppRequestMicrosoft{} + var expected *string + obj.TenantID = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetTenantID(), "getter should return the property value") + }) + + t.Run("GetTenantID_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &CreateOauthAppRequestMicrosoft{} + obj.TenantID = nil + + // Act & Assert + assert.Nil(t, obj.GetTenantID(), "getter should return nil when property is nil") + }) + + t.Run("GetTenantID_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *CreateOauthAppRequestMicrosoft + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetTenantID() // Should return zero value + }) + + t.Run("GetRedirectURI", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &CreateOauthAppRequestMicrosoft{} + var expected *string + obj.RedirectURI = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetRedirectURI(), "getter should return the property value") + }) + + t.Run("GetRedirectURI_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &CreateOauthAppRequestMicrosoft{} + obj.RedirectURI = nil + + // Act & Assert + assert.Nil(t, obj.GetRedirectURI(), "getter should return nil when property is nil") + }) + + t.Run("GetRedirectURI_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *CreateOauthAppRequestMicrosoft + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetRedirectURI() // Should return zero value + }) + + t.Run("GetCompletionURL", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &CreateOauthAppRequestMicrosoft{} + var expected *string + obj.CompletionURL = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetCompletionURL(), "getter should return the property value") + }) + + t.Run("GetCompletionURL_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &CreateOauthAppRequestMicrosoft{} + obj.CompletionURL = nil + + // Act & Assert + assert.Nil(t, obj.GetCompletionURL(), "getter should return nil when property is nil") + }) + + t.Run("GetCompletionURL_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *CreateOauthAppRequestMicrosoft + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetCompletionURL() // Should return zero value + }) + + t.Run("GetSecretExpiresAt", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &CreateOauthAppRequestMicrosoft{} + var expected *time.Time + obj.SecretExpiresAt = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetSecretExpiresAt(), "getter should return the property value") + }) + + t.Run("GetSecretExpiresAt_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &CreateOauthAppRequestMicrosoft{} + obj.SecretExpiresAt = nil + + // Act & Assert + assert.Nil(t, obj.GetSecretExpiresAt(), "getter should return nil when property is nil") + }) + + t.Run("GetSecretExpiresAt_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *CreateOauthAppRequestMicrosoft + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetSecretExpiresAt() // Should return zero value + }) + +} + +func TestSettersMarkExplicitCreateOauthAppRequestMicrosoft(t *testing.T) { + t.Run("SetClientID_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &CreateOauthAppRequestMicrosoft{} + var fernTestValueClientID string // Act - obj.SetGuests(fernTestValueGuests) + obj.SetClientID(fernTestValueClientID) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -15764,14 +15806,14 @@ func TestSettersMarkExplicitCreateSeriesRequest(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetAnswers_MarksExplicit", func(t *testing.T) { + t.Run("SetClientSecret_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &CreateSeriesRequest{} - var fernTestValueAnswers map[string]*CreateSeriesRequestAnswersValue + obj := &CreateOauthAppRequestMicrosoft{} + var fernTestValueClientSecret string // Act - obj.SetAnswers(fernTestValueAnswers) + obj.SetClientSecret(fernTestValueClientSecret) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -15795,14 +15837,14 @@ func TestSettersMarkExplicitCreateSeriesRequest(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetLocation_MarksExplicit", func(t *testing.T) { + t.Run("SetTenantID_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &CreateSeriesRequest{} - var fernTestValueLocation *CreateSeriesRequestLocation + obj := &CreateOauthAppRequestMicrosoft{} + var fernTestValueTenantID *string // Act - obj.SetLocation(fernTestValueLocation) + obj.SetTenantID(fernTestValueTenantID) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -15826,14 +15868,14 @@ func TestSettersMarkExplicitCreateSeriesRequest(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetMetadata_MarksExplicit", func(t *testing.T) { + t.Run("SetRedirectURI_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &CreateSeriesRequest{} - var fernTestValueMetadata map[string]string + obj := &CreateOauthAppRequestMicrosoft{} + var fernTestValueRedirectURI *string // Act - obj.SetMetadata(fernTestValueMetadata) + obj.SetRedirectURI(fernTestValueRedirectURI) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -15857,14 +15899,14 @@ func TestSettersMarkExplicitCreateSeriesRequest(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetRecurrence_MarksExplicit", func(t *testing.T) { + t.Run("SetCompletionURL_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &CreateSeriesRequest{} - var fernTestValueRecurrence *CreateSeriesRequestRecurrence + obj := &CreateOauthAppRequestMicrosoft{} + var fernTestValueCompletionURL *string // Act - obj.SetRecurrence(fernTestValueRecurrence) + obj.SetCompletionURL(fernTestValueCompletionURL) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -15888,14 +15930,14 @@ func TestSettersMarkExplicitCreateSeriesRequest(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetOnConflict_MarksExplicit", func(t *testing.T) { + t.Run("SetSecretExpiresAt_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &CreateSeriesRequest{} - var fernTestValueOnConflict *CreateSeriesRequestOnConflict + obj := &CreateOauthAppRequestMicrosoft{} + var fernTestValueSecretExpiresAt *time.Time // Act - obj.SetOnConflict(fernTestValueOnConflict) + obj.SetSecretExpiresAt(fernTestValueSecretExpiresAt) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -15921,404 +15963,278 @@ func TestSettersMarkExplicitCreateSeriesRequest(t *testing.T) { } -func TestGettersCreateSeriesRequestAnswersValue(t *testing.T) { - t.Run("GetString", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &CreateSeriesRequestAnswersValue{} - var expected string - obj.String = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetString(), "getter should return the property value") - }) - - t.Run("GetString_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *CreateSeriesRequestAnswersValue - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetString() // Should return zero value - }) - - t.Run("GetStringList", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &CreateSeriesRequestAnswersValue{} - var expected []string - obj.StringList = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetStringList(), "getter should return the property value") - }) - - t.Run("GetStringList_NilValue", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &CreateSeriesRequestAnswersValue{} - obj.StringList = nil - - // Act & Assert - assert.Nil(t, obj.GetStringList(), "getter should return nil when property is nil") - }) - - t.Run("GetStringList_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *CreateSeriesRequestAnswersValue - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetStringList() // Should return zero value +func TestSettersCreateOauthAppRequestZoom(t *testing.T) { + t.Run("SetClientID", func(t *testing.T) { + obj := &CreateOauthAppRequestZoom{} + var fernTestValueClientID string + obj.SetClientID(fernTestValueClientID) + assert.Equal(t, fernTestValueClientID, obj.ClientID) + assert.NotNil(t, obj.explicitFields) }) -} - -func TestGettersCreateSeriesRequestAttributesValue(t *testing.T) { - t.Run("GetString", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &CreateSeriesRequestAttributesValue{} - var expected string - obj.String = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetString(), "getter should return the property value") + t.Run("SetClientSecret", func(t *testing.T) { + obj := &CreateOauthAppRequestZoom{} + var fernTestValueClientSecret string + obj.SetClientSecret(fernTestValueClientSecret) + assert.Equal(t, fernTestValueClientSecret, obj.ClientSecret) + assert.NotNil(t, obj.explicitFields) }) - t.Run("GetString_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *CreateSeriesRequestAttributesValue - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetString() // Should return zero value + t.Run("SetWebhookSecret", func(t *testing.T) { + obj := &CreateOauthAppRequestZoom{} + var fernTestValueWebhookSecret *string + obj.SetWebhookSecret(fernTestValueWebhookSecret) + assert.Equal(t, fernTestValueWebhookSecret, obj.WebhookSecret) + assert.NotNil(t, obj.explicitFields) }) - t.Run("GetStringList", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &CreateSeriesRequestAttributesValue{} - var expected []string - obj.StringList = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetStringList(), "getter should return the property value") + t.Run("SetRedirectURI", func(t *testing.T) { + obj := &CreateOauthAppRequestZoom{} + var fernTestValueRedirectURI *string + obj.SetRedirectURI(fernTestValueRedirectURI) + assert.Equal(t, fernTestValueRedirectURI, obj.RedirectURI) + assert.NotNil(t, obj.explicitFields) }) - t.Run("GetStringList_NilValue", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &CreateSeriesRequestAttributesValue{} - obj.StringList = nil - - // Act & Assert - assert.Nil(t, obj.GetStringList(), "getter should return nil when property is nil") + t.Run("SetCompletionURL", func(t *testing.T) { + obj := &CreateOauthAppRequestZoom{} + var fernTestValueCompletionURL *string + obj.SetCompletionURL(fernTestValueCompletionURL) + assert.Equal(t, fernTestValueCompletionURL, obj.CompletionURL) + assert.NotNil(t, obj.explicitFields) }) - t.Run("GetStringList_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *CreateSeriesRequestAttributesValue - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetStringList() // Should return zero value + t.Run("SetSecretExpiresAt", func(t *testing.T) { + obj := &CreateOauthAppRequestZoom{} + var fernTestValueSecretExpiresAt *time.Time + obj.SetSecretExpiresAt(fernTestValueSecretExpiresAt) + assert.Equal(t, fernTestValueSecretExpiresAt, obj.SecretExpiresAt) + assert.NotNil(t, obj.explicitFields) }) } -func TestGettersCreateSeriesRequestLocation(t *testing.T) { - t.Run("GetType", func(t *testing.T) { +func TestGettersCreateOauthAppRequestZoom(t *testing.T) { + t.Run("GetClientID", func(t *testing.T) { t.Parallel() // Arrange - obj := &CreateSeriesRequestLocation{} + obj := &CreateOauthAppRequestZoom{} var expected string - obj.Type = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetType(), "getter should return the property value") - }) - - t.Run("GetType_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *CreateSeriesRequestLocation - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetType() // Should return zero value - }) - - t.Run("GetLink", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &CreateSeriesRequestLocation{} - var expected *CreateSeriesRequestLocationLink - obj.Link = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetLink(), "getter should return the property value") - }) - - t.Run("GetLink_NilValue", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &CreateSeriesRequestLocation{} - obj.Link = nil + obj.ClientID = expected // Act & Assert - assert.Nil(t, obj.GetLink(), "getter should return nil when property is nil") + assert.Equal(t, expected, obj.GetClientID(), "getter should return the property value") }) - t.Run("GetLink_NilReceiver", func(t *testing.T) { + t.Run("GetClientID_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *CreateSeriesRequestLocation + var obj *CreateOauthAppRequestZoom // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetLink() // Should return zero value - }) - - t.Run("GetPhone", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &CreateSeriesRequestLocation{} - var expected *CreateSeriesRequestLocationPhone - obj.Phone = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetPhone(), "getter should return the property value") + _ = obj.GetClientID() // Should return zero value }) - t.Run("GetPhone_NilValue", func(t *testing.T) { + t.Run("GetClientSecret", func(t *testing.T) { t.Parallel() // Arrange - obj := &CreateSeriesRequestLocation{} - obj.Phone = nil + obj := &CreateOauthAppRequestZoom{} + var expected string + obj.ClientSecret = expected // Act & Assert - assert.Nil(t, obj.GetPhone(), "getter should return nil when property is nil") + assert.Equal(t, expected, obj.GetClientSecret(), "getter should return the property value") }) - t.Run("GetPhone_NilReceiver", func(t *testing.T) { + t.Run("GetClientSecret_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *CreateSeriesRequestLocation + var obj *CreateOauthAppRequestZoom // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetPhone() // Should return zero value + _ = obj.GetClientSecret() // Should return zero value }) - t.Run("GetInPerson", func(t *testing.T) { + t.Run("GetWebhookSecret", func(t *testing.T) { t.Parallel() // Arrange - obj := &CreateSeriesRequestLocation{} - var expected *CreateSeriesRequestLocationInPerson - obj.InPerson = expected + obj := &CreateOauthAppRequestZoom{} + var expected *string + obj.WebhookSecret = expected // Act & Assert - assert.Equal(t, expected, obj.GetInPerson(), "getter should return the property value") + assert.Equal(t, expected, obj.GetWebhookSecret(), "getter should return the property value") }) - t.Run("GetInPerson_NilValue", func(t *testing.T) { + t.Run("GetWebhookSecret_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &CreateSeriesRequestLocation{} - obj.InPerson = nil + obj := &CreateOauthAppRequestZoom{} + obj.WebhookSecret = nil // Act & Assert - assert.Nil(t, obj.GetInPerson(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetWebhookSecret(), "getter should return nil when property is nil") }) - t.Run("GetInPerson_NilReceiver", func(t *testing.T) { + t.Run("GetWebhookSecret_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *CreateSeriesRequestLocation + var obj *CreateOauthAppRequestZoom // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetInPerson() // Should return zero value + _ = obj.GetWebhookSecret() // Should return zero value }) - t.Run("GetGoogleMeet", func(t *testing.T) { + t.Run("GetRedirectURI", func(t *testing.T) { t.Parallel() // Arrange - obj := &CreateSeriesRequestLocation{} - var expected *CreateSeriesRequestLocationGoogleMeet - obj.GoogleMeet = expected + obj := &CreateOauthAppRequestZoom{} + var expected *string + obj.RedirectURI = expected // Act & Assert - assert.Equal(t, expected, obj.GetGoogleMeet(), "getter should return the property value") + assert.Equal(t, expected, obj.GetRedirectURI(), "getter should return the property value") }) - t.Run("GetGoogleMeet_NilValue", func(t *testing.T) { + t.Run("GetRedirectURI_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &CreateSeriesRequestLocation{} - obj.GoogleMeet = nil + obj := &CreateOauthAppRequestZoom{} + obj.RedirectURI = nil // Act & Assert - assert.Nil(t, obj.GetGoogleMeet(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetRedirectURI(), "getter should return nil when property is nil") }) - t.Run("GetGoogleMeet_NilReceiver", func(t *testing.T) { + t.Run("GetRedirectURI_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *CreateSeriesRequestLocation + var obj *CreateOauthAppRequestZoom // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetGoogleMeet() // Should return zero value + _ = obj.GetRedirectURI() // Should return zero value }) - t.Run("GetMicrosoftTeams", func(t *testing.T) { + t.Run("GetCompletionURL", func(t *testing.T) { t.Parallel() // Arrange - obj := &CreateSeriesRequestLocation{} - var expected *CreateSeriesRequestLocationMicrosoftTeams - obj.MicrosoftTeams = expected + obj := &CreateOauthAppRequestZoom{} + var expected *string + obj.CompletionURL = expected // Act & Assert - assert.Equal(t, expected, obj.GetMicrosoftTeams(), "getter should return the property value") + assert.Equal(t, expected, obj.GetCompletionURL(), "getter should return the property value") }) - t.Run("GetMicrosoftTeams_NilValue", func(t *testing.T) { + t.Run("GetCompletionURL_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &CreateSeriesRequestLocation{} - obj.MicrosoftTeams = nil + obj := &CreateOauthAppRequestZoom{} + obj.CompletionURL = nil // Act & Assert - assert.Nil(t, obj.GetMicrosoftTeams(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetCompletionURL(), "getter should return nil when property is nil") }) - t.Run("GetMicrosoftTeams_NilReceiver", func(t *testing.T) { + t.Run("GetCompletionURL_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *CreateSeriesRequestLocation + var obj *CreateOauthAppRequestZoom // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetMicrosoftTeams() // Should return zero value + _ = obj.GetCompletionURL() // Should return zero value }) - t.Run("GetZoom", func(t *testing.T) { + t.Run("GetSecretExpiresAt", func(t *testing.T) { t.Parallel() // Arrange - obj := &CreateSeriesRequestLocation{} - var expected *CreateSeriesRequestLocationZoom - obj.Zoom = expected + obj := &CreateOauthAppRequestZoom{} + var expected *time.Time + obj.SecretExpiresAt = expected // Act & Assert - assert.Equal(t, expected, obj.GetZoom(), "getter should return the property value") + assert.Equal(t, expected, obj.GetSecretExpiresAt(), "getter should return the property value") }) - t.Run("GetZoom_NilValue", func(t *testing.T) { + t.Run("GetSecretExpiresAt_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &CreateSeriesRequestLocation{} - obj.Zoom = nil + obj := &CreateOauthAppRequestZoom{} + obj.SecretExpiresAt = nil // Act & Assert - assert.Nil(t, obj.GetZoom(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetSecretExpiresAt(), "getter should return nil when property is nil") }) - t.Run("GetZoom_NilReceiver", func(t *testing.T) { + t.Run("GetSecretExpiresAt_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *CreateSeriesRequestLocation + var obj *CreateOauthAppRequestZoom // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetZoom() // Should return zero value - }) - -} - -func TestSettersCreateSeriesRequestLocationInPerson(t *testing.T) { - t.Run("SetAddress", func(t *testing.T) { - obj := &CreateSeriesRequestLocationInPerson{} - var fernTestValueAddress *string - obj.SetAddress(fernTestValueAddress) - assert.Equal(t, fernTestValueAddress, obj.Address) - assert.NotNil(t, obj.explicitFields) + _ = obj.GetSecretExpiresAt() // Should return zero value }) } -func TestGettersCreateSeriesRequestLocationInPerson(t *testing.T) { - t.Run("GetAddress", func(t *testing.T) { +func TestSettersMarkExplicitCreateOauthAppRequestZoom(t *testing.T) { + t.Run("SetClientID_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &CreateSeriesRequestLocationInPerson{} - var expected *string - obj.Address = expected + obj := &CreateOauthAppRequestZoom{} + var fernTestValueClientID string - // Act & Assert - assert.Equal(t, expected, obj.GetAddress(), "getter should return the property value") - }) + // Act + obj.SetClientID(fernTestValueClientID) - t.Run("GetAddress_NilValue", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &CreateSeriesRequestLocationInPerson{} - obj.Address = nil + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") - // Act & Assert - assert.Nil(t, obj.GetAddress(), "getter should return nil when property is nil") - }) + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } - t.Run("GetAddress_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *CreateSeriesRequestLocationInPerson - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetAddress() // Should return zero value + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip }) -} - -func TestSettersMarkExplicitCreateSeriesRequestLocationInPerson(t *testing.T) { - t.Run("SetAddress_MarksExplicit", func(t *testing.T) { + t.Run("SetClientSecret_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &CreateSeriesRequestLocationInPerson{} - var fernTestValueAddress *string + obj := &CreateOauthAppRequestZoom{} + var fernTestValueClientSecret string // Act - obj.SetAddress(fernTestValueAddress) + obj.SetClientSecret(fernTestValueClientSecret) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -16342,64 +16258,45 @@ func TestSettersMarkExplicitCreateSeriesRequestLocationInPerson(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) -} - -func TestSettersCreateSeriesRequestLocationLink(t *testing.T) { - t.Run("SetURL", func(t *testing.T) { - obj := &CreateSeriesRequestLocationLink{} - var fernTestValueURL *string - obj.SetURL(fernTestValueURL) - assert.Equal(t, fernTestValueURL, obj.URL) - assert.NotNil(t, obj.explicitFields) - }) - -} - -func TestGettersCreateSeriesRequestLocationLink(t *testing.T) { - t.Run("GetURL", func(t *testing.T) { + t.Run("SetWebhookSecret_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &CreateSeriesRequestLocationLink{} - var expected *string - obj.URL = expected + obj := &CreateOauthAppRequestZoom{} + var fernTestValueWebhookSecret *string - // Act & Assert - assert.Equal(t, expected, obj.GetURL(), "getter should return the property value") - }) + // Act + obj.SetWebhookSecret(fernTestValueWebhookSecret) - t.Run("GetURL_NilValue", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &CreateSeriesRequestLocationLink{} - obj.URL = nil + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") - // Act & Assert - assert.Nil(t, obj.GetURL(), "getter should return nil when property is nil") - }) + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } - t.Run("GetURL_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *CreateSeriesRequestLocationLink - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetURL() // Should return zero value + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip }) -} - -func TestSettersMarkExplicitCreateSeriesRequestLocationLink(t *testing.T) { - t.Run("SetURL_MarksExplicit", func(t *testing.T) { + t.Run("SetRedirectURI_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &CreateSeriesRequestLocationLink{} - var fernTestValueURL *string + obj := &CreateOauthAppRequestZoom{} + var fernTestValueRedirectURI *string // Act - obj.SetURL(fernTestValueURL) + obj.SetRedirectURI(fernTestValueRedirectURI) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -16423,319 +16320,14 @@ func TestSettersMarkExplicitCreateSeriesRequestLocationLink(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) -} - -func TestSettersCreateSeriesRequestLocationPhone(t *testing.T) { - t.Run("SetNumber", func(t *testing.T) { - obj := &CreateSeriesRequestLocationPhone{} - var fernTestValueNumber *string - obj.SetNumber(fernTestValueNumber) - assert.Equal(t, fernTestValueNumber, obj.Number) - assert.NotNil(t, obj.explicitFields) - }) - -} - -func TestGettersCreateSeriesRequestLocationPhone(t *testing.T) { - t.Run("GetNumber", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &CreateSeriesRequestLocationPhone{} - var expected *string - obj.Number = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetNumber(), "getter should return the property value") - }) - - t.Run("GetNumber_NilValue", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &CreateSeriesRequestLocationPhone{} - obj.Number = nil - - // Act & Assert - assert.Nil(t, obj.GetNumber(), "getter should return nil when property is nil") - }) - - t.Run("GetNumber_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *CreateSeriesRequestLocationPhone - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetNumber() // Should return zero value - }) - -} - -func TestSettersMarkExplicitCreateSeriesRequestLocationPhone(t *testing.T) { - t.Run("SetNumber_MarksExplicit", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &CreateSeriesRequestLocationPhone{} - var fernTestValueNumber *string - - // Act - obj.SetNumber(fernTestValueNumber) - - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") - - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } - - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip - }) - -} - -func TestSettersCreateSeriesRequestLocationZoom(t *testing.T) { - t.Run("SetURL", func(t *testing.T) { - obj := &CreateSeriesRequestLocationZoom{} - var fernTestValueURL *string - obj.SetURL(fernTestValueURL) - assert.Equal(t, fernTestValueURL, obj.URL) - assert.NotNil(t, obj.explicitFields) - }) - -} - -func TestGettersCreateSeriesRequestLocationZoom(t *testing.T) { - t.Run("GetURL", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &CreateSeriesRequestLocationZoom{} - var expected *string - obj.URL = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetURL(), "getter should return the property value") - }) - - t.Run("GetURL_NilValue", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &CreateSeriesRequestLocationZoom{} - obj.URL = nil - - // Act & Assert - assert.Nil(t, obj.GetURL(), "getter should return nil when property is nil") - }) - - t.Run("GetURL_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *CreateSeriesRequestLocationZoom - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetURL() // Should return zero value - }) - -} - -func TestSettersMarkExplicitCreateSeriesRequestLocationZoom(t *testing.T) { - t.Run("SetURL_MarksExplicit", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &CreateSeriesRequestLocationZoom{} - var fernTestValueURL *string - - // Act - obj.SetURL(fernTestValueURL) - - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") - - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } - - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip - }) - -} - -func TestSettersCreateSeriesRequestRecurrence(t *testing.T) { - t.Run("SetFrequency", func(t *testing.T) { - obj := &CreateSeriesRequestRecurrence{} - var fernTestValueFrequency CreateSeriesRequestRecurrenceFrequency - obj.SetFrequency(fernTestValueFrequency) - assert.Equal(t, fernTestValueFrequency, obj.Frequency) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetInterval", func(t *testing.T) { - obj := &CreateSeriesRequestRecurrence{} - var fernTestValueInterval *int - obj.SetInterval(fernTestValueInterval) - assert.Equal(t, fernTestValueInterval, obj.Interval) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetCount", func(t *testing.T) { - obj := &CreateSeriesRequestRecurrence{} - var fernTestValueCount int - obj.SetCount(fernTestValueCount) - assert.Equal(t, fernTestValueCount, obj.Count) - assert.NotNil(t, obj.explicitFields) - }) - -} - -func TestGettersCreateSeriesRequestRecurrence(t *testing.T) { - t.Run("GetFrequency", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &CreateSeriesRequestRecurrence{} - var expected CreateSeriesRequestRecurrenceFrequency - obj.Frequency = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetFrequency(), "getter should return the property value") - }) - - t.Run("GetFrequency_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *CreateSeriesRequestRecurrence - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetFrequency() // Should return zero value - }) - - t.Run("GetInterval", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &CreateSeriesRequestRecurrence{} - var expected *int - obj.Interval = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetInterval(), "getter should return the property value") - }) - - t.Run("GetInterval_NilValue", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &CreateSeriesRequestRecurrence{} - obj.Interval = nil - - // Act & Assert - assert.Nil(t, obj.GetInterval(), "getter should return nil when property is nil") - }) - - t.Run("GetInterval_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *CreateSeriesRequestRecurrence - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetInterval() // Should return zero value - }) - - t.Run("GetCount", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &CreateSeriesRequestRecurrence{} - var expected int - obj.Count = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetCount(), "getter should return the property value") - }) - - t.Run("GetCount_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *CreateSeriesRequestRecurrence - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetCount() // Should return zero value - }) - -} - -func TestSettersMarkExplicitCreateSeriesRequestRecurrence(t *testing.T) { - t.Run("SetFrequency_MarksExplicit", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &CreateSeriesRequestRecurrence{} - var fernTestValueFrequency CreateSeriesRequestRecurrenceFrequency - - // Act - obj.SetFrequency(fernTestValueFrequency) - - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") - - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } - - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip - }) - - t.Run("SetInterval_MarksExplicit", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &CreateSeriesRequestRecurrence{} - var fernTestValueInterval *int + t.Run("SetCompletionURL_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &CreateOauthAppRequestZoom{} + var fernTestValueCompletionURL *string // Act - obj.SetInterval(fernTestValueInterval) + obj.SetCompletionURL(fernTestValueCompletionURL) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -16759,14 +16351,14 @@ func TestSettersMarkExplicitCreateSeriesRequestRecurrence(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetCount_MarksExplicit", func(t *testing.T) { + t.Run("SetSecretExpiresAt_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &CreateSeriesRequestRecurrence{} - var fernTestValueCount int + obj := &CreateOauthAppRequestZoom{} + var fernTestValueSecretExpiresAt *time.Time // Act - obj.SetCount(fernTestValueCount) + obj.SetSecretExpiresAt(fernTestValueSecretExpiresAt) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -16792,495 +16384,493 @@ func TestSettersMarkExplicitCreateSeriesRequestRecurrence(t *testing.T) { } -func TestSettersCredit(t *testing.T) { - t.Run("SetObject", func(t *testing.T) { - obj := &Credit{} - var fernTestValueObject CreditObject - obj.SetObject(fernTestValueObject) - assert.Equal(t, fernTestValueObject, obj.Object) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetID", func(t *testing.T) { - obj := &Credit{} - var fernTestValueID string - obj.SetID(fernTestValueID) - assert.Equal(t, fernTestValueID, obj.ID) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetKind", func(t *testing.T) { - obj := &Credit{} - var fernTestValueKind CreditKind - obj.SetKind(fernTestValueKind) - assert.Equal(t, fernTestValueKind, obj.Kind) +func TestSettersCreateSeriesRequest(t *testing.T) { + t.Run("SetEventType", func(t *testing.T) { + obj := &CreateSeriesRequest{} + var fernTestValueEventType string + obj.SetEventType(fernTestValueEventType) + assert.Equal(t, fernTestValueEventType, obj.EventType) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetAmount", func(t *testing.T) { - obj := &Credit{} - var fernTestValueAmount int64 - obj.SetAmount(fernTestValueAmount) - assert.Equal(t, fernTestValueAmount, obj.Amount) + t.Run("SetStart", func(t *testing.T) { + obj := &CreateSeriesRequest{} + var fernTestValueStart string + obj.SetStart(fernTestValueStart) + assert.Equal(t, fernTestValueStart, obj.Start) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetRemaining", func(t *testing.T) { - obj := &Credit{} - var fernTestValueRemaining int64 - obj.SetRemaining(fernTestValueRemaining) - assert.Equal(t, fernTestValueRemaining, obj.Remaining) + t.Run("SetHost", func(t *testing.T) { + obj := &CreateSeriesRequest{} + var fernTestValueHost *string + obj.SetHost(fernTestValueHost) + assert.Equal(t, fernTestValueHost, obj.Host) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetMeter", func(t *testing.T) { - obj := &Credit{} - var fernTestValueMeter *CreditMeter - obj.SetMeter(fernTestValueMeter) - assert.Equal(t, fernTestValueMeter, obj.Meter) + t.Run("SetAttributes", func(t *testing.T) { + obj := &CreateSeriesRequest{} + var fernTestValueAttributes map[string]*CreateSeriesRequestAttributesValue + obj.SetAttributes(fernTestValueAttributes) + assert.Equal(t, fernTestValueAttributes, obj.Attributes) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetMeters", func(t *testing.T) { - obj := &Credit{} - var fernTestValueMeters []CreditMetersItem - obj.SetMeters(fernTestValueMeters) - assert.Equal(t, fernTestValueMeters, obj.Meters) + t.Run("SetDurationMinutes", func(t *testing.T) { + obj := &CreateSeriesRequest{} + var fernTestValueDurationMinutes *int + obj.SetDurationMinutes(fernTestValueDurationMinutes) + assert.Equal(t, fernTestValueDurationMinutes, obj.DurationMinutes) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetAppliesTo", func(t *testing.T) { - obj := &Credit{} - var fernTestValueAppliesTo CreditAppliesTo - obj.SetAppliesTo(fernTestValueAppliesTo) - assert.Equal(t, fernTestValueAppliesTo, obj.AppliesTo) + t.Run("SetAttendee", func(t *testing.T) { + obj := &CreateSeriesRequest{} + var fernTestValueAttendee *SchedulingAttendeeInput + obj.SetAttendee(fernTestValueAttendee) + assert.Equal(t, fernTestValueAttendee, obj.Attendee) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetSource", func(t *testing.T) { - obj := &Credit{} - var fernTestValueSource CreditSource - obj.SetSource(fernTestValueSource) - assert.Equal(t, fernTestValueSource, obj.Source) + t.Run("SetGuests", func(t *testing.T) { + obj := &CreateSeriesRequest{} + var fernTestValueGuests []*SchedulingGuestInput + obj.SetGuests(fernTestValueGuests) + assert.Equal(t, fernTestValueGuests, obj.Guests) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetDescription", func(t *testing.T) { - obj := &Credit{} - var fernTestValueDescription string - obj.SetDescription(fernTestValueDescription) - assert.Equal(t, fernTestValueDescription, obj.Description) + t.Run("SetAnswers", func(t *testing.T) { + obj := &CreateSeriesRequest{} + var fernTestValueAnswers map[string]*CreateSeriesRequestAnswersValue + obj.SetAnswers(fernTestValueAnswers) + assert.Equal(t, fernTestValueAnswers, obj.Answers) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetEffectiveAt", func(t *testing.T) { - obj := &Credit{} - var fernTestValueEffectiveAt time.Time - obj.SetEffectiveAt(fernTestValueEffectiveAt) - assert.Equal(t, fernTestValueEffectiveAt, obj.EffectiveAt) + t.Run("SetLocation", func(t *testing.T) { + obj := &CreateSeriesRequest{} + var fernTestValueLocation *CreateSeriesRequestLocation + obj.SetLocation(fernTestValueLocation) + assert.Equal(t, fernTestValueLocation, obj.Location) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetExpiresAt", func(t *testing.T) { - obj := &Credit{} - var fernTestValueExpiresAt *time.Time - obj.SetExpiresAt(fernTestValueExpiresAt) - assert.Equal(t, fernTestValueExpiresAt, obj.ExpiresAt) + t.Run("SetMetadata", func(t *testing.T) { + obj := &CreateSeriesRequest{} + var fernTestValueMetadata map[string]string + obj.SetMetadata(fernTestValueMetadata) + assert.Equal(t, fernTestValueMetadata, obj.Metadata) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetVoidedAt", func(t *testing.T) { - obj := &Credit{} - var fernTestValueVoidedAt *time.Time - obj.SetVoidedAt(fernTestValueVoidedAt) - assert.Equal(t, fernTestValueVoidedAt, obj.VoidedAt) + t.Run("SetRecurrence", func(t *testing.T) { + obj := &CreateSeriesRequest{} + var fernTestValueRecurrence *CreateSeriesRequestRecurrence + obj.SetRecurrence(fernTestValueRecurrence) + assert.Equal(t, fernTestValueRecurrence, obj.Recurrence) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetCreatedAt", func(t *testing.T) { - obj := &Credit{} - var fernTestValueCreatedAt time.Time - obj.SetCreatedAt(fernTestValueCreatedAt) - assert.Equal(t, fernTestValueCreatedAt, obj.CreatedAt) + t.Run("SetOnConflict", func(t *testing.T) { + obj := &CreateSeriesRequest{} + var fernTestValueOnConflict *CreateSeriesRequestOnConflict + obj.SetOnConflict(fernTestValueOnConflict) + assert.Equal(t, fernTestValueOnConflict, obj.OnConflict) assert.NotNil(t, obj.explicitFields) }) } -func TestGettersCredit(t *testing.T) { - t.Run("GetObject", func(t *testing.T) { +func TestGettersCreateSeriesRequest(t *testing.T) { + t.Run("GetEventType", func(t *testing.T) { t.Parallel() // Arrange - obj := &Credit{} - var expected CreditObject - obj.Object = expected + obj := &CreateSeriesRequest{} + var expected string + obj.EventType = expected // Act & Assert - assert.Equal(t, expected, obj.GetObject(), "getter should return the property value") + assert.Equal(t, expected, obj.GetEventType(), "getter should return the property value") }) - t.Run("GetObject_NilReceiver", func(t *testing.T) { + t.Run("GetEventType_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *Credit + var obj *CreateSeriesRequest // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetObject() // Should return zero value + _ = obj.GetEventType() // Should return zero value }) - t.Run("GetID", func(t *testing.T) { + t.Run("GetStart", func(t *testing.T) { t.Parallel() // Arrange - obj := &Credit{} + obj := &CreateSeriesRequest{} var expected string - obj.ID = expected + obj.Start = expected // Act & Assert - assert.Equal(t, expected, obj.GetID(), "getter should return the property value") + assert.Equal(t, expected, obj.GetStart(), "getter should return the property value") }) - t.Run("GetID_NilReceiver", func(t *testing.T) { + t.Run("GetStart_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *Credit + var obj *CreateSeriesRequest // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetID() // Should return zero value + _ = obj.GetStart() // Should return zero value }) - t.Run("GetKind", func(t *testing.T) { + t.Run("GetHost", func(t *testing.T) { t.Parallel() // Arrange - obj := &Credit{} - var expected CreditKind - obj.Kind = expected + obj := &CreateSeriesRequest{} + var expected *string + obj.Host = expected // Act & Assert - assert.Equal(t, expected, obj.GetKind(), "getter should return the property value") - }) - - t.Run("GetKind_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *Credit - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetKind() // Should return zero value + assert.Equal(t, expected, obj.GetHost(), "getter should return the property value") }) - t.Run("GetAmount", func(t *testing.T) { + t.Run("GetHost_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &Credit{} - var expected int64 - obj.Amount = expected + obj := &CreateSeriesRequest{} + obj.Host = nil // Act & Assert - assert.Equal(t, expected, obj.GetAmount(), "getter should return the property value") + assert.Nil(t, obj.GetHost(), "getter should return nil when property is nil") }) - t.Run("GetAmount_NilReceiver", func(t *testing.T) { + t.Run("GetHost_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *Credit + var obj *CreateSeriesRequest // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetAmount() // Should return zero value + _ = obj.GetHost() // Should return zero value }) - t.Run("GetRemaining", func(t *testing.T) { + t.Run("GetAttributes", func(t *testing.T) { t.Parallel() // Arrange - obj := &Credit{} - var expected int64 - obj.Remaining = expected + obj := &CreateSeriesRequest{} + var expected map[string]*CreateSeriesRequestAttributesValue + obj.Attributes = expected // Act & Assert - assert.Equal(t, expected, obj.GetRemaining(), "getter should return the property value") + assert.Equal(t, expected, obj.GetAttributes(), "getter should return the property value") }) - t.Run("GetRemaining_NilReceiver", func(t *testing.T) { + t.Run("GetAttributes_NilValue", func(t *testing.T) { t.Parallel() - var obj *Credit + // Arrange + obj := &CreateSeriesRequest{} + obj.Attributes = nil + + // Act & Assert + assert.Nil(t, obj.GetAttributes(), "getter should return nil when property is nil") + }) + + t.Run("GetAttributes_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *CreateSeriesRequest // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetRemaining() // Should return zero value + _ = obj.GetAttributes() // Should return zero value }) - t.Run("GetMeter", func(t *testing.T) { + t.Run("GetDurationMinutes", func(t *testing.T) { t.Parallel() // Arrange - obj := &Credit{} - var expected *CreditMeter - obj.Meter = expected + obj := &CreateSeriesRequest{} + var expected *int + obj.DurationMinutes = expected // Act & Assert - assert.Equal(t, expected, obj.GetMeter(), "getter should return the property value") + assert.Equal(t, expected, obj.GetDurationMinutes(), "getter should return the property value") }) - t.Run("GetMeter_NilValue", func(t *testing.T) { + t.Run("GetDurationMinutes_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &Credit{} - obj.Meter = nil + obj := &CreateSeriesRequest{} + obj.DurationMinutes = nil // Act & Assert - assert.Nil(t, obj.GetMeter(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetDurationMinutes(), "getter should return nil when property is nil") }) - t.Run("GetMeter_NilReceiver", func(t *testing.T) { + t.Run("GetDurationMinutes_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *Credit + var obj *CreateSeriesRequest // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetMeter() // Should return zero value + _ = obj.GetDurationMinutes() // Should return zero value }) - t.Run("GetMeters", func(t *testing.T) { + t.Run("GetAttendee", func(t *testing.T) { t.Parallel() // Arrange - obj := &Credit{} - var expected []CreditMetersItem - obj.Meters = expected + obj := &CreateSeriesRequest{} + var expected *SchedulingAttendeeInput + obj.Attendee = expected // Act & Assert - assert.Equal(t, expected, obj.GetMeters(), "getter should return the property value") + assert.Equal(t, expected, obj.GetAttendee(), "getter should return the property value") }) - t.Run("GetMeters_NilValue", func(t *testing.T) { + t.Run("GetAttendee_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &Credit{} - obj.Meters = nil + obj := &CreateSeriesRequest{} + obj.Attendee = nil // Act & Assert - assert.Nil(t, obj.GetMeters(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetAttendee(), "getter should return nil when property is nil") }) - t.Run("GetMeters_NilReceiver", func(t *testing.T) { + t.Run("GetAttendee_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *Credit + var obj *CreateSeriesRequest // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetMeters() // Should return zero value + _ = obj.GetAttendee() // Should return zero value }) - t.Run("GetAppliesTo", func(t *testing.T) { + t.Run("GetGuests", func(t *testing.T) { t.Parallel() // Arrange - obj := &Credit{} - var expected CreditAppliesTo - obj.AppliesTo = expected + obj := &CreateSeriesRequest{} + var expected []*SchedulingGuestInput + obj.Guests = expected // Act & Assert - assert.Equal(t, expected, obj.GetAppliesTo(), "getter should return the property value") - }) - - t.Run("GetAppliesTo_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *Credit - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetAppliesTo() // Should return zero value + assert.Equal(t, expected, obj.GetGuests(), "getter should return the property value") }) - t.Run("GetSource", func(t *testing.T) { + t.Run("GetGuests_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &Credit{} - var expected CreditSource - obj.Source = expected + obj := &CreateSeriesRequest{} + obj.Guests = nil // Act & Assert - assert.Equal(t, expected, obj.GetSource(), "getter should return the property value") + assert.Nil(t, obj.GetGuests(), "getter should return nil when property is nil") }) - t.Run("GetSource_NilReceiver", func(t *testing.T) { + t.Run("GetGuests_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *Credit + var obj *CreateSeriesRequest // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetSource() // Should return zero value + _ = obj.GetGuests() // Should return zero value }) - t.Run("GetDescription", func(t *testing.T) { + t.Run("GetAnswers", func(t *testing.T) { t.Parallel() // Arrange - obj := &Credit{} - var expected string - obj.Description = expected + obj := &CreateSeriesRequest{} + var expected map[string]*CreateSeriesRequestAnswersValue + obj.Answers = expected // Act & Assert - assert.Equal(t, expected, obj.GetDescription(), "getter should return the property value") + assert.Equal(t, expected, obj.GetAnswers(), "getter should return the property value") }) - t.Run("GetDescription_NilReceiver", func(t *testing.T) { + t.Run("GetAnswers_NilValue", func(t *testing.T) { t.Parallel() - var obj *Credit + // Arrange + obj := &CreateSeriesRequest{} + obj.Answers = nil + + // Act & Assert + assert.Nil(t, obj.GetAnswers(), "getter should return nil when property is nil") + }) + + t.Run("GetAnswers_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *CreateSeriesRequest // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetDescription() // Should return zero value + _ = obj.GetAnswers() // Should return zero value }) - t.Run("GetEffectiveAt", func(t *testing.T) { + t.Run("GetLocation", func(t *testing.T) { t.Parallel() // Arrange - obj := &Credit{} - var expected time.Time - obj.EffectiveAt = expected + obj := &CreateSeriesRequest{} + var expected *CreateSeriesRequestLocation + obj.Location = expected // Act & Assert - assert.Equal(t, expected, obj.GetEffectiveAt(), "getter should return the property value") + assert.Equal(t, expected, obj.GetLocation(), "getter should return the property value") }) - t.Run("GetEffectiveAt_NilReceiver", func(t *testing.T) { + t.Run("GetLocation_NilValue", func(t *testing.T) { t.Parallel() - var obj *Credit + // Arrange + obj := &CreateSeriesRequest{} + obj.Location = nil + + // Act & Assert + assert.Nil(t, obj.GetLocation(), "getter should return nil when property is nil") + }) + + t.Run("GetLocation_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *CreateSeriesRequest // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetEffectiveAt() // Should return zero value + _ = obj.GetLocation() // Should return zero value }) - t.Run("GetExpiresAt", func(t *testing.T) { + t.Run("GetMetadata", func(t *testing.T) { t.Parallel() // Arrange - obj := &Credit{} - var expected *time.Time - obj.ExpiresAt = expected + obj := &CreateSeriesRequest{} + var expected map[string]string + obj.Metadata = expected // Act & Assert - assert.Equal(t, expected, obj.GetExpiresAt(), "getter should return the property value") + assert.Equal(t, expected, obj.GetMetadata(), "getter should return the property value") }) - t.Run("GetExpiresAt_NilValue", func(t *testing.T) { + t.Run("GetMetadata_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &Credit{} - obj.ExpiresAt = nil + obj := &CreateSeriesRequest{} + obj.Metadata = nil // Act & Assert - assert.Nil(t, obj.GetExpiresAt(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetMetadata(), "getter should return nil when property is nil") }) - t.Run("GetExpiresAt_NilReceiver", func(t *testing.T) { + t.Run("GetMetadata_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *Credit + var obj *CreateSeriesRequest // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetExpiresAt() // Should return zero value + _ = obj.GetMetadata() // Should return zero value }) - t.Run("GetVoidedAt", func(t *testing.T) { + t.Run("GetRecurrence", func(t *testing.T) { t.Parallel() // Arrange - obj := &Credit{} - var expected *time.Time - obj.VoidedAt = expected + obj := &CreateSeriesRequest{} + var expected *CreateSeriesRequestRecurrence + obj.Recurrence = expected // Act & Assert - assert.Equal(t, expected, obj.GetVoidedAt(), "getter should return the property value") + assert.Equal(t, expected, obj.GetRecurrence(), "getter should return the property value") }) - t.Run("GetVoidedAt_NilValue", func(t *testing.T) { + t.Run("GetRecurrence_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &Credit{} - obj.VoidedAt = nil + obj := &CreateSeriesRequest{} + obj.Recurrence = nil // Act & Assert - assert.Nil(t, obj.GetVoidedAt(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetRecurrence(), "getter should return nil when property is nil") }) - t.Run("GetVoidedAt_NilReceiver", func(t *testing.T) { + t.Run("GetRecurrence_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *Credit + var obj *CreateSeriesRequest // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetVoidedAt() // Should return zero value + _ = obj.GetRecurrence() // Should return zero value }) - t.Run("GetCreatedAt", func(t *testing.T) { + t.Run("GetOnConflict", func(t *testing.T) { t.Parallel() // Arrange - obj := &Credit{} - var expected time.Time - obj.CreatedAt = expected + obj := &CreateSeriesRequest{} + var expected *CreateSeriesRequestOnConflict + obj.OnConflict = expected // Act & Assert - assert.Equal(t, expected, obj.GetCreatedAt(), "getter should return the property value") + assert.Equal(t, expected, obj.GetOnConflict(), "getter should return the property value") }) - t.Run("GetCreatedAt_NilReceiver", func(t *testing.T) { + t.Run("GetOnConflict_NilValue", func(t *testing.T) { t.Parallel() - var obj *Credit + // Arrange + obj := &CreateSeriesRequest{} + obj.OnConflict = nil + + // Act & Assert + assert.Nil(t, obj.GetOnConflict(), "getter should return nil when property is nil") + }) + + t.Run("GetOnConflict_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *CreateSeriesRequest // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetCreatedAt() // Should return zero value + _ = obj.GetOnConflict() // Should return zero value }) } -func TestSettersMarkExplicitCredit(t *testing.T) { - t.Run("SetObject_MarksExplicit", func(t *testing.T) { +func TestSettersMarkExplicitCreateSeriesRequest(t *testing.T) { + t.Run("SetEventType_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &Credit{} - var fernTestValueObject CreditObject + obj := &CreateSeriesRequest{} + var fernTestValueEventType string // Act - obj.SetObject(fernTestValueObject) + obj.SetEventType(fernTestValueEventType) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -17304,14 +16894,14 @@ func TestSettersMarkExplicitCredit(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetID_MarksExplicit", func(t *testing.T) { + t.Run("SetStart_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &Credit{} - var fernTestValueID string + obj := &CreateSeriesRequest{} + var fernTestValueStart string // Act - obj.SetID(fernTestValueID) + obj.SetStart(fernTestValueStart) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -17335,14 +16925,14 @@ func TestSettersMarkExplicitCredit(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetKind_MarksExplicit", func(t *testing.T) { + t.Run("SetHost_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &Credit{} - var fernTestValueKind CreditKind + obj := &CreateSeriesRequest{} + var fernTestValueHost *string // Act - obj.SetKind(fernTestValueKind) + obj.SetHost(fernTestValueHost) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -17366,14 +16956,14 @@ func TestSettersMarkExplicitCredit(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetAmount_MarksExplicit", func(t *testing.T) { + t.Run("SetAttributes_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &Credit{} - var fernTestValueAmount int64 + obj := &CreateSeriesRequest{} + var fernTestValueAttributes map[string]*CreateSeriesRequestAttributesValue // Act - obj.SetAmount(fernTestValueAmount) + obj.SetAttributes(fernTestValueAttributes) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -17397,14 +16987,14 @@ func TestSettersMarkExplicitCredit(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetRemaining_MarksExplicit", func(t *testing.T) { + t.Run("SetDurationMinutes_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &Credit{} - var fernTestValueRemaining int64 + obj := &CreateSeriesRequest{} + var fernTestValueDurationMinutes *int // Act - obj.SetRemaining(fernTestValueRemaining) + obj.SetDurationMinutes(fernTestValueDurationMinutes) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -17428,14 +17018,14 @@ func TestSettersMarkExplicitCredit(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetMeter_MarksExplicit", func(t *testing.T) { + t.Run("SetAttendee_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &Credit{} - var fernTestValueMeter *CreditMeter + obj := &CreateSeriesRequest{} + var fernTestValueAttendee *SchedulingAttendeeInput // Act - obj.SetMeter(fernTestValueMeter) + obj.SetAttendee(fernTestValueAttendee) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -17459,14 +17049,14 @@ func TestSettersMarkExplicitCredit(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetMeters_MarksExplicit", func(t *testing.T) { + t.Run("SetGuests_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &Credit{} - var fernTestValueMeters []CreditMetersItem + obj := &CreateSeriesRequest{} + var fernTestValueGuests []*SchedulingGuestInput // Act - obj.SetMeters(fernTestValueMeters) + obj.SetGuests(fernTestValueGuests) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -17490,14 +17080,14 @@ func TestSettersMarkExplicitCredit(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetAppliesTo_MarksExplicit", func(t *testing.T) { + t.Run("SetAnswers_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &Credit{} - var fernTestValueAppliesTo CreditAppliesTo + obj := &CreateSeriesRequest{} + var fernTestValueAnswers map[string]*CreateSeriesRequestAnswersValue // Act - obj.SetAppliesTo(fernTestValueAppliesTo) + obj.SetAnswers(fernTestValueAnswers) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -17521,14 +17111,14 @@ func TestSettersMarkExplicitCredit(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetSource_MarksExplicit", func(t *testing.T) { + t.Run("SetLocation_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &Credit{} - var fernTestValueSource CreditSource + obj := &CreateSeriesRequest{} + var fernTestValueLocation *CreateSeriesRequestLocation // Act - obj.SetSource(fernTestValueSource) + obj.SetLocation(fernTestValueLocation) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -17552,14 +17142,14 @@ func TestSettersMarkExplicitCredit(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetDescription_MarksExplicit", func(t *testing.T) { + t.Run("SetMetadata_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &Credit{} - var fernTestValueDescription string + obj := &CreateSeriesRequest{} + var fernTestValueMetadata map[string]string // Act - obj.SetDescription(fernTestValueDescription) + obj.SetMetadata(fernTestValueMetadata) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -17583,14 +17173,14 @@ func TestSettersMarkExplicitCredit(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetEffectiveAt_MarksExplicit", func(t *testing.T) { + t.Run("SetRecurrence_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &Credit{} - var fernTestValueEffectiveAt time.Time + obj := &CreateSeriesRequest{} + var fernTestValueRecurrence *CreateSeriesRequestRecurrence // Act - obj.SetEffectiveAt(fernTestValueEffectiveAt) + obj.SetRecurrence(fernTestValueRecurrence) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -17614,14 +17204,14 @@ func TestSettersMarkExplicitCredit(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetExpiresAt_MarksExplicit", func(t *testing.T) { + t.Run("SetOnConflict_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &Credit{} - var fernTestValueExpiresAt *time.Time + obj := &CreateSeriesRequest{} + var fernTestValueOnConflict *CreateSeriesRequestOnConflict // Act - obj.SetExpiresAt(fernTestValueExpiresAt) + obj.SetOnConflict(fernTestValueOnConflict) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -17645,557 +17235,406 @@ func TestSettersMarkExplicitCredit(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetVoidedAt_MarksExplicit", func(t *testing.T) { +} + +func TestGettersCreateSeriesRequestAnswersValue(t *testing.T) { + t.Run("GetString", func(t *testing.T) { t.Parallel() // Arrange - obj := &Credit{} - var fernTestValueVoidedAt *time.Time - - // Act - obj.SetVoidedAt(fernTestValueVoidedAt) - - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") + obj := &CreateSeriesRequestAnswersValue{} + var expected string + obj.String = expected - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } + // Act & Assert + assert.Equal(t, expected, obj.GetString(), "getter should return the property value") + }) - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip + t.Run("GetString_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *CreateSeriesRequestAnswersValue + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetString() // Should return zero value }) - t.Run("SetCreatedAt_MarksExplicit", func(t *testing.T) { + t.Run("GetStringList", func(t *testing.T) { t.Parallel() // Arrange - obj := &Credit{} - var fernTestValueCreatedAt time.Time - - // Act - obj.SetCreatedAt(fernTestValueCreatedAt) - - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") - - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } + obj := &CreateSeriesRequestAnswersValue{} + var expected []string + obj.StringList = expected - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip + // Act & Assert + assert.Equal(t, expected, obj.GetStringList(), "getter should return the property value") }) -} - -func TestSettersCreditList(t *testing.T) { - t.Run("SetObject", func(t *testing.T) { - obj := &CreditList{} - var fernTestValueObject CreditListObject - obj.SetObject(fernTestValueObject) - assert.Equal(t, fernTestValueObject, obj.Object) - assert.NotNil(t, obj.explicitFields) - }) + t.Run("GetStringList_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &CreateSeriesRequestAnswersValue{} + obj.StringList = nil - t.Run("SetData", func(t *testing.T) { - obj := &CreditList{} - var fernTestValueData []*Credit - obj.SetData(fernTestValueData) - assert.Equal(t, fernTestValueData, obj.Data) - assert.NotNil(t, obj.explicitFields) + // Act & Assert + assert.Nil(t, obj.GetStringList(), "getter should return nil when property is nil") }) - t.Run("SetHasMore", func(t *testing.T) { - obj := &CreditList{} - var fernTestValueHasMore bool - obj.SetHasMore(fernTestValueHasMore) - assert.Equal(t, fernTestValueHasMore, obj.HasMore) - assert.NotNil(t, obj.explicitFields) + t.Run("GetStringList_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *CreateSeriesRequestAnswersValue + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetStringList() // Should return zero value }) } -func TestGettersCreditList(t *testing.T) { - t.Run("GetObject", func(t *testing.T) { +func TestGettersCreateSeriesRequestAttributesValue(t *testing.T) { + t.Run("GetString", func(t *testing.T) { t.Parallel() // Arrange - obj := &CreditList{} - var expected CreditListObject - obj.Object = expected + obj := &CreateSeriesRequestAttributesValue{} + var expected string + obj.String = expected // Act & Assert - assert.Equal(t, expected, obj.GetObject(), "getter should return the property value") + assert.Equal(t, expected, obj.GetString(), "getter should return the property value") }) - t.Run("GetObject_NilReceiver", func(t *testing.T) { + t.Run("GetString_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *CreditList + var obj *CreateSeriesRequestAttributesValue // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetObject() // Should return zero value + _ = obj.GetString() // Should return zero value }) - t.Run("GetData", func(t *testing.T) { + t.Run("GetStringList", func(t *testing.T) { t.Parallel() // Arrange - obj := &CreditList{} - var expected []*Credit - obj.Data = expected + obj := &CreateSeriesRequestAttributesValue{} + var expected []string + obj.StringList = expected // Act & Assert - assert.Equal(t, expected, obj.GetData(), "getter should return the property value") + assert.Equal(t, expected, obj.GetStringList(), "getter should return the property value") }) - t.Run("GetData_NilValue", func(t *testing.T) { + t.Run("GetStringList_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &CreditList{} - obj.Data = nil + obj := &CreateSeriesRequestAttributesValue{} + obj.StringList = nil // Act & Assert - assert.Nil(t, obj.GetData(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetStringList(), "getter should return nil when property is nil") }) - t.Run("GetData_NilReceiver", func(t *testing.T) { + t.Run("GetStringList_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *CreditList + var obj *CreateSeriesRequestAttributesValue // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetData() // Should return zero value + _ = obj.GetStringList() // Should return zero value }) - t.Run("GetHasMore", func(t *testing.T) { +} + +func TestGettersCreateSeriesRequestLocation(t *testing.T) { + t.Run("GetType", func(t *testing.T) { t.Parallel() // Arrange - obj := &CreditList{} - var expected bool - obj.HasMore = expected + obj := &CreateSeriesRequestLocation{} + var expected string + obj.Type = expected // Act & Assert - assert.Equal(t, expected, obj.GetHasMore(), "getter should return the property value") + assert.Equal(t, expected, obj.GetType(), "getter should return the property value") }) - t.Run("GetHasMore_NilReceiver", func(t *testing.T) { + t.Run("GetType_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *CreditList + var obj *CreateSeriesRequestLocation // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetHasMore() // Should return zero value - }) - -} - -func TestSettersMarkExplicitCreditList(t *testing.T) { - t.Run("SetObject_MarksExplicit", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &CreditList{} - var fernTestValueObject CreditListObject - - // Act - obj.SetObject(fernTestValueObject) - - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") - - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } - - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip - }) - - t.Run("SetData_MarksExplicit", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &CreditList{} - var fernTestValueData []*Credit - - // Act - obj.SetData(fernTestValueData) - - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") - - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } - - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip + _ = obj.GetType() // Should return zero value }) - t.Run("SetHasMore_MarksExplicit", func(t *testing.T) { + t.Run("GetLink", func(t *testing.T) { t.Parallel() // Arrange - obj := &CreditList{} - var fernTestValueHasMore bool - - // Act - obj.SetHasMore(fernTestValueHasMore) - - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") - - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } - - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip - }) - -} - -func TestSettersDedicatedIPPool(t *testing.T) { - t.Run("SetObject", func(t *testing.T) { - obj := &DedicatedIPPool{} - var fernTestValueObject DedicatedIPPoolObject - obj.SetObject(fernTestValueObject) - assert.Equal(t, fernTestValueObject, obj.Object) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetStatus", func(t *testing.T) { - obj := &DedicatedIPPool{} - var fernTestValueStatus DedicatedIPPoolStatus - obj.SetStatus(fernTestValueStatus) - assert.Equal(t, fernTestValueStatus, obj.Status) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetIps", func(t *testing.T) { - obj := &DedicatedIPPool{} - var fernTestValueIps []*DedicatedIPPoolIpsItem - obj.SetIps(fernTestValueIps) - assert.Equal(t, fernTestValueIps, obj.Ips) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetDedicatedShare", func(t *testing.T) { - obj := &DedicatedIPPool{} - var fernTestValueDedicatedShare *float64 - obj.SetDedicatedShare(fernTestValueDedicatedShare) - assert.Equal(t, fernTestValueDedicatedShare, obj.DedicatedShare) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetMessage", func(t *testing.T) { - obj := &DedicatedIPPool{} - var fernTestValueMessage *string - obj.SetMessage(fernTestValueMessage) - assert.Equal(t, fernTestValueMessage, obj.Message) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetCreatedAt", func(t *testing.T) { - obj := &DedicatedIPPool{} - var fernTestValueCreatedAt *time.Time - obj.SetCreatedAt(fernTestValueCreatedAt) - assert.Equal(t, fernTestValueCreatedAt, obj.CreatedAt) - assert.NotNil(t, obj.explicitFields) - }) + obj := &CreateSeriesRequestLocation{} + var expected *CreateSeriesRequestLocationLink + obj.Link = expected - t.Run("SetReadyAt", func(t *testing.T) { - obj := &DedicatedIPPool{} - var fernTestValueReadyAt *time.Time - obj.SetReadyAt(fernTestValueReadyAt) - assert.Equal(t, fernTestValueReadyAt, obj.ReadyAt) - assert.NotNil(t, obj.explicitFields) + // Act & Assert + assert.Equal(t, expected, obj.GetLink(), "getter should return the property value") }) -} - -func TestGettersDedicatedIPPool(t *testing.T) { - t.Run("GetObject", func(t *testing.T) { + t.Run("GetLink_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &DedicatedIPPool{} - var expected DedicatedIPPoolObject - obj.Object = expected + obj := &CreateSeriesRequestLocation{} + obj.Link = nil // Act & Assert - assert.Equal(t, expected, obj.GetObject(), "getter should return the property value") + assert.Nil(t, obj.GetLink(), "getter should return nil when property is nil") }) - t.Run("GetObject_NilReceiver", func(t *testing.T) { + t.Run("GetLink_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DedicatedIPPool + var obj *CreateSeriesRequestLocation // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetObject() // Should return zero value + _ = obj.GetLink() // Should return zero value }) - t.Run("GetStatus", func(t *testing.T) { + t.Run("GetPhone", func(t *testing.T) { t.Parallel() // Arrange - obj := &DedicatedIPPool{} - var expected DedicatedIPPoolStatus - obj.Status = expected + obj := &CreateSeriesRequestLocation{} + var expected *CreateSeriesRequestLocationPhone + obj.Phone = expected // Act & Assert - assert.Equal(t, expected, obj.GetStatus(), "getter should return the property value") + assert.Equal(t, expected, obj.GetPhone(), "getter should return the property value") }) - t.Run("GetStatus_NilReceiver", func(t *testing.T) { + t.Run("GetPhone_NilValue", func(t *testing.T) { t.Parallel() - var obj *DedicatedIPPool + // Arrange + obj := &CreateSeriesRequestLocation{} + obj.Phone = nil + + // Act & Assert + assert.Nil(t, obj.GetPhone(), "getter should return nil when property is nil") + }) + + t.Run("GetPhone_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *CreateSeriesRequestLocation // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetStatus() // Should return zero value + _ = obj.GetPhone() // Should return zero value }) - t.Run("GetIps", func(t *testing.T) { + t.Run("GetInPerson", func(t *testing.T) { t.Parallel() // Arrange - obj := &DedicatedIPPool{} - var expected []*DedicatedIPPoolIpsItem - obj.Ips = expected + obj := &CreateSeriesRequestLocation{} + var expected *CreateSeriesRequestLocationInPerson + obj.InPerson = expected // Act & Assert - assert.Equal(t, expected, obj.GetIps(), "getter should return the property value") + assert.Equal(t, expected, obj.GetInPerson(), "getter should return the property value") }) - t.Run("GetIps_NilValue", func(t *testing.T) { + t.Run("GetInPerson_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &DedicatedIPPool{} - obj.Ips = nil + obj := &CreateSeriesRequestLocation{} + obj.InPerson = nil // Act & Assert - assert.Nil(t, obj.GetIps(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetInPerson(), "getter should return nil when property is nil") }) - t.Run("GetIps_NilReceiver", func(t *testing.T) { + t.Run("GetInPerson_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DedicatedIPPool + var obj *CreateSeriesRequestLocation // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetIps() // Should return zero value + _ = obj.GetInPerson() // Should return zero value }) - t.Run("GetDedicatedShare", func(t *testing.T) { + t.Run("GetGoogleMeet", func(t *testing.T) { t.Parallel() // Arrange - obj := &DedicatedIPPool{} - var expected *float64 - obj.DedicatedShare = expected + obj := &CreateSeriesRequestLocation{} + var expected *CreateSeriesRequestLocationGoogleMeet + obj.GoogleMeet = expected // Act & Assert - assert.Equal(t, expected, obj.GetDedicatedShare(), "getter should return the property value") + assert.Equal(t, expected, obj.GetGoogleMeet(), "getter should return the property value") }) - t.Run("GetDedicatedShare_NilValue", func(t *testing.T) { + t.Run("GetGoogleMeet_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &DedicatedIPPool{} - obj.DedicatedShare = nil + obj := &CreateSeriesRequestLocation{} + obj.GoogleMeet = nil // Act & Assert - assert.Nil(t, obj.GetDedicatedShare(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetGoogleMeet(), "getter should return nil when property is nil") }) - t.Run("GetDedicatedShare_NilReceiver", func(t *testing.T) { + t.Run("GetGoogleMeet_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DedicatedIPPool + var obj *CreateSeriesRequestLocation // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetDedicatedShare() // Should return zero value + _ = obj.GetGoogleMeet() // Should return zero value }) - t.Run("GetMessage", func(t *testing.T) { + t.Run("GetMicrosoftTeams", func(t *testing.T) { t.Parallel() // Arrange - obj := &DedicatedIPPool{} - var expected *string - obj.Message = expected + obj := &CreateSeriesRequestLocation{} + var expected *CreateSeriesRequestLocationMicrosoftTeams + obj.MicrosoftTeams = expected // Act & Assert - assert.Equal(t, expected, obj.GetMessage(), "getter should return the property value") + assert.Equal(t, expected, obj.GetMicrosoftTeams(), "getter should return the property value") }) - t.Run("GetMessage_NilValue", func(t *testing.T) { + t.Run("GetMicrosoftTeams_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &DedicatedIPPool{} - obj.Message = nil + obj := &CreateSeriesRequestLocation{} + obj.MicrosoftTeams = nil // Act & Assert - assert.Nil(t, obj.GetMessage(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetMicrosoftTeams(), "getter should return nil when property is nil") }) - t.Run("GetMessage_NilReceiver", func(t *testing.T) { + t.Run("GetMicrosoftTeams_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DedicatedIPPool + var obj *CreateSeriesRequestLocation // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetMessage() // Should return zero value + _ = obj.GetMicrosoftTeams() // Should return zero value }) - t.Run("GetCreatedAt", func(t *testing.T) { + t.Run("GetZoom", func(t *testing.T) { t.Parallel() // Arrange - obj := &DedicatedIPPool{} - var expected *time.Time - obj.CreatedAt = expected + obj := &CreateSeriesRequestLocation{} + var expected *CreateSeriesRequestLocationZoom + obj.Zoom = expected // Act & Assert - assert.Equal(t, expected, obj.GetCreatedAt(), "getter should return the property value") + assert.Equal(t, expected, obj.GetZoom(), "getter should return the property value") }) - t.Run("GetCreatedAt_NilValue", func(t *testing.T) { + t.Run("GetZoom_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &DedicatedIPPool{} - obj.CreatedAt = nil + obj := &CreateSeriesRequestLocation{} + obj.Zoom = nil // Act & Assert - assert.Nil(t, obj.GetCreatedAt(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetZoom(), "getter should return nil when property is nil") }) - t.Run("GetCreatedAt_NilReceiver", func(t *testing.T) { + t.Run("GetZoom_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DedicatedIPPool + var obj *CreateSeriesRequestLocation // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetCreatedAt() // Should return zero value + _ = obj.GetZoom() // Should return zero value }) - t.Run("GetReadyAt", func(t *testing.T) { +} + +func TestSettersCreateSeriesRequestLocationInPerson(t *testing.T) { + t.Run("SetAddress", func(t *testing.T) { + obj := &CreateSeriesRequestLocationInPerson{} + var fernTestValueAddress *string + obj.SetAddress(fernTestValueAddress) + assert.Equal(t, fernTestValueAddress, obj.Address) + assert.NotNil(t, obj.explicitFields) + }) + +} + +func TestGettersCreateSeriesRequestLocationInPerson(t *testing.T) { + t.Run("GetAddress", func(t *testing.T) { t.Parallel() // Arrange - obj := &DedicatedIPPool{} - var expected *time.Time - obj.ReadyAt = expected + obj := &CreateSeriesRequestLocationInPerson{} + var expected *string + obj.Address = expected // Act & Assert - assert.Equal(t, expected, obj.GetReadyAt(), "getter should return the property value") + assert.Equal(t, expected, obj.GetAddress(), "getter should return the property value") }) - t.Run("GetReadyAt_NilValue", func(t *testing.T) { + t.Run("GetAddress_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &DedicatedIPPool{} - obj.ReadyAt = nil + obj := &CreateSeriesRequestLocationInPerson{} + obj.Address = nil // Act & Assert - assert.Nil(t, obj.GetReadyAt(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetAddress(), "getter should return nil when property is nil") }) - t.Run("GetReadyAt_NilReceiver", func(t *testing.T) { + t.Run("GetAddress_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DedicatedIPPool + var obj *CreateSeriesRequestLocationInPerson // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetReadyAt() // Should return zero value + _ = obj.GetAddress() // Should return zero value }) } -func TestSettersMarkExplicitDedicatedIPPool(t *testing.T) { - t.Run("SetObject_MarksExplicit", func(t *testing.T) { +func TestSettersMarkExplicitCreateSeriesRequestLocationInPerson(t *testing.T) { + t.Run("SetAddress_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DedicatedIPPool{} - var fernTestValueObject DedicatedIPPoolObject + obj := &CreateSeriesRequestLocationInPerson{} + var fernTestValueAddress *string // Act - obj.SetObject(fernTestValueObject) + obj.SetAddress(fernTestValueAddress) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -18219,76 +17658,64 @@ func TestSettersMarkExplicitDedicatedIPPool(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetStatus_MarksExplicit", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &DedicatedIPPool{} - var fernTestValueStatus DedicatedIPPoolStatus +} - // Act - obj.SetStatus(fernTestValueStatus) +func TestSettersCreateSeriesRequestLocationLink(t *testing.T) { + t.Run("SetURL", func(t *testing.T) { + obj := &CreateSeriesRequestLocationLink{} + var fernTestValueURL *string + obj.SetURL(fernTestValueURL) + assert.Equal(t, fernTestValueURL, obj.URL) + assert.NotNil(t, obj.explicitFields) + }) - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") +} - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } +func TestGettersCreateSeriesRequestLocationLink(t *testing.T) { + t.Run("GetURL", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &CreateSeriesRequestLocationLink{} + var expected *string + obj.URL = expected - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip + // Act & Assert + assert.Equal(t, expected, obj.GetURL(), "getter should return the property value") }) - t.Run("SetIps_MarksExplicit", func(t *testing.T) { + t.Run("GetURL_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &DedicatedIPPool{} - var fernTestValueIps []*DedicatedIPPoolIpsItem - - // Act - obj.SetIps(fernTestValueIps) - - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") + obj := &CreateSeriesRequestLocationLink{} + obj.URL = nil - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } + // Act & Assert + assert.Nil(t, obj.GetURL(), "getter should return nil when property is nil") + }) - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip + t.Run("GetURL_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *CreateSeriesRequestLocationLink + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetURL() // Should return zero value }) - t.Run("SetDedicatedShare_MarksExplicit", func(t *testing.T) { +} + +func TestSettersMarkExplicitCreateSeriesRequestLocationLink(t *testing.T) { + t.Run("SetURL_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DedicatedIPPool{} - var fernTestValueDedicatedShare *float64 + obj := &CreateSeriesRequestLocationLink{} + var fernTestValueURL *string // Act - obj.SetDedicatedShare(fernTestValueDedicatedShare) + obj.SetURL(fernTestValueURL) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -18312,76 +17739,64 @@ func TestSettersMarkExplicitDedicatedIPPool(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetMessage_MarksExplicit", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &DedicatedIPPool{} - var fernTestValueMessage *string +} - // Act - obj.SetMessage(fernTestValueMessage) +func TestSettersCreateSeriesRequestLocationPhone(t *testing.T) { + t.Run("SetNumber", func(t *testing.T) { + obj := &CreateSeriesRequestLocationPhone{} + var fernTestValueNumber *string + obj.SetNumber(fernTestValueNumber) + assert.Equal(t, fernTestValueNumber, obj.Number) + assert.NotNil(t, obj.explicitFields) + }) - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") +} - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } +func TestGettersCreateSeriesRequestLocationPhone(t *testing.T) { + t.Run("GetNumber", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &CreateSeriesRequestLocationPhone{} + var expected *string + obj.Number = expected - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip + // Act & Assert + assert.Equal(t, expected, obj.GetNumber(), "getter should return the property value") }) - t.Run("SetCreatedAt_MarksExplicit", func(t *testing.T) { + t.Run("GetNumber_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &DedicatedIPPool{} - var fernTestValueCreatedAt *time.Time - - // Act - obj.SetCreatedAt(fernTestValueCreatedAt) - - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") + obj := &CreateSeriesRequestLocationPhone{} + obj.Number = nil - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } + // Act & Assert + assert.Nil(t, obj.GetNumber(), "getter should return nil when property is nil") + }) - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip + t.Run("GetNumber_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *CreateSeriesRequestLocationPhone + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetNumber() // Should return zero value }) - t.Run("SetReadyAt_MarksExplicit", func(t *testing.T) { +} + +func TestSettersMarkExplicitCreateSeriesRequestLocationPhone(t *testing.T) { + t.Run("SetNumber_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DedicatedIPPool{} - var fernTestValueReadyAt *time.Time + obj := &CreateSeriesRequestLocationPhone{} + var fernTestValueNumber *string // Act - obj.SetReadyAt(fernTestValueReadyAt) + obj.SetNumber(fernTestValueNumber) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -18407,114 +17822,62 @@ func TestSettersMarkExplicitDedicatedIPPool(t *testing.T) { } -func TestSettersDedicatedIPPoolIpsItem(t *testing.T) { - t.Run("SetIP", func(t *testing.T) { - obj := &DedicatedIPPoolIpsItem{} - var fernTestValueIP string - obj.SetIP(fernTestValueIP) - assert.Equal(t, fernTestValueIP, obj.IP) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetDelivered7D", func(t *testing.T) { - obj := &DedicatedIPPoolIpsItem{} - var fernTestValueDelivered7D int64 - obj.SetDelivered7D(fernTestValueDelivered7D) - assert.Equal(t, fernTestValueDelivered7D, obj.Delivered7D) +func TestSettersCreateSeriesRequestLocationZoom(t *testing.T) { + t.Run("SetURL", func(t *testing.T) { + obj := &CreateSeriesRequestLocationZoom{} + var fernTestValueURL *string + obj.SetURL(fernTestValueURL) + assert.Equal(t, fernTestValueURL, obj.URL) assert.NotNil(t, obj.explicitFields) }) } -func TestGettersDedicatedIPPoolIpsItem(t *testing.T) { - t.Run("GetIP", func(t *testing.T) { +func TestGettersCreateSeriesRequestLocationZoom(t *testing.T) { + t.Run("GetURL", func(t *testing.T) { t.Parallel() // Arrange - obj := &DedicatedIPPoolIpsItem{} - var expected string - obj.IP = expected + obj := &CreateSeriesRequestLocationZoom{} + var expected *string + obj.URL = expected // Act & Assert - assert.Equal(t, expected, obj.GetIP(), "getter should return the property value") - }) - - t.Run("GetIP_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *DedicatedIPPoolIpsItem - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetIP() // Should return zero value + assert.Equal(t, expected, obj.GetURL(), "getter should return the property value") }) - t.Run("GetDelivered7D", func(t *testing.T) { + t.Run("GetURL_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &DedicatedIPPoolIpsItem{} - var expected int64 - obj.Delivered7D = expected + obj := &CreateSeriesRequestLocationZoom{} + obj.URL = nil // Act & Assert - assert.Equal(t, expected, obj.GetDelivered7D(), "getter should return the property value") + assert.Nil(t, obj.GetURL(), "getter should return nil when property is nil") }) - t.Run("GetDelivered7D_NilReceiver", func(t *testing.T) { + t.Run("GetURL_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DedicatedIPPoolIpsItem + var obj *CreateSeriesRequestLocationZoom // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetDelivered7D() // Should return zero value + _ = obj.GetURL() // Should return zero value }) } -func TestSettersMarkExplicitDedicatedIPPoolIpsItem(t *testing.T) { - t.Run("SetIP_MarksExplicit", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &DedicatedIPPoolIpsItem{} - var fernTestValueIP string - - // Act - obj.SetIP(fernTestValueIP) - - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") - - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } - - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip - }) - - t.Run("SetDelivered7D_MarksExplicit", func(t *testing.T) { +func TestSettersMarkExplicitCreateSeriesRequestLocationZoom(t *testing.T) { + t.Run("SetURL_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DedicatedIPPoolIpsItem{} - var fernTestValueDelivered7D int64 + obj := &CreateSeriesRequestLocationZoom{} + var fernTestValueURL *string // Act - obj.SetDelivered7D(fernTestValueDelivered7D) + obj.SetURL(fernTestValueURL) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -18540,114 +17903,124 @@ func TestSettersMarkExplicitDedicatedIPPoolIpsItem(t *testing.T) { } -func TestSettersDeletedAudience(t *testing.T) { - t.Run("SetObject", func(t *testing.T) { - obj := &DeletedAudience{} - var fernTestValueObject DeletedAudienceObject - obj.SetObject(fernTestValueObject) - assert.Equal(t, fernTestValueObject, obj.Object) +func TestSettersCreateSeriesRequestRecurrence(t *testing.T) { + t.Run("SetFrequency", func(t *testing.T) { + obj := &CreateSeriesRequestRecurrence{} + var fernTestValueFrequency CreateSeriesRequestRecurrenceFrequency + obj.SetFrequency(fernTestValueFrequency) + assert.Equal(t, fernTestValueFrequency, obj.Frequency) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetID", func(t *testing.T) { - obj := &DeletedAudience{} - var fernTestValueID string - obj.SetID(fernTestValueID) - assert.Equal(t, fernTestValueID, obj.ID) + t.Run("SetInterval", func(t *testing.T) { + obj := &CreateSeriesRequestRecurrence{} + var fernTestValueInterval *int + obj.SetInterval(fernTestValueInterval) + assert.Equal(t, fernTestValueInterval, obj.Interval) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetDeleted", func(t *testing.T) { - obj := &DeletedAudience{} - var fernTestValueDeleted bool - obj.SetDeleted(fernTestValueDeleted) - assert.Equal(t, fernTestValueDeleted, obj.Deleted) + t.Run("SetCount", func(t *testing.T) { + obj := &CreateSeriesRequestRecurrence{} + var fernTestValueCount int + obj.SetCount(fernTestValueCount) + assert.Equal(t, fernTestValueCount, obj.Count) assert.NotNil(t, obj.explicitFields) }) } -func TestGettersDeletedAudience(t *testing.T) { - t.Run("GetObject", func(t *testing.T) { +func TestGettersCreateSeriesRequestRecurrence(t *testing.T) { + t.Run("GetFrequency", func(t *testing.T) { t.Parallel() // Arrange - obj := &DeletedAudience{} - var expected DeletedAudienceObject - obj.Object = expected + obj := &CreateSeriesRequestRecurrence{} + var expected CreateSeriesRequestRecurrenceFrequency + obj.Frequency = expected // Act & Assert - assert.Equal(t, expected, obj.GetObject(), "getter should return the property value") + assert.Equal(t, expected, obj.GetFrequency(), "getter should return the property value") }) - t.Run("GetObject_NilReceiver", func(t *testing.T) { + t.Run("GetFrequency_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DeletedAudience + var obj *CreateSeriesRequestRecurrence // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetObject() // Should return zero value + _ = obj.GetFrequency() // Should return zero value }) - t.Run("GetID", func(t *testing.T) { + t.Run("GetInterval", func(t *testing.T) { t.Parallel() // Arrange - obj := &DeletedAudience{} - var expected string - obj.ID = expected + obj := &CreateSeriesRequestRecurrence{} + var expected *int + obj.Interval = expected // Act & Assert - assert.Equal(t, expected, obj.GetID(), "getter should return the property value") + assert.Equal(t, expected, obj.GetInterval(), "getter should return the property value") }) - t.Run("GetID_NilReceiver", func(t *testing.T) { + t.Run("GetInterval_NilValue", func(t *testing.T) { t.Parallel() - var obj *DeletedAudience + // Arrange + obj := &CreateSeriesRequestRecurrence{} + obj.Interval = nil + + // Act & Assert + assert.Nil(t, obj.GetInterval(), "getter should return nil when property is nil") + }) + + t.Run("GetInterval_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *CreateSeriesRequestRecurrence // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetID() // Should return zero value + _ = obj.GetInterval() // Should return zero value }) - t.Run("GetDeleted", func(t *testing.T) { + t.Run("GetCount", func(t *testing.T) { t.Parallel() // Arrange - obj := &DeletedAudience{} - var expected bool - obj.Deleted = expected + obj := &CreateSeriesRequestRecurrence{} + var expected int + obj.Count = expected // Act & Assert - assert.Equal(t, expected, obj.GetDeleted(), "getter should return the property value") + assert.Equal(t, expected, obj.GetCount(), "getter should return the property value") }) - t.Run("GetDeleted_NilReceiver", func(t *testing.T) { + t.Run("GetCount_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DeletedAudience + var obj *CreateSeriesRequestRecurrence // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetDeleted() // Should return zero value + _ = obj.GetCount() // Should return zero value }) } -func TestSettersMarkExplicitDeletedAudience(t *testing.T) { - t.Run("SetObject_MarksExplicit", func(t *testing.T) { +func TestSettersMarkExplicitCreateSeriesRequestRecurrence(t *testing.T) { + t.Run("SetFrequency_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DeletedAudience{} - var fernTestValueObject DeletedAudienceObject + obj := &CreateSeriesRequestRecurrence{} + var fernTestValueFrequency CreateSeriesRequestRecurrenceFrequency // Act - obj.SetObject(fernTestValueObject) + obj.SetFrequency(fernTestValueFrequency) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -18671,14 +18044,14 @@ func TestSettersMarkExplicitDeletedAudience(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetID_MarksExplicit", func(t *testing.T) { + t.Run("SetInterval_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DeletedAudience{} - var fernTestValueID string + obj := &CreateSeriesRequestRecurrence{} + var fernTestValueInterval *int // Act - obj.SetID(fernTestValueID) + obj.SetInterval(fernTestValueInterval) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -18702,14 +18075,14 @@ func TestSettersMarkExplicitDeletedAudience(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetDeleted_MarksExplicit", func(t *testing.T) { + t.Run("SetCount_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DeletedAudience{} - var fernTestValueDeleted bool + obj := &CreateSeriesRequestRecurrence{} + var fernTestValueCount int // Act - obj.SetDeleted(fernTestValueDeleted) + obj.SetCount(fernTestValueCount) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -18735,39 +18108,127 @@ func TestSettersMarkExplicitDeletedAudience(t *testing.T) { } -func TestSettersDeletedBroadcast(t *testing.T) { +func TestSettersCredit(t *testing.T) { t.Run("SetObject", func(t *testing.T) { - obj := &DeletedBroadcast{} - var fernTestValueObject DeletedBroadcastObject + obj := &Credit{} + var fernTestValueObject CreditObject obj.SetObject(fernTestValueObject) assert.Equal(t, fernTestValueObject, obj.Object) assert.NotNil(t, obj.explicitFields) }) t.Run("SetID", func(t *testing.T) { - obj := &DeletedBroadcast{} + obj := &Credit{} var fernTestValueID string obj.SetID(fernTestValueID) assert.Equal(t, fernTestValueID, obj.ID) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetDeleted", func(t *testing.T) { - obj := &DeletedBroadcast{} - var fernTestValueDeleted bool - obj.SetDeleted(fernTestValueDeleted) - assert.Equal(t, fernTestValueDeleted, obj.Deleted) + t.Run("SetKind", func(t *testing.T) { + obj := &Credit{} + var fernTestValueKind CreditKind + obj.SetKind(fernTestValueKind) + assert.Equal(t, fernTestValueKind, obj.Kind) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetAmount", func(t *testing.T) { + obj := &Credit{} + var fernTestValueAmount int64 + obj.SetAmount(fernTestValueAmount) + assert.Equal(t, fernTestValueAmount, obj.Amount) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetRemaining", func(t *testing.T) { + obj := &Credit{} + var fernTestValueRemaining int64 + obj.SetRemaining(fernTestValueRemaining) + assert.Equal(t, fernTestValueRemaining, obj.Remaining) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetMeter", func(t *testing.T) { + obj := &Credit{} + var fernTestValueMeter *CreditMeter + obj.SetMeter(fernTestValueMeter) + assert.Equal(t, fernTestValueMeter, obj.Meter) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetMeters", func(t *testing.T) { + obj := &Credit{} + var fernTestValueMeters []CreditMetersItem + obj.SetMeters(fernTestValueMeters) + assert.Equal(t, fernTestValueMeters, obj.Meters) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetAppliesTo", func(t *testing.T) { + obj := &Credit{} + var fernTestValueAppliesTo CreditAppliesTo + obj.SetAppliesTo(fernTestValueAppliesTo) + assert.Equal(t, fernTestValueAppliesTo, obj.AppliesTo) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetSource", func(t *testing.T) { + obj := &Credit{} + var fernTestValueSource CreditSource + obj.SetSource(fernTestValueSource) + assert.Equal(t, fernTestValueSource, obj.Source) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetDescription", func(t *testing.T) { + obj := &Credit{} + var fernTestValueDescription string + obj.SetDescription(fernTestValueDescription) + assert.Equal(t, fernTestValueDescription, obj.Description) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetEffectiveAt", func(t *testing.T) { + obj := &Credit{} + var fernTestValueEffectiveAt time.Time + obj.SetEffectiveAt(fernTestValueEffectiveAt) + assert.Equal(t, fernTestValueEffectiveAt, obj.EffectiveAt) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetExpiresAt", func(t *testing.T) { + obj := &Credit{} + var fernTestValueExpiresAt *time.Time + obj.SetExpiresAt(fernTestValueExpiresAt) + assert.Equal(t, fernTestValueExpiresAt, obj.ExpiresAt) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetVoidedAt", func(t *testing.T) { + obj := &Credit{} + var fernTestValueVoidedAt *time.Time + obj.SetVoidedAt(fernTestValueVoidedAt) + assert.Equal(t, fernTestValueVoidedAt, obj.VoidedAt) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetCreatedAt", func(t *testing.T) { + obj := &Credit{} + var fernTestValueCreatedAt time.Time + obj.SetCreatedAt(fernTestValueCreatedAt) + assert.Equal(t, fernTestValueCreatedAt, obj.CreatedAt) assert.NotNil(t, obj.explicitFields) }) } -func TestGettersDeletedBroadcast(t *testing.T) { +func TestGettersCredit(t *testing.T) { t.Run("GetObject", func(t *testing.T) { t.Parallel() // Arrange - obj := &DeletedBroadcast{} - var expected DeletedBroadcastObject + obj := &Credit{} + var expected CreditObject obj.Object = expected // Act & Assert @@ -18776,7 +18237,7 @@ func TestGettersDeletedBroadcast(t *testing.T) { t.Run("GetObject_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DeletedBroadcast + var obj *Credit // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -18789,7 +18250,7 @@ func TestGettersDeletedBroadcast(t *testing.T) { t.Run("GetID", func(t *testing.T) { t.Parallel() // Arrange - obj := &DeletedBroadcast{} + obj := &Credit{} var expected string obj.ID = expected @@ -18799,7 +18260,7 @@ func TestGettersDeletedBroadcast(t *testing.T) { t.Run("GetID_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DeletedBroadcast + var obj *Credit // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -18809,232 +18270,330 @@ func TestGettersDeletedBroadcast(t *testing.T) { _ = obj.GetID() // Should return zero value }) - t.Run("GetDeleted", func(t *testing.T) { + t.Run("GetKind", func(t *testing.T) { t.Parallel() // Arrange - obj := &DeletedBroadcast{} - var expected bool - obj.Deleted = expected + obj := &Credit{} + var expected CreditKind + obj.Kind = expected // Act & Assert - assert.Equal(t, expected, obj.GetDeleted(), "getter should return the property value") + assert.Equal(t, expected, obj.GetKind(), "getter should return the property value") }) - t.Run("GetDeleted_NilReceiver", func(t *testing.T) { + t.Run("GetKind_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DeletedBroadcast + var obj *Credit // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetDeleted() // Should return zero value + _ = obj.GetKind() // Should return zero value }) -} - -func TestSettersMarkExplicitDeletedBroadcast(t *testing.T) { - t.Run("SetObject_MarksExplicit", func(t *testing.T) { + t.Run("GetAmount", func(t *testing.T) { t.Parallel() // Arrange - obj := &DeletedBroadcast{} - var fernTestValueObject DeletedBroadcastObject + obj := &Credit{} + var expected int64 + obj.Amount = expected - // Act - obj.SetObject(fernTestValueObject) + // Act & Assert + assert.Equal(t, expected, obj.GetAmount(), "getter should return the property value") + }) - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") + t.Run("GetAmount_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *Credit + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetAmount() // Should return zero value + }) - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } + t.Run("GetRemaining", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &Credit{} + var expected int64 + obj.Remaining = expected - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip + // Act & Assert + assert.Equal(t, expected, obj.GetRemaining(), "getter should return the property value") }) - t.Run("SetID_MarksExplicit", func(t *testing.T) { + t.Run("GetRemaining_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *Credit + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetRemaining() // Should return zero value + }) + + t.Run("GetMeter", func(t *testing.T) { t.Parallel() // Arrange - obj := &DeletedBroadcast{} - var fernTestValueID string + obj := &Credit{} + var expected *CreditMeter + obj.Meter = expected - // Act - obj.SetID(fernTestValueID) + // Act & Assert + assert.Equal(t, expected, obj.GetMeter(), "getter should return the property value") + }) - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") + t.Run("GetMeter_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &Credit{} + obj.Meter = nil - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } + // Act & Assert + assert.Nil(t, obj.GetMeter(), "getter should return nil when property is nil") + }) - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip + t.Run("GetMeter_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *Credit + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetMeter() // Should return zero value }) - t.Run("SetDeleted_MarksExplicit", func(t *testing.T) { + t.Run("GetMeters", func(t *testing.T) { t.Parallel() // Arrange - obj := &DeletedBroadcast{} - var fernTestValueDeleted bool - - // Act - obj.SetDeleted(fernTestValueDeleted) + obj := &Credit{} + var expected []CreditMetersItem + obj.Meters = expected - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") + // Act & Assert + assert.Equal(t, expected, obj.GetMeters(), "getter should return the property value") + }) - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } + t.Run("GetMeters_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &Credit{} + obj.Meters = nil - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip + // Act & Assert + assert.Nil(t, obj.GetMeters(), "getter should return nil when property is nil") }) -} + t.Run("GetMeters_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *Credit + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetMeters() // Should return zero value + }) -func TestSettersDeletedContact(t *testing.T) { - t.Run("SetObject", func(t *testing.T) { - obj := &DeletedContact{} - var fernTestValueObject DeletedContactObject - obj.SetObject(fernTestValueObject) - assert.Equal(t, fernTestValueObject, obj.Object) - assert.NotNil(t, obj.explicitFields) + t.Run("GetAppliesTo", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &Credit{} + var expected CreditAppliesTo + obj.AppliesTo = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetAppliesTo(), "getter should return the property value") }) - t.Run("SetID", func(t *testing.T) { - obj := &DeletedContact{} - var fernTestValueID string - obj.SetID(fernTestValueID) - assert.Equal(t, fernTestValueID, obj.ID) - assert.NotNil(t, obj.explicitFields) + t.Run("GetAppliesTo_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *Credit + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetAppliesTo() // Should return zero value }) - t.Run("SetDeleted", func(t *testing.T) { - obj := &DeletedContact{} - var fernTestValueDeleted bool - obj.SetDeleted(fernTestValueDeleted) - assert.Equal(t, fernTestValueDeleted, obj.Deleted) - assert.NotNil(t, obj.explicitFields) + t.Run("GetSource", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &Credit{} + var expected CreditSource + obj.Source = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetSource(), "getter should return the property value") }) -} + t.Run("GetSource_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *Credit + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetSource() // Should return zero value + }) -func TestGettersDeletedContact(t *testing.T) { - t.Run("GetObject", func(t *testing.T) { + t.Run("GetDescription", func(t *testing.T) { t.Parallel() // Arrange - obj := &DeletedContact{} - var expected DeletedContactObject - obj.Object = expected + obj := &Credit{} + var expected string + obj.Description = expected // Act & Assert - assert.Equal(t, expected, obj.GetObject(), "getter should return the property value") + assert.Equal(t, expected, obj.GetDescription(), "getter should return the property value") }) - t.Run("GetObject_NilReceiver", func(t *testing.T) { + t.Run("GetDescription_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DeletedContact + var obj *Credit // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetObject() // Should return zero value + _ = obj.GetDescription() // Should return zero value }) - t.Run("GetID", func(t *testing.T) { + t.Run("GetEffectiveAt", func(t *testing.T) { t.Parallel() // Arrange - obj := &DeletedContact{} - var expected string - obj.ID = expected + obj := &Credit{} + var expected time.Time + obj.EffectiveAt = expected // Act & Assert - assert.Equal(t, expected, obj.GetID(), "getter should return the property value") + assert.Equal(t, expected, obj.GetEffectiveAt(), "getter should return the property value") }) - t.Run("GetID_NilReceiver", func(t *testing.T) { + t.Run("GetEffectiveAt_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DeletedContact + var obj *Credit // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetID() // Should return zero value + _ = obj.GetEffectiveAt() // Should return zero value }) - t.Run("GetDeleted", func(t *testing.T) { + t.Run("GetExpiresAt", func(t *testing.T) { t.Parallel() // Arrange - obj := &DeletedContact{} - var expected bool - obj.Deleted = expected + obj := &Credit{} + var expected *time.Time + obj.ExpiresAt = expected // Act & Assert - assert.Equal(t, expected, obj.GetDeleted(), "getter should return the property value") + assert.Equal(t, expected, obj.GetExpiresAt(), "getter should return the property value") }) - t.Run("GetDeleted_NilReceiver", func(t *testing.T) { + t.Run("GetExpiresAt_NilValue", func(t *testing.T) { t.Parallel() - var obj *DeletedContact + // Arrange + obj := &Credit{} + obj.ExpiresAt = nil + + // Act & Assert + assert.Nil(t, obj.GetExpiresAt(), "getter should return nil when property is nil") + }) + + t.Run("GetExpiresAt_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *Credit // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetDeleted() // Should return zero value + _ = obj.GetExpiresAt() // Should return zero value + }) + + t.Run("GetVoidedAt", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &Credit{} + var expected *time.Time + obj.VoidedAt = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetVoidedAt(), "getter should return the property value") + }) + + t.Run("GetVoidedAt_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &Credit{} + obj.VoidedAt = nil + + // Act & Assert + assert.Nil(t, obj.GetVoidedAt(), "getter should return nil when property is nil") + }) + + t.Run("GetVoidedAt_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *Credit + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetVoidedAt() // Should return zero value + }) + + t.Run("GetCreatedAt", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &Credit{} + var expected time.Time + obj.CreatedAt = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetCreatedAt(), "getter should return the property value") + }) + + t.Run("GetCreatedAt_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *Credit + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetCreatedAt() // Should return zero value }) } -func TestSettersMarkExplicitDeletedContact(t *testing.T) { +func TestSettersMarkExplicitCredit(t *testing.T) { t.Run("SetObject_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DeletedContact{} - var fernTestValueObject DeletedContactObject + obj := &Credit{} + var fernTestValueObject CreditObject // Act obj.SetObject(fernTestValueObject) @@ -19064,7 +18623,7 @@ func TestSettersMarkExplicitDeletedContact(t *testing.T) { t.Run("SetID_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DeletedContact{} + obj := &Credit{} var fernTestValueID string // Act @@ -19092,14 +18651,14 @@ func TestSettersMarkExplicitDeletedContact(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetDeleted_MarksExplicit", func(t *testing.T) { + t.Run("SetKind_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DeletedContact{} - var fernTestValueDeleted bool + obj := &Credit{} + var fernTestValueKind CreditKind // Act - obj.SetDeleted(fernTestValueDeleted) + obj.SetKind(fernTestValueKind) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -19123,116 +18682,14 @@ func TestSettersMarkExplicitDeletedContact(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) -} - -func TestSettersDeletedContactProperty(t *testing.T) { - t.Run("SetObject", func(t *testing.T) { - obj := &DeletedContactProperty{} - var fernTestValueObject DeletedContactPropertyObject - obj.SetObject(fernTestValueObject) - assert.Equal(t, fernTestValueObject, obj.Object) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetID", func(t *testing.T) { - obj := &DeletedContactProperty{} - var fernTestValueID string - obj.SetID(fernTestValueID) - assert.Equal(t, fernTestValueID, obj.ID) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetDeleted", func(t *testing.T) { - obj := &DeletedContactProperty{} - var fernTestValueDeleted bool - obj.SetDeleted(fernTestValueDeleted) - assert.Equal(t, fernTestValueDeleted, obj.Deleted) - assert.NotNil(t, obj.explicitFields) - }) - -} - -func TestGettersDeletedContactProperty(t *testing.T) { - t.Run("GetObject", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &DeletedContactProperty{} - var expected DeletedContactPropertyObject - obj.Object = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetObject(), "getter should return the property value") - }) - - t.Run("GetObject_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *DeletedContactProperty - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetObject() // Should return zero value - }) - - t.Run("GetID", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &DeletedContactProperty{} - var expected string - obj.ID = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetID(), "getter should return the property value") - }) - - t.Run("GetID_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *DeletedContactProperty - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetID() // Should return zero value - }) - - t.Run("GetDeleted", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &DeletedContactProperty{} - var expected bool - obj.Deleted = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetDeleted(), "getter should return the property value") - }) - - t.Run("GetDeleted_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *DeletedContactProperty - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetDeleted() // Should return zero value - }) - -} - -func TestSettersMarkExplicitDeletedContactProperty(t *testing.T) { - t.Run("SetObject_MarksExplicit", func(t *testing.T) { + t.Run("SetAmount_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DeletedContactProperty{} - var fernTestValueObject DeletedContactPropertyObject + obj := &Credit{} + var fernTestValueAmount int64 // Act - obj.SetObject(fernTestValueObject) + obj.SetAmount(fernTestValueAmount) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -19256,14 +18713,14 @@ func TestSettersMarkExplicitDeletedContactProperty(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetID_MarksExplicit", func(t *testing.T) { + t.Run("SetRemaining_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DeletedContactProperty{} - var fernTestValueID string + obj := &Credit{} + var fernTestValueRemaining int64 // Act - obj.SetID(fernTestValueID) + obj.SetRemaining(fernTestValueRemaining) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -19287,14 +18744,14 @@ func TestSettersMarkExplicitDeletedContactProperty(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetDeleted_MarksExplicit", func(t *testing.T) { + t.Run("SetMeter_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DeletedContactProperty{} - var fernTestValueDeleted bool + obj := &Credit{} + var fernTestValueMeter *CreditMeter // Act - obj.SetDeleted(fernTestValueDeleted) + obj.SetMeter(fernTestValueMeter) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -19318,116 +18775,45 @@ func TestSettersMarkExplicitDeletedContactProperty(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) -} - -func TestSettersDeletedEmailTemplate(t *testing.T) { - t.Run("SetObject", func(t *testing.T) { - obj := &DeletedEmailTemplate{} - var fernTestValueObject DeletedEmailTemplateObject - obj.SetObject(fernTestValueObject) - assert.Equal(t, fernTestValueObject, obj.Object) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetID", func(t *testing.T) { - obj := &DeletedEmailTemplate{} - var fernTestValueID string - obj.SetID(fernTestValueID) - assert.Equal(t, fernTestValueID, obj.ID) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetDeleted", func(t *testing.T) { - obj := &DeletedEmailTemplate{} - var fernTestValueDeleted bool - obj.SetDeleted(fernTestValueDeleted) - assert.Equal(t, fernTestValueDeleted, obj.Deleted) - assert.NotNil(t, obj.explicitFields) - }) - -} - -func TestGettersDeletedEmailTemplate(t *testing.T) { - t.Run("GetObject", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &DeletedEmailTemplate{} - var expected DeletedEmailTemplateObject - obj.Object = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetObject(), "getter should return the property value") - }) - - t.Run("GetObject_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *DeletedEmailTemplate - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetObject() // Should return zero value - }) - - t.Run("GetID", func(t *testing.T) { + t.Run("SetMeters_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DeletedEmailTemplate{} - var expected string - obj.ID = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetID(), "getter should return the property value") - }) + obj := &Credit{} + var fernTestValueMeters []CreditMetersItem - t.Run("GetID_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *DeletedEmailTemplate - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetID() // Should return zero value - }) + // Act + obj.SetMeters(fernTestValueMeters) - t.Run("GetDeleted", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &DeletedEmailTemplate{} - var expected bool - obj.Deleted = expected + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") - // Act & Assert - assert.Equal(t, expected, obj.GetDeleted(), "getter should return the property value") - }) + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } - t.Run("GetDeleted_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *DeletedEmailTemplate - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetDeleted() // Should return zero value + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip }) -} - -func TestSettersMarkExplicitDeletedEmailTemplate(t *testing.T) { - t.Run("SetObject_MarksExplicit", func(t *testing.T) { + t.Run("SetAppliesTo_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DeletedEmailTemplate{} - var fernTestValueObject DeletedEmailTemplateObject + obj := &Credit{} + var fernTestValueAppliesTo CreditAppliesTo // Act - obj.SetObject(fernTestValueObject) + obj.SetAppliesTo(fernTestValueAppliesTo) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -19451,14 +18837,14 @@ func TestSettersMarkExplicitDeletedEmailTemplate(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetID_MarksExplicit", func(t *testing.T) { + t.Run("SetSource_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DeletedEmailTemplate{} - var fernTestValueID string + obj := &Credit{} + var fernTestValueSource CreditSource // Act - obj.SetID(fernTestValueID) + obj.SetSource(fernTestValueSource) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -19482,14 +18868,14 @@ func TestSettersMarkExplicitDeletedEmailTemplate(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetDeleted_MarksExplicit", func(t *testing.T) { + t.Run("SetDescription_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DeletedEmailTemplate{} - var fernTestValueDeleted bool + obj := &Credit{} + var fernTestValueDescription string // Act - obj.SetDeleted(fernTestValueDeleted) + obj.SetDescription(fernTestValueDescription) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -19513,116 +18899,45 @@ func TestSettersMarkExplicitDeletedEmailTemplate(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) -} - -func TestSettersDeletedFormSubmission(t *testing.T) { - t.Run("SetObject", func(t *testing.T) { - obj := &DeletedFormSubmission{} - var fernTestValueObject DeletedFormSubmissionObject - obj.SetObject(fernTestValueObject) - assert.Equal(t, fernTestValueObject, obj.Object) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetID", func(t *testing.T) { - obj := &DeletedFormSubmission{} - var fernTestValueID string - obj.SetID(fernTestValueID) - assert.Equal(t, fernTestValueID, obj.ID) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetDeleted", func(t *testing.T) { - obj := &DeletedFormSubmission{} - var fernTestValueDeleted bool - obj.SetDeleted(fernTestValueDeleted) - assert.Equal(t, fernTestValueDeleted, obj.Deleted) - assert.NotNil(t, obj.explicitFields) - }) - -} - -func TestGettersDeletedFormSubmission(t *testing.T) { - t.Run("GetObject", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &DeletedFormSubmission{} - var expected DeletedFormSubmissionObject - obj.Object = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetObject(), "getter should return the property value") - }) - - t.Run("GetObject_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *DeletedFormSubmission - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetObject() // Should return zero value - }) - - t.Run("GetID", func(t *testing.T) { + t.Run("SetEffectiveAt_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DeletedFormSubmission{} - var expected string - obj.ID = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetID(), "getter should return the property value") - }) + obj := &Credit{} + var fernTestValueEffectiveAt time.Time - t.Run("GetID_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *DeletedFormSubmission - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetID() // Should return zero value - }) + // Act + obj.SetEffectiveAt(fernTestValueEffectiveAt) - t.Run("GetDeleted", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &DeletedFormSubmission{} - var expected bool - obj.Deleted = expected + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") - // Act & Assert - assert.Equal(t, expected, obj.GetDeleted(), "getter should return the property value") - }) + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } - t.Run("GetDeleted_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *DeletedFormSubmission - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetDeleted() // Should return zero value + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip }) -} - -func TestSettersMarkExplicitDeletedFormSubmission(t *testing.T) { - t.Run("SetObject_MarksExplicit", func(t *testing.T) { + t.Run("SetExpiresAt_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DeletedFormSubmission{} - var fernTestValueObject DeletedFormSubmissionObject + obj := &Credit{} + var fernTestValueExpiresAt *time.Time // Act - obj.SetObject(fernTestValueObject) + obj.SetExpiresAt(fernTestValueExpiresAt) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -19646,14 +18961,14 @@ func TestSettersMarkExplicitDeletedFormSubmission(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetID_MarksExplicit", func(t *testing.T) { + t.Run("SetVoidedAt_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DeletedFormSubmission{} - var fernTestValueID string + obj := &Credit{} + var fernTestValueVoidedAt *time.Time // Act - obj.SetID(fernTestValueID) + obj.SetVoidedAt(fernTestValueVoidedAt) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -19677,14 +18992,14 @@ func TestSettersMarkExplicitDeletedFormSubmission(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetDeleted_MarksExplicit", func(t *testing.T) { + t.Run("SetCreatedAt_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DeletedFormSubmission{} - var fernTestValueDeleted bool + obj := &Credit{} + var fernTestValueCreatedAt time.Time // Act - obj.SetDeleted(fernTestValueDeleted) + obj.SetCreatedAt(fernTestValueCreatedAt) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -19710,39 +19025,39 @@ func TestSettersMarkExplicitDeletedFormSubmission(t *testing.T) { } -func TestSettersDeletedHookApplication(t *testing.T) { +func TestSettersCreditList(t *testing.T) { t.Run("SetObject", func(t *testing.T) { - obj := &DeletedHookApplication{} - var fernTestValueObject DeletedHookApplicationObject + obj := &CreditList{} + var fernTestValueObject CreditListObject obj.SetObject(fernTestValueObject) assert.Equal(t, fernTestValueObject, obj.Object) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetID", func(t *testing.T) { - obj := &DeletedHookApplication{} - var fernTestValueID string - obj.SetID(fernTestValueID) - assert.Equal(t, fernTestValueID, obj.ID) + t.Run("SetData", func(t *testing.T) { + obj := &CreditList{} + var fernTestValueData []*Credit + obj.SetData(fernTestValueData) + assert.Equal(t, fernTestValueData, obj.Data) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetDeleted", func(t *testing.T) { - obj := &DeletedHookApplication{} - var fernTestValueDeleted bool - obj.SetDeleted(fernTestValueDeleted) - assert.Equal(t, fernTestValueDeleted, obj.Deleted) + t.Run("SetHasMore", func(t *testing.T) { + obj := &CreditList{} + var fernTestValueHasMore bool + obj.SetHasMore(fernTestValueHasMore) + assert.Equal(t, fernTestValueHasMore, obj.HasMore) assert.NotNil(t, obj.explicitFields) }) } -func TestGettersDeletedHookApplication(t *testing.T) { +func TestGettersCreditList(t *testing.T) { t.Run("GetObject", func(t *testing.T) { t.Parallel() // Arrange - obj := &DeletedHookApplication{} - var expected DeletedHookApplicationObject + obj := &CreditList{} + var expected CreditListObject obj.Object = expected // Act & Assert @@ -19751,7 +19066,7 @@ func TestGettersDeletedHookApplication(t *testing.T) { t.Run("GetObject_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DeletedHookApplication + var obj *CreditList // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -19761,60 +19076,70 @@ func TestGettersDeletedHookApplication(t *testing.T) { _ = obj.GetObject() // Should return zero value }) - t.Run("GetID", func(t *testing.T) { + t.Run("GetData", func(t *testing.T) { t.Parallel() // Arrange - obj := &DeletedHookApplication{} - var expected string - obj.ID = expected + obj := &CreditList{} + var expected []*Credit + obj.Data = expected // Act & Assert - assert.Equal(t, expected, obj.GetID(), "getter should return the property value") + assert.Equal(t, expected, obj.GetData(), "getter should return the property value") }) - t.Run("GetID_NilReceiver", func(t *testing.T) { + t.Run("GetData_NilValue", func(t *testing.T) { t.Parallel() - var obj *DeletedHookApplication + // Arrange + obj := &CreditList{} + obj.Data = nil + + // Act & Assert + assert.Nil(t, obj.GetData(), "getter should return nil when property is nil") + }) + + t.Run("GetData_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *CreditList // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetID() // Should return zero value + _ = obj.GetData() // Should return zero value }) - t.Run("GetDeleted", func(t *testing.T) { + t.Run("GetHasMore", func(t *testing.T) { t.Parallel() // Arrange - obj := &DeletedHookApplication{} + obj := &CreditList{} var expected bool - obj.Deleted = expected + obj.HasMore = expected // Act & Assert - assert.Equal(t, expected, obj.GetDeleted(), "getter should return the property value") + assert.Equal(t, expected, obj.GetHasMore(), "getter should return the property value") }) - t.Run("GetDeleted_NilReceiver", func(t *testing.T) { + t.Run("GetHasMore_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DeletedHookApplication + var obj *CreditList // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetDeleted() // Should return zero value + _ = obj.GetHasMore() // Should return zero value }) } -func TestSettersMarkExplicitDeletedHookApplication(t *testing.T) { +func TestSettersMarkExplicitCreditList(t *testing.T) { t.Run("SetObject_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DeletedHookApplication{} - var fernTestValueObject DeletedHookApplicationObject + obj := &CreditList{} + var fernTestValueObject CreditListObject // Act obj.SetObject(fernTestValueObject) @@ -19841,14 +19166,14 @@ func TestSettersMarkExplicitDeletedHookApplication(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetID_MarksExplicit", func(t *testing.T) { + t.Run("SetData_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DeletedHookApplication{} - var fernTestValueID string + obj := &CreditList{} + var fernTestValueData []*Credit // Act - obj.SetID(fernTestValueID) + obj.SetData(fernTestValueData) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -19872,14 +19197,14 @@ func TestSettersMarkExplicitDeletedHookApplication(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetDeleted_MarksExplicit", func(t *testing.T) { + t.Run("SetHasMore_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DeletedHookApplication{} - var fernTestValueDeleted bool + obj := &CreditList{} + var fernTestValueHasMore bool // Act - obj.SetDeleted(fernTestValueDeleted) + obj.SetHasMore(fernTestValueHasMore) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -19905,39 +19230,71 @@ func TestSettersMarkExplicitDeletedHookApplication(t *testing.T) { } -func TestSettersDeletedHookEndpoint(t *testing.T) { +func TestSettersDedicatedIPPool(t *testing.T) { t.Run("SetObject", func(t *testing.T) { - obj := &DeletedHookEndpoint{} - var fernTestValueObject DeletedHookEndpointObject + obj := &DedicatedIPPool{} + var fernTestValueObject DedicatedIPPoolObject obj.SetObject(fernTestValueObject) assert.Equal(t, fernTestValueObject, obj.Object) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetID", func(t *testing.T) { - obj := &DeletedHookEndpoint{} - var fernTestValueID string - obj.SetID(fernTestValueID) - assert.Equal(t, fernTestValueID, obj.ID) + t.Run("SetStatus", func(t *testing.T) { + obj := &DedicatedIPPool{} + var fernTestValueStatus DedicatedIPPoolStatus + obj.SetStatus(fernTestValueStatus) + assert.Equal(t, fernTestValueStatus, obj.Status) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetDeleted", func(t *testing.T) { - obj := &DeletedHookEndpoint{} - var fernTestValueDeleted bool - obj.SetDeleted(fernTestValueDeleted) - assert.Equal(t, fernTestValueDeleted, obj.Deleted) + t.Run("SetIps", func(t *testing.T) { + obj := &DedicatedIPPool{} + var fernTestValueIps []*DedicatedIPPoolIpsItem + obj.SetIps(fernTestValueIps) + assert.Equal(t, fernTestValueIps, obj.Ips) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetDedicatedShare", func(t *testing.T) { + obj := &DedicatedIPPool{} + var fernTestValueDedicatedShare *float64 + obj.SetDedicatedShare(fernTestValueDedicatedShare) + assert.Equal(t, fernTestValueDedicatedShare, obj.DedicatedShare) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetMessage", func(t *testing.T) { + obj := &DedicatedIPPool{} + var fernTestValueMessage *string + obj.SetMessage(fernTestValueMessage) + assert.Equal(t, fernTestValueMessage, obj.Message) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetCreatedAt", func(t *testing.T) { + obj := &DedicatedIPPool{} + var fernTestValueCreatedAt *time.Time + obj.SetCreatedAt(fernTestValueCreatedAt) + assert.Equal(t, fernTestValueCreatedAt, obj.CreatedAt) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetReadyAt", func(t *testing.T) { + obj := &DedicatedIPPool{} + var fernTestValueReadyAt *time.Time + obj.SetReadyAt(fernTestValueReadyAt) + assert.Equal(t, fernTestValueReadyAt, obj.ReadyAt) assert.NotNil(t, obj.explicitFields) }) } -func TestGettersDeletedHookEndpoint(t *testing.T) { +func TestGettersDedicatedIPPool(t *testing.T) { t.Run("GetObject", func(t *testing.T) { t.Parallel() // Arrange - obj := &DeletedHookEndpoint{} - var expected DeletedHookEndpointObject + obj := &DedicatedIPPool{} + var expected DedicatedIPPoolObject obj.Object = expected // Act & Assert @@ -19946,7 +19303,7 @@ func TestGettersDeletedHookEndpoint(t *testing.T) { t.Run("GetObject_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DeletedHookEndpoint + var obj *DedicatedIPPool // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -19956,60 +19313,202 @@ func TestGettersDeletedHookEndpoint(t *testing.T) { _ = obj.GetObject() // Should return zero value }) - t.Run("GetID", func(t *testing.T) { + t.Run("GetStatus", func(t *testing.T) { t.Parallel() // Arrange - obj := &DeletedHookEndpoint{} - var expected string - obj.ID = expected + obj := &DedicatedIPPool{} + var expected DedicatedIPPoolStatus + obj.Status = expected // Act & Assert - assert.Equal(t, expected, obj.GetID(), "getter should return the property value") + assert.Equal(t, expected, obj.GetStatus(), "getter should return the property value") }) - t.Run("GetID_NilReceiver", func(t *testing.T) { + t.Run("GetStatus_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DeletedHookEndpoint + var obj *DedicatedIPPool // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetID() // Should return zero value + _ = obj.GetStatus() // Should return zero value }) - t.Run("GetDeleted", func(t *testing.T) { + t.Run("GetIps", func(t *testing.T) { t.Parallel() // Arrange - obj := &DeletedHookEndpoint{} - var expected bool - obj.Deleted = expected + obj := &DedicatedIPPool{} + var expected []*DedicatedIPPoolIpsItem + obj.Ips = expected // Act & Assert - assert.Equal(t, expected, obj.GetDeleted(), "getter should return the property value") + assert.Equal(t, expected, obj.GetIps(), "getter should return the property value") }) - t.Run("GetDeleted_NilReceiver", func(t *testing.T) { + t.Run("GetIps_NilValue", func(t *testing.T) { t.Parallel() - var obj *DeletedHookEndpoint + // Arrange + obj := &DedicatedIPPool{} + obj.Ips = nil + + // Act & Assert + assert.Nil(t, obj.GetIps(), "getter should return nil when property is nil") + }) + + t.Run("GetIps_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *DedicatedIPPool // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetDeleted() // Should return zero value + _ = obj.GetIps() // Should return zero value + }) + + t.Run("GetDedicatedShare", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DedicatedIPPool{} + var expected *float64 + obj.DedicatedShare = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetDedicatedShare(), "getter should return the property value") + }) + + t.Run("GetDedicatedShare_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DedicatedIPPool{} + obj.DedicatedShare = nil + + // Act & Assert + assert.Nil(t, obj.GetDedicatedShare(), "getter should return nil when property is nil") + }) + + t.Run("GetDedicatedShare_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *DedicatedIPPool + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetDedicatedShare() // Should return zero value + }) + + t.Run("GetMessage", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DedicatedIPPool{} + var expected *string + obj.Message = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetMessage(), "getter should return the property value") + }) + + t.Run("GetMessage_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DedicatedIPPool{} + obj.Message = nil + + // Act & Assert + assert.Nil(t, obj.GetMessage(), "getter should return nil when property is nil") + }) + + t.Run("GetMessage_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *DedicatedIPPool + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetMessage() // Should return zero value + }) + + t.Run("GetCreatedAt", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DedicatedIPPool{} + var expected *time.Time + obj.CreatedAt = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetCreatedAt(), "getter should return the property value") + }) + + t.Run("GetCreatedAt_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DedicatedIPPool{} + obj.CreatedAt = nil + + // Act & Assert + assert.Nil(t, obj.GetCreatedAt(), "getter should return nil when property is nil") + }) + + t.Run("GetCreatedAt_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *DedicatedIPPool + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetCreatedAt() // Should return zero value + }) + + t.Run("GetReadyAt", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DedicatedIPPool{} + var expected *time.Time + obj.ReadyAt = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetReadyAt(), "getter should return the property value") + }) + + t.Run("GetReadyAt_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DedicatedIPPool{} + obj.ReadyAt = nil + + // Act & Assert + assert.Nil(t, obj.GetReadyAt(), "getter should return nil when property is nil") + }) + + t.Run("GetReadyAt_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *DedicatedIPPool + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetReadyAt() // Should return zero value }) } -func TestSettersMarkExplicitDeletedHookEndpoint(t *testing.T) { +func TestSettersMarkExplicitDedicatedIPPool(t *testing.T) { t.Run("SetObject_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DeletedHookEndpoint{} - var fernTestValueObject DeletedHookEndpointObject + obj := &DedicatedIPPool{} + var fernTestValueObject DedicatedIPPoolObject // Act obj.SetObject(fernTestValueObject) @@ -20036,14 +19535,14 @@ func TestSettersMarkExplicitDeletedHookEndpoint(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetID_MarksExplicit", func(t *testing.T) { + t.Run("SetStatus_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DeletedHookEndpoint{} - var fernTestValueID string + obj := &DedicatedIPPool{} + var fernTestValueStatus DedicatedIPPoolStatus // Act - obj.SetID(fernTestValueID) + obj.SetStatus(fernTestValueStatus) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -20067,14 +19566,14 @@ func TestSettersMarkExplicitDeletedHookEndpoint(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetDeleted_MarksExplicit", func(t *testing.T) { + t.Run("SetIps_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DeletedHookEndpoint{} - var fernTestValueDeleted bool + obj := &DedicatedIPPool{} + var fernTestValueIps []*DedicatedIPPoolIpsItem // Act - obj.SetDeleted(fernTestValueDeleted) + obj.SetIps(fernTestValueIps) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -20098,116 +19597,45 @@ func TestSettersMarkExplicitDeletedHookEndpoint(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) -} - -func TestSettersDeletedInboxThread(t *testing.T) { - t.Run("SetObject", func(t *testing.T) { - obj := &DeletedInboxThread{} - var fernTestValueObject DeletedInboxThreadObject - obj.SetObject(fernTestValueObject) - assert.Equal(t, fernTestValueObject, obj.Object) - assert.NotNil(t, obj.explicitFields) - }) + t.Run("SetDedicatedShare_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DedicatedIPPool{} + var fernTestValueDedicatedShare *float64 - t.Run("SetID", func(t *testing.T) { - obj := &DeletedInboxThread{} - var fernTestValueID string - obj.SetID(fernTestValueID) - assert.Equal(t, fernTestValueID, obj.ID) - assert.NotNil(t, obj.explicitFields) - }) + // Act + obj.SetDedicatedShare(fernTestValueDedicatedShare) - t.Run("SetDeleted", func(t *testing.T) { - obj := &DeletedInboxThread{} - var fernTestValueDeleted bool - obj.SetDeleted(fernTestValueDeleted) - assert.Equal(t, fernTestValueDeleted, obj.Deleted) - assert.NotNil(t, obj.explicitFields) - }) + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") -} - -func TestGettersDeletedInboxThread(t *testing.T) { - t.Run("GetObject", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &DeletedInboxThread{} - var expected DeletedInboxThreadObject - obj.Object = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetObject(), "getter should return the property value") - }) - - t.Run("GetObject_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *DeletedInboxThread - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetObject() // Should return zero value - }) - - t.Run("GetID", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &DeletedInboxThread{} - var expected string - obj.ID = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetID(), "getter should return the property value") - }) - - t.Run("GetID_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *DeletedInboxThread - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetID() // Should return zero value - }) - - t.Run("GetDeleted", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &DeletedInboxThread{} - var expected bool - obj.Deleted = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetDeleted(), "getter should return the property value") - }) + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } - t.Run("GetDeleted_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *DeletedInboxThread - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetDeleted() // Should return zero value + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip }) -} - -func TestSettersMarkExplicitDeletedInboxThread(t *testing.T) { - t.Run("SetObject_MarksExplicit", func(t *testing.T) { + t.Run("SetMessage_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DeletedInboxThread{} - var fernTestValueObject DeletedInboxThreadObject + obj := &DedicatedIPPool{} + var fernTestValueMessage *string // Act - obj.SetObject(fernTestValueObject) + obj.SetMessage(fernTestValueMessage) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -20231,14 +19659,14 @@ func TestSettersMarkExplicitDeletedInboxThread(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetID_MarksExplicit", func(t *testing.T) { + t.Run("SetCreatedAt_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DeletedInboxThread{} - var fernTestValueID string + obj := &DedicatedIPPool{} + var fernTestValueCreatedAt *time.Time // Act - obj.SetID(fernTestValueID) + obj.SetCreatedAt(fernTestValueCreatedAt) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -20262,14 +19690,14 @@ func TestSettersMarkExplicitDeletedInboxThread(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetDeleted_MarksExplicit", func(t *testing.T) { + t.Run("SetReadyAt_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DeletedInboxThread{} - var fernTestValueDeleted bool + obj := &DedicatedIPPool{} + var fernTestValueReadyAt *time.Time // Act - obj.SetDeleted(fernTestValueDeleted) + obj.SetReadyAt(fernTestValueReadyAt) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -20295,145 +19723,83 @@ func TestSettersMarkExplicitDeletedInboxThread(t *testing.T) { } -func TestSettersDeletedReceivedEmail(t *testing.T) { - t.Run("SetObject", func(t *testing.T) { - obj := &DeletedReceivedEmail{} - var fernTestValueObject DeletedReceivedEmailObject - obj.SetObject(fernTestValueObject) - assert.Equal(t, fernTestValueObject, obj.Object) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetID", func(t *testing.T) { - obj := &DeletedReceivedEmail{} - var fernTestValueID string - obj.SetID(fernTestValueID) - assert.Equal(t, fernTestValueID, obj.ID) +func TestSettersDedicatedIPPoolIpsItem(t *testing.T) { + t.Run("SetIP", func(t *testing.T) { + obj := &DedicatedIPPoolIpsItem{} + var fernTestValueIP string + obj.SetIP(fernTestValueIP) + assert.Equal(t, fernTestValueIP, obj.IP) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetDeleted", func(t *testing.T) { - obj := &DeletedReceivedEmail{} - var fernTestValueDeleted bool - obj.SetDeleted(fernTestValueDeleted) - assert.Equal(t, fernTestValueDeleted, obj.Deleted) + t.Run("SetDelivered7D", func(t *testing.T) { + obj := &DedicatedIPPoolIpsItem{} + var fernTestValueDelivered7D int64 + obj.SetDelivered7D(fernTestValueDelivered7D) + assert.Equal(t, fernTestValueDelivered7D, obj.Delivered7D) assert.NotNil(t, obj.explicitFields) }) } -func TestGettersDeletedReceivedEmail(t *testing.T) { - t.Run("GetObject", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &DeletedReceivedEmail{} - var expected DeletedReceivedEmailObject - obj.Object = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetObject(), "getter should return the property value") - }) - - t.Run("GetObject_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *DeletedReceivedEmail - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetObject() // Should return zero value - }) - - t.Run("GetID", func(t *testing.T) { +func TestGettersDedicatedIPPoolIpsItem(t *testing.T) { + t.Run("GetIP", func(t *testing.T) { t.Parallel() // Arrange - obj := &DeletedReceivedEmail{} + obj := &DedicatedIPPoolIpsItem{} var expected string - obj.ID = expected + obj.IP = expected // Act & Assert - assert.Equal(t, expected, obj.GetID(), "getter should return the property value") + assert.Equal(t, expected, obj.GetIP(), "getter should return the property value") }) - t.Run("GetID_NilReceiver", func(t *testing.T) { + t.Run("GetIP_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DeletedReceivedEmail + var obj *DedicatedIPPoolIpsItem // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetID() // Should return zero value + _ = obj.GetIP() // Should return zero value }) - t.Run("GetDeleted", func(t *testing.T) { + t.Run("GetDelivered7D", func(t *testing.T) { t.Parallel() // Arrange - obj := &DeletedReceivedEmail{} - var expected bool - obj.Deleted = expected + obj := &DedicatedIPPoolIpsItem{} + var expected int64 + obj.Delivered7D = expected // Act & Assert - assert.Equal(t, expected, obj.GetDeleted(), "getter should return the property value") + assert.Equal(t, expected, obj.GetDelivered7D(), "getter should return the property value") }) - t.Run("GetDeleted_NilReceiver", func(t *testing.T) { + t.Run("GetDelivered7D_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DeletedReceivedEmail + var obj *DedicatedIPPoolIpsItem // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetDeleted() // Should return zero value + _ = obj.GetDelivered7D() // Should return zero value }) } -func TestSettersMarkExplicitDeletedReceivedEmail(t *testing.T) { - t.Run("SetObject_MarksExplicit", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &DeletedReceivedEmail{} - var fernTestValueObject DeletedReceivedEmailObject - - // Act - obj.SetObject(fernTestValueObject) - - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") - - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } - - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip - }) - - t.Run("SetID_MarksExplicit", func(t *testing.T) { +func TestSettersMarkExplicitDedicatedIPPoolIpsItem(t *testing.T) { + t.Run("SetIP_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DeletedReceivedEmail{} - var fernTestValueID string + obj := &DedicatedIPPoolIpsItem{} + var fernTestValueIP string // Act - obj.SetID(fernTestValueID) + obj.SetIP(fernTestValueIP) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -20457,14 +19823,14 @@ func TestSettersMarkExplicitDeletedReceivedEmail(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetDeleted_MarksExplicit", func(t *testing.T) { + t.Run("SetDelivered7D_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DeletedReceivedEmail{} - var fernTestValueDeleted bool + obj := &DedicatedIPPoolIpsItem{} + var fernTestValueDelivered7D int64 // Act - obj.SetDeleted(fernTestValueDeleted) + obj.SetDelivered7D(fernTestValueDelivered7D) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -20490,17 +19856,17 @@ func TestSettersMarkExplicitDeletedReceivedEmail(t *testing.T) { } -func TestSettersDeletedRiskLimitBucket(t *testing.T) { +func TestSettersDeletedAudience(t *testing.T) { t.Run("SetObject", func(t *testing.T) { - obj := &DeletedRiskLimitBucket{} - var fernTestValueObject DeletedRiskLimitBucketObject + obj := &DeletedAudience{} + var fernTestValueObject DeletedAudienceObject obj.SetObject(fernTestValueObject) assert.Equal(t, fernTestValueObject, obj.Object) assert.NotNil(t, obj.explicitFields) }) t.Run("SetID", func(t *testing.T) { - obj := &DeletedRiskLimitBucket{} + obj := &DeletedAudience{} var fernTestValueID string obj.SetID(fernTestValueID) assert.Equal(t, fernTestValueID, obj.ID) @@ -20508,7 +19874,7 @@ func TestSettersDeletedRiskLimitBucket(t *testing.T) { }) t.Run("SetDeleted", func(t *testing.T) { - obj := &DeletedRiskLimitBucket{} + obj := &DeletedAudience{} var fernTestValueDeleted bool obj.SetDeleted(fernTestValueDeleted) assert.Equal(t, fernTestValueDeleted, obj.Deleted) @@ -20517,12 +19883,12 @@ func TestSettersDeletedRiskLimitBucket(t *testing.T) { } -func TestGettersDeletedRiskLimitBucket(t *testing.T) { +func TestGettersDeletedAudience(t *testing.T) { t.Run("GetObject", func(t *testing.T) { t.Parallel() // Arrange - obj := &DeletedRiskLimitBucket{} - var expected DeletedRiskLimitBucketObject + obj := &DeletedAudience{} + var expected DeletedAudienceObject obj.Object = expected // Act & Assert @@ -20531,7 +19897,7 @@ func TestGettersDeletedRiskLimitBucket(t *testing.T) { t.Run("GetObject_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DeletedRiskLimitBucket + var obj *DeletedAudience // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -20544,7 +19910,7 @@ func TestGettersDeletedRiskLimitBucket(t *testing.T) { t.Run("GetID", func(t *testing.T) { t.Parallel() // Arrange - obj := &DeletedRiskLimitBucket{} + obj := &DeletedAudience{} var expected string obj.ID = expected @@ -20554,7 +19920,7 @@ func TestGettersDeletedRiskLimitBucket(t *testing.T) { t.Run("GetID_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DeletedRiskLimitBucket + var obj *DeletedAudience // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -20567,7 +19933,7 @@ func TestGettersDeletedRiskLimitBucket(t *testing.T) { t.Run("GetDeleted", func(t *testing.T) { t.Parallel() // Arrange - obj := &DeletedRiskLimitBucket{} + obj := &DeletedAudience{} var expected bool obj.Deleted = expected @@ -20577,7 +19943,7 @@ func TestGettersDeletedRiskLimitBucket(t *testing.T) { t.Run("GetDeleted_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DeletedRiskLimitBucket + var obj *DeletedAudience // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -20589,12 +19955,12 @@ func TestGettersDeletedRiskLimitBucket(t *testing.T) { } -func TestSettersMarkExplicitDeletedRiskLimitBucket(t *testing.T) { +func TestSettersMarkExplicitDeletedAudience(t *testing.T) { t.Run("SetObject_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DeletedRiskLimitBucket{} - var fernTestValueObject DeletedRiskLimitBucketObject + obj := &DeletedAudience{} + var fernTestValueObject DeletedAudienceObject // Act obj.SetObject(fernTestValueObject) @@ -20624,7 +19990,7 @@ func TestSettersMarkExplicitDeletedRiskLimitBucket(t *testing.T) { t.Run("SetID_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DeletedRiskLimitBucket{} + obj := &DeletedAudience{} var fernTestValueID string // Act @@ -20655,7 +20021,7 @@ func TestSettersMarkExplicitDeletedRiskLimitBucket(t *testing.T) { t.Run("SetDeleted_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DeletedRiskLimitBucket{} + obj := &DeletedAudience{} var fernTestValueDeleted bool // Act @@ -20685,17 +20051,17 @@ func TestSettersMarkExplicitDeletedRiskLimitBucket(t *testing.T) { } -func TestSettersDeletedRiskListEntry(t *testing.T) { +func TestSettersDeletedBroadcast(t *testing.T) { t.Run("SetObject", func(t *testing.T) { - obj := &DeletedRiskListEntry{} - var fernTestValueObject DeletedRiskListEntryObject + obj := &DeletedBroadcast{} + var fernTestValueObject DeletedBroadcastObject obj.SetObject(fernTestValueObject) assert.Equal(t, fernTestValueObject, obj.Object) assert.NotNil(t, obj.explicitFields) }) t.Run("SetID", func(t *testing.T) { - obj := &DeletedRiskListEntry{} + obj := &DeletedBroadcast{} var fernTestValueID string obj.SetID(fernTestValueID) assert.Equal(t, fernTestValueID, obj.ID) @@ -20703,7 +20069,7 @@ func TestSettersDeletedRiskListEntry(t *testing.T) { }) t.Run("SetDeleted", func(t *testing.T) { - obj := &DeletedRiskListEntry{} + obj := &DeletedBroadcast{} var fernTestValueDeleted bool obj.SetDeleted(fernTestValueDeleted) assert.Equal(t, fernTestValueDeleted, obj.Deleted) @@ -20712,12 +20078,12 @@ func TestSettersDeletedRiskListEntry(t *testing.T) { } -func TestGettersDeletedRiskListEntry(t *testing.T) { +func TestGettersDeletedBroadcast(t *testing.T) { t.Run("GetObject", func(t *testing.T) { t.Parallel() // Arrange - obj := &DeletedRiskListEntry{} - var expected DeletedRiskListEntryObject + obj := &DeletedBroadcast{} + var expected DeletedBroadcastObject obj.Object = expected // Act & Assert @@ -20726,7 +20092,7 @@ func TestGettersDeletedRiskListEntry(t *testing.T) { t.Run("GetObject_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DeletedRiskListEntry + var obj *DeletedBroadcast // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -20739,7 +20105,7 @@ func TestGettersDeletedRiskListEntry(t *testing.T) { t.Run("GetID", func(t *testing.T) { t.Parallel() // Arrange - obj := &DeletedRiskListEntry{} + obj := &DeletedBroadcast{} var expected string obj.ID = expected @@ -20749,7 +20115,7 @@ func TestGettersDeletedRiskListEntry(t *testing.T) { t.Run("GetID_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DeletedRiskListEntry + var obj *DeletedBroadcast // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -20762,7 +20128,7 @@ func TestGettersDeletedRiskListEntry(t *testing.T) { t.Run("GetDeleted", func(t *testing.T) { t.Parallel() // Arrange - obj := &DeletedRiskListEntry{} + obj := &DeletedBroadcast{} var expected bool obj.Deleted = expected @@ -20772,7 +20138,7 @@ func TestGettersDeletedRiskListEntry(t *testing.T) { t.Run("GetDeleted_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DeletedRiskListEntry + var obj *DeletedBroadcast // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -20784,12 +20150,12 @@ func TestGettersDeletedRiskListEntry(t *testing.T) { } -func TestSettersMarkExplicitDeletedRiskListEntry(t *testing.T) { +func TestSettersMarkExplicitDeletedBroadcast(t *testing.T) { t.Run("SetObject_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DeletedRiskListEntry{} - var fernTestValueObject DeletedRiskListEntryObject + obj := &DeletedBroadcast{} + var fernTestValueObject DeletedBroadcastObject // Act obj.SetObject(fernTestValueObject) @@ -20819,7 +20185,7 @@ func TestSettersMarkExplicitDeletedRiskListEntry(t *testing.T) { t.Run("SetID_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DeletedRiskListEntry{} + obj := &DeletedBroadcast{} var fernTestValueID string // Act @@ -20850,7 +20216,7 @@ func TestSettersMarkExplicitDeletedRiskListEntry(t *testing.T) { t.Run("SetDeleted_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DeletedRiskListEntry{} + obj := &DeletedBroadcast{} var fernTestValueDeleted bool // Act @@ -20880,17 +20246,17 @@ func TestSettersMarkExplicitDeletedRiskListEntry(t *testing.T) { } -func TestSettersDeletedRiskRule(t *testing.T) { +func TestSettersDeletedContact(t *testing.T) { t.Run("SetObject", func(t *testing.T) { - obj := &DeletedRiskRule{} - var fernTestValueObject DeletedRiskRuleObject + obj := &DeletedContact{} + var fernTestValueObject DeletedContactObject obj.SetObject(fernTestValueObject) assert.Equal(t, fernTestValueObject, obj.Object) assert.NotNil(t, obj.explicitFields) }) t.Run("SetID", func(t *testing.T) { - obj := &DeletedRiskRule{} + obj := &DeletedContact{} var fernTestValueID string obj.SetID(fernTestValueID) assert.Equal(t, fernTestValueID, obj.ID) @@ -20898,7 +20264,7 @@ func TestSettersDeletedRiskRule(t *testing.T) { }) t.Run("SetDeleted", func(t *testing.T) { - obj := &DeletedRiskRule{} + obj := &DeletedContact{} var fernTestValueDeleted bool obj.SetDeleted(fernTestValueDeleted) assert.Equal(t, fernTestValueDeleted, obj.Deleted) @@ -20907,12 +20273,12 @@ func TestSettersDeletedRiskRule(t *testing.T) { } -func TestGettersDeletedRiskRule(t *testing.T) { +func TestGettersDeletedContact(t *testing.T) { t.Run("GetObject", func(t *testing.T) { t.Parallel() // Arrange - obj := &DeletedRiskRule{} - var expected DeletedRiskRuleObject + obj := &DeletedContact{} + var expected DeletedContactObject obj.Object = expected // Act & Assert @@ -20921,7 +20287,7 @@ func TestGettersDeletedRiskRule(t *testing.T) { t.Run("GetObject_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DeletedRiskRule + var obj *DeletedContact // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -20934,7 +20300,7 @@ func TestGettersDeletedRiskRule(t *testing.T) { t.Run("GetID", func(t *testing.T) { t.Parallel() // Arrange - obj := &DeletedRiskRule{} + obj := &DeletedContact{} var expected string obj.ID = expected @@ -20944,7 +20310,7 @@ func TestGettersDeletedRiskRule(t *testing.T) { t.Run("GetID_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DeletedRiskRule + var obj *DeletedContact // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -20957,7 +20323,7 @@ func TestGettersDeletedRiskRule(t *testing.T) { t.Run("GetDeleted", func(t *testing.T) { t.Parallel() // Arrange - obj := &DeletedRiskRule{} + obj := &DeletedContact{} var expected bool obj.Deleted = expected @@ -20967,7 +20333,7 @@ func TestGettersDeletedRiskRule(t *testing.T) { t.Run("GetDeleted_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DeletedRiskRule + var obj *DeletedContact // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -20979,12 +20345,12 @@ func TestGettersDeletedRiskRule(t *testing.T) { } -func TestSettersMarkExplicitDeletedRiskRule(t *testing.T) { +func TestSettersMarkExplicitDeletedContact(t *testing.T) { t.Run("SetObject_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DeletedRiskRule{} - var fernTestValueObject DeletedRiskRuleObject + obj := &DeletedContact{} + var fernTestValueObject DeletedContactObject // Act obj.SetObject(fernTestValueObject) @@ -21014,7 +20380,7 @@ func TestSettersMarkExplicitDeletedRiskRule(t *testing.T) { t.Run("SetID_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DeletedRiskRule{} + obj := &DeletedContact{} var fernTestValueID string // Act @@ -21045,7 +20411,7 @@ func TestSettersMarkExplicitDeletedRiskRule(t *testing.T) { t.Run("SetDeleted_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DeletedRiskRule{} + obj := &DeletedContact{} var fernTestValueDeleted bool // Act @@ -21075,17 +20441,17 @@ func TestSettersMarkExplicitDeletedRiskRule(t *testing.T) { } -func TestSettersDeletedSchedulingCalendarConnection(t *testing.T) { +func TestSettersDeletedContactProperty(t *testing.T) { t.Run("SetObject", func(t *testing.T) { - obj := &DeletedSchedulingCalendarConnection{} - var fernTestValueObject DeletedSchedulingCalendarConnectionObject + obj := &DeletedContactProperty{} + var fernTestValueObject DeletedContactPropertyObject obj.SetObject(fernTestValueObject) assert.Equal(t, fernTestValueObject, obj.Object) assert.NotNil(t, obj.explicitFields) }) t.Run("SetID", func(t *testing.T) { - obj := &DeletedSchedulingCalendarConnection{} + obj := &DeletedContactProperty{} var fernTestValueID string obj.SetID(fernTestValueID) assert.Equal(t, fernTestValueID, obj.ID) @@ -21093,7 +20459,7 @@ func TestSettersDeletedSchedulingCalendarConnection(t *testing.T) { }) t.Run("SetDeleted", func(t *testing.T) { - obj := &DeletedSchedulingCalendarConnection{} + obj := &DeletedContactProperty{} var fernTestValueDeleted bool obj.SetDeleted(fernTestValueDeleted) assert.Equal(t, fernTestValueDeleted, obj.Deleted) @@ -21102,12 +20468,12 @@ func TestSettersDeletedSchedulingCalendarConnection(t *testing.T) { } -func TestGettersDeletedSchedulingCalendarConnection(t *testing.T) { +func TestGettersDeletedContactProperty(t *testing.T) { t.Run("GetObject", func(t *testing.T) { t.Parallel() // Arrange - obj := &DeletedSchedulingCalendarConnection{} - var expected DeletedSchedulingCalendarConnectionObject + obj := &DeletedContactProperty{} + var expected DeletedContactPropertyObject obj.Object = expected // Act & Assert @@ -21116,7 +20482,7 @@ func TestGettersDeletedSchedulingCalendarConnection(t *testing.T) { t.Run("GetObject_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DeletedSchedulingCalendarConnection + var obj *DeletedContactProperty // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -21129,7 +20495,7 @@ func TestGettersDeletedSchedulingCalendarConnection(t *testing.T) { t.Run("GetID", func(t *testing.T) { t.Parallel() // Arrange - obj := &DeletedSchedulingCalendarConnection{} + obj := &DeletedContactProperty{} var expected string obj.ID = expected @@ -21139,7 +20505,7 @@ func TestGettersDeletedSchedulingCalendarConnection(t *testing.T) { t.Run("GetID_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DeletedSchedulingCalendarConnection + var obj *DeletedContactProperty // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -21152,7 +20518,7 @@ func TestGettersDeletedSchedulingCalendarConnection(t *testing.T) { t.Run("GetDeleted", func(t *testing.T) { t.Parallel() // Arrange - obj := &DeletedSchedulingCalendarConnection{} + obj := &DeletedContactProperty{} var expected bool obj.Deleted = expected @@ -21162,7 +20528,7 @@ func TestGettersDeletedSchedulingCalendarConnection(t *testing.T) { t.Run("GetDeleted_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DeletedSchedulingCalendarConnection + var obj *DeletedContactProperty // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -21174,12 +20540,12 @@ func TestGettersDeletedSchedulingCalendarConnection(t *testing.T) { } -func TestSettersMarkExplicitDeletedSchedulingCalendarConnection(t *testing.T) { +func TestSettersMarkExplicitDeletedContactProperty(t *testing.T) { t.Run("SetObject_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DeletedSchedulingCalendarConnection{} - var fernTestValueObject DeletedSchedulingCalendarConnectionObject + obj := &DeletedContactProperty{} + var fernTestValueObject DeletedContactPropertyObject // Act obj.SetObject(fernTestValueObject) @@ -21209,7 +20575,7 @@ func TestSettersMarkExplicitDeletedSchedulingCalendarConnection(t *testing.T) { t.Run("SetID_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DeletedSchedulingCalendarConnection{} + obj := &DeletedContactProperty{} var fernTestValueID string // Act @@ -21240,7 +20606,7 @@ func TestSettersMarkExplicitDeletedSchedulingCalendarConnection(t *testing.T) { t.Run("SetDeleted_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DeletedSchedulingCalendarConnection{} + obj := &DeletedContactProperty{} var fernTestValueDeleted bool // Act @@ -21270,17 +20636,17 @@ func TestSettersMarkExplicitDeletedSchedulingCalendarConnection(t *testing.T) { } -func TestSettersDeletedSchedulingCalendarDelegation(t *testing.T) { +func TestSettersDeletedEmailTemplate(t *testing.T) { t.Run("SetObject", func(t *testing.T) { - obj := &DeletedSchedulingCalendarDelegation{} - var fernTestValueObject DeletedSchedulingCalendarDelegationObject + obj := &DeletedEmailTemplate{} + var fernTestValueObject DeletedEmailTemplateObject obj.SetObject(fernTestValueObject) assert.Equal(t, fernTestValueObject, obj.Object) assert.NotNil(t, obj.explicitFields) }) t.Run("SetID", func(t *testing.T) { - obj := &DeletedSchedulingCalendarDelegation{} + obj := &DeletedEmailTemplate{} var fernTestValueID string obj.SetID(fernTestValueID) assert.Equal(t, fernTestValueID, obj.ID) @@ -21288,7 +20654,7 @@ func TestSettersDeletedSchedulingCalendarDelegation(t *testing.T) { }) t.Run("SetDeleted", func(t *testing.T) { - obj := &DeletedSchedulingCalendarDelegation{} + obj := &DeletedEmailTemplate{} var fernTestValueDeleted bool obj.SetDeleted(fernTestValueDeleted) assert.Equal(t, fernTestValueDeleted, obj.Deleted) @@ -21297,12 +20663,12 @@ func TestSettersDeletedSchedulingCalendarDelegation(t *testing.T) { } -func TestGettersDeletedSchedulingCalendarDelegation(t *testing.T) { +func TestGettersDeletedEmailTemplate(t *testing.T) { t.Run("GetObject", func(t *testing.T) { t.Parallel() // Arrange - obj := &DeletedSchedulingCalendarDelegation{} - var expected DeletedSchedulingCalendarDelegationObject + obj := &DeletedEmailTemplate{} + var expected DeletedEmailTemplateObject obj.Object = expected // Act & Assert @@ -21311,7 +20677,7 @@ func TestGettersDeletedSchedulingCalendarDelegation(t *testing.T) { t.Run("GetObject_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DeletedSchedulingCalendarDelegation + var obj *DeletedEmailTemplate // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -21324,7 +20690,7 @@ func TestGettersDeletedSchedulingCalendarDelegation(t *testing.T) { t.Run("GetID", func(t *testing.T) { t.Parallel() // Arrange - obj := &DeletedSchedulingCalendarDelegation{} + obj := &DeletedEmailTemplate{} var expected string obj.ID = expected @@ -21334,7 +20700,7 @@ func TestGettersDeletedSchedulingCalendarDelegation(t *testing.T) { t.Run("GetID_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DeletedSchedulingCalendarDelegation + var obj *DeletedEmailTemplate // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -21347,7 +20713,7 @@ func TestGettersDeletedSchedulingCalendarDelegation(t *testing.T) { t.Run("GetDeleted", func(t *testing.T) { t.Parallel() // Arrange - obj := &DeletedSchedulingCalendarDelegation{} + obj := &DeletedEmailTemplate{} var expected bool obj.Deleted = expected @@ -21357,7 +20723,7 @@ func TestGettersDeletedSchedulingCalendarDelegation(t *testing.T) { t.Run("GetDeleted_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DeletedSchedulingCalendarDelegation + var obj *DeletedEmailTemplate // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -21369,12 +20735,12 @@ func TestGettersDeletedSchedulingCalendarDelegation(t *testing.T) { } -func TestSettersMarkExplicitDeletedSchedulingCalendarDelegation(t *testing.T) { +func TestSettersMarkExplicitDeletedEmailTemplate(t *testing.T) { t.Run("SetObject_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DeletedSchedulingCalendarDelegation{} - var fernTestValueObject DeletedSchedulingCalendarDelegationObject + obj := &DeletedEmailTemplate{} + var fernTestValueObject DeletedEmailTemplateObject // Act obj.SetObject(fernTestValueObject) @@ -21404,7 +20770,7 @@ func TestSettersMarkExplicitDeletedSchedulingCalendarDelegation(t *testing.T) { t.Run("SetID_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DeletedSchedulingCalendarDelegation{} + obj := &DeletedEmailTemplate{} var fernTestValueID string // Act @@ -21435,7 +20801,7 @@ func TestSettersMarkExplicitDeletedSchedulingCalendarDelegation(t *testing.T) { t.Run("SetDeleted_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DeletedSchedulingCalendarDelegation{} + obj := &DeletedEmailTemplate{} var fernTestValueDeleted bool // Act @@ -21465,17 +20831,17 @@ func TestSettersMarkExplicitDeletedSchedulingCalendarDelegation(t *testing.T) { } -func TestSettersDeletedSchedulingHost(t *testing.T) { +func TestSettersDeletedFormSubmission(t *testing.T) { t.Run("SetObject", func(t *testing.T) { - obj := &DeletedSchedulingHost{} - var fernTestValueObject DeletedSchedulingHostObject + obj := &DeletedFormSubmission{} + var fernTestValueObject DeletedFormSubmissionObject obj.SetObject(fernTestValueObject) assert.Equal(t, fernTestValueObject, obj.Object) assert.NotNil(t, obj.explicitFields) }) t.Run("SetID", func(t *testing.T) { - obj := &DeletedSchedulingHost{} + obj := &DeletedFormSubmission{} var fernTestValueID string obj.SetID(fernTestValueID) assert.Equal(t, fernTestValueID, obj.ID) @@ -21483,7 +20849,7 @@ func TestSettersDeletedSchedulingHost(t *testing.T) { }) t.Run("SetDeleted", func(t *testing.T) { - obj := &DeletedSchedulingHost{} + obj := &DeletedFormSubmission{} var fernTestValueDeleted bool obj.SetDeleted(fernTestValueDeleted) assert.Equal(t, fernTestValueDeleted, obj.Deleted) @@ -21492,12 +20858,12 @@ func TestSettersDeletedSchedulingHost(t *testing.T) { } -func TestGettersDeletedSchedulingHost(t *testing.T) { +func TestGettersDeletedFormSubmission(t *testing.T) { t.Run("GetObject", func(t *testing.T) { t.Parallel() // Arrange - obj := &DeletedSchedulingHost{} - var expected DeletedSchedulingHostObject + obj := &DeletedFormSubmission{} + var expected DeletedFormSubmissionObject obj.Object = expected // Act & Assert @@ -21506,7 +20872,7 @@ func TestGettersDeletedSchedulingHost(t *testing.T) { t.Run("GetObject_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DeletedSchedulingHost + var obj *DeletedFormSubmission // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -21519,7 +20885,7 @@ func TestGettersDeletedSchedulingHost(t *testing.T) { t.Run("GetID", func(t *testing.T) { t.Parallel() // Arrange - obj := &DeletedSchedulingHost{} + obj := &DeletedFormSubmission{} var expected string obj.ID = expected @@ -21529,7 +20895,7 @@ func TestGettersDeletedSchedulingHost(t *testing.T) { t.Run("GetID_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DeletedSchedulingHost + var obj *DeletedFormSubmission // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -21542,7 +20908,7 @@ func TestGettersDeletedSchedulingHost(t *testing.T) { t.Run("GetDeleted", func(t *testing.T) { t.Parallel() // Arrange - obj := &DeletedSchedulingHost{} + obj := &DeletedFormSubmission{} var expected bool obj.Deleted = expected @@ -21552,7 +20918,7 @@ func TestGettersDeletedSchedulingHost(t *testing.T) { t.Run("GetDeleted_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DeletedSchedulingHost + var obj *DeletedFormSubmission // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -21564,12 +20930,12 @@ func TestGettersDeletedSchedulingHost(t *testing.T) { } -func TestSettersMarkExplicitDeletedSchedulingHost(t *testing.T) { +func TestSettersMarkExplicitDeletedFormSubmission(t *testing.T) { t.Run("SetObject_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DeletedSchedulingHost{} - var fernTestValueObject DeletedSchedulingHostObject + obj := &DeletedFormSubmission{} + var fernTestValueObject DeletedFormSubmissionObject // Act obj.SetObject(fernTestValueObject) @@ -21599,7 +20965,7 @@ func TestSettersMarkExplicitDeletedSchedulingHost(t *testing.T) { t.Run("SetID_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DeletedSchedulingHost{} + obj := &DeletedFormSubmission{} var fernTestValueID string // Act @@ -21630,7 +20996,7 @@ func TestSettersMarkExplicitDeletedSchedulingHost(t *testing.T) { t.Run("SetDeleted_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DeletedSchedulingHost{} + obj := &DeletedFormSubmission{} var fernTestValueDeleted bool // Act @@ -21660,17 +21026,17 @@ func TestSettersMarkExplicitDeletedSchedulingHost(t *testing.T) { } -func TestSettersDeletedSchedulingSchedule(t *testing.T) { +func TestSettersDeletedHookApplication(t *testing.T) { t.Run("SetObject", func(t *testing.T) { - obj := &DeletedSchedulingSchedule{} - var fernTestValueObject DeletedSchedulingScheduleObject + obj := &DeletedHookApplication{} + var fernTestValueObject DeletedHookApplicationObject obj.SetObject(fernTestValueObject) assert.Equal(t, fernTestValueObject, obj.Object) assert.NotNil(t, obj.explicitFields) }) t.Run("SetID", func(t *testing.T) { - obj := &DeletedSchedulingSchedule{} + obj := &DeletedHookApplication{} var fernTestValueID string obj.SetID(fernTestValueID) assert.Equal(t, fernTestValueID, obj.ID) @@ -21678,7 +21044,7 @@ func TestSettersDeletedSchedulingSchedule(t *testing.T) { }) t.Run("SetDeleted", func(t *testing.T) { - obj := &DeletedSchedulingSchedule{} + obj := &DeletedHookApplication{} var fernTestValueDeleted bool obj.SetDeleted(fernTestValueDeleted) assert.Equal(t, fernTestValueDeleted, obj.Deleted) @@ -21687,12 +21053,12 @@ func TestSettersDeletedSchedulingSchedule(t *testing.T) { } -func TestGettersDeletedSchedulingSchedule(t *testing.T) { +func TestGettersDeletedHookApplication(t *testing.T) { t.Run("GetObject", func(t *testing.T) { t.Parallel() // Arrange - obj := &DeletedSchedulingSchedule{} - var expected DeletedSchedulingScheduleObject + obj := &DeletedHookApplication{} + var expected DeletedHookApplicationObject obj.Object = expected // Act & Assert @@ -21701,7 +21067,7 @@ func TestGettersDeletedSchedulingSchedule(t *testing.T) { t.Run("GetObject_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DeletedSchedulingSchedule + var obj *DeletedHookApplication // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -21714,7 +21080,7 @@ func TestGettersDeletedSchedulingSchedule(t *testing.T) { t.Run("GetID", func(t *testing.T) { t.Parallel() // Arrange - obj := &DeletedSchedulingSchedule{} + obj := &DeletedHookApplication{} var expected string obj.ID = expected @@ -21724,7 +21090,7 @@ func TestGettersDeletedSchedulingSchedule(t *testing.T) { t.Run("GetID_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DeletedSchedulingSchedule + var obj *DeletedHookApplication // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -21737,7 +21103,7 @@ func TestGettersDeletedSchedulingSchedule(t *testing.T) { t.Run("GetDeleted", func(t *testing.T) { t.Parallel() // Arrange - obj := &DeletedSchedulingSchedule{} + obj := &DeletedHookApplication{} var expected bool obj.Deleted = expected @@ -21747,7 +21113,7 @@ func TestGettersDeletedSchedulingSchedule(t *testing.T) { t.Run("GetDeleted_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DeletedSchedulingSchedule + var obj *DeletedHookApplication // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -21759,12 +21125,12 @@ func TestGettersDeletedSchedulingSchedule(t *testing.T) { } -func TestSettersMarkExplicitDeletedSchedulingSchedule(t *testing.T) { +func TestSettersMarkExplicitDeletedHookApplication(t *testing.T) { t.Run("SetObject_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DeletedSchedulingSchedule{} - var fernTestValueObject DeletedSchedulingScheduleObject + obj := &DeletedHookApplication{} + var fernTestValueObject DeletedHookApplicationObject // Act obj.SetObject(fernTestValueObject) @@ -21794,7 +21160,7 @@ func TestSettersMarkExplicitDeletedSchedulingSchedule(t *testing.T) { t.Run("SetID_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DeletedSchedulingSchedule{} + obj := &DeletedHookApplication{} var fernTestValueID string // Act @@ -21825,7 +21191,7 @@ func TestSettersMarkExplicitDeletedSchedulingSchedule(t *testing.T) { t.Run("SetDeleted_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DeletedSchedulingSchedule{} + obj := &DeletedHookApplication{} var fernTestValueDeleted bool // Act @@ -21855,17 +21221,17 @@ func TestSettersMarkExplicitDeletedSchedulingSchedule(t *testing.T) { } -func TestSettersDeletedSegment(t *testing.T) { +func TestSettersDeletedHookEndpoint(t *testing.T) { t.Run("SetObject", func(t *testing.T) { - obj := &DeletedSegment{} - var fernTestValueObject DeletedSegmentObject + obj := &DeletedHookEndpoint{} + var fernTestValueObject DeletedHookEndpointObject obj.SetObject(fernTestValueObject) assert.Equal(t, fernTestValueObject, obj.Object) assert.NotNil(t, obj.explicitFields) }) t.Run("SetID", func(t *testing.T) { - obj := &DeletedSegment{} + obj := &DeletedHookEndpoint{} var fernTestValueID string obj.SetID(fernTestValueID) assert.Equal(t, fernTestValueID, obj.ID) @@ -21873,7 +21239,7 @@ func TestSettersDeletedSegment(t *testing.T) { }) t.Run("SetDeleted", func(t *testing.T) { - obj := &DeletedSegment{} + obj := &DeletedHookEndpoint{} var fernTestValueDeleted bool obj.SetDeleted(fernTestValueDeleted) assert.Equal(t, fernTestValueDeleted, obj.Deleted) @@ -21882,12 +21248,12 @@ func TestSettersDeletedSegment(t *testing.T) { } -func TestGettersDeletedSegment(t *testing.T) { +func TestGettersDeletedHookEndpoint(t *testing.T) { t.Run("GetObject", func(t *testing.T) { t.Parallel() // Arrange - obj := &DeletedSegment{} - var expected DeletedSegmentObject + obj := &DeletedHookEndpoint{} + var expected DeletedHookEndpointObject obj.Object = expected // Act & Assert @@ -21896,7 +21262,7 @@ func TestGettersDeletedSegment(t *testing.T) { t.Run("GetObject_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DeletedSegment + var obj *DeletedHookEndpoint // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -21909,7 +21275,7 @@ func TestGettersDeletedSegment(t *testing.T) { t.Run("GetID", func(t *testing.T) { t.Parallel() // Arrange - obj := &DeletedSegment{} + obj := &DeletedHookEndpoint{} var expected string obj.ID = expected @@ -21919,7 +21285,7 @@ func TestGettersDeletedSegment(t *testing.T) { t.Run("GetID_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DeletedSegment + var obj *DeletedHookEndpoint // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -21932,7 +21298,7 @@ func TestGettersDeletedSegment(t *testing.T) { t.Run("GetDeleted", func(t *testing.T) { t.Parallel() // Arrange - obj := &DeletedSegment{} + obj := &DeletedHookEndpoint{} var expected bool obj.Deleted = expected @@ -21942,7 +21308,7 @@ func TestGettersDeletedSegment(t *testing.T) { t.Run("GetDeleted_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DeletedSegment + var obj *DeletedHookEndpoint // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -21954,12 +21320,12 @@ func TestGettersDeletedSegment(t *testing.T) { } -func TestSettersMarkExplicitDeletedSegment(t *testing.T) { +func TestSettersMarkExplicitDeletedHookEndpoint(t *testing.T) { t.Run("SetObject_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DeletedSegment{} - var fernTestValueObject DeletedSegmentObject + obj := &DeletedHookEndpoint{} + var fernTestValueObject DeletedHookEndpointObject // Act obj.SetObject(fernTestValueObject) @@ -21989,7 +21355,7 @@ func TestSettersMarkExplicitDeletedSegment(t *testing.T) { t.Run("SetID_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DeletedSegment{} + obj := &DeletedHookEndpoint{} var fernTestValueID string // Act @@ -22020,7 +21386,7 @@ func TestSettersMarkExplicitDeletedSegment(t *testing.T) { t.Run("SetDeleted_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DeletedSegment{} + obj := &DeletedHookEndpoint{} var fernTestValueDeleted bool // Act @@ -22050,17 +21416,17 @@ func TestSettersMarkExplicitDeletedSegment(t *testing.T) { } -func TestSettersDeletedSignDocument(t *testing.T) { +func TestSettersDeletedInboxThread(t *testing.T) { t.Run("SetObject", func(t *testing.T) { - obj := &DeletedSignDocument{} - var fernTestValueObject DeletedSignDocumentObject + obj := &DeletedInboxThread{} + var fernTestValueObject DeletedInboxThreadObject obj.SetObject(fernTestValueObject) assert.Equal(t, fernTestValueObject, obj.Object) assert.NotNil(t, obj.explicitFields) }) t.Run("SetID", func(t *testing.T) { - obj := &DeletedSignDocument{} + obj := &DeletedInboxThread{} var fernTestValueID string obj.SetID(fernTestValueID) assert.Equal(t, fernTestValueID, obj.ID) @@ -22068,7 +21434,7 @@ func TestSettersDeletedSignDocument(t *testing.T) { }) t.Run("SetDeleted", func(t *testing.T) { - obj := &DeletedSignDocument{} + obj := &DeletedInboxThread{} var fernTestValueDeleted bool obj.SetDeleted(fernTestValueDeleted) assert.Equal(t, fernTestValueDeleted, obj.Deleted) @@ -22077,12 +21443,12 @@ func TestSettersDeletedSignDocument(t *testing.T) { } -func TestGettersDeletedSignDocument(t *testing.T) { +func TestGettersDeletedInboxThread(t *testing.T) { t.Run("GetObject", func(t *testing.T) { t.Parallel() // Arrange - obj := &DeletedSignDocument{} - var expected DeletedSignDocumentObject + obj := &DeletedInboxThread{} + var expected DeletedInboxThreadObject obj.Object = expected // Act & Assert @@ -22091,7 +21457,7 @@ func TestGettersDeletedSignDocument(t *testing.T) { t.Run("GetObject_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DeletedSignDocument + var obj *DeletedInboxThread // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -22104,7 +21470,7 @@ func TestGettersDeletedSignDocument(t *testing.T) { t.Run("GetID", func(t *testing.T) { t.Parallel() // Arrange - obj := &DeletedSignDocument{} + obj := &DeletedInboxThread{} var expected string obj.ID = expected @@ -22114,7 +21480,7 @@ func TestGettersDeletedSignDocument(t *testing.T) { t.Run("GetID_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DeletedSignDocument + var obj *DeletedInboxThread // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -22127,7 +21493,7 @@ func TestGettersDeletedSignDocument(t *testing.T) { t.Run("GetDeleted", func(t *testing.T) { t.Parallel() // Arrange - obj := &DeletedSignDocument{} + obj := &DeletedInboxThread{} var expected bool obj.Deleted = expected @@ -22137,7 +21503,7 @@ func TestGettersDeletedSignDocument(t *testing.T) { t.Run("GetDeleted_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DeletedSignDocument + var obj *DeletedInboxThread // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -22149,12 +21515,12 @@ func TestGettersDeletedSignDocument(t *testing.T) { } -func TestSettersMarkExplicitDeletedSignDocument(t *testing.T) { +func TestSettersMarkExplicitDeletedInboxThread(t *testing.T) { t.Run("SetObject_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DeletedSignDocument{} - var fernTestValueObject DeletedSignDocumentObject + obj := &DeletedInboxThread{} + var fernTestValueObject DeletedInboxThreadObject // Act obj.SetObject(fernTestValueObject) @@ -22184,7 +21550,7 @@ func TestSettersMarkExplicitDeletedSignDocument(t *testing.T) { t.Run("SetID_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DeletedSignDocument{} + obj := &DeletedInboxThread{} var fernTestValueID string // Act @@ -22215,7 +21581,7 @@ func TestSettersMarkExplicitDeletedSignDocument(t *testing.T) { t.Run("SetDeleted_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DeletedSignDocument{} + obj := &DeletedInboxThread{} var fernTestValueDeleted bool // Act @@ -22245,17 +21611,17 @@ func TestSettersMarkExplicitDeletedSignDocument(t *testing.T) { } -func TestSettersDeletedSignRequest(t *testing.T) { +func TestSettersDeletedReceivedEmail(t *testing.T) { t.Run("SetObject", func(t *testing.T) { - obj := &DeletedSignRequest{} - var fernTestValueObject DeletedSignRequestObject + obj := &DeletedReceivedEmail{} + var fernTestValueObject DeletedReceivedEmailObject obj.SetObject(fernTestValueObject) assert.Equal(t, fernTestValueObject, obj.Object) assert.NotNil(t, obj.explicitFields) }) t.Run("SetID", func(t *testing.T) { - obj := &DeletedSignRequest{} + obj := &DeletedReceivedEmail{} var fernTestValueID string obj.SetID(fernTestValueID) assert.Equal(t, fernTestValueID, obj.ID) @@ -22263,7 +21629,7 @@ func TestSettersDeletedSignRequest(t *testing.T) { }) t.Run("SetDeleted", func(t *testing.T) { - obj := &DeletedSignRequest{} + obj := &DeletedReceivedEmail{} var fernTestValueDeleted bool obj.SetDeleted(fernTestValueDeleted) assert.Equal(t, fernTestValueDeleted, obj.Deleted) @@ -22272,12 +21638,12 @@ func TestSettersDeletedSignRequest(t *testing.T) { } -func TestGettersDeletedSignRequest(t *testing.T) { +func TestGettersDeletedReceivedEmail(t *testing.T) { t.Run("GetObject", func(t *testing.T) { t.Parallel() // Arrange - obj := &DeletedSignRequest{} - var expected DeletedSignRequestObject + obj := &DeletedReceivedEmail{} + var expected DeletedReceivedEmailObject obj.Object = expected // Act & Assert @@ -22286,7 +21652,7 @@ func TestGettersDeletedSignRequest(t *testing.T) { t.Run("GetObject_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DeletedSignRequest + var obj *DeletedReceivedEmail // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -22299,7 +21665,7 @@ func TestGettersDeletedSignRequest(t *testing.T) { t.Run("GetID", func(t *testing.T) { t.Parallel() // Arrange - obj := &DeletedSignRequest{} + obj := &DeletedReceivedEmail{} var expected string obj.ID = expected @@ -22309,7 +21675,7 @@ func TestGettersDeletedSignRequest(t *testing.T) { t.Run("GetID_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DeletedSignRequest + var obj *DeletedReceivedEmail // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -22322,7 +21688,7 @@ func TestGettersDeletedSignRequest(t *testing.T) { t.Run("GetDeleted", func(t *testing.T) { t.Parallel() // Arrange - obj := &DeletedSignRequest{} + obj := &DeletedReceivedEmail{} var expected bool obj.Deleted = expected @@ -22332,7 +21698,7 @@ func TestGettersDeletedSignRequest(t *testing.T) { t.Run("GetDeleted_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DeletedSignRequest + var obj *DeletedReceivedEmail // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -22344,12 +21710,12 @@ func TestGettersDeletedSignRequest(t *testing.T) { } -func TestSettersMarkExplicitDeletedSignRequest(t *testing.T) { +func TestSettersMarkExplicitDeletedReceivedEmail(t *testing.T) { t.Run("SetObject_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DeletedSignRequest{} - var fernTestValueObject DeletedSignRequestObject + obj := &DeletedReceivedEmail{} + var fernTestValueObject DeletedReceivedEmailObject // Act obj.SetObject(fernTestValueObject) @@ -22379,7 +21745,7 @@ func TestSettersMarkExplicitDeletedSignRequest(t *testing.T) { t.Run("SetID_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DeletedSignRequest{} + obj := &DeletedReceivedEmail{} var fernTestValueID string // Act @@ -22410,7 +21776,7 @@ func TestSettersMarkExplicitDeletedSignRequest(t *testing.T) { t.Run("SetDeleted_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DeletedSignRequest{} + obj := &DeletedReceivedEmail{} var fernTestValueDeleted bool // Act @@ -22440,17 +21806,17 @@ func TestSettersMarkExplicitDeletedSignRequest(t *testing.T) { } -func TestSettersDeletedSignTemplate(t *testing.T) { +func TestSettersDeletedRiskLimitBucket(t *testing.T) { t.Run("SetObject", func(t *testing.T) { - obj := &DeletedSignTemplate{} - var fernTestValueObject DeletedSignTemplateObject + obj := &DeletedRiskLimitBucket{} + var fernTestValueObject DeletedRiskLimitBucketObject obj.SetObject(fernTestValueObject) assert.Equal(t, fernTestValueObject, obj.Object) assert.NotNil(t, obj.explicitFields) }) t.Run("SetID", func(t *testing.T) { - obj := &DeletedSignTemplate{} + obj := &DeletedRiskLimitBucket{} var fernTestValueID string obj.SetID(fernTestValueID) assert.Equal(t, fernTestValueID, obj.ID) @@ -22458,7 +21824,7 @@ func TestSettersDeletedSignTemplate(t *testing.T) { }) t.Run("SetDeleted", func(t *testing.T) { - obj := &DeletedSignTemplate{} + obj := &DeletedRiskLimitBucket{} var fernTestValueDeleted bool obj.SetDeleted(fernTestValueDeleted) assert.Equal(t, fernTestValueDeleted, obj.Deleted) @@ -22467,12 +21833,12 @@ func TestSettersDeletedSignTemplate(t *testing.T) { } -func TestGettersDeletedSignTemplate(t *testing.T) { +func TestGettersDeletedRiskLimitBucket(t *testing.T) { t.Run("GetObject", func(t *testing.T) { t.Parallel() // Arrange - obj := &DeletedSignTemplate{} - var expected DeletedSignTemplateObject + obj := &DeletedRiskLimitBucket{} + var expected DeletedRiskLimitBucketObject obj.Object = expected // Act & Assert @@ -22481,7 +21847,7 @@ func TestGettersDeletedSignTemplate(t *testing.T) { t.Run("GetObject_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DeletedSignTemplate + var obj *DeletedRiskLimitBucket // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -22494,7 +21860,7 @@ func TestGettersDeletedSignTemplate(t *testing.T) { t.Run("GetID", func(t *testing.T) { t.Parallel() // Arrange - obj := &DeletedSignTemplate{} + obj := &DeletedRiskLimitBucket{} var expected string obj.ID = expected @@ -22504,7 +21870,7 @@ func TestGettersDeletedSignTemplate(t *testing.T) { t.Run("GetID_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DeletedSignTemplate + var obj *DeletedRiskLimitBucket // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -22517,7 +21883,7 @@ func TestGettersDeletedSignTemplate(t *testing.T) { t.Run("GetDeleted", func(t *testing.T) { t.Parallel() // Arrange - obj := &DeletedSignTemplate{} + obj := &DeletedRiskLimitBucket{} var expected bool obj.Deleted = expected @@ -22527,7 +21893,7 @@ func TestGettersDeletedSignTemplate(t *testing.T) { t.Run("GetDeleted_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DeletedSignTemplate + var obj *DeletedRiskLimitBucket // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -22539,12 +21905,12 @@ func TestGettersDeletedSignTemplate(t *testing.T) { } -func TestSettersMarkExplicitDeletedSignTemplate(t *testing.T) { +func TestSettersMarkExplicitDeletedRiskLimitBucket(t *testing.T) { t.Run("SetObject_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DeletedSignTemplate{} - var fernTestValueObject DeletedSignTemplateObject + obj := &DeletedRiskLimitBucket{} + var fernTestValueObject DeletedRiskLimitBucketObject // Act obj.SetObject(fernTestValueObject) @@ -22574,7 +21940,7 @@ func TestSettersMarkExplicitDeletedSignTemplate(t *testing.T) { t.Run("SetID_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DeletedSignTemplate{} + obj := &DeletedRiskLimitBucket{} var fernTestValueID string // Act @@ -22605,7 +21971,7 @@ func TestSettersMarkExplicitDeletedSignTemplate(t *testing.T) { t.Run("SetDeleted_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DeletedSignTemplate{} + obj := &DeletedRiskLimitBucket{} var fernTestValueDeleted bool // Act @@ -22635,17 +22001,17 @@ func TestSettersMarkExplicitDeletedSignTemplate(t *testing.T) { } -func TestSettersDeletedSmsSuppression(t *testing.T) { +func TestSettersDeletedRiskListEntry(t *testing.T) { t.Run("SetObject", func(t *testing.T) { - obj := &DeletedSmsSuppression{} - var fernTestValueObject DeletedSmsSuppressionObject + obj := &DeletedRiskListEntry{} + var fernTestValueObject DeletedRiskListEntryObject obj.SetObject(fernTestValueObject) assert.Equal(t, fernTestValueObject, obj.Object) assert.NotNil(t, obj.explicitFields) }) t.Run("SetID", func(t *testing.T) { - obj := &DeletedSmsSuppression{} + obj := &DeletedRiskListEntry{} var fernTestValueID string obj.SetID(fernTestValueID) assert.Equal(t, fernTestValueID, obj.ID) @@ -22653,7 +22019,7 @@ func TestSettersDeletedSmsSuppression(t *testing.T) { }) t.Run("SetDeleted", func(t *testing.T) { - obj := &DeletedSmsSuppression{} + obj := &DeletedRiskListEntry{} var fernTestValueDeleted bool obj.SetDeleted(fernTestValueDeleted) assert.Equal(t, fernTestValueDeleted, obj.Deleted) @@ -22662,12 +22028,12 @@ func TestSettersDeletedSmsSuppression(t *testing.T) { } -func TestGettersDeletedSmsSuppression(t *testing.T) { +func TestGettersDeletedRiskListEntry(t *testing.T) { t.Run("GetObject", func(t *testing.T) { t.Parallel() // Arrange - obj := &DeletedSmsSuppression{} - var expected DeletedSmsSuppressionObject + obj := &DeletedRiskListEntry{} + var expected DeletedRiskListEntryObject obj.Object = expected // Act & Assert @@ -22676,7 +22042,7 @@ func TestGettersDeletedSmsSuppression(t *testing.T) { t.Run("GetObject_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DeletedSmsSuppression + var obj *DeletedRiskListEntry // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -22689,7 +22055,7 @@ func TestGettersDeletedSmsSuppression(t *testing.T) { t.Run("GetID", func(t *testing.T) { t.Parallel() // Arrange - obj := &DeletedSmsSuppression{} + obj := &DeletedRiskListEntry{} var expected string obj.ID = expected @@ -22699,7 +22065,7 @@ func TestGettersDeletedSmsSuppression(t *testing.T) { t.Run("GetID_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DeletedSmsSuppression + var obj *DeletedRiskListEntry // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -22712,7 +22078,7 @@ func TestGettersDeletedSmsSuppression(t *testing.T) { t.Run("GetDeleted", func(t *testing.T) { t.Parallel() // Arrange - obj := &DeletedSmsSuppression{} + obj := &DeletedRiskListEntry{} var expected bool obj.Deleted = expected @@ -22722,7 +22088,7 @@ func TestGettersDeletedSmsSuppression(t *testing.T) { t.Run("GetDeleted_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DeletedSmsSuppression + var obj *DeletedRiskListEntry // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -22734,12 +22100,12 @@ func TestGettersDeletedSmsSuppression(t *testing.T) { } -func TestSettersMarkExplicitDeletedSmsSuppression(t *testing.T) { +func TestSettersMarkExplicitDeletedRiskListEntry(t *testing.T) { t.Run("SetObject_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DeletedSmsSuppression{} - var fernTestValueObject DeletedSmsSuppressionObject + obj := &DeletedRiskListEntry{} + var fernTestValueObject DeletedRiskListEntryObject // Act obj.SetObject(fernTestValueObject) @@ -22769,7 +22135,7 @@ func TestSettersMarkExplicitDeletedSmsSuppression(t *testing.T) { t.Run("SetID_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DeletedSmsSuppression{} + obj := &DeletedRiskListEntry{} var fernTestValueID string // Act @@ -22800,7 +22166,7 @@ func TestSettersMarkExplicitDeletedSmsSuppression(t *testing.T) { t.Run("SetDeleted_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DeletedSmsSuppression{} + obj := &DeletedRiskListEntry{} var fernTestValueDeleted bool // Act @@ -22830,17 +22196,17 @@ func TestSettersMarkExplicitDeletedSmsSuppression(t *testing.T) { } -func TestSettersDeletedSuppression(t *testing.T) { +func TestSettersDeletedRiskRule(t *testing.T) { t.Run("SetObject", func(t *testing.T) { - obj := &DeletedSuppression{} - var fernTestValueObject DeletedSuppressionObject + obj := &DeletedRiskRule{} + var fernTestValueObject DeletedRiskRuleObject obj.SetObject(fernTestValueObject) assert.Equal(t, fernTestValueObject, obj.Object) assert.NotNil(t, obj.explicitFields) }) t.Run("SetID", func(t *testing.T) { - obj := &DeletedSuppression{} + obj := &DeletedRiskRule{} var fernTestValueID string obj.SetID(fernTestValueID) assert.Equal(t, fernTestValueID, obj.ID) @@ -22848,7 +22214,7 @@ func TestSettersDeletedSuppression(t *testing.T) { }) t.Run("SetDeleted", func(t *testing.T) { - obj := &DeletedSuppression{} + obj := &DeletedRiskRule{} var fernTestValueDeleted bool obj.SetDeleted(fernTestValueDeleted) assert.Equal(t, fernTestValueDeleted, obj.Deleted) @@ -22857,12 +22223,12 @@ func TestSettersDeletedSuppression(t *testing.T) { } -func TestGettersDeletedSuppression(t *testing.T) { +func TestGettersDeletedRiskRule(t *testing.T) { t.Run("GetObject", func(t *testing.T) { t.Parallel() // Arrange - obj := &DeletedSuppression{} - var expected DeletedSuppressionObject + obj := &DeletedRiskRule{} + var expected DeletedRiskRuleObject obj.Object = expected // Act & Assert @@ -22871,7 +22237,7 @@ func TestGettersDeletedSuppression(t *testing.T) { t.Run("GetObject_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DeletedSuppression + var obj *DeletedRiskRule // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -22884,7 +22250,7 @@ func TestGettersDeletedSuppression(t *testing.T) { t.Run("GetID", func(t *testing.T) { t.Parallel() // Arrange - obj := &DeletedSuppression{} + obj := &DeletedRiskRule{} var expected string obj.ID = expected @@ -22894,7 +22260,7 @@ func TestGettersDeletedSuppression(t *testing.T) { t.Run("GetID_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DeletedSuppression + var obj *DeletedRiskRule // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -22907,7 +22273,7 @@ func TestGettersDeletedSuppression(t *testing.T) { t.Run("GetDeleted", func(t *testing.T) { t.Parallel() // Arrange - obj := &DeletedSuppression{} + obj := &DeletedRiskRule{} var expected bool obj.Deleted = expected @@ -22917,7 +22283,7 @@ func TestGettersDeletedSuppression(t *testing.T) { t.Run("GetDeleted_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DeletedSuppression + var obj *DeletedRiskRule // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -22929,12 +22295,12 @@ func TestGettersDeletedSuppression(t *testing.T) { } -func TestSettersMarkExplicitDeletedSuppression(t *testing.T) { +func TestSettersMarkExplicitDeletedRiskRule(t *testing.T) { t.Run("SetObject_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DeletedSuppression{} - var fernTestValueObject DeletedSuppressionObject + obj := &DeletedRiskRule{} + var fernTestValueObject DeletedRiskRuleObject // Act obj.SetObject(fernTestValueObject) @@ -22964,7 +22330,7 @@ func TestSettersMarkExplicitDeletedSuppression(t *testing.T) { t.Run("SetID_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DeletedSuppression{} + obj := &DeletedRiskRule{} var fernTestValueID string // Act @@ -22995,7 +22361,7 @@ func TestSettersMarkExplicitDeletedSuppression(t *testing.T) { t.Run("SetDeleted_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DeletedSuppression{} + obj := &DeletedRiskRule{} var fernTestValueDeleted bool // Act @@ -23025,17 +22391,17 @@ func TestSettersMarkExplicitDeletedSuppression(t *testing.T) { } -func TestSettersDeletedTopic(t *testing.T) { +func TestSettersDeletedSchedulingCalendarConnection(t *testing.T) { t.Run("SetObject", func(t *testing.T) { - obj := &DeletedTopic{} - var fernTestValueObject DeletedTopicObject + obj := &DeletedSchedulingCalendarConnection{} + var fernTestValueObject DeletedSchedulingCalendarConnectionObject obj.SetObject(fernTestValueObject) assert.Equal(t, fernTestValueObject, obj.Object) assert.NotNil(t, obj.explicitFields) }) t.Run("SetID", func(t *testing.T) { - obj := &DeletedTopic{} + obj := &DeletedSchedulingCalendarConnection{} var fernTestValueID string obj.SetID(fernTestValueID) assert.Equal(t, fernTestValueID, obj.ID) @@ -23043,7 +22409,7 @@ func TestSettersDeletedTopic(t *testing.T) { }) t.Run("SetDeleted", func(t *testing.T) { - obj := &DeletedTopic{} + obj := &DeletedSchedulingCalendarConnection{} var fernTestValueDeleted bool obj.SetDeleted(fernTestValueDeleted) assert.Equal(t, fernTestValueDeleted, obj.Deleted) @@ -23052,12 +22418,12 @@ func TestSettersDeletedTopic(t *testing.T) { } -func TestGettersDeletedTopic(t *testing.T) { +func TestGettersDeletedSchedulingCalendarConnection(t *testing.T) { t.Run("GetObject", func(t *testing.T) { t.Parallel() // Arrange - obj := &DeletedTopic{} - var expected DeletedTopicObject + obj := &DeletedSchedulingCalendarConnection{} + var expected DeletedSchedulingCalendarConnectionObject obj.Object = expected // Act & Assert @@ -23066,7 +22432,7 @@ func TestGettersDeletedTopic(t *testing.T) { t.Run("GetObject_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DeletedTopic + var obj *DeletedSchedulingCalendarConnection // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -23079,7 +22445,7 @@ func TestGettersDeletedTopic(t *testing.T) { t.Run("GetID", func(t *testing.T) { t.Parallel() // Arrange - obj := &DeletedTopic{} + obj := &DeletedSchedulingCalendarConnection{} var expected string obj.ID = expected @@ -23089,7 +22455,7 @@ func TestGettersDeletedTopic(t *testing.T) { t.Run("GetID_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DeletedTopic + var obj *DeletedSchedulingCalendarConnection // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -23102,7 +22468,7 @@ func TestGettersDeletedTopic(t *testing.T) { t.Run("GetDeleted", func(t *testing.T) { t.Parallel() // Arrange - obj := &DeletedTopic{} + obj := &DeletedSchedulingCalendarConnection{} var expected bool obj.Deleted = expected @@ -23112,7 +22478,7 @@ func TestGettersDeletedTopic(t *testing.T) { t.Run("GetDeleted_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DeletedTopic + var obj *DeletedSchedulingCalendarConnection // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -23124,12 +22490,12 @@ func TestGettersDeletedTopic(t *testing.T) { } -func TestSettersMarkExplicitDeletedTopic(t *testing.T) { +func TestSettersMarkExplicitDeletedSchedulingCalendarConnection(t *testing.T) { t.Run("SetObject_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DeletedTopic{} - var fernTestValueObject DeletedTopicObject + obj := &DeletedSchedulingCalendarConnection{} + var fernTestValueObject DeletedSchedulingCalendarConnectionObject // Act obj.SetObject(fernTestValueObject) @@ -23159,7 +22525,7 @@ func TestSettersMarkExplicitDeletedTopic(t *testing.T) { t.Run("SetID_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DeletedTopic{} + obj := &DeletedSchedulingCalendarConnection{} var fernTestValueID string // Act @@ -23190,7 +22556,7 @@ func TestSettersMarkExplicitDeletedTopic(t *testing.T) { t.Run("SetDeleted_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DeletedTopic{} + obj := &DeletedSchedulingCalendarConnection{} var fernTestValueDeleted bool // Act @@ -23220,33 +22586,25 @@ func TestSettersMarkExplicitDeletedTopic(t *testing.T) { } -func TestSettersDeletedTrackingRule(t *testing.T) { +func TestSettersDeletedSchedulingCalendarDelegation(t *testing.T) { t.Run("SetObject", func(t *testing.T) { - obj := &DeletedTrackingRule{} - var fernTestValueObject DeletedTrackingRuleObject + obj := &DeletedSchedulingCalendarDelegation{} + var fernTestValueObject DeletedSchedulingCalendarDelegationObject obj.SetObject(fernTestValueObject) assert.Equal(t, fernTestValueObject, obj.Object) assert.NotNil(t, obj.explicitFields) }) t.Run("SetID", func(t *testing.T) { - obj := &DeletedTrackingRule{} + obj := &DeletedSchedulingCalendarDelegation{} var fernTestValueID string obj.SetID(fernTestValueID) assert.Equal(t, fernTestValueID, obj.ID) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetCategory", func(t *testing.T) { - obj := &DeletedTrackingRule{} - var fernTestValueCategory *string - obj.SetCategory(fernTestValueCategory) - assert.Equal(t, fernTestValueCategory, obj.Category) - assert.NotNil(t, obj.explicitFields) - }) - t.Run("SetDeleted", func(t *testing.T) { - obj := &DeletedTrackingRule{} + obj := &DeletedSchedulingCalendarDelegation{} var fernTestValueDeleted bool obj.SetDeleted(fernTestValueDeleted) assert.Equal(t, fernTestValueDeleted, obj.Deleted) @@ -23255,12 +22613,12 @@ func TestSettersDeletedTrackingRule(t *testing.T) { } -func TestGettersDeletedTrackingRule(t *testing.T) { +func TestGettersDeletedSchedulingCalendarDelegation(t *testing.T) { t.Run("GetObject", func(t *testing.T) { t.Parallel() // Arrange - obj := &DeletedTrackingRule{} - var expected DeletedTrackingRuleObject + obj := &DeletedSchedulingCalendarDelegation{} + var expected DeletedSchedulingCalendarDelegationObject obj.Object = expected // Act & Assert @@ -23269,7 +22627,7 @@ func TestGettersDeletedTrackingRule(t *testing.T) { t.Run("GetObject_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DeletedTrackingRule + var obj *DeletedSchedulingCalendarDelegation // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -23282,7 +22640,7 @@ func TestGettersDeletedTrackingRule(t *testing.T) { t.Run("GetID", func(t *testing.T) { t.Parallel() // Arrange - obj := &DeletedTrackingRule{} + obj := &DeletedSchedulingCalendarDelegation{} var expected string obj.ID = expected @@ -23292,7 +22650,7 @@ func TestGettersDeletedTrackingRule(t *testing.T) { t.Run("GetID_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DeletedTrackingRule + var obj *DeletedSchedulingCalendarDelegation // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -23302,43 +22660,10 @@ func TestGettersDeletedTrackingRule(t *testing.T) { _ = obj.GetID() // Should return zero value }) - t.Run("GetCategory", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &DeletedTrackingRule{} - var expected *string - obj.Category = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetCategory(), "getter should return the property value") - }) - - t.Run("GetCategory_NilValue", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &DeletedTrackingRule{} - obj.Category = nil - - // Act & Assert - assert.Nil(t, obj.GetCategory(), "getter should return nil when property is nil") - }) - - t.Run("GetCategory_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *DeletedTrackingRule - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetCategory() // Should return zero value - }) - t.Run("GetDeleted", func(t *testing.T) { t.Parallel() // Arrange - obj := &DeletedTrackingRule{} + obj := &DeletedSchedulingCalendarDelegation{} var expected bool obj.Deleted = expected @@ -23348,7 +22673,7 @@ func TestGettersDeletedTrackingRule(t *testing.T) { t.Run("GetDeleted_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DeletedTrackingRule + var obj *DeletedSchedulingCalendarDelegation // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -23360,12 +22685,12 @@ func TestGettersDeletedTrackingRule(t *testing.T) { } -func TestSettersMarkExplicitDeletedTrackingRule(t *testing.T) { +func TestSettersMarkExplicitDeletedSchedulingCalendarDelegation(t *testing.T) { t.Run("SetObject_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DeletedTrackingRule{} - var fernTestValueObject DeletedTrackingRuleObject + obj := &DeletedSchedulingCalendarDelegation{} + var fernTestValueObject DeletedSchedulingCalendarDelegationObject // Act obj.SetObject(fernTestValueObject) @@ -23395,7 +22720,7 @@ func TestSettersMarkExplicitDeletedTrackingRule(t *testing.T) { t.Run("SetID_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DeletedTrackingRule{} + obj := &DeletedSchedulingCalendarDelegation{} var fernTestValueID string // Act @@ -23423,14 +22748,14 @@ func TestSettersMarkExplicitDeletedTrackingRule(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetCategory_MarksExplicit", func(t *testing.T) { + t.Run("SetDeleted_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DeletedTrackingRule{} - var fernTestValueCategory *string + obj := &DeletedSchedulingCalendarDelegation{} + var fernTestValueDeleted bool // Act - obj.SetCategory(fernTestValueCategory) + obj.SetDeleted(fernTestValueDeleted) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -23454,14 +22779,85 @@ func TestSettersMarkExplicitDeletedTrackingRule(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetDeleted_MarksExplicit", func(t *testing.T) { +} + +func TestSettersDeletedSchedulingHolidayCalendar(t *testing.T) { + t.Run("SetID", func(t *testing.T) { + obj := &DeletedSchedulingHolidayCalendar{} + var fernTestValueID string + obj.SetID(fernTestValueID) + assert.Equal(t, fernTestValueID, obj.ID) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetDeleted", func(t *testing.T) { + obj := &DeletedSchedulingHolidayCalendar{} + var fernTestValueDeleted bool + obj.SetDeleted(fernTestValueDeleted) + assert.Equal(t, fernTestValueDeleted, obj.Deleted) + assert.NotNil(t, obj.explicitFields) + }) + +} + +func TestGettersDeletedSchedulingHolidayCalendar(t *testing.T) { + t.Run("GetID", func(t *testing.T) { t.Parallel() // Arrange - obj := &DeletedTrackingRule{} - var fernTestValueDeleted bool + obj := &DeletedSchedulingHolidayCalendar{} + var expected string + obj.ID = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetID(), "getter should return the property value") + }) + + t.Run("GetID_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *DeletedSchedulingHolidayCalendar + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetID() // Should return zero value + }) + + t.Run("GetDeleted", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DeletedSchedulingHolidayCalendar{} + var expected bool + obj.Deleted = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetDeleted(), "getter should return the property value") + }) + + t.Run("GetDeleted_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *DeletedSchedulingHolidayCalendar + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetDeleted() // Should return zero value + }) + +} + +func TestSettersMarkExplicitDeletedSchedulingHolidayCalendar(t *testing.T) { + t.Run("SetID_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DeletedSchedulingHolidayCalendar{} + var fernTestValueID string // Act - obj.SetDeleted(fernTestValueDeleted) + obj.SetID(fernTestValueID) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -23485,382 +22881,342 @@ func TestSettersMarkExplicitDeletedTrackingRule(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) -} - -func TestSettersDmarcPublishedRecord(t *testing.T) { - t.Run("SetValue", func(t *testing.T) { - obj := &DmarcPublishedRecord{} - var fernTestValueValue string - obj.SetValue(fernTestValueValue) - assert.Equal(t, fernTestValueValue, obj.Value) - assert.NotNil(t, obj.explicitFields) - }) + t.Run("SetDeleted_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DeletedSchedulingHolidayCalendar{} + var fernTestValueDeleted bool - t.Run("SetP", func(t *testing.T) { - obj := &DmarcPublishedRecord{} - var fernTestValueP *DmarcPublishedRecordP - obj.SetP(fernTestValueP) - assert.Equal(t, fernTestValueP, obj.P) - assert.NotNil(t, obj.explicitFields) - }) + // Act + obj.SetDeleted(fernTestValueDeleted) - t.Run("SetSp", func(t *testing.T) { - obj := &DmarcPublishedRecord{} - var fernTestValueSp *DmarcPublishedRecordSp - obj.SetSp(fernTestValueSp) - assert.Equal(t, fernTestValueSp, obj.Sp) - assert.NotNil(t, obj.explicitFields) - }) + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") - t.Run("SetNp", func(t *testing.T) { - obj := &DmarcPublishedRecord{} - var fernTestValueNp *DmarcPublishedRecordNp - obj.SetNp(fernTestValueNp) - assert.Equal(t, fernTestValueNp, obj.Np) - assert.NotNil(t, obj.explicitFields) - }) + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } - t.Run("SetAdkim", func(t *testing.T) { - obj := &DmarcPublishedRecord{} - var fernTestValueAdkim *DmarcPublishedRecordAdkim - obj.SetAdkim(fernTestValueAdkim) - assert.Equal(t, fernTestValueAdkim, obj.Adkim) - assert.NotNil(t, obj.explicitFields) + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetAspf", func(t *testing.T) { - obj := &DmarcPublishedRecord{} - var fernTestValueAspf *DmarcPublishedRecordAspf - obj.SetAspf(fernTestValueAspf) - assert.Equal(t, fernTestValueAspf, obj.Aspf) - assert.NotNil(t, obj.explicitFields) - }) +} - t.Run("SetPct", func(t *testing.T) { - obj := &DmarcPublishedRecord{} - var fernTestValuePct *int64 - obj.SetPct(fernTestValuePct) - assert.Equal(t, fernTestValuePct, obj.Pct) +func TestSettersDeletedSchedulingHost(t *testing.T) { + t.Run("SetObject", func(t *testing.T) { + obj := &DeletedSchedulingHost{} + var fernTestValueObject DeletedSchedulingHostObject + obj.SetObject(fernTestValueObject) + assert.Equal(t, fernTestValueObject, obj.Object) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetT", func(t *testing.T) { - obj := &DmarcPublishedRecord{} - var fernTestValueT *DmarcPublishedRecordT - obj.SetT(fernTestValueT) - assert.Equal(t, fernTestValueT, obj.T) + t.Run("SetID", func(t *testing.T) { + obj := &DeletedSchedulingHost{} + var fernTestValueID string + obj.SetID(fernTestValueID) + assert.Equal(t, fernTestValueID, obj.ID) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetRua", func(t *testing.T) { - obj := &DmarcPublishedRecord{} - var fernTestValueRua []string - obj.SetRua(fernTestValueRua) - assert.Equal(t, fernTestValueRua, obj.Rua) + t.Run("SetDeleted", func(t *testing.T) { + obj := &DeletedSchedulingHost{} + var fernTestValueDeleted bool + obj.SetDeleted(fernTestValueDeleted) + assert.Equal(t, fernTestValueDeleted, obj.Deleted) assert.NotNil(t, obj.explicitFields) }) } -func TestGettersDmarcPublishedRecord(t *testing.T) { - t.Run("GetValue", func(t *testing.T) { +func TestGettersDeletedSchedulingHost(t *testing.T) { + t.Run("GetObject", func(t *testing.T) { t.Parallel() // Arrange - obj := &DmarcPublishedRecord{} - var expected string - obj.Value = expected + obj := &DeletedSchedulingHost{} + var expected DeletedSchedulingHostObject + obj.Object = expected // Act & Assert - assert.Equal(t, expected, obj.GetValue(), "getter should return the property value") + assert.Equal(t, expected, obj.GetObject(), "getter should return the property value") }) - t.Run("GetValue_NilReceiver", func(t *testing.T) { + t.Run("GetObject_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DmarcPublishedRecord + var obj *DeletedSchedulingHost // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetValue() // Should return zero value - }) - - t.Run("GetP", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &DmarcPublishedRecord{} - var expected *DmarcPublishedRecordP - obj.P = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetP(), "getter should return the property value") + _ = obj.GetObject() // Should return zero value }) - t.Run("GetP_NilValue", func(t *testing.T) { + t.Run("GetID", func(t *testing.T) { t.Parallel() // Arrange - obj := &DmarcPublishedRecord{} - obj.P = nil + obj := &DeletedSchedulingHost{} + var expected string + obj.ID = expected // Act & Assert - assert.Nil(t, obj.GetP(), "getter should return nil when property is nil") + assert.Equal(t, expected, obj.GetID(), "getter should return the property value") }) - t.Run("GetP_NilReceiver", func(t *testing.T) { + t.Run("GetID_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DmarcPublishedRecord + var obj *DeletedSchedulingHost // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetP() // Should return zero value - }) - - t.Run("GetSp", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &DmarcPublishedRecord{} - var expected *DmarcPublishedRecordSp - obj.Sp = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetSp(), "getter should return the property value") + _ = obj.GetID() // Should return zero value }) - t.Run("GetSp_NilValue", func(t *testing.T) { + t.Run("GetDeleted", func(t *testing.T) { t.Parallel() // Arrange - obj := &DmarcPublishedRecord{} - obj.Sp = nil + obj := &DeletedSchedulingHost{} + var expected bool + obj.Deleted = expected // Act & Assert - assert.Nil(t, obj.GetSp(), "getter should return nil when property is nil") + assert.Equal(t, expected, obj.GetDeleted(), "getter should return the property value") }) - t.Run("GetSp_NilReceiver", func(t *testing.T) { + t.Run("GetDeleted_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DmarcPublishedRecord + var obj *DeletedSchedulingHost // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetSp() // Should return zero value + _ = obj.GetDeleted() // Should return zero value }) - t.Run("GetNp", func(t *testing.T) { +} + +func TestSettersMarkExplicitDeletedSchedulingHost(t *testing.T) { + t.Run("SetObject_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DmarcPublishedRecord{} - var expected *DmarcPublishedRecordNp - obj.Np = expected + obj := &DeletedSchedulingHost{} + var fernTestValueObject DeletedSchedulingHostObject - // Act & Assert - assert.Equal(t, expected, obj.GetNp(), "getter should return the property value") - }) + // Act + obj.SetObject(fernTestValueObject) - t.Run("GetNp_NilValue", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &DmarcPublishedRecord{} - obj.Np = nil + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") - // Act & Assert - assert.Nil(t, obj.GetNp(), "getter should return nil when property is nil") - }) + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } - t.Run("GetNp_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *DmarcPublishedRecord - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetNp() // Should return zero value + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("GetAdkim", func(t *testing.T) { + t.Run("SetID_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DmarcPublishedRecord{} - var expected *DmarcPublishedRecordAdkim - obj.Adkim = expected + obj := &DeletedSchedulingHost{} + var fernTestValueID string - // Act & Assert - assert.Equal(t, expected, obj.GetAdkim(), "getter should return the property value") - }) + // Act + obj.SetID(fernTestValueID) - t.Run("GetAdkim_NilValue", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &DmarcPublishedRecord{} - obj.Adkim = nil + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") - // Act & Assert - assert.Nil(t, obj.GetAdkim(), "getter should return nil when property is nil") - }) + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } - t.Run("GetAdkim_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *DmarcPublishedRecord - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetAdkim() // Should return zero value + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("GetAspf", func(t *testing.T) { + t.Run("SetDeleted_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DmarcPublishedRecord{} - var expected *DmarcPublishedRecordAspf - obj.Aspf = expected + obj := &DeletedSchedulingHost{} + var fernTestValueDeleted bool - // Act & Assert - assert.Equal(t, expected, obj.GetAspf(), "getter should return the property value") - }) + // Act + obj.SetDeleted(fernTestValueDeleted) - t.Run("GetAspf_NilValue", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &DmarcPublishedRecord{} - obj.Aspf = nil + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") - // Act & Assert - assert.Nil(t, obj.GetAspf(), "getter should return nil when property is nil") + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("GetAspf_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *DmarcPublishedRecord - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetAspf() // Should return zero value +} + +func TestSettersDeletedSchedulingOauthApp(t *testing.T) { + t.Run("SetObject", func(t *testing.T) { + obj := &DeletedSchedulingOauthApp{} + var fernTestValueObject DeletedSchedulingOauthAppObject + obj.SetObject(fernTestValueObject) + assert.Equal(t, fernTestValueObject, obj.Object) + assert.NotNil(t, obj.explicitFields) }) - t.Run("GetPct", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &DmarcPublishedRecord{} - var expected *int64 - obj.Pct = expected + t.Run("SetID", func(t *testing.T) { + obj := &DeletedSchedulingOauthApp{} + var fernTestValueID string + obj.SetID(fernTestValueID) + assert.Equal(t, fernTestValueID, obj.ID) + assert.NotNil(t, obj.explicitFields) + }) - // Act & Assert - assert.Equal(t, expected, obj.GetPct(), "getter should return the property value") + t.Run("SetDeleted", func(t *testing.T) { + obj := &DeletedSchedulingOauthApp{} + var fernTestValueDeleted bool + obj.SetDeleted(fernTestValueDeleted) + assert.Equal(t, fernTestValueDeleted, obj.Deleted) + assert.NotNil(t, obj.explicitFields) }) - t.Run("GetPct_NilValue", func(t *testing.T) { +} + +func TestGettersDeletedSchedulingOauthApp(t *testing.T) { + t.Run("GetObject", func(t *testing.T) { t.Parallel() // Arrange - obj := &DmarcPublishedRecord{} - obj.Pct = nil + obj := &DeletedSchedulingOauthApp{} + var expected DeletedSchedulingOauthAppObject + obj.Object = expected // Act & Assert - assert.Nil(t, obj.GetPct(), "getter should return nil when property is nil") + assert.Equal(t, expected, obj.GetObject(), "getter should return the property value") }) - t.Run("GetPct_NilReceiver", func(t *testing.T) { + t.Run("GetObject_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DmarcPublishedRecord + var obj *DeletedSchedulingOauthApp // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetPct() // Should return zero value - }) - - t.Run("GetT", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &DmarcPublishedRecord{} - var expected *DmarcPublishedRecordT - obj.T = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetT(), "getter should return the property value") + _ = obj.GetObject() // Should return zero value }) - t.Run("GetT_NilValue", func(t *testing.T) { + t.Run("GetID", func(t *testing.T) { t.Parallel() // Arrange - obj := &DmarcPublishedRecord{} - obj.T = nil + obj := &DeletedSchedulingOauthApp{} + var expected string + obj.ID = expected // Act & Assert - assert.Nil(t, obj.GetT(), "getter should return nil when property is nil") + assert.Equal(t, expected, obj.GetID(), "getter should return the property value") }) - t.Run("GetT_NilReceiver", func(t *testing.T) { + t.Run("GetID_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DmarcPublishedRecord + var obj *DeletedSchedulingOauthApp // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetT() // Should return zero value - }) - - t.Run("GetRua", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &DmarcPublishedRecord{} - var expected []string - obj.Rua = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetRua(), "getter should return the property value") + _ = obj.GetID() // Should return zero value }) - t.Run("GetRua_NilValue", func(t *testing.T) { + t.Run("GetDeleted", func(t *testing.T) { t.Parallel() // Arrange - obj := &DmarcPublishedRecord{} - obj.Rua = nil + obj := &DeletedSchedulingOauthApp{} + var expected bool + obj.Deleted = expected // Act & Assert - assert.Nil(t, obj.GetRua(), "getter should return nil when property is nil") + assert.Equal(t, expected, obj.GetDeleted(), "getter should return the property value") }) - t.Run("GetRua_NilReceiver", func(t *testing.T) { + t.Run("GetDeleted_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DmarcPublishedRecord + var obj *DeletedSchedulingOauthApp // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetRua() // Should return zero value + _ = obj.GetDeleted() // Should return zero value }) } -func TestSettersMarkExplicitDmarcPublishedRecord(t *testing.T) { - t.Run("SetValue_MarksExplicit", func(t *testing.T) { +func TestSettersMarkExplicitDeletedSchedulingOauthApp(t *testing.T) { + t.Run("SetObject_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DmarcPublishedRecord{} - var fernTestValueValue string + obj := &DeletedSchedulingOauthApp{} + var fernTestValueObject DeletedSchedulingOauthAppObject // Act - obj.SetValue(fernTestValueValue) + obj.SetObject(fernTestValueObject) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -23884,14 +23240,14 @@ func TestSettersMarkExplicitDmarcPublishedRecord(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetP_MarksExplicit", func(t *testing.T) { + t.Run("SetID_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DmarcPublishedRecord{} - var fernTestValueP *DmarcPublishedRecordP + obj := &DeletedSchedulingOauthApp{} + var fernTestValueID string // Act - obj.SetP(fernTestValueP) + obj.SetID(fernTestValueID) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -23915,14 +23271,14 @@ func TestSettersMarkExplicitDmarcPublishedRecord(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetSp_MarksExplicit", func(t *testing.T) { + t.Run("SetDeleted_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DmarcPublishedRecord{} - var fernTestValueSp *DmarcPublishedRecordSp + obj := &DeletedSchedulingOauthApp{} + var fernTestValueDeleted bool // Act - obj.SetSp(fernTestValueSp) + obj.SetDeleted(fernTestValueDeleted) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -23946,107 +23302,116 @@ func TestSettersMarkExplicitDmarcPublishedRecord(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetNp_MarksExplicit", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &DmarcPublishedRecord{} - var fernTestValueNp *DmarcPublishedRecordNp - - // Act - obj.SetNp(fernTestValueNp) +} - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") +func TestSettersDeletedSchedulingOutOfOffice(t *testing.T) { + t.Run("SetObject", func(t *testing.T) { + obj := &DeletedSchedulingOutOfOffice{} + var fernTestValueObject DeletedSchedulingOutOfOfficeObject + obj.SetObject(fernTestValueObject) + assert.Equal(t, fernTestValueObject, obj.Object) + assert.NotNil(t, obj.explicitFields) + }) - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } + t.Run("SetID", func(t *testing.T) { + obj := &DeletedSchedulingOutOfOffice{} + var fernTestValueID string + obj.SetID(fernTestValueID) + assert.Equal(t, fernTestValueID, obj.ID) + assert.NotNil(t, obj.explicitFields) + }) - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip + t.Run("SetDeleted", func(t *testing.T) { + obj := &DeletedSchedulingOutOfOffice{} + var fernTestValueDeleted bool + obj.SetDeleted(fernTestValueDeleted) + assert.Equal(t, fernTestValueDeleted, obj.Deleted) + assert.NotNil(t, obj.explicitFields) }) - t.Run("SetAdkim_MarksExplicit", func(t *testing.T) { +} + +func TestGettersDeletedSchedulingOutOfOffice(t *testing.T) { + t.Run("GetObject", func(t *testing.T) { t.Parallel() // Arrange - obj := &DmarcPublishedRecord{} - var fernTestValueAdkim *DmarcPublishedRecordAdkim - - // Act - obj.SetAdkim(fernTestValueAdkim) - - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") + obj := &DeletedSchedulingOutOfOffice{} + var expected DeletedSchedulingOutOfOfficeObject + obj.Object = expected - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } + // Act & Assert + assert.Equal(t, expected, obj.GetObject(), "getter should return the property value") + }) - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip + t.Run("GetObject_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *DeletedSchedulingOutOfOffice + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetObject() // Should return zero value }) - t.Run("SetAspf_MarksExplicit", func(t *testing.T) { + t.Run("GetID", func(t *testing.T) { t.Parallel() // Arrange - obj := &DmarcPublishedRecord{} - var fernTestValueAspf *DmarcPublishedRecordAspf + obj := &DeletedSchedulingOutOfOffice{} + var expected string + obj.ID = expected - // Act - obj.SetAspf(fernTestValueAspf) + // Act & Assert + assert.Equal(t, expected, obj.GetID(), "getter should return the property value") + }) - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") + t.Run("GetID_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *DeletedSchedulingOutOfOffice + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetID() // Should return zero value + }) - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } + t.Run("GetDeleted", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DeletedSchedulingOutOfOffice{} + var expected bool + obj.Deleted = expected - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip + // Act & Assert + assert.Equal(t, expected, obj.GetDeleted(), "getter should return the property value") }) - t.Run("SetPct_MarksExplicit", func(t *testing.T) { + t.Run("GetDeleted_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *DeletedSchedulingOutOfOffice + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetDeleted() // Should return zero value + }) + +} + +func TestSettersMarkExplicitDeletedSchedulingOutOfOffice(t *testing.T) { + t.Run("SetObject_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DmarcPublishedRecord{} - var fernTestValuePct *int64 + obj := &DeletedSchedulingOutOfOffice{} + var fernTestValueObject DeletedSchedulingOutOfOfficeObject // Act - obj.SetPct(fernTestValuePct) + obj.SetObject(fernTestValueObject) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -24070,14 +23435,14 @@ func TestSettersMarkExplicitDmarcPublishedRecord(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetT_MarksExplicit", func(t *testing.T) { + t.Run("SetID_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DmarcPublishedRecord{} - var fernTestValueT *DmarcPublishedRecordT + obj := &DeletedSchedulingOutOfOffice{} + var fernTestValueID string // Act - obj.SetT(fernTestValueT) + obj.SetID(fernTestValueID) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -24101,14 +23466,14 @@ func TestSettersMarkExplicitDmarcPublishedRecord(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetRua_MarksExplicit", func(t *testing.T) { + t.Run("SetDeleted_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DmarcPublishedRecord{} - var fernTestValueRua []string + obj := &DeletedSchedulingOutOfOffice{} + var fernTestValueDeleted bool // Act - obj.SetRua(fernTestValueRua) + obj.SetDeleted(fernTestValueDeleted) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -24134,119 +23499,39 @@ func TestSettersMarkExplicitDmarcPublishedRecord(t *testing.T) { } -func TestSettersDmarcReport(t *testing.T) { +func TestSettersDeletedSchedulingSchedule(t *testing.T) { t.Run("SetObject", func(t *testing.T) { - obj := &DmarcReport{} - var fernTestValueObject DmarcReportObject + obj := &DeletedSchedulingSchedule{} + var fernTestValueObject DeletedSchedulingScheduleObject obj.SetObject(fernTestValueObject) assert.Equal(t, fernTestValueObject, obj.Object) assert.NotNil(t, obj.explicitFields) }) t.Run("SetID", func(t *testing.T) { - obj := &DmarcReport{} + obj := &DeletedSchedulingSchedule{} var fernTestValueID string obj.SetID(fernTestValueID) assert.Equal(t, fernTestValueID, obj.ID) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetDomainID", func(t *testing.T) { - obj := &DmarcReport{} - var fernTestValueDomainID string - obj.SetDomainID(fernTestValueDomainID) - assert.Equal(t, fernTestValueDomainID, obj.DomainID) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetReporter", func(t *testing.T) { - obj := &DmarcReport{} - var fernTestValueReporter *DmarcReportReporter - obj.SetReporter(fernTestValueReporter) - assert.Equal(t, fernTestValueReporter, obj.Reporter) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetReportID", func(t *testing.T) { - obj := &DmarcReport{} - var fernTestValueReportID string - obj.SetReportID(fernTestValueReportID) - assert.Equal(t, fernTestValueReportID, obj.ReportID) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetPeriodStart", func(t *testing.T) { - obj := &DmarcReport{} - var fernTestValuePeriodStart time.Time - obj.SetPeriodStart(fernTestValuePeriodStart) - assert.Equal(t, fernTestValuePeriodStart, obj.PeriodStart) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetPeriodEnd", func(t *testing.T) { - obj := &DmarcReport{} - var fernTestValuePeriodEnd time.Time - obj.SetPeriodEnd(fernTestValuePeriodEnd) - assert.Equal(t, fernTestValuePeriodEnd, obj.PeriodEnd) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetPolicyPublished", func(t *testing.T) { - obj := &DmarcReport{} - var fernTestValuePolicyPublished *DmarcReportPolicyPublished - obj.SetPolicyPublished(fernTestValuePolicyPublished) - assert.Equal(t, fernTestValuePolicyPublished, obj.PolicyPublished) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetMessages", func(t *testing.T) { - obj := &DmarcReport{} - var fernTestValueMessages int64 - obj.SetMessages(fernTestValueMessages) - assert.Equal(t, fernTestValueMessages, obj.Messages) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetPassing", func(t *testing.T) { - obj := &DmarcReport{} - var fernTestValuePassing int64 - obj.SetPassing(fernTestValuePassing) - assert.Equal(t, fernTestValuePassing, obj.Passing) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetTruncated", func(t *testing.T) { - obj := &DmarcReport{} - var fernTestValueTruncated bool - obj.SetTruncated(fernTestValueTruncated) - assert.Equal(t, fernTestValueTruncated, obj.Truncated) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetReceivedAt", func(t *testing.T) { - obj := &DmarcReport{} - var fernTestValueReceivedAt time.Time - obj.SetReceivedAt(fernTestValueReceivedAt) - assert.Equal(t, fernTestValueReceivedAt, obj.ReceivedAt) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetRecords", func(t *testing.T) { - obj := &DmarcReport{} - var fernTestValueRecords []*DmarcReportRecord - obj.SetRecords(fernTestValueRecords) - assert.Equal(t, fernTestValueRecords, obj.Records) + t.Run("SetDeleted", func(t *testing.T) { + obj := &DeletedSchedulingSchedule{} + var fernTestValueDeleted bool + obj.SetDeleted(fernTestValueDeleted) + assert.Equal(t, fernTestValueDeleted, obj.Deleted) assert.NotNil(t, obj.explicitFields) }) } -func TestGettersDmarcReport(t *testing.T) { +func TestGettersDeletedSchedulingSchedule(t *testing.T) { t.Run("GetObject", func(t *testing.T) { t.Parallel() // Arrange - obj := &DmarcReport{} - var expected DmarcReportObject + obj := &DeletedSchedulingSchedule{} + var expected DeletedSchedulingScheduleObject obj.Object = expected // Act & Assert @@ -24255,7 +23540,7 @@ func TestGettersDmarcReport(t *testing.T) { t.Run("GetObject_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DmarcReport + var obj *DeletedSchedulingSchedule // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -24268,7 +23553,7 @@ func TestGettersDmarcReport(t *testing.T) { t.Run("GetID", func(t *testing.T) { t.Parallel() // Arrange - obj := &DmarcReport{} + obj := &DeletedSchedulingSchedule{} var expected string obj.ID = expected @@ -24278,7 +23563,7 @@ func TestGettersDmarcReport(t *testing.T) { t.Run("GetID_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DmarcReport + var obj *DeletedSchedulingSchedule // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -24288,297 +23573,232 @@ func TestGettersDmarcReport(t *testing.T) { _ = obj.GetID() // Should return zero value }) - t.Run("GetDomainID", func(t *testing.T) { + t.Run("GetDeleted", func(t *testing.T) { t.Parallel() // Arrange - obj := &DmarcReport{} - var expected string - obj.DomainID = expected + obj := &DeletedSchedulingSchedule{} + var expected bool + obj.Deleted = expected // Act & Assert - assert.Equal(t, expected, obj.GetDomainID(), "getter should return the property value") + assert.Equal(t, expected, obj.GetDeleted(), "getter should return the property value") }) - t.Run("GetDomainID_NilReceiver", func(t *testing.T) { + t.Run("GetDeleted_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DmarcReport + var obj *DeletedSchedulingSchedule // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetDomainID() // Should return zero value + _ = obj.GetDeleted() // Should return zero value }) - t.Run("GetReporter", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &DmarcReport{} - var expected *DmarcReportReporter - obj.Reporter = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetReporter(), "getter should return the property value") - }) +} - t.Run("GetReporter_NilValue", func(t *testing.T) { +func TestSettersMarkExplicitDeletedSchedulingSchedule(t *testing.T) { + t.Run("SetObject_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DmarcReport{} - obj.Reporter = nil - - // Act & Assert - assert.Nil(t, obj.GetReporter(), "getter should return nil when property is nil") - }) + obj := &DeletedSchedulingSchedule{} + var fernTestValueObject DeletedSchedulingScheduleObject - t.Run("GetReporter_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *DmarcReport - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetReporter() // Should return zero value - }) + // Act + obj.SetObject(fernTestValueObject) - t.Run("GetReportID", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &DmarcReport{} - var expected string - obj.ReportID = expected + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") - // Act & Assert - assert.Equal(t, expected, obj.GetReportID(), "getter should return the property value") - }) + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } - t.Run("GetReportID_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *DmarcReport - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetReportID() // Should return zero value + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("GetPeriodStart", func(t *testing.T) { + t.Run("SetID_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DmarcReport{} - var expected time.Time - obj.PeriodStart = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetPeriodStart(), "getter should return the property value") - }) + obj := &DeletedSchedulingSchedule{} + var fernTestValueID string - t.Run("GetPeriodStart_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *DmarcReport - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetPeriodStart() // Should return zero value - }) + // Act + obj.SetID(fernTestValueID) - t.Run("GetPeriodEnd", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &DmarcReport{} - var expected time.Time - obj.PeriodEnd = expected + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") - // Act & Assert - assert.Equal(t, expected, obj.GetPeriodEnd(), "getter should return the property value") - }) + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } - t.Run("GetPeriodEnd_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *DmarcReport - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetPeriodEnd() // Should return zero value + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("GetPolicyPublished", func(t *testing.T) { + t.Run("SetDeleted_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DmarcReport{} - var expected *DmarcReportPolicyPublished - obj.PolicyPublished = expected + obj := &DeletedSchedulingSchedule{} + var fernTestValueDeleted bool - // Act & Assert - assert.Equal(t, expected, obj.GetPolicyPublished(), "getter should return the property value") - }) + // Act + obj.SetDeleted(fernTestValueDeleted) - t.Run("GetPolicyPublished_NilValue", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &DmarcReport{} - obj.PolicyPublished = nil + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") - // Act & Assert - assert.Nil(t, obj.GetPolicyPublished(), "getter should return nil when property is nil") - }) + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } - t.Run("GetPolicyPublished_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *DmarcReport - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetPolicyPublished() // Should return zero value + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("GetMessages", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &DmarcReport{} - var expected int64 - obj.Messages = expected +} - // Act & Assert - assert.Equal(t, expected, obj.GetMessages(), "getter should return the property value") +func TestSettersDeletedSegment(t *testing.T) { + t.Run("SetObject", func(t *testing.T) { + obj := &DeletedSegment{} + var fernTestValueObject DeletedSegmentObject + obj.SetObject(fernTestValueObject) + assert.Equal(t, fernTestValueObject, obj.Object) + assert.NotNil(t, obj.explicitFields) }) - t.Run("GetMessages_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *DmarcReport - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetMessages() // Should return zero value + t.Run("SetID", func(t *testing.T) { + obj := &DeletedSegment{} + var fernTestValueID string + obj.SetID(fernTestValueID) + assert.Equal(t, fernTestValueID, obj.ID) + assert.NotNil(t, obj.explicitFields) }) - t.Run("GetPassing", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &DmarcReport{} - var expected int64 - obj.Passing = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetPassing(), "getter should return the property value") + t.Run("SetDeleted", func(t *testing.T) { + obj := &DeletedSegment{} + var fernTestValueDeleted bool + obj.SetDeleted(fernTestValueDeleted) + assert.Equal(t, fernTestValueDeleted, obj.Deleted) + assert.NotNil(t, obj.explicitFields) }) - t.Run("GetPassing_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *DmarcReport - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetPassing() // Should return zero value - }) +} - t.Run("GetTruncated", func(t *testing.T) { +func TestGettersDeletedSegment(t *testing.T) { + t.Run("GetObject", func(t *testing.T) { t.Parallel() // Arrange - obj := &DmarcReport{} - var expected bool - obj.Truncated = expected + obj := &DeletedSegment{} + var expected DeletedSegmentObject + obj.Object = expected // Act & Assert - assert.Equal(t, expected, obj.GetTruncated(), "getter should return the property value") + assert.Equal(t, expected, obj.GetObject(), "getter should return the property value") }) - t.Run("GetTruncated_NilReceiver", func(t *testing.T) { + t.Run("GetObject_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DmarcReport + var obj *DeletedSegment // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetTruncated() // Should return zero value + _ = obj.GetObject() // Should return zero value }) - t.Run("GetReceivedAt", func(t *testing.T) { + t.Run("GetID", func(t *testing.T) { t.Parallel() // Arrange - obj := &DmarcReport{} - var expected time.Time - obj.ReceivedAt = expected + obj := &DeletedSegment{} + var expected string + obj.ID = expected // Act & Assert - assert.Equal(t, expected, obj.GetReceivedAt(), "getter should return the property value") + assert.Equal(t, expected, obj.GetID(), "getter should return the property value") }) - t.Run("GetReceivedAt_NilReceiver", func(t *testing.T) { + t.Run("GetID_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DmarcReport + var obj *DeletedSegment // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetReceivedAt() // Should return zero value - }) - - t.Run("GetRecords", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &DmarcReport{} - var expected []*DmarcReportRecord - obj.Records = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetRecords(), "getter should return the property value") + _ = obj.GetID() // Should return zero value }) - t.Run("GetRecords_NilValue", func(t *testing.T) { + t.Run("GetDeleted", func(t *testing.T) { t.Parallel() // Arrange - obj := &DmarcReport{} - obj.Records = nil + obj := &DeletedSegment{} + var expected bool + obj.Deleted = expected // Act & Assert - assert.Nil(t, obj.GetRecords(), "getter should return nil when property is nil") + assert.Equal(t, expected, obj.GetDeleted(), "getter should return the property value") }) - t.Run("GetRecords_NilReceiver", func(t *testing.T) { + t.Run("GetDeleted_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DmarcReport + var obj *DeletedSegment // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetRecords() // Should return zero value + _ = obj.GetDeleted() // Should return zero value }) } -func TestSettersMarkExplicitDmarcReport(t *testing.T) { +func TestSettersMarkExplicitDeletedSegment(t *testing.T) { t.Run("SetObject_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DmarcReport{} - var fernTestValueObject DmarcReportObject + obj := &DeletedSegment{} + var fernTestValueObject DeletedSegmentObject // Act obj.SetObject(fernTestValueObject) @@ -24608,7 +23828,7 @@ func TestSettersMarkExplicitDmarcReport(t *testing.T) { t.Run("SetID_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DmarcReport{} + obj := &DeletedSegment{} var fernTestValueID string // Act @@ -24636,14 +23856,14 @@ func TestSettersMarkExplicitDmarcReport(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetDomainID_MarksExplicit", func(t *testing.T) { + t.Run("SetDeleted_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DmarcReport{} - var fernTestValueDomainID string + obj := &DeletedSegment{} + var fernTestValueDeleted bool // Act - obj.SetDomainID(fernTestValueDomainID) + obj.SetDeleted(fernTestValueDeleted) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -24667,76 +23887,116 @@ func TestSettersMarkExplicitDmarcReport(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetReporter_MarksExplicit", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &DmarcReport{} - var fernTestValueReporter *DmarcReportReporter +} - // Act - obj.SetReporter(fernTestValueReporter) +func TestSettersDeletedSignDocument(t *testing.T) { + t.Run("SetObject", func(t *testing.T) { + obj := &DeletedSignDocument{} + var fernTestValueObject DeletedSignDocumentObject + obj.SetObject(fernTestValueObject) + assert.Equal(t, fernTestValueObject, obj.Object) + assert.NotNil(t, obj.explicitFields) + }) - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") + t.Run("SetID", func(t *testing.T) { + obj := &DeletedSignDocument{} + var fernTestValueID string + obj.SetID(fernTestValueID) + assert.Equal(t, fernTestValueID, obj.ID) + assert.NotNil(t, obj.explicitFields) + }) - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } + t.Run("SetDeleted", func(t *testing.T) { + obj := &DeletedSignDocument{} + var fernTestValueDeleted bool + obj.SetDeleted(fernTestValueDeleted) + assert.Equal(t, fernTestValueDeleted, obj.Deleted) + assert.NotNil(t, obj.explicitFields) + }) - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip +} + +func TestGettersDeletedSignDocument(t *testing.T) { + t.Run("GetObject", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DeletedSignDocument{} + var expected DeletedSignDocumentObject + obj.Object = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetObject(), "getter should return the property value") }) - t.Run("SetReportID_MarksExplicit", func(t *testing.T) { + t.Run("GetObject_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *DeletedSignDocument + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetObject() // Should return zero value + }) + + t.Run("GetID", func(t *testing.T) { t.Parallel() // Arrange - obj := &DmarcReport{} - var fernTestValueReportID string + obj := &DeletedSignDocument{} + var expected string + obj.ID = expected - // Act - obj.SetReportID(fernTestValueReportID) + // Act & Assert + assert.Equal(t, expected, obj.GetID(), "getter should return the property value") + }) - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") + t.Run("GetID_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *DeletedSignDocument + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetID() // Should return zero value + }) - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } + t.Run("GetDeleted", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DeletedSignDocument{} + var expected bool + obj.Deleted = expected - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip + // Act & Assert + assert.Equal(t, expected, obj.GetDeleted(), "getter should return the property value") }) - t.Run("SetPeriodStart_MarksExplicit", func(t *testing.T) { + t.Run("GetDeleted_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *DeletedSignDocument + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetDeleted() // Should return zero value + }) + +} + +func TestSettersMarkExplicitDeletedSignDocument(t *testing.T) { + t.Run("SetObject_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DmarcReport{} - var fernTestValuePeriodStart time.Time + obj := &DeletedSignDocument{} + var fernTestValueObject DeletedSignDocumentObject // Act - obj.SetPeriodStart(fernTestValuePeriodStart) + obj.SetObject(fernTestValueObject) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -24760,14 +24020,14 @@ func TestSettersMarkExplicitDmarcReport(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetPeriodEnd_MarksExplicit", func(t *testing.T) { + t.Run("SetID_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DmarcReport{} - var fernTestValuePeriodEnd time.Time + obj := &DeletedSignDocument{} + var fernTestValueID string // Act - obj.SetPeriodEnd(fernTestValuePeriodEnd) + obj.SetID(fernTestValueID) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -24791,14 +24051,14 @@ func TestSettersMarkExplicitDmarcReport(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetPolicyPublished_MarksExplicit", func(t *testing.T) { + t.Run("SetDeleted_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DmarcReport{} - var fernTestValuePolicyPublished *DmarcReportPolicyPublished + obj := &DeletedSignDocument{} + var fernTestValueDeleted bool // Act - obj.SetPolicyPublished(fernTestValuePolicyPublished) + obj.SetDeleted(fernTestValueDeleted) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -24822,76 +24082,116 @@ func TestSettersMarkExplicitDmarcReport(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetMessages_MarksExplicit", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &DmarcReport{} - var fernTestValueMessages int64 +} - // Act - obj.SetMessages(fernTestValueMessages) +func TestSettersDeletedSignRequest(t *testing.T) { + t.Run("SetObject", func(t *testing.T) { + obj := &DeletedSignRequest{} + var fernTestValueObject DeletedSignRequestObject + obj.SetObject(fernTestValueObject) + assert.Equal(t, fernTestValueObject, obj.Object) + assert.NotNil(t, obj.explicitFields) + }) - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") + t.Run("SetID", func(t *testing.T) { + obj := &DeletedSignRequest{} + var fernTestValueID string + obj.SetID(fernTestValueID) + assert.Equal(t, fernTestValueID, obj.ID) + assert.NotNil(t, obj.explicitFields) + }) - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } + t.Run("SetDeleted", func(t *testing.T) { + obj := &DeletedSignRequest{} + var fernTestValueDeleted bool + obj.SetDeleted(fernTestValueDeleted) + assert.Equal(t, fernTestValueDeleted, obj.Deleted) + assert.NotNil(t, obj.explicitFields) + }) - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip +} + +func TestGettersDeletedSignRequest(t *testing.T) { + t.Run("GetObject", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DeletedSignRequest{} + var expected DeletedSignRequestObject + obj.Object = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetObject(), "getter should return the property value") }) - t.Run("SetPassing_MarksExplicit", func(t *testing.T) { + t.Run("GetObject_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *DeletedSignRequest + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetObject() // Should return zero value + }) + + t.Run("GetID", func(t *testing.T) { t.Parallel() // Arrange - obj := &DmarcReport{} - var fernTestValuePassing int64 + obj := &DeletedSignRequest{} + var expected string + obj.ID = expected - // Act - obj.SetPassing(fernTestValuePassing) + // Act & Assert + assert.Equal(t, expected, obj.GetID(), "getter should return the property value") + }) - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") + t.Run("GetID_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *DeletedSignRequest + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetID() // Should return zero value + }) - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } + t.Run("GetDeleted", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DeletedSignRequest{} + var expected bool + obj.Deleted = expected - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip + // Act & Assert + assert.Equal(t, expected, obj.GetDeleted(), "getter should return the property value") }) - t.Run("SetTruncated_MarksExplicit", func(t *testing.T) { + t.Run("GetDeleted_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *DeletedSignRequest + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetDeleted() // Should return zero value + }) + +} + +func TestSettersMarkExplicitDeletedSignRequest(t *testing.T) { + t.Run("SetObject_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DmarcReport{} - var fernTestValueTruncated bool + obj := &DeletedSignRequest{} + var fernTestValueObject DeletedSignRequestObject // Act - obj.SetTruncated(fernTestValueTruncated) + obj.SetObject(fernTestValueObject) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -24915,14 +24215,14 @@ func TestSettersMarkExplicitDmarcReport(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetReceivedAt_MarksExplicit", func(t *testing.T) { + t.Run("SetID_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DmarcReport{} - var fernTestValueReceivedAt time.Time + obj := &DeletedSignRequest{} + var fernTestValueID string // Act - obj.SetReceivedAt(fernTestValueReceivedAt) + obj.SetID(fernTestValueID) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -24946,14 +24246,14 @@ func TestSettersMarkExplicitDmarcReport(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetRecords_MarksExplicit", func(t *testing.T) { + t.Run("SetDeleted_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DmarcReport{} - var fernTestValueRecords []*DmarcReportRecord + obj := &DeletedSignRequest{} + var fernTestValueDeleted bool // Act - obj.SetRecords(fernTestValueRecords) + obj.SetDeleted(fernTestValueDeleted) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -24979,39 +24279,39 @@ func TestSettersMarkExplicitDmarcReport(t *testing.T) { } -func TestSettersDmarcReportList(t *testing.T) { +func TestSettersDeletedSignTemplate(t *testing.T) { t.Run("SetObject", func(t *testing.T) { - obj := &DmarcReportList{} - var fernTestValueObject DmarcReportListObject + obj := &DeletedSignTemplate{} + var fernTestValueObject DeletedSignTemplateObject obj.SetObject(fernTestValueObject) assert.Equal(t, fernTestValueObject, obj.Object) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetData", func(t *testing.T) { - obj := &DmarcReportList{} - var fernTestValueData []*DmarcReportSummary - obj.SetData(fernTestValueData) - assert.Equal(t, fernTestValueData, obj.Data) + t.Run("SetID", func(t *testing.T) { + obj := &DeletedSignTemplate{} + var fernTestValueID string + obj.SetID(fernTestValueID) + assert.Equal(t, fernTestValueID, obj.ID) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetHasMore", func(t *testing.T) { - obj := &DmarcReportList{} - var fernTestValueHasMore bool - obj.SetHasMore(fernTestValueHasMore) - assert.Equal(t, fernTestValueHasMore, obj.HasMore) + t.Run("SetDeleted", func(t *testing.T) { + obj := &DeletedSignTemplate{} + var fernTestValueDeleted bool + obj.SetDeleted(fernTestValueDeleted) + assert.Equal(t, fernTestValueDeleted, obj.Deleted) assert.NotNil(t, obj.explicitFields) }) } -func TestGettersDmarcReportList(t *testing.T) { +func TestGettersDeletedSignTemplate(t *testing.T) { t.Run("GetObject", func(t *testing.T) { t.Parallel() // Arrange - obj := &DmarcReportList{} - var expected DmarcReportListObject + obj := &DeletedSignTemplate{} + var expected DeletedSignTemplateObject obj.Object = expected // Act & Assert @@ -25020,7 +24320,7 @@ func TestGettersDmarcReportList(t *testing.T) { t.Run("GetObject_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DmarcReportList + var obj *DeletedSignTemplate // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -25030,70 +24330,60 @@ func TestGettersDmarcReportList(t *testing.T) { _ = obj.GetObject() // Should return zero value }) - t.Run("GetData", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &DmarcReportList{} - var expected []*DmarcReportSummary - obj.Data = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetData(), "getter should return the property value") - }) - - t.Run("GetData_NilValue", func(t *testing.T) { + t.Run("GetID", func(t *testing.T) { t.Parallel() // Arrange - obj := &DmarcReportList{} - obj.Data = nil + obj := &DeletedSignTemplate{} + var expected string + obj.ID = expected // Act & Assert - assert.Nil(t, obj.GetData(), "getter should return nil when property is nil") + assert.Equal(t, expected, obj.GetID(), "getter should return the property value") }) - t.Run("GetData_NilReceiver", func(t *testing.T) { + t.Run("GetID_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DmarcReportList + var obj *DeletedSignTemplate // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetData() // Should return zero value + _ = obj.GetID() // Should return zero value }) - t.Run("GetHasMore", func(t *testing.T) { + t.Run("GetDeleted", func(t *testing.T) { t.Parallel() // Arrange - obj := &DmarcReportList{} + obj := &DeletedSignTemplate{} var expected bool - obj.HasMore = expected + obj.Deleted = expected // Act & Assert - assert.Equal(t, expected, obj.GetHasMore(), "getter should return the property value") + assert.Equal(t, expected, obj.GetDeleted(), "getter should return the property value") }) - t.Run("GetHasMore_NilReceiver", func(t *testing.T) { + t.Run("GetDeleted_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DmarcReportList + var obj *DeletedSignTemplate // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetHasMore() // Should return zero value + _ = obj.GetDeleted() // Should return zero value }) } -func TestSettersMarkExplicitDmarcReportList(t *testing.T) { +func TestSettersMarkExplicitDeletedSignTemplate(t *testing.T) { t.Run("SetObject_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DmarcReportList{} - var fernTestValueObject DmarcReportListObject + obj := &DeletedSignTemplate{} + var fernTestValueObject DeletedSignTemplateObject // Act obj.SetObject(fernTestValueObject) @@ -25120,14 +24410,14 @@ func TestSettersMarkExplicitDmarcReportList(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetData_MarksExplicit", func(t *testing.T) { + t.Run("SetID_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DmarcReportList{} - var fernTestValueData []*DmarcReportSummary + obj := &DeletedSignTemplate{} + var fernTestValueID string // Act - obj.SetData(fernTestValueData) + obj.SetID(fernTestValueID) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -25151,14 +24441,14 @@ func TestSettersMarkExplicitDmarcReportList(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetHasMore_MarksExplicit", func(t *testing.T) { + t.Run("SetDeleted_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DmarcReportList{} - var fernTestValueHasMore bool + obj := &DeletedSignTemplate{} + var fernTestValueDeleted bool // Act - obj.SetHasMore(fernTestValueHasMore) + obj.SetDeleted(fernTestValueDeleted) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -25184,339 +24474,309 @@ func TestSettersMarkExplicitDmarcReportList(t *testing.T) { } -func TestSettersDmarcReportPolicyPublished(t *testing.T) { - t.Run("SetDomain", func(t *testing.T) { - obj := &DmarcReportPolicyPublished{} - var fernTestValueDomain string - obj.SetDomain(fernTestValueDomain) - assert.Equal(t, fernTestValueDomain, obj.Domain) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetP", func(t *testing.T) { - obj := &DmarcReportPolicyPublished{} - var fernTestValueP *string - obj.SetP(fernTestValueP) - assert.Equal(t, fernTestValueP, obj.P) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetSp", func(t *testing.T) { - obj := &DmarcReportPolicyPublished{} - var fernTestValueSp *string - obj.SetSp(fernTestValueSp) - assert.Equal(t, fernTestValueSp, obj.Sp) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetNp", func(t *testing.T) { - obj := &DmarcReportPolicyPublished{} - var fernTestValueNp *string - obj.SetNp(fernTestValueNp) - assert.Equal(t, fernTestValueNp, obj.Np) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetAdkim", func(t *testing.T) { - obj := &DmarcReportPolicyPublished{} - var fernTestValueAdkim *string - obj.SetAdkim(fernTestValueAdkim) - assert.Equal(t, fernTestValueAdkim, obj.Adkim) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetAspf", func(t *testing.T) { - obj := &DmarcReportPolicyPublished{} - var fernTestValueAspf *string - obj.SetAspf(fernTestValueAspf) - assert.Equal(t, fernTestValueAspf, obj.Aspf) +func TestSettersDeletedSmsSuppression(t *testing.T) { + t.Run("SetObject", func(t *testing.T) { + obj := &DeletedSmsSuppression{} + var fernTestValueObject DeletedSmsSuppressionObject + obj.SetObject(fernTestValueObject) + assert.Equal(t, fernTestValueObject, obj.Object) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetPct", func(t *testing.T) { - obj := &DmarcReportPolicyPublished{} - var fernTestValuePct *int64 - obj.SetPct(fernTestValuePct) - assert.Equal(t, fernTestValuePct, obj.Pct) + t.Run("SetID", func(t *testing.T) { + obj := &DeletedSmsSuppression{} + var fernTestValueID string + obj.SetID(fernTestValueID) + assert.Equal(t, fernTestValueID, obj.ID) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetTesting", func(t *testing.T) { - obj := &DmarcReportPolicyPublished{} - var fernTestValueTesting *string - obj.SetTesting(fernTestValueTesting) - assert.Equal(t, fernTestValueTesting, obj.Testing) + t.Run("SetDeleted", func(t *testing.T) { + obj := &DeletedSmsSuppression{} + var fernTestValueDeleted bool + obj.SetDeleted(fernTestValueDeleted) + assert.Equal(t, fernTestValueDeleted, obj.Deleted) assert.NotNil(t, obj.explicitFields) }) } -func TestGettersDmarcReportPolicyPublished(t *testing.T) { - t.Run("GetDomain", func(t *testing.T) { +func TestGettersDeletedSmsSuppression(t *testing.T) { + t.Run("GetObject", func(t *testing.T) { t.Parallel() // Arrange - obj := &DmarcReportPolicyPublished{} - var expected string - obj.Domain = expected + obj := &DeletedSmsSuppression{} + var expected DeletedSmsSuppressionObject + obj.Object = expected // Act & Assert - assert.Equal(t, expected, obj.GetDomain(), "getter should return the property value") + assert.Equal(t, expected, obj.GetObject(), "getter should return the property value") }) - t.Run("GetDomain_NilReceiver", func(t *testing.T) { + t.Run("GetObject_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DmarcReportPolicyPublished + var obj *DeletedSmsSuppression // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetDomain() // Should return zero value - }) - - t.Run("GetP", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &DmarcReportPolicyPublished{} - var expected *string - obj.P = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetP(), "getter should return the property value") + _ = obj.GetObject() // Should return zero value }) - t.Run("GetP_NilValue", func(t *testing.T) { + t.Run("GetID", func(t *testing.T) { t.Parallel() // Arrange - obj := &DmarcReportPolicyPublished{} - obj.P = nil + obj := &DeletedSmsSuppression{} + var expected string + obj.ID = expected // Act & Assert - assert.Nil(t, obj.GetP(), "getter should return nil when property is nil") + assert.Equal(t, expected, obj.GetID(), "getter should return the property value") }) - t.Run("GetP_NilReceiver", func(t *testing.T) { + t.Run("GetID_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DmarcReportPolicyPublished + var obj *DeletedSmsSuppression // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetP() // Should return zero value - }) - - t.Run("GetSp", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &DmarcReportPolicyPublished{} - var expected *string - obj.Sp = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetSp(), "getter should return the property value") + _ = obj.GetID() // Should return zero value }) - t.Run("GetSp_NilValue", func(t *testing.T) { + t.Run("GetDeleted", func(t *testing.T) { t.Parallel() // Arrange - obj := &DmarcReportPolicyPublished{} - obj.Sp = nil + obj := &DeletedSmsSuppression{} + var expected bool + obj.Deleted = expected // Act & Assert - assert.Nil(t, obj.GetSp(), "getter should return nil when property is nil") + assert.Equal(t, expected, obj.GetDeleted(), "getter should return the property value") }) - t.Run("GetSp_NilReceiver", func(t *testing.T) { + t.Run("GetDeleted_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DmarcReportPolicyPublished + var obj *DeletedSmsSuppression // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetSp() // Should return zero value + _ = obj.GetDeleted() // Should return zero value }) - t.Run("GetNp", func(t *testing.T) { +} + +func TestSettersMarkExplicitDeletedSmsSuppression(t *testing.T) { + t.Run("SetObject_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DmarcReportPolicyPublished{} - var expected *string - obj.Np = expected + obj := &DeletedSmsSuppression{} + var fernTestValueObject DeletedSmsSuppressionObject - // Act & Assert - assert.Equal(t, expected, obj.GetNp(), "getter should return the property value") - }) + // Act + obj.SetObject(fernTestValueObject) - t.Run("GetNp_NilValue", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &DmarcReportPolicyPublished{} - obj.Np = nil + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") - // Act & Assert - assert.Nil(t, obj.GetNp(), "getter should return nil when property is nil") - }) + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } - t.Run("GetNp_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *DmarcReportPolicyPublished - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetNp() // Should return zero value + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("GetAdkim", func(t *testing.T) { + t.Run("SetID_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DmarcReportPolicyPublished{} - var expected *string - obj.Adkim = expected + obj := &DeletedSmsSuppression{} + var fernTestValueID string - // Act & Assert - assert.Equal(t, expected, obj.GetAdkim(), "getter should return the property value") + // Act + obj.SetID(fernTestValueID) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("GetAdkim_NilValue", func(t *testing.T) { + t.Run("SetDeleted_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DmarcReportPolicyPublished{} - obj.Adkim = nil + obj := &DeletedSmsSuppression{} + var fernTestValueDeleted bool - // Act & Assert - assert.Nil(t, obj.GetAdkim(), "getter should return nil when property is nil") + // Act + obj.SetDeleted(fernTestValueDeleted) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("GetAdkim_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *DmarcReportPolicyPublished - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetAdkim() // Should return zero value +} + +func TestSettersDeletedSuppression(t *testing.T) { + t.Run("SetObject", func(t *testing.T) { + obj := &DeletedSuppression{} + var fernTestValueObject DeletedSuppressionObject + obj.SetObject(fernTestValueObject) + assert.Equal(t, fernTestValueObject, obj.Object) + assert.NotNil(t, obj.explicitFields) }) - t.Run("GetAspf", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &DmarcReportPolicyPublished{} - var expected *string - obj.Aspf = expected + t.Run("SetID", func(t *testing.T) { + obj := &DeletedSuppression{} + var fernTestValueID string + obj.SetID(fernTestValueID) + assert.Equal(t, fernTestValueID, obj.ID) + assert.NotNil(t, obj.explicitFields) + }) - // Act & Assert - assert.Equal(t, expected, obj.GetAspf(), "getter should return the property value") + t.Run("SetDeleted", func(t *testing.T) { + obj := &DeletedSuppression{} + var fernTestValueDeleted bool + obj.SetDeleted(fernTestValueDeleted) + assert.Equal(t, fernTestValueDeleted, obj.Deleted) + assert.NotNil(t, obj.explicitFields) }) - t.Run("GetAspf_NilValue", func(t *testing.T) { +} + +func TestGettersDeletedSuppression(t *testing.T) { + t.Run("GetObject", func(t *testing.T) { t.Parallel() // Arrange - obj := &DmarcReportPolicyPublished{} - obj.Aspf = nil + obj := &DeletedSuppression{} + var expected DeletedSuppressionObject + obj.Object = expected // Act & Assert - assert.Nil(t, obj.GetAspf(), "getter should return nil when property is nil") + assert.Equal(t, expected, obj.GetObject(), "getter should return the property value") }) - t.Run("GetAspf_NilReceiver", func(t *testing.T) { + t.Run("GetObject_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DmarcReportPolicyPublished + var obj *DeletedSuppression // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetAspf() // Should return zero value - }) - - t.Run("GetPct", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &DmarcReportPolicyPublished{} - var expected *int64 - obj.Pct = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetPct(), "getter should return the property value") + _ = obj.GetObject() // Should return zero value }) - t.Run("GetPct_NilValue", func(t *testing.T) { + t.Run("GetID", func(t *testing.T) { t.Parallel() // Arrange - obj := &DmarcReportPolicyPublished{} - obj.Pct = nil + obj := &DeletedSuppression{} + var expected string + obj.ID = expected // Act & Assert - assert.Nil(t, obj.GetPct(), "getter should return nil when property is nil") + assert.Equal(t, expected, obj.GetID(), "getter should return the property value") }) - t.Run("GetPct_NilReceiver", func(t *testing.T) { + t.Run("GetID_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DmarcReportPolicyPublished + var obj *DeletedSuppression // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetPct() // Should return zero value - }) - - t.Run("GetTesting", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &DmarcReportPolicyPublished{} - var expected *string - obj.Testing = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetTesting(), "getter should return the property value") + _ = obj.GetID() // Should return zero value }) - t.Run("GetTesting_NilValue", func(t *testing.T) { + t.Run("GetDeleted", func(t *testing.T) { t.Parallel() // Arrange - obj := &DmarcReportPolicyPublished{} - obj.Testing = nil + obj := &DeletedSuppression{} + var expected bool + obj.Deleted = expected // Act & Assert - assert.Nil(t, obj.GetTesting(), "getter should return nil when property is nil") + assert.Equal(t, expected, obj.GetDeleted(), "getter should return the property value") }) - t.Run("GetTesting_NilReceiver", func(t *testing.T) { + t.Run("GetDeleted_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DmarcReportPolicyPublished + var obj *DeletedSuppression // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetTesting() // Should return zero value + _ = obj.GetDeleted() // Should return zero value }) } -func TestSettersMarkExplicitDmarcReportPolicyPublished(t *testing.T) { - t.Run("SetDomain_MarksExplicit", func(t *testing.T) { +func TestSettersMarkExplicitDeletedSuppression(t *testing.T) { + t.Run("SetObject_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DmarcReportPolicyPublished{} - var fernTestValueDomain string + obj := &DeletedSuppression{} + var fernTestValueObject DeletedSuppressionObject // Act - obj.SetDomain(fernTestValueDomain) + obj.SetObject(fernTestValueObject) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -25540,14 +24800,14 @@ func TestSettersMarkExplicitDmarcReportPolicyPublished(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetP_MarksExplicit", func(t *testing.T) { + t.Run("SetID_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DmarcReportPolicyPublished{} - var fernTestValueP *string + obj := &DeletedSuppression{} + var fernTestValueID string // Act - obj.SetP(fernTestValueP) + obj.SetID(fernTestValueID) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -25571,14 +24831,14 @@ func TestSettersMarkExplicitDmarcReportPolicyPublished(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetSp_MarksExplicit", func(t *testing.T) { + t.Run("SetDeleted_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DmarcReportPolicyPublished{} - var fernTestValueSp *string + obj := &DeletedSuppression{} + var fernTestValueDeleted bool // Act - obj.SetSp(fernTestValueSp) + obj.SetDeleted(fernTestValueDeleted) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -25602,76 +24862,116 @@ func TestSettersMarkExplicitDmarcReportPolicyPublished(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetNp_MarksExplicit", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &DmarcReportPolicyPublished{} - var fernTestValueNp *string +} - // Act - obj.SetNp(fernTestValueNp) +func TestSettersDeletedTopic(t *testing.T) { + t.Run("SetObject", func(t *testing.T) { + obj := &DeletedTopic{} + var fernTestValueObject DeletedTopicObject + obj.SetObject(fernTestValueObject) + assert.Equal(t, fernTestValueObject, obj.Object) + assert.NotNil(t, obj.explicitFields) + }) - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") + t.Run("SetID", func(t *testing.T) { + obj := &DeletedTopic{} + var fernTestValueID string + obj.SetID(fernTestValueID) + assert.Equal(t, fernTestValueID, obj.ID) + assert.NotNil(t, obj.explicitFields) + }) - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } + t.Run("SetDeleted", func(t *testing.T) { + obj := &DeletedTopic{} + var fernTestValueDeleted bool + obj.SetDeleted(fernTestValueDeleted) + assert.Equal(t, fernTestValueDeleted, obj.Deleted) + assert.NotNil(t, obj.explicitFields) + }) - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip +} + +func TestGettersDeletedTopic(t *testing.T) { + t.Run("GetObject", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DeletedTopic{} + var expected DeletedTopicObject + obj.Object = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetObject(), "getter should return the property value") }) - t.Run("SetAdkim_MarksExplicit", func(t *testing.T) { + t.Run("GetObject_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *DeletedTopic + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetObject() // Should return zero value + }) + + t.Run("GetID", func(t *testing.T) { t.Parallel() // Arrange - obj := &DmarcReportPolicyPublished{} - var fernTestValueAdkim *string + obj := &DeletedTopic{} + var expected string + obj.ID = expected - // Act - obj.SetAdkim(fernTestValueAdkim) + // Act & Assert + assert.Equal(t, expected, obj.GetID(), "getter should return the property value") + }) - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") + t.Run("GetID_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *DeletedTopic + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetID() // Should return zero value + }) - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } + t.Run("GetDeleted", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DeletedTopic{} + var expected bool + obj.Deleted = expected - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip + // Act & Assert + assert.Equal(t, expected, obj.GetDeleted(), "getter should return the property value") }) - t.Run("SetAspf_MarksExplicit", func(t *testing.T) { + t.Run("GetDeleted_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *DeletedTopic + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetDeleted() // Should return zero value + }) + +} + +func TestSettersMarkExplicitDeletedTopic(t *testing.T) { + t.Run("SetObject_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DmarcReportPolicyPublished{} - var fernTestValueAspf *string + obj := &DeletedTopic{} + var fernTestValueObject DeletedTopicObject // Act - obj.SetAspf(fernTestValueAspf) + obj.SetObject(fernTestValueObject) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -25695,14 +24995,14 @@ func TestSettersMarkExplicitDmarcReportPolicyPublished(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetPct_MarksExplicit", func(t *testing.T) { + t.Run("SetID_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DmarcReportPolicyPublished{} - var fernTestValuePct *int64 + obj := &DeletedTopic{} + var fernTestValueID string // Act - obj.SetPct(fernTestValuePct) + obj.SetID(fernTestValueID) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -25726,14 +25026,14 @@ func TestSettersMarkExplicitDmarcReportPolicyPublished(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetTesting_MarksExplicit", func(t *testing.T) { + t.Run("SetDeleted_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DmarcReportPolicyPublished{} - var fernTestValueTesting *string + obj := &DeletedTopic{} + var fernTestValueDeleted bool // Act - obj.SetTesting(fernTestValueTesting) + obj.SetDeleted(fernTestValueDeleted) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -25759,392 +25059,647 @@ func TestSettersMarkExplicitDmarcReportPolicyPublished(t *testing.T) { } -func TestSettersDmarcReportRecord(t *testing.T) { - t.Run("SetSourceIP", func(t *testing.T) { - obj := &DmarcReportRecord{} - var fernTestValueSourceIP string - obj.SetSourceIP(fernTestValueSourceIP) - assert.Equal(t, fernTestValueSourceIP, obj.SourceIP) +func TestSettersDeletedTrackingRule(t *testing.T) { + t.Run("SetObject", func(t *testing.T) { + obj := &DeletedTrackingRule{} + var fernTestValueObject DeletedTrackingRuleObject + obj.SetObject(fernTestValueObject) + assert.Equal(t, fernTestValueObject, obj.Object) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetCount", func(t *testing.T) { - obj := &DmarcReportRecord{} - var fernTestValueCount int64 - obj.SetCount(fernTestValueCount) - assert.Equal(t, fernTestValueCount, obj.Count) + t.Run("SetID", func(t *testing.T) { + obj := &DeletedTrackingRule{} + var fernTestValueID string + obj.SetID(fernTestValueID) + assert.Equal(t, fernTestValueID, obj.ID) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetDisposition", func(t *testing.T) { - obj := &DmarcReportRecord{} - var fernTestValueDisposition DmarcReportRecordDisposition - obj.SetDisposition(fernTestValueDisposition) - assert.Equal(t, fernTestValueDisposition, obj.Disposition) + t.Run("SetCategory", func(t *testing.T) { + obj := &DeletedTrackingRule{} + var fernTestValueCategory *string + obj.SetCategory(fernTestValueCategory) + assert.Equal(t, fernTestValueCategory, obj.Category) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetDkim", func(t *testing.T) { - obj := &DmarcReportRecord{} - var fernTestValueDkim DmarcReportRecordDkim - obj.SetDkim(fernTestValueDkim) - assert.Equal(t, fernTestValueDkim, obj.Dkim) + t.Run("SetDeleted", func(t *testing.T) { + obj := &DeletedTrackingRule{} + var fernTestValueDeleted bool + obj.SetDeleted(fernTestValueDeleted) + assert.Equal(t, fernTestValueDeleted, obj.Deleted) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetSpf", func(t *testing.T) { - obj := &DmarcReportRecord{} - var fernTestValueSpf DmarcReportRecordSpf - obj.SetSpf(fernTestValueSpf) - assert.Equal(t, fernTestValueSpf, obj.Spf) - assert.NotNil(t, obj.explicitFields) - }) +} - t.Run("SetDmarcPass", func(t *testing.T) { - obj := &DmarcReportRecord{} - var fernTestValueDmarcPass bool - obj.SetDmarcPass(fernTestValueDmarcPass) - assert.Equal(t, fernTestValueDmarcPass, obj.DmarcPass) - assert.NotNil(t, obj.explicitFields) - }) +func TestGettersDeletedTrackingRule(t *testing.T) { + t.Run("GetObject", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DeletedTrackingRule{} + var expected DeletedTrackingRuleObject + obj.Object = expected - t.Run("SetHeaderFrom", func(t *testing.T) { - obj := &DmarcReportRecord{} - var fernTestValueHeaderFrom string - obj.SetHeaderFrom(fernTestValueHeaderFrom) - assert.Equal(t, fernTestValueHeaderFrom, obj.HeaderFrom) - assert.NotNil(t, obj.explicitFields) + // Act & Assert + assert.Equal(t, expected, obj.GetObject(), "getter should return the property value") }) - t.Run("SetEnvelopeFrom", func(t *testing.T) { - obj := &DmarcReportRecord{} - var fernTestValueEnvelopeFrom *string - obj.SetEnvelopeFrom(fernTestValueEnvelopeFrom) - assert.Equal(t, fernTestValueEnvelopeFrom, obj.EnvelopeFrom) - assert.NotNil(t, obj.explicitFields) + t.Run("GetObject_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *DeletedTrackingRule + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetObject() // Should return zero value }) - t.Run("SetViaCoss", func(t *testing.T) { - obj := &DmarcReportRecord{} - var fernTestValueViaCoss bool - obj.SetViaCoss(fernTestValueViaCoss) - assert.Equal(t, fernTestValueViaCoss, obj.ViaCoss) - assert.NotNil(t, obj.explicitFields) - }) + t.Run("GetID", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DeletedTrackingRule{} + var expected string + obj.ID = expected - t.Run("SetAuthResults", func(t *testing.T) { - obj := &DmarcReportRecord{} - var fernTestValueAuthResults *DmarcReportRecordAuthResults - obj.SetAuthResults(fernTestValueAuthResults) - assert.Equal(t, fernTestValueAuthResults, obj.AuthResults) - assert.NotNil(t, obj.explicitFields) + // Act & Assert + assert.Equal(t, expected, obj.GetID(), "getter should return the property value") }) - t.Run("SetReasons", func(t *testing.T) { - obj := &DmarcReportRecord{} - var fernTestValueReasons []*DmarcReportRecordReasonsItem - obj.SetReasons(fernTestValueReasons) - assert.Equal(t, fernTestValueReasons, obj.Reasons) - assert.NotNil(t, obj.explicitFields) + t.Run("GetID_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *DeletedTrackingRule + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetID() // Should return zero value }) -} + t.Run("GetCategory", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DeletedTrackingRule{} + var expected *string + obj.Category = expected -func TestGettersDmarcReportRecord(t *testing.T) { - t.Run("GetSourceIP", func(t *testing.T) { + // Act & Assert + assert.Equal(t, expected, obj.GetCategory(), "getter should return the property value") + }) + + t.Run("GetCategory_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &DmarcReportRecord{} - var expected string - obj.SourceIP = expected + obj := &DeletedTrackingRule{} + obj.Category = nil // Act & Assert - assert.Equal(t, expected, obj.GetSourceIP(), "getter should return the property value") + assert.Nil(t, obj.GetCategory(), "getter should return nil when property is nil") }) - t.Run("GetSourceIP_NilReceiver", func(t *testing.T) { + t.Run("GetCategory_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DmarcReportRecord + var obj *DeletedTrackingRule // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetSourceIP() // Should return zero value + _ = obj.GetCategory() // Should return zero value }) - t.Run("GetCount", func(t *testing.T) { + t.Run("GetDeleted", func(t *testing.T) { t.Parallel() // Arrange - obj := &DmarcReportRecord{} - var expected int64 - obj.Count = expected + obj := &DeletedTrackingRule{} + var expected bool + obj.Deleted = expected // Act & Assert - assert.Equal(t, expected, obj.GetCount(), "getter should return the property value") + assert.Equal(t, expected, obj.GetDeleted(), "getter should return the property value") }) - t.Run("GetCount_NilReceiver", func(t *testing.T) { + t.Run("GetDeleted_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DmarcReportRecord + var obj *DeletedTrackingRule // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetCount() // Should return zero value + _ = obj.GetDeleted() // Should return zero value }) - t.Run("GetDisposition", func(t *testing.T) { +} + +func TestSettersMarkExplicitDeletedTrackingRule(t *testing.T) { + t.Run("SetObject_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DmarcReportRecord{} - var expected DmarcReportRecordDisposition - obj.Disposition = expected + obj := &DeletedTrackingRule{} + var fernTestValueObject DeletedTrackingRuleObject + + // Act + obj.SetObject(fernTestValueObject) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetID_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DeletedTrackingRule{} + var fernTestValueID string + + // Act + obj.SetID(fernTestValueID) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetCategory_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DeletedTrackingRule{} + var fernTestValueCategory *string + + // Act + obj.SetCategory(fernTestValueCategory) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetDeleted_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DeletedTrackingRule{} + var fernTestValueDeleted bool + + // Act + obj.SetDeleted(fernTestValueDeleted) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + +} + +func TestSettersDmarcPublishedRecord(t *testing.T) { + t.Run("SetValue", func(t *testing.T) { + obj := &DmarcPublishedRecord{} + var fernTestValueValue string + obj.SetValue(fernTestValueValue) + assert.Equal(t, fernTestValueValue, obj.Value) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetP", func(t *testing.T) { + obj := &DmarcPublishedRecord{} + var fernTestValueP *DmarcPublishedRecordP + obj.SetP(fernTestValueP) + assert.Equal(t, fernTestValueP, obj.P) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetSp", func(t *testing.T) { + obj := &DmarcPublishedRecord{} + var fernTestValueSp *DmarcPublishedRecordSp + obj.SetSp(fernTestValueSp) + assert.Equal(t, fernTestValueSp, obj.Sp) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetNp", func(t *testing.T) { + obj := &DmarcPublishedRecord{} + var fernTestValueNp *DmarcPublishedRecordNp + obj.SetNp(fernTestValueNp) + assert.Equal(t, fernTestValueNp, obj.Np) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetAdkim", func(t *testing.T) { + obj := &DmarcPublishedRecord{} + var fernTestValueAdkim *DmarcPublishedRecordAdkim + obj.SetAdkim(fernTestValueAdkim) + assert.Equal(t, fernTestValueAdkim, obj.Adkim) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetAspf", func(t *testing.T) { + obj := &DmarcPublishedRecord{} + var fernTestValueAspf *DmarcPublishedRecordAspf + obj.SetAspf(fernTestValueAspf) + assert.Equal(t, fernTestValueAspf, obj.Aspf) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetPct", func(t *testing.T) { + obj := &DmarcPublishedRecord{} + var fernTestValuePct *int64 + obj.SetPct(fernTestValuePct) + assert.Equal(t, fernTestValuePct, obj.Pct) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetT", func(t *testing.T) { + obj := &DmarcPublishedRecord{} + var fernTestValueT *DmarcPublishedRecordT + obj.SetT(fernTestValueT) + assert.Equal(t, fernTestValueT, obj.T) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetRua", func(t *testing.T) { + obj := &DmarcPublishedRecord{} + var fernTestValueRua []string + obj.SetRua(fernTestValueRua) + assert.Equal(t, fernTestValueRua, obj.Rua) + assert.NotNil(t, obj.explicitFields) + }) + +} + +func TestGettersDmarcPublishedRecord(t *testing.T) { + t.Run("GetValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DmarcPublishedRecord{} + var expected string + obj.Value = expected // Act & Assert - assert.Equal(t, expected, obj.GetDisposition(), "getter should return the property value") + assert.Equal(t, expected, obj.GetValue(), "getter should return the property value") }) - t.Run("GetDisposition_NilReceiver", func(t *testing.T) { + t.Run("GetValue_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DmarcReportRecord + var obj *DmarcPublishedRecord // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetDisposition() // Should return zero value + _ = obj.GetValue() // Should return zero value }) - t.Run("GetDkim", func(t *testing.T) { + t.Run("GetP", func(t *testing.T) { t.Parallel() // Arrange - obj := &DmarcReportRecord{} - var expected DmarcReportRecordDkim - obj.Dkim = expected + obj := &DmarcPublishedRecord{} + var expected *DmarcPublishedRecordP + obj.P = expected // Act & Assert - assert.Equal(t, expected, obj.GetDkim(), "getter should return the property value") + assert.Equal(t, expected, obj.GetP(), "getter should return the property value") }) - t.Run("GetDkim_NilReceiver", func(t *testing.T) { + t.Run("GetP_NilValue", func(t *testing.T) { t.Parallel() - var obj *DmarcReportRecord + // Arrange + obj := &DmarcPublishedRecord{} + obj.P = nil + + // Act & Assert + assert.Nil(t, obj.GetP(), "getter should return nil when property is nil") + }) + + t.Run("GetP_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *DmarcPublishedRecord // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetDkim() // Should return zero value + _ = obj.GetP() // Should return zero value }) - t.Run("GetSpf", func(t *testing.T) { + t.Run("GetSp", func(t *testing.T) { t.Parallel() // Arrange - obj := &DmarcReportRecord{} - var expected DmarcReportRecordSpf - obj.Spf = expected + obj := &DmarcPublishedRecord{} + var expected *DmarcPublishedRecordSp + obj.Sp = expected // Act & Assert - assert.Equal(t, expected, obj.GetSpf(), "getter should return the property value") + assert.Equal(t, expected, obj.GetSp(), "getter should return the property value") }) - t.Run("GetSpf_NilReceiver", func(t *testing.T) { + t.Run("GetSp_NilValue", func(t *testing.T) { t.Parallel() - var obj *DmarcReportRecord + // Arrange + obj := &DmarcPublishedRecord{} + obj.Sp = nil + + // Act & Assert + assert.Nil(t, obj.GetSp(), "getter should return nil when property is nil") + }) + + t.Run("GetSp_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *DmarcPublishedRecord // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetSpf() // Should return zero value + _ = obj.GetSp() // Should return zero value }) - t.Run("GetDmarcPass", func(t *testing.T) { + t.Run("GetNp", func(t *testing.T) { t.Parallel() // Arrange - obj := &DmarcReportRecord{} - var expected bool - obj.DmarcPass = expected + obj := &DmarcPublishedRecord{} + var expected *DmarcPublishedRecordNp + obj.Np = expected // Act & Assert - assert.Equal(t, expected, obj.GetDmarcPass(), "getter should return the property value") + assert.Equal(t, expected, obj.GetNp(), "getter should return the property value") }) - t.Run("GetDmarcPass_NilReceiver", func(t *testing.T) { + t.Run("GetNp_NilValue", func(t *testing.T) { t.Parallel() - var obj *DmarcReportRecord + // Arrange + obj := &DmarcPublishedRecord{} + obj.Np = nil + + // Act & Assert + assert.Nil(t, obj.GetNp(), "getter should return nil when property is nil") + }) + + t.Run("GetNp_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *DmarcPublishedRecord // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetDmarcPass() // Should return zero value + _ = obj.GetNp() // Should return zero value }) - t.Run("GetHeaderFrom", func(t *testing.T) { + t.Run("GetAdkim", func(t *testing.T) { t.Parallel() // Arrange - obj := &DmarcReportRecord{} - var expected string - obj.HeaderFrom = expected + obj := &DmarcPublishedRecord{} + var expected *DmarcPublishedRecordAdkim + obj.Adkim = expected // Act & Assert - assert.Equal(t, expected, obj.GetHeaderFrom(), "getter should return the property value") + assert.Equal(t, expected, obj.GetAdkim(), "getter should return the property value") }) - t.Run("GetHeaderFrom_NilReceiver", func(t *testing.T) { + t.Run("GetAdkim_NilValue", func(t *testing.T) { t.Parallel() - var obj *DmarcReportRecord + // Arrange + obj := &DmarcPublishedRecord{} + obj.Adkim = nil + + // Act & Assert + assert.Nil(t, obj.GetAdkim(), "getter should return nil when property is nil") + }) + + t.Run("GetAdkim_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *DmarcPublishedRecord // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetHeaderFrom() // Should return zero value + _ = obj.GetAdkim() // Should return zero value }) - t.Run("GetEnvelopeFrom", func(t *testing.T) { + t.Run("GetAspf", func(t *testing.T) { t.Parallel() // Arrange - obj := &DmarcReportRecord{} - var expected *string - obj.EnvelopeFrom = expected + obj := &DmarcPublishedRecord{} + var expected *DmarcPublishedRecordAspf + obj.Aspf = expected // Act & Assert - assert.Equal(t, expected, obj.GetEnvelopeFrom(), "getter should return the property value") + assert.Equal(t, expected, obj.GetAspf(), "getter should return the property value") }) - t.Run("GetEnvelopeFrom_NilValue", func(t *testing.T) { + t.Run("GetAspf_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &DmarcReportRecord{} - obj.EnvelopeFrom = nil + obj := &DmarcPublishedRecord{} + obj.Aspf = nil // Act & Assert - assert.Nil(t, obj.GetEnvelopeFrom(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetAspf(), "getter should return nil when property is nil") }) - t.Run("GetEnvelopeFrom_NilReceiver", func(t *testing.T) { + t.Run("GetAspf_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DmarcReportRecord + var obj *DmarcPublishedRecord // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetEnvelopeFrom() // Should return zero value + _ = obj.GetAspf() // Should return zero value }) - t.Run("GetViaCoss", func(t *testing.T) { + t.Run("GetPct", func(t *testing.T) { t.Parallel() // Arrange - obj := &DmarcReportRecord{} - var expected bool - obj.ViaCoss = expected + obj := &DmarcPublishedRecord{} + var expected *int64 + obj.Pct = expected // Act & Assert - assert.Equal(t, expected, obj.GetViaCoss(), "getter should return the property value") + assert.Equal(t, expected, obj.GetPct(), "getter should return the property value") }) - t.Run("GetViaCoss_NilReceiver", func(t *testing.T) { + t.Run("GetPct_NilValue", func(t *testing.T) { t.Parallel() - var obj *DmarcReportRecord + // Arrange + obj := &DmarcPublishedRecord{} + obj.Pct = nil + + // Act & Assert + assert.Nil(t, obj.GetPct(), "getter should return nil when property is nil") + }) + + t.Run("GetPct_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *DmarcPublishedRecord // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetViaCoss() // Should return zero value + _ = obj.GetPct() // Should return zero value }) - t.Run("GetAuthResults", func(t *testing.T) { + t.Run("GetT", func(t *testing.T) { t.Parallel() // Arrange - obj := &DmarcReportRecord{} - var expected *DmarcReportRecordAuthResults - obj.AuthResults = expected + obj := &DmarcPublishedRecord{} + var expected *DmarcPublishedRecordT + obj.T = expected // Act & Assert - assert.Equal(t, expected, obj.GetAuthResults(), "getter should return the property value") + assert.Equal(t, expected, obj.GetT(), "getter should return the property value") }) - t.Run("GetAuthResults_NilValue", func(t *testing.T) { + t.Run("GetT_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &DmarcReportRecord{} - obj.AuthResults = nil + obj := &DmarcPublishedRecord{} + obj.T = nil // Act & Assert - assert.Nil(t, obj.GetAuthResults(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetT(), "getter should return nil when property is nil") }) - t.Run("GetAuthResults_NilReceiver", func(t *testing.T) { + t.Run("GetT_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DmarcReportRecord + var obj *DmarcPublishedRecord // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetAuthResults() // Should return zero value + _ = obj.GetT() // Should return zero value }) - t.Run("GetReasons", func(t *testing.T) { + t.Run("GetRua", func(t *testing.T) { t.Parallel() // Arrange - obj := &DmarcReportRecord{} - var expected []*DmarcReportRecordReasonsItem - obj.Reasons = expected + obj := &DmarcPublishedRecord{} + var expected []string + obj.Rua = expected // Act & Assert - assert.Equal(t, expected, obj.GetReasons(), "getter should return the property value") + assert.Equal(t, expected, obj.GetRua(), "getter should return the property value") }) - t.Run("GetReasons_NilValue", func(t *testing.T) { + t.Run("GetRua_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &DmarcReportRecord{} - obj.Reasons = nil + obj := &DmarcPublishedRecord{} + obj.Rua = nil // Act & Assert - assert.Nil(t, obj.GetReasons(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetRua(), "getter should return nil when property is nil") }) - t.Run("GetReasons_NilReceiver", func(t *testing.T) { + t.Run("GetRua_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DmarcReportRecord + var obj *DmarcPublishedRecord // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetReasons() // Should return zero value + _ = obj.GetRua() // Should return zero value }) } -func TestSettersMarkExplicitDmarcReportRecord(t *testing.T) { - t.Run("SetSourceIP_MarksExplicit", func(t *testing.T) { +func TestSettersMarkExplicitDmarcPublishedRecord(t *testing.T) { + t.Run("SetValue_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DmarcReportRecord{} - var fernTestValueSourceIP string + obj := &DmarcPublishedRecord{} + var fernTestValueValue string // Act - obj.SetSourceIP(fernTestValueSourceIP) + obj.SetValue(fernTestValueValue) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -26168,14 +25723,14 @@ func TestSettersMarkExplicitDmarcReportRecord(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetCount_MarksExplicit", func(t *testing.T) { + t.Run("SetP_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DmarcReportRecord{} - var fernTestValueCount int64 + obj := &DmarcPublishedRecord{} + var fernTestValueP *DmarcPublishedRecordP // Act - obj.SetCount(fernTestValueCount) + obj.SetP(fernTestValueP) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -26199,14 +25754,14 @@ func TestSettersMarkExplicitDmarcReportRecord(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetDisposition_MarksExplicit", func(t *testing.T) { + t.Run("SetSp_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DmarcReportRecord{} - var fernTestValueDisposition DmarcReportRecordDisposition + obj := &DmarcPublishedRecord{} + var fernTestValueSp *DmarcPublishedRecordSp // Act - obj.SetDisposition(fernTestValueDisposition) + obj.SetSp(fernTestValueSp) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -26230,14 +25785,14 @@ func TestSettersMarkExplicitDmarcReportRecord(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetDkim_MarksExplicit", func(t *testing.T) { + t.Run("SetNp_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DmarcReportRecord{} - var fernTestValueDkim DmarcReportRecordDkim + obj := &DmarcPublishedRecord{} + var fernTestValueNp *DmarcPublishedRecordNp // Act - obj.SetDkim(fernTestValueDkim) + obj.SetNp(fernTestValueNp) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -26261,14 +25816,14 @@ func TestSettersMarkExplicitDmarcReportRecord(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetSpf_MarksExplicit", func(t *testing.T) { + t.Run("SetAdkim_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DmarcReportRecord{} - var fernTestValueSpf DmarcReportRecordSpf + obj := &DmarcPublishedRecord{} + var fernTestValueAdkim *DmarcPublishedRecordAdkim // Act - obj.SetSpf(fernTestValueSpf) + obj.SetAdkim(fernTestValueAdkim) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -26292,14 +25847,14 @@ func TestSettersMarkExplicitDmarcReportRecord(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetDmarcPass_MarksExplicit", func(t *testing.T) { + t.Run("SetAspf_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DmarcReportRecord{} - var fernTestValueDmarcPass bool + obj := &DmarcPublishedRecord{} + var fernTestValueAspf *DmarcPublishedRecordAspf // Act - obj.SetDmarcPass(fernTestValueDmarcPass) + obj.SetAspf(fernTestValueAspf) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -26323,14 +25878,14 @@ func TestSettersMarkExplicitDmarcReportRecord(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetHeaderFrom_MarksExplicit", func(t *testing.T) { + t.Run("SetPct_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DmarcReportRecord{} - var fernTestValueHeaderFrom string + obj := &DmarcPublishedRecord{} + var fernTestValuePct *int64 // Act - obj.SetHeaderFrom(fernTestValueHeaderFrom) + obj.SetPct(fernTestValuePct) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -26354,14 +25909,14 @@ func TestSettersMarkExplicitDmarcReportRecord(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetEnvelopeFrom_MarksExplicit", func(t *testing.T) { + t.Run("SetT_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DmarcReportRecord{} - var fernTestValueEnvelopeFrom *string + obj := &DmarcPublishedRecord{} + var fernTestValueT *DmarcPublishedRecordT // Act - obj.SetEnvelopeFrom(fernTestValueEnvelopeFrom) + obj.SetT(fernTestValueT) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -26385,14 +25940,14 @@ func TestSettersMarkExplicitDmarcReportRecord(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetViaCoss_MarksExplicit", func(t *testing.T) { + t.Run("SetRua_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DmarcReportRecord{} - var fernTestValueViaCoss bool + obj := &DmarcPublishedRecord{} + var fernTestValueRua []string // Act - obj.SetViaCoss(fernTestValueViaCoss) + obj.SetRua(fernTestValueRua) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -26416,341 +25971,456 @@ func TestSettersMarkExplicitDmarcReportRecord(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetAuthResults_MarksExplicit", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &DmarcReportRecord{} - var fernTestValueAuthResults *DmarcReportRecordAuthResults - - // Act - obj.SetAuthResults(fernTestValueAuthResults) - - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") +} - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } +func TestSettersDmarcReport(t *testing.T) { + t.Run("SetObject", func(t *testing.T) { + obj := &DmarcReport{} + var fernTestValueObject DmarcReportObject + obj.SetObject(fernTestValueObject) + assert.Equal(t, fernTestValueObject, obj.Object) + assert.NotNil(t, obj.explicitFields) + }) - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip + t.Run("SetID", func(t *testing.T) { + obj := &DmarcReport{} + var fernTestValueID string + obj.SetID(fernTestValueID) + assert.Equal(t, fernTestValueID, obj.ID) + assert.NotNil(t, obj.explicitFields) }) - t.Run("SetReasons_MarksExplicit", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &DmarcReportRecord{} - var fernTestValueReasons []*DmarcReportRecordReasonsItem + t.Run("SetDomainID", func(t *testing.T) { + obj := &DmarcReport{} + var fernTestValueDomainID string + obj.SetDomainID(fernTestValueDomainID) + assert.Equal(t, fernTestValueDomainID, obj.DomainID) + assert.NotNil(t, obj.explicitFields) + }) - // Act - obj.SetReasons(fernTestValueReasons) + t.Run("SetReporter", func(t *testing.T) { + obj := &DmarcReport{} + var fernTestValueReporter *DmarcReportReporter + obj.SetReporter(fernTestValueReporter) + assert.Equal(t, fernTestValueReporter, obj.Reporter) + assert.NotNil(t, obj.explicitFields) + }) - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") + t.Run("SetReportID", func(t *testing.T) { + obj := &DmarcReport{} + var fernTestValueReportID string + obj.SetReportID(fernTestValueReportID) + assert.Equal(t, fernTestValueReportID, obj.ReportID) + assert.NotNil(t, obj.explicitFields) + }) - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } + t.Run("SetPeriodStart", func(t *testing.T) { + obj := &DmarcReport{} + var fernTestValuePeriodStart time.Time + obj.SetPeriodStart(fernTestValuePeriodStart) + assert.Equal(t, fernTestValuePeriodStart, obj.PeriodStart) + assert.NotNil(t, obj.explicitFields) + }) - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip + t.Run("SetPeriodEnd", func(t *testing.T) { + obj := &DmarcReport{} + var fernTestValuePeriodEnd time.Time + obj.SetPeriodEnd(fernTestValuePeriodEnd) + assert.Equal(t, fernTestValuePeriodEnd, obj.PeriodEnd) + assert.NotNil(t, obj.explicitFields) }) -} + t.Run("SetPolicyPublished", func(t *testing.T) { + obj := &DmarcReport{} + var fernTestValuePolicyPublished *DmarcReportPolicyPublished + obj.SetPolicyPublished(fernTestValuePolicyPublished) + assert.Equal(t, fernTestValuePolicyPublished, obj.PolicyPublished) + assert.NotNil(t, obj.explicitFields) + }) -func TestSettersDmarcReportRecordAuthResults(t *testing.T) { - t.Run("SetDkim", func(t *testing.T) { - obj := &DmarcReportRecordAuthResults{} - var fernTestValueDkim []*DmarcReportRecordAuthResultsDkimItem - obj.SetDkim(fernTestValueDkim) - assert.Equal(t, fernTestValueDkim, obj.Dkim) + t.Run("SetMessages", func(t *testing.T) { + obj := &DmarcReport{} + var fernTestValueMessages int64 + obj.SetMessages(fernTestValueMessages) + assert.Equal(t, fernTestValueMessages, obj.Messages) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetSpf", func(t *testing.T) { - obj := &DmarcReportRecordAuthResults{} - var fernTestValueSpf []*DmarcReportRecordAuthResultsSpfItem - obj.SetSpf(fernTestValueSpf) - assert.Equal(t, fernTestValueSpf, obj.Spf) + t.Run("SetPassing", func(t *testing.T) { + obj := &DmarcReport{} + var fernTestValuePassing int64 + obj.SetPassing(fernTestValuePassing) + assert.Equal(t, fernTestValuePassing, obj.Passing) assert.NotNil(t, obj.explicitFields) }) -} + t.Run("SetTruncated", func(t *testing.T) { + obj := &DmarcReport{} + var fernTestValueTruncated bool + obj.SetTruncated(fernTestValueTruncated) + assert.Equal(t, fernTestValueTruncated, obj.Truncated) + assert.NotNil(t, obj.explicitFields) + }) -func TestGettersDmarcReportRecordAuthResults(t *testing.T) { - t.Run("GetDkim", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &DmarcReportRecordAuthResults{} - var expected []*DmarcReportRecordAuthResultsDkimItem - obj.Dkim = expected + t.Run("SetReceivedAt", func(t *testing.T) { + obj := &DmarcReport{} + var fernTestValueReceivedAt time.Time + obj.SetReceivedAt(fernTestValueReceivedAt) + assert.Equal(t, fernTestValueReceivedAt, obj.ReceivedAt) + assert.NotNil(t, obj.explicitFields) + }) - // Act & Assert - assert.Equal(t, expected, obj.GetDkim(), "getter should return the property value") + t.Run("SetRecords", func(t *testing.T) { + obj := &DmarcReport{} + var fernTestValueRecords []*DmarcReportRecord + obj.SetRecords(fernTestValueRecords) + assert.Equal(t, fernTestValueRecords, obj.Records) + assert.NotNil(t, obj.explicitFields) }) - t.Run("GetDkim_NilValue", func(t *testing.T) { +} + +func TestGettersDmarcReport(t *testing.T) { + t.Run("GetObject", func(t *testing.T) { t.Parallel() // Arrange - obj := &DmarcReportRecordAuthResults{} - obj.Dkim = nil + obj := &DmarcReport{} + var expected DmarcReportObject + obj.Object = expected // Act & Assert - assert.Nil(t, obj.GetDkim(), "getter should return nil when property is nil") + assert.Equal(t, expected, obj.GetObject(), "getter should return the property value") }) - t.Run("GetDkim_NilReceiver", func(t *testing.T) { + t.Run("GetObject_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DmarcReportRecordAuthResults + var obj *DmarcReport // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetDkim() // Should return zero value + _ = obj.GetObject() // Should return zero value }) - t.Run("GetSpf", func(t *testing.T) { + t.Run("GetID", func(t *testing.T) { t.Parallel() // Arrange - obj := &DmarcReportRecordAuthResults{} - var expected []*DmarcReportRecordAuthResultsSpfItem - obj.Spf = expected + obj := &DmarcReport{} + var expected string + obj.ID = expected // Act & Assert - assert.Equal(t, expected, obj.GetSpf(), "getter should return the property value") + assert.Equal(t, expected, obj.GetID(), "getter should return the property value") }) - t.Run("GetSpf_NilValue", func(t *testing.T) { + t.Run("GetID_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *DmarcReport + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetID() // Should return zero value + }) + + t.Run("GetDomainID", func(t *testing.T) { t.Parallel() // Arrange - obj := &DmarcReportRecordAuthResults{} - obj.Spf = nil + obj := &DmarcReport{} + var expected string + obj.DomainID = expected // Act & Assert - assert.Nil(t, obj.GetSpf(), "getter should return nil when property is nil") + assert.Equal(t, expected, obj.GetDomainID(), "getter should return the property value") }) - t.Run("GetSpf_NilReceiver", func(t *testing.T) { + t.Run("GetDomainID_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DmarcReportRecordAuthResults + var obj *DmarcReport // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetSpf() // Should return zero value + _ = obj.GetDomainID() // Should return zero value }) -} - -func TestSettersMarkExplicitDmarcReportRecordAuthResults(t *testing.T) { - t.Run("SetDkim_MarksExplicit", func(t *testing.T) { + t.Run("GetReporter", func(t *testing.T) { t.Parallel() // Arrange - obj := &DmarcReportRecordAuthResults{} - var fernTestValueDkim []*DmarcReportRecordAuthResultsDkimItem - - // Act - obj.SetDkim(fernTestValueDkim) - - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") - - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } + obj := &DmarcReport{} + var expected *DmarcReportReporter + obj.Reporter = expected - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip + // Act & Assert + assert.Equal(t, expected, obj.GetReporter(), "getter should return the property value") }) - t.Run("SetSpf_MarksExplicit", func(t *testing.T) { + t.Run("GetReporter_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &DmarcReportRecordAuthResults{} - var fernTestValueSpf []*DmarcReportRecordAuthResultsSpfItem - - // Act - obj.SetSpf(fernTestValueSpf) - - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") + obj := &DmarcReport{} + obj.Reporter = nil - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } + // Act & Assert + assert.Nil(t, obj.GetReporter(), "getter should return nil when property is nil") + }) - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip + t.Run("GetReporter_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *DmarcReport + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetReporter() // Should return zero value }) -} + t.Run("GetReportID", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DmarcReport{} + var expected string + obj.ReportID = expected -func TestSettersDmarcReportRecordAuthResultsDkimItem(t *testing.T) { - t.Run("SetDomain", func(t *testing.T) { - obj := &DmarcReportRecordAuthResultsDkimItem{} - var fernTestValueDomain string - obj.SetDomain(fernTestValueDomain) - assert.Equal(t, fernTestValueDomain, obj.Domain) - assert.NotNil(t, obj.explicitFields) + // Act & Assert + assert.Equal(t, expected, obj.GetReportID(), "getter should return the property value") }) - t.Run("SetSelector", func(t *testing.T) { - obj := &DmarcReportRecordAuthResultsDkimItem{} - var fernTestValueSelector *string - obj.SetSelector(fernTestValueSelector) - assert.Equal(t, fernTestValueSelector, obj.Selector) - assert.NotNil(t, obj.explicitFields) + t.Run("GetReportID_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *DmarcReport + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetReportID() // Should return zero value }) - t.Run("SetResult", func(t *testing.T) { - obj := &DmarcReportRecordAuthResultsDkimItem{} - var fernTestValueResult string - obj.SetResult(fernTestValueResult) - assert.Equal(t, fernTestValueResult, obj.Result) - assert.NotNil(t, obj.explicitFields) + t.Run("GetPeriodStart", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DmarcReport{} + var expected time.Time + obj.PeriodStart = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetPeriodStart(), "getter should return the property value") }) -} + t.Run("GetPeriodStart_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *DmarcReport + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetPeriodStart() // Should return zero value + }) -func TestGettersDmarcReportRecordAuthResultsDkimItem(t *testing.T) { - t.Run("GetDomain", func(t *testing.T) { + t.Run("GetPeriodEnd", func(t *testing.T) { t.Parallel() // Arrange - obj := &DmarcReportRecordAuthResultsDkimItem{} - var expected string - obj.Domain = expected + obj := &DmarcReport{} + var expected time.Time + obj.PeriodEnd = expected // Act & Assert - assert.Equal(t, expected, obj.GetDomain(), "getter should return the property value") + assert.Equal(t, expected, obj.GetPeriodEnd(), "getter should return the property value") }) - t.Run("GetDomain_NilReceiver", func(t *testing.T) { + t.Run("GetPeriodEnd_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DmarcReportRecordAuthResultsDkimItem + var obj *DmarcReport // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetDomain() // Should return zero value + _ = obj.GetPeriodEnd() // Should return zero value }) - t.Run("GetSelector", func(t *testing.T) { + t.Run("GetPolicyPublished", func(t *testing.T) { t.Parallel() // Arrange - obj := &DmarcReportRecordAuthResultsDkimItem{} - var expected *string - obj.Selector = expected + obj := &DmarcReport{} + var expected *DmarcReportPolicyPublished + obj.PolicyPublished = expected // Act & Assert - assert.Equal(t, expected, obj.GetSelector(), "getter should return the property value") + assert.Equal(t, expected, obj.GetPolicyPublished(), "getter should return the property value") }) - t.Run("GetSelector_NilValue", func(t *testing.T) { + t.Run("GetPolicyPublished_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &DmarcReportRecordAuthResultsDkimItem{} - obj.Selector = nil + obj := &DmarcReport{} + obj.PolicyPublished = nil // Act & Assert - assert.Nil(t, obj.GetSelector(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetPolicyPublished(), "getter should return nil when property is nil") }) - t.Run("GetSelector_NilReceiver", func(t *testing.T) { + t.Run("GetPolicyPublished_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DmarcReportRecordAuthResultsDkimItem + var obj *DmarcReport // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetSelector() // Should return zero value + _ = obj.GetPolicyPublished() // Should return zero value }) - t.Run("GetResult", func(t *testing.T) { + t.Run("GetMessages", func(t *testing.T) { t.Parallel() // Arrange - obj := &DmarcReportRecordAuthResultsDkimItem{} - var expected string - obj.Result = expected + obj := &DmarcReport{} + var expected int64 + obj.Messages = expected // Act & Assert - assert.Equal(t, expected, obj.GetResult(), "getter should return the property value") + assert.Equal(t, expected, obj.GetMessages(), "getter should return the property value") }) - t.Run("GetResult_NilReceiver", func(t *testing.T) { + t.Run("GetMessages_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DmarcReportRecordAuthResultsDkimItem + var obj *DmarcReport // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetResult() // Should return zero value + _ = obj.GetMessages() // Should return zero value }) -} - -func TestSettersMarkExplicitDmarcReportRecordAuthResultsDkimItem(t *testing.T) { - t.Run("SetDomain_MarksExplicit", func(t *testing.T) { + t.Run("GetPassing", func(t *testing.T) { t.Parallel() // Arrange - obj := &DmarcReportRecordAuthResultsDkimItem{} - var fernTestValueDomain string + obj := &DmarcReport{} + var expected int64 + obj.Passing = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetPassing(), "getter should return the property value") + }) + + t.Run("GetPassing_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *DmarcReport + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetPassing() // Should return zero value + }) + + t.Run("GetTruncated", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DmarcReport{} + var expected bool + obj.Truncated = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetTruncated(), "getter should return the property value") + }) + + t.Run("GetTruncated_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *DmarcReport + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetTruncated() // Should return zero value + }) + + t.Run("GetReceivedAt", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DmarcReport{} + var expected time.Time + obj.ReceivedAt = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetReceivedAt(), "getter should return the property value") + }) + + t.Run("GetReceivedAt_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *DmarcReport + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetReceivedAt() // Should return zero value + }) + + t.Run("GetRecords", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DmarcReport{} + var expected []*DmarcReportRecord + obj.Records = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetRecords(), "getter should return the property value") + }) + + t.Run("GetRecords_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DmarcReport{} + obj.Records = nil + + // Act & Assert + assert.Nil(t, obj.GetRecords(), "getter should return nil when property is nil") + }) + + t.Run("GetRecords_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *DmarcReport + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetRecords() // Should return zero value + }) + +} + +func TestSettersMarkExplicitDmarcReport(t *testing.T) { + t.Run("SetObject_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DmarcReport{} + var fernTestValueObject DmarcReportObject // Act - obj.SetDomain(fernTestValueDomain) + obj.SetObject(fernTestValueObject) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -26774,14 +26444,14 @@ func TestSettersMarkExplicitDmarcReportRecordAuthResultsDkimItem(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetSelector_MarksExplicit", func(t *testing.T) { + t.Run("SetID_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DmarcReportRecordAuthResultsDkimItem{} - var fernTestValueSelector *string + obj := &DmarcReport{} + var fernTestValueID string // Act - obj.SetSelector(fernTestValueSelector) + obj.SetID(fernTestValueID) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -26805,14 +26475,14 @@ func TestSettersMarkExplicitDmarcReportRecordAuthResultsDkimItem(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetResult_MarksExplicit", func(t *testing.T) { + t.Run("SetDomainID_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DmarcReportRecordAuthResultsDkimItem{} - var fernTestValueResult string + obj := &DmarcReport{} + var fernTestValueDomainID string // Act - obj.SetResult(fernTestValueResult) + obj.SetDomainID(fernTestValueDomainID) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -26836,126 +26506,107 @@ func TestSettersMarkExplicitDmarcReportRecordAuthResultsDkimItem(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) -} + t.Run("SetReporter_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DmarcReport{} + var fernTestValueReporter *DmarcReportReporter -func TestSettersDmarcReportRecordAuthResultsSpfItem(t *testing.T) { - t.Run("SetDomain", func(t *testing.T) { - obj := &DmarcReportRecordAuthResultsSpfItem{} - var fernTestValueDomain string - obj.SetDomain(fernTestValueDomain) - assert.Equal(t, fernTestValueDomain, obj.Domain) - assert.NotNil(t, obj.explicitFields) - }) + // Act + obj.SetReporter(fernTestValueReporter) - t.Run("SetScope", func(t *testing.T) { - obj := &DmarcReportRecordAuthResultsSpfItem{} - var fernTestValueScope *string - obj.SetScope(fernTestValueScope) - assert.Equal(t, fernTestValueScope, obj.Scope) - assert.NotNil(t, obj.explicitFields) - }) + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") - t.Run("SetResult", func(t *testing.T) { - obj := &DmarcReportRecordAuthResultsSpfItem{} - var fernTestValueResult string - obj.SetResult(fernTestValueResult) - assert.Equal(t, fernTestValueResult, obj.Result) - assert.NotNil(t, obj.explicitFields) - }) + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } -} + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) -func TestGettersDmarcReportRecordAuthResultsSpfItem(t *testing.T) { - t.Run("GetDomain", func(t *testing.T) { + t.Run("SetReportID_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DmarcReportRecordAuthResultsSpfItem{} - var expected string - obj.Domain = expected + obj := &DmarcReport{} + var fernTestValueReportID string - // Act & Assert - assert.Equal(t, expected, obj.GetDomain(), "getter should return the property value") - }) + // Act + obj.SetReportID(fernTestValueReportID) - t.Run("GetDomain_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *DmarcReportRecordAuthResultsSpfItem - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetDomain() // Should return zero value - }) + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") - t.Run("GetScope", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &DmarcReportRecordAuthResultsSpfItem{} - var expected *string - obj.Scope = expected + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } - // Act & Assert - assert.Equal(t, expected, obj.GetScope(), "getter should return the property value") + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("GetScope_NilValue", func(t *testing.T) { + t.Run("SetPeriodStart_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DmarcReportRecordAuthResultsSpfItem{} - obj.Scope = nil - - // Act & Assert - assert.Nil(t, obj.GetScope(), "getter should return nil when property is nil") - }) + obj := &DmarcReport{} + var fernTestValuePeriodStart time.Time - t.Run("GetScope_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *DmarcReportRecordAuthResultsSpfItem - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetScope() // Should return zero value - }) + // Act + obj.SetPeriodStart(fernTestValuePeriodStart) - t.Run("GetResult", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &DmarcReportRecordAuthResultsSpfItem{} - var expected string - obj.Result = expected + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") - // Act & Assert - assert.Equal(t, expected, obj.GetResult(), "getter should return the property value") - }) + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } - t.Run("GetResult_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *DmarcReportRecordAuthResultsSpfItem - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetResult() // Should return zero value + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip }) -} - -func TestSettersMarkExplicitDmarcReportRecordAuthResultsSpfItem(t *testing.T) { - t.Run("SetDomain_MarksExplicit", func(t *testing.T) { + t.Run("SetPeriodEnd_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DmarcReportRecordAuthResultsSpfItem{} - var fernTestValueDomain string + obj := &DmarcReport{} + var fernTestValuePeriodEnd time.Time // Act - obj.SetDomain(fernTestValueDomain) + obj.SetPeriodEnd(fernTestValuePeriodEnd) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -26979,14 +26630,14 @@ func TestSettersMarkExplicitDmarcReportRecordAuthResultsSpfItem(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetScope_MarksExplicit", func(t *testing.T) { + t.Run("SetPolicyPublished_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DmarcReportRecordAuthResultsSpfItem{} - var fernTestValueScope *string + obj := &DmarcReport{} + var fernTestValuePolicyPublished *DmarcReportPolicyPublished // Act - obj.SetScope(fernTestValueScope) + obj.SetPolicyPublished(fernTestValuePolicyPublished) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -27010,14 +26661,14 @@ func TestSettersMarkExplicitDmarcReportRecordAuthResultsSpfItem(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetResult_MarksExplicit", func(t *testing.T) { + t.Run("SetMessages_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DmarcReportRecordAuthResultsSpfItem{} - var fernTestValueResult string + obj := &DmarcReport{} + var fernTestValueMessages int64 // Act - obj.SetResult(fernTestValueResult) + obj.SetMessages(fernTestValueMessages) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -27041,95 +26692,76 @@ func TestSettersMarkExplicitDmarcReportRecordAuthResultsSpfItem(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) -} - -func TestSettersDmarcReportRecordReasonsItem(t *testing.T) { - t.Run("SetType", func(t *testing.T) { - obj := &DmarcReportRecordReasonsItem{} - var fernTestValueType string - obj.SetType(fernTestValueType) - assert.Equal(t, fernTestValueType, obj.Type) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetComment", func(t *testing.T) { - obj := &DmarcReportRecordReasonsItem{} - var fernTestValueComment *string - obj.SetComment(fernTestValueComment) - assert.Equal(t, fernTestValueComment, obj.Comment) - assert.NotNil(t, obj.explicitFields) - }) - -} - -func TestGettersDmarcReportRecordReasonsItem(t *testing.T) { - t.Run("GetType", func(t *testing.T) { + t.Run("SetPassing_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DmarcReportRecordReasonsItem{} - var expected string - obj.Type = expected + obj := &DmarcReport{} + var fernTestValuePassing int64 - // Act & Assert - assert.Equal(t, expected, obj.GetType(), "getter should return the property value") - }) + // Act + obj.SetPassing(fernTestValuePassing) - t.Run("GetType_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *DmarcReportRecordReasonsItem - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetType() // Should return zero value - }) + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") - t.Run("GetComment", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &DmarcReportRecordReasonsItem{} - var expected *string - obj.Comment = expected + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } - // Act & Assert - assert.Equal(t, expected, obj.GetComment(), "getter should return the property value") + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("GetComment_NilValue", func(t *testing.T) { + t.Run("SetTruncated_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DmarcReportRecordReasonsItem{} - obj.Comment = nil + obj := &DmarcReport{} + var fernTestValueTruncated bool - // Act & Assert - assert.Nil(t, obj.GetComment(), "getter should return nil when property is nil") - }) + // Act + obj.SetTruncated(fernTestValueTruncated) - t.Run("GetComment_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *DmarcReportRecordReasonsItem - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetComment() // Should return zero value - }) + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") -} + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } -func TestSettersMarkExplicitDmarcReportRecordReasonsItem(t *testing.T) { - t.Run("SetType_MarksExplicit", func(t *testing.T) { + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetReceivedAt_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DmarcReportRecordReasonsItem{} - var fernTestValueType string + obj := &DmarcReport{} + var fernTestValueReceivedAt time.Time // Act - obj.SetType(fernTestValueType) + obj.SetReceivedAt(fernTestValueReceivedAt) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -27153,14 +26785,14 @@ func TestSettersMarkExplicitDmarcReportRecordReasonsItem(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetComment_MarksExplicit", func(t *testing.T) { + t.Run("SetRecords_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DmarcReportRecordReasonsItem{} - var fernTestValueComment *string + obj := &DmarcReport{} + var fernTestValueRecords []*DmarcReportRecord // Act - obj.SetComment(fernTestValueComment) + obj.SetRecords(fernTestValueRecords) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -27186,93 +26818,124 @@ func TestSettersMarkExplicitDmarcReportRecordReasonsItem(t *testing.T) { } -func TestSettersDmarcReportReporter(t *testing.T) { - t.Run("SetOrgName", func(t *testing.T) { - obj := &DmarcReportReporter{} - var fernTestValueOrgName string - obj.SetOrgName(fernTestValueOrgName) - assert.Equal(t, fernTestValueOrgName, obj.OrgName) +func TestSettersDmarcReportList(t *testing.T) { + t.Run("SetObject", func(t *testing.T) { + obj := &DmarcReportList{} + var fernTestValueObject DmarcReportListObject + obj.SetObject(fernTestValueObject) + assert.Equal(t, fernTestValueObject, obj.Object) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetEmail", func(t *testing.T) { - obj := &DmarcReportReporter{} - var fernTestValueEmail *string - obj.SetEmail(fernTestValueEmail) - assert.Equal(t, fernTestValueEmail, obj.Email) + t.Run("SetData", func(t *testing.T) { + obj := &DmarcReportList{} + var fernTestValueData []*DmarcReportSummary + obj.SetData(fernTestValueData) + assert.Equal(t, fernTestValueData, obj.Data) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetHasMore", func(t *testing.T) { + obj := &DmarcReportList{} + var fernTestValueHasMore bool + obj.SetHasMore(fernTestValueHasMore) + assert.Equal(t, fernTestValueHasMore, obj.HasMore) assert.NotNil(t, obj.explicitFields) }) } -func TestGettersDmarcReportReporter(t *testing.T) { - t.Run("GetOrgName", func(t *testing.T) { +func TestGettersDmarcReportList(t *testing.T) { + t.Run("GetObject", func(t *testing.T) { t.Parallel() // Arrange - obj := &DmarcReportReporter{} - var expected string - obj.OrgName = expected + obj := &DmarcReportList{} + var expected DmarcReportListObject + obj.Object = expected // Act & Assert - assert.Equal(t, expected, obj.GetOrgName(), "getter should return the property value") + assert.Equal(t, expected, obj.GetObject(), "getter should return the property value") }) - t.Run("GetOrgName_NilReceiver", func(t *testing.T) { + t.Run("GetObject_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DmarcReportReporter + var obj *DmarcReportList // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetOrgName() // Should return zero value + _ = obj.GetObject() // Should return zero value }) - t.Run("GetEmail", func(t *testing.T) { + t.Run("GetData", func(t *testing.T) { t.Parallel() // Arrange - obj := &DmarcReportReporter{} - var expected *string - obj.Email = expected + obj := &DmarcReportList{} + var expected []*DmarcReportSummary + obj.Data = expected // Act & Assert - assert.Equal(t, expected, obj.GetEmail(), "getter should return the property value") + assert.Equal(t, expected, obj.GetData(), "getter should return the property value") }) - t.Run("GetEmail_NilValue", func(t *testing.T) { + t.Run("GetData_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &DmarcReportReporter{} - obj.Email = nil + obj := &DmarcReportList{} + obj.Data = nil // Act & Assert - assert.Nil(t, obj.GetEmail(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetData(), "getter should return nil when property is nil") }) - t.Run("GetEmail_NilReceiver", func(t *testing.T) { + t.Run("GetData_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DmarcReportReporter + var obj *DmarcReportList // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetEmail() // Should return zero value + _ = obj.GetData() // Should return zero value + }) + + t.Run("GetHasMore", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DmarcReportList{} + var expected bool + obj.HasMore = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetHasMore(), "getter should return the property value") + }) + + t.Run("GetHasMore_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *DmarcReportList + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetHasMore() // Should return zero value }) } -func TestSettersMarkExplicitDmarcReportReporter(t *testing.T) { - t.Run("SetOrgName_MarksExplicit", func(t *testing.T) { +func TestSettersMarkExplicitDmarcReportList(t *testing.T) { + t.Run("SetObject_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DmarcReportReporter{} - var fernTestValueOrgName string + obj := &DmarcReportList{} + var fernTestValueObject DmarcReportListObject // Act - obj.SetOrgName(fernTestValueOrgName) + obj.SetObject(fernTestValueObject) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -27296,14 +26959,14 @@ func TestSettersMarkExplicitDmarcReportReporter(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetEmail_MarksExplicit", func(t *testing.T) { + t.Run("SetData_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DmarcReportReporter{} - var fernTestValueEmail *string + obj := &DmarcReportList{} + var fernTestValueData []*DmarcReportSummary // Act - obj.SetEmail(fernTestValueEmail) + obj.SetData(fernTestValueData) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -27327,415 +26990,372 @@ func TestSettersMarkExplicitDmarcReportReporter(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) -} + t.Run("SetHasMore_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DmarcReportList{} + var fernTestValueHasMore bool -func TestSettersDmarcReportSummary(t *testing.T) { - t.Run("SetObject", func(t *testing.T) { - obj := &DmarcReportSummary{} - var fernTestValueObject DmarcReportSummaryObject - obj.SetObject(fernTestValueObject) - assert.Equal(t, fernTestValueObject, obj.Object) - assert.NotNil(t, obj.explicitFields) - }) + // Act + obj.SetHasMore(fernTestValueHasMore) - t.Run("SetID", func(t *testing.T) { - obj := &DmarcReportSummary{} - var fernTestValueID string - obj.SetID(fernTestValueID) - assert.Equal(t, fernTestValueID, obj.ID) - assert.NotNil(t, obj.explicitFields) - }) + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") - t.Run("SetDomainID", func(t *testing.T) { - obj := &DmarcReportSummary{} - var fernTestValueDomainID string - obj.SetDomainID(fernTestValueDomainID) - assert.Equal(t, fernTestValueDomainID, obj.DomainID) - assert.NotNil(t, obj.explicitFields) - }) + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } - t.Run("SetReporter", func(t *testing.T) { - obj := &DmarcReportSummary{} - var fernTestValueReporter *DmarcReportSummaryReporter - obj.SetReporter(fernTestValueReporter) - assert.Equal(t, fernTestValueReporter, obj.Reporter) - assert.NotNil(t, obj.explicitFields) + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetReportID", func(t *testing.T) { - obj := &DmarcReportSummary{} - var fernTestValueReportID string - obj.SetReportID(fernTestValueReportID) - assert.Equal(t, fernTestValueReportID, obj.ReportID) +} + +func TestSettersDmarcReportPolicyPublished(t *testing.T) { + t.Run("SetDomain", func(t *testing.T) { + obj := &DmarcReportPolicyPublished{} + var fernTestValueDomain string + obj.SetDomain(fernTestValueDomain) + assert.Equal(t, fernTestValueDomain, obj.Domain) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetPeriodStart", func(t *testing.T) { - obj := &DmarcReportSummary{} - var fernTestValuePeriodStart time.Time - obj.SetPeriodStart(fernTestValuePeriodStart) - assert.Equal(t, fernTestValuePeriodStart, obj.PeriodStart) + t.Run("SetP", func(t *testing.T) { + obj := &DmarcReportPolicyPublished{} + var fernTestValueP *string + obj.SetP(fernTestValueP) + assert.Equal(t, fernTestValueP, obj.P) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetPeriodEnd", func(t *testing.T) { - obj := &DmarcReportSummary{} - var fernTestValuePeriodEnd time.Time - obj.SetPeriodEnd(fernTestValuePeriodEnd) - assert.Equal(t, fernTestValuePeriodEnd, obj.PeriodEnd) + t.Run("SetSp", func(t *testing.T) { + obj := &DmarcReportPolicyPublished{} + var fernTestValueSp *string + obj.SetSp(fernTestValueSp) + assert.Equal(t, fernTestValueSp, obj.Sp) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetPolicyPublished", func(t *testing.T) { - obj := &DmarcReportSummary{} - var fernTestValuePolicyPublished *DmarcReportSummaryPolicyPublished - obj.SetPolicyPublished(fernTestValuePolicyPublished) - assert.Equal(t, fernTestValuePolicyPublished, obj.PolicyPublished) + t.Run("SetNp", func(t *testing.T) { + obj := &DmarcReportPolicyPublished{} + var fernTestValueNp *string + obj.SetNp(fernTestValueNp) + assert.Equal(t, fernTestValueNp, obj.Np) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetMessages", func(t *testing.T) { - obj := &DmarcReportSummary{} - var fernTestValueMessages int64 - obj.SetMessages(fernTestValueMessages) - assert.Equal(t, fernTestValueMessages, obj.Messages) + t.Run("SetAdkim", func(t *testing.T) { + obj := &DmarcReportPolicyPublished{} + var fernTestValueAdkim *string + obj.SetAdkim(fernTestValueAdkim) + assert.Equal(t, fernTestValueAdkim, obj.Adkim) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetPassing", func(t *testing.T) { - obj := &DmarcReportSummary{} - var fernTestValuePassing int64 - obj.SetPassing(fernTestValuePassing) - assert.Equal(t, fernTestValuePassing, obj.Passing) + t.Run("SetAspf", func(t *testing.T) { + obj := &DmarcReportPolicyPublished{} + var fernTestValueAspf *string + obj.SetAspf(fernTestValueAspf) + assert.Equal(t, fernTestValueAspf, obj.Aspf) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetTruncated", func(t *testing.T) { - obj := &DmarcReportSummary{} - var fernTestValueTruncated bool - obj.SetTruncated(fernTestValueTruncated) - assert.Equal(t, fernTestValueTruncated, obj.Truncated) + t.Run("SetPct", func(t *testing.T) { + obj := &DmarcReportPolicyPublished{} + var fernTestValuePct *int64 + obj.SetPct(fernTestValuePct) + assert.Equal(t, fernTestValuePct, obj.Pct) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetReceivedAt", func(t *testing.T) { - obj := &DmarcReportSummary{} - var fernTestValueReceivedAt time.Time - obj.SetReceivedAt(fernTestValueReceivedAt) - assert.Equal(t, fernTestValueReceivedAt, obj.ReceivedAt) + t.Run("SetTesting", func(t *testing.T) { + obj := &DmarcReportPolicyPublished{} + var fernTestValueTesting *string + obj.SetTesting(fernTestValueTesting) + assert.Equal(t, fernTestValueTesting, obj.Testing) assert.NotNil(t, obj.explicitFields) }) } -func TestGettersDmarcReportSummary(t *testing.T) { - t.Run("GetObject", func(t *testing.T) { +func TestGettersDmarcReportPolicyPublished(t *testing.T) { + t.Run("GetDomain", func(t *testing.T) { t.Parallel() // Arrange - obj := &DmarcReportSummary{} - var expected DmarcReportSummaryObject - obj.Object = expected + obj := &DmarcReportPolicyPublished{} + var expected string + obj.Domain = expected // Act & Assert - assert.Equal(t, expected, obj.GetObject(), "getter should return the property value") + assert.Equal(t, expected, obj.GetDomain(), "getter should return the property value") }) - t.Run("GetObject_NilReceiver", func(t *testing.T) { + t.Run("GetDomain_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DmarcReportSummary + var obj *DmarcReportPolicyPublished // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetObject() // Should return zero value + _ = obj.GetDomain() // Should return zero value }) - t.Run("GetID", func(t *testing.T) { + t.Run("GetP", func(t *testing.T) { t.Parallel() // Arrange - obj := &DmarcReportSummary{} - var expected string - obj.ID = expected + obj := &DmarcReportPolicyPublished{} + var expected *string + obj.P = expected // Act & Assert - assert.Equal(t, expected, obj.GetID(), "getter should return the property value") - }) - - t.Run("GetID_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *DmarcReportSummary - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetID() // Should return zero value + assert.Equal(t, expected, obj.GetP(), "getter should return the property value") }) - t.Run("GetDomainID", func(t *testing.T) { + t.Run("GetP_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &DmarcReportSummary{} - var expected string - obj.DomainID = expected + obj := &DmarcReportPolicyPublished{} + obj.P = nil // Act & Assert - assert.Equal(t, expected, obj.GetDomainID(), "getter should return the property value") + assert.Nil(t, obj.GetP(), "getter should return nil when property is nil") }) - t.Run("GetDomainID_NilReceiver", func(t *testing.T) { + t.Run("GetP_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DmarcReportSummary + var obj *DmarcReportPolicyPublished // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetDomainID() // Should return zero value + _ = obj.GetP() // Should return zero value }) - t.Run("GetReporter", func(t *testing.T) { + t.Run("GetSp", func(t *testing.T) { t.Parallel() // Arrange - obj := &DmarcReportSummary{} - var expected *DmarcReportSummaryReporter - obj.Reporter = expected + obj := &DmarcReportPolicyPublished{} + var expected *string + obj.Sp = expected // Act & Assert - assert.Equal(t, expected, obj.GetReporter(), "getter should return the property value") + assert.Equal(t, expected, obj.GetSp(), "getter should return the property value") }) - t.Run("GetReporter_NilValue", func(t *testing.T) { + t.Run("GetSp_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &DmarcReportSummary{} - obj.Reporter = nil + obj := &DmarcReportPolicyPublished{} + obj.Sp = nil // Act & Assert - assert.Nil(t, obj.GetReporter(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetSp(), "getter should return nil when property is nil") }) - t.Run("GetReporter_NilReceiver", func(t *testing.T) { + t.Run("GetSp_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DmarcReportSummary + var obj *DmarcReportPolicyPublished // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetReporter() // Should return zero value + _ = obj.GetSp() // Should return zero value }) - t.Run("GetReportID", func(t *testing.T) { + t.Run("GetNp", func(t *testing.T) { t.Parallel() // Arrange - obj := &DmarcReportSummary{} - var expected string - obj.ReportID = expected + obj := &DmarcReportPolicyPublished{} + var expected *string + obj.Np = expected // Act & Assert - assert.Equal(t, expected, obj.GetReportID(), "getter should return the property value") - }) - - t.Run("GetReportID_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *DmarcReportSummary - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetReportID() // Should return zero value + assert.Equal(t, expected, obj.GetNp(), "getter should return the property value") }) - t.Run("GetPeriodStart", func(t *testing.T) { + t.Run("GetNp_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &DmarcReportSummary{} - var expected time.Time - obj.PeriodStart = expected + obj := &DmarcReportPolicyPublished{} + obj.Np = nil // Act & Assert - assert.Equal(t, expected, obj.GetPeriodStart(), "getter should return the property value") + assert.Nil(t, obj.GetNp(), "getter should return nil when property is nil") }) - t.Run("GetPeriodStart_NilReceiver", func(t *testing.T) { + t.Run("GetNp_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DmarcReportSummary + var obj *DmarcReportPolicyPublished // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetPeriodStart() // Should return zero value + _ = obj.GetNp() // Should return zero value }) - t.Run("GetPeriodEnd", func(t *testing.T) { + t.Run("GetAdkim", func(t *testing.T) { t.Parallel() // Arrange - obj := &DmarcReportSummary{} - var expected time.Time - obj.PeriodEnd = expected + obj := &DmarcReportPolicyPublished{} + var expected *string + obj.Adkim = expected // Act & Assert - assert.Equal(t, expected, obj.GetPeriodEnd(), "getter should return the property value") + assert.Equal(t, expected, obj.GetAdkim(), "getter should return the property value") }) - t.Run("GetPeriodEnd_NilReceiver", func(t *testing.T) { + t.Run("GetAdkim_NilValue", func(t *testing.T) { t.Parallel() - var obj *DmarcReportSummary + // Arrange + obj := &DmarcReportPolicyPublished{} + obj.Adkim = nil + + // Act & Assert + assert.Nil(t, obj.GetAdkim(), "getter should return nil when property is nil") + }) + + t.Run("GetAdkim_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *DmarcReportPolicyPublished // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetPeriodEnd() // Should return zero value + _ = obj.GetAdkim() // Should return zero value }) - t.Run("GetPolicyPublished", func(t *testing.T) { + t.Run("GetAspf", func(t *testing.T) { t.Parallel() // Arrange - obj := &DmarcReportSummary{} - var expected *DmarcReportSummaryPolicyPublished - obj.PolicyPublished = expected + obj := &DmarcReportPolicyPublished{} + var expected *string + obj.Aspf = expected // Act & Assert - assert.Equal(t, expected, obj.GetPolicyPublished(), "getter should return the property value") + assert.Equal(t, expected, obj.GetAspf(), "getter should return the property value") }) - t.Run("GetPolicyPublished_NilValue", func(t *testing.T) { + t.Run("GetAspf_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &DmarcReportSummary{} - obj.PolicyPublished = nil + obj := &DmarcReportPolicyPublished{} + obj.Aspf = nil // Act & Assert - assert.Nil(t, obj.GetPolicyPublished(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetAspf(), "getter should return nil when property is nil") }) - t.Run("GetPolicyPublished_NilReceiver", func(t *testing.T) { + t.Run("GetAspf_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DmarcReportSummary + var obj *DmarcReportPolicyPublished // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetPolicyPublished() // Should return zero value + _ = obj.GetAspf() // Should return zero value }) - t.Run("GetMessages", func(t *testing.T) { + t.Run("GetPct", func(t *testing.T) { t.Parallel() // Arrange - obj := &DmarcReportSummary{} - var expected int64 - obj.Messages = expected + obj := &DmarcReportPolicyPublished{} + var expected *int64 + obj.Pct = expected // Act & Assert - assert.Equal(t, expected, obj.GetMessages(), "getter should return the property value") - }) - - t.Run("GetMessages_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *DmarcReportSummary - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetMessages() // Should return zero value + assert.Equal(t, expected, obj.GetPct(), "getter should return the property value") }) - t.Run("GetPassing", func(t *testing.T) { + t.Run("GetPct_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &DmarcReportSummary{} - var expected int64 - obj.Passing = expected + obj := &DmarcReportPolicyPublished{} + obj.Pct = nil // Act & Assert - assert.Equal(t, expected, obj.GetPassing(), "getter should return the property value") + assert.Nil(t, obj.GetPct(), "getter should return nil when property is nil") }) - t.Run("GetPassing_NilReceiver", func(t *testing.T) { + t.Run("GetPct_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DmarcReportSummary + var obj *DmarcReportPolicyPublished // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetPassing() // Should return zero value + _ = obj.GetPct() // Should return zero value }) - t.Run("GetTruncated", func(t *testing.T) { + t.Run("GetTesting", func(t *testing.T) { t.Parallel() // Arrange - obj := &DmarcReportSummary{} - var expected bool - obj.Truncated = expected + obj := &DmarcReportPolicyPublished{} + var expected *string + obj.Testing = expected // Act & Assert - assert.Equal(t, expected, obj.GetTruncated(), "getter should return the property value") - }) - - t.Run("GetTruncated_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *DmarcReportSummary - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetTruncated() // Should return zero value + assert.Equal(t, expected, obj.GetTesting(), "getter should return the property value") }) - t.Run("GetReceivedAt", func(t *testing.T) { + t.Run("GetTesting_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &DmarcReportSummary{} - var expected time.Time - obj.ReceivedAt = expected + obj := &DmarcReportPolicyPublished{} + obj.Testing = nil // Act & Assert - assert.Equal(t, expected, obj.GetReceivedAt(), "getter should return the property value") + assert.Nil(t, obj.GetTesting(), "getter should return nil when property is nil") }) - t.Run("GetReceivedAt_NilReceiver", func(t *testing.T) { + t.Run("GetTesting_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DmarcReportSummary + var obj *DmarcReportPolicyPublished // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetReceivedAt() // Should return zero value + _ = obj.GetTesting() // Should return zero value }) } -func TestSettersMarkExplicitDmarcReportSummary(t *testing.T) { - t.Run("SetObject_MarksExplicit", func(t *testing.T) { +func TestSettersMarkExplicitDmarcReportPolicyPublished(t *testing.T) { + t.Run("SetDomain_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DmarcReportSummary{} - var fernTestValueObject DmarcReportSummaryObject + obj := &DmarcReportPolicyPublished{} + var fernTestValueDomain string // Act - obj.SetObject(fernTestValueObject) + obj.SetDomain(fernTestValueDomain) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -27759,14 +27379,14 @@ func TestSettersMarkExplicitDmarcReportSummary(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetID_MarksExplicit", func(t *testing.T) { + t.Run("SetP_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DmarcReportSummary{} - var fernTestValueID string + obj := &DmarcReportPolicyPublished{} + var fernTestValueP *string // Act - obj.SetID(fernTestValueID) + obj.SetP(fernTestValueP) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -27790,14 +27410,14 @@ func TestSettersMarkExplicitDmarcReportSummary(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetDomainID_MarksExplicit", func(t *testing.T) { + t.Run("SetSp_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DmarcReportSummary{} - var fernTestValueDomainID string + obj := &DmarcReportPolicyPublished{} + var fernTestValueSp *string // Act - obj.SetDomainID(fernTestValueDomainID) + obj.SetSp(fernTestValueSp) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -27821,14 +27441,14 @@ func TestSettersMarkExplicitDmarcReportSummary(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetReporter_MarksExplicit", func(t *testing.T) { + t.Run("SetNp_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DmarcReportSummary{} - var fernTestValueReporter *DmarcReportSummaryReporter + obj := &DmarcReportPolicyPublished{} + var fernTestValueNp *string // Act - obj.SetReporter(fernTestValueReporter) + obj.SetNp(fernTestValueNp) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -27852,14 +27472,14 @@ func TestSettersMarkExplicitDmarcReportSummary(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetReportID_MarksExplicit", func(t *testing.T) { + t.Run("SetAdkim_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DmarcReportSummary{} - var fernTestValueReportID string + obj := &DmarcReportPolicyPublished{} + var fernTestValueAdkim *string // Act - obj.SetReportID(fernTestValueReportID) + obj.SetAdkim(fernTestValueAdkim) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -27883,14 +27503,14 @@ func TestSettersMarkExplicitDmarcReportSummary(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetPeriodStart_MarksExplicit", func(t *testing.T) { + t.Run("SetAspf_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DmarcReportSummary{} - var fernTestValuePeriodStart time.Time + obj := &DmarcReportPolicyPublished{} + var fernTestValueAspf *string // Act - obj.SetPeriodStart(fernTestValuePeriodStart) + obj.SetAspf(fernTestValueAspf) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -27914,14 +27534,14 @@ func TestSettersMarkExplicitDmarcReportSummary(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetPeriodEnd_MarksExplicit", func(t *testing.T) { + t.Run("SetPct_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DmarcReportSummary{} - var fernTestValuePeriodEnd time.Time + obj := &DmarcReportPolicyPublished{} + var fernTestValuePct *int64 // Act - obj.SetPeriodEnd(fernTestValuePeriodEnd) + obj.SetPct(fernTestValuePct) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -27945,14 +27565,14 @@ func TestSettersMarkExplicitDmarcReportSummary(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetPolicyPublished_MarksExplicit", func(t *testing.T) { + t.Run("SetTesting_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DmarcReportSummary{} - var fernTestValuePolicyPublished *DmarcReportSummaryPolicyPublished + obj := &DmarcReportPolicyPublished{} + var fernTestValueTesting *string // Act - obj.SetPolicyPublished(fernTestValuePolicyPublished) + obj.SetTesting(fernTestValueTesting) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -27976,465 +27596,394 @@ func TestSettersMarkExplicitDmarcReportSummary(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetMessages_MarksExplicit", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &DmarcReportSummary{} - var fernTestValueMessages int64 - - // Act - obj.SetMessages(fernTestValueMessages) +} - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") +func TestSettersDmarcReportRecord(t *testing.T) { + t.Run("SetSourceIP", func(t *testing.T) { + obj := &DmarcReportRecord{} + var fernTestValueSourceIP string + obj.SetSourceIP(fernTestValueSourceIP) + assert.Equal(t, fernTestValueSourceIP, obj.SourceIP) + assert.NotNil(t, obj.explicitFields) + }) - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } - - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip - }) - - t.Run("SetPassing_MarksExplicit", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &DmarcReportSummary{} - var fernTestValuePassing int64 - - // Act - obj.SetPassing(fernTestValuePassing) - - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") - - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } - - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip - }) - - t.Run("SetTruncated_MarksExplicit", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &DmarcReportSummary{} - var fernTestValueTruncated bool - - // Act - obj.SetTruncated(fernTestValueTruncated) - - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") - - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } - - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip + t.Run("SetCount", func(t *testing.T) { + obj := &DmarcReportRecord{} + var fernTestValueCount int64 + obj.SetCount(fernTestValueCount) + assert.Equal(t, fernTestValueCount, obj.Count) + assert.NotNil(t, obj.explicitFields) }) - t.Run("SetReceivedAt_MarksExplicit", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &DmarcReportSummary{} - var fernTestValueReceivedAt time.Time - - // Act - obj.SetReceivedAt(fernTestValueReceivedAt) - - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") - - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } - - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip + t.Run("SetDisposition", func(t *testing.T) { + obj := &DmarcReportRecord{} + var fernTestValueDisposition DmarcReportRecordDisposition + obj.SetDisposition(fernTestValueDisposition) + assert.Equal(t, fernTestValueDisposition, obj.Disposition) + assert.NotNil(t, obj.explicitFields) }) -} - -func TestSettersDmarcReportSummaryPolicyPublished(t *testing.T) { - t.Run("SetDomain", func(t *testing.T) { - obj := &DmarcReportSummaryPolicyPublished{} - var fernTestValueDomain string - obj.SetDomain(fernTestValueDomain) - assert.Equal(t, fernTestValueDomain, obj.Domain) + t.Run("SetDkim", func(t *testing.T) { + obj := &DmarcReportRecord{} + var fernTestValueDkim DmarcReportRecordDkim + obj.SetDkim(fernTestValueDkim) + assert.Equal(t, fernTestValueDkim, obj.Dkim) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetP", func(t *testing.T) { - obj := &DmarcReportSummaryPolicyPublished{} - var fernTestValueP *string - obj.SetP(fernTestValueP) - assert.Equal(t, fernTestValueP, obj.P) + t.Run("SetSpf", func(t *testing.T) { + obj := &DmarcReportRecord{} + var fernTestValueSpf DmarcReportRecordSpf + obj.SetSpf(fernTestValueSpf) + assert.Equal(t, fernTestValueSpf, obj.Spf) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetSp", func(t *testing.T) { - obj := &DmarcReportSummaryPolicyPublished{} - var fernTestValueSp *string - obj.SetSp(fernTestValueSp) - assert.Equal(t, fernTestValueSp, obj.Sp) + t.Run("SetDmarcPass", func(t *testing.T) { + obj := &DmarcReportRecord{} + var fernTestValueDmarcPass bool + obj.SetDmarcPass(fernTestValueDmarcPass) + assert.Equal(t, fernTestValueDmarcPass, obj.DmarcPass) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetNp", func(t *testing.T) { - obj := &DmarcReportSummaryPolicyPublished{} - var fernTestValueNp *string - obj.SetNp(fernTestValueNp) - assert.Equal(t, fernTestValueNp, obj.Np) + t.Run("SetHeaderFrom", func(t *testing.T) { + obj := &DmarcReportRecord{} + var fernTestValueHeaderFrom string + obj.SetHeaderFrom(fernTestValueHeaderFrom) + assert.Equal(t, fernTestValueHeaderFrom, obj.HeaderFrom) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetAdkim", func(t *testing.T) { - obj := &DmarcReportSummaryPolicyPublished{} - var fernTestValueAdkim *string - obj.SetAdkim(fernTestValueAdkim) - assert.Equal(t, fernTestValueAdkim, obj.Adkim) + t.Run("SetEnvelopeFrom", func(t *testing.T) { + obj := &DmarcReportRecord{} + var fernTestValueEnvelopeFrom *string + obj.SetEnvelopeFrom(fernTestValueEnvelopeFrom) + assert.Equal(t, fernTestValueEnvelopeFrom, obj.EnvelopeFrom) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetAspf", func(t *testing.T) { - obj := &DmarcReportSummaryPolicyPublished{} - var fernTestValueAspf *string - obj.SetAspf(fernTestValueAspf) - assert.Equal(t, fernTestValueAspf, obj.Aspf) + t.Run("SetViaCoss", func(t *testing.T) { + obj := &DmarcReportRecord{} + var fernTestValueViaCoss bool + obj.SetViaCoss(fernTestValueViaCoss) + assert.Equal(t, fernTestValueViaCoss, obj.ViaCoss) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetPct", func(t *testing.T) { - obj := &DmarcReportSummaryPolicyPublished{} - var fernTestValuePct *int64 - obj.SetPct(fernTestValuePct) - assert.Equal(t, fernTestValuePct, obj.Pct) + t.Run("SetAuthResults", func(t *testing.T) { + obj := &DmarcReportRecord{} + var fernTestValueAuthResults *DmarcReportRecordAuthResults + obj.SetAuthResults(fernTestValueAuthResults) + assert.Equal(t, fernTestValueAuthResults, obj.AuthResults) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetTesting", func(t *testing.T) { - obj := &DmarcReportSummaryPolicyPublished{} - var fernTestValueTesting *string - obj.SetTesting(fernTestValueTesting) - assert.Equal(t, fernTestValueTesting, obj.Testing) + t.Run("SetReasons", func(t *testing.T) { + obj := &DmarcReportRecord{} + var fernTestValueReasons []*DmarcReportRecordReasonsItem + obj.SetReasons(fernTestValueReasons) + assert.Equal(t, fernTestValueReasons, obj.Reasons) assert.NotNil(t, obj.explicitFields) }) } -func TestGettersDmarcReportSummaryPolicyPublished(t *testing.T) { - t.Run("GetDomain", func(t *testing.T) { +func TestGettersDmarcReportRecord(t *testing.T) { + t.Run("GetSourceIP", func(t *testing.T) { t.Parallel() // Arrange - obj := &DmarcReportSummaryPolicyPublished{} + obj := &DmarcReportRecord{} var expected string - obj.Domain = expected + obj.SourceIP = expected // Act & Assert - assert.Equal(t, expected, obj.GetDomain(), "getter should return the property value") + assert.Equal(t, expected, obj.GetSourceIP(), "getter should return the property value") }) - t.Run("GetDomain_NilReceiver", func(t *testing.T) { + t.Run("GetSourceIP_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DmarcReportSummaryPolicyPublished + var obj *DmarcReportRecord // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetDomain() // Should return zero value + _ = obj.GetSourceIP() // Should return zero value }) - t.Run("GetP", func(t *testing.T) { + t.Run("GetCount", func(t *testing.T) { t.Parallel() // Arrange - obj := &DmarcReportSummaryPolicyPublished{} - var expected *string - obj.P = expected + obj := &DmarcReportRecord{} + var expected int64 + obj.Count = expected // Act & Assert - assert.Equal(t, expected, obj.GetP(), "getter should return the property value") + assert.Equal(t, expected, obj.GetCount(), "getter should return the property value") }) - t.Run("GetP_NilValue", func(t *testing.T) { + t.Run("GetCount_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *DmarcReportRecord + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetCount() // Should return zero value + }) + + t.Run("GetDisposition", func(t *testing.T) { t.Parallel() // Arrange - obj := &DmarcReportSummaryPolicyPublished{} - obj.P = nil + obj := &DmarcReportRecord{} + var expected DmarcReportRecordDisposition + obj.Disposition = expected // Act & Assert - assert.Nil(t, obj.GetP(), "getter should return nil when property is nil") + assert.Equal(t, expected, obj.GetDisposition(), "getter should return the property value") }) - t.Run("GetP_NilReceiver", func(t *testing.T) { + t.Run("GetDisposition_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DmarcReportSummaryPolicyPublished + var obj *DmarcReportRecord // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetP() // Should return zero value + _ = obj.GetDisposition() // Should return zero value }) - t.Run("GetSp", func(t *testing.T) { + t.Run("GetDkim", func(t *testing.T) { t.Parallel() // Arrange - obj := &DmarcReportSummaryPolicyPublished{} - var expected *string - obj.Sp = expected + obj := &DmarcReportRecord{} + var expected DmarcReportRecordDkim + obj.Dkim = expected // Act & Assert - assert.Equal(t, expected, obj.GetSp(), "getter should return the property value") + assert.Equal(t, expected, obj.GetDkim(), "getter should return the property value") }) - t.Run("GetSp_NilValue", func(t *testing.T) { + t.Run("GetDkim_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *DmarcReportRecord + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetDkim() // Should return zero value + }) + + t.Run("GetSpf", func(t *testing.T) { t.Parallel() // Arrange - obj := &DmarcReportSummaryPolicyPublished{} - obj.Sp = nil + obj := &DmarcReportRecord{} + var expected DmarcReportRecordSpf + obj.Spf = expected // Act & Assert - assert.Nil(t, obj.GetSp(), "getter should return nil when property is nil") + assert.Equal(t, expected, obj.GetSpf(), "getter should return the property value") }) - t.Run("GetSp_NilReceiver", func(t *testing.T) { + t.Run("GetSpf_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DmarcReportSummaryPolicyPublished + var obj *DmarcReportRecord // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetSp() // Should return zero value + _ = obj.GetSpf() // Should return zero value }) - t.Run("GetNp", func(t *testing.T) { + t.Run("GetDmarcPass", func(t *testing.T) { t.Parallel() // Arrange - obj := &DmarcReportSummaryPolicyPublished{} - var expected *string - obj.Np = expected + obj := &DmarcReportRecord{} + var expected bool + obj.DmarcPass = expected // Act & Assert - assert.Equal(t, expected, obj.GetNp(), "getter should return the property value") + assert.Equal(t, expected, obj.GetDmarcPass(), "getter should return the property value") }) - t.Run("GetNp_NilValue", func(t *testing.T) { + t.Run("GetDmarcPass_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *DmarcReportRecord + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetDmarcPass() // Should return zero value + }) + + t.Run("GetHeaderFrom", func(t *testing.T) { t.Parallel() // Arrange - obj := &DmarcReportSummaryPolicyPublished{} - obj.Np = nil + obj := &DmarcReportRecord{} + var expected string + obj.HeaderFrom = expected // Act & Assert - assert.Nil(t, obj.GetNp(), "getter should return nil when property is nil") + assert.Equal(t, expected, obj.GetHeaderFrom(), "getter should return the property value") }) - t.Run("GetNp_NilReceiver", func(t *testing.T) { + t.Run("GetHeaderFrom_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DmarcReportSummaryPolicyPublished + var obj *DmarcReportRecord // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetNp() // Should return zero value + _ = obj.GetHeaderFrom() // Should return zero value }) - t.Run("GetAdkim", func(t *testing.T) { + t.Run("GetEnvelopeFrom", func(t *testing.T) { t.Parallel() // Arrange - obj := &DmarcReportSummaryPolicyPublished{} + obj := &DmarcReportRecord{} var expected *string - obj.Adkim = expected + obj.EnvelopeFrom = expected // Act & Assert - assert.Equal(t, expected, obj.GetAdkim(), "getter should return the property value") + assert.Equal(t, expected, obj.GetEnvelopeFrom(), "getter should return the property value") }) - t.Run("GetAdkim_NilValue", func(t *testing.T) { + t.Run("GetEnvelopeFrom_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &DmarcReportSummaryPolicyPublished{} - obj.Adkim = nil + obj := &DmarcReportRecord{} + obj.EnvelopeFrom = nil // Act & Assert - assert.Nil(t, obj.GetAdkim(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetEnvelopeFrom(), "getter should return nil when property is nil") }) - t.Run("GetAdkim_NilReceiver", func(t *testing.T) { + t.Run("GetEnvelopeFrom_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DmarcReportSummaryPolicyPublished + var obj *DmarcReportRecord // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetAdkim() // Should return zero value - }) - - t.Run("GetAspf", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &DmarcReportSummaryPolicyPublished{} - var expected *string - obj.Aspf = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetAspf(), "getter should return the property value") + _ = obj.GetEnvelopeFrom() // Should return zero value }) - t.Run("GetAspf_NilValue", func(t *testing.T) { + t.Run("GetViaCoss", func(t *testing.T) { t.Parallel() // Arrange - obj := &DmarcReportSummaryPolicyPublished{} - obj.Aspf = nil + obj := &DmarcReportRecord{} + var expected bool + obj.ViaCoss = expected // Act & Assert - assert.Nil(t, obj.GetAspf(), "getter should return nil when property is nil") + assert.Equal(t, expected, obj.GetViaCoss(), "getter should return the property value") }) - t.Run("GetAspf_NilReceiver", func(t *testing.T) { + t.Run("GetViaCoss_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DmarcReportSummaryPolicyPublished + var obj *DmarcReportRecord // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetAspf() // Should return zero value + _ = obj.GetViaCoss() // Should return zero value }) - t.Run("GetPct", func(t *testing.T) { + t.Run("GetAuthResults", func(t *testing.T) { t.Parallel() // Arrange - obj := &DmarcReportSummaryPolicyPublished{} - var expected *int64 - obj.Pct = expected + obj := &DmarcReportRecord{} + var expected *DmarcReportRecordAuthResults + obj.AuthResults = expected // Act & Assert - assert.Equal(t, expected, obj.GetPct(), "getter should return the property value") + assert.Equal(t, expected, obj.GetAuthResults(), "getter should return the property value") }) - t.Run("GetPct_NilValue", func(t *testing.T) { + t.Run("GetAuthResults_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &DmarcReportSummaryPolicyPublished{} - obj.Pct = nil + obj := &DmarcReportRecord{} + obj.AuthResults = nil // Act & Assert - assert.Nil(t, obj.GetPct(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetAuthResults(), "getter should return nil when property is nil") }) - t.Run("GetPct_NilReceiver", func(t *testing.T) { + t.Run("GetAuthResults_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DmarcReportSummaryPolicyPublished + var obj *DmarcReportRecord // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetPct() // Should return zero value + _ = obj.GetAuthResults() // Should return zero value }) - t.Run("GetTesting", func(t *testing.T) { + t.Run("GetReasons", func(t *testing.T) { t.Parallel() // Arrange - obj := &DmarcReportSummaryPolicyPublished{} - var expected *string - obj.Testing = expected + obj := &DmarcReportRecord{} + var expected []*DmarcReportRecordReasonsItem + obj.Reasons = expected // Act & Assert - assert.Equal(t, expected, obj.GetTesting(), "getter should return the property value") + assert.Equal(t, expected, obj.GetReasons(), "getter should return the property value") }) - t.Run("GetTesting_NilValue", func(t *testing.T) { + t.Run("GetReasons_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &DmarcReportSummaryPolicyPublished{} - obj.Testing = nil + obj := &DmarcReportRecord{} + obj.Reasons = nil // Act & Assert - assert.Nil(t, obj.GetTesting(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetReasons(), "getter should return nil when property is nil") }) - t.Run("GetTesting_NilReceiver", func(t *testing.T) { + t.Run("GetReasons_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DmarcReportSummaryPolicyPublished + var obj *DmarcReportRecord // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetTesting() // Should return zero value + _ = obj.GetReasons() // Should return zero value }) } -func TestSettersMarkExplicitDmarcReportSummaryPolicyPublished(t *testing.T) { - t.Run("SetDomain_MarksExplicit", func(t *testing.T) { +func TestSettersMarkExplicitDmarcReportRecord(t *testing.T) { + t.Run("SetSourceIP_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DmarcReportSummaryPolicyPublished{} - var fernTestValueDomain string + obj := &DmarcReportRecord{} + var fernTestValueSourceIP string // Act - obj.SetDomain(fernTestValueDomain) + obj.SetSourceIP(fernTestValueSourceIP) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -28458,14 +28007,14 @@ func TestSettersMarkExplicitDmarcReportSummaryPolicyPublished(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetP_MarksExplicit", func(t *testing.T) { + t.Run("SetCount_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DmarcReportSummaryPolicyPublished{} - var fernTestValueP *string + obj := &DmarcReportRecord{} + var fernTestValueCount int64 // Act - obj.SetP(fernTestValueP) + obj.SetCount(fernTestValueCount) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -28489,14 +28038,14 @@ func TestSettersMarkExplicitDmarcReportSummaryPolicyPublished(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetSp_MarksExplicit", func(t *testing.T) { + t.Run("SetDisposition_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DmarcReportSummaryPolicyPublished{} - var fernTestValueSp *string + obj := &DmarcReportRecord{} + var fernTestValueDisposition DmarcReportRecordDisposition // Act - obj.SetSp(fernTestValueSp) + obj.SetDisposition(fernTestValueDisposition) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -28520,14 +28069,14 @@ func TestSettersMarkExplicitDmarcReportSummaryPolicyPublished(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetNp_MarksExplicit", func(t *testing.T) { + t.Run("SetDkim_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DmarcReportSummaryPolicyPublished{} - var fernTestValueNp *string + obj := &DmarcReportRecord{} + var fernTestValueDkim DmarcReportRecordDkim // Act - obj.SetNp(fernTestValueNp) + obj.SetDkim(fernTestValueDkim) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -28551,14 +28100,14 @@ func TestSettersMarkExplicitDmarcReportSummaryPolicyPublished(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetAdkim_MarksExplicit", func(t *testing.T) { + t.Run("SetSpf_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DmarcReportSummaryPolicyPublished{} - var fernTestValueAdkim *string + obj := &DmarcReportRecord{} + var fernTestValueSpf DmarcReportRecordSpf // Act - obj.SetAdkim(fernTestValueAdkim) + obj.SetSpf(fernTestValueSpf) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -28582,14 +28131,14 @@ func TestSettersMarkExplicitDmarcReportSummaryPolicyPublished(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetAspf_MarksExplicit", func(t *testing.T) { + t.Run("SetDmarcPass_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DmarcReportSummaryPolicyPublished{} - var fernTestValueAspf *string + obj := &DmarcReportRecord{} + var fernTestValueDmarcPass bool // Act - obj.SetAspf(fernTestValueAspf) + obj.SetDmarcPass(fernTestValueDmarcPass) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -28613,14 +28162,14 @@ func TestSettersMarkExplicitDmarcReportSummaryPolicyPublished(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetPct_MarksExplicit", func(t *testing.T) { + t.Run("SetHeaderFrom_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DmarcReportSummaryPolicyPublished{} - var fernTestValuePct *int64 + obj := &DmarcReportRecord{} + var fernTestValueHeaderFrom string // Act - obj.SetPct(fernTestValuePct) + obj.SetHeaderFrom(fernTestValueHeaderFrom) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -28644,14 +28193,107 @@ func TestSettersMarkExplicitDmarcReportSummaryPolicyPublished(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetTesting_MarksExplicit", func(t *testing.T) { + t.Run("SetEnvelopeFrom_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DmarcReportSummaryPolicyPublished{} - var fernTestValueTesting *string + obj := &DmarcReportRecord{} + var fernTestValueEnvelopeFrom *string // Act - obj.SetTesting(fernTestValueTesting) + obj.SetEnvelopeFrom(fernTestValueEnvelopeFrom) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetViaCoss_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DmarcReportRecord{} + var fernTestValueViaCoss bool + + // Act + obj.SetViaCoss(fernTestValueViaCoss) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetAuthResults_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DmarcReportRecord{} + var fernTestValueAuthResults *DmarcReportRecordAuthResults + + // Act + obj.SetAuthResults(fernTestValueAuthResults) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetReasons_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DmarcReportRecord{} + var fernTestValueReasons []*DmarcReportRecordReasonsItem + + // Act + obj.SetReasons(fernTestValueReasons) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -28677,93 +28319,103 @@ func TestSettersMarkExplicitDmarcReportSummaryPolicyPublished(t *testing.T) { } -func TestSettersDmarcReportSummaryReporter(t *testing.T) { - t.Run("SetOrgName", func(t *testing.T) { - obj := &DmarcReportSummaryReporter{} - var fernTestValueOrgName string - obj.SetOrgName(fernTestValueOrgName) - assert.Equal(t, fernTestValueOrgName, obj.OrgName) +func TestSettersDmarcReportRecordAuthResults(t *testing.T) { + t.Run("SetDkim", func(t *testing.T) { + obj := &DmarcReportRecordAuthResults{} + var fernTestValueDkim []*DmarcReportRecordAuthResultsDkimItem + obj.SetDkim(fernTestValueDkim) + assert.Equal(t, fernTestValueDkim, obj.Dkim) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetEmail", func(t *testing.T) { - obj := &DmarcReportSummaryReporter{} - var fernTestValueEmail *string - obj.SetEmail(fernTestValueEmail) - assert.Equal(t, fernTestValueEmail, obj.Email) + t.Run("SetSpf", func(t *testing.T) { + obj := &DmarcReportRecordAuthResults{} + var fernTestValueSpf []*DmarcReportRecordAuthResultsSpfItem + obj.SetSpf(fernTestValueSpf) + assert.Equal(t, fernTestValueSpf, obj.Spf) assert.NotNil(t, obj.explicitFields) }) } -func TestGettersDmarcReportSummaryReporter(t *testing.T) { - t.Run("GetOrgName", func(t *testing.T) { +func TestGettersDmarcReportRecordAuthResults(t *testing.T) { + t.Run("GetDkim", func(t *testing.T) { t.Parallel() // Arrange - obj := &DmarcReportSummaryReporter{} - var expected string - obj.OrgName = expected + obj := &DmarcReportRecordAuthResults{} + var expected []*DmarcReportRecordAuthResultsDkimItem + obj.Dkim = expected // Act & Assert - assert.Equal(t, expected, obj.GetOrgName(), "getter should return the property value") + assert.Equal(t, expected, obj.GetDkim(), "getter should return the property value") }) - t.Run("GetOrgName_NilReceiver", func(t *testing.T) { + t.Run("GetDkim_NilValue", func(t *testing.T) { t.Parallel() - var obj *DmarcReportSummaryReporter + // Arrange + obj := &DmarcReportRecordAuthResults{} + obj.Dkim = nil + + // Act & Assert + assert.Nil(t, obj.GetDkim(), "getter should return nil when property is nil") + }) + + t.Run("GetDkim_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *DmarcReportRecordAuthResults // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetOrgName() // Should return zero value + _ = obj.GetDkim() // Should return zero value }) - t.Run("GetEmail", func(t *testing.T) { + t.Run("GetSpf", func(t *testing.T) { t.Parallel() // Arrange - obj := &DmarcReportSummaryReporter{} - var expected *string - obj.Email = expected + obj := &DmarcReportRecordAuthResults{} + var expected []*DmarcReportRecordAuthResultsSpfItem + obj.Spf = expected // Act & Assert - assert.Equal(t, expected, obj.GetEmail(), "getter should return the property value") + assert.Equal(t, expected, obj.GetSpf(), "getter should return the property value") }) - t.Run("GetEmail_NilValue", func(t *testing.T) { + t.Run("GetSpf_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &DmarcReportSummaryReporter{} - obj.Email = nil + obj := &DmarcReportRecordAuthResults{} + obj.Spf = nil // Act & Assert - assert.Nil(t, obj.GetEmail(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetSpf(), "getter should return nil when property is nil") }) - t.Run("GetEmail_NilReceiver", func(t *testing.T) { + t.Run("GetSpf_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DmarcReportSummaryReporter + var obj *DmarcReportRecordAuthResults // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetEmail() // Should return zero value + _ = obj.GetSpf() // Should return zero value }) } -func TestSettersMarkExplicitDmarcReportSummaryReporter(t *testing.T) { - t.Run("SetOrgName_MarksExplicit", func(t *testing.T) { +func TestSettersMarkExplicitDmarcReportRecordAuthResults(t *testing.T) { + t.Run("SetDkim_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DmarcReportSummaryReporter{} - var fernTestValueOrgName string + obj := &DmarcReportRecordAuthResults{} + var fernTestValueDkim []*DmarcReportRecordAuthResultsDkimItem // Act - obj.SetOrgName(fernTestValueOrgName) + obj.SetDkim(fernTestValueDkim) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -28787,14 +28439,14 @@ func TestSettersMarkExplicitDmarcReportSummaryReporter(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetEmail_MarksExplicit", func(t *testing.T) { + t.Run("SetSpf_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DmarcReportSummaryReporter{} - var fernTestValueEmail *string + obj := &DmarcReportRecordAuthResults{} + var fernTestValueSpf []*DmarcReportRecordAuthResultsSpfItem // Act - obj.SetEmail(fernTestValueEmail) + obj.SetSpf(fernTestValueSpf) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -28820,176 +28472,155 @@ func TestSettersMarkExplicitDmarcReportSummaryReporter(t *testing.T) { } -func TestSettersDmarcSource(t *testing.T) { - t.Run("SetSourceIP", func(t *testing.T) { - obj := &DmarcSource{} - var fernTestValueSourceIP string - obj.SetSourceIP(fernTestValueSourceIP) - assert.Equal(t, fernTestValueSourceIP, obj.SourceIP) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetHeaderFrom", func(t *testing.T) { - obj := &DmarcSource{} - var fernTestValueHeaderFrom string - obj.SetHeaderFrom(fernTestValueHeaderFrom) - assert.Equal(t, fernTestValueHeaderFrom, obj.HeaderFrom) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetMessages", func(t *testing.T) { - obj := &DmarcSource{} - var fernTestValueMessages int64 - obj.SetMessages(fernTestValueMessages) - assert.Equal(t, fernTestValueMessages, obj.Messages) +func TestSettersDmarcReportRecordAuthResultsDkimItem(t *testing.T) { + t.Run("SetDomain", func(t *testing.T) { + obj := &DmarcReportRecordAuthResultsDkimItem{} + var fernTestValueDomain string + obj.SetDomain(fernTestValueDomain) + assert.Equal(t, fernTestValueDomain, obj.Domain) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetPassing", func(t *testing.T) { - obj := &DmarcSource{} - var fernTestValuePassing int64 - obj.SetPassing(fernTestValuePassing) - assert.Equal(t, fernTestValuePassing, obj.Passing) + t.Run("SetSelector", func(t *testing.T) { + obj := &DmarcReportRecordAuthResultsDkimItem{} + var fernTestValueSelector *string + obj.SetSelector(fernTestValueSelector) + assert.Equal(t, fernTestValueSelector, obj.Selector) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetViaCoss", func(t *testing.T) { - obj := &DmarcSource{} - var fernTestValueViaCoss bool - obj.SetViaCoss(fernTestValueViaCoss) - assert.Equal(t, fernTestValueViaCoss, obj.ViaCoss) + t.Run("SetResult", func(t *testing.T) { + obj := &DmarcReportRecordAuthResultsDkimItem{} + var fernTestValueResult string + obj.SetResult(fernTestValueResult) + assert.Equal(t, fernTestValueResult, obj.Result) assert.NotNil(t, obj.explicitFields) }) } -func TestGettersDmarcSource(t *testing.T) { - t.Run("GetSourceIP", func(t *testing.T) { +func TestGettersDmarcReportRecordAuthResultsDkimItem(t *testing.T) { + t.Run("GetDomain", func(t *testing.T) { t.Parallel() // Arrange - obj := &DmarcSource{} + obj := &DmarcReportRecordAuthResultsDkimItem{} var expected string - obj.SourceIP = expected + obj.Domain = expected // Act & Assert - assert.Equal(t, expected, obj.GetSourceIP(), "getter should return the property value") + assert.Equal(t, expected, obj.GetDomain(), "getter should return the property value") }) - t.Run("GetSourceIP_NilReceiver", func(t *testing.T) { + t.Run("GetDomain_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DmarcSource + var obj *DmarcReportRecordAuthResultsDkimItem // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetSourceIP() // Should return zero value + _ = obj.GetDomain() // Should return zero value }) - t.Run("GetHeaderFrom", func(t *testing.T) { + t.Run("GetSelector", func(t *testing.T) { t.Parallel() // Arrange - obj := &DmarcSource{} - var expected string - obj.HeaderFrom = expected + obj := &DmarcReportRecordAuthResultsDkimItem{} + var expected *string + obj.Selector = expected // Act & Assert - assert.Equal(t, expected, obj.GetHeaderFrom(), "getter should return the property value") - }) - - t.Run("GetHeaderFrom_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *DmarcSource - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetHeaderFrom() // Should return zero value + assert.Equal(t, expected, obj.GetSelector(), "getter should return the property value") }) - t.Run("GetMessages", func(t *testing.T) { + t.Run("GetSelector_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &DmarcSource{} - var expected int64 - obj.Messages = expected + obj := &DmarcReportRecordAuthResultsDkimItem{} + obj.Selector = nil // Act & Assert - assert.Equal(t, expected, obj.GetMessages(), "getter should return the property value") + assert.Nil(t, obj.GetSelector(), "getter should return nil when property is nil") }) - t.Run("GetMessages_NilReceiver", func(t *testing.T) { + t.Run("GetSelector_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DmarcSource + var obj *DmarcReportRecordAuthResultsDkimItem // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetMessages() // Should return zero value + _ = obj.GetSelector() // Should return zero value }) - t.Run("GetPassing", func(t *testing.T) { + t.Run("GetResult", func(t *testing.T) { t.Parallel() // Arrange - obj := &DmarcSource{} - var expected int64 - obj.Passing = expected + obj := &DmarcReportRecordAuthResultsDkimItem{} + var expected string + obj.Result = expected // Act & Assert - assert.Equal(t, expected, obj.GetPassing(), "getter should return the property value") + assert.Equal(t, expected, obj.GetResult(), "getter should return the property value") }) - t.Run("GetPassing_NilReceiver", func(t *testing.T) { + t.Run("GetResult_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DmarcSource + var obj *DmarcReportRecordAuthResultsDkimItem // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetPassing() // Should return zero value + _ = obj.GetResult() // Should return zero value }) - t.Run("GetViaCoss", func(t *testing.T) { +} + +func TestSettersMarkExplicitDmarcReportRecordAuthResultsDkimItem(t *testing.T) { + t.Run("SetDomain_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DmarcSource{} - var expected bool - obj.ViaCoss = expected + obj := &DmarcReportRecordAuthResultsDkimItem{} + var fernTestValueDomain string - // Act & Assert - assert.Equal(t, expected, obj.GetViaCoss(), "getter should return the property value") - }) + // Act + obj.SetDomain(fernTestValueDomain) - t.Run("GetViaCoss_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *DmarcSource - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetViaCoss() // Should return zero value - }) + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") -} + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } -func TestSettersMarkExplicitDmarcSource(t *testing.T) { - t.Run("SetSourceIP_MarksExplicit", func(t *testing.T) { + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetSelector_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DmarcSource{} - var fernTestValueSourceIP string + obj := &DmarcReportRecordAuthResultsDkimItem{} + var fernTestValueSelector *string // Act - obj.SetSourceIP(fernTestValueSourceIP) + obj.SetSelector(fernTestValueSelector) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -29013,14 +28644,14 @@ func TestSettersMarkExplicitDmarcSource(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetHeaderFrom_MarksExplicit", func(t *testing.T) { + t.Run("SetResult_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DmarcSource{} - var fernTestValueHeaderFrom string + obj := &DmarcReportRecordAuthResultsDkimItem{} + var fernTestValueResult string // Act - obj.SetHeaderFrom(fernTestValueHeaderFrom) + obj.SetResult(fernTestValueResult) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -29044,14 +28675,126 @@ func TestSettersMarkExplicitDmarcSource(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetMessages_MarksExplicit", func(t *testing.T) { +} + +func TestSettersDmarcReportRecordAuthResultsSpfItem(t *testing.T) { + t.Run("SetDomain", func(t *testing.T) { + obj := &DmarcReportRecordAuthResultsSpfItem{} + var fernTestValueDomain string + obj.SetDomain(fernTestValueDomain) + assert.Equal(t, fernTestValueDomain, obj.Domain) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetScope", func(t *testing.T) { + obj := &DmarcReportRecordAuthResultsSpfItem{} + var fernTestValueScope *string + obj.SetScope(fernTestValueScope) + assert.Equal(t, fernTestValueScope, obj.Scope) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetResult", func(t *testing.T) { + obj := &DmarcReportRecordAuthResultsSpfItem{} + var fernTestValueResult string + obj.SetResult(fernTestValueResult) + assert.Equal(t, fernTestValueResult, obj.Result) + assert.NotNil(t, obj.explicitFields) + }) + +} + +func TestGettersDmarcReportRecordAuthResultsSpfItem(t *testing.T) { + t.Run("GetDomain", func(t *testing.T) { t.Parallel() // Arrange - obj := &DmarcSource{} - var fernTestValueMessages int64 + obj := &DmarcReportRecordAuthResultsSpfItem{} + var expected string + obj.Domain = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetDomain(), "getter should return the property value") + }) + + t.Run("GetDomain_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *DmarcReportRecordAuthResultsSpfItem + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetDomain() // Should return zero value + }) + + t.Run("GetScope", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DmarcReportRecordAuthResultsSpfItem{} + var expected *string + obj.Scope = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetScope(), "getter should return the property value") + }) + + t.Run("GetScope_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DmarcReportRecordAuthResultsSpfItem{} + obj.Scope = nil + + // Act & Assert + assert.Nil(t, obj.GetScope(), "getter should return nil when property is nil") + }) + + t.Run("GetScope_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *DmarcReportRecordAuthResultsSpfItem + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetScope() // Should return zero value + }) + + t.Run("GetResult", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DmarcReportRecordAuthResultsSpfItem{} + var expected string + obj.Result = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetResult(), "getter should return the property value") + }) + + t.Run("GetResult_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *DmarcReportRecordAuthResultsSpfItem + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetResult() // Should return zero value + }) + +} + +func TestSettersMarkExplicitDmarcReportRecordAuthResultsSpfItem(t *testing.T) { + t.Run("SetDomain_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DmarcReportRecordAuthResultsSpfItem{} + var fernTestValueDomain string // Act - obj.SetMessages(fernTestValueMessages) + obj.SetDomain(fernTestValueDomain) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -29075,14 +28818,14 @@ func TestSettersMarkExplicitDmarcSource(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetPassing_MarksExplicit", func(t *testing.T) { + t.Run("SetScope_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DmarcSource{} - var fernTestValuePassing int64 + obj := &DmarcReportRecordAuthResultsSpfItem{} + var fernTestValueScope *string // Act - obj.SetPassing(fernTestValuePassing) + obj.SetScope(fernTestValueScope) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -29106,14 +28849,14 @@ func TestSettersMarkExplicitDmarcSource(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetViaCoss_MarksExplicit", func(t *testing.T) { + t.Run("SetResult_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DmarcSource{} - var fernTestValueViaCoss bool + obj := &DmarcReportRecordAuthResultsSpfItem{} + var fernTestValueResult string // Act - obj.SetViaCoss(fernTestValueViaCoss) + obj.SetResult(fernTestValueResult) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -29139,666 +28882,696 @@ func TestSettersMarkExplicitDmarcSource(t *testing.T) { } -func TestSettersDomain(t *testing.T) { - t.Run("SetObject", func(t *testing.T) { - obj := &Domain{} - var fernTestValueObject DomainObject - obj.SetObject(fernTestValueObject) - assert.Equal(t, fernTestValueObject, obj.Object) +func TestSettersDmarcReportRecordReasonsItem(t *testing.T) { + t.Run("SetType", func(t *testing.T) { + obj := &DmarcReportRecordReasonsItem{} + var fernTestValueType string + obj.SetType(fernTestValueType) + assert.Equal(t, fernTestValueType, obj.Type) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetID", func(t *testing.T) { - obj := &Domain{} - var fernTestValueID string - obj.SetID(fernTestValueID) - assert.Equal(t, fernTestValueID, obj.ID) + t.Run("SetComment", func(t *testing.T) { + obj := &DmarcReportRecordReasonsItem{} + var fernTestValueComment *string + obj.SetComment(fernTestValueComment) + assert.Equal(t, fernTestValueComment, obj.Comment) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetName", func(t *testing.T) { - obj := &Domain{} - var fernTestValueName string - obj.SetName(fernTestValueName) - assert.Equal(t, fernTestValueName, obj.Name) - assert.NotNil(t, obj.explicitFields) - }) +} - t.Run("SetStatus", func(t *testing.T) { - obj := &Domain{} - var fernTestValueStatus DomainStatus - obj.SetStatus(fernTestValueStatus) - assert.Equal(t, fernTestValueStatus, obj.Status) - assert.NotNil(t, obj.explicitFields) - }) +func TestGettersDmarcReportRecordReasonsItem(t *testing.T) { + t.Run("GetType", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DmarcReportRecordReasonsItem{} + var expected string + obj.Type = expected - t.Run("SetCanSend", func(t *testing.T) { - obj := &Domain{} - var fernTestValueCanSend bool - obj.SetCanSend(fernTestValueCanSend) - assert.Equal(t, fernTestValueCanSend, obj.CanSend) - assert.NotNil(t, obj.explicitFields) + // Act & Assert + assert.Equal(t, expected, obj.GetType(), "getter should return the property value") }) - t.Run("SetRegion", func(t *testing.T) { - obj := &Domain{} - var fernTestValueRegion *string - obj.SetRegion(fernTestValueRegion) - assert.Equal(t, fernTestValueRegion, obj.Region) - assert.NotNil(t, obj.explicitFields) + t.Run("GetType_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *DmarcReportRecordReasonsItem + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetType() // Should return zero value }) - t.Run("SetMailFromDomain", func(t *testing.T) { - obj := &Domain{} - var fernTestValueMailFromDomain string - obj.SetMailFromDomain(fernTestValueMailFromDomain) - assert.Equal(t, fernTestValueMailFromDomain, obj.MailFromDomain) - assert.NotNil(t, obj.explicitFields) - }) + t.Run("GetComment", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DmarcReportRecordReasonsItem{} + var expected *string + obj.Comment = expected - t.Run("SetMailFromStatus", func(t *testing.T) { - obj := &Domain{} - var fernTestValueMailFromStatus DomainMailFromStatus - obj.SetMailFromStatus(fernTestValueMailFromStatus) - assert.Equal(t, fernTestValueMailFromStatus, obj.MailFromStatus) - assert.NotNil(t, obj.explicitFields) + // Act & Assert + assert.Equal(t, expected, obj.GetComment(), "getter should return the property value") }) - t.Run("SetRecords", func(t *testing.T) { - obj := &Domain{} - var fernTestValueRecords []*DomainRecord - obj.SetRecords(fernTestValueRecords) - assert.Equal(t, fernTestValueRecords, obj.Records) - assert.NotNil(t, obj.explicitFields) - }) + t.Run("GetComment_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DmarcReportRecordReasonsItem{} + obj.Comment = nil - t.Run("SetCreatedAt", func(t *testing.T) { - obj := &Domain{} - var fernTestValueCreatedAt time.Time - obj.SetCreatedAt(fernTestValueCreatedAt) - assert.Equal(t, fernTestValueCreatedAt, obj.CreatedAt) - assert.NotNil(t, obj.explicitFields) + // Act & Assert + assert.Nil(t, obj.GetComment(), "getter should return nil when property is nil") }) - t.Run("SetLastCheckedAt", func(t *testing.T) { - obj := &Domain{} - var fernTestValueLastCheckedAt *time.Time - obj.SetLastCheckedAt(fernTestValueLastCheckedAt) - assert.Equal(t, fernTestValueLastCheckedAt, obj.LastCheckedAt) - assert.NotNil(t, obj.explicitFields) + t.Run("GetComment_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *DmarcReportRecordReasonsItem + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetComment() // Should return zero value }) - t.Run("SetVerifiedAt", func(t *testing.T) { - obj := &Domain{} - var fernTestValueVerifiedAt *time.Time - obj.SetVerifiedAt(fernTestValueVerifiedAt) - assert.Equal(t, fernTestValueVerifiedAt, obj.VerifiedAt) - assert.NotNil(t, obj.explicitFields) - }) +} - t.Run("SetFailedAt", func(t *testing.T) { - obj := &Domain{} - var fernTestValueFailedAt *time.Time - obj.SetFailedAt(fernTestValueFailedAt) - assert.Equal(t, fernTestValueFailedAt, obj.FailedAt) - assert.NotNil(t, obj.explicitFields) - }) +func TestSettersMarkExplicitDmarcReportRecordReasonsItem(t *testing.T) { + t.Run("SetType_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DmarcReportRecordReasonsItem{} + var fernTestValueType string - t.Run("SetTracking", func(t *testing.T) { - obj := &Domain{} - var fernTestValueTracking *TrackingDomain - obj.SetTracking(fernTestValueTracking) - assert.Equal(t, fernTestValueTracking, obj.Tracking) - assert.NotNil(t, obj.explicitFields) - }) + // Act + obj.SetType(fernTestValueType) - t.Run("SetReceiving", func(t *testing.T) { - obj := &Domain{} - var fernTestValueReceiving *ReceivingDomain - obj.SetReceiving(fernTestValueReceiving) - assert.Equal(t, fernTestValueReceiving, obj.Receiving) - assert.NotNil(t, obj.explicitFields) + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetBimi", func(t *testing.T) { - obj := &Domain{} - var fernTestValueBimi *DomainBimi - obj.SetBimi(fernTestValueBimi) - assert.Equal(t, fernTestValueBimi, obj.Bimi) - assert.NotNil(t, obj.explicitFields) + t.Run("SetComment_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DmarcReportRecordReasonsItem{} + var fernTestValueComment *string + + // Act + obj.SetComment(fernTestValueComment) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetSubaccountID", func(t *testing.T) { - obj := &Domain{} - var fernTestValueSubaccountID *string - obj.SetSubaccountID(fernTestValueSubaccountID) - assert.Equal(t, fernTestValueSubaccountID, obj.SubaccountID) +} + +func TestSettersDmarcReportReporter(t *testing.T) { + t.Run("SetOrgName", func(t *testing.T) { + obj := &DmarcReportReporter{} + var fernTestValueOrgName string + obj.SetOrgName(fernTestValueOrgName) + assert.Equal(t, fernTestValueOrgName, obj.OrgName) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetSharedWithSubaccounts", func(t *testing.T) { - obj := &Domain{} - var fernTestValueSharedWithSubaccounts bool - obj.SetSharedWithSubaccounts(fernTestValueSharedWithSubaccounts) - assert.Equal(t, fernTestValueSharedWithSubaccounts, obj.SharedWithSubaccounts) + t.Run("SetEmail", func(t *testing.T) { + obj := &DmarcReportReporter{} + var fernTestValueEmail *string + obj.SetEmail(fernTestValueEmail) + assert.Equal(t, fernTestValueEmail, obj.Email) assert.NotNil(t, obj.explicitFields) }) } -func TestGettersDomain(t *testing.T) { - t.Run("GetObject", func(t *testing.T) { +func TestGettersDmarcReportReporter(t *testing.T) { + t.Run("GetOrgName", func(t *testing.T) { t.Parallel() // Arrange - obj := &Domain{} - var expected DomainObject - obj.Object = expected + obj := &DmarcReportReporter{} + var expected string + obj.OrgName = expected // Act & Assert - assert.Equal(t, expected, obj.GetObject(), "getter should return the property value") + assert.Equal(t, expected, obj.GetOrgName(), "getter should return the property value") }) - t.Run("GetObject_NilReceiver", func(t *testing.T) { + t.Run("GetOrgName_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *Domain + var obj *DmarcReportReporter // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetObject() // Should return zero value + _ = obj.GetOrgName() // Should return zero value }) - t.Run("GetID", func(t *testing.T) { + t.Run("GetEmail", func(t *testing.T) { t.Parallel() // Arrange - obj := &Domain{} - var expected string - obj.ID = expected + obj := &DmarcReportReporter{} + var expected *string + obj.Email = expected // Act & Assert - assert.Equal(t, expected, obj.GetID(), "getter should return the property value") - }) - - t.Run("GetID_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *Domain - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetID() // Should return zero value + assert.Equal(t, expected, obj.GetEmail(), "getter should return the property value") }) - t.Run("GetName", func(t *testing.T) { + t.Run("GetEmail_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &Domain{} - var expected string - obj.Name = expected + obj := &DmarcReportReporter{} + obj.Email = nil // Act & Assert - assert.Equal(t, expected, obj.GetName(), "getter should return the property value") + assert.Nil(t, obj.GetEmail(), "getter should return nil when property is nil") }) - t.Run("GetName_NilReceiver", func(t *testing.T) { + t.Run("GetEmail_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *Domain + var obj *DmarcReportReporter // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetName() // Should return zero value + _ = obj.GetEmail() // Should return zero value }) - t.Run("GetStatus", func(t *testing.T) { +} + +func TestSettersMarkExplicitDmarcReportReporter(t *testing.T) { + t.Run("SetOrgName_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &Domain{} - var expected DomainStatus - obj.Status = expected + obj := &DmarcReportReporter{} + var fernTestValueOrgName string - // Act & Assert - assert.Equal(t, expected, obj.GetStatus(), "getter should return the property value") - }) + // Act + obj.SetOrgName(fernTestValueOrgName) - t.Run("GetStatus_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *Domain - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetStatus() // Should return zero value + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("GetCanSend", func(t *testing.T) { + t.Run("SetEmail_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &Domain{} - var expected bool - obj.CanSend = expected + obj := &DmarcReportReporter{} + var fernTestValueEmail *string - // Act & Assert - assert.Equal(t, expected, obj.GetCanSend(), "getter should return the property value") + // Act + obj.SetEmail(fernTestValueEmail) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("GetCanSend_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *Domain - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetCanSend() // Should return zero value +} + +func TestSettersDmarcReportSummary(t *testing.T) { + t.Run("SetObject", func(t *testing.T) { + obj := &DmarcReportSummary{} + var fernTestValueObject DmarcReportSummaryObject + obj.SetObject(fernTestValueObject) + assert.Equal(t, fernTestValueObject, obj.Object) + assert.NotNil(t, obj.explicitFields) }) - t.Run("GetRegion", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &Domain{} - var expected *string - obj.Region = expected + t.Run("SetID", func(t *testing.T) { + obj := &DmarcReportSummary{} + var fernTestValueID string + obj.SetID(fernTestValueID) + assert.Equal(t, fernTestValueID, obj.ID) + assert.NotNil(t, obj.explicitFields) + }) - // Act & Assert - assert.Equal(t, expected, obj.GetRegion(), "getter should return the property value") + t.Run("SetDomainID", func(t *testing.T) { + obj := &DmarcReportSummary{} + var fernTestValueDomainID string + obj.SetDomainID(fernTestValueDomainID) + assert.Equal(t, fernTestValueDomainID, obj.DomainID) + assert.NotNil(t, obj.explicitFields) }) - t.Run("GetRegion_NilValue", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &Domain{} - obj.Region = nil + t.Run("SetReporter", func(t *testing.T) { + obj := &DmarcReportSummary{} + var fernTestValueReporter *DmarcReportSummaryReporter + obj.SetReporter(fernTestValueReporter) + assert.Equal(t, fernTestValueReporter, obj.Reporter) + assert.NotNil(t, obj.explicitFields) + }) - // Act & Assert - assert.Nil(t, obj.GetRegion(), "getter should return nil when property is nil") + t.Run("SetReportID", func(t *testing.T) { + obj := &DmarcReportSummary{} + var fernTestValueReportID string + obj.SetReportID(fernTestValueReportID) + assert.Equal(t, fernTestValueReportID, obj.ReportID) + assert.NotNil(t, obj.explicitFields) }) - t.Run("GetRegion_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *Domain - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetRegion() // Should return zero value + t.Run("SetPeriodStart", func(t *testing.T) { + obj := &DmarcReportSummary{} + var fernTestValuePeriodStart time.Time + obj.SetPeriodStart(fernTestValuePeriodStart) + assert.Equal(t, fernTestValuePeriodStart, obj.PeriodStart) + assert.NotNil(t, obj.explicitFields) }) - t.Run("GetMailFromDomain", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &Domain{} - var expected string - obj.MailFromDomain = expected + t.Run("SetPeriodEnd", func(t *testing.T) { + obj := &DmarcReportSummary{} + var fernTestValuePeriodEnd time.Time + obj.SetPeriodEnd(fernTestValuePeriodEnd) + assert.Equal(t, fernTestValuePeriodEnd, obj.PeriodEnd) + assert.NotNil(t, obj.explicitFields) + }) - // Act & Assert - assert.Equal(t, expected, obj.GetMailFromDomain(), "getter should return the property value") + t.Run("SetPolicyPublished", func(t *testing.T) { + obj := &DmarcReportSummary{} + var fernTestValuePolicyPublished *DmarcReportSummaryPolicyPublished + obj.SetPolicyPublished(fernTestValuePolicyPublished) + assert.Equal(t, fernTestValuePolicyPublished, obj.PolicyPublished) + assert.NotNil(t, obj.explicitFields) }) - t.Run("GetMailFromDomain_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *Domain - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetMailFromDomain() // Should return zero value + t.Run("SetMessages", func(t *testing.T) { + obj := &DmarcReportSummary{} + var fernTestValueMessages int64 + obj.SetMessages(fernTestValueMessages) + assert.Equal(t, fernTestValueMessages, obj.Messages) + assert.NotNil(t, obj.explicitFields) }) - t.Run("GetMailFromStatus", func(t *testing.T) { + t.Run("SetPassing", func(t *testing.T) { + obj := &DmarcReportSummary{} + var fernTestValuePassing int64 + obj.SetPassing(fernTestValuePassing) + assert.Equal(t, fernTestValuePassing, obj.Passing) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetTruncated", func(t *testing.T) { + obj := &DmarcReportSummary{} + var fernTestValueTruncated bool + obj.SetTruncated(fernTestValueTruncated) + assert.Equal(t, fernTestValueTruncated, obj.Truncated) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetReceivedAt", func(t *testing.T) { + obj := &DmarcReportSummary{} + var fernTestValueReceivedAt time.Time + obj.SetReceivedAt(fernTestValueReceivedAt) + assert.Equal(t, fernTestValueReceivedAt, obj.ReceivedAt) + assert.NotNil(t, obj.explicitFields) + }) + +} + +func TestGettersDmarcReportSummary(t *testing.T) { + t.Run("GetObject", func(t *testing.T) { t.Parallel() // Arrange - obj := &Domain{} - var expected DomainMailFromStatus - obj.MailFromStatus = expected + obj := &DmarcReportSummary{} + var expected DmarcReportSummaryObject + obj.Object = expected // Act & Assert - assert.Equal(t, expected, obj.GetMailFromStatus(), "getter should return the property value") + assert.Equal(t, expected, obj.GetObject(), "getter should return the property value") }) - t.Run("GetMailFromStatus_NilReceiver", func(t *testing.T) { + t.Run("GetObject_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *Domain + var obj *DmarcReportSummary // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetMailFromStatus() // Should return zero value - }) - - t.Run("GetRecords", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &Domain{} - var expected []*DomainRecord - obj.Records = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetRecords(), "getter should return the property value") + _ = obj.GetObject() // Should return zero value }) - t.Run("GetRecords_NilValue", func(t *testing.T) { + t.Run("GetID", func(t *testing.T) { t.Parallel() // Arrange - obj := &Domain{} - obj.Records = nil + obj := &DmarcReportSummary{} + var expected string + obj.ID = expected // Act & Assert - assert.Nil(t, obj.GetRecords(), "getter should return nil when property is nil") + assert.Equal(t, expected, obj.GetID(), "getter should return the property value") }) - t.Run("GetRecords_NilReceiver", func(t *testing.T) { + t.Run("GetID_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *Domain + var obj *DmarcReportSummary // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetRecords() // Should return zero value + _ = obj.GetID() // Should return zero value }) - t.Run("GetCreatedAt", func(t *testing.T) { + t.Run("GetDomainID", func(t *testing.T) { t.Parallel() // Arrange - obj := &Domain{} - var expected time.Time - obj.CreatedAt = expected + obj := &DmarcReportSummary{} + var expected string + obj.DomainID = expected // Act & Assert - assert.Equal(t, expected, obj.GetCreatedAt(), "getter should return the property value") + assert.Equal(t, expected, obj.GetDomainID(), "getter should return the property value") }) - t.Run("GetCreatedAt_NilReceiver", func(t *testing.T) { + t.Run("GetDomainID_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *Domain + var obj *DmarcReportSummary // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetCreatedAt() // Should return zero value + _ = obj.GetDomainID() // Should return zero value }) - t.Run("GetLastCheckedAt", func(t *testing.T) { + t.Run("GetReporter", func(t *testing.T) { t.Parallel() // Arrange - obj := &Domain{} - var expected *time.Time - obj.LastCheckedAt = expected + obj := &DmarcReportSummary{} + var expected *DmarcReportSummaryReporter + obj.Reporter = expected // Act & Assert - assert.Equal(t, expected, obj.GetLastCheckedAt(), "getter should return the property value") + assert.Equal(t, expected, obj.GetReporter(), "getter should return the property value") }) - t.Run("GetLastCheckedAt_NilValue", func(t *testing.T) { + t.Run("GetReporter_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &Domain{} - obj.LastCheckedAt = nil + obj := &DmarcReportSummary{} + obj.Reporter = nil // Act & Assert - assert.Nil(t, obj.GetLastCheckedAt(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetReporter(), "getter should return nil when property is nil") }) - t.Run("GetLastCheckedAt_NilReceiver", func(t *testing.T) { + t.Run("GetReporter_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *Domain + var obj *DmarcReportSummary // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetLastCheckedAt() // Should return zero value - }) - - t.Run("GetVerifiedAt", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &Domain{} - var expected *time.Time - obj.VerifiedAt = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetVerifiedAt(), "getter should return the property value") + _ = obj.GetReporter() // Should return zero value }) - t.Run("GetVerifiedAt_NilValue", func(t *testing.T) { + t.Run("GetReportID", func(t *testing.T) { t.Parallel() // Arrange - obj := &Domain{} - obj.VerifiedAt = nil + obj := &DmarcReportSummary{} + var expected string + obj.ReportID = expected // Act & Assert - assert.Nil(t, obj.GetVerifiedAt(), "getter should return nil when property is nil") + assert.Equal(t, expected, obj.GetReportID(), "getter should return the property value") }) - t.Run("GetVerifiedAt_NilReceiver", func(t *testing.T) { + t.Run("GetReportID_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *Domain + var obj *DmarcReportSummary // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetVerifiedAt() // Should return zero value - }) - - t.Run("GetFailedAt", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &Domain{} - var expected *time.Time - obj.FailedAt = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetFailedAt(), "getter should return the property value") + _ = obj.GetReportID() // Should return zero value }) - t.Run("GetFailedAt_NilValue", func(t *testing.T) { + t.Run("GetPeriodStart", func(t *testing.T) { t.Parallel() // Arrange - obj := &Domain{} - obj.FailedAt = nil + obj := &DmarcReportSummary{} + var expected time.Time + obj.PeriodStart = expected // Act & Assert - assert.Nil(t, obj.GetFailedAt(), "getter should return nil when property is nil") + assert.Equal(t, expected, obj.GetPeriodStart(), "getter should return the property value") }) - t.Run("GetFailedAt_NilReceiver", func(t *testing.T) { + t.Run("GetPeriodStart_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *Domain + var obj *DmarcReportSummary // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetFailedAt() // Should return zero value - }) - - t.Run("GetTracking", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &Domain{} - var expected *TrackingDomain - obj.Tracking = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetTracking(), "getter should return the property value") + _ = obj.GetPeriodStart() // Should return zero value }) - t.Run("GetTracking_NilValue", func(t *testing.T) { + t.Run("GetPeriodEnd", func(t *testing.T) { t.Parallel() // Arrange - obj := &Domain{} - obj.Tracking = nil + obj := &DmarcReportSummary{} + var expected time.Time + obj.PeriodEnd = expected // Act & Assert - assert.Nil(t, obj.GetTracking(), "getter should return nil when property is nil") + assert.Equal(t, expected, obj.GetPeriodEnd(), "getter should return the property value") }) - t.Run("GetTracking_NilReceiver", func(t *testing.T) { + t.Run("GetPeriodEnd_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *Domain + var obj *DmarcReportSummary // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetTracking() // Should return zero value + _ = obj.GetPeriodEnd() // Should return zero value }) - t.Run("GetReceiving", func(t *testing.T) { + t.Run("GetPolicyPublished", func(t *testing.T) { t.Parallel() // Arrange - obj := &Domain{} - var expected *ReceivingDomain - obj.Receiving = expected + obj := &DmarcReportSummary{} + var expected *DmarcReportSummaryPolicyPublished + obj.PolicyPublished = expected // Act & Assert - assert.Equal(t, expected, obj.GetReceiving(), "getter should return the property value") + assert.Equal(t, expected, obj.GetPolicyPublished(), "getter should return the property value") }) - t.Run("GetReceiving_NilValue", func(t *testing.T) { + t.Run("GetPolicyPublished_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &Domain{} - obj.Receiving = nil + obj := &DmarcReportSummary{} + obj.PolicyPublished = nil // Act & Assert - assert.Nil(t, obj.GetReceiving(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetPolicyPublished(), "getter should return nil when property is nil") }) - t.Run("GetReceiving_NilReceiver", func(t *testing.T) { + t.Run("GetPolicyPublished_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *Domain + var obj *DmarcReportSummary // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetReceiving() // Should return zero value - }) - - t.Run("GetBimi", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &Domain{} - var expected *DomainBimi - obj.Bimi = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetBimi(), "getter should return the property value") + _ = obj.GetPolicyPublished() // Should return zero value }) - t.Run("GetBimi_NilValue", func(t *testing.T) { + t.Run("GetMessages", func(t *testing.T) { t.Parallel() // Arrange - obj := &Domain{} - obj.Bimi = nil + obj := &DmarcReportSummary{} + var expected int64 + obj.Messages = expected // Act & Assert - assert.Nil(t, obj.GetBimi(), "getter should return nil when property is nil") + assert.Equal(t, expected, obj.GetMessages(), "getter should return the property value") }) - t.Run("GetBimi_NilReceiver", func(t *testing.T) { + t.Run("GetMessages_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *Domain + var obj *DmarcReportSummary // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetBimi() // Should return zero value + _ = obj.GetMessages() // Should return zero value }) - t.Run("GetSubaccountID", func(t *testing.T) { + t.Run("GetPassing", func(t *testing.T) { t.Parallel() // Arrange - obj := &Domain{} - var expected *string - obj.SubaccountID = expected + obj := &DmarcReportSummary{} + var expected int64 + obj.Passing = expected // Act & Assert - assert.Equal(t, expected, obj.GetSubaccountID(), "getter should return the property value") + assert.Equal(t, expected, obj.GetPassing(), "getter should return the property value") }) - t.Run("GetSubaccountID_NilValue", func(t *testing.T) { + t.Run("GetPassing_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *DmarcReportSummary + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetPassing() // Should return zero value + }) + + t.Run("GetTruncated", func(t *testing.T) { t.Parallel() // Arrange - obj := &Domain{} - obj.SubaccountID = nil + obj := &DmarcReportSummary{} + var expected bool + obj.Truncated = expected // Act & Assert - assert.Nil(t, obj.GetSubaccountID(), "getter should return nil when property is nil") + assert.Equal(t, expected, obj.GetTruncated(), "getter should return the property value") }) - t.Run("GetSubaccountID_NilReceiver", func(t *testing.T) { + t.Run("GetTruncated_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *Domain + var obj *DmarcReportSummary // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetSubaccountID() // Should return zero value + _ = obj.GetTruncated() // Should return zero value }) - t.Run("GetSharedWithSubaccounts", func(t *testing.T) { + t.Run("GetReceivedAt", func(t *testing.T) { t.Parallel() // Arrange - obj := &Domain{} - var expected bool - obj.SharedWithSubaccounts = expected + obj := &DmarcReportSummary{} + var expected time.Time + obj.ReceivedAt = expected // Act & Assert - assert.Equal(t, expected, obj.GetSharedWithSubaccounts(), "getter should return the property value") + assert.Equal(t, expected, obj.GetReceivedAt(), "getter should return the property value") }) - t.Run("GetSharedWithSubaccounts_NilReceiver", func(t *testing.T) { + t.Run("GetReceivedAt_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *Domain + var obj *DmarcReportSummary // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetSharedWithSubaccounts() // Should return zero value + _ = obj.GetReceivedAt() // Should return zero value }) } -func TestSettersMarkExplicitDomain(t *testing.T) { +func TestSettersMarkExplicitDmarcReportSummary(t *testing.T) { t.Run("SetObject_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &Domain{} - var fernTestValueObject DomainObject + obj := &DmarcReportSummary{} + var fernTestValueObject DmarcReportSummaryObject // Act obj.SetObject(fernTestValueObject) @@ -29828,7 +29601,7 @@ func TestSettersMarkExplicitDomain(t *testing.T) { t.Run("SetID_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &Domain{} + obj := &DmarcReportSummary{} var fernTestValueID string // Act @@ -29856,14 +29629,14 @@ func TestSettersMarkExplicitDomain(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetName_MarksExplicit", func(t *testing.T) { + t.Run("SetDomainID_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &Domain{} - var fernTestValueName string + obj := &DmarcReportSummary{} + var fernTestValueDomainID string // Act - obj.SetName(fernTestValueName) + obj.SetDomainID(fernTestValueDomainID) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -29887,14 +29660,14 @@ func TestSettersMarkExplicitDomain(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetStatus_MarksExplicit", func(t *testing.T) { + t.Run("SetReporter_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &Domain{} - var fernTestValueStatus DomainStatus + obj := &DmarcReportSummary{} + var fernTestValueReporter *DmarcReportSummaryReporter // Act - obj.SetStatus(fernTestValueStatus) + obj.SetReporter(fernTestValueReporter) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -29918,14 +29691,14 @@ func TestSettersMarkExplicitDomain(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetCanSend_MarksExplicit", func(t *testing.T) { + t.Run("SetReportID_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &Domain{} - var fernTestValueCanSend bool + obj := &DmarcReportSummary{} + var fernTestValueReportID string // Act - obj.SetCanSend(fernTestValueCanSend) + obj.SetReportID(fernTestValueReportID) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -29949,14 +29722,14 @@ func TestSettersMarkExplicitDomain(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetRegion_MarksExplicit", func(t *testing.T) { + t.Run("SetPeriodStart_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &Domain{} - var fernTestValueRegion *string + obj := &DmarcReportSummary{} + var fernTestValuePeriodStart time.Time // Act - obj.SetRegion(fernTestValueRegion) + obj.SetPeriodStart(fernTestValuePeriodStart) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -29980,14 +29753,14 @@ func TestSettersMarkExplicitDomain(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetMailFromDomain_MarksExplicit", func(t *testing.T) { + t.Run("SetPeriodEnd_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &Domain{} - var fernTestValueMailFromDomain string + obj := &DmarcReportSummary{} + var fernTestValuePeriodEnd time.Time // Act - obj.SetMailFromDomain(fernTestValueMailFromDomain) + obj.SetPeriodEnd(fernTestValuePeriodEnd) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -30011,14 +29784,14 @@ func TestSettersMarkExplicitDomain(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetMailFromStatus_MarksExplicit", func(t *testing.T) { + t.Run("SetPolicyPublished_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &Domain{} - var fernTestValueMailFromStatus DomainMailFromStatus + obj := &DmarcReportSummary{} + var fernTestValuePolicyPublished *DmarcReportSummaryPolicyPublished // Act - obj.SetMailFromStatus(fernTestValueMailFromStatus) + obj.SetPolicyPublished(fernTestValuePolicyPublished) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -30042,14 +29815,14 @@ func TestSettersMarkExplicitDomain(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetRecords_MarksExplicit", func(t *testing.T) { + t.Run("SetMessages_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &Domain{} - var fernTestValueRecords []*DomainRecord + obj := &DmarcReportSummary{} + var fernTestValueMessages int64 // Act - obj.SetRecords(fernTestValueRecords) + obj.SetMessages(fernTestValueMessages) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -30073,14 +29846,14 @@ func TestSettersMarkExplicitDomain(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetCreatedAt_MarksExplicit", func(t *testing.T) { + t.Run("SetPassing_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &Domain{} - var fernTestValueCreatedAt time.Time + obj := &DmarcReportSummary{} + var fernTestValuePassing int64 // Act - obj.SetCreatedAt(fernTestValueCreatedAt) + obj.SetPassing(fernTestValuePassing) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -30104,14 +29877,14 @@ func TestSettersMarkExplicitDomain(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetLastCheckedAt_MarksExplicit", func(t *testing.T) { + t.Run("SetTruncated_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &Domain{} - var fernTestValueLastCheckedAt *time.Time + obj := &DmarcReportSummary{} + var fernTestValueTruncated bool // Act - obj.SetLastCheckedAt(fernTestValueLastCheckedAt) + obj.SetTruncated(fernTestValueTruncated) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -30135,14 +29908,14 @@ func TestSettersMarkExplicitDomain(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetVerifiedAt_MarksExplicit", func(t *testing.T) { + t.Run("SetReceivedAt_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &Domain{} - var fernTestValueVerifiedAt *time.Time + obj := &DmarcReportSummary{} + var fernTestValueReceivedAt time.Time // Act - obj.SetVerifiedAt(fernTestValueVerifiedAt) + obj.SetReceivedAt(fernTestValueReceivedAt) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -30166,476 +29939,341 @@ func TestSettersMarkExplicitDomain(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetFailedAt_MarksExplicit", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &Domain{} - var fernTestValueFailedAt *time.Time - - // Act - obj.SetFailedAt(fernTestValueFailedAt) +} - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") +func TestSettersDmarcReportSummaryPolicyPublished(t *testing.T) { + t.Run("SetDomain", func(t *testing.T) { + obj := &DmarcReportSummaryPolicyPublished{} + var fernTestValueDomain string + obj.SetDomain(fernTestValueDomain) + assert.Equal(t, fernTestValueDomain, obj.Domain) + assert.NotNil(t, obj.explicitFields) + }) - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } + t.Run("SetP", func(t *testing.T) { + obj := &DmarcReportSummaryPolicyPublished{} + var fernTestValueP *string + obj.SetP(fernTestValueP) + assert.Equal(t, fernTestValueP, obj.P) + assert.NotNil(t, obj.explicitFields) + }) - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip + t.Run("SetSp", func(t *testing.T) { + obj := &DmarcReportSummaryPolicyPublished{} + var fernTestValueSp *string + obj.SetSp(fernTestValueSp) + assert.Equal(t, fernTestValueSp, obj.Sp) + assert.NotNil(t, obj.explicitFields) }) - t.Run("SetTracking_MarksExplicit", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &Domain{} - var fernTestValueTracking *TrackingDomain + t.Run("SetNp", func(t *testing.T) { + obj := &DmarcReportSummaryPolicyPublished{} + var fernTestValueNp *string + obj.SetNp(fernTestValueNp) + assert.Equal(t, fernTestValueNp, obj.Np) + assert.NotNil(t, obj.explicitFields) + }) - // Act - obj.SetTracking(fernTestValueTracking) + t.Run("SetAdkim", func(t *testing.T) { + obj := &DmarcReportSummaryPolicyPublished{} + var fernTestValueAdkim *string + obj.SetAdkim(fernTestValueAdkim) + assert.Equal(t, fernTestValueAdkim, obj.Adkim) + assert.NotNil(t, obj.explicitFields) + }) - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") + t.Run("SetAspf", func(t *testing.T) { + obj := &DmarcReportSummaryPolicyPublished{} + var fernTestValueAspf *string + obj.SetAspf(fernTestValueAspf) + assert.Equal(t, fernTestValueAspf, obj.Aspf) + assert.NotNil(t, obj.explicitFields) + }) - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } + t.Run("SetPct", func(t *testing.T) { + obj := &DmarcReportSummaryPolicyPublished{} + var fernTestValuePct *int64 + obj.SetPct(fernTestValuePct) + assert.Equal(t, fernTestValuePct, obj.Pct) + assert.NotNil(t, obj.explicitFields) + }) - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip + t.Run("SetTesting", func(t *testing.T) { + obj := &DmarcReportSummaryPolicyPublished{} + var fernTestValueTesting *string + obj.SetTesting(fernTestValueTesting) + assert.Equal(t, fernTestValueTesting, obj.Testing) + assert.NotNil(t, obj.explicitFields) }) - t.Run("SetReceiving_MarksExplicit", func(t *testing.T) { +} + +func TestGettersDmarcReportSummaryPolicyPublished(t *testing.T) { + t.Run("GetDomain", func(t *testing.T) { t.Parallel() // Arrange - obj := &Domain{} - var fernTestValueReceiving *ReceivingDomain - - // Act - obj.SetReceiving(fernTestValueReceiving) - - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") + obj := &DmarcReportSummaryPolicyPublished{} + var expected string + obj.Domain = expected - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } + // Act & Assert + assert.Equal(t, expected, obj.GetDomain(), "getter should return the property value") + }) - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip + t.Run("GetDomain_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *DmarcReportSummaryPolicyPublished + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetDomain() // Should return zero value }) - t.Run("SetBimi_MarksExplicit", func(t *testing.T) { + t.Run("GetP", func(t *testing.T) { t.Parallel() // Arrange - obj := &Domain{} - var fernTestValueBimi *DomainBimi - - // Act - obj.SetBimi(fernTestValueBimi) - - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") - - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } + obj := &DmarcReportSummaryPolicyPublished{} + var expected *string + obj.P = expected - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip + // Act & Assert + assert.Equal(t, expected, obj.GetP(), "getter should return the property value") }) - t.Run("SetSubaccountID_MarksExplicit", func(t *testing.T) { + t.Run("GetP_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &Domain{} - var fernTestValueSubaccountID *string - - // Act - obj.SetSubaccountID(fernTestValueSubaccountID) - - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") - - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } - - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip - }) - - t.Run("SetSharedWithSubaccounts_MarksExplicit", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &Domain{} - var fernTestValueSharedWithSubaccounts bool - - // Act - obj.SetSharedWithSubaccounts(fernTestValueSharedWithSubaccounts) - - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") - - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } - - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip - }) - -} - -func TestSettersDomainBimi(t *testing.T) { - t.Run("SetStatus", func(t *testing.T) { - obj := &DomainBimi{} - var fernTestValueStatus DomainBimiStatus - obj.SetStatus(fernTestValueStatus) - assert.Equal(t, fernTestValueStatus, obj.Status) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetName", func(t *testing.T) { - obj := &DomainBimi{} - var fernTestValueName string - obj.SetName(fernTestValueName) - assert.Equal(t, fernTestValueName, obj.Name) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetRecord", func(t *testing.T) { - obj := &DomainBimi{} - var fernTestValueRecord *string - obj.SetRecord(fernTestValueRecord) - assert.Equal(t, fernTestValueRecord, obj.Record) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetLogoURL", func(t *testing.T) { - obj := &DomainBimi{} - var fernTestValueLogoURL *string - obj.SetLogoURL(fernTestValueLogoURL) - assert.Equal(t, fernTestValueLogoURL, obj.LogoURL) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetCertificateURL", func(t *testing.T) { - obj := &DomainBimi{} - var fernTestValueCertificateURL *string - obj.SetCertificateURL(fernTestValueCertificateURL) - assert.Equal(t, fernTestValueCertificateURL, obj.CertificateURL) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetDmarcPolicy", func(t *testing.T) { - obj := &DomainBimi{} - var fernTestValueDmarcPolicy *DomainBimiDmarcPolicy - obj.SetDmarcPolicy(fernTestValueDmarcPolicy) - assert.Equal(t, fernTestValueDmarcPolicy, obj.DmarcPolicy) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetIssues", func(t *testing.T) { - obj := &DomainBimi{} - var fernTestValueIssues []*DomainBimiIssuesItem - obj.SetIssues(fernTestValueIssues) - assert.Equal(t, fernTestValueIssues, obj.Issues) - assert.NotNil(t, obj.explicitFields) - }) - -} - -func TestGettersDomainBimi(t *testing.T) { - t.Run("GetStatus", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &DomainBimi{} - var expected DomainBimiStatus - obj.Status = expected + obj := &DmarcReportSummaryPolicyPublished{} + obj.P = nil // Act & Assert - assert.Equal(t, expected, obj.GetStatus(), "getter should return the property value") + assert.Nil(t, obj.GetP(), "getter should return nil when property is nil") }) - t.Run("GetStatus_NilReceiver", func(t *testing.T) { + t.Run("GetP_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DomainBimi + var obj *DmarcReportSummaryPolicyPublished // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetStatus() // Should return zero value + _ = obj.GetP() // Should return zero value }) - t.Run("GetName", func(t *testing.T) { + t.Run("GetSp", func(t *testing.T) { t.Parallel() // Arrange - obj := &DomainBimi{} - var expected string - obj.Name = expected + obj := &DmarcReportSummaryPolicyPublished{} + var expected *string + obj.Sp = expected // Act & Assert - assert.Equal(t, expected, obj.GetName(), "getter should return the property value") + assert.Equal(t, expected, obj.GetSp(), "getter should return the property value") }) - t.Run("GetName_NilReceiver", func(t *testing.T) { + t.Run("GetSp_NilValue", func(t *testing.T) { t.Parallel() - var obj *DomainBimi + // Arrange + obj := &DmarcReportSummaryPolicyPublished{} + obj.Sp = nil + + // Act & Assert + assert.Nil(t, obj.GetSp(), "getter should return nil when property is nil") + }) + + t.Run("GetSp_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *DmarcReportSummaryPolicyPublished // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetName() // Should return zero value + _ = obj.GetSp() // Should return zero value }) - t.Run("GetRecord", func(t *testing.T) { + t.Run("GetNp", func(t *testing.T) { t.Parallel() // Arrange - obj := &DomainBimi{} + obj := &DmarcReportSummaryPolicyPublished{} var expected *string - obj.Record = expected + obj.Np = expected // Act & Assert - assert.Equal(t, expected, obj.GetRecord(), "getter should return the property value") + assert.Equal(t, expected, obj.GetNp(), "getter should return the property value") }) - t.Run("GetRecord_NilValue", func(t *testing.T) { + t.Run("GetNp_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &DomainBimi{} - obj.Record = nil + obj := &DmarcReportSummaryPolicyPublished{} + obj.Np = nil // Act & Assert - assert.Nil(t, obj.GetRecord(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetNp(), "getter should return nil when property is nil") }) - t.Run("GetRecord_NilReceiver", func(t *testing.T) { + t.Run("GetNp_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DomainBimi + var obj *DmarcReportSummaryPolicyPublished // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetRecord() // Should return zero value + _ = obj.GetNp() // Should return zero value }) - t.Run("GetLogoURL", func(t *testing.T) { + t.Run("GetAdkim", func(t *testing.T) { t.Parallel() // Arrange - obj := &DomainBimi{} + obj := &DmarcReportSummaryPolicyPublished{} var expected *string - obj.LogoURL = expected + obj.Adkim = expected // Act & Assert - assert.Equal(t, expected, obj.GetLogoURL(), "getter should return the property value") + assert.Equal(t, expected, obj.GetAdkim(), "getter should return the property value") }) - t.Run("GetLogoURL_NilValue", func(t *testing.T) { + t.Run("GetAdkim_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &DomainBimi{} - obj.LogoURL = nil + obj := &DmarcReportSummaryPolicyPublished{} + obj.Adkim = nil // Act & Assert - assert.Nil(t, obj.GetLogoURL(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetAdkim(), "getter should return nil when property is nil") }) - t.Run("GetLogoURL_NilReceiver", func(t *testing.T) { + t.Run("GetAdkim_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DomainBimi + var obj *DmarcReportSummaryPolicyPublished // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetLogoURL() // Should return zero value + _ = obj.GetAdkim() // Should return zero value }) - t.Run("GetCertificateURL", func(t *testing.T) { + t.Run("GetAspf", func(t *testing.T) { t.Parallel() // Arrange - obj := &DomainBimi{} + obj := &DmarcReportSummaryPolicyPublished{} var expected *string - obj.CertificateURL = expected + obj.Aspf = expected // Act & Assert - assert.Equal(t, expected, obj.GetCertificateURL(), "getter should return the property value") + assert.Equal(t, expected, obj.GetAspf(), "getter should return the property value") }) - t.Run("GetCertificateURL_NilValue", func(t *testing.T) { + t.Run("GetAspf_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &DomainBimi{} - obj.CertificateURL = nil + obj := &DmarcReportSummaryPolicyPublished{} + obj.Aspf = nil // Act & Assert - assert.Nil(t, obj.GetCertificateURL(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetAspf(), "getter should return nil when property is nil") }) - t.Run("GetCertificateURL_NilReceiver", func(t *testing.T) { + t.Run("GetAspf_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DomainBimi + var obj *DmarcReportSummaryPolicyPublished // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetCertificateURL() // Should return zero value + _ = obj.GetAspf() // Should return zero value }) - t.Run("GetDmarcPolicy", func(t *testing.T) { + t.Run("GetPct", func(t *testing.T) { t.Parallel() // Arrange - obj := &DomainBimi{} - var expected *DomainBimiDmarcPolicy - obj.DmarcPolicy = expected + obj := &DmarcReportSummaryPolicyPublished{} + var expected *int64 + obj.Pct = expected // Act & Assert - assert.Equal(t, expected, obj.GetDmarcPolicy(), "getter should return the property value") + assert.Equal(t, expected, obj.GetPct(), "getter should return the property value") }) - t.Run("GetDmarcPolicy_NilValue", func(t *testing.T) { + t.Run("GetPct_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &DomainBimi{} - obj.DmarcPolicy = nil + obj := &DmarcReportSummaryPolicyPublished{} + obj.Pct = nil // Act & Assert - assert.Nil(t, obj.GetDmarcPolicy(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetPct(), "getter should return nil when property is nil") }) - t.Run("GetDmarcPolicy_NilReceiver", func(t *testing.T) { + t.Run("GetPct_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DomainBimi + var obj *DmarcReportSummaryPolicyPublished // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetDmarcPolicy() // Should return zero value + _ = obj.GetPct() // Should return zero value }) - t.Run("GetIssues", func(t *testing.T) { + t.Run("GetTesting", func(t *testing.T) { t.Parallel() // Arrange - obj := &DomainBimi{} - var expected []*DomainBimiIssuesItem - obj.Issues = expected + obj := &DmarcReportSummaryPolicyPublished{} + var expected *string + obj.Testing = expected // Act & Assert - assert.Equal(t, expected, obj.GetIssues(), "getter should return the property value") + assert.Equal(t, expected, obj.GetTesting(), "getter should return the property value") }) - t.Run("GetIssues_NilValue", func(t *testing.T) { + t.Run("GetTesting_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &DomainBimi{} - obj.Issues = nil + obj := &DmarcReportSummaryPolicyPublished{} + obj.Testing = nil // Act & Assert - assert.Nil(t, obj.GetIssues(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetTesting(), "getter should return nil when property is nil") }) - t.Run("GetIssues_NilReceiver", func(t *testing.T) { + t.Run("GetTesting_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DomainBimi + var obj *DmarcReportSummaryPolicyPublished // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetIssues() // Should return zero value + _ = obj.GetTesting() // Should return zero value }) } -func TestSettersMarkExplicitDomainBimi(t *testing.T) { - t.Run("SetStatus_MarksExplicit", func(t *testing.T) { +func TestSettersMarkExplicitDmarcReportSummaryPolicyPublished(t *testing.T) { + t.Run("SetDomain_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DomainBimi{} - var fernTestValueStatus DomainBimiStatus + obj := &DmarcReportSummaryPolicyPublished{} + var fernTestValueDomain string // Act - obj.SetStatus(fernTestValueStatus) + obj.SetDomain(fernTestValueDomain) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -30659,14 +30297,14 @@ func TestSettersMarkExplicitDomainBimi(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetName_MarksExplicit", func(t *testing.T) { + t.Run("SetP_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DomainBimi{} - var fernTestValueName string + obj := &DmarcReportSummaryPolicyPublished{} + var fernTestValueP *string // Act - obj.SetName(fernTestValueName) + obj.SetP(fernTestValueP) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -30690,14 +30328,14 @@ func TestSettersMarkExplicitDomainBimi(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetRecord_MarksExplicit", func(t *testing.T) { + t.Run("SetSp_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DomainBimi{} - var fernTestValueRecord *string + obj := &DmarcReportSummaryPolicyPublished{} + var fernTestValueSp *string // Act - obj.SetRecord(fernTestValueRecord) + obj.SetSp(fernTestValueSp) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -30721,14 +30359,14 @@ func TestSettersMarkExplicitDomainBimi(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetLogoURL_MarksExplicit", func(t *testing.T) { + t.Run("SetNp_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DomainBimi{} - var fernTestValueLogoURL *string + obj := &DmarcReportSummaryPolicyPublished{} + var fernTestValueNp *string // Act - obj.SetLogoURL(fernTestValueLogoURL) + obj.SetNp(fernTestValueNp) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -30752,14 +30390,14 @@ func TestSettersMarkExplicitDomainBimi(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetCertificateURL_MarksExplicit", func(t *testing.T) { + t.Run("SetAdkim_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DomainBimi{} - var fernTestValueCertificateURL *string + obj := &DmarcReportSummaryPolicyPublished{} + var fernTestValueAdkim *string // Act - obj.SetCertificateURL(fernTestValueCertificateURL) + obj.SetAdkim(fernTestValueAdkim) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -30783,14 +30421,14 @@ func TestSettersMarkExplicitDomainBimi(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetDmarcPolicy_MarksExplicit", func(t *testing.T) { + t.Run("SetAspf_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DomainBimi{} - var fernTestValueDmarcPolicy *DomainBimiDmarcPolicy + obj := &DmarcReportSummaryPolicyPublished{} + var fernTestValueAspf *string // Act - obj.SetDmarcPolicy(fernTestValueDmarcPolicy) + obj.SetAspf(fernTestValueAspf) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -30814,14 +30452,45 @@ func TestSettersMarkExplicitDomainBimi(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetIssues_MarksExplicit", func(t *testing.T) { + t.Run("SetPct_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DomainBimi{} - var fernTestValueIssues []*DomainBimiIssuesItem + obj := &DmarcReportSummaryPolicyPublished{} + var fernTestValuePct *int64 // Act - obj.SetIssues(fernTestValueIssues) + obj.SetPct(fernTestValuePct) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetTesting_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DmarcReportSummaryPolicyPublished{} + var fernTestValueTesting *string + + // Act + obj.SetTesting(fernTestValueTesting) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -30847,83 +30516,93 @@ func TestSettersMarkExplicitDomainBimi(t *testing.T) { } -func TestSettersDomainBimiIssuesItem(t *testing.T) { - t.Run("SetCode", func(t *testing.T) { - obj := &DomainBimiIssuesItem{} - var fernTestValueCode DomainBimiIssuesItemCode - obj.SetCode(fernTestValueCode) - assert.Equal(t, fernTestValueCode, obj.Code) +func TestSettersDmarcReportSummaryReporter(t *testing.T) { + t.Run("SetOrgName", func(t *testing.T) { + obj := &DmarcReportSummaryReporter{} + var fernTestValueOrgName string + obj.SetOrgName(fernTestValueOrgName) + assert.Equal(t, fernTestValueOrgName, obj.OrgName) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetMessage", func(t *testing.T) { - obj := &DomainBimiIssuesItem{} - var fernTestValueMessage string - obj.SetMessage(fernTestValueMessage) - assert.Equal(t, fernTestValueMessage, obj.Message) + t.Run("SetEmail", func(t *testing.T) { + obj := &DmarcReportSummaryReporter{} + var fernTestValueEmail *string + obj.SetEmail(fernTestValueEmail) + assert.Equal(t, fernTestValueEmail, obj.Email) assert.NotNil(t, obj.explicitFields) }) } -func TestGettersDomainBimiIssuesItem(t *testing.T) { - t.Run("GetCode", func(t *testing.T) { +func TestGettersDmarcReportSummaryReporter(t *testing.T) { + t.Run("GetOrgName", func(t *testing.T) { t.Parallel() // Arrange - obj := &DomainBimiIssuesItem{} - var expected DomainBimiIssuesItemCode - obj.Code = expected + obj := &DmarcReportSummaryReporter{} + var expected string + obj.OrgName = expected // Act & Assert - assert.Equal(t, expected, obj.GetCode(), "getter should return the property value") + assert.Equal(t, expected, obj.GetOrgName(), "getter should return the property value") }) - t.Run("GetCode_NilReceiver", func(t *testing.T) { + t.Run("GetOrgName_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DomainBimiIssuesItem + var obj *DmarcReportSummaryReporter // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetCode() // Should return zero value + _ = obj.GetOrgName() // Should return zero value }) - t.Run("GetMessage", func(t *testing.T) { + t.Run("GetEmail", func(t *testing.T) { t.Parallel() // Arrange - obj := &DomainBimiIssuesItem{} - var expected string - obj.Message = expected + obj := &DmarcReportSummaryReporter{} + var expected *string + obj.Email = expected // Act & Assert - assert.Equal(t, expected, obj.GetMessage(), "getter should return the property value") + assert.Equal(t, expected, obj.GetEmail(), "getter should return the property value") }) - t.Run("GetMessage_NilReceiver", func(t *testing.T) { + t.Run("GetEmail_NilValue", func(t *testing.T) { t.Parallel() - var obj *DomainBimiIssuesItem + // Arrange + obj := &DmarcReportSummaryReporter{} + obj.Email = nil + + // Act & Assert + assert.Nil(t, obj.GetEmail(), "getter should return nil when property is nil") + }) + + t.Run("GetEmail_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *DmarcReportSummaryReporter // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetMessage() // Should return zero value + _ = obj.GetEmail() // Should return zero value }) } -func TestSettersMarkExplicitDomainBimiIssuesItem(t *testing.T) { - t.Run("SetCode_MarksExplicit", func(t *testing.T) { +func TestSettersMarkExplicitDmarcReportSummaryReporter(t *testing.T) { + t.Run("SetOrgName_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DomainBimiIssuesItem{} - var fernTestValueCode DomainBimiIssuesItemCode + obj := &DmarcReportSummaryReporter{} + var fernTestValueOrgName string // Act - obj.SetCode(fernTestValueCode) + obj.SetOrgName(fernTestValueOrgName) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -30947,14 +30626,14 @@ func TestSettersMarkExplicitDomainBimiIssuesItem(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetMessage_MarksExplicit", func(t *testing.T) { + t.Run("SetEmail_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DomainBimiIssuesItem{} - var fernTestValueMessage string + obj := &DmarcReportSummaryReporter{} + var fernTestValueEmail *string // Act - obj.SetMessage(fernTestValueMessage) + obj.SetEmail(fernTestValueEmail) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -30980,576 +30659,176 @@ func TestSettersMarkExplicitDomainBimiIssuesItem(t *testing.T) { } -func TestSettersDomainDmarc(t *testing.T) { - t.Run("SetObject", func(t *testing.T) { - obj := &DomainDmarc{} - var fernTestValueObject DomainDmarcObject - obj.SetObject(fernTestValueObject) - assert.Equal(t, fernTestValueObject, obj.Object) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetDomainID", func(t *testing.T) { - obj := &DomainDmarc{} - var fernTestValueDomainID string - obj.SetDomainID(fernTestValueDomainID) - assert.Equal(t, fernTestValueDomainID, obj.DomainID) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetReportAddress", func(t *testing.T) { - obj := &DomainDmarc{} - var fernTestValueReportAddress *string - obj.SetReportAddress(fernTestValueReportAddress) - assert.Equal(t, fernTestValueReportAddress, obj.ReportAddress) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetRecord", func(t *testing.T) { - obj := &DomainDmarc{} - var fernTestValueRecord *DmarcPublishedRecord - obj.SetRecord(fernTestValueRecord) - assert.Equal(t, fernTestValueRecord, obj.Record) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetPolicy", func(t *testing.T) { - obj := &DomainDmarc{} - var fernTestValuePolicy *DomainDmarcPolicy - obj.SetPolicy(fernTestValuePolicy) - assert.Equal(t, fernTestValuePolicy, obj.Policy) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetInheritedFrom", func(t *testing.T) { - obj := &DomainDmarc{} - var fernTestValueInheritedFrom *string - obj.SetInheritedFrom(fernTestValueInheritedFrom) - assert.Equal(t, fernTestValueInheritedFrom, obj.InheritedFrom) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetPolicySince", func(t *testing.T) { - obj := &DomainDmarc{} - var fernTestValuePolicySince *time.Time - obj.SetPolicySince(fernTestValuePolicySince) - assert.Equal(t, fernTestValuePolicySince, obj.PolicySince) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetStage", func(t *testing.T) { - obj := &DomainDmarc{} - var fernTestValueStage DomainDmarcStage - obj.SetStage(fernTestValueStage) - assert.Equal(t, fernTestValueStage, obj.Stage) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetPartial", func(t *testing.T) { - obj := &DomainDmarc{} - var fernTestValuePartial bool - obj.SetPartial(fernTestValuePartial) - assert.Equal(t, fernTestValuePartial, obj.Partial) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetReporting", func(t *testing.T) { - obj := &DomainDmarc{} - var fernTestValueReporting bool - obj.SetReporting(fernTestValueReporting) - assert.Equal(t, fernTestValueReporting, obj.Reporting) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetReady", func(t *testing.T) { - obj := &DomainDmarc{} - var fernTestValueReady bool - obj.SetReady(fernTestValueReady) - assert.Equal(t, fernTestValueReady, obj.Ready) +func TestSettersDmarcSource(t *testing.T) { + t.Run("SetSourceIP", func(t *testing.T) { + obj := &DmarcSource{} + var fernTestValueSourceIP string + obj.SetSourceIP(fernTestValueSourceIP) + assert.Equal(t, fernTestValueSourceIP, obj.SourceIP) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetNext", func(t *testing.T) { - obj := &DomainDmarc{} - var fernTestValueNext *DomainDmarcNext - obj.SetNext(fernTestValueNext) - assert.Equal(t, fernTestValueNext, obj.Next) + t.Run("SetHeaderFrom", func(t *testing.T) { + obj := &DmarcSource{} + var fernTestValueHeaderFrom string + obj.SetHeaderFrom(fernTestValueHeaderFrom) + assert.Equal(t, fernTestValueHeaderFrom, obj.HeaderFrom) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetChecks", func(t *testing.T) { - obj := &DomainDmarc{} - var fernTestValueChecks []*DomainDmarcChecksItem - obj.SetChecks(fernTestValueChecks) - assert.Equal(t, fernTestValueChecks, obj.Checks) + t.Run("SetMessages", func(t *testing.T) { + obj := &DmarcSource{} + var fernTestValueMessages int64 + obj.SetMessages(fernTestValueMessages) + assert.Equal(t, fernTestValueMessages, obj.Messages) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetWarnings", func(t *testing.T) { - obj := &DomainDmarc{} - var fernTestValueWarnings []string - obj.SetWarnings(fernTestValueWarnings) - assert.Equal(t, fernTestValueWarnings, obj.Warnings) + t.Run("SetPassing", func(t *testing.T) { + obj := &DmarcSource{} + var fernTestValuePassing int64 + obj.SetPassing(fernTestValuePassing) + assert.Equal(t, fernTestValuePassing, obj.Passing) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetReportSummary", func(t *testing.T) { - obj := &DomainDmarc{} - var fernTestValueReportSummary *DomainDmarcReportSummary - obj.SetReportSummary(fernTestValueReportSummary) - assert.Equal(t, fernTestValueReportSummary, obj.ReportSummary) + t.Run("SetViaCoss", func(t *testing.T) { + obj := &DmarcSource{} + var fernTestValueViaCoss bool + obj.SetViaCoss(fernTestValueViaCoss) + assert.Equal(t, fernTestValueViaCoss, obj.ViaCoss) assert.NotNil(t, obj.explicitFields) }) } -func TestGettersDomainDmarc(t *testing.T) { - t.Run("GetObject", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &DomainDmarc{} - var expected DomainDmarcObject - obj.Object = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetObject(), "getter should return the property value") - }) - - t.Run("GetObject_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *DomainDmarc - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetObject() // Should return zero value - }) - - t.Run("GetDomainID", func(t *testing.T) { +func TestGettersDmarcSource(t *testing.T) { + t.Run("GetSourceIP", func(t *testing.T) { t.Parallel() // Arrange - obj := &DomainDmarc{} + obj := &DmarcSource{} var expected string - obj.DomainID = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetDomainID(), "getter should return the property value") - }) - - t.Run("GetDomainID_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *DomainDmarc - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetDomainID() // Should return zero value - }) - - t.Run("GetReportAddress", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &DomainDmarc{} - var expected *string - obj.ReportAddress = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetReportAddress(), "getter should return the property value") - }) - - t.Run("GetReportAddress_NilValue", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &DomainDmarc{} - obj.ReportAddress = nil - - // Act & Assert - assert.Nil(t, obj.GetReportAddress(), "getter should return nil when property is nil") - }) - - t.Run("GetReportAddress_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *DomainDmarc - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetReportAddress() // Should return zero value - }) - - t.Run("GetRecord", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &DomainDmarc{} - var expected *DmarcPublishedRecord - obj.Record = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetRecord(), "getter should return the property value") - }) - - t.Run("GetRecord_NilValue", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &DomainDmarc{} - obj.Record = nil - - // Act & Assert - assert.Nil(t, obj.GetRecord(), "getter should return nil when property is nil") - }) - - t.Run("GetRecord_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *DomainDmarc - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetRecord() // Should return zero value - }) - - t.Run("GetPolicy", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &DomainDmarc{} - var expected *DomainDmarcPolicy - obj.Policy = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetPolicy(), "getter should return the property value") - }) - - t.Run("GetPolicy_NilValue", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &DomainDmarc{} - obj.Policy = nil - - // Act & Assert - assert.Nil(t, obj.GetPolicy(), "getter should return nil when property is nil") - }) - - t.Run("GetPolicy_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *DomainDmarc - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetPolicy() // Should return zero value - }) - - t.Run("GetInheritedFrom", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &DomainDmarc{} - var expected *string - obj.InheritedFrom = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetInheritedFrom(), "getter should return the property value") - }) - - t.Run("GetInheritedFrom_NilValue", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &DomainDmarc{} - obj.InheritedFrom = nil - - // Act & Assert - assert.Nil(t, obj.GetInheritedFrom(), "getter should return nil when property is nil") - }) - - t.Run("GetInheritedFrom_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *DomainDmarc - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetInheritedFrom() // Should return zero value - }) - - t.Run("GetPolicySince", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &DomainDmarc{} - var expected *time.Time - obj.PolicySince = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetPolicySince(), "getter should return the property value") - }) - - t.Run("GetPolicySince_NilValue", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &DomainDmarc{} - obj.PolicySince = nil + obj.SourceIP = expected // Act & Assert - assert.Nil(t, obj.GetPolicySince(), "getter should return nil when property is nil") + assert.Equal(t, expected, obj.GetSourceIP(), "getter should return the property value") }) - t.Run("GetPolicySince_NilReceiver", func(t *testing.T) { + t.Run("GetSourceIP_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DomainDmarc + var obj *DmarcSource // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetPolicySince() // Should return zero value + _ = obj.GetSourceIP() // Should return zero value }) - t.Run("GetStage", func(t *testing.T) { + t.Run("GetHeaderFrom", func(t *testing.T) { t.Parallel() // Arrange - obj := &DomainDmarc{} - var expected DomainDmarcStage - obj.Stage = expected + obj := &DmarcSource{} + var expected string + obj.HeaderFrom = expected // Act & Assert - assert.Equal(t, expected, obj.GetStage(), "getter should return the property value") + assert.Equal(t, expected, obj.GetHeaderFrom(), "getter should return the property value") }) - t.Run("GetStage_NilReceiver", func(t *testing.T) { + t.Run("GetHeaderFrom_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DomainDmarc + var obj *DmarcSource // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetStage() // Should return zero value + _ = obj.GetHeaderFrom() // Should return zero value }) - t.Run("GetPartial", func(t *testing.T) { + t.Run("GetMessages", func(t *testing.T) { t.Parallel() // Arrange - obj := &DomainDmarc{} - var expected bool - obj.Partial = expected + obj := &DmarcSource{} + var expected int64 + obj.Messages = expected // Act & Assert - assert.Equal(t, expected, obj.GetPartial(), "getter should return the property value") + assert.Equal(t, expected, obj.GetMessages(), "getter should return the property value") }) - t.Run("GetPartial_NilReceiver", func(t *testing.T) { + t.Run("GetMessages_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DomainDmarc + var obj *DmarcSource // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetPartial() // Should return zero value + _ = obj.GetMessages() // Should return zero value }) - t.Run("GetReporting", func(t *testing.T) { + t.Run("GetPassing", func(t *testing.T) { t.Parallel() // Arrange - obj := &DomainDmarc{} - var expected bool - obj.Reporting = expected + obj := &DmarcSource{} + var expected int64 + obj.Passing = expected // Act & Assert - assert.Equal(t, expected, obj.GetReporting(), "getter should return the property value") + assert.Equal(t, expected, obj.GetPassing(), "getter should return the property value") }) - t.Run("GetReporting_NilReceiver", func(t *testing.T) { + t.Run("GetPassing_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DomainDmarc + var obj *DmarcSource // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetReporting() // Should return zero value + _ = obj.GetPassing() // Should return zero value }) - t.Run("GetReady", func(t *testing.T) { + t.Run("GetViaCoss", func(t *testing.T) { t.Parallel() // Arrange - obj := &DomainDmarc{} + obj := &DmarcSource{} var expected bool - obj.Ready = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetReady(), "getter should return the property value") - }) - - t.Run("GetReady_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *DomainDmarc - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetReady() // Should return zero value - }) - - t.Run("GetNext", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &DomainDmarc{} - var expected *DomainDmarcNext - obj.Next = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetNext(), "getter should return the property value") - }) - - t.Run("GetNext_NilValue", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &DomainDmarc{} - obj.Next = nil - - // Act & Assert - assert.Nil(t, obj.GetNext(), "getter should return nil when property is nil") - }) - - t.Run("GetNext_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *DomainDmarc - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetNext() // Should return zero value - }) - - t.Run("GetChecks", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &DomainDmarc{} - var expected []*DomainDmarcChecksItem - obj.Checks = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetChecks(), "getter should return the property value") - }) - - t.Run("GetChecks_NilValue", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &DomainDmarc{} - obj.Checks = nil - - // Act & Assert - assert.Nil(t, obj.GetChecks(), "getter should return nil when property is nil") - }) - - t.Run("GetChecks_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *DomainDmarc - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetChecks() // Should return zero value - }) - - t.Run("GetWarnings", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &DomainDmarc{} - var expected []string - obj.Warnings = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetWarnings(), "getter should return the property value") - }) - - t.Run("GetWarnings_NilValue", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &DomainDmarc{} - obj.Warnings = nil - - // Act & Assert - assert.Nil(t, obj.GetWarnings(), "getter should return nil when property is nil") - }) - - t.Run("GetWarnings_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *DomainDmarc - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetWarnings() // Should return zero value - }) - - t.Run("GetReportSummary", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &DomainDmarc{} - var expected *DomainDmarcReportSummary - obj.ReportSummary = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetReportSummary(), "getter should return the property value") - }) - - t.Run("GetReportSummary_NilValue", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &DomainDmarc{} - obj.ReportSummary = nil + obj.ViaCoss = expected // Act & Assert - assert.Nil(t, obj.GetReportSummary(), "getter should return nil when property is nil") + assert.Equal(t, expected, obj.GetViaCoss(), "getter should return the property value") }) - t.Run("GetReportSummary_NilReceiver", func(t *testing.T) { + t.Run("GetViaCoss_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DomainDmarc + var obj *DmarcSource // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetReportSummary() // Should return zero value + _ = obj.GetViaCoss() // Should return zero value }) } -func TestSettersMarkExplicitDomainDmarc(t *testing.T) { - t.Run("SetObject_MarksExplicit", func(t *testing.T) { +func TestSettersMarkExplicitDmarcSource(t *testing.T) { + t.Run("SetSourceIP_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DomainDmarc{} - var fernTestValueObject DomainDmarcObject + obj := &DmarcSource{} + var fernTestValueSourceIP string // Act - obj.SetObject(fernTestValueObject) + obj.SetSourceIP(fernTestValueSourceIP) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -31573,14 +30852,14 @@ func TestSettersMarkExplicitDomainDmarc(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetDomainID_MarksExplicit", func(t *testing.T) { + t.Run("SetHeaderFrom_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DomainDmarc{} - var fernTestValueDomainID string + obj := &DmarcSource{} + var fernTestValueHeaderFrom string // Act - obj.SetDomainID(fernTestValueDomainID) + obj.SetHeaderFrom(fernTestValueHeaderFrom) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -31604,14 +30883,14 @@ func TestSettersMarkExplicitDomainDmarc(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetReportAddress_MarksExplicit", func(t *testing.T) { + t.Run("SetMessages_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DomainDmarc{} - var fernTestValueReportAddress *string + obj := &DmarcSource{} + var fernTestValueMessages int64 // Act - obj.SetReportAddress(fernTestValueReportAddress) + obj.SetMessages(fernTestValueMessages) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -31635,14 +30914,14 @@ func TestSettersMarkExplicitDomainDmarc(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetRecord_MarksExplicit", func(t *testing.T) { + t.Run("SetPassing_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DomainDmarc{} - var fernTestValueRecord *DmarcPublishedRecord + obj := &DmarcSource{} + var fernTestValuePassing int64 // Act - obj.SetRecord(fernTestValueRecord) + obj.SetPassing(fernTestValuePassing) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -31666,14 +30945,14 @@ func TestSettersMarkExplicitDomainDmarc(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetPolicy_MarksExplicit", func(t *testing.T) { + t.Run("SetViaCoss_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DomainDmarc{} - var fernTestValuePolicy *DomainDmarcPolicy + obj := &DmarcSource{} + var fernTestValueViaCoss bool // Act - obj.SetPolicy(fernTestValuePolicy) + obj.SetViaCoss(fernTestValueViaCoss) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -31697,16 +30976,673 @@ func TestSettersMarkExplicitDomainDmarc(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetInheritedFrom_MarksExplicit", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &DomainDmarc{} - var fernTestValueInheritedFrom *string - - // Act - obj.SetInheritedFrom(fernTestValueInheritedFrom) +} - // Assert - object with explicitly set field can be marshaled/unmarshaled +func TestSettersDomain(t *testing.T) { + t.Run("SetObject", func(t *testing.T) { + obj := &Domain{} + var fernTestValueObject DomainObject + obj.SetObject(fernTestValueObject) + assert.Equal(t, fernTestValueObject, obj.Object) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetID", func(t *testing.T) { + obj := &Domain{} + var fernTestValueID string + obj.SetID(fernTestValueID) + assert.Equal(t, fernTestValueID, obj.ID) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetName", func(t *testing.T) { + obj := &Domain{} + var fernTestValueName string + obj.SetName(fernTestValueName) + assert.Equal(t, fernTestValueName, obj.Name) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetStatus", func(t *testing.T) { + obj := &Domain{} + var fernTestValueStatus DomainStatus + obj.SetStatus(fernTestValueStatus) + assert.Equal(t, fernTestValueStatus, obj.Status) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetCanSend", func(t *testing.T) { + obj := &Domain{} + var fernTestValueCanSend bool + obj.SetCanSend(fernTestValueCanSend) + assert.Equal(t, fernTestValueCanSend, obj.CanSend) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetRegion", func(t *testing.T) { + obj := &Domain{} + var fernTestValueRegion *string + obj.SetRegion(fernTestValueRegion) + assert.Equal(t, fernTestValueRegion, obj.Region) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetMailFromDomain", func(t *testing.T) { + obj := &Domain{} + var fernTestValueMailFromDomain string + obj.SetMailFromDomain(fernTestValueMailFromDomain) + assert.Equal(t, fernTestValueMailFromDomain, obj.MailFromDomain) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetMailFromStatus", func(t *testing.T) { + obj := &Domain{} + var fernTestValueMailFromStatus DomainMailFromStatus + obj.SetMailFromStatus(fernTestValueMailFromStatus) + assert.Equal(t, fernTestValueMailFromStatus, obj.MailFromStatus) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetRecords", func(t *testing.T) { + obj := &Domain{} + var fernTestValueRecords []*DomainRecord + obj.SetRecords(fernTestValueRecords) + assert.Equal(t, fernTestValueRecords, obj.Records) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetCreatedAt", func(t *testing.T) { + obj := &Domain{} + var fernTestValueCreatedAt time.Time + obj.SetCreatedAt(fernTestValueCreatedAt) + assert.Equal(t, fernTestValueCreatedAt, obj.CreatedAt) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetLastCheckedAt", func(t *testing.T) { + obj := &Domain{} + var fernTestValueLastCheckedAt *time.Time + obj.SetLastCheckedAt(fernTestValueLastCheckedAt) + assert.Equal(t, fernTestValueLastCheckedAt, obj.LastCheckedAt) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetVerifiedAt", func(t *testing.T) { + obj := &Domain{} + var fernTestValueVerifiedAt *time.Time + obj.SetVerifiedAt(fernTestValueVerifiedAt) + assert.Equal(t, fernTestValueVerifiedAt, obj.VerifiedAt) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetFailedAt", func(t *testing.T) { + obj := &Domain{} + var fernTestValueFailedAt *time.Time + obj.SetFailedAt(fernTestValueFailedAt) + assert.Equal(t, fernTestValueFailedAt, obj.FailedAt) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetTracking", func(t *testing.T) { + obj := &Domain{} + var fernTestValueTracking *TrackingDomain + obj.SetTracking(fernTestValueTracking) + assert.Equal(t, fernTestValueTracking, obj.Tracking) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetReceiving", func(t *testing.T) { + obj := &Domain{} + var fernTestValueReceiving *ReceivingDomain + obj.SetReceiving(fernTestValueReceiving) + assert.Equal(t, fernTestValueReceiving, obj.Receiving) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetBimi", func(t *testing.T) { + obj := &Domain{} + var fernTestValueBimi *DomainBimi + obj.SetBimi(fernTestValueBimi) + assert.Equal(t, fernTestValueBimi, obj.Bimi) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetSubaccountID", func(t *testing.T) { + obj := &Domain{} + var fernTestValueSubaccountID *string + obj.SetSubaccountID(fernTestValueSubaccountID) + assert.Equal(t, fernTestValueSubaccountID, obj.SubaccountID) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetSharedWithSubaccounts", func(t *testing.T) { + obj := &Domain{} + var fernTestValueSharedWithSubaccounts bool + obj.SetSharedWithSubaccounts(fernTestValueSharedWithSubaccounts) + assert.Equal(t, fernTestValueSharedWithSubaccounts, obj.SharedWithSubaccounts) + assert.NotNil(t, obj.explicitFields) + }) + +} + +func TestGettersDomain(t *testing.T) { + t.Run("GetObject", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &Domain{} + var expected DomainObject + obj.Object = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetObject(), "getter should return the property value") + }) + + t.Run("GetObject_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *Domain + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetObject() // Should return zero value + }) + + t.Run("GetID", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &Domain{} + var expected string + obj.ID = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetID(), "getter should return the property value") + }) + + t.Run("GetID_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *Domain + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetID() // Should return zero value + }) + + t.Run("GetName", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &Domain{} + var expected string + obj.Name = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetName(), "getter should return the property value") + }) + + t.Run("GetName_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *Domain + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetName() // Should return zero value + }) + + t.Run("GetStatus", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &Domain{} + var expected DomainStatus + obj.Status = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetStatus(), "getter should return the property value") + }) + + t.Run("GetStatus_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *Domain + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetStatus() // Should return zero value + }) + + t.Run("GetCanSend", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &Domain{} + var expected bool + obj.CanSend = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetCanSend(), "getter should return the property value") + }) + + t.Run("GetCanSend_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *Domain + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetCanSend() // Should return zero value + }) + + t.Run("GetRegion", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &Domain{} + var expected *string + obj.Region = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetRegion(), "getter should return the property value") + }) + + t.Run("GetRegion_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &Domain{} + obj.Region = nil + + // Act & Assert + assert.Nil(t, obj.GetRegion(), "getter should return nil when property is nil") + }) + + t.Run("GetRegion_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *Domain + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetRegion() // Should return zero value + }) + + t.Run("GetMailFromDomain", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &Domain{} + var expected string + obj.MailFromDomain = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetMailFromDomain(), "getter should return the property value") + }) + + t.Run("GetMailFromDomain_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *Domain + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetMailFromDomain() // Should return zero value + }) + + t.Run("GetMailFromStatus", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &Domain{} + var expected DomainMailFromStatus + obj.MailFromStatus = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetMailFromStatus(), "getter should return the property value") + }) + + t.Run("GetMailFromStatus_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *Domain + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetMailFromStatus() // Should return zero value + }) + + t.Run("GetRecords", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &Domain{} + var expected []*DomainRecord + obj.Records = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetRecords(), "getter should return the property value") + }) + + t.Run("GetRecords_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &Domain{} + obj.Records = nil + + // Act & Assert + assert.Nil(t, obj.GetRecords(), "getter should return nil when property is nil") + }) + + t.Run("GetRecords_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *Domain + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetRecords() // Should return zero value + }) + + t.Run("GetCreatedAt", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &Domain{} + var expected time.Time + obj.CreatedAt = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetCreatedAt(), "getter should return the property value") + }) + + t.Run("GetCreatedAt_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *Domain + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetCreatedAt() // Should return zero value + }) + + t.Run("GetLastCheckedAt", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &Domain{} + var expected *time.Time + obj.LastCheckedAt = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetLastCheckedAt(), "getter should return the property value") + }) + + t.Run("GetLastCheckedAt_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &Domain{} + obj.LastCheckedAt = nil + + // Act & Assert + assert.Nil(t, obj.GetLastCheckedAt(), "getter should return nil when property is nil") + }) + + t.Run("GetLastCheckedAt_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *Domain + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetLastCheckedAt() // Should return zero value + }) + + t.Run("GetVerifiedAt", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &Domain{} + var expected *time.Time + obj.VerifiedAt = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetVerifiedAt(), "getter should return the property value") + }) + + t.Run("GetVerifiedAt_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &Domain{} + obj.VerifiedAt = nil + + // Act & Assert + assert.Nil(t, obj.GetVerifiedAt(), "getter should return nil when property is nil") + }) + + t.Run("GetVerifiedAt_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *Domain + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetVerifiedAt() // Should return zero value + }) + + t.Run("GetFailedAt", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &Domain{} + var expected *time.Time + obj.FailedAt = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetFailedAt(), "getter should return the property value") + }) + + t.Run("GetFailedAt_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &Domain{} + obj.FailedAt = nil + + // Act & Assert + assert.Nil(t, obj.GetFailedAt(), "getter should return nil when property is nil") + }) + + t.Run("GetFailedAt_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *Domain + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetFailedAt() // Should return zero value + }) + + t.Run("GetTracking", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &Domain{} + var expected *TrackingDomain + obj.Tracking = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetTracking(), "getter should return the property value") + }) + + t.Run("GetTracking_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &Domain{} + obj.Tracking = nil + + // Act & Assert + assert.Nil(t, obj.GetTracking(), "getter should return nil when property is nil") + }) + + t.Run("GetTracking_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *Domain + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetTracking() // Should return zero value + }) + + t.Run("GetReceiving", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &Domain{} + var expected *ReceivingDomain + obj.Receiving = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetReceiving(), "getter should return the property value") + }) + + t.Run("GetReceiving_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &Domain{} + obj.Receiving = nil + + // Act & Assert + assert.Nil(t, obj.GetReceiving(), "getter should return nil when property is nil") + }) + + t.Run("GetReceiving_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *Domain + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetReceiving() // Should return zero value + }) + + t.Run("GetBimi", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &Domain{} + var expected *DomainBimi + obj.Bimi = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetBimi(), "getter should return the property value") + }) + + t.Run("GetBimi_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &Domain{} + obj.Bimi = nil + + // Act & Assert + assert.Nil(t, obj.GetBimi(), "getter should return nil when property is nil") + }) + + t.Run("GetBimi_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *Domain + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetBimi() // Should return zero value + }) + + t.Run("GetSubaccountID", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &Domain{} + var expected *string + obj.SubaccountID = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetSubaccountID(), "getter should return the property value") + }) + + t.Run("GetSubaccountID_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &Domain{} + obj.SubaccountID = nil + + // Act & Assert + assert.Nil(t, obj.GetSubaccountID(), "getter should return nil when property is nil") + }) + + t.Run("GetSubaccountID_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *Domain + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetSubaccountID() // Should return zero value + }) + + t.Run("GetSharedWithSubaccounts", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &Domain{} + var expected bool + obj.SharedWithSubaccounts = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetSharedWithSubaccounts(), "getter should return the property value") + }) + + t.Run("GetSharedWithSubaccounts_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *Domain + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetSharedWithSubaccounts() // Should return zero value + }) + +} + +func TestSettersMarkExplicitDomain(t *testing.T) { + t.Run("SetObject_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &Domain{} + var fernTestValueObject DomainObject + + // Act + obj.SetObject(fernTestValueObject) + + // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) require.NoError(t, err, "marshaling should succeed for test setup") @@ -31728,14 +31664,14 @@ func TestSettersMarkExplicitDomainDmarc(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetPolicySince_MarksExplicit", func(t *testing.T) { + t.Run("SetID_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DomainDmarc{} - var fernTestValuePolicySince *time.Time + obj := &Domain{} + var fernTestValueID string // Act - obj.SetPolicySince(fernTestValuePolicySince) + obj.SetID(fernTestValueID) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -31759,14 +31695,14 @@ func TestSettersMarkExplicitDomainDmarc(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetStage_MarksExplicit", func(t *testing.T) { + t.Run("SetName_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DomainDmarc{} - var fernTestValueStage DomainDmarcStage + obj := &Domain{} + var fernTestValueName string // Act - obj.SetStage(fernTestValueStage) + obj.SetName(fernTestValueName) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -31790,14 +31726,14 @@ func TestSettersMarkExplicitDomainDmarc(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetPartial_MarksExplicit", func(t *testing.T) { + t.Run("SetStatus_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DomainDmarc{} - var fernTestValuePartial bool + obj := &Domain{} + var fernTestValueStatus DomainStatus // Act - obj.SetPartial(fernTestValuePartial) + obj.SetStatus(fernTestValueStatus) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -31821,14 +31757,14 @@ func TestSettersMarkExplicitDomainDmarc(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetReporting_MarksExplicit", func(t *testing.T) { + t.Run("SetCanSend_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DomainDmarc{} - var fernTestValueReporting bool + obj := &Domain{} + var fernTestValueCanSend bool // Act - obj.SetReporting(fernTestValueReporting) + obj.SetCanSend(fernTestValueCanSend) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -31852,14 +31788,14 @@ func TestSettersMarkExplicitDomainDmarc(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetReady_MarksExplicit", func(t *testing.T) { + t.Run("SetRegion_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DomainDmarc{} - var fernTestValueReady bool + obj := &Domain{} + var fernTestValueRegion *string // Act - obj.SetReady(fernTestValueReady) + obj.SetRegion(fernTestValueRegion) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -31883,14 +31819,14 @@ func TestSettersMarkExplicitDomainDmarc(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetNext_MarksExplicit", func(t *testing.T) { + t.Run("SetMailFromDomain_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DomainDmarc{} - var fernTestValueNext *DomainDmarcNext + obj := &Domain{} + var fernTestValueMailFromDomain string // Act - obj.SetNext(fernTestValueNext) + obj.SetMailFromDomain(fernTestValueMailFromDomain) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -31914,14 +31850,14 @@ func TestSettersMarkExplicitDomainDmarc(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetChecks_MarksExplicit", func(t *testing.T) { + t.Run("SetMailFromStatus_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DomainDmarc{} - var fernTestValueChecks []*DomainDmarcChecksItem + obj := &Domain{} + var fernTestValueMailFromStatus DomainMailFromStatus // Act - obj.SetChecks(fernTestValueChecks) + obj.SetMailFromStatus(fernTestValueMailFromStatus) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -31945,14 +31881,14 @@ func TestSettersMarkExplicitDomainDmarc(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetWarnings_MarksExplicit", func(t *testing.T) { + t.Run("SetRecords_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DomainDmarc{} - var fernTestValueWarnings []string + obj := &Domain{} + var fernTestValueRecords []*DomainRecord // Act - obj.SetWarnings(fernTestValueWarnings) + obj.SetRecords(fernTestValueRecords) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -31976,14 +31912,14 @@ func TestSettersMarkExplicitDomainDmarc(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetReportSummary_MarksExplicit", func(t *testing.T) { + t.Run("SetCreatedAt_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DomainDmarc{} - var fernTestValueReportSummary *DomainDmarcReportSummary + obj := &Domain{} + var fernTestValueCreatedAt time.Time // Act - obj.SetReportSummary(fernTestValueReportSummary) + obj.SetCreatedAt(fernTestValueCreatedAt) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -32007,116 +31943,45 @@ func TestSettersMarkExplicitDomainDmarc(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) -} - -func TestSettersDomainDmarcChecksItem(t *testing.T) { - t.Run("SetID", func(t *testing.T) { - obj := &DomainDmarcChecksItem{} - var fernTestValueID DomainDmarcChecksItemID - obj.SetID(fernTestValueID) - assert.Equal(t, fernTestValueID, obj.ID) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetOk", func(t *testing.T) { - obj := &DomainDmarcChecksItem{} - var fernTestValueOk bool - obj.SetOk(fernTestValueOk) - assert.Equal(t, fernTestValueOk, obj.Ok) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetMessage", func(t *testing.T) { - obj := &DomainDmarcChecksItem{} - var fernTestValueMessage string - obj.SetMessage(fernTestValueMessage) - assert.Equal(t, fernTestValueMessage, obj.Message) - assert.NotNil(t, obj.explicitFields) - }) - -} - -func TestGettersDomainDmarcChecksItem(t *testing.T) { - t.Run("GetID", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &DomainDmarcChecksItem{} - var expected DomainDmarcChecksItemID - obj.ID = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetID(), "getter should return the property value") - }) - - t.Run("GetID_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *DomainDmarcChecksItem - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetID() // Should return zero value - }) - - t.Run("GetOk", func(t *testing.T) { + t.Run("SetLastCheckedAt_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DomainDmarcChecksItem{} - var expected bool - obj.Ok = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetOk(), "getter should return the property value") - }) + obj := &Domain{} + var fernTestValueLastCheckedAt *time.Time - t.Run("GetOk_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *DomainDmarcChecksItem - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetOk() // Should return zero value - }) + // Act + obj.SetLastCheckedAt(fernTestValueLastCheckedAt) - t.Run("GetMessage", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &DomainDmarcChecksItem{} - var expected string - obj.Message = expected + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") - // Act & Assert - assert.Equal(t, expected, obj.GetMessage(), "getter should return the property value") - }) + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } - t.Run("GetMessage_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *DomainDmarcChecksItem - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetMessage() // Should return zero value + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip }) -} - -func TestSettersMarkExplicitDomainDmarcChecksItem(t *testing.T) { - t.Run("SetID_MarksExplicit", func(t *testing.T) { + t.Run("SetVerifiedAt_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DomainDmarcChecksItem{} - var fernTestValueID DomainDmarcChecksItemID + obj := &Domain{} + var fernTestValueVerifiedAt *time.Time // Act - obj.SetID(fernTestValueID) + obj.SetVerifiedAt(fernTestValueVerifiedAt) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -32140,14 +32005,14 @@ func TestSettersMarkExplicitDomainDmarcChecksItem(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetOk_MarksExplicit", func(t *testing.T) { + t.Run("SetFailedAt_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DomainDmarcChecksItem{} - var fernTestValueOk bool + obj := &Domain{} + var fernTestValueFailedAt *time.Time // Act - obj.SetOk(fernTestValueOk) + obj.SetFailedAt(fernTestValueFailedAt) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -32171,14 +32036,14 @@ func TestSettersMarkExplicitDomainDmarcChecksItem(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetMessage_MarksExplicit", func(t *testing.T) { + t.Run("SetTracking_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DomainDmarcChecksItem{} - var fernTestValueMessage string + obj := &Domain{} + var fernTestValueTracking *TrackingDomain // Act - obj.SetMessage(fernTestValueMessage) + obj.SetTracking(fernTestValueTracking) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -32202,116 +32067,45 @@ func TestSettersMarkExplicitDomainDmarcChecksItem(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) -} - -func TestSettersDomainDmarcNext(t *testing.T) { - t.Run("SetKind", func(t *testing.T) { - obj := &DomainDmarcNext{} - var fernTestValueKind DomainDmarcNextKind - obj.SetKind(fernTestValueKind) - assert.Equal(t, fernTestValueKind, obj.Kind) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetPolicy", func(t *testing.T) { - obj := &DomainDmarcNext{} - var fernTestValuePolicy DomainDmarcNextPolicy - obj.SetPolicy(fernTestValuePolicy) - assert.Equal(t, fernTestValuePolicy, obj.Policy) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetRecord", func(t *testing.T) { - obj := &DomainDmarcNext{} - var fernTestValueRecord string - obj.SetRecord(fernTestValueRecord) - assert.Equal(t, fernTestValueRecord, obj.Record) - assert.NotNil(t, obj.explicitFields) - }) - -} - -func TestGettersDomainDmarcNext(t *testing.T) { - t.Run("GetKind", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &DomainDmarcNext{} - var expected DomainDmarcNextKind - obj.Kind = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetKind(), "getter should return the property value") - }) - - t.Run("GetKind_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *DomainDmarcNext - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetKind() // Should return zero value - }) - - t.Run("GetPolicy", func(t *testing.T) { + t.Run("SetReceiving_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DomainDmarcNext{} - var expected DomainDmarcNextPolicy - obj.Policy = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetPolicy(), "getter should return the property value") - }) + obj := &Domain{} + var fernTestValueReceiving *ReceivingDomain - t.Run("GetPolicy_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *DomainDmarcNext - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetPolicy() // Should return zero value - }) + // Act + obj.SetReceiving(fernTestValueReceiving) - t.Run("GetRecord", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &DomainDmarcNext{} - var expected string - obj.Record = expected + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") - // Act & Assert - assert.Equal(t, expected, obj.GetRecord(), "getter should return the property value") - }) + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } - t.Run("GetRecord_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *DomainDmarcNext - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetRecord() // Should return zero value + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip }) -} - -func TestSettersMarkExplicitDomainDmarcNext(t *testing.T) { - t.Run("SetKind_MarksExplicit", func(t *testing.T) { + t.Run("SetBimi_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DomainDmarcNext{} - var fernTestValueKind DomainDmarcNextKind + obj := &Domain{} + var fernTestValueBimi *DomainBimi // Act - obj.SetKind(fernTestValueKind) + obj.SetBimi(fernTestValueBimi) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -32335,14 +32129,14 @@ func TestSettersMarkExplicitDomainDmarcNext(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetPolicy_MarksExplicit", func(t *testing.T) { + t.Run("SetSubaccountID_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DomainDmarcNext{} - var fernTestValuePolicy DomainDmarcNextPolicy + obj := &Domain{} + var fernTestValueSubaccountID *string // Act - obj.SetPolicy(fernTestValuePolicy) + obj.SetSubaccountID(fernTestValueSubaccountID) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -32366,14 +32160,14 @@ func TestSettersMarkExplicitDomainDmarcNext(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetRecord_MarksExplicit", func(t *testing.T) { + t.Run("SetSharedWithSubaccounts_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DomainDmarcNext{} - var fernTestValueRecord string + obj := &Domain{} + var fernTestValueSharedWithSubaccounts bool // Act - obj.SetRecord(fernTestValueRecord) + obj.SetSharedWithSubaccounts(fernTestValueSharedWithSubaccounts) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -32399,361 +32193,288 @@ func TestSettersMarkExplicitDomainDmarcNext(t *testing.T) { } -func TestSettersDomainDmarcReportSummary(t *testing.T) { - t.Run("SetPeriodStart", func(t *testing.T) { - obj := &DomainDmarcReportSummary{} - var fernTestValuePeriodStart time.Time - obj.SetPeriodStart(fernTestValuePeriodStart) - assert.Equal(t, fernTestValuePeriodStart, obj.PeriodStart) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetPeriodEnd", func(t *testing.T) { - obj := &DomainDmarcReportSummary{} - var fernTestValuePeriodEnd time.Time - obj.SetPeriodEnd(fernTestValuePeriodEnd) - assert.Equal(t, fernTestValuePeriodEnd, obj.PeriodEnd) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetReports", func(t *testing.T) { - obj := &DomainDmarcReportSummary{} - var fernTestValueReports int64 - obj.SetReports(fernTestValueReports) - assert.Equal(t, fernTestValueReports, obj.Reports) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetMessages", func(t *testing.T) { - obj := &DomainDmarcReportSummary{} - var fernTestValueMessages int64 - obj.SetMessages(fernTestValueMessages) - assert.Equal(t, fernTestValueMessages, obj.Messages) +func TestSettersDomainBimi(t *testing.T) { + t.Run("SetStatus", func(t *testing.T) { + obj := &DomainBimi{} + var fernTestValueStatus DomainBimiStatus + obj.SetStatus(fernTestValueStatus) + assert.Equal(t, fernTestValueStatus, obj.Status) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetPassing", func(t *testing.T) { - obj := &DomainDmarcReportSummary{} - var fernTestValuePassing int64 - obj.SetPassing(fernTestValuePassing) - assert.Equal(t, fernTestValuePassing, obj.Passing) + t.Run("SetName", func(t *testing.T) { + obj := &DomainBimi{} + var fernTestValueName string + obj.SetName(fernTestValueName) + assert.Equal(t, fernTestValueName, obj.Name) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetCossMessages", func(t *testing.T) { - obj := &DomainDmarcReportSummary{} - var fernTestValueCossMessages int64 - obj.SetCossMessages(fernTestValueCossMessages) - assert.Equal(t, fernTestValueCossMessages, obj.CossMessages) + t.Run("SetRecord", func(t *testing.T) { + obj := &DomainBimi{} + var fernTestValueRecord *string + obj.SetRecord(fernTestValueRecord) + assert.Equal(t, fernTestValueRecord, obj.Record) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetCossPassing", func(t *testing.T) { - obj := &DomainDmarcReportSummary{} - var fernTestValueCossPassing int64 - obj.SetCossPassing(fernTestValueCossPassing) - assert.Equal(t, fernTestValueCossPassing, obj.CossPassing) + t.Run("SetLogoURL", func(t *testing.T) { + obj := &DomainBimi{} + var fernTestValueLogoURL *string + obj.SetLogoURL(fernTestValueLogoURL) + assert.Equal(t, fernTestValueLogoURL, obj.LogoURL) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetFirstReportAt", func(t *testing.T) { - obj := &DomainDmarcReportSummary{} - var fernTestValueFirstReportAt *time.Time - obj.SetFirstReportAt(fernTestValueFirstReportAt) - assert.Equal(t, fernTestValueFirstReportAt, obj.FirstReportAt) + t.Run("SetCertificateURL", func(t *testing.T) { + obj := &DomainBimi{} + var fernTestValueCertificateURL *string + obj.SetCertificateURL(fernTestValueCertificateURL) + assert.Equal(t, fernTestValueCertificateURL, obj.CertificateURL) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetLastReportAt", func(t *testing.T) { - obj := &DomainDmarcReportSummary{} - var fernTestValueLastReportAt *time.Time - obj.SetLastReportAt(fernTestValueLastReportAt) - assert.Equal(t, fernTestValueLastReportAt, obj.LastReportAt) + t.Run("SetDmarcPolicy", func(t *testing.T) { + obj := &DomainBimi{} + var fernTestValueDmarcPolicy *DomainBimiDmarcPolicy + obj.SetDmarcPolicy(fernTestValueDmarcPolicy) + assert.Equal(t, fernTestValueDmarcPolicy, obj.DmarcPolicy) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetSources", func(t *testing.T) { - obj := &DomainDmarcReportSummary{} - var fernTestValueSources []*DmarcSource - obj.SetSources(fernTestValueSources) - assert.Equal(t, fernTestValueSources, obj.Sources) + t.Run("SetIssues", func(t *testing.T) { + obj := &DomainBimi{} + var fernTestValueIssues []*DomainBimiIssuesItem + obj.SetIssues(fernTestValueIssues) + assert.Equal(t, fernTestValueIssues, obj.Issues) assert.NotNil(t, obj.explicitFields) }) } -func TestGettersDomainDmarcReportSummary(t *testing.T) { - t.Run("GetPeriodStart", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &DomainDmarcReportSummary{} - var expected time.Time - obj.PeriodStart = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetPeriodStart(), "getter should return the property value") - }) - - t.Run("GetPeriodStart_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *DomainDmarcReportSummary - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetPeriodStart() // Should return zero value - }) - - t.Run("GetPeriodEnd", func(t *testing.T) { +func TestGettersDomainBimi(t *testing.T) { + t.Run("GetStatus", func(t *testing.T) { t.Parallel() // Arrange - obj := &DomainDmarcReportSummary{} - var expected time.Time - obj.PeriodEnd = expected + obj := &DomainBimi{} + var expected DomainBimiStatus + obj.Status = expected // Act & Assert - assert.Equal(t, expected, obj.GetPeriodEnd(), "getter should return the property value") + assert.Equal(t, expected, obj.GetStatus(), "getter should return the property value") }) - t.Run("GetPeriodEnd_NilReceiver", func(t *testing.T) { + t.Run("GetStatus_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DomainDmarcReportSummary + var obj *DomainBimi // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetPeriodEnd() // Should return zero value + _ = obj.GetStatus() // Should return zero value }) - t.Run("GetReports", func(t *testing.T) { + t.Run("GetName", func(t *testing.T) { t.Parallel() // Arrange - obj := &DomainDmarcReportSummary{} - var expected int64 - obj.Reports = expected + obj := &DomainBimi{} + var expected string + obj.Name = expected // Act & Assert - assert.Equal(t, expected, obj.GetReports(), "getter should return the property value") + assert.Equal(t, expected, obj.GetName(), "getter should return the property value") }) - t.Run("GetReports_NilReceiver", func(t *testing.T) { + t.Run("GetName_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DomainDmarcReportSummary + var obj *DomainBimi // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetReports() // Should return zero value + _ = obj.GetName() // Should return zero value }) - t.Run("GetMessages", func(t *testing.T) { + t.Run("GetRecord", func(t *testing.T) { t.Parallel() // Arrange - obj := &DomainDmarcReportSummary{} - var expected int64 - obj.Messages = expected + obj := &DomainBimi{} + var expected *string + obj.Record = expected // Act & Assert - assert.Equal(t, expected, obj.GetMessages(), "getter should return the property value") - }) - - t.Run("GetMessages_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *DomainDmarcReportSummary - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetMessages() // Should return zero value + assert.Equal(t, expected, obj.GetRecord(), "getter should return the property value") }) - t.Run("GetPassing", func(t *testing.T) { + t.Run("GetRecord_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &DomainDmarcReportSummary{} - var expected int64 - obj.Passing = expected + obj := &DomainBimi{} + obj.Record = nil // Act & Assert - assert.Equal(t, expected, obj.GetPassing(), "getter should return the property value") + assert.Nil(t, obj.GetRecord(), "getter should return nil when property is nil") }) - t.Run("GetPassing_NilReceiver", func(t *testing.T) { + t.Run("GetRecord_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DomainDmarcReportSummary + var obj *DomainBimi // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetPassing() // Should return zero value + _ = obj.GetRecord() // Should return zero value }) - t.Run("GetCossMessages", func(t *testing.T) { + t.Run("GetLogoURL", func(t *testing.T) { t.Parallel() // Arrange - obj := &DomainDmarcReportSummary{} - var expected int64 - obj.CossMessages = expected + obj := &DomainBimi{} + var expected *string + obj.LogoURL = expected // Act & Assert - assert.Equal(t, expected, obj.GetCossMessages(), "getter should return the property value") - }) - - t.Run("GetCossMessages_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *DomainDmarcReportSummary - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetCossMessages() // Should return zero value + assert.Equal(t, expected, obj.GetLogoURL(), "getter should return the property value") }) - t.Run("GetCossPassing", func(t *testing.T) { + t.Run("GetLogoURL_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &DomainDmarcReportSummary{} - var expected int64 - obj.CossPassing = expected + obj := &DomainBimi{} + obj.LogoURL = nil // Act & Assert - assert.Equal(t, expected, obj.GetCossPassing(), "getter should return the property value") + assert.Nil(t, obj.GetLogoURL(), "getter should return nil when property is nil") }) - t.Run("GetCossPassing_NilReceiver", func(t *testing.T) { + t.Run("GetLogoURL_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DomainDmarcReportSummary + var obj *DomainBimi // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetCossPassing() // Should return zero value + _ = obj.GetLogoURL() // Should return zero value }) - t.Run("GetFirstReportAt", func(t *testing.T) { + t.Run("GetCertificateURL", func(t *testing.T) { t.Parallel() // Arrange - obj := &DomainDmarcReportSummary{} - var expected *time.Time - obj.FirstReportAt = expected + obj := &DomainBimi{} + var expected *string + obj.CertificateURL = expected // Act & Assert - assert.Equal(t, expected, obj.GetFirstReportAt(), "getter should return the property value") + assert.Equal(t, expected, obj.GetCertificateURL(), "getter should return the property value") }) - t.Run("GetFirstReportAt_NilValue", func(t *testing.T) { + t.Run("GetCertificateURL_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &DomainDmarcReportSummary{} - obj.FirstReportAt = nil + obj := &DomainBimi{} + obj.CertificateURL = nil // Act & Assert - assert.Nil(t, obj.GetFirstReportAt(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetCertificateURL(), "getter should return nil when property is nil") }) - t.Run("GetFirstReportAt_NilReceiver", func(t *testing.T) { + t.Run("GetCertificateURL_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DomainDmarcReportSummary + var obj *DomainBimi // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetFirstReportAt() // Should return zero value + _ = obj.GetCertificateURL() // Should return zero value }) - t.Run("GetLastReportAt", func(t *testing.T) { + t.Run("GetDmarcPolicy", func(t *testing.T) { t.Parallel() // Arrange - obj := &DomainDmarcReportSummary{} - var expected *time.Time - obj.LastReportAt = expected + obj := &DomainBimi{} + var expected *DomainBimiDmarcPolicy + obj.DmarcPolicy = expected // Act & Assert - assert.Equal(t, expected, obj.GetLastReportAt(), "getter should return the property value") + assert.Equal(t, expected, obj.GetDmarcPolicy(), "getter should return the property value") }) - t.Run("GetLastReportAt_NilValue", func(t *testing.T) { + t.Run("GetDmarcPolicy_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &DomainDmarcReportSummary{} - obj.LastReportAt = nil + obj := &DomainBimi{} + obj.DmarcPolicy = nil // Act & Assert - assert.Nil(t, obj.GetLastReportAt(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetDmarcPolicy(), "getter should return nil when property is nil") }) - t.Run("GetLastReportAt_NilReceiver", func(t *testing.T) { + t.Run("GetDmarcPolicy_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DomainDmarcReportSummary + var obj *DomainBimi // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetLastReportAt() // Should return zero value + _ = obj.GetDmarcPolicy() // Should return zero value }) - t.Run("GetSources", func(t *testing.T) { + t.Run("GetIssues", func(t *testing.T) { t.Parallel() // Arrange - obj := &DomainDmarcReportSummary{} - var expected []*DmarcSource - obj.Sources = expected + obj := &DomainBimi{} + var expected []*DomainBimiIssuesItem + obj.Issues = expected // Act & Assert - assert.Equal(t, expected, obj.GetSources(), "getter should return the property value") + assert.Equal(t, expected, obj.GetIssues(), "getter should return the property value") }) - t.Run("GetSources_NilValue", func(t *testing.T) { + t.Run("GetIssues_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &DomainDmarcReportSummary{} - obj.Sources = nil + obj := &DomainBimi{} + obj.Issues = nil // Act & Assert - assert.Nil(t, obj.GetSources(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetIssues(), "getter should return nil when property is nil") }) - t.Run("GetSources_NilReceiver", func(t *testing.T) { + t.Run("GetIssues_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DomainDmarcReportSummary + var obj *DomainBimi // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetSources() // Should return zero value + _ = obj.GetIssues() // Should return zero value }) } -func TestSettersMarkExplicitDomainDmarcReportSummary(t *testing.T) { - t.Run("SetPeriodStart_MarksExplicit", func(t *testing.T) { +func TestSettersMarkExplicitDomainBimi(t *testing.T) { + t.Run("SetStatus_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DomainDmarcReportSummary{} - var fernTestValuePeriodStart time.Time + obj := &DomainBimi{} + var fernTestValueStatus DomainBimiStatus // Act - obj.SetPeriodStart(fernTestValuePeriodStart) + obj.SetStatus(fernTestValueStatus) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -32777,14 +32498,14 @@ func TestSettersMarkExplicitDomainDmarcReportSummary(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetPeriodEnd_MarksExplicit", func(t *testing.T) { + t.Run("SetName_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DomainDmarcReportSummary{} - var fernTestValuePeriodEnd time.Time + obj := &DomainBimi{} + var fernTestValueName string // Act - obj.SetPeriodEnd(fernTestValuePeriodEnd) + obj.SetName(fernTestValueName) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -32808,14 +32529,14 @@ func TestSettersMarkExplicitDomainDmarcReportSummary(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetReports_MarksExplicit", func(t *testing.T) { + t.Run("SetRecord_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DomainDmarcReportSummary{} - var fernTestValueReports int64 + obj := &DomainBimi{} + var fernTestValueRecord *string // Act - obj.SetReports(fernTestValueReports) + obj.SetRecord(fernTestValueRecord) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -32839,14 +32560,14 @@ func TestSettersMarkExplicitDomainDmarcReportSummary(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetMessages_MarksExplicit", func(t *testing.T) { + t.Run("SetLogoURL_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DomainDmarcReportSummary{} - var fernTestValueMessages int64 + obj := &DomainBimi{} + var fernTestValueLogoURL *string // Act - obj.SetMessages(fernTestValueMessages) + obj.SetLogoURL(fernTestValueLogoURL) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -32870,14 +32591,14 @@ func TestSettersMarkExplicitDomainDmarcReportSummary(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetPassing_MarksExplicit", func(t *testing.T) { + t.Run("SetCertificateURL_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DomainDmarcReportSummary{} - var fernTestValuePassing int64 + obj := &DomainBimi{} + var fernTestValueCertificateURL *string // Act - obj.SetPassing(fernTestValuePassing) + obj.SetCertificateURL(fernTestValueCertificateURL) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -32901,14 +32622,14 @@ func TestSettersMarkExplicitDomainDmarcReportSummary(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetCossMessages_MarksExplicit", func(t *testing.T) { + t.Run("SetDmarcPolicy_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DomainDmarcReportSummary{} - var fernTestValueCossMessages int64 + obj := &DomainBimi{} + var fernTestValueDmarcPolicy *DomainBimiDmarcPolicy // Act - obj.SetCossMessages(fernTestValueCossMessages) + obj.SetDmarcPolicy(fernTestValueDmarcPolicy) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -32932,14 +32653,14 @@ func TestSettersMarkExplicitDomainDmarcReportSummary(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetCossPassing_MarksExplicit", func(t *testing.T) { + t.Run("SetIssues_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DomainDmarcReportSummary{} - var fernTestValueCossPassing int64 + obj := &DomainBimi{} + var fernTestValueIssues []*DomainBimiIssuesItem // Act - obj.SetCossPassing(fernTestValueCossPassing) + obj.SetIssues(fernTestValueIssues) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -32963,45 +32684,85 @@ func TestSettersMarkExplicitDomainDmarcReportSummary(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetFirstReportAt_MarksExplicit", func(t *testing.T) { +} + +func TestSettersDomainBimiIssuesItem(t *testing.T) { + t.Run("SetCode", func(t *testing.T) { + obj := &DomainBimiIssuesItem{} + var fernTestValueCode DomainBimiIssuesItemCode + obj.SetCode(fernTestValueCode) + assert.Equal(t, fernTestValueCode, obj.Code) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetMessage", func(t *testing.T) { + obj := &DomainBimiIssuesItem{} + var fernTestValueMessage string + obj.SetMessage(fernTestValueMessage) + assert.Equal(t, fernTestValueMessage, obj.Message) + assert.NotNil(t, obj.explicitFields) + }) + +} + +func TestGettersDomainBimiIssuesItem(t *testing.T) { + t.Run("GetCode", func(t *testing.T) { t.Parallel() // Arrange - obj := &DomainDmarcReportSummary{} - var fernTestValueFirstReportAt *time.Time + obj := &DomainBimiIssuesItem{} + var expected DomainBimiIssuesItemCode + obj.Code = expected - // Act - obj.SetFirstReportAt(fernTestValueFirstReportAt) + // Act & Assert + assert.Equal(t, expected, obj.GetCode(), "getter should return the property value") + }) - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") + t.Run("GetCode_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *DomainBimiIssuesItem + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetCode() // Should return zero value + }) - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } + t.Run("GetMessage", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DomainBimiIssuesItem{} + var expected string + obj.Message = expected - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip + // Act & Assert + assert.Equal(t, expected, obj.GetMessage(), "getter should return the property value") }) - t.Run("SetLastReportAt_MarksExplicit", func(t *testing.T) { + t.Run("GetMessage_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *DomainBimiIssuesItem + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetMessage() // Should return zero value + }) + +} + +func TestSettersMarkExplicitDomainBimiIssuesItem(t *testing.T) { + t.Run("SetCode_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DomainDmarcReportSummary{} - var fernTestValueLastReportAt *time.Time + obj := &DomainBimiIssuesItem{} + var fernTestValueCode DomainBimiIssuesItemCode // Act - obj.SetLastReportAt(fernTestValueLastReportAt) + obj.SetCode(fernTestValueCode) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -33025,14 +32786,14 @@ func TestSettersMarkExplicitDomainDmarcReportSummary(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetSources_MarksExplicit", func(t *testing.T) { + t.Run("SetMessage_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DomainDmarcReportSummary{} - var fernTestValueSources []*DmarcSource + obj := &DomainBimiIssuesItem{} + var fernTestValueMessage string // Act - obj.SetSources(fernTestValueSources) + obj.SetMessage(fernTestValueMessage) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -33058,289 +32819,576 @@ func TestSettersMarkExplicitDomainDmarcReportSummary(t *testing.T) { } -func TestSettersDomainRecord(t *testing.T) { - t.Run("SetPurpose", func(t *testing.T) { - obj := &DomainRecord{} - var fernTestValuePurpose DomainRecordPurpose - obj.SetPurpose(fernTestValuePurpose) - assert.Equal(t, fernTestValuePurpose, obj.Purpose) +func TestSettersDomainDmarc(t *testing.T) { + t.Run("SetObject", func(t *testing.T) { + obj := &DomainDmarc{} + var fernTestValueObject DomainDmarcObject + obj.SetObject(fernTestValueObject) + assert.Equal(t, fernTestValueObject, obj.Object) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetType", func(t *testing.T) { - obj := &DomainRecord{} - var fernTestValueType DomainRecordType - obj.SetType(fernTestValueType) - assert.Equal(t, fernTestValueType, obj.Type) + t.Run("SetDomainID", func(t *testing.T) { + obj := &DomainDmarc{} + var fernTestValueDomainID string + obj.SetDomainID(fernTestValueDomainID) + assert.Equal(t, fernTestValueDomainID, obj.DomainID) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetName", func(t *testing.T) { - obj := &DomainRecord{} - var fernTestValueName string - obj.SetName(fernTestValueName) - assert.Equal(t, fernTestValueName, obj.Name) + t.Run("SetReportAddress", func(t *testing.T) { + obj := &DomainDmarc{} + var fernTestValueReportAddress *string + obj.SetReportAddress(fernTestValueReportAddress) + assert.Equal(t, fernTestValueReportAddress, obj.ReportAddress) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetValue", func(t *testing.T) { - obj := &DomainRecord{} - var fernTestValueValue string - obj.SetValue(fernTestValueValue) - assert.Equal(t, fernTestValueValue, obj.Value) + t.Run("SetRecord", func(t *testing.T) { + obj := &DomainDmarc{} + var fernTestValueRecord *DmarcPublishedRecord + obj.SetRecord(fernTestValueRecord) + assert.Equal(t, fernTestValueRecord, obj.Record) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetPriority", func(t *testing.T) { - obj := &DomainRecord{} - var fernTestValuePriority *int64 - obj.SetPriority(fernTestValuePriority) - assert.Equal(t, fernTestValuePriority, obj.Priority) + t.Run("SetPolicy", func(t *testing.T) { + obj := &DomainDmarc{} + var fernTestValuePolicy *DomainDmarcPolicy + obj.SetPolicy(fernTestValuePolicy) + assert.Equal(t, fernTestValuePolicy, obj.Policy) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetRequired", func(t *testing.T) { - obj := &DomainRecord{} - var fernTestValueRequired bool - obj.SetRequired(fernTestValueRequired) - assert.Equal(t, fernTestValueRequired, obj.Required) + t.Run("SetInheritedFrom", func(t *testing.T) { + obj := &DomainDmarc{} + var fernTestValueInheritedFrom *string + obj.SetInheritedFrom(fernTestValueInheritedFrom) + assert.Equal(t, fernTestValueInheritedFrom, obj.InheritedFrom) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetStatus", func(t *testing.T) { - obj := &DomainRecord{} - var fernTestValueStatus DomainRecordStatus - obj.SetStatus(fernTestValueStatus) - assert.Equal(t, fernTestValueStatus, obj.Status) + t.Run("SetPolicySince", func(t *testing.T) { + obj := &DomainDmarc{} + var fernTestValuePolicySince *time.Time + obj.SetPolicySince(fernTestValuePolicySince) + assert.Equal(t, fernTestValuePolicySince, obj.PolicySince) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetFound", func(t *testing.T) { - obj := &DomainRecord{} - var fernTestValueFound []string - obj.SetFound(fernTestValueFound) - assert.Equal(t, fernTestValueFound, obj.Found) + t.Run("SetStage", func(t *testing.T) { + obj := &DomainDmarc{} + var fernTestValueStage DomainDmarcStage + obj.SetStage(fernTestValueStage) + assert.Equal(t, fernTestValueStage, obj.Stage) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetPartial", func(t *testing.T) { + obj := &DomainDmarc{} + var fernTestValuePartial bool + obj.SetPartial(fernTestValuePartial) + assert.Equal(t, fernTestValuePartial, obj.Partial) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetReporting", func(t *testing.T) { + obj := &DomainDmarc{} + var fernTestValueReporting bool + obj.SetReporting(fernTestValueReporting) + assert.Equal(t, fernTestValueReporting, obj.Reporting) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetReady", func(t *testing.T) { + obj := &DomainDmarc{} + var fernTestValueReady bool + obj.SetReady(fernTestValueReady) + assert.Equal(t, fernTestValueReady, obj.Ready) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetNext", func(t *testing.T) { + obj := &DomainDmarc{} + var fernTestValueNext *DomainDmarcNext + obj.SetNext(fernTestValueNext) + assert.Equal(t, fernTestValueNext, obj.Next) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetChecks", func(t *testing.T) { + obj := &DomainDmarc{} + var fernTestValueChecks []*DomainDmarcChecksItem + obj.SetChecks(fernTestValueChecks) + assert.Equal(t, fernTestValueChecks, obj.Checks) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetWarnings", func(t *testing.T) { + obj := &DomainDmarc{} + var fernTestValueWarnings []string + obj.SetWarnings(fernTestValueWarnings) + assert.Equal(t, fernTestValueWarnings, obj.Warnings) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetReportSummary", func(t *testing.T) { + obj := &DomainDmarc{} + var fernTestValueReportSummary *DomainDmarcReportSummary + obj.SetReportSummary(fernTestValueReportSummary) + assert.Equal(t, fernTestValueReportSummary, obj.ReportSummary) assert.NotNil(t, obj.explicitFields) }) } -func TestGettersDomainRecord(t *testing.T) { - t.Run("GetPurpose", func(t *testing.T) { +func TestGettersDomainDmarc(t *testing.T) { + t.Run("GetObject", func(t *testing.T) { t.Parallel() // Arrange - obj := &DomainRecord{} - var expected DomainRecordPurpose - obj.Purpose = expected + obj := &DomainDmarc{} + var expected DomainDmarcObject + obj.Object = expected // Act & Assert - assert.Equal(t, expected, obj.GetPurpose(), "getter should return the property value") + assert.Equal(t, expected, obj.GetObject(), "getter should return the property value") }) - t.Run("GetPurpose_NilReceiver", func(t *testing.T) { + t.Run("GetObject_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DomainRecord + var obj *DomainDmarc // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetPurpose() // Should return zero value + _ = obj.GetObject() // Should return zero value }) - t.Run("GetType", func(t *testing.T) { + t.Run("GetDomainID", func(t *testing.T) { t.Parallel() // Arrange - obj := &DomainRecord{} - var expected DomainRecordType - obj.Type = expected + obj := &DomainDmarc{} + var expected string + obj.DomainID = expected // Act & Assert - assert.Equal(t, expected, obj.GetType(), "getter should return the property value") + assert.Equal(t, expected, obj.GetDomainID(), "getter should return the property value") }) - t.Run("GetType_NilReceiver", func(t *testing.T) { + t.Run("GetDomainID_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DomainRecord + var obj *DomainDmarc // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetType() // Should return zero value + _ = obj.GetDomainID() // Should return zero value }) - t.Run("GetName", func(t *testing.T) { + t.Run("GetReportAddress", func(t *testing.T) { t.Parallel() // Arrange - obj := &DomainRecord{} - var expected string - obj.Name = expected + obj := &DomainDmarc{} + var expected *string + obj.ReportAddress = expected // Act & Assert - assert.Equal(t, expected, obj.GetName(), "getter should return the property value") + assert.Equal(t, expected, obj.GetReportAddress(), "getter should return the property value") }) - t.Run("GetName_NilReceiver", func(t *testing.T) { + t.Run("GetReportAddress_NilValue", func(t *testing.T) { t.Parallel() - var obj *DomainRecord + // Arrange + obj := &DomainDmarc{} + obj.ReportAddress = nil + + // Act & Assert + assert.Nil(t, obj.GetReportAddress(), "getter should return nil when property is nil") + }) + + t.Run("GetReportAddress_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *DomainDmarc // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetName() // Should return zero value + _ = obj.GetReportAddress() // Should return zero value }) - t.Run("GetValue", func(t *testing.T) { + t.Run("GetRecord", func(t *testing.T) { t.Parallel() // Arrange - obj := &DomainRecord{} - var expected string - obj.Value = expected + obj := &DomainDmarc{} + var expected *DmarcPublishedRecord + obj.Record = expected // Act & Assert - assert.Equal(t, expected, obj.GetValue(), "getter should return the property value") + assert.Equal(t, expected, obj.GetRecord(), "getter should return the property value") }) - t.Run("GetValue_NilReceiver", func(t *testing.T) { + t.Run("GetRecord_NilValue", func(t *testing.T) { t.Parallel() - var obj *DomainRecord + // Arrange + obj := &DomainDmarc{} + obj.Record = nil + + // Act & Assert + assert.Nil(t, obj.GetRecord(), "getter should return nil when property is nil") + }) + + t.Run("GetRecord_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *DomainDmarc // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetValue() // Should return zero value + _ = obj.GetRecord() // Should return zero value }) - t.Run("GetPriority", func(t *testing.T) { + t.Run("GetPolicy", func(t *testing.T) { t.Parallel() // Arrange - obj := &DomainRecord{} - var expected *int64 - obj.Priority = expected + obj := &DomainDmarc{} + var expected *DomainDmarcPolicy + obj.Policy = expected // Act & Assert - assert.Equal(t, expected, obj.GetPriority(), "getter should return the property value") + assert.Equal(t, expected, obj.GetPolicy(), "getter should return the property value") }) - t.Run("GetPriority_NilValue", func(t *testing.T) { + t.Run("GetPolicy_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &DomainRecord{} - obj.Priority = nil + obj := &DomainDmarc{} + obj.Policy = nil // Act & Assert - assert.Nil(t, obj.GetPriority(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetPolicy(), "getter should return nil when property is nil") }) - t.Run("GetPriority_NilReceiver", func(t *testing.T) { + t.Run("GetPolicy_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DomainRecord + var obj *DomainDmarc // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetPriority() // Should return zero value + _ = obj.GetPolicy() // Should return zero value }) - t.Run("GetRequired", func(t *testing.T) { + t.Run("GetInheritedFrom", func(t *testing.T) { t.Parallel() // Arrange - obj := &DomainRecord{} + obj := &DomainDmarc{} + var expected *string + obj.InheritedFrom = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetInheritedFrom(), "getter should return the property value") + }) + + t.Run("GetInheritedFrom_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DomainDmarc{} + obj.InheritedFrom = nil + + // Act & Assert + assert.Nil(t, obj.GetInheritedFrom(), "getter should return nil when property is nil") + }) + + t.Run("GetInheritedFrom_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *DomainDmarc + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetInheritedFrom() // Should return zero value + }) + + t.Run("GetPolicySince", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DomainDmarc{} + var expected *time.Time + obj.PolicySince = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetPolicySince(), "getter should return the property value") + }) + + t.Run("GetPolicySince_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DomainDmarc{} + obj.PolicySince = nil + + // Act & Assert + assert.Nil(t, obj.GetPolicySince(), "getter should return nil when property is nil") + }) + + t.Run("GetPolicySince_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *DomainDmarc + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetPolicySince() // Should return zero value + }) + + t.Run("GetStage", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DomainDmarc{} + var expected DomainDmarcStage + obj.Stage = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetStage(), "getter should return the property value") + }) + + t.Run("GetStage_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *DomainDmarc + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetStage() // Should return zero value + }) + + t.Run("GetPartial", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DomainDmarc{} var expected bool - obj.Required = expected + obj.Partial = expected // Act & Assert - assert.Equal(t, expected, obj.GetRequired(), "getter should return the property value") + assert.Equal(t, expected, obj.GetPartial(), "getter should return the property value") }) - t.Run("GetRequired_NilReceiver", func(t *testing.T) { + t.Run("GetPartial_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DomainRecord + var obj *DomainDmarc // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetRequired() // Should return zero value + _ = obj.GetPartial() // Should return zero value }) - t.Run("GetStatus", func(t *testing.T) { + t.Run("GetReporting", func(t *testing.T) { t.Parallel() // Arrange - obj := &DomainRecord{} - var expected DomainRecordStatus - obj.Status = expected + obj := &DomainDmarc{} + var expected bool + obj.Reporting = expected // Act & Assert - assert.Equal(t, expected, obj.GetStatus(), "getter should return the property value") + assert.Equal(t, expected, obj.GetReporting(), "getter should return the property value") }) - t.Run("GetStatus_NilReceiver", func(t *testing.T) { + t.Run("GetReporting_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DomainRecord + var obj *DomainDmarc // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetStatus() // Should return zero value + _ = obj.GetReporting() // Should return zero value }) - t.Run("GetFound", func(t *testing.T) { + t.Run("GetReady", func(t *testing.T) { t.Parallel() // Arrange - obj := &DomainRecord{} + obj := &DomainDmarc{} + var expected bool + obj.Ready = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetReady(), "getter should return the property value") + }) + + t.Run("GetReady_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *DomainDmarc + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetReady() // Should return zero value + }) + + t.Run("GetNext", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DomainDmarc{} + var expected *DomainDmarcNext + obj.Next = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetNext(), "getter should return the property value") + }) + + t.Run("GetNext_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DomainDmarc{} + obj.Next = nil + + // Act & Assert + assert.Nil(t, obj.GetNext(), "getter should return nil when property is nil") + }) + + t.Run("GetNext_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *DomainDmarc + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetNext() // Should return zero value + }) + + t.Run("GetChecks", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DomainDmarc{} + var expected []*DomainDmarcChecksItem + obj.Checks = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetChecks(), "getter should return the property value") + }) + + t.Run("GetChecks_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DomainDmarc{} + obj.Checks = nil + + // Act & Assert + assert.Nil(t, obj.GetChecks(), "getter should return nil when property is nil") + }) + + t.Run("GetChecks_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *DomainDmarc + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetChecks() // Should return zero value + }) + + t.Run("GetWarnings", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DomainDmarc{} var expected []string - obj.Found = expected + obj.Warnings = expected // Act & Assert - assert.Equal(t, expected, obj.GetFound(), "getter should return the property value") + assert.Equal(t, expected, obj.GetWarnings(), "getter should return the property value") }) - t.Run("GetFound_NilValue", func(t *testing.T) { + t.Run("GetWarnings_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &DomainRecord{} - obj.Found = nil + obj := &DomainDmarc{} + obj.Warnings = nil // Act & Assert - assert.Nil(t, obj.GetFound(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetWarnings(), "getter should return nil when property is nil") }) - t.Run("GetFound_NilReceiver", func(t *testing.T) { + t.Run("GetWarnings_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DomainRecord + var obj *DomainDmarc // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetFound() // Should return zero value + _ = obj.GetWarnings() // Should return zero value + }) + + t.Run("GetReportSummary", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DomainDmarc{} + var expected *DomainDmarcReportSummary + obj.ReportSummary = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetReportSummary(), "getter should return the property value") + }) + + t.Run("GetReportSummary_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DomainDmarc{} + obj.ReportSummary = nil + + // Act & Assert + assert.Nil(t, obj.GetReportSummary(), "getter should return nil when property is nil") + }) + + t.Run("GetReportSummary_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *DomainDmarc + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetReportSummary() // Should return zero value }) } -func TestSettersMarkExplicitDomainRecord(t *testing.T) { - t.Run("SetPurpose_MarksExplicit", func(t *testing.T) { +func TestSettersMarkExplicitDomainDmarc(t *testing.T) { + t.Run("SetObject_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DomainRecord{} - var fernTestValuePurpose DomainRecordPurpose + obj := &DomainDmarc{} + var fernTestValueObject DomainDmarcObject // Act - obj.SetPurpose(fernTestValuePurpose) + obj.SetObject(fernTestValueObject) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -33364,14 +33412,14 @@ func TestSettersMarkExplicitDomainRecord(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetType_MarksExplicit", func(t *testing.T) { + t.Run("SetDomainID_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DomainRecord{} - var fernTestValueType DomainRecordType + obj := &DomainDmarc{} + var fernTestValueDomainID string // Act - obj.SetType(fernTestValueType) + obj.SetDomainID(fernTestValueDomainID) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -33395,14 +33443,14 @@ func TestSettersMarkExplicitDomainRecord(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetName_MarksExplicit", func(t *testing.T) { + t.Run("SetReportAddress_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DomainRecord{} - var fernTestValueName string + obj := &DomainDmarc{} + var fernTestValueReportAddress *string // Act - obj.SetName(fernTestValueName) + obj.SetReportAddress(fernTestValueReportAddress) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -33426,14 +33474,14 @@ func TestSettersMarkExplicitDomainRecord(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetValue_MarksExplicit", func(t *testing.T) { + t.Run("SetRecord_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DomainRecord{} - var fernTestValueValue string + obj := &DomainDmarc{} + var fernTestValueRecord *DmarcPublishedRecord // Act - obj.SetValue(fernTestValueValue) + obj.SetRecord(fernTestValueRecord) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -33457,14 +33505,14 @@ func TestSettersMarkExplicitDomainRecord(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetPriority_MarksExplicit", func(t *testing.T) { + t.Run("SetPolicy_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DomainRecord{} - var fernTestValuePriority *int64 + obj := &DomainDmarc{} + var fernTestValuePolicy *DomainDmarcPolicy // Act - obj.SetPriority(fernTestValuePriority) + obj.SetPolicy(fernTestValuePolicy) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -33488,14 +33536,14 @@ func TestSettersMarkExplicitDomainRecord(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetRequired_MarksExplicit", func(t *testing.T) { + t.Run("SetInheritedFrom_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DomainRecord{} - var fernTestValueRequired bool + obj := &DomainDmarc{} + var fernTestValueInheritedFrom *string // Act - obj.SetRequired(fernTestValueRequired) + obj.SetInheritedFrom(fernTestValueInheritedFrom) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -33519,14 +33567,14 @@ func TestSettersMarkExplicitDomainRecord(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetStatus_MarksExplicit", func(t *testing.T) { + t.Run("SetPolicySince_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DomainRecord{} - var fernTestValueStatus DomainRecordStatus + obj := &DomainDmarc{} + var fernTestValuePolicySince *time.Time // Act - obj.SetStatus(fernTestValueStatus) + obj.SetPolicySince(fernTestValuePolicySince) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -33550,14 +33598,14 @@ func TestSettersMarkExplicitDomainRecord(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetFound_MarksExplicit", func(t *testing.T) { + t.Run("SetStage_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DomainRecord{} - var fernTestValueFound []string + obj := &DomainDmarc{} + var fernTestValueStage DomainDmarcStage // Act - obj.SetFound(fernTestValueFound) + obj.SetStage(fernTestValueStage) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -33581,216 +33629,330 @@ func TestSettersMarkExplicitDomainRecord(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) -} + t.Run("SetPartial_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DomainDmarc{} + var fernTestValuePartial bool -func TestSettersDomainWebhookEvent(t *testing.T) { - t.Run("SetID", func(t *testing.T) { - obj := &DomainWebhookEvent{} - var fernTestValueID string - obj.SetID(fernTestValueID) - assert.Equal(t, fernTestValueID, obj.ID) - assert.NotNil(t, obj.explicitFields) - }) + // Act + obj.SetPartial(fernTestValuePartial) - t.Run("SetObject", func(t *testing.T) { - obj := &DomainWebhookEvent{} - var fernTestValueObject DomainWebhookEventObject - obj.SetObject(fernTestValueObject) - assert.Equal(t, fernTestValueObject, obj.Object) - assert.NotNil(t, obj.explicitFields) - }) + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") - t.Run("SetType", func(t *testing.T) { - obj := &DomainWebhookEvent{} - var fernTestValueType DomainWebhookEventType - obj.SetType(fernTestValueType) - assert.Equal(t, fernTestValueType, obj.Type) - assert.NotNil(t, obj.explicitFields) - }) + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } - t.Run("SetAPIVersion", func(t *testing.T) { - obj := &DomainWebhookEvent{} - var fernTestValueAPIVersion string - obj.SetAPIVersion(fernTestValueAPIVersion) - assert.Equal(t, fernTestValueAPIVersion, obj.APIVersion) - assert.NotNil(t, obj.explicitFields) + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetCreatedAt", func(t *testing.T) { - obj := &DomainWebhookEvent{} - var fernTestValueCreatedAt time.Time - obj.SetCreatedAt(fernTestValueCreatedAt) - assert.Equal(t, fernTestValueCreatedAt, obj.CreatedAt) - assert.NotNil(t, obj.explicitFields) - }) + t.Run("SetReporting_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DomainDmarc{} + var fernTestValueReporting bool - t.Run("SetData", func(t *testing.T) { - obj := &DomainWebhookEvent{} - var fernTestValueData *DomainWebhookEventData - obj.SetData(fernTestValueData) - assert.Equal(t, fernTestValueData, obj.Data) - assert.NotNil(t, obj.explicitFields) - }) + // Act + obj.SetReporting(fernTestValueReporting) -} + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") -func TestGettersDomainWebhookEvent(t *testing.T) { - t.Run("GetID", func(t *testing.T) { + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetReady_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DomainWebhookEvent{} - var expected string - obj.ID = expected + obj := &DomainDmarc{} + var fernTestValueReady bool - // Act & Assert - assert.Equal(t, expected, obj.GetID(), "getter should return the property value") + // Act + obj.SetReady(fernTestValueReady) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("GetID_NilReceiver", func(t *testing.T) { + t.Run("SetNext_MarksExplicit", func(t *testing.T) { t.Parallel() - var obj *DomainWebhookEvent - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetID() // Should return zero value + // Arrange + obj := &DomainDmarc{} + var fernTestValueNext *DomainDmarcNext + + // Act + obj.SetNext(fernTestValueNext) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("GetObject", func(t *testing.T) { + t.Run("SetChecks_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DomainWebhookEvent{} - var expected DomainWebhookEventObject - obj.Object = expected + obj := &DomainDmarc{} + var fernTestValueChecks []*DomainDmarcChecksItem - // Act & Assert - assert.Equal(t, expected, obj.GetObject(), "getter should return the property value") + // Act + obj.SetChecks(fernTestValueChecks) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("GetObject_NilReceiver", func(t *testing.T) { + t.Run("SetWarnings_MarksExplicit", func(t *testing.T) { t.Parallel() - var obj *DomainWebhookEvent - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetObject() // Should return zero value + // Arrange + obj := &DomainDmarc{} + var fernTestValueWarnings []string + + // Act + obj.SetWarnings(fernTestValueWarnings) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("GetType", func(t *testing.T) { + t.Run("SetReportSummary_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DomainWebhookEvent{} - var expected DomainWebhookEventType - obj.Type = expected + obj := &DomainDmarc{} + var fernTestValueReportSummary *DomainDmarcReportSummary - // Act & Assert - assert.Equal(t, expected, obj.GetType(), "getter should return the property value") + // Act + obj.SetReportSummary(fernTestValueReportSummary) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("GetType_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *DomainWebhookEvent - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetType() // Should return zero value +} + +func TestSettersDomainDmarcChecksItem(t *testing.T) { + t.Run("SetID", func(t *testing.T) { + obj := &DomainDmarcChecksItem{} + var fernTestValueID DomainDmarcChecksItemID + obj.SetID(fernTestValueID) + assert.Equal(t, fernTestValueID, obj.ID) + assert.NotNil(t, obj.explicitFields) }) - t.Run("GetAPIVersion", func(t *testing.T) { + t.Run("SetOk", func(t *testing.T) { + obj := &DomainDmarcChecksItem{} + var fernTestValueOk bool + obj.SetOk(fernTestValueOk) + assert.Equal(t, fernTestValueOk, obj.Ok) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetMessage", func(t *testing.T) { + obj := &DomainDmarcChecksItem{} + var fernTestValueMessage string + obj.SetMessage(fernTestValueMessage) + assert.Equal(t, fernTestValueMessage, obj.Message) + assert.NotNil(t, obj.explicitFields) + }) + +} + +func TestGettersDomainDmarcChecksItem(t *testing.T) { + t.Run("GetID", func(t *testing.T) { t.Parallel() // Arrange - obj := &DomainWebhookEvent{} - var expected string - obj.APIVersion = expected + obj := &DomainDmarcChecksItem{} + var expected DomainDmarcChecksItemID + obj.ID = expected // Act & Assert - assert.Equal(t, expected, obj.GetAPIVersion(), "getter should return the property value") + assert.Equal(t, expected, obj.GetID(), "getter should return the property value") }) - t.Run("GetAPIVersion_NilReceiver", func(t *testing.T) { + t.Run("GetID_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DomainWebhookEvent + var obj *DomainDmarcChecksItem // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetAPIVersion() // Should return zero value + _ = obj.GetID() // Should return zero value }) - t.Run("GetCreatedAt", func(t *testing.T) { + t.Run("GetOk", func(t *testing.T) { t.Parallel() // Arrange - obj := &DomainWebhookEvent{} - var expected time.Time - obj.CreatedAt = expected + obj := &DomainDmarcChecksItem{} + var expected bool + obj.Ok = expected // Act & Assert - assert.Equal(t, expected, obj.GetCreatedAt(), "getter should return the property value") + assert.Equal(t, expected, obj.GetOk(), "getter should return the property value") }) - t.Run("GetCreatedAt_NilReceiver", func(t *testing.T) { + t.Run("GetOk_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DomainWebhookEvent + var obj *DomainDmarcChecksItem // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetCreatedAt() // Should return zero value - }) - - t.Run("GetData", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &DomainWebhookEvent{} - var expected *DomainWebhookEventData - obj.Data = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetData(), "getter should return the property value") + _ = obj.GetOk() // Should return zero value }) - t.Run("GetData_NilValue", func(t *testing.T) { + t.Run("GetMessage", func(t *testing.T) { t.Parallel() // Arrange - obj := &DomainWebhookEvent{} - obj.Data = nil + obj := &DomainDmarcChecksItem{} + var expected string + obj.Message = expected // Act & Assert - assert.Nil(t, obj.GetData(), "getter should return nil when property is nil") + assert.Equal(t, expected, obj.GetMessage(), "getter should return the property value") }) - t.Run("GetData_NilReceiver", func(t *testing.T) { + t.Run("GetMessage_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DomainWebhookEvent + var obj *DomainDmarcChecksItem // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetData() // Should return zero value + _ = obj.GetMessage() // Should return zero value }) } -func TestSettersMarkExplicitDomainWebhookEvent(t *testing.T) { +func TestSettersMarkExplicitDomainDmarcChecksItem(t *testing.T) { t.Run("SetID_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DomainWebhookEvent{} - var fernTestValueID string + obj := &DomainDmarcChecksItem{} + var fernTestValueID DomainDmarcChecksItemID // Act obj.SetID(fernTestValueID) @@ -33817,14 +33979,14 @@ func TestSettersMarkExplicitDomainWebhookEvent(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetObject_MarksExplicit", func(t *testing.T) { + t.Run("SetOk_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DomainWebhookEvent{} - var fernTestValueObject DomainWebhookEventObject + obj := &DomainDmarcChecksItem{} + var fernTestValueOk bool // Act - obj.SetObject(fernTestValueObject) + obj.SetOk(fernTestValueOk) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -33848,14 +34010,14 @@ func TestSettersMarkExplicitDomainWebhookEvent(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetType_MarksExplicit", func(t *testing.T) { + t.Run("SetMessage_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DomainWebhookEvent{} - var fernTestValueType DomainWebhookEventType + obj := &DomainDmarcChecksItem{} + var fernTestValueMessage string // Act - obj.SetType(fernTestValueType) + obj.SetMessage(fernTestValueMessage) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -33879,14 +34041,116 @@ func TestSettersMarkExplicitDomainWebhookEvent(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetAPIVersion_MarksExplicit", func(t *testing.T) { +} + +func TestSettersDomainDmarcNext(t *testing.T) { + t.Run("SetKind", func(t *testing.T) { + obj := &DomainDmarcNext{} + var fernTestValueKind DomainDmarcNextKind + obj.SetKind(fernTestValueKind) + assert.Equal(t, fernTestValueKind, obj.Kind) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetPolicy", func(t *testing.T) { + obj := &DomainDmarcNext{} + var fernTestValuePolicy DomainDmarcNextPolicy + obj.SetPolicy(fernTestValuePolicy) + assert.Equal(t, fernTestValuePolicy, obj.Policy) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetRecord", func(t *testing.T) { + obj := &DomainDmarcNext{} + var fernTestValueRecord string + obj.SetRecord(fernTestValueRecord) + assert.Equal(t, fernTestValueRecord, obj.Record) + assert.NotNil(t, obj.explicitFields) + }) + +} + +func TestGettersDomainDmarcNext(t *testing.T) { + t.Run("GetKind", func(t *testing.T) { t.Parallel() // Arrange - obj := &DomainWebhookEvent{} - var fernTestValueAPIVersion string + obj := &DomainDmarcNext{} + var expected DomainDmarcNextKind + obj.Kind = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetKind(), "getter should return the property value") + }) + + t.Run("GetKind_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *DomainDmarcNext + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetKind() // Should return zero value + }) + + t.Run("GetPolicy", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DomainDmarcNext{} + var expected DomainDmarcNextPolicy + obj.Policy = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetPolicy(), "getter should return the property value") + }) + + t.Run("GetPolicy_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *DomainDmarcNext + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetPolicy() // Should return zero value + }) + + t.Run("GetRecord", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DomainDmarcNext{} + var expected string + obj.Record = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetRecord(), "getter should return the property value") + }) + + t.Run("GetRecord_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *DomainDmarcNext + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetRecord() // Should return zero value + }) + +} + +func TestSettersMarkExplicitDomainDmarcNext(t *testing.T) { + t.Run("SetKind_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DomainDmarcNext{} + var fernTestValueKind DomainDmarcNextKind // Act - obj.SetAPIVersion(fernTestValueAPIVersion) + obj.SetKind(fernTestValueKind) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -33910,14 +34174,14 @@ func TestSettersMarkExplicitDomainWebhookEvent(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetCreatedAt_MarksExplicit", func(t *testing.T) { + t.Run("SetPolicy_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DomainWebhookEvent{} - var fernTestValueCreatedAt time.Time + obj := &DomainDmarcNext{} + var fernTestValuePolicy DomainDmarcNextPolicy // Act - obj.SetCreatedAt(fernTestValueCreatedAt) + obj.SetPolicy(fernTestValuePolicy) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -33941,14 +34205,14 @@ func TestSettersMarkExplicitDomainWebhookEvent(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetData_MarksExplicit", func(t *testing.T) { + t.Run("SetRecord_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DomainWebhookEvent{} - var fernTestValueData *DomainWebhookEventData + obj := &DomainDmarcNext{} + var fernTestValueRecord string // Act - obj.SetData(fernTestValueData) + obj.SetRecord(fernTestValueRecord) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -33974,49 +34238,9 @@ func TestSettersMarkExplicitDomainWebhookEvent(t *testing.T) { } -func TestSettersDomainWebhookEventData(t *testing.T) { - t.Run("SetOrganizationID", func(t *testing.T) { - obj := &DomainWebhookEventData{} - var fernTestValueOrganizationID string - obj.SetOrganizationID(fernTestValueOrganizationID) - assert.Equal(t, fernTestValueOrganizationID, obj.OrganizationID) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetDomainID", func(t *testing.T) { - obj := &DomainWebhookEventData{} - var fernTestValueDomainID string - obj.SetDomainID(fernTestValueDomainID) - assert.Equal(t, fernTestValueDomainID, obj.DomainID) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetDomain", func(t *testing.T) { - obj := &DomainWebhookEventData{} - var fernTestValueDomain string - obj.SetDomain(fernTestValueDomain) - assert.Equal(t, fernTestValueDomain, obj.Domain) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetDmarcReportID", func(t *testing.T) { - obj := &DomainWebhookEventData{} - var fernTestValueDmarcReportID string - obj.SetDmarcReportID(fernTestValueDmarcReportID) - assert.Equal(t, fernTestValueDmarcReportID, obj.DmarcReportID) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetReporter", func(t *testing.T) { - obj := &DomainWebhookEventData{} - var fernTestValueReporter string - obj.SetReporter(fernTestValueReporter) - assert.Equal(t, fernTestValueReporter, obj.Reporter) - assert.NotNil(t, obj.explicitFields) - }) - +func TestSettersDomainDmarcReportSummary(t *testing.T) { t.Run("SetPeriodStart", func(t *testing.T) { - obj := &DomainWebhookEventData{} + obj := &DomainDmarcReportSummary{} var fernTestValuePeriodStart time.Time obj.SetPeriodStart(fernTestValuePeriodStart) assert.Equal(t, fernTestValuePeriodStart, obj.PeriodStart) @@ -34024,15 +34248,23 @@ func TestSettersDomainWebhookEventData(t *testing.T) { }) t.Run("SetPeriodEnd", func(t *testing.T) { - obj := &DomainWebhookEventData{} + obj := &DomainDmarcReportSummary{} var fernTestValuePeriodEnd time.Time obj.SetPeriodEnd(fernTestValuePeriodEnd) assert.Equal(t, fernTestValuePeriodEnd, obj.PeriodEnd) assert.NotNil(t, obj.explicitFields) }) + t.Run("SetReports", func(t *testing.T) { + obj := &DomainDmarcReportSummary{} + var fernTestValueReports int64 + obj.SetReports(fernTestValueReports) + assert.Equal(t, fernTestValueReports, obj.Reports) + assert.NotNil(t, obj.explicitFields) + }) + t.Run("SetMessages", func(t *testing.T) { - obj := &DomainWebhookEventData{} + obj := &DomainDmarcReportSummary{} var fernTestValueMessages int64 obj.SetMessages(fernTestValueMessages) assert.Equal(t, fernTestValueMessages, obj.Messages) @@ -34040,265 +34272,327 @@ func TestSettersDomainWebhookEventData(t *testing.T) { }) t.Run("SetPassing", func(t *testing.T) { - obj := &DomainWebhookEventData{} + obj := &DomainDmarcReportSummary{} var fernTestValuePassing int64 obj.SetPassing(fernTestValuePassing) assert.Equal(t, fernTestValuePassing, obj.Passing) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetOccurredAt", func(t *testing.T) { - obj := &DomainWebhookEventData{} - var fernTestValueOccurredAt time.Time - obj.SetOccurredAt(fernTestValueOccurredAt) - assert.Equal(t, fernTestValueOccurredAt, obj.OccurredAt) + t.Run("SetCossMessages", func(t *testing.T) { + obj := &DomainDmarcReportSummary{} + var fernTestValueCossMessages int64 + obj.SetCossMessages(fernTestValueCossMessages) + assert.Equal(t, fernTestValueCossMessages, obj.CossMessages) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetCossPassing", func(t *testing.T) { + obj := &DomainDmarcReportSummary{} + var fernTestValueCossPassing int64 + obj.SetCossPassing(fernTestValueCossPassing) + assert.Equal(t, fernTestValueCossPassing, obj.CossPassing) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetFirstReportAt", func(t *testing.T) { + obj := &DomainDmarcReportSummary{} + var fernTestValueFirstReportAt *time.Time + obj.SetFirstReportAt(fernTestValueFirstReportAt) + assert.Equal(t, fernTestValueFirstReportAt, obj.FirstReportAt) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetLastReportAt", func(t *testing.T) { + obj := &DomainDmarcReportSummary{} + var fernTestValueLastReportAt *time.Time + obj.SetLastReportAt(fernTestValueLastReportAt) + assert.Equal(t, fernTestValueLastReportAt, obj.LastReportAt) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetSources", func(t *testing.T) { + obj := &DomainDmarcReportSummary{} + var fernTestValueSources []*DmarcSource + obj.SetSources(fernTestValueSources) + assert.Equal(t, fernTestValueSources, obj.Sources) assert.NotNil(t, obj.explicitFields) }) } -func TestGettersDomainWebhookEventData(t *testing.T) { - t.Run("GetOrganizationID", func(t *testing.T) { +func TestGettersDomainDmarcReportSummary(t *testing.T) { + t.Run("GetPeriodStart", func(t *testing.T) { t.Parallel() // Arrange - obj := &DomainWebhookEventData{} - var expected string - obj.OrganizationID = expected + obj := &DomainDmarcReportSummary{} + var expected time.Time + obj.PeriodStart = expected // Act & Assert - assert.Equal(t, expected, obj.GetOrganizationID(), "getter should return the property value") + assert.Equal(t, expected, obj.GetPeriodStart(), "getter should return the property value") }) - t.Run("GetOrganizationID_NilReceiver", func(t *testing.T) { + t.Run("GetPeriodStart_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DomainWebhookEventData + var obj *DomainDmarcReportSummary // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetOrganizationID() // Should return zero value + _ = obj.GetPeriodStart() // Should return zero value }) - t.Run("GetDomainID", func(t *testing.T) { + t.Run("GetPeriodEnd", func(t *testing.T) { t.Parallel() // Arrange - obj := &DomainWebhookEventData{} - var expected string - obj.DomainID = expected + obj := &DomainDmarcReportSummary{} + var expected time.Time + obj.PeriodEnd = expected // Act & Assert - assert.Equal(t, expected, obj.GetDomainID(), "getter should return the property value") + assert.Equal(t, expected, obj.GetPeriodEnd(), "getter should return the property value") }) - t.Run("GetDomainID_NilReceiver", func(t *testing.T) { + t.Run("GetPeriodEnd_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DomainWebhookEventData + var obj *DomainDmarcReportSummary // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetDomainID() // Should return zero value + _ = obj.GetPeriodEnd() // Should return zero value }) - t.Run("GetDomain", func(t *testing.T) { + t.Run("GetReports", func(t *testing.T) { t.Parallel() // Arrange - obj := &DomainWebhookEventData{} - var expected string - obj.Domain = expected + obj := &DomainDmarcReportSummary{} + var expected int64 + obj.Reports = expected // Act & Assert - assert.Equal(t, expected, obj.GetDomain(), "getter should return the property value") + assert.Equal(t, expected, obj.GetReports(), "getter should return the property value") }) - t.Run("GetDomain_NilReceiver", func(t *testing.T) { + t.Run("GetReports_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DomainWebhookEventData + var obj *DomainDmarcReportSummary // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetDomain() // Should return zero value + _ = obj.GetReports() // Should return zero value }) - t.Run("GetDmarcReportID", func(t *testing.T) { + t.Run("GetMessages", func(t *testing.T) { t.Parallel() // Arrange - obj := &DomainWebhookEventData{} - var expected string - obj.DmarcReportID = expected + obj := &DomainDmarcReportSummary{} + var expected int64 + obj.Messages = expected // Act & Assert - assert.Equal(t, expected, obj.GetDmarcReportID(), "getter should return the property value") + assert.Equal(t, expected, obj.GetMessages(), "getter should return the property value") }) - t.Run("GetDmarcReportID_NilReceiver", func(t *testing.T) { + t.Run("GetMessages_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DomainWebhookEventData + var obj *DomainDmarcReportSummary // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetDmarcReportID() // Should return zero value + _ = obj.GetMessages() // Should return zero value }) - t.Run("GetReporter", func(t *testing.T) { + t.Run("GetPassing", func(t *testing.T) { t.Parallel() // Arrange - obj := &DomainWebhookEventData{} - var expected string - obj.Reporter = expected + obj := &DomainDmarcReportSummary{} + var expected int64 + obj.Passing = expected // Act & Assert - assert.Equal(t, expected, obj.GetReporter(), "getter should return the property value") + assert.Equal(t, expected, obj.GetPassing(), "getter should return the property value") }) - t.Run("GetReporter_NilReceiver", func(t *testing.T) { + t.Run("GetPassing_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DomainWebhookEventData + var obj *DomainDmarcReportSummary // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetReporter() // Should return zero value + _ = obj.GetPassing() // Should return zero value }) - t.Run("GetPeriodStart", func(t *testing.T) { + t.Run("GetCossMessages", func(t *testing.T) { t.Parallel() // Arrange - obj := &DomainWebhookEventData{} - var expected time.Time - obj.PeriodStart = expected + obj := &DomainDmarcReportSummary{} + var expected int64 + obj.CossMessages = expected // Act & Assert - assert.Equal(t, expected, obj.GetPeriodStart(), "getter should return the property value") + assert.Equal(t, expected, obj.GetCossMessages(), "getter should return the property value") }) - t.Run("GetPeriodStart_NilReceiver", func(t *testing.T) { + t.Run("GetCossMessages_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DomainWebhookEventData + var obj *DomainDmarcReportSummary // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetPeriodStart() // Should return zero value + _ = obj.GetCossMessages() // Should return zero value }) - t.Run("GetPeriodEnd", func(t *testing.T) { + t.Run("GetCossPassing", func(t *testing.T) { t.Parallel() // Arrange - obj := &DomainWebhookEventData{} - var expected time.Time - obj.PeriodEnd = expected + obj := &DomainDmarcReportSummary{} + var expected int64 + obj.CossPassing = expected // Act & Assert - assert.Equal(t, expected, obj.GetPeriodEnd(), "getter should return the property value") + assert.Equal(t, expected, obj.GetCossPassing(), "getter should return the property value") }) - t.Run("GetPeriodEnd_NilReceiver", func(t *testing.T) { + t.Run("GetCossPassing_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DomainWebhookEventData + var obj *DomainDmarcReportSummary // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetPeriodEnd() // Should return zero value + _ = obj.GetCossPassing() // Should return zero value }) - t.Run("GetMessages", func(t *testing.T) { + t.Run("GetFirstReportAt", func(t *testing.T) { t.Parallel() // Arrange - obj := &DomainWebhookEventData{} - var expected int64 - obj.Messages = expected + obj := &DomainDmarcReportSummary{} + var expected *time.Time + obj.FirstReportAt = expected // Act & Assert - assert.Equal(t, expected, obj.GetMessages(), "getter should return the property value") + assert.Equal(t, expected, obj.GetFirstReportAt(), "getter should return the property value") }) - t.Run("GetMessages_NilReceiver", func(t *testing.T) { + t.Run("GetFirstReportAt_NilValue", func(t *testing.T) { t.Parallel() - var obj *DomainWebhookEventData + // Arrange + obj := &DomainDmarcReportSummary{} + obj.FirstReportAt = nil + + // Act & Assert + assert.Nil(t, obj.GetFirstReportAt(), "getter should return nil when property is nil") + }) + + t.Run("GetFirstReportAt_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *DomainDmarcReportSummary // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetMessages() // Should return zero value + _ = obj.GetFirstReportAt() // Should return zero value }) - t.Run("GetPassing", func(t *testing.T) { + t.Run("GetLastReportAt", func(t *testing.T) { t.Parallel() // Arrange - obj := &DomainWebhookEventData{} - var expected int64 - obj.Passing = expected + obj := &DomainDmarcReportSummary{} + var expected *time.Time + obj.LastReportAt = expected // Act & Assert - assert.Equal(t, expected, obj.GetPassing(), "getter should return the property value") + assert.Equal(t, expected, obj.GetLastReportAt(), "getter should return the property value") }) - t.Run("GetPassing_NilReceiver", func(t *testing.T) { + t.Run("GetLastReportAt_NilValue", func(t *testing.T) { t.Parallel() - var obj *DomainWebhookEventData + // Arrange + obj := &DomainDmarcReportSummary{} + obj.LastReportAt = nil + + // Act & Assert + assert.Nil(t, obj.GetLastReportAt(), "getter should return nil when property is nil") + }) + + t.Run("GetLastReportAt_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *DomainDmarcReportSummary // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetPassing() // Should return zero value + _ = obj.GetLastReportAt() // Should return zero value }) - t.Run("GetOccurredAt", func(t *testing.T) { + t.Run("GetSources", func(t *testing.T) { t.Parallel() // Arrange - obj := &DomainWebhookEventData{} - var expected time.Time - obj.OccurredAt = expected + obj := &DomainDmarcReportSummary{} + var expected []*DmarcSource + obj.Sources = expected // Act & Assert - assert.Equal(t, expected, obj.GetOccurredAt(), "getter should return the property value") + assert.Equal(t, expected, obj.GetSources(), "getter should return the property value") }) - t.Run("GetOccurredAt_NilReceiver", func(t *testing.T) { + t.Run("GetSources_NilValue", func(t *testing.T) { t.Parallel() - var obj *DomainWebhookEventData + // Arrange + obj := &DomainDmarcReportSummary{} + obj.Sources = nil + + // Act & Assert + assert.Nil(t, obj.GetSources(), "getter should return nil when property is nil") + }) + + t.Run("GetSources_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *DomainDmarcReportSummary // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetOccurredAt() // Should return zero value + _ = obj.GetSources() // Should return zero value }) } -func TestSettersMarkExplicitDomainWebhookEventData(t *testing.T) { - t.Run("SetOrganizationID_MarksExplicit", func(t *testing.T) { +func TestSettersMarkExplicitDomainDmarcReportSummary(t *testing.T) { + t.Run("SetPeriodStart_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DomainWebhookEventData{} - var fernTestValueOrganizationID string + obj := &DomainDmarcReportSummary{} + var fernTestValuePeriodStart time.Time // Act - obj.SetOrganizationID(fernTestValueOrganizationID) + obj.SetPeriodStart(fernTestValuePeriodStart) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -34322,14 +34616,14 @@ func TestSettersMarkExplicitDomainWebhookEventData(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetDomainID_MarksExplicit", func(t *testing.T) { + t.Run("SetPeriodEnd_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DomainWebhookEventData{} - var fernTestValueDomainID string + obj := &DomainDmarcReportSummary{} + var fernTestValuePeriodEnd time.Time // Act - obj.SetDomainID(fernTestValueDomainID) + obj.SetPeriodEnd(fernTestValuePeriodEnd) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -34353,14 +34647,14 @@ func TestSettersMarkExplicitDomainWebhookEventData(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetDomain_MarksExplicit", func(t *testing.T) { + t.Run("SetReports_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DomainWebhookEventData{} - var fernTestValueDomain string + obj := &DomainDmarcReportSummary{} + var fernTestValueReports int64 // Act - obj.SetDomain(fernTestValueDomain) + obj.SetReports(fernTestValueReports) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -34384,14 +34678,14 @@ func TestSettersMarkExplicitDomainWebhookEventData(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetDmarcReportID_MarksExplicit", func(t *testing.T) { + t.Run("SetMessages_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DomainWebhookEventData{} - var fernTestValueDmarcReportID string + obj := &DomainDmarcReportSummary{} + var fernTestValueMessages int64 // Act - obj.SetDmarcReportID(fernTestValueDmarcReportID) + obj.SetMessages(fernTestValueMessages) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -34415,14 +34709,14 @@ func TestSettersMarkExplicitDomainWebhookEventData(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetReporter_MarksExplicit", func(t *testing.T) { + t.Run("SetPassing_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DomainWebhookEventData{} - var fernTestValueReporter string + obj := &DomainDmarcReportSummary{} + var fernTestValuePassing int64 // Act - obj.SetReporter(fernTestValueReporter) + obj.SetPassing(fernTestValuePassing) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -34446,14 +34740,14 @@ func TestSettersMarkExplicitDomainWebhookEventData(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetPeriodStart_MarksExplicit", func(t *testing.T) { + t.Run("SetCossMessages_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DomainWebhookEventData{} - var fernTestValuePeriodStart time.Time + obj := &DomainDmarcReportSummary{} + var fernTestValueCossMessages int64 // Act - obj.SetPeriodStart(fernTestValuePeriodStart) + obj.SetCossMessages(fernTestValueCossMessages) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -34477,14 +34771,14 @@ func TestSettersMarkExplicitDomainWebhookEventData(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetPeriodEnd_MarksExplicit", func(t *testing.T) { + t.Run("SetCossPassing_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DomainWebhookEventData{} - var fernTestValuePeriodEnd time.Time + obj := &DomainDmarcReportSummary{} + var fernTestValueCossPassing int64 // Act - obj.SetPeriodEnd(fernTestValuePeriodEnd) + obj.SetCossPassing(fernTestValueCossPassing) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -34508,14 +34802,14 @@ func TestSettersMarkExplicitDomainWebhookEventData(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetMessages_MarksExplicit", func(t *testing.T) { + t.Run("SetFirstReportAt_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DomainWebhookEventData{} - var fernTestValueMessages int64 + obj := &DomainDmarcReportSummary{} + var fernTestValueFirstReportAt *time.Time // Act - obj.SetMessages(fernTestValueMessages) + obj.SetFirstReportAt(fernTestValueFirstReportAt) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -34539,14 +34833,14 @@ func TestSettersMarkExplicitDomainWebhookEventData(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetPassing_MarksExplicit", func(t *testing.T) { + t.Run("SetLastReportAt_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DomainWebhookEventData{} - var fernTestValuePassing int64 + obj := &DomainDmarcReportSummary{} + var fernTestValueLastReportAt *time.Time // Act - obj.SetPassing(fernTestValuePassing) + obj.SetLastReportAt(fernTestValueLastReportAt) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -34570,14 +34864,14 @@ func TestSettersMarkExplicitDomainWebhookEventData(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetOccurredAt_MarksExplicit", func(t *testing.T) { + t.Run("SetSources_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DomainWebhookEventData{} - var fernTestValueOccurredAt time.Time + obj := &DomainDmarcReportSummary{} + var fernTestValueSources []*DmarcSource // Act - obj.SetOccurredAt(fernTestValueOccurredAt) + obj.SetSources(fernTestValueSources) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -34603,651 +34897,227 @@ func TestSettersMarkExplicitDomainWebhookEventData(t *testing.T) { } -func TestSettersEmail(t *testing.T) { - t.Run("SetObject", func(t *testing.T) { - obj := &Email{} - var fernTestValueObject EmailObject - obj.SetObject(fernTestValueObject) - assert.Equal(t, fernTestValueObject, obj.Object) +func TestSettersDomainRecord(t *testing.T) { + t.Run("SetPurpose", func(t *testing.T) { + obj := &DomainRecord{} + var fernTestValuePurpose DomainRecordPurpose + obj.SetPurpose(fernTestValuePurpose) + assert.Equal(t, fernTestValuePurpose, obj.Purpose) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetID", func(t *testing.T) { - obj := &Email{} - var fernTestValueID string - obj.SetID(fernTestValueID) - assert.Equal(t, fernTestValueID, obj.ID) + t.Run("SetType", func(t *testing.T) { + obj := &DomainRecord{} + var fernTestValueType DomainRecordType + obj.SetType(fernTestValueType) + assert.Equal(t, fernTestValueType, obj.Type) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetFrom", func(t *testing.T) { - obj := &Email{} - var fernTestValueFrom string - obj.SetFrom(fernTestValueFrom) - assert.Equal(t, fernTestValueFrom, obj.From) + t.Run("SetName", func(t *testing.T) { + obj := &DomainRecord{} + var fernTestValueName string + obj.SetName(fernTestValueName) + assert.Equal(t, fernTestValueName, obj.Name) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetTo", func(t *testing.T) { - obj := &Email{} - var fernTestValueTo []string - obj.SetTo(fernTestValueTo) - assert.Equal(t, fernTestValueTo, obj.To) + t.Run("SetValue", func(t *testing.T) { + obj := &DomainRecord{} + var fernTestValueValue string + obj.SetValue(fernTestValueValue) + assert.Equal(t, fernTestValueValue, obj.Value) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetCc", func(t *testing.T) { - obj := &Email{} - var fernTestValueCc []string - obj.SetCc(fernTestValueCc) - assert.Equal(t, fernTestValueCc, obj.Cc) + t.Run("SetPriority", func(t *testing.T) { + obj := &DomainRecord{} + var fernTestValuePriority *int64 + obj.SetPriority(fernTestValuePriority) + assert.Equal(t, fernTestValuePriority, obj.Priority) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetBcc", func(t *testing.T) { - obj := &Email{} - var fernTestValueBcc []string - obj.SetBcc(fernTestValueBcc) - assert.Equal(t, fernTestValueBcc, obj.Bcc) + t.Run("SetRequired", func(t *testing.T) { + obj := &DomainRecord{} + var fernTestValueRequired bool + obj.SetRequired(fernTestValueRequired) + assert.Equal(t, fernTestValueRequired, obj.Required) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetReplyTo", func(t *testing.T) { - obj := &Email{} - var fernTestValueReplyTo []string - obj.SetReplyTo(fernTestValueReplyTo) - assert.Equal(t, fernTestValueReplyTo, obj.ReplyTo) + t.Run("SetStatus", func(t *testing.T) { + obj := &DomainRecord{} + var fernTestValueStatus DomainRecordStatus + obj.SetStatus(fernTestValueStatus) + assert.Equal(t, fernTestValueStatus, obj.Status) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetSubject", func(t *testing.T) { - obj := &Email{} - var fernTestValueSubject string - obj.SetSubject(fernTestValueSubject) - assert.Equal(t, fernTestValueSubject, obj.Subject) + t.Run("SetFound", func(t *testing.T) { + obj := &DomainRecord{} + var fernTestValueFound []string + obj.SetFound(fernTestValueFound) + assert.Equal(t, fernTestValueFound, obj.Found) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetHTML", func(t *testing.T) { - obj := &Email{} - var fernTestValueHTML *string - obj.SetHTML(fernTestValueHTML) - assert.Equal(t, fernTestValueHTML, obj.HTML) - assert.NotNil(t, obj.explicitFields) - }) +} - t.Run("SetText", func(t *testing.T) { - obj := &Email{} - var fernTestValueText *string - obj.SetText(fernTestValueText) - assert.Equal(t, fernTestValueText, obj.Text) - assert.NotNil(t, obj.explicitFields) - }) +func TestGettersDomainRecord(t *testing.T) { + t.Run("GetPurpose", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DomainRecord{} + var expected DomainRecordPurpose + obj.Purpose = expected - t.Run("SetHeaders", func(t *testing.T) { - obj := &Email{} - var fernTestValueHeaders map[string]string - obj.SetHeaders(fernTestValueHeaders) - assert.Equal(t, fernTestValueHeaders, obj.Headers) - assert.NotNil(t, obj.explicitFields) + // Act & Assert + assert.Equal(t, expected, obj.GetPurpose(), "getter should return the property value") }) - t.Run("SetTags", func(t *testing.T) { - obj := &Email{} - var fernTestValueTags []*EmailTagsItem - obj.SetTags(fernTestValueTags) - assert.Equal(t, fernTestValueTags, obj.Tags) - assert.NotNil(t, obj.explicitFields) + t.Run("GetPurpose_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *DomainRecord + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetPurpose() // Should return zero value }) - t.Run("SetCategory", func(t *testing.T) { - obj := &Email{} - var fernTestValueCategory *string - obj.SetCategory(fernTestValueCategory) - assert.Equal(t, fernTestValueCategory, obj.Category) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetStream", func(t *testing.T) { - obj := &Email{} - var fernTestValueStream EmailStream - obj.SetStream(fernTestValueStream) - assert.Equal(t, fernTestValueStream, obj.Stream) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetStatus", func(t *testing.T) { - obj := &Email{} - var fernTestValueStatus EmailStatus - obj.SetStatus(fernTestValueStatus) - assert.Equal(t, fernTestValueStatus, obj.Status) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetFailure", func(t *testing.T) { - obj := &Email{} - var fernTestValueFailure *EmailFailure - obj.SetFailure(fernTestValueFailure) - assert.Equal(t, fernTestValueFailure, obj.Failure) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetRecipients", func(t *testing.T) { - obj := &Email{} - var fernTestValueRecipients []*EmailRecipient - obj.SetRecipients(fernTestValueRecipients) - assert.Equal(t, fernTestValueRecipients, obj.Recipients) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetAttachments", func(t *testing.T) { - obj := &Email{} - var fernTestValueAttachments []*EmailAttachment - obj.SetAttachments(fernTestValueAttachments) - assert.Equal(t, fernTestValueAttachments, obj.Attachments) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetSandbox", func(t *testing.T) { - obj := &Email{} - var fernTestValueSandbox bool - obj.SetSandbox(fernTestValueSandbox) - assert.Equal(t, fernTestValueSandbox, obj.Sandbox) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetTracking", func(t *testing.T) { - obj := &Email{} - var fernTestValueTracking *EmailTracking - obj.SetTracking(fernTestValueTracking) - assert.Equal(t, fernTestValueTracking, obj.Tracking) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetCreatedAt", func(t *testing.T) { - obj := &Email{} - var fernTestValueCreatedAt time.Time - obj.SetCreatedAt(fernTestValueCreatedAt) - assert.Equal(t, fernTestValueCreatedAt, obj.CreatedAt) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetSentAt", func(t *testing.T) { - obj := &Email{} - var fernTestValueSentAt *time.Time - obj.SetSentAt(fernTestValueSentAt) - assert.Equal(t, fernTestValueSentAt, obj.SentAt) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetScheduledAt", func(t *testing.T) { - obj := &Email{} - var fernTestValueScheduledAt *time.Time - obj.SetScheduledAt(fernTestValueScheduledAt) - assert.Equal(t, fernTestValueScheduledAt, obj.ScheduledAt) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetBatchID", func(t *testing.T) { - obj := &Email{} - var fernTestValueBatchID *string - obj.SetBatchID(fernTestValueBatchID) - assert.Equal(t, fernTestValueBatchID, obj.BatchID) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetTemplate", func(t *testing.T) { - obj := &Email{} - var fernTestValueTemplate *EmailTemplateReference - obj.SetTemplate(fernTestValueTemplate) - assert.Equal(t, fernTestValueTemplate, obj.Template) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetBroadcastID", func(t *testing.T) { - obj := &Email{} - var fernTestValueBroadcastID *string - obj.SetBroadcastID(fernTestValueBroadcastID) - assert.Equal(t, fernTestValueBroadcastID, obj.BroadcastID) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetSubaccountID", func(t *testing.T) { - obj := &Email{} - var fernTestValueSubaccountID *string - obj.SetSubaccountID(fernTestValueSubaccountID) - assert.Equal(t, fernTestValueSubaccountID, obj.SubaccountID) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetContentStorage", func(t *testing.T) { - obj := &Email{} - var fernTestValueContentStorage *EmailContentStorage - obj.SetContentStorage(fernTestValueContentStorage) - assert.Equal(t, fernTestValueContentStorage, obj.ContentStorage) - assert.NotNil(t, obj.explicitFields) - }) - -} - -func TestGettersEmail(t *testing.T) { - t.Run("GetObject", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &Email{} - var expected EmailObject - obj.Object = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetObject(), "getter should return the property value") - }) - - t.Run("GetObject_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *Email - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetObject() // Should return zero value - }) - - t.Run("GetID", func(t *testing.T) { + t.Run("GetType", func(t *testing.T) { t.Parallel() // Arrange - obj := &Email{} - var expected string - obj.ID = expected + obj := &DomainRecord{} + var expected DomainRecordType + obj.Type = expected // Act & Assert - assert.Equal(t, expected, obj.GetID(), "getter should return the property value") + assert.Equal(t, expected, obj.GetType(), "getter should return the property value") }) - t.Run("GetID_NilReceiver", func(t *testing.T) { + t.Run("GetType_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *Email + var obj *DomainRecord // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetID() // Should return zero value + _ = obj.GetType() // Should return zero value }) - t.Run("GetFrom", func(t *testing.T) { + t.Run("GetName", func(t *testing.T) { t.Parallel() // Arrange - obj := &Email{} + obj := &DomainRecord{} var expected string - obj.From = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetFrom(), "getter should return the property value") - }) - - t.Run("GetFrom_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *Email - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetFrom() // Should return zero value - }) - - t.Run("GetTo", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &Email{} - var expected []string - obj.To = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetTo(), "getter should return the property value") - }) - - t.Run("GetTo_NilValue", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &Email{} - obj.To = nil - - // Act & Assert - assert.Nil(t, obj.GetTo(), "getter should return nil when property is nil") - }) - - t.Run("GetTo_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *Email - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetTo() // Should return zero value - }) - - t.Run("GetCc", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &Email{} - var expected []string - obj.Cc = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetCc(), "getter should return the property value") - }) - - t.Run("GetCc_NilValue", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &Email{} - obj.Cc = nil - - // Act & Assert - assert.Nil(t, obj.GetCc(), "getter should return nil when property is nil") - }) - - t.Run("GetCc_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *Email - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetCc() // Should return zero value - }) - - t.Run("GetBcc", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &Email{} - var expected []string - obj.Bcc = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetBcc(), "getter should return the property value") - }) - - t.Run("GetBcc_NilValue", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &Email{} - obj.Bcc = nil - - // Act & Assert - assert.Nil(t, obj.GetBcc(), "getter should return nil when property is nil") - }) - - t.Run("GetBcc_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *Email - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetBcc() // Should return zero value - }) - - t.Run("GetReplyTo", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &Email{} - var expected []string - obj.ReplyTo = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetReplyTo(), "getter should return the property value") - }) - - t.Run("GetReplyTo_NilValue", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &Email{} - obj.ReplyTo = nil + obj.Name = expected // Act & Assert - assert.Nil(t, obj.GetReplyTo(), "getter should return nil when property is nil") + assert.Equal(t, expected, obj.GetName(), "getter should return the property value") }) - t.Run("GetReplyTo_NilReceiver", func(t *testing.T) { + t.Run("GetName_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *Email + var obj *DomainRecord // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetReplyTo() // Should return zero value + _ = obj.GetName() // Should return zero value }) - t.Run("GetSubject", func(t *testing.T) { + t.Run("GetValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &Email{} + obj := &DomainRecord{} var expected string - obj.Subject = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetSubject(), "getter should return the property value") - }) - - t.Run("GetSubject_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *Email - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetSubject() // Should return zero value - }) - - t.Run("GetHTML", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &Email{} - var expected *string - obj.HTML = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetHTML(), "getter should return the property value") - }) - - t.Run("GetHTML_NilValue", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &Email{} - obj.HTML = nil - - // Act & Assert - assert.Nil(t, obj.GetHTML(), "getter should return nil when property is nil") - }) - - t.Run("GetHTML_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *Email - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetHTML() // Should return zero value - }) - - t.Run("GetText", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &Email{} - var expected *string - obj.Text = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetText(), "getter should return the property value") - }) - - t.Run("GetText_NilValue", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &Email{} - obj.Text = nil - - // Act & Assert - assert.Nil(t, obj.GetText(), "getter should return nil when property is nil") - }) - - t.Run("GetText_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *Email - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetText() // Should return zero value - }) - - t.Run("GetHeaders", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &Email{} - var expected map[string]string - obj.Headers = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetHeaders(), "getter should return the property value") - }) - - t.Run("GetHeaders_NilValue", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &Email{} - obj.Headers = nil - - // Act & Assert - assert.Nil(t, obj.GetHeaders(), "getter should return nil when property is nil") - }) - - t.Run("GetHeaders_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *Email - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetHeaders() // Should return zero value - }) - - t.Run("GetTags", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &Email{} - var expected []*EmailTagsItem - obj.Tags = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetTags(), "getter should return the property value") - }) - - t.Run("GetTags_NilValue", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &Email{} - obj.Tags = nil + obj.Value = expected // Act & Assert - assert.Nil(t, obj.GetTags(), "getter should return nil when property is nil") + assert.Equal(t, expected, obj.GetValue(), "getter should return the property value") }) - t.Run("GetTags_NilReceiver", func(t *testing.T) { + t.Run("GetValue_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *Email + var obj *DomainRecord // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetTags() // Should return zero value + _ = obj.GetValue() // Should return zero value }) - t.Run("GetCategory", func(t *testing.T) { + t.Run("GetPriority", func(t *testing.T) { t.Parallel() // Arrange - obj := &Email{} - var expected *string - obj.Category = expected + obj := &DomainRecord{} + var expected *int64 + obj.Priority = expected // Act & Assert - assert.Equal(t, expected, obj.GetCategory(), "getter should return the property value") + assert.Equal(t, expected, obj.GetPriority(), "getter should return the property value") }) - t.Run("GetCategory_NilValue", func(t *testing.T) { + t.Run("GetPriority_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &Email{} - obj.Category = nil + obj := &DomainRecord{} + obj.Priority = nil // Act & Assert - assert.Nil(t, obj.GetCategory(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetPriority(), "getter should return nil when property is nil") }) - t.Run("GetCategory_NilReceiver", func(t *testing.T) { + t.Run("GetPriority_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *Email + var obj *DomainRecord // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetCategory() // Should return zero value + _ = obj.GetPriority() // Should return zero value }) - t.Run("GetStream", func(t *testing.T) { + t.Run("GetRequired", func(t *testing.T) { t.Parallel() // Arrange - obj := &Email{} - var expected EmailStream - obj.Stream = expected + obj := &DomainRecord{} + var expected bool + obj.Required = expected // Act & Assert - assert.Equal(t, expected, obj.GetStream(), "getter should return the property value") + assert.Equal(t, expected, obj.GetRequired(), "getter should return the property value") }) - t.Run("GetStream_NilReceiver", func(t *testing.T) { + t.Run("GetRequired_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *Email + var obj *DomainRecord // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetStream() // Should return zero value + _ = obj.GetRequired() // Should return zero value }) t.Run("GetStatus", func(t *testing.T) { t.Parallel() // Arrange - obj := &Email{} - var expected EmailStatus + obj := &DomainRecord{} + var expected DomainRecordStatus obj.Status = expected // Act & Assert @@ -35256,7 +35126,7 @@ func TestGettersEmail(t *testing.T) { t.Run("GetStatus_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *Email + var obj *DomainRecord // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -35266,426 +35136,50 @@ func TestGettersEmail(t *testing.T) { _ = obj.GetStatus() // Should return zero value }) - t.Run("GetFailure", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &Email{} - var expected *EmailFailure - obj.Failure = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetFailure(), "getter should return the property value") - }) - - t.Run("GetFailure_NilValue", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &Email{} - obj.Failure = nil - - // Act & Assert - assert.Nil(t, obj.GetFailure(), "getter should return nil when property is nil") - }) - - t.Run("GetFailure_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *Email - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetFailure() // Should return zero value - }) - - t.Run("GetRecipients", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &Email{} - var expected []*EmailRecipient - obj.Recipients = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetRecipients(), "getter should return the property value") - }) - - t.Run("GetRecipients_NilValue", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &Email{} - obj.Recipients = nil - - // Act & Assert - assert.Nil(t, obj.GetRecipients(), "getter should return nil when property is nil") - }) - - t.Run("GetRecipients_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *Email - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetRecipients() // Should return zero value - }) - - t.Run("GetAttachments", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &Email{} - var expected []*EmailAttachment - obj.Attachments = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetAttachments(), "getter should return the property value") - }) - - t.Run("GetAttachments_NilValue", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &Email{} - obj.Attachments = nil - - // Act & Assert - assert.Nil(t, obj.GetAttachments(), "getter should return nil when property is nil") - }) - - t.Run("GetAttachments_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *Email - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetAttachments() // Should return zero value - }) - - t.Run("GetSandbox", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &Email{} - var expected bool - obj.Sandbox = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetSandbox(), "getter should return the property value") - }) - - t.Run("GetSandbox_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *Email - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetSandbox() // Should return zero value - }) - - t.Run("GetTracking", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &Email{} - var expected *EmailTracking - obj.Tracking = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetTracking(), "getter should return the property value") - }) - - t.Run("GetTracking_NilValue", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &Email{} - obj.Tracking = nil - - // Act & Assert - assert.Nil(t, obj.GetTracking(), "getter should return nil when property is nil") - }) - - t.Run("GetTracking_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *Email - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetTracking() // Should return zero value - }) - - t.Run("GetCreatedAt", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &Email{} - var expected time.Time - obj.CreatedAt = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetCreatedAt(), "getter should return the property value") - }) - - t.Run("GetCreatedAt_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *Email - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetCreatedAt() // Should return zero value - }) - - t.Run("GetSentAt", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &Email{} - var expected *time.Time - obj.SentAt = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetSentAt(), "getter should return the property value") - }) - - t.Run("GetSentAt_NilValue", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &Email{} - obj.SentAt = nil - - // Act & Assert - assert.Nil(t, obj.GetSentAt(), "getter should return nil when property is nil") - }) - - t.Run("GetSentAt_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *Email - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetSentAt() // Should return zero value - }) - - t.Run("GetScheduledAt", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &Email{} - var expected *time.Time - obj.ScheduledAt = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetScheduledAt(), "getter should return the property value") - }) - - t.Run("GetScheduledAt_NilValue", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &Email{} - obj.ScheduledAt = nil - - // Act & Assert - assert.Nil(t, obj.GetScheduledAt(), "getter should return nil when property is nil") - }) - - t.Run("GetScheduledAt_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *Email - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetScheduledAt() // Should return zero value - }) - - t.Run("GetBatchID", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &Email{} - var expected *string - obj.BatchID = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetBatchID(), "getter should return the property value") - }) - - t.Run("GetBatchID_NilValue", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &Email{} - obj.BatchID = nil - - // Act & Assert - assert.Nil(t, obj.GetBatchID(), "getter should return nil when property is nil") - }) - - t.Run("GetBatchID_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *Email - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetBatchID() // Should return zero value - }) - - t.Run("GetTemplate", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &Email{} - var expected *EmailTemplateReference - obj.Template = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetTemplate(), "getter should return the property value") - }) - - t.Run("GetTemplate_NilValue", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &Email{} - obj.Template = nil - - // Act & Assert - assert.Nil(t, obj.GetTemplate(), "getter should return nil when property is nil") - }) - - t.Run("GetTemplate_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *Email - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetTemplate() // Should return zero value - }) - - t.Run("GetBroadcastID", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &Email{} - var expected *string - obj.BroadcastID = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetBroadcastID(), "getter should return the property value") - }) - - t.Run("GetBroadcastID_NilValue", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &Email{} - obj.BroadcastID = nil - - // Act & Assert - assert.Nil(t, obj.GetBroadcastID(), "getter should return nil when property is nil") - }) - - t.Run("GetBroadcastID_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *Email - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetBroadcastID() // Should return zero value - }) - - t.Run("GetSubaccountID", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &Email{} - var expected *string - obj.SubaccountID = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetSubaccountID(), "getter should return the property value") - }) - - t.Run("GetSubaccountID_NilValue", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &Email{} - obj.SubaccountID = nil - - // Act & Assert - assert.Nil(t, obj.GetSubaccountID(), "getter should return nil when property is nil") - }) - - t.Run("GetSubaccountID_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *Email - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetSubaccountID() // Should return zero value - }) - - t.Run("GetContentStorage", func(t *testing.T) { + t.Run("GetFound", func(t *testing.T) { t.Parallel() // Arrange - obj := &Email{} - var expected *EmailContentStorage - obj.ContentStorage = expected + obj := &DomainRecord{} + var expected []string + obj.Found = expected // Act & Assert - assert.Equal(t, expected, obj.GetContentStorage(), "getter should return the property value") + assert.Equal(t, expected, obj.GetFound(), "getter should return the property value") }) - t.Run("GetContentStorage_NilValue", func(t *testing.T) { + t.Run("GetFound_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &Email{} - obj.ContentStorage = nil + obj := &DomainRecord{} + obj.Found = nil // Act & Assert - assert.Nil(t, obj.GetContentStorage(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetFound(), "getter should return nil when property is nil") }) - t.Run("GetContentStorage_NilReceiver", func(t *testing.T) { + t.Run("GetFound_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *Email + var obj *DomainRecord // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetContentStorage() // Should return zero value + _ = obj.GetFound() // Should return zero value }) } -func TestSettersMarkExplicitEmail(t *testing.T) { - t.Run("SetObject_MarksExplicit", func(t *testing.T) { +func TestSettersMarkExplicitDomainRecord(t *testing.T) { + t.Run("SetPurpose_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &Email{} - var fernTestValueObject EmailObject + obj := &DomainRecord{} + var fernTestValuePurpose DomainRecordPurpose // Act - obj.SetObject(fernTestValueObject) + obj.SetPurpose(fernTestValuePurpose) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -35709,14 +35203,14 @@ func TestSettersMarkExplicitEmail(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetID_MarksExplicit", func(t *testing.T) { + t.Run("SetType_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &Email{} - var fernTestValueID string + obj := &DomainRecord{} + var fernTestValueType DomainRecordType // Act - obj.SetID(fernTestValueID) + obj.SetType(fernTestValueType) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -35740,14 +35234,14 @@ func TestSettersMarkExplicitEmail(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetFrom_MarksExplicit", func(t *testing.T) { + t.Run("SetName_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &Email{} - var fernTestValueFrom string + obj := &DomainRecord{} + var fernTestValueName string // Act - obj.SetFrom(fernTestValueFrom) + obj.SetName(fernTestValueName) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -35771,14 +35265,14 @@ func TestSettersMarkExplicitEmail(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetTo_MarksExplicit", func(t *testing.T) { + t.Run("SetValue_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &Email{} - var fernTestValueTo []string + obj := &DomainRecord{} + var fernTestValueValue string // Act - obj.SetTo(fernTestValueTo) + obj.SetValue(fernTestValueValue) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -35802,14 +35296,14 @@ func TestSettersMarkExplicitEmail(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetCc_MarksExplicit", func(t *testing.T) { + t.Run("SetPriority_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &Email{} - var fernTestValueCc []string + obj := &DomainRecord{} + var fernTestValuePriority *int64 // Act - obj.SetCc(fernTestValueCc) + obj.SetPriority(fernTestValuePriority) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -35833,14 +35327,14 @@ func TestSettersMarkExplicitEmail(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetBcc_MarksExplicit", func(t *testing.T) { + t.Run("SetRequired_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &Email{} - var fernTestValueBcc []string + obj := &DomainRecord{} + var fernTestValueRequired bool // Act - obj.SetBcc(fernTestValueBcc) + obj.SetRequired(fernTestValueRequired) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -35864,14 +35358,14 @@ func TestSettersMarkExplicitEmail(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetReplyTo_MarksExplicit", func(t *testing.T) { + t.Run("SetStatus_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &Email{} - var fernTestValueReplyTo []string + obj := &DomainRecord{} + var fernTestValueStatus DomainRecordStatus // Act - obj.SetReplyTo(fernTestValueReplyTo) + obj.SetStatus(fernTestValueStatus) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -35895,14 +35389,14 @@ func TestSettersMarkExplicitEmail(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetSubject_MarksExplicit", func(t *testing.T) { + t.Run("SetFound_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &Email{} - var fernTestValueSubject string + obj := &DomainRecord{} + var fernTestValueFound []string // Act - obj.SetSubject(fernTestValueSubject) + obj.SetFound(fernTestValueFound) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -35926,262 +35420,219 @@ func TestSettersMarkExplicitEmail(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetHTML_MarksExplicit", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &Email{} - var fernTestValueHTML *string - - // Act - obj.SetHTML(fernTestValueHTML) +} - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") +func TestSettersDomainWebhookEvent(t *testing.T) { + t.Run("SetID", func(t *testing.T) { + obj := &DomainWebhookEvent{} + var fernTestValueID string + obj.SetID(fernTestValueID) + assert.Equal(t, fernTestValueID, obj.ID) + assert.NotNil(t, obj.explicitFields) + }) - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } + t.Run("SetObject", func(t *testing.T) { + obj := &DomainWebhookEvent{} + var fernTestValueObject DomainWebhookEventObject + obj.SetObject(fernTestValueObject) + assert.Equal(t, fernTestValueObject, obj.Object) + assert.NotNil(t, obj.explicitFields) + }) - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip + t.Run("SetType", func(t *testing.T) { + obj := &DomainWebhookEvent{} + var fernTestValueType DomainWebhookEventType + obj.SetType(fernTestValueType) + assert.Equal(t, fernTestValueType, obj.Type) + assert.NotNil(t, obj.explicitFields) }) - t.Run("SetText_MarksExplicit", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &Email{} - var fernTestValueText *string - - // Act - obj.SetText(fernTestValueText) - - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") + t.Run("SetAPIVersion", func(t *testing.T) { + obj := &DomainWebhookEvent{} + var fernTestValueAPIVersion string + obj.SetAPIVersion(fernTestValueAPIVersion) + assert.Equal(t, fernTestValueAPIVersion, obj.APIVersion) + assert.NotNil(t, obj.explicitFields) + }) - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } + t.Run("SetCreatedAt", func(t *testing.T) { + obj := &DomainWebhookEvent{} + var fernTestValueCreatedAt time.Time + obj.SetCreatedAt(fernTestValueCreatedAt) + assert.Equal(t, fernTestValueCreatedAt, obj.CreatedAt) + assert.NotNil(t, obj.explicitFields) + }) - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip + t.Run("SetData", func(t *testing.T) { + obj := &DomainWebhookEvent{} + var fernTestValueData *DomainWebhookEventData + obj.SetData(fernTestValueData) + assert.Equal(t, fernTestValueData, obj.Data) + assert.NotNil(t, obj.explicitFields) }) - t.Run("SetHeaders_MarksExplicit", func(t *testing.T) { +} + +func TestGettersDomainWebhookEvent(t *testing.T) { + t.Run("GetID", func(t *testing.T) { t.Parallel() // Arrange - obj := &Email{} - var fernTestValueHeaders map[string]string - - // Act - obj.SetHeaders(fernTestValueHeaders) - - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") + obj := &DomainWebhookEvent{} + var expected string + obj.ID = expected - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } + // Act & Assert + assert.Equal(t, expected, obj.GetID(), "getter should return the property value") + }) - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip + t.Run("GetID_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *DomainWebhookEvent + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetID() // Should return zero value }) - t.Run("SetTags_MarksExplicit", func(t *testing.T) { + t.Run("GetObject", func(t *testing.T) { t.Parallel() // Arrange - obj := &Email{} - var fernTestValueTags []*EmailTagsItem - - // Act - obj.SetTags(fernTestValueTags) - - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") + obj := &DomainWebhookEvent{} + var expected DomainWebhookEventObject + obj.Object = expected - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } + // Act & Assert + assert.Equal(t, expected, obj.GetObject(), "getter should return the property value") + }) - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip + t.Run("GetObject_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *DomainWebhookEvent + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetObject() // Should return zero value }) - t.Run("SetCategory_MarksExplicit", func(t *testing.T) { + t.Run("GetType", func(t *testing.T) { t.Parallel() // Arrange - obj := &Email{} - var fernTestValueCategory *string - - // Act - obj.SetCategory(fernTestValueCategory) - - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") + obj := &DomainWebhookEvent{} + var expected DomainWebhookEventType + obj.Type = expected - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } + // Act & Assert + assert.Equal(t, expected, obj.GetType(), "getter should return the property value") + }) - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip + t.Run("GetType_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *DomainWebhookEvent + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetType() // Should return zero value }) - t.Run("SetStream_MarksExplicit", func(t *testing.T) { + t.Run("GetAPIVersion", func(t *testing.T) { t.Parallel() // Arrange - obj := &Email{} - var fernTestValueStream EmailStream - - // Act - obj.SetStream(fernTestValueStream) - - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") + obj := &DomainWebhookEvent{} + var expected string + obj.APIVersion = expected - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } + // Act & Assert + assert.Equal(t, expected, obj.GetAPIVersion(), "getter should return the property value") + }) - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip + t.Run("GetAPIVersion_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *DomainWebhookEvent + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetAPIVersion() // Should return zero value }) - t.Run("SetStatus_MarksExplicit", func(t *testing.T) { + t.Run("GetCreatedAt", func(t *testing.T) { t.Parallel() // Arrange - obj := &Email{} - var fernTestValueStatus EmailStatus - - // Act - obj.SetStatus(fernTestValueStatus) - - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") + obj := &DomainWebhookEvent{} + var expected time.Time + obj.CreatedAt = expected - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } + // Act & Assert + assert.Equal(t, expected, obj.GetCreatedAt(), "getter should return the property value") + }) - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip + t.Run("GetCreatedAt_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *DomainWebhookEvent + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetCreatedAt() // Should return zero value }) - t.Run("SetFailure_MarksExplicit", func(t *testing.T) { + t.Run("GetData", func(t *testing.T) { t.Parallel() // Arrange - obj := &Email{} - var fernTestValueFailure *EmailFailure + obj := &DomainWebhookEvent{} + var expected *DomainWebhookEventData + obj.Data = expected - // Act - obj.SetFailure(fernTestValueFailure) + // Act & Assert + assert.Equal(t, expected, obj.GetData(), "getter should return the property value") + }) - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") + t.Run("GetData_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DomainWebhookEvent{} + obj.Data = nil - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } + // Act & Assert + assert.Nil(t, obj.GetData(), "getter should return nil when property is nil") + }) - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip + t.Run("GetData_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *DomainWebhookEvent + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetData() // Should return zero value }) - t.Run("SetRecipients_MarksExplicit", func(t *testing.T) { +} + +func TestSettersMarkExplicitDomainWebhookEvent(t *testing.T) { + t.Run("SetID_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &Email{} - var fernTestValueRecipients []*EmailRecipient + obj := &DomainWebhookEvent{} + var fernTestValueID string // Act - obj.SetRecipients(fernTestValueRecipients) + obj.SetID(fernTestValueID) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -36205,14 +35656,14 @@ func TestSettersMarkExplicitEmail(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetAttachments_MarksExplicit", func(t *testing.T) { + t.Run("SetObject_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &Email{} - var fernTestValueAttachments []*EmailAttachment + obj := &DomainWebhookEvent{} + var fernTestValueObject DomainWebhookEventObject // Act - obj.SetAttachments(fernTestValueAttachments) + obj.SetObject(fernTestValueObject) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -36236,14 +35687,14 @@ func TestSettersMarkExplicitEmail(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetSandbox_MarksExplicit", func(t *testing.T) { + t.Run("SetType_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &Email{} - var fernTestValueSandbox bool + obj := &DomainWebhookEvent{} + var fernTestValueType DomainWebhookEventType // Act - obj.SetSandbox(fernTestValueSandbox) + obj.SetType(fernTestValueType) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -36267,14 +35718,14 @@ func TestSettersMarkExplicitEmail(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetTracking_MarksExplicit", func(t *testing.T) { + t.Run("SetAPIVersion_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &Email{} - var fernTestValueTracking *EmailTracking + obj := &DomainWebhookEvent{} + var fernTestValueAPIVersion string // Act - obj.SetTracking(fernTestValueTracking) + obj.SetAPIVersion(fernTestValueAPIVersion) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -36301,7 +35752,7 @@ func TestSettersMarkExplicitEmail(t *testing.T) { t.Run("SetCreatedAt_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &Email{} + obj := &DomainWebhookEvent{} var fernTestValueCreatedAt time.Time // Act @@ -36329,14 +35780,14 @@ func TestSettersMarkExplicitEmail(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetSentAt_MarksExplicit", func(t *testing.T) { + t.Run("SetData_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &Email{} - var fernTestValueSentAt *time.Time + obj := &DomainWebhookEvent{} + var fernTestValueData *DomainWebhookEventData // Act - obj.SetSentAt(fernTestValueSentAt) + obj.SetData(fernTestValueData) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -36360,374 +35811,333 @@ func TestSettersMarkExplicitEmail(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetScheduledAt_MarksExplicit", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &Email{} - var fernTestValueScheduledAt *time.Time - - // Act - obj.SetScheduledAt(fernTestValueScheduledAt) - - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") - - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } +} - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip +func TestSettersDomainWebhookEventData(t *testing.T) { + t.Run("SetOrganizationID", func(t *testing.T) { + obj := &DomainWebhookEventData{} + var fernTestValueOrganizationID string + obj.SetOrganizationID(fernTestValueOrganizationID) + assert.Equal(t, fernTestValueOrganizationID, obj.OrganizationID) + assert.NotNil(t, obj.explicitFields) }) - t.Run("SetBatchID_MarksExplicit", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &Email{} - var fernTestValueBatchID *string - - // Act - obj.SetBatchID(fernTestValueBatchID) + t.Run("SetDomainID", func(t *testing.T) { + obj := &DomainWebhookEventData{} + var fernTestValueDomainID string + obj.SetDomainID(fernTestValueDomainID) + assert.Equal(t, fernTestValueDomainID, obj.DomainID) + assert.NotNil(t, obj.explicitFields) + }) - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") + t.Run("SetDomain", func(t *testing.T) { + obj := &DomainWebhookEventData{} + var fernTestValueDomain string + obj.SetDomain(fernTestValueDomain) + assert.Equal(t, fernTestValueDomain, obj.Domain) + assert.NotNil(t, obj.explicitFields) + }) - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } + t.Run("SetDmarcReportID", func(t *testing.T) { + obj := &DomainWebhookEventData{} + var fernTestValueDmarcReportID string + obj.SetDmarcReportID(fernTestValueDmarcReportID) + assert.Equal(t, fernTestValueDmarcReportID, obj.DmarcReportID) + assert.NotNil(t, obj.explicitFields) + }) - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip + t.Run("SetReporter", func(t *testing.T) { + obj := &DomainWebhookEventData{} + var fernTestValueReporter string + obj.SetReporter(fernTestValueReporter) + assert.Equal(t, fernTestValueReporter, obj.Reporter) + assert.NotNil(t, obj.explicitFields) }) - t.Run("SetTemplate_MarksExplicit", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &Email{} - var fernTestValueTemplate *EmailTemplateReference + t.Run("SetPeriodStart", func(t *testing.T) { + obj := &DomainWebhookEventData{} + var fernTestValuePeriodStart time.Time + obj.SetPeriodStart(fernTestValuePeriodStart) + assert.Equal(t, fernTestValuePeriodStart, obj.PeriodStart) + assert.NotNil(t, obj.explicitFields) + }) - // Act - obj.SetTemplate(fernTestValueTemplate) + t.Run("SetPeriodEnd", func(t *testing.T) { + obj := &DomainWebhookEventData{} + var fernTestValuePeriodEnd time.Time + obj.SetPeriodEnd(fernTestValuePeriodEnd) + assert.Equal(t, fernTestValuePeriodEnd, obj.PeriodEnd) + assert.NotNil(t, obj.explicitFields) + }) - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") + t.Run("SetMessages", func(t *testing.T) { + obj := &DomainWebhookEventData{} + var fernTestValueMessages int64 + obj.SetMessages(fernTestValueMessages) + assert.Equal(t, fernTestValueMessages, obj.Messages) + assert.NotNil(t, obj.explicitFields) + }) - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } + t.Run("SetPassing", func(t *testing.T) { + obj := &DomainWebhookEventData{} + var fernTestValuePassing int64 + obj.SetPassing(fernTestValuePassing) + assert.Equal(t, fernTestValuePassing, obj.Passing) + assert.NotNil(t, obj.explicitFields) + }) - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip + t.Run("SetOccurredAt", func(t *testing.T) { + obj := &DomainWebhookEventData{} + var fernTestValueOccurredAt time.Time + obj.SetOccurredAt(fernTestValueOccurredAt) + assert.Equal(t, fernTestValueOccurredAt, obj.OccurredAt) + assert.NotNil(t, obj.explicitFields) }) - t.Run("SetBroadcastID_MarksExplicit", func(t *testing.T) { +} + +func TestGettersDomainWebhookEventData(t *testing.T) { + t.Run("GetOrganizationID", func(t *testing.T) { t.Parallel() // Arrange - obj := &Email{} - var fernTestValueBroadcastID *string - - // Act - obj.SetBroadcastID(fernTestValueBroadcastID) - - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") - - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } + obj := &DomainWebhookEventData{} + var expected string + obj.OrganizationID = expected - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip + // Act & Assert + assert.Equal(t, expected, obj.GetOrganizationID(), "getter should return the property value") }) - t.Run("SetSubaccountID_MarksExplicit", func(t *testing.T) { + t.Run("GetOrganizationID_NilReceiver", func(t *testing.T) { t.Parallel() - // Arrange - obj := &Email{} - var fernTestValueSubaccountID *string - - // Act - obj.SetSubaccountID(fernTestValueSubaccountID) - - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") - - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } - - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip + var obj *DomainWebhookEventData + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetOrganizationID() // Should return zero value }) - t.Run("SetContentStorage_MarksExplicit", func(t *testing.T) { + t.Run("GetDomainID", func(t *testing.T) { t.Parallel() // Arrange - obj := &Email{} - var fernTestValueContentStorage *EmailContentStorage - - // Act - obj.SetContentStorage(fernTestValueContentStorage) - - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") + obj := &DomainWebhookEventData{} + var expected string + obj.DomainID = expected - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } + // Act & Assert + assert.Equal(t, expected, obj.GetDomainID(), "getter should return the property value") + }) - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip + t.Run("GetDomainID_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *DomainWebhookEventData + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetDomainID() // Should return zero value }) -} + t.Run("GetDomain", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DomainWebhookEventData{} + var expected string + obj.Domain = expected -func TestSettersEmailAttachment(t *testing.T) { - t.Run("SetID", func(t *testing.T) { - obj := &EmailAttachment{} - var fernTestValueID string - obj.SetID(fernTestValueID) - assert.Equal(t, fernTestValueID, obj.ID) - assert.NotNil(t, obj.explicitFields) + // Act & Assert + assert.Equal(t, expected, obj.GetDomain(), "getter should return the property value") }) - t.Run("SetFilename", func(t *testing.T) { - obj := &EmailAttachment{} - var fernTestValueFilename string - obj.SetFilename(fernTestValueFilename) - assert.Equal(t, fernTestValueFilename, obj.Filename) - assert.NotNil(t, obj.explicitFields) + t.Run("GetDomain_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *DomainWebhookEventData + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetDomain() // Should return zero value }) - t.Run("SetContentType", func(t *testing.T) { - obj := &EmailAttachment{} - var fernTestValueContentType string - obj.SetContentType(fernTestValueContentType) - assert.Equal(t, fernTestValueContentType, obj.ContentType) - assert.NotNil(t, obj.explicitFields) - }) + t.Run("GetDmarcReportID", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DomainWebhookEventData{} + var expected string + obj.DmarcReportID = expected - t.Run("SetContentID", func(t *testing.T) { - obj := &EmailAttachment{} - var fernTestValueContentID *string - obj.SetContentID(fernTestValueContentID) - assert.Equal(t, fernTestValueContentID, obj.ContentID) - assert.NotNil(t, obj.explicitFields) + // Act & Assert + assert.Equal(t, expected, obj.GetDmarcReportID(), "getter should return the property value") }) - t.Run("SetSize", func(t *testing.T) { - obj := &EmailAttachment{} - var fernTestValueSize int64 - obj.SetSize(fernTestValueSize) - assert.Equal(t, fernTestValueSize, obj.Size) - assert.NotNil(t, obj.explicitFields) + t.Run("GetDmarcReportID_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *DomainWebhookEventData + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetDmarcReportID() // Should return zero value }) -} - -func TestGettersEmailAttachment(t *testing.T) { - t.Run("GetID", func(t *testing.T) { + t.Run("GetReporter", func(t *testing.T) { t.Parallel() // Arrange - obj := &EmailAttachment{} + obj := &DomainWebhookEventData{} var expected string - obj.ID = expected + obj.Reporter = expected // Act & Assert - assert.Equal(t, expected, obj.GetID(), "getter should return the property value") + assert.Equal(t, expected, obj.GetReporter(), "getter should return the property value") }) - t.Run("GetID_NilReceiver", func(t *testing.T) { + t.Run("GetReporter_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *EmailAttachment + var obj *DomainWebhookEventData // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetID() // Should return zero value + _ = obj.GetReporter() // Should return zero value }) - t.Run("GetFilename", func(t *testing.T) { + t.Run("GetPeriodStart", func(t *testing.T) { t.Parallel() // Arrange - obj := &EmailAttachment{} - var expected string - obj.Filename = expected + obj := &DomainWebhookEventData{} + var expected time.Time + obj.PeriodStart = expected // Act & Assert - assert.Equal(t, expected, obj.GetFilename(), "getter should return the property value") + assert.Equal(t, expected, obj.GetPeriodStart(), "getter should return the property value") }) - t.Run("GetFilename_NilReceiver", func(t *testing.T) { + t.Run("GetPeriodStart_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *EmailAttachment + var obj *DomainWebhookEventData // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetFilename() // Should return zero value + _ = obj.GetPeriodStart() // Should return zero value }) - t.Run("GetContentType", func(t *testing.T) { + t.Run("GetPeriodEnd", func(t *testing.T) { t.Parallel() // Arrange - obj := &EmailAttachment{} - var expected string - obj.ContentType = expected + obj := &DomainWebhookEventData{} + var expected time.Time + obj.PeriodEnd = expected // Act & Assert - assert.Equal(t, expected, obj.GetContentType(), "getter should return the property value") + assert.Equal(t, expected, obj.GetPeriodEnd(), "getter should return the property value") }) - t.Run("GetContentType_NilReceiver", func(t *testing.T) { + t.Run("GetPeriodEnd_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *EmailAttachment + var obj *DomainWebhookEventData // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetContentType() // Should return zero value + _ = obj.GetPeriodEnd() // Should return zero value }) - t.Run("GetContentID", func(t *testing.T) { + t.Run("GetMessages", func(t *testing.T) { t.Parallel() // Arrange - obj := &EmailAttachment{} - var expected *string - obj.ContentID = expected + obj := &DomainWebhookEventData{} + var expected int64 + obj.Messages = expected // Act & Assert - assert.Equal(t, expected, obj.GetContentID(), "getter should return the property value") + assert.Equal(t, expected, obj.GetMessages(), "getter should return the property value") }) - t.Run("GetContentID_NilValue", func(t *testing.T) { + t.Run("GetMessages_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *DomainWebhookEventData + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetMessages() // Should return zero value + }) + + t.Run("GetPassing", func(t *testing.T) { t.Parallel() // Arrange - obj := &EmailAttachment{} - obj.ContentID = nil + obj := &DomainWebhookEventData{} + var expected int64 + obj.Passing = expected // Act & Assert - assert.Nil(t, obj.GetContentID(), "getter should return nil when property is nil") + assert.Equal(t, expected, obj.GetPassing(), "getter should return the property value") }) - t.Run("GetContentID_NilReceiver", func(t *testing.T) { + t.Run("GetPassing_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *EmailAttachment + var obj *DomainWebhookEventData // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetContentID() // Should return zero value + _ = obj.GetPassing() // Should return zero value }) - t.Run("GetSize", func(t *testing.T) { + t.Run("GetOccurredAt", func(t *testing.T) { t.Parallel() // Arrange - obj := &EmailAttachment{} - var expected int64 - obj.Size = expected + obj := &DomainWebhookEventData{} + var expected time.Time + obj.OccurredAt = expected // Act & Assert - assert.Equal(t, expected, obj.GetSize(), "getter should return the property value") + assert.Equal(t, expected, obj.GetOccurredAt(), "getter should return the property value") }) - t.Run("GetSize_NilReceiver", func(t *testing.T) { + t.Run("GetOccurredAt_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *EmailAttachment + var obj *DomainWebhookEventData // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetSize() // Should return zero value + _ = obj.GetOccurredAt() // Should return zero value }) } -func TestSettersMarkExplicitEmailAttachment(t *testing.T) { - t.Run("SetID_MarksExplicit", func(t *testing.T) { +func TestSettersMarkExplicitDomainWebhookEventData(t *testing.T) { + t.Run("SetOrganizationID_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &EmailAttachment{} - var fernTestValueID string + obj := &DomainWebhookEventData{} + var fernTestValueOrganizationID string // Act - obj.SetID(fernTestValueID) + obj.SetOrganizationID(fernTestValueOrganizationID) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -36751,14 +36161,14 @@ func TestSettersMarkExplicitEmailAttachment(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetFilename_MarksExplicit", func(t *testing.T) { + t.Run("SetDomainID_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &EmailAttachment{} - var fernTestValueFilename string + obj := &DomainWebhookEventData{} + var fernTestValueDomainID string // Act - obj.SetFilename(fernTestValueFilename) + obj.SetDomainID(fernTestValueDomainID) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -36782,14 +36192,14 @@ func TestSettersMarkExplicitEmailAttachment(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetContentType_MarksExplicit", func(t *testing.T) { + t.Run("SetDomain_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &EmailAttachment{} - var fernTestValueContentType string + obj := &DomainWebhookEventData{} + var fernTestValueDomain string // Act - obj.SetContentType(fernTestValueContentType) + obj.SetDomain(fernTestValueDomain) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -36813,14 +36223,14 @@ func TestSettersMarkExplicitEmailAttachment(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetContentID_MarksExplicit", func(t *testing.T) { + t.Run("SetDmarcReportID_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &EmailAttachment{} - var fernTestValueContentID *string + obj := &DomainWebhookEventData{} + var fernTestValueDmarcReportID string // Act - obj.SetContentID(fernTestValueContentID) + obj.SetDmarcReportID(fernTestValueDmarcReportID) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -36844,14 +36254,14 @@ func TestSettersMarkExplicitEmailAttachment(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetSize_MarksExplicit", func(t *testing.T) { + t.Run("SetReporter_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &EmailAttachment{} - var fernTestValueSize int64 + obj := &DomainWebhookEventData{} + var fernTestValueReporter string // Act - obj.SetSize(fernTestValueSize) + obj.SetReporter(fernTestValueReporter) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -36875,95 +36285,14 @@ func TestSettersMarkExplicitEmailAttachment(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) -} - -func TestSettersEmailContentStorage(t *testing.T) { - t.Run("SetMode", func(t *testing.T) { - obj := &EmailContentStorage{} - var fernTestValueMode EmailContentStorageMode - obj.SetMode(fernTestValueMode) - assert.Equal(t, fernTestValueMode, obj.Mode) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetDiscardedAt", func(t *testing.T) { - obj := &EmailContentStorage{} - var fernTestValueDiscardedAt *time.Time - obj.SetDiscardedAt(fernTestValueDiscardedAt) - assert.Equal(t, fernTestValueDiscardedAt, obj.DiscardedAt) - assert.NotNil(t, obj.explicitFields) - }) - -} - -func TestGettersEmailContentStorage(t *testing.T) { - t.Run("GetMode", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &EmailContentStorage{} - var expected EmailContentStorageMode - obj.Mode = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetMode(), "getter should return the property value") - }) - - t.Run("GetMode_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *EmailContentStorage - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetMode() // Should return zero value - }) - - t.Run("GetDiscardedAt", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &EmailContentStorage{} - var expected *time.Time - obj.DiscardedAt = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetDiscardedAt(), "getter should return the property value") - }) - - t.Run("GetDiscardedAt_NilValue", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &EmailContentStorage{} - obj.DiscardedAt = nil - - // Act & Assert - assert.Nil(t, obj.GetDiscardedAt(), "getter should return nil when property is nil") - }) - - t.Run("GetDiscardedAt_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *EmailContentStorage - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetDiscardedAt() // Should return zero value - }) - -} - -func TestSettersMarkExplicitEmailContentStorage(t *testing.T) { - t.Run("SetMode_MarksExplicit", func(t *testing.T) { + t.Run("SetPeriodStart_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &EmailContentStorage{} - var fernTestValueMode EmailContentStorageMode + obj := &DomainWebhookEventData{} + var fernTestValuePeriodStart time.Time // Act - obj.SetMode(fernTestValueMode) + obj.SetPeriodStart(fernTestValuePeriodStart) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -36987,14 +36316,14 @@ func TestSettersMarkExplicitEmailContentStorage(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetDiscardedAt_MarksExplicit", func(t *testing.T) { + t.Run("SetPeriodEnd_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &EmailContentStorage{} - var fernTestValueDiscardedAt *time.Time + obj := &DomainWebhookEventData{} + var fernTestValuePeriodEnd time.Time // Act - obj.SetDiscardedAt(fernTestValueDiscardedAt) + obj.SetPeriodEnd(fernTestValuePeriodEnd) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -37018,85 +36347,45 @@ func TestSettersMarkExplicitEmailContentStorage(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) -} - -func TestSettersEmailFailure(t *testing.T) { - t.Run("SetCode", func(t *testing.T) { - obj := &EmailFailure{} - var fernTestValueCode string - obj.SetCode(fernTestValueCode) - assert.Equal(t, fernTestValueCode, obj.Code) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetMessage", func(t *testing.T) { - obj := &EmailFailure{} - var fernTestValueMessage string - obj.SetMessage(fernTestValueMessage) - assert.Equal(t, fernTestValueMessage, obj.Message) - assert.NotNil(t, obj.explicitFields) - }) - -} - -func TestGettersEmailFailure(t *testing.T) { - t.Run("GetCode", func(t *testing.T) { + t.Run("SetMessages_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &EmailFailure{} - var expected string - obj.Code = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetCode(), "getter should return the property value") - }) + obj := &DomainWebhookEventData{} + var fernTestValueMessages int64 - t.Run("GetCode_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *EmailFailure - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetCode() // Should return zero value - }) + // Act + obj.SetMessages(fernTestValueMessages) - t.Run("GetMessage", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &EmailFailure{} - var expected string - obj.Message = expected + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") - // Act & Assert - assert.Equal(t, expected, obj.GetMessage(), "getter should return the property value") - }) + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } - t.Run("GetMessage_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *EmailFailure - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetMessage() // Should return zero value + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip }) -} - -func TestSettersMarkExplicitEmailFailure(t *testing.T) { - t.Run("SetCode_MarksExplicit", func(t *testing.T) { + t.Run("SetPassing_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &EmailFailure{} - var fernTestValueCode string + obj := &DomainWebhookEventData{} + var fernTestValuePassing int64 // Act - obj.SetCode(fernTestValueCode) + obj.SetPassing(fernTestValuePassing) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -37120,14 +36409,14 @@ func TestSettersMarkExplicitEmailFailure(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetMessage_MarksExplicit", func(t *testing.T) { + t.Run("SetOccurredAt_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &EmailFailure{} - var fernTestValueMessage string + obj := &DomainWebhookEventData{} + var fernTestValueOccurredAt time.Time // Act - obj.SetMessage(fernTestValueMessage) + obj.SetOccurredAt(fernTestValueOccurredAt) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -37153,718 +36442,828 @@ func TestSettersMarkExplicitEmailFailure(t *testing.T) { } -func TestSettersEmailRecipient(t *testing.T) { - t.Run("SetAddress", func(t *testing.T) { - obj := &EmailRecipient{} - var fernTestValueAddress string - obj.SetAddress(fernTestValueAddress) - assert.Equal(t, fernTestValueAddress, obj.Address) +func TestSettersEmail(t *testing.T) { + t.Run("SetObject", func(t *testing.T) { + obj := &Email{} + var fernTestValueObject EmailObject + obj.SetObject(fernTestValueObject) + assert.Equal(t, fernTestValueObject, obj.Object) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetType", func(t *testing.T) { - obj := &EmailRecipient{} - var fernTestValueType EmailRecipientType - obj.SetType(fernTestValueType) - assert.Equal(t, fernTestValueType, obj.Type) + t.Run("SetID", func(t *testing.T) { + obj := &Email{} + var fernTestValueID string + obj.SetID(fernTestValueID) + assert.Equal(t, fernTestValueID, obj.ID) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetFrom", func(t *testing.T) { + obj := &Email{} + var fernTestValueFrom string + obj.SetFrom(fernTestValueFrom) + assert.Equal(t, fernTestValueFrom, obj.From) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetTo", func(t *testing.T) { + obj := &Email{} + var fernTestValueTo []string + obj.SetTo(fernTestValueTo) + assert.Equal(t, fernTestValueTo, obj.To) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetCc", func(t *testing.T) { + obj := &Email{} + var fernTestValueCc []string + obj.SetCc(fernTestValueCc) + assert.Equal(t, fernTestValueCc, obj.Cc) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetBcc", func(t *testing.T) { + obj := &Email{} + var fernTestValueBcc []string + obj.SetBcc(fernTestValueBcc) + assert.Equal(t, fernTestValueBcc, obj.Bcc) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetReplyTo", func(t *testing.T) { + obj := &Email{} + var fernTestValueReplyTo []string + obj.SetReplyTo(fernTestValueReplyTo) + assert.Equal(t, fernTestValueReplyTo, obj.ReplyTo) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetSubject", func(t *testing.T) { + obj := &Email{} + var fernTestValueSubject string + obj.SetSubject(fernTestValueSubject) + assert.Equal(t, fernTestValueSubject, obj.Subject) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetHTML", func(t *testing.T) { + obj := &Email{} + var fernTestValueHTML *string + obj.SetHTML(fernTestValueHTML) + assert.Equal(t, fernTestValueHTML, obj.HTML) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetText", func(t *testing.T) { + obj := &Email{} + var fernTestValueText *string + obj.SetText(fernTestValueText) + assert.Equal(t, fernTestValueText, obj.Text) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetHeaders", func(t *testing.T) { + obj := &Email{} + var fernTestValueHeaders map[string]string + obj.SetHeaders(fernTestValueHeaders) + assert.Equal(t, fernTestValueHeaders, obj.Headers) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetTags", func(t *testing.T) { + obj := &Email{} + var fernTestValueTags []*EmailTagsItem + obj.SetTags(fernTestValueTags) + assert.Equal(t, fernTestValueTags, obj.Tags) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetCategory", func(t *testing.T) { + obj := &Email{} + var fernTestValueCategory *string + obj.SetCategory(fernTestValueCategory) + assert.Equal(t, fernTestValueCategory, obj.Category) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetStream", func(t *testing.T) { + obj := &Email{} + var fernTestValueStream EmailStream + obj.SetStream(fernTestValueStream) + assert.Equal(t, fernTestValueStream, obj.Stream) assert.NotNil(t, obj.explicitFields) }) t.Run("SetStatus", func(t *testing.T) { - obj := &EmailRecipient{} - var fernTestValueStatus EmailRecipientStatus + obj := &Email{} + var fernTestValueStatus EmailStatus obj.SetStatus(fernTestValueStatus) assert.Equal(t, fernTestValueStatus, obj.Status) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetLastEventAt", func(t *testing.T) { - obj := &EmailRecipient{} - var fernTestValueLastEventAt *time.Time - obj.SetLastEventAt(fernTestValueLastEventAt) - assert.Equal(t, fernTestValueLastEventAt, obj.LastEventAt) + t.Run("SetFailure", func(t *testing.T) { + obj := &Email{} + var fernTestValueFailure *EmailFailure + obj.SetFailure(fernTestValueFailure) + assert.Equal(t, fernTestValueFailure, obj.Failure) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetRecipients", func(t *testing.T) { + obj := &Email{} + var fernTestValueRecipients []*EmailRecipient + obj.SetRecipients(fernTestValueRecipients) + assert.Equal(t, fernTestValueRecipients, obj.Recipients) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetAttachments", func(t *testing.T) { + obj := &Email{} + var fernTestValueAttachments []*EmailAttachment + obj.SetAttachments(fernTestValueAttachments) + assert.Equal(t, fernTestValueAttachments, obj.Attachments) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetSandbox", func(t *testing.T) { + obj := &Email{} + var fernTestValueSandbox bool + obj.SetSandbox(fernTestValueSandbox) + assert.Equal(t, fernTestValueSandbox, obj.Sandbox) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetTracking", func(t *testing.T) { + obj := &Email{} + var fernTestValueTracking *EmailTracking + obj.SetTracking(fernTestValueTracking) + assert.Equal(t, fernTestValueTracking, obj.Tracking) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetCreatedAt", func(t *testing.T) { + obj := &Email{} + var fernTestValueCreatedAt time.Time + obj.SetCreatedAt(fernTestValueCreatedAt) + assert.Equal(t, fernTestValueCreatedAt, obj.CreatedAt) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetSentAt", func(t *testing.T) { + obj := &Email{} + var fernTestValueSentAt *time.Time + obj.SetSentAt(fernTestValueSentAt) + assert.Equal(t, fernTestValueSentAt, obj.SentAt) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetScheduledAt", func(t *testing.T) { + obj := &Email{} + var fernTestValueScheduledAt *time.Time + obj.SetScheduledAt(fernTestValueScheduledAt) + assert.Equal(t, fernTestValueScheduledAt, obj.ScheduledAt) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetBatchID", func(t *testing.T) { + obj := &Email{} + var fernTestValueBatchID *string + obj.SetBatchID(fernTestValueBatchID) + assert.Equal(t, fernTestValueBatchID, obj.BatchID) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetTemplate", func(t *testing.T) { + obj := &Email{} + var fernTestValueTemplate *EmailTemplateReference + obj.SetTemplate(fernTestValueTemplate) + assert.Equal(t, fernTestValueTemplate, obj.Template) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetBroadcastID", func(t *testing.T) { + obj := &Email{} + var fernTestValueBroadcastID *string + obj.SetBroadcastID(fernTestValueBroadcastID) + assert.Equal(t, fernTestValueBroadcastID, obj.BroadcastID) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetSubaccountID", func(t *testing.T) { + obj := &Email{} + var fernTestValueSubaccountID *string + obj.SetSubaccountID(fernTestValueSubaccountID) + assert.Equal(t, fernTestValueSubaccountID, obj.SubaccountID) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetContentStorage", func(t *testing.T) { + obj := &Email{} + var fernTestValueContentStorage *EmailContentStorage + obj.SetContentStorage(fernTestValueContentStorage) + assert.Equal(t, fernTestValueContentStorage, obj.ContentStorage) assert.NotNil(t, obj.explicitFields) }) } -func TestGettersEmailRecipient(t *testing.T) { - t.Run("GetAddress", func(t *testing.T) { +func TestGettersEmail(t *testing.T) { + t.Run("GetObject", func(t *testing.T) { t.Parallel() // Arrange - obj := &EmailRecipient{} - var expected string - obj.Address = expected + obj := &Email{} + var expected EmailObject + obj.Object = expected // Act & Assert - assert.Equal(t, expected, obj.GetAddress(), "getter should return the property value") + assert.Equal(t, expected, obj.GetObject(), "getter should return the property value") }) - t.Run("GetAddress_NilReceiver", func(t *testing.T) { + t.Run("GetObject_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *EmailRecipient + var obj *Email // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetAddress() // Should return zero value + _ = obj.GetObject() // Should return zero value }) - t.Run("GetType", func(t *testing.T) { + t.Run("GetID", func(t *testing.T) { t.Parallel() // Arrange - obj := &EmailRecipient{} - var expected EmailRecipientType - obj.Type = expected + obj := &Email{} + var expected string + obj.ID = expected // Act & Assert - assert.Equal(t, expected, obj.GetType(), "getter should return the property value") + assert.Equal(t, expected, obj.GetID(), "getter should return the property value") }) - t.Run("GetType_NilReceiver", func(t *testing.T) { + t.Run("GetID_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *EmailRecipient + var obj *Email // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetType() // Should return zero value + _ = obj.GetID() // Should return zero value }) - t.Run("GetStatus", func(t *testing.T) { + t.Run("GetFrom", func(t *testing.T) { t.Parallel() // Arrange - obj := &EmailRecipient{} - var expected EmailRecipientStatus - obj.Status = expected + obj := &Email{} + var expected string + obj.From = expected // Act & Assert - assert.Equal(t, expected, obj.GetStatus(), "getter should return the property value") + assert.Equal(t, expected, obj.GetFrom(), "getter should return the property value") }) - t.Run("GetStatus_NilReceiver", func(t *testing.T) { + t.Run("GetFrom_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *EmailRecipient + var obj *Email // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetStatus() // Should return zero value + _ = obj.GetFrom() // Should return zero value }) - t.Run("GetLastEventAt", func(t *testing.T) { + t.Run("GetTo", func(t *testing.T) { t.Parallel() // Arrange - obj := &EmailRecipient{} - var expected *time.Time - obj.LastEventAt = expected + obj := &Email{} + var expected []string + obj.To = expected // Act & Assert - assert.Equal(t, expected, obj.GetLastEventAt(), "getter should return the property value") + assert.Equal(t, expected, obj.GetTo(), "getter should return the property value") }) - t.Run("GetLastEventAt_NilValue", func(t *testing.T) { + t.Run("GetTo_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &EmailRecipient{} - obj.LastEventAt = nil + obj := &Email{} + obj.To = nil // Act & Assert - assert.Nil(t, obj.GetLastEventAt(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetTo(), "getter should return nil when property is nil") }) - t.Run("GetLastEventAt_NilReceiver", func(t *testing.T) { + t.Run("GetTo_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *EmailRecipient + var obj *Email // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetLastEventAt() // Should return zero value + _ = obj.GetTo() // Should return zero value }) -} - -func TestSettersMarkExplicitEmailRecipient(t *testing.T) { - t.Run("SetAddress_MarksExplicit", func(t *testing.T) { + t.Run("GetCc", func(t *testing.T) { t.Parallel() // Arrange - obj := &EmailRecipient{} - var fernTestValueAddress string - - // Act - obj.SetAddress(fernTestValueAddress) - - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") - - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } + obj := &Email{} + var expected []string + obj.Cc = expected - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip + // Act & Assert + assert.Equal(t, expected, obj.GetCc(), "getter should return the property value") }) - t.Run("SetType_MarksExplicit", func(t *testing.T) { + t.Run("GetCc_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &EmailRecipient{} - var fernTestValueType EmailRecipientType - - // Act - obj.SetType(fernTestValueType) - - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") + obj := &Email{} + obj.Cc = nil - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } + // Act & Assert + assert.Nil(t, obj.GetCc(), "getter should return nil when property is nil") + }) - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip + t.Run("GetCc_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *Email + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetCc() // Should return zero value }) - t.Run("SetStatus_MarksExplicit", func(t *testing.T) { + t.Run("GetBcc", func(t *testing.T) { t.Parallel() // Arrange - obj := &EmailRecipient{} - var fernTestValueStatus EmailRecipientStatus - - // Act - obj.SetStatus(fernTestValueStatus) - - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") - - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } + obj := &Email{} + var expected []string + obj.Bcc = expected - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip + // Act & Assert + assert.Equal(t, expected, obj.GetBcc(), "getter should return the property value") }) - t.Run("SetLastEventAt_MarksExplicit", func(t *testing.T) { + t.Run("GetBcc_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &EmailRecipient{} - var fernTestValueLastEventAt *time.Time - - // Act - obj.SetLastEventAt(fernTestValueLastEventAt) - - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") - - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } + obj := &Email{} + obj.Bcc = nil - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip + // Act & Assert + assert.Nil(t, obj.GetBcc(), "getter should return nil when property is nil") }) -} - -func TestSettersEmailTagsItem(t *testing.T) { - t.Run("SetName", func(t *testing.T) { - obj := &EmailTagsItem{} - var fernTestValueName string - obj.SetName(fernTestValueName) - assert.Equal(t, fernTestValueName, obj.Name) - assert.NotNil(t, obj.explicitFields) + t.Run("GetBcc_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *Email + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetBcc() // Should return zero value }) - t.Run("SetValue", func(t *testing.T) { - obj := &EmailTagsItem{} - var fernTestValueValue string - obj.SetValue(fernTestValueValue) - assert.Equal(t, fernTestValueValue, obj.Value) - assert.NotNil(t, obj.explicitFields) - }) + t.Run("GetReplyTo", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &Email{} + var expected []string + obj.ReplyTo = expected -} + // Act & Assert + assert.Equal(t, expected, obj.GetReplyTo(), "getter should return the property value") + }) -func TestGettersEmailTagsItem(t *testing.T) { - t.Run("GetName", func(t *testing.T) { + t.Run("GetReplyTo_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &EmailTagsItem{} - var expected string - obj.Name = expected + obj := &Email{} + obj.ReplyTo = nil // Act & Assert - assert.Equal(t, expected, obj.GetName(), "getter should return the property value") + assert.Nil(t, obj.GetReplyTo(), "getter should return nil when property is nil") }) - t.Run("GetName_NilReceiver", func(t *testing.T) { + t.Run("GetReplyTo_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *EmailTagsItem + var obj *Email // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetName() // Should return zero value + _ = obj.GetReplyTo() // Should return zero value }) - t.Run("GetValue", func(t *testing.T) { + t.Run("GetSubject", func(t *testing.T) { t.Parallel() // Arrange - obj := &EmailTagsItem{} + obj := &Email{} var expected string - obj.Value = expected + obj.Subject = expected // Act & Assert - assert.Equal(t, expected, obj.GetValue(), "getter should return the property value") + assert.Equal(t, expected, obj.GetSubject(), "getter should return the property value") }) - t.Run("GetValue_NilReceiver", func(t *testing.T) { + t.Run("GetSubject_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *EmailTagsItem + var obj *Email // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetValue() // Should return zero value + _ = obj.GetSubject() // Should return zero value }) -} - -func TestSettersMarkExplicitEmailTagsItem(t *testing.T) { - t.Run("SetName_MarksExplicit", func(t *testing.T) { + t.Run("GetHTML", func(t *testing.T) { t.Parallel() // Arrange - obj := &EmailTagsItem{} - var fernTestValueName string - - // Act - obj.SetName(fernTestValueName) - - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") - - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } + obj := &Email{} + var expected *string + obj.HTML = expected - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip + // Act & Assert + assert.Equal(t, expected, obj.GetHTML(), "getter should return the property value") }) - t.Run("SetValue_MarksExplicit", func(t *testing.T) { + t.Run("GetHTML_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &EmailTagsItem{} - var fernTestValueValue string - - // Act - obj.SetValue(fernTestValueValue) - - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") - - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } - - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip - }) - -} - -func TestSettersEmailTemplate(t *testing.T) { - t.Run("SetObject", func(t *testing.T) { - obj := &EmailTemplate{} - var fernTestValueObject EmailTemplateObject - obj.SetObject(fernTestValueObject) - assert.Equal(t, fernTestValueObject, obj.Object) - assert.NotNil(t, obj.explicitFields) - }) + obj := &Email{} + obj.HTML = nil - t.Run("SetID", func(t *testing.T) { - obj := &EmailTemplate{} - var fernTestValueID string - obj.SetID(fernTestValueID) - assert.Equal(t, fernTestValueID, obj.ID) - assert.NotNil(t, obj.explicitFields) + // Act & Assert + assert.Nil(t, obj.GetHTML(), "getter should return nil when property is nil") }) - t.Run("SetAlias", func(t *testing.T) { - obj := &EmailTemplate{} - var fernTestValueAlias *string - obj.SetAlias(fernTestValueAlias) - assert.Equal(t, fernTestValueAlias, obj.Alias) - assert.NotNil(t, obj.explicitFields) + t.Run("GetHTML_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *Email + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetHTML() // Should return zero value }) - t.Run("SetName", func(t *testing.T) { - obj := &EmailTemplate{} - var fernTestValueName string - obj.SetName(fernTestValueName) - assert.Equal(t, fernTestValueName, obj.Name) - assert.NotNil(t, obj.explicitFields) - }) + t.Run("GetText", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &Email{} + var expected *string + obj.Text = expected - t.Run("SetDescription", func(t *testing.T) { - obj := &EmailTemplate{} - var fernTestValueDescription *string - obj.SetDescription(fernTestValueDescription) - assert.Equal(t, fernTestValueDescription, obj.Description) - assert.NotNil(t, obj.explicitFields) + // Act & Assert + assert.Equal(t, expected, obj.GetText(), "getter should return the property value") }) - t.Run("SetPublishedVersion", func(t *testing.T) { - obj := &EmailTemplate{} - var fernTestValuePublishedVersion *int64 - obj.SetPublishedVersion(fernTestValuePublishedVersion) - assert.Equal(t, fernTestValuePublishedVersion, obj.PublishedVersion) - assert.NotNil(t, obj.explicitFields) - }) + t.Run("GetText_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &Email{} + obj.Text = nil - t.Run("SetPublishedAt", func(t *testing.T) { - obj := &EmailTemplate{} - var fernTestValuePublishedAt *time.Time - obj.SetPublishedAt(fernTestValuePublishedAt) - assert.Equal(t, fernTestValuePublishedAt, obj.PublishedAt) - assert.NotNil(t, obj.explicitFields) + // Act & Assert + assert.Nil(t, obj.GetText(), "getter should return nil when property is nil") }) - t.Run("SetHasUnpublishedChanges", func(t *testing.T) { - obj := &EmailTemplate{} - var fernTestValueHasUnpublishedChanges bool - obj.SetHasUnpublishedChanges(fernTestValueHasUnpublishedChanges) - assert.Equal(t, fernTestValueHasUnpublishedChanges, obj.HasUnpublishedChanges) - assert.NotNil(t, obj.explicitFields) + t.Run("GetText_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *Email + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetText() // Should return zero value }) - t.Run("SetCreatedAt", func(t *testing.T) { - obj := &EmailTemplate{} - var fernTestValueCreatedAt time.Time - obj.SetCreatedAt(fernTestValueCreatedAt) - assert.Equal(t, fernTestValueCreatedAt, obj.CreatedAt) - assert.NotNil(t, obj.explicitFields) - }) + t.Run("GetHeaders", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &Email{} + var expected map[string]string + obj.Headers = expected - t.Run("SetUpdatedAt", func(t *testing.T) { - obj := &EmailTemplate{} - var fernTestValueUpdatedAt time.Time - obj.SetUpdatedAt(fernTestValueUpdatedAt) - assert.Equal(t, fernTestValueUpdatedAt, obj.UpdatedAt) - assert.NotNil(t, obj.explicitFields) + // Act & Assert + assert.Equal(t, expected, obj.GetHeaders(), "getter should return the property value") }) -} - -func TestGettersEmailTemplate(t *testing.T) { - t.Run("GetObject", func(t *testing.T) { + t.Run("GetHeaders_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &EmailTemplate{} - var expected EmailTemplateObject - obj.Object = expected + obj := &Email{} + obj.Headers = nil // Act & Assert - assert.Equal(t, expected, obj.GetObject(), "getter should return the property value") + assert.Nil(t, obj.GetHeaders(), "getter should return nil when property is nil") }) - t.Run("GetObject_NilReceiver", func(t *testing.T) { + t.Run("GetHeaders_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *EmailTemplate + var obj *Email // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetObject() // Should return zero value + _ = obj.GetHeaders() // Should return zero value }) - t.Run("GetID", func(t *testing.T) { + t.Run("GetTags", func(t *testing.T) { t.Parallel() // Arrange - obj := &EmailTemplate{} - var expected string - obj.ID = expected + obj := &Email{} + var expected []*EmailTagsItem + obj.Tags = expected // Act & Assert - assert.Equal(t, expected, obj.GetID(), "getter should return the property value") + assert.Equal(t, expected, obj.GetTags(), "getter should return the property value") }) - t.Run("GetID_NilReceiver", func(t *testing.T) { + t.Run("GetTags_NilValue", func(t *testing.T) { t.Parallel() - var obj *EmailTemplate + // Arrange + obj := &Email{} + obj.Tags = nil + + // Act & Assert + assert.Nil(t, obj.GetTags(), "getter should return nil when property is nil") + }) + + t.Run("GetTags_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *Email // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetID() // Should return zero value + _ = obj.GetTags() // Should return zero value }) - t.Run("GetAlias", func(t *testing.T) { + t.Run("GetCategory", func(t *testing.T) { t.Parallel() // Arrange - obj := &EmailTemplate{} + obj := &Email{} var expected *string - obj.Alias = expected + obj.Category = expected // Act & Assert - assert.Equal(t, expected, obj.GetAlias(), "getter should return the property value") + assert.Equal(t, expected, obj.GetCategory(), "getter should return the property value") }) - t.Run("GetAlias_NilValue", func(t *testing.T) { + t.Run("GetCategory_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &EmailTemplate{} - obj.Alias = nil + obj := &Email{} + obj.Category = nil // Act & Assert - assert.Nil(t, obj.GetAlias(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetCategory(), "getter should return nil when property is nil") }) - t.Run("GetAlias_NilReceiver", func(t *testing.T) { + t.Run("GetCategory_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *EmailTemplate + var obj *Email // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetAlias() // Should return zero value + _ = obj.GetCategory() // Should return zero value }) - t.Run("GetName", func(t *testing.T) { + t.Run("GetStream", func(t *testing.T) { t.Parallel() // Arrange - obj := &EmailTemplate{} - var expected string - obj.Name = expected + obj := &Email{} + var expected EmailStream + obj.Stream = expected // Act & Assert - assert.Equal(t, expected, obj.GetName(), "getter should return the property value") + assert.Equal(t, expected, obj.GetStream(), "getter should return the property value") }) - t.Run("GetName_NilReceiver", func(t *testing.T) { + t.Run("GetStream_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *EmailTemplate + var obj *Email // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetName() // Should return zero value + _ = obj.GetStream() // Should return zero value }) - t.Run("GetDescription", func(t *testing.T) { + t.Run("GetStatus", func(t *testing.T) { t.Parallel() // Arrange - obj := &EmailTemplate{} - var expected *string - obj.Description = expected + obj := &Email{} + var expected EmailStatus + obj.Status = expected // Act & Assert - assert.Equal(t, expected, obj.GetDescription(), "getter should return the property value") + assert.Equal(t, expected, obj.GetStatus(), "getter should return the property value") }) - t.Run("GetDescription_NilValue", func(t *testing.T) { + t.Run("GetStatus_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *Email + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetStatus() // Should return zero value + }) + + t.Run("GetFailure", func(t *testing.T) { t.Parallel() // Arrange - obj := &EmailTemplate{} - obj.Description = nil + obj := &Email{} + var expected *EmailFailure + obj.Failure = expected // Act & Assert - assert.Nil(t, obj.GetDescription(), "getter should return nil when property is nil") + assert.Equal(t, expected, obj.GetFailure(), "getter should return the property value") }) - t.Run("GetDescription_NilReceiver", func(t *testing.T) { + t.Run("GetFailure_NilValue", func(t *testing.T) { t.Parallel() - var obj *EmailTemplate + // Arrange + obj := &Email{} + obj.Failure = nil + + // Act & Assert + assert.Nil(t, obj.GetFailure(), "getter should return nil when property is nil") + }) + + t.Run("GetFailure_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *Email // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetDescription() // Should return zero value + _ = obj.GetFailure() // Should return zero value }) - t.Run("GetPublishedVersion", func(t *testing.T) { + t.Run("GetRecipients", func(t *testing.T) { t.Parallel() // Arrange - obj := &EmailTemplate{} - var expected *int64 - obj.PublishedVersion = expected + obj := &Email{} + var expected []*EmailRecipient + obj.Recipients = expected // Act & Assert - assert.Equal(t, expected, obj.GetPublishedVersion(), "getter should return the property value") + assert.Equal(t, expected, obj.GetRecipients(), "getter should return the property value") }) - t.Run("GetPublishedVersion_NilValue", func(t *testing.T) { + t.Run("GetRecipients_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &EmailTemplate{} - obj.PublishedVersion = nil + obj := &Email{} + obj.Recipients = nil // Act & Assert - assert.Nil(t, obj.GetPublishedVersion(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetRecipients(), "getter should return nil when property is nil") }) - t.Run("GetPublishedVersion_NilReceiver", func(t *testing.T) { + t.Run("GetRecipients_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *EmailTemplate + var obj *Email // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetPublishedVersion() // Should return zero value + _ = obj.GetRecipients() // Should return zero value }) - t.Run("GetPublishedAt", func(t *testing.T) { + t.Run("GetAttachments", func(t *testing.T) { t.Parallel() // Arrange - obj := &EmailTemplate{} - var expected *time.Time - obj.PublishedAt = expected + obj := &Email{} + var expected []*EmailAttachment + obj.Attachments = expected // Act & Assert - assert.Equal(t, expected, obj.GetPublishedAt(), "getter should return the property value") + assert.Equal(t, expected, obj.GetAttachments(), "getter should return the property value") }) - t.Run("GetPublishedAt_NilValue", func(t *testing.T) { + t.Run("GetAttachments_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &EmailTemplate{} - obj.PublishedAt = nil + obj := &Email{} + obj.Attachments = nil // Act & Assert - assert.Nil(t, obj.GetPublishedAt(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetAttachments(), "getter should return nil when property is nil") }) - t.Run("GetPublishedAt_NilReceiver", func(t *testing.T) { + t.Run("GetAttachments_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *EmailTemplate + var obj *Email // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetPublishedAt() // Should return zero value + _ = obj.GetAttachments() // Should return zero value }) - t.Run("GetHasUnpublishedChanges", func(t *testing.T) { + t.Run("GetSandbox", func(t *testing.T) { t.Parallel() // Arrange - obj := &EmailTemplate{} + obj := &Email{} var expected bool - obj.HasUnpublishedChanges = expected + obj.Sandbox = expected // Act & Assert - assert.Equal(t, expected, obj.GetHasUnpublishedChanges(), "getter should return the property value") + assert.Equal(t, expected, obj.GetSandbox(), "getter should return the property value") }) - t.Run("GetHasUnpublishedChanges_NilReceiver", func(t *testing.T) { + t.Run("GetSandbox_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *EmailTemplate + var obj *Email // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetHasUnpublishedChanges() // Should return zero value + _ = obj.GetSandbox() // Should return zero value + }) + + t.Run("GetTracking", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &Email{} + var expected *EmailTracking + obj.Tracking = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetTracking(), "getter should return the property value") + }) + + t.Run("GetTracking_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &Email{} + obj.Tracking = nil + + // Act & Assert + assert.Nil(t, obj.GetTracking(), "getter should return nil when property is nil") + }) + + t.Run("GetTracking_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *Email + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetTracking() // Should return zero value }) t.Run("GetCreatedAt", func(t *testing.T) { t.Parallel() // Arrange - obj := &EmailTemplate{} + obj := &Email{} var expected time.Time obj.CreatedAt = expected @@ -37874,7 +37273,7 @@ func TestGettersEmailTemplate(t *testing.T) { t.Run("GetCreatedAt_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *EmailTemplate + var obj *Email // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -37884,102 +37283,248 @@ func TestGettersEmailTemplate(t *testing.T) { _ = obj.GetCreatedAt() // Should return zero value }) - t.Run("GetUpdatedAt", func(t *testing.T) { + t.Run("GetSentAt", func(t *testing.T) { t.Parallel() // Arrange - obj := &EmailTemplate{} - var expected time.Time - obj.UpdatedAt = expected + obj := &Email{} + var expected *time.Time + obj.SentAt = expected // Act & Assert - assert.Equal(t, expected, obj.GetUpdatedAt(), "getter should return the property value") + assert.Equal(t, expected, obj.GetSentAt(), "getter should return the property value") }) - t.Run("GetUpdatedAt_NilReceiver", func(t *testing.T) { + t.Run("GetSentAt_NilValue", func(t *testing.T) { t.Parallel() - var obj *EmailTemplate + // Arrange + obj := &Email{} + obj.SentAt = nil + + // Act & Assert + assert.Nil(t, obj.GetSentAt(), "getter should return nil when property is nil") + }) + + t.Run("GetSentAt_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *Email // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetUpdatedAt() // Should return zero value + _ = obj.GetSentAt() // Should return zero value }) -} - -func TestSettersMarkExplicitEmailTemplate(t *testing.T) { - t.Run("SetObject_MarksExplicit", func(t *testing.T) { + t.Run("GetScheduledAt", func(t *testing.T) { t.Parallel() // Arrange - obj := &EmailTemplate{} - var fernTestValueObject EmailTemplateObject - - // Act - obj.SetObject(fernTestValueObject) - - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") - - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } + obj := &Email{} + var expected *time.Time + obj.ScheduledAt = expected - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip + // Act & Assert + assert.Equal(t, expected, obj.GetScheduledAt(), "getter should return the property value") }) - t.Run("SetID_MarksExplicit", func(t *testing.T) { + t.Run("GetScheduledAt_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &EmailTemplate{} - var fernTestValueID string + obj := &Email{} + obj.ScheduledAt = nil - // Act - obj.SetID(fernTestValueID) + // Act & Assert + assert.Nil(t, obj.GetScheduledAt(), "getter should return nil when property is nil") + }) - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") + t.Run("GetScheduledAt_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *Email + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetScheduledAt() // Should return zero value + }) - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } + t.Run("GetBatchID", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &Email{} + var expected *string + obj.BatchID = expected - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip + // Act & Assert + assert.Equal(t, expected, obj.GetBatchID(), "getter should return the property value") }) - t.Run("SetAlias_MarksExplicit", func(t *testing.T) { + t.Run("GetBatchID_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &EmailTemplate{} - var fernTestValueAlias *string + obj := &Email{} + obj.BatchID = nil + + // Act & Assert + assert.Nil(t, obj.GetBatchID(), "getter should return nil when property is nil") + }) + + t.Run("GetBatchID_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *Email + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetBatchID() // Should return zero value + }) + + t.Run("GetTemplate", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &Email{} + var expected *EmailTemplateReference + obj.Template = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetTemplate(), "getter should return the property value") + }) + + t.Run("GetTemplate_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &Email{} + obj.Template = nil + + // Act & Assert + assert.Nil(t, obj.GetTemplate(), "getter should return nil when property is nil") + }) + + t.Run("GetTemplate_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *Email + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetTemplate() // Should return zero value + }) + + t.Run("GetBroadcastID", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &Email{} + var expected *string + obj.BroadcastID = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetBroadcastID(), "getter should return the property value") + }) + + t.Run("GetBroadcastID_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &Email{} + obj.BroadcastID = nil + + // Act & Assert + assert.Nil(t, obj.GetBroadcastID(), "getter should return nil when property is nil") + }) + + t.Run("GetBroadcastID_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *Email + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetBroadcastID() // Should return zero value + }) + + t.Run("GetSubaccountID", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &Email{} + var expected *string + obj.SubaccountID = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetSubaccountID(), "getter should return the property value") + }) + + t.Run("GetSubaccountID_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &Email{} + obj.SubaccountID = nil + + // Act & Assert + assert.Nil(t, obj.GetSubaccountID(), "getter should return nil when property is nil") + }) + + t.Run("GetSubaccountID_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *Email + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetSubaccountID() // Should return zero value + }) + + t.Run("GetContentStorage", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &Email{} + var expected *EmailContentStorage + obj.ContentStorage = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetContentStorage(), "getter should return the property value") + }) + + t.Run("GetContentStorage_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &Email{} + obj.ContentStorage = nil + + // Act & Assert + assert.Nil(t, obj.GetContentStorage(), "getter should return nil when property is nil") + }) + + t.Run("GetContentStorage_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *Email + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetContentStorage() // Should return zero value + }) + +} + +func TestSettersMarkExplicitEmail(t *testing.T) { + t.Run("SetObject_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &Email{} + var fernTestValueObject EmailObject // Act - obj.SetAlias(fernTestValueAlias) + obj.SetObject(fernTestValueObject) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -38003,14 +37548,14 @@ func TestSettersMarkExplicitEmailTemplate(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetName_MarksExplicit", func(t *testing.T) { + t.Run("SetID_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &EmailTemplate{} - var fernTestValueName string + obj := &Email{} + var fernTestValueID string // Act - obj.SetName(fernTestValueName) + obj.SetID(fernTestValueID) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -38034,14 +37579,14 @@ func TestSettersMarkExplicitEmailTemplate(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetDescription_MarksExplicit", func(t *testing.T) { + t.Run("SetFrom_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &EmailTemplate{} - var fernTestValueDescription *string + obj := &Email{} + var fernTestValueFrom string // Act - obj.SetDescription(fernTestValueDescription) + obj.SetFrom(fernTestValueFrom) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -38065,14 +37610,14 @@ func TestSettersMarkExplicitEmailTemplate(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetPublishedVersion_MarksExplicit", func(t *testing.T) { + t.Run("SetTo_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &EmailTemplate{} - var fernTestValuePublishedVersion *int64 + obj := &Email{} + var fernTestValueTo []string // Act - obj.SetPublishedVersion(fernTestValuePublishedVersion) + obj.SetTo(fernTestValueTo) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -38096,14 +37641,14 @@ func TestSettersMarkExplicitEmailTemplate(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetPublishedAt_MarksExplicit", func(t *testing.T) { + t.Run("SetCc_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &EmailTemplate{} - var fernTestValuePublishedAt *time.Time + obj := &Email{} + var fernTestValueCc []string // Act - obj.SetPublishedAt(fernTestValuePublishedAt) + obj.SetCc(fernTestValueCc) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -38127,14 +37672,14 @@ func TestSettersMarkExplicitEmailTemplate(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetHasUnpublishedChanges_MarksExplicit", func(t *testing.T) { + t.Run("SetBcc_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &EmailTemplate{} - var fernTestValueHasUnpublishedChanges bool + obj := &Email{} + var fernTestValueBcc []string // Act - obj.SetHasUnpublishedChanges(fernTestValueHasUnpublishedChanges) + obj.SetBcc(fernTestValueBcc) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -38158,14 +37703,14 @@ func TestSettersMarkExplicitEmailTemplate(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetCreatedAt_MarksExplicit", func(t *testing.T) { + t.Run("SetReplyTo_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &EmailTemplate{} - var fernTestValueCreatedAt time.Time + obj := &Email{} + var fernTestValueReplyTo []string // Act - obj.SetCreatedAt(fernTestValueCreatedAt) + obj.SetReplyTo(fernTestValueReplyTo) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -38189,14 +37734,14 @@ func TestSettersMarkExplicitEmailTemplate(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetUpdatedAt_MarksExplicit", func(t *testing.T) { + t.Run("SetSubject_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &EmailTemplate{} - var fernTestValueUpdatedAt time.Time + obj := &Email{} + var fernTestValueSubject string // Act - obj.SetUpdatedAt(fernTestValueUpdatedAt) + obj.SetSubject(fernTestValueSubject) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -38220,126 +37765,14 @@ func TestSettersMarkExplicitEmailTemplate(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) -} - -func TestSettersEmailTemplateList(t *testing.T) { - t.Run("SetObject", func(t *testing.T) { - obj := &EmailTemplateList{} - var fernTestValueObject EmailTemplateListObject - obj.SetObject(fernTestValueObject) - assert.Equal(t, fernTestValueObject, obj.Object) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetData", func(t *testing.T) { - obj := &EmailTemplateList{} - var fernTestValueData []*EmailTemplate - obj.SetData(fernTestValueData) - assert.Equal(t, fernTestValueData, obj.Data) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetHasMore", func(t *testing.T) { - obj := &EmailTemplateList{} - var fernTestValueHasMore bool - obj.SetHasMore(fernTestValueHasMore) - assert.Equal(t, fernTestValueHasMore, obj.HasMore) - assert.NotNil(t, obj.explicitFields) - }) - -} - -func TestGettersEmailTemplateList(t *testing.T) { - t.Run("GetObject", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &EmailTemplateList{} - var expected EmailTemplateListObject - obj.Object = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetObject(), "getter should return the property value") - }) - - t.Run("GetObject_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *EmailTemplateList - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetObject() // Should return zero value - }) - - t.Run("GetData", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &EmailTemplateList{} - var expected []*EmailTemplate - obj.Data = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetData(), "getter should return the property value") - }) - - t.Run("GetData_NilValue", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &EmailTemplateList{} - obj.Data = nil - - // Act & Assert - assert.Nil(t, obj.GetData(), "getter should return nil when property is nil") - }) - - t.Run("GetData_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *EmailTemplateList - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetData() // Should return zero value - }) - - t.Run("GetHasMore", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &EmailTemplateList{} - var expected bool - obj.HasMore = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetHasMore(), "getter should return the property value") - }) - - t.Run("GetHasMore_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *EmailTemplateList - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetHasMore() // Should return zero value - }) - -} - -func TestSettersMarkExplicitEmailTemplateList(t *testing.T) { - t.Run("SetObject_MarksExplicit", func(t *testing.T) { + t.Run("SetHTML_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &EmailTemplateList{} - var fernTestValueObject EmailTemplateListObject + obj := &Email{} + var fernTestValueHTML *string // Act - obj.SetObject(fernTestValueObject) + obj.SetHTML(fernTestValueHTML) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -38363,14 +37796,14 @@ func TestSettersMarkExplicitEmailTemplateList(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetData_MarksExplicit", func(t *testing.T) { + t.Run("SetText_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &EmailTemplateList{} - var fernTestValueData []*EmailTemplate + obj := &Email{} + var fernTestValueText *string // Act - obj.SetData(fernTestValueData) + obj.SetText(fernTestValueText) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -38394,14 +37827,14 @@ func TestSettersMarkExplicitEmailTemplateList(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetHasMore_MarksExplicit", func(t *testing.T) { + t.Run("SetHeaders_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &EmailTemplateList{} - var fernTestValueHasMore bool + obj := &Email{} + var fernTestValueHeaders map[string]string // Act - obj.SetHasMore(fernTestValueHasMore) + obj.SetHeaders(fernTestValueHeaders) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -38425,126 +37858,14 @@ func TestSettersMarkExplicitEmailTemplateList(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) -} - -func TestSettersEmailTemplateReference(t *testing.T) { - t.Run("SetID", func(t *testing.T) { - obj := &EmailTemplateReference{} - var fernTestValueID string - obj.SetID(fernTestValueID) - assert.Equal(t, fernTestValueID, obj.ID) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetVersion", func(t *testing.T) { - obj := &EmailTemplateReference{} - var fernTestValueVersion *int64 - obj.SetVersion(fernTestValueVersion) - assert.Equal(t, fernTestValueVersion, obj.Version) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetLocale", func(t *testing.T) { - obj := &EmailTemplateReference{} - var fernTestValueLocale string - obj.SetLocale(fernTestValueLocale) - assert.Equal(t, fernTestValueLocale, obj.Locale) - assert.NotNil(t, obj.explicitFields) - }) - -} - -func TestGettersEmailTemplateReference(t *testing.T) { - t.Run("GetID", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &EmailTemplateReference{} - var expected string - obj.ID = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetID(), "getter should return the property value") - }) - - t.Run("GetID_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *EmailTemplateReference - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetID() // Should return zero value - }) - - t.Run("GetVersion", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &EmailTemplateReference{} - var expected *int64 - obj.Version = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetVersion(), "getter should return the property value") - }) - - t.Run("GetVersion_NilValue", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &EmailTemplateReference{} - obj.Version = nil - - // Act & Assert - assert.Nil(t, obj.GetVersion(), "getter should return nil when property is nil") - }) - - t.Run("GetVersion_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *EmailTemplateReference - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetVersion() // Should return zero value - }) - - t.Run("GetLocale", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &EmailTemplateReference{} - var expected string - obj.Locale = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetLocale(), "getter should return the property value") - }) - - t.Run("GetLocale_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *EmailTemplateReference - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetLocale() // Should return zero value - }) - -} - -func TestSettersMarkExplicitEmailTemplateReference(t *testing.T) { - t.Run("SetID_MarksExplicit", func(t *testing.T) { + t.Run("SetTags_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &EmailTemplateReference{} - var fernTestValueID string + obj := &Email{} + var fernTestValueTags []*EmailTagsItem // Act - obj.SetID(fernTestValueID) + obj.SetTags(fernTestValueTags) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -38568,14 +37889,14 @@ func TestSettersMarkExplicitEmailTemplateReference(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetVersion_MarksExplicit", func(t *testing.T) { + t.Run("SetCategory_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &EmailTemplateReference{} - var fernTestValueVersion *int64 + obj := &Email{} + var fernTestValueCategory *string // Act - obj.SetVersion(fernTestValueVersion) + obj.SetCategory(fernTestValueCategory) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -38599,14 +37920,14 @@ func TestSettersMarkExplicitEmailTemplateReference(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetLocale_MarksExplicit", func(t *testing.T) { + t.Run("SetStream_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &EmailTemplateReference{} - var fernTestValueLocale string + obj := &Email{} + var fernTestValueStream EmailStream // Act - obj.SetLocale(fernTestValueLocale) + obj.SetStream(fernTestValueStream) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -38630,455 +37951,14 @@ func TestSettersMarkExplicitEmailTemplateReference(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) -} - -func TestSettersEmailTemplateVersion(t *testing.T) { - t.Run("SetObject", func(t *testing.T) { - obj := &EmailTemplateVersion{} - var fernTestValueObject EmailTemplateVersionObject - obj.SetObject(fernTestValueObject) - assert.Equal(t, fernTestValueObject, obj.Object) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetTemplateID", func(t *testing.T) { - obj := &EmailTemplateVersion{} - var fernTestValueTemplateID string - obj.SetTemplateID(fernTestValueTemplateID) - assert.Equal(t, fernTestValueTemplateID, obj.TemplateID) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetVersion", func(t *testing.T) { - obj := &EmailTemplateVersion{} - var fernTestValueVersion *int64 - obj.SetVersion(fernTestValueVersion) - assert.Equal(t, fernTestValueVersion, obj.Version) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetRevision", func(t *testing.T) { - obj := &EmailTemplateVersion{} - var fernTestValueRevision int64 - obj.SetRevision(fernTestValueRevision) - assert.Equal(t, fernTestValueRevision, obj.Revision) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetDefaultLocale", func(t *testing.T) { - obj := &EmailTemplateVersion{} - var fernTestValueDefaultLocale string - obj.SetDefaultLocale(fernTestValueDefaultLocale) - assert.Equal(t, fernTestValueDefaultLocale, obj.DefaultLocale) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetVariables", func(t *testing.T) { - obj := &EmailTemplateVersion{} - var fernTestValueVariables []*TemplateVariable - obj.SetVariables(fernTestValueVariables) - assert.Equal(t, fernTestValueVariables, obj.Variables) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetSampleVariables", func(t *testing.T) { - obj := &EmailTemplateVersion{} - var fernTestValueSampleVariables map[string]any - obj.SetSampleVariables(fernTestValueSampleVariables) - assert.Equal(t, fernTestValueSampleVariables, obj.SampleVariables) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetContents", func(t *testing.T) { - obj := &EmailTemplateVersion{} - var fernTestValueContents []*TemplateContent - obj.SetContents(fernTestValueContents) - assert.Equal(t, fernTestValueContents, obj.Contents) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetProblems", func(t *testing.T) { - obj := &EmailTemplateVersion{} - var fernTestValueProblems []*TemplateProblem - obj.SetProblems(fernTestValueProblems) - assert.Equal(t, fernTestValueProblems, obj.Problems) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetPublishedAt", func(t *testing.T) { - obj := &EmailTemplateVersion{} - var fernTestValuePublishedAt *time.Time - obj.SetPublishedAt(fernTestValuePublishedAt) - assert.Equal(t, fernTestValuePublishedAt, obj.PublishedAt) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetCreatedAt", func(t *testing.T) { - obj := &EmailTemplateVersion{} - var fernTestValueCreatedAt time.Time - obj.SetCreatedAt(fernTestValueCreatedAt) - assert.Equal(t, fernTestValueCreatedAt, obj.CreatedAt) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetUpdatedAt", func(t *testing.T) { - obj := &EmailTemplateVersion{} - var fernTestValueUpdatedAt time.Time - obj.SetUpdatedAt(fernTestValueUpdatedAt) - assert.Equal(t, fernTestValueUpdatedAt, obj.UpdatedAt) - assert.NotNil(t, obj.explicitFields) - }) - -} - -func TestGettersEmailTemplateVersion(t *testing.T) { - t.Run("GetObject", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &EmailTemplateVersion{} - var expected EmailTemplateVersionObject - obj.Object = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetObject(), "getter should return the property value") - }) - - t.Run("GetObject_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *EmailTemplateVersion - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetObject() // Should return zero value - }) - - t.Run("GetTemplateID", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &EmailTemplateVersion{} - var expected string - obj.TemplateID = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetTemplateID(), "getter should return the property value") - }) - - t.Run("GetTemplateID_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *EmailTemplateVersion - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetTemplateID() // Should return zero value - }) - - t.Run("GetVersion", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &EmailTemplateVersion{} - var expected *int64 - obj.Version = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetVersion(), "getter should return the property value") - }) - - t.Run("GetVersion_NilValue", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &EmailTemplateVersion{} - obj.Version = nil - - // Act & Assert - assert.Nil(t, obj.GetVersion(), "getter should return nil when property is nil") - }) - - t.Run("GetVersion_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *EmailTemplateVersion - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetVersion() // Should return zero value - }) - - t.Run("GetRevision", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &EmailTemplateVersion{} - var expected int64 - obj.Revision = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetRevision(), "getter should return the property value") - }) - - t.Run("GetRevision_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *EmailTemplateVersion - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetRevision() // Should return zero value - }) - - t.Run("GetDefaultLocale", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &EmailTemplateVersion{} - var expected string - obj.DefaultLocale = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetDefaultLocale(), "getter should return the property value") - }) - - t.Run("GetDefaultLocale_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *EmailTemplateVersion - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetDefaultLocale() // Should return zero value - }) - - t.Run("GetVariables", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &EmailTemplateVersion{} - var expected []*TemplateVariable - obj.Variables = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetVariables(), "getter should return the property value") - }) - - t.Run("GetVariables_NilValue", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &EmailTemplateVersion{} - obj.Variables = nil - - // Act & Assert - assert.Nil(t, obj.GetVariables(), "getter should return nil when property is nil") - }) - - t.Run("GetVariables_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *EmailTemplateVersion - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetVariables() // Should return zero value - }) - - t.Run("GetSampleVariables", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &EmailTemplateVersion{} - var expected map[string]any - obj.SampleVariables = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetSampleVariables(), "getter should return the property value") - }) - - t.Run("GetSampleVariables_NilValue", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &EmailTemplateVersion{} - obj.SampleVariables = nil - - // Act & Assert - assert.Nil(t, obj.GetSampleVariables(), "getter should return nil when property is nil") - }) - - t.Run("GetSampleVariables_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *EmailTemplateVersion - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetSampleVariables() // Should return zero value - }) - - t.Run("GetContents", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &EmailTemplateVersion{} - var expected []*TemplateContent - obj.Contents = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetContents(), "getter should return the property value") - }) - - t.Run("GetContents_NilValue", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &EmailTemplateVersion{} - obj.Contents = nil - - // Act & Assert - assert.Nil(t, obj.GetContents(), "getter should return nil when property is nil") - }) - - t.Run("GetContents_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *EmailTemplateVersion - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetContents() // Should return zero value - }) - - t.Run("GetProblems", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &EmailTemplateVersion{} - var expected []*TemplateProblem - obj.Problems = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetProblems(), "getter should return the property value") - }) - - t.Run("GetProblems_NilValue", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &EmailTemplateVersion{} - obj.Problems = nil - - // Act & Assert - assert.Nil(t, obj.GetProblems(), "getter should return nil when property is nil") - }) - - t.Run("GetProblems_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *EmailTemplateVersion - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetProblems() // Should return zero value - }) - - t.Run("GetPublishedAt", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &EmailTemplateVersion{} - var expected *time.Time - obj.PublishedAt = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetPublishedAt(), "getter should return the property value") - }) - - t.Run("GetPublishedAt_NilValue", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &EmailTemplateVersion{} - obj.PublishedAt = nil - - // Act & Assert - assert.Nil(t, obj.GetPublishedAt(), "getter should return nil when property is nil") - }) - - t.Run("GetPublishedAt_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *EmailTemplateVersion - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetPublishedAt() // Should return zero value - }) - - t.Run("GetCreatedAt", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &EmailTemplateVersion{} - var expected time.Time - obj.CreatedAt = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetCreatedAt(), "getter should return the property value") - }) - - t.Run("GetCreatedAt_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *EmailTemplateVersion - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetCreatedAt() // Should return zero value - }) - - t.Run("GetUpdatedAt", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &EmailTemplateVersion{} - var expected time.Time - obj.UpdatedAt = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetUpdatedAt(), "getter should return the property value") - }) - - t.Run("GetUpdatedAt_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *EmailTemplateVersion - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetUpdatedAt() // Should return zero value - }) - -} - -func TestSettersMarkExplicitEmailTemplateVersion(t *testing.T) { - t.Run("SetObject_MarksExplicit", func(t *testing.T) { + t.Run("SetStatus_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &EmailTemplateVersion{} - var fernTestValueObject EmailTemplateVersionObject + obj := &Email{} + var fernTestValueStatus EmailStatus // Act - obj.SetObject(fernTestValueObject) + obj.SetStatus(fernTestValueStatus) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -39102,14 +37982,14 @@ func TestSettersMarkExplicitEmailTemplateVersion(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetTemplateID_MarksExplicit", func(t *testing.T) { + t.Run("SetFailure_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &EmailTemplateVersion{} - var fernTestValueTemplateID string + obj := &Email{} + var fernTestValueFailure *EmailFailure // Act - obj.SetTemplateID(fernTestValueTemplateID) + obj.SetFailure(fernTestValueFailure) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -39133,14 +38013,14 @@ func TestSettersMarkExplicitEmailTemplateVersion(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetVersion_MarksExplicit", func(t *testing.T) { + t.Run("SetRecipients_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &EmailTemplateVersion{} - var fernTestValueVersion *int64 + obj := &Email{} + var fernTestValueRecipients []*EmailRecipient // Act - obj.SetVersion(fernTestValueVersion) + obj.SetRecipients(fernTestValueRecipients) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -39164,14 +38044,14 @@ func TestSettersMarkExplicitEmailTemplateVersion(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetRevision_MarksExplicit", func(t *testing.T) { + t.Run("SetAttachments_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &EmailTemplateVersion{} - var fernTestValueRevision int64 + obj := &Email{} + var fernTestValueAttachments []*EmailAttachment // Act - obj.SetRevision(fernTestValueRevision) + obj.SetAttachments(fernTestValueAttachments) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -39195,14 +38075,14 @@ func TestSettersMarkExplicitEmailTemplateVersion(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetDefaultLocale_MarksExplicit", func(t *testing.T) { + t.Run("SetSandbox_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &EmailTemplateVersion{} - var fernTestValueDefaultLocale string + obj := &Email{} + var fernTestValueSandbox bool // Act - obj.SetDefaultLocale(fernTestValueDefaultLocale) + obj.SetSandbox(fernTestValueSandbox) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -39226,14 +38106,14 @@ func TestSettersMarkExplicitEmailTemplateVersion(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetVariables_MarksExplicit", func(t *testing.T) { + t.Run("SetTracking_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &EmailTemplateVersion{} - var fernTestValueVariables []*TemplateVariable + obj := &Email{} + var fernTestValueTracking *EmailTracking // Act - obj.SetVariables(fernTestValueVariables) + obj.SetTracking(fernTestValueTracking) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -39257,14 +38137,14 @@ func TestSettersMarkExplicitEmailTemplateVersion(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetSampleVariables_MarksExplicit", func(t *testing.T) { + t.Run("SetCreatedAt_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &EmailTemplateVersion{} - var fernTestValueSampleVariables map[string]any + obj := &Email{} + var fernTestValueCreatedAt time.Time // Act - obj.SetSampleVariables(fernTestValueSampleVariables) + obj.SetCreatedAt(fernTestValueCreatedAt) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -39288,14 +38168,14 @@ func TestSettersMarkExplicitEmailTemplateVersion(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetContents_MarksExplicit", func(t *testing.T) { + t.Run("SetSentAt_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &EmailTemplateVersion{} - var fernTestValueContents []*TemplateContent + obj := &Email{} + var fernTestValueSentAt *time.Time // Act - obj.SetContents(fernTestValueContents) + obj.SetSentAt(fernTestValueSentAt) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -39319,14 +38199,14 @@ func TestSettersMarkExplicitEmailTemplateVersion(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetProblems_MarksExplicit", func(t *testing.T) { + t.Run("SetScheduledAt_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &EmailTemplateVersion{} - var fernTestValueProblems []*TemplateProblem + obj := &Email{} + var fernTestValueScheduledAt *time.Time // Act - obj.SetProblems(fernTestValueProblems) + obj.SetScheduledAt(fernTestValueScheduledAt) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -39350,14 +38230,14 @@ func TestSettersMarkExplicitEmailTemplateVersion(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetPublishedAt_MarksExplicit", func(t *testing.T) { + t.Run("SetBatchID_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &EmailTemplateVersion{} - var fernTestValuePublishedAt *time.Time + obj := &Email{} + var fernTestValueBatchID *string // Act - obj.SetPublishedAt(fernTestValuePublishedAt) + obj.SetBatchID(fernTestValueBatchID) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -39381,14 +38261,14 @@ func TestSettersMarkExplicitEmailTemplateVersion(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetCreatedAt_MarksExplicit", func(t *testing.T) { + t.Run("SetTemplate_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &EmailTemplateVersion{} - var fernTestValueCreatedAt time.Time + obj := &Email{} + var fernTestValueTemplate *EmailTemplateReference // Act - obj.SetCreatedAt(fernTestValueCreatedAt) + obj.SetTemplate(fernTestValueTemplate) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -39412,157 +38292,14 @@ func TestSettersMarkExplicitEmailTemplateVersion(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetUpdatedAt_MarksExplicit", func(t *testing.T) { + t.Run("SetBroadcastID_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &EmailTemplateVersion{} - var fernTestValueUpdatedAt time.Time - - // Act - obj.SetUpdatedAt(fernTestValueUpdatedAt) - - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") - - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } - - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip - }) - -} - -func TestSettersEmailTemplateVersionList(t *testing.T) { - t.Run("SetObject", func(t *testing.T) { - obj := &EmailTemplateVersionList{} - var fernTestValueObject EmailTemplateVersionListObject - obj.SetObject(fernTestValueObject) - assert.Equal(t, fernTestValueObject, obj.Object) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetData", func(t *testing.T) { - obj := &EmailTemplateVersionList{} - var fernTestValueData []*EmailTemplateVersion - obj.SetData(fernTestValueData) - assert.Equal(t, fernTestValueData, obj.Data) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetHasMore", func(t *testing.T) { - obj := &EmailTemplateVersionList{} - var fernTestValueHasMore bool - obj.SetHasMore(fernTestValueHasMore) - assert.Equal(t, fernTestValueHasMore, obj.HasMore) - assert.NotNil(t, obj.explicitFields) - }) - -} - -func TestGettersEmailTemplateVersionList(t *testing.T) { - t.Run("GetObject", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &EmailTemplateVersionList{} - var expected EmailTemplateVersionListObject - obj.Object = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetObject(), "getter should return the property value") - }) - - t.Run("GetObject_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *EmailTemplateVersionList - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetObject() // Should return zero value - }) - - t.Run("GetData", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &EmailTemplateVersionList{} - var expected []*EmailTemplateVersion - obj.Data = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetData(), "getter should return the property value") - }) - - t.Run("GetData_NilValue", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &EmailTemplateVersionList{} - obj.Data = nil - - // Act & Assert - assert.Nil(t, obj.GetData(), "getter should return nil when property is nil") - }) - - t.Run("GetData_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *EmailTemplateVersionList - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetData() // Should return zero value - }) - - t.Run("GetHasMore", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &EmailTemplateVersionList{} - var expected bool - obj.HasMore = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetHasMore(), "getter should return the property value") - }) - - t.Run("GetHasMore_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *EmailTemplateVersionList - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetHasMore() // Should return zero value - }) - -} - -func TestSettersMarkExplicitEmailTemplateVersionList(t *testing.T) { - t.Run("SetObject_MarksExplicit", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &EmailTemplateVersionList{} - var fernTestValueObject EmailTemplateVersionListObject + obj := &Email{} + var fernTestValueBroadcastID *string // Act - obj.SetObject(fernTestValueObject) + obj.SetBroadcastID(fernTestValueBroadcastID) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -39586,14 +38323,14 @@ func TestSettersMarkExplicitEmailTemplateVersionList(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetData_MarksExplicit", func(t *testing.T) { + t.Run("SetSubaccountID_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &EmailTemplateVersionList{} - var fernTestValueData []*EmailTemplateVersion + obj := &Email{} + var fernTestValueSubaccountID *string // Act - obj.SetData(fernTestValueData) + obj.SetSubaccountID(fernTestValueSubaccountID) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -39617,14 +38354,14 @@ func TestSettersMarkExplicitEmailTemplateVersionList(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetHasMore_MarksExplicit", func(t *testing.T) { + t.Run("SetContentStorage_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &EmailTemplateVersionList{} - var fernTestValueHasMore bool + obj := &Email{} + var fernTestValueContentStorage *EmailContentStorage // Act - obj.SetHasMore(fernTestValueHasMore) + obj.SetContentStorage(fernTestValueContentStorage) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -39650,340 +38387,186 @@ func TestSettersMarkExplicitEmailTemplateVersionList(t *testing.T) { } -func TestSettersEmailTracking(t *testing.T) { - t.Run("SetOpens", func(t *testing.T) { - obj := &EmailTracking{} - var fernTestValueOpens bool - obj.SetOpens(fernTestValueOpens) - assert.Equal(t, fernTestValueOpens, obj.Opens) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetClicks", func(t *testing.T) { - obj := &EmailTracking{} - var fernTestValueClicks bool - obj.SetClicks(fernTestValueClicks) - assert.Equal(t, fernTestValueClicks, obj.Clicks) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetUnsubscribe", func(t *testing.T) { - obj := &EmailTracking{} - var fernTestValueUnsubscribe bool - obj.SetUnsubscribe(fernTestValueUnsubscribe) - assert.Equal(t, fernTestValueUnsubscribe, obj.Unsubscribe) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetOpenCount", func(t *testing.T) { - obj := &EmailTracking{} - var fernTestValueOpenCount int64 - obj.SetOpenCount(fernTestValueOpenCount) - assert.Equal(t, fernTestValueOpenCount, obj.OpenCount) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetFirstOpenedAt", func(t *testing.T) { - obj := &EmailTracking{} - var fernTestValueFirstOpenedAt *time.Time - obj.SetFirstOpenedAt(fernTestValueFirstOpenedAt) - assert.Equal(t, fernTestValueFirstOpenedAt, obj.FirstOpenedAt) +func TestSettersEmailAttachment(t *testing.T) { + t.Run("SetID", func(t *testing.T) { + obj := &EmailAttachment{} + var fernTestValueID string + obj.SetID(fernTestValueID) + assert.Equal(t, fernTestValueID, obj.ID) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetLastOpenedAt", func(t *testing.T) { - obj := &EmailTracking{} - var fernTestValueLastOpenedAt *time.Time - obj.SetLastOpenedAt(fernTestValueLastOpenedAt) - assert.Equal(t, fernTestValueLastOpenedAt, obj.LastOpenedAt) + t.Run("SetFilename", func(t *testing.T) { + obj := &EmailAttachment{} + var fernTestValueFilename string + obj.SetFilename(fernTestValueFilename) + assert.Equal(t, fernTestValueFilename, obj.Filename) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetClickCount", func(t *testing.T) { - obj := &EmailTracking{} - var fernTestValueClickCount int64 - obj.SetClickCount(fernTestValueClickCount) - assert.Equal(t, fernTestValueClickCount, obj.ClickCount) + t.Run("SetContentType", func(t *testing.T) { + obj := &EmailAttachment{} + var fernTestValueContentType string + obj.SetContentType(fernTestValueContentType) + assert.Equal(t, fernTestValueContentType, obj.ContentType) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetFirstClickedAt", func(t *testing.T) { - obj := &EmailTracking{} - var fernTestValueFirstClickedAt *time.Time - obj.SetFirstClickedAt(fernTestValueFirstClickedAt) - assert.Equal(t, fernTestValueFirstClickedAt, obj.FirstClickedAt) + t.Run("SetContentID", func(t *testing.T) { + obj := &EmailAttachment{} + var fernTestValueContentID *string + obj.SetContentID(fernTestValueContentID) + assert.Equal(t, fernTestValueContentID, obj.ContentID) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetLastClickedAt", func(t *testing.T) { - obj := &EmailTracking{} - var fernTestValueLastClickedAt *time.Time - obj.SetLastClickedAt(fernTestValueLastClickedAt) - assert.Equal(t, fernTestValueLastClickedAt, obj.LastClickedAt) + t.Run("SetSize", func(t *testing.T) { + obj := &EmailAttachment{} + var fernTestValueSize int64 + obj.SetSize(fernTestValueSize) + assert.Equal(t, fernTestValueSize, obj.Size) assert.NotNil(t, obj.explicitFields) }) } -func TestGettersEmailTracking(t *testing.T) { - t.Run("GetOpens", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &EmailTracking{} - var expected bool - obj.Opens = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetOpens(), "getter should return the property value") - }) - - t.Run("GetOpens_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *EmailTracking - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetOpens() // Should return zero value - }) - - t.Run("GetClicks", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &EmailTracking{} - var expected bool - obj.Clicks = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetClicks(), "getter should return the property value") - }) - - t.Run("GetClicks_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *EmailTracking - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetClicks() // Should return zero value - }) - - t.Run("GetUnsubscribe", func(t *testing.T) { +func TestGettersEmailAttachment(t *testing.T) { + t.Run("GetID", func(t *testing.T) { t.Parallel() // Arrange - obj := &EmailTracking{} - var expected bool - obj.Unsubscribe = expected + obj := &EmailAttachment{} + var expected string + obj.ID = expected // Act & Assert - assert.Equal(t, expected, obj.GetUnsubscribe(), "getter should return the property value") + assert.Equal(t, expected, obj.GetID(), "getter should return the property value") }) - t.Run("GetUnsubscribe_NilReceiver", func(t *testing.T) { + t.Run("GetID_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *EmailTracking + var obj *EmailAttachment // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetUnsubscribe() // Should return zero value + _ = obj.GetID() // Should return zero value }) - t.Run("GetOpenCount", func(t *testing.T) { + t.Run("GetFilename", func(t *testing.T) { t.Parallel() // Arrange - obj := &EmailTracking{} - var expected int64 - obj.OpenCount = expected + obj := &EmailAttachment{} + var expected string + obj.Filename = expected // Act & Assert - assert.Equal(t, expected, obj.GetOpenCount(), "getter should return the property value") + assert.Equal(t, expected, obj.GetFilename(), "getter should return the property value") }) - t.Run("GetOpenCount_NilReceiver", func(t *testing.T) { + t.Run("GetFilename_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *EmailTracking + var obj *EmailAttachment // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetOpenCount() // Should return zero value - }) - - t.Run("GetFirstOpenedAt", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &EmailTracking{} - var expected *time.Time - obj.FirstOpenedAt = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetFirstOpenedAt(), "getter should return the property value") + _ = obj.GetFilename() // Should return zero value }) - t.Run("GetFirstOpenedAt_NilValue", func(t *testing.T) { + t.Run("GetContentType", func(t *testing.T) { t.Parallel() // Arrange - obj := &EmailTracking{} - obj.FirstOpenedAt = nil + obj := &EmailAttachment{} + var expected string + obj.ContentType = expected // Act & Assert - assert.Nil(t, obj.GetFirstOpenedAt(), "getter should return nil when property is nil") + assert.Equal(t, expected, obj.GetContentType(), "getter should return the property value") }) - t.Run("GetFirstOpenedAt_NilReceiver", func(t *testing.T) { + t.Run("GetContentType_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *EmailTracking + var obj *EmailAttachment // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetFirstOpenedAt() // Should return zero value + _ = obj.GetContentType() // Should return zero value }) - t.Run("GetLastOpenedAt", func(t *testing.T) { + t.Run("GetContentID", func(t *testing.T) { t.Parallel() // Arrange - obj := &EmailTracking{} - var expected *time.Time - obj.LastOpenedAt = expected + obj := &EmailAttachment{} + var expected *string + obj.ContentID = expected // Act & Assert - assert.Equal(t, expected, obj.GetLastOpenedAt(), "getter should return the property value") + assert.Equal(t, expected, obj.GetContentID(), "getter should return the property value") }) - t.Run("GetLastOpenedAt_NilValue", func(t *testing.T) { + t.Run("GetContentID_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &EmailTracking{} - obj.LastOpenedAt = nil + obj := &EmailAttachment{} + obj.ContentID = nil // Act & Assert - assert.Nil(t, obj.GetLastOpenedAt(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetContentID(), "getter should return nil when property is nil") }) - t.Run("GetLastOpenedAt_NilReceiver", func(t *testing.T) { + t.Run("GetContentID_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *EmailTracking + var obj *EmailAttachment // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetLastOpenedAt() // Should return zero value + _ = obj.GetContentID() // Should return zero value }) - t.Run("GetClickCount", func(t *testing.T) { + t.Run("GetSize", func(t *testing.T) { t.Parallel() // Arrange - obj := &EmailTracking{} + obj := &EmailAttachment{} var expected int64 - obj.ClickCount = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetClickCount(), "getter should return the property value") - }) - - t.Run("GetClickCount_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *EmailTracking - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetClickCount() // Should return zero value - }) - - t.Run("GetFirstClickedAt", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &EmailTracking{} - var expected *time.Time - obj.FirstClickedAt = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetFirstClickedAt(), "getter should return the property value") - }) - - t.Run("GetFirstClickedAt_NilValue", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &EmailTracking{} - obj.FirstClickedAt = nil - - // Act & Assert - assert.Nil(t, obj.GetFirstClickedAt(), "getter should return nil when property is nil") - }) - - t.Run("GetFirstClickedAt_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *EmailTracking - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetFirstClickedAt() // Should return zero value - }) - - t.Run("GetLastClickedAt", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &EmailTracking{} - var expected *time.Time - obj.LastClickedAt = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetLastClickedAt(), "getter should return the property value") - }) - - t.Run("GetLastClickedAt_NilValue", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &EmailTracking{} - obj.LastClickedAt = nil + obj.Size = expected // Act & Assert - assert.Nil(t, obj.GetLastClickedAt(), "getter should return nil when property is nil") + assert.Equal(t, expected, obj.GetSize(), "getter should return the property value") }) - t.Run("GetLastClickedAt_NilReceiver", func(t *testing.T) { + t.Run("GetSize_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *EmailTracking + var obj *EmailAttachment // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetLastClickedAt() // Should return zero value + _ = obj.GetSize() // Should return zero value }) } -func TestSettersMarkExplicitEmailTracking(t *testing.T) { - t.Run("SetOpens_MarksExplicit", func(t *testing.T) { +func TestSettersMarkExplicitEmailAttachment(t *testing.T) { + t.Run("SetID_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &EmailTracking{} - var fernTestValueOpens bool + obj := &EmailAttachment{} + var fernTestValueID string // Act - obj.SetOpens(fernTestValueOpens) + obj.SetID(fernTestValueID) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -40007,14 +38590,14 @@ func TestSettersMarkExplicitEmailTracking(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetClicks_MarksExplicit", func(t *testing.T) { + t.Run("SetFilename_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &EmailTracking{} - var fernTestValueClicks bool + obj := &EmailAttachment{} + var fernTestValueFilename string // Act - obj.SetClicks(fernTestValueClicks) + obj.SetFilename(fernTestValueFilename) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -40038,14 +38621,14 @@ func TestSettersMarkExplicitEmailTracking(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetUnsubscribe_MarksExplicit", func(t *testing.T) { + t.Run("SetContentType_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &EmailTracking{} - var fernTestValueUnsubscribe bool + obj := &EmailAttachment{} + var fernTestValueContentType string // Act - obj.SetUnsubscribe(fernTestValueUnsubscribe) + obj.SetContentType(fernTestValueContentType) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -40069,14 +38652,14 @@ func TestSettersMarkExplicitEmailTracking(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetOpenCount_MarksExplicit", func(t *testing.T) { + t.Run("SetContentID_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &EmailTracking{} - var fernTestValueOpenCount int64 + obj := &EmailAttachment{} + var fernTestValueContentID *string // Act - obj.SetOpenCount(fernTestValueOpenCount) + obj.SetContentID(fernTestValueContentID) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -40100,14 +38683,14 @@ func TestSettersMarkExplicitEmailTracking(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetFirstOpenedAt_MarksExplicit", func(t *testing.T) { + t.Run("SetSize_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &EmailTracking{} - var fernTestValueFirstOpenedAt *time.Time + obj := &EmailAttachment{} + var fernTestValueSize int64 // Act - obj.SetFirstOpenedAt(fernTestValueFirstOpenedAt) + obj.SetSize(fernTestValueSize) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -40131,76 +38714,95 @@ func TestSettersMarkExplicitEmailTracking(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetLastOpenedAt_MarksExplicit", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &EmailTracking{} - var fernTestValueLastOpenedAt *time.Time +} - // Act - obj.SetLastOpenedAt(fernTestValueLastOpenedAt) +func TestSettersEmailContentStorage(t *testing.T) { + t.Run("SetMode", func(t *testing.T) { + obj := &EmailContentStorage{} + var fernTestValueMode EmailContentStorageMode + obj.SetMode(fernTestValueMode) + assert.Equal(t, fernTestValueMode, obj.Mode) + assert.NotNil(t, obj.explicitFields) + }) - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") + t.Run("SetDiscardedAt", func(t *testing.T) { + obj := &EmailContentStorage{} + var fernTestValueDiscardedAt *time.Time + obj.SetDiscardedAt(fernTestValueDiscardedAt) + assert.Equal(t, fernTestValueDiscardedAt, obj.DiscardedAt) + assert.NotNil(t, obj.explicitFields) + }) - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } +} - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip +func TestGettersEmailContentStorage(t *testing.T) { + t.Run("GetMode", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &EmailContentStorage{} + var expected EmailContentStorageMode + obj.Mode = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetMode(), "getter should return the property value") }) - t.Run("SetClickCount_MarksExplicit", func(t *testing.T) { + t.Run("GetMode_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *EmailContentStorage + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetMode() // Should return zero value + }) + + t.Run("GetDiscardedAt", func(t *testing.T) { t.Parallel() // Arrange - obj := &EmailTracking{} - var fernTestValueClickCount int64 + obj := &EmailContentStorage{} + var expected *time.Time + obj.DiscardedAt = expected - // Act - obj.SetClickCount(fernTestValueClickCount) + // Act & Assert + assert.Equal(t, expected, obj.GetDiscardedAt(), "getter should return the property value") + }) - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") + t.Run("GetDiscardedAt_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &EmailContentStorage{} + obj.DiscardedAt = nil - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } + // Act & Assert + assert.Nil(t, obj.GetDiscardedAt(), "getter should return nil when property is nil") + }) - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip + t.Run("GetDiscardedAt_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *EmailContentStorage + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetDiscardedAt() // Should return zero value }) - t.Run("SetFirstClickedAt_MarksExplicit", func(t *testing.T) { +} + +func TestSettersMarkExplicitEmailContentStorage(t *testing.T) { + t.Run("SetMode_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &EmailTracking{} - var fernTestValueFirstClickedAt *time.Time + obj := &EmailContentStorage{} + var fernTestValueMode EmailContentStorageMode // Act - obj.SetFirstClickedAt(fernTestValueFirstClickedAt) + obj.SetMode(fernTestValueMode) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -40224,14 +38826,14 @@ func TestSettersMarkExplicitEmailTracking(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetLastClickedAt_MarksExplicit", func(t *testing.T) { + t.Run("SetDiscardedAt_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &EmailTracking{} - var fernTestValueLastClickedAt *time.Time + obj := &EmailContentStorage{} + var fernTestValueDiscardedAt *time.Time // Act - obj.SetLastClickedAt(fernTestValueLastClickedAt) + obj.SetDiscardedAt(fernTestValueDiscardedAt) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -40257,62 +38859,83 @@ func TestSettersMarkExplicitEmailTracking(t *testing.T) { } -func TestSettersError(t *testing.T) { - t.Run("SetError", func(t *testing.T) { - obj := &Error{} - var fernTestValueError *ErrorBody - obj.SetError(fernTestValueError) - assert.Equal(t, fernTestValueError, obj.Error) +func TestSettersEmailFailure(t *testing.T) { + t.Run("SetCode", func(t *testing.T) { + obj := &EmailFailure{} + var fernTestValueCode string + obj.SetCode(fernTestValueCode) + assert.Equal(t, fernTestValueCode, obj.Code) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetMessage", func(t *testing.T) { + obj := &EmailFailure{} + var fernTestValueMessage string + obj.SetMessage(fernTestValueMessage) + assert.Equal(t, fernTestValueMessage, obj.Message) assert.NotNil(t, obj.explicitFields) }) } -func TestGettersError(t *testing.T) { - t.Run("GetError", func(t *testing.T) { +func TestGettersEmailFailure(t *testing.T) { + t.Run("GetCode", func(t *testing.T) { t.Parallel() // Arrange - obj := &Error{} - var expected *ErrorBody - obj.Error = expected + obj := &EmailFailure{} + var expected string + obj.Code = expected // Act & Assert - assert.Equal(t, expected, obj.GetError(), "getter should return the property value") + assert.Equal(t, expected, obj.GetCode(), "getter should return the property value") }) - t.Run("GetError_NilValue", func(t *testing.T) { + t.Run("GetCode_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *EmailFailure + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetCode() // Should return zero value + }) + + t.Run("GetMessage", func(t *testing.T) { t.Parallel() // Arrange - obj := &Error{} - obj.Error = nil + obj := &EmailFailure{} + var expected string + obj.Message = expected // Act & Assert - assert.Nil(t, obj.GetError(), "getter should return nil when property is nil") + assert.Equal(t, expected, obj.GetMessage(), "getter should return the property value") }) - t.Run("GetError_NilReceiver", func(t *testing.T) { + t.Run("GetMessage_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *Error + var obj *EmailFailure // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetError() // Should return zero value + _ = obj.GetMessage() // Should return zero value }) } -func TestSettersMarkExplicitError(t *testing.T) { - t.Run("SetError_MarksExplicit", func(t *testing.T) { +func TestSettersMarkExplicitEmailFailure(t *testing.T) { + t.Run("SetCode_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &Error{} - var fernTestValueError *ErrorBody + obj := &EmailFailure{} + var fernTestValueCode string // Act - obj.SetError(fernTestValueError) + obj.SetCode(fernTestValueCode) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -40336,270 +38959,188 @@ func TestSettersMarkExplicitError(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) -} + t.Run("SetMessage_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &EmailFailure{} + var fernTestValueMessage string -func TestSettersErrorBody(t *testing.T) { - t.Run("SetType", func(t *testing.T) { - obj := &ErrorBody{} - var fernTestValueType ErrorBodyType - obj.SetType(fernTestValueType) - assert.Equal(t, fernTestValueType, obj.Type) - assert.NotNil(t, obj.explicitFields) - }) + // Act + obj.SetMessage(fernTestValueMessage) - t.Run("SetCode", func(t *testing.T) { - obj := &ErrorBody{} - var fernTestValueCode string - obj.SetCode(fernTestValueCode) - assert.Equal(t, fernTestValueCode, obj.Code) - assert.NotNil(t, obj.explicitFields) - }) + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") - t.Run("SetMessage", func(t *testing.T) { - obj := &ErrorBody{} - var fernTestValueMessage string - obj.SetMessage(fernTestValueMessage) - assert.Equal(t, fernTestValueMessage, obj.Message) - assert.NotNil(t, obj.explicitFields) + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetParam", func(t *testing.T) { - obj := &ErrorBody{} - var fernTestValueParam *string - obj.SetParam(fernTestValueParam) - assert.Equal(t, fernTestValueParam, obj.Param) +} + +func TestSettersEmailRecipient(t *testing.T) { + t.Run("SetAddress", func(t *testing.T) { + obj := &EmailRecipient{} + var fernTestValueAddress string + obj.SetAddress(fernTestValueAddress) + assert.Equal(t, fernTestValueAddress, obj.Address) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetIssues", func(t *testing.T) { - obj := &ErrorBody{} - var fernTestValueIssues []*ErrorBodyIssuesItem - obj.SetIssues(fernTestValueIssues) - assert.Equal(t, fernTestValueIssues, obj.Issues) + t.Run("SetType", func(t *testing.T) { + obj := &EmailRecipient{} + var fernTestValueType EmailRecipientType + obj.SetType(fernTestValueType) + assert.Equal(t, fernTestValueType, obj.Type) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetHint", func(t *testing.T) { - obj := &ErrorBody{} - var fernTestValueHint *string - obj.SetHint(fernTestValueHint) - assert.Equal(t, fernTestValueHint, obj.Hint) + t.Run("SetStatus", func(t *testing.T) { + obj := &EmailRecipient{} + var fernTestValueStatus EmailRecipientStatus + obj.SetStatus(fernTestValueStatus) + assert.Equal(t, fernTestValueStatus, obj.Status) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetRequestID", func(t *testing.T) { - obj := &ErrorBody{} - var fernTestValueRequestID string - obj.SetRequestID(fernTestValueRequestID) - assert.Equal(t, fernTestValueRequestID, obj.RequestID) + t.Run("SetLastEventAt", func(t *testing.T) { + obj := &EmailRecipient{} + var fernTestValueLastEventAt *time.Time + obj.SetLastEventAt(fernTestValueLastEventAt) + assert.Equal(t, fernTestValueLastEventAt, obj.LastEventAt) assert.NotNil(t, obj.explicitFields) }) } -func TestGettersErrorBody(t *testing.T) { - t.Run("GetType", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &ErrorBody{} - var expected ErrorBodyType - obj.Type = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetType(), "getter should return the property value") - }) - - t.Run("GetType_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *ErrorBody - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetType() // Should return zero value - }) - - t.Run("GetCode", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &ErrorBody{} - var expected string - obj.Code = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetCode(), "getter should return the property value") - }) - - t.Run("GetCode_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *ErrorBody - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetCode() // Should return zero value - }) - - t.Run("GetMessage", func(t *testing.T) { +func TestGettersEmailRecipient(t *testing.T) { + t.Run("GetAddress", func(t *testing.T) { t.Parallel() // Arrange - obj := &ErrorBody{} + obj := &EmailRecipient{} var expected string - obj.Message = expected + obj.Address = expected // Act & Assert - assert.Equal(t, expected, obj.GetMessage(), "getter should return the property value") + assert.Equal(t, expected, obj.GetAddress(), "getter should return the property value") }) - t.Run("GetMessage_NilReceiver", func(t *testing.T) { + t.Run("GetAddress_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *ErrorBody + var obj *EmailRecipient // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetMessage() // Should return zero value - }) - - t.Run("GetParam", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &ErrorBody{} - var expected *string - obj.Param = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetParam(), "getter should return the property value") + _ = obj.GetAddress() // Should return zero value }) - t.Run("GetParam_NilValue", func(t *testing.T) { + t.Run("GetType", func(t *testing.T) { t.Parallel() // Arrange - obj := &ErrorBody{} - obj.Param = nil + obj := &EmailRecipient{} + var expected EmailRecipientType + obj.Type = expected // Act & Assert - assert.Nil(t, obj.GetParam(), "getter should return nil when property is nil") + assert.Equal(t, expected, obj.GetType(), "getter should return the property value") }) - t.Run("GetParam_NilReceiver", func(t *testing.T) { + t.Run("GetType_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *ErrorBody + var obj *EmailRecipient // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetParam() // Should return zero value - }) - - t.Run("GetIssues", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &ErrorBody{} - var expected []*ErrorBodyIssuesItem - obj.Issues = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetIssues(), "getter should return the property value") + _ = obj.GetType() // Should return zero value }) - t.Run("GetIssues_NilValue", func(t *testing.T) { + t.Run("GetStatus", func(t *testing.T) { t.Parallel() // Arrange - obj := &ErrorBody{} - obj.Issues = nil + obj := &EmailRecipient{} + var expected EmailRecipientStatus + obj.Status = expected // Act & Assert - assert.Nil(t, obj.GetIssues(), "getter should return nil when property is nil") + assert.Equal(t, expected, obj.GetStatus(), "getter should return the property value") }) - t.Run("GetIssues_NilReceiver", func(t *testing.T) { + t.Run("GetStatus_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *ErrorBody + var obj *EmailRecipient // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetIssues() // Should return zero value - }) - - t.Run("GetHint", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &ErrorBody{} - var expected *string - obj.Hint = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetHint(), "getter should return the property value") + _ = obj.GetStatus() // Should return zero value }) - t.Run("GetHint_NilValue", func(t *testing.T) { + t.Run("GetLastEventAt", func(t *testing.T) { t.Parallel() // Arrange - obj := &ErrorBody{} - obj.Hint = nil + obj := &EmailRecipient{} + var expected *time.Time + obj.LastEventAt = expected // Act & Assert - assert.Nil(t, obj.GetHint(), "getter should return nil when property is nil") - }) - - t.Run("GetHint_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *ErrorBody - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetHint() // Should return zero value + assert.Equal(t, expected, obj.GetLastEventAt(), "getter should return the property value") }) - t.Run("GetRequestID", func(t *testing.T) { + t.Run("GetLastEventAt_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &ErrorBody{} - var expected string - obj.RequestID = expected + obj := &EmailRecipient{} + obj.LastEventAt = nil // Act & Assert - assert.Equal(t, expected, obj.GetRequestID(), "getter should return the property value") + assert.Nil(t, obj.GetLastEventAt(), "getter should return nil when property is nil") }) - t.Run("GetRequestID_NilReceiver", func(t *testing.T) { + t.Run("GetLastEventAt_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *ErrorBody + var obj *EmailRecipient // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetRequestID() // Should return zero value + _ = obj.GetLastEventAt() // Should return zero value }) } -func TestSettersMarkExplicitErrorBody(t *testing.T) { - t.Run("SetType_MarksExplicit", func(t *testing.T) { +func TestSettersMarkExplicitEmailRecipient(t *testing.T) { + t.Run("SetAddress_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &ErrorBody{} - var fernTestValueType ErrorBodyType + obj := &EmailRecipient{} + var fernTestValueAddress string // Act - obj.SetType(fernTestValueType) + obj.SetAddress(fernTestValueAddress) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -40623,14 +39164,14 @@ func TestSettersMarkExplicitErrorBody(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetCode_MarksExplicit", func(t *testing.T) { + t.Run("SetType_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &ErrorBody{} - var fernTestValueCode string + obj := &EmailRecipient{} + var fernTestValueType EmailRecipientType // Act - obj.SetCode(fernTestValueCode) + obj.SetType(fernTestValueType) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -40654,14 +39195,14 @@ func TestSettersMarkExplicitErrorBody(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetMessage_MarksExplicit", func(t *testing.T) { + t.Run("SetStatus_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &ErrorBody{} - var fernTestValueMessage string + obj := &EmailRecipient{} + var fernTestValueStatus EmailRecipientStatus // Act - obj.SetMessage(fernTestValueMessage) + obj.SetStatus(fernTestValueStatus) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -40685,14 +39226,14 @@ func TestSettersMarkExplicitErrorBody(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetParam_MarksExplicit", func(t *testing.T) { + t.Run("SetLastEventAt_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &ErrorBody{} - var fernTestValueParam *string + obj := &EmailRecipient{} + var fernTestValueLastEventAt *time.Time // Act - obj.SetParam(fernTestValueParam) + obj.SetLastEventAt(fernTestValueLastEventAt) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -40716,445 +39257,85 @@ func TestSettersMarkExplicitErrorBody(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetIssues_MarksExplicit", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &ErrorBody{} - var fernTestValueIssues []*ErrorBodyIssuesItem +} - // Act - obj.SetIssues(fernTestValueIssues) +func TestSettersEmailTagsItem(t *testing.T) { + t.Run("SetName", func(t *testing.T) { + obj := &EmailTagsItem{} + var fernTestValueName string + obj.SetName(fernTestValueName) + assert.Equal(t, fernTestValueName, obj.Name) + assert.NotNil(t, obj.explicitFields) + }) - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") + t.Run("SetValue", func(t *testing.T) { + obj := &EmailTagsItem{} + var fernTestValueValue string + obj.SetValue(fernTestValueValue) + assert.Equal(t, fernTestValueValue, obj.Value) + assert.NotNil(t, obj.explicitFields) + }) - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } +} - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip - }) - - t.Run("SetHint_MarksExplicit", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &ErrorBody{} - var fernTestValueHint *string - - // Act - obj.SetHint(fernTestValueHint) - - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") - - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } - - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip - }) - - t.Run("SetRequestID_MarksExplicit", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &ErrorBody{} - var fernTestValueRequestID string - - // Act - obj.SetRequestID(fernTestValueRequestID) - - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") - - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } - - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip - }) - -} - -func TestSettersErrorBodyIssuesItem(t *testing.T) { - t.Run("SetPath", func(t *testing.T) { - obj := &ErrorBodyIssuesItem{} - var fernTestValuePath string - obj.SetPath(fernTestValuePath) - assert.Equal(t, fernTestValuePath, obj.Path) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetMessage", func(t *testing.T) { - obj := &ErrorBodyIssuesItem{} - var fernTestValueMessage string - obj.SetMessage(fernTestValueMessage) - assert.Equal(t, fernTestValueMessage, obj.Message) - assert.NotNil(t, obj.explicitFields) - }) - -} - -func TestGettersErrorBodyIssuesItem(t *testing.T) { - t.Run("GetPath", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &ErrorBodyIssuesItem{} - var expected string - obj.Path = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetPath(), "getter should return the property value") - }) - - t.Run("GetPath_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *ErrorBodyIssuesItem - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetPath() // Should return zero value - }) - - t.Run("GetMessage", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &ErrorBodyIssuesItem{} - var expected string - obj.Message = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetMessage(), "getter should return the property value") - }) - - t.Run("GetMessage_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *ErrorBodyIssuesItem - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetMessage() // Should return zero value - }) - -} - -func TestSettersMarkExplicitErrorBodyIssuesItem(t *testing.T) { - t.Run("SetPath_MarksExplicit", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &ErrorBodyIssuesItem{} - var fernTestValuePath string - - // Act - obj.SetPath(fernTestValuePath) - - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") - - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } - - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip - }) - - t.Run("SetMessage_MarksExplicit", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &ErrorBodyIssuesItem{} - var fernTestValueMessage string - - // Act - obj.SetMessage(fernTestValueMessage) - - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") - - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } - - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip - }) - -} - -func TestGettersExportSuppressionsRequestScope(t *testing.T) { - t.Run("GetExportSuppressionsRequestScopeZero", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &ExportSuppressionsRequestScope{} - var expected ExportSuppressionsRequestScopeZero - obj.ExportSuppressionsRequestScopeZero = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetExportSuppressionsRequestScopeZero(), "getter should return the property value") - }) - - t.Run("GetExportSuppressionsRequestScopeZero_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *ExportSuppressionsRequestScope - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetExportSuppressionsRequestScopeZero() // Should return zero value - }) - - t.Run("GetExportSuppressionsRequestScopeOne", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &ExportSuppressionsRequestScope{} - var expected ExportSuppressionsRequestScopeOne - obj.ExportSuppressionsRequestScopeOne = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetExportSuppressionsRequestScopeOne(), "getter should return the property value") - }) - - t.Run("GetExportSuppressionsRequestScopeOne_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *ExportSuppressionsRequestScope - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetExportSuppressionsRequestScopeOne() // Should return zero value - }) - - t.Run("GetString", func(t *testing.T) { +func TestGettersEmailTagsItem(t *testing.T) { + t.Run("GetName", func(t *testing.T) { t.Parallel() // Arrange - obj := &ExportSuppressionsRequestScope{} + obj := &EmailTagsItem{} var expected string - obj.String = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetString(), "getter should return the property value") - }) - - t.Run("GetString_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *ExportSuppressionsRequestScope - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetString() // Should return zero value - }) - -} - -func TestSettersForgottenRiskUser(t *testing.T) { - t.Run("SetObject", func(t *testing.T) { - obj := &ForgottenRiskUser{} - var fernTestValueObject ForgottenRiskUserObject - obj.SetObject(fernTestValueObject) - assert.Equal(t, fernTestValueObject, obj.Object) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetID", func(t *testing.T) { - obj := &ForgottenRiskUser{} - var fernTestValueID string - obj.SetID(fernTestValueID) - assert.Equal(t, fernTestValueID, obj.ID) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetDeleted", func(t *testing.T) { - obj := &ForgottenRiskUser{} - var fernTestValueDeleted bool - obj.SetDeleted(fernTestValueDeleted) - assert.Equal(t, fernTestValueDeleted, obj.Deleted) - assert.NotNil(t, obj.explicitFields) - }) - -} - -func TestGettersForgottenRiskUser(t *testing.T) { - t.Run("GetObject", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &ForgottenRiskUser{} - var expected ForgottenRiskUserObject - obj.Object = expected + obj.Name = expected // Act & Assert - assert.Equal(t, expected, obj.GetObject(), "getter should return the property value") + assert.Equal(t, expected, obj.GetName(), "getter should return the property value") }) - t.Run("GetObject_NilReceiver", func(t *testing.T) { + t.Run("GetName_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *ForgottenRiskUser + var obj *EmailTagsItem // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetObject() // Should return zero value + _ = obj.GetName() // Should return zero value }) - t.Run("GetID", func(t *testing.T) { + t.Run("GetValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &ForgottenRiskUser{} + obj := &EmailTagsItem{} var expected string - obj.ID = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetID(), "getter should return the property value") - }) - - t.Run("GetID_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *ForgottenRiskUser - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetID() // Should return zero value - }) - - t.Run("GetDeleted", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &ForgottenRiskUser{} - var expected bool - obj.Deleted = expected + obj.Value = expected // Act & Assert - assert.Equal(t, expected, obj.GetDeleted(), "getter should return the property value") + assert.Equal(t, expected, obj.GetValue(), "getter should return the property value") }) - t.Run("GetDeleted_NilReceiver", func(t *testing.T) { + t.Run("GetValue_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *ForgottenRiskUser + var obj *EmailTagsItem // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetDeleted() // Should return zero value + _ = obj.GetValue() // Should return zero value }) } -func TestSettersMarkExplicitForgottenRiskUser(t *testing.T) { - t.Run("SetObject_MarksExplicit", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &ForgottenRiskUser{} - var fernTestValueObject ForgottenRiskUserObject - - // Act - obj.SetObject(fernTestValueObject) - - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") - - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } - - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip - }) - - t.Run("SetID_MarksExplicit", func(t *testing.T) { +func TestSettersMarkExplicitEmailTagsItem(t *testing.T) { + t.Run("SetName_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &ForgottenRiskUser{} - var fernTestValueID string + obj := &EmailTagsItem{} + var fernTestValueName string // Act - obj.SetID(fernTestValueID) + obj.SetName(fernTestValueName) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -41178,14 +39359,14 @@ func TestSettersMarkExplicitForgottenRiskUser(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetDeleted_MarksExplicit", func(t *testing.T) { + t.Run("SetValue_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &ForgottenRiskUser{} - var fernTestValueDeleted bool + obj := &EmailTagsItem{} + var fernTestValueValue string // Act - obj.SetDeleted(fernTestValueDeleted) + obj.SetValue(fernTestValueValue) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -41211,159 +39392,95 @@ func TestSettersMarkExplicitForgottenRiskUser(t *testing.T) { } -func TestSettersFormSubmission(t *testing.T) { +func TestSettersEmailTemplate(t *testing.T) { t.Run("SetObject", func(t *testing.T) { - obj := &FormSubmission{} - var fernTestValueObject FormSubmissionObject + obj := &EmailTemplate{} + var fernTestValueObject EmailTemplateObject obj.SetObject(fernTestValueObject) assert.Equal(t, fernTestValueObject, obj.Object) assert.NotNil(t, obj.explicitFields) }) t.Run("SetID", func(t *testing.T) { - obj := &FormSubmission{} + obj := &EmailTemplate{} var fernTestValueID string obj.SetID(fernTestValueID) assert.Equal(t, fernTestValueID, obj.ID) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetFormID", func(t *testing.T) { - obj := &FormSubmission{} - var fernTestValueFormID string - obj.SetFormID(fernTestValueFormID) - assert.Equal(t, fernTestValueFormID, obj.FormID) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetStatus", func(t *testing.T) { - obj := &FormSubmission{} - var fernTestValueStatus FormSubmissionStatus - obj.SetStatus(fernTestValueStatus) - assert.Equal(t, fernTestValueStatus, obj.Status) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetData", func(t *testing.T) { - obj := &FormSubmission{} - var fernTestValueData map[string]*FormSubmissionDataValue - obj.SetData(fernTestValueData) - assert.Equal(t, fernTestValueData, obj.Data) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetSubmitterEmail", func(t *testing.T) { - obj := &FormSubmission{} - var fernTestValueSubmitterEmail *string - obj.SetSubmitterEmail(fernTestValueSubmitterEmail) - assert.Equal(t, fernTestValueSubmitterEmail, obj.SubmitterEmail) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetFiles", func(t *testing.T) { - obj := &FormSubmission{} - var fernTestValueFiles []*FormSubmissionFile - obj.SetFiles(fernTestValueFiles) - assert.Equal(t, fernTestValueFiles, obj.Files) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetSpamReason", func(t *testing.T) { - obj := &FormSubmission{} - var fernTestValueSpamReason *FormSubmissionSpamReason - obj.SetSpamReason(fernTestValueSpamReason) - assert.Equal(t, fernTestValueSpamReason, obj.SpamReason) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetRisk", func(t *testing.T) { - obj := &FormSubmission{} - var fernTestValueRisk *FormSubmissionRisk - obj.SetRisk(fernTestValueRisk) - assert.Equal(t, fernTestValueRisk, obj.Risk) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetIP", func(t *testing.T) { - obj := &FormSubmission{} - var fernTestValueIP *string - obj.SetIP(fernTestValueIP) - assert.Equal(t, fernTestValueIP, obj.IP) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetUserAgent", func(t *testing.T) { - obj := &FormSubmission{} - var fernTestValueUserAgent *string - obj.SetUserAgent(fernTestValueUserAgent) - assert.Equal(t, fernTestValueUserAgent, obj.UserAgent) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetOrigin", func(t *testing.T) { - obj := &FormSubmission{} - var fernTestValueOrigin *string - obj.SetOrigin(fernTestValueOrigin) - assert.Equal(t, fernTestValueOrigin, obj.Origin) + t.Run("SetAlias", func(t *testing.T) { + obj := &EmailTemplate{} + var fernTestValueAlias *string + obj.SetAlias(fernTestValueAlias) + assert.Equal(t, fernTestValueAlias, obj.Alias) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetReferrer", func(t *testing.T) { - obj := &FormSubmission{} - var fernTestValueReferrer *string - obj.SetReferrer(fernTestValueReferrer) - assert.Equal(t, fernTestValueReferrer, obj.Referrer) + t.Run("SetName", func(t *testing.T) { + obj := &EmailTemplate{} + var fernTestValueName string + obj.SetName(fernTestValueName) + assert.Equal(t, fernTestValueName, obj.Name) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetConfirmedAt", func(t *testing.T) { - obj := &FormSubmission{} - var fernTestValueConfirmedAt *time.Time - obj.SetConfirmedAt(fernTestValueConfirmedAt) - assert.Equal(t, fernTestValueConfirmedAt, obj.ConfirmedAt) + t.Run("SetDescription", func(t *testing.T) { + obj := &EmailTemplate{} + var fernTestValueDescription *string + obj.SetDescription(fernTestValueDescription) + assert.Equal(t, fernTestValueDescription, obj.Description) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetAcceptedAt", func(t *testing.T) { - obj := &FormSubmission{} - var fernTestValueAcceptedAt *time.Time - obj.SetAcceptedAt(fernTestValueAcceptedAt) - assert.Equal(t, fernTestValueAcceptedAt, obj.AcceptedAt) + t.Run("SetPublishedVersion", func(t *testing.T) { + obj := &EmailTemplate{} + var fernTestValuePublishedVersion *int64 + obj.SetPublishedVersion(fernTestValuePublishedVersion) + assert.Equal(t, fernTestValuePublishedVersion, obj.PublishedVersion) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetReleasedAt", func(t *testing.T) { - obj := &FormSubmission{} - var fernTestValueReleasedAt *time.Time - obj.SetReleasedAt(fernTestValueReleasedAt) - assert.Equal(t, fernTestValueReleasedAt, obj.ReleasedAt) + t.Run("SetPublishedAt", func(t *testing.T) { + obj := &EmailTemplate{} + var fernTestValuePublishedAt *time.Time + obj.SetPublishedAt(fernTestValuePublishedAt) + assert.Equal(t, fernTestValuePublishedAt, obj.PublishedAt) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetSandbox", func(t *testing.T) { - obj := &FormSubmission{} - var fernTestValueSandbox bool - obj.SetSandbox(fernTestValueSandbox) - assert.Equal(t, fernTestValueSandbox, obj.Sandbox) + t.Run("SetHasUnpublishedChanges", func(t *testing.T) { + obj := &EmailTemplate{} + var fernTestValueHasUnpublishedChanges bool + obj.SetHasUnpublishedChanges(fernTestValueHasUnpublishedChanges) + assert.Equal(t, fernTestValueHasUnpublishedChanges, obj.HasUnpublishedChanges) assert.NotNil(t, obj.explicitFields) }) t.Run("SetCreatedAt", func(t *testing.T) { - obj := &FormSubmission{} + obj := &EmailTemplate{} var fernTestValueCreatedAt time.Time obj.SetCreatedAt(fernTestValueCreatedAt) assert.Equal(t, fernTestValueCreatedAt, obj.CreatedAt) assert.NotNil(t, obj.explicitFields) }) + t.Run("SetUpdatedAt", func(t *testing.T) { + obj := &EmailTemplate{} + var fernTestValueUpdatedAt time.Time + obj.SetUpdatedAt(fernTestValueUpdatedAt) + assert.Equal(t, fernTestValueUpdatedAt, obj.UpdatedAt) + assert.NotNil(t, obj.explicitFields) + }) + } -func TestGettersFormSubmission(t *testing.T) { +func TestGettersEmailTemplate(t *testing.T) { t.Run("GetObject", func(t *testing.T) { t.Parallel() // Arrange - obj := &FormSubmission{} - var expected FormSubmissionObject + obj := &EmailTemplate{} + var expected EmailTemplateObject obj.Object = expected // Act & Assert @@ -41372,7 +39489,7 @@ func TestGettersFormSubmission(t *testing.T) { t.Run("GetObject_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *FormSubmission + var obj *EmailTemplate // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -41385,7 +39502,7 @@ func TestGettersFormSubmission(t *testing.T) { t.Run("GetID", func(t *testing.T) { t.Parallel() // Arrange - obj := &FormSubmission{} + obj := &EmailTemplate{} var expected string obj.ID = expected @@ -41395,7 +39512,7 @@ func TestGettersFormSubmission(t *testing.T) { t.Run("GetID_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *FormSubmission + var obj *EmailTemplate // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -41405,502 +39522,238 @@ func TestGettersFormSubmission(t *testing.T) { _ = obj.GetID() // Should return zero value }) - t.Run("GetFormID", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &FormSubmission{} - var expected string - obj.FormID = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetFormID(), "getter should return the property value") - }) - - t.Run("GetFormID_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *FormSubmission - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetFormID() // Should return zero value - }) - - t.Run("GetStatus", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &FormSubmission{} - var expected FormSubmissionStatus - obj.Status = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetStatus(), "getter should return the property value") - }) - - t.Run("GetStatus_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *FormSubmission - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetStatus() // Should return zero value - }) - - t.Run("GetData", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &FormSubmission{} - var expected map[string]*FormSubmissionDataValue - obj.Data = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetData(), "getter should return the property value") - }) - - t.Run("GetData_NilValue", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &FormSubmission{} - obj.Data = nil - - // Act & Assert - assert.Nil(t, obj.GetData(), "getter should return nil when property is nil") - }) - - t.Run("GetData_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *FormSubmission - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetData() // Should return zero value - }) - - t.Run("GetSubmitterEmail", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &FormSubmission{} - var expected *string - obj.SubmitterEmail = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetSubmitterEmail(), "getter should return the property value") - }) - - t.Run("GetSubmitterEmail_NilValue", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &FormSubmission{} - obj.SubmitterEmail = nil - - // Act & Assert - assert.Nil(t, obj.GetSubmitterEmail(), "getter should return nil when property is nil") - }) - - t.Run("GetSubmitterEmail_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *FormSubmission - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetSubmitterEmail() // Should return zero value - }) - - t.Run("GetFiles", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &FormSubmission{} - var expected []*FormSubmissionFile - obj.Files = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetFiles(), "getter should return the property value") - }) - - t.Run("GetFiles_NilValue", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &FormSubmission{} - obj.Files = nil - - // Act & Assert - assert.Nil(t, obj.GetFiles(), "getter should return nil when property is nil") - }) - - t.Run("GetFiles_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *FormSubmission - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetFiles() // Should return zero value - }) - - t.Run("GetSpamReason", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &FormSubmission{} - var expected *FormSubmissionSpamReason - obj.SpamReason = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetSpamReason(), "getter should return the property value") - }) - - t.Run("GetSpamReason_NilValue", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &FormSubmission{} - obj.SpamReason = nil - - // Act & Assert - assert.Nil(t, obj.GetSpamReason(), "getter should return nil when property is nil") - }) - - t.Run("GetSpamReason_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *FormSubmission - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetSpamReason() // Should return zero value - }) - - t.Run("GetRisk", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &FormSubmission{} - var expected *FormSubmissionRisk - obj.Risk = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetRisk(), "getter should return the property value") - }) - - t.Run("GetRisk_NilValue", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &FormSubmission{} - obj.Risk = nil - - // Act & Assert - assert.Nil(t, obj.GetRisk(), "getter should return nil when property is nil") - }) - - t.Run("GetRisk_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *FormSubmission - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetRisk() // Should return zero value - }) - - t.Run("GetIP", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &FormSubmission{} - var expected *string - obj.IP = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetIP(), "getter should return the property value") - }) - - t.Run("GetIP_NilValue", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &FormSubmission{} - obj.IP = nil - - // Act & Assert - assert.Nil(t, obj.GetIP(), "getter should return nil when property is nil") - }) - - t.Run("GetIP_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *FormSubmission - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetIP() // Should return zero value - }) - - t.Run("GetUserAgent", func(t *testing.T) { + t.Run("GetAlias", func(t *testing.T) { t.Parallel() // Arrange - obj := &FormSubmission{} + obj := &EmailTemplate{} var expected *string - obj.UserAgent = expected + obj.Alias = expected // Act & Assert - assert.Equal(t, expected, obj.GetUserAgent(), "getter should return the property value") + assert.Equal(t, expected, obj.GetAlias(), "getter should return the property value") }) - t.Run("GetUserAgent_NilValue", func(t *testing.T) { + t.Run("GetAlias_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &FormSubmission{} - obj.UserAgent = nil + obj := &EmailTemplate{} + obj.Alias = nil // Act & Assert - assert.Nil(t, obj.GetUserAgent(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetAlias(), "getter should return nil when property is nil") }) - t.Run("GetUserAgent_NilReceiver", func(t *testing.T) { + t.Run("GetAlias_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *FormSubmission + var obj *EmailTemplate // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetUserAgent() // Should return zero value - }) - - t.Run("GetOrigin", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &FormSubmission{} - var expected *string - obj.Origin = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetOrigin(), "getter should return the property value") + _ = obj.GetAlias() // Should return zero value }) - t.Run("GetOrigin_NilValue", func(t *testing.T) { + t.Run("GetName", func(t *testing.T) { t.Parallel() // Arrange - obj := &FormSubmission{} - obj.Origin = nil + obj := &EmailTemplate{} + var expected string + obj.Name = expected // Act & Assert - assert.Nil(t, obj.GetOrigin(), "getter should return nil when property is nil") + assert.Equal(t, expected, obj.GetName(), "getter should return the property value") }) - t.Run("GetOrigin_NilReceiver", func(t *testing.T) { + t.Run("GetName_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *FormSubmission + var obj *EmailTemplate // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetOrigin() // Should return zero value + _ = obj.GetName() // Should return zero value }) - t.Run("GetReferrer", func(t *testing.T) { + t.Run("GetDescription", func(t *testing.T) { t.Parallel() // Arrange - obj := &FormSubmission{} + obj := &EmailTemplate{} var expected *string - obj.Referrer = expected + obj.Description = expected // Act & Assert - assert.Equal(t, expected, obj.GetReferrer(), "getter should return the property value") + assert.Equal(t, expected, obj.GetDescription(), "getter should return the property value") }) - t.Run("GetReferrer_NilValue", func(t *testing.T) { + t.Run("GetDescription_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &FormSubmission{} - obj.Referrer = nil + obj := &EmailTemplate{} + obj.Description = nil // Act & Assert - assert.Nil(t, obj.GetReferrer(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetDescription(), "getter should return nil when property is nil") }) - t.Run("GetReferrer_NilReceiver", func(t *testing.T) { + t.Run("GetDescription_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *FormSubmission + var obj *EmailTemplate // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetReferrer() // Should return zero value + _ = obj.GetDescription() // Should return zero value }) - t.Run("GetConfirmedAt", func(t *testing.T) { + t.Run("GetPublishedVersion", func(t *testing.T) { t.Parallel() // Arrange - obj := &FormSubmission{} - var expected *time.Time - obj.ConfirmedAt = expected + obj := &EmailTemplate{} + var expected *int64 + obj.PublishedVersion = expected // Act & Assert - assert.Equal(t, expected, obj.GetConfirmedAt(), "getter should return the property value") + assert.Equal(t, expected, obj.GetPublishedVersion(), "getter should return the property value") }) - t.Run("GetConfirmedAt_NilValue", func(t *testing.T) { + t.Run("GetPublishedVersion_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &FormSubmission{} - obj.ConfirmedAt = nil + obj := &EmailTemplate{} + obj.PublishedVersion = nil // Act & Assert - assert.Nil(t, obj.GetConfirmedAt(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetPublishedVersion(), "getter should return nil when property is nil") }) - t.Run("GetConfirmedAt_NilReceiver", func(t *testing.T) { + t.Run("GetPublishedVersion_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *FormSubmission + var obj *EmailTemplate // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetConfirmedAt() // Should return zero value + _ = obj.GetPublishedVersion() // Should return zero value }) - t.Run("GetAcceptedAt", func(t *testing.T) { + t.Run("GetPublishedAt", func(t *testing.T) { t.Parallel() // Arrange - obj := &FormSubmission{} + obj := &EmailTemplate{} var expected *time.Time - obj.AcceptedAt = expected + obj.PublishedAt = expected // Act & Assert - assert.Equal(t, expected, obj.GetAcceptedAt(), "getter should return the property value") + assert.Equal(t, expected, obj.GetPublishedAt(), "getter should return the property value") }) - t.Run("GetAcceptedAt_NilValue", func(t *testing.T) { + t.Run("GetPublishedAt_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &FormSubmission{} - obj.AcceptedAt = nil + obj := &EmailTemplate{} + obj.PublishedAt = nil // Act & Assert - assert.Nil(t, obj.GetAcceptedAt(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetPublishedAt(), "getter should return nil when property is nil") }) - t.Run("GetAcceptedAt_NilReceiver", func(t *testing.T) { + t.Run("GetPublishedAt_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *FormSubmission + var obj *EmailTemplate // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetAcceptedAt() // Should return zero value - }) - - t.Run("GetReleasedAt", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &FormSubmission{} - var expected *time.Time - obj.ReleasedAt = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetReleasedAt(), "getter should return the property value") + _ = obj.GetPublishedAt() // Should return zero value }) - t.Run("GetReleasedAt_NilValue", func(t *testing.T) { + t.Run("GetHasUnpublishedChanges", func(t *testing.T) { t.Parallel() // Arrange - obj := &FormSubmission{} - obj.ReleasedAt = nil + obj := &EmailTemplate{} + var expected bool + obj.HasUnpublishedChanges = expected // Act & Assert - assert.Nil(t, obj.GetReleasedAt(), "getter should return nil when property is nil") + assert.Equal(t, expected, obj.GetHasUnpublishedChanges(), "getter should return the property value") }) - t.Run("GetReleasedAt_NilReceiver", func(t *testing.T) { + t.Run("GetHasUnpublishedChanges_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *FormSubmission + var obj *EmailTemplate // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetReleasedAt() // Should return zero value + _ = obj.GetHasUnpublishedChanges() // Should return zero value }) - t.Run("GetSandbox", func(t *testing.T) { + t.Run("GetCreatedAt", func(t *testing.T) { t.Parallel() // Arrange - obj := &FormSubmission{} - var expected bool - obj.Sandbox = expected + obj := &EmailTemplate{} + var expected time.Time + obj.CreatedAt = expected // Act & Assert - assert.Equal(t, expected, obj.GetSandbox(), "getter should return the property value") + assert.Equal(t, expected, obj.GetCreatedAt(), "getter should return the property value") }) - t.Run("GetSandbox_NilReceiver", func(t *testing.T) { + t.Run("GetCreatedAt_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *FormSubmission + var obj *EmailTemplate // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetSandbox() // Should return zero value + _ = obj.GetCreatedAt() // Should return zero value }) - t.Run("GetCreatedAt", func(t *testing.T) { + t.Run("GetUpdatedAt", func(t *testing.T) { t.Parallel() // Arrange - obj := &FormSubmission{} + obj := &EmailTemplate{} var expected time.Time - obj.CreatedAt = expected + obj.UpdatedAt = expected // Act & Assert - assert.Equal(t, expected, obj.GetCreatedAt(), "getter should return the property value") + assert.Equal(t, expected, obj.GetUpdatedAt(), "getter should return the property value") }) - t.Run("GetCreatedAt_NilReceiver", func(t *testing.T) { + t.Run("GetUpdatedAt_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *FormSubmission + var obj *EmailTemplate // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetCreatedAt() // Should return zero value + _ = obj.GetUpdatedAt() // Should return zero value }) } -func TestSettersMarkExplicitFormSubmission(t *testing.T) { +func TestSettersMarkExplicitEmailTemplate(t *testing.T) { t.Run("SetObject_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &FormSubmission{} - var fernTestValueObject FormSubmissionObject + obj := &EmailTemplate{} + var fernTestValueObject EmailTemplateObject // Act obj.SetObject(fernTestValueObject) @@ -41930,7 +39783,7 @@ func TestSettersMarkExplicitFormSubmission(t *testing.T) { t.Run("SetID_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &FormSubmission{} + obj := &EmailTemplate{} var fernTestValueID string // Act @@ -41958,14 +39811,14 @@ func TestSettersMarkExplicitFormSubmission(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetFormID_MarksExplicit", func(t *testing.T) { + t.Run("SetAlias_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &FormSubmission{} - var fernTestValueFormID string + obj := &EmailTemplate{} + var fernTestValueAlias *string // Act - obj.SetFormID(fernTestValueFormID) + obj.SetAlias(fernTestValueAlias) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -41989,14 +39842,14 @@ func TestSettersMarkExplicitFormSubmission(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetStatus_MarksExplicit", func(t *testing.T) { + t.Run("SetName_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &FormSubmission{} - var fernTestValueStatus FormSubmissionStatus + obj := &EmailTemplate{} + var fernTestValueName string // Act - obj.SetStatus(fernTestValueStatus) + obj.SetName(fernTestValueName) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -42020,14 +39873,14 @@ func TestSettersMarkExplicitFormSubmission(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetData_MarksExplicit", func(t *testing.T) { + t.Run("SetDescription_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &FormSubmission{} - var fernTestValueData map[string]*FormSubmissionDataValue + obj := &EmailTemplate{} + var fernTestValueDescription *string // Act - obj.SetData(fernTestValueData) + obj.SetDescription(fernTestValueDescription) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -42051,14 +39904,14 @@ func TestSettersMarkExplicitFormSubmission(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetSubmitterEmail_MarksExplicit", func(t *testing.T) { + t.Run("SetPublishedVersion_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &FormSubmission{} - var fernTestValueSubmitterEmail *string + obj := &EmailTemplate{} + var fernTestValuePublishedVersion *int64 // Act - obj.SetSubmitterEmail(fernTestValueSubmitterEmail) + obj.SetPublishedVersion(fernTestValuePublishedVersion) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -42082,14 +39935,14 @@ func TestSettersMarkExplicitFormSubmission(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetFiles_MarksExplicit", func(t *testing.T) { + t.Run("SetPublishedAt_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &FormSubmission{} - var fernTestValueFiles []*FormSubmissionFile + obj := &EmailTemplate{} + var fernTestValuePublishedAt *time.Time // Act - obj.SetFiles(fernTestValueFiles) + obj.SetPublishedAt(fernTestValuePublishedAt) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -42113,14 +39966,14 @@ func TestSettersMarkExplicitFormSubmission(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetSpamReason_MarksExplicit", func(t *testing.T) { + t.Run("SetHasUnpublishedChanges_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &FormSubmission{} - var fernTestValueSpamReason *FormSubmissionSpamReason + obj := &EmailTemplate{} + var fernTestValueHasUnpublishedChanges bool // Act - obj.SetSpamReason(fernTestValueSpamReason) + obj.SetHasUnpublishedChanges(fernTestValueHasUnpublishedChanges) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -42144,14 +39997,14 @@ func TestSettersMarkExplicitFormSubmission(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetRisk_MarksExplicit", func(t *testing.T) { + t.Run("SetCreatedAt_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &FormSubmission{} - var fernTestValueRisk *FormSubmissionRisk + obj := &EmailTemplate{} + var fernTestValueCreatedAt time.Time // Act - obj.SetRisk(fernTestValueRisk) + obj.SetCreatedAt(fernTestValueCreatedAt) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -42175,14 +40028,14 @@ func TestSettersMarkExplicitFormSubmission(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetIP_MarksExplicit", func(t *testing.T) { + t.Run("SetUpdatedAt_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &FormSubmission{} - var fernTestValueIP *string + obj := &EmailTemplate{} + var fernTestValueUpdatedAt time.Time // Act - obj.SetIP(fernTestValueIP) + obj.SetUpdatedAt(fernTestValueUpdatedAt) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -42206,76 +40059,126 @@ func TestSettersMarkExplicitFormSubmission(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetUserAgent_MarksExplicit", func(t *testing.T) { +} + +func TestSettersEmailTemplateList(t *testing.T) { + t.Run("SetObject", func(t *testing.T) { + obj := &EmailTemplateList{} + var fernTestValueObject EmailTemplateListObject + obj.SetObject(fernTestValueObject) + assert.Equal(t, fernTestValueObject, obj.Object) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetData", func(t *testing.T) { + obj := &EmailTemplateList{} + var fernTestValueData []*EmailTemplate + obj.SetData(fernTestValueData) + assert.Equal(t, fernTestValueData, obj.Data) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetHasMore", func(t *testing.T) { + obj := &EmailTemplateList{} + var fernTestValueHasMore bool + obj.SetHasMore(fernTestValueHasMore) + assert.Equal(t, fernTestValueHasMore, obj.HasMore) + assert.NotNil(t, obj.explicitFields) + }) + +} + +func TestGettersEmailTemplateList(t *testing.T) { + t.Run("GetObject", func(t *testing.T) { t.Parallel() // Arrange - obj := &FormSubmission{} - var fernTestValueUserAgent *string + obj := &EmailTemplateList{} + var expected EmailTemplateListObject + obj.Object = expected - // Act - obj.SetUserAgent(fernTestValueUserAgent) + // Act & Assert + assert.Equal(t, expected, obj.GetObject(), "getter should return the property value") + }) - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") + t.Run("GetObject_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *EmailTemplateList + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetObject() // Should return zero value + }) - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } + t.Run("GetData", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &EmailTemplateList{} + var expected []*EmailTemplate + obj.Data = expected - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip + // Act & Assert + assert.Equal(t, expected, obj.GetData(), "getter should return the property value") }) - t.Run("SetOrigin_MarksExplicit", func(t *testing.T) { + t.Run("GetData_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &FormSubmission{} - var fernTestValueOrigin *string + obj := &EmailTemplateList{} + obj.Data = nil - // Act - obj.SetOrigin(fernTestValueOrigin) + // Act & Assert + assert.Nil(t, obj.GetData(), "getter should return nil when property is nil") + }) - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") + t.Run("GetData_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *EmailTemplateList + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetData() // Should return zero value + }) - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } + t.Run("GetHasMore", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &EmailTemplateList{} + var expected bool + obj.HasMore = expected - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip + // Act & Assert + assert.Equal(t, expected, obj.GetHasMore(), "getter should return the property value") }) - t.Run("SetReferrer_MarksExplicit", func(t *testing.T) { + t.Run("GetHasMore_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *EmailTemplateList + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetHasMore() // Should return zero value + }) + +} + +func TestSettersMarkExplicitEmailTemplateList(t *testing.T) { + t.Run("SetObject_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &FormSubmission{} - var fernTestValueReferrer *string + obj := &EmailTemplateList{} + var fernTestValueObject EmailTemplateListObject // Act - obj.SetReferrer(fernTestValueReferrer) + obj.SetObject(fernTestValueObject) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -42299,14 +40202,14 @@ func TestSettersMarkExplicitFormSubmission(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetConfirmedAt_MarksExplicit", func(t *testing.T) { + t.Run("SetData_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &FormSubmission{} - var fernTestValueConfirmedAt *time.Time + obj := &EmailTemplateList{} + var fernTestValueData []*EmailTemplate // Act - obj.SetConfirmedAt(fernTestValueConfirmedAt) + obj.SetData(fernTestValueData) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -42330,14 +40233,14 @@ func TestSettersMarkExplicitFormSubmission(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetAcceptedAt_MarksExplicit", func(t *testing.T) { + t.Run("SetHasMore_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &FormSubmission{} - var fernTestValueAcceptedAt *time.Time + obj := &EmailTemplateList{} + var fernTestValueHasMore bool // Act - obj.SetAcceptedAt(fernTestValueAcceptedAt) + obj.SetHasMore(fernTestValueHasMore) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -42361,14 +40264,126 @@ func TestSettersMarkExplicitFormSubmission(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetReleasedAt_MarksExplicit", func(t *testing.T) { +} + +func TestSettersEmailTemplateReference(t *testing.T) { + t.Run("SetID", func(t *testing.T) { + obj := &EmailTemplateReference{} + var fernTestValueID string + obj.SetID(fernTestValueID) + assert.Equal(t, fernTestValueID, obj.ID) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetVersion", func(t *testing.T) { + obj := &EmailTemplateReference{} + var fernTestValueVersion *int64 + obj.SetVersion(fernTestValueVersion) + assert.Equal(t, fernTestValueVersion, obj.Version) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetLocale", func(t *testing.T) { + obj := &EmailTemplateReference{} + var fernTestValueLocale string + obj.SetLocale(fernTestValueLocale) + assert.Equal(t, fernTestValueLocale, obj.Locale) + assert.NotNil(t, obj.explicitFields) + }) + +} + +func TestGettersEmailTemplateReference(t *testing.T) { + t.Run("GetID", func(t *testing.T) { t.Parallel() // Arrange - obj := &FormSubmission{} - var fernTestValueReleasedAt *time.Time + obj := &EmailTemplateReference{} + var expected string + obj.ID = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetID(), "getter should return the property value") + }) + + t.Run("GetID_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *EmailTemplateReference + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetID() // Should return zero value + }) + + t.Run("GetVersion", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &EmailTemplateReference{} + var expected *int64 + obj.Version = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetVersion(), "getter should return the property value") + }) + + t.Run("GetVersion_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &EmailTemplateReference{} + obj.Version = nil + + // Act & Assert + assert.Nil(t, obj.GetVersion(), "getter should return nil when property is nil") + }) + + t.Run("GetVersion_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *EmailTemplateReference + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetVersion() // Should return zero value + }) + + t.Run("GetLocale", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &EmailTemplateReference{} + var expected string + obj.Locale = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetLocale(), "getter should return the property value") + }) + + t.Run("GetLocale_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *EmailTemplateReference + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetLocale() // Should return zero value + }) + +} + +func TestSettersMarkExplicitEmailTemplateReference(t *testing.T) { + t.Run("SetID_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &EmailTemplateReference{} + var fernTestValueID string // Act - obj.SetReleasedAt(fernTestValueReleasedAt) + obj.SetID(fernTestValueID) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -42392,14 +40407,14 @@ func TestSettersMarkExplicitFormSubmission(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetSandbox_MarksExplicit", func(t *testing.T) { + t.Run("SetVersion_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &FormSubmission{} - var fernTestValueSandbox bool + obj := &EmailTemplateReference{} + var fernTestValueVersion *int64 // Act - obj.SetSandbox(fernTestValueSandbox) + obj.SetVersion(fernTestValueVersion) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -42423,14 +40438,14 @@ func TestSettersMarkExplicitFormSubmission(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetCreatedAt_MarksExplicit", func(t *testing.T) { + t.Run("SetLocale_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &FormSubmission{} - var fernTestValueCreatedAt time.Time + obj := &EmailTemplateReference{} + var fernTestValueLocale string // Act - obj.SetCreatedAt(fernTestValueCreatedAt) + obj.SetLocale(fernTestValueLocale) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -42456,235 +40471,453 @@ func TestSettersMarkExplicitFormSubmission(t *testing.T) { } -func TestGettersFormSubmissionDataValue(t *testing.T) { - t.Run("GetString", func(t *testing.T) { +func TestSettersEmailTemplateVersion(t *testing.T) { + t.Run("SetObject", func(t *testing.T) { + obj := &EmailTemplateVersion{} + var fernTestValueObject EmailTemplateVersionObject + obj.SetObject(fernTestValueObject) + assert.Equal(t, fernTestValueObject, obj.Object) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetTemplateID", func(t *testing.T) { + obj := &EmailTemplateVersion{} + var fernTestValueTemplateID string + obj.SetTemplateID(fernTestValueTemplateID) + assert.Equal(t, fernTestValueTemplateID, obj.TemplateID) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetVersion", func(t *testing.T) { + obj := &EmailTemplateVersion{} + var fernTestValueVersion *int64 + obj.SetVersion(fernTestValueVersion) + assert.Equal(t, fernTestValueVersion, obj.Version) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetRevision", func(t *testing.T) { + obj := &EmailTemplateVersion{} + var fernTestValueRevision int64 + obj.SetRevision(fernTestValueRevision) + assert.Equal(t, fernTestValueRevision, obj.Revision) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetDefaultLocale", func(t *testing.T) { + obj := &EmailTemplateVersion{} + var fernTestValueDefaultLocale string + obj.SetDefaultLocale(fernTestValueDefaultLocale) + assert.Equal(t, fernTestValueDefaultLocale, obj.DefaultLocale) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetVariables", func(t *testing.T) { + obj := &EmailTemplateVersion{} + var fernTestValueVariables []*TemplateVariable + obj.SetVariables(fernTestValueVariables) + assert.Equal(t, fernTestValueVariables, obj.Variables) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetSampleVariables", func(t *testing.T) { + obj := &EmailTemplateVersion{} + var fernTestValueSampleVariables map[string]any + obj.SetSampleVariables(fernTestValueSampleVariables) + assert.Equal(t, fernTestValueSampleVariables, obj.SampleVariables) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetContents", func(t *testing.T) { + obj := &EmailTemplateVersion{} + var fernTestValueContents []*TemplateContent + obj.SetContents(fernTestValueContents) + assert.Equal(t, fernTestValueContents, obj.Contents) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetProblems", func(t *testing.T) { + obj := &EmailTemplateVersion{} + var fernTestValueProblems []*TemplateProblem + obj.SetProblems(fernTestValueProblems) + assert.Equal(t, fernTestValueProblems, obj.Problems) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetPublishedAt", func(t *testing.T) { + obj := &EmailTemplateVersion{} + var fernTestValuePublishedAt *time.Time + obj.SetPublishedAt(fernTestValuePublishedAt) + assert.Equal(t, fernTestValuePublishedAt, obj.PublishedAt) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetCreatedAt", func(t *testing.T) { + obj := &EmailTemplateVersion{} + var fernTestValueCreatedAt time.Time + obj.SetCreatedAt(fernTestValueCreatedAt) + assert.Equal(t, fernTestValueCreatedAt, obj.CreatedAt) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetUpdatedAt", func(t *testing.T) { + obj := &EmailTemplateVersion{} + var fernTestValueUpdatedAt time.Time + obj.SetUpdatedAt(fernTestValueUpdatedAt) + assert.Equal(t, fernTestValueUpdatedAt, obj.UpdatedAt) + assert.NotNil(t, obj.explicitFields) + }) + +} + +func TestGettersEmailTemplateVersion(t *testing.T) { + t.Run("GetObject", func(t *testing.T) { t.Parallel() // Arrange - obj := &FormSubmissionDataValue{} + obj := &EmailTemplateVersion{} + var expected EmailTemplateVersionObject + obj.Object = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetObject(), "getter should return the property value") + }) + + t.Run("GetObject_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *EmailTemplateVersion + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetObject() // Should return zero value + }) + + t.Run("GetTemplateID", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &EmailTemplateVersion{} var expected string - obj.String = expected + obj.TemplateID = expected // Act & Assert - assert.Equal(t, expected, obj.GetString(), "getter should return the property value") + assert.Equal(t, expected, obj.GetTemplateID(), "getter should return the property value") }) - t.Run("GetString_NilReceiver", func(t *testing.T) { + t.Run("GetTemplateID_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *FormSubmissionDataValue + var obj *EmailTemplateVersion // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetString() // Should return zero value + _ = obj.GetTemplateID() // Should return zero value }) - t.Run("GetStringList", func(t *testing.T) { + t.Run("GetVersion", func(t *testing.T) { t.Parallel() // Arrange - obj := &FormSubmissionDataValue{} - var expected []string - obj.StringList = expected + obj := &EmailTemplateVersion{} + var expected *int64 + obj.Version = expected // Act & Assert - assert.Equal(t, expected, obj.GetStringList(), "getter should return the property value") + assert.Equal(t, expected, obj.GetVersion(), "getter should return the property value") }) - t.Run("GetStringList_NilValue", func(t *testing.T) { + t.Run("GetVersion_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &FormSubmissionDataValue{} - obj.StringList = nil + obj := &EmailTemplateVersion{} + obj.Version = nil // Act & Assert - assert.Nil(t, obj.GetStringList(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetVersion(), "getter should return nil when property is nil") }) - t.Run("GetStringList_NilReceiver", func(t *testing.T) { + t.Run("GetVersion_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *FormSubmissionDataValue + var obj *EmailTemplateVersion // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetStringList() // Should return zero value + _ = obj.GetVersion() // Should return zero value }) -} + t.Run("GetRevision", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &EmailTemplateVersion{} + var expected int64 + obj.Revision = expected -func TestSettersFormSubmissionFile(t *testing.T) { - t.Run("SetID", func(t *testing.T) { - obj := &FormSubmissionFile{} - var fernTestValueID string - obj.SetID(fernTestValueID) - assert.Equal(t, fernTestValueID, obj.ID) - assert.NotNil(t, obj.explicitFields) + // Act & Assert + assert.Equal(t, expected, obj.GetRevision(), "getter should return the property value") }) - t.Run("SetField", func(t *testing.T) { - obj := &FormSubmissionFile{} - var fernTestValueField string - obj.SetField(fernTestValueField) - assert.Equal(t, fernTestValueField, obj.Field) - assert.NotNil(t, obj.explicitFields) + t.Run("GetRevision_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *EmailTemplateVersion + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetRevision() // Should return zero value }) - t.Run("SetFilename", func(t *testing.T) { - obj := &FormSubmissionFile{} - var fernTestValueFilename string - obj.SetFilename(fernTestValueFilename) - assert.Equal(t, fernTestValueFilename, obj.Filename) - assert.NotNil(t, obj.explicitFields) + t.Run("GetDefaultLocale", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &EmailTemplateVersion{} + var expected string + obj.DefaultLocale = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetDefaultLocale(), "getter should return the property value") }) - t.Run("SetContentType", func(t *testing.T) { - obj := &FormSubmissionFile{} - var fernTestValueContentType string - obj.SetContentType(fernTestValueContentType) - assert.Equal(t, fernTestValueContentType, obj.ContentType) - assert.NotNil(t, obj.explicitFields) + t.Run("GetDefaultLocale_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *EmailTemplateVersion + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetDefaultLocale() // Should return zero value }) - t.Run("SetSize", func(t *testing.T) { - obj := &FormSubmissionFile{} - var fernTestValueSize int64 - obj.SetSize(fernTestValueSize) - assert.Equal(t, fernTestValueSize, obj.Size) - assert.NotNil(t, obj.explicitFields) + t.Run("GetVariables", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &EmailTemplateVersion{} + var expected []*TemplateVariable + obj.Variables = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetVariables(), "getter should return the property value") }) -} + t.Run("GetVariables_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &EmailTemplateVersion{} + obj.Variables = nil -func TestGettersFormSubmissionFile(t *testing.T) { - t.Run("GetID", func(t *testing.T) { + // Act & Assert + assert.Nil(t, obj.GetVariables(), "getter should return nil when property is nil") + }) + + t.Run("GetVariables_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *EmailTemplateVersion + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetVariables() // Should return zero value + }) + + t.Run("GetSampleVariables", func(t *testing.T) { t.Parallel() // Arrange - obj := &FormSubmissionFile{} - var expected string - obj.ID = expected + obj := &EmailTemplateVersion{} + var expected map[string]any + obj.SampleVariables = expected // Act & Assert - assert.Equal(t, expected, obj.GetID(), "getter should return the property value") + assert.Equal(t, expected, obj.GetSampleVariables(), "getter should return the property value") }) - t.Run("GetID_NilReceiver", func(t *testing.T) { + t.Run("GetSampleVariables_NilValue", func(t *testing.T) { t.Parallel() - var obj *FormSubmissionFile + // Arrange + obj := &EmailTemplateVersion{} + obj.SampleVariables = nil + + // Act & Assert + assert.Nil(t, obj.GetSampleVariables(), "getter should return nil when property is nil") + }) + + t.Run("GetSampleVariables_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *EmailTemplateVersion // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetID() // Should return zero value + _ = obj.GetSampleVariables() // Should return zero value }) - t.Run("GetField", func(t *testing.T) { + t.Run("GetContents", func(t *testing.T) { t.Parallel() // Arrange - obj := &FormSubmissionFile{} - var expected string - obj.Field = expected + obj := &EmailTemplateVersion{} + var expected []*TemplateContent + obj.Contents = expected // Act & Assert - assert.Equal(t, expected, obj.GetField(), "getter should return the property value") + assert.Equal(t, expected, obj.GetContents(), "getter should return the property value") }) - t.Run("GetField_NilReceiver", func(t *testing.T) { + t.Run("GetContents_NilValue", func(t *testing.T) { t.Parallel() - var obj *FormSubmissionFile + // Arrange + obj := &EmailTemplateVersion{} + obj.Contents = nil + + // Act & Assert + assert.Nil(t, obj.GetContents(), "getter should return nil when property is nil") + }) + + t.Run("GetContents_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *EmailTemplateVersion // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetField() // Should return zero value + _ = obj.GetContents() // Should return zero value }) - t.Run("GetFilename", func(t *testing.T) { + t.Run("GetProblems", func(t *testing.T) { t.Parallel() // Arrange - obj := &FormSubmissionFile{} - var expected string - obj.Filename = expected + obj := &EmailTemplateVersion{} + var expected []*TemplateProblem + obj.Problems = expected // Act & Assert - assert.Equal(t, expected, obj.GetFilename(), "getter should return the property value") + assert.Equal(t, expected, obj.GetProblems(), "getter should return the property value") }) - t.Run("GetFilename_NilReceiver", func(t *testing.T) { + t.Run("GetProblems_NilValue", func(t *testing.T) { t.Parallel() - var obj *FormSubmissionFile + // Arrange + obj := &EmailTemplateVersion{} + obj.Problems = nil + + // Act & Assert + assert.Nil(t, obj.GetProblems(), "getter should return nil when property is nil") + }) + + t.Run("GetProblems_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *EmailTemplateVersion // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetFilename() // Should return zero value + _ = obj.GetProblems() // Should return zero value }) - t.Run("GetContentType", func(t *testing.T) { + t.Run("GetPublishedAt", func(t *testing.T) { t.Parallel() // Arrange - obj := &FormSubmissionFile{} - var expected string - obj.ContentType = expected + obj := &EmailTemplateVersion{} + var expected *time.Time + obj.PublishedAt = expected // Act & Assert - assert.Equal(t, expected, obj.GetContentType(), "getter should return the property value") + assert.Equal(t, expected, obj.GetPublishedAt(), "getter should return the property value") }) - t.Run("GetContentType_NilReceiver", func(t *testing.T) { + t.Run("GetPublishedAt_NilValue", func(t *testing.T) { t.Parallel() - var obj *FormSubmissionFile + // Arrange + obj := &EmailTemplateVersion{} + obj.PublishedAt = nil + + // Act & Assert + assert.Nil(t, obj.GetPublishedAt(), "getter should return nil when property is nil") + }) + + t.Run("GetPublishedAt_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *EmailTemplateVersion // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetContentType() // Should return zero value + _ = obj.GetPublishedAt() // Should return zero value }) - t.Run("GetSize", func(t *testing.T) { + t.Run("GetCreatedAt", func(t *testing.T) { t.Parallel() // Arrange - obj := &FormSubmissionFile{} - var expected int64 - obj.Size = expected + obj := &EmailTemplateVersion{} + var expected time.Time + obj.CreatedAt = expected // Act & Assert - assert.Equal(t, expected, obj.GetSize(), "getter should return the property value") + assert.Equal(t, expected, obj.GetCreatedAt(), "getter should return the property value") }) - t.Run("GetSize_NilReceiver", func(t *testing.T) { + t.Run("GetCreatedAt_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *FormSubmissionFile + var obj *EmailTemplateVersion // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetSize() // Should return zero value + _ = obj.GetCreatedAt() // Should return zero value + }) + + t.Run("GetUpdatedAt", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &EmailTemplateVersion{} + var expected time.Time + obj.UpdatedAt = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetUpdatedAt(), "getter should return the property value") + }) + + t.Run("GetUpdatedAt_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *EmailTemplateVersion + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetUpdatedAt() // Should return zero value }) } -func TestSettersMarkExplicitFormSubmissionFile(t *testing.T) { - t.Run("SetID_MarksExplicit", func(t *testing.T) { +func TestSettersMarkExplicitEmailTemplateVersion(t *testing.T) { + t.Run("SetObject_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &FormSubmissionFile{} - var fernTestValueID string + obj := &EmailTemplateVersion{} + var fernTestValueObject EmailTemplateVersionObject // Act - obj.SetID(fernTestValueID) + obj.SetObject(fernTestValueObject) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -42708,14 +40941,14 @@ func TestSettersMarkExplicitFormSubmissionFile(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetField_MarksExplicit", func(t *testing.T) { + t.Run("SetTemplateID_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &FormSubmissionFile{} - var fernTestValueField string + obj := &EmailTemplateVersion{} + var fernTestValueTemplateID string // Act - obj.SetField(fernTestValueField) + obj.SetTemplateID(fernTestValueTemplateID) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -42739,14 +40972,14 @@ func TestSettersMarkExplicitFormSubmissionFile(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetFilename_MarksExplicit", func(t *testing.T) { + t.Run("SetVersion_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &FormSubmissionFile{} - var fernTestValueFilename string + obj := &EmailTemplateVersion{} + var fernTestValueVersion *int64 // Act - obj.SetFilename(fernTestValueFilename) + obj.SetVersion(fernTestValueVersion) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -42770,14 +41003,14 @@ func TestSettersMarkExplicitFormSubmissionFile(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetContentType_MarksExplicit", func(t *testing.T) { + t.Run("SetRevision_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &FormSubmissionFile{} - var fernTestValueContentType string + obj := &EmailTemplateVersion{} + var fernTestValueRevision int64 // Act - obj.SetContentType(fernTestValueContentType) + obj.SetRevision(fernTestValueRevision) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -42801,14 +41034,14 @@ func TestSettersMarkExplicitFormSubmissionFile(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetSize_MarksExplicit", func(t *testing.T) { + t.Run("SetDefaultLocale_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &FormSubmissionFile{} - var fernTestValueSize int64 + obj := &EmailTemplateVersion{} + var fernTestValueDefaultLocale string // Act - obj.SetSize(fernTestValueSize) + obj.SetDefaultLocale(fernTestValueDefaultLocale) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -42832,126 +41065,138 @@ func TestSettersMarkExplicitFormSubmissionFile(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) -} + t.Run("SetVariables_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &EmailTemplateVersion{} + var fernTestValueVariables []*TemplateVariable -func TestSettersFormSubmissionList(t *testing.T) { - t.Run("SetObject", func(t *testing.T) { - obj := &FormSubmissionList{} - var fernTestValueObject FormSubmissionListObject - obj.SetObject(fernTestValueObject) - assert.Equal(t, fernTestValueObject, obj.Object) - assert.NotNil(t, obj.explicitFields) - }) + // Act + obj.SetVariables(fernTestValueVariables) - t.Run("SetData", func(t *testing.T) { - obj := &FormSubmissionList{} - var fernTestValueData []*FormSubmission - obj.SetData(fernTestValueData) - assert.Equal(t, fernTestValueData, obj.Data) - assert.NotNil(t, obj.explicitFields) - }) + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") - t.Run("SetHasMore", func(t *testing.T) { - obj := &FormSubmissionList{} - var fernTestValueHasMore bool - obj.SetHasMore(fernTestValueHasMore) - assert.Equal(t, fernTestValueHasMore, obj.HasMore) - assert.NotNil(t, obj.explicitFields) - }) + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } -} + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) -func TestGettersFormSubmissionList(t *testing.T) { - t.Run("GetObject", func(t *testing.T) { + t.Run("SetSampleVariables_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &FormSubmissionList{} - var expected FormSubmissionListObject - obj.Object = expected + obj := &EmailTemplateVersion{} + var fernTestValueSampleVariables map[string]any - // Act & Assert - assert.Equal(t, expected, obj.GetObject(), "getter should return the property value") - }) + // Act + obj.SetSampleVariables(fernTestValueSampleVariables) - t.Run("GetObject_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *FormSubmissionList - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetObject() // Should return zero value - }) + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") - t.Run("GetData", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &FormSubmissionList{} - var expected []*FormSubmission - obj.Data = expected + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } - // Act & Assert - assert.Equal(t, expected, obj.GetData(), "getter should return the property value") + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("GetData_NilValue", func(t *testing.T) { + t.Run("SetContents_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &FormSubmissionList{} - obj.Data = nil + obj := &EmailTemplateVersion{} + var fernTestValueContents []*TemplateContent - // Act & Assert - assert.Nil(t, obj.GetData(), "getter should return nil when property is nil") - }) + // Act + obj.SetContents(fernTestValueContents) - t.Run("GetData_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *FormSubmissionList - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetData() // Should return zero value + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("GetHasMore", func(t *testing.T) { + t.Run("SetProblems_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &FormSubmissionList{} - var expected bool - obj.HasMore = expected + obj := &EmailTemplateVersion{} + var fernTestValueProblems []*TemplateProblem - // Act & Assert - assert.Equal(t, expected, obj.GetHasMore(), "getter should return the property value") - }) + // Act + obj.SetProblems(fernTestValueProblems) - t.Run("GetHasMore_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *FormSubmissionList - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetHasMore() // Should return zero value - }) + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") -} + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } -func TestSettersMarkExplicitFormSubmissionList(t *testing.T) { - t.Run("SetObject_MarksExplicit", func(t *testing.T) { + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetPublishedAt_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &FormSubmissionList{} - var fernTestValueObject FormSubmissionListObject + obj := &EmailTemplateVersion{} + var fernTestValuePublishedAt *time.Time // Act - obj.SetObject(fernTestValueObject) + obj.SetPublishedAt(fernTestValuePublishedAt) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -42975,14 +41220,14 @@ func TestSettersMarkExplicitFormSubmissionList(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetData_MarksExplicit", func(t *testing.T) { + t.Run("SetCreatedAt_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &FormSubmissionList{} - var fernTestValueData []*FormSubmission + obj := &EmailTemplateVersion{} + var fernTestValueCreatedAt time.Time // Act - obj.SetData(fernTestValueData) + obj.SetCreatedAt(fernTestValueCreatedAt) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -43006,14 +41251,14 @@ func TestSettersMarkExplicitFormSubmissionList(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetHasMore_MarksExplicit", func(t *testing.T) { + t.Run("SetUpdatedAt_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &FormSubmissionList{} - var fernTestValueHasMore bool + obj := &EmailTemplateVersion{} + var fernTestValueUpdatedAt time.Time // Act - obj.SetHasMore(fernTestValueHasMore) + obj.SetUpdatedAt(fernTestValueUpdatedAt) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -43039,144 +41284,124 @@ func TestSettersMarkExplicitFormSubmissionList(t *testing.T) { } -func TestSettersFormSubmissionRisk(t *testing.T) { - t.Run("SetAssessmentID", func(t *testing.T) { - obj := &FormSubmissionRisk{} - var fernTestValueAssessmentID *string - obj.SetAssessmentID(fernTestValueAssessmentID) - assert.Equal(t, fernTestValueAssessmentID, obj.AssessmentID) +func TestSettersEmailTemplateVersionList(t *testing.T) { + t.Run("SetObject", func(t *testing.T) { + obj := &EmailTemplateVersionList{} + var fernTestValueObject EmailTemplateVersionListObject + obj.SetObject(fernTestValueObject) + assert.Equal(t, fernTestValueObject, obj.Object) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetDecision", func(t *testing.T) { - obj := &FormSubmissionRisk{} - var fernTestValueDecision *FormSubmissionRiskDecision - obj.SetDecision(fernTestValueDecision) - assert.Equal(t, fernTestValueDecision, obj.Decision) + t.Run("SetData", func(t *testing.T) { + obj := &EmailTemplateVersionList{} + var fernTestValueData []*EmailTemplateVersion + obj.SetData(fernTestValueData) + assert.Equal(t, fernTestValueData, obj.Data) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetScore", func(t *testing.T) { - obj := &FormSubmissionRisk{} - var fernTestValueScore *float64 - obj.SetScore(fernTestValueScore) - assert.Equal(t, fernTestValueScore, obj.Score) + t.Run("SetHasMore", func(t *testing.T) { + obj := &EmailTemplateVersionList{} + var fernTestValueHasMore bool + obj.SetHasMore(fernTestValueHasMore) + assert.Equal(t, fernTestValueHasMore, obj.HasMore) assert.NotNil(t, obj.explicitFields) }) } -func TestGettersFormSubmissionRisk(t *testing.T) { - t.Run("GetAssessmentID", func(t *testing.T) { +func TestGettersEmailTemplateVersionList(t *testing.T) { + t.Run("GetObject", func(t *testing.T) { t.Parallel() // Arrange - obj := &FormSubmissionRisk{} - var expected *string - obj.AssessmentID = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetAssessmentID(), "getter should return the property value") - }) - - t.Run("GetAssessmentID_NilValue", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &FormSubmissionRisk{} - obj.AssessmentID = nil + obj := &EmailTemplateVersionList{} + var expected EmailTemplateVersionListObject + obj.Object = expected // Act & Assert - assert.Nil(t, obj.GetAssessmentID(), "getter should return nil when property is nil") + assert.Equal(t, expected, obj.GetObject(), "getter should return the property value") }) - t.Run("GetAssessmentID_NilReceiver", func(t *testing.T) { + t.Run("GetObject_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *FormSubmissionRisk + var obj *EmailTemplateVersionList // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetAssessmentID() // Should return zero value + _ = obj.GetObject() // Should return zero value }) - t.Run("GetDecision", func(t *testing.T) { + t.Run("GetData", func(t *testing.T) { t.Parallel() // Arrange - obj := &FormSubmissionRisk{} - var expected *FormSubmissionRiskDecision - obj.Decision = expected + obj := &EmailTemplateVersionList{} + var expected []*EmailTemplateVersion + obj.Data = expected // Act & Assert - assert.Equal(t, expected, obj.GetDecision(), "getter should return the property value") + assert.Equal(t, expected, obj.GetData(), "getter should return the property value") }) - t.Run("GetDecision_NilValue", func(t *testing.T) { + t.Run("GetData_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &FormSubmissionRisk{} - obj.Decision = nil + obj := &EmailTemplateVersionList{} + obj.Data = nil // Act & Assert - assert.Nil(t, obj.GetDecision(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetData(), "getter should return nil when property is nil") }) - t.Run("GetDecision_NilReceiver", func(t *testing.T) { + t.Run("GetData_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *FormSubmissionRisk + var obj *EmailTemplateVersionList // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetDecision() // Should return zero value - }) - - t.Run("GetScore", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &FormSubmissionRisk{} - var expected *float64 - obj.Score = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetScore(), "getter should return the property value") + _ = obj.GetData() // Should return zero value }) - t.Run("GetScore_NilValue", func(t *testing.T) { + t.Run("GetHasMore", func(t *testing.T) { t.Parallel() // Arrange - obj := &FormSubmissionRisk{} - obj.Score = nil + obj := &EmailTemplateVersionList{} + var expected bool + obj.HasMore = expected // Act & Assert - assert.Nil(t, obj.GetScore(), "getter should return nil when property is nil") + assert.Equal(t, expected, obj.GetHasMore(), "getter should return the property value") }) - t.Run("GetScore_NilReceiver", func(t *testing.T) { + t.Run("GetHasMore_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *FormSubmissionRisk + var obj *EmailTemplateVersionList // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetScore() // Should return zero value + _ = obj.GetHasMore() // Should return zero value }) } -func TestSettersMarkExplicitFormSubmissionRisk(t *testing.T) { - t.Run("SetAssessmentID_MarksExplicit", func(t *testing.T) { +func TestSettersMarkExplicitEmailTemplateVersionList(t *testing.T) { + t.Run("SetObject_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &FormSubmissionRisk{} - var fernTestValueAssessmentID *string + obj := &EmailTemplateVersionList{} + var fernTestValueObject EmailTemplateVersionListObject // Act - obj.SetAssessmentID(fernTestValueAssessmentID) + obj.SetObject(fernTestValueObject) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -43200,14 +41425,14 @@ func TestSettersMarkExplicitFormSubmissionRisk(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetDecision_MarksExplicit", func(t *testing.T) { + t.Run("SetData_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &FormSubmissionRisk{} - var fernTestValueDecision *FormSubmissionRiskDecision + obj := &EmailTemplateVersionList{} + var fernTestValueData []*EmailTemplateVersion // Act - obj.SetDecision(fernTestValueDecision) + obj.SetData(fernTestValueData) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -43231,14 +41456,14 @@ func TestSettersMarkExplicitFormSubmissionRisk(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetScore_MarksExplicit", func(t *testing.T) { + t.Run("SetHasMore_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &FormSubmissionRisk{} - var fernTestValueScore *float64 + obj := &EmailTemplateVersionList{} + var fernTestValueHasMore bool // Act - obj.SetScore(fernTestValueScore) + obj.SetHasMore(fernTestValueHasMore) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -43264,258 +41489,340 @@ func TestSettersMarkExplicitFormSubmissionRisk(t *testing.T) { } -func TestSettersHookApplication(t *testing.T) { - t.Run("SetObject", func(t *testing.T) { - obj := &HookApplication{} - var fernTestValueObject HookApplicationObject - obj.SetObject(fernTestValueObject) - assert.Equal(t, fernTestValueObject, obj.Object) +func TestSettersEmailTracking(t *testing.T) { + t.Run("SetOpens", func(t *testing.T) { + obj := &EmailTracking{} + var fernTestValueOpens bool + obj.SetOpens(fernTestValueOpens) + assert.Equal(t, fernTestValueOpens, obj.Opens) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetID", func(t *testing.T) { - obj := &HookApplication{} - var fernTestValueID string - obj.SetID(fernTestValueID) - assert.Equal(t, fernTestValueID, obj.ID) + t.Run("SetClicks", func(t *testing.T) { + obj := &EmailTracking{} + var fernTestValueClicks bool + obj.SetClicks(fernTestValueClicks) + assert.Equal(t, fernTestValueClicks, obj.Clicks) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetUID", func(t *testing.T) { - obj := &HookApplication{} - var fernTestValueUID *string - obj.SetUID(fernTestValueUID) - assert.Equal(t, fernTestValueUID, obj.UID) + t.Run("SetUnsubscribe", func(t *testing.T) { + obj := &EmailTracking{} + var fernTestValueUnsubscribe bool + obj.SetUnsubscribe(fernTestValueUnsubscribe) + assert.Equal(t, fernTestValueUnsubscribe, obj.Unsubscribe) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetName", func(t *testing.T) { - obj := &HookApplication{} - var fernTestValueName string - obj.SetName(fernTestValueName) - assert.Equal(t, fernTestValueName, obj.Name) + t.Run("SetOpenCount", func(t *testing.T) { + obj := &EmailTracking{} + var fernTestValueOpenCount int64 + obj.SetOpenCount(fernTestValueOpenCount) + assert.Equal(t, fernTestValueOpenCount, obj.OpenCount) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetMetadata", func(t *testing.T) { - obj := &HookApplication{} - var fernTestValueMetadata map[string]string - obj.SetMetadata(fernTestValueMetadata) - assert.Equal(t, fernTestValueMetadata, obj.Metadata) + t.Run("SetFirstOpenedAt", func(t *testing.T) { + obj := &EmailTracking{} + var fernTestValueFirstOpenedAt *time.Time + obj.SetFirstOpenedAt(fernTestValueFirstOpenedAt) + assert.Equal(t, fernTestValueFirstOpenedAt, obj.FirstOpenedAt) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetCreatedAt", func(t *testing.T) { - obj := &HookApplication{} - var fernTestValueCreatedAt time.Time - obj.SetCreatedAt(fernTestValueCreatedAt) - assert.Equal(t, fernTestValueCreatedAt, obj.CreatedAt) + t.Run("SetLastOpenedAt", func(t *testing.T) { + obj := &EmailTracking{} + var fernTestValueLastOpenedAt *time.Time + obj.SetLastOpenedAt(fernTestValueLastOpenedAt) + assert.Equal(t, fernTestValueLastOpenedAt, obj.LastOpenedAt) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetUpdatedAt", func(t *testing.T) { - obj := &HookApplication{} - var fernTestValueUpdatedAt time.Time - obj.SetUpdatedAt(fernTestValueUpdatedAt) - assert.Equal(t, fernTestValueUpdatedAt, obj.UpdatedAt) + t.Run("SetClickCount", func(t *testing.T) { + obj := &EmailTracking{} + var fernTestValueClickCount int64 + obj.SetClickCount(fernTestValueClickCount) + assert.Equal(t, fernTestValueClickCount, obj.ClickCount) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetFirstClickedAt", func(t *testing.T) { + obj := &EmailTracking{} + var fernTestValueFirstClickedAt *time.Time + obj.SetFirstClickedAt(fernTestValueFirstClickedAt) + assert.Equal(t, fernTestValueFirstClickedAt, obj.FirstClickedAt) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetLastClickedAt", func(t *testing.T) { + obj := &EmailTracking{} + var fernTestValueLastClickedAt *time.Time + obj.SetLastClickedAt(fernTestValueLastClickedAt) + assert.Equal(t, fernTestValueLastClickedAt, obj.LastClickedAt) assert.NotNil(t, obj.explicitFields) }) } -func TestGettersHookApplication(t *testing.T) { - t.Run("GetObject", func(t *testing.T) { +func TestGettersEmailTracking(t *testing.T) { + t.Run("GetOpens", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookApplication{} - var expected HookApplicationObject - obj.Object = expected + obj := &EmailTracking{} + var expected bool + obj.Opens = expected // Act & Assert - assert.Equal(t, expected, obj.GetObject(), "getter should return the property value") + assert.Equal(t, expected, obj.GetOpens(), "getter should return the property value") }) - t.Run("GetObject_NilReceiver", func(t *testing.T) { + t.Run("GetOpens_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *HookApplication + var obj *EmailTracking // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetObject() // Should return zero value + _ = obj.GetOpens() // Should return zero value }) - t.Run("GetID", func(t *testing.T) { + t.Run("GetClicks", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookApplication{} - var expected string - obj.ID = expected + obj := &EmailTracking{} + var expected bool + obj.Clicks = expected // Act & Assert - assert.Equal(t, expected, obj.GetID(), "getter should return the property value") + assert.Equal(t, expected, obj.GetClicks(), "getter should return the property value") }) - t.Run("GetID_NilReceiver", func(t *testing.T) { + t.Run("GetClicks_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *HookApplication + var obj *EmailTracking // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetID() // Should return zero value + _ = obj.GetClicks() // Should return zero value }) - t.Run("GetUID", func(t *testing.T) { + t.Run("GetUnsubscribe", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookApplication{} - var expected *string - obj.UID = expected + obj := &EmailTracking{} + var expected bool + obj.Unsubscribe = expected // Act & Assert - assert.Equal(t, expected, obj.GetUID(), "getter should return the property value") + assert.Equal(t, expected, obj.GetUnsubscribe(), "getter should return the property value") }) - t.Run("GetUID_NilValue", func(t *testing.T) { + t.Run("GetUnsubscribe_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *EmailTracking + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetUnsubscribe() // Should return zero value + }) + + t.Run("GetOpenCount", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookApplication{} - obj.UID = nil + obj := &EmailTracking{} + var expected int64 + obj.OpenCount = expected // Act & Assert - assert.Nil(t, obj.GetUID(), "getter should return nil when property is nil") + assert.Equal(t, expected, obj.GetOpenCount(), "getter should return the property value") }) - t.Run("GetUID_NilReceiver", func(t *testing.T) { + t.Run("GetOpenCount_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *HookApplication + var obj *EmailTracking // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetUID() // Should return zero value + _ = obj.GetOpenCount() // Should return zero value }) - t.Run("GetName", func(t *testing.T) { + t.Run("GetFirstOpenedAt", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookApplication{} - var expected string - obj.Name = expected + obj := &EmailTracking{} + var expected *time.Time + obj.FirstOpenedAt = expected // Act & Assert - assert.Equal(t, expected, obj.GetName(), "getter should return the property value") + assert.Equal(t, expected, obj.GetFirstOpenedAt(), "getter should return the property value") }) - t.Run("GetName_NilReceiver", func(t *testing.T) { + t.Run("GetFirstOpenedAt_NilValue", func(t *testing.T) { t.Parallel() - var obj *HookApplication + // Arrange + obj := &EmailTracking{} + obj.FirstOpenedAt = nil + + // Act & Assert + assert.Nil(t, obj.GetFirstOpenedAt(), "getter should return nil when property is nil") + }) + + t.Run("GetFirstOpenedAt_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *EmailTracking // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetName() // Should return zero value + _ = obj.GetFirstOpenedAt() // Should return zero value }) - t.Run("GetMetadata", func(t *testing.T) { + t.Run("GetLastOpenedAt", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookApplication{} - var expected map[string]string - obj.Metadata = expected + obj := &EmailTracking{} + var expected *time.Time + obj.LastOpenedAt = expected // Act & Assert - assert.Equal(t, expected, obj.GetMetadata(), "getter should return the property value") + assert.Equal(t, expected, obj.GetLastOpenedAt(), "getter should return the property value") }) - t.Run("GetMetadata_NilValue", func(t *testing.T) { + t.Run("GetLastOpenedAt_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookApplication{} - obj.Metadata = nil + obj := &EmailTracking{} + obj.LastOpenedAt = nil // Act & Assert - assert.Nil(t, obj.GetMetadata(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetLastOpenedAt(), "getter should return nil when property is nil") }) - t.Run("GetMetadata_NilReceiver", func(t *testing.T) { + t.Run("GetLastOpenedAt_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *HookApplication + var obj *EmailTracking // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetMetadata() // Should return zero value + _ = obj.GetLastOpenedAt() // Should return zero value }) - t.Run("GetCreatedAt", func(t *testing.T) { + t.Run("GetClickCount", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookApplication{} - var expected time.Time - obj.CreatedAt = expected + obj := &EmailTracking{} + var expected int64 + obj.ClickCount = expected // Act & Assert - assert.Equal(t, expected, obj.GetCreatedAt(), "getter should return the property value") + assert.Equal(t, expected, obj.GetClickCount(), "getter should return the property value") }) - t.Run("GetCreatedAt_NilReceiver", func(t *testing.T) { + t.Run("GetClickCount_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *HookApplication + var obj *EmailTracking // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetCreatedAt() // Should return zero value + _ = obj.GetClickCount() // Should return zero value }) - t.Run("GetUpdatedAt", func(t *testing.T) { + t.Run("GetFirstClickedAt", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookApplication{} - var expected time.Time - obj.UpdatedAt = expected + obj := &EmailTracking{} + var expected *time.Time + obj.FirstClickedAt = expected // Act & Assert - assert.Equal(t, expected, obj.GetUpdatedAt(), "getter should return the property value") + assert.Equal(t, expected, obj.GetFirstClickedAt(), "getter should return the property value") }) - t.Run("GetUpdatedAt_NilReceiver", func(t *testing.T) { + t.Run("GetFirstClickedAt_NilValue", func(t *testing.T) { t.Parallel() - var obj *HookApplication + // Arrange + obj := &EmailTracking{} + obj.FirstClickedAt = nil + + // Act & Assert + assert.Nil(t, obj.GetFirstClickedAt(), "getter should return nil when property is nil") + }) + + t.Run("GetFirstClickedAt_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *EmailTracking // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetUpdatedAt() // Should return zero value + _ = obj.GetFirstClickedAt() // Should return zero value + }) + + t.Run("GetLastClickedAt", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &EmailTracking{} + var expected *time.Time + obj.LastClickedAt = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetLastClickedAt(), "getter should return the property value") + }) + + t.Run("GetLastClickedAt_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &EmailTracking{} + obj.LastClickedAt = nil + + // Act & Assert + assert.Nil(t, obj.GetLastClickedAt(), "getter should return nil when property is nil") + }) + + t.Run("GetLastClickedAt_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *EmailTracking + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetLastClickedAt() // Should return zero value }) } -func TestSettersMarkExplicitHookApplication(t *testing.T) { - t.Run("SetObject_MarksExplicit", func(t *testing.T) { +func TestSettersMarkExplicitEmailTracking(t *testing.T) { + t.Run("SetOpens_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookApplication{} - var fernTestValueObject HookApplicationObject + obj := &EmailTracking{} + var fernTestValueOpens bool // Act - obj.SetObject(fernTestValueObject) + obj.SetOpens(fernTestValueOpens) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -43539,14 +41846,14 @@ func TestSettersMarkExplicitHookApplication(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetID_MarksExplicit", func(t *testing.T) { + t.Run("SetClicks_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookApplication{} - var fernTestValueID string + obj := &EmailTracking{} + var fernTestValueClicks bool // Act - obj.SetID(fernTestValueID) + obj.SetClicks(fernTestValueClicks) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -43570,14 +41877,14 @@ func TestSettersMarkExplicitHookApplication(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetUID_MarksExplicit", func(t *testing.T) { + t.Run("SetUnsubscribe_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookApplication{} - var fernTestValueUID *string + obj := &EmailTracking{} + var fernTestValueUnsubscribe bool // Act - obj.SetUID(fernTestValueUID) + obj.SetUnsubscribe(fernTestValueUnsubscribe) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -43601,14 +41908,14 @@ func TestSettersMarkExplicitHookApplication(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetName_MarksExplicit", func(t *testing.T) { + t.Run("SetOpenCount_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookApplication{} - var fernTestValueName string + obj := &EmailTracking{} + var fernTestValueOpenCount int64 // Act - obj.SetName(fernTestValueName) + obj.SetOpenCount(fernTestValueOpenCount) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -43632,14 +41939,14 @@ func TestSettersMarkExplicitHookApplication(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetMetadata_MarksExplicit", func(t *testing.T) { + t.Run("SetFirstOpenedAt_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookApplication{} - var fernTestValueMetadata map[string]string + obj := &EmailTracking{} + var fernTestValueFirstOpenedAt *time.Time // Act - obj.SetMetadata(fernTestValueMetadata) + obj.SetFirstOpenedAt(fernTestValueFirstOpenedAt) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -43663,14 +41970,14 @@ func TestSettersMarkExplicitHookApplication(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetCreatedAt_MarksExplicit", func(t *testing.T) { + t.Run("SetLastOpenedAt_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookApplication{} - var fernTestValueCreatedAt time.Time + obj := &EmailTracking{} + var fernTestValueLastOpenedAt *time.Time // Act - obj.SetCreatedAt(fernTestValueCreatedAt) + obj.SetLastOpenedAt(fernTestValueLastOpenedAt) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -43694,14 +42001,14 @@ func TestSettersMarkExplicitHookApplication(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetUpdatedAt_MarksExplicit", func(t *testing.T) { + t.Run("SetClickCount_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookApplication{} - var fernTestValueUpdatedAt time.Time + obj := &EmailTracking{} + var fernTestValueClickCount int64 // Act - obj.SetUpdatedAt(fernTestValueUpdatedAt) + obj.SetClickCount(fernTestValueClickCount) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -43725,126 +42032,14 @@ func TestSettersMarkExplicitHookApplication(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) -} - -func TestSettersHookApplicationList(t *testing.T) { - t.Run("SetObject", func(t *testing.T) { - obj := &HookApplicationList{} - var fernTestValueObject HookApplicationListObject - obj.SetObject(fernTestValueObject) - assert.Equal(t, fernTestValueObject, obj.Object) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetData", func(t *testing.T) { - obj := &HookApplicationList{} - var fernTestValueData []*HookApplication - obj.SetData(fernTestValueData) - assert.Equal(t, fernTestValueData, obj.Data) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetHasMore", func(t *testing.T) { - obj := &HookApplicationList{} - var fernTestValueHasMore bool - obj.SetHasMore(fernTestValueHasMore) - assert.Equal(t, fernTestValueHasMore, obj.HasMore) - assert.NotNil(t, obj.explicitFields) - }) - -} - -func TestGettersHookApplicationList(t *testing.T) { - t.Run("GetObject", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &HookApplicationList{} - var expected HookApplicationListObject - obj.Object = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetObject(), "getter should return the property value") - }) - - t.Run("GetObject_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *HookApplicationList - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetObject() // Should return zero value - }) - - t.Run("GetData", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &HookApplicationList{} - var expected []*HookApplication - obj.Data = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetData(), "getter should return the property value") - }) - - t.Run("GetData_NilValue", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &HookApplicationList{} - obj.Data = nil - - // Act & Assert - assert.Nil(t, obj.GetData(), "getter should return nil when property is nil") - }) - - t.Run("GetData_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *HookApplicationList - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetData() // Should return zero value - }) - - t.Run("GetHasMore", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &HookApplicationList{} - var expected bool - obj.HasMore = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetHasMore(), "getter should return the property value") - }) - - t.Run("GetHasMore_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *HookApplicationList - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetHasMore() // Should return zero value - }) - -} - -func TestSettersMarkExplicitHookApplicationList(t *testing.T) { - t.Run("SetObject_MarksExplicit", func(t *testing.T) { + t.Run("SetFirstClickedAt_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookApplicationList{} - var fernTestValueObject HookApplicationListObject + obj := &EmailTracking{} + var fernTestValueFirstClickedAt *time.Time // Act - obj.SetObject(fernTestValueObject) + obj.SetFirstClickedAt(fernTestValueFirstClickedAt) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -43868,14 +42063,14 @@ func TestSettersMarkExplicitHookApplicationList(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetData_MarksExplicit", func(t *testing.T) { + t.Run("SetLastClickedAt_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookApplicationList{} - var fernTestValueData []*HookApplication + obj := &EmailTracking{} + var fernTestValueLastClickedAt *time.Time // Act - obj.SetData(fernTestValueData) + obj.SetLastClickedAt(fernTestValueLastClickedAt) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -43899,14 +42094,64 @@ func TestSettersMarkExplicitHookApplicationList(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetHasMore_MarksExplicit", func(t *testing.T) { +} + +func TestSettersError(t *testing.T) { + t.Run("SetError", func(t *testing.T) { + obj := &Error{} + var fernTestValueError *ErrorBody + obj.SetError(fernTestValueError) + assert.Equal(t, fernTestValueError, obj.Error) + assert.NotNil(t, obj.explicitFields) + }) + +} + +func TestGettersError(t *testing.T) { + t.Run("GetError", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookApplicationList{} - var fernTestValueHasMore bool + obj := &Error{} + var expected *ErrorBody + obj.Error = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetError(), "getter should return the property value") + }) + + t.Run("GetError_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &Error{} + obj.Error = nil + + // Act & Assert + assert.Nil(t, obj.GetError(), "getter should return nil when property is nil") + }) + + t.Run("GetError_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *Error + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetError() // Should return zero value + }) + +} + +func TestSettersMarkExplicitError(t *testing.T) { + t.Run("SetError_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &Error{} + var fernTestValueError *ErrorBody // Act - obj.SetHasMore(fernTestValueHasMore) + obj.SetError(fernTestValueError) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -43932,330 +42177,268 @@ func TestSettersMarkExplicitHookApplicationList(t *testing.T) { } -func TestSettersHookAttempt(t *testing.T) { - t.Run("SetObject", func(t *testing.T) { - obj := &HookAttempt{} - var fernTestValueObject HookAttemptObject - obj.SetObject(fernTestValueObject) - assert.Equal(t, fernTestValueObject, obj.Object) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetID", func(t *testing.T) { - obj := &HookAttempt{} - var fernTestValueID string - obj.SetID(fernTestValueID) - assert.Equal(t, fernTestValueID, obj.ID) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetDeliveryID", func(t *testing.T) { - obj := &HookAttempt{} - var fernTestValueDeliveryID string - obj.SetDeliveryID(fernTestValueDeliveryID) - assert.Equal(t, fernTestValueDeliveryID, obj.DeliveryID) +func TestSettersErrorBody(t *testing.T) { + t.Run("SetType", func(t *testing.T) { + obj := &ErrorBody{} + var fernTestValueType ErrorBodyType + obj.SetType(fernTestValueType) + assert.Equal(t, fernTestValueType, obj.Type) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetEndpointID", func(t *testing.T) { - obj := &HookAttempt{} - var fernTestValueEndpointID string - obj.SetEndpointID(fernTestValueEndpointID) - assert.Equal(t, fernTestValueEndpointID, obj.EndpointID) + t.Run("SetCode", func(t *testing.T) { + obj := &ErrorBody{} + var fernTestValueCode string + obj.SetCode(fernTestValueCode) + assert.Equal(t, fernTestValueCode, obj.Code) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetAttemptedAt", func(t *testing.T) { - obj := &HookAttempt{} - var fernTestValueAttemptedAt time.Time - obj.SetAttemptedAt(fernTestValueAttemptedAt) - assert.Equal(t, fernTestValueAttemptedAt, obj.AttemptedAt) + t.Run("SetMessage", func(t *testing.T) { + obj := &ErrorBody{} + var fernTestValueMessage string + obj.SetMessage(fernTestValueMessage) + assert.Equal(t, fernTestValueMessage, obj.Message) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetStatusCode", func(t *testing.T) { - obj := &HookAttempt{} - var fernTestValueStatusCode *int64 - obj.SetStatusCode(fernTestValueStatusCode) - assert.Equal(t, fernTestValueStatusCode, obj.StatusCode) + t.Run("SetParam", func(t *testing.T) { + obj := &ErrorBody{} + var fernTestValueParam *string + obj.SetParam(fernTestValueParam) + assert.Equal(t, fernTestValueParam, obj.Param) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetDurationMs", func(t *testing.T) { - obj := &HookAttempt{} - var fernTestValueDurationMs int64 - obj.SetDurationMs(fernTestValueDurationMs) - assert.Equal(t, fernTestValueDurationMs, obj.DurationMs) + t.Run("SetIssues", func(t *testing.T) { + obj := &ErrorBody{} + var fernTestValueIssues []*ErrorBodyIssuesItem + obj.SetIssues(fernTestValueIssues) + assert.Equal(t, fernTestValueIssues, obj.Issues) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetError", func(t *testing.T) { - obj := &HookAttempt{} - var fernTestValueError *string - obj.SetError(fernTestValueError) - assert.Equal(t, fernTestValueError, obj.Error) + t.Run("SetHint", func(t *testing.T) { + obj := &ErrorBody{} + var fernTestValueHint *string + obj.SetHint(fernTestValueHint) + assert.Equal(t, fernTestValueHint, obj.Hint) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetResponseExcerpt", func(t *testing.T) { - obj := &HookAttempt{} - var fernTestValueResponseExcerpt *string - obj.SetResponseExcerpt(fernTestValueResponseExcerpt) - assert.Equal(t, fernTestValueResponseExcerpt, obj.ResponseExcerpt) + t.Run("SetRequestID", func(t *testing.T) { + obj := &ErrorBody{} + var fernTestValueRequestID string + obj.SetRequestID(fernTestValueRequestID) + assert.Equal(t, fernTestValueRequestID, obj.RequestID) assert.NotNil(t, obj.explicitFields) }) } -func TestGettersHookAttempt(t *testing.T) { - t.Run("GetObject", func(t *testing.T) { +func TestGettersErrorBody(t *testing.T) { + t.Run("GetType", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookAttempt{} - var expected HookAttemptObject - obj.Object = expected + obj := &ErrorBody{} + var expected ErrorBodyType + obj.Type = expected // Act & Assert - assert.Equal(t, expected, obj.GetObject(), "getter should return the property value") + assert.Equal(t, expected, obj.GetType(), "getter should return the property value") }) - t.Run("GetObject_NilReceiver", func(t *testing.T) { + t.Run("GetType_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *HookAttempt + var obj *ErrorBody // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetObject() // Should return zero value + _ = obj.GetType() // Should return zero value }) - t.Run("GetID", func(t *testing.T) { + t.Run("GetCode", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookAttempt{} + obj := &ErrorBody{} var expected string - obj.ID = expected + obj.Code = expected // Act & Assert - assert.Equal(t, expected, obj.GetID(), "getter should return the property value") + assert.Equal(t, expected, obj.GetCode(), "getter should return the property value") }) - t.Run("GetID_NilReceiver", func(t *testing.T) { + t.Run("GetCode_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *HookAttempt + var obj *ErrorBody // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetID() // Should return zero value + _ = obj.GetCode() // Should return zero value }) - t.Run("GetDeliveryID", func(t *testing.T) { + t.Run("GetMessage", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookAttempt{} + obj := &ErrorBody{} var expected string - obj.DeliveryID = expected + obj.Message = expected // Act & Assert - assert.Equal(t, expected, obj.GetDeliveryID(), "getter should return the property value") + assert.Equal(t, expected, obj.GetMessage(), "getter should return the property value") }) - t.Run("GetDeliveryID_NilReceiver", func(t *testing.T) { + t.Run("GetMessage_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *HookAttempt + var obj *ErrorBody // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetDeliveryID() // Should return zero value + _ = obj.GetMessage() // Should return zero value }) - t.Run("GetEndpointID", func(t *testing.T) { + t.Run("GetParam", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookAttempt{} - var expected string - obj.EndpointID = expected + obj := &ErrorBody{} + var expected *string + obj.Param = expected // Act & Assert - assert.Equal(t, expected, obj.GetEndpointID(), "getter should return the property value") - }) - - t.Run("GetEndpointID_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *HookAttempt - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetEndpointID() // Should return zero value + assert.Equal(t, expected, obj.GetParam(), "getter should return the property value") }) - t.Run("GetAttemptedAt", func(t *testing.T) { + t.Run("GetParam_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookAttempt{} - var expected time.Time - obj.AttemptedAt = expected + obj := &ErrorBody{} + obj.Param = nil // Act & Assert - assert.Equal(t, expected, obj.GetAttemptedAt(), "getter should return the property value") + assert.Nil(t, obj.GetParam(), "getter should return nil when property is nil") }) - t.Run("GetAttemptedAt_NilReceiver", func(t *testing.T) { + t.Run("GetParam_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *HookAttempt + var obj *ErrorBody // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetAttemptedAt() // Should return zero value - }) - - t.Run("GetStatusCode", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &HookAttempt{} - var expected *int64 - obj.StatusCode = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetStatusCode(), "getter should return the property value") + _ = obj.GetParam() // Should return zero value }) - t.Run("GetStatusCode_NilValue", func(t *testing.T) { + t.Run("GetIssues", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookAttempt{} - obj.StatusCode = nil + obj := &ErrorBody{} + var expected []*ErrorBodyIssuesItem + obj.Issues = expected // Act & Assert - assert.Nil(t, obj.GetStatusCode(), "getter should return nil when property is nil") - }) - - t.Run("GetStatusCode_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *HookAttempt - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetStatusCode() // Should return zero value + assert.Equal(t, expected, obj.GetIssues(), "getter should return the property value") }) - t.Run("GetDurationMs", func(t *testing.T) { + t.Run("GetIssues_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookAttempt{} - var expected int64 - obj.DurationMs = expected + obj := &ErrorBody{} + obj.Issues = nil // Act & Assert - assert.Equal(t, expected, obj.GetDurationMs(), "getter should return the property value") + assert.Nil(t, obj.GetIssues(), "getter should return nil when property is nil") }) - t.Run("GetDurationMs_NilReceiver", func(t *testing.T) { + t.Run("GetIssues_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *HookAttempt + var obj *ErrorBody // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetDurationMs() // Should return zero value + _ = obj.GetIssues() // Should return zero value }) - t.Run("GetError", func(t *testing.T) { + t.Run("GetHint", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookAttempt{} + obj := &ErrorBody{} var expected *string - obj.Error = expected + obj.Hint = expected // Act & Assert - assert.Equal(t, expected, obj.GetError(), "getter should return the property value") + assert.Equal(t, expected, obj.GetHint(), "getter should return the property value") }) - t.Run("GetError_NilValue", func(t *testing.T) { + t.Run("GetHint_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookAttempt{} - obj.Error = nil + obj := &ErrorBody{} + obj.Hint = nil // Act & Assert - assert.Nil(t, obj.GetError(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetHint(), "getter should return nil when property is nil") }) - t.Run("GetError_NilReceiver", func(t *testing.T) { + t.Run("GetHint_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *HookAttempt + var obj *ErrorBody // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetError() // Should return zero value - }) - - t.Run("GetResponseExcerpt", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &HookAttempt{} - var expected *string - obj.ResponseExcerpt = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetResponseExcerpt(), "getter should return the property value") + _ = obj.GetHint() // Should return zero value }) - t.Run("GetResponseExcerpt_NilValue", func(t *testing.T) { + t.Run("GetRequestID", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookAttempt{} - obj.ResponseExcerpt = nil + obj := &ErrorBody{} + var expected string + obj.RequestID = expected // Act & Assert - assert.Nil(t, obj.GetResponseExcerpt(), "getter should return nil when property is nil") + assert.Equal(t, expected, obj.GetRequestID(), "getter should return the property value") }) - t.Run("GetResponseExcerpt_NilReceiver", func(t *testing.T) { + t.Run("GetRequestID_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *HookAttempt + var obj *ErrorBody // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetResponseExcerpt() // Should return zero value + _ = obj.GetRequestID() // Should return zero value }) } -func TestSettersMarkExplicitHookAttempt(t *testing.T) { - t.Run("SetObject_MarksExplicit", func(t *testing.T) { +func TestSettersMarkExplicitErrorBody(t *testing.T) { + t.Run("SetType_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookAttempt{} - var fernTestValueObject HookAttemptObject + obj := &ErrorBody{} + var fernTestValueType ErrorBodyType // Act - obj.SetObject(fernTestValueObject) + obj.SetType(fernTestValueType) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -44279,14 +42462,14 @@ func TestSettersMarkExplicitHookAttempt(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetID_MarksExplicit", func(t *testing.T) { + t.Run("SetCode_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookAttempt{} - var fernTestValueID string + obj := &ErrorBody{} + var fernTestValueCode string // Act - obj.SetID(fernTestValueID) + obj.SetCode(fernTestValueCode) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -44310,14 +42493,14 @@ func TestSettersMarkExplicitHookAttempt(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetDeliveryID_MarksExplicit", func(t *testing.T) { + t.Run("SetMessage_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookAttempt{} - var fernTestValueDeliveryID string + obj := &ErrorBody{} + var fernTestValueMessage string // Act - obj.SetDeliveryID(fernTestValueDeliveryID) + obj.SetMessage(fernTestValueMessage) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -44341,14 +42524,14 @@ func TestSettersMarkExplicitHookAttempt(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetEndpointID_MarksExplicit", func(t *testing.T) { + t.Run("SetParam_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookAttempt{} - var fernTestValueEndpointID string + obj := &ErrorBody{} + var fernTestValueParam *string // Act - obj.SetEndpointID(fernTestValueEndpointID) + obj.SetParam(fernTestValueParam) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -44372,14 +42555,14 @@ func TestSettersMarkExplicitHookAttempt(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetAttemptedAt_MarksExplicit", func(t *testing.T) { + t.Run("SetIssues_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookAttempt{} - var fernTestValueAttemptedAt time.Time + obj := &ErrorBody{} + var fernTestValueIssues []*ErrorBodyIssuesItem // Act - obj.SetAttemptedAt(fernTestValueAttemptedAt) + obj.SetIssues(fernTestValueIssues) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -44403,14 +42586,14 @@ func TestSettersMarkExplicitHookAttempt(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetStatusCode_MarksExplicit", func(t *testing.T) { + t.Run("SetHint_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookAttempt{} - var fernTestValueStatusCode *int64 + obj := &ErrorBody{} + var fernTestValueHint *string // Act - obj.SetStatusCode(fernTestValueStatusCode) + obj.SetHint(fernTestValueHint) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -44434,14 +42617,14 @@ func TestSettersMarkExplicitHookAttempt(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetDurationMs_MarksExplicit", func(t *testing.T) { + t.Run("SetRequestID_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookAttempt{} - var fernTestValueDurationMs int64 + obj := &ErrorBody{} + var fernTestValueRequestID string // Act - obj.SetDurationMs(fernTestValueDurationMs) + obj.SetRequestID(fernTestValueRequestID) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -44465,51 +42648,122 @@ func TestSettersMarkExplicitHookAttempt(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetError_MarksExplicit", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &HookAttempt{} - var fernTestValueError *string - - // Act - obj.SetError(fernTestValueError) - - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") +} - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } +func TestSettersErrorBodyIssuesItem(t *testing.T) { + t.Run("SetPath", func(t *testing.T) { + obj := &ErrorBodyIssuesItem{} + var fernTestValuePath string + obj.SetPath(fernTestValuePath) + assert.Equal(t, fernTestValuePath, obj.Path) + assert.NotNil(t, obj.explicitFields) + }) - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip + t.Run("SetMessage", func(t *testing.T) { + obj := &ErrorBodyIssuesItem{} + var fernTestValueMessage string + obj.SetMessage(fernTestValueMessage) + assert.Equal(t, fernTestValueMessage, obj.Message) + assert.NotNil(t, obj.explicitFields) }) - t.Run("SetResponseExcerpt_MarksExplicit", func(t *testing.T) { +} + +func TestGettersErrorBodyIssuesItem(t *testing.T) { + t.Run("GetPath", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookAttempt{} - var fernTestValueResponseExcerpt *string + obj := &ErrorBodyIssuesItem{} + var expected string + obj.Path = expected - // Act - obj.SetResponseExcerpt(fernTestValueResponseExcerpt) + // Act & Assert + assert.Equal(t, expected, obj.GetPath(), "getter should return the property value") + }) - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") + t.Run("GetPath_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *ErrorBodyIssuesItem + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetPath() // Should return zero value + }) - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + t.Run("GetMessage", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &ErrorBodyIssuesItem{} + var expected string + obj.Message = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetMessage(), "getter should return the property value") + }) + + t.Run("GetMessage_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *ErrorBodyIssuesItem + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetMessage() // Should return zero value + }) + +} + +func TestSettersMarkExplicitErrorBodyIssuesItem(t *testing.T) { + t.Run("SetPath_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &ErrorBodyIssuesItem{} + var fernTestValuePath string + + // Act + obj.SetPath(fernTestValuePath) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetMessage_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &ErrorBodyIssuesItem{} + var fernTestValueMessage string + + // Act + obj.SetMessage(fernTestValueMessage) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value // Detect if marshaled JSON is an object or primitive to use correct unmarshal target if len(bytes) > 0 && bytes[0] == '{' { // JSON object - unmarshal into map @@ -44529,39 +42783,111 @@ func TestSettersMarkExplicitHookAttempt(t *testing.T) { } -func TestSettersHookAttemptList(t *testing.T) { +func TestGettersExportSuppressionsRequestScope(t *testing.T) { + t.Run("GetExportSuppressionsRequestScopeZero", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &ExportSuppressionsRequestScope{} + var expected ExportSuppressionsRequestScopeZero + obj.ExportSuppressionsRequestScopeZero = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetExportSuppressionsRequestScopeZero(), "getter should return the property value") + }) + + t.Run("GetExportSuppressionsRequestScopeZero_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *ExportSuppressionsRequestScope + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetExportSuppressionsRequestScopeZero() // Should return zero value + }) + + t.Run("GetExportSuppressionsRequestScopeOne", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &ExportSuppressionsRequestScope{} + var expected ExportSuppressionsRequestScopeOne + obj.ExportSuppressionsRequestScopeOne = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetExportSuppressionsRequestScopeOne(), "getter should return the property value") + }) + + t.Run("GetExportSuppressionsRequestScopeOne_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *ExportSuppressionsRequestScope + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetExportSuppressionsRequestScopeOne() // Should return zero value + }) + + t.Run("GetString", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &ExportSuppressionsRequestScope{} + var expected string + obj.String = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetString(), "getter should return the property value") + }) + + t.Run("GetString_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *ExportSuppressionsRequestScope + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetString() // Should return zero value + }) + +} + +func TestSettersForgottenRiskUser(t *testing.T) { t.Run("SetObject", func(t *testing.T) { - obj := &HookAttemptList{} - var fernTestValueObject HookAttemptListObject + obj := &ForgottenRiskUser{} + var fernTestValueObject ForgottenRiskUserObject obj.SetObject(fernTestValueObject) assert.Equal(t, fernTestValueObject, obj.Object) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetData", func(t *testing.T) { - obj := &HookAttemptList{} - var fernTestValueData []*HookAttempt - obj.SetData(fernTestValueData) - assert.Equal(t, fernTestValueData, obj.Data) + t.Run("SetID", func(t *testing.T) { + obj := &ForgottenRiskUser{} + var fernTestValueID string + obj.SetID(fernTestValueID) + assert.Equal(t, fernTestValueID, obj.ID) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetHasMore", func(t *testing.T) { - obj := &HookAttemptList{} - var fernTestValueHasMore bool - obj.SetHasMore(fernTestValueHasMore) - assert.Equal(t, fernTestValueHasMore, obj.HasMore) + t.Run("SetDeleted", func(t *testing.T) { + obj := &ForgottenRiskUser{} + var fernTestValueDeleted bool + obj.SetDeleted(fernTestValueDeleted) + assert.Equal(t, fernTestValueDeleted, obj.Deleted) assert.NotNil(t, obj.explicitFields) }) } -func TestGettersHookAttemptList(t *testing.T) { +func TestGettersForgottenRiskUser(t *testing.T) { t.Run("GetObject", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookAttemptList{} - var expected HookAttemptListObject + obj := &ForgottenRiskUser{} + var expected ForgottenRiskUserObject obj.Object = expected // Act & Assert @@ -44570,7 +42896,7 @@ func TestGettersHookAttemptList(t *testing.T) { t.Run("GetObject_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *HookAttemptList + var obj *ForgottenRiskUser // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -44580,70 +42906,60 @@ func TestGettersHookAttemptList(t *testing.T) { _ = obj.GetObject() // Should return zero value }) - t.Run("GetData", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &HookAttemptList{} - var expected []*HookAttempt - obj.Data = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetData(), "getter should return the property value") - }) - - t.Run("GetData_NilValue", func(t *testing.T) { + t.Run("GetID", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookAttemptList{} - obj.Data = nil + obj := &ForgottenRiskUser{} + var expected string + obj.ID = expected // Act & Assert - assert.Nil(t, obj.GetData(), "getter should return nil when property is nil") + assert.Equal(t, expected, obj.GetID(), "getter should return the property value") }) - t.Run("GetData_NilReceiver", func(t *testing.T) { + t.Run("GetID_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *HookAttemptList + var obj *ForgottenRiskUser // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetData() // Should return zero value + _ = obj.GetID() // Should return zero value }) - t.Run("GetHasMore", func(t *testing.T) { + t.Run("GetDeleted", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookAttemptList{} + obj := &ForgottenRiskUser{} var expected bool - obj.HasMore = expected + obj.Deleted = expected // Act & Assert - assert.Equal(t, expected, obj.GetHasMore(), "getter should return the property value") + assert.Equal(t, expected, obj.GetDeleted(), "getter should return the property value") }) - t.Run("GetHasMore_NilReceiver", func(t *testing.T) { + t.Run("GetDeleted_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *HookAttemptList + var obj *ForgottenRiskUser // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetHasMore() // Should return zero value + _ = obj.GetDeleted() // Should return zero value }) } -func TestSettersMarkExplicitHookAttemptList(t *testing.T) { +func TestSettersMarkExplicitForgottenRiskUser(t *testing.T) { t.Run("SetObject_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookAttemptList{} - var fernTestValueObject HookAttemptListObject + obj := &ForgottenRiskUser{} + var fernTestValueObject ForgottenRiskUserObject // Act obj.SetObject(fernTestValueObject) @@ -44670,14 +42986,14 @@ func TestSettersMarkExplicitHookAttemptList(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetData_MarksExplicit", func(t *testing.T) { + t.Run("SetID_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookAttemptList{} - var fernTestValueData []*HookAttempt + obj := &ForgottenRiskUser{} + var fernTestValueID string // Act - obj.SetData(fernTestValueData) + obj.SetID(fernTestValueID) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -44701,14 +43017,14 @@ func TestSettersMarkExplicitHookAttemptList(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetHasMore_MarksExplicit", func(t *testing.T) { + t.Run("SetDeleted_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookAttemptList{} - var fernTestValueHasMore bool + obj := &ForgottenRiskUser{} + var fernTestValueDeleted bool // Act - obj.SetHasMore(fernTestValueHasMore) + obj.SetDeleted(fernTestValueDeleted) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -44734,111 +43050,159 @@ func TestSettersMarkExplicitHookAttemptList(t *testing.T) { } -func TestSettersHookDelivery(t *testing.T) { +func TestSettersFormSubmission(t *testing.T) { t.Run("SetObject", func(t *testing.T) { - obj := &HookDelivery{} - var fernTestValueObject HookDeliveryObject + obj := &FormSubmission{} + var fernTestValueObject FormSubmissionObject obj.SetObject(fernTestValueObject) assert.Equal(t, fernTestValueObject, obj.Object) assert.NotNil(t, obj.explicitFields) }) t.Run("SetID", func(t *testing.T) { - obj := &HookDelivery{} + obj := &FormSubmission{} var fernTestValueID string obj.SetID(fernTestValueID) assert.Equal(t, fernTestValueID, obj.ID) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetApplicationID", func(t *testing.T) { - obj := &HookDelivery{} - var fernTestValueApplicationID string - obj.SetApplicationID(fernTestValueApplicationID) - assert.Equal(t, fernTestValueApplicationID, obj.ApplicationID) + t.Run("SetFormID", func(t *testing.T) { + obj := &FormSubmission{} + var fernTestValueFormID string + obj.SetFormID(fernTestValueFormID) + assert.Equal(t, fernTestValueFormID, obj.FormID) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetMessageID", func(t *testing.T) { - obj := &HookDelivery{} - var fernTestValueMessageID string - obj.SetMessageID(fernTestValueMessageID) - assert.Equal(t, fernTestValueMessageID, obj.MessageID) + t.Run("SetStatus", func(t *testing.T) { + obj := &FormSubmission{} + var fernTestValueStatus FormSubmissionStatus + obj.SetStatus(fernTestValueStatus) + assert.Equal(t, fernTestValueStatus, obj.Status) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetEndpointID", func(t *testing.T) { - obj := &HookDelivery{} - var fernTestValueEndpointID string - obj.SetEndpointID(fernTestValueEndpointID) - assert.Equal(t, fernTestValueEndpointID, obj.EndpointID) + t.Run("SetData", func(t *testing.T) { + obj := &FormSubmission{} + var fernTestValueData map[string]*FormSubmissionDataValue + obj.SetData(fernTestValueData) + assert.Equal(t, fernTestValueData, obj.Data) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetStatus", func(t *testing.T) { - obj := &HookDelivery{} - var fernTestValueStatus HookDeliveryStatus - obj.SetStatus(fernTestValueStatus) - assert.Equal(t, fernTestValueStatus, obj.Status) + t.Run("SetSubmitterEmail", func(t *testing.T) { + obj := &FormSubmission{} + var fernTestValueSubmitterEmail *string + obj.SetSubmitterEmail(fernTestValueSubmitterEmail) + assert.Equal(t, fernTestValueSubmitterEmail, obj.SubmitterEmail) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetAttemptCount", func(t *testing.T) { - obj := &HookDelivery{} - var fernTestValueAttemptCount int64 - obj.SetAttemptCount(fernTestValueAttemptCount) - assert.Equal(t, fernTestValueAttemptCount, obj.AttemptCount) + t.Run("SetFiles", func(t *testing.T) { + obj := &FormSubmission{} + var fernTestValueFiles []*FormSubmissionFile + obj.SetFiles(fernTestValueFiles) + assert.Equal(t, fernTestValueFiles, obj.Files) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetNextAttemptAt", func(t *testing.T) { - obj := &HookDelivery{} - var fernTestValueNextAttemptAt *time.Time - obj.SetNextAttemptAt(fernTestValueNextAttemptAt) - assert.Equal(t, fernTestValueNextAttemptAt, obj.NextAttemptAt) + t.Run("SetSpamReason", func(t *testing.T) { + obj := &FormSubmission{} + var fernTestValueSpamReason *FormSubmissionSpamReason + obj.SetSpamReason(fernTestValueSpamReason) + assert.Equal(t, fernTestValueSpamReason, obj.SpamReason) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetLastStatusCode", func(t *testing.T) { - obj := &HookDelivery{} - var fernTestValueLastStatusCode *int64 - obj.SetLastStatusCode(fernTestValueLastStatusCode) - assert.Equal(t, fernTestValueLastStatusCode, obj.LastStatusCode) + t.Run("SetRisk", func(t *testing.T) { + obj := &FormSubmission{} + var fernTestValueRisk *FormSubmissionRisk + obj.SetRisk(fernTestValueRisk) + assert.Equal(t, fernTestValueRisk, obj.Risk) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetLastError", func(t *testing.T) { - obj := &HookDelivery{} - var fernTestValueLastError *string - obj.SetLastError(fernTestValueLastError) - assert.Equal(t, fernTestValueLastError, obj.LastError) + t.Run("SetIP", func(t *testing.T) { + obj := &FormSubmission{} + var fernTestValueIP *string + obj.SetIP(fernTestValueIP) + assert.Equal(t, fernTestValueIP, obj.IP) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetUserAgent", func(t *testing.T) { + obj := &FormSubmission{} + var fernTestValueUserAgent *string + obj.SetUserAgent(fernTestValueUserAgent) + assert.Equal(t, fernTestValueUserAgent, obj.UserAgent) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetOrigin", func(t *testing.T) { + obj := &FormSubmission{} + var fernTestValueOrigin *string + obj.SetOrigin(fernTestValueOrigin) + assert.Equal(t, fernTestValueOrigin, obj.Origin) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetReferrer", func(t *testing.T) { + obj := &FormSubmission{} + var fernTestValueReferrer *string + obj.SetReferrer(fernTestValueReferrer) + assert.Equal(t, fernTestValueReferrer, obj.Referrer) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetConfirmedAt", func(t *testing.T) { + obj := &FormSubmission{} + var fernTestValueConfirmedAt *time.Time + obj.SetConfirmedAt(fernTestValueConfirmedAt) + assert.Equal(t, fernTestValueConfirmedAt, obj.ConfirmedAt) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetAcceptedAt", func(t *testing.T) { + obj := &FormSubmission{} + var fernTestValueAcceptedAt *time.Time + obj.SetAcceptedAt(fernTestValueAcceptedAt) + assert.Equal(t, fernTestValueAcceptedAt, obj.AcceptedAt) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetReleasedAt", func(t *testing.T) { + obj := &FormSubmission{} + var fernTestValueReleasedAt *time.Time + obj.SetReleasedAt(fernTestValueReleasedAt) + assert.Equal(t, fernTestValueReleasedAt, obj.ReleasedAt) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetSandbox", func(t *testing.T) { + obj := &FormSubmission{} + var fernTestValueSandbox bool + obj.SetSandbox(fernTestValueSandbox) + assert.Equal(t, fernTestValueSandbox, obj.Sandbox) assert.NotNil(t, obj.explicitFields) }) t.Run("SetCreatedAt", func(t *testing.T) { - obj := &HookDelivery{} + obj := &FormSubmission{} var fernTestValueCreatedAt time.Time obj.SetCreatedAt(fernTestValueCreatedAt) assert.Equal(t, fernTestValueCreatedAt, obj.CreatedAt) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetFinishedAt", func(t *testing.T) { - obj := &HookDelivery{} - var fernTestValueFinishedAt *time.Time - obj.SetFinishedAt(fernTestValueFinishedAt) - assert.Equal(t, fernTestValueFinishedAt, obj.FinishedAt) - assert.NotNil(t, obj.explicitFields) - }) - } -func TestGettersHookDelivery(t *testing.T) { +func TestGettersFormSubmission(t *testing.T) { t.Run("GetObject", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookDelivery{} - var expected HookDeliveryObject + obj := &FormSubmission{} + var expected FormSubmissionObject obj.Object = expected // Act & Assert @@ -44847,7 +43211,7 @@ func TestGettersHookDelivery(t *testing.T) { t.Run("GetObject_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *HookDelivery + var obj *FormSubmission // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -44860,7 +43224,7 @@ func TestGettersHookDelivery(t *testing.T) { t.Run("GetID", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookDelivery{} + obj := &FormSubmission{} var expected string obj.ID = expected @@ -44870,7 +43234,7 @@ func TestGettersHookDelivery(t *testing.T) { t.Run("GetID_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *HookDelivery + var obj *FormSubmission // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -44880,284 +43244,502 @@ func TestGettersHookDelivery(t *testing.T) { _ = obj.GetID() // Should return zero value }) - t.Run("GetApplicationID", func(t *testing.T) { + t.Run("GetFormID", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookDelivery{} + obj := &FormSubmission{} var expected string - obj.ApplicationID = expected + obj.FormID = expected // Act & Assert - assert.Equal(t, expected, obj.GetApplicationID(), "getter should return the property value") + assert.Equal(t, expected, obj.GetFormID(), "getter should return the property value") }) - t.Run("GetApplicationID_NilReceiver", func(t *testing.T) { + t.Run("GetFormID_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *HookDelivery + var obj *FormSubmission // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetApplicationID() // Should return zero value + _ = obj.GetFormID() // Should return zero value }) - t.Run("GetMessageID", func(t *testing.T) { + t.Run("GetStatus", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookDelivery{} - var expected string - obj.MessageID = expected + obj := &FormSubmission{} + var expected FormSubmissionStatus + obj.Status = expected // Act & Assert - assert.Equal(t, expected, obj.GetMessageID(), "getter should return the property value") + assert.Equal(t, expected, obj.GetStatus(), "getter should return the property value") }) - t.Run("GetMessageID_NilReceiver", func(t *testing.T) { + t.Run("GetStatus_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *HookDelivery + var obj *FormSubmission // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetMessageID() // Should return zero value + _ = obj.GetStatus() // Should return zero value }) - t.Run("GetEndpointID", func(t *testing.T) { + t.Run("GetData", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookDelivery{} - var expected string - obj.EndpointID = expected + obj := &FormSubmission{} + var expected map[string]*FormSubmissionDataValue + obj.Data = expected // Act & Assert - assert.Equal(t, expected, obj.GetEndpointID(), "getter should return the property value") + assert.Equal(t, expected, obj.GetData(), "getter should return the property value") }) - t.Run("GetEndpointID_NilReceiver", func(t *testing.T) { + t.Run("GetData_NilValue", func(t *testing.T) { t.Parallel() - var obj *HookDelivery + // Arrange + obj := &FormSubmission{} + obj.Data = nil + + // Act & Assert + assert.Nil(t, obj.GetData(), "getter should return nil when property is nil") + }) + + t.Run("GetData_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *FormSubmission // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetEndpointID() // Should return zero value + _ = obj.GetData() // Should return zero value }) - t.Run("GetStatus", func(t *testing.T) { + t.Run("GetSubmitterEmail", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookDelivery{} - var expected HookDeliveryStatus - obj.Status = expected + obj := &FormSubmission{} + var expected *string + obj.SubmitterEmail = expected // Act & Assert - assert.Equal(t, expected, obj.GetStatus(), "getter should return the property value") + assert.Equal(t, expected, obj.GetSubmitterEmail(), "getter should return the property value") }) - t.Run("GetStatus_NilReceiver", func(t *testing.T) { + t.Run("GetSubmitterEmail_NilValue", func(t *testing.T) { t.Parallel() - var obj *HookDelivery + // Arrange + obj := &FormSubmission{} + obj.SubmitterEmail = nil + + // Act & Assert + assert.Nil(t, obj.GetSubmitterEmail(), "getter should return nil when property is nil") + }) + + t.Run("GetSubmitterEmail_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *FormSubmission // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetStatus() // Should return zero value + _ = obj.GetSubmitterEmail() // Should return zero value }) - t.Run("GetAttemptCount", func(t *testing.T) { + t.Run("GetFiles", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookDelivery{} - var expected int64 - obj.AttemptCount = expected + obj := &FormSubmission{} + var expected []*FormSubmissionFile + obj.Files = expected // Act & Assert - assert.Equal(t, expected, obj.GetAttemptCount(), "getter should return the property value") + assert.Equal(t, expected, obj.GetFiles(), "getter should return the property value") }) - t.Run("GetAttemptCount_NilReceiver", func(t *testing.T) { + t.Run("GetFiles_NilValue", func(t *testing.T) { t.Parallel() - var obj *HookDelivery + // Arrange + obj := &FormSubmission{} + obj.Files = nil + + // Act & Assert + assert.Nil(t, obj.GetFiles(), "getter should return nil when property is nil") + }) + + t.Run("GetFiles_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *FormSubmission // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetAttemptCount() // Should return zero value + _ = obj.GetFiles() // Should return zero value }) - t.Run("GetNextAttemptAt", func(t *testing.T) { + t.Run("GetSpamReason", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookDelivery{} - var expected *time.Time - obj.NextAttemptAt = expected + obj := &FormSubmission{} + var expected *FormSubmissionSpamReason + obj.SpamReason = expected // Act & Assert - assert.Equal(t, expected, obj.GetNextAttemptAt(), "getter should return the property value") + assert.Equal(t, expected, obj.GetSpamReason(), "getter should return the property value") }) - t.Run("GetNextAttemptAt_NilValue", func(t *testing.T) { + t.Run("GetSpamReason_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookDelivery{} - obj.NextAttemptAt = nil + obj := &FormSubmission{} + obj.SpamReason = nil // Act & Assert - assert.Nil(t, obj.GetNextAttemptAt(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetSpamReason(), "getter should return nil when property is nil") }) - t.Run("GetNextAttemptAt_NilReceiver", func(t *testing.T) { + t.Run("GetSpamReason_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *HookDelivery + var obj *FormSubmission // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetNextAttemptAt() // Should return zero value + _ = obj.GetSpamReason() // Should return zero value }) - t.Run("GetLastStatusCode", func(t *testing.T) { + t.Run("GetRisk", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookDelivery{} - var expected *int64 - obj.LastStatusCode = expected + obj := &FormSubmission{} + var expected *FormSubmissionRisk + obj.Risk = expected // Act & Assert - assert.Equal(t, expected, obj.GetLastStatusCode(), "getter should return the property value") + assert.Equal(t, expected, obj.GetRisk(), "getter should return the property value") }) - t.Run("GetLastStatusCode_NilValue", func(t *testing.T) { + t.Run("GetRisk_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookDelivery{} - obj.LastStatusCode = nil + obj := &FormSubmission{} + obj.Risk = nil // Act & Assert - assert.Nil(t, obj.GetLastStatusCode(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetRisk(), "getter should return nil when property is nil") }) - t.Run("GetLastStatusCode_NilReceiver", func(t *testing.T) { + t.Run("GetRisk_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *HookDelivery + var obj *FormSubmission // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetLastStatusCode() // Should return zero value + _ = obj.GetRisk() // Should return zero value }) - t.Run("GetLastError", func(t *testing.T) { + t.Run("GetIP", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookDelivery{} + obj := &FormSubmission{} var expected *string - obj.LastError = expected + obj.IP = expected // Act & Assert - assert.Equal(t, expected, obj.GetLastError(), "getter should return the property value") + assert.Equal(t, expected, obj.GetIP(), "getter should return the property value") }) - t.Run("GetLastError_NilValue", func(t *testing.T) { + t.Run("GetIP_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookDelivery{} - obj.LastError = nil + obj := &FormSubmission{} + obj.IP = nil // Act & Assert - assert.Nil(t, obj.GetLastError(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetIP(), "getter should return nil when property is nil") }) - t.Run("GetLastError_NilReceiver", func(t *testing.T) { + t.Run("GetIP_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *HookDelivery + var obj *FormSubmission // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetLastError() // Should return zero value + _ = obj.GetIP() // Should return zero value }) - t.Run("GetCreatedAt", func(t *testing.T) { + t.Run("GetUserAgent", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookDelivery{} - var expected time.Time - obj.CreatedAt = expected + obj := &FormSubmission{} + var expected *string + obj.UserAgent = expected // Act & Assert - assert.Equal(t, expected, obj.GetCreatedAt(), "getter should return the property value") + assert.Equal(t, expected, obj.GetUserAgent(), "getter should return the property value") }) - t.Run("GetCreatedAt_NilReceiver", func(t *testing.T) { + t.Run("GetUserAgent_NilValue", func(t *testing.T) { t.Parallel() - var obj *HookDelivery + // Arrange + obj := &FormSubmission{} + obj.UserAgent = nil + + // Act & Assert + assert.Nil(t, obj.GetUserAgent(), "getter should return nil when property is nil") + }) + + t.Run("GetUserAgent_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *FormSubmission // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetCreatedAt() // Should return zero value + _ = obj.GetUserAgent() // Should return zero value }) - t.Run("GetFinishedAt", func(t *testing.T) { + t.Run("GetOrigin", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookDelivery{} + obj := &FormSubmission{} + var expected *string + obj.Origin = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetOrigin(), "getter should return the property value") + }) + + t.Run("GetOrigin_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &FormSubmission{} + obj.Origin = nil + + // Act & Assert + assert.Nil(t, obj.GetOrigin(), "getter should return nil when property is nil") + }) + + t.Run("GetOrigin_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *FormSubmission + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetOrigin() // Should return zero value + }) + + t.Run("GetReferrer", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &FormSubmission{} + var expected *string + obj.Referrer = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetReferrer(), "getter should return the property value") + }) + + t.Run("GetReferrer_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &FormSubmission{} + obj.Referrer = nil + + // Act & Assert + assert.Nil(t, obj.GetReferrer(), "getter should return nil when property is nil") + }) + + t.Run("GetReferrer_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *FormSubmission + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetReferrer() // Should return zero value + }) + + t.Run("GetConfirmedAt", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &FormSubmission{} var expected *time.Time - obj.FinishedAt = expected + obj.ConfirmedAt = expected // Act & Assert - assert.Equal(t, expected, obj.GetFinishedAt(), "getter should return the property value") + assert.Equal(t, expected, obj.GetConfirmedAt(), "getter should return the property value") }) - t.Run("GetFinishedAt_NilValue", func(t *testing.T) { + t.Run("GetConfirmedAt_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookDelivery{} - obj.FinishedAt = nil + obj := &FormSubmission{} + obj.ConfirmedAt = nil // Act & Assert - assert.Nil(t, obj.GetFinishedAt(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetConfirmedAt(), "getter should return nil when property is nil") }) - t.Run("GetFinishedAt_NilReceiver", func(t *testing.T) { + t.Run("GetConfirmedAt_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *HookDelivery + var obj *FormSubmission // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetFinishedAt() // Should return zero value + _ = obj.GetConfirmedAt() // Should return zero value + }) + + t.Run("GetAcceptedAt", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &FormSubmission{} + var expected *time.Time + obj.AcceptedAt = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetAcceptedAt(), "getter should return the property value") + }) + + t.Run("GetAcceptedAt_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &FormSubmission{} + obj.AcceptedAt = nil + + // Act & Assert + assert.Nil(t, obj.GetAcceptedAt(), "getter should return nil when property is nil") + }) + + t.Run("GetAcceptedAt_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *FormSubmission + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetAcceptedAt() // Should return zero value + }) + + t.Run("GetReleasedAt", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &FormSubmission{} + var expected *time.Time + obj.ReleasedAt = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetReleasedAt(), "getter should return the property value") + }) + + t.Run("GetReleasedAt_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &FormSubmission{} + obj.ReleasedAt = nil + + // Act & Assert + assert.Nil(t, obj.GetReleasedAt(), "getter should return nil when property is nil") + }) + + t.Run("GetReleasedAt_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *FormSubmission + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetReleasedAt() // Should return zero value + }) + + t.Run("GetSandbox", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &FormSubmission{} + var expected bool + obj.Sandbox = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetSandbox(), "getter should return the property value") + }) + + t.Run("GetSandbox_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *FormSubmission + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetSandbox() // Should return zero value + }) + + t.Run("GetCreatedAt", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &FormSubmission{} + var expected time.Time + obj.CreatedAt = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetCreatedAt(), "getter should return the property value") + }) + + t.Run("GetCreatedAt_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *FormSubmission + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetCreatedAt() // Should return zero value }) } -func TestSettersMarkExplicitHookDelivery(t *testing.T) { +func TestSettersMarkExplicitFormSubmission(t *testing.T) { t.Run("SetObject_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookDelivery{} - var fernTestValueObject HookDeliveryObject + obj := &FormSubmission{} + var fernTestValueObject FormSubmissionObject // Act obj.SetObject(fernTestValueObject) @@ -45187,7 +43769,7 @@ func TestSettersMarkExplicitHookDelivery(t *testing.T) { t.Run("SetID_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookDelivery{} + obj := &FormSubmission{} var fernTestValueID string // Act @@ -45215,14 +43797,14 @@ func TestSettersMarkExplicitHookDelivery(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetApplicationID_MarksExplicit", func(t *testing.T) { + t.Run("SetFormID_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookDelivery{} - var fernTestValueApplicationID string + obj := &FormSubmission{} + var fernTestValueFormID string // Act - obj.SetApplicationID(fernTestValueApplicationID) + obj.SetFormID(fernTestValueFormID) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -45246,14 +43828,14 @@ func TestSettersMarkExplicitHookDelivery(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetMessageID_MarksExplicit", func(t *testing.T) { + t.Run("SetStatus_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookDelivery{} - var fernTestValueMessageID string + obj := &FormSubmission{} + var fernTestValueStatus FormSubmissionStatus // Act - obj.SetMessageID(fernTestValueMessageID) + obj.SetStatus(fernTestValueStatus) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -45277,14 +43859,14 @@ func TestSettersMarkExplicitHookDelivery(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetEndpointID_MarksExplicit", func(t *testing.T) { + t.Run("SetData_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookDelivery{} - var fernTestValueEndpointID string + obj := &FormSubmission{} + var fernTestValueData map[string]*FormSubmissionDataValue // Act - obj.SetEndpointID(fernTestValueEndpointID) + obj.SetData(fernTestValueData) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -45308,14 +43890,14 @@ func TestSettersMarkExplicitHookDelivery(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetStatus_MarksExplicit", func(t *testing.T) { + t.Run("SetSubmitterEmail_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookDelivery{} - var fernTestValueStatus HookDeliveryStatus + obj := &FormSubmission{} + var fernTestValueSubmitterEmail *string // Act - obj.SetStatus(fernTestValueStatus) + obj.SetSubmitterEmail(fernTestValueSubmitterEmail) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -45339,14 +43921,14 @@ func TestSettersMarkExplicitHookDelivery(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetAttemptCount_MarksExplicit", func(t *testing.T) { + t.Run("SetFiles_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookDelivery{} - var fernTestValueAttemptCount int64 + obj := &FormSubmission{} + var fernTestValueFiles []*FormSubmissionFile // Act - obj.SetAttemptCount(fernTestValueAttemptCount) + obj.SetFiles(fernTestValueFiles) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -45370,14 +43952,14 @@ func TestSettersMarkExplicitHookDelivery(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetNextAttemptAt_MarksExplicit", func(t *testing.T) { + t.Run("SetSpamReason_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookDelivery{} - var fernTestValueNextAttemptAt *time.Time + obj := &FormSubmission{} + var fernTestValueSpamReason *FormSubmissionSpamReason // Act - obj.SetNextAttemptAt(fernTestValueNextAttemptAt) + obj.SetSpamReason(fernTestValueSpamReason) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -45401,14 +43983,14 @@ func TestSettersMarkExplicitHookDelivery(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetLastStatusCode_MarksExplicit", func(t *testing.T) { + t.Run("SetRisk_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookDelivery{} - var fernTestValueLastStatusCode *int64 + obj := &FormSubmission{} + var fernTestValueRisk *FormSubmissionRisk // Act - obj.SetLastStatusCode(fernTestValueLastStatusCode) + obj.SetRisk(fernTestValueRisk) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -45432,14 +44014,14 @@ func TestSettersMarkExplicitHookDelivery(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetLastError_MarksExplicit", func(t *testing.T) { + t.Run("SetIP_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookDelivery{} - var fernTestValueLastError *string + obj := &FormSubmission{} + var fernTestValueIP *string // Act - obj.SetLastError(fernTestValueLastError) + obj.SetIP(fernTestValueIP) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -45463,14 +44045,14 @@ func TestSettersMarkExplicitHookDelivery(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetCreatedAt_MarksExplicit", func(t *testing.T) { + t.Run("SetUserAgent_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookDelivery{} - var fernTestValueCreatedAt time.Time + obj := &FormSubmission{} + var fernTestValueUserAgent *string // Act - obj.SetCreatedAt(fernTestValueCreatedAt) + obj.SetUserAgent(fernTestValueUserAgent) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -45494,14 +44076,14 @@ func TestSettersMarkExplicitHookDelivery(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetFinishedAt_MarksExplicit", func(t *testing.T) { + t.Run("SetOrigin_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookDelivery{} - var fernTestValueFinishedAt *time.Time + obj := &FormSubmission{} + var fernTestValueOrigin *string // Act - obj.SetFinishedAt(fernTestValueFinishedAt) + obj.SetOrigin(fernTestValueOrigin) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -45525,126 +44107,14 @@ func TestSettersMarkExplicitHookDelivery(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) -} - -func TestSettersHookDeliveryList(t *testing.T) { - t.Run("SetObject", func(t *testing.T) { - obj := &HookDeliveryList{} - var fernTestValueObject HookDeliveryListObject - obj.SetObject(fernTestValueObject) - assert.Equal(t, fernTestValueObject, obj.Object) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetData", func(t *testing.T) { - obj := &HookDeliveryList{} - var fernTestValueData []*HookDelivery - obj.SetData(fernTestValueData) - assert.Equal(t, fernTestValueData, obj.Data) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetHasMore", func(t *testing.T) { - obj := &HookDeliveryList{} - var fernTestValueHasMore bool - obj.SetHasMore(fernTestValueHasMore) - assert.Equal(t, fernTestValueHasMore, obj.HasMore) - assert.NotNil(t, obj.explicitFields) - }) - -} - -func TestGettersHookDeliveryList(t *testing.T) { - t.Run("GetObject", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &HookDeliveryList{} - var expected HookDeliveryListObject - obj.Object = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetObject(), "getter should return the property value") - }) - - t.Run("GetObject_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *HookDeliveryList - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetObject() // Should return zero value - }) - - t.Run("GetData", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &HookDeliveryList{} - var expected []*HookDelivery - obj.Data = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetData(), "getter should return the property value") - }) - - t.Run("GetData_NilValue", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &HookDeliveryList{} - obj.Data = nil - - // Act & Assert - assert.Nil(t, obj.GetData(), "getter should return nil when property is nil") - }) - - t.Run("GetData_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *HookDeliveryList - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetData() // Should return zero value - }) - - t.Run("GetHasMore", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &HookDeliveryList{} - var expected bool - obj.HasMore = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetHasMore(), "getter should return the property value") - }) - - t.Run("GetHasMore_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *HookDeliveryList - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetHasMore() // Should return zero value - }) - -} - -func TestSettersMarkExplicitHookDeliveryList(t *testing.T) { - t.Run("SetObject_MarksExplicit", func(t *testing.T) { + t.Run("SetReferrer_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookDeliveryList{} - var fernTestValueObject HookDeliveryListObject + obj := &FormSubmission{} + var fernTestValueReferrer *string // Act - obj.SetObject(fernTestValueObject) + obj.SetReferrer(fernTestValueReferrer) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -45668,14 +44138,14 @@ func TestSettersMarkExplicitHookDeliveryList(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetData_MarksExplicit", func(t *testing.T) { + t.Run("SetConfirmedAt_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookDeliveryList{} - var fernTestValueData []*HookDelivery + obj := &FormSubmission{} + var fernTestValueConfirmedAt *time.Time // Act - obj.SetData(fernTestValueData) + obj.SetConfirmedAt(fernTestValueConfirmedAt) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -45699,14 +44169,14 @@ func TestSettersMarkExplicitHookDeliveryList(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetHasMore_MarksExplicit", func(t *testing.T) { + t.Run("SetAcceptedAt_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookDeliveryList{} - var fernTestValueHasMore bool + obj := &FormSubmission{} + var fernTestValueAcceptedAt *time.Time // Act - obj.SetHasMore(fernTestValueHasMore) + obj.SetAcceptedAt(fernTestValueAcceptedAt) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -45730,568 +44200,330 @@ func TestSettersMarkExplicitHookDeliveryList(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) -} - -func TestSettersHookEndpoint(t *testing.T) { - t.Run("SetObject", func(t *testing.T) { - obj := &HookEndpoint{} - var fernTestValueObject HookEndpointObject - obj.SetObject(fernTestValueObject) - assert.Equal(t, fernTestValueObject, obj.Object) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetID", func(t *testing.T) { - obj := &HookEndpoint{} - var fernTestValueID string - obj.SetID(fernTestValueID) - assert.Equal(t, fernTestValueID, obj.ID) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetApplicationID", func(t *testing.T) { - obj := &HookEndpoint{} - var fernTestValueApplicationID string - obj.SetApplicationID(fernTestValueApplicationID) - assert.Equal(t, fernTestValueApplicationID, obj.ApplicationID) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetURL", func(t *testing.T) { - obj := &HookEndpoint{} - var fernTestValueURL string - obj.SetURL(fernTestValueURL) - assert.Equal(t, fernTestValueURL, obj.URL) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetDescription", func(t *testing.T) { - obj := &HookEndpoint{} - var fernTestValueDescription *string - obj.SetDescription(fernTestValueDescription) - assert.Equal(t, fernTestValueDescription, obj.Description) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetFilterTypes", func(t *testing.T) { - obj := &HookEndpoint{} - var fernTestValueFilterTypes []string - obj.SetFilterTypes(fernTestValueFilterTypes) - assert.Equal(t, fernTestValueFilterTypes, obj.FilterTypes) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetRateLimitPerSecond", func(t *testing.T) { - obj := &HookEndpoint{} - var fernTestValueRateLimitPerSecond *int64 - obj.SetRateLimitPerSecond(fernTestValueRateLimitPerSecond) - assert.Equal(t, fernTestValueRateLimitPerSecond, obj.RateLimitPerSecond) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetEnabled", func(t *testing.T) { - obj := &HookEndpoint{} - var fernTestValueEnabled bool - obj.SetEnabled(fernTestValueEnabled) - assert.Equal(t, fernTestValueEnabled, obj.Enabled) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetDisabledReason", func(t *testing.T) { - obj := &HookEndpoint{} - var fernTestValueDisabledReason *HookEndpointDisabledReason - obj.SetDisabledReason(fernTestValueDisabledReason) - assert.Equal(t, fernTestValueDisabledReason, obj.DisabledReason) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetDisabledAt", func(t *testing.T) { - obj := &HookEndpoint{} - var fernTestValueDisabledAt *time.Time - obj.SetDisabledAt(fernTestValueDisabledAt) - assert.Equal(t, fernTestValueDisabledAt, obj.DisabledAt) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetFailingSince", func(t *testing.T) { - obj := &HookEndpoint{} - var fernTestValueFailingSince *time.Time - obj.SetFailingSince(fernTestValueFailingSince) - assert.Equal(t, fernTestValueFailingSince, obj.FailingSince) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetPreviousSecretExpiresAt", func(t *testing.T) { - obj := &HookEndpoint{} - var fernTestValuePreviousSecretExpiresAt *time.Time - obj.SetPreviousSecretExpiresAt(fernTestValuePreviousSecretExpiresAt) - assert.Equal(t, fernTestValuePreviousSecretExpiresAt, obj.PreviousSecretExpiresAt) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetMetadata", func(t *testing.T) { - obj := &HookEndpoint{} - var fernTestValueMetadata map[string]string - obj.SetMetadata(fernTestValueMetadata) - assert.Equal(t, fernTestValueMetadata, obj.Metadata) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetCreatedAt", func(t *testing.T) { - obj := &HookEndpoint{} - var fernTestValueCreatedAt time.Time - obj.SetCreatedAt(fernTestValueCreatedAt) - assert.Equal(t, fernTestValueCreatedAt, obj.CreatedAt) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetUpdatedAt", func(t *testing.T) { - obj := &HookEndpoint{} - var fernTestValueUpdatedAt time.Time - obj.SetUpdatedAt(fernTestValueUpdatedAt) - assert.Equal(t, fernTestValueUpdatedAt, obj.UpdatedAt) - assert.NotNil(t, obj.explicitFields) - }) - -} - -func TestGettersHookEndpoint(t *testing.T) { - t.Run("GetObject", func(t *testing.T) { + t.Run("SetReleasedAt_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookEndpoint{} - var expected HookEndpointObject - obj.Object = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetObject(), "getter should return the property value") - }) + obj := &FormSubmission{} + var fernTestValueReleasedAt *time.Time - t.Run("GetObject_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *HookEndpoint - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetObject() // Should return zero value - }) + // Act + obj.SetReleasedAt(fernTestValueReleasedAt) - t.Run("GetID", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &HookEndpoint{} - var expected string - obj.ID = expected + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") - // Act & Assert - assert.Equal(t, expected, obj.GetID(), "getter should return the property value") - }) + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } - t.Run("GetID_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *HookEndpoint - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetID() // Should return zero value + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("GetApplicationID", func(t *testing.T) { + t.Run("SetSandbox_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookEndpoint{} - var expected string - obj.ApplicationID = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetApplicationID(), "getter should return the property value") - }) + obj := &FormSubmission{} + var fernTestValueSandbox bool - t.Run("GetApplicationID_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *HookEndpoint - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetApplicationID() // Should return zero value - }) + // Act + obj.SetSandbox(fernTestValueSandbox) - t.Run("GetURL", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &HookEndpoint{} - var expected string - obj.URL = expected + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") - // Act & Assert - assert.Equal(t, expected, obj.GetURL(), "getter should return the property value") - }) + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } - t.Run("GetURL_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *HookEndpoint - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetURL() // Should return zero value + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("GetDescription", func(t *testing.T) { + t.Run("SetCreatedAt_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookEndpoint{} - var expected *string - obj.Description = expected + obj := &FormSubmission{} + var fernTestValueCreatedAt time.Time - // Act & Assert - assert.Equal(t, expected, obj.GetDescription(), "getter should return the property value") - }) + // Act + obj.SetCreatedAt(fernTestValueCreatedAt) - t.Run("GetDescription_NilValue", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &HookEndpoint{} - obj.Description = nil + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") - // Act & Assert - assert.Nil(t, obj.GetDescription(), "getter should return nil when property is nil") - }) + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } - t.Run("GetDescription_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *HookEndpoint - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetDescription() // Should return zero value + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("GetFilterTypes", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &HookEndpoint{} - var expected []string - obj.FilterTypes = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetFilterTypes(), "getter should return the property value") - }) +} - t.Run("GetFilterTypes_NilValue", func(t *testing.T) { +func TestGettersFormSubmissionDataValue(t *testing.T) { + t.Run("GetString", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookEndpoint{} - obj.FilterTypes = nil + obj := &FormSubmissionDataValue{} + var expected string + obj.String = expected // Act & Assert - assert.Nil(t, obj.GetFilterTypes(), "getter should return nil when property is nil") + assert.Equal(t, expected, obj.GetString(), "getter should return the property value") }) - t.Run("GetFilterTypes_NilReceiver", func(t *testing.T) { + t.Run("GetString_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *HookEndpoint + var obj *FormSubmissionDataValue // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetFilterTypes() // Should return zero value - }) - - t.Run("GetRateLimitPerSecond", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &HookEndpoint{} - var expected *int64 - obj.RateLimitPerSecond = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetRateLimitPerSecond(), "getter should return the property value") + _ = obj.GetString() // Should return zero value }) - t.Run("GetRateLimitPerSecond_NilValue", func(t *testing.T) { + t.Run("GetStringList", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookEndpoint{} - obj.RateLimitPerSecond = nil + obj := &FormSubmissionDataValue{} + var expected []string + obj.StringList = expected // Act & Assert - assert.Nil(t, obj.GetRateLimitPerSecond(), "getter should return nil when property is nil") - }) - - t.Run("GetRateLimitPerSecond_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *HookEndpoint - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetRateLimitPerSecond() // Should return zero value + assert.Equal(t, expected, obj.GetStringList(), "getter should return the property value") }) - t.Run("GetEnabled", func(t *testing.T) { + t.Run("GetStringList_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookEndpoint{} - var expected bool - obj.Enabled = expected + obj := &FormSubmissionDataValue{} + obj.StringList = nil // Act & Assert - assert.Equal(t, expected, obj.GetEnabled(), "getter should return the property value") + assert.Nil(t, obj.GetStringList(), "getter should return nil when property is nil") }) - t.Run("GetEnabled_NilReceiver", func(t *testing.T) { + t.Run("GetStringList_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *HookEndpoint + var obj *FormSubmissionDataValue // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetEnabled() // Should return zero value - }) - - t.Run("GetDisabledReason", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &HookEndpoint{} - var expected *HookEndpointDisabledReason - obj.DisabledReason = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetDisabledReason(), "getter should return the property value") + _ = obj.GetStringList() // Should return zero value }) - t.Run("GetDisabledReason_NilValue", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &HookEndpoint{} - obj.DisabledReason = nil +} - // Act & Assert - assert.Nil(t, obj.GetDisabledReason(), "getter should return nil when property is nil") +func TestSettersFormSubmissionFile(t *testing.T) { + t.Run("SetID", func(t *testing.T) { + obj := &FormSubmissionFile{} + var fernTestValueID string + obj.SetID(fernTestValueID) + assert.Equal(t, fernTestValueID, obj.ID) + assert.NotNil(t, obj.explicitFields) }) - t.Run("GetDisabledReason_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *HookEndpoint - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetDisabledReason() // Should return zero value + t.Run("SetField", func(t *testing.T) { + obj := &FormSubmissionFile{} + var fernTestValueField string + obj.SetField(fernTestValueField) + assert.Equal(t, fernTestValueField, obj.Field) + assert.NotNil(t, obj.explicitFields) }) - t.Run("GetDisabledAt", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &HookEndpoint{} - var expected *time.Time - obj.DisabledAt = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetDisabledAt(), "getter should return the property value") + t.Run("SetFilename", func(t *testing.T) { + obj := &FormSubmissionFile{} + var fernTestValueFilename string + obj.SetFilename(fernTestValueFilename) + assert.Equal(t, fernTestValueFilename, obj.Filename) + assert.NotNil(t, obj.explicitFields) }) - t.Run("GetDisabledAt_NilValue", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &HookEndpoint{} - obj.DisabledAt = nil - - // Act & Assert - assert.Nil(t, obj.GetDisabledAt(), "getter should return nil when property is nil") + t.Run("SetContentType", func(t *testing.T) { + obj := &FormSubmissionFile{} + var fernTestValueContentType string + obj.SetContentType(fernTestValueContentType) + assert.Equal(t, fernTestValueContentType, obj.ContentType) + assert.NotNil(t, obj.explicitFields) }) - t.Run("GetDisabledAt_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *HookEndpoint - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetDisabledAt() // Should return zero value + t.Run("SetSize", func(t *testing.T) { + obj := &FormSubmissionFile{} + var fernTestValueSize int64 + obj.SetSize(fernTestValueSize) + assert.Equal(t, fernTestValueSize, obj.Size) + assert.NotNil(t, obj.explicitFields) }) - t.Run("GetFailingSince", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &HookEndpoint{} - var expected *time.Time - obj.FailingSince = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetFailingSince(), "getter should return the property value") - }) +} - t.Run("GetFailingSince_NilValue", func(t *testing.T) { +func TestGettersFormSubmissionFile(t *testing.T) { + t.Run("GetID", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookEndpoint{} - obj.FailingSince = nil + obj := &FormSubmissionFile{} + var expected string + obj.ID = expected // Act & Assert - assert.Nil(t, obj.GetFailingSince(), "getter should return nil when property is nil") + assert.Equal(t, expected, obj.GetID(), "getter should return the property value") }) - t.Run("GetFailingSince_NilReceiver", func(t *testing.T) { + t.Run("GetID_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *HookEndpoint + var obj *FormSubmissionFile // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetFailingSince() // Should return zero value - }) - - t.Run("GetPreviousSecretExpiresAt", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &HookEndpoint{} - var expected *time.Time - obj.PreviousSecretExpiresAt = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetPreviousSecretExpiresAt(), "getter should return the property value") + _ = obj.GetID() // Should return zero value }) - t.Run("GetPreviousSecretExpiresAt_NilValue", func(t *testing.T) { + t.Run("GetField", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookEndpoint{} - obj.PreviousSecretExpiresAt = nil + obj := &FormSubmissionFile{} + var expected string + obj.Field = expected // Act & Assert - assert.Nil(t, obj.GetPreviousSecretExpiresAt(), "getter should return nil when property is nil") + assert.Equal(t, expected, obj.GetField(), "getter should return the property value") }) - t.Run("GetPreviousSecretExpiresAt_NilReceiver", func(t *testing.T) { + t.Run("GetField_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *HookEndpoint + var obj *FormSubmissionFile // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetPreviousSecretExpiresAt() // Should return zero value - }) - - t.Run("GetMetadata", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &HookEndpoint{} - var expected map[string]string - obj.Metadata = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetMetadata(), "getter should return the property value") + _ = obj.GetField() // Should return zero value }) - t.Run("GetMetadata_NilValue", func(t *testing.T) { + t.Run("GetFilename", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookEndpoint{} - obj.Metadata = nil + obj := &FormSubmissionFile{} + var expected string + obj.Filename = expected // Act & Assert - assert.Nil(t, obj.GetMetadata(), "getter should return nil when property is nil") + assert.Equal(t, expected, obj.GetFilename(), "getter should return the property value") }) - t.Run("GetMetadata_NilReceiver", func(t *testing.T) { + t.Run("GetFilename_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *HookEndpoint + var obj *FormSubmissionFile // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetMetadata() // Should return zero value + _ = obj.GetFilename() // Should return zero value }) - t.Run("GetCreatedAt", func(t *testing.T) { + t.Run("GetContentType", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookEndpoint{} - var expected time.Time - obj.CreatedAt = expected + obj := &FormSubmissionFile{} + var expected string + obj.ContentType = expected // Act & Assert - assert.Equal(t, expected, obj.GetCreatedAt(), "getter should return the property value") + assert.Equal(t, expected, obj.GetContentType(), "getter should return the property value") }) - t.Run("GetCreatedAt_NilReceiver", func(t *testing.T) { + t.Run("GetContentType_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *HookEndpoint + var obj *FormSubmissionFile // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetCreatedAt() // Should return zero value + _ = obj.GetContentType() // Should return zero value }) - t.Run("GetUpdatedAt", func(t *testing.T) { + t.Run("GetSize", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookEndpoint{} - var expected time.Time - obj.UpdatedAt = expected + obj := &FormSubmissionFile{} + var expected int64 + obj.Size = expected // Act & Assert - assert.Equal(t, expected, obj.GetUpdatedAt(), "getter should return the property value") + assert.Equal(t, expected, obj.GetSize(), "getter should return the property value") }) - t.Run("GetUpdatedAt_NilReceiver", func(t *testing.T) { + t.Run("GetSize_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *HookEndpoint + var obj *FormSubmissionFile // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetUpdatedAt() // Should return zero value + _ = obj.GetSize() // Should return zero value }) } -func TestSettersMarkExplicitHookEndpoint(t *testing.T) { - t.Run("SetObject_MarksExplicit", func(t *testing.T) { +func TestSettersMarkExplicitFormSubmissionFile(t *testing.T) { + t.Run("SetID_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookEndpoint{} - var fernTestValueObject HookEndpointObject + obj := &FormSubmissionFile{} + var fernTestValueID string // Act - obj.SetObject(fernTestValueObject) + obj.SetID(fernTestValueID) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -46315,14 +44547,14 @@ func TestSettersMarkExplicitHookEndpoint(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetID_MarksExplicit", func(t *testing.T) { + t.Run("SetField_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookEndpoint{} - var fernTestValueID string + obj := &FormSubmissionFile{} + var fernTestValueField string // Act - obj.SetID(fernTestValueID) + obj.SetField(fernTestValueField) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -46346,14 +44578,14 @@ func TestSettersMarkExplicitHookEndpoint(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetApplicationID_MarksExplicit", func(t *testing.T) { + t.Run("SetFilename_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookEndpoint{} - var fernTestValueApplicationID string + obj := &FormSubmissionFile{} + var fernTestValueFilename string // Act - obj.SetApplicationID(fernTestValueApplicationID) + obj.SetFilename(fernTestValueFilename) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -46377,14 +44609,14 @@ func TestSettersMarkExplicitHookEndpoint(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetURL_MarksExplicit", func(t *testing.T) { + t.Run("SetContentType_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookEndpoint{} - var fernTestValueURL string + obj := &FormSubmissionFile{} + var fernTestValueContentType string // Act - obj.SetURL(fernTestValueURL) + obj.SetContentType(fernTestValueContentType) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -46408,14 +44640,14 @@ func TestSettersMarkExplicitHookEndpoint(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetDescription_MarksExplicit", func(t *testing.T) { + t.Run("SetSize_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookEndpoint{} - var fernTestValueDescription *string + obj := &FormSubmissionFile{} + var fernTestValueSize int64 // Act - obj.SetDescription(fernTestValueDescription) + obj.SetSize(fernTestValueSize) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -46439,76 +44671,126 @@ func TestSettersMarkExplicitHookEndpoint(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetFilterTypes_MarksExplicit", func(t *testing.T) { +} + +func TestSettersFormSubmissionList(t *testing.T) { + t.Run("SetObject", func(t *testing.T) { + obj := &FormSubmissionList{} + var fernTestValueObject FormSubmissionListObject + obj.SetObject(fernTestValueObject) + assert.Equal(t, fernTestValueObject, obj.Object) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetData", func(t *testing.T) { + obj := &FormSubmissionList{} + var fernTestValueData []*FormSubmission + obj.SetData(fernTestValueData) + assert.Equal(t, fernTestValueData, obj.Data) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetHasMore", func(t *testing.T) { + obj := &FormSubmissionList{} + var fernTestValueHasMore bool + obj.SetHasMore(fernTestValueHasMore) + assert.Equal(t, fernTestValueHasMore, obj.HasMore) + assert.NotNil(t, obj.explicitFields) + }) + +} + +func TestGettersFormSubmissionList(t *testing.T) { + t.Run("GetObject", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookEndpoint{} - var fernTestValueFilterTypes []string + obj := &FormSubmissionList{} + var expected FormSubmissionListObject + obj.Object = expected - // Act - obj.SetFilterTypes(fernTestValueFilterTypes) + // Act & Assert + assert.Equal(t, expected, obj.GetObject(), "getter should return the property value") + }) - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") + t.Run("GetObject_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *FormSubmissionList + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetObject() // Should return zero value + }) - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } + t.Run("GetData", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &FormSubmissionList{} + var expected []*FormSubmission + obj.Data = expected - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip + // Act & Assert + assert.Equal(t, expected, obj.GetData(), "getter should return the property value") }) - t.Run("SetRateLimitPerSecond_MarksExplicit", func(t *testing.T) { + t.Run("GetData_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookEndpoint{} - var fernTestValueRateLimitPerSecond *int64 + obj := &FormSubmissionList{} + obj.Data = nil - // Act - obj.SetRateLimitPerSecond(fernTestValueRateLimitPerSecond) + // Act & Assert + assert.Nil(t, obj.GetData(), "getter should return nil when property is nil") + }) - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") + t.Run("GetData_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *FormSubmissionList + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetData() // Should return zero value + }) - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } + t.Run("GetHasMore", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &FormSubmissionList{} + var expected bool + obj.HasMore = expected - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip + // Act & Assert + assert.Equal(t, expected, obj.GetHasMore(), "getter should return the property value") }) - t.Run("SetEnabled_MarksExplicit", func(t *testing.T) { + t.Run("GetHasMore_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *FormSubmissionList + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetHasMore() // Should return zero value + }) + +} + +func TestSettersMarkExplicitFormSubmissionList(t *testing.T) { + t.Run("SetObject_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookEndpoint{} - var fernTestValueEnabled bool + obj := &FormSubmissionList{} + var fernTestValueObject FormSubmissionListObject // Act - obj.SetEnabled(fernTestValueEnabled) + obj.SetObject(fernTestValueObject) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -46532,14 +44814,14 @@ func TestSettersMarkExplicitHookEndpoint(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetDisabledReason_MarksExplicit", func(t *testing.T) { + t.Run("SetData_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookEndpoint{} - var fernTestValueDisabledReason *HookEndpointDisabledReason + obj := &FormSubmissionList{} + var fernTestValueData []*FormSubmission // Act - obj.SetDisabledReason(fernTestValueDisabledReason) + obj.SetData(fernTestValueData) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -46563,14 +44845,14 @@ func TestSettersMarkExplicitHookEndpoint(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetDisabledAt_MarksExplicit", func(t *testing.T) { + t.Run("SetHasMore_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookEndpoint{} - var fernTestValueDisabledAt *time.Time + obj := &FormSubmissionList{} + var fernTestValueHasMore bool // Act - obj.SetDisabledAt(fernTestValueDisabledAt) + obj.SetHasMore(fernTestValueHasMore) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -46594,76 +44876,146 @@ func TestSettersMarkExplicitHookEndpoint(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetFailingSince_MarksExplicit", func(t *testing.T) { +} + +func TestSettersFormSubmissionRisk(t *testing.T) { + t.Run("SetAssessmentID", func(t *testing.T) { + obj := &FormSubmissionRisk{} + var fernTestValueAssessmentID *string + obj.SetAssessmentID(fernTestValueAssessmentID) + assert.Equal(t, fernTestValueAssessmentID, obj.AssessmentID) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetDecision", func(t *testing.T) { + obj := &FormSubmissionRisk{} + var fernTestValueDecision *FormSubmissionRiskDecision + obj.SetDecision(fernTestValueDecision) + assert.Equal(t, fernTestValueDecision, obj.Decision) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetScore", func(t *testing.T) { + obj := &FormSubmissionRisk{} + var fernTestValueScore *float64 + obj.SetScore(fernTestValueScore) + assert.Equal(t, fernTestValueScore, obj.Score) + assert.NotNil(t, obj.explicitFields) + }) + +} + +func TestGettersFormSubmissionRisk(t *testing.T) { + t.Run("GetAssessmentID", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookEndpoint{} - var fernTestValueFailingSince *time.Time + obj := &FormSubmissionRisk{} + var expected *string + obj.AssessmentID = expected - // Act - obj.SetFailingSince(fernTestValueFailingSince) + // Act & Assert + assert.Equal(t, expected, obj.GetAssessmentID(), "getter should return the property value") + }) - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") + t.Run("GetAssessmentID_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &FormSubmissionRisk{} + obj.AssessmentID = nil - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } + // Act & Assert + assert.Nil(t, obj.GetAssessmentID(), "getter should return nil when property is nil") + }) - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip + t.Run("GetAssessmentID_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *FormSubmissionRisk + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetAssessmentID() // Should return zero value }) - t.Run("SetPreviousSecretExpiresAt_MarksExplicit", func(t *testing.T) { + t.Run("GetDecision", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookEndpoint{} - var fernTestValuePreviousSecretExpiresAt *time.Time + obj := &FormSubmissionRisk{} + var expected *FormSubmissionRiskDecision + obj.Decision = expected - // Act - obj.SetPreviousSecretExpiresAt(fernTestValuePreviousSecretExpiresAt) + // Act & Assert + assert.Equal(t, expected, obj.GetDecision(), "getter should return the property value") + }) - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") + t.Run("GetDecision_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &FormSubmissionRisk{} + obj.Decision = nil - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } + // Act & Assert + assert.Nil(t, obj.GetDecision(), "getter should return nil when property is nil") + }) - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip + t.Run("GetDecision_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *FormSubmissionRisk + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetDecision() // Should return zero value }) - t.Run("SetMetadata_MarksExplicit", func(t *testing.T) { + t.Run("GetScore", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookEndpoint{} - var fernTestValueMetadata map[string]string + obj := &FormSubmissionRisk{} + var expected *float64 + obj.Score = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetScore(), "getter should return the property value") + }) + + t.Run("GetScore_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &FormSubmissionRisk{} + obj.Score = nil + + // Act & Assert + assert.Nil(t, obj.GetScore(), "getter should return nil when property is nil") + }) + + t.Run("GetScore_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *FormSubmissionRisk + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetScore() // Should return zero value + }) + +} + +func TestSettersMarkExplicitFormSubmissionRisk(t *testing.T) { + t.Run("SetAssessmentID_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &FormSubmissionRisk{} + var fernTestValueAssessmentID *string // Act - obj.SetMetadata(fernTestValueMetadata) + obj.SetAssessmentID(fernTestValueAssessmentID) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -46687,14 +45039,14 @@ func TestSettersMarkExplicitHookEndpoint(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetCreatedAt_MarksExplicit", func(t *testing.T) { + t.Run("SetDecision_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookEndpoint{} - var fernTestValueCreatedAt time.Time + obj := &FormSubmissionRisk{} + var fernTestValueDecision *FormSubmissionRiskDecision // Act - obj.SetCreatedAt(fernTestValueCreatedAt) + obj.SetDecision(fernTestValueDecision) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -46718,14 +45070,14 @@ func TestSettersMarkExplicitHookEndpoint(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetUpdatedAt_MarksExplicit", func(t *testing.T) { + t.Run("SetScore_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookEndpoint{} - var fernTestValueUpdatedAt time.Time + obj := &FormSubmissionRisk{} + var fernTestValueScore *float64 // Act - obj.SetUpdatedAt(fernTestValueUpdatedAt) + obj.SetScore(fernTestValueScore) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -46751,48 +45103,511 @@ func TestSettersMarkExplicitHookEndpoint(t *testing.T) { } -func TestSettersHookEndpointList(t *testing.T) { +func TestSettersHookApplication(t *testing.T) { t.Run("SetObject", func(t *testing.T) { - obj := &HookEndpointList{} - var fernTestValueObject HookEndpointListObject + obj := &HookApplication{} + var fernTestValueObject HookApplicationObject obj.SetObject(fernTestValueObject) assert.Equal(t, fernTestValueObject, obj.Object) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetData", func(t *testing.T) { - obj := &HookEndpointList{} - var fernTestValueData []*HookEndpoint - obj.SetData(fernTestValueData) - assert.Equal(t, fernTestValueData, obj.Data) + t.Run("SetID", func(t *testing.T) { + obj := &HookApplication{} + var fernTestValueID string + obj.SetID(fernTestValueID) + assert.Equal(t, fernTestValueID, obj.ID) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetHasMore", func(t *testing.T) { - obj := &HookEndpointList{} - var fernTestValueHasMore bool - obj.SetHasMore(fernTestValueHasMore) - assert.Equal(t, fernTestValueHasMore, obj.HasMore) + t.Run("SetUID", func(t *testing.T) { + obj := &HookApplication{} + var fernTestValueUID *string + obj.SetUID(fernTestValueUID) + assert.Equal(t, fernTestValueUID, obj.UID) assert.NotNil(t, obj.explicitFields) }) -} - -func TestGettersHookEndpointList(t *testing.T) { - t.Run("GetObject", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &HookEndpointList{} - var expected HookEndpointListObject - obj.Object = expected + t.Run("SetName", func(t *testing.T) { + obj := &HookApplication{} + var fernTestValueName string + obj.SetName(fernTestValueName) + assert.Equal(t, fernTestValueName, obj.Name) + assert.NotNil(t, obj.explicitFields) + }) - // Act & Assert - assert.Equal(t, expected, obj.GetObject(), "getter should return the property value") + t.Run("SetMetadata", func(t *testing.T) { + obj := &HookApplication{} + var fernTestValueMetadata map[string]string + obj.SetMetadata(fernTestValueMetadata) + assert.Equal(t, fernTestValueMetadata, obj.Metadata) + assert.NotNil(t, obj.explicitFields) }) - t.Run("GetObject_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *HookEndpointList + t.Run("SetCreatedAt", func(t *testing.T) { + obj := &HookApplication{} + var fernTestValueCreatedAt time.Time + obj.SetCreatedAt(fernTestValueCreatedAt) + assert.Equal(t, fernTestValueCreatedAt, obj.CreatedAt) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetUpdatedAt", func(t *testing.T) { + obj := &HookApplication{} + var fernTestValueUpdatedAt time.Time + obj.SetUpdatedAt(fernTestValueUpdatedAt) + assert.Equal(t, fernTestValueUpdatedAt, obj.UpdatedAt) + assert.NotNil(t, obj.explicitFields) + }) + +} + +func TestGettersHookApplication(t *testing.T) { + t.Run("GetObject", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &HookApplication{} + var expected HookApplicationObject + obj.Object = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetObject(), "getter should return the property value") + }) + + t.Run("GetObject_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *HookApplication + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetObject() // Should return zero value + }) + + t.Run("GetID", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &HookApplication{} + var expected string + obj.ID = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetID(), "getter should return the property value") + }) + + t.Run("GetID_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *HookApplication + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetID() // Should return zero value + }) + + t.Run("GetUID", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &HookApplication{} + var expected *string + obj.UID = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetUID(), "getter should return the property value") + }) + + t.Run("GetUID_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &HookApplication{} + obj.UID = nil + + // Act & Assert + assert.Nil(t, obj.GetUID(), "getter should return nil when property is nil") + }) + + t.Run("GetUID_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *HookApplication + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetUID() // Should return zero value + }) + + t.Run("GetName", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &HookApplication{} + var expected string + obj.Name = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetName(), "getter should return the property value") + }) + + t.Run("GetName_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *HookApplication + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetName() // Should return zero value + }) + + t.Run("GetMetadata", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &HookApplication{} + var expected map[string]string + obj.Metadata = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetMetadata(), "getter should return the property value") + }) + + t.Run("GetMetadata_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &HookApplication{} + obj.Metadata = nil + + // Act & Assert + assert.Nil(t, obj.GetMetadata(), "getter should return nil when property is nil") + }) + + t.Run("GetMetadata_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *HookApplication + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetMetadata() // Should return zero value + }) + + t.Run("GetCreatedAt", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &HookApplication{} + var expected time.Time + obj.CreatedAt = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetCreatedAt(), "getter should return the property value") + }) + + t.Run("GetCreatedAt_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *HookApplication + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetCreatedAt() // Should return zero value + }) + + t.Run("GetUpdatedAt", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &HookApplication{} + var expected time.Time + obj.UpdatedAt = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetUpdatedAt(), "getter should return the property value") + }) + + t.Run("GetUpdatedAt_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *HookApplication + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetUpdatedAt() // Should return zero value + }) + +} + +func TestSettersMarkExplicitHookApplication(t *testing.T) { + t.Run("SetObject_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &HookApplication{} + var fernTestValueObject HookApplicationObject + + // Act + obj.SetObject(fernTestValueObject) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetID_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &HookApplication{} + var fernTestValueID string + + // Act + obj.SetID(fernTestValueID) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetUID_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &HookApplication{} + var fernTestValueUID *string + + // Act + obj.SetUID(fernTestValueUID) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetName_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &HookApplication{} + var fernTestValueName string + + // Act + obj.SetName(fernTestValueName) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetMetadata_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &HookApplication{} + var fernTestValueMetadata map[string]string + + // Act + obj.SetMetadata(fernTestValueMetadata) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetCreatedAt_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &HookApplication{} + var fernTestValueCreatedAt time.Time + + // Act + obj.SetCreatedAt(fernTestValueCreatedAt) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetUpdatedAt_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &HookApplication{} + var fernTestValueUpdatedAt time.Time + + // Act + obj.SetUpdatedAt(fernTestValueUpdatedAt) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + +} + +func TestSettersHookApplicationList(t *testing.T) { + t.Run("SetObject", func(t *testing.T) { + obj := &HookApplicationList{} + var fernTestValueObject HookApplicationListObject + obj.SetObject(fernTestValueObject) + assert.Equal(t, fernTestValueObject, obj.Object) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetData", func(t *testing.T) { + obj := &HookApplicationList{} + var fernTestValueData []*HookApplication + obj.SetData(fernTestValueData) + assert.Equal(t, fernTestValueData, obj.Data) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetHasMore", func(t *testing.T) { + obj := &HookApplicationList{} + var fernTestValueHasMore bool + obj.SetHasMore(fernTestValueHasMore) + assert.Equal(t, fernTestValueHasMore, obj.HasMore) + assert.NotNil(t, obj.explicitFields) + }) + +} + +func TestGettersHookApplicationList(t *testing.T) { + t.Run("GetObject", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &HookApplicationList{} + var expected HookApplicationListObject + obj.Object = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetObject(), "getter should return the property value") + }) + + t.Run("GetObject_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *HookApplicationList // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -46805,8 +45620,8 @@ func TestGettersHookEndpointList(t *testing.T) { t.Run("GetData", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookEndpointList{} - var expected []*HookEndpoint + obj := &HookApplicationList{} + var expected []*HookApplication obj.Data = expected // Act & Assert @@ -46816,7 +45631,7 @@ func TestGettersHookEndpointList(t *testing.T) { t.Run("GetData_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookEndpointList{} + obj := &HookApplicationList{} obj.Data = nil // Act & Assert @@ -46825,7 +45640,7 @@ func TestGettersHookEndpointList(t *testing.T) { t.Run("GetData_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *HookEndpointList + var obj *HookApplicationList // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -46838,7 +45653,7 @@ func TestGettersHookEndpointList(t *testing.T) { t.Run("GetHasMore", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookEndpointList{} + obj := &HookApplicationList{} var expected bool obj.HasMore = expected @@ -46848,7 +45663,7 @@ func TestGettersHookEndpointList(t *testing.T) { t.Run("GetHasMore_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *HookEndpointList + var obj *HookApplicationList // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -46860,12 +45675,12 @@ func TestGettersHookEndpointList(t *testing.T) { } -func TestSettersMarkExplicitHookEndpointList(t *testing.T) { +func TestSettersMarkExplicitHookApplicationList(t *testing.T) { t.Run("SetObject_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookEndpointList{} - var fernTestValueObject HookEndpointListObject + obj := &HookApplicationList{} + var fernTestValueObject HookApplicationListObject // Act obj.SetObject(fernTestValueObject) @@ -46895,8 +45710,8 @@ func TestSettersMarkExplicitHookEndpointList(t *testing.T) { t.Run("SetData_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookEndpointList{} - var fernTestValueData []*HookEndpoint + obj := &HookApplicationList{} + var fernTestValueData []*HookApplication // Act obj.SetData(fernTestValueData) @@ -46926,7 +45741,7 @@ func TestSettersMarkExplicitHookEndpointList(t *testing.T) { t.Run("SetHasMore_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookEndpointList{} + obj := &HookApplicationList{} var fernTestValueHasMore bool // Act @@ -46956,87 +45771,87 @@ func TestSettersMarkExplicitHookEndpointList(t *testing.T) { } -func TestSettersHookEndpointRecovery(t *testing.T) { +func TestSettersHookAttempt(t *testing.T) { t.Run("SetObject", func(t *testing.T) { - obj := &HookEndpointRecovery{} - var fernTestValueObject HookEndpointRecoveryObject + obj := &HookAttempt{} + var fernTestValueObject HookAttemptObject obj.SetObject(fernTestValueObject) assert.Equal(t, fernTestValueObject, obj.Object) assert.NotNil(t, obj.explicitFields) }) t.Run("SetID", func(t *testing.T) { - obj := &HookEndpointRecovery{} + obj := &HookAttempt{} var fernTestValueID string obj.SetID(fernTestValueID) assert.Equal(t, fernTestValueID, obj.ID) assert.NotNil(t, obj.explicitFields) }) + t.Run("SetDeliveryID", func(t *testing.T) { + obj := &HookAttempt{} + var fernTestValueDeliveryID string + obj.SetDeliveryID(fernTestValueDeliveryID) + assert.Equal(t, fernTestValueDeliveryID, obj.DeliveryID) + assert.NotNil(t, obj.explicitFields) + }) + t.Run("SetEndpointID", func(t *testing.T) { - obj := &HookEndpointRecovery{} + obj := &HookAttempt{} var fernTestValueEndpointID string obj.SetEndpointID(fernTestValueEndpointID) assert.Equal(t, fernTestValueEndpointID, obj.EndpointID) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetSince", func(t *testing.T) { - obj := &HookEndpointRecovery{} - var fernTestValueSince time.Time - obj.SetSince(fernTestValueSince) - assert.Equal(t, fernTestValueSince, obj.Since) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetUntil", func(t *testing.T) { - obj := &HookEndpointRecovery{} - var fernTestValueUntil time.Time - obj.SetUntil(fernTestValueUntil) - assert.Equal(t, fernTestValueUntil, obj.Until) + t.Run("SetAttemptedAt", func(t *testing.T) { + obj := &HookAttempt{} + var fernTestValueAttemptedAt time.Time + obj.SetAttemptedAt(fernTestValueAttemptedAt) + assert.Equal(t, fernTestValueAttemptedAt, obj.AttemptedAt) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetStatus", func(t *testing.T) { - obj := &HookEndpointRecovery{} - var fernTestValueStatus HookEndpointRecoveryStatus - obj.SetStatus(fernTestValueStatus) - assert.Equal(t, fernTestValueStatus, obj.Status) + t.Run("SetStatusCode", func(t *testing.T) { + obj := &HookAttempt{} + var fernTestValueStatusCode *int64 + obj.SetStatusCode(fernTestValueStatusCode) + assert.Equal(t, fernTestValueStatusCode, obj.StatusCode) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetRequeued", func(t *testing.T) { - obj := &HookEndpointRecovery{} - var fernTestValueRequeued int64 - obj.SetRequeued(fernTestValueRequeued) - assert.Equal(t, fernTestValueRequeued, obj.Requeued) + t.Run("SetDurationMs", func(t *testing.T) { + obj := &HookAttempt{} + var fernTestValueDurationMs int64 + obj.SetDurationMs(fernTestValueDurationMs) + assert.Equal(t, fernTestValueDurationMs, obj.DurationMs) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetCreatedAt", func(t *testing.T) { - obj := &HookEndpointRecovery{} - var fernTestValueCreatedAt time.Time - obj.SetCreatedAt(fernTestValueCreatedAt) - assert.Equal(t, fernTestValueCreatedAt, obj.CreatedAt) + t.Run("SetError", func(t *testing.T) { + obj := &HookAttempt{} + var fernTestValueError *string + obj.SetError(fernTestValueError) + assert.Equal(t, fernTestValueError, obj.Error) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetCompletedAt", func(t *testing.T) { - obj := &HookEndpointRecovery{} - var fernTestValueCompletedAt *time.Time - obj.SetCompletedAt(fernTestValueCompletedAt) - assert.Equal(t, fernTestValueCompletedAt, obj.CompletedAt) + t.Run("SetResponseExcerpt", func(t *testing.T) { + obj := &HookAttempt{} + var fernTestValueResponseExcerpt *string + obj.SetResponseExcerpt(fernTestValueResponseExcerpt) + assert.Equal(t, fernTestValueResponseExcerpt, obj.ResponseExcerpt) assert.NotNil(t, obj.explicitFields) }) } -func TestGettersHookEndpointRecovery(t *testing.T) { +func TestGettersHookAttempt(t *testing.T) { t.Run("GetObject", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookEndpointRecovery{} - var expected HookEndpointRecoveryObject + obj := &HookAttempt{} + var expected HookAttemptObject obj.Object = expected // Act & Assert @@ -47045,7 +45860,7 @@ func TestGettersHookEndpointRecovery(t *testing.T) { t.Run("GetObject_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *HookEndpointRecovery + var obj *HookAttempt // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -47058,7 +45873,7 @@ func TestGettersHookEndpointRecovery(t *testing.T) { t.Run("GetID", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookEndpointRecovery{} + obj := &HookAttempt{} var expected string obj.ID = expected @@ -47068,7 +45883,7 @@ func TestGettersHookEndpointRecovery(t *testing.T) { t.Run("GetID_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *HookEndpointRecovery + var obj *HookAttempt // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -47078,185 +45893,205 @@ func TestGettersHookEndpointRecovery(t *testing.T) { _ = obj.GetID() // Should return zero value }) - t.Run("GetEndpointID", func(t *testing.T) { + t.Run("GetDeliveryID", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookEndpointRecovery{} + obj := &HookAttempt{} var expected string - obj.EndpointID = expected + obj.DeliveryID = expected // Act & Assert - assert.Equal(t, expected, obj.GetEndpointID(), "getter should return the property value") + assert.Equal(t, expected, obj.GetDeliveryID(), "getter should return the property value") }) - t.Run("GetEndpointID_NilReceiver", func(t *testing.T) { + t.Run("GetDeliveryID_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *HookEndpointRecovery + var obj *HookAttempt // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetEndpointID() // Should return zero value + _ = obj.GetDeliveryID() // Should return zero value }) - t.Run("GetSince", func(t *testing.T) { + t.Run("GetEndpointID", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookEndpointRecovery{} - var expected time.Time - obj.Since = expected + obj := &HookAttempt{} + var expected string + obj.EndpointID = expected // Act & Assert - assert.Equal(t, expected, obj.GetSince(), "getter should return the property value") + assert.Equal(t, expected, obj.GetEndpointID(), "getter should return the property value") }) - t.Run("GetSince_NilReceiver", func(t *testing.T) { + t.Run("GetEndpointID_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *HookEndpointRecovery + var obj *HookAttempt // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetSince() // Should return zero value + _ = obj.GetEndpointID() // Should return zero value }) - t.Run("GetUntil", func(t *testing.T) { + t.Run("GetAttemptedAt", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookEndpointRecovery{} + obj := &HookAttempt{} var expected time.Time - obj.Until = expected + obj.AttemptedAt = expected // Act & Assert - assert.Equal(t, expected, obj.GetUntil(), "getter should return the property value") + assert.Equal(t, expected, obj.GetAttemptedAt(), "getter should return the property value") }) - t.Run("GetUntil_NilReceiver", func(t *testing.T) { + t.Run("GetAttemptedAt_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *HookEndpointRecovery + var obj *HookAttempt // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetUntil() // Should return zero value + _ = obj.GetAttemptedAt() // Should return zero value }) - t.Run("GetStatus", func(t *testing.T) { + t.Run("GetStatusCode", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookEndpointRecovery{} - var expected HookEndpointRecoveryStatus - obj.Status = expected + obj := &HookAttempt{} + var expected *int64 + obj.StatusCode = expected // Act & Assert - assert.Equal(t, expected, obj.GetStatus(), "getter should return the property value") + assert.Equal(t, expected, obj.GetStatusCode(), "getter should return the property value") }) - t.Run("GetStatus_NilReceiver", func(t *testing.T) { + t.Run("GetStatusCode_NilValue", func(t *testing.T) { t.Parallel() - var obj *HookEndpointRecovery + // Arrange + obj := &HookAttempt{} + obj.StatusCode = nil + + // Act & Assert + assert.Nil(t, obj.GetStatusCode(), "getter should return nil when property is nil") + }) + + t.Run("GetStatusCode_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *HookAttempt // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetStatus() // Should return zero value + _ = obj.GetStatusCode() // Should return zero value }) - t.Run("GetRequeued", func(t *testing.T) { + t.Run("GetDurationMs", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookEndpointRecovery{} + obj := &HookAttempt{} var expected int64 - obj.Requeued = expected + obj.DurationMs = expected // Act & Assert - assert.Equal(t, expected, obj.GetRequeued(), "getter should return the property value") + assert.Equal(t, expected, obj.GetDurationMs(), "getter should return the property value") }) - t.Run("GetRequeued_NilReceiver", func(t *testing.T) { + t.Run("GetDurationMs_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *HookEndpointRecovery + var obj *HookAttempt // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetRequeued() // Should return zero value + _ = obj.GetDurationMs() // Should return zero value }) - t.Run("GetCreatedAt", func(t *testing.T) { + t.Run("GetError", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookEndpointRecovery{} - var expected time.Time - obj.CreatedAt = expected + obj := &HookAttempt{} + var expected *string + obj.Error = expected // Act & Assert - assert.Equal(t, expected, obj.GetCreatedAt(), "getter should return the property value") + assert.Equal(t, expected, obj.GetError(), "getter should return the property value") }) - t.Run("GetCreatedAt_NilReceiver", func(t *testing.T) { + t.Run("GetError_NilValue", func(t *testing.T) { t.Parallel() - var obj *HookEndpointRecovery + // Arrange + obj := &HookAttempt{} + obj.Error = nil + + // Act & Assert + assert.Nil(t, obj.GetError(), "getter should return nil when property is nil") + }) + + t.Run("GetError_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *HookAttempt // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetCreatedAt() // Should return zero value + _ = obj.GetError() // Should return zero value }) - t.Run("GetCompletedAt", func(t *testing.T) { + t.Run("GetResponseExcerpt", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookEndpointRecovery{} - var expected *time.Time - obj.CompletedAt = expected + obj := &HookAttempt{} + var expected *string + obj.ResponseExcerpt = expected // Act & Assert - assert.Equal(t, expected, obj.GetCompletedAt(), "getter should return the property value") + assert.Equal(t, expected, obj.GetResponseExcerpt(), "getter should return the property value") }) - t.Run("GetCompletedAt_NilValue", func(t *testing.T) { + t.Run("GetResponseExcerpt_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookEndpointRecovery{} - obj.CompletedAt = nil + obj := &HookAttempt{} + obj.ResponseExcerpt = nil // Act & Assert - assert.Nil(t, obj.GetCompletedAt(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetResponseExcerpt(), "getter should return nil when property is nil") }) - t.Run("GetCompletedAt_NilReceiver", func(t *testing.T) { + t.Run("GetResponseExcerpt_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *HookEndpointRecovery + var obj *HookAttempt // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetCompletedAt() // Should return zero value + _ = obj.GetResponseExcerpt() // Should return zero value }) } -func TestSettersMarkExplicitHookEndpointRecovery(t *testing.T) { +func TestSettersMarkExplicitHookAttempt(t *testing.T) { t.Run("SetObject_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookEndpointRecovery{} - var fernTestValueObject HookEndpointRecoveryObject + obj := &HookAttempt{} + var fernTestValueObject HookAttemptObject // Act obj.SetObject(fernTestValueObject) @@ -47286,7 +46121,7 @@ func TestSettersMarkExplicitHookEndpointRecovery(t *testing.T) { t.Run("SetID_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookEndpointRecovery{} + obj := &HookAttempt{} var fernTestValueID string // Act @@ -47314,14 +46149,14 @@ func TestSettersMarkExplicitHookEndpointRecovery(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetEndpointID_MarksExplicit", func(t *testing.T) { + t.Run("SetDeliveryID_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookEndpointRecovery{} - var fernTestValueEndpointID string + obj := &HookAttempt{} + var fernTestValueDeliveryID string // Act - obj.SetEndpointID(fernTestValueEndpointID) + obj.SetDeliveryID(fernTestValueDeliveryID) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -47345,14 +46180,14 @@ func TestSettersMarkExplicitHookEndpointRecovery(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetSince_MarksExplicit", func(t *testing.T) { + t.Run("SetEndpointID_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookEndpointRecovery{} - var fernTestValueSince time.Time + obj := &HookAttempt{} + var fernTestValueEndpointID string // Act - obj.SetSince(fernTestValueSince) + obj.SetEndpointID(fernTestValueEndpointID) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -47376,14 +46211,14 @@ func TestSettersMarkExplicitHookEndpointRecovery(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetUntil_MarksExplicit", func(t *testing.T) { + t.Run("SetAttemptedAt_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookEndpointRecovery{} - var fernTestValueUntil time.Time + obj := &HookAttempt{} + var fernTestValueAttemptedAt time.Time // Act - obj.SetUntil(fernTestValueUntil) + obj.SetAttemptedAt(fernTestValueAttemptedAt) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -47407,14 +46242,14 @@ func TestSettersMarkExplicitHookEndpointRecovery(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetStatus_MarksExplicit", func(t *testing.T) { + t.Run("SetStatusCode_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookEndpointRecovery{} - var fernTestValueStatus HookEndpointRecoveryStatus + obj := &HookAttempt{} + var fernTestValueStatusCode *int64 // Act - obj.SetStatus(fernTestValueStatus) + obj.SetStatusCode(fernTestValueStatusCode) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -47438,14 +46273,14 @@ func TestSettersMarkExplicitHookEndpointRecovery(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetRequeued_MarksExplicit", func(t *testing.T) { + t.Run("SetDurationMs_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookEndpointRecovery{} - var fernTestValueRequeued int64 + obj := &HookAttempt{} + var fernTestValueDurationMs int64 // Act - obj.SetRequeued(fernTestValueRequeued) + obj.SetDurationMs(fernTestValueDurationMs) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -47469,14 +46304,14 @@ func TestSettersMarkExplicitHookEndpointRecovery(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetCreatedAt_MarksExplicit", func(t *testing.T) { + t.Run("SetError_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookEndpointRecovery{} - var fernTestValueCreatedAt time.Time + obj := &HookAttempt{} + var fernTestValueError *string // Act - obj.SetCreatedAt(fernTestValueCreatedAt) + obj.SetError(fernTestValueError) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -47500,14 +46335,14 @@ func TestSettersMarkExplicitHookEndpointRecovery(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetCompletedAt_MarksExplicit", func(t *testing.T) { + t.Run("SetResponseExcerpt_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookEndpointRecovery{} - var fernTestValueCompletedAt *time.Time + obj := &HookAttempt{} + var fernTestValueResponseExcerpt *string // Act - obj.SetCompletedAt(fernTestValueCompletedAt) + obj.SetResponseExcerpt(fernTestValueResponseExcerpt) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -47533,31 +46368,39 @@ func TestSettersMarkExplicitHookEndpointRecovery(t *testing.T) { } -func TestSettersHookEndpointSecret(t *testing.T) { +func TestSettersHookAttemptList(t *testing.T) { t.Run("SetObject", func(t *testing.T) { - obj := &HookEndpointSecret{} - var fernTestValueObject HookEndpointSecretObject + obj := &HookAttemptList{} + var fernTestValueObject HookAttemptListObject obj.SetObject(fernTestValueObject) assert.Equal(t, fernTestValueObject, obj.Object) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetSecret", func(t *testing.T) { - obj := &HookEndpointSecret{} - var fernTestValueSecret string - obj.SetSecret(fernTestValueSecret) - assert.Equal(t, fernTestValueSecret, obj.Secret) + t.Run("SetData", func(t *testing.T) { + obj := &HookAttemptList{} + var fernTestValueData []*HookAttempt + obj.SetData(fernTestValueData) + assert.Equal(t, fernTestValueData, obj.Data) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetHasMore", func(t *testing.T) { + obj := &HookAttemptList{} + var fernTestValueHasMore bool + obj.SetHasMore(fernTestValueHasMore) + assert.Equal(t, fernTestValueHasMore, obj.HasMore) assert.NotNil(t, obj.explicitFields) }) } -func TestGettersHookEndpointSecret(t *testing.T) { +func TestGettersHookAttemptList(t *testing.T) { t.Run("GetObject", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookEndpointSecret{} - var expected HookEndpointSecretObject + obj := &HookAttemptList{} + var expected HookAttemptListObject obj.Object = expected // Act & Assert @@ -47566,7 +46409,7 @@ func TestGettersHookEndpointSecret(t *testing.T) { t.Run("GetObject_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *HookEndpointSecret + var obj *HookAttemptList // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -47576,37 +46419,70 @@ func TestGettersHookEndpointSecret(t *testing.T) { _ = obj.GetObject() // Should return zero value }) - t.Run("GetSecret", func(t *testing.T) { + t.Run("GetData", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookEndpointSecret{} - var expected string - obj.Secret = expected + obj := &HookAttemptList{} + var expected []*HookAttempt + obj.Data = expected // Act & Assert - assert.Equal(t, expected, obj.GetSecret(), "getter should return the property value") + assert.Equal(t, expected, obj.GetData(), "getter should return the property value") }) - t.Run("GetSecret_NilReceiver", func(t *testing.T) { + t.Run("GetData_NilValue", func(t *testing.T) { t.Parallel() - var obj *HookEndpointSecret + // Arrange + obj := &HookAttemptList{} + obj.Data = nil + + // Act & Assert + assert.Nil(t, obj.GetData(), "getter should return nil when property is nil") + }) + + t.Run("GetData_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *HookAttemptList // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetSecret() // Should return zero value + _ = obj.GetData() // Should return zero value + }) + + t.Run("GetHasMore", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &HookAttemptList{} + var expected bool + obj.HasMore = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetHasMore(), "getter should return the property value") + }) + + t.Run("GetHasMore_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *HookAttemptList + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetHasMore() // Should return zero value }) } -func TestSettersMarkExplicitHookEndpointSecret(t *testing.T) { +func TestSettersMarkExplicitHookAttemptList(t *testing.T) { t.Run("SetObject_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookEndpointSecret{} - var fernTestValueObject HookEndpointSecretObject + obj := &HookAttemptList{} + var fernTestValueObject HookAttemptListObject // Act obj.SetObject(fernTestValueObject) @@ -47633,14 +46509,45 @@ func TestSettersMarkExplicitHookEndpointSecret(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetSecret_MarksExplicit", func(t *testing.T) { + t.Run("SetData_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookEndpointSecret{} - var fernTestValueSecret string + obj := &HookAttemptList{} + var fernTestValueData []*HookAttempt // Act - obj.SetSecret(fernTestValueSecret) + obj.SetData(fernTestValueData) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetHasMore_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &HookAttemptList{} + var fernTestValueHasMore bool + + // Act + obj.SetHasMore(fernTestValueHasMore) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -47666,17 +46573,17 @@ func TestSettersMarkExplicitHookEndpointSecret(t *testing.T) { } -func TestSettersHookEndpointWithSecret(t *testing.T) { +func TestSettersHookDelivery(t *testing.T) { t.Run("SetObject", func(t *testing.T) { - obj := &HookEndpointWithSecret{} - var fernTestValueObject HookEndpointWithSecretObject + obj := &HookDelivery{} + var fernTestValueObject HookDeliveryObject obj.SetObject(fernTestValueObject) assert.Equal(t, fernTestValueObject, obj.Object) assert.NotNil(t, obj.explicitFields) }) t.Run("SetID", func(t *testing.T) { - obj := &HookEndpointWithSecret{} + obj := &HookDelivery{} var fernTestValueID string obj.SetID(fernTestValueID) assert.Equal(t, fernTestValueID, obj.ID) @@ -47684,125 +46591,93 @@ func TestSettersHookEndpointWithSecret(t *testing.T) { }) t.Run("SetApplicationID", func(t *testing.T) { - obj := &HookEndpointWithSecret{} + obj := &HookDelivery{} var fernTestValueApplicationID string obj.SetApplicationID(fernTestValueApplicationID) assert.Equal(t, fernTestValueApplicationID, obj.ApplicationID) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetURL", func(t *testing.T) { - obj := &HookEndpointWithSecret{} - var fernTestValueURL string - obj.SetURL(fernTestValueURL) - assert.Equal(t, fernTestValueURL, obj.URL) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetDescription", func(t *testing.T) { - obj := &HookEndpointWithSecret{} - var fernTestValueDescription *string - obj.SetDescription(fernTestValueDescription) - assert.Equal(t, fernTestValueDescription, obj.Description) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetFilterTypes", func(t *testing.T) { - obj := &HookEndpointWithSecret{} - var fernTestValueFilterTypes []string - obj.SetFilterTypes(fernTestValueFilterTypes) - assert.Equal(t, fernTestValueFilterTypes, obj.FilterTypes) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetRateLimitPerSecond", func(t *testing.T) { - obj := &HookEndpointWithSecret{} - var fernTestValueRateLimitPerSecond *int64 - obj.SetRateLimitPerSecond(fernTestValueRateLimitPerSecond) - assert.Equal(t, fernTestValueRateLimitPerSecond, obj.RateLimitPerSecond) + t.Run("SetMessageID", func(t *testing.T) { + obj := &HookDelivery{} + var fernTestValueMessageID string + obj.SetMessageID(fernTestValueMessageID) + assert.Equal(t, fernTestValueMessageID, obj.MessageID) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetEnabled", func(t *testing.T) { - obj := &HookEndpointWithSecret{} - var fernTestValueEnabled bool - obj.SetEnabled(fernTestValueEnabled) - assert.Equal(t, fernTestValueEnabled, obj.Enabled) + t.Run("SetEndpointID", func(t *testing.T) { + obj := &HookDelivery{} + var fernTestValueEndpointID string + obj.SetEndpointID(fernTestValueEndpointID) + assert.Equal(t, fernTestValueEndpointID, obj.EndpointID) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetDisabledReason", func(t *testing.T) { - obj := &HookEndpointWithSecret{} - var fernTestValueDisabledReason *HookEndpointWithSecretDisabledReason - obj.SetDisabledReason(fernTestValueDisabledReason) - assert.Equal(t, fernTestValueDisabledReason, obj.DisabledReason) + t.Run("SetStatus", func(t *testing.T) { + obj := &HookDelivery{} + var fernTestValueStatus HookDeliveryStatus + obj.SetStatus(fernTestValueStatus) + assert.Equal(t, fernTestValueStatus, obj.Status) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetDisabledAt", func(t *testing.T) { - obj := &HookEndpointWithSecret{} - var fernTestValueDisabledAt *time.Time - obj.SetDisabledAt(fernTestValueDisabledAt) - assert.Equal(t, fernTestValueDisabledAt, obj.DisabledAt) + t.Run("SetAttemptCount", func(t *testing.T) { + obj := &HookDelivery{} + var fernTestValueAttemptCount int64 + obj.SetAttemptCount(fernTestValueAttemptCount) + assert.Equal(t, fernTestValueAttemptCount, obj.AttemptCount) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetFailingSince", func(t *testing.T) { - obj := &HookEndpointWithSecret{} - var fernTestValueFailingSince *time.Time - obj.SetFailingSince(fernTestValueFailingSince) - assert.Equal(t, fernTestValueFailingSince, obj.FailingSince) + t.Run("SetNextAttemptAt", func(t *testing.T) { + obj := &HookDelivery{} + var fernTestValueNextAttemptAt *time.Time + obj.SetNextAttemptAt(fernTestValueNextAttemptAt) + assert.Equal(t, fernTestValueNextAttemptAt, obj.NextAttemptAt) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetPreviousSecretExpiresAt", func(t *testing.T) { - obj := &HookEndpointWithSecret{} - var fernTestValuePreviousSecretExpiresAt *time.Time - obj.SetPreviousSecretExpiresAt(fernTestValuePreviousSecretExpiresAt) - assert.Equal(t, fernTestValuePreviousSecretExpiresAt, obj.PreviousSecretExpiresAt) + t.Run("SetLastStatusCode", func(t *testing.T) { + obj := &HookDelivery{} + var fernTestValueLastStatusCode *int64 + obj.SetLastStatusCode(fernTestValueLastStatusCode) + assert.Equal(t, fernTestValueLastStatusCode, obj.LastStatusCode) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetMetadata", func(t *testing.T) { - obj := &HookEndpointWithSecret{} - var fernTestValueMetadata map[string]string - obj.SetMetadata(fernTestValueMetadata) - assert.Equal(t, fernTestValueMetadata, obj.Metadata) + t.Run("SetLastError", func(t *testing.T) { + obj := &HookDelivery{} + var fernTestValueLastError *string + obj.SetLastError(fernTestValueLastError) + assert.Equal(t, fernTestValueLastError, obj.LastError) assert.NotNil(t, obj.explicitFields) }) t.Run("SetCreatedAt", func(t *testing.T) { - obj := &HookEndpointWithSecret{} + obj := &HookDelivery{} var fernTestValueCreatedAt time.Time obj.SetCreatedAt(fernTestValueCreatedAt) assert.Equal(t, fernTestValueCreatedAt, obj.CreatedAt) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetUpdatedAt", func(t *testing.T) { - obj := &HookEndpointWithSecret{} - var fernTestValueUpdatedAt time.Time - obj.SetUpdatedAt(fernTestValueUpdatedAt) - assert.Equal(t, fernTestValueUpdatedAt, obj.UpdatedAt) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetSecret", func(t *testing.T) { - obj := &HookEndpointWithSecret{} - var fernTestValueSecret string - obj.SetSecret(fernTestValueSecret) - assert.Equal(t, fernTestValueSecret, obj.Secret) + t.Run("SetFinishedAt", func(t *testing.T) { + obj := &HookDelivery{} + var fernTestValueFinishedAt *time.Time + obj.SetFinishedAt(fernTestValueFinishedAt) + assert.Equal(t, fernTestValueFinishedAt, obj.FinishedAt) assert.NotNil(t, obj.explicitFields) }) } -func TestGettersHookEndpointWithSecret(t *testing.T) { +func TestGettersHookDelivery(t *testing.T) { t.Run("GetObject", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookEndpointWithSecret{} - var expected HookEndpointWithSecretObject + obj := &HookDelivery{} + var expected HookDeliveryObject obj.Object = expected // Act & Assert @@ -47811,7 +46686,7 @@ func TestGettersHookEndpointWithSecret(t *testing.T) { t.Run("GetObject_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *HookEndpointWithSecret + var obj *HookDelivery // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -47824,7 +46699,7 @@ func TestGettersHookEndpointWithSecret(t *testing.T) { t.Run("GetID", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookEndpointWithSecret{} + obj := &HookDelivery{} var expected string obj.ID = expected @@ -47834,7 +46709,7 @@ func TestGettersHookEndpointWithSecret(t *testing.T) { t.Run("GetID_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *HookEndpointWithSecret + var obj *HookDelivery // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -47847,7 +46722,7 @@ func TestGettersHookEndpointWithSecret(t *testing.T) { t.Run("GetApplicationID", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookEndpointWithSecret{} + obj := &HookDelivery{} var expected string obj.ApplicationID = expected @@ -47857,7 +46732,7 @@ func TestGettersHookEndpointWithSecret(t *testing.T) { t.Run("GetApplicationID_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *HookEndpointWithSecret + var obj *HookDelivery // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -47867,320 +46742,201 @@ func TestGettersHookEndpointWithSecret(t *testing.T) { _ = obj.GetApplicationID() // Should return zero value }) - t.Run("GetURL", func(t *testing.T) { + t.Run("GetMessageID", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookEndpointWithSecret{} + obj := &HookDelivery{} var expected string - obj.URL = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetURL(), "getter should return the property value") - }) - - t.Run("GetURL_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *HookEndpointWithSecret - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetURL() // Should return zero value - }) - - t.Run("GetDescription", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &HookEndpointWithSecret{} - var expected *string - obj.Description = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetDescription(), "getter should return the property value") - }) - - t.Run("GetDescription_NilValue", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &HookEndpointWithSecret{} - obj.Description = nil - - // Act & Assert - assert.Nil(t, obj.GetDescription(), "getter should return nil when property is nil") - }) - - t.Run("GetDescription_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *HookEndpointWithSecret - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetDescription() // Should return zero value - }) - - t.Run("GetFilterTypes", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &HookEndpointWithSecret{} - var expected []string - obj.FilterTypes = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetFilterTypes(), "getter should return the property value") - }) - - t.Run("GetFilterTypes_NilValue", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &HookEndpointWithSecret{} - obj.FilterTypes = nil - - // Act & Assert - assert.Nil(t, obj.GetFilterTypes(), "getter should return nil when property is nil") - }) - - t.Run("GetFilterTypes_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *HookEndpointWithSecret - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetFilterTypes() // Should return zero value - }) - - t.Run("GetRateLimitPerSecond", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &HookEndpointWithSecret{} - var expected *int64 - obj.RateLimitPerSecond = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetRateLimitPerSecond(), "getter should return the property value") - }) - - t.Run("GetRateLimitPerSecond_NilValue", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &HookEndpointWithSecret{} - obj.RateLimitPerSecond = nil + obj.MessageID = expected // Act & Assert - assert.Nil(t, obj.GetRateLimitPerSecond(), "getter should return nil when property is nil") + assert.Equal(t, expected, obj.GetMessageID(), "getter should return the property value") }) - t.Run("GetRateLimitPerSecond_NilReceiver", func(t *testing.T) { + t.Run("GetMessageID_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *HookEndpointWithSecret + var obj *HookDelivery // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetRateLimitPerSecond() // Should return zero value + _ = obj.GetMessageID() // Should return zero value }) - t.Run("GetEnabled", func(t *testing.T) { + t.Run("GetEndpointID", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookEndpointWithSecret{} - var expected bool - obj.Enabled = expected + obj := &HookDelivery{} + var expected string + obj.EndpointID = expected // Act & Assert - assert.Equal(t, expected, obj.GetEnabled(), "getter should return the property value") + assert.Equal(t, expected, obj.GetEndpointID(), "getter should return the property value") }) - t.Run("GetEnabled_NilReceiver", func(t *testing.T) { + t.Run("GetEndpointID_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *HookEndpointWithSecret + var obj *HookDelivery // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetEnabled() // Should return zero value - }) - - t.Run("GetDisabledReason", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &HookEndpointWithSecret{} - var expected *HookEndpointWithSecretDisabledReason - obj.DisabledReason = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetDisabledReason(), "getter should return the property value") + _ = obj.GetEndpointID() // Should return zero value }) - t.Run("GetDisabledReason_NilValue", func(t *testing.T) { + t.Run("GetStatus", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookEndpointWithSecret{} - obj.DisabledReason = nil + obj := &HookDelivery{} + var expected HookDeliveryStatus + obj.Status = expected // Act & Assert - assert.Nil(t, obj.GetDisabledReason(), "getter should return nil when property is nil") + assert.Equal(t, expected, obj.GetStatus(), "getter should return the property value") }) - t.Run("GetDisabledReason_NilReceiver", func(t *testing.T) { + t.Run("GetStatus_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *HookEndpointWithSecret + var obj *HookDelivery // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetDisabledReason() // Should return zero value - }) - - t.Run("GetDisabledAt", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &HookEndpointWithSecret{} - var expected *time.Time - obj.DisabledAt = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetDisabledAt(), "getter should return the property value") + _ = obj.GetStatus() // Should return zero value }) - t.Run("GetDisabledAt_NilValue", func(t *testing.T) { + t.Run("GetAttemptCount", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookEndpointWithSecret{} - obj.DisabledAt = nil + obj := &HookDelivery{} + var expected int64 + obj.AttemptCount = expected // Act & Assert - assert.Nil(t, obj.GetDisabledAt(), "getter should return nil when property is nil") + assert.Equal(t, expected, obj.GetAttemptCount(), "getter should return the property value") }) - t.Run("GetDisabledAt_NilReceiver", func(t *testing.T) { + t.Run("GetAttemptCount_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *HookEndpointWithSecret + var obj *HookDelivery // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetDisabledAt() // Should return zero value + _ = obj.GetAttemptCount() // Should return zero value }) - t.Run("GetFailingSince", func(t *testing.T) { + t.Run("GetNextAttemptAt", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookEndpointWithSecret{} + obj := &HookDelivery{} var expected *time.Time - obj.FailingSince = expected + obj.NextAttemptAt = expected // Act & Assert - assert.Equal(t, expected, obj.GetFailingSince(), "getter should return the property value") + assert.Equal(t, expected, obj.GetNextAttemptAt(), "getter should return the property value") }) - t.Run("GetFailingSince_NilValue", func(t *testing.T) { + t.Run("GetNextAttemptAt_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookEndpointWithSecret{} - obj.FailingSince = nil + obj := &HookDelivery{} + obj.NextAttemptAt = nil // Act & Assert - assert.Nil(t, obj.GetFailingSince(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetNextAttemptAt(), "getter should return nil when property is nil") }) - t.Run("GetFailingSince_NilReceiver", func(t *testing.T) { + t.Run("GetNextAttemptAt_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *HookEndpointWithSecret + var obj *HookDelivery // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetFailingSince() // Should return zero value + _ = obj.GetNextAttemptAt() // Should return zero value }) - t.Run("GetPreviousSecretExpiresAt", func(t *testing.T) { + t.Run("GetLastStatusCode", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookEndpointWithSecret{} - var expected *time.Time - obj.PreviousSecretExpiresAt = expected + obj := &HookDelivery{} + var expected *int64 + obj.LastStatusCode = expected // Act & Assert - assert.Equal(t, expected, obj.GetPreviousSecretExpiresAt(), "getter should return the property value") + assert.Equal(t, expected, obj.GetLastStatusCode(), "getter should return the property value") }) - t.Run("GetPreviousSecretExpiresAt_NilValue", func(t *testing.T) { + t.Run("GetLastStatusCode_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookEndpointWithSecret{} - obj.PreviousSecretExpiresAt = nil + obj := &HookDelivery{} + obj.LastStatusCode = nil // Act & Assert - assert.Nil(t, obj.GetPreviousSecretExpiresAt(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetLastStatusCode(), "getter should return nil when property is nil") }) - t.Run("GetPreviousSecretExpiresAt_NilReceiver", func(t *testing.T) { + t.Run("GetLastStatusCode_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *HookEndpointWithSecret + var obj *HookDelivery // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetPreviousSecretExpiresAt() // Should return zero value + _ = obj.GetLastStatusCode() // Should return zero value }) - t.Run("GetMetadata", func(t *testing.T) { + t.Run("GetLastError", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookEndpointWithSecret{} - var expected map[string]string - obj.Metadata = expected + obj := &HookDelivery{} + var expected *string + obj.LastError = expected // Act & Assert - assert.Equal(t, expected, obj.GetMetadata(), "getter should return the property value") + assert.Equal(t, expected, obj.GetLastError(), "getter should return the property value") }) - t.Run("GetMetadata_NilValue", func(t *testing.T) { + t.Run("GetLastError_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookEndpointWithSecret{} - obj.Metadata = nil + obj := &HookDelivery{} + obj.LastError = nil // Act & Assert - assert.Nil(t, obj.GetMetadata(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetLastError(), "getter should return nil when property is nil") }) - t.Run("GetMetadata_NilReceiver", func(t *testing.T) { + t.Run("GetLastError_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *HookEndpointWithSecret + var obj *HookDelivery // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetMetadata() // Should return zero value + _ = obj.GetLastError() // Should return zero value }) t.Run("GetCreatedAt", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookEndpointWithSecret{} + obj := &HookDelivery{} var expected time.Time obj.CreatedAt = expected @@ -48190,7 +46946,7 @@ func TestGettersHookEndpointWithSecret(t *testing.T) { t.Run("GetCreatedAt_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *HookEndpointWithSecret + var obj *HookDelivery // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -48200,60 +46956,47 @@ func TestGettersHookEndpointWithSecret(t *testing.T) { _ = obj.GetCreatedAt() // Should return zero value }) - t.Run("GetUpdatedAt", func(t *testing.T) { + t.Run("GetFinishedAt", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookEndpointWithSecret{} - var expected time.Time - obj.UpdatedAt = expected + obj := &HookDelivery{} + var expected *time.Time + obj.FinishedAt = expected // Act & Assert - assert.Equal(t, expected, obj.GetUpdatedAt(), "getter should return the property value") - }) - - t.Run("GetUpdatedAt_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *HookEndpointWithSecret - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetUpdatedAt() // Should return zero value + assert.Equal(t, expected, obj.GetFinishedAt(), "getter should return the property value") }) - t.Run("GetSecret", func(t *testing.T) { + t.Run("GetFinishedAt_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookEndpointWithSecret{} - var expected string - obj.Secret = expected + obj := &HookDelivery{} + obj.FinishedAt = nil // Act & Assert - assert.Equal(t, expected, obj.GetSecret(), "getter should return the property value") + assert.Nil(t, obj.GetFinishedAt(), "getter should return nil when property is nil") }) - t.Run("GetSecret_NilReceiver", func(t *testing.T) { + t.Run("GetFinishedAt_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *HookEndpointWithSecret + var obj *HookDelivery // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetSecret() // Should return zero value + _ = obj.GetFinishedAt() // Should return zero value }) } -func TestSettersMarkExplicitHookEndpointWithSecret(t *testing.T) { +func TestSettersMarkExplicitHookDelivery(t *testing.T) { t.Run("SetObject_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookEndpointWithSecret{} - var fernTestValueObject HookEndpointWithSecretObject + obj := &HookDelivery{} + var fernTestValueObject HookDeliveryObject // Act obj.SetObject(fernTestValueObject) @@ -48283,7 +47026,7 @@ func TestSettersMarkExplicitHookEndpointWithSecret(t *testing.T) { t.Run("SetID_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookEndpointWithSecret{} + obj := &HookDelivery{} var fernTestValueID string // Act @@ -48314,7 +47057,7 @@ func TestSettersMarkExplicitHookEndpointWithSecret(t *testing.T) { t.Run("SetApplicationID_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookEndpointWithSecret{} + obj := &HookDelivery{} var fernTestValueApplicationID string // Act @@ -48342,14 +47085,14 @@ func TestSettersMarkExplicitHookEndpointWithSecret(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetURL_MarksExplicit", func(t *testing.T) { + t.Run("SetMessageID_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookEndpointWithSecret{} - var fernTestValueURL string + obj := &HookDelivery{} + var fernTestValueMessageID string // Act - obj.SetURL(fernTestValueURL) + obj.SetMessageID(fernTestValueMessageID) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -48373,14 +47116,14 @@ func TestSettersMarkExplicitHookEndpointWithSecret(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetDescription_MarksExplicit", func(t *testing.T) { + t.Run("SetEndpointID_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookEndpointWithSecret{} - var fernTestValueDescription *string + obj := &HookDelivery{} + var fernTestValueEndpointID string // Act - obj.SetDescription(fernTestValueDescription) + obj.SetEndpointID(fernTestValueEndpointID) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -48404,14 +47147,14 @@ func TestSettersMarkExplicitHookEndpointWithSecret(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetFilterTypes_MarksExplicit", func(t *testing.T) { + t.Run("SetStatus_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookEndpointWithSecret{} - var fernTestValueFilterTypes []string + obj := &HookDelivery{} + var fernTestValueStatus HookDeliveryStatus // Act - obj.SetFilterTypes(fernTestValueFilterTypes) + obj.SetStatus(fernTestValueStatus) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -48435,14 +47178,14 @@ func TestSettersMarkExplicitHookEndpointWithSecret(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetRateLimitPerSecond_MarksExplicit", func(t *testing.T) { + t.Run("SetAttemptCount_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookEndpointWithSecret{} - var fernTestValueRateLimitPerSecond *int64 + obj := &HookDelivery{} + var fernTestValueAttemptCount int64 // Act - obj.SetRateLimitPerSecond(fernTestValueRateLimitPerSecond) + obj.SetAttemptCount(fernTestValueAttemptCount) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -48466,14 +47209,14 @@ func TestSettersMarkExplicitHookEndpointWithSecret(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetEnabled_MarksExplicit", func(t *testing.T) { + t.Run("SetNextAttemptAt_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookEndpointWithSecret{} - var fernTestValueEnabled bool + obj := &HookDelivery{} + var fernTestValueNextAttemptAt *time.Time // Act - obj.SetEnabled(fernTestValueEnabled) + obj.SetNextAttemptAt(fernTestValueNextAttemptAt) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -48497,14 +47240,14 @@ func TestSettersMarkExplicitHookEndpointWithSecret(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetDisabledReason_MarksExplicit", func(t *testing.T) { + t.Run("SetLastStatusCode_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookEndpointWithSecret{} - var fernTestValueDisabledReason *HookEndpointWithSecretDisabledReason + obj := &HookDelivery{} + var fernTestValueLastStatusCode *int64 // Act - obj.SetDisabledReason(fernTestValueDisabledReason) + obj.SetLastStatusCode(fernTestValueLastStatusCode) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -48528,14 +47271,14 @@ func TestSettersMarkExplicitHookEndpointWithSecret(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetDisabledAt_MarksExplicit", func(t *testing.T) { + t.Run("SetLastError_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookEndpointWithSecret{} - var fernTestValueDisabledAt *time.Time + obj := &HookDelivery{} + var fernTestValueLastError *string // Act - obj.SetDisabledAt(fernTestValueDisabledAt) + obj.SetLastError(fernTestValueLastError) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -48559,14 +47302,14 @@ func TestSettersMarkExplicitHookEndpointWithSecret(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetFailingSince_MarksExplicit", func(t *testing.T) { + t.Run("SetCreatedAt_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookEndpointWithSecret{} - var fernTestValueFailingSince *time.Time + obj := &HookDelivery{} + var fernTestValueCreatedAt time.Time // Act - obj.SetFailingSince(fernTestValueFailingSince) + obj.SetCreatedAt(fernTestValueCreatedAt) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -48590,14 +47333,14 @@ func TestSettersMarkExplicitHookEndpointWithSecret(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetPreviousSecretExpiresAt_MarksExplicit", func(t *testing.T) { + t.Run("SetFinishedAt_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookEndpointWithSecret{} - var fernTestValuePreviousSecretExpiresAt *time.Time + obj := &HookDelivery{} + var fernTestValueFinishedAt *time.Time // Act - obj.SetPreviousSecretExpiresAt(fernTestValuePreviousSecretExpiresAt) + obj.SetFinishedAt(fernTestValueFinishedAt) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -48621,45 +47364,126 @@ func TestSettersMarkExplicitHookEndpointWithSecret(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetMetadata_MarksExplicit", func(t *testing.T) { +} + +func TestSettersHookDeliveryList(t *testing.T) { + t.Run("SetObject", func(t *testing.T) { + obj := &HookDeliveryList{} + var fernTestValueObject HookDeliveryListObject + obj.SetObject(fernTestValueObject) + assert.Equal(t, fernTestValueObject, obj.Object) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetData", func(t *testing.T) { + obj := &HookDeliveryList{} + var fernTestValueData []*HookDelivery + obj.SetData(fernTestValueData) + assert.Equal(t, fernTestValueData, obj.Data) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetHasMore", func(t *testing.T) { + obj := &HookDeliveryList{} + var fernTestValueHasMore bool + obj.SetHasMore(fernTestValueHasMore) + assert.Equal(t, fernTestValueHasMore, obj.HasMore) + assert.NotNil(t, obj.explicitFields) + }) + +} + +func TestGettersHookDeliveryList(t *testing.T) { + t.Run("GetObject", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookEndpointWithSecret{} - var fernTestValueMetadata map[string]string + obj := &HookDeliveryList{} + var expected HookDeliveryListObject + obj.Object = expected - // Act - obj.SetMetadata(fernTestValueMetadata) + // Act & Assert + assert.Equal(t, expected, obj.GetObject(), "getter should return the property value") + }) - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") + t.Run("GetObject_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *HookDeliveryList + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetObject() // Should return zero value + }) - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } + t.Run("GetData", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &HookDeliveryList{} + var expected []*HookDelivery + obj.Data = expected - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip + // Act & Assert + assert.Equal(t, expected, obj.GetData(), "getter should return the property value") }) - t.Run("SetCreatedAt_MarksExplicit", func(t *testing.T) { + t.Run("GetData_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookEndpointWithSecret{} - var fernTestValueCreatedAt time.Time + obj := &HookDeliveryList{} + obj.Data = nil + + // Act & Assert + assert.Nil(t, obj.GetData(), "getter should return nil when property is nil") + }) + + t.Run("GetData_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *HookDeliveryList + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetData() // Should return zero value + }) + + t.Run("GetHasMore", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &HookDeliveryList{} + var expected bool + obj.HasMore = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetHasMore(), "getter should return the property value") + }) + + t.Run("GetHasMore_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *HookDeliveryList + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetHasMore() // Should return zero value + }) + +} + +func TestSettersMarkExplicitHookDeliveryList(t *testing.T) { + t.Run("SetObject_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &HookDeliveryList{} + var fernTestValueObject HookDeliveryListObject // Act - obj.SetCreatedAt(fernTestValueCreatedAt) + obj.SetObject(fernTestValueObject) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -48683,14 +47507,14 @@ func TestSettersMarkExplicitHookEndpointWithSecret(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetUpdatedAt_MarksExplicit", func(t *testing.T) { + t.Run("SetData_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookEndpointWithSecret{} - var fernTestValueUpdatedAt time.Time + obj := &HookDeliveryList{} + var fernTestValueData []*HookDelivery // Act - obj.SetUpdatedAt(fernTestValueUpdatedAt) + obj.SetData(fernTestValueData) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -48714,14 +47538,14 @@ func TestSettersMarkExplicitHookEndpointWithSecret(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetSecret_MarksExplicit", func(t *testing.T) { + t.Run("SetHasMore_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookEndpointWithSecret{} - var fernTestValueSecret string + obj := &HookDeliveryList{} + var fernTestValueHasMore bool // Act - obj.SetSecret(fernTestValueSecret) + obj.SetHasMore(fernTestValueHasMore) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -48747,57 +47571,113 @@ func TestSettersMarkExplicitHookEndpointWithSecret(t *testing.T) { } -func TestSettersHookEventType(t *testing.T) { +func TestSettersHookEndpoint(t *testing.T) { t.Run("SetObject", func(t *testing.T) { - obj := &HookEventType{} - var fernTestValueObject HookEventTypeObject + obj := &HookEndpoint{} + var fernTestValueObject HookEndpointObject obj.SetObject(fernTestValueObject) assert.Equal(t, fernTestValueObject, obj.Object) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetName", func(t *testing.T) { - obj := &HookEventType{} - var fernTestValueName string - obj.SetName(fernTestValueName) - assert.Equal(t, fernTestValueName, obj.Name) + t.Run("SetID", func(t *testing.T) { + obj := &HookEndpoint{} + var fernTestValueID string + obj.SetID(fernTestValueID) + assert.Equal(t, fernTestValueID, obj.ID) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetApplicationID", func(t *testing.T) { + obj := &HookEndpoint{} + var fernTestValueApplicationID string + obj.SetApplicationID(fernTestValueApplicationID) + assert.Equal(t, fernTestValueApplicationID, obj.ApplicationID) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetURL", func(t *testing.T) { + obj := &HookEndpoint{} + var fernTestValueURL string + obj.SetURL(fernTestValueURL) + assert.Equal(t, fernTestValueURL, obj.URL) assert.NotNil(t, obj.explicitFields) }) t.Run("SetDescription", func(t *testing.T) { - obj := &HookEventType{} + obj := &HookEndpoint{} var fernTestValueDescription *string obj.SetDescription(fernTestValueDescription) assert.Equal(t, fernTestValueDescription, obj.Description) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetSchema", func(t *testing.T) { - obj := &HookEventType{} - var fernTestValueSchema map[string]any - obj.SetSchema(fernTestValueSchema) - assert.Equal(t, fernTestValueSchema, obj.Schema) + t.Run("SetFilterTypes", func(t *testing.T) { + obj := &HookEndpoint{} + var fernTestValueFilterTypes []string + obj.SetFilterTypes(fernTestValueFilterTypes) + assert.Equal(t, fernTestValueFilterTypes, obj.FilterTypes) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetExamples", func(t *testing.T) { - obj := &HookEventType{} - var fernTestValueExamples []map[string]any - obj.SetExamples(fernTestValueExamples) - assert.Equal(t, fernTestValueExamples, obj.Examples) + t.Run("SetRateLimitPerSecond", func(t *testing.T) { + obj := &HookEndpoint{} + var fernTestValueRateLimitPerSecond *int64 + obj.SetRateLimitPerSecond(fernTestValueRateLimitPerSecond) + assert.Equal(t, fernTestValueRateLimitPerSecond, obj.RateLimitPerSecond) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetArchived", func(t *testing.T) { - obj := &HookEventType{} - var fernTestValueArchived bool - obj.SetArchived(fernTestValueArchived) - assert.Equal(t, fernTestValueArchived, obj.Archived) + t.Run("SetEnabled", func(t *testing.T) { + obj := &HookEndpoint{} + var fernTestValueEnabled bool + obj.SetEnabled(fernTestValueEnabled) + assert.Equal(t, fernTestValueEnabled, obj.Enabled) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetDisabledReason", func(t *testing.T) { + obj := &HookEndpoint{} + var fernTestValueDisabledReason *HookEndpointDisabledReason + obj.SetDisabledReason(fernTestValueDisabledReason) + assert.Equal(t, fernTestValueDisabledReason, obj.DisabledReason) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetDisabledAt", func(t *testing.T) { + obj := &HookEndpoint{} + var fernTestValueDisabledAt *time.Time + obj.SetDisabledAt(fernTestValueDisabledAt) + assert.Equal(t, fernTestValueDisabledAt, obj.DisabledAt) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetFailingSince", func(t *testing.T) { + obj := &HookEndpoint{} + var fernTestValueFailingSince *time.Time + obj.SetFailingSince(fernTestValueFailingSince) + assert.Equal(t, fernTestValueFailingSince, obj.FailingSince) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetPreviousSecretExpiresAt", func(t *testing.T) { + obj := &HookEndpoint{} + var fernTestValuePreviousSecretExpiresAt *time.Time + obj.SetPreviousSecretExpiresAt(fernTestValuePreviousSecretExpiresAt) + assert.Equal(t, fernTestValuePreviousSecretExpiresAt, obj.PreviousSecretExpiresAt) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetMetadata", func(t *testing.T) { + obj := &HookEndpoint{} + var fernTestValueMetadata map[string]string + obj.SetMetadata(fernTestValueMetadata) + assert.Equal(t, fernTestValueMetadata, obj.Metadata) assert.NotNil(t, obj.explicitFields) }) t.Run("SetCreatedAt", func(t *testing.T) { - obj := &HookEventType{} + obj := &HookEndpoint{} var fernTestValueCreatedAt time.Time obj.SetCreatedAt(fernTestValueCreatedAt) assert.Equal(t, fernTestValueCreatedAt, obj.CreatedAt) @@ -48805,7 +47685,7 @@ func TestSettersHookEventType(t *testing.T) { }) t.Run("SetUpdatedAt", func(t *testing.T) { - obj := &HookEventType{} + obj := &HookEndpoint{} var fernTestValueUpdatedAt time.Time obj.SetUpdatedAt(fernTestValueUpdatedAt) assert.Equal(t, fernTestValueUpdatedAt, obj.UpdatedAt) @@ -48814,12 +47694,12 @@ func TestSettersHookEventType(t *testing.T) { } -func TestGettersHookEventType(t *testing.T) { +func TestGettersHookEndpoint(t *testing.T) { t.Run("GetObject", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookEventType{} - var expected HookEventTypeObject + obj := &HookEndpoint{} + var expected HookEndpointObject obj.Object = expected // Act & Assert @@ -48828,7 +47708,7 @@ func TestGettersHookEventType(t *testing.T) { t.Run("GetObject_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *HookEventType + var obj *HookEndpoint // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -48838,33 +47718,79 @@ func TestGettersHookEventType(t *testing.T) { _ = obj.GetObject() // Should return zero value }) - t.Run("GetName", func(t *testing.T) { + t.Run("GetID", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookEventType{} + obj := &HookEndpoint{} var expected string - obj.Name = expected + obj.ID = expected // Act & Assert - assert.Equal(t, expected, obj.GetName(), "getter should return the property value") + assert.Equal(t, expected, obj.GetID(), "getter should return the property value") }) - t.Run("GetName_NilReceiver", func(t *testing.T) { + t.Run("GetID_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *HookEventType + var obj *HookEndpoint // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetName() // Should return zero value + _ = obj.GetID() // Should return zero value + }) + + t.Run("GetApplicationID", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &HookEndpoint{} + var expected string + obj.ApplicationID = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetApplicationID(), "getter should return the property value") + }) + + t.Run("GetApplicationID_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *HookEndpoint + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetApplicationID() // Should return zero value + }) + + t.Run("GetURL", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &HookEndpoint{} + var expected string + obj.URL = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetURL(), "getter should return the property value") + }) + + t.Run("GetURL_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *HookEndpoint + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetURL() // Should return zero value }) t.Run("GetDescription", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookEventType{} + obj := &HookEndpoint{} var expected *string obj.Description = expected @@ -48875,7 +47801,7 @@ func TestGettersHookEventType(t *testing.T) { t.Run("GetDescription_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookEventType{} + obj := &HookEndpoint{} obj.Description = nil // Act & Assert @@ -48884,7 +47810,7 @@ func TestGettersHookEventType(t *testing.T) { t.Run("GetDescription_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *HookEventType + var obj *HookEndpoint // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -48894,99 +47820,264 @@ func TestGettersHookEventType(t *testing.T) { _ = obj.GetDescription() // Should return zero value }) - t.Run("GetSchema", func(t *testing.T) { + t.Run("GetFilterTypes", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookEventType{} - var expected map[string]any - obj.Schema = expected + obj := &HookEndpoint{} + var expected []string + obj.FilterTypes = expected // Act & Assert - assert.Equal(t, expected, obj.GetSchema(), "getter should return the property value") + assert.Equal(t, expected, obj.GetFilterTypes(), "getter should return the property value") }) - t.Run("GetSchema_NilValue", func(t *testing.T) { + t.Run("GetFilterTypes_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookEventType{} - obj.Schema = nil + obj := &HookEndpoint{} + obj.FilterTypes = nil // Act & Assert - assert.Nil(t, obj.GetSchema(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetFilterTypes(), "getter should return nil when property is nil") }) - t.Run("GetSchema_NilReceiver", func(t *testing.T) { + t.Run("GetFilterTypes_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *HookEventType + var obj *HookEndpoint // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetSchema() // Should return zero value + _ = obj.GetFilterTypes() // Should return zero value }) - t.Run("GetExamples", func(t *testing.T) { + t.Run("GetRateLimitPerSecond", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookEventType{} - var expected []map[string]any - obj.Examples = expected + obj := &HookEndpoint{} + var expected *int64 + obj.RateLimitPerSecond = expected // Act & Assert - assert.Equal(t, expected, obj.GetExamples(), "getter should return the property value") + assert.Equal(t, expected, obj.GetRateLimitPerSecond(), "getter should return the property value") }) - t.Run("GetExamples_NilValue", func(t *testing.T) { + t.Run("GetRateLimitPerSecond_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookEventType{} - obj.Examples = nil + obj := &HookEndpoint{} + obj.RateLimitPerSecond = nil // Act & Assert - assert.Nil(t, obj.GetExamples(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetRateLimitPerSecond(), "getter should return nil when property is nil") }) - t.Run("GetExamples_NilReceiver", func(t *testing.T) { + t.Run("GetRateLimitPerSecond_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *HookEventType + var obj *HookEndpoint // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetExamples() // Should return zero value + _ = obj.GetRateLimitPerSecond() // Should return zero value }) - t.Run("GetArchived", func(t *testing.T) { + t.Run("GetEnabled", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookEventType{} + obj := &HookEndpoint{} var expected bool - obj.Archived = expected + obj.Enabled = expected // Act & Assert - assert.Equal(t, expected, obj.GetArchived(), "getter should return the property value") + assert.Equal(t, expected, obj.GetEnabled(), "getter should return the property value") }) - t.Run("GetArchived_NilReceiver", func(t *testing.T) { + t.Run("GetEnabled_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *HookEventType + var obj *HookEndpoint // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetArchived() // Should return zero value + _ = obj.GetEnabled() // Should return zero value + }) + + t.Run("GetDisabledReason", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &HookEndpoint{} + var expected *HookEndpointDisabledReason + obj.DisabledReason = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetDisabledReason(), "getter should return the property value") + }) + + t.Run("GetDisabledReason_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &HookEndpoint{} + obj.DisabledReason = nil + + // Act & Assert + assert.Nil(t, obj.GetDisabledReason(), "getter should return nil when property is nil") + }) + + t.Run("GetDisabledReason_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *HookEndpoint + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetDisabledReason() // Should return zero value + }) + + t.Run("GetDisabledAt", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &HookEndpoint{} + var expected *time.Time + obj.DisabledAt = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetDisabledAt(), "getter should return the property value") + }) + + t.Run("GetDisabledAt_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &HookEndpoint{} + obj.DisabledAt = nil + + // Act & Assert + assert.Nil(t, obj.GetDisabledAt(), "getter should return nil when property is nil") + }) + + t.Run("GetDisabledAt_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *HookEndpoint + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetDisabledAt() // Should return zero value + }) + + t.Run("GetFailingSince", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &HookEndpoint{} + var expected *time.Time + obj.FailingSince = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetFailingSince(), "getter should return the property value") + }) + + t.Run("GetFailingSince_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &HookEndpoint{} + obj.FailingSince = nil + + // Act & Assert + assert.Nil(t, obj.GetFailingSince(), "getter should return nil when property is nil") + }) + + t.Run("GetFailingSince_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *HookEndpoint + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetFailingSince() // Should return zero value + }) + + t.Run("GetPreviousSecretExpiresAt", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &HookEndpoint{} + var expected *time.Time + obj.PreviousSecretExpiresAt = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetPreviousSecretExpiresAt(), "getter should return the property value") + }) + + t.Run("GetPreviousSecretExpiresAt_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &HookEndpoint{} + obj.PreviousSecretExpiresAt = nil + + // Act & Assert + assert.Nil(t, obj.GetPreviousSecretExpiresAt(), "getter should return nil when property is nil") + }) + + t.Run("GetPreviousSecretExpiresAt_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *HookEndpoint + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetPreviousSecretExpiresAt() // Should return zero value + }) + + t.Run("GetMetadata", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &HookEndpoint{} + var expected map[string]string + obj.Metadata = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetMetadata(), "getter should return the property value") + }) + + t.Run("GetMetadata_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &HookEndpoint{} + obj.Metadata = nil + + // Act & Assert + assert.Nil(t, obj.GetMetadata(), "getter should return nil when property is nil") + }) + + t.Run("GetMetadata_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *HookEndpoint + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetMetadata() // Should return zero value }) t.Run("GetCreatedAt", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookEventType{} + obj := &HookEndpoint{} var expected time.Time obj.CreatedAt = expected @@ -48996,7 +48087,7 @@ func TestGettersHookEventType(t *testing.T) { t.Run("GetCreatedAt_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *HookEventType + var obj *HookEndpoint // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -49009,7 +48100,7 @@ func TestGettersHookEventType(t *testing.T) { t.Run("GetUpdatedAt", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookEventType{} + obj := &HookEndpoint{} var expected time.Time obj.UpdatedAt = expected @@ -49019,7 +48110,7 @@ func TestGettersHookEventType(t *testing.T) { t.Run("GetUpdatedAt_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *HookEventType + var obj *HookEndpoint // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -49031,12 +48122,12 @@ func TestGettersHookEventType(t *testing.T) { } -func TestSettersMarkExplicitHookEventType(t *testing.T) { +func TestSettersMarkExplicitHookEndpoint(t *testing.T) { t.Run("SetObject_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookEventType{} - var fernTestValueObject HookEventTypeObject + obj := &HookEndpoint{} + var fernTestValueObject HookEndpointObject // Act obj.SetObject(fernTestValueObject) @@ -49063,14 +48154,14 @@ func TestSettersMarkExplicitHookEventType(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetName_MarksExplicit", func(t *testing.T) { + t.Run("SetID_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookEventType{} - var fernTestValueName string + obj := &HookEndpoint{} + var fernTestValueID string // Act - obj.SetName(fernTestValueName) + obj.SetID(fernTestValueID) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -49094,14 +48185,14 @@ func TestSettersMarkExplicitHookEventType(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetDescription_MarksExplicit", func(t *testing.T) { + t.Run("SetApplicationID_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookEventType{} - var fernTestValueDescription *string + obj := &HookEndpoint{} + var fernTestValueApplicationID string // Act - obj.SetDescription(fernTestValueDescription) + obj.SetApplicationID(fernTestValueApplicationID) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -49125,14 +48216,14 @@ func TestSettersMarkExplicitHookEventType(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetSchema_MarksExplicit", func(t *testing.T) { + t.Run("SetURL_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookEventType{} - var fernTestValueSchema map[string]any + obj := &HookEndpoint{} + var fernTestValueURL string // Act - obj.SetSchema(fernTestValueSchema) + obj.SetURL(fernTestValueURL) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -49156,14 +48247,14 @@ func TestSettersMarkExplicitHookEventType(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetExamples_MarksExplicit", func(t *testing.T) { + t.Run("SetDescription_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookEventType{} - var fernTestValueExamples []map[string]any + obj := &HookEndpoint{} + var fernTestValueDescription *string // Act - obj.SetExamples(fernTestValueExamples) + obj.SetDescription(fernTestValueDescription) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -49187,14 +48278,14 @@ func TestSettersMarkExplicitHookEventType(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetArchived_MarksExplicit", func(t *testing.T) { + t.Run("SetFilterTypes_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookEventType{} - var fernTestValueArchived bool + obj := &HookEndpoint{} + var fernTestValueFilterTypes []string // Act - obj.SetArchived(fernTestValueArchived) + obj.SetFilterTypes(fernTestValueFilterTypes) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -49218,14 +48309,14 @@ func TestSettersMarkExplicitHookEventType(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetCreatedAt_MarksExplicit", func(t *testing.T) { + t.Run("SetRateLimitPerSecond_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookEventType{} - var fernTestValueCreatedAt time.Time + obj := &HookEndpoint{} + var fernTestValueRateLimitPerSecond *int64 // Act - obj.SetCreatedAt(fernTestValueCreatedAt) + obj.SetRateLimitPerSecond(fernTestValueRateLimitPerSecond) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -49249,14 +48340,14 @@ func TestSettersMarkExplicitHookEventType(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetUpdatedAt_MarksExplicit", func(t *testing.T) { + t.Run("SetEnabled_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookEventType{} - var fernTestValueUpdatedAt time.Time + obj := &HookEndpoint{} + var fernTestValueEnabled bool // Act - obj.SetUpdatedAt(fernTestValueUpdatedAt) + obj.SetEnabled(fernTestValueEnabled) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -49280,188 +48371,14 @@ func TestSettersMarkExplicitHookEventType(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) -} - -func TestSettersHookEventTypeList(t *testing.T) { - t.Run("SetObject", func(t *testing.T) { - obj := &HookEventTypeList{} - var fernTestValueObject HookEventTypeListObject - obj.SetObject(fernTestValueObject) - assert.Equal(t, fernTestValueObject, obj.Object) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetData", func(t *testing.T) { - obj := &HookEventTypeList{} - var fernTestValueData []*HookEventType - obj.SetData(fernTestValueData) - assert.Equal(t, fernTestValueData, obj.Data) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetHasMore", func(t *testing.T) { - obj := &HookEventTypeList{} - var fernTestValueHasMore bool - obj.SetHasMore(fernTestValueHasMore) - assert.Equal(t, fernTestValueHasMore, obj.HasMore) - assert.NotNil(t, obj.explicitFields) - }) - -} - -func TestGettersHookEventTypeList(t *testing.T) { - t.Run("GetObject", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &HookEventTypeList{} - var expected HookEventTypeListObject - obj.Object = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetObject(), "getter should return the property value") - }) - - t.Run("GetObject_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *HookEventTypeList - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetObject() // Should return zero value - }) - - t.Run("GetData", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &HookEventTypeList{} - var expected []*HookEventType - obj.Data = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetData(), "getter should return the property value") - }) - - t.Run("GetData_NilValue", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &HookEventTypeList{} - obj.Data = nil - - // Act & Assert - assert.Nil(t, obj.GetData(), "getter should return nil when property is nil") - }) - - t.Run("GetData_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *HookEventTypeList - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetData() // Should return zero value - }) - - t.Run("GetHasMore", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &HookEventTypeList{} - var expected bool - obj.HasMore = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetHasMore(), "getter should return the property value") - }) - - t.Run("GetHasMore_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *HookEventTypeList - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetHasMore() // Should return zero value - }) - -} - -func TestSettersMarkExplicitHookEventTypeList(t *testing.T) { - t.Run("SetObject_MarksExplicit", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &HookEventTypeList{} - var fernTestValueObject HookEventTypeListObject - - // Act - obj.SetObject(fernTestValueObject) - - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") - - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } - - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip - }) - - t.Run("SetData_MarksExplicit", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &HookEventTypeList{} - var fernTestValueData []*HookEventType - - // Act - obj.SetData(fernTestValueData) - - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") - - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } - - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip - }) - - t.Run("SetHasMore_MarksExplicit", func(t *testing.T) { + t.Run("SetDisabledReason_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookEventTypeList{} - var fernTestValueHasMore bool + obj := &HookEndpoint{} + var fernTestValueDisabledReason *HookEndpointDisabledReason // Act - obj.SetHasMore(fernTestValueHasMore) + obj.SetDisabledReason(fernTestValueDisabledReason) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -49485,219 +48402,14 @@ func TestSettersMarkExplicitHookEventTypeList(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) -} - -func TestSettersHookMessage(t *testing.T) { - t.Run("SetObject", func(t *testing.T) { - obj := &HookMessage{} - var fernTestValueObject HookMessageObject - obj.SetObject(fernTestValueObject) - assert.Equal(t, fernTestValueObject, obj.Object) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetID", func(t *testing.T) { - obj := &HookMessage{} - var fernTestValueID string - obj.SetID(fernTestValueID) - assert.Equal(t, fernTestValueID, obj.ID) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetApplicationID", func(t *testing.T) { - obj := &HookMessage{} - var fernTestValueApplicationID string - obj.SetApplicationID(fernTestValueApplicationID) - assert.Equal(t, fernTestValueApplicationID, obj.ApplicationID) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetEventType", func(t *testing.T) { - obj := &HookMessage{} - var fernTestValueEventType string - obj.SetEventType(fernTestValueEventType) - assert.Equal(t, fernTestValueEventType, obj.EventType) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetPayload", func(t *testing.T) { - obj := &HookMessage{} - var fernTestValuePayload map[string]any - obj.SetPayload(fernTestValuePayload) - assert.Equal(t, fernTestValuePayload, obj.Payload) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetCreatedAt", func(t *testing.T) { - obj := &HookMessage{} - var fernTestValueCreatedAt time.Time - obj.SetCreatedAt(fernTestValueCreatedAt) - assert.Equal(t, fernTestValueCreatedAt, obj.CreatedAt) - assert.NotNil(t, obj.explicitFields) - }) - -} - -func TestGettersHookMessage(t *testing.T) { - t.Run("GetObject", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &HookMessage{} - var expected HookMessageObject - obj.Object = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetObject(), "getter should return the property value") - }) - - t.Run("GetObject_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *HookMessage - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetObject() // Should return zero value - }) - - t.Run("GetID", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &HookMessage{} - var expected string - obj.ID = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetID(), "getter should return the property value") - }) - - t.Run("GetID_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *HookMessage - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetID() // Should return zero value - }) - - t.Run("GetApplicationID", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &HookMessage{} - var expected string - obj.ApplicationID = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetApplicationID(), "getter should return the property value") - }) - - t.Run("GetApplicationID_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *HookMessage - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetApplicationID() // Should return zero value - }) - - t.Run("GetEventType", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &HookMessage{} - var expected string - obj.EventType = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetEventType(), "getter should return the property value") - }) - - t.Run("GetEventType_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *HookMessage - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetEventType() // Should return zero value - }) - - t.Run("GetPayload", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &HookMessage{} - var expected map[string]any - obj.Payload = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetPayload(), "getter should return the property value") - }) - - t.Run("GetPayload_NilValue", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &HookMessage{} - obj.Payload = nil - - // Act & Assert - assert.Nil(t, obj.GetPayload(), "getter should return nil when property is nil") - }) - - t.Run("GetPayload_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *HookMessage - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetPayload() // Should return zero value - }) - - t.Run("GetCreatedAt", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &HookMessage{} - var expected time.Time - obj.CreatedAt = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetCreatedAt(), "getter should return the property value") - }) - - t.Run("GetCreatedAt_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *HookMessage - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetCreatedAt() // Should return zero value - }) - -} - -func TestSettersMarkExplicitHookMessage(t *testing.T) { - t.Run("SetObject_MarksExplicit", func(t *testing.T) { + t.Run("SetDisabledAt_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookMessage{} - var fernTestValueObject HookMessageObject + obj := &HookEndpoint{} + var fernTestValueDisabledAt *time.Time // Act - obj.SetObject(fernTestValueObject) + obj.SetDisabledAt(fernTestValueDisabledAt) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -49721,14 +48433,14 @@ func TestSettersMarkExplicitHookMessage(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetID_MarksExplicit", func(t *testing.T) { + t.Run("SetFailingSince_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookMessage{} - var fernTestValueID string + obj := &HookEndpoint{} + var fernTestValueFailingSince *time.Time // Act - obj.SetID(fernTestValueID) + obj.SetFailingSince(fernTestValueFailingSince) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -49752,14 +48464,14 @@ func TestSettersMarkExplicitHookMessage(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetApplicationID_MarksExplicit", func(t *testing.T) { + t.Run("SetPreviousSecretExpiresAt_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookMessage{} - var fernTestValueApplicationID string + obj := &HookEndpoint{} + var fernTestValuePreviousSecretExpiresAt *time.Time // Act - obj.SetApplicationID(fernTestValueApplicationID) + obj.SetPreviousSecretExpiresAt(fernTestValuePreviousSecretExpiresAt) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -49783,14 +48495,14 @@ func TestSettersMarkExplicitHookMessage(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetEventType_MarksExplicit", func(t *testing.T) { + t.Run("SetMetadata_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookMessage{} - var fernTestValueEventType string + obj := &HookEndpoint{} + var fernTestValueMetadata map[string]string // Act - obj.SetEventType(fernTestValueEventType) + obj.SetMetadata(fernTestValueMetadata) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -49814,14 +48526,14 @@ func TestSettersMarkExplicitHookMessage(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetPayload_MarksExplicit", func(t *testing.T) { + t.Run("SetCreatedAt_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookMessage{} - var fernTestValuePayload map[string]any + obj := &HookEndpoint{} + var fernTestValueCreatedAt time.Time // Act - obj.SetPayload(fernTestValuePayload) + obj.SetCreatedAt(fernTestValueCreatedAt) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -49845,14 +48557,14 @@ func TestSettersMarkExplicitHookMessage(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetCreatedAt_MarksExplicit", func(t *testing.T) { + t.Run("SetUpdatedAt_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookMessage{} - var fernTestValueCreatedAt time.Time + obj := &HookEndpoint{} + var fernTestValueUpdatedAt time.Time // Act - obj.SetCreatedAt(fernTestValueCreatedAt) + obj.SetUpdatedAt(fernTestValueUpdatedAt) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -49878,25 +48590,25 @@ func TestSettersMarkExplicitHookMessage(t *testing.T) { } -func TestSettersHookMessageList(t *testing.T) { +func TestSettersHookEndpointList(t *testing.T) { t.Run("SetObject", func(t *testing.T) { - obj := &HookMessageList{} - var fernTestValueObject HookMessageListObject + obj := &HookEndpointList{} + var fernTestValueObject HookEndpointListObject obj.SetObject(fernTestValueObject) assert.Equal(t, fernTestValueObject, obj.Object) assert.NotNil(t, obj.explicitFields) }) t.Run("SetData", func(t *testing.T) { - obj := &HookMessageList{} - var fernTestValueData []*HookMessage + obj := &HookEndpointList{} + var fernTestValueData []*HookEndpoint obj.SetData(fernTestValueData) assert.Equal(t, fernTestValueData, obj.Data) assert.NotNil(t, obj.explicitFields) }) t.Run("SetHasMore", func(t *testing.T) { - obj := &HookMessageList{} + obj := &HookEndpointList{} var fernTestValueHasMore bool obj.SetHasMore(fernTestValueHasMore) assert.Equal(t, fernTestValueHasMore, obj.HasMore) @@ -49905,12 +48617,12 @@ func TestSettersHookMessageList(t *testing.T) { } -func TestGettersHookMessageList(t *testing.T) { +func TestGettersHookEndpointList(t *testing.T) { t.Run("GetObject", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookMessageList{} - var expected HookMessageListObject + obj := &HookEndpointList{} + var expected HookEndpointListObject obj.Object = expected // Act & Assert @@ -49919,7 +48631,7 @@ func TestGettersHookMessageList(t *testing.T) { t.Run("GetObject_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *HookMessageList + var obj *HookEndpointList // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -49932,8 +48644,8 @@ func TestGettersHookMessageList(t *testing.T) { t.Run("GetData", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookMessageList{} - var expected []*HookMessage + obj := &HookEndpointList{} + var expected []*HookEndpoint obj.Data = expected // Act & Assert @@ -49943,7 +48655,7 @@ func TestGettersHookMessageList(t *testing.T) { t.Run("GetData_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookMessageList{} + obj := &HookEndpointList{} obj.Data = nil // Act & Assert @@ -49952,7 +48664,7 @@ func TestGettersHookMessageList(t *testing.T) { t.Run("GetData_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *HookMessageList + var obj *HookEndpointList // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -49965,7 +48677,7 @@ func TestGettersHookMessageList(t *testing.T) { t.Run("GetHasMore", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookMessageList{} + obj := &HookEndpointList{} var expected bool obj.HasMore = expected @@ -49975,7 +48687,7 @@ func TestGettersHookMessageList(t *testing.T) { t.Run("GetHasMore_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *HookMessageList + var obj *HookEndpointList // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -49987,12 +48699,12 @@ func TestGettersHookMessageList(t *testing.T) { } -func TestSettersMarkExplicitHookMessageList(t *testing.T) { +func TestSettersMarkExplicitHookEndpointList(t *testing.T) { t.Run("SetObject_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookMessageList{} - var fernTestValueObject HookMessageListObject + obj := &HookEndpointList{} + var fernTestValueObject HookEndpointListObject // Act obj.SetObject(fernTestValueObject) @@ -50022,8 +48734,8 @@ func TestSettersMarkExplicitHookMessageList(t *testing.T) { t.Run("SetData_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookMessageList{} - var fernTestValueData []*HookMessage + obj := &HookEndpointList{} + var fernTestValueData []*HookEndpoint // Act obj.SetData(fernTestValueData) @@ -50053,7 +48765,7 @@ func TestSettersMarkExplicitHookMessageList(t *testing.T) { t.Run("SetHasMore_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookMessageList{} + obj := &HookEndpointList{} var fernTestValueHasMore bool // Act @@ -50083,71 +48795,87 @@ func TestSettersMarkExplicitHookMessageList(t *testing.T) { } -func TestSettersHookPortalSession(t *testing.T) { +func TestSettersHookEndpointRecovery(t *testing.T) { t.Run("SetObject", func(t *testing.T) { - obj := &HookPortalSession{} - var fernTestValueObject HookPortalSessionObject + obj := &HookEndpointRecovery{} + var fernTestValueObject HookEndpointRecoveryObject obj.SetObject(fernTestValueObject) assert.Equal(t, fernTestValueObject, obj.Object) assert.NotNil(t, obj.explicitFields) }) t.Run("SetID", func(t *testing.T) { - obj := &HookPortalSession{} + obj := &HookEndpointRecovery{} var fernTestValueID string obj.SetID(fernTestValueID) assert.Equal(t, fernTestValueID, obj.ID) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetApplicationID", func(t *testing.T) { - obj := &HookPortalSession{} - var fernTestValueApplicationID string - obj.SetApplicationID(fernTestValueApplicationID) - assert.Equal(t, fernTestValueApplicationID, obj.ApplicationID) + t.Run("SetEndpointID", func(t *testing.T) { + obj := &HookEndpointRecovery{} + var fernTestValueEndpointID string + obj.SetEndpointID(fernTestValueEndpointID) + assert.Equal(t, fernTestValueEndpointID, obj.EndpointID) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetURL", func(t *testing.T) { - obj := &HookPortalSession{} - var fernTestValueURL string - obj.SetURL(fernTestValueURL) - assert.Equal(t, fernTestValueURL, obj.URL) + t.Run("SetSince", func(t *testing.T) { + obj := &HookEndpointRecovery{} + var fernTestValueSince time.Time + obj.SetSince(fernTestValueSince) + assert.Equal(t, fernTestValueSince, obj.Since) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetToken", func(t *testing.T) { - obj := &HookPortalSession{} - var fernTestValueToken string - obj.SetToken(fernTestValueToken) - assert.Equal(t, fernTestValueToken, obj.Token) + t.Run("SetUntil", func(t *testing.T) { + obj := &HookEndpointRecovery{} + var fernTestValueUntil time.Time + obj.SetUntil(fernTestValueUntil) + assert.Equal(t, fernTestValueUntil, obj.Until) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetReadOnly", func(t *testing.T) { - obj := &HookPortalSession{} - var fernTestValueReadOnly bool - obj.SetReadOnly(fernTestValueReadOnly) - assert.Equal(t, fernTestValueReadOnly, obj.ReadOnly) + t.Run("SetStatus", func(t *testing.T) { + obj := &HookEndpointRecovery{} + var fernTestValueStatus HookEndpointRecoveryStatus + obj.SetStatus(fernTestValueStatus) + assert.Equal(t, fernTestValueStatus, obj.Status) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetExpiresAt", func(t *testing.T) { - obj := &HookPortalSession{} - var fernTestValueExpiresAt time.Time - obj.SetExpiresAt(fernTestValueExpiresAt) - assert.Equal(t, fernTestValueExpiresAt, obj.ExpiresAt) + t.Run("SetRequeued", func(t *testing.T) { + obj := &HookEndpointRecovery{} + var fernTestValueRequeued int64 + obj.SetRequeued(fernTestValueRequeued) + assert.Equal(t, fernTestValueRequeued, obj.Requeued) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetCreatedAt", func(t *testing.T) { + obj := &HookEndpointRecovery{} + var fernTestValueCreatedAt time.Time + obj.SetCreatedAt(fernTestValueCreatedAt) + assert.Equal(t, fernTestValueCreatedAt, obj.CreatedAt) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetCompletedAt", func(t *testing.T) { + obj := &HookEndpointRecovery{} + var fernTestValueCompletedAt *time.Time + obj.SetCompletedAt(fernTestValueCompletedAt) + assert.Equal(t, fernTestValueCompletedAt, obj.CompletedAt) assert.NotNil(t, obj.explicitFields) }) } -func TestGettersHookPortalSession(t *testing.T) { +func TestGettersHookEndpointRecovery(t *testing.T) { t.Run("GetObject", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookPortalSession{} - var expected HookPortalSessionObject + obj := &HookEndpointRecovery{} + var expected HookEndpointRecoveryObject obj.Object = expected // Act & Assert @@ -50156,7 +48884,7 @@ func TestGettersHookPortalSession(t *testing.T) { t.Run("GetObject_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *HookPortalSession + var obj *HookEndpointRecovery // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -50169,7 +48897,7 @@ func TestGettersHookPortalSession(t *testing.T) { t.Run("GetID", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookPortalSession{} + obj := &HookEndpointRecovery{} var expected string obj.ID = expected @@ -50179,7 +48907,7 @@ func TestGettersHookPortalSession(t *testing.T) { t.Run("GetID_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *HookPortalSession + var obj *HookEndpointRecovery // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -50189,129 +48917,185 @@ func TestGettersHookPortalSession(t *testing.T) { _ = obj.GetID() // Should return zero value }) - t.Run("GetApplicationID", func(t *testing.T) { + t.Run("GetEndpointID", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookPortalSession{} + obj := &HookEndpointRecovery{} var expected string - obj.ApplicationID = expected + obj.EndpointID = expected // Act & Assert - assert.Equal(t, expected, obj.GetApplicationID(), "getter should return the property value") + assert.Equal(t, expected, obj.GetEndpointID(), "getter should return the property value") }) - t.Run("GetApplicationID_NilReceiver", func(t *testing.T) { + t.Run("GetEndpointID_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *HookPortalSession + var obj *HookEndpointRecovery // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetApplicationID() // Should return zero value + _ = obj.GetEndpointID() // Should return zero value }) - t.Run("GetURL", func(t *testing.T) { + t.Run("GetSince", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookPortalSession{} - var expected string - obj.URL = expected + obj := &HookEndpointRecovery{} + var expected time.Time + obj.Since = expected // Act & Assert - assert.Equal(t, expected, obj.GetURL(), "getter should return the property value") + assert.Equal(t, expected, obj.GetSince(), "getter should return the property value") }) - t.Run("GetURL_NilReceiver", func(t *testing.T) { + t.Run("GetSince_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *HookPortalSession + var obj *HookEndpointRecovery // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetURL() // Should return zero value + _ = obj.GetSince() // Should return zero value }) - t.Run("GetToken", func(t *testing.T) { + t.Run("GetUntil", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookPortalSession{} - var expected string - obj.Token = expected + obj := &HookEndpointRecovery{} + var expected time.Time + obj.Until = expected // Act & Assert - assert.Equal(t, expected, obj.GetToken(), "getter should return the property value") + assert.Equal(t, expected, obj.GetUntil(), "getter should return the property value") }) - t.Run("GetToken_NilReceiver", func(t *testing.T) { + t.Run("GetUntil_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *HookPortalSession + var obj *HookEndpointRecovery // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetToken() // Should return zero value + _ = obj.GetUntil() // Should return zero value }) - t.Run("GetReadOnly", func(t *testing.T) { + t.Run("GetStatus", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookPortalSession{} - var expected bool - obj.ReadOnly = expected + obj := &HookEndpointRecovery{} + var expected HookEndpointRecoveryStatus + obj.Status = expected // Act & Assert - assert.Equal(t, expected, obj.GetReadOnly(), "getter should return the property value") + assert.Equal(t, expected, obj.GetStatus(), "getter should return the property value") }) - t.Run("GetReadOnly_NilReceiver", func(t *testing.T) { + t.Run("GetStatus_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *HookPortalSession + var obj *HookEndpointRecovery // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetReadOnly() // Should return zero value + _ = obj.GetStatus() // Should return zero value }) - t.Run("GetExpiresAt", func(t *testing.T) { + t.Run("GetRequeued", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookPortalSession{} + obj := &HookEndpointRecovery{} + var expected int64 + obj.Requeued = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetRequeued(), "getter should return the property value") + }) + + t.Run("GetRequeued_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *HookEndpointRecovery + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetRequeued() // Should return zero value + }) + + t.Run("GetCreatedAt", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &HookEndpointRecovery{} var expected time.Time - obj.ExpiresAt = expected + obj.CreatedAt = expected // Act & Assert - assert.Equal(t, expected, obj.GetExpiresAt(), "getter should return the property value") + assert.Equal(t, expected, obj.GetCreatedAt(), "getter should return the property value") }) - t.Run("GetExpiresAt_NilReceiver", func(t *testing.T) { + t.Run("GetCreatedAt_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *HookPortalSession + var obj *HookEndpointRecovery // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetExpiresAt() // Should return zero value + _ = obj.GetCreatedAt() // Should return zero value + }) + + t.Run("GetCompletedAt", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &HookEndpointRecovery{} + var expected *time.Time + obj.CompletedAt = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetCompletedAt(), "getter should return the property value") + }) + + t.Run("GetCompletedAt_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &HookEndpointRecovery{} + obj.CompletedAt = nil + + // Act & Assert + assert.Nil(t, obj.GetCompletedAt(), "getter should return nil when property is nil") + }) + + t.Run("GetCompletedAt_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *HookEndpointRecovery + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetCompletedAt() // Should return zero value }) } -func TestSettersMarkExplicitHookPortalSession(t *testing.T) { +func TestSettersMarkExplicitHookEndpointRecovery(t *testing.T) { t.Run("SetObject_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookPortalSession{} - var fernTestValueObject HookPortalSessionObject + obj := &HookEndpointRecovery{} + var fernTestValueObject HookEndpointRecoveryObject // Act obj.SetObject(fernTestValueObject) @@ -50341,7 +49125,7 @@ func TestSettersMarkExplicitHookPortalSession(t *testing.T) { t.Run("SetID_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookPortalSession{} + obj := &HookEndpointRecovery{} var fernTestValueID string // Act @@ -50369,14 +49153,14 @@ func TestSettersMarkExplicitHookPortalSession(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetApplicationID_MarksExplicit", func(t *testing.T) { + t.Run("SetEndpointID_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookPortalSession{} - var fernTestValueApplicationID string + obj := &HookEndpointRecovery{} + var fernTestValueEndpointID string // Act - obj.SetApplicationID(fernTestValueApplicationID) + obj.SetEndpointID(fernTestValueEndpointID) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -50400,14 +49184,14 @@ func TestSettersMarkExplicitHookPortalSession(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetURL_MarksExplicit", func(t *testing.T) { + t.Run("SetSince_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookPortalSession{} - var fernTestValueURL string + obj := &HookEndpointRecovery{} + var fernTestValueSince time.Time // Act - obj.SetURL(fernTestValueURL) + obj.SetSince(fernTestValueSince) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -50431,14 +49215,14 @@ func TestSettersMarkExplicitHookPortalSession(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetToken_MarksExplicit", func(t *testing.T) { + t.Run("SetUntil_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookPortalSession{} - var fernTestValueToken string + obj := &HookEndpointRecovery{} + var fernTestValueUntil time.Time // Act - obj.SetToken(fernTestValueToken) + obj.SetUntil(fernTestValueUntil) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -50462,14 +49246,14 @@ func TestSettersMarkExplicitHookPortalSession(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetReadOnly_MarksExplicit", func(t *testing.T) { + t.Run("SetStatus_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookPortalSession{} - var fernTestValueReadOnly bool + obj := &HookEndpointRecovery{} + var fernTestValueStatus HookEndpointRecoveryStatus // Act - obj.SetReadOnly(fernTestValueReadOnly) + obj.SetStatus(fernTestValueStatus) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -50493,14 +49277,76 @@ func TestSettersMarkExplicitHookPortalSession(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetExpiresAt_MarksExplicit", func(t *testing.T) { + t.Run("SetRequeued_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &HookPortalSession{} - var fernTestValueExpiresAt time.Time + obj := &HookEndpointRecovery{} + var fernTestValueRequeued int64 // Act - obj.SetExpiresAt(fernTestValueExpiresAt) + obj.SetRequeued(fernTestValueRequeued) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetCreatedAt_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &HookEndpointRecovery{} + var fernTestValueCreatedAt time.Time + + // Act + obj.SetCreatedAt(fernTestValueCreatedAt) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetCompletedAt_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &HookEndpointRecovery{} + var fernTestValueCompletedAt *time.Time + + // Act + obj.SetCompletedAt(fernTestValueCompletedAt) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -50526,39 +49372,31 @@ func TestSettersMarkExplicitHookPortalSession(t *testing.T) { } -func TestSettersInboundAddress(t *testing.T) { +func TestSettersHookEndpointSecret(t *testing.T) { t.Run("SetObject", func(t *testing.T) { - obj := &InboundAddress{} - var fernTestValueObject InboundAddressObject + obj := &HookEndpointSecret{} + var fernTestValueObject HookEndpointSecretObject obj.SetObject(fernTestValueObject) assert.Equal(t, fernTestValueObject, obj.Object) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetEnvironmentID", func(t *testing.T) { - obj := &InboundAddress{} - var fernTestValueEnvironmentID string - obj.SetEnvironmentID(fernTestValueEnvironmentID) - assert.Equal(t, fernTestValueEnvironmentID, obj.EnvironmentID) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetDomain", func(t *testing.T) { - obj := &InboundAddress{} - var fernTestValueDomain string - obj.SetDomain(fernTestValueDomain) - assert.Equal(t, fernTestValueDomain, obj.Domain) + t.Run("SetSecret", func(t *testing.T) { + obj := &HookEndpointSecret{} + var fernTestValueSecret string + obj.SetSecret(fernTestValueSecret) + assert.Equal(t, fernTestValueSecret, obj.Secret) assert.NotNil(t, obj.explicitFields) }) } -func TestGettersInboundAddress(t *testing.T) { +func TestGettersHookEndpointSecret(t *testing.T) { t.Run("GetObject", func(t *testing.T) { t.Parallel() // Arrange - obj := &InboundAddress{} - var expected InboundAddressObject + obj := &HookEndpointSecret{} + var expected HookEndpointSecretObject obj.Object = expected // Act & Assert @@ -50567,7 +49405,7 @@ func TestGettersInboundAddress(t *testing.T) { t.Run("GetObject_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *InboundAddress + var obj *HookEndpointSecret // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -50577,60 +49415,37 @@ func TestGettersInboundAddress(t *testing.T) { _ = obj.GetObject() // Should return zero value }) - t.Run("GetEnvironmentID", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &InboundAddress{} - var expected string - obj.EnvironmentID = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetEnvironmentID(), "getter should return the property value") - }) - - t.Run("GetEnvironmentID_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *InboundAddress - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetEnvironmentID() // Should return zero value - }) - - t.Run("GetDomain", func(t *testing.T) { + t.Run("GetSecret", func(t *testing.T) { t.Parallel() // Arrange - obj := &InboundAddress{} + obj := &HookEndpointSecret{} var expected string - obj.Domain = expected + obj.Secret = expected // Act & Assert - assert.Equal(t, expected, obj.GetDomain(), "getter should return the property value") + assert.Equal(t, expected, obj.GetSecret(), "getter should return the property value") }) - t.Run("GetDomain_NilReceiver", func(t *testing.T) { + t.Run("GetSecret_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *InboundAddress + var obj *HookEndpointSecret // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetDomain() // Should return zero value + _ = obj.GetSecret() // Should return zero value }) } -func TestSettersMarkExplicitInboundAddress(t *testing.T) { +func TestSettersMarkExplicitHookEndpointSecret(t *testing.T) { t.Run("SetObject_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &InboundAddress{} - var fernTestValueObject InboundAddressObject + obj := &HookEndpointSecret{} + var fernTestValueObject HookEndpointSecretObject // Act obj.SetObject(fernTestValueObject) @@ -50657,45 +49472,14 @@ func TestSettersMarkExplicitInboundAddress(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetEnvironmentID_MarksExplicit", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &InboundAddress{} - var fernTestValueEnvironmentID string - - // Act - obj.SetEnvironmentID(fernTestValueEnvironmentID) - - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") - - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } - - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip - }) - - t.Run("SetDomain_MarksExplicit", func(t *testing.T) { + t.Run("SetSecret_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &InboundAddress{} - var fernTestValueDomain string + obj := &HookEndpointSecret{} + var fernTestValueSecret string // Act - obj.SetDomain(fernTestValueDomain) + obj.SetSecret(fernTestValueSecret) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -50721,207 +49505,143 @@ func TestSettersMarkExplicitInboundAddress(t *testing.T) { } -func TestSettersInboxMessage(t *testing.T) { +func TestSettersHookEndpointWithSecret(t *testing.T) { t.Run("SetObject", func(t *testing.T) { - obj := &InboxMessage{} - var fernTestValueObject InboxMessageObject + obj := &HookEndpointWithSecret{} + var fernTestValueObject HookEndpointWithSecretObject obj.SetObject(fernTestValueObject) assert.Equal(t, fernTestValueObject, obj.Object) assert.NotNil(t, obj.explicitFields) }) t.Run("SetID", func(t *testing.T) { - obj := &InboxMessage{} + obj := &HookEndpointWithSecret{} var fernTestValueID string obj.SetID(fernTestValueID) assert.Equal(t, fernTestValueID, obj.ID) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetInboxID", func(t *testing.T) { - obj := &InboxMessage{} - var fernTestValueInboxID string - obj.SetInboxID(fernTestValueInboxID) - assert.Equal(t, fernTestValueInboxID, obj.InboxID) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetThreadID", func(t *testing.T) { - obj := &InboxMessage{} - var fernTestValueThreadID string - obj.SetThreadID(fernTestValueThreadID) - assert.Equal(t, fernTestValueThreadID, obj.ThreadID) + t.Run("SetApplicationID", func(t *testing.T) { + obj := &HookEndpointWithSecret{} + var fernTestValueApplicationID string + obj.SetApplicationID(fernTestValueApplicationID) + assert.Equal(t, fernTestValueApplicationID, obj.ApplicationID) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetDirection", func(t *testing.T) { - obj := &InboxMessage{} - var fernTestValueDirection InboxMessageDirection - obj.SetDirection(fernTestValueDirection) - assert.Equal(t, fernTestValueDirection, obj.Direction) + t.Run("SetURL", func(t *testing.T) { + obj := &HookEndpointWithSecret{} + var fernTestValueURL string + obj.SetURL(fernTestValueURL) + assert.Equal(t, fernTestValueURL, obj.URL) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetStatus", func(t *testing.T) { - obj := &InboxMessage{} - var fernTestValueStatus InboxMessageStatus - obj.SetStatus(fernTestValueStatus) - assert.Equal(t, fernTestValueStatus, obj.Status) + t.Run("SetDescription", func(t *testing.T) { + obj := &HookEndpointWithSecret{} + var fernTestValueDescription *string + obj.SetDescription(fernTestValueDescription) + assert.Equal(t, fernTestValueDescription, obj.Description) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetFrom", func(t *testing.T) { - obj := &InboxMessage{} - var fernTestValueFrom *string - obj.SetFrom(fernTestValueFrom) - assert.Equal(t, fernTestValueFrom, obj.From) + t.Run("SetFilterTypes", func(t *testing.T) { + obj := &HookEndpointWithSecret{} + var fernTestValueFilterTypes []string + obj.SetFilterTypes(fernTestValueFilterTypes) + assert.Equal(t, fernTestValueFilterTypes, obj.FilterTypes) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetTo", func(t *testing.T) { - obj := &InboxMessage{} - var fernTestValueTo []string - obj.SetTo(fernTestValueTo) - assert.Equal(t, fernTestValueTo, obj.To) + t.Run("SetRateLimitPerSecond", func(t *testing.T) { + obj := &HookEndpointWithSecret{} + var fernTestValueRateLimitPerSecond *int64 + obj.SetRateLimitPerSecond(fernTestValueRateLimitPerSecond) + assert.Equal(t, fernTestValueRateLimitPerSecond, obj.RateLimitPerSecond) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetCc", func(t *testing.T) { - obj := &InboxMessage{} - var fernTestValueCc []string - obj.SetCc(fernTestValueCc) - assert.Equal(t, fernTestValueCc, obj.Cc) + t.Run("SetEnabled", func(t *testing.T) { + obj := &HookEndpointWithSecret{} + var fernTestValueEnabled bool + obj.SetEnabled(fernTestValueEnabled) + assert.Equal(t, fernTestValueEnabled, obj.Enabled) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetSubject", func(t *testing.T) { - obj := &InboxMessage{} - var fernTestValueSubject *string - obj.SetSubject(fernTestValueSubject) - assert.Equal(t, fernTestValueSubject, obj.Subject) + t.Run("SetDisabledReason", func(t *testing.T) { + obj := &HookEndpointWithSecret{} + var fernTestValueDisabledReason *HookEndpointWithSecretDisabledReason + obj.SetDisabledReason(fernTestValueDisabledReason) + assert.Equal(t, fernTestValueDisabledReason, obj.DisabledReason) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetPreview", func(t *testing.T) { - obj := &InboxMessage{} - var fernTestValuePreview *string - obj.SetPreview(fernTestValuePreview) - assert.Equal(t, fernTestValuePreview, obj.Preview) + t.Run("SetDisabledAt", func(t *testing.T) { + obj := &HookEndpointWithSecret{} + var fernTestValueDisabledAt *time.Time + obj.SetDisabledAt(fernTestValueDisabledAt) + assert.Equal(t, fernTestValueDisabledAt, obj.DisabledAt) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetAttachments", func(t *testing.T) { - obj := &InboxMessage{} - var fernTestValueAttachments []*ReceivedEmailAttachment - obj.SetAttachments(fernTestValueAttachments) - assert.Equal(t, fernTestValueAttachments, obj.Attachments) + t.Run("SetFailingSince", func(t *testing.T) { + obj := &HookEndpointWithSecret{} + var fernTestValueFailingSince *time.Time + obj.SetFailingSince(fernTestValueFailingSince) + assert.Equal(t, fernTestValueFailingSince, obj.FailingSince) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetSpam", func(t *testing.T) { - obj := &InboxMessage{} - var fernTestValueSpam bool - obj.SetSpam(fernTestValueSpam) - assert.Equal(t, fernTestValueSpam, obj.Spam) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetReceivedEmailID", func(t *testing.T) { - obj := &InboxMessage{} - var fernTestValueReceivedEmailID *string - obj.SetReceivedEmailID(fernTestValueReceivedEmailID) - assert.Equal(t, fernTestValueReceivedEmailID, obj.ReceivedEmailID) + t.Run("SetPreviousSecretExpiresAt", func(t *testing.T) { + obj := &HookEndpointWithSecret{} + var fernTestValuePreviousSecretExpiresAt *time.Time + obj.SetPreviousSecretExpiresAt(fernTestValuePreviousSecretExpiresAt) + assert.Equal(t, fernTestValuePreviousSecretExpiresAt, obj.PreviousSecretExpiresAt) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetEmailID", func(t *testing.T) { - obj := &InboxMessage{} - var fernTestValueEmailID *string - obj.SetEmailID(fernTestValueEmailID) - assert.Equal(t, fernTestValueEmailID, obj.EmailID) + t.Run("SetMetadata", func(t *testing.T) { + obj := &HookEndpointWithSecret{} + var fernTestValueMetadata map[string]string + obj.SetMetadata(fernTestValueMetadata) + assert.Equal(t, fernTestValueMetadata, obj.Metadata) assert.NotNil(t, obj.explicitFields) }) t.Run("SetCreatedAt", func(t *testing.T) { - obj := &InboxMessage{} + obj := &HookEndpointWithSecret{} var fernTestValueCreatedAt time.Time obj.SetCreatedAt(fernTestValueCreatedAt) assert.Equal(t, fernTestValueCreatedAt, obj.CreatedAt) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetReplyTo", func(t *testing.T) { - obj := &InboxMessage{} - var fernTestValueReplyTo []string - obj.SetReplyTo(fernTestValueReplyTo) - assert.Equal(t, fernTestValueReplyTo, obj.ReplyTo) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetMessageID", func(t *testing.T) { - obj := &InboxMessage{} - var fernTestValueMessageID *string - obj.SetMessageID(fernTestValueMessageID) - assert.Equal(t, fernTestValueMessageID, obj.MessageID) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetInReplyTo", func(t *testing.T) { - obj := &InboxMessage{} - var fernTestValueInReplyTo *string - obj.SetInReplyTo(fernTestValueInReplyTo) - assert.Equal(t, fernTestValueInReplyTo, obj.InReplyTo) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetReferences", func(t *testing.T) { - obj := &InboxMessage{} - var fernTestValueReferences []string - obj.SetReferences(fernTestValueReferences) - assert.Equal(t, fernTestValueReferences, obj.References) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetText", func(t *testing.T) { - obj := &InboxMessage{} - var fernTestValueText *string - obj.SetText(fernTestValueText) - assert.Equal(t, fernTestValueText, obj.Text) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetExtractedText", func(t *testing.T) { - obj := &InboxMessage{} - var fernTestValueExtractedText *string - obj.SetExtractedText(fernTestValueExtractedText) - assert.Equal(t, fernTestValueExtractedText, obj.ExtractedText) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetHTML", func(t *testing.T) { - obj := &InboxMessage{} - var fernTestValueHTML *string - obj.SetHTML(fernTestValueHTML) - assert.Equal(t, fernTestValueHTML, obj.HTML) + t.Run("SetUpdatedAt", func(t *testing.T) { + obj := &HookEndpointWithSecret{} + var fernTestValueUpdatedAt time.Time + obj.SetUpdatedAt(fernTestValueUpdatedAt) + assert.Equal(t, fernTestValueUpdatedAt, obj.UpdatedAt) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetTruncated", func(t *testing.T) { - obj := &InboxMessage{} - var fernTestValueTruncated bool - obj.SetTruncated(fernTestValueTruncated) - assert.Equal(t, fernTestValueTruncated, obj.Truncated) + t.Run("SetSecret", func(t *testing.T) { + obj := &HookEndpointWithSecret{} + var fernTestValueSecret string + obj.SetSecret(fernTestValueSecret) + assert.Equal(t, fernTestValueSecret, obj.Secret) assert.NotNil(t, obj.explicitFields) }) } -func TestGettersInboxMessage(t *testing.T) { +func TestGettersHookEndpointWithSecret(t *testing.T) { t.Run("GetObject", func(t *testing.T) { t.Parallel() // Arrange - obj := &InboxMessage{} - var expected InboxMessageObject + obj := &HookEndpointWithSecret{} + var expected HookEndpointWithSecretObject obj.Object = expected // Act & Assert @@ -50930,7 +49650,7 @@ func TestGettersInboxMessage(t *testing.T) { t.Run("GetObject_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *InboxMessage + var obj *HookEndpointWithSecret // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -50943,7 +49663,7 @@ func TestGettersInboxMessage(t *testing.T) { t.Run("GetID", func(t *testing.T) { t.Parallel() // Arrange - obj := &InboxMessage{} + obj := &HookEndpointWithSecret{} var expected string obj.ID = expected @@ -50953,7 +49673,7 @@ func TestGettersInboxMessage(t *testing.T) { t.Run("GetID_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *InboxMessage + var obj *HookEndpointWithSecret // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -50963,389 +49683,343 @@ func TestGettersInboxMessage(t *testing.T) { _ = obj.GetID() // Should return zero value }) - t.Run("GetInboxID", func(t *testing.T) { + t.Run("GetApplicationID", func(t *testing.T) { t.Parallel() // Arrange - obj := &InboxMessage{} + obj := &HookEndpointWithSecret{} var expected string - obj.InboxID = expected + obj.ApplicationID = expected // Act & Assert - assert.Equal(t, expected, obj.GetInboxID(), "getter should return the property value") + assert.Equal(t, expected, obj.GetApplicationID(), "getter should return the property value") }) - t.Run("GetInboxID_NilReceiver", func(t *testing.T) { + t.Run("GetApplicationID_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *InboxMessage + var obj *HookEndpointWithSecret // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetInboxID() // Should return zero value + _ = obj.GetApplicationID() // Should return zero value }) - t.Run("GetThreadID", func(t *testing.T) { + t.Run("GetURL", func(t *testing.T) { t.Parallel() // Arrange - obj := &InboxMessage{} + obj := &HookEndpointWithSecret{} var expected string - obj.ThreadID = expected + obj.URL = expected // Act & Assert - assert.Equal(t, expected, obj.GetThreadID(), "getter should return the property value") + assert.Equal(t, expected, obj.GetURL(), "getter should return the property value") }) - t.Run("GetThreadID_NilReceiver", func(t *testing.T) { + t.Run("GetURL_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *InboxMessage + var obj *HookEndpointWithSecret // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetThreadID() // Should return zero value + _ = obj.GetURL() // Should return zero value }) - t.Run("GetDirection", func(t *testing.T) { + t.Run("GetDescription", func(t *testing.T) { t.Parallel() // Arrange - obj := &InboxMessage{} - var expected InboxMessageDirection - obj.Direction = expected + obj := &HookEndpointWithSecret{} + var expected *string + obj.Description = expected // Act & Assert - assert.Equal(t, expected, obj.GetDirection(), "getter should return the property value") - }) - - t.Run("GetDirection_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *InboxMessage - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetDirection() // Should return zero value + assert.Equal(t, expected, obj.GetDescription(), "getter should return the property value") }) - t.Run("GetStatus", func(t *testing.T) { + t.Run("GetDescription_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &InboxMessage{} - var expected InboxMessageStatus - obj.Status = expected + obj := &HookEndpointWithSecret{} + obj.Description = nil // Act & Assert - assert.Equal(t, expected, obj.GetStatus(), "getter should return the property value") + assert.Nil(t, obj.GetDescription(), "getter should return nil when property is nil") }) - t.Run("GetStatus_NilReceiver", func(t *testing.T) { + t.Run("GetDescription_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *InboxMessage + var obj *HookEndpointWithSecret // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetStatus() // Should return zero value + _ = obj.GetDescription() // Should return zero value }) - t.Run("GetFrom", func(t *testing.T) { + t.Run("GetFilterTypes", func(t *testing.T) { t.Parallel() // Arrange - obj := &InboxMessage{} - var expected *string - obj.From = expected + obj := &HookEndpointWithSecret{} + var expected []string + obj.FilterTypes = expected // Act & Assert - assert.Equal(t, expected, obj.GetFrom(), "getter should return the property value") + assert.Equal(t, expected, obj.GetFilterTypes(), "getter should return the property value") }) - t.Run("GetFrom_NilValue", func(t *testing.T) { + t.Run("GetFilterTypes_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &InboxMessage{} - obj.From = nil + obj := &HookEndpointWithSecret{} + obj.FilterTypes = nil // Act & Assert - assert.Nil(t, obj.GetFrom(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetFilterTypes(), "getter should return nil when property is nil") }) - t.Run("GetFrom_NilReceiver", func(t *testing.T) { + t.Run("GetFilterTypes_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *InboxMessage + var obj *HookEndpointWithSecret // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetFrom() // Should return zero value + _ = obj.GetFilterTypes() // Should return zero value }) - t.Run("GetTo", func(t *testing.T) { + t.Run("GetRateLimitPerSecond", func(t *testing.T) { t.Parallel() // Arrange - obj := &InboxMessage{} - var expected []string - obj.To = expected + obj := &HookEndpointWithSecret{} + var expected *int64 + obj.RateLimitPerSecond = expected // Act & Assert - assert.Equal(t, expected, obj.GetTo(), "getter should return the property value") + assert.Equal(t, expected, obj.GetRateLimitPerSecond(), "getter should return the property value") }) - t.Run("GetTo_NilValue", func(t *testing.T) { + t.Run("GetRateLimitPerSecond_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &InboxMessage{} - obj.To = nil + obj := &HookEndpointWithSecret{} + obj.RateLimitPerSecond = nil // Act & Assert - assert.Nil(t, obj.GetTo(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetRateLimitPerSecond(), "getter should return nil when property is nil") }) - t.Run("GetTo_NilReceiver", func(t *testing.T) { + t.Run("GetRateLimitPerSecond_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *InboxMessage + var obj *HookEndpointWithSecret // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetTo() // Should return zero value - }) - - t.Run("GetCc", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &InboxMessage{} - var expected []string - obj.Cc = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetCc(), "getter should return the property value") + _ = obj.GetRateLimitPerSecond() // Should return zero value }) - t.Run("GetCc_NilValue", func(t *testing.T) { + t.Run("GetEnabled", func(t *testing.T) { t.Parallel() // Arrange - obj := &InboxMessage{} - obj.Cc = nil + obj := &HookEndpointWithSecret{} + var expected bool + obj.Enabled = expected // Act & Assert - assert.Nil(t, obj.GetCc(), "getter should return nil when property is nil") + assert.Equal(t, expected, obj.GetEnabled(), "getter should return the property value") }) - t.Run("GetCc_NilReceiver", func(t *testing.T) { + t.Run("GetEnabled_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *InboxMessage + var obj *HookEndpointWithSecret // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetCc() // Should return zero value + _ = obj.GetEnabled() // Should return zero value }) - t.Run("GetSubject", func(t *testing.T) { + t.Run("GetDisabledReason", func(t *testing.T) { t.Parallel() // Arrange - obj := &InboxMessage{} - var expected *string - obj.Subject = expected + obj := &HookEndpointWithSecret{} + var expected *HookEndpointWithSecretDisabledReason + obj.DisabledReason = expected // Act & Assert - assert.Equal(t, expected, obj.GetSubject(), "getter should return the property value") + assert.Equal(t, expected, obj.GetDisabledReason(), "getter should return the property value") }) - t.Run("GetSubject_NilValue", func(t *testing.T) { + t.Run("GetDisabledReason_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &InboxMessage{} - obj.Subject = nil + obj := &HookEndpointWithSecret{} + obj.DisabledReason = nil // Act & Assert - assert.Nil(t, obj.GetSubject(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetDisabledReason(), "getter should return nil when property is nil") }) - t.Run("GetSubject_NilReceiver", func(t *testing.T) { + t.Run("GetDisabledReason_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *InboxMessage + var obj *HookEndpointWithSecret // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetSubject() // Should return zero value + _ = obj.GetDisabledReason() // Should return zero value }) - t.Run("GetPreview", func(t *testing.T) { + t.Run("GetDisabledAt", func(t *testing.T) { t.Parallel() // Arrange - obj := &InboxMessage{} - var expected *string - obj.Preview = expected + obj := &HookEndpointWithSecret{} + var expected *time.Time + obj.DisabledAt = expected // Act & Assert - assert.Equal(t, expected, obj.GetPreview(), "getter should return the property value") + assert.Equal(t, expected, obj.GetDisabledAt(), "getter should return the property value") }) - t.Run("GetPreview_NilValue", func(t *testing.T) { + t.Run("GetDisabledAt_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &InboxMessage{} - obj.Preview = nil + obj := &HookEndpointWithSecret{} + obj.DisabledAt = nil // Act & Assert - assert.Nil(t, obj.GetPreview(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetDisabledAt(), "getter should return nil when property is nil") }) - t.Run("GetPreview_NilReceiver", func(t *testing.T) { + t.Run("GetDisabledAt_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *InboxMessage + var obj *HookEndpointWithSecret // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetPreview() // Should return zero value - }) - - t.Run("GetAttachments", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &InboxMessage{} - var expected []*ReceivedEmailAttachment - obj.Attachments = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetAttachments(), "getter should return the property value") + _ = obj.GetDisabledAt() // Should return zero value }) - t.Run("GetAttachments_NilValue", func(t *testing.T) { + t.Run("GetFailingSince", func(t *testing.T) { t.Parallel() // Arrange - obj := &InboxMessage{} - obj.Attachments = nil + obj := &HookEndpointWithSecret{} + var expected *time.Time + obj.FailingSince = expected // Act & Assert - assert.Nil(t, obj.GetAttachments(), "getter should return nil when property is nil") - }) - - t.Run("GetAttachments_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *InboxMessage - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetAttachments() // Should return zero value + assert.Equal(t, expected, obj.GetFailingSince(), "getter should return the property value") }) - t.Run("GetSpam", func(t *testing.T) { + t.Run("GetFailingSince_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &InboxMessage{} - var expected bool - obj.Spam = expected + obj := &HookEndpointWithSecret{} + obj.FailingSince = nil // Act & Assert - assert.Equal(t, expected, obj.GetSpam(), "getter should return the property value") + assert.Nil(t, obj.GetFailingSince(), "getter should return nil when property is nil") }) - t.Run("GetSpam_NilReceiver", func(t *testing.T) { + t.Run("GetFailingSince_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *InboxMessage + var obj *HookEndpointWithSecret // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetSpam() // Should return zero value + _ = obj.GetFailingSince() // Should return zero value }) - t.Run("GetReceivedEmailID", func(t *testing.T) { + t.Run("GetPreviousSecretExpiresAt", func(t *testing.T) { t.Parallel() // Arrange - obj := &InboxMessage{} - var expected *string - obj.ReceivedEmailID = expected + obj := &HookEndpointWithSecret{} + var expected *time.Time + obj.PreviousSecretExpiresAt = expected // Act & Assert - assert.Equal(t, expected, obj.GetReceivedEmailID(), "getter should return the property value") + assert.Equal(t, expected, obj.GetPreviousSecretExpiresAt(), "getter should return the property value") }) - t.Run("GetReceivedEmailID_NilValue", func(t *testing.T) { + t.Run("GetPreviousSecretExpiresAt_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &InboxMessage{} - obj.ReceivedEmailID = nil + obj := &HookEndpointWithSecret{} + obj.PreviousSecretExpiresAt = nil // Act & Assert - assert.Nil(t, obj.GetReceivedEmailID(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetPreviousSecretExpiresAt(), "getter should return nil when property is nil") }) - t.Run("GetReceivedEmailID_NilReceiver", func(t *testing.T) { + t.Run("GetPreviousSecretExpiresAt_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *InboxMessage + var obj *HookEndpointWithSecret // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetReceivedEmailID() // Should return zero value + _ = obj.GetPreviousSecretExpiresAt() // Should return zero value }) - t.Run("GetEmailID", func(t *testing.T) { + t.Run("GetMetadata", func(t *testing.T) { t.Parallel() // Arrange - obj := &InboxMessage{} - var expected *string - obj.EmailID = expected + obj := &HookEndpointWithSecret{} + var expected map[string]string + obj.Metadata = expected // Act & Assert - assert.Equal(t, expected, obj.GetEmailID(), "getter should return the property value") + assert.Equal(t, expected, obj.GetMetadata(), "getter should return the property value") }) - t.Run("GetEmailID_NilValue", func(t *testing.T) { + t.Run("GetMetadata_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &InboxMessage{} - obj.EmailID = nil + obj := &HookEndpointWithSecret{} + obj.Metadata = nil // Act & Assert - assert.Nil(t, obj.GetEmailID(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetMetadata(), "getter should return nil when property is nil") }) - t.Run("GetEmailID_NilReceiver", func(t *testing.T) { + t.Run("GetMetadata_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *InboxMessage + var obj *HookEndpointWithSecret // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetEmailID() // Should return zero value + _ = obj.GetMetadata() // Should return zero value }) t.Run("GetCreatedAt", func(t *testing.T) { t.Parallel() // Arrange - obj := &InboxMessage{} + obj := &HookEndpointWithSecret{} var expected time.Time obj.CreatedAt = expected @@ -51355,7 +50029,7 @@ func TestGettersInboxMessage(t *testing.T) { t.Run("GetCreatedAt_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *InboxMessage + var obj *HookEndpointWithSecret // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -51365,268 +50039,60 @@ func TestGettersInboxMessage(t *testing.T) { _ = obj.GetCreatedAt() // Should return zero value }) - t.Run("GetReplyTo", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &InboxMessage{} - var expected []string - obj.ReplyTo = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetReplyTo(), "getter should return the property value") - }) - - t.Run("GetReplyTo_NilValue", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &InboxMessage{} - obj.ReplyTo = nil - - // Act & Assert - assert.Nil(t, obj.GetReplyTo(), "getter should return nil when property is nil") - }) - - t.Run("GetReplyTo_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *InboxMessage - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetReplyTo() // Should return zero value - }) - - t.Run("GetMessageID", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &InboxMessage{} - var expected *string - obj.MessageID = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetMessageID(), "getter should return the property value") - }) - - t.Run("GetMessageID_NilValue", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &InboxMessage{} - obj.MessageID = nil - - // Act & Assert - assert.Nil(t, obj.GetMessageID(), "getter should return nil when property is nil") - }) - - t.Run("GetMessageID_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *InboxMessage - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetMessageID() // Should return zero value - }) - - t.Run("GetInReplyTo", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &InboxMessage{} - var expected *string - obj.InReplyTo = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetInReplyTo(), "getter should return the property value") - }) - - t.Run("GetInReplyTo_NilValue", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &InboxMessage{} - obj.InReplyTo = nil - - // Act & Assert - assert.Nil(t, obj.GetInReplyTo(), "getter should return nil when property is nil") - }) - - t.Run("GetInReplyTo_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *InboxMessage - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetInReplyTo() // Should return zero value - }) - - t.Run("GetReferences", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &InboxMessage{} - var expected []string - obj.References = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetReferences(), "getter should return the property value") - }) - - t.Run("GetReferences_NilValue", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &InboxMessage{} - obj.References = nil - - // Act & Assert - assert.Nil(t, obj.GetReferences(), "getter should return nil when property is nil") - }) - - t.Run("GetReferences_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *InboxMessage - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetReferences() // Should return zero value - }) - - t.Run("GetText", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &InboxMessage{} - var expected *string - obj.Text = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetText(), "getter should return the property value") - }) - - t.Run("GetText_NilValue", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &InboxMessage{} - obj.Text = nil - - // Act & Assert - assert.Nil(t, obj.GetText(), "getter should return nil when property is nil") - }) - - t.Run("GetText_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *InboxMessage - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetText() // Should return zero value - }) - - t.Run("GetExtractedText", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &InboxMessage{} - var expected *string - obj.ExtractedText = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetExtractedText(), "getter should return the property value") - }) - - t.Run("GetExtractedText_NilValue", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &InboxMessage{} - obj.ExtractedText = nil - - // Act & Assert - assert.Nil(t, obj.GetExtractedText(), "getter should return nil when property is nil") - }) - - t.Run("GetExtractedText_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *InboxMessage - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetExtractedText() // Should return zero value - }) - - t.Run("GetHTML", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &InboxMessage{} - var expected *string - obj.HTML = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetHTML(), "getter should return the property value") - }) - - t.Run("GetHTML_NilValue", func(t *testing.T) { + t.Run("GetUpdatedAt", func(t *testing.T) { t.Parallel() // Arrange - obj := &InboxMessage{} - obj.HTML = nil + obj := &HookEndpointWithSecret{} + var expected time.Time + obj.UpdatedAt = expected // Act & Assert - assert.Nil(t, obj.GetHTML(), "getter should return nil when property is nil") + assert.Equal(t, expected, obj.GetUpdatedAt(), "getter should return the property value") }) - t.Run("GetHTML_NilReceiver", func(t *testing.T) { + t.Run("GetUpdatedAt_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *InboxMessage + var obj *HookEndpointWithSecret // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetHTML() // Should return zero value + _ = obj.GetUpdatedAt() // Should return zero value }) - t.Run("GetTruncated", func(t *testing.T) { + t.Run("GetSecret", func(t *testing.T) { t.Parallel() // Arrange - obj := &InboxMessage{} - var expected bool - obj.Truncated = expected + obj := &HookEndpointWithSecret{} + var expected string + obj.Secret = expected // Act & Assert - assert.Equal(t, expected, obj.GetTruncated(), "getter should return the property value") + assert.Equal(t, expected, obj.GetSecret(), "getter should return the property value") }) - t.Run("GetTruncated_NilReceiver", func(t *testing.T) { + t.Run("GetSecret_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *InboxMessage + var obj *HookEndpointWithSecret // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetTruncated() // Should return zero value + _ = obj.GetSecret() // Should return zero value }) } -func TestSettersMarkExplicitInboxMessage(t *testing.T) { +func TestSettersMarkExplicitHookEndpointWithSecret(t *testing.T) { t.Run("SetObject_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &InboxMessage{} - var fernTestValueObject InboxMessageObject + obj := &HookEndpointWithSecret{} + var fernTestValueObject HookEndpointWithSecretObject // Act obj.SetObject(fernTestValueObject) @@ -51656,7 +50122,7 @@ func TestSettersMarkExplicitInboxMessage(t *testing.T) { t.Run("SetID_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &InboxMessage{} + obj := &HookEndpointWithSecret{} var fernTestValueID string // Act @@ -51684,14 +50150,14 @@ func TestSettersMarkExplicitInboxMessage(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetInboxID_MarksExplicit", func(t *testing.T) { + t.Run("SetApplicationID_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &InboxMessage{} - var fernTestValueInboxID string + obj := &HookEndpointWithSecret{} + var fernTestValueApplicationID string // Act - obj.SetInboxID(fernTestValueInboxID) + obj.SetApplicationID(fernTestValueApplicationID) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -51715,14 +50181,14 @@ func TestSettersMarkExplicitInboxMessage(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetThreadID_MarksExplicit", func(t *testing.T) { + t.Run("SetURL_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &InboxMessage{} - var fernTestValueThreadID string + obj := &HookEndpointWithSecret{} + var fernTestValueURL string // Act - obj.SetThreadID(fernTestValueThreadID) + obj.SetURL(fernTestValueURL) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -51746,14 +50212,14 @@ func TestSettersMarkExplicitInboxMessage(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetDirection_MarksExplicit", func(t *testing.T) { + t.Run("SetDescription_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &InboxMessage{} - var fernTestValueDirection InboxMessageDirection + obj := &HookEndpointWithSecret{} + var fernTestValueDescription *string // Act - obj.SetDirection(fernTestValueDirection) + obj.SetDescription(fernTestValueDescription) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -51777,14 +50243,14 @@ func TestSettersMarkExplicitInboxMessage(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetStatus_MarksExplicit", func(t *testing.T) { + t.Run("SetFilterTypes_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &InboxMessage{} - var fernTestValueStatus InboxMessageStatus + obj := &HookEndpointWithSecret{} + var fernTestValueFilterTypes []string // Act - obj.SetStatus(fernTestValueStatus) + obj.SetFilterTypes(fernTestValueFilterTypes) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -51808,14 +50274,14 @@ func TestSettersMarkExplicitInboxMessage(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetFrom_MarksExplicit", func(t *testing.T) { + t.Run("SetRateLimitPerSecond_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &InboxMessage{} - var fernTestValueFrom *string + obj := &HookEndpointWithSecret{} + var fernTestValueRateLimitPerSecond *int64 // Act - obj.SetFrom(fernTestValueFrom) + obj.SetRateLimitPerSecond(fernTestValueRateLimitPerSecond) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -51839,14 +50305,14 @@ func TestSettersMarkExplicitInboxMessage(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetTo_MarksExplicit", func(t *testing.T) { + t.Run("SetEnabled_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &InboxMessage{} - var fernTestValueTo []string + obj := &HookEndpointWithSecret{} + var fernTestValueEnabled bool // Act - obj.SetTo(fernTestValueTo) + obj.SetEnabled(fernTestValueEnabled) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -51870,14 +50336,14 @@ func TestSettersMarkExplicitInboxMessage(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetCc_MarksExplicit", func(t *testing.T) { + t.Run("SetDisabledReason_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &InboxMessage{} - var fernTestValueCc []string + obj := &HookEndpointWithSecret{} + var fernTestValueDisabledReason *HookEndpointWithSecretDisabledReason // Act - obj.SetCc(fernTestValueCc) + obj.SetDisabledReason(fernTestValueDisabledReason) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -51901,14 +50367,14 @@ func TestSettersMarkExplicitInboxMessage(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetSubject_MarksExplicit", func(t *testing.T) { + t.Run("SetDisabledAt_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &InboxMessage{} - var fernTestValueSubject *string + obj := &HookEndpointWithSecret{} + var fernTestValueDisabledAt *time.Time // Act - obj.SetSubject(fernTestValueSubject) + obj.SetDisabledAt(fernTestValueDisabledAt) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -51932,14 +50398,14 @@ func TestSettersMarkExplicitInboxMessage(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetPreview_MarksExplicit", func(t *testing.T) { + t.Run("SetFailingSince_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &InboxMessage{} - var fernTestValuePreview *string + obj := &HookEndpointWithSecret{} + var fernTestValueFailingSince *time.Time // Act - obj.SetPreview(fernTestValuePreview) + obj.SetFailingSince(fernTestValueFailingSince) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -51963,14 +50429,14 @@ func TestSettersMarkExplicitInboxMessage(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetAttachments_MarksExplicit", func(t *testing.T) { + t.Run("SetPreviousSecretExpiresAt_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &InboxMessage{} - var fernTestValueAttachments []*ReceivedEmailAttachment + obj := &HookEndpointWithSecret{} + var fernTestValuePreviousSecretExpiresAt *time.Time // Act - obj.SetAttachments(fernTestValueAttachments) + obj.SetPreviousSecretExpiresAt(fernTestValuePreviousSecretExpiresAt) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -51994,14 +50460,14 @@ func TestSettersMarkExplicitInboxMessage(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetSpam_MarksExplicit", func(t *testing.T) { + t.Run("SetMetadata_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &InboxMessage{} - var fernTestValueSpam bool + obj := &HookEndpointWithSecret{} + var fernTestValueMetadata map[string]string // Act - obj.SetSpam(fernTestValueSpam) + obj.SetMetadata(fernTestValueMetadata) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -52025,14 +50491,14 @@ func TestSettersMarkExplicitInboxMessage(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetReceivedEmailID_MarksExplicit", func(t *testing.T) { + t.Run("SetCreatedAt_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &InboxMessage{} - var fernTestValueReceivedEmailID *string + obj := &HookEndpointWithSecret{} + var fernTestValueCreatedAt time.Time // Act - obj.SetReceivedEmailID(fernTestValueReceivedEmailID) + obj.SetCreatedAt(fernTestValueCreatedAt) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -52056,14 +50522,14 @@ func TestSettersMarkExplicitInboxMessage(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetEmailID_MarksExplicit", func(t *testing.T) { + t.Run("SetUpdatedAt_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &InboxMessage{} - var fernTestValueEmailID *string + obj := &HookEndpointWithSecret{} + var fernTestValueUpdatedAt time.Time // Act - obj.SetEmailID(fernTestValueEmailID) + obj.SetUpdatedAt(fernTestValueUpdatedAt) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -52087,14 +50553,14 @@ func TestSettersMarkExplicitInboxMessage(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetCreatedAt_MarksExplicit", func(t *testing.T) { + t.Run("SetSecret_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &InboxMessage{} - var fernTestValueCreatedAt time.Time + obj := &HookEndpointWithSecret{} + var fernTestValueSecret string // Act - obj.SetCreatedAt(fernTestValueCreatedAt) + obj.SetSecret(fernTestValueSecret) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -52118,179 +50584,311 @@ func TestSettersMarkExplicitInboxMessage(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetReplyTo_MarksExplicit", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &InboxMessage{} - var fernTestValueReplyTo []string - - // Act - obj.SetReplyTo(fernTestValueReplyTo) +} - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") +func TestSettersHookEventType(t *testing.T) { + t.Run("SetObject", func(t *testing.T) { + obj := &HookEventType{} + var fernTestValueObject HookEventTypeObject + obj.SetObject(fernTestValueObject) + assert.Equal(t, fernTestValueObject, obj.Object) + assert.NotNil(t, obj.explicitFields) + }) - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } + t.Run("SetName", func(t *testing.T) { + obj := &HookEventType{} + var fernTestValueName string + obj.SetName(fernTestValueName) + assert.Equal(t, fernTestValueName, obj.Name) + assert.NotNil(t, obj.explicitFields) + }) - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip + t.Run("SetDescription", func(t *testing.T) { + obj := &HookEventType{} + var fernTestValueDescription *string + obj.SetDescription(fernTestValueDescription) + assert.Equal(t, fernTestValueDescription, obj.Description) + assert.NotNil(t, obj.explicitFields) }) - t.Run("SetMessageID_MarksExplicit", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &InboxMessage{} - var fernTestValueMessageID *string + t.Run("SetSchema", func(t *testing.T) { + obj := &HookEventType{} + var fernTestValueSchema map[string]any + obj.SetSchema(fernTestValueSchema) + assert.Equal(t, fernTestValueSchema, obj.Schema) + assert.NotNil(t, obj.explicitFields) + }) - // Act - obj.SetMessageID(fernTestValueMessageID) + t.Run("SetExamples", func(t *testing.T) { + obj := &HookEventType{} + var fernTestValueExamples []map[string]any + obj.SetExamples(fernTestValueExamples) + assert.Equal(t, fernTestValueExamples, obj.Examples) + assert.NotNil(t, obj.explicitFields) + }) - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") + t.Run("SetArchived", func(t *testing.T) { + obj := &HookEventType{} + var fernTestValueArchived bool + obj.SetArchived(fernTestValueArchived) + assert.Equal(t, fernTestValueArchived, obj.Archived) + assert.NotNil(t, obj.explicitFields) + }) - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } + t.Run("SetCreatedAt", func(t *testing.T) { + obj := &HookEventType{} + var fernTestValueCreatedAt time.Time + obj.SetCreatedAt(fernTestValueCreatedAt) + assert.Equal(t, fernTestValueCreatedAt, obj.CreatedAt) + assert.NotNil(t, obj.explicitFields) + }) - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip + t.Run("SetUpdatedAt", func(t *testing.T) { + obj := &HookEventType{} + var fernTestValueUpdatedAt time.Time + obj.SetUpdatedAt(fernTestValueUpdatedAt) + assert.Equal(t, fernTestValueUpdatedAt, obj.UpdatedAt) + assert.NotNil(t, obj.explicitFields) }) - t.Run("SetInReplyTo_MarksExplicit", func(t *testing.T) { +} + +func TestGettersHookEventType(t *testing.T) { + t.Run("GetObject", func(t *testing.T) { t.Parallel() // Arrange - obj := &InboxMessage{} - var fernTestValueInReplyTo *string - - // Act - obj.SetInReplyTo(fernTestValueInReplyTo) - - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") + obj := &HookEventType{} + var expected HookEventTypeObject + obj.Object = expected - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } + // Act & Assert + assert.Equal(t, expected, obj.GetObject(), "getter should return the property value") + }) - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip + t.Run("GetObject_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *HookEventType + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetObject() // Should return zero value }) - t.Run("SetReferences_MarksExplicit", func(t *testing.T) { + t.Run("GetName", func(t *testing.T) { t.Parallel() // Arrange - obj := &InboxMessage{} - var fernTestValueReferences []string + obj := &HookEventType{} + var expected string + obj.Name = expected - // Act - obj.SetReferences(fernTestValueReferences) + // Act & Assert + assert.Equal(t, expected, obj.GetName(), "getter should return the property value") + }) - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") + t.Run("GetName_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *HookEventType + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetName() // Should return zero value + }) - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } + t.Run("GetDescription", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &HookEventType{} + var expected *string + obj.Description = expected - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip + // Act & Assert + assert.Equal(t, expected, obj.GetDescription(), "getter should return the property value") }) - t.Run("SetText_MarksExplicit", func(t *testing.T) { + t.Run("GetDescription_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &InboxMessage{} - var fernTestValueText *string + obj := &HookEventType{} + obj.Description = nil - // Act - obj.SetText(fernTestValueText) + // Act & Assert + assert.Nil(t, obj.GetDescription(), "getter should return nil when property is nil") + }) - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") + t.Run("GetDescription_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *HookEventType + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetDescription() // Should return zero value + }) - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } + t.Run("GetSchema", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &HookEventType{} + var expected map[string]any + obj.Schema = expected - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip + // Act & Assert + assert.Equal(t, expected, obj.GetSchema(), "getter should return the property value") }) - t.Run("SetExtractedText_MarksExplicit", func(t *testing.T) { + t.Run("GetSchema_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &InboxMessage{} - var fernTestValueExtractedText *string - - // Act - obj.SetExtractedText(fernTestValueExtractedText) + obj := &HookEventType{} + obj.Schema = nil - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") + // Act & Assert + assert.Nil(t, obj.GetSchema(), "getter should return nil when property is nil") + }) - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} + t.Run("GetSchema_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *HookEventType + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetSchema() // Should return zero value + }) + + t.Run("GetExamples", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &HookEventType{} + var expected []map[string]any + obj.Examples = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetExamples(), "getter should return the property value") + }) + + t.Run("GetExamples_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &HookEventType{} + obj.Examples = nil + + // Act & Assert + assert.Nil(t, obj.GetExamples(), "getter should return nil when property is nil") + }) + + t.Run("GetExamples_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *HookEventType + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetExamples() // Should return zero value + }) + + t.Run("GetArchived", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &HookEventType{} + var expected bool + obj.Archived = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetArchived(), "getter should return the property value") + }) + + t.Run("GetArchived_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *HookEventType + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetArchived() // Should return zero value + }) + + t.Run("GetCreatedAt", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &HookEventType{} + var expected time.Time + obj.CreatedAt = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetCreatedAt(), "getter should return the property value") + }) + + t.Run("GetCreatedAt_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *HookEventType + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetCreatedAt() // Should return zero value + }) + + t.Run("GetUpdatedAt", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &HookEventType{} + var expected time.Time + obj.UpdatedAt = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetUpdatedAt(), "getter should return the property value") + }) + + t.Run("GetUpdatedAt_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *HookEventType + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetUpdatedAt() // Should return zero value + }) + +} + +func TestSettersMarkExplicitHookEventType(t *testing.T) { + t.Run("SetObject_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &HookEventType{} + var fernTestValueObject HookEventTypeObject + + // Act + obj.SetObject(fernTestValueObject) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} err = json.Unmarshal(bytes, &unmarshaled) require.NoError(t, err, "unmarshaling should succeed for test verification") } else { @@ -52304,14 +50902,14 @@ func TestSettersMarkExplicitInboxMessage(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetHTML_MarksExplicit", func(t *testing.T) { + t.Run("SetName_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &InboxMessage{} - var fernTestValueHTML *string + obj := &HookEventType{} + var fernTestValueName string // Act - obj.SetHTML(fernTestValueHTML) + obj.SetName(fernTestValueName) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -52335,14 +50933,169 @@ func TestSettersMarkExplicitInboxMessage(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetTruncated_MarksExplicit", func(t *testing.T) { + t.Run("SetDescription_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &InboxMessage{} - var fernTestValueTruncated bool + obj := &HookEventType{} + var fernTestValueDescription *string // Act - obj.SetTruncated(fernTestValueTruncated) + obj.SetDescription(fernTestValueDescription) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetSchema_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &HookEventType{} + var fernTestValueSchema map[string]any + + // Act + obj.SetSchema(fernTestValueSchema) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetExamples_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &HookEventType{} + var fernTestValueExamples []map[string]any + + // Act + obj.SetExamples(fernTestValueExamples) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetArchived_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &HookEventType{} + var fernTestValueArchived bool + + // Act + obj.SetArchived(fernTestValueArchived) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetCreatedAt_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &HookEventType{} + var fernTestValueCreatedAt time.Time + + // Act + obj.SetCreatedAt(fernTestValueCreatedAt) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetUpdatedAt_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &HookEventType{} + var fernTestValueUpdatedAt time.Time + + // Act + obj.SetUpdatedAt(fernTestValueUpdatedAt) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -52368,25 +51121,25 @@ func TestSettersMarkExplicitInboxMessage(t *testing.T) { } -func TestSettersInboxMessageList(t *testing.T) { +func TestSettersHookEventTypeList(t *testing.T) { t.Run("SetObject", func(t *testing.T) { - obj := &InboxMessageList{} - var fernTestValueObject InboxMessageListObject + obj := &HookEventTypeList{} + var fernTestValueObject HookEventTypeListObject obj.SetObject(fernTestValueObject) assert.Equal(t, fernTestValueObject, obj.Object) assert.NotNil(t, obj.explicitFields) }) t.Run("SetData", func(t *testing.T) { - obj := &InboxMessageList{} - var fernTestValueData []*InboxMessageSummary + obj := &HookEventTypeList{} + var fernTestValueData []*HookEventType obj.SetData(fernTestValueData) assert.Equal(t, fernTestValueData, obj.Data) assert.NotNil(t, obj.explicitFields) }) t.Run("SetHasMore", func(t *testing.T) { - obj := &InboxMessageList{} + obj := &HookEventTypeList{} var fernTestValueHasMore bool obj.SetHasMore(fernTestValueHasMore) assert.Equal(t, fernTestValueHasMore, obj.HasMore) @@ -52395,12 +51148,12 @@ func TestSettersInboxMessageList(t *testing.T) { } -func TestGettersInboxMessageList(t *testing.T) { +func TestGettersHookEventTypeList(t *testing.T) { t.Run("GetObject", func(t *testing.T) { t.Parallel() // Arrange - obj := &InboxMessageList{} - var expected InboxMessageListObject + obj := &HookEventTypeList{} + var expected HookEventTypeListObject obj.Object = expected // Act & Assert @@ -52409,7 +51162,7 @@ func TestGettersInboxMessageList(t *testing.T) { t.Run("GetObject_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *InboxMessageList + var obj *HookEventTypeList // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -52422,8 +51175,8 @@ func TestGettersInboxMessageList(t *testing.T) { t.Run("GetData", func(t *testing.T) { t.Parallel() // Arrange - obj := &InboxMessageList{} - var expected []*InboxMessageSummary + obj := &HookEventTypeList{} + var expected []*HookEventType obj.Data = expected // Act & Assert @@ -52433,7 +51186,7 @@ func TestGettersInboxMessageList(t *testing.T) { t.Run("GetData_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &InboxMessageList{} + obj := &HookEventTypeList{} obj.Data = nil // Act & Assert @@ -52442,7 +51195,7 @@ func TestGettersInboxMessageList(t *testing.T) { t.Run("GetData_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *InboxMessageList + var obj *HookEventTypeList // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -52455,7 +51208,7 @@ func TestGettersInboxMessageList(t *testing.T) { t.Run("GetHasMore", func(t *testing.T) { t.Parallel() // Arrange - obj := &InboxMessageList{} + obj := &HookEventTypeList{} var expected bool obj.HasMore = expected @@ -52465,7 +51218,7 @@ func TestGettersInboxMessageList(t *testing.T) { t.Run("GetHasMore_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *InboxMessageList + var obj *HookEventTypeList // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -52477,12 +51230,12 @@ func TestGettersInboxMessageList(t *testing.T) { } -func TestSettersMarkExplicitInboxMessageList(t *testing.T) { +func TestSettersMarkExplicitHookEventTypeList(t *testing.T) { t.Run("SetObject_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &InboxMessageList{} - var fernTestValueObject InboxMessageListObject + obj := &HookEventTypeList{} + var fernTestValueObject HookEventTypeListObject // Act obj.SetObject(fernTestValueObject) @@ -52512,8 +51265,8 @@ func TestSettersMarkExplicitInboxMessageList(t *testing.T) { t.Run("SetData_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &InboxMessageList{} - var fernTestValueData []*InboxMessageSummary + obj := &HookEventTypeList{} + var fernTestValueData []*HookEventType // Act obj.SetData(fernTestValueData) @@ -52543,7 +51296,7 @@ func TestSettersMarkExplicitInboxMessageList(t *testing.T) { t.Run("SetHasMore_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &InboxMessageList{} + obj := &HookEventTypeList{} var fernTestValueHasMore bool // Act @@ -52573,129 +51326,49 @@ func TestSettersMarkExplicitInboxMessageList(t *testing.T) { } -func TestSettersInboxMessageSummary(t *testing.T) { +func TestSettersHookMessage(t *testing.T) { t.Run("SetObject", func(t *testing.T) { - obj := &InboxMessageSummary{} - var fernTestValueObject InboxMessageSummaryObject + obj := &HookMessage{} + var fernTestValueObject HookMessageObject obj.SetObject(fernTestValueObject) assert.Equal(t, fernTestValueObject, obj.Object) assert.NotNil(t, obj.explicitFields) }) t.Run("SetID", func(t *testing.T) { - obj := &InboxMessageSummary{} + obj := &HookMessage{} var fernTestValueID string obj.SetID(fernTestValueID) assert.Equal(t, fernTestValueID, obj.ID) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetInboxID", func(t *testing.T) { - obj := &InboxMessageSummary{} - var fernTestValueInboxID string - obj.SetInboxID(fernTestValueInboxID) - assert.Equal(t, fernTestValueInboxID, obj.InboxID) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetThreadID", func(t *testing.T) { - obj := &InboxMessageSummary{} - var fernTestValueThreadID string - obj.SetThreadID(fernTestValueThreadID) - assert.Equal(t, fernTestValueThreadID, obj.ThreadID) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetDirection", func(t *testing.T) { - obj := &InboxMessageSummary{} - var fernTestValueDirection InboxMessageSummaryDirection - obj.SetDirection(fernTestValueDirection) - assert.Equal(t, fernTestValueDirection, obj.Direction) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetStatus", func(t *testing.T) { - obj := &InboxMessageSummary{} - var fernTestValueStatus InboxMessageSummaryStatus - obj.SetStatus(fernTestValueStatus) - assert.Equal(t, fernTestValueStatus, obj.Status) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetFrom", func(t *testing.T) { - obj := &InboxMessageSummary{} - var fernTestValueFrom *string - obj.SetFrom(fernTestValueFrom) - assert.Equal(t, fernTestValueFrom, obj.From) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetTo", func(t *testing.T) { - obj := &InboxMessageSummary{} - var fernTestValueTo []string - obj.SetTo(fernTestValueTo) - assert.Equal(t, fernTestValueTo, obj.To) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetCc", func(t *testing.T) { - obj := &InboxMessageSummary{} - var fernTestValueCc []string - obj.SetCc(fernTestValueCc) - assert.Equal(t, fernTestValueCc, obj.Cc) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetSubject", func(t *testing.T) { - obj := &InboxMessageSummary{} - var fernTestValueSubject *string - obj.SetSubject(fernTestValueSubject) - assert.Equal(t, fernTestValueSubject, obj.Subject) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetPreview", func(t *testing.T) { - obj := &InboxMessageSummary{} - var fernTestValuePreview *string - obj.SetPreview(fernTestValuePreview) - assert.Equal(t, fernTestValuePreview, obj.Preview) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetAttachments", func(t *testing.T) { - obj := &InboxMessageSummary{} - var fernTestValueAttachments []*ReceivedEmailAttachment - obj.SetAttachments(fernTestValueAttachments) - assert.Equal(t, fernTestValueAttachments, obj.Attachments) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetSpam", func(t *testing.T) { - obj := &InboxMessageSummary{} - var fernTestValueSpam bool - obj.SetSpam(fernTestValueSpam) - assert.Equal(t, fernTestValueSpam, obj.Spam) + t.Run("SetApplicationID", func(t *testing.T) { + obj := &HookMessage{} + var fernTestValueApplicationID string + obj.SetApplicationID(fernTestValueApplicationID) + assert.Equal(t, fernTestValueApplicationID, obj.ApplicationID) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetReceivedEmailID", func(t *testing.T) { - obj := &InboxMessageSummary{} - var fernTestValueReceivedEmailID *string - obj.SetReceivedEmailID(fernTestValueReceivedEmailID) - assert.Equal(t, fernTestValueReceivedEmailID, obj.ReceivedEmailID) + t.Run("SetEventType", func(t *testing.T) { + obj := &HookMessage{} + var fernTestValueEventType string + obj.SetEventType(fernTestValueEventType) + assert.Equal(t, fernTestValueEventType, obj.EventType) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetEmailID", func(t *testing.T) { - obj := &InboxMessageSummary{} - var fernTestValueEmailID *string - obj.SetEmailID(fernTestValueEmailID) - assert.Equal(t, fernTestValueEmailID, obj.EmailID) + t.Run("SetPayload", func(t *testing.T) { + obj := &HookMessage{} + var fernTestValuePayload map[string]any + obj.SetPayload(fernTestValuePayload) + assert.Equal(t, fernTestValuePayload, obj.Payload) assert.NotNil(t, obj.explicitFields) }) t.Run("SetCreatedAt", func(t *testing.T) { - obj := &InboxMessageSummary{} + obj := &HookMessage{} var fernTestValueCreatedAt time.Time obj.SetCreatedAt(fernTestValueCreatedAt) assert.Equal(t, fernTestValueCreatedAt, obj.CreatedAt) @@ -52704,12 +51377,12 @@ func TestSettersInboxMessageSummary(t *testing.T) { } -func TestGettersInboxMessageSummary(t *testing.T) { +func TestGettersHookMessage(t *testing.T) { t.Run("GetObject", func(t *testing.T) { t.Parallel() // Arrange - obj := &InboxMessageSummary{} - var expected InboxMessageSummaryObject + obj := &HookMessage{} + var expected HookMessageObject obj.Object = expected // Act & Assert @@ -52718,7 +51391,7 @@ func TestGettersInboxMessageSummary(t *testing.T) { t.Run("GetObject_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *InboxMessageSummary + var obj *HookMessage // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -52731,7 +51404,7 @@ func TestGettersInboxMessageSummary(t *testing.T) { t.Run("GetID", func(t *testing.T) { t.Parallel() // Arrange - obj := &InboxMessageSummary{} + obj := &HookMessage{} var expected string obj.ID = expected @@ -52741,7 +51414,7 @@ func TestGettersInboxMessageSummary(t *testing.T) { t.Run("GetID_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *InboxMessageSummary + var obj *HookMessage // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -52751,389 +51424,89 @@ func TestGettersInboxMessageSummary(t *testing.T) { _ = obj.GetID() // Should return zero value }) - t.Run("GetInboxID", func(t *testing.T) { + t.Run("GetApplicationID", func(t *testing.T) { t.Parallel() // Arrange - obj := &InboxMessageSummary{} + obj := &HookMessage{} var expected string - obj.InboxID = expected + obj.ApplicationID = expected // Act & Assert - assert.Equal(t, expected, obj.GetInboxID(), "getter should return the property value") + assert.Equal(t, expected, obj.GetApplicationID(), "getter should return the property value") }) - t.Run("GetInboxID_NilReceiver", func(t *testing.T) { + t.Run("GetApplicationID_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *InboxMessageSummary + var obj *HookMessage // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetInboxID() // Should return zero value + _ = obj.GetApplicationID() // Should return zero value }) - t.Run("GetThreadID", func(t *testing.T) { + t.Run("GetEventType", func(t *testing.T) { t.Parallel() // Arrange - obj := &InboxMessageSummary{} + obj := &HookMessage{} var expected string - obj.ThreadID = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetThreadID(), "getter should return the property value") - }) - - t.Run("GetThreadID_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *InboxMessageSummary - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetThreadID() // Should return zero value - }) - - t.Run("GetDirection", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &InboxMessageSummary{} - var expected InboxMessageSummaryDirection - obj.Direction = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetDirection(), "getter should return the property value") - }) - - t.Run("GetDirection_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *InboxMessageSummary - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetDirection() // Should return zero value - }) - - t.Run("GetStatus", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &InboxMessageSummary{} - var expected InboxMessageSummaryStatus - obj.Status = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetStatus(), "getter should return the property value") - }) - - t.Run("GetStatus_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *InboxMessageSummary - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetStatus() // Should return zero value - }) - - t.Run("GetFrom", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &InboxMessageSummary{} - var expected *string - obj.From = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetFrom(), "getter should return the property value") - }) - - t.Run("GetFrom_NilValue", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &InboxMessageSummary{} - obj.From = nil - - // Act & Assert - assert.Nil(t, obj.GetFrom(), "getter should return nil when property is nil") - }) - - t.Run("GetFrom_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *InboxMessageSummary - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetFrom() // Should return zero value - }) - - t.Run("GetTo", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &InboxMessageSummary{} - var expected []string - obj.To = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetTo(), "getter should return the property value") - }) - - t.Run("GetTo_NilValue", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &InboxMessageSummary{} - obj.To = nil - - // Act & Assert - assert.Nil(t, obj.GetTo(), "getter should return nil when property is nil") - }) - - t.Run("GetTo_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *InboxMessageSummary - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetTo() // Should return zero value - }) - - t.Run("GetCc", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &InboxMessageSummary{} - var expected []string - obj.Cc = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetCc(), "getter should return the property value") - }) - - t.Run("GetCc_NilValue", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &InboxMessageSummary{} - obj.Cc = nil - - // Act & Assert - assert.Nil(t, obj.GetCc(), "getter should return nil when property is nil") - }) - - t.Run("GetCc_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *InboxMessageSummary - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetCc() // Should return zero value - }) - - t.Run("GetSubject", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &InboxMessageSummary{} - var expected *string - obj.Subject = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetSubject(), "getter should return the property value") - }) - - t.Run("GetSubject_NilValue", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &InboxMessageSummary{} - obj.Subject = nil - - // Act & Assert - assert.Nil(t, obj.GetSubject(), "getter should return nil when property is nil") - }) - - t.Run("GetSubject_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *InboxMessageSummary - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetSubject() // Should return zero value - }) - - t.Run("GetPreview", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &InboxMessageSummary{} - var expected *string - obj.Preview = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetPreview(), "getter should return the property value") - }) - - t.Run("GetPreview_NilValue", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &InboxMessageSummary{} - obj.Preview = nil - - // Act & Assert - assert.Nil(t, obj.GetPreview(), "getter should return nil when property is nil") - }) - - t.Run("GetPreview_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *InboxMessageSummary - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetPreview() // Should return zero value - }) - - t.Run("GetAttachments", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &InboxMessageSummary{} - var expected []*ReceivedEmailAttachment - obj.Attachments = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetAttachments(), "getter should return the property value") - }) - - t.Run("GetAttachments_NilValue", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &InboxMessageSummary{} - obj.Attachments = nil - - // Act & Assert - assert.Nil(t, obj.GetAttachments(), "getter should return nil when property is nil") - }) - - t.Run("GetAttachments_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *InboxMessageSummary - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetAttachments() // Should return zero value - }) - - t.Run("GetSpam", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &InboxMessageSummary{} - var expected bool - obj.Spam = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetSpam(), "getter should return the property value") - }) - - t.Run("GetSpam_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *InboxMessageSummary - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetSpam() // Should return zero value - }) - - t.Run("GetReceivedEmailID", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &InboxMessageSummary{} - var expected *string - obj.ReceivedEmailID = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetReceivedEmailID(), "getter should return the property value") - }) - - t.Run("GetReceivedEmailID_NilValue", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &InboxMessageSummary{} - obj.ReceivedEmailID = nil + obj.EventType = expected // Act & Assert - assert.Nil(t, obj.GetReceivedEmailID(), "getter should return nil when property is nil") + assert.Equal(t, expected, obj.GetEventType(), "getter should return the property value") }) - t.Run("GetReceivedEmailID_NilReceiver", func(t *testing.T) { + t.Run("GetEventType_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *InboxMessageSummary + var obj *HookMessage // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetReceivedEmailID() // Should return zero value + _ = obj.GetEventType() // Should return zero value }) - t.Run("GetEmailID", func(t *testing.T) { + t.Run("GetPayload", func(t *testing.T) { t.Parallel() // Arrange - obj := &InboxMessageSummary{} - var expected *string - obj.EmailID = expected + obj := &HookMessage{} + var expected map[string]any + obj.Payload = expected // Act & Assert - assert.Equal(t, expected, obj.GetEmailID(), "getter should return the property value") + assert.Equal(t, expected, obj.GetPayload(), "getter should return the property value") }) - t.Run("GetEmailID_NilValue", func(t *testing.T) { + t.Run("GetPayload_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &InboxMessageSummary{} - obj.EmailID = nil + obj := &HookMessage{} + obj.Payload = nil // Act & Assert - assert.Nil(t, obj.GetEmailID(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetPayload(), "getter should return nil when property is nil") }) - t.Run("GetEmailID_NilReceiver", func(t *testing.T) { + t.Run("GetPayload_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *InboxMessageSummary + var obj *HookMessage // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetEmailID() // Should return zero value + _ = obj.GetPayload() // Should return zero value }) t.Run("GetCreatedAt", func(t *testing.T) { t.Parallel() // Arrange - obj := &InboxMessageSummary{} + obj := &HookMessage{} var expected time.Time obj.CreatedAt = expected @@ -53143,7 +51516,7 @@ func TestGettersInboxMessageSummary(t *testing.T) { t.Run("GetCreatedAt_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *InboxMessageSummary + var obj *HookMessage // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -53155,12 +51528,12 @@ func TestGettersInboxMessageSummary(t *testing.T) { } -func TestSettersMarkExplicitInboxMessageSummary(t *testing.T) { +func TestSettersMarkExplicitHookMessage(t *testing.T) { t.Run("SetObject_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &InboxMessageSummary{} - var fernTestValueObject InboxMessageSummaryObject + obj := &HookMessage{} + var fernTestValueObject HookMessageObject // Act obj.SetObject(fernTestValueObject) @@ -53190,7 +51563,7 @@ func TestSettersMarkExplicitInboxMessageSummary(t *testing.T) { t.Run("SetID_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &InboxMessageSummary{} + obj := &HookMessage{} var fernTestValueID string // Act @@ -53218,14 +51591,14 @@ func TestSettersMarkExplicitInboxMessageSummary(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetInboxID_MarksExplicit", func(t *testing.T) { + t.Run("SetApplicationID_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &InboxMessageSummary{} - var fernTestValueInboxID string + obj := &HookMessage{} + var fernTestValueApplicationID string // Act - obj.SetInboxID(fernTestValueInboxID) + obj.SetApplicationID(fernTestValueApplicationID) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -53249,14 +51622,14 @@ func TestSettersMarkExplicitInboxMessageSummary(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetThreadID_MarksExplicit", func(t *testing.T) { + t.Run("SetEventType_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &InboxMessageSummary{} - var fernTestValueThreadID string + obj := &HookMessage{} + var fernTestValueEventType string // Act - obj.SetThreadID(fernTestValueThreadID) + obj.SetEventType(fernTestValueEventType) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -53280,14 +51653,14 @@ func TestSettersMarkExplicitInboxMessageSummary(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetDirection_MarksExplicit", func(t *testing.T) { + t.Run("SetPayload_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &InboxMessageSummary{} - var fernTestValueDirection InboxMessageSummaryDirection + obj := &HookMessage{} + var fernTestValuePayload map[string]any // Act - obj.SetDirection(fernTestValueDirection) + obj.SetPayload(fernTestValuePayload) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -53311,14 +51684,14 @@ func TestSettersMarkExplicitInboxMessageSummary(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetStatus_MarksExplicit", func(t *testing.T) { + t.Run("SetCreatedAt_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &InboxMessageSummary{} - var fernTestValueStatus InboxMessageSummaryStatus + obj := &HookMessage{} + var fernTestValueCreatedAt time.Time // Act - obj.SetStatus(fernTestValueStatus) + obj.SetCreatedAt(fernTestValueCreatedAt) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -53342,14 +51715,126 @@ func TestSettersMarkExplicitInboxMessageSummary(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetFrom_MarksExplicit", func(t *testing.T) { +} + +func TestSettersHookMessageList(t *testing.T) { + t.Run("SetObject", func(t *testing.T) { + obj := &HookMessageList{} + var fernTestValueObject HookMessageListObject + obj.SetObject(fernTestValueObject) + assert.Equal(t, fernTestValueObject, obj.Object) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetData", func(t *testing.T) { + obj := &HookMessageList{} + var fernTestValueData []*HookMessage + obj.SetData(fernTestValueData) + assert.Equal(t, fernTestValueData, obj.Data) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetHasMore", func(t *testing.T) { + obj := &HookMessageList{} + var fernTestValueHasMore bool + obj.SetHasMore(fernTestValueHasMore) + assert.Equal(t, fernTestValueHasMore, obj.HasMore) + assert.NotNil(t, obj.explicitFields) + }) + +} + +func TestGettersHookMessageList(t *testing.T) { + t.Run("GetObject", func(t *testing.T) { t.Parallel() // Arrange - obj := &InboxMessageSummary{} - var fernTestValueFrom *string + obj := &HookMessageList{} + var expected HookMessageListObject + obj.Object = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetObject(), "getter should return the property value") + }) + + t.Run("GetObject_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *HookMessageList + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetObject() // Should return zero value + }) + + t.Run("GetData", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &HookMessageList{} + var expected []*HookMessage + obj.Data = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetData(), "getter should return the property value") + }) + + t.Run("GetData_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &HookMessageList{} + obj.Data = nil + + // Act & Assert + assert.Nil(t, obj.GetData(), "getter should return nil when property is nil") + }) + + t.Run("GetData_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *HookMessageList + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetData() // Should return zero value + }) + + t.Run("GetHasMore", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &HookMessageList{} + var expected bool + obj.HasMore = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetHasMore(), "getter should return the property value") + }) + + t.Run("GetHasMore_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *HookMessageList + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetHasMore() // Should return zero value + }) + +} + +func TestSettersMarkExplicitHookMessageList(t *testing.T) { + t.Run("SetObject_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &HookMessageList{} + var fernTestValueObject HookMessageListObject // Act - obj.SetFrom(fernTestValueFrom) + obj.SetObject(fernTestValueObject) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -53373,14 +51858,14 @@ func TestSettersMarkExplicitInboxMessageSummary(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetTo_MarksExplicit", func(t *testing.T) { + t.Run("SetData_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &InboxMessageSummary{} - var fernTestValueTo []string + obj := &HookMessageList{} + var fernTestValueData []*HookMessage // Act - obj.SetTo(fernTestValueTo) + obj.SetData(fernTestValueData) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -53404,14 +51889,14 @@ func TestSettersMarkExplicitInboxMessageSummary(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetCc_MarksExplicit", func(t *testing.T) { + t.Run("SetHasMore_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &InboxMessageSummary{} - var fernTestValueCc []string + obj := &HookMessageList{} + var fernTestValueHasMore bool // Act - obj.SetCc(fernTestValueCc) + obj.SetHasMore(fernTestValueHasMore) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -53435,322 +51920,73 @@ func TestSettersMarkExplicitInboxMessageSummary(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetSubject_MarksExplicit", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &InboxMessageSummary{} - var fernTestValueSubject *string - - // Act - obj.SetSubject(fernTestValueSubject) +} - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") - - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } - - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip - }) - - t.Run("SetPreview_MarksExplicit", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &InboxMessageSummary{} - var fernTestValuePreview *string - - // Act - obj.SetPreview(fernTestValuePreview) - - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") - - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } - - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip - }) - - t.Run("SetAttachments_MarksExplicit", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &InboxMessageSummary{} - var fernTestValueAttachments []*ReceivedEmailAttachment - - // Act - obj.SetAttachments(fernTestValueAttachments) - - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") - - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } - - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip - }) - - t.Run("SetSpam_MarksExplicit", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &InboxMessageSummary{} - var fernTestValueSpam bool - - // Act - obj.SetSpam(fernTestValueSpam) - - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") - - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } - - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip - }) - - t.Run("SetReceivedEmailID_MarksExplicit", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &InboxMessageSummary{} - var fernTestValueReceivedEmailID *string - - // Act - obj.SetReceivedEmailID(fernTestValueReceivedEmailID) - - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") - - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } - - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip - }) - - t.Run("SetEmailID_MarksExplicit", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &InboxMessageSummary{} - var fernTestValueEmailID *string - - // Act - obj.SetEmailID(fernTestValueEmailID) - - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") - - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } - - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip - }) - - t.Run("SetCreatedAt_MarksExplicit", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &InboxMessageSummary{} - var fernTestValueCreatedAt time.Time - - // Act - obj.SetCreatedAt(fernTestValueCreatedAt) - - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") - - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } - - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip - }) - -} - -func TestSettersInboxThread(t *testing.T) { +func TestSettersHookPortalSession(t *testing.T) { t.Run("SetObject", func(t *testing.T) { - obj := &InboxThread{} - var fernTestValueObject InboxThreadObject + obj := &HookPortalSession{} + var fernTestValueObject HookPortalSessionObject obj.SetObject(fernTestValueObject) assert.Equal(t, fernTestValueObject, obj.Object) assert.NotNil(t, obj.explicitFields) }) t.Run("SetID", func(t *testing.T) { - obj := &InboxThread{} + obj := &HookPortalSession{} var fernTestValueID string obj.SetID(fernTestValueID) assert.Equal(t, fernTestValueID, obj.ID) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetInboxID", func(t *testing.T) { - obj := &InboxThread{} - var fernTestValueInboxID string - obj.SetInboxID(fernTestValueInboxID) - assert.Equal(t, fernTestValueInboxID, obj.InboxID) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetSubject", func(t *testing.T) { - obj := &InboxThread{} - var fernTestValueSubject *string - obj.SetSubject(fernTestValueSubject) - assert.Equal(t, fernTestValueSubject, obj.Subject) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetParticipants", func(t *testing.T) { - obj := &InboxThread{} - var fernTestValueParticipants []string - obj.SetParticipants(fernTestValueParticipants) - assert.Equal(t, fernTestValueParticipants, obj.Participants) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetMessageCount", func(t *testing.T) { - obj := &InboxThread{} - var fernTestValueMessageCount int64 - obj.SetMessageCount(fernTestValueMessageCount) - assert.Equal(t, fernTestValueMessageCount, obj.MessageCount) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetPreview", func(t *testing.T) { - obj := &InboxThread{} - var fernTestValuePreview *string - obj.SetPreview(fernTestValuePreview) - assert.Equal(t, fernTestValuePreview, obj.Preview) + t.Run("SetApplicationID", func(t *testing.T) { + obj := &HookPortalSession{} + var fernTestValueApplicationID string + obj.SetApplicationID(fernTestValueApplicationID) + assert.Equal(t, fernTestValueApplicationID, obj.ApplicationID) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetLastMessageAt", func(t *testing.T) { - obj := &InboxThread{} - var fernTestValueLastMessageAt time.Time - obj.SetLastMessageAt(fernTestValueLastMessageAt) - assert.Equal(t, fernTestValueLastMessageAt, obj.LastMessageAt) + t.Run("SetURL", func(t *testing.T) { + obj := &HookPortalSession{} + var fernTestValueURL string + obj.SetURL(fernTestValueURL) + assert.Equal(t, fernTestValueURL, obj.URL) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetLastInboundAt", func(t *testing.T) { - obj := &InboxThread{} - var fernTestValueLastInboundAt *time.Time - obj.SetLastInboundAt(fernTestValueLastInboundAt) - assert.Equal(t, fernTestValueLastInboundAt, obj.LastInboundAt) + t.Run("SetToken", func(t *testing.T) { + obj := &HookPortalSession{} + var fernTestValueToken string + obj.SetToken(fernTestValueToken) + assert.Equal(t, fernTestValueToken, obj.Token) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetCreatedAt", func(t *testing.T) { - obj := &InboxThread{} - var fernTestValueCreatedAt time.Time - obj.SetCreatedAt(fernTestValueCreatedAt) - assert.Equal(t, fernTestValueCreatedAt, obj.CreatedAt) + t.Run("SetReadOnly", func(t *testing.T) { + obj := &HookPortalSession{} + var fernTestValueReadOnly bool + obj.SetReadOnly(fernTestValueReadOnly) + assert.Equal(t, fernTestValueReadOnly, obj.ReadOnly) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetMessages", func(t *testing.T) { - obj := &InboxThread{} - var fernTestValueMessages []*InboxMessage - obj.SetMessages(fernTestValueMessages) - assert.Equal(t, fernTestValueMessages, obj.Messages) + t.Run("SetExpiresAt", func(t *testing.T) { + obj := &HookPortalSession{} + var fernTestValueExpiresAt time.Time + obj.SetExpiresAt(fernTestValueExpiresAt) + assert.Equal(t, fernTestValueExpiresAt, obj.ExpiresAt) assert.NotNil(t, obj.explicitFields) }) } -func TestGettersInboxThread(t *testing.T) { +func TestGettersHookPortalSession(t *testing.T) { t.Run("GetObject", func(t *testing.T) { t.Parallel() // Arrange - obj := &InboxThread{} - var expected InboxThreadObject + obj := &HookPortalSession{} + var expected HookPortalSessionObject obj.Object = expected // Act & Assert @@ -53759,7 +51995,7 @@ func TestGettersInboxThread(t *testing.T) { t.Run("GetObject_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *InboxThread + var obj *HookPortalSession // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -53772,7 +52008,7 @@ func TestGettersInboxThread(t *testing.T) { t.Run("GetID", func(t *testing.T) { t.Parallel() // Arrange - obj := &InboxThread{} + obj := &HookPortalSession{} var expected string obj.ID = expected @@ -53782,7 +52018,7 @@ func TestGettersInboxThread(t *testing.T) { t.Run("GetID_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *InboxThread + var obj *HookPortalSession // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -53792,271 +52028,129 @@ func TestGettersInboxThread(t *testing.T) { _ = obj.GetID() // Should return zero value }) - t.Run("GetInboxID", func(t *testing.T) { + t.Run("GetApplicationID", func(t *testing.T) { t.Parallel() // Arrange - obj := &InboxThread{} + obj := &HookPortalSession{} var expected string - obj.InboxID = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetInboxID(), "getter should return the property value") - }) - - t.Run("GetInboxID_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *InboxThread - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetInboxID() // Should return zero value - }) - - t.Run("GetSubject", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &InboxThread{} - var expected *string - obj.Subject = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetSubject(), "getter should return the property value") - }) - - t.Run("GetSubject_NilValue", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &InboxThread{} - obj.Subject = nil - - // Act & Assert - assert.Nil(t, obj.GetSubject(), "getter should return nil when property is nil") - }) - - t.Run("GetSubject_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *InboxThread - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetSubject() // Should return zero value - }) - - t.Run("GetParticipants", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &InboxThread{} - var expected []string - obj.Participants = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetParticipants(), "getter should return the property value") - }) - - t.Run("GetParticipants_NilValue", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &InboxThread{} - obj.Participants = nil - - // Act & Assert - assert.Nil(t, obj.GetParticipants(), "getter should return nil when property is nil") - }) - - t.Run("GetParticipants_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *InboxThread - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetParticipants() // Should return zero value - }) - - t.Run("GetMessageCount", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &InboxThread{} - var expected int64 - obj.MessageCount = expected + obj.ApplicationID = expected // Act & Assert - assert.Equal(t, expected, obj.GetMessageCount(), "getter should return the property value") + assert.Equal(t, expected, obj.GetApplicationID(), "getter should return the property value") }) - t.Run("GetMessageCount_NilReceiver", func(t *testing.T) { + t.Run("GetApplicationID_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *InboxThread + var obj *HookPortalSession // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetMessageCount() // Should return zero value - }) - - t.Run("GetPreview", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &InboxThread{} - var expected *string - obj.Preview = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetPreview(), "getter should return the property value") + _ = obj.GetApplicationID() // Should return zero value }) - t.Run("GetPreview_NilValue", func(t *testing.T) { + t.Run("GetURL", func(t *testing.T) { t.Parallel() // Arrange - obj := &InboxThread{} - obj.Preview = nil + obj := &HookPortalSession{} + var expected string + obj.URL = expected // Act & Assert - assert.Nil(t, obj.GetPreview(), "getter should return nil when property is nil") + assert.Equal(t, expected, obj.GetURL(), "getter should return the property value") }) - t.Run("GetPreview_NilReceiver", func(t *testing.T) { + t.Run("GetURL_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *InboxThread + var obj *HookPortalSession // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetPreview() // Should return zero value + _ = obj.GetURL() // Should return zero value }) - t.Run("GetLastMessageAt", func(t *testing.T) { + t.Run("GetToken", func(t *testing.T) { t.Parallel() // Arrange - obj := &InboxThread{} - var expected time.Time - obj.LastMessageAt = expected + obj := &HookPortalSession{} + var expected string + obj.Token = expected // Act & Assert - assert.Equal(t, expected, obj.GetLastMessageAt(), "getter should return the property value") + assert.Equal(t, expected, obj.GetToken(), "getter should return the property value") }) - t.Run("GetLastMessageAt_NilReceiver", func(t *testing.T) { + t.Run("GetToken_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *InboxThread + var obj *HookPortalSession // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetLastMessageAt() // Should return zero value - }) - - t.Run("GetLastInboundAt", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &InboxThread{} - var expected *time.Time - obj.LastInboundAt = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetLastInboundAt(), "getter should return the property value") + _ = obj.GetToken() // Should return zero value }) - t.Run("GetLastInboundAt_NilValue", func(t *testing.T) { + t.Run("GetReadOnly", func(t *testing.T) { t.Parallel() // Arrange - obj := &InboxThread{} - obj.LastInboundAt = nil + obj := &HookPortalSession{} + var expected bool + obj.ReadOnly = expected // Act & Assert - assert.Nil(t, obj.GetLastInboundAt(), "getter should return nil when property is nil") + assert.Equal(t, expected, obj.GetReadOnly(), "getter should return the property value") }) - t.Run("GetLastInboundAt_NilReceiver", func(t *testing.T) { + t.Run("GetReadOnly_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *InboxThread + var obj *HookPortalSession // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetLastInboundAt() // Should return zero value + _ = obj.GetReadOnly() // Should return zero value }) - t.Run("GetCreatedAt", func(t *testing.T) { + t.Run("GetExpiresAt", func(t *testing.T) { t.Parallel() // Arrange - obj := &InboxThread{} + obj := &HookPortalSession{} var expected time.Time - obj.CreatedAt = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetCreatedAt(), "getter should return the property value") - }) - - t.Run("GetCreatedAt_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *InboxThread - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetCreatedAt() // Should return zero value - }) - - t.Run("GetMessages", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &InboxThread{} - var expected []*InboxMessage - obj.Messages = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetMessages(), "getter should return the property value") - }) - - t.Run("GetMessages_NilValue", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &InboxThread{} - obj.Messages = nil + obj.ExpiresAt = expected // Act & Assert - assert.Nil(t, obj.GetMessages(), "getter should return nil when property is nil") + assert.Equal(t, expected, obj.GetExpiresAt(), "getter should return the property value") }) - t.Run("GetMessages_NilReceiver", func(t *testing.T) { + t.Run("GetExpiresAt_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *InboxThread + var obj *HookPortalSession // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetMessages() // Should return zero value + _ = obj.GetExpiresAt() // Should return zero value }) } -func TestSettersMarkExplicitInboxThread(t *testing.T) { +func TestSettersMarkExplicitHookPortalSession(t *testing.T) { t.Run("SetObject_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &InboxThread{} - var fernTestValueObject InboxThreadObject + obj := &HookPortalSession{} + var fernTestValueObject HookPortalSessionObject // Act obj.SetObject(fernTestValueObject) @@ -54086,7 +52180,7 @@ func TestSettersMarkExplicitInboxThread(t *testing.T) { t.Run("SetID_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &InboxThread{} + obj := &HookPortalSession{} var fernTestValueID string // Act @@ -54114,138 +52208,14 @@ func TestSettersMarkExplicitInboxThread(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetInboxID_MarksExplicit", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &InboxThread{} - var fernTestValueInboxID string - - // Act - obj.SetInboxID(fernTestValueInboxID) - - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") - - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } - - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip - }) - - t.Run("SetSubject_MarksExplicit", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &InboxThread{} - var fernTestValueSubject *string - - // Act - obj.SetSubject(fernTestValueSubject) - - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") - - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } - - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip - }) - - t.Run("SetParticipants_MarksExplicit", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &InboxThread{} - var fernTestValueParticipants []string - - // Act - obj.SetParticipants(fernTestValueParticipants) - - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") - - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } - - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip - }) - - t.Run("SetMessageCount_MarksExplicit", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &InboxThread{} - var fernTestValueMessageCount int64 - - // Act - obj.SetMessageCount(fernTestValueMessageCount) - - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") - - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } - - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip - }) - - t.Run("SetPreview_MarksExplicit", func(t *testing.T) { + t.Run("SetApplicationID_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &InboxThread{} - var fernTestValuePreview *string + obj := &HookPortalSession{} + var fernTestValueApplicationID string // Act - obj.SetPreview(fernTestValuePreview) + obj.SetApplicationID(fernTestValueApplicationID) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -54269,14 +52239,14 @@ func TestSettersMarkExplicitInboxThread(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetLastMessageAt_MarksExplicit", func(t *testing.T) { + t.Run("SetURL_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &InboxThread{} - var fernTestValueLastMessageAt time.Time + obj := &HookPortalSession{} + var fernTestValueURL string // Act - obj.SetLastMessageAt(fernTestValueLastMessageAt) + obj.SetURL(fernTestValueURL) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -54300,14 +52270,14 @@ func TestSettersMarkExplicitInboxThread(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetLastInboundAt_MarksExplicit", func(t *testing.T) { + t.Run("SetToken_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &InboxThread{} - var fernTestValueLastInboundAt *time.Time + obj := &HookPortalSession{} + var fernTestValueToken string // Act - obj.SetLastInboundAt(fernTestValueLastInboundAt) + obj.SetToken(fernTestValueToken) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -54331,14 +52301,14 @@ func TestSettersMarkExplicitInboxThread(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetCreatedAt_MarksExplicit", func(t *testing.T) { + t.Run("SetReadOnly_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &InboxThread{} - var fernTestValueCreatedAt time.Time + obj := &HookPortalSession{} + var fernTestValueReadOnly bool // Act - obj.SetCreatedAt(fernTestValueCreatedAt) + obj.SetReadOnly(fernTestValueReadOnly) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -54362,14 +52332,14 @@ func TestSettersMarkExplicitInboxThread(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetMessages_MarksExplicit", func(t *testing.T) { + t.Run("SetExpiresAt_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &InboxThread{} - var fernTestValueMessages []*InboxMessage + obj := &HookPortalSession{} + var fernTestValueExpiresAt time.Time // Act - obj.SetMessages(fernTestValueMessages) + obj.SetExpiresAt(fernTestValueExpiresAt) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -54395,39 +52365,39 @@ func TestSettersMarkExplicitInboxThread(t *testing.T) { } -func TestSettersInboxThreadList(t *testing.T) { +func TestSettersInboundAddress(t *testing.T) { t.Run("SetObject", func(t *testing.T) { - obj := &InboxThreadList{} - var fernTestValueObject InboxThreadListObject + obj := &InboundAddress{} + var fernTestValueObject InboundAddressObject obj.SetObject(fernTestValueObject) assert.Equal(t, fernTestValueObject, obj.Object) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetData", func(t *testing.T) { - obj := &InboxThreadList{} - var fernTestValueData []*InboxThreadSummary - obj.SetData(fernTestValueData) - assert.Equal(t, fernTestValueData, obj.Data) + t.Run("SetEnvironmentID", func(t *testing.T) { + obj := &InboundAddress{} + var fernTestValueEnvironmentID string + obj.SetEnvironmentID(fernTestValueEnvironmentID) + assert.Equal(t, fernTestValueEnvironmentID, obj.EnvironmentID) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetHasMore", func(t *testing.T) { - obj := &InboxThreadList{} - var fernTestValueHasMore bool - obj.SetHasMore(fernTestValueHasMore) - assert.Equal(t, fernTestValueHasMore, obj.HasMore) + t.Run("SetDomain", func(t *testing.T) { + obj := &InboundAddress{} + var fernTestValueDomain string + obj.SetDomain(fernTestValueDomain) + assert.Equal(t, fernTestValueDomain, obj.Domain) assert.NotNil(t, obj.explicitFields) }) } -func TestGettersInboxThreadList(t *testing.T) { +func TestGettersInboundAddress(t *testing.T) { t.Run("GetObject", func(t *testing.T) { t.Parallel() // Arrange - obj := &InboxThreadList{} - var expected InboxThreadListObject + obj := &InboundAddress{} + var expected InboundAddressObject obj.Object = expected // Act & Assert @@ -54436,7 +52406,7 @@ func TestGettersInboxThreadList(t *testing.T) { t.Run("GetObject_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *InboxThreadList + var obj *InboundAddress // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -54446,70 +52416,60 @@ func TestGettersInboxThreadList(t *testing.T) { _ = obj.GetObject() // Should return zero value }) - t.Run("GetData", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &InboxThreadList{} - var expected []*InboxThreadSummary - obj.Data = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetData(), "getter should return the property value") - }) - - t.Run("GetData_NilValue", func(t *testing.T) { + t.Run("GetEnvironmentID", func(t *testing.T) { t.Parallel() // Arrange - obj := &InboxThreadList{} - obj.Data = nil + obj := &InboundAddress{} + var expected string + obj.EnvironmentID = expected // Act & Assert - assert.Nil(t, obj.GetData(), "getter should return nil when property is nil") + assert.Equal(t, expected, obj.GetEnvironmentID(), "getter should return the property value") }) - t.Run("GetData_NilReceiver", func(t *testing.T) { + t.Run("GetEnvironmentID_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *InboxThreadList + var obj *InboundAddress // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetData() // Should return zero value + _ = obj.GetEnvironmentID() // Should return zero value }) - t.Run("GetHasMore", func(t *testing.T) { + t.Run("GetDomain", func(t *testing.T) { t.Parallel() // Arrange - obj := &InboxThreadList{} - var expected bool - obj.HasMore = expected + obj := &InboundAddress{} + var expected string + obj.Domain = expected // Act & Assert - assert.Equal(t, expected, obj.GetHasMore(), "getter should return the property value") + assert.Equal(t, expected, obj.GetDomain(), "getter should return the property value") }) - t.Run("GetHasMore_NilReceiver", func(t *testing.T) { + t.Run("GetDomain_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *InboxThreadList + var obj *InboundAddress // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetHasMore() // Should return zero value + _ = obj.GetDomain() // Should return zero value }) } -func TestSettersMarkExplicitInboxThreadList(t *testing.T) { +func TestSettersMarkExplicitInboundAddress(t *testing.T) { t.Run("SetObject_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &InboxThreadList{} - var fernTestValueObject InboxThreadListObject + obj := &InboundAddress{} + var fernTestValueObject InboundAddressObject // Act obj.SetObject(fernTestValueObject) @@ -54536,14 +52496,14 @@ func TestSettersMarkExplicitInboxThreadList(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetData_MarksExplicit", func(t *testing.T) { + t.Run("SetEnvironmentID_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &InboxThreadList{} - var fernTestValueData []*InboxThreadSummary + obj := &InboundAddress{} + var fernTestValueEnvironmentID string // Act - obj.SetData(fernTestValueData) + obj.SetEnvironmentID(fernTestValueEnvironmentID) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -54567,14 +52527,14 @@ func TestSettersMarkExplicitInboxThreadList(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetHasMore_MarksExplicit", func(t *testing.T) { + t.Run("SetDomain_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &InboxThreadList{} - var fernTestValueHasMore bool + obj := &InboundAddress{} + var fernTestValueDomain string // Act - obj.SetHasMore(fernTestValueHasMore) + obj.SetDomain(fernTestValueDomain) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -54600,17 +52560,17 @@ func TestSettersMarkExplicitInboxThreadList(t *testing.T) { } -func TestSettersInboxThreadSummary(t *testing.T) { +func TestSettersInboxMessage(t *testing.T) { t.Run("SetObject", func(t *testing.T) { - obj := &InboxThreadSummary{} - var fernTestValueObject InboxThreadSummaryObject + obj := &InboxMessage{} + var fernTestValueObject InboxMessageObject obj.SetObject(fernTestValueObject) assert.Equal(t, fernTestValueObject, obj.Object) assert.NotNil(t, obj.explicitFields) }) t.Run("SetID", func(t *testing.T) { - obj := &InboxThreadSummary{} + obj := &InboxMessage{} var fernTestValueID string obj.SetID(fernTestValueID) assert.Equal(t, fernTestValueID, obj.ID) @@ -54618,77 +52578,189 @@ func TestSettersInboxThreadSummary(t *testing.T) { }) t.Run("SetInboxID", func(t *testing.T) { - obj := &InboxThreadSummary{} + obj := &InboxMessage{} var fernTestValueInboxID string obj.SetInboxID(fernTestValueInboxID) assert.Equal(t, fernTestValueInboxID, obj.InboxID) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetSubject", func(t *testing.T) { - obj := &InboxThreadSummary{} - var fernTestValueSubject *string - obj.SetSubject(fernTestValueSubject) - assert.Equal(t, fernTestValueSubject, obj.Subject) + t.Run("SetThreadID", func(t *testing.T) { + obj := &InboxMessage{} + var fernTestValueThreadID string + obj.SetThreadID(fernTestValueThreadID) + assert.Equal(t, fernTestValueThreadID, obj.ThreadID) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetParticipants", func(t *testing.T) { - obj := &InboxThreadSummary{} - var fernTestValueParticipants []string - obj.SetParticipants(fernTestValueParticipants) - assert.Equal(t, fernTestValueParticipants, obj.Participants) + t.Run("SetDirection", func(t *testing.T) { + obj := &InboxMessage{} + var fernTestValueDirection InboxMessageDirection + obj.SetDirection(fernTestValueDirection) + assert.Equal(t, fernTestValueDirection, obj.Direction) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetMessageCount", func(t *testing.T) { - obj := &InboxThreadSummary{} - var fernTestValueMessageCount int64 - obj.SetMessageCount(fernTestValueMessageCount) - assert.Equal(t, fernTestValueMessageCount, obj.MessageCount) + t.Run("SetStatus", func(t *testing.T) { + obj := &InboxMessage{} + var fernTestValueStatus InboxMessageStatus + obj.SetStatus(fernTestValueStatus) + assert.Equal(t, fernTestValueStatus, obj.Status) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetFrom", func(t *testing.T) { + obj := &InboxMessage{} + var fernTestValueFrom *string + obj.SetFrom(fernTestValueFrom) + assert.Equal(t, fernTestValueFrom, obj.From) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetTo", func(t *testing.T) { + obj := &InboxMessage{} + var fernTestValueTo []string + obj.SetTo(fernTestValueTo) + assert.Equal(t, fernTestValueTo, obj.To) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetCc", func(t *testing.T) { + obj := &InboxMessage{} + var fernTestValueCc []string + obj.SetCc(fernTestValueCc) + assert.Equal(t, fernTestValueCc, obj.Cc) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetSubject", func(t *testing.T) { + obj := &InboxMessage{} + var fernTestValueSubject *string + obj.SetSubject(fernTestValueSubject) + assert.Equal(t, fernTestValueSubject, obj.Subject) assert.NotNil(t, obj.explicitFields) }) t.Run("SetPreview", func(t *testing.T) { - obj := &InboxThreadSummary{} + obj := &InboxMessage{} var fernTestValuePreview *string obj.SetPreview(fernTestValuePreview) assert.Equal(t, fernTestValuePreview, obj.Preview) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetLastMessageAt", func(t *testing.T) { - obj := &InboxThreadSummary{} - var fernTestValueLastMessageAt time.Time - obj.SetLastMessageAt(fernTestValueLastMessageAt) - assert.Equal(t, fernTestValueLastMessageAt, obj.LastMessageAt) + t.Run("SetAttachments", func(t *testing.T) { + obj := &InboxMessage{} + var fernTestValueAttachments []*ReceivedEmailAttachment + obj.SetAttachments(fernTestValueAttachments) + assert.Equal(t, fernTestValueAttachments, obj.Attachments) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetLastInboundAt", func(t *testing.T) { - obj := &InboxThreadSummary{} - var fernTestValueLastInboundAt *time.Time - obj.SetLastInboundAt(fernTestValueLastInboundAt) - assert.Equal(t, fernTestValueLastInboundAt, obj.LastInboundAt) + t.Run("SetSpam", func(t *testing.T) { + obj := &InboxMessage{} + var fernTestValueSpam bool + obj.SetSpam(fernTestValueSpam) + assert.Equal(t, fernTestValueSpam, obj.Spam) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetReceivedEmailID", func(t *testing.T) { + obj := &InboxMessage{} + var fernTestValueReceivedEmailID *string + obj.SetReceivedEmailID(fernTestValueReceivedEmailID) + assert.Equal(t, fernTestValueReceivedEmailID, obj.ReceivedEmailID) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetEmailID", func(t *testing.T) { + obj := &InboxMessage{} + var fernTestValueEmailID *string + obj.SetEmailID(fernTestValueEmailID) + assert.Equal(t, fernTestValueEmailID, obj.EmailID) assert.NotNil(t, obj.explicitFields) }) t.Run("SetCreatedAt", func(t *testing.T) { - obj := &InboxThreadSummary{} + obj := &InboxMessage{} var fernTestValueCreatedAt time.Time obj.SetCreatedAt(fernTestValueCreatedAt) assert.Equal(t, fernTestValueCreatedAt, obj.CreatedAt) assert.NotNil(t, obj.explicitFields) }) + t.Run("SetReplyTo", func(t *testing.T) { + obj := &InboxMessage{} + var fernTestValueReplyTo []string + obj.SetReplyTo(fernTestValueReplyTo) + assert.Equal(t, fernTestValueReplyTo, obj.ReplyTo) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetMessageID", func(t *testing.T) { + obj := &InboxMessage{} + var fernTestValueMessageID *string + obj.SetMessageID(fernTestValueMessageID) + assert.Equal(t, fernTestValueMessageID, obj.MessageID) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetInReplyTo", func(t *testing.T) { + obj := &InboxMessage{} + var fernTestValueInReplyTo *string + obj.SetInReplyTo(fernTestValueInReplyTo) + assert.Equal(t, fernTestValueInReplyTo, obj.InReplyTo) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetReferences", func(t *testing.T) { + obj := &InboxMessage{} + var fernTestValueReferences []string + obj.SetReferences(fernTestValueReferences) + assert.Equal(t, fernTestValueReferences, obj.References) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetText", func(t *testing.T) { + obj := &InboxMessage{} + var fernTestValueText *string + obj.SetText(fernTestValueText) + assert.Equal(t, fernTestValueText, obj.Text) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetExtractedText", func(t *testing.T) { + obj := &InboxMessage{} + var fernTestValueExtractedText *string + obj.SetExtractedText(fernTestValueExtractedText) + assert.Equal(t, fernTestValueExtractedText, obj.ExtractedText) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetHTML", func(t *testing.T) { + obj := &InboxMessage{} + var fernTestValueHTML *string + obj.SetHTML(fernTestValueHTML) + assert.Equal(t, fernTestValueHTML, obj.HTML) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetTruncated", func(t *testing.T) { + obj := &InboxMessage{} + var fernTestValueTruncated bool + obj.SetTruncated(fernTestValueTruncated) + assert.Equal(t, fernTestValueTruncated, obj.Truncated) + assert.NotNil(t, obj.explicitFields) + }) + } -func TestGettersInboxThreadSummary(t *testing.T) { +func TestGettersInboxMessage(t *testing.T) { t.Run("GetObject", func(t *testing.T) { t.Parallel() // Arrange - obj := &InboxThreadSummary{} - var expected InboxThreadSummaryObject + obj := &InboxMessage{} + var expected InboxMessageObject obj.Object = expected // Act & Assert @@ -54697,7 +52769,7 @@ func TestGettersInboxThreadSummary(t *testing.T) { t.Run("GetObject_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *InboxThreadSummary + var obj *InboxMessage // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -54710,7 +52782,7 @@ func TestGettersInboxThreadSummary(t *testing.T) { t.Run("GetID", func(t *testing.T) { t.Parallel() // Arrange - obj := &InboxThreadSummary{} + obj := &InboxMessage{} var expected string obj.ID = expected @@ -54720,7 +52792,7 @@ func TestGettersInboxThreadSummary(t *testing.T) { t.Run("GetID_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *InboxThreadSummary + var obj *InboxMessage // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -54733,7 +52805,7 @@ func TestGettersInboxThreadSummary(t *testing.T) { t.Run("GetInboxID", func(t *testing.T) { t.Parallel() // Arrange - obj := &InboxThreadSummary{} + obj := &InboxMessage{} var expected string obj.InboxID = expected @@ -54743,7 +52815,7 @@ func TestGettersInboxThreadSummary(t *testing.T) { t.Run("GetInboxID_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *InboxThreadSummary + var obj *InboxMessage // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -54753,99 +52825,211 @@ func TestGettersInboxThreadSummary(t *testing.T) { _ = obj.GetInboxID() // Should return zero value }) - t.Run("GetSubject", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &InboxThreadSummary{} - var expected *string - obj.Subject = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetSubject(), "getter should return the property value") - }) - - t.Run("GetSubject_NilValue", func(t *testing.T) { + t.Run("GetThreadID", func(t *testing.T) { t.Parallel() // Arrange - obj := &InboxThreadSummary{} - obj.Subject = nil + obj := &InboxMessage{} + var expected string + obj.ThreadID = expected // Act & Assert - assert.Nil(t, obj.GetSubject(), "getter should return nil when property is nil") + assert.Equal(t, expected, obj.GetThreadID(), "getter should return the property value") }) - t.Run("GetSubject_NilReceiver", func(t *testing.T) { + t.Run("GetThreadID_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *InboxThreadSummary + var obj *InboxMessage // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetSubject() // Should return zero value + _ = obj.GetThreadID() // Should return zero value }) - t.Run("GetParticipants", func(t *testing.T) { + t.Run("GetDirection", func(t *testing.T) { t.Parallel() // Arrange - obj := &InboxThreadSummary{} - var expected []string - obj.Participants = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetParticipants(), "getter should return the property value") + obj := &InboxMessage{} + var expected InboxMessageDirection + obj.Direction = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetDirection(), "getter should return the property value") }) - t.Run("GetParticipants_NilValue", func(t *testing.T) { + t.Run("GetDirection_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *InboxMessage + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetDirection() // Should return zero value + }) + + t.Run("GetStatus", func(t *testing.T) { t.Parallel() // Arrange - obj := &InboxThreadSummary{} - obj.Participants = nil + obj := &InboxMessage{} + var expected InboxMessageStatus + obj.Status = expected // Act & Assert - assert.Nil(t, obj.GetParticipants(), "getter should return nil when property is nil") + assert.Equal(t, expected, obj.GetStatus(), "getter should return the property value") }) - t.Run("GetParticipants_NilReceiver", func(t *testing.T) { + t.Run("GetStatus_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *InboxThreadSummary + var obj *InboxMessage // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetParticipants() // Should return zero value + _ = obj.GetStatus() // Should return zero value }) - t.Run("GetMessageCount", func(t *testing.T) { + t.Run("GetFrom", func(t *testing.T) { t.Parallel() // Arrange - obj := &InboxThreadSummary{} - var expected int64 - obj.MessageCount = expected + obj := &InboxMessage{} + var expected *string + obj.From = expected // Act & Assert - assert.Equal(t, expected, obj.GetMessageCount(), "getter should return the property value") + assert.Equal(t, expected, obj.GetFrom(), "getter should return the property value") }) - t.Run("GetMessageCount_NilReceiver", func(t *testing.T) { + t.Run("GetFrom_NilValue", func(t *testing.T) { t.Parallel() - var obj *InboxThreadSummary + // Arrange + obj := &InboxMessage{} + obj.From = nil + + // Act & Assert + assert.Nil(t, obj.GetFrom(), "getter should return nil when property is nil") + }) + + t.Run("GetFrom_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *InboxMessage // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetMessageCount() // Should return zero value + _ = obj.GetFrom() // Should return zero value + }) + + t.Run("GetTo", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &InboxMessage{} + var expected []string + obj.To = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetTo(), "getter should return the property value") + }) + + t.Run("GetTo_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &InboxMessage{} + obj.To = nil + + // Act & Assert + assert.Nil(t, obj.GetTo(), "getter should return nil when property is nil") + }) + + t.Run("GetTo_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *InboxMessage + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetTo() // Should return zero value + }) + + t.Run("GetCc", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &InboxMessage{} + var expected []string + obj.Cc = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetCc(), "getter should return the property value") + }) + + t.Run("GetCc_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &InboxMessage{} + obj.Cc = nil + + // Act & Assert + assert.Nil(t, obj.GetCc(), "getter should return nil when property is nil") + }) + + t.Run("GetCc_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *InboxMessage + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetCc() // Should return zero value + }) + + t.Run("GetSubject", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &InboxMessage{} + var expected *string + obj.Subject = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetSubject(), "getter should return the property value") + }) + + t.Run("GetSubject_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &InboxMessage{} + obj.Subject = nil + + // Act & Assert + assert.Nil(t, obj.GetSubject(), "getter should return nil when property is nil") + }) + + t.Run("GetSubject_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *InboxMessage + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetSubject() // Should return zero value }) t.Run("GetPreview", func(t *testing.T) { t.Parallel() // Arrange - obj := &InboxThreadSummary{} + obj := &InboxMessage{} var expected *string obj.Preview = expected @@ -54856,7 +53040,7 @@ func TestGettersInboxThreadSummary(t *testing.T) { t.Run("GetPreview_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &InboxThreadSummary{} + obj := &InboxMessage{} obj.Preview = nil // Act & Assert @@ -54865,7 +53049,7 @@ func TestGettersInboxThreadSummary(t *testing.T) { t.Run("GetPreview_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *InboxThreadSummary + var obj *InboxMessage // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -54875,66 +53059,132 @@ func TestGettersInboxThreadSummary(t *testing.T) { _ = obj.GetPreview() // Should return zero value }) - t.Run("GetLastMessageAt", func(t *testing.T) { + t.Run("GetAttachments", func(t *testing.T) { t.Parallel() // Arrange - obj := &InboxThreadSummary{} - var expected time.Time - obj.LastMessageAt = expected + obj := &InboxMessage{} + var expected []*ReceivedEmailAttachment + obj.Attachments = expected // Act & Assert - assert.Equal(t, expected, obj.GetLastMessageAt(), "getter should return the property value") + assert.Equal(t, expected, obj.GetAttachments(), "getter should return the property value") }) - t.Run("GetLastMessageAt_NilReceiver", func(t *testing.T) { + t.Run("GetAttachments_NilValue", func(t *testing.T) { t.Parallel() - var obj *InboxThreadSummary + // Arrange + obj := &InboxMessage{} + obj.Attachments = nil + + // Act & Assert + assert.Nil(t, obj.GetAttachments(), "getter should return nil when property is nil") + }) + + t.Run("GetAttachments_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *InboxMessage // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetLastMessageAt() // Should return zero value + _ = obj.GetAttachments() // Should return zero value }) - t.Run("GetLastInboundAt", func(t *testing.T) { + t.Run("GetSpam", func(t *testing.T) { t.Parallel() // Arrange - obj := &InboxThreadSummary{} - var expected *time.Time - obj.LastInboundAt = expected + obj := &InboxMessage{} + var expected bool + obj.Spam = expected // Act & Assert - assert.Equal(t, expected, obj.GetLastInboundAt(), "getter should return the property value") + assert.Equal(t, expected, obj.GetSpam(), "getter should return the property value") }) - t.Run("GetLastInboundAt_NilValue", func(t *testing.T) { + t.Run("GetSpam_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *InboxMessage + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetSpam() // Should return zero value + }) + + t.Run("GetReceivedEmailID", func(t *testing.T) { t.Parallel() // Arrange - obj := &InboxThreadSummary{} - obj.LastInboundAt = nil + obj := &InboxMessage{} + var expected *string + obj.ReceivedEmailID = expected // Act & Assert - assert.Nil(t, obj.GetLastInboundAt(), "getter should return nil when property is nil") + assert.Equal(t, expected, obj.GetReceivedEmailID(), "getter should return the property value") }) - t.Run("GetLastInboundAt_NilReceiver", func(t *testing.T) { + t.Run("GetReceivedEmailID_NilValue", func(t *testing.T) { t.Parallel() - var obj *InboxThreadSummary + // Arrange + obj := &InboxMessage{} + obj.ReceivedEmailID = nil + + // Act & Assert + assert.Nil(t, obj.GetReceivedEmailID(), "getter should return nil when property is nil") + }) + + t.Run("GetReceivedEmailID_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *InboxMessage // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetLastInboundAt() // Should return zero value + _ = obj.GetReceivedEmailID() // Should return zero value + }) + + t.Run("GetEmailID", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &InboxMessage{} + var expected *string + obj.EmailID = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetEmailID(), "getter should return the property value") + }) + + t.Run("GetEmailID_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &InboxMessage{} + obj.EmailID = nil + + // Act & Assert + assert.Nil(t, obj.GetEmailID(), "getter should return nil when property is nil") + }) + + t.Run("GetEmailID_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *InboxMessage + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetEmailID() // Should return zero value }) t.Run("GetCreatedAt", func(t *testing.T) { t.Parallel() // Arrange - obj := &InboxThreadSummary{} + obj := &InboxMessage{} var expected time.Time obj.CreatedAt = expected @@ -54944,7 +53194,7 @@ func TestGettersInboxThreadSummary(t *testing.T) { t.Run("GetCreatedAt_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *InboxThreadSummary + var obj *InboxMessage // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -54954,14 +53204,268 @@ func TestGettersInboxThreadSummary(t *testing.T) { _ = obj.GetCreatedAt() // Should return zero value }) + t.Run("GetReplyTo", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &InboxMessage{} + var expected []string + obj.ReplyTo = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetReplyTo(), "getter should return the property value") + }) + + t.Run("GetReplyTo_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &InboxMessage{} + obj.ReplyTo = nil + + // Act & Assert + assert.Nil(t, obj.GetReplyTo(), "getter should return nil when property is nil") + }) + + t.Run("GetReplyTo_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *InboxMessage + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetReplyTo() // Should return zero value + }) + + t.Run("GetMessageID", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &InboxMessage{} + var expected *string + obj.MessageID = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetMessageID(), "getter should return the property value") + }) + + t.Run("GetMessageID_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &InboxMessage{} + obj.MessageID = nil + + // Act & Assert + assert.Nil(t, obj.GetMessageID(), "getter should return nil when property is nil") + }) + + t.Run("GetMessageID_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *InboxMessage + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetMessageID() // Should return zero value + }) + + t.Run("GetInReplyTo", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &InboxMessage{} + var expected *string + obj.InReplyTo = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetInReplyTo(), "getter should return the property value") + }) + + t.Run("GetInReplyTo_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &InboxMessage{} + obj.InReplyTo = nil + + // Act & Assert + assert.Nil(t, obj.GetInReplyTo(), "getter should return nil when property is nil") + }) + + t.Run("GetInReplyTo_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *InboxMessage + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetInReplyTo() // Should return zero value + }) + + t.Run("GetReferences", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &InboxMessage{} + var expected []string + obj.References = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetReferences(), "getter should return the property value") + }) + + t.Run("GetReferences_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &InboxMessage{} + obj.References = nil + + // Act & Assert + assert.Nil(t, obj.GetReferences(), "getter should return nil when property is nil") + }) + + t.Run("GetReferences_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *InboxMessage + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetReferences() // Should return zero value + }) + + t.Run("GetText", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &InboxMessage{} + var expected *string + obj.Text = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetText(), "getter should return the property value") + }) + + t.Run("GetText_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &InboxMessage{} + obj.Text = nil + + // Act & Assert + assert.Nil(t, obj.GetText(), "getter should return nil when property is nil") + }) + + t.Run("GetText_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *InboxMessage + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetText() // Should return zero value + }) + + t.Run("GetExtractedText", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &InboxMessage{} + var expected *string + obj.ExtractedText = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetExtractedText(), "getter should return the property value") + }) + + t.Run("GetExtractedText_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &InboxMessage{} + obj.ExtractedText = nil + + // Act & Assert + assert.Nil(t, obj.GetExtractedText(), "getter should return nil when property is nil") + }) + + t.Run("GetExtractedText_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *InboxMessage + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetExtractedText() // Should return zero value + }) + + t.Run("GetHTML", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &InboxMessage{} + var expected *string + obj.HTML = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetHTML(), "getter should return the property value") + }) + + t.Run("GetHTML_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &InboxMessage{} + obj.HTML = nil + + // Act & Assert + assert.Nil(t, obj.GetHTML(), "getter should return nil when property is nil") + }) + + t.Run("GetHTML_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *InboxMessage + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetHTML() // Should return zero value + }) + + t.Run("GetTruncated", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &InboxMessage{} + var expected bool + obj.Truncated = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetTruncated(), "getter should return the property value") + }) + + t.Run("GetTruncated_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *InboxMessage + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetTruncated() // Should return zero value + }) + } -func TestSettersMarkExplicitInboxThreadSummary(t *testing.T) { +func TestSettersMarkExplicitInboxMessage(t *testing.T) { t.Run("SetObject_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &InboxThreadSummary{} - var fernTestValueObject InboxThreadSummaryObject + obj := &InboxMessage{} + var fernTestValueObject InboxMessageObject // Act obj.SetObject(fernTestValueObject) @@ -54991,7 +53495,7 @@ func TestSettersMarkExplicitInboxThreadSummary(t *testing.T) { t.Run("SetID_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &InboxThreadSummary{} + obj := &InboxMessage{} var fernTestValueID string // Act @@ -55022,7 +53526,7 @@ func TestSettersMarkExplicitInboxThreadSummary(t *testing.T) { t.Run("SetInboxID_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &InboxThreadSummary{} + obj := &InboxMessage{} var fernTestValueInboxID string // Act @@ -55050,14 +53554,14 @@ func TestSettersMarkExplicitInboxThreadSummary(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetSubject_MarksExplicit", func(t *testing.T) { + t.Run("SetThreadID_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &InboxThreadSummary{} - var fernTestValueSubject *string + obj := &InboxMessage{} + var fernTestValueThreadID string // Act - obj.SetSubject(fernTestValueSubject) + obj.SetThreadID(fernTestValueThreadID) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -55081,14 +53585,14 @@ func TestSettersMarkExplicitInboxThreadSummary(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetParticipants_MarksExplicit", func(t *testing.T) { + t.Run("SetDirection_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &InboxThreadSummary{} - var fernTestValueParticipants []string + obj := &InboxMessage{} + var fernTestValueDirection InboxMessageDirection // Act - obj.SetParticipants(fernTestValueParticipants) + obj.SetDirection(fernTestValueDirection) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -55112,14 +53616,14 @@ func TestSettersMarkExplicitInboxThreadSummary(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetMessageCount_MarksExplicit", func(t *testing.T) { + t.Run("SetStatus_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &InboxThreadSummary{} - var fernTestValueMessageCount int64 + obj := &InboxMessage{} + var fernTestValueStatus InboxMessageStatus // Act - obj.SetMessageCount(fernTestValueMessageCount) + obj.SetStatus(fernTestValueStatus) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -55143,14 +53647,14 @@ func TestSettersMarkExplicitInboxThreadSummary(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetPreview_MarksExplicit", func(t *testing.T) { + t.Run("SetFrom_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &InboxThreadSummary{} - var fernTestValuePreview *string + obj := &InboxMessage{} + var fernTestValueFrom *string // Act - obj.SetPreview(fernTestValuePreview) + obj.SetFrom(fernTestValueFrom) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -55174,14 +53678,14 @@ func TestSettersMarkExplicitInboxThreadSummary(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetLastMessageAt_MarksExplicit", func(t *testing.T) { + t.Run("SetTo_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &InboxThreadSummary{} - var fernTestValueLastMessageAt time.Time + obj := &InboxMessage{} + var fernTestValueTo []string // Act - obj.SetLastMessageAt(fernTestValueLastMessageAt) + obj.SetTo(fernTestValueTo) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -55205,14 +53709,14 @@ func TestSettersMarkExplicitInboxThreadSummary(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetLastInboundAt_MarksExplicit", func(t *testing.T) { + t.Run("SetCc_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &InboxThreadSummary{} - var fernTestValueLastInboundAt *time.Time + obj := &InboxMessage{} + var fernTestValueCc []string // Act - obj.SetLastInboundAt(fernTestValueLastInboundAt) + obj.SetCc(fernTestValueCc) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -55236,14 +53740,14 @@ func TestSettersMarkExplicitInboxThreadSummary(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetCreatedAt_MarksExplicit", func(t *testing.T) { + t.Run("SetSubject_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &InboxThreadSummary{} - var fernTestValueCreatedAt time.Time + obj := &InboxMessage{} + var fernTestValueSubject *string // Act - obj.SetCreatedAt(fernTestValueCreatedAt) + obj.SetSubject(fernTestValueSubject) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -55267,792 +53771,1235 @@ func TestSettersMarkExplicitInboxThreadSummary(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) -} + t.Run("SetPreview_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &InboxMessage{} + var fernTestValuePreview *string -func TestSettersInvoice(t *testing.T) { - t.Run("SetObject", func(t *testing.T) { - obj := &Invoice{} - var fernTestValueObject InvoiceObject - obj.SetObject(fernTestValueObject) - assert.Equal(t, fernTestValueObject, obj.Object) - assert.NotNil(t, obj.explicitFields) - }) + // Act + obj.SetPreview(fernTestValuePreview) - t.Run("SetID", func(t *testing.T) { - obj := &Invoice{} - var fernTestValueID string - obj.SetID(fernTestValueID) - assert.Equal(t, fernTestValueID, obj.ID) - assert.NotNil(t, obj.explicitFields) - }) + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") - t.Run("SetNumber", func(t *testing.T) { - obj := &Invoice{} - var fernTestValueNumber *string - obj.SetNumber(fernTestValueNumber) - assert.Equal(t, fernTestValueNumber, obj.Number) - assert.NotNil(t, obj.explicitFields) - }) + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } - t.Run("SetKind", func(t *testing.T) { - obj := &Invoice{} - var fernTestValueKind InvoiceKind - obj.SetKind(fernTestValueKind) - assert.Equal(t, fernTestValueKind, obj.Kind) - assert.NotNil(t, obj.explicitFields) + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetStatus", func(t *testing.T) { - obj := &Invoice{} - var fernTestValueStatus InvoiceStatus - obj.SetStatus(fernTestValueStatus) - assert.Equal(t, fernTestValueStatus, obj.Status) - assert.NotNil(t, obj.explicitFields) - }) + t.Run("SetAttachments_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &InboxMessage{} + var fernTestValueAttachments []*ReceivedEmailAttachment - t.Run("SetCurrency", func(t *testing.T) { - obj := &Invoice{} - var fernTestValueCurrency InvoiceCurrency - obj.SetCurrency(fernTestValueCurrency) - assert.Equal(t, fernTestValueCurrency, obj.Currency) - assert.NotNil(t, obj.explicitFields) - }) + // Act + obj.SetAttachments(fernTestValueAttachments) - t.Run("SetPeriod", func(t *testing.T) { - obj := &Invoice{} - var fernTestValuePeriod *InvoicePeriod - obj.SetPeriod(fernTestValuePeriod) - assert.Equal(t, fernTestValuePeriod, obj.Period) - assert.NotNil(t, obj.explicitFields) - }) + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") - t.Run("SetSubtotal", func(t *testing.T) { - obj := &Invoice{} - var fernTestValueSubtotal int64 - obj.SetSubtotal(fernTestValueSubtotal) - assert.Equal(t, fernTestValueSubtotal, obj.Subtotal) - assert.NotNil(t, obj.explicitFields) - }) + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } - t.Run("SetDiscount", func(t *testing.T) { - obj := &Invoice{} - var fernTestValueDiscount int64 - obj.SetDiscount(fernTestValueDiscount) - assert.Equal(t, fernTestValueDiscount, obj.Discount) - assert.NotNil(t, obj.explicitFields) + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetCredit", func(t *testing.T) { - obj := &Invoice{} - var fernTestValueCredit int64 - obj.SetCredit(fernTestValueCredit) - assert.Equal(t, fernTestValueCredit, obj.Credit) - assert.NotNil(t, obj.explicitFields) - }) + t.Run("SetSpam_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &InboxMessage{} + var fernTestValueSpam bool - t.Run("SetTax", func(t *testing.T) { - obj := &Invoice{} - var fernTestValueTax int64 - obj.SetTax(fernTestValueTax) - assert.Equal(t, fernTestValueTax, obj.Tax) - assert.NotNil(t, obj.explicitFields) - }) + // Act + obj.SetSpam(fernTestValueSpam) - t.Run("SetTotal", func(t *testing.T) { - obj := &Invoice{} - var fernTestValueTotal int64 - obj.SetTotal(fernTestValueTotal) - assert.Equal(t, fernTestValueTotal, obj.Total) - assert.NotNil(t, obj.explicitFields) - }) + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") - t.Run("SetAmountPaid", func(t *testing.T) { - obj := &Invoice{} - var fernTestValueAmountPaid int64 - obj.SetAmountPaid(fernTestValueAmountPaid) - assert.Equal(t, fernTestValueAmountPaid, obj.AmountPaid) - assert.NotNil(t, obj.explicitFields) - }) + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } - t.Run("SetAmountDue", func(t *testing.T) { - obj := &Invoice{} - var fernTestValueAmountDue int64 - obj.SetAmountDue(fernTestValueAmountDue) - assert.Equal(t, fernTestValueAmountDue, obj.AmountDue) - assert.NotNil(t, obj.explicitFields) + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetCollectionMethod", func(t *testing.T) { - obj := &Invoice{} - var fernTestValueCollectionMethod InvoiceCollectionMethod - obj.SetCollectionMethod(fernTestValueCollectionMethod) - assert.Equal(t, fernTestValueCollectionMethod, obj.CollectionMethod) - assert.NotNil(t, obj.explicitFields) - }) + t.Run("SetReceivedEmailID_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &InboxMessage{} + var fernTestValueReceivedEmailID *string - t.Run("SetDueAt", func(t *testing.T) { - obj := &Invoice{} - var fernTestValueDueAt *time.Time - obj.SetDueAt(fernTestValueDueAt) - assert.Equal(t, fernTestValueDueAt, obj.DueAt) - assert.NotNil(t, obj.explicitFields) - }) + // Act + obj.SetReceivedEmailID(fernTestValueReceivedEmailID) - t.Run("SetFinalizedAt", func(t *testing.T) { - obj := &Invoice{} - var fernTestValueFinalizedAt *time.Time - obj.SetFinalizedAt(fernTestValueFinalizedAt) - assert.Equal(t, fernTestValueFinalizedAt, obj.FinalizedAt) - assert.NotNil(t, obj.explicitFields) - }) + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") - t.Run("SetPaidAt", func(t *testing.T) { - obj := &Invoice{} - var fernTestValuePaidAt *time.Time - obj.SetPaidAt(fernTestValuePaidAt) - assert.Equal(t, fernTestValuePaidAt, obj.PaidAt) - assert.NotNil(t, obj.explicitFields) - }) + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } - t.Run("SetVoidedAt", func(t *testing.T) { - obj := &Invoice{} - var fernTestValueVoidedAt *time.Time - obj.SetVoidedAt(fernTestValueVoidedAt) - assert.Equal(t, fernTestValueVoidedAt, obj.VoidedAt) - assert.NotNil(t, obj.explicitFields) + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetHostedURL", func(t *testing.T) { - obj := &Invoice{} - var fernTestValueHostedURL *string - obj.SetHostedURL(fernTestValueHostedURL) - assert.Equal(t, fernTestValueHostedURL, obj.HostedURL) - assert.NotNil(t, obj.explicitFields) - }) + t.Run("SetEmailID_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &InboxMessage{} + var fernTestValueEmailID *string - t.Run("SetPdfURL", func(t *testing.T) { - obj := &Invoice{} - var fernTestValuePdfURL *string - obj.SetPdfURL(fernTestValuePdfURL) - assert.Equal(t, fernTestValuePdfURL, obj.PdfURL) - assert.NotNil(t, obj.explicitFields) - }) + // Act + obj.SetEmailID(fernTestValueEmailID) - t.Run("SetLines", func(t *testing.T) { - obj := &Invoice{} - var fernTestValueLines []*InvoiceLine - obj.SetLines(fernTestValueLines) - assert.Equal(t, fernTestValueLines, obj.Lines) - assert.NotNil(t, obj.explicitFields) - }) + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") -} + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } -func TestGettersInvoice(t *testing.T) { - t.Run("GetObject", func(t *testing.T) { + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetCreatedAt_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &Invoice{} - var expected InvoiceObject - obj.Object = expected + obj := &InboxMessage{} + var fernTestValueCreatedAt time.Time - // Act & Assert - assert.Equal(t, expected, obj.GetObject(), "getter should return the property value") - }) + // Act + obj.SetCreatedAt(fernTestValueCreatedAt) - t.Run("GetObject_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *Invoice - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetObject() // Should return zero value + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("GetID", func(t *testing.T) { + t.Run("SetReplyTo_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &Invoice{} - var expected string - obj.ID = expected + obj := &InboxMessage{} + var fernTestValueReplyTo []string - // Act & Assert - assert.Equal(t, expected, obj.GetID(), "getter should return the property value") - }) + // Act + obj.SetReplyTo(fernTestValueReplyTo) - t.Run("GetID_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *Invoice - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetID() // Should return zero value - }) + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") - t.Run("GetNumber", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &Invoice{} - var expected *string - obj.Number = expected + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } - // Act & Assert - assert.Equal(t, expected, obj.GetNumber(), "getter should return the property value") + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("GetNumber_NilValue", func(t *testing.T) { + t.Run("SetMessageID_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &Invoice{} - obj.Number = nil + obj := &InboxMessage{} + var fernTestValueMessageID *string - // Act & Assert - assert.Nil(t, obj.GetNumber(), "getter should return nil when property is nil") - }) + // Act + obj.SetMessageID(fernTestValueMessageID) - t.Run("GetNumber_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *Invoice - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetNumber() // Should return zero value + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("GetKind", func(t *testing.T) { + t.Run("SetInReplyTo_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &Invoice{} - var expected InvoiceKind - obj.Kind = expected + obj := &InboxMessage{} + var fernTestValueInReplyTo *string - // Act & Assert - assert.Equal(t, expected, obj.GetKind(), "getter should return the property value") - }) + // Act + obj.SetInReplyTo(fernTestValueInReplyTo) - t.Run("GetKind_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *Invoice - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetKind() // Should return zero value + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("GetStatus", func(t *testing.T) { + t.Run("SetReferences_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &Invoice{} - var expected InvoiceStatus - obj.Status = expected + obj := &InboxMessage{} + var fernTestValueReferences []string - // Act & Assert - assert.Equal(t, expected, obj.GetStatus(), "getter should return the property value") + // Act + obj.SetReferences(fernTestValueReferences) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("GetStatus_NilReceiver", func(t *testing.T) { + t.Run("SetText_MarksExplicit", func(t *testing.T) { t.Parallel() - var obj *Invoice - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetStatus() // Should return zero value + // Arrange + obj := &InboxMessage{} + var fernTestValueText *string + + // Act + obj.SetText(fernTestValueText) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("GetCurrency", func(t *testing.T) { + t.Run("SetExtractedText_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &Invoice{} - var expected InvoiceCurrency - obj.Currency = expected + obj := &InboxMessage{} + var fernTestValueExtractedText *string + + // Act + obj.SetExtractedText(fernTestValueExtractedText) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetHTML_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &InboxMessage{} + var fernTestValueHTML *string + + // Act + obj.SetHTML(fernTestValueHTML) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetTruncated_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &InboxMessage{} + var fernTestValueTruncated bool + + // Act + obj.SetTruncated(fernTestValueTruncated) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + +} + +func TestSettersInboxMessageList(t *testing.T) { + t.Run("SetObject", func(t *testing.T) { + obj := &InboxMessageList{} + var fernTestValueObject InboxMessageListObject + obj.SetObject(fernTestValueObject) + assert.Equal(t, fernTestValueObject, obj.Object) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetData", func(t *testing.T) { + obj := &InboxMessageList{} + var fernTestValueData []*InboxMessageSummary + obj.SetData(fernTestValueData) + assert.Equal(t, fernTestValueData, obj.Data) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetHasMore", func(t *testing.T) { + obj := &InboxMessageList{} + var fernTestValueHasMore bool + obj.SetHasMore(fernTestValueHasMore) + assert.Equal(t, fernTestValueHasMore, obj.HasMore) + assert.NotNil(t, obj.explicitFields) + }) + +} + +func TestGettersInboxMessageList(t *testing.T) { + t.Run("GetObject", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &InboxMessageList{} + var expected InboxMessageListObject + obj.Object = expected // Act & Assert - assert.Equal(t, expected, obj.GetCurrency(), "getter should return the property value") + assert.Equal(t, expected, obj.GetObject(), "getter should return the property value") }) - t.Run("GetCurrency_NilReceiver", func(t *testing.T) { + t.Run("GetObject_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *Invoice + var obj *InboxMessageList // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetCurrency() // Should return zero value + _ = obj.GetObject() // Should return zero value }) - t.Run("GetPeriod", func(t *testing.T) { + t.Run("GetData", func(t *testing.T) { t.Parallel() // Arrange - obj := &Invoice{} - var expected *InvoicePeriod - obj.Period = expected + obj := &InboxMessageList{} + var expected []*InboxMessageSummary + obj.Data = expected // Act & Assert - assert.Equal(t, expected, obj.GetPeriod(), "getter should return the property value") + assert.Equal(t, expected, obj.GetData(), "getter should return the property value") }) - t.Run("GetPeriod_NilValue", func(t *testing.T) { + t.Run("GetData_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &Invoice{} - obj.Period = nil + obj := &InboxMessageList{} + obj.Data = nil // Act & Assert - assert.Nil(t, obj.GetPeriod(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetData(), "getter should return nil when property is nil") }) - t.Run("GetPeriod_NilReceiver", func(t *testing.T) { + t.Run("GetData_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *Invoice + var obj *InboxMessageList // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetPeriod() // Should return zero value + _ = obj.GetData() // Should return zero value }) - t.Run("GetSubtotal", func(t *testing.T) { + t.Run("GetHasMore", func(t *testing.T) { t.Parallel() // Arrange - obj := &Invoice{} - var expected int64 - obj.Subtotal = expected + obj := &InboxMessageList{} + var expected bool + obj.HasMore = expected // Act & Assert - assert.Equal(t, expected, obj.GetSubtotal(), "getter should return the property value") + assert.Equal(t, expected, obj.GetHasMore(), "getter should return the property value") }) - t.Run("GetSubtotal_NilReceiver", func(t *testing.T) { + t.Run("GetHasMore_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *Invoice + var obj *InboxMessageList // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetSubtotal() // Should return zero value + _ = obj.GetHasMore() // Should return zero value }) - t.Run("GetDiscount", func(t *testing.T) { +} + +func TestSettersMarkExplicitInboxMessageList(t *testing.T) { + t.Run("SetObject_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &Invoice{} - var expected int64 - obj.Discount = expected + obj := &InboxMessageList{} + var fernTestValueObject InboxMessageListObject + + // Act + obj.SetObject(fernTestValueObject) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetData_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &InboxMessageList{} + var fernTestValueData []*InboxMessageSummary + + // Act + obj.SetData(fernTestValueData) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetHasMore_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &InboxMessageList{} + var fernTestValueHasMore bool + + // Act + obj.SetHasMore(fernTestValueHasMore) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + +} + +func TestSettersInboxMessageSummary(t *testing.T) { + t.Run("SetObject", func(t *testing.T) { + obj := &InboxMessageSummary{} + var fernTestValueObject InboxMessageSummaryObject + obj.SetObject(fernTestValueObject) + assert.Equal(t, fernTestValueObject, obj.Object) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetID", func(t *testing.T) { + obj := &InboxMessageSummary{} + var fernTestValueID string + obj.SetID(fernTestValueID) + assert.Equal(t, fernTestValueID, obj.ID) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetInboxID", func(t *testing.T) { + obj := &InboxMessageSummary{} + var fernTestValueInboxID string + obj.SetInboxID(fernTestValueInboxID) + assert.Equal(t, fernTestValueInboxID, obj.InboxID) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetThreadID", func(t *testing.T) { + obj := &InboxMessageSummary{} + var fernTestValueThreadID string + obj.SetThreadID(fernTestValueThreadID) + assert.Equal(t, fernTestValueThreadID, obj.ThreadID) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetDirection", func(t *testing.T) { + obj := &InboxMessageSummary{} + var fernTestValueDirection InboxMessageSummaryDirection + obj.SetDirection(fernTestValueDirection) + assert.Equal(t, fernTestValueDirection, obj.Direction) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetStatus", func(t *testing.T) { + obj := &InboxMessageSummary{} + var fernTestValueStatus InboxMessageSummaryStatus + obj.SetStatus(fernTestValueStatus) + assert.Equal(t, fernTestValueStatus, obj.Status) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetFrom", func(t *testing.T) { + obj := &InboxMessageSummary{} + var fernTestValueFrom *string + obj.SetFrom(fernTestValueFrom) + assert.Equal(t, fernTestValueFrom, obj.From) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetTo", func(t *testing.T) { + obj := &InboxMessageSummary{} + var fernTestValueTo []string + obj.SetTo(fernTestValueTo) + assert.Equal(t, fernTestValueTo, obj.To) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetCc", func(t *testing.T) { + obj := &InboxMessageSummary{} + var fernTestValueCc []string + obj.SetCc(fernTestValueCc) + assert.Equal(t, fernTestValueCc, obj.Cc) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetSubject", func(t *testing.T) { + obj := &InboxMessageSummary{} + var fernTestValueSubject *string + obj.SetSubject(fernTestValueSubject) + assert.Equal(t, fernTestValueSubject, obj.Subject) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetPreview", func(t *testing.T) { + obj := &InboxMessageSummary{} + var fernTestValuePreview *string + obj.SetPreview(fernTestValuePreview) + assert.Equal(t, fernTestValuePreview, obj.Preview) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetAttachments", func(t *testing.T) { + obj := &InboxMessageSummary{} + var fernTestValueAttachments []*ReceivedEmailAttachment + obj.SetAttachments(fernTestValueAttachments) + assert.Equal(t, fernTestValueAttachments, obj.Attachments) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetSpam", func(t *testing.T) { + obj := &InboxMessageSummary{} + var fernTestValueSpam bool + obj.SetSpam(fernTestValueSpam) + assert.Equal(t, fernTestValueSpam, obj.Spam) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetReceivedEmailID", func(t *testing.T) { + obj := &InboxMessageSummary{} + var fernTestValueReceivedEmailID *string + obj.SetReceivedEmailID(fernTestValueReceivedEmailID) + assert.Equal(t, fernTestValueReceivedEmailID, obj.ReceivedEmailID) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetEmailID", func(t *testing.T) { + obj := &InboxMessageSummary{} + var fernTestValueEmailID *string + obj.SetEmailID(fernTestValueEmailID) + assert.Equal(t, fernTestValueEmailID, obj.EmailID) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetCreatedAt", func(t *testing.T) { + obj := &InboxMessageSummary{} + var fernTestValueCreatedAt time.Time + obj.SetCreatedAt(fernTestValueCreatedAt) + assert.Equal(t, fernTestValueCreatedAt, obj.CreatedAt) + assert.NotNil(t, obj.explicitFields) + }) + +} + +func TestGettersInboxMessageSummary(t *testing.T) { + t.Run("GetObject", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &InboxMessageSummary{} + var expected InboxMessageSummaryObject + obj.Object = expected // Act & Assert - assert.Equal(t, expected, obj.GetDiscount(), "getter should return the property value") + assert.Equal(t, expected, obj.GetObject(), "getter should return the property value") }) - t.Run("GetDiscount_NilReceiver", func(t *testing.T) { + t.Run("GetObject_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *Invoice + var obj *InboxMessageSummary // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetDiscount() // Should return zero value + _ = obj.GetObject() // Should return zero value }) - t.Run("GetCredit", func(t *testing.T) { + t.Run("GetID", func(t *testing.T) { t.Parallel() // Arrange - obj := &Invoice{} - var expected int64 - obj.Credit = expected + obj := &InboxMessageSummary{} + var expected string + obj.ID = expected // Act & Assert - assert.Equal(t, expected, obj.GetCredit(), "getter should return the property value") + assert.Equal(t, expected, obj.GetID(), "getter should return the property value") }) - t.Run("GetCredit_NilReceiver", func(t *testing.T) { + t.Run("GetID_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *Invoice + var obj *InboxMessageSummary // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetCredit() // Should return zero value + _ = obj.GetID() // Should return zero value }) - t.Run("GetTax", func(t *testing.T) { + t.Run("GetInboxID", func(t *testing.T) { t.Parallel() // Arrange - obj := &Invoice{} - var expected int64 - obj.Tax = expected + obj := &InboxMessageSummary{} + var expected string + obj.InboxID = expected // Act & Assert - assert.Equal(t, expected, obj.GetTax(), "getter should return the property value") + assert.Equal(t, expected, obj.GetInboxID(), "getter should return the property value") }) - t.Run("GetTax_NilReceiver", func(t *testing.T) { + t.Run("GetInboxID_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *Invoice + var obj *InboxMessageSummary // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetTax() // Should return zero value + _ = obj.GetInboxID() // Should return zero value }) - t.Run("GetTotal", func(t *testing.T) { + t.Run("GetThreadID", func(t *testing.T) { t.Parallel() // Arrange - obj := &Invoice{} - var expected int64 - obj.Total = expected + obj := &InboxMessageSummary{} + var expected string + obj.ThreadID = expected // Act & Assert - assert.Equal(t, expected, obj.GetTotal(), "getter should return the property value") + assert.Equal(t, expected, obj.GetThreadID(), "getter should return the property value") }) - t.Run("GetTotal_NilReceiver", func(t *testing.T) { + t.Run("GetThreadID_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *Invoice + var obj *InboxMessageSummary // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetTotal() // Should return zero value + _ = obj.GetThreadID() // Should return zero value }) - t.Run("GetAmountPaid", func(t *testing.T) { + t.Run("GetDirection", func(t *testing.T) { t.Parallel() // Arrange - obj := &Invoice{} - var expected int64 - obj.AmountPaid = expected + obj := &InboxMessageSummary{} + var expected InboxMessageSummaryDirection + obj.Direction = expected // Act & Assert - assert.Equal(t, expected, obj.GetAmountPaid(), "getter should return the property value") + assert.Equal(t, expected, obj.GetDirection(), "getter should return the property value") }) - t.Run("GetAmountPaid_NilReceiver", func(t *testing.T) { + t.Run("GetDirection_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *Invoice + var obj *InboxMessageSummary // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetAmountPaid() // Should return zero value + _ = obj.GetDirection() // Should return zero value }) - t.Run("GetAmountDue", func(t *testing.T) { + t.Run("GetStatus", func(t *testing.T) { t.Parallel() // Arrange - obj := &Invoice{} - var expected int64 - obj.AmountDue = expected + obj := &InboxMessageSummary{} + var expected InboxMessageSummaryStatus + obj.Status = expected // Act & Assert - assert.Equal(t, expected, obj.GetAmountDue(), "getter should return the property value") + assert.Equal(t, expected, obj.GetStatus(), "getter should return the property value") }) - t.Run("GetAmountDue_NilReceiver", func(t *testing.T) { + t.Run("GetStatus_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *Invoice + var obj *InboxMessageSummary // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetAmountDue() // Should return zero value + _ = obj.GetStatus() // Should return zero value }) - t.Run("GetCollectionMethod", func(t *testing.T) { + t.Run("GetFrom", func(t *testing.T) { t.Parallel() // Arrange - obj := &Invoice{} - var expected InvoiceCollectionMethod - obj.CollectionMethod = expected + obj := &InboxMessageSummary{} + var expected *string + obj.From = expected // Act & Assert - assert.Equal(t, expected, obj.GetCollectionMethod(), "getter should return the property value") + assert.Equal(t, expected, obj.GetFrom(), "getter should return the property value") }) - t.Run("GetCollectionMethod_NilReceiver", func(t *testing.T) { + t.Run("GetFrom_NilValue", func(t *testing.T) { t.Parallel() - var obj *Invoice + // Arrange + obj := &InboxMessageSummary{} + obj.From = nil + + // Act & Assert + assert.Nil(t, obj.GetFrom(), "getter should return nil when property is nil") + }) + + t.Run("GetFrom_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *InboxMessageSummary // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetCollectionMethod() // Should return zero value + _ = obj.GetFrom() // Should return zero value }) - t.Run("GetDueAt", func(t *testing.T) { + t.Run("GetTo", func(t *testing.T) { t.Parallel() // Arrange - obj := &Invoice{} - var expected *time.Time - obj.DueAt = expected + obj := &InboxMessageSummary{} + var expected []string + obj.To = expected // Act & Assert - assert.Equal(t, expected, obj.GetDueAt(), "getter should return the property value") + assert.Equal(t, expected, obj.GetTo(), "getter should return the property value") }) - t.Run("GetDueAt_NilValue", func(t *testing.T) { + t.Run("GetTo_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &Invoice{} - obj.DueAt = nil + obj := &InboxMessageSummary{} + obj.To = nil // Act & Assert - assert.Nil(t, obj.GetDueAt(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetTo(), "getter should return nil when property is nil") }) - t.Run("GetDueAt_NilReceiver", func(t *testing.T) { + t.Run("GetTo_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *Invoice + var obj *InboxMessageSummary // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetDueAt() // Should return zero value + _ = obj.GetTo() // Should return zero value }) - t.Run("GetFinalizedAt", func(t *testing.T) { + t.Run("GetCc", func(t *testing.T) { t.Parallel() // Arrange - obj := &Invoice{} - var expected *time.Time - obj.FinalizedAt = expected + obj := &InboxMessageSummary{} + var expected []string + obj.Cc = expected // Act & Assert - assert.Equal(t, expected, obj.GetFinalizedAt(), "getter should return the property value") + assert.Equal(t, expected, obj.GetCc(), "getter should return the property value") }) - t.Run("GetFinalizedAt_NilValue", func(t *testing.T) { + t.Run("GetCc_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &Invoice{} - obj.FinalizedAt = nil + obj := &InboxMessageSummary{} + obj.Cc = nil // Act & Assert - assert.Nil(t, obj.GetFinalizedAt(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetCc(), "getter should return nil when property is nil") }) - t.Run("GetFinalizedAt_NilReceiver", func(t *testing.T) { + t.Run("GetCc_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *Invoice + var obj *InboxMessageSummary // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetFinalizedAt() // Should return zero value + _ = obj.GetCc() // Should return zero value }) - t.Run("GetPaidAt", func(t *testing.T) { + t.Run("GetSubject", func(t *testing.T) { t.Parallel() // Arrange - obj := &Invoice{} - var expected *time.Time - obj.PaidAt = expected + obj := &InboxMessageSummary{} + var expected *string + obj.Subject = expected // Act & Assert - assert.Equal(t, expected, obj.GetPaidAt(), "getter should return the property value") + assert.Equal(t, expected, obj.GetSubject(), "getter should return the property value") }) - t.Run("GetPaidAt_NilValue", func(t *testing.T) { + t.Run("GetSubject_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &Invoice{} - obj.PaidAt = nil + obj := &InboxMessageSummary{} + obj.Subject = nil // Act & Assert - assert.Nil(t, obj.GetPaidAt(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetSubject(), "getter should return nil when property is nil") }) - t.Run("GetPaidAt_NilReceiver", func(t *testing.T) { + t.Run("GetSubject_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *Invoice + var obj *InboxMessageSummary // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetPaidAt() // Should return zero value + _ = obj.GetSubject() // Should return zero value }) - t.Run("GetVoidedAt", func(t *testing.T) { + t.Run("GetPreview", func(t *testing.T) { t.Parallel() // Arrange - obj := &Invoice{} - var expected *time.Time - obj.VoidedAt = expected + obj := &InboxMessageSummary{} + var expected *string + obj.Preview = expected // Act & Assert - assert.Equal(t, expected, obj.GetVoidedAt(), "getter should return the property value") + assert.Equal(t, expected, obj.GetPreview(), "getter should return the property value") }) - t.Run("GetVoidedAt_NilValue", func(t *testing.T) { + t.Run("GetPreview_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &Invoice{} - obj.VoidedAt = nil + obj := &InboxMessageSummary{} + obj.Preview = nil // Act & Assert - assert.Nil(t, obj.GetVoidedAt(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetPreview(), "getter should return nil when property is nil") }) - t.Run("GetVoidedAt_NilReceiver", func(t *testing.T) { + t.Run("GetPreview_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *Invoice + var obj *InboxMessageSummary // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetVoidedAt() // Should return zero value + _ = obj.GetPreview() // Should return zero value }) - t.Run("GetHostedURL", func(t *testing.T) { + t.Run("GetAttachments", func(t *testing.T) { t.Parallel() // Arrange - obj := &Invoice{} - var expected *string - obj.HostedURL = expected + obj := &InboxMessageSummary{} + var expected []*ReceivedEmailAttachment + obj.Attachments = expected // Act & Assert - assert.Equal(t, expected, obj.GetHostedURL(), "getter should return the property value") + assert.Equal(t, expected, obj.GetAttachments(), "getter should return the property value") }) - t.Run("GetHostedURL_NilValue", func(t *testing.T) { + t.Run("GetAttachments_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &Invoice{} - obj.HostedURL = nil + obj := &InboxMessageSummary{} + obj.Attachments = nil // Act & Assert - assert.Nil(t, obj.GetHostedURL(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetAttachments(), "getter should return nil when property is nil") }) - t.Run("GetHostedURL_NilReceiver", func(t *testing.T) { + t.Run("GetAttachments_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *Invoice + var obj *InboxMessageSummary // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetHostedURL() // Should return zero value + _ = obj.GetAttachments() // Should return zero value }) - t.Run("GetPdfURL", func(t *testing.T) { + t.Run("GetSpam", func(t *testing.T) { t.Parallel() // Arrange - obj := &Invoice{} + obj := &InboxMessageSummary{} + var expected bool + obj.Spam = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetSpam(), "getter should return the property value") + }) + + t.Run("GetSpam_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *InboxMessageSummary + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetSpam() // Should return zero value + }) + + t.Run("GetReceivedEmailID", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &InboxMessageSummary{} var expected *string - obj.PdfURL = expected + obj.ReceivedEmailID = expected // Act & Assert - assert.Equal(t, expected, obj.GetPdfURL(), "getter should return the property value") + assert.Equal(t, expected, obj.GetReceivedEmailID(), "getter should return the property value") }) - t.Run("GetPdfURL_NilValue", func(t *testing.T) { + t.Run("GetReceivedEmailID_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &Invoice{} - obj.PdfURL = nil + obj := &InboxMessageSummary{} + obj.ReceivedEmailID = nil // Act & Assert - assert.Nil(t, obj.GetPdfURL(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetReceivedEmailID(), "getter should return nil when property is nil") }) - t.Run("GetPdfURL_NilReceiver", func(t *testing.T) { + t.Run("GetReceivedEmailID_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *Invoice + var obj *InboxMessageSummary // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetPdfURL() // Should return zero value + _ = obj.GetReceivedEmailID() // Should return zero value }) - t.Run("GetLines", func(t *testing.T) { + t.Run("GetEmailID", func(t *testing.T) { t.Parallel() // Arrange - obj := &Invoice{} - var expected []*InvoiceLine - obj.Lines = expected + obj := &InboxMessageSummary{} + var expected *string + obj.EmailID = expected // Act & Assert - assert.Equal(t, expected, obj.GetLines(), "getter should return the property value") + assert.Equal(t, expected, obj.GetEmailID(), "getter should return the property value") }) - t.Run("GetLines_NilValue", func(t *testing.T) { + t.Run("GetEmailID_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &Invoice{} - obj.Lines = nil + obj := &InboxMessageSummary{} + obj.EmailID = nil // Act & Assert - assert.Nil(t, obj.GetLines(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetEmailID(), "getter should return nil when property is nil") }) - t.Run("GetLines_NilReceiver", func(t *testing.T) { + t.Run("GetEmailID_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *Invoice + var obj *InboxMessageSummary // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetLines() // Should return zero value + _ = obj.GetEmailID() // Should return zero value + }) + + t.Run("GetCreatedAt", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &InboxMessageSummary{} + var expected time.Time + obj.CreatedAt = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetCreatedAt(), "getter should return the property value") + }) + + t.Run("GetCreatedAt_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *InboxMessageSummary + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetCreatedAt() // Should return zero value }) } -func TestSettersMarkExplicitInvoice(t *testing.T) { +func TestSettersMarkExplicitInboxMessageSummary(t *testing.T) { t.Run("SetObject_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &Invoice{} - var fernTestValueObject InvoiceObject + obj := &InboxMessageSummary{} + var fernTestValueObject InboxMessageSummaryObject // Act obj.SetObject(fernTestValueObject) @@ -56082,7 +55029,7 @@ func TestSettersMarkExplicitInvoice(t *testing.T) { t.Run("SetID_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &Invoice{} + obj := &InboxMessageSummary{} var fernTestValueID string // Act @@ -56110,14 +55057,14 @@ func TestSettersMarkExplicitInvoice(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetNumber_MarksExplicit", func(t *testing.T) { + t.Run("SetInboxID_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &Invoice{} - var fernTestValueNumber *string + obj := &InboxMessageSummary{} + var fernTestValueInboxID string // Act - obj.SetNumber(fernTestValueNumber) + obj.SetInboxID(fernTestValueInboxID) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -56141,14 +55088,14 @@ func TestSettersMarkExplicitInvoice(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetKind_MarksExplicit", func(t *testing.T) { + t.Run("SetThreadID_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &Invoice{} - var fernTestValueKind InvoiceKind + obj := &InboxMessageSummary{} + var fernTestValueThreadID string // Act - obj.SetKind(fernTestValueKind) + obj.SetThreadID(fernTestValueThreadID) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -56172,14 +55119,14 @@ func TestSettersMarkExplicitInvoice(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetStatus_MarksExplicit", func(t *testing.T) { + t.Run("SetDirection_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &Invoice{} - var fernTestValueStatus InvoiceStatus + obj := &InboxMessageSummary{} + var fernTestValueDirection InboxMessageSummaryDirection // Act - obj.SetStatus(fernTestValueStatus) + obj.SetDirection(fernTestValueDirection) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -56203,14 +55150,14 @@ func TestSettersMarkExplicitInvoice(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetCurrency_MarksExplicit", func(t *testing.T) { + t.Run("SetStatus_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &Invoice{} - var fernTestValueCurrency InvoiceCurrency + obj := &InboxMessageSummary{} + var fernTestValueStatus InboxMessageSummaryStatus // Act - obj.SetCurrency(fernTestValueCurrency) + obj.SetStatus(fernTestValueStatus) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -56234,14 +55181,14 @@ func TestSettersMarkExplicitInvoice(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetPeriod_MarksExplicit", func(t *testing.T) { + t.Run("SetFrom_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &Invoice{} - var fernTestValuePeriod *InvoicePeriod + obj := &InboxMessageSummary{} + var fernTestValueFrom *string // Act - obj.SetPeriod(fernTestValuePeriod) + obj.SetFrom(fernTestValueFrom) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -56265,14 +55212,14 @@ func TestSettersMarkExplicitInvoice(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetSubtotal_MarksExplicit", func(t *testing.T) { + t.Run("SetTo_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &Invoice{} - var fernTestValueSubtotal int64 + obj := &InboxMessageSummary{} + var fernTestValueTo []string // Act - obj.SetSubtotal(fernTestValueSubtotal) + obj.SetTo(fernTestValueTo) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -56296,14 +55243,14 @@ func TestSettersMarkExplicitInvoice(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetDiscount_MarksExplicit", func(t *testing.T) { + t.Run("SetCc_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &Invoice{} - var fernTestValueDiscount int64 + obj := &InboxMessageSummary{} + var fernTestValueCc []string // Act - obj.SetDiscount(fernTestValueDiscount) + obj.SetCc(fernTestValueCc) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -56327,14 +55274,14 @@ func TestSettersMarkExplicitInvoice(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetCredit_MarksExplicit", func(t *testing.T) { + t.Run("SetSubject_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &Invoice{} - var fernTestValueCredit int64 + obj := &InboxMessageSummary{} + var fernTestValueSubject *string // Act - obj.SetCredit(fernTestValueCredit) + obj.SetSubject(fernTestValueSubject) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -56358,14 +55305,14 @@ func TestSettersMarkExplicitInvoice(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetTax_MarksExplicit", func(t *testing.T) { + t.Run("SetPreview_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &Invoice{} - var fernTestValueTax int64 + obj := &InboxMessageSummary{} + var fernTestValuePreview *string // Act - obj.SetTax(fernTestValueTax) + obj.SetPreview(fernTestValuePreview) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -56389,14 +55336,14 @@ func TestSettersMarkExplicitInvoice(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetTotal_MarksExplicit", func(t *testing.T) { + t.Run("SetAttachments_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &Invoice{} - var fernTestValueTotal int64 + obj := &InboxMessageSummary{} + var fernTestValueAttachments []*ReceivedEmailAttachment // Act - obj.SetTotal(fernTestValueTotal) + obj.SetAttachments(fernTestValueAttachments) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -56420,14 +55367,14 @@ func TestSettersMarkExplicitInvoice(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetAmountPaid_MarksExplicit", func(t *testing.T) { + t.Run("SetSpam_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &Invoice{} - var fernTestValueAmountPaid int64 + obj := &InboxMessageSummary{} + var fernTestValueSpam bool // Act - obj.SetAmountPaid(fernTestValueAmountPaid) + obj.SetSpam(fernTestValueSpam) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -56451,14 +55398,14 @@ func TestSettersMarkExplicitInvoice(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetAmountDue_MarksExplicit", func(t *testing.T) { + t.Run("SetReceivedEmailID_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &Invoice{} - var fernTestValueAmountDue int64 + obj := &InboxMessageSummary{} + var fernTestValueReceivedEmailID *string // Act - obj.SetAmountDue(fernTestValueAmountDue) + obj.SetReceivedEmailID(fernTestValueReceivedEmailID) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -56482,14 +55429,14 @@ func TestSettersMarkExplicitInvoice(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetCollectionMethod_MarksExplicit", func(t *testing.T) { + t.Run("SetEmailID_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &Invoice{} - var fernTestValueCollectionMethod InvoiceCollectionMethod + obj := &InboxMessageSummary{} + var fernTestValueEmailID *string // Act - obj.SetCollectionMethod(fernTestValueCollectionMethod) + obj.SetEmailID(fernTestValueEmailID) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -56513,14 +55460,14 @@ func TestSettersMarkExplicitInvoice(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetDueAt_MarksExplicit", func(t *testing.T) { + t.Run("SetCreatedAt_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &Invoice{} - var fernTestValueDueAt *time.Time + obj := &InboxMessageSummary{} + var fernTestValueCreatedAt time.Time // Act - obj.SetDueAt(fernTestValueDueAt) + obj.SetCreatedAt(fernTestValueCreatedAt) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -56544,291 +55491,105 @@ func TestSettersMarkExplicitInvoice(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetFinalizedAt_MarksExplicit", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &Invoice{} - var fernTestValueFinalizedAt *time.Time +} - // Act - obj.SetFinalizedAt(fernTestValueFinalizedAt) +func TestSettersInboxThread(t *testing.T) { + t.Run("SetObject", func(t *testing.T) { + obj := &InboxThread{} + var fernTestValueObject InboxThreadObject + obj.SetObject(fernTestValueObject) + assert.Equal(t, fernTestValueObject, obj.Object) + assert.NotNil(t, obj.explicitFields) + }) - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") + t.Run("SetID", func(t *testing.T) { + obj := &InboxThread{} + var fernTestValueID string + obj.SetID(fernTestValueID) + assert.Equal(t, fernTestValueID, obj.ID) + assert.NotNil(t, obj.explicitFields) + }) - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } + t.Run("SetInboxID", func(t *testing.T) { + obj := &InboxThread{} + var fernTestValueInboxID string + obj.SetInboxID(fernTestValueInboxID) + assert.Equal(t, fernTestValueInboxID, obj.InboxID) + assert.NotNil(t, obj.explicitFields) + }) - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip + t.Run("SetSubject", func(t *testing.T) { + obj := &InboxThread{} + var fernTestValueSubject *string + obj.SetSubject(fernTestValueSubject) + assert.Equal(t, fernTestValueSubject, obj.Subject) + assert.NotNil(t, obj.explicitFields) }) - t.Run("SetPaidAt_MarksExplicit", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &Invoice{} - var fernTestValuePaidAt *time.Time + t.Run("SetParticipants", func(t *testing.T) { + obj := &InboxThread{} + var fernTestValueParticipants []string + obj.SetParticipants(fernTestValueParticipants) + assert.Equal(t, fernTestValueParticipants, obj.Participants) + assert.NotNil(t, obj.explicitFields) + }) - // Act - obj.SetPaidAt(fernTestValuePaidAt) - - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") - - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } - - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip - }) - - t.Run("SetVoidedAt_MarksExplicit", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &Invoice{} - var fernTestValueVoidedAt *time.Time - - // Act - obj.SetVoidedAt(fernTestValueVoidedAt) - - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") - - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } - - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip - }) - - t.Run("SetHostedURL_MarksExplicit", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &Invoice{} - var fernTestValueHostedURL *string - - // Act - obj.SetHostedURL(fernTestValueHostedURL) - - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") - - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } - - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip - }) - - t.Run("SetPdfURL_MarksExplicit", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &Invoice{} - var fernTestValuePdfURL *string - - // Act - obj.SetPdfURL(fernTestValuePdfURL) - - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") - - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } - - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip - }) - - t.Run("SetLines_MarksExplicit", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &Invoice{} - var fernTestValueLines []*InvoiceLine - - // Act - obj.SetLines(fernTestValueLines) - - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") - - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } - - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip - }) - -} - -func TestSettersInvoiceLine(t *testing.T) { - t.Run("SetObject", func(t *testing.T) { - obj := &InvoiceLine{} - var fernTestValueObject InvoiceLineObject - obj.SetObject(fernTestValueObject) - assert.Equal(t, fernTestValueObject, obj.Object) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetID", func(t *testing.T) { - obj := &InvoiceLine{} - var fernTestValueID string - obj.SetID(fernTestValueID) - assert.Equal(t, fernTestValueID, obj.ID) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetKind", func(t *testing.T) { - obj := &InvoiceLine{} - var fernTestValueKind InvoiceLineKind - obj.SetKind(fernTestValueKind) - assert.Equal(t, fernTestValueKind, obj.Kind) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetDescription", func(t *testing.T) { - obj := &InvoiceLine{} - var fernTestValueDescription string - obj.SetDescription(fernTestValueDescription) - assert.Equal(t, fernTestValueDescription, obj.Description) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetMeter", func(t *testing.T) { - obj := &InvoiceLine{} - var fernTestValueMeter *InvoiceLineMeter - obj.SetMeter(fernTestValueMeter) - assert.Equal(t, fernTestValueMeter, obj.Meter) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetDimension", func(t *testing.T) { - obj := &InvoiceLine{} - var fernTestValueDimension *string - obj.SetDimension(fernTestValueDimension) - assert.Equal(t, fernTestValueDimension, obj.Dimension) + t.Run("SetMessageCount", func(t *testing.T) { + obj := &InboxThread{} + var fernTestValueMessageCount int64 + obj.SetMessageCount(fernTestValueMessageCount) + assert.Equal(t, fernTestValueMessageCount, obj.MessageCount) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetQuantity", func(t *testing.T) { - obj := &InvoiceLine{} - var fernTestValueQuantity *int64 - obj.SetQuantity(fernTestValueQuantity) - assert.Equal(t, fernTestValueQuantity, obj.Quantity) + t.Run("SetPreview", func(t *testing.T) { + obj := &InboxThread{} + var fernTestValuePreview *string + obj.SetPreview(fernTestValuePreview) + assert.Equal(t, fernTestValuePreview, obj.Preview) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetIncludedQuantity", func(t *testing.T) { - obj := &InvoiceLine{} - var fernTestValueIncludedQuantity *int64 - obj.SetIncludedQuantity(fernTestValueIncludedQuantity) - assert.Equal(t, fernTestValueIncludedQuantity, obj.IncludedQuantity) + t.Run("SetLastMessageAt", func(t *testing.T) { + obj := &InboxThread{} + var fernTestValueLastMessageAt time.Time + obj.SetLastMessageAt(fernTestValueLastMessageAt) + assert.Equal(t, fernTestValueLastMessageAt, obj.LastMessageAt) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetUnitPrice", func(t *testing.T) { - obj := &InvoiceLine{} - var fernTestValueUnitPrice *string - obj.SetUnitPrice(fernTestValueUnitPrice) - assert.Equal(t, fernTestValueUnitPrice, obj.UnitPrice) + t.Run("SetLastInboundAt", func(t *testing.T) { + obj := &InboxThread{} + var fernTestValueLastInboundAt *time.Time + obj.SetLastInboundAt(fernTestValueLastInboundAt) + assert.Equal(t, fernTestValueLastInboundAt, obj.LastInboundAt) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetAmount", func(t *testing.T) { - obj := &InvoiceLine{} - var fernTestValueAmount int64 - obj.SetAmount(fernTestValueAmount) - assert.Equal(t, fernTestValueAmount, obj.Amount) + t.Run("SetCreatedAt", func(t *testing.T) { + obj := &InboxThread{} + var fernTestValueCreatedAt time.Time + obj.SetCreatedAt(fernTestValueCreatedAt) + assert.Equal(t, fernTestValueCreatedAt, obj.CreatedAt) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetPeriod", func(t *testing.T) { - obj := &InvoiceLine{} - var fernTestValuePeriod *InvoiceLinePeriod - obj.SetPeriod(fernTestValuePeriod) - assert.Equal(t, fernTestValuePeriod, obj.Period) + t.Run("SetMessages", func(t *testing.T) { + obj := &InboxThread{} + var fernTestValueMessages []*InboxMessage + obj.SetMessages(fernTestValueMessages) + assert.Equal(t, fernTestValueMessages, obj.Messages) assert.NotNil(t, obj.explicitFields) }) } -func TestGettersInvoiceLine(t *testing.T) { +func TestGettersInboxThread(t *testing.T) { t.Run("GetObject", func(t *testing.T) { t.Parallel() // Arrange - obj := &InvoiceLine{} - var expected InvoiceLineObject + obj := &InboxThread{} + var expected InboxThreadObject obj.Object = expected // Act & Assert @@ -56837,7 +55598,7 @@ func TestGettersInvoiceLine(t *testing.T) { t.Run("GetObject_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *InvoiceLine + var obj *InboxThread // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -56850,7 +55611,7 @@ func TestGettersInvoiceLine(t *testing.T) { t.Run("GetID", func(t *testing.T) { t.Parallel() // Arrange - obj := &InvoiceLine{} + obj := &InboxThread{} var expected string obj.ID = expected @@ -56860,7 +55621,7 @@ func TestGettersInvoiceLine(t *testing.T) { t.Run("GetID_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *InvoiceLine + var obj *InboxThread // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -56870,281 +55631,271 @@ func TestGettersInvoiceLine(t *testing.T) { _ = obj.GetID() // Should return zero value }) - t.Run("GetKind", func(t *testing.T) { + t.Run("GetInboxID", func(t *testing.T) { t.Parallel() // Arrange - obj := &InvoiceLine{} - var expected InvoiceLineKind - obj.Kind = expected + obj := &InboxThread{} + var expected string + obj.InboxID = expected // Act & Assert - assert.Equal(t, expected, obj.GetKind(), "getter should return the property value") + assert.Equal(t, expected, obj.GetInboxID(), "getter should return the property value") }) - t.Run("GetKind_NilReceiver", func(t *testing.T) { + t.Run("GetInboxID_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *InvoiceLine + var obj *InboxThread // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetKind() // Should return zero value + _ = obj.GetInboxID() // Should return zero value }) - t.Run("GetDescription", func(t *testing.T) { + t.Run("GetSubject", func(t *testing.T) { t.Parallel() // Arrange - obj := &InvoiceLine{} - var expected string - obj.Description = expected + obj := &InboxThread{} + var expected *string + obj.Subject = expected // Act & Assert - assert.Equal(t, expected, obj.GetDescription(), "getter should return the property value") + assert.Equal(t, expected, obj.GetSubject(), "getter should return the property value") }) - t.Run("GetDescription_NilReceiver", func(t *testing.T) { + t.Run("GetSubject_NilValue", func(t *testing.T) { t.Parallel() - var obj *InvoiceLine + // Arrange + obj := &InboxThread{} + obj.Subject = nil + + // Act & Assert + assert.Nil(t, obj.GetSubject(), "getter should return nil when property is nil") + }) + + t.Run("GetSubject_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *InboxThread // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetDescription() // Should return zero value + _ = obj.GetSubject() // Should return zero value }) - t.Run("GetMeter", func(t *testing.T) { + t.Run("GetParticipants", func(t *testing.T) { t.Parallel() // Arrange - obj := &InvoiceLine{} - var expected *InvoiceLineMeter - obj.Meter = expected + obj := &InboxThread{} + var expected []string + obj.Participants = expected // Act & Assert - assert.Equal(t, expected, obj.GetMeter(), "getter should return the property value") + assert.Equal(t, expected, obj.GetParticipants(), "getter should return the property value") }) - t.Run("GetMeter_NilValue", func(t *testing.T) { + t.Run("GetParticipants_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &InvoiceLine{} - obj.Meter = nil + obj := &InboxThread{} + obj.Participants = nil // Act & Assert - assert.Nil(t, obj.GetMeter(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetParticipants(), "getter should return nil when property is nil") }) - t.Run("GetMeter_NilReceiver", func(t *testing.T) { + t.Run("GetParticipants_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *InvoiceLine + var obj *InboxThread // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetMeter() // Should return zero value - }) - - t.Run("GetDimension", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &InvoiceLine{} - var expected *string - obj.Dimension = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetDimension(), "getter should return the property value") + _ = obj.GetParticipants() // Should return zero value }) - t.Run("GetDimension_NilValue", func(t *testing.T) { + t.Run("GetMessageCount", func(t *testing.T) { t.Parallel() // Arrange - obj := &InvoiceLine{} - obj.Dimension = nil + obj := &InboxThread{} + var expected int64 + obj.MessageCount = expected // Act & Assert - assert.Nil(t, obj.GetDimension(), "getter should return nil when property is nil") + assert.Equal(t, expected, obj.GetMessageCount(), "getter should return the property value") }) - t.Run("GetDimension_NilReceiver", func(t *testing.T) { + t.Run("GetMessageCount_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *InvoiceLine + var obj *InboxThread // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetDimension() // Should return zero value + _ = obj.GetMessageCount() // Should return zero value }) - t.Run("GetQuantity", func(t *testing.T) { + t.Run("GetPreview", func(t *testing.T) { t.Parallel() // Arrange - obj := &InvoiceLine{} - var expected *int64 - obj.Quantity = expected + obj := &InboxThread{} + var expected *string + obj.Preview = expected // Act & Assert - assert.Equal(t, expected, obj.GetQuantity(), "getter should return the property value") + assert.Equal(t, expected, obj.GetPreview(), "getter should return the property value") }) - t.Run("GetQuantity_NilValue", func(t *testing.T) { + t.Run("GetPreview_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &InvoiceLine{} - obj.Quantity = nil + obj := &InboxThread{} + obj.Preview = nil // Act & Assert - assert.Nil(t, obj.GetQuantity(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetPreview(), "getter should return nil when property is nil") }) - t.Run("GetQuantity_NilReceiver", func(t *testing.T) { + t.Run("GetPreview_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *InvoiceLine + var obj *InboxThread // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetQuantity() // Should return zero value - }) - - t.Run("GetIncludedQuantity", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &InvoiceLine{} - var expected *int64 - obj.IncludedQuantity = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetIncludedQuantity(), "getter should return the property value") + _ = obj.GetPreview() // Should return zero value }) - t.Run("GetIncludedQuantity_NilValue", func(t *testing.T) { + t.Run("GetLastMessageAt", func(t *testing.T) { t.Parallel() // Arrange - obj := &InvoiceLine{} - obj.IncludedQuantity = nil + obj := &InboxThread{} + var expected time.Time + obj.LastMessageAt = expected // Act & Assert - assert.Nil(t, obj.GetIncludedQuantity(), "getter should return nil when property is nil") + assert.Equal(t, expected, obj.GetLastMessageAt(), "getter should return the property value") }) - t.Run("GetIncludedQuantity_NilReceiver", func(t *testing.T) { + t.Run("GetLastMessageAt_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *InvoiceLine + var obj *InboxThread // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetIncludedQuantity() // Should return zero value + _ = obj.GetLastMessageAt() // Should return zero value }) - t.Run("GetUnitPrice", func(t *testing.T) { + t.Run("GetLastInboundAt", func(t *testing.T) { t.Parallel() // Arrange - obj := &InvoiceLine{} - var expected *string - obj.UnitPrice = expected + obj := &InboxThread{} + var expected *time.Time + obj.LastInboundAt = expected // Act & Assert - assert.Equal(t, expected, obj.GetUnitPrice(), "getter should return the property value") + assert.Equal(t, expected, obj.GetLastInboundAt(), "getter should return the property value") }) - t.Run("GetUnitPrice_NilValue", func(t *testing.T) { + t.Run("GetLastInboundAt_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &InvoiceLine{} - obj.UnitPrice = nil + obj := &InboxThread{} + obj.LastInboundAt = nil // Act & Assert - assert.Nil(t, obj.GetUnitPrice(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetLastInboundAt(), "getter should return nil when property is nil") }) - t.Run("GetUnitPrice_NilReceiver", func(t *testing.T) { + t.Run("GetLastInboundAt_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *InvoiceLine + var obj *InboxThread // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetUnitPrice() // Should return zero value + _ = obj.GetLastInboundAt() // Should return zero value }) - t.Run("GetAmount", func(t *testing.T) { + t.Run("GetCreatedAt", func(t *testing.T) { t.Parallel() // Arrange - obj := &InvoiceLine{} - var expected int64 - obj.Amount = expected + obj := &InboxThread{} + var expected time.Time + obj.CreatedAt = expected // Act & Assert - assert.Equal(t, expected, obj.GetAmount(), "getter should return the property value") + assert.Equal(t, expected, obj.GetCreatedAt(), "getter should return the property value") }) - t.Run("GetAmount_NilReceiver", func(t *testing.T) { + t.Run("GetCreatedAt_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *InvoiceLine + var obj *InboxThread // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetAmount() // Should return zero value + _ = obj.GetCreatedAt() // Should return zero value }) - t.Run("GetPeriod", func(t *testing.T) { + t.Run("GetMessages", func(t *testing.T) { t.Parallel() // Arrange - obj := &InvoiceLine{} - var expected *InvoiceLinePeriod - obj.Period = expected + obj := &InboxThread{} + var expected []*InboxMessage + obj.Messages = expected // Act & Assert - assert.Equal(t, expected, obj.GetPeriod(), "getter should return the property value") + assert.Equal(t, expected, obj.GetMessages(), "getter should return the property value") }) - t.Run("GetPeriod_NilValue", func(t *testing.T) { + t.Run("GetMessages_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &InvoiceLine{} - obj.Period = nil + obj := &InboxThread{} + obj.Messages = nil // Act & Assert - assert.Nil(t, obj.GetPeriod(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetMessages(), "getter should return nil when property is nil") }) - t.Run("GetPeriod_NilReceiver", func(t *testing.T) { + t.Run("GetMessages_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *InvoiceLine + var obj *InboxThread // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetPeriod() // Should return zero value + _ = obj.GetMessages() // Should return zero value }) } -func TestSettersMarkExplicitInvoiceLine(t *testing.T) { +func TestSettersMarkExplicitInboxThread(t *testing.T) { t.Run("SetObject_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &InvoiceLine{} - var fernTestValueObject InvoiceLineObject + obj := &InboxThread{} + var fernTestValueObject InboxThreadObject // Act obj.SetObject(fernTestValueObject) @@ -57174,7 +55925,7 @@ func TestSettersMarkExplicitInvoiceLine(t *testing.T) { t.Run("SetID_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &InvoiceLine{} + obj := &InboxThread{} var fernTestValueID string // Act @@ -57202,76 +55953,14 @@ func TestSettersMarkExplicitInvoiceLine(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetKind_MarksExplicit", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &InvoiceLine{} - var fernTestValueKind InvoiceLineKind - - // Act - obj.SetKind(fernTestValueKind) - - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") - - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } - - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip - }) - - t.Run("SetDescription_MarksExplicit", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &InvoiceLine{} - var fernTestValueDescription string - - // Act - obj.SetDescription(fernTestValueDescription) - - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") - - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } - - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip - }) - - t.Run("SetMeter_MarksExplicit", func(t *testing.T) { + t.Run("SetInboxID_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &InvoiceLine{} - var fernTestValueMeter *InvoiceLineMeter + obj := &InboxThread{} + var fernTestValueInboxID string // Act - obj.SetMeter(fernTestValueMeter) + obj.SetInboxID(fernTestValueInboxID) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -57295,14 +55984,14 @@ func TestSettersMarkExplicitInvoiceLine(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetDimension_MarksExplicit", func(t *testing.T) { + t.Run("SetSubject_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &InvoiceLine{} - var fernTestValueDimension *string + obj := &InboxThread{} + var fernTestValueSubject *string // Act - obj.SetDimension(fernTestValueDimension) + obj.SetSubject(fernTestValueSubject) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -57326,14 +56015,14 @@ func TestSettersMarkExplicitInvoiceLine(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetQuantity_MarksExplicit", func(t *testing.T) { + t.Run("SetParticipants_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &InvoiceLine{} - var fernTestValueQuantity *int64 + obj := &InboxThread{} + var fernTestValueParticipants []string // Act - obj.SetQuantity(fernTestValueQuantity) + obj.SetParticipants(fernTestValueParticipants) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -57357,14 +56046,14 @@ func TestSettersMarkExplicitInvoiceLine(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetIncludedQuantity_MarksExplicit", func(t *testing.T) { + t.Run("SetMessageCount_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &InvoiceLine{} - var fernTestValueIncludedQuantity *int64 + obj := &InboxThread{} + var fernTestValueMessageCount int64 // Act - obj.SetIncludedQuantity(fernTestValueIncludedQuantity) + obj.SetMessageCount(fernTestValueMessageCount) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -57388,14 +56077,14 @@ func TestSettersMarkExplicitInvoiceLine(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetUnitPrice_MarksExplicit", func(t *testing.T) { + t.Run("SetPreview_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &InvoiceLine{} - var fernTestValueUnitPrice *string + obj := &InboxThread{} + var fernTestValuePreview *string // Act - obj.SetUnitPrice(fernTestValueUnitPrice) + obj.SetPreview(fernTestValuePreview) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -57419,14 +56108,14 @@ func TestSettersMarkExplicitInvoiceLine(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetAmount_MarksExplicit", func(t *testing.T) { + t.Run("SetLastMessageAt_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &InvoiceLine{} - var fernTestValueAmount int64 + obj := &InboxThread{} + var fernTestValueLastMessageAt time.Time // Act - obj.SetAmount(fernTestValueAmount) + obj.SetLastMessageAt(fernTestValueLastMessageAt) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -57450,14 +56139,14 @@ func TestSettersMarkExplicitInvoiceLine(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetPeriod_MarksExplicit", func(t *testing.T) { + t.Run("SetLastInboundAt_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &InvoiceLine{} - var fernTestValuePeriod *InvoiceLinePeriod + obj := &InboxThread{} + var fernTestValueLastInboundAt *time.Time // Act - obj.SetPeriod(fernTestValuePeriod) + obj.SetLastInboundAt(fernTestValueLastInboundAt) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -57481,85 +56170,14 @@ func TestSettersMarkExplicitInvoiceLine(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) -} - -func TestSettersInvoiceLinePeriod(t *testing.T) { - t.Run("SetStart", func(t *testing.T) { - obj := &InvoiceLinePeriod{} - var fernTestValueStart time.Time - obj.SetStart(fernTestValueStart) - assert.Equal(t, fernTestValueStart, obj.Start) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetEnd", func(t *testing.T) { - obj := &InvoiceLinePeriod{} - var fernTestValueEnd time.Time - obj.SetEnd(fernTestValueEnd) - assert.Equal(t, fernTestValueEnd, obj.End) - assert.NotNil(t, obj.explicitFields) - }) - -} - -func TestGettersInvoiceLinePeriod(t *testing.T) { - t.Run("GetStart", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &InvoiceLinePeriod{} - var expected time.Time - obj.Start = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetStart(), "getter should return the property value") - }) - - t.Run("GetStart_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *InvoiceLinePeriod - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetStart() // Should return zero value - }) - - t.Run("GetEnd", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &InvoiceLinePeriod{} - var expected time.Time - obj.End = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetEnd(), "getter should return the property value") - }) - - t.Run("GetEnd_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *InvoiceLinePeriod - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetEnd() // Should return zero value - }) - -} - -func TestSettersMarkExplicitInvoiceLinePeriod(t *testing.T) { - t.Run("SetStart_MarksExplicit", func(t *testing.T) { + t.Run("SetCreatedAt_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &InvoiceLinePeriod{} - var fernTestValueStart time.Time + obj := &InboxThread{} + var fernTestValueCreatedAt time.Time // Act - obj.SetStart(fernTestValueStart) + obj.SetCreatedAt(fernTestValueCreatedAt) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -57583,14 +56201,14 @@ func TestSettersMarkExplicitInvoiceLinePeriod(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetEnd_MarksExplicit", func(t *testing.T) { + t.Run("SetMessages_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &InvoiceLinePeriod{} - var fernTestValueEnd time.Time + obj := &InboxThread{} + var fernTestValueMessages []*InboxMessage // Act - obj.SetEnd(fernTestValueEnd) + obj.SetMessages(fernTestValueMessages) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -57616,25 +56234,25 @@ func TestSettersMarkExplicitInvoiceLinePeriod(t *testing.T) { } -func TestSettersInvoiceList(t *testing.T) { +func TestSettersInboxThreadList(t *testing.T) { t.Run("SetObject", func(t *testing.T) { - obj := &InvoiceList{} - var fernTestValueObject InvoiceListObject + obj := &InboxThreadList{} + var fernTestValueObject InboxThreadListObject obj.SetObject(fernTestValueObject) assert.Equal(t, fernTestValueObject, obj.Object) assert.NotNil(t, obj.explicitFields) }) t.Run("SetData", func(t *testing.T) { - obj := &InvoiceList{} - var fernTestValueData []*InvoiceSummary + obj := &InboxThreadList{} + var fernTestValueData []*InboxThreadSummary obj.SetData(fernTestValueData) assert.Equal(t, fernTestValueData, obj.Data) assert.NotNil(t, obj.explicitFields) }) t.Run("SetHasMore", func(t *testing.T) { - obj := &InvoiceList{} + obj := &InboxThreadList{} var fernTestValueHasMore bool obj.SetHasMore(fernTestValueHasMore) assert.Equal(t, fernTestValueHasMore, obj.HasMore) @@ -57643,12 +56261,12 @@ func TestSettersInvoiceList(t *testing.T) { } -func TestGettersInvoiceList(t *testing.T) { +func TestGettersInboxThreadList(t *testing.T) { t.Run("GetObject", func(t *testing.T) { t.Parallel() // Arrange - obj := &InvoiceList{} - var expected InvoiceListObject + obj := &InboxThreadList{} + var expected InboxThreadListObject obj.Object = expected // Act & Assert @@ -57657,7 +56275,7 @@ func TestGettersInvoiceList(t *testing.T) { t.Run("GetObject_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *InvoiceList + var obj *InboxThreadList // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -57670,8 +56288,8 @@ func TestGettersInvoiceList(t *testing.T) { t.Run("GetData", func(t *testing.T) { t.Parallel() // Arrange - obj := &InvoiceList{} - var expected []*InvoiceSummary + obj := &InboxThreadList{} + var expected []*InboxThreadSummary obj.Data = expected // Act & Assert @@ -57681,7 +56299,7 @@ func TestGettersInvoiceList(t *testing.T) { t.Run("GetData_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &InvoiceList{} + obj := &InboxThreadList{} obj.Data = nil // Act & Assert @@ -57690,7 +56308,7 @@ func TestGettersInvoiceList(t *testing.T) { t.Run("GetData_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *InvoiceList + var obj *InboxThreadList // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -57703,7 +56321,7 @@ func TestGettersInvoiceList(t *testing.T) { t.Run("GetHasMore", func(t *testing.T) { t.Parallel() // Arrange - obj := &InvoiceList{} + obj := &InboxThreadList{} var expected bool obj.HasMore = expected @@ -57713,7 +56331,7 @@ func TestGettersInvoiceList(t *testing.T) { t.Run("GetHasMore_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *InvoiceList + var obj *InboxThreadList // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -57725,12 +56343,12 @@ func TestGettersInvoiceList(t *testing.T) { } -func TestSettersMarkExplicitInvoiceList(t *testing.T) { +func TestSettersMarkExplicitInboxThreadList(t *testing.T) { t.Run("SetObject_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &InvoiceList{} - var fernTestValueObject InvoiceListObject + obj := &InboxThreadList{} + var fernTestValueObject InboxThreadListObject // Act obj.SetObject(fernTestValueObject) @@ -57760,8 +56378,8 @@ func TestSettersMarkExplicitInvoiceList(t *testing.T) { t.Run("SetData_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &InvoiceList{} - var fernTestValueData []*InvoiceSummary + obj := &InboxThreadList{} + var fernTestValueData []*InboxThreadSummary // Act obj.SetData(fernTestValueData) @@ -57791,7 +56409,7 @@ func TestSettersMarkExplicitInvoiceList(t *testing.T) { t.Run("SetHasMore_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &InvoiceList{} + obj := &InboxThreadList{} var fernTestValueHasMore bool // Act @@ -57821,198 +56439,734 @@ func TestSettersMarkExplicitInvoiceList(t *testing.T) { } -func TestSettersInvoicePeriod(t *testing.T) { - t.Run("SetStart", func(t *testing.T) { - obj := &InvoicePeriod{} - var fernTestValueStart time.Time - obj.SetStart(fernTestValueStart) - assert.Equal(t, fernTestValueStart, obj.Start) +func TestSettersInboxThreadSummary(t *testing.T) { + t.Run("SetObject", func(t *testing.T) { + obj := &InboxThreadSummary{} + var fernTestValueObject InboxThreadSummaryObject + obj.SetObject(fernTestValueObject) + assert.Equal(t, fernTestValueObject, obj.Object) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetEnd", func(t *testing.T) { - obj := &InvoicePeriod{} - var fernTestValueEnd time.Time - obj.SetEnd(fernTestValueEnd) - assert.Equal(t, fernTestValueEnd, obj.End) + t.Run("SetID", func(t *testing.T) { + obj := &InboxThreadSummary{} + var fernTestValueID string + obj.SetID(fernTestValueID) + assert.Equal(t, fernTestValueID, obj.ID) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetInboxID", func(t *testing.T) { + obj := &InboxThreadSummary{} + var fernTestValueInboxID string + obj.SetInboxID(fernTestValueInboxID) + assert.Equal(t, fernTestValueInboxID, obj.InboxID) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetSubject", func(t *testing.T) { + obj := &InboxThreadSummary{} + var fernTestValueSubject *string + obj.SetSubject(fernTestValueSubject) + assert.Equal(t, fernTestValueSubject, obj.Subject) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetParticipants", func(t *testing.T) { + obj := &InboxThreadSummary{} + var fernTestValueParticipants []string + obj.SetParticipants(fernTestValueParticipants) + assert.Equal(t, fernTestValueParticipants, obj.Participants) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetMessageCount", func(t *testing.T) { + obj := &InboxThreadSummary{} + var fernTestValueMessageCount int64 + obj.SetMessageCount(fernTestValueMessageCount) + assert.Equal(t, fernTestValueMessageCount, obj.MessageCount) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetPreview", func(t *testing.T) { + obj := &InboxThreadSummary{} + var fernTestValuePreview *string + obj.SetPreview(fernTestValuePreview) + assert.Equal(t, fernTestValuePreview, obj.Preview) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetLastMessageAt", func(t *testing.T) { + obj := &InboxThreadSummary{} + var fernTestValueLastMessageAt time.Time + obj.SetLastMessageAt(fernTestValueLastMessageAt) + assert.Equal(t, fernTestValueLastMessageAt, obj.LastMessageAt) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetLastInboundAt", func(t *testing.T) { + obj := &InboxThreadSummary{} + var fernTestValueLastInboundAt *time.Time + obj.SetLastInboundAt(fernTestValueLastInboundAt) + assert.Equal(t, fernTestValueLastInboundAt, obj.LastInboundAt) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetCreatedAt", func(t *testing.T) { + obj := &InboxThreadSummary{} + var fernTestValueCreatedAt time.Time + obj.SetCreatedAt(fernTestValueCreatedAt) + assert.Equal(t, fernTestValueCreatedAt, obj.CreatedAt) assert.NotNil(t, obj.explicitFields) }) } -func TestGettersInvoicePeriod(t *testing.T) { - t.Run("GetStart", func(t *testing.T) { +func TestGettersInboxThreadSummary(t *testing.T) { + t.Run("GetObject", func(t *testing.T) { t.Parallel() // Arrange - obj := &InvoicePeriod{} - var expected time.Time - obj.Start = expected + obj := &InboxThreadSummary{} + var expected InboxThreadSummaryObject + obj.Object = expected // Act & Assert - assert.Equal(t, expected, obj.GetStart(), "getter should return the property value") + assert.Equal(t, expected, obj.GetObject(), "getter should return the property value") }) - t.Run("GetStart_NilReceiver", func(t *testing.T) { + t.Run("GetObject_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *InvoicePeriod + var obj *InboxThreadSummary // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetStart() // Should return zero value + _ = obj.GetObject() // Should return zero value }) - t.Run("GetEnd", func(t *testing.T) { + t.Run("GetID", func(t *testing.T) { t.Parallel() // Arrange - obj := &InvoicePeriod{} - var expected time.Time - obj.End = expected + obj := &InboxThreadSummary{} + var expected string + obj.ID = expected // Act & Assert - assert.Equal(t, expected, obj.GetEnd(), "getter should return the property value") + assert.Equal(t, expected, obj.GetID(), "getter should return the property value") }) - t.Run("GetEnd_NilReceiver", func(t *testing.T) { + t.Run("GetID_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *InvoicePeriod + var obj *InboxThreadSummary // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetEnd() // Should return zero value + _ = obj.GetID() // Should return zero value }) -} - -func TestSettersMarkExplicitInvoicePeriod(t *testing.T) { - t.Run("SetStart_MarksExplicit", func(t *testing.T) { + t.Run("GetInboxID", func(t *testing.T) { t.Parallel() // Arrange - obj := &InvoicePeriod{} - var fernTestValueStart time.Time + obj := &InboxThreadSummary{} + var expected string + obj.InboxID = expected - // Act - obj.SetStart(fernTestValueStart) + // Act & Assert + assert.Equal(t, expected, obj.GetInboxID(), "getter should return the property value") + }) - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") + t.Run("GetInboxID_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *InboxThreadSummary + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetInboxID() // Should return zero value + }) - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } + t.Run("GetSubject", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &InboxThreadSummary{} + var expected *string + obj.Subject = expected - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip + // Act & Assert + assert.Equal(t, expected, obj.GetSubject(), "getter should return the property value") }) - t.Run("SetEnd_MarksExplicit", func(t *testing.T) { + t.Run("GetSubject_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &InvoicePeriod{} - var fernTestValueEnd time.Time + obj := &InboxThreadSummary{} + obj.Subject = nil - // Act - obj.SetEnd(fernTestValueEnd) + // Act & Assert + assert.Nil(t, obj.GetSubject(), "getter should return nil when property is nil") + }) - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") + t.Run("GetSubject_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *InboxThreadSummary + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetSubject() // Should return zero value + }) - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } + t.Run("GetParticipants", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &InboxThreadSummary{} + var expected []string + obj.Participants = expected - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip + // Act & Assert + assert.Equal(t, expected, obj.GetParticipants(), "getter should return the property value") }) -} + t.Run("GetParticipants_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &InboxThreadSummary{} + obj.Participants = nil -func TestSettersInvoiceSummary(t *testing.T) { - t.Run("SetObject", func(t *testing.T) { - obj := &InvoiceSummary{} - var fernTestValueObject InvoiceSummaryObject - obj.SetObject(fernTestValueObject) - assert.Equal(t, fernTestValueObject, obj.Object) - assert.NotNil(t, obj.explicitFields) + // Act & Assert + assert.Nil(t, obj.GetParticipants(), "getter should return nil when property is nil") }) - t.Run("SetID", func(t *testing.T) { - obj := &InvoiceSummary{} - var fernTestValueID string - obj.SetID(fernTestValueID) - assert.Equal(t, fernTestValueID, obj.ID) - assert.NotNil(t, obj.explicitFields) + t.Run("GetParticipants_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *InboxThreadSummary + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetParticipants() // Should return zero value }) - t.Run("SetNumber", func(t *testing.T) { - obj := &InvoiceSummary{} - var fernTestValueNumber *string - obj.SetNumber(fernTestValueNumber) - assert.Equal(t, fernTestValueNumber, obj.Number) - assert.NotNil(t, obj.explicitFields) + t.Run("GetMessageCount", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &InboxThreadSummary{} + var expected int64 + obj.MessageCount = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetMessageCount(), "getter should return the property value") }) - t.Run("SetKind", func(t *testing.T) { - obj := &InvoiceSummary{} - var fernTestValueKind InvoiceSummaryKind - obj.SetKind(fernTestValueKind) - assert.Equal(t, fernTestValueKind, obj.Kind) - assert.NotNil(t, obj.explicitFields) + t.Run("GetMessageCount_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *InboxThreadSummary + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetMessageCount() // Should return zero value }) - t.Run("SetStatus", func(t *testing.T) { - obj := &InvoiceSummary{} - var fernTestValueStatus InvoiceSummaryStatus - obj.SetStatus(fernTestValueStatus) - assert.Equal(t, fernTestValueStatus, obj.Status) - assert.NotNil(t, obj.explicitFields) + t.Run("GetPreview", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &InboxThreadSummary{} + var expected *string + obj.Preview = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetPreview(), "getter should return the property value") + }) + + t.Run("GetPreview_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &InboxThreadSummary{} + obj.Preview = nil + + // Act & Assert + assert.Nil(t, obj.GetPreview(), "getter should return nil when property is nil") + }) + + t.Run("GetPreview_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *InboxThreadSummary + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetPreview() // Should return zero value + }) + + t.Run("GetLastMessageAt", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &InboxThreadSummary{} + var expected time.Time + obj.LastMessageAt = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetLastMessageAt(), "getter should return the property value") + }) + + t.Run("GetLastMessageAt_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *InboxThreadSummary + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetLastMessageAt() // Should return zero value + }) + + t.Run("GetLastInboundAt", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &InboxThreadSummary{} + var expected *time.Time + obj.LastInboundAt = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetLastInboundAt(), "getter should return the property value") + }) + + t.Run("GetLastInboundAt_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &InboxThreadSummary{} + obj.LastInboundAt = nil + + // Act & Assert + assert.Nil(t, obj.GetLastInboundAt(), "getter should return nil when property is nil") + }) + + t.Run("GetLastInboundAt_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *InboxThreadSummary + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetLastInboundAt() // Should return zero value + }) + + t.Run("GetCreatedAt", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &InboxThreadSummary{} + var expected time.Time + obj.CreatedAt = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetCreatedAt(), "getter should return the property value") + }) + + t.Run("GetCreatedAt_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *InboxThreadSummary + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetCreatedAt() // Should return zero value + }) + +} + +func TestSettersMarkExplicitInboxThreadSummary(t *testing.T) { + t.Run("SetObject_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &InboxThreadSummary{} + var fernTestValueObject InboxThreadSummaryObject + + // Act + obj.SetObject(fernTestValueObject) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetID_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &InboxThreadSummary{} + var fernTestValueID string + + // Act + obj.SetID(fernTestValueID) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetInboxID_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &InboxThreadSummary{} + var fernTestValueInboxID string + + // Act + obj.SetInboxID(fernTestValueInboxID) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetSubject_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &InboxThreadSummary{} + var fernTestValueSubject *string + + // Act + obj.SetSubject(fernTestValueSubject) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetParticipants_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &InboxThreadSummary{} + var fernTestValueParticipants []string + + // Act + obj.SetParticipants(fernTestValueParticipants) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetMessageCount_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &InboxThreadSummary{} + var fernTestValueMessageCount int64 + + // Act + obj.SetMessageCount(fernTestValueMessageCount) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetPreview_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &InboxThreadSummary{} + var fernTestValuePreview *string + + // Act + obj.SetPreview(fernTestValuePreview) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetLastMessageAt_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &InboxThreadSummary{} + var fernTestValueLastMessageAt time.Time + + // Act + obj.SetLastMessageAt(fernTestValueLastMessageAt) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetLastInboundAt_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &InboxThreadSummary{} + var fernTestValueLastInboundAt *time.Time + + // Act + obj.SetLastInboundAt(fernTestValueLastInboundAt) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetCreatedAt_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &InboxThreadSummary{} + var fernTestValueCreatedAt time.Time + + // Act + obj.SetCreatedAt(fernTestValueCreatedAt) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + +} + +func TestSettersInvoice(t *testing.T) { + t.Run("SetObject", func(t *testing.T) { + obj := &Invoice{} + var fernTestValueObject InvoiceObject + obj.SetObject(fernTestValueObject) + assert.Equal(t, fernTestValueObject, obj.Object) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetID", func(t *testing.T) { + obj := &Invoice{} + var fernTestValueID string + obj.SetID(fernTestValueID) + assert.Equal(t, fernTestValueID, obj.ID) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetNumber", func(t *testing.T) { + obj := &Invoice{} + var fernTestValueNumber *string + obj.SetNumber(fernTestValueNumber) + assert.Equal(t, fernTestValueNumber, obj.Number) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetKind", func(t *testing.T) { + obj := &Invoice{} + var fernTestValueKind InvoiceKind + obj.SetKind(fernTestValueKind) + assert.Equal(t, fernTestValueKind, obj.Kind) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetStatus", func(t *testing.T) { + obj := &Invoice{} + var fernTestValueStatus InvoiceStatus + obj.SetStatus(fernTestValueStatus) + assert.Equal(t, fernTestValueStatus, obj.Status) + assert.NotNil(t, obj.explicitFields) }) t.Run("SetCurrency", func(t *testing.T) { - obj := &InvoiceSummary{} - var fernTestValueCurrency InvoiceSummaryCurrency + obj := &Invoice{} + var fernTestValueCurrency InvoiceCurrency obj.SetCurrency(fernTestValueCurrency) assert.Equal(t, fernTestValueCurrency, obj.Currency) assert.NotNil(t, obj.explicitFields) }) t.Run("SetPeriod", func(t *testing.T) { - obj := &InvoiceSummary{} - var fernTestValuePeriod *InvoiceSummaryPeriod + obj := &Invoice{} + var fernTestValuePeriod *InvoicePeriod obj.SetPeriod(fernTestValuePeriod) assert.Equal(t, fernTestValuePeriod, obj.Period) assert.NotNil(t, obj.explicitFields) }) t.Run("SetSubtotal", func(t *testing.T) { - obj := &InvoiceSummary{} + obj := &Invoice{} var fernTestValueSubtotal int64 obj.SetSubtotal(fernTestValueSubtotal) assert.Equal(t, fernTestValueSubtotal, obj.Subtotal) @@ -58020,7 +57174,7 @@ func TestSettersInvoiceSummary(t *testing.T) { }) t.Run("SetDiscount", func(t *testing.T) { - obj := &InvoiceSummary{} + obj := &Invoice{} var fernTestValueDiscount int64 obj.SetDiscount(fernTestValueDiscount) assert.Equal(t, fernTestValueDiscount, obj.Discount) @@ -58028,7 +57182,7 @@ func TestSettersInvoiceSummary(t *testing.T) { }) t.Run("SetCredit", func(t *testing.T) { - obj := &InvoiceSummary{} + obj := &Invoice{} var fernTestValueCredit int64 obj.SetCredit(fernTestValueCredit) assert.Equal(t, fernTestValueCredit, obj.Credit) @@ -58036,7 +57190,7 @@ func TestSettersInvoiceSummary(t *testing.T) { }) t.Run("SetTax", func(t *testing.T) { - obj := &InvoiceSummary{} + obj := &Invoice{} var fernTestValueTax int64 obj.SetTax(fernTestValueTax) assert.Equal(t, fernTestValueTax, obj.Tax) @@ -58044,7 +57198,7 @@ func TestSettersInvoiceSummary(t *testing.T) { }) t.Run("SetTotal", func(t *testing.T) { - obj := &InvoiceSummary{} + obj := &Invoice{} var fernTestValueTotal int64 obj.SetTotal(fernTestValueTotal) assert.Equal(t, fernTestValueTotal, obj.Total) @@ -58052,7 +57206,7 @@ func TestSettersInvoiceSummary(t *testing.T) { }) t.Run("SetAmountPaid", func(t *testing.T) { - obj := &InvoiceSummary{} + obj := &Invoice{} var fernTestValueAmountPaid int64 obj.SetAmountPaid(fernTestValueAmountPaid) assert.Equal(t, fernTestValueAmountPaid, obj.AmountPaid) @@ -58060,7 +57214,7 @@ func TestSettersInvoiceSummary(t *testing.T) { }) t.Run("SetAmountDue", func(t *testing.T) { - obj := &InvoiceSummary{} + obj := &Invoice{} var fernTestValueAmountDue int64 obj.SetAmountDue(fernTestValueAmountDue) assert.Equal(t, fernTestValueAmountDue, obj.AmountDue) @@ -58068,15 +57222,15 @@ func TestSettersInvoiceSummary(t *testing.T) { }) t.Run("SetCollectionMethod", func(t *testing.T) { - obj := &InvoiceSummary{} - var fernTestValueCollectionMethod InvoiceSummaryCollectionMethod + obj := &Invoice{} + var fernTestValueCollectionMethod InvoiceCollectionMethod obj.SetCollectionMethod(fernTestValueCollectionMethod) assert.Equal(t, fernTestValueCollectionMethod, obj.CollectionMethod) assert.NotNil(t, obj.explicitFields) }) t.Run("SetDueAt", func(t *testing.T) { - obj := &InvoiceSummary{} + obj := &Invoice{} var fernTestValueDueAt *time.Time obj.SetDueAt(fernTestValueDueAt) assert.Equal(t, fernTestValueDueAt, obj.DueAt) @@ -58084,7 +57238,7 @@ func TestSettersInvoiceSummary(t *testing.T) { }) t.Run("SetFinalizedAt", func(t *testing.T) { - obj := &InvoiceSummary{} + obj := &Invoice{} var fernTestValueFinalizedAt *time.Time obj.SetFinalizedAt(fernTestValueFinalizedAt) assert.Equal(t, fernTestValueFinalizedAt, obj.FinalizedAt) @@ -58092,7 +57246,7 @@ func TestSettersInvoiceSummary(t *testing.T) { }) t.Run("SetPaidAt", func(t *testing.T) { - obj := &InvoiceSummary{} + obj := &Invoice{} var fernTestValuePaidAt *time.Time obj.SetPaidAt(fernTestValuePaidAt) assert.Equal(t, fernTestValuePaidAt, obj.PaidAt) @@ -58100,7 +57254,7 @@ func TestSettersInvoiceSummary(t *testing.T) { }) t.Run("SetVoidedAt", func(t *testing.T) { - obj := &InvoiceSummary{} + obj := &Invoice{} var fernTestValueVoidedAt *time.Time obj.SetVoidedAt(fernTestValueVoidedAt) assert.Equal(t, fernTestValueVoidedAt, obj.VoidedAt) @@ -58108,7 +57262,7 @@ func TestSettersInvoiceSummary(t *testing.T) { }) t.Run("SetHostedURL", func(t *testing.T) { - obj := &InvoiceSummary{} + obj := &Invoice{} var fernTestValueHostedURL *string obj.SetHostedURL(fernTestValueHostedURL) assert.Equal(t, fernTestValueHostedURL, obj.HostedURL) @@ -58116,21 +57270,29 @@ func TestSettersInvoiceSummary(t *testing.T) { }) t.Run("SetPdfURL", func(t *testing.T) { - obj := &InvoiceSummary{} + obj := &Invoice{} var fernTestValuePdfURL *string obj.SetPdfURL(fernTestValuePdfURL) assert.Equal(t, fernTestValuePdfURL, obj.PdfURL) assert.NotNil(t, obj.explicitFields) }) + t.Run("SetLines", func(t *testing.T) { + obj := &Invoice{} + var fernTestValueLines []*InvoiceLine + obj.SetLines(fernTestValueLines) + assert.Equal(t, fernTestValueLines, obj.Lines) + assert.NotNil(t, obj.explicitFields) + }) + } -func TestGettersInvoiceSummary(t *testing.T) { +func TestGettersInvoice(t *testing.T) { t.Run("GetObject", func(t *testing.T) { t.Parallel() // Arrange - obj := &InvoiceSummary{} - var expected InvoiceSummaryObject + obj := &Invoice{} + var expected InvoiceObject obj.Object = expected // Act & Assert @@ -58139,7 +57301,7 @@ func TestGettersInvoiceSummary(t *testing.T) { t.Run("GetObject_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *InvoiceSummary + var obj *Invoice // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -58152,7 +57314,7 @@ func TestGettersInvoiceSummary(t *testing.T) { t.Run("GetID", func(t *testing.T) { t.Parallel() // Arrange - obj := &InvoiceSummary{} + obj := &Invoice{} var expected string obj.ID = expected @@ -58162,7 +57324,7 @@ func TestGettersInvoiceSummary(t *testing.T) { t.Run("GetID_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *InvoiceSummary + var obj *Invoice // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -58175,7 +57337,7 @@ func TestGettersInvoiceSummary(t *testing.T) { t.Run("GetNumber", func(t *testing.T) { t.Parallel() // Arrange - obj := &InvoiceSummary{} + obj := &Invoice{} var expected *string obj.Number = expected @@ -58186,7 +57348,7 @@ func TestGettersInvoiceSummary(t *testing.T) { t.Run("GetNumber_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &InvoiceSummary{} + obj := &Invoice{} obj.Number = nil // Act & Assert @@ -58195,7 +57357,7 @@ func TestGettersInvoiceSummary(t *testing.T) { t.Run("GetNumber_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *InvoiceSummary + var obj *Invoice // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -58208,8 +57370,8 @@ func TestGettersInvoiceSummary(t *testing.T) { t.Run("GetKind", func(t *testing.T) { t.Parallel() // Arrange - obj := &InvoiceSummary{} - var expected InvoiceSummaryKind + obj := &Invoice{} + var expected InvoiceKind obj.Kind = expected // Act & Assert @@ -58218,7 +57380,7 @@ func TestGettersInvoiceSummary(t *testing.T) { t.Run("GetKind_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *InvoiceSummary + var obj *Invoice // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -58231,8 +57393,8 @@ func TestGettersInvoiceSummary(t *testing.T) { t.Run("GetStatus", func(t *testing.T) { t.Parallel() // Arrange - obj := &InvoiceSummary{} - var expected InvoiceSummaryStatus + obj := &Invoice{} + var expected InvoiceStatus obj.Status = expected // Act & Assert @@ -58241,7 +57403,7 @@ func TestGettersInvoiceSummary(t *testing.T) { t.Run("GetStatus_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *InvoiceSummary + var obj *Invoice // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -58254,8 +57416,8 @@ func TestGettersInvoiceSummary(t *testing.T) { t.Run("GetCurrency", func(t *testing.T) { t.Parallel() // Arrange - obj := &InvoiceSummary{} - var expected InvoiceSummaryCurrency + obj := &Invoice{} + var expected InvoiceCurrency obj.Currency = expected // Act & Assert @@ -58264,7 +57426,7 @@ func TestGettersInvoiceSummary(t *testing.T) { t.Run("GetCurrency_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *InvoiceSummary + var obj *Invoice // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -58277,8 +57439,8 @@ func TestGettersInvoiceSummary(t *testing.T) { t.Run("GetPeriod", func(t *testing.T) { t.Parallel() // Arrange - obj := &InvoiceSummary{} - var expected *InvoiceSummaryPeriod + obj := &Invoice{} + var expected *InvoicePeriod obj.Period = expected // Act & Assert @@ -58288,7 +57450,7 @@ func TestGettersInvoiceSummary(t *testing.T) { t.Run("GetPeriod_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &InvoiceSummary{} + obj := &Invoice{} obj.Period = nil // Act & Assert @@ -58297,7 +57459,7 @@ func TestGettersInvoiceSummary(t *testing.T) { t.Run("GetPeriod_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *InvoiceSummary + var obj *Invoice // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -58310,7 +57472,7 @@ func TestGettersInvoiceSummary(t *testing.T) { t.Run("GetSubtotal", func(t *testing.T) { t.Parallel() // Arrange - obj := &InvoiceSummary{} + obj := &Invoice{} var expected int64 obj.Subtotal = expected @@ -58320,7 +57482,7 @@ func TestGettersInvoiceSummary(t *testing.T) { t.Run("GetSubtotal_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *InvoiceSummary + var obj *Invoice // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -58333,7 +57495,7 @@ func TestGettersInvoiceSummary(t *testing.T) { t.Run("GetDiscount", func(t *testing.T) { t.Parallel() // Arrange - obj := &InvoiceSummary{} + obj := &Invoice{} var expected int64 obj.Discount = expected @@ -58343,7 +57505,7 @@ func TestGettersInvoiceSummary(t *testing.T) { t.Run("GetDiscount_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *InvoiceSummary + var obj *Invoice // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -58356,7 +57518,7 @@ func TestGettersInvoiceSummary(t *testing.T) { t.Run("GetCredit", func(t *testing.T) { t.Parallel() // Arrange - obj := &InvoiceSummary{} + obj := &Invoice{} var expected int64 obj.Credit = expected @@ -58366,7 +57528,7 @@ func TestGettersInvoiceSummary(t *testing.T) { t.Run("GetCredit_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *InvoiceSummary + var obj *Invoice // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -58379,7 +57541,7 @@ func TestGettersInvoiceSummary(t *testing.T) { t.Run("GetTax", func(t *testing.T) { t.Parallel() // Arrange - obj := &InvoiceSummary{} + obj := &Invoice{} var expected int64 obj.Tax = expected @@ -58389,7 +57551,7 @@ func TestGettersInvoiceSummary(t *testing.T) { t.Run("GetTax_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *InvoiceSummary + var obj *Invoice // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -58402,7 +57564,7 @@ func TestGettersInvoiceSummary(t *testing.T) { t.Run("GetTotal", func(t *testing.T) { t.Parallel() // Arrange - obj := &InvoiceSummary{} + obj := &Invoice{} var expected int64 obj.Total = expected @@ -58412,7 +57574,7 @@ func TestGettersInvoiceSummary(t *testing.T) { t.Run("GetTotal_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *InvoiceSummary + var obj *Invoice // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -58425,7 +57587,7 @@ func TestGettersInvoiceSummary(t *testing.T) { t.Run("GetAmountPaid", func(t *testing.T) { t.Parallel() // Arrange - obj := &InvoiceSummary{} + obj := &Invoice{} var expected int64 obj.AmountPaid = expected @@ -58435,7 +57597,7 @@ func TestGettersInvoiceSummary(t *testing.T) { t.Run("GetAmountPaid_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *InvoiceSummary + var obj *Invoice // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -58448,7 +57610,7 @@ func TestGettersInvoiceSummary(t *testing.T) { t.Run("GetAmountDue", func(t *testing.T) { t.Parallel() // Arrange - obj := &InvoiceSummary{} + obj := &Invoice{} var expected int64 obj.AmountDue = expected @@ -58458,7 +57620,7 @@ func TestGettersInvoiceSummary(t *testing.T) { t.Run("GetAmountDue_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *InvoiceSummary + var obj *Invoice // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -58471,8 +57633,8 @@ func TestGettersInvoiceSummary(t *testing.T) { t.Run("GetCollectionMethod", func(t *testing.T) { t.Parallel() // Arrange - obj := &InvoiceSummary{} - var expected InvoiceSummaryCollectionMethod + obj := &Invoice{} + var expected InvoiceCollectionMethod obj.CollectionMethod = expected // Act & Assert @@ -58481,7 +57643,7 @@ func TestGettersInvoiceSummary(t *testing.T) { t.Run("GetCollectionMethod_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *InvoiceSummary + var obj *Invoice // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -58494,7 +57656,7 @@ func TestGettersInvoiceSummary(t *testing.T) { t.Run("GetDueAt", func(t *testing.T) { t.Parallel() // Arrange - obj := &InvoiceSummary{} + obj := &Invoice{} var expected *time.Time obj.DueAt = expected @@ -58505,7 +57667,7 @@ func TestGettersInvoiceSummary(t *testing.T) { t.Run("GetDueAt_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &InvoiceSummary{} + obj := &Invoice{} obj.DueAt = nil // Act & Assert @@ -58514,7 +57676,7 @@ func TestGettersInvoiceSummary(t *testing.T) { t.Run("GetDueAt_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *InvoiceSummary + var obj *Invoice // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -58527,7 +57689,7 @@ func TestGettersInvoiceSummary(t *testing.T) { t.Run("GetFinalizedAt", func(t *testing.T) { t.Parallel() // Arrange - obj := &InvoiceSummary{} + obj := &Invoice{} var expected *time.Time obj.FinalizedAt = expected @@ -58538,7 +57700,7 @@ func TestGettersInvoiceSummary(t *testing.T) { t.Run("GetFinalizedAt_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &InvoiceSummary{} + obj := &Invoice{} obj.FinalizedAt = nil // Act & Assert @@ -58547,7 +57709,7 @@ func TestGettersInvoiceSummary(t *testing.T) { t.Run("GetFinalizedAt_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *InvoiceSummary + var obj *Invoice // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -58560,7 +57722,7 @@ func TestGettersInvoiceSummary(t *testing.T) { t.Run("GetPaidAt", func(t *testing.T) { t.Parallel() // Arrange - obj := &InvoiceSummary{} + obj := &Invoice{} var expected *time.Time obj.PaidAt = expected @@ -58571,7 +57733,7 @@ func TestGettersInvoiceSummary(t *testing.T) { t.Run("GetPaidAt_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &InvoiceSummary{} + obj := &Invoice{} obj.PaidAt = nil // Act & Assert @@ -58580,7 +57742,7 @@ func TestGettersInvoiceSummary(t *testing.T) { t.Run("GetPaidAt_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *InvoiceSummary + var obj *Invoice // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -58593,7 +57755,7 @@ func TestGettersInvoiceSummary(t *testing.T) { t.Run("GetVoidedAt", func(t *testing.T) { t.Parallel() // Arrange - obj := &InvoiceSummary{} + obj := &Invoice{} var expected *time.Time obj.VoidedAt = expected @@ -58604,7 +57766,7 @@ func TestGettersInvoiceSummary(t *testing.T) { t.Run("GetVoidedAt_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &InvoiceSummary{} + obj := &Invoice{} obj.VoidedAt = nil // Act & Assert @@ -58613,7 +57775,7 @@ func TestGettersInvoiceSummary(t *testing.T) { t.Run("GetVoidedAt_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *InvoiceSummary + var obj *Invoice // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -58626,7 +57788,7 @@ func TestGettersInvoiceSummary(t *testing.T) { t.Run("GetHostedURL", func(t *testing.T) { t.Parallel() // Arrange - obj := &InvoiceSummary{} + obj := &Invoice{} var expected *string obj.HostedURL = expected @@ -58637,7 +57799,7 @@ func TestGettersInvoiceSummary(t *testing.T) { t.Run("GetHostedURL_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &InvoiceSummary{} + obj := &Invoice{} obj.HostedURL = nil // Act & Assert @@ -58646,7 +57808,7 @@ func TestGettersInvoiceSummary(t *testing.T) { t.Run("GetHostedURL_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *InvoiceSummary + var obj *Invoice // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -58659,7 +57821,7 @@ func TestGettersInvoiceSummary(t *testing.T) { t.Run("GetPdfURL", func(t *testing.T) { t.Parallel() // Arrange - obj := &InvoiceSummary{} + obj := &Invoice{} var expected *string obj.PdfURL = expected @@ -58670,7 +57832,7 @@ func TestGettersInvoiceSummary(t *testing.T) { t.Run("GetPdfURL_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &InvoiceSummary{} + obj := &Invoice{} obj.PdfURL = nil // Act & Assert @@ -58679,7 +57841,7 @@ func TestGettersInvoiceSummary(t *testing.T) { t.Run("GetPdfURL_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *InvoiceSummary + var obj *Invoice // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -58689,14 +57851,47 @@ func TestGettersInvoiceSummary(t *testing.T) { _ = obj.GetPdfURL() // Should return zero value }) + t.Run("GetLines", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &Invoice{} + var expected []*InvoiceLine + obj.Lines = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetLines(), "getter should return the property value") + }) + + t.Run("GetLines_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &Invoice{} + obj.Lines = nil + + // Act & Assert + assert.Nil(t, obj.GetLines(), "getter should return nil when property is nil") + }) + + t.Run("GetLines_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *Invoice + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetLines() // Should return zero value + }) + } -func TestSettersMarkExplicitInvoiceSummary(t *testing.T) { +func TestSettersMarkExplicitInvoice(t *testing.T) { t.Run("SetObject_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &InvoiceSummary{} - var fernTestValueObject InvoiceSummaryObject + obj := &Invoice{} + var fernTestValueObject InvoiceObject // Act obj.SetObject(fernTestValueObject) @@ -58726,7 +57921,7 @@ func TestSettersMarkExplicitInvoiceSummary(t *testing.T) { t.Run("SetID_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &InvoiceSummary{} + obj := &Invoice{} var fernTestValueID string // Act @@ -58757,7 +57952,7 @@ func TestSettersMarkExplicitInvoiceSummary(t *testing.T) { t.Run("SetNumber_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &InvoiceSummary{} + obj := &Invoice{} var fernTestValueNumber *string // Act @@ -58788,8 +57983,8 @@ func TestSettersMarkExplicitInvoiceSummary(t *testing.T) { t.Run("SetKind_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &InvoiceSummary{} - var fernTestValueKind InvoiceSummaryKind + obj := &Invoice{} + var fernTestValueKind InvoiceKind // Act obj.SetKind(fernTestValueKind) @@ -58819,8 +58014,8 @@ func TestSettersMarkExplicitInvoiceSummary(t *testing.T) { t.Run("SetStatus_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &InvoiceSummary{} - var fernTestValueStatus InvoiceSummaryStatus + obj := &Invoice{} + var fernTestValueStatus InvoiceStatus // Act obj.SetStatus(fernTestValueStatus) @@ -58850,8 +58045,8 @@ func TestSettersMarkExplicitInvoiceSummary(t *testing.T) { t.Run("SetCurrency_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &InvoiceSummary{} - var fernTestValueCurrency InvoiceSummaryCurrency + obj := &Invoice{} + var fernTestValueCurrency InvoiceCurrency // Act obj.SetCurrency(fernTestValueCurrency) @@ -58881,8 +58076,8 @@ func TestSettersMarkExplicitInvoiceSummary(t *testing.T) { t.Run("SetPeriod_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &InvoiceSummary{} - var fernTestValuePeriod *InvoiceSummaryPeriod + obj := &Invoice{} + var fernTestValuePeriod *InvoicePeriod // Act obj.SetPeriod(fernTestValuePeriod) @@ -58912,7 +58107,7 @@ func TestSettersMarkExplicitInvoiceSummary(t *testing.T) { t.Run("SetSubtotal_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &InvoiceSummary{} + obj := &Invoice{} var fernTestValueSubtotal int64 // Act @@ -58943,7 +58138,7 @@ func TestSettersMarkExplicitInvoiceSummary(t *testing.T) { t.Run("SetDiscount_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &InvoiceSummary{} + obj := &Invoice{} var fernTestValueDiscount int64 // Act @@ -58974,7 +58169,7 @@ func TestSettersMarkExplicitInvoiceSummary(t *testing.T) { t.Run("SetCredit_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &InvoiceSummary{} + obj := &Invoice{} var fernTestValueCredit int64 // Act @@ -59005,7 +58200,7 @@ func TestSettersMarkExplicitInvoiceSummary(t *testing.T) { t.Run("SetTax_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &InvoiceSummary{} + obj := &Invoice{} var fernTestValueTax int64 // Act @@ -59036,7 +58231,7 @@ func TestSettersMarkExplicitInvoiceSummary(t *testing.T) { t.Run("SetTotal_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &InvoiceSummary{} + obj := &Invoice{} var fernTestValueTotal int64 // Act @@ -59067,7 +58262,7 @@ func TestSettersMarkExplicitInvoiceSummary(t *testing.T) { t.Run("SetAmountPaid_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &InvoiceSummary{} + obj := &Invoice{} var fernTestValueAmountPaid int64 // Act @@ -59098,7 +58293,7 @@ func TestSettersMarkExplicitInvoiceSummary(t *testing.T) { t.Run("SetAmountDue_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &InvoiceSummary{} + obj := &Invoice{} var fernTestValueAmountDue int64 // Act @@ -59129,8 +58324,8 @@ func TestSettersMarkExplicitInvoiceSummary(t *testing.T) { t.Run("SetCollectionMethod_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &InvoiceSummary{} - var fernTestValueCollectionMethod InvoiceSummaryCollectionMethod + obj := &Invoice{} + var fernTestValueCollectionMethod InvoiceCollectionMethod // Act obj.SetCollectionMethod(fernTestValueCollectionMethod) @@ -59160,7 +58355,7 @@ func TestSettersMarkExplicitInvoiceSummary(t *testing.T) { t.Run("SetDueAt_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &InvoiceSummary{} + obj := &Invoice{} var fernTestValueDueAt *time.Time // Act @@ -59191,7 +58386,7 @@ func TestSettersMarkExplicitInvoiceSummary(t *testing.T) { t.Run("SetFinalizedAt_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &InvoiceSummary{} + obj := &Invoice{} var fernTestValueFinalizedAt *time.Time // Act @@ -59222,7 +58417,7 @@ func TestSettersMarkExplicitInvoiceSummary(t *testing.T) { t.Run("SetPaidAt_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &InvoiceSummary{} + obj := &Invoice{} var fernTestValuePaidAt *time.Time // Act @@ -59253,7 +58448,7 @@ func TestSettersMarkExplicitInvoiceSummary(t *testing.T) { t.Run("SetVoidedAt_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &InvoiceSummary{} + obj := &Invoice{} var fernTestValueVoidedAt *time.Time // Act @@ -59284,7 +58479,7 @@ func TestSettersMarkExplicitInvoiceSummary(t *testing.T) { t.Run("SetHostedURL_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &InvoiceSummary{} + obj := &Invoice{} var fernTestValueHostedURL *string // Act @@ -59315,7 +58510,7 @@ func TestSettersMarkExplicitInvoiceSummary(t *testing.T) { t.Run("SetPdfURL_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &InvoiceSummary{} + obj := &Invoice{} var fernTestValuePdfURL *string // Act @@ -59343,116 +58538,14 @@ func TestSettersMarkExplicitInvoiceSummary(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) -} - -func TestSettersInvoiceSummaryPeriod(t *testing.T) { - t.Run("SetStart", func(t *testing.T) { - obj := &InvoiceSummaryPeriod{} - var fernTestValueStart time.Time - obj.SetStart(fernTestValueStart) - assert.Equal(t, fernTestValueStart, obj.Start) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetEnd", func(t *testing.T) { - obj := &InvoiceSummaryPeriod{} - var fernTestValueEnd time.Time - obj.SetEnd(fernTestValueEnd) - assert.Equal(t, fernTestValueEnd, obj.End) - assert.NotNil(t, obj.explicitFields) - }) - -} - -func TestGettersInvoiceSummaryPeriod(t *testing.T) { - t.Run("GetStart", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &InvoiceSummaryPeriod{} - var expected time.Time - obj.Start = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetStart(), "getter should return the property value") - }) - - t.Run("GetStart_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *InvoiceSummaryPeriod - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetStart() // Should return zero value - }) - - t.Run("GetEnd", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &InvoiceSummaryPeriod{} - var expected time.Time - obj.End = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetEnd(), "getter should return the property value") - }) - - t.Run("GetEnd_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *InvoiceSummaryPeriod - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetEnd() // Should return zero value - }) - -} - -func TestSettersMarkExplicitInvoiceSummaryPeriod(t *testing.T) { - t.Run("SetStart_MarksExplicit", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &InvoiceSummaryPeriod{} - var fernTestValueStart time.Time - - // Act - obj.SetStart(fernTestValueStart) - - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") - - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } - - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip - }) - - t.Run("SetEnd_MarksExplicit", func(t *testing.T) { + t.Run("SetLines_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &InvoiceSummaryPeriod{} - var fernTestValueEnd time.Time + obj := &Invoice{} + var fernTestValueLines []*InvoiceLine // Act - obj.SetEnd(fernTestValueEnd) + obj.SetLines(fernTestValueLines) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -59478,143 +58571,103 @@ func TestSettersMarkExplicitInvoiceSummaryPeriod(t *testing.T) { } -func TestGettersListSuppressionsRequestScope(t *testing.T) { - t.Run("GetListSuppressionsRequestScopeZero", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &ListSuppressionsRequestScope{} - var expected ListSuppressionsRequestScopeZero - obj.ListSuppressionsRequestScopeZero = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetListSuppressionsRequestScopeZero(), "getter should return the property value") - }) - - t.Run("GetListSuppressionsRequestScopeZero_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *ListSuppressionsRequestScope - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetListSuppressionsRequestScopeZero() // Should return zero value - }) - - t.Run("GetListSuppressionsRequestScopeOne", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &ListSuppressionsRequestScope{} - var expected ListSuppressionsRequestScopeOne - obj.ListSuppressionsRequestScopeOne = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetListSuppressionsRequestScopeOne(), "getter should return the property value") +func TestSettersInvoiceLine(t *testing.T) { + t.Run("SetObject", func(t *testing.T) { + obj := &InvoiceLine{} + var fernTestValueObject InvoiceLineObject + obj.SetObject(fernTestValueObject) + assert.Equal(t, fernTestValueObject, obj.Object) + assert.NotNil(t, obj.explicitFields) }) - t.Run("GetListSuppressionsRequestScopeOne_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *ListSuppressionsRequestScope - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetListSuppressionsRequestScopeOne() // Should return zero value + t.Run("SetID", func(t *testing.T) { + obj := &InvoiceLine{} + var fernTestValueID string + obj.SetID(fernTestValueID) + assert.Equal(t, fernTestValueID, obj.ID) + assert.NotNil(t, obj.explicitFields) }) - t.Run("GetString", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &ListSuppressionsRequestScope{} - var expected string - obj.String = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetString(), "getter should return the property value") + t.Run("SetKind", func(t *testing.T) { + obj := &InvoiceLine{} + var fernTestValueKind InvoiceLineKind + obj.SetKind(fernTestValueKind) + assert.Equal(t, fernTestValueKind, obj.Kind) + assert.NotNil(t, obj.explicitFields) }) - t.Run("GetString_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *ListSuppressionsRequestScope - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetString() // Should return zero value + t.Run("SetDescription", func(t *testing.T) { + obj := &InvoiceLine{} + var fernTestValueDescription string + obj.SetDescription(fernTestValueDescription) + assert.Equal(t, fernTestValueDescription, obj.Description) + assert.NotNil(t, obj.explicitFields) }) -} - -func TestSettersLogDrainAttempt(t *testing.T) { - t.Run("SetObject", func(t *testing.T) { - obj := &LogDrainAttempt{} - var fernTestValueObject LogDrainAttemptObject - obj.SetObject(fernTestValueObject) - assert.Equal(t, fernTestValueObject, obj.Object) + t.Run("SetMeter", func(t *testing.T) { + obj := &InvoiceLine{} + var fernTestValueMeter *InvoiceLineMeter + obj.SetMeter(fernTestValueMeter) + assert.Equal(t, fernTestValueMeter, obj.Meter) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetID", func(t *testing.T) { - obj := &LogDrainAttempt{} - var fernTestValueID string - obj.SetID(fernTestValueID) - assert.Equal(t, fernTestValueID, obj.ID) + t.Run("SetDimension", func(t *testing.T) { + obj := &InvoiceLine{} + var fernTestValueDimension *string + obj.SetDimension(fernTestValueDimension) + assert.Equal(t, fernTestValueDimension, obj.Dimension) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetAttemptedAt", func(t *testing.T) { - obj := &LogDrainAttempt{} - var fernTestValueAttemptedAt time.Time - obj.SetAttemptedAt(fernTestValueAttemptedAt) - assert.Equal(t, fernTestValueAttemptedAt, obj.AttemptedAt) + t.Run("SetQuantity", func(t *testing.T) { + obj := &InvoiceLine{} + var fernTestValueQuantity *int64 + obj.SetQuantity(fernTestValueQuantity) + assert.Equal(t, fernTestValueQuantity, obj.Quantity) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetStatusCode", func(t *testing.T) { - obj := &LogDrainAttempt{} - var fernTestValueStatusCode *int64 - obj.SetStatusCode(fernTestValueStatusCode) - assert.Equal(t, fernTestValueStatusCode, obj.StatusCode) + t.Run("SetIncludedQuantity", func(t *testing.T) { + obj := &InvoiceLine{} + var fernTestValueIncludedQuantity *int64 + obj.SetIncludedQuantity(fernTestValueIncludedQuantity) + assert.Equal(t, fernTestValueIncludedQuantity, obj.IncludedQuantity) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetDurationMs", func(t *testing.T) { - obj := &LogDrainAttempt{} - var fernTestValueDurationMs int64 - obj.SetDurationMs(fernTestValueDurationMs) - assert.Equal(t, fernTestValueDurationMs, obj.DurationMs) + t.Run("SetUnitPrice", func(t *testing.T) { + obj := &InvoiceLine{} + var fernTestValueUnitPrice *string + obj.SetUnitPrice(fernTestValueUnitPrice) + assert.Equal(t, fernTestValueUnitPrice, obj.UnitPrice) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetError", func(t *testing.T) { - obj := &LogDrainAttempt{} - var fernTestValueError *string - obj.SetError(fernTestValueError) - assert.Equal(t, fernTestValueError, obj.Error) + t.Run("SetAmount", func(t *testing.T) { + obj := &InvoiceLine{} + var fernTestValueAmount int64 + obj.SetAmount(fernTestValueAmount) + assert.Equal(t, fernTestValueAmount, obj.Amount) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetResponseExcerpt", func(t *testing.T) { - obj := &LogDrainAttempt{} - var fernTestValueResponseExcerpt *string - obj.SetResponseExcerpt(fernTestValueResponseExcerpt) - assert.Equal(t, fernTestValueResponseExcerpt, obj.ResponseExcerpt) + t.Run("SetPeriod", func(t *testing.T) { + obj := &InvoiceLine{} + var fernTestValuePeriod *InvoiceLinePeriod + obj.SetPeriod(fernTestValuePeriod) + assert.Equal(t, fernTestValuePeriod, obj.Period) assert.NotNil(t, obj.explicitFields) }) } -func TestGettersLogDrainAttempt(t *testing.T) { +func TestGettersInvoiceLine(t *testing.T) { t.Run("GetObject", func(t *testing.T) { t.Parallel() // Arrange - obj := &LogDrainAttempt{} - var expected LogDrainAttemptObject + obj := &InvoiceLine{} + var expected InvoiceLineObject obj.Object = expected // Act & Assert @@ -59623,7 +58676,7 @@ func TestGettersLogDrainAttempt(t *testing.T) { t.Run("GetObject_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *LogDrainAttempt + var obj *InvoiceLine // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -59636,7 +58689,7 @@ func TestGettersLogDrainAttempt(t *testing.T) { t.Run("GetID", func(t *testing.T) { t.Parallel() // Arrange - obj := &LogDrainAttempt{} + obj := &InvoiceLine{} var expected string obj.ID = expected @@ -59646,7 +58699,7 @@ func TestGettersLogDrainAttempt(t *testing.T) { t.Run("GetID_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *LogDrainAttempt + var obj *InvoiceLine // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -59656,828 +58709,281 @@ func TestGettersLogDrainAttempt(t *testing.T) { _ = obj.GetID() // Should return zero value }) - t.Run("GetAttemptedAt", func(t *testing.T) { + t.Run("GetKind", func(t *testing.T) { t.Parallel() // Arrange - obj := &LogDrainAttempt{} - var expected time.Time - obj.AttemptedAt = expected + obj := &InvoiceLine{} + var expected InvoiceLineKind + obj.Kind = expected // Act & Assert - assert.Equal(t, expected, obj.GetAttemptedAt(), "getter should return the property value") + assert.Equal(t, expected, obj.GetKind(), "getter should return the property value") }) - t.Run("GetAttemptedAt_NilReceiver", func(t *testing.T) { + t.Run("GetKind_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *LogDrainAttempt + var obj *InvoiceLine // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetAttemptedAt() // Should return zero value + _ = obj.GetKind() // Should return zero value }) - t.Run("GetStatusCode", func(t *testing.T) { + t.Run("GetDescription", func(t *testing.T) { t.Parallel() // Arrange - obj := &LogDrainAttempt{} - var expected *int64 - obj.StatusCode = expected + obj := &InvoiceLine{} + var expected string + obj.Description = expected // Act & Assert - assert.Equal(t, expected, obj.GetStatusCode(), "getter should return the property value") + assert.Equal(t, expected, obj.GetDescription(), "getter should return the property value") }) - t.Run("GetStatusCode_NilValue", func(t *testing.T) { + t.Run("GetDescription_NilReceiver", func(t *testing.T) { t.Parallel() - // Arrange - obj := &LogDrainAttempt{} - obj.StatusCode = nil - - // Act & Assert - assert.Nil(t, obj.GetStatusCode(), "getter should return nil when property is nil") - }) - - t.Run("GetStatusCode_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *LogDrainAttempt - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetStatusCode() // Should return zero value - }) - - t.Run("GetDurationMs", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &LogDrainAttempt{} - var expected int64 - obj.DurationMs = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetDurationMs(), "getter should return the property value") - }) - - t.Run("GetDurationMs_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *LogDrainAttempt + var obj *InvoiceLine // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetDurationMs() // Should return zero value + _ = obj.GetDescription() // Should return zero value }) - t.Run("GetError", func(t *testing.T) { + t.Run("GetMeter", func(t *testing.T) { t.Parallel() // Arrange - obj := &LogDrainAttempt{} - var expected *string - obj.Error = expected + obj := &InvoiceLine{} + var expected *InvoiceLineMeter + obj.Meter = expected // Act & Assert - assert.Equal(t, expected, obj.GetError(), "getter should return the property value") + assert.Equal(t, expected, obj.GetMeter(), "getter should return the property value") }) - t.Run("GetError_NilValue", func(t *testing.T) { + t.Run("GetMeter_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &LogDrainAttempt{} - obj.Error = nil + obj := &InvoiceLine{} + obj.Meter = nil // Act & Assert - assert.Nil(t, obj.GetError(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetMeter(), "getter should return nil when property is nil") }) - t.Run("GetError_NilReceiver", func(t *testing.T) { + t.Run("GetMeter_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *LogDrainAttempt + var obj *InvoiceLine // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetError() // Should return zero value + _ = obj.GetMeter() // Should return zero value }) - t.Run("GetResponseExcerpt", func(t *testing.T) { + t.Run("GetDimension", func(t *testing.T) { t.Parallel() // Arrange - obj := &LogDrainAttempt{} + obj := &InvoiceLine{} var expected *string - obj.ResponseExcerpt = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetResponseExcerpt(), "getter should return the property value") - }) - - t.Run("GetResponseExcerpt_NilValue", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &LogDrainAttempt{} - obj.ResponseExcerpt = nil - - // Act & Assert - assert.Nil(t, obj.GetResponseExcerpt(), "getter should return nil when property is nil") - }) - - t.Run("GetResponseExcerpt_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *LogDrainAttempt - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetResponseExcerpt() // Should return zero value - }) - -} - -func TestSettersMarkExplicitLogDrainAttempt(t *testing.T) { - t.Run("SetObject_MarksExplicit", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &LogDrainAttempt{} - var fernTestValueObject LogDrainAttemptObject - - // Act - obj.SetObject(fernTestValueObject) - - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") - - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } - - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip - }) - - t.Run("SetID_MarksExplicit", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &LogDrainAttempt{} - var fernTestValueID string - - // Act - obj.SetID(fernTestValueID) - - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") - - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } - - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip - }) - - t.Run("SetAttemptedAt_MarksExplicit", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &LogDrainAttempt{} - var fernTestValueAttemptedAt time.Time - - // Act - obj.SetAttemptedAt(fernTestValueAttemptedAt) - - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") - - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } - - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip - }) - - t.Run("SetStatusCode_MarksExplicit", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &LogDrainAttempt{} - var fernTestValueStatusCode *int64 - - // Act - obj.SetStatusCode(fernTestValueStatusCode) - - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") - - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } - - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip - }) - - t.Run("SetDurationMs_MarksExplicit", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &LogDrainAttempt{} - var fernTestValueDurationMs int64 - - // Act - obj.SetDurationMs(fernTestValueDurationMs) - - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") - - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } - - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip - }) - - t.Run("SetError_MarksExplicit", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &LogDrainAttempt{} - var fernTestValueError *string - - // Act - obj.SetError(fernTestValueError) - - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") - - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } - - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip - }) - - t.Run("SetResponseExcerpt_MarksExplicit", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &LogDrainAttempt{} - var fernTestValueResponseExcerpt *string - - // Act - obj.SetResponseExcerpt(fernTestValueResponseExcerpt) - - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") - - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } - - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip - }) - -} - -func TestSettersLogDrainBatch(t *testing.T) { - t.Run("SetObject", func(t *testing.T) { - obj := &LogDrainBatch{} - var fernTestValueObject LogDrainBatchObject - obj.SetObject(fernTestValueObject) - assert.Equal(t, fernTestValueObject, obj.Object) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetID", func(t *testing.T) { - obj := &LogDrainBatch{} - var fernTestValueID string - obj.SetID(fernTestValueID) - assert.Equal(t, fernTestValueID, obj.ID) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetDrainID", func(t *testing.T) { - obj := &LogDrainBatch{} - var fernTestValueDrainID string - obj.SetDrainID(fernTestValueDrainID) - assert.Equal(t, fernTestValueDrainID, obj.DrainID) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetStatus", func(t *testing.T) { - obj := &LogDrainBatch{} - var fernTestValueStatus LogDrainBatchStatus - obj.SetStatus(fernTestValueStatus) - assert.Equal(t, fernTestValueStatus, obj.Status) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetLineCount", func(t *testing.T) { - obj := &LogDrainBatch{} - var fernTestValueLineCount int64 - obj.SetLineCount(fernTestValueLineCount) - assert.Equal(t, fernTestValueLineCount, obj.LineCount) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetByteSize", func(t *testing.T) { - obj := &LogDrainBatch{} - var fernTestValueByteSize int64 - obj.SetByteSize(fernTestValueByteSize) - assert.Equal(t, fernTestValueByteSize, obj.ByteSize) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetAttemptCount", func(t *testing.T) { - obj := &LogDrainBatch{} - var fernTestValueAttemptCount int64 - obj.SetAttemptCount(fernTestValueAttemptCount) - assert.Equal(t, fernTestValueAttemptCount, obj.AttemptCount) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetNextAttemptAt", func(t *testing.T) { - obj := &LogDrainBatch{} - var fernTestValueNextAttemptAt *time.Time - obj.SetNextAttemptAt(fernTestValueNextAttemptAt) - assert.Equal(t, fernTestValueNextAttemptAt, obj.NextAttemptAt) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetLastStatusCode", func(t *testing.T) { - obj := &LogDrainBatch{} - var fernTestValueLastStatusCode *int64 - obj.SetLastStatusCode(fernTestValueLastStatusCode) - assert.Equal(t, fernTestValueLastStatusCode, obj.LastStatusCode) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetLastError", func(t *testing.T) { - obj := &LogDrainBatch{} - var fernTestValueLastError *string - obj.SetLastError(fernTestValueLastError) - assert.Equal(t, fernTestValueLastError, obj.LastError) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetAttempts", func(t *testing.T) { - obj := &LogDrainBatch{} - var fernTestValueAttempts []*LogDrainAttempt - obj.SetAttempts(fernTestValueAttempts) - assert.Equal(t, fernTestValueAttempts, obj.Attempts) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetCreatedAt", func(t *testing.T) { - obj := &LogDrainBatch{} - var fernTestValueCreatedAt time.Time - obj.SetCreatedAt(fernTestValueCreatedAt) - assert.Equal(t, fernTestValueCreatedAt, obj.CreatedAt) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetUpdatedAt", func(t *testing.T) { - obj := &LogDrainBatch{} - var fernTestValueUpdatedAt time.Time - obj.SetUpdatedAt(fernTestValueUpdatedAt) - assert.Equal(t, fernTestValueUpdatedAt, obj.UpdatedAt) - assert.NotNil(t, obj.explicitFields) - }) - -} - -func TestGettersLogDrainBatch(t *testing.T) { - t.Run("GetObject", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &LogDrainBatch{} - var expected LogDrainBatchObject - obj.Object = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetObject(), "getter should return the property value") - }) - - t.Run("GetObject_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *LogDrainBatch - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetObject() // Should return zero value - }) - - t.Run("GetID", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &LogDrainBatch{} - var expected string - obj.ID = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetID(), "getter should return the property value") - }) - - t.Run("GetID_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *LogDrainBatch - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetID() // Should return zero value - }) - - t.Run("GetDrainID", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &LogDrainBatch{} - var expected string - obj.DrainID = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetDrainID(), "getter should return the property value") - }) - - t.Run("GetDrainID_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *LogDrainBatch - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetDrainID() // Should return zero value - }) - - t.Run("GetStatus", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &LogDrainBatch{} - var expected LogDrainBatchStatus - obj.Status = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetStatus(), "getter should return the property value") - }) - - t.Run("GetStatus_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *LogDrainBatch - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetStatus() // Should return zero value - }) - - t.Run("GetLineCount", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &LogDrainBatch{} - var expected int64 - obj.LineCount = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetLineCount(), "getter should return the property value") - }) - - t.Run("GetLineCount_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *LogDrainBatch - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetLineCount() // Should return zero value - }) - - t.Run("GetByteSize", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &LogDrainBatch{} - var expected int64 - obj.ByteSize = expected + obj.Dimension = expected // Act & Assert - assert.Equal(t, expected, obj.GetByteSize(), "getter should return the property value") - }) - - t.Run("GetByteSize_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *LogDrainBatch - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetByteSize() // Should return zero value + assert.Equal(t, expected, obj.GetDimension(), "getter should return the property value") }) - t.Run("GetAttemptCount", func(t *testing.T) { + t.Run("GetDimension_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &LogDrainBatch{} - var expected int64 - obj.AttemptCount = expected + obj := &InvoiceLine{} + obj.Dimension = nil // Act & Assert - assert.Equal(t, expected, obj.GetAttemptCount(), "getter should return the property value") + assert.Nil(t, obj.GetDimension(), "getter should return nil when property is nil") }) - t.Run("GetAttemptCount_NilReceiver", func(t *testing.T) { + t.Run("GetDimension_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *LogDrainBatch + var obj *InvoiceLine // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetAttemptCount() // Should return zero value + _ = obj.GetDimension() // Should return zero value }) - t.Run("GetNextAttemptAt", func(t *testing.T) { + t.Run("GetQuantity", func(t *testing.T) { t.Parallel() // Arrange - obj := &LogDrainBatch{} - var expected *time.Time - obj.NextAttemptAt = expected + obj := &InvoiceLine{} + var expected *int64 + obj.Quantity = expected // Act & Assert - assert.Equal(t, expected, obj.GetNextAttemptAt(), "getter should return the property value") + assert.Equal(t, expected, obj.GetQuantity(), "getter should return the property value") }) - t.Run("GetNextAttemptAt_NilValue", func(t *testing.T) { + t.Run("GetQuantity_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &LogDrainBatch{} - obj.NextAttemptAt = nil + obj := &InvoiceLine{} + obj.Quantity = nil // Act & Assert - assert.Nil(t, obj.GetNextAttemptAt(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetQuantity(), "getter should return nil when property is nil") }) - t.Run("GetNextAttemptAt_NilReceiver", func(t *testing.T) { + t.Run("GetQuantity_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *LogDrainBatch + var obj *InvoiceLine // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetNextAttemptAt() // Should return zero value + _ = obj.GetQuantity() // Should return zero value }) - t.Run("GetLastStatusCode", func(t *testing.T) { + t.Run("GetIncludedQuantity", func(t *testing.T) { t.Parallel() // Arrange - obj := &LogDrainBatch{} + obj := &InvoiceLine{} var expected *int64 - obj.LastStatusCode = expected + obj.IncludedQuantity = expected // Act & Assert - assert.Equal(t, expected, obj.GetLastStatusCode(), "getter should return the property value") + assert.Equal(t, expected, obj.GetIncludedQuantity(), "getter should return the property value") }) - t.Run("GetLastStatusCode_NilValue", func(t *testing.T) { + t.Run("GetIncludedQuantity_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &LogDrainBatch{} - obj.LastStatusCode = nil + obj := &InvoiceLine{} + obj.IncludedQuantity = nil // Act & Assert - assert.Nil(t, obj.GetLastStatusCode(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetIncludedQuantity(), "getter should return nil when property is nil") }) - t.Run("GetLastStatusCode_NilReceiver", func(t *testing.T) { + t.Run("GetIncludedQuantity_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *LogDrainBatch + var obj *InvoiceLine // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetLastStatusCode() // Should return zero value + _ = obj.GetIncludedQuantity() // Should return zero value }) - t.Run("GetLastError", func(t *testing.T) { + t.Run("GetUnitPrice", func(t *testing.T) { t.Parallel() // Arrange - obj := &LogDrainBatch{} + obj := &InvoiceLine{} var expected *string - obj.LastError = expected + obj.UnitPrice = expected // Act & Assert - assert.Equal(t, expected, obj.GetLastError(), "getter should return the property value") + assert.Equal(t, expected, obj.GetUnitPrice(), "getter should return the property value") }) - t.Run("GetLastError_NilValue", func(t *testing.T) { + t.Run("GetUnitPrice_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &LogDrainBatch{} - obj.LastError = nil + obj := &InvoiceLine{} + obj.UnitPrice = nil // Act & Assert - assert.Nil(t, obj.GetLastError(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetUnitPrice(), "getter should return nil when property is nil") }) - t.Run("GetLastError_NilReceiver", func(t *testing.T) { + t.Run("GetUnitPrice_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *LogDrainBatch + var obj *InvoiceLine // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetLastError() // Should return zero value - }) - - t.Run("GetAttempts", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &LogDrainBatch{} - var expected []*LogDrainAttempt - obj.Attempts = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetAttempts(), "getter should return the property value") + _ = obj.GetUnitPrice() // Should return zero value }) - t.Run("GetAttempts_NilValue", func(t *testing.T) { + t.Run("GetAmount", func(t *testing.T) { t.Parallel() // Arrange - obj := &LogDrainBatch{} - obj.Attempts = nil + obj := &InvoiceLine{} + var expected int64 + obj.Amount = expected // Act & Assert - assert.Nil(t, obj.GetAttempts(), "getter should return nil when property is nil") + assert.Equal(t, expected, obj.GetAmount(), "getter should return the property value") }) - t.Run("GetAttempts_NilReceiver", func(t *testing.T) { + t.Run("GetAmount_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *LogDrainBatch + var obj *InvoiceLine // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetAttempts() // Should return zero value + _ = obj.GetAmount() // Should return zero value }) - t.Run("GetCreatedAt", func(t *testing.T) { + t.Run("GetPeriod", func(t *testing.T) { t.Parallel() // Arrange - obj := &LogDrainBatch{} - var expected time.Time - obj.CreatedAt = expected + obj := &InvoiceLine{} + var expected *InvoiceLinePeriod + obj.Period = expected // Act & Assert - assert.Equal(t, expected, obj.GetCreatedAt(), "getter should return the property value") - }) - - t.Run("GetCreatedAt_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *LogDrainBatch - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetCreatedAt() // Should return zero value + assert.Equal(t, expected, obj.GetPeriod(), "getter should return the property value") }) - t.Run("GetUpdatedAt", func(t *testing.T) { + t.Run("GetPeriod_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &LogDrainBatch{} - var expected time.Time - obj.UpdatedAt = expected + obj := &InvoiceLine{} + obj.Period = nil // Act & Assert - assert.Equal(t, expected, obj.GetUpdatedAt(), "getter should return the property value") + assert.Nil(t, obj.GetPeriod(), "getter should return nil when property is nil") }) - t.Run("GetUpdatedAt_NilReceiver", func(t *testing.T) { + t.Run("GetPeriod_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *LogDrainBatch + var obj *InvoiceLine // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetUpdatedAt() // Should return zero value + _ = obj.GetPeriod() // Should return zero value }) } -func TestSettersMarkExplicitLogDrainBatch(t *testing.T) { +func TestSettersMarkExplicitInvoiceLine(t *testing.T) { t.Run("SetObject_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &LogDrainBatch{} - var fernTestValueObject LogDrainBatchObject + obj := &InvoiceLine{} + var fernTestValueObject InvoiceLineObject // Act obj.SetObject(fernTestValueObject) @@ -60507,7 +59013,7 @@ func TestSettersMarkExplicitLogDrainBatch(t *testing.T) { t.Run("SetID_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &LogDrainBatch{} + obj := &InvoiceLine{} var fernTestValueID string // Act @@ -60535,14 +59041,14 @@ func TestSettersMarkExplicitLogDrainBatch(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetDrainID_MarksExplicit", func(t *testing.T) { + t.Run("SetKind_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &LogDrainBatch{} - var fernTestValueDrainID string + obj := &InvoiceLine{} + var fernTestValueKind InvoiceLineKind // Act - obj.SetDrainID(fernTestValueDrainID) + obj.SetKind(fernTestValueKind) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -60566,14 +59072,14 @@ func TestSettersMarkExplicitLogDrainBatch(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetStatus_MarksExplicit", func(t *testing.T) { + t.Run("SetDescription_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &LogDrainBatch{} - var fernTestValueStatus LogDrainBatchStatus + obj := &InvoiceLine{} + var fernTestValueDescription string // Act - obj.SetStatus(fernTestValueStatus) + obj.SetDescription(fernTestValueDescription) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -60597,14 +59103,14 @@ func TestSettersMarkExplicitLogDrainBatch(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetLineCount_MarksExplicit", func(t *testing.T) { + t.Run("SetMeter_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &LogDrainBatch{} - var fernTestValueLineCount int64 + obj := &InvoiceLine{} + var fernTestValueMeter *InvoiceLineMeter // Act - obj.SetLineCount(fernTestValueLineCount) + obj.SetMeter(fernTestValueMeter) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -60628,14 +59134,14 @@ func TestSettersMarkExplicitLogDrainBatch(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetByteSize_MarksExplicit", func(t *testing.T) { + t.Run("SetDimension_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &LogDrainBatch{} - var fernTestValueByteSize int64 + obj := &InvoiceLine{} + var fernTestValueDimension *string // Act - obj.SetByteSize(fernTestValueByteSize) + obj.SetDimension(fernTestValueDimension) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -60659,14 +59165,14 @@ func TestSettersMarkExplicitLogDrainBatch(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetAttemptCount_MarksExplicit", func(t *testing.T) { + t.Run("SetQuantity_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &LogDrainBatch{} - var fernTestValueAttemptCount int64 + obj := &InvoiceLine{} + var fernTestValueQuantity *int64 // Act - obj.SetAttemptCount(fernTestValueAttemptCount) + obj.SetQuantity(fernTestValueQuantity) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -60690,14 +59196,14 @@ func TestSettersMarkExplicitLogDrainBatch(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetNextAttemptAt_MarksExplicit", func(t *testing.T) { + t.Run("SetIncludedQuantity_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &LogDrainBatch{} - var fernTestValueNextAttemptAt *time.Time + obj := &InvoiceLine{} + var fernTestValueIncludedQuantity *int64 // Act - obj.SetNextAttemptAt(fernTestValueNextAttemptAt) + obj.SetIncludedQuantity(fernTestValueIncludedQuantity) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -60721,14 +59227,14 @@ func TestSettersMarkExplicitLogDrainBatch(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetLastStatusCode_MarksExplicit", func(t *testing.T) { + t.Run("SetUnitPrice_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &LogDrainBatch{} - var fernTestValueLastStatusCode *int64 + obj := &InvoiceLine{} + var fernTestValueUnitPrice *string // Act - obj.SetLastStatusCode(fernTestValueLastStatusCode) + obj.SetUnitPrice(fernTestValueUnitPrice) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -60752,14 +59258,14 @@ func TestSettersMarkExplicitLogDrainBatch(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetLastError_MarksExplicit", func(t *testing.T) { + t.Run("SetAmount_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &LogDrainBatch{} - var fernTestValueLastError *string + obj := &InvoiceLine{} + var fernTestValueAmount int64 // Act - obj.SetLastError(fernTestValueLastError) + obj.SetAmount(fernTestValueAmount) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -60783,14 +59289,14 @@ func TestSettersMarkExplicitLogDrainBatch(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetAttempts_MarksExplicit", func(t *testing.T) { + t.Run("SetPeriod_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &LogDrainBatch{} - var fernTestValueAttempts []*LogDrainAttempt + obj := &InvoiceLine{} + var fernTestValuePeriod *InvoiceLinePeriod // Act - obj.SetAttempts(fernTestValueAttempts) + obj.SetPeriod(fernTestValuePeriod) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -60814,14 +59320,85 @@ func TestSettersMarkExplicitLogDrainBatch(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetCreatedAt_MarksExplicit", func(t *testing.T) { +} + +func TestSettersInvoiceLinePeriod(t *testing.T) { + t.Run("SetStart", func(t *testing.T) { + obj := &InvoiceLinePeriod{} + var fernTestValueStart time.Time + obj.SetStart(fernTestValueStart) + assert.Equal(t, fernTestValueStart, obj.Start) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetEnd", func(t *testing.T) { + obj := &InvoiceLinePeriod{} + var fernTestValueEnd time.Time + obj.SetEnd(fernTestValueEnd) + assert.Equal(t, fernTestValueEnd, obj.End) + assert.NotNil(t, obj.explicitFields) + }) + +} + +func TestGettersInvoiceLinePeriod(t *testing.T) { + t.Run("GetStart", func(t *testing.T) { t.Parallel() // Arrange - obj := &LogDrainBatch{} - var fernTestValueCreatedAt time.Time + obj := &InvoiceLinePeriod{} + var expected time.Time + obj.Start = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetStart(), "getter should return the property value") + }) + + t.Run("GetStart_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *InvoiceLinePeriod + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetStart() // Should return zero value + }) + + t.Run("GetEnd", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &InvoiceLinePeriod{} + var expected time.Time + obj.End = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetEnd(), "getter should return the property value") + }) + + t.Run("GetEnd_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *InvoiceLinePeriod + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetEnd() // Should return zero value + }) + +} + +func TestSettersMarkExplicitInvoiceLinePeriod(t *testing.T) { + t.Run("SetStart_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &InvoiceLinePeriod{} + var fernTestValueStart time.Time // Act - obj.SetCreatedAt(fernTestValueCreatedAt) + obj.SetStart(fernTestValueStart) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -60845,14 +59422,14 @@ func TestSettersMarkExplicitLogDrainBatch(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetUpdatedAt_MarksExplicit", func(t *testing.T) { + t.Run("SetEnd_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &LogDrainBatch{} - var fernTestValueUpdatedAt time.Time + obj := &InvoiceLinePeriod{} + var fernTestValueEnd time.Time // Act - obj.SetUpdatedAt(fernTestValueUpdatedAt) + obj.SetEnd(fernTestValueEnd) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -60878,25 +59455,25 @@ func TestSettersMarkExplicitLogDrainBatch(t *testing.T) { } -func TestSettersLogDrainBatchList(t *testing.T) { +func TestSettersInvoiceList(t *testing.T) { t.Run("SetObject", func(t *testing.T) { - obj := &LogDrainBatchList{} - var fernTestValueObject LogDrainBatchListObject + obj := &InvoiceList{} + var fernTestValueObject InvoiceListObject obj.SetObject(fernTestValueObject) assert.Equal(t, fernTestValueObject, obj.Object) assert.NotNil(t, obj.explicitFields) }) t.Run("SetData", func(t *testing.T) { - obj := &LogDrainBatchList{} - var fernTestValueData []*LogDrainBatch + obj := &InvoiceList{} + var fernTestValueData []*InvoiceSummary obj.SetData(fernTestValueData) assert.Equal(t, fernTestValueData, obj.Data) assert.NotNil(t, obj.explicitFields) }) t.Run("SetHasMore", func(t *testing.T) { - obj := &LogDrainBatchList{} + obj := &InvoiceList{} var fernTestValueHasMore bool obj.SetHasMore(fernTestValueHasMore) assert.Equal(t, fernTestValueHasMore, obj.HasMore) @@ -60905,12 +59482,12 @@ func TestSettersLogDrainBatchList(t *testing.T) { } -func TestGettersLogDrainBatchList(t *testing.T) { +func TestGettersInvoiceList(t *testing.T) { t.Run("GetObject", func(t *testing.T) { t.Parallel() // Arrange - obj := &LogDrainBatchList{} - var expected LogDrainBatchListObject + obj := &InvoiceList{} + var expected InvoiceListObject obj.Object = expected // Act & Assert @@ -60919,7 +59496,7 @@ func TestGettersLogDrainBatchList(t *testing.T) { t.Run("GetObject_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *LogDrainBatchList + var obj *InvoiceList // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -60932,8 +59509,8 @@ func TestGettersLogDrainBatchList(t *testing.T) { t.Run("GetData", func(t *testing.T) { t.Parallel() // Arrange - obj := &LogDrainBatchList{} - var expected []*LogDrainBatch + obj := &InvoiceList{} + var expected []*InvoiceSummary obj.Data = expected // Act & Assert @@ -60943,7 +59520,7 @@ func TestGettersLogDrainBatchList(t *testing.T) { t.Run("GetData_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &LogDrainBatchList{} + obj := &InvoiceList{} obj.Data = nil // Act & Assert @@ -60952,7 +59529,7 @@ func TestGettersLogDrainBatchList(t *testing.T) { t.Run("GetData_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *LogDrainBatchList + var obj *InvoiceList // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -60965,7 +59542,7 @@ func TestGettersLogDrainBatchList(t *testing.T) { t.Run("GetHasMore", func(t *testing.T) { t.Parallel() // Arrange - obj := &LogDrainBatchList{} + obj := &InvoiceList{} var expected bool obj.HasMore = expected @@ -60975,7 +59552,7 @@ func TestGettersLogDrainBatchList(t *testing.T) { t.Run("GetHasMore_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *LogDrainBatchList + var obj *InvoiceList // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -60987,12 +59564,12 @@ func TestGettersLogDrainBatchList(t *testing.T) { } -func TestSettersMarkExplicitLogDrainBatchList(t *testing.T) { +func TestSettersMarkExplicitInvoiceList(t *testing.T) { t.Run("SetObject_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &LogDrainBatchList{} - var fernTestValueObject LogDrainBatchListObject + obj := &InvoiceList{} + var fernTestValueObject InvoiceListObject // Act obj.SetObject(fernTestValueObject) @@ -61022,8 +59599,8 @@ func TestSettersMarkExplicitLogDrainBatchList(t *testing.T) { t.Run("SetData_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &LogDrainBatchList{} - var fernTestValueData []*LogDrainBatch + obj := &InvoiceList{} + var fernTestValueData []*InvoiceSummary // Act obj.SetData(fernTestValueData) @@ -61053,7 +59630,7 @@ func TestSettersMarkExplicitLogDrainBatchList(t *testing.T) { t.Run("SetHasMore_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &LogDrainBatchList{} + obj := &InvoiceList{} var fernTestValueHasMore bool // Act @@ -61083,367 +59660,882 @@ func TestSettersMarkExplicitLogDrainBatchList(t *testing.T) { } -func TestSettersMarketingSettings(t *testing.T) { - t.Run("SetObject", func(t *testing.T) { - obj := &MarketingSettings{} - var fernTestValueObject MarketingSettingsObject - obj.SetObject(fernTestValueObject) - assert.Equal(t, fernTestValueObject, obj.Object) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetDisplayName", func(t *testing.T) { - obj := &MarketingSettings{} - var fernTestValueDisplayName *string - obj.SetDisplayName(fernTestValueDisplayName) - assert.Equal(t, fernTestValueDisplayName, obj.DisplayName) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetMailingAddress", func(t *testing.T) { - obj := &MarketingSettings{} - var fernTestValueMailingAddress *string - obj.SetMailingAddress(fernTestValueMailingAddress) - assert.Equal(t, fernTestValueMailingAddress, obj.MailingAddress) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetDoubleOptInDefault", func(t *testing.T) { - obj := &MarketingSettings{} - var fernTestValueDoubleOptInDefault bool - obj.SetDoubleOptInDefault(fernTestValueDoubleOptInDefault) - assert.Equal(t, fernTestValueDoubleOptInDefault, obj.DoubleOptInDefault) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetConfirmationFrom", func(t *testing.T) { - obj := &MarketingSettings{} - var fernTestValueConfirmationFrom *string - obj.SetConfirmationFrom(fernTestValueConfirmationFrom) - assert.Equal(t, fernTestValueConfirmationFrom, obj.ConfirmationFrom) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetConfirmationSubject", func(t *testing.T) { - obj := &MarketingSettings{} - var fernTestValueConfirmationSubject *string - obj.SetConfirmationSubject(fernTestValueConfirmationSubject) - assert.Equal(t, fernTestValueConfirmationSubject, obj.ConfirmationSubject) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetConfirmationHTML", func(t *testing.T) { - obj := &MarketingSettings{} - var fernTestValueConfirmationHTML *string - obj.SetConfirmationHTML(fernTestValueConfirmationHTML) - assert.Equal(t, fernTestValueConfirmationHTML, obj.ConfirmationHTML) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetConfirmationText", func(t *testing.T) { - obj := &MarketingSettings{} - var fernTestValueConfirmationText *string - obj.SetConfirmationText(fernTestValueConfirmationText) - assert.Equal(t, fernTestValueConfirmationText, obj.ConfirmationText) +func TestSettersInvoicePeriod(t *testing.T) { + t.Run("SetStart", func(t *testing.T) { + obj := &InvoicePeriod{} + var fernTestValueStart time.Time + obj.SetStart(fernTestValueStart) + assert.Equal(t, fernTestValueStart, obj.Start) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetConfirmedRedirectURL", func(t *testing.T) { - obj := &MarketingSettings{} - var fernTestValueConfirmedRedirectURL *string - obj.SetConfirmedRedirectURL(fernTestValueConfirmedRedirectURL) - assert.Equal(t, fernTestValueConfirmedRedirectURL, obj.ConfirmedRedirectURL) + t.Run("SetEnd", func(t *testing.T) { + obj := &InvoicePeriod{} + var fernTestValueEnd time.Time + obj.SetEnd(fernTestValueEnd) + assert.Equal(t, fernTestValueEnd, obj.End) assert.NotNil(t, obj.explicitFields) }) } -func TestGettersMarketingSettings(t *testing.T) { - t.Run("GetObject", func(t *testing.T) { +func TestGettersInvoicePeriod(t *testing.T) { + t.Run("GetStart", func(t *testing.T) { t.Parallel() // Arrange - obj := &MarketingSettings{} - var expected MarketingSettingsObject - obj.Object = expected + obj := &InvoicePeriod{} + var expected time.Time + obj.Start = expected // Act & Assert - assert.Equal(t, expected, obj.GetObject(), "getter should return the property value") + assert.Equal(t, expected, obj.GetStart(), "getter should return the property value") }) - t.Run("GetObject_NilReceiver", func(t *testing.T) { + t.Run("GetStart_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *MarketingSettings + var obj *InvoicePeriod // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetObject() // Should return zero value + _ = obj.GetStart() // Should return zero value }) - t.Run("GetDisplayName", func(t *testing.T) { + t.Run("GetEnd", func(t *testing.T) { t.Parallel() // Arrange - obj := &MarketingSettings{} - var expected *string - obj.DisplayName = expected + obj := &InvoicePeriod{} + var expected time.Time + obj.End = expected // Act & Assert - assert.Equal(t, expected, obj.GetDisplayName(), "getter should return the property value") + assert.Equal(t, expected, obj.GetEnd(), "getter should return the property value") }) - t.Run("GetDisplayName_NilValue", func(t *testing.T) { + t.Run("GetEnd_NilReceiver", func(t *testing.T) { t.Parallel() - // Arrange - obj := &MarketingSettings{} - obj.DisplayName = nil - - // Act & Assert - assert.Nil(t, obj.GetDisplayName(), "getter should return nil when property is nil") - }) - - t.Run("GetDisplayName_NilReceiver", func(t *testing.T) { + var obj *InvoicePeriod + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetEnd() // Should return zero value + }) + +} + +func TestSettersMarkExplicitInvoicePeriod(t *testing.T) { + t.Run("SetStart_MarksExplicit", func(t *testing.T) { t.Parallel() - var obj *MarketingSettings + // Arrange + obj := &InvoicePeriod{} + var fernTestValueStart time.Time + + // Act + obj.SetStart(fernTestValueStart) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetEnd_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &InvoicePeriod{} + var fernTestValueEnd time.Time + + // Act + obj.SetEnd(fernTestValueEnd) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + +} + +func TestSettersInvoiceSummary(t *testing.T) { + t.Run("SetObject", func(t *testing.T) { + obj := &InvoiceSummary{} + var fernTestValueObject InvoiceSummaryObject + obj.SetObject(fernTestValueObject) + assert.Equal(t, fernTestValueObject, obj.Object) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetID", func(t *testing.T) { + obj := &InvoiceSummary{} + var fernTestValueID string + obj.SetID(fernTestValueID) + assert.Equal(t, fernTestValueID, obj.ID) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetNumber", func(t *testing.T) { + obj := &InvoiceSummary{} + var fernTestValueNumber *string + obj.SetNumber(fernTestValueNumber) + assert.Equal(t, fernTestValueNumber, obj.Number) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetKind", func(t *testing.T) { + obj := &InvoiceSummary{} + var fernTestValueKind InvoiceSummaryKind + obj.SetKind(fernTestValueKind) + assert.Equal(t, fernTestValueKind, obj.Kind) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetStatus", func(t *testing.T) { + obj := &InvoiceSummary{} + var fernTestValueStatus InvoiceSummaryStatus + obj.SetStatus(fernTestValueStatus) + assert.Equal(t, fernTestValueStatus, obj.Status) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetCurrency", func(t *testing.T) { + obj := &InvoiceSummary{} + var fernTestValueCurrency InvoiceSummaryCurrency + obj.SetCurrency(fernTestValueCurrency) + assert.Equal(t, fernTestValueCurrency, obj.Currency) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetPeriod", func(t *testing.T) { + obj := &InvoiceSummary{} + var fernTestValuePeriod *InvoiceSummaryPeriod + obj.SetPeriod(fernTestValuePeriod) + assert.Equal(t, fernTestValuePeriod, obj.Period) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetSubtotal", func(t *testing.T) { + obj := &InvoiceSummary{} + var fernTestValueSubtotal int64 + obj.SetSubtotal(fernTestValueSubtotal) + assert.Equal(t, fernTestValueSubtotal, obj.Subtotal) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetDiscount", func(t *testing.T) { + obj := &InvoiceSummary{} + var fernTestValueDiscount int64 + obj.SetDiscount(fernTestValueDiscount) + assert.Equal(t, fernTestValueDiscount, obj.Discount) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetCredit", func(t *testing.T) { + obj := &InvoiceSummary{} + var fernTestValueCredit int64 + obj.SetCredit(fernTestValueCredit) + assert.Equal(t, fernTestValueCredit, obj.Credit) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetTax", func(t *testing.T) { + obj := &InvoiceSummary{} + var fernTestValueTax int64 + obj.SetTax(fernTestValueTax) + assert.Equal(t, fernTestValueTax, obj.Tax) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetTotal", func(t *testing.T) { + obj := &InvoiceSummary{} + var fernTestValueTotal int64 + obj.SetTotal(fernTestValueTotal) + assert.Equal(t, fernTestValueTotal, obj.Total) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetAmountPaid", func(t *testing.T) { + obj := &InvoiceSummary{} + var fernTestValueAmountPaid int64 + obj.SetAmountPaid(fernTestValueAmountPaid) + assert.Equal(t, fernTestValueAmountPaid, obj.AmountPaid) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetAmountDue", func(t *testing.T) { + obj := &InvoiceSummary{} + var fernTestValueAmountDue int64 + obj.SetAmountDue(fernTestValueAmountDue) + assert.Equal(t, fernTestValueAmountDue, obj.AmountDue) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetCollectionMethod", func(t *testing.T) { + obj := &InvoiceSummary{} + var fernTestValueCollectionMethod InvoiceSummaryCollectionMethod + obj.SetCollectionMethod(fernTestValueCollectionMethod) + assert.Equal(t, fernTestValueCollectionMethod, obj.CollectionMethod) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetDueAt", func(t *testing.T) { + obj := &InvoiceSummary{} + var fernTestValueDueAt *time.Time + obj.SetDueAt(fernTestValueDueAt) + assert.Equal(t, fernTestValueDueAt, obj.DueAt) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetFinalizedAt", func(t *testing.T) { + obj := &InvoiceSummary{} + var fernTestValueFinalizedAt *time.Time + obj.SetFinalizedAt(fernTestValueFinalizedAt) + assert.Equal(t, fernTestValueFinalizedAt, obj.FinalizedAt) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetPaidAt", func(t *testing.T) { + obj := &InvoiceSummary{} + var fernTestValuePaidAt *time.Time + obj.SetPaidAt(fernTestValuePaidAt) + assert.Equal(t, fernTestValuePaidAt, obj.PaidAt) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetVoidedAt", func(t *testing.T) { + obj := &InvoiceSummary{} + var fernTestValueVoidedAt *time.Time + obj.SetVoidedAt(fernTestValueVoidedAt) + assert.Equal(t, fernTestValueVoidedAt, obj.VoidedAt) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetHostedURL", func(t *testing.T) { + obj := &InvoiceSummary{} + var fernTestValueHostedURL *string + obj.SetHostedURL(fernTestValueHostedURL) + assert.Equal(t, fernTestValueHostedURL, obj.HostedURL) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetPdfURL", func(t *testing.T) { + obj := &InvoiceSummary{} + var fernTestValuePdfURL *string + obj.SetPdfURL(fernTestValuePdfURL) + assert.Equal(t, fernTestValuePdfURL, obj.PdfURL) + assert.NotNil(t, obj.explicitFields) + }) + +} + +func TestGettersInvoiceSummary(t *testing.T) { + t.Run("GetObject", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &InvoiceSummary{} + var expected InvoiceSummaryObject + obj.Object = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetObject(), "getter should return the property value") + }) + + t.Run("GetObject_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *InvoiceSummary // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetDisplayName() // Should return zero value + _ = obj.GetObject() // Should return zero value }) - t.Run("GetMailingAddress", func(t *testing.T) { + t.Run("GetID", func(t *testing.T) { t.Parallel() // Arrange - obj := &MarketingSettings{} + obj := &InvoiceSummary{} + var expected string + obj.ID = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetID(), "getter should return the property value") + }) + + t.Run("GetID_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *InvoiceSummary + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetID() // Should return zero value + }) + + t.Run("GetNumber", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &InvoiceSummary{} var expected *string - obj.MailingAddress = expected + obj.Number = expected // Act & Assert - assert.Equal(t, expected, obj.GetMailingAddress(), "getter should return the property value") + assert.Equal(t, expected, obj.GetNumber(), "getter should return the property value") }) - t.Run("GetMailingAddress_NilValue", func(t *testing.T) { + t.Run("GetNumber_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &MarketingSettings{} - obj.MailingAddress = nil + obj := &InvoiceSummary{} + obj.Number = nil // Act & Assert - assert.Nil(t, obj.GetMailingAddress(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetNumber(), "getter should return nil when property is nil") }) - t.Run("GetMailingAddress_NilReceiver", func(t *testing.T) { + t.Run("GetNumber_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *MarketingSettings + var obj *InvoiceSummary // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetMailingAddress() // Should return zero value + _ = obj.GetNumber() // Should return zero value }) - t.Run("GetDoubleOptInDefault", func(t *testing.T) { + t.Run("GetKind", func(t *testing.T) { t.Parallel() // Arrange - obj := &MarketingSettings{} - var expected bool - obj.DoubleOptInDefault = expected + obj := &InvoiceSummary{} + var expected InvoiceSummaryKind + obj.Kind = expected // Act & Assert - assert.Equal(t, expected, obj.GetDoubleOptInDefault(), "getter should return the property value") + assert.Equal(t, expected, obj.GetKind(), "getter should return the property value") }) - t.Run("GetDoubleOptInDefault_NilReceiver", func(t *testing.T) { + t.Run("GetKind_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *MarketingSettings + var obj *InvoiceSummary // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetDoubleOptInDefault() // Should return zero value + _ = obj.GetKind() // Should return zero value }) - t.Run("GetConfirmationFrom", func(t *testing.T) { + t.Run("GetStatus", func(t *testing.T) { t.Parallel() // Arrange - obj := &MarketingSettings{} - var expected *string - obj.ConfirmationFrom = expected + obj := &InvoiceSummary{} + var expected InvoiceSummaryStatus + obj.Status = expected // Act & Assert - assert.Equal(t, expected, obj.GetConfirmationFrom(), "getter should return the property value") + assert.Equal(t, expected, obj.GetStatus(), "getter should return the property value") }) - t.Run("GetConfirmationFrom_NilValue", func(t *testing.T) { + t.Run("GetStatus_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *InvoiceSummary + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetStatus() // Should return zero value + }) + + t.Run("GetCurrency", func(t *testing.T) { t.Parallel() // Arrange - obj := &MarketingSettings{} - obj.ConfirmationFrom = nil + obj := &InvoiceSummary{} + var expected InvoiceSummaryCurrency + obj.Currency = expected // Act & Assert - assert.Nil(t, obj.GetConfirmationFrom(), "getter should return nil when property is nil") + assert.Equal(t, expected, obj.GetCurrency(), "getter should return the property value") }) - t.Run("GetConfirmationFrom_NilReceiver", func(t *testing.T) { + t.Run("GetCurrency_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *MarketingSettings + var obj *InvoiceSummary // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetConfirmationFrom() // Should return zero value + _ = obj.GetCurrency() // Should return zero value }) - t.Run("GetConfirmationSubject", func(t *testing.T) { + t.Run("GetPeriod", func(t *testing.T) { t.Parallel() // Arrange - obj := &MarketingSettings{} - var expected *string - obj.ConfirmationSubject = expected + obj := &InvoiceSummary{} + var expected *InvoiceSummaryPeriod + obj.Period = expected // Act & Assert - assert.Equal(t, expected, obj.GetConfirmationSubject(), "getter should return the property value") + assert.Equal(t, expected, obj.GetPeriod(), "getter should return the property value") }) - t.Run("GetConfirmationSubject_NilValue", func(t *testing.T) { + t.Run("GetPeriod_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &MarketingSettings{} - obj.ConfirmationSubject = nil + obj := &InvoiceSummary{} + obj.Period = nil // Act & Assert - assert.Nil(t, obj.GetConfirmationSubject(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetPeriod(), "getter should return nil when property is nil") }) - t.Run("GetConfirmationSubject_NilReceiver", func(t *testing.T) { + t.Run("GetPeriod_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *MarketingSettings + var obj *InvoiceSummary // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetConfirmationSubject() // Should return zero value + _ = obj.GetPeriod() // Should return zero value }) - t.Run("GetConfirmationHTML", func(t *testing.T) { + t.Run("GetSubtotal", func(t *testing.T) { t.Parallel() // Arrange - obj := &MarketingSettings{} - var expected *string - obj.ConfirmationHTML = expected + obj := &InvoiceSummary{} + var expected int64 + obj.Subtotal = expected // Act & Assert - assert.Equal(t, expected, obj.GetConfirmationHTML(), "getter should return the property value") + assert.Equal(t, expected, obj.GetSubtotal(), "getter should return the property value") }) - t.Run("GetConfirmationHTML_NilValue", func(t *testing.T) { + t.Run("GetSubtotal_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *InvoiceSummary + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetSubtotal() // Should return zero value + }) + + t.Run("GetDiscount", func(t *testing.T) { t.Parallel() // Arrange - obj := &MarketingSettings{} - obj.ConfirmationHTML = nil + obj := &InvoiceSummary{} + var expected int64 + obj.Discount = expected // Act & Assert - assert.Nil(t, obj.GetConfirmationHTML(), "getter should return nil when property is nil") + assert.Equal(t, expected, obj.GetDiscount(), "getter should return the property value") }) - t.Run("GetConfirmationHTML_NilReceiver", func(t *testing.T) { + t.Run("GetDiscount_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *MarketingSettings + var obj *InvoiceSummary // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetConfirmationHTML() // Should return zero value + _ = obj.GetDiscount() // Should return zero value }) - t.Run("GetConfirmationText", func(t *testing.T) { + t.Run("GetCredit", func(t *testing.T) { t.Parallel() // Arrange - obj := &MarketingSettings{} + obj := &InvoiceSummary{} + var expected int64 + obj.Credit = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetCredit(), "getter should return the property value") + }) + + t.Run("GetCredit_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *InvoiceSummary + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetCredit() // Should return zero value + }) + + t.Run("GetTax", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &InvoiceSummary{} + var expected int64 + obj.Tax = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetTax(), "getter should return the property value") + }) + + t.Run("GetTax_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *InvoiceSummary + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetTax() // Should return zero value + }) + + t.Run("GetTotal", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &InvoiceSummary{} + var expected int64 + obj.Total = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetTotal(), "getter should return the property value") + }) + + t.Run("GetTotal_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *InvoiceSummary + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetTotal() // Should return zero value + }) + + t.Run("GetAmountPaid", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &InvoiceSummary{} + var expected int64 + obj.AmountPaid = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetAmountPaid(), "getter should return the property value") + }) + + t.Run("GetAmountPaid_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *InvoiceSummary + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetAmountPaid() // Should return zero value + }) + + t.Run("GetAmountDue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &InvoiceSummary{} + var expected int64 + obj.AmountDue = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetAmountDue(), "getter should return the property value") + }) + + t.Run("GetAmountDue_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *InvoiceSummary + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetAmountDue() // Should return zero value + }) + + t.Run("GetCollectionMethod", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &InvoiceSummary{} + var expected InvoiceSummaryCollectionMethod + obj.CollectionMethod = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetCollectionMethod(), "getter should return the property value") + }) + + t.Run("GetCollectionMethod_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *InvoiceSummary + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetCollectionMethod() // Should return zero value + }) + + t.Run("GetDueAt", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &InvoiceSummary{} + var expected *time.Time + obj.DueAt = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetDueAt(), "getter should return the property value") + }) + + t.Run("GetDueAt_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &InvoiceSummary{} + obj.DueAt = nil + + // Act & Assert + assert.Nil(t, obj.GetDueAt(), "getter should return nil when property is nil") + }) + + t.Run("GetDueAt_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *InvoiceSummary + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetDueAt() // Should return zero value + }) + + t.Run("GetFinalizedAt", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &InvoiceSummary{} + var expected *time.Time + obj.FinalizedAt = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetFinalizedAt(), "getter should return the property value") + }) + + t.Run("GetFinalizedAt_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &InvoiceSummary{} + obj.FinalizedAt = nil + + // Act & Assert + assert.Nil(t, obj.GetFinalizedAt(), "getter should return nil when property is nil") + }) + + t.Run("GetFinalizedAt_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *InvoiceSummary + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetFinalizedAt() // Should return zero value + }) + + t.Run("GetPaidAt", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &InvoiceSummary{} + var expected *time.Time + obj.PaidAt = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetPaidAt(), "getter should return the property value") + }) + + t.Run("GetPaidAt_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &InvoiceSummary{} + obj.PaidAt = nil + + // Act & Assert + assert.Nil(t, obj.GetPaidAt(), "getter should return nil when property is nil") + }) + + t.Run("GetPaidAt_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *InvoiceSummary + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetPaidAt() // Should return zero value + }) + + t.Run("GetVoidedAt", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &InvoiceSummary{} + var expected *time.Time + obj.VoidedAt = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetVoidedAt(), "getter should return the property value") + }) + + t.Run("GetVoidedAt_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &InvoiceSummary{} + obj.VoidedAt = nil + + // Act & Assert + assert.Nil(t, obj.GetVoidedAt(), "getter should return nil when property is nil") + }) + + t.Run("GetVoidedAt_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *InvoiceSummary + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetVoidedAt() // Should return zero value + }) + + t.Run("GetHostedURL", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &InvoiceSummary{} var expected *string - obj.ConfirmationText = expected + obj.HostedURL = expected // Act & Assert - assert.Equal(t, expected, obj.GetConfirmationText(), "getter should return the property value") + assert.Equal(t, expected, obj.GetHostedURL(), "getter should return the property value") }) - t.Run("GetConfirmationText_NilValue", func(t *testing.T) { + t.Run("GetHostedURL_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &MarketingSettings{} - obj.ConfirmationText = nil + obj := &InvoiceSummary{} + obj.HostedURL = nil // Act & Assert - assert.Nil(t, obj.GetConfirmationText(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetHostedURL(), "getter should return nil when property is nil") }) - t.Run("GetConfirmationText_NilReceiver", func(t *testing.T) { + t.Run("GetHostedURL_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *MarketingSettings + var obj *InvoiceSummary // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetConfirmationText() // Should return zero value + _ = obj.GetHostedURL() // Should return zero value }) - t.Run("GetConfirmedRedirectURL", func(t *testing.T) { + t.Run("GetPdfURL", func(t *testing.T) { t.Parallel() // Arrange - obj := &MarketingSettings{} + obj := &InvoiceSummary{} var expected *string - obj.ConfirmedRedirectURL = expected + obj.PdfURL = expected // Act & Assert - assert.Equal(t, expected, obj.GetConfirmedRedirectURL(), "getter should return the property value") + assert.Equal(t, expected, obj.GetPdfURL(), "getter should return the property value") }) - t.Run("GetConfirmedRedirectURL_NilValue", func(t *testing.T) { + t.Run("GetPdfURL_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &MarketingSettings{} - obj.ConfirmedRedirectURL = nil + obj := &InvoiceSummary{} + obj.PdfURL = nil // Act & Assert - assert.Nil(t, obj.GetConfirmedRedirectURL(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetPdfURL(), "getter should return nil when property is nil") }) - t.Run("GetConfirmedRedirectURL_NilReceiver", func(t *testing.T) { + t.Run("GetPdfURL_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *MarketingSettings + var obj *InvoiceSummary // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetConfirmedRedirectURL() // Should return zero value + _ = obj.GetPdfURL() // Should return zero value }) } -func TestSettersMarkExplicitMarketingSettings(t *testing.T) { +func TestSettersMarkExplicitInvoiceSummary(t *testing.T) { t.Run("SetObject_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &MarketingSettings{} - var fernTestValueObject MarketingSettingsObject + obj := &InvoiceSummary{} + var fernTestValueObject InvoiceSummaryObject // Act obj.SetObject(fernTestValueObject) @@ -61470,14 +60562,14 @@ func TestSettersMarkExplicitMarketingSettings(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetDisplayName_MarksExplicit", func(t *testing.T) { + t.Run("SetID_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &MarketingSettings{} - var fernTestValueDisplayName *string + obj := &InvoiceSummary{} + var fernTestValueID string // Act - obj.SetDisplayName(fernTestValueDisplayName) + obj.SetID(fernTestValueID) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -61501,14 +60593,14 @@ func TestSettersMarkExplicitMarketingSettings(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetMailingAddress_MarksExplicit", func(t *testing.T) { + t.Run("SetNumber_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &MarketingSettings{} - var fernTestValueMailingAddress *string + obj := &InvoiceSummary{} + var fernTestValueNumber *string // Act - obj.SetMailingAddress(fernTestValueMailingAddress) + obj.SetNumber(fernTestValueNumber) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -61532,14 +60624,14 @@ func TestSettersMarkExplicitMarketingSettings(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetDoubleOptInDefault_MarksExplicit", func(t *testing.T) { + t.Run("SetKind_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &MarketingSettings{} - var fernTestValueDoubleOptInDefault bool + obj := &InvoiceSummary{} + var fernTestValueKind InvoiceSummaryKind // Act - obj.SetDoubleOptInDefault(fernTestValueDoubleOptInDefault) + obj.SetKind(fernTestValueKind) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -61563,14 +60655,14 @@ func TestSettersMarkExplicitMarketingSettings(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetConfirmationFrom_MarksExplicit", func(t *testing.T) { + t.Run("SetStatus_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &MarketingSettings{} - var fernTestValueConfirmationFrom *string + obj := &InvoiceSummary{} + var fernTestValueStatus InvoiceSummaryStatus // Act - obj.SetConfirmationFrom(fernTestValueConfirmationFrom) + obj.SetStatus(fernTestValueStatus) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -61594,14 +60686,14 @@ func TestSettersMarkExplicitMarketingSettings(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetConfirmationSubject_MarksExplicit", func(t *testing.T) { + t.Run("SetCurrency_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &MarketingSettings{} - var fernTestValueConfirmationSubject *string + obj := &InvoiceSummary{} + var fernTestValueCurrency InvoiceSummaryCurrency // Act - obj.SetConfirmationSubject(fernTestValueConfirmationSubject) + obj.SetCurrency(fernTestValueCurrency) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -61625,14 +60717,14 @@ func TestSettersMarkExplicitMarketingSettings(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetConfirmationHTML_MarksExplicit", func(t *testing.T) { + t.Run("SetPeriod_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &MarketingSettings{} - var fernTestValueConfirmationHTML *string + obj := &InvoiceSummary{} + var fernTestValuePeriod *InvoiceSummaryPeriod // Act - obj.SetConfirmationHTML(fernTestValueConfirmationHTML) + obj.SetPeriod(fernTestValuePeriod) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -61656,14 +60748,14 @@ func TestSettersMarkExplicitMarketingSettings(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetConfirmationText_MarksExplicit", func(t *testing.T) { + t.Run("SetSubtotal_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &MarketingSettings{} - var fernTestValueConfirmationText *string + obj := &InvoiceSummary{} + var fernTestValueSubtotal int64 // Act - obj.SetConfirmationText(fernTestValueConfirmationText) + obj.SetSubtotal(fernTestValueSubtotal) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -61687,14 +60779,14 @@ func TestSettersMarkExplicitMarketingSettings(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetConfirmedRedirectURL_MarksExplicit", func(t *testing.T) { + t.Run("SetDiscount_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &MarketingSettings{} - var fernTestValueConfirmedRedirectURL *string + obj := &InvoiceSummary{} + var fernTestValueDiscount int64 // Act - obj.SetConfirmedRedirectURL(fernTestValueConfirmedRedirectURL) + obj.SetDiscount(fernTestValueDiscount) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -61718,147 +60810,107 @@ func TestSettersMarkExplicitMarketingSettings(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) -} + t.Run("SetCredit_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &InvoiceSummary{} + var fernTestValueCredit int64 -func TestSettersPreferenceLinks(t *testing.T) { - t.Run("SetObject", func(t *testing.T) { - obj := &PreferenceLinks{} - var fernTestValueObject PreferenceLinksObject - obj.SetObject(fernTestValueObject) - assert.Equal(t, fernTestValueObject, obj.Object) - assert.NotNil(t, obj.explicitFields) - }) + // Act + obj.SetCredit(fernTestValueCredit) - t.Run("SetContactID", func(t *testing.T) { - obj := &PreferenceLinks{} - var fernTestValueContactID string - obj.SetContactID(fernTestValueContactID) - assert.Equal(t, fernTestValueContactID, obj.ContactID) - assert.NotNil(t, obj.explicitFields) - }) + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") - t.Run("SetPreferencesURL", func(t *testing.T) { - obj := &PreferenceLinks{} - var fernTestValuePreferencesURL string - obj.SetPreferencesURL(fernTestValuePreferencesURL) - assert.Equal(t, fernTestValuePreferencesURL, obj.PreferencesURL) - assert.NotNil(t, obj.explicitFields) - }) + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } - t.Run("SetUnsubscribeURL", func(t *testing.T) { - obj := &PreferenceLinks{} - var fernTestValueUnsubscribeURL string - obj.SetUnsubscribeURL(fernTestValueUnsubscribeURL) - assert.Equal(t, fernTestValueUnsubscribeURL, obj.UnsubscribeURL) - assert.NotNil(t, obj.explicitFields) + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip }) -} - -func TestGettersPreferenceLinks(t *testing.T) { - t.Run("GetObject", func(t *testing.T) { + t.Run("SetTax_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &PreferenceLinks{} - var expected PreferenceLinksObject - obj.Object = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetObject(), "getter should return the property value") - }) + obj := &InvoiceSummary{} + var fernTestValueTax int64 - t.Run("GetObject_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *PreferenceLinks - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetObject() // Should return zero value - }) + // Act + obj.SetTax(fernTestValueTax) - t.Run("GetContactID", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &PreferenceLinks{} - var expected string - obj.ContactID = expected + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") - // Act & Assert - assert.Equal(t, expected, obj.GetContactID(), "getter should return the property value") - }) + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } - t.Run("GetContactID_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *PreferenceLinks - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetContactID() // Should return zero value + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("GetPreferencesURL", func(t *testing.T) { + t.Run("SetTotal_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &PreferenceLinks{} - var expected string - obj.PreferencesURL = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetPreferencesURL(), "getter should return the property value") - }) + obj := &InvoiceSummary{} + var fernTestValueTotal int64 - t.Run("GetPreferencesURL_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *PreferenceLinks - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetPreferencesURL() // Should return zero value - }) + // Act + obj.SetTotal(fernTestValueTotal) - t.Run("GetUnsubscribeURL", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &PreferenceLinks{} - var expected string - obj.UnsubscribeURL = expected + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") - // Act & Assert - assert.Equal(t, expected, obj.GetUnsubscribeURL(), "getter should return the property value") - }) + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } - t.Run("GetUnsubscribeURL_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *PreferenceLinks - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetUnsubscribeURL() // Should return zero value + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip }) -} - -func TestSettersMarkExplicitPreferenceLinks(t *testing.T) { - t.Run("SetObject_MarksExplicit", func(t *testing.T) { + t.Run("SetAmountPaid_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &PreferenceLinks{} - var fernTestValueObject PreferenceLinksObject + obj := &InvoiceSummary{} + var fernTestValueAmountPaid int64 // Act - obj.SetObject(fernTestValueObject) + obj.SetAmountPaid(fernTestValueAmountPaid) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -61882,14 +60934,14 @@ func TestSettersMarkExplicitPreferenceLinks(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetContactID_MarksExplicit", func(t *testing.T) { + t.Run("SetAmountDue_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &PreferenceLinks{} - var fernTestValueContactID string + obj := &InvoiceSummary{} + var fernTestValueAmountDue int64 // Act - obj.SetContactID(fernTestValueContactID) + obj.SetAmountDue(fernTestValueAmountDue) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -61913,14 +60965,14 @@ func TestSettersMarkExplicitPreferenceLinks(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetPreferencesURL_MarksExplicit", func(t *testing.T) { + t.Run("SetCollectionMethod_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &PreferenceLinks{} - var fernTestValuePreferencesURL string + obj := &InvoiceSummary{} + var fernTestValueCollectionMethod InvoiceSummaryCollectionMethod // Act - obj.SetPreferencesURL(fernTestValuePreferencesURL) + obj.SetCollectionMethod(fernTestValueCollectionMethod) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -61944,14 +60996,14 @@ func TestSettersMarkExplicitPreferenceLinks(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetUnsubscribeURL_MarksExplicit", func(t *testing.T) { + t.Run("SetDueAt_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &PreferenceLinks{} - var fernTestValueUnsubscribeURL string + obj := &InvoiceSummary{} + var fernTestValueDueAt *time.Time // Act - obj.SetUnsubscribeURL(fernTestValueUnsubscribeURL) + obj.SetDueAt(fernTestValueDueAt) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -61975,955 +61027,627 @@ func TestSettersMarkExplicitPreferenceLinks(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) -} - -func TestSettersReceivedEmail(t *testing.T) { - t.Run("SetObject", func(t *testing.T) { - obj := &ReceivedEmail{} - var fernTestValueObject ReceivedEmailObject - obj.SetObject(fernTestValueObject) - assert.Equal(t, fernTestValueObject, obj.Object) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetID", func(t *testing.T) { - obj := &ReceivedEmail{} - var fernTestValueID string - obj.SetID(fernTestValueID) - assert.Equal(t, fernTestValueID, obj.ID) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetStatus", func(t *testing.T) { - obj := &ReceivedEmail{} - var fernTestValueStatus ReceivedEmailStatus - obj.SetStatus(fernTestValueStatus) - assert.Equal(t, fernTestValueStatus, obj.Status) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetBlockedReason", func(t *testing.T) { - obj := &ReceivedEmail{} - var fernTestValueBlockedReason *ReceivedEmailBlockedReason - obj.SetBlockedReason(fernTestValueBlockedReason) - assert.Equal(t, fernTestValueBlockedReason, obj.BlockedReason) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetMailFrom", func(t *testing.T) { - obj := &ReceivedEmail{} - var fernTestValueMailFrom string - obj.SetMailFrom(fernTestValueMailFrom) - assert.Equal(t, fernTestValueMailFrom, obj.MailFrom) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetRecipients", func(t *testing.T) { - obj := &ReceivedEmail{} - var fernTestValueRecipients []string - obj.SetRecipients(fernTestValueRecipients) - assert.Equal(t, fernTestValueRecipients, obj.Recipients) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetFrom", func(t *testing.T) { - obj := &ReceivedEmail{} - var fernTestValueFrom *string - obj.SetFrom(fernTestValueFrom) - assert.Equal(t, fernTestValueFrom, obj.From) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetTo", func(t *testing.T) { - obj := &ReceivedEmail{} - var fernTestValueTo []string - obj.SetTo(fernTestValueTo) - assert.Equal(t, fernTestValueTo, obj.To) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetCc", func(t *testing.T) { - obj := &ReceivedEmail{} - var fernTestValueCc []string - obj.SetCc(fernTestValueCc) - assert.Equal(t, fernTestValueCc, obj.Cc) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetSubject", func(t *testing.T) { - obj := &ReceivedEmail{} - var fernTestValueSubject *string - obj.SetSubject(fernTestValueSubject) - assert.Equal(t, fernTestValueSubject, obj.Subject) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetMessageID", func(t *testing.T) { - obj := &ReceivedEmail{} - var fernTestValueMessageID *string - obj.SetMessageID(fernTestValueMessageID) - assert.Equal(t, fernTestValueMessageID, obj.MessageID) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetAttachments", func(t *testing.T) { - obj := &ReceivedEmail{} - var fernTestValueAttachments []*ReceivedEmailAttachment - obj.SetAttachments(fernTestValueAttachments) - assert.Equal(t, fernTestValueAttachments, obj.Attachments) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetSize", func(t *testing.T) { - obj := &ReceivedEmail{} - var fernTestValueSize int64 - obj.SetSize(fernTestValueSize) - assert.Equal(t, fernTestValueSize, obj.Size) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetSpam", func(t *testing.T) { - obj := &ReceivedEmail{} - var fernTestValueSpam bool - obj.SetSpam(fernTestValueSpam) - assert.Equal(t, fernTestValueSpam, obj.Spam) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetVerdicts", func(t *testing.T) { - obj := &ReceivedEmail{} - var fernTestValueVerdicts *ReceivedEmailVerdicts - obj.SetVerdicts(fernTestValueVerdicts) - assert.Equal(t, fernTestValueVerdicts, obj.Verdicts) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetSandbox", func(t *testing.T) { - obj := &ReceivedEmail{} - var fernTestValueSandbox bool - obj.SetSandbox(fernTestValueSandbox) - assert.Equal(t, fernTestValueSandbox, obj.Sandbox) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetReceivedAt", func(t *testing.T) { - obj := &ReceivedEmail{} - var fernTestValueReceivedAt time.Time - obj.SetReceivedAt(fernTestValueReceivedAt) - assert.Equal(t, fernTestValueReceivedAt, obj.ReceivedAt) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetReplyTo", func(t *testing.T) { - obj := &ReceivedEmail{} - var fernTestValueReplyTo []string - obj.SetReplyTo(fernTestValueReplyTo) - assert.Equal(t, fernTestValueReplyTo, obj.ReplyTo) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetInReplyTo", func(t *testing.T) { - obj := &ReceivedEmail{} - var fernTestValueInReplyTo *string - obj.SetInReplyTo(fernTestValueInReplyTo) - assert.Equal(t, fernTestValueInReplyTo, obj.InReplyTo) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetReferences", func(t *testing.T) { - obj := &ReceivedEmail{} - var fernTestValueReferences []string - obj.SetReferences(fernTestValueReferences) - assert.Equal(t, fernTestValueReferences, obj.References) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetSentAt", func(t *testing.T) { - obj := &ReceivedEmail{} - var fernTestValueSentAt *time.Time - obj.SetSentAt(fernTestValueSentAt) - assert.Equal(t, fernTestValueSentAt, obj.SentAt) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetHeaders", func(t *testing.T) { - obj := &ReceivedEmail{} - var fernTestValueHeaders []*ReceivedEmailHeadersItem - obj.SetHeaders(fernTestValueHeaders) - assert.Equal(t, fernTestValueHeaders, obj.Headers) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetText", func(t *testing.T) { - obj := &ReceivedEmail{} - var fernTestValueText *string - obj.SetText(fernTestValueText) - assert.Equal(t, fernTestValueText, obj.Text) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetHTML", func(t *testing.T) { - obj := &ReceivedEmail{} - var fernTestValueHTML *string - obj.SetHTML(fernTestValueHTML) - assert.Equal(t, fernTestValueHTML, obj.HTML) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetTruncated", func(t *testing.T) { - obj := &ReceivedEmail{} - var fernTestValueTruncated bool - obj.SetTruncated(fernTestValueTruncated) - assert.Equal(t, fernTestValueTruncated, obj.Truncated) - assert.NotNil(t, obj.explicitFields) - }) - -} - -func TestGettersReceivedEmail(t *testing.T) { - t.Run("GetObject", func(t *testing.T) { + t.Run("SetFinalizedAt_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &ReceivedEmail{} - var expected ReceivedEmailObject - obj.Object = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetObject(), "getter should return the property value") - }) + obj := &InvoiceSummary{} + var fernTestValueFinalizedAt *time.Time - t.Run("GetObject_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *ReceivedEmail - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetObject() // Should return zero value - }) + // Act + obj.SetFinalizedAt(fernTestValueFinalizedAt) - t.Run("GetID", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &ReceivedEmail{} - var expected string - obj.ID = expected + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") - // Act & Assert - assert.Equal(t, expected, obj.GetID(), "getter should return the property value") - }) + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } - t.Run("GetID_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *ReceivedEmail - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetID() // Should return zero value + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("GetStatus", func(t *testing.T) { + t.Run("SetPaidAt_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &ReceivedEmail{} - var expected ReceivedEmailStatus - obj.Status = expected + obj := &InvoiceSummary{} + var fernTestValuePaidAt *time.Time - // Act & Assert - assert.Equal(t, expected, obj.GetStatus(), "getter should return the property value") - }) + // Act + obj.SetPaidAt(fernTestValuePaidAt) - t.Run("GetStatus_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *ReceivedEmail - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetStatus() // Should return zero value - }) + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") - t.Run("GetBlockedReason", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &ReceivedEmail{} - var expected *ReceivedEmailBlockedReason - obj.BlockedReason = expected + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } - // Act & Assert - assert.Equal(t, expected, obj.GetBlockedReason(), "getter should return the property value") + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("GetBlockedReason_NilValue", func(t *testing.T) { + t.Run("SetVoidedAt_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &ReceivedEmail{} - obj.BlockedReason = nil + obj := &InvoiceSummary{} + var fernTestValueVoidedAt *time.Time - // Act & Assert - assert.Nil(t, obj.GetBlockedReason(), "getter should return nil when property is nil") - }) + // Act + obj.SetVoidedAt(fernTestValueVoidedAt) - t.Run("GetBlockedReason_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *ReceivedEmail - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetBlockedReason() // Should return zero value + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("GetMailFrom", func(t *testing.T) { + t.Run("SetHostedURL_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &ReceivedEmail{} - var expected string - obj.MailFrom = expected + obj := &InvoiceSummary{} + var fernTestValueHostedURL *string - // Act & Assert - assert.Equal(t, expected, obj.GetMailFrom(), "getter should return the property value") - }) + // Act + obj.SetHostedURL(fernTestValueHostedURL) - t.Run("GetMailFrom_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *ReceivedEmail - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetMailFrom() // Should return zero value - }) + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") - t.Run("GetRecipients", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &ReceivedEmail{} - var expected []string - obj.Recipients = expected + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } - // Act & Assert - assert.Equal(t, expected, obj.GetRecipients(), "getter should return the property value") + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("GetRecipients_NilValue", func(t *testing.T) { + t.Run("SetPdfURL_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &ReceivedEmail{} - obj.Recipients = nil + obj := &InvoiceSummary{} + var fernTestValuePdfURL *string - // Act & Assert - assert.Nil(t, obj.GetRecipients(), "getter should return nil when property is nil") - }) + // Act + obj.SetPdfURL(fernTestValuePdfURL) - t.Run("GetRecipients_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *ReceivedEmail - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetRecipients() // Should return zero value - }) + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") - t.Run("GetFrom", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &ReceivedEmail{} - var expected *string - obj.From = expected + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } - // Act & Assert - assert.Equal(t, expected, obj.GetFrom(), "getter should return the property value") + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("GetFrom_NilValue", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &ReceivedEmail{} - obj.From = nil +} - // Act & Assert - assert.Nil(t, obj.GetFrom(), "getter should return nil when property is nil") +func TestSettersInvoiceSummaryPeriod(t *testing.T) { + t.Run("SetStart", func(t *testing.T) { + obj := &InvoiceSummaryPeriod{} + var fernTestValueStart time.Time + obj.SetStart(fernTestValueStart) + assert.Equal(t, fernTestValueStart, obj.Start) + assert.NotNil(t, obj.explicitFields) }) - t.Run("GetFrom_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *ReceivedEmail - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetFrom() // Should return zero value + t.Run("SetEnd", func(t *testing.T) { + obj := &InvoiceSummaryPeriod{} + var fernTestValueEnd time.Time + obj.SetEnd(fernTestValueEnd) + assert.Equal(t, fernTestValueEnd, obj.End) + assert.NotNil(t, obj.explicitFields) }) - t.Run("GetTo", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &ReceivedEmail{} - var expected []string - obj.To = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetTo(), "getter should return the property value") - }) +} - t.Run("GetTo_NilValue", func(t *testing.T) { +func TestGettersInvoiceSummaryPeriod(t *testing.T) { + t.Run("GetStart", func(t *testing.T) { t.Parallel() // Arrange - obj := &ReceivedEmail{} - obj.To = nil + obj := &InvoiceSummaryPeriod{} + var expected time.Time + obj.Start = expected // Act & Assert - assert.Nil(t, obj.GetTo(), "getter should return nil when property is nil") + assert.Equal(t, expected, obj.GetStart(), "getter should return the property value") }) - t.Run("GetTo_NilReceiver", func(t *testing.T) { + t.Run("GetStart_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *ReceivedEmail + var obj *InvoiceSummaryPeriod // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetTo() // Should return zero value - }) - - t.Run("GetCc", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &ReceivedEmail{} - var expected []string - obj.Cc = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetCc(), "getter should return the property value") + _ = obj.GetStart() // Should return zero value }) - t.Run("GetCc_NilValue", func(t *testing.T) { + t.Run("GetEnd", func(t *testing.T) { t.Parallel() // Arrange - obj := &ReceivedEmail{} - obj.Cc = nil + obj := &InvoiceSummaryPeriod{} + var expected time.Time + obj.End = expected // Act & Assert - assert.Nil(t, obj.GetCc(), "getter should return nil when property is nil") + assert.Equal(t, expected, obj.GetEnd(), "getter should return the property value") }) - t.Run("GetCc_NilReceiver", func(t *testing.T) { + t.Run("GetEnd_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *ReceivedEmail + var obj *InvoiceSummaryPeriod // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetCc() // Should return zero value + _ = obj.GetEnd() // Should return zero value }) - t.Run("GetSubject", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &ReceivedEmail{} - var expected *string - obj.Subject = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetSubject(), "getter should return the property value") - }) +} - t.Run("GetSubject_NilValue", func(t *testing.T) { +func TestSettersMarkExplicitInvoiceSummaryPeriod(t *testing.T) { + t.Run("SetStart_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &ReceivedEmail{} - obj.Subject = nil + obj := &InvoiceSummaryPeriod{} + var fernTestValueStart time.Time - // Act & Assert - assert.Nil(t, obj.GetSubject(), "getter should return nil when property is nil") - }) + // Act + obj.SetStart(fernTestValueStart) - t.Run("GetSubject_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *ReceivedEmail - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetSubject() // Should return zero value - }) + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") - t.Run("GetMessageID", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &ReceivedEmail{} - var expected *string - obj.MessageID = expected + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } - // Act & Assert - assert.Equal(t, expected, obj.GetMessageID(), "getter should return the property value") + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("GetMessageID_NilValue", func(t *testing.T) { + t.Run("SetEnd_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &ReceivedEmail{} - obj.MessageID = nil + obj := &InvoiceSummaryPeriod{} + var fernTestValueEnd time.Time - // Act & Assert - assert.Nil(t, obj.GetMessageID(), "getter should return nil when property is nil") - }) + // Act + obj.SetEnd(fernTestValueEnd) - t.Run("GetMessageID_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *ReceivedEmail - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetMessageID() // Should return zero value - }) + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") - t.Run("GetAttachments", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &ReceivedEmail{} - var expected []*ReceivedEmailAttachment - obj.Attachments = expected + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } - // Act & Assert - assert.Equal(t, expected, obj.GetAttachments(), "getter should return the property value") + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("GetAttachments_NilValue", func(t *testing.T) { +} + +func TestGettersListSuppressionsRequestScope(t *testing.T) { + t.Run("GetListSuppressionsRequestScopeZero", func(t *testing.T) { t.Parallel() // Arrange - obj := &ReceivedEmail{} - obj.Attachments = nil + obj := &ListSuppressionsRequestScope{} + var expected ListSuppressionsRequestScopeZero + obj.ListSuppressionsRequestScopeZero = expected // Act & Assert - assert.Nil(t, obj.GetAttachments(), "getter should return nil when property is nil") + assert.Equal(t, expected, obj.GetListSuppressionsRequestScopeZero(), "getter should return the property value") }) - t.Run("GetAttachments_NilReceiver", func(t *testing.T) { + t.Run("GetListSuppressionsRequestScopeZero_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *ReceivedEmail + var obj *ListSuppressionsRequestScope // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetAttachments() // Should return zero value + _ = obj.GetListSuppressionsRequestScopeZero() // Should return zero value }) - t.Run("GetSize", func(t *testing.T) { + t.Run("GetListSuppressionsRequestScopeOne", func(t *testing.T) { t.Parallel() // Arrange - obj := &ReceivedEmail{} - var expected int64 - obj.Size = expected + obj := &ListSuppressionsRequestScope{} + var expected ListSuppressionsRequestScopeOne + obj.ListSuppressionsRequestScopeOne = expected // Act & Assert - assert.Equal(t, expected, obj.GetSize(), "getter should return the property value") + assert.Equal(t, expected, obj.GetListSuppressionsRequestScopeOne(), "getter should return the property value") }) - t.Run("GetSize_NilReceiver", func(t *testing.T) { + t.Run("GetListSuppressionsRequestScopeOne_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *ReceivedEmail + var obj *ListSuppressionsRequestScope // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetSize() // Should return zero value + _ = obj.GetListSuppressionsRequestScopeOne() // Should return zero value }) - t.Run("GetSpam", func(t *testing.T) { + t.Run("GetString", func(t *testing.T) { t.Parallel() // Arrange - obj := &ReceivedEmail{} - var expected bool - obj.Spam = expected + obj := &ListSuppressionsRequestScope{} + var expected string + obj.String = expected // Act & Assert - assert.Equal(t, expected, obj.GetSpam(), "getter should return the property value") + assert.Equal(t, expected, obj.GetString(), "getter should return the property value") }) - t.Run("GetSpam_NilReceiver", func(t *testing.T) { + t.Run("GetString_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *ReceivedEmail + var obj *ListSuppressionsRequestScope // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetSpam() // Should return zero value + _ = obj.GetString() // Should return zero value }) - t.Run("GetVerdicts", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &ReceivedEmail{} - var expected *ReceivedEmailVerdicts - obj.Verdicts = expected +} - // Act & Assert - assert.Equal(t, expected, obj.GetVerdicts(), "getter should return the property value") +func TestSettersLogDrainAttempt(t *testing.T) { + t.Run("SetObject", func(t *testing.T) { + obj := &LogDrainAttempt{} + var fernTestValueObject LogDrainAttemptObject + obj.SetObject(fernTestValueObject) + assert.Equal(t, fernTestValueObject, obj.Object) + assert.NotNil(t, obj.explicitFields) }) - t.Run("GetVerdicts_NilValue", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &ReceivedEmail{} - obj.Verdicts = nil - - // Act & Assert - assert.Nil(t, obj.GetVerdicts(), "getter should return nil when property is nil") + t.Run("SetID", func(t *testing.T) { + obj := &LogDrainAttempt{} + var fernTestValueID string + obj.SetID(fernTestValueID) + assert.Equal(t, fernTestValueID, obj.ID) + assert.NotNil(t, obj.explicitFields) }) - t.Run("GetVerdicts_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *ReceivedEmail - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetVerdicts() // Should return zero value + t.Run("SetAttemptedAt", func(t *testing.T) { + obj := &LogDrainAttempt{} + var fernTestValueAttemptedAt time.Time + obj.SetAttemptedAt(fernTestValueAttemptedAt) + assert.Equal(t, fernTestValueAttemptedAt, obj.AttemptedAt) + assert.NotNil(t, obj.explicitFields) }) - t.Run("GetSandbox", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &ReceivedEmail{} - var expected bool - obj.Sandbox = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetSandbox(), "getter should return the property value") + t.Run("SetStatusCode", func(t *testing.T) { + obj := &LogDrainAttempt{} + var fernTestValueStatusCode *int64 + obj.SetStatusCode(fernTestValueStatusCode) + assert.Equal(t, fernTestValueStatusCode, obj.StatusCode) + assert.NotNil(t, obj.explicitFields) }) - t.Run("GetSandbox_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *ReceivedEmail - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetSandbox() // Should return zero value + t.Run("SetDurationMs", func(t *testing.T) { + obj := &LogDrainAttempt{} + var fernTestValueDurationMs int64 + obj.SetDurationMs(fernTestValueDurationMs) + assert.Equal(t, fernTestValueDurationMs, obj.DurationMs) + assert.NotNil(t, obj.explicitFields) }) - t.Run("GetReceivedAt", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &ReceivedEmail{} - var expected time.Time - obj.ReceivedAt = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetReceivedAt(), "getter should return the property value") + t.Run("SetError", func(t *testing.T) { + obj := &LogDrainAttempt{} + var fernTestValueError *string + obj.SetError(fernTestValueError) + assert.Equal(t, fernTestValueError, obj.Error) + assert.NotNil(t, obj.explicitFields) }) - t.Run("GetReceivedAt_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *ReceivedEmail - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetReceivedAt() // Should return zero value + t.Run("SetResponseExcerpt", func(t *testing.T) { + obj := &LogDrainAttempt{} + var fernTestValueResponseExcerpt *string + obj.SetResponseExcerpt(fernTestValueResponseExcerpt) + assert.Equal(t, fernTestValueResponseExcerpt, obj.ResponseExcerpt) + assert.NotNil(t, obj.explicitFields) }) - t.Run("GetReplyTo", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &ReceivedEmail{} - var expected []string - obj.ReplyTo = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetReplyTo(), "getter should return the property value") - }) +} - t.Run("GetReplyTo_NilValue", func(t *testing.T) { +func TestGettersLogDrainAttempt(t *testing.T) { + t.Run("GetObject", func(t *testing.T) { t.Parallel() // Arrange - obj := &ReceivedEmail{} - obj.ReplyTo = nil + obj := &LogDrainAttempt{} + var expected LogDrainAttemptObject + obj.Object = expected // Act & Assert - assert.Nil(t, obj.GetReplyTo(), "getter should return nil when property is nil") + assert.Equal(t, expected, obj.GetObject(), "getter should return the property value") }) - t.Run("GetReplyTo_NilReceiver", func(t *testing.T) { + t.Run("GetObject_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *ReceivedEmail + var obj *LogDrainAttempt // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetReplyTo() // Should return zero value - }) - - t.Run("GetInReplyTo", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &ReceivedEmail{} - var expected *string - obj.InReplyTo = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetInReplyTo(), "getter should return the property value") + _ = obj.GetObject() // Should return zero value }) - t.Run("GetInReplyTo_NilValue", func(t *testing.T) { + t.Run("GetID", func(t *testing.T) { t.Parallel() // Arrange - obj := &ReceivedEmail{} - obj.InReplyTo = nil + obj := &LogDrainAttempt{} + var expected string + obj.ID = expected // Act & Assert - assert.Nil(t, obj.GetInReplyTo(), "getter should return nil when property is nil") + assert.Equal(t, expected, obj.GetID(), "getter should return the property value") }) - t.Run("GetInReplyTo_NilReceiver", func(t *testing.T) { + t.Run("GetID_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *ReceivedEmail + var obj *LogDrainAttempt // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetInReplyTo() // Should return zero value - }) - - t.Run("GetReferences", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &ReceivedEmail{} - var expected []string - obj.References = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetReferences(), "getter should return the property value") + _ = obj.GetID() // Should return zero value }) - t.Run("GetReferences_NilValue", func(t *testing.T) { + t.Run("GetAttemptedAt", func(t *testing.T) { t.Parallel() // Arrange - obj := &ReceivedEmail{} - obj.References = nil + obj := &LogDrainAttempt{} + var expected time.Time + obj.AttemptedAt = expected // Act & Assert - assert.Nil(t, obj.GetReferences(), "getter should return nil when property is nil") + assert.Equal(t, expected, obj.GetAttemptedAt(), "getter should return the property value") }) - t.Run("GetReferences_NilReceiver", func(t *testing.T) { + t.Run("GetAttemptedAt_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *ReceivedEmail + var obj *LogDrainAttempt // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetReferences() // Should return zero value + _ = obj.GetAttemptedAt() // Should return zero value }) - t.Run("GetSentAt", func(t *testing.T) { + t.Run("GetStatusCode", func(t *testing.T) { t.Parallel() // Arrange - obj := &ReceivedEmail{} - var expected *time.Time - obj.SentAt = expected + obj := &LogDrainAttempt{} + var expected *int64 + obj.StatusCode = expected // Act & Assert - assert.Equal(t, expected, obj.GetSentAt(), "getter should return the property value") + assert.Equal(t, expected, obj.GetStatusCode(), "getter should return the property value") }) - t.Run("GetSentAt_NilValue", func(t *testing.T) { + t.Run("GetStatusCode_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &ReceivedEmail{} - obj.SentAt = nil + obj := &LogDrainAttempt{} + obj.StatusCode = nil // Act & Assert - assert.Nil(t, obj.GetSentAt(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetStatusCode(), "getter should return nil when property is nil") }) - t.Run("GetSentAt_NilReceiver", func(t *testing.T) { + t.Run("GetStatusCode_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *ReceivedEmail + var obj *LogDrainAttempt // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetSentAt() // Should return zero value - }) - - t.Run("GetHeaders", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &ReceivedEmail{} - var expected []*ReceivedEmailHeadersItem - obj.Headers = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetHeaders(), "getter should return the property value") + _ = obj.GetStatusCode() // Should return zero value }) - t.Run("GetHeaders_NilValue", func(t *testing.T) { + t.Run("GetDurationMs", func(t *testing.T) { t.Parallel() // Arrange - obj := &ReceivedEmail{} - obj.Headers = nil + obj := &LogDrainAttempt{} + var expected int64 + obj.DurationMs = expected // Act & Assert - assert.Nil(t, obj.GetHeaders(), "getter should return nil when property is nil") + assert.Equal(t, expected, obj.GetDurationMs(), "getter should return the property value") }) - t.Run("GetHeaders_NilReceiver", func(t *testing.T) { + t.Run("GetDurationMs_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *ReceivedEmail + var obj *LogDrainAttempt // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetHeaders() // Should return zero value + _ = obj.GetDurationMs() // Should return zero value }) - t.Run("GetText", func(t *testing.T) { + t.Run("GetError", func(t *testing.T) { t.Parallel() // Arrange - obj := &ReceivedEmail{} + obj := &LogDrainAttempt{} var expected *string - obj.Text = expected + obj.Error = expected // Act & Assert - assert.Equal(t, expected, obj.GetText(), "getter should return the property value") + assert.Equal(t, expected, obj.GetError(), "getter should return the property value") }) - t.Run("GetText_NilValue", func(t *testing.T) { + t.Run("GetError_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &ReceivedEmail{} - obj.Text = nil + obj := &LogDrainAttempt{} + obj.Error = nil // Act & Assert - assert.Nil(t, obj.GetText(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetError(), "getter should return nil when property is nil") }) - t.Run("GetText_NilReceiver", func(t *testing.T) { + t.Run("GetError_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *ReceivedEmail + var obj *LogDrainAttempt // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetText() // Should return zero value + _ = obj.GetError() // Should return zero value }) - t.Run("GetHTML", func(t *testing.T) { + t.Run("GetResponseExcerpt", func(t *testing.T) { t.Parallel() // Arrange - obj := &ReceivedEmail{} + obj := &LogDrainAttempt{} var expected *string - obj.HTML = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetHTML(), "getter should return the property value") - }) - - t.Run("GetHTML_NilValue", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &ReceivedEmail{} - obj.HTML = nil + obj.ResponseExcerpt = expected // Act & Assert - assert.Nil(t, obj.GetHTML(), "getter should return nil when property is nil") - }) - - t.Run("GetHTML_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *ReceivedEmail - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetHTML() // Should return zero value + assert.Equal(t, expected, obj.GetResponseExcerpt(), "getter should return the property value") }) - t.Run("GetTruncated", func(t *testing.T) { + t.Run("GetResponseExcerpt_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &ReceivedEmail{} - var expected bool - obj.Truncated = expected + obj := &LogDrainAttempt{} + obj.ResponseExcerpt = nil // Act & Assert - assert.Equal(t, expected, obj.GetTruncated(), "getter should return the property value") + assert.Nil(t, obj.GetResponseExcerpt(), "getter should return nil when property is nil") }) - t.Run("GetTruncated_NilReceiver", func(t *testing.T) { + t.Run("GetResponseExcerpt_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *ReceivedEmail + var obj *LogDrainAttempt // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetTruncated() // Should return zero value + _ = obj.GetResponseExcerpt() // Should return zero value }) } -func TestSettersMarkExplicitReceivedEmail(t *testing.T) { +func TestSettersMarkExplicitLogDrainAttempt(t *testing.T) { t.Run("SetObject_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &ReceivedEmail{} - var fernTestValueObject ReceivedEmailObject + obj := &LogDrainAttempt{} + var fernTestValueObject LogDrainAttemptObject // Act obj.SetObject(fernTestValueObject) @@ -62953,7 +61677,7 @@ func TestSettersMarkExplicitReceivedEmail(t *testing.T) { t.Run("SetID_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &ReceivedEmail{} + obj := &LogDrainAttempt{} var fernTestValueID string // Act @@ -62981,14 +61705,14 @@ func TestSettersMarkExplicitReceivedEmail(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetStatus_MarksExplicit", func(t *testing.T) { + t.Run("SetAttemptedAt_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &ReceivedEmail{} - var fernTestValueStatus ReceivedEmailStatus + obj := &LogDrainAttempt{} + var fernTestValueAttemptedAt time.Time // Act - obj.SetStatus(fernTestValueStatus) + obj.SetAttemptedAt(fernTestValueAttemptedAt) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -63012,14 +61736,14 @@ func TestSettersMarkExplicitReceivedEmail(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetBlockedReason_MarksExplicit", func(t *testing.T) { + t.Run("SetStatusCode_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &ReceivedEmail{} - var fernTestValueBlockedReason *ReceivedEmailBlockedReason + obj := &LogDrainAttempt{} + var fernTestValueStatusCode *int64 // Act - obj.SetBlockedReason(fernTestValueBlockedReason) + obj.SetStatusCode(fernTestValueStatusCode) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -63043,14 +61767,14 @@ func TestSettersMarkExplicitReceivedEmail(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetMailFrom_MarksExplicit", func(t *testing.T) { + t.Run("SetDurationMs_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &ReceivedEmail{} - var fernTestValueMailFrom string + obj := &LogDrainAttempt{} + var fernTestValueDurationMs int64 // Act - obj.SetMailFrom(fernTestValueMailFrom) + obj.SetDurationMs(fernTestValueDurationMs) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -63074,14 +61798,14 @@ func TestSettersMarkExplicitReceivedEmail(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetRecipients_MarksExplicit", func(t *testing.T) { + t.Run("SetError_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &ReceivedEmail{} - var fernTestValueRecipients []string + obj := &LogDrainAttempt{} + var fernTestValueError *string // Act - obj.SetRecipients(fernTestValueRecipients) + obj.SetError(fernTestValueError) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -63105,14 +61829,14 @@ func TestSettersMarkExplicitReceivedEmail(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetFrom_MarksExplicit", func(t *testing.T) { + t.Run("SetResponseExcerpt_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &ReceivedEmail{} - var fernTestValueFrom *string + obj := &LogDrainAttempt{} + var fernTestValueResponseExcerpt *string // Act - obj.SetFrom(fernTestValueFrom) + obj.SetResponseExcerpt(fernTestValueResponseExcerpt) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -63136,76 +61860,466 @@ func TestSettersMarkExplicitReceivedEmail(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetTo_MarksExplicit", func(t *testing.T) { +} + +func TestSettersLogDrainBatch(t *testing.T) { + t.Run("SetObject", func(t *testing.T) { + obj := &LogDrainBatch{} + var fernTestValueObject LogDrainBatchObject + obj.SetObject(fernTestValueObject) + assert.Equal(t, fernTestValueObject, obj.Object) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetID", func(t *testing.T) { + obj := &LogDrainBatch{} + var fernTestValueID string + obj.SetID(fernTestValueID) + assert.Equal(t, fernTestValueID, obj.ID) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetDrainID", func(t *testing.T) { + obj := &LogDrainBatch{} + var fernTestValueDrainID string + obj.SetDrainID(fernTestValueDrainID) + assert.Equal(t, fernTestValueDrainID, obj.DrainID) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetStatus", func(t *testing.T) { + obj := &LogDrainBatch{} + var fernTestValueStatus LogDrainBatchStatus + obj.SetStatus(fernTestValueStatus) + assert.Equal(t, fernTestValueStatus, obj.Status) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetLineCount", func(t *testing.T) { + obj := &LogDrainBatch{} + var fernTestValueLineCount int64 + obj.SetLineCount(fernTestValueLineCount) + assert.Equal(t, fernTestValueLineCount, obj.LineCount) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetByteSize", func(t *testing.T) { + obj := &LogDrainBatch{} + var fernTestValueByteSize int64 + obj.SetByteSize(fernTestValueByteSize) + assert.Equal(t, fernTestValueByteSize, obj.ByteSize) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetAttemptCount", func(t *testing.T) { + obj := &LogDrainBatch{} + var fernTestValueAttemptCount int64 + obj.SetAttemptCount(fernTestValueAttemptCount) + assert.Equal(t, fernTestValueAttemptCount, obj.AttemptCount) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetNextAttemptAt", func(t *testing.T) { + obj := &LogDrainBatch{} + var fernTestValueNextAttemptAt *time.Time + obj.SetNextAttemptAt(fernTestValueNextAttemptAt) + assert.Equal(t, fernTestValueNextAttemptAt, obj.NextAttemptAt) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetLastStatusCode", func(t *testing.T) { + obj := &LogDrainBatch{} + var fernTestValueLastStatusCode *int64 + obj.SetLastStatusCode(fernTestValueLastStatusCode) + assert.Equal(t, fernTestValueLastStatusCode, obj.LastStatusCode) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetLastError", func(t *testing.T) { + obj := &LogDrainBatch{} + var fernTestValueLastError *string + obj.SetLastError(fernTestValueLastError) + assert.Equal(t, fernTestValueLastError, obj.LastError) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetAttempts", func(t *testing.T) { + obj := &LogDrainBatch{} + var fernTestValueAttempts []*LogDrainAttempt + obj.SetAttempts(fernTestValueAttempts) + assert.Equal(t, fernTestValueAttempts, obj.Attempts) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetCreatedAt", func(t *testing.T) { + obj := &LogDrainBatch{} + var fernTestValueCreatedAt time.Time + obj.SetCreatedAt(fernTestValueCreatedAt) + assert.Equal(t, fernTestValueCreatedAt, obj.CreatedAt) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetUpdatedAt", func(t *testing.T) { + obj := &LogDrainBatch{} + var fernTestValueUpdatedAt time.Time + obj.SetUpdatedAt(fernTestValueUpdatedAt) + assert.Equal(t, fernTestValueUpdatedAt, obj.UpdatedAt) + assert.NotNil(t, obj.explicitFields) + }) + +} + +func TestGettersLogDrainBatch(t *testing.T) { + t.Run("GetObject", func(t *testing.T) { t.Parallel() // Arrange - obj := &ReceivedEmail{} - var fernTestValueTo []string + obj := &LogDrainBatch{} + var expected LogDrainBatchObject + obj.Object = expected - // Act - obj.SetTo(fernTestValueTo) + // Act & Assert + assert.Equal(t, expected, obj.GetObject(), "getter should return the property value") + }) - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") + t.Run("GetObject_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *LogDrainBatch + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetObject() // Should return zero value + }) - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } + t.Run("GetID", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &LogDrainBatch{} + var expected string + obj.ID = expected - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip + // Act & Assert + assert.Equal(t, expected, obj.GetID(), "getter should return the property value") }) - t.Run("SetCc_MarksExplicit", func(t *testing.T) { + t.Run("GetID_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *LogDrainBatch + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetID() // Should return zero value + }) + + t.Run("GetDrainID", func(t *testing.T) { t.Parallel() // Arrange - obj := &ReceivedEmail{} - var fernTestValueCc []string + obj := &LogDrainBatch{} + var expected string + obj.DrainID = expected - // Act - obj.SetCc(fernTestValueCc) + // Act & Assert + assert.Equal(t, expected, obj.GetDrainID(), "getter should return the property value") + }) - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") + t.Run("GetDrainID_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *LogDrainBatch + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetDrainID() // Should return zero value + }) - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } + t.Run("GetStatus", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &LogDrainBatch{} + var expected LogDrainBatchStatus + obj.Status = expected - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip + // Act & Assert + assert.Equal(t, expected, obj.GetStatus(), "getter should return the property value") }) - t.Run("SetSubject_MarksExplicit", func(t *testing.T) { + t.Run("GetStatus_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *LogDrainBatch + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetStatus() // Should return zero value + }) + + t.Run("GetLineCount", func(t *testing.T) { t.Parallel() // Arrange - obj := &ReceivedEmail{} - var fernTestValueSubject *string + obj := &LogDrainBatch{} + var expected int64 + obj.LineCount = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetLineCount(), "getter should return the property value") + }) + + t.Run("GetLineCount_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *LogDrainBatch + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetLineCount() // Should return zero value + }) + + t.Run("GetByteSize", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &LogDrainBatch{} + var expected int64 + obj.ByteSize = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetByteSize(), "getter should return the property value") + }) + + t.Run("GetByteSize_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *LogDrainBatch + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetByteSize() // Should return zero value + }) + + t.Run("GetAttemptCount", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &LogDrainBatch{} + var expected int64 + obj.AttemptCount = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetAttemptCount(), "getter should return the property value") + }) + + t.Run("GetAttemptCount_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *LogDrainBatch + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetAttemptCount() // Should return zero value + }) + + t.Run("GetNextAttemptAt", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &LogDrainBatch{} + var expected *time.Time + obj.NextAttemptAt = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetNextAttemptAt(), "getter should return the property value") + }) + + t.Run("GetNextAttemptAt_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &LogDrainBatch{} + obj.NextAttemptAt = nil + + // Act & Assert + assert.Nil(t, obj.GetNextAttemptAt(), "getter should return nil when property is nil") + }) + + t.Run("GetNextAttemptAt_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *LogDrainBatch + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetNextAttemptAt() // Should return zero value + }) + + t.Run("GetLastStatusCode", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &LogDrainBatch{} + var expected *int64 + obj.LastStatusCode = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetLastStatusCode(), "getter should return the property value") + }) + + t.Run("GetLastStatusCode_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &LogDrainBatch{} + obj.LastStatusCode = nil + + // Act & Assert + assert.Nil(t, obj.GetLastStatusCode(), "getter should return nil when property is nil") + }) + + t.Run("GetLastStatusCode_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *LogDrainBatch + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetLastStatusCode() // Should return zero value + }) + + t.Run("GetLastError", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &LogDrainBatch{} + var expected *string + obj.LastError = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetLastError(), "getter should return the property value") + }) + + t.Run("GetLastError_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &LogDrainBatch{} + obj.LastError = nil + + // Act & Assert + assert.Nil(t, obj.GetLastError(), "getter should return nil when property is nil") + }) + + t.Run("GetLastError_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *LogDrainBatch + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetLastError() // Should return zero value + }) + + t.Run("GetAttempts", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &LogDrainBatch{} + var expected []*LogDrainAttempt + obj.Attempts = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetAttempts(), "getter should return the property value") + }) + + t.Run("GetAttempts_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &LogDrainBatch{} + obj.Attempts = nil + + // Act & Assert + assert.Nil(t, obj.GetAttempts(), "getter should return nil when property is nil") + }) + + t.Run("GetAttempts_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *LogDrainBatch + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetAttempts() // Should return zero value + }) + + t.Run("GetCreatedAt", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &LogDrainBatch{} + var expected time.Time + obj.CreatedAt = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetCreatedAt(), "getter should return the property value") + }) + + t.Run("GetCreatedAt_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *LogDrainBatch + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetCreatedAt() // Should return zero value + }) + + t.Run("GetUpdatedAt", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &LogDrainBatch{} + var expected time.Time + obj.UpdatedAt = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetUpdatedAt(), "getter should return the property value") + }) + + t.Run("GetUpdatedAt_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *LogDrainBatch + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetUpdatedAt() // Should return zero value + }) + +} + +func TestSettersMarkExplicitLogDrainBatch(t *testing.T) { + t.Run("SetObject_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &LogDrainBatch{} + var fernTestValueObject LogDrainBatchObject // Act - obj.SetSubject(fernTestValueSubject) + obj.SetObject(fernTestValueObject) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -63229,14 +62343,14 @@ func TestSettersMarkExplicitReceivedEmail(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetMessageID_MarksExplicit", func(t *testing.T) { + t.Run("SetID_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &ReceivedEmail{} - var fernTestValueMessageID *string + obj := &LogDrainBatch{} + var fernTestValueID string // Act - obj.SetMessageID(fernTestValueMessageID) + obj.SetID(fernTestValueID) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -63260,14 +62374,14 @@ func TestSettersMarkExplicitReceivedEmail(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetAttachments_MarksExplicit", func(t *testing.T) { + t.Run("SetDrainID_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &ReceivedEmail{} - var fernTestValueAttachments []*ReceivedEmailAttachment + obj := &LogDrainBatch{} + var fernTestValueDrainID string // Act - obj.SetAttachments(fernTestValueAttachments) + obj.SetDrainID(fernTestValueDrainID) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -63291,14 +62405,14 @@ func TestSettersMarkExplicitReceivedEmail(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetSize_MarksExplicit", func(t *testing.T) { + t.Run("SetStatus_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &ReceivedEmail{} - var fernTestValueSize int64 + obj := &LogDrainBatch{} + var fernTestValueStatus LogDrainBatchStatus // Act - obj.SetSize(fernTestValueSize) + obj.SetStatus(fernTestValueStatus) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -63322,14 +62436,14 @@ func TestSettersMarkExplicitReceivedEmail(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetSpam_MarksExplicit", func(t *testing.T) { + t.Run("SetLineCount_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &ReceivedEmail{} - var fernTestValueSpam bool + obj := &LogDrainBatch{} + var fernTestValueLineCount int64 // Act - obj.SetSpam(fernTestValueSpam) + obj.SetLineCount(fernTestValueLineCount) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -63353,14 +62467,14 @@ func TestSettersMarkExplicitReceivedEmail(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetVerdicts_MarksExplicit", func(t *testing.T) { + t.Run("SetByteSize_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &ReceivedEmail{} - var fernTestValueVerdicts *ReceivedEmailVerdicts + obj := &LogDrainBatch{} + var fernTestValueByteSize int64 // Act - obj.SetVerdicts(fernTestValueVerdicts) + obj.SetByteSize(fernTestValueByteSize) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -63384,14 +62498,14 @@ func TestSettersMarkExplicitReceivedEmail(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetSandbox_MarksExplicit", func(t *testing.T) { + t.Run("SetAttemptCount_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &ReceivedEmail{} - var fernTestValueSandbox bool + obj := &LogDrainBatch{} + var fernTestValueAttemptCount int64 // Act - obj.SetSandbox(fernTestValueSandbox) + obj.SetAttemptCount(fernTestValueAttemptCount) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -63415,14 +62529,14 @@ func TestSettersMarkExplicitReceivedEmail(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetReceivedAt_MarksExplicit", func(t *testing.T) { + t.Run("SetNextAttemptAt_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &ReceivedEmail{} - var fernTestValueReceivedAt time.Time + obj := &LogDrainBatch{} + var fernTestValueNextAttemptAt *time.Time // Act - obj.SetReceivedAt(fernTestValueReceivedAt) + obj.SetNextAttemptAt(fernTestValueNextAttemptAt) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -63446,14 +62560,14 @@ func TestSettersMarkExplicitReceivedEmail(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetReplyTo_MarksExplicit", func(t *testing.T) { + t.Run("SetLastStatusCode_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &ReceivedEmail{} - var fernTestValueReplyTo []string + obj := &LogDrainBatch{} + var fernTestValueLastStatusCode *int64 // Act - obj.SetReplyTo(fernTestValueReplyTo) + obj.SetLastStatusCode(fernTestValueLastStatusCode) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -63477,14 +62591,14 @@ func TestSettersMarkExplicitReceivedEmail(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetInReplyTo_MarksExplicit", func(t *testing.T) { + t.Run("SetLastError_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &ReceivedEmail{} - var fernTestValueInReplyTo *string + obj := &LogDrainBatch{} + var fernTestValueLastError *string // Act - obj.SetInReplyTo(fernTestValueInReplyTo) + obj.SetLastError(fernTestValueLastError) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -63508,14 +62622,14 @@ func TestSettersMarkExplicitReceivedEmail(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetReferences_MarksExplicit", func(t *testing.T) { + t.Run("SetAttempts_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &ReceivedEmail{} - var fernTestValueReferences []string + obj := &LogDrainBatch{} + var fernTestValueAttempts []*LogDrainAttempt // Act - obj.SetReferences(fernTestValueReferences) + obj.SetAttempts(fernTestValueAttempts) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -63539,14 +62653,14 @@ func TestSettersMarkExplicitReceivedEmail(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetSentAt_MarksExplicit", func(t *testing.T) { + t.Run("SetCreatedAt_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &ReceivedEmail{} - var fernTestValueSentAt *time.Time + obj := &LogDrainBatch{} + var fernTestValueCreatedAt time.Time // Act - obj.SetSentAt(fernTestValueSentAt) + obj.SetCreatedAt(fernTestValueCreatedAt) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -63570,14 +62684,14 @@ func TestSettersMarkExplicitReceivedEmail(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetHeaders_MarksExplicit", func(t *testing.T) { + t.Run("SetUpdatedAt_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &ReceivedEmail{} - var fernTestValueHeaders []*ReceivedEmailHeadersItem + obj := &LogDrainBatch{} + var fernTestValueUpdatedAt time.Time // Act - obj.SetHeaders(fernTestValueHeaders) + obj.SetUpdatedAt(fernTestValueUpdatedAt) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -63601,14 +62715,126 @@ func TestSettersMarkExplicitReceivedEmail(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetText_MarksExplicit", func(t *testing.T) { +} + +func TestSettersLogDrainBatchList(t *testing.T) { + t.Run("SetObject", func(t *testing.T) { + obj := &LogDrainBatchList{} + var fernTestValueObject LogDrainBatchListObject + obj.SetObject(fernTestValueObject) + assert.Equal(t, fernTestValueObject, obj.Object) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetData", func(t *testing.T) { + obj := &LogDrainBatchList{} + var fernTestValueData []*LogDrainBatch + obj.SetData(fernTestValueData) + assert.Equal(t, fernTestValueData, obj.Data) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetHasMore", func(t *testing.T) { + obj := &LogDrainBatchList{} + var fernTestValueHasMore bool + obj.SetHasMore(fernTestValueHasMore) + assert.Equal(t, fernTestValueHasMore, obj.HasMore) + assert.NotNil(t, obj.explicitFields) + }) + +} + +func TestGettersLogDrainBatchList(t *testing.T) { + t.Run("GetObject", func(t *testing.T) { t.Parallel() // Arrange - obj := &ReceivedEmail{} - var fernTestValueText *string + obj := &LogDrainBatchList{} + var expected LogDrainBatchListObject + obj.Object = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetObject(), "getter should return the property value") + }) + + t.Run("GetObject_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *LogDrainBatchList + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetObject() // Should return zero value + }) + + t.Run("GetData", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &LogDrainBatchList{} + var expected []*LogDrainBatch + obj.Data = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetData(), "getter should return the property value") + }) + + t.Run("GetData_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &LogDrainBatchList{} + obj.Data = nil + + // Act & Assert + assert.Nil(t, obj.GetData(), "getter should return nil when property is nil") + }) + + t.Run("GetData_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *LogDrainBatchList + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetData() // Should return zero value + }) + + t.Run("GetHasMore", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &LogDrainBatchList{} + var expected bool + obj.HasMore = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetHasMore(), "getter should return the property value") + }) + + t.Run("GetHasMore_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *LogDrainBatchList + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetHasMore() // Should return zero value + }) + +} + +func TestSettersMarkExplicitLogDrainBatchList(t *testing.T) { + t.Run("SetObject_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &LogDrainBatchList{} + var fernTestValueObject LogDrainBatchListObject // Act - obj.SetText(fernTestValueText) + obj.SetObject(fernTestValueObject) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -63632,14 +62858,14 @@ func TestSettersMarkExplicitReceivedEmail(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetHTML_MarksExplicit", func(t *testing.T) { + t.Run("SetData_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &ReceivedEmail{} - var fernTestValueHTML *string + obj := &LogDrainBatchList{} + var fernTestValueData []*LogDrainBatch // Act - obj.SetHTML(fernTestValueHTML) + obj.SetData(fernTestValueData) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -63663,14 +62889,14 @@ func TestSettersMarkExplicitReceivedEmail(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetTruncated_MarksExplicit", func(t *testing.T) { + t.Run("SetHasMore_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &ReceivedEmail{} - var fernTestValueTruncated bool + obj := &LogDrainBatchList{} + var fernTestValueHasMore bool // Act - obj.SetTruncated(fernTestValueTruncated) + obj.SetHasMore(fernTestValueHasMore) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -63696,239 +62922,382 @@ func TestSettersMarkExplicitReceivedEmail(t *testing.T) { } -func TestSettersReceivedEmailAttachment(t *testing.T) { - t.Run("SetID", func(t *testing.T) { - obj := &ReceivedEmailAttachment{} - var fernTestValueID string - obj.SetID(fernTestValueID) - assert.Equal(t, fernTestValueID, obj.ID) +func TestSettersMarketingSettings(t *testing.T) { + t.Run("SetObject", func(t *testing.T) { + obj := &MarketingSettings{} + var fernTestValueObject MarketingSettingsObject + obj.SetObject(fernTestValueObject) + assert.Equal(t, fernTestValueObject, obj.Object) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetFilename", func(t *testing.T) { - obj := &ReceivedEmailAttachment{} - var fernTestValueFilename *string - obj.SetFilename(fernTestValueFilename) - assert.Equal(t, fernTestValueFilename, obj.Filename) + t.Run("SetDisplayName", func(t *testing.T) { + obj := &MarketingSettings{} + var fernTestValueDisplayName *string + obj.SetDisplayName(fernTestValueDisplayName) + assert.Equal(t, fernTestValueDisplayName, obj.DisplayName) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetContentType", func(t *testing.T) { - obj := &ReceivedEmailAttachment{} - var fernTestValueContentType string - obj.SetContentType(fernTestValueContentType) - assert.Equal(t, fernTestValueContentType, obj.ContentType) + t.Run("SetMailingAddress", func(t *testing.T) { + obj := &MarketingSettings{} + var fernTestValueMailingAddress *string + obj.SetMailingAddress(fernTestValueMailingAddress) + assert.Equal(t, fernTestValueMailingAddress, obj.MailingAddress) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetContentID", func(t *testing.T) { - obj := &ReceivedEmailAttachment{} - var fernTestValueContentID *string - obj.SetContentID(fernTestValueContentID) - assert.Equal(t, fernTestValueContentID, obj.ContentID) + t.Run("SetDoubleOptInDefault", func(t *testing.T) { + obj := &MarketingSettings{} + var fernTestValueDoubleOptInDefault bool + obj.SetDoubleOptInDefault(fernTestValueDoubleOptInDefault) + assert.Equal(t, fernTestValueDoubleOptInDefault, obj.DoubleOptInDefault) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetDisposition", func(t *testing.T) { - obj := &ReceivedEmailAttachment{} - var fernTestValueDisposition ReceivedEmailAttachmentDisposition - obj.SetDisposition(fernTestValueDisposition) - assert.Equal(t, fernTestValueDisposition, obj.Disposition) + t.Run("SetConfirmationFrom", func(t *testing.T) { + obj := &MarketingSettings{} + var fernTestValueConfirmationFrom *string + obj.SetConfirmationFrom(fernTestValueConfirmationFrom) + assert.Equal(t, fernTestValueConfirmationFrom, obj.ConfirmationFrom) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetSize", func(t *testing.T) { - obj := &ReceivedEmailAttachment{} - var fernTestValueSize int64 - obj.SetSize(fernTestValueSize) - assert.Equal(t, fernTestValueSize, obj.Size) + t.Run("SetConfirmationSubject", func(t *testing.T) { + obj := &MarketingSettings{} + var fernTestValueConfirmationSubject *string + obj.SetConfirmationSubject(fernTestValueConfirmationSubject) + assert.Equal(t, fernTestValueConfirmationSubject, obj.ConfirmationSubject) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetConfirmationHTML", func(t *testing.T) { + obj := &MarketingSettings{} + var fernTestValueConfirmationHTML *string + obj.SetConfirmationHTML(fernTestValueConfirmationHTML) + assert.Equal(t, fernTestValueConfirmationHTML, obj.ConfirmationHTML) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetConfirmationText", func(t *testing.T) { + obj := &MarketingSettings{} + var fernTestValueConfirmationText *string + obj.SetConfirmationText(fernTestValueConfirmationText) + assert.Equal(t, fernTestValueConfirmationText, obj.ConfirmationText) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetConfirmedRedirectURL", func(t *testing.T) { + obj := &MarketingSettings{} + var fernTestValueConfirmedRedirectURL *string + obj.SetConfirmedRedirectURL(fernTestValueConfirmedRedirectURL) + assert.Equal(t, fernTestValueConfirmedRedirectURL, obj.ConfirmedRedirectURL) assert.NotNil(t, obj.explicitFields) }) } -func TestGettersReceivedEmailAttachment(t *testing.T) { - t.Run("GetID", func(t *testing.T) { +func TestGettersMarketingSettings(t *testing.T) { + t.Run("GetObject", func(t *testing.T) { t.Parallel() // Arrange - obj := &ReceivedEmailAttachment{} - var expected string - obj.ID = expected + obj := &MarketingSettings{} + var expected MarketingSettingsObject + obj.Object = expected // Act & Assert - assert.Equal(t, expected, obj.GetID(), "getter should return the property value") + assert.Equal(t, expected, obj.GetObject(), "getter should return the property value") }) - t.Run("GetID_NilReceiver", func(t *testing.T) { + t.Run("GetObject_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *ReceivedEmailAttachment + var obj *MarketingSettings // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetID() // Should return zero value + _ = obj.GetObject() // Should return zero value }) - t.Run("GetFilename", func(t *testing.T) { + t.Run("GetDisplayName", func(t *testing.T) { t.Parallel() // Arrange - obj := &ReceivedEmailAttachment{} + obj := &MarketingSettings{} var expected *string - obj.Filename = expected + obj.DisplayName = expected // Act & Assert - assert.Equal(t, expected, obj.GetFilename(), "getter should return the property value") + assert.Equal(t, expected, obj.GetDisplayName(), "getter should return the property value") }) - t.Run("GetFilename_NilValue", func(t *testing.T) { + t.Run("GetDisplayName_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &ReceivedEmailAttachment{} - obj.Filename = nil + obj := &MarketingSettings{} + obj.DisplayName = nil // Act & Assert - assert.Nil(t, obj.GetFilename(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetDisplayName(), "getter should return nil when property is nil") }) - t.Run("GetFilename_NilReceiver", func(t *testing.T) { + t.Run("GetDisplayName_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *ReceivedEmailAttachment + var obj *MarketingSettings // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetFilename() // Should return zero value + _ = obj.GetDisplayName() // Should return zero value }) - t.Run("GetContentType", func(t *testing.T) { + t.Run("GetMailingAddress", func(t *testing.T) { t.Parallel() // Arrange - obj := &ReceivedEmailAttachment{} - var expected string - obj.ContentType = expected + obj := &MarketingSettings{} + var expected *string + obj.MailingAddress = expected // Act & Assert - assert.Equal(t, expected, obj.GetContentType(), "getter should return the property value") + assert.Equal(t, expected, obj.GetMailingAddress(), "getter should return the property value") }) - t.Run("GetContentType_NilReceiver", func(t *testing.T) { + t.Run("GetMailingAddress_NilValue", func(t *testing.T) { t.Parallel() - var obj *ReceivedEmailAttachment + // Arrange + obj := &MarketingSettings{} + obj.MailingAddress = nil + + // Act & Assert + assert.Nil(t, obj.GetMailingAddress(), "getter should return nil when property is nil") + }) + + t.Run("GetMailingAddress_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *MarketingSettings // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetContentType() // Should return zero value + _ = obj.GetMailingAddress() // Should return zero value }) - t.Run("GetContentID", func(t *testing.T) { + t.Run("GetDoubleOptInDefault", func(t *testing.T) { t.Parallel() // Arrange - obj := &ReceivedEmailAttachment{} + obj := &MarketingSettings{} + var expected bool + obj.DoubleOptInDefault = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetDoubleOptInDefault(), "getter should return the property value") + }) + + t.Run("GetDoubleOptInDefault_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *MarketingSettings + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetDoubleOptInDefault() // Should return zero value + }) + + t.Run("GetConfirmationFrom", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &MarketingSettings{} var expected *string - obj.ContentID = expected + obj.ConfirmationFrom = expected // Act & Assert - assert.Equal(t, expected, obj.GetContentID(), "getter should return the property value") + assert.Equal(t, expected, obj.GetConfirmationFrom(), "getter should return the property value") }) - t.Run("GetContentID_NilValue", func(t *testing.T) { + t.Run("GetConfirmationFrom_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &ReceivedEmailAttachment{} - obj.ContentID = nil + obj := &MarketingSettings{} + obj.ConfirmationFrom = nil // Act & Assert - assert.Nil(t, obj.GetContentID(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetConfirmationFrom(), "getter should return nil when property is nil") }) - t.Run("GetContentID_NilReceiver", func(t *testing.T) { + t.Run("GetConfirmationFrom_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *ReceivedEmailAttachment + var obj *MarketingSettings // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetContentID() // Should return zero value + _ = obj.GetConfirmationFrom() // Should return zero value }) - t.Run("GetDisposition", func(t *testing.T) { + t.Run("GetConfirmationSubject", func(t *testing.T) { t.Parallel() // Arrange - obj := &ReceivedEmailAttachment{} - var expected ReceivedEmailAttachmentDisposition - obj.Disposition = expected + obj := &MarketingSettings{} + var expected *string + obj.ConfirmationSubject = expected // Act & Assert - assert.Equal(t, expected, obj.GetDisposition(), "getter should return the property value") + assert.Equal(t, expected, obj.GetConfirmationSubject(), "getter should return the property value") }) - t.Run("GetDisposition_NilReceiver", func(t *testing.T) { + t.Run("GetConfirmationSubject_NilValue", func(t *testing.T) { t.Parallel() - var obj *ReceivedEmailAttachment + // Arrange + obj := &MarketingSettings{} + obj.ConfirmationSubject = nil + + // Act & Assert + assert.Nil(t, obj.GetConfirmationSubject(), "getter should return nil when property is nil") + }) + + t.Run("GetConfirmationSubject_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *MarketingSettings // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetDisposition() // Should return zero value + _ = obj.GetConfirmationSubject() // Should return zero value }) - t.Run("GetSize", func(t *testing.T) { + t.Run("GetConfirmationHTML", func(t *testing.T) { t.Parallel() // Arrange - obj := &ReceivedEmailAttachment{} - var expected int64 - obj.Size = expected + obj := &MarketingSettings{} + var expected *string + obj.ConfirmationHTML = expected // Act & Assert - assert.Equal(t, expected, obj.GetSize(), "getter should return the property value") + assert.Equal(t, expected, obj.GetConfirmationHTML(), "getter should return the property value") }) - t.Run("GetSize_NilReceiver", func(t *testing.T) { + t.Run("GetConfirmationHTML_NilValue", func(t *testing.T) { t.Parallel() - var obj *ReceivedEmailAttachment + // Arrange + obj := &MarketingSettings{} + obj.ConfirmationHTML = nil + + // Act & Assert + assert.Nil(t, obj.GetConfirmationHTML(), "getter should return nil when property is nil") + }) + + t.Run("GetConfirmationHTML_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *MarketingSettings // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetSize() // Should return zero value + _ = obj.GetConfirmationHTML() // Should return zero value }) -} - -func TestSettersMarkExplicitReceivedEmailAttachment(t *testing.T) { - t.Run("SetID_MarksExplicit", func(t *testing.T) { + t.Run("GetConfirmationText", func(t *testing.T) { t.Parallel() // Arrange - obj := &ReceivedEmailAttachment{} - var fernTestValueID string + obj := &MarketingSettings{} + var expected *string + obj.ConfirmationText = expected - // Act - obj.SetID(fernTestValueID) + // Act & Assert + assert.Equal(t, expected, obj.GetConfirmationText(), "getter should return the property value") + }) - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") + t.Run("GetConfirmationText_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &MarketingSettings{} + obj.ConfirmationText = nil - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") + // Act & Assert + assert.Nil(t, obj.GetConfirmationText(), "getter should return nil when property is nil") + }) + + t.Run("GetConfirmationText_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *MarketingSettings + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetConfirmationText() // Should return zero value + }) + + t.Run("GetConfirmedRedirectURL", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &MarketingSettings{} + var expected *string + obj.ConfirmedRedirectURL = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetConfirmedRedirectURL(), "getter should return the property value") + }) + + t.Run("GetConfirmedRedirectURL_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &MarketingSettings{} + obj.ConfirmedRedirectURL = nil + + // Act & Assert + assert.Nil(t, obj.GetConfirmedRedirectURL(), "getter should return nil when property is nil") + }) + + t.Run("GetConfirmedRedirectURL_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *MarketingSettings + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetConfirmedRedirectURL() // Should return zero value + }) + +} + +func TestSettersMarkExplicitMarketingSettings(t *testing.T) { + t.Run("SetObject_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &MarketingSettings{} + var fernTestValueObject MarketingSettingsObject + + // Act + obj.SetObject(fernTestValueObject) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") } else { // JSON primitive (string, number, boolean, null) - unmarshal into interface{} var unmarshaled interface{} @@ -63940,14 +63309,14 @@ func TestSettersMarkExplicitReceivedEmailAttachment(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetFilename_MarksExplicit", func(t *testing.T) { + t.Run("SetDisplayName_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &ReceivedEmailAttachment{} - var fernTestValueFilename *string + obj := &MarketingSettings{} + var fernTestValueDisplayName *string // Act - obj.SetFilename(fernTestValueFilename) + obj.SetDisplayName(fernTestValueDisplayName) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -63971,14 +63340,14 @@ func TestSettersMarkExplicitReceivedEmailAttachment(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetContentType_MarksExplicit", func(t *testing.T) { + t.Run("SetMailingAddress_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &ReceivedEmailAttachment{} - var fernTestValueContentType string + obj := &MarketingSettings{} + var fernTestValueMailingAddress *string // Act - obj.SetContentType(fernTestValueContentType) + obj.SetMailingAddress(fernTestValueMailingAddress) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -64002,14 +63371,14 @@ func TestSettersMarkExplicitReceivedEmailAttachment(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetContentID_MarksExplicit", func(t *testing.T) { + t.Run("SetDoubleOptInDefault_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &ReceivedEmailAttachment{} - var fernTestValueContentID *string + obj := &MarketingSettings{} + var fernTestValueDoubleOptInDefault bool // Act - obj.SetContentID(fernTestValueContentID) + obj.SetDoubleOptInDefault(fernTestValueDoubleOptInDefault) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -64033,14 +63402,14 @@ func TestSettersMarkExplicitReceivedEmailAttachment(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetDisposition_MarksExplicit", func(t *testing.T) { + t.Run("SetConfirmationFrom_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &ReceivedEmailAttachment{} - var fernTestValueDisposition ReceivedEmailAttachmentDisposition + obj := &MarketingSettings{} + var fernTestValueConfirmationFrom *string // Act - obj.SetDisposition(fernTestValueDisposition) + obj.SetConfirmationFrom(fernTestValueConfirmationFrom) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -64064,14 +63433,14 @@ func TestSettersMarkExplicitReceivedEmailAttachment(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetSize_MarksExplicit", func(t *testing.T) { + t.Run("SetConfirmationSubject_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &ReceivedEmailAttachment{} - var fernTestValueSize int64 + obj := &MarketingSettings{} + var fernTestValueConfirmationSubject *string // Act - obj.SetSize(fernTestValueSize) + obj.SetConfirmationSubject(fernTestValueConfirmationSubject) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -64095,85 +63464,45 @@ func TestSettersMarkExplicitReceivedEmailAttachment(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) -} - -func TestSettersReceivedEmailHeadersItem(t *testing.T) { - t.Run("SetName", func(t *testing.T) { - obj := &ReceivedEmailHeadersItem{} - var fernTestValueName string - obj.SetName(fernTestValueName) - assert.Equal(t, fernTestValueName, obj.Name) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetValue", func(t *testing.T) { - obj := &ReceivedEmailHeadersItem{} - var fernTestValueValue string - obj.SetValue(fernTestValueValue) - assert.Equal(t, fernTestValueValue, obj.Value) - assert.NotNil(t, obj.explicitFields) - }) - -} - -func TestGettersReceivedEmailHeadersItem(t *testing.T) { - t.Run("GetName", func(t *testing.T) { + t.Run("SetConfirmationHTML_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &ReceivedEmailHeadersItem{} - var expected string - obj.Name = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetName(), "getter should return the property value") - }) + obj := &MarketingSettings{} + var fernTestValueConfirmationHTML *string - t.Run("GetName_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *ReceivedEmailHeadersItem - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetName() // Should return zero value - }) + // Act + obj.SetConfirmationHTML(fernTestValueConfirmationHTML) - t.Run("GetValue", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &ReceivedEmailHeadersItem{} - var expected string - obj.Value = expected + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") - // Act & Assert - assert.Equal(t, expected, obj.GetValue(), "getter should return the property value") - }) + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } - t.Run("GetValue_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *ReceivedEmailHeadersItem - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetValue() // Should return zero value + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip }) -} - -func TestSettersMarkExplicitReceivedEmailHeadersItem(t *testing.T) { - t.Run("SetName_MarksExplicit", func(t *testing.T) { + t.Run("SetConfirmationText_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &ReceivedEmailHeadersItem{} - var fernTestValueName string + obj := &MarketingSettings{} + var fernTestValueConfirmationText *string // Act - obj.SetName(fernTestValueName) + obj.SetConfirmationText(fernTestValueConfirmationText) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -64197,14 +63526,14 @@ func TestSettersMarkExplicitReceivedEmailHeadersItem(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetValue_MarksExplicit", func(t *testing.T) { + t.Run("SetConfirmedRedirectURL_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &ReceivedEmailHeadersItem{} - var fernTestValueValue string + obj := &MarketingSettings{} + var fernTestValueConfirmedRedirectURL *string // Act - obj.SetValue(fernTestValueValue) + obj.SetConfirmedRedirectURL(fernTestValueConfirmedRedirectURL) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -64230,39 +63559,47 @@ func TestSettersMarkExplicitReceivedEmailHeadersItem(t *testing.T) { } -func TestSettersReceivedEmailList(t *testing.T) { +func TestSettersPreferenceLinks(t *testing.T) { t.Run("SetObject", func(t *testing.T) { - obj := &ReceivedEmailList{} - var fernTestValueObject ReceivedEmailListObject + obj := &PreferenceLinks{} + var fernTestValueObject PreferenceLinksObject obj.SetObject(fernTestValueObject) assert.Equal(t, fernTestValueObject, obj.Object) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetData", func(t *testing.T) { - obj := &ReceivedEmailList{} - var fernTestValueData []*ReceivedEmailSummary - obj.SetData(fernTestValueData) - assert.Equal(t, fernTestValueData, obj.Data) + t.Run("SetContactID", func(t *testing.T) { + obj := &PreferenceLinks{} + var fernTestValueContactID string + obj.SetContactID(fernTestValueContactID) + assert.Equal(t, fernTestValueContactID, obj.ContactID) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetHasMore", func(t *testing.T) { - obj := &ReceivedEmailList{} - var fernTestValueHasMore bool - obj.SetHasMore(fernTestValueHasMore) - assert.Equal(t, fernTestValueHasMore, obj.HasMore) + t.Run("SetPreferencesURL", func(t *testing.T) { + obj := &PreferenceLinks{} + var fernTestValuePreferencesURL string + obj.SetPreferencesURL(fernTestValuePreferencesURL) + assert.Equal(t, fernTestValuePreferencesURL, obj.PreferencesURL) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetUnsubscribeURL", func(t *testing.T) { + obj := &PreferenceLinks{} + var fernTestValueUnsubscribeURL string + obj.SetUnsubscribeURL(fernTestValueUnsubscribeURL) + assert.Equal(t, fernTestValueUnsubscribeURL, obj.UnsubscribeURL) assert.NotNil(t, obj.explicitFields) }) } -func TestGettersReceivedEmailList(t *testing.T) { +func TestGettersPreferenceLinks(t *testing.T) { t.Run("GetObject", func(t *testing.T) { t.Parallel() // Arrange - obj := &ReceivedEmailList{} - var expected ReceivedEmailListObject + obj := &PreferenceLinks{} + var expected PreferenceLinksObject obj.Object = expected // Act & Assert @@ -64271,7 +63608,7 @@ func TestGettersReceivedEmailList(t *testing.T) { t.Run("GetObject_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *ReceivedEmailList + var obj *PreferenceLinks // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -64281,70 +63618,83 @@ func TestGettersReceivedEmailList(t *testing.T) { _ = obj.GetObject() // Should return zero value }) - t.Run("GetData", func(t *testing.T) { + t.Run("GetContactID", func(t *testing.T) { t.Parallel() // Arrange - obj := &ReceivedEmailList{} - var expected []*ReceivedEmailSummary - obj.Data = expected + obj := &PreferenceLinks{} + var expected string + obj.ContactID = expected // Act & Assert - assert.Equal(t, expected, obj.GetData(), "getter should return the property value") + assert.Equal(t, expected, obj.GetContactID(), "getter should return the property value") }) - t.Run("GetData_NilValue", func(t *testing.T) { + t.Run("GetContactID_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *PreferenceLinks + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetContactID() // Should return zero value + }) + + t.Run("GetPreferencesURL", func(t *testing.T) { t.Parallel() // Arrange - obj := &ReceivedEmailList{} - obj.Data = nil + obj := &PreferenceLinks{} + var expected string + obj.PreferencesURL = expected // Act & Assert - assert.Nil(t, obj.GetData(), "getter should return nil when property is nil") + assert.Equal(t, expected, obj.GetPreferencesURL(), "getter should return the property value") }) - t.Run("GetData_NilReceiver", func(t *testing.T) { + t.Run("GetPreferencesURL_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *ReceivedEmailList + var obj *PreferenceLinks // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetData() // Should return zero value + _ = obj.GetPreferencesURL() // Should return zero value }) - t.Run("GetHasMore", func(t *testing.T) { + t.Run("GetUnsubscribeURL", func(t *testing.T) { t.Parallel() // Arrange - obj := &ReceivedEmailList{} - var expected bool - obj.HasMore = expected + obj := &PreferenceLinks{} + var expected string + obj.UnsubscribeURL = expected // Act & Assert - assert.Equal(t, expected, obj.GetHasMore(), "getter should return the property value") + assert.Equal(t, expected, obj.GetUnsubscribeURL(), "getter should return the property value") }) - t.Run("GetHasMore_NilReceiver", func(t *testing.T) { + t.Run("GetUnsubscribeURL_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *ReceivedEmailList + var obj *PreferenceLinks // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetHasMore() // Should return zero value + _ = obj.GetUnsubscribeURL() // Should return zero value }) } -func TestSettersMarkExplicitReceivedEmailList(t *testing.T) { +func TestSettersMarkExplicitPreferenceLinks(t *testing.T) { t.Run("SetObject_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &ReceivedEmailList{} - var fernTestValueObject ReceivedEmailListObject + obj := &PreferenceLinks{} + var fernTestValueObject PreferenceLinksObject // Act obj.SetObject(fernTestValueObject) @@ -64371,14 +63721,14 @@ func TestSettersMarkExplicitReceivedEmailList(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetData_MarksExplicit", func(t *testing.T) { + t.Run("SetContactID_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &ReceivedEmailList{} - var fernTestValueData []*ReceivedEmailSummary + obj := &PreferenceLinks{} + var fernTestValueContactID string // Act - obj.SetData(fernTestValueData) + obj.SetContactID(fernTestValueContactID) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -64402,14 +63752,45 @@ func TestSettersMarkExplicitReceivedEmailList(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetHasMore_MarksExplicit", func(t *testing.T) { + t.Run("SetPreferencesURL_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &ReceivedEmailList{} - var fernTestValueHasMore bool + obj := &PreferenceLinks{} + var fernTestValuePreferencesURL string // Act - obj.SetHasMore(fernTestValueHasMore) + obj.SetPreferencesURL(fernTestValuePreferencesURL) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetUnsubscribeURL_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &PreferenceLinks{} + var fernTestValueUnsubscribeURL string + + // Act + obj.SetUnsubscribeURL(fernTestValueUnsubscribeURL) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -64435,17 +63816,17 @@ func TestSettersMarkExplicitReceivedEmailList(t *testing.T) { } -func TestSettersReceivedEmailSummary(t *testing.T) { +func TestSettersReceivedEmail(t *testing.T) { t.Run("SetObject", func(t *testing.T) { - obj := &ReceivedEmailSummary{} - var fernTestValueObject ReceivedEmailSummaryObject + obj := &ReceivedEmail{} + var fernTestValueObject ReceivedEmailObject obj.SetObject(fernTestValueObject) assert.Equal(t, fernTestValueObject, obj.Object) assert.NotNil(t, obj.explicitFields) }) t.Run("SetID", func(t *testing.T) { - obj := &ReceivedEmailSummary{} + obj := &ReceivedEmail{} var fernTestValueID string obj.SetID(fernTestValueID) assert.Equal(t, fernTestValueID, obj.ID) @@ -64453,23 +63834,23 @@ func TestSettersReceivedEmailSummary(t *testing.T) { }) t.Run("SetStatus", func(t *testing.T) { - obj := &ReceivedEmailSummary{} - var fernTestValueStatus ReceivedEmailSummaryStatus + obj := &ReceivedEmail{} + var fernTestValueStatus ReceivedEmailStatus obj.SetStatus(fernTestValueStatus) assert.Equal(t, fernTestValueStatus, obj.Status) assert.NotNil(t, obj.explicitFields) }) t.Run("SetBlockedReason", func(t *testing.T) { - obj := &ReceivedEmailSummary{} - var fernTestValueBlockedReason *ReceivedEmailSummaryBlockedReason + obj := &ReceivedEmail{} + var fernTestValueBlockedReason *ReceivedEmailBlockedReason obj.SetBlockedReason(fernTestValueBlockedReason) assert.Equal(t, fernTestValueBlockedReason, obj.BlockedReason) assert.NotNil(t, obj.explicitFields) }) t.Run("SetMailFrom", func(t *testing.T) { - obj := &ReceivedEmailSummary{} + obj := &ReceivedEmail{} var fernTestValueMailFrom string obj.SetMailFrom(fernTestValueMailFrom) assert.Equal(t, fernTestValueMailFrom, obj.MailFrom) @@ -64477,7 +63858,7 @@ func TestSettersReceivedEmailSummary(t *testing.T) { }) t.Run("SetRecipients", func(t *testing.T) { - obj := &ReceivedEmailSummary{} + obj := &ReceivedEmail{} var fernTestValueRecipients []string obj.SetRecipients(fernTestValueRecipients) assert.Equal(t, fernTestValueRecipients, obj.Recipients) @@ -64485,7 +63866,7 @@ func TestSettersReceivedEmailSummary(t *testing.T) { }) t.Run("SetFrom", func(t *testing.T) { - obj := &ReceivedEmailSummary{} + obj := &ReceivedEmail{} var fernTestValueFrom *string obj.SetFrom(fernTestValueFrom) assert.Equal(t, fernTestValueFrom, obj.From) @@ -64493,7 +63874,7 @@ func TestSettersReceivedEmailSummary(t *testing.T) { }) t.Run("SetTo", func(t *testing.T) { - obj := &ReceivedEmailSummary{} + obj := &ReceivedEmail{} var fernTestValueTo []string obj.SetTo(fernTestValueTo) assert.Equal(t, fernTestValueTo, obj.To) @@ -64501,7 +63882,7 @@ func TestSettersReceivedEmailSummary(t *testing.T) { }) t.Run("SetCc", func(t *testing.T) { - obj := &ReceivedEmailSummary{} + obj := &ReceivedEmail{} var fernTestValueCc []string obj.SetCc(fernTestValueCc) assert.Equal(t, fernTestValueCc, obj.Cc) @@ -64509,7 +63890,7 @@ func TestSettersReceivedEmailSummary(t *testing.T) { }) t.Run("SetSubject", func(t *testing.T) { - obj := &ReceivedEmailSummary{} + obj := &ReceivedEmail{} var fernTestValueSubject *string obj.SetSubject(fernTestValueSubject) assert.Equal(t, fernTestValueSubject, obj.Subject) @@ -64517,7 +63898,7 @@ func TestSettersReceivedEmailSummary(t *testing.T) { }) t.Run("SetMessageID", func(t *testing.T) { - obj := &ReceivedEmailSummary{} + obj := &ReceivedEmail{} var fernTestValueMessageID *string obj.SetMessageID(fernTestValueMessageID) assert.Equal(t, fernTestValueMessageID, obj.MessageID) @@ -64525,7 +63906,7 @@ func TestSettersReceivedEmailSummary(t *testing.T) { }) t.Run("SetAttachments", func(t *testing.T) { - obj := &ReceivedEmailSummary{} + obj := &ReceivedEmail{} var fernTestValueAttachments []*ReceivedEmailAttachment obj.SetAttachments(fernTestValueAttachments) assert.Equal(t, fernTestValueAttachments, obj.Attachments) @@ -64533,7 +63914,7 @@ func TestSettersReceivedEmailSummary(t *testing.T) { }) t.Run("SetSize", func(t *testing.T) { - obj := &ReceivedEmailSummary{} + obj := &ReceivedEmail{} var fernTestValueSize int64 obj.SetSize(fernTestValueSize) assert.Equal(t, fernTestValueSize, obj.Size) @@ -64541,7 +63922,7 @@ func TestSettersReceivedEmailSummary(t *testing.T) { }) t.Run("SetSpam", func(t *testing.T) { - obj := &ReceivedEmailSummary{} + obj := &ReceivedEmail{} var fernTestValueSpam bool obj.SetSpam(fernTestValueSpam) assert.Equal(t, fernTestValueSpam, obj.Spam) @@ -64549,7 +63930,7 @@ func TestSettersReceivedEmailSummary(t *testing.T) { }) t.Run("SetVerdicts", func(t *testing.T) { - obj := &ReceivedEmailSummary{} + obj := &ReceivedEmail{} var fernTestValueVerdicts *ReceivedEmailVerdicts obj.SetVerdicts(fernTestValueVerdicts) assert.Equal(t, fernTestValueVerdicts, obj.Verdicts) @@ -64557,7 +63938,7 @@ func TestSettersReceivedEmailSummary(t *testing.T) { }) t.Run("SetSandbox", func(t *testing.T) { - obj := &ReceivedEmailSummary{} + obj := &ReceivedEmail{} var fernTestValueSandbox bool obj.SetSandbox(fernTestValueSandbox) assert.Equal(t, fernTestValueSandbox, obj.Sandbox) @@ -64565,21 +63946,85 @@ func TestSettersReceivedEmailSummary(t *testing.T) { }) t.Run("SetReceivedAt", func(t *testing.T) { - obj := &ReceivedEmailSummary{} + obj := &ReceivedEmail{} var fernTestValueReceivedAt time.Time obj.SetReceivedAt(fernTestValueReceivedAt) assert.Equal(t, fernTestValueReceivedAt, obj.ReceivedAt) assert.NotNil(t, obj.explicitFields) }) + t.Run("SetReplyTo", func(t *testing.T) { + obj := &ReceivedEmail{} + var fernTestValueReplyTo []string + obj.SetReplyTo(fernTestValueReplyTo) + assert.Equal(t, fernTestValueReplyTo, obj.ReplyTo) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetInReplyTo", func(t *testing.T) { + obj := &ReceivedEmail{} + var fernTestValueInReplyTo *string + obj.SetInReplyTo(fernTestValueInReplyTo) + assert.Equal(t, fernTestValueInReplyTo, obj.InReplyTo) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetReferences", func(t *testing.T) { + obj := &ReceivedEmail{} + var fernTestValueReferences []string + obj.SetReferences(fernTestValueReferences) + assert.Equal(t, fernTestValueReferences, obj.References) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetSentAt", func(t *testing.T) { + obj := &ReceivedEmail{} + var fernTestValueSentAt *time.Time + obj.SetSentAt(fernTestValueSentAt) + assert.Equal(t, fernTestValueSentAt, obj.SentAt) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetHeaders", func(t *testing.T) { + obj := &ReceivedEmail{} + var fernTestValueHeaders []*ReceivedEmailHeadersItem + obj.SetHeaders(fernTestValueHeaders) + assert.Equal(t, fernTestValueHeaders, obj.Headers) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetText", func(t *testing.T) { + obj := &ReceivedEmail{} + var fernTestValueText *string + obj.SetText(fernTestValueText) + assert.Equal(t, fernTestValueText, obj.Text) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetHTML", func(t *testing.T) { + obj := &ReceivedEmail{} + var fernTestValueHTML *string + obj.SetHTML(fernTestValueHTML) + assert.Equal(t, fernTestValueHTML, obj.HTML) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetTruncated", func(t *testing.T) { + obj := &ReceivedEmail{} + var fernTestValueTruncated bool + obj.SetTruncated(fernTestValueTruncated) + assert.Equal(t, fernTestValueTruncated, obj.Truncated) + assert.NotNil(t, obj.explicitFields) + }) + } -func TestGettersReceivedEmailSummary(t *testing.T) { +func TestGettersReceivedEmail(t *testing.T) { t.Run("GetObject", func(t *testing.T) { t.Parallel() // Arrange - obj := &ReceivedEmailSummary{} - var expected ReceivedEmailSummaryObject + obj := &ReceivedEmail{} + var expected ReceivedEmailObject obj.Object = expected // Act & Assert @@ -64588,7 +64033,7 @@ func TestGettersReceivedEmailSummary(t *testing.T) { t.Run("GetObject_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *ReceivedEmailSummary + var obj *ReceivedEmail // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -64601,7 +64046,7 @@ func TestGettersReceivedEmailSummary(t *testing.T) { t.Run("GetID", func(t *testing.T) { t.Parallel() // Arrange - obj := &ReceivedEmailSummary{} + obj := &ReceivedEmail{} var expected string obj.ID = expected @@ -64611,7 +64056,7 @@ func TestGettersReceivedEmailSummary(t *testing.T) { t.Run("GetID_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *ReceivedEmailSummary + var obj *ReceivedEmail // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -64624,8 +64069,8 @@ func TestGettersReceivedEmailSummary(t *testing.T) { t.Run("GetStatus", func(t *testing.T) { t.Parallel() // Arrange - obj := &ReceivedEmailSummary{} - var expected ReceivedEmailSummaryStatus + obj := &ReceivedEmail{} + var expected ReceivedEmailStatus obj.Status = expected // Act & Assert @@ -64634,7 +64079,7 @@ func TestGettersReceivedEmailSummary(t *testing.T) { t.Run("GetStatus_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *ReceivedEmailSummary + var obj *ReceivedEmail // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -64647,8 +64092,8 @@ func TestGettersReceivedEmailSummary(t *testing.T) { t.Run("GetBlockedReason", func(t *testing.T) { t.Parallel() // Arrange - obj := &ReceivedEmailSummary{} - var expected *ReceivedEmailSummaryBlockedReason + obj := &ReceivedEmail{} + var expected *ReceivedEmailBlockedReason obj.BlockedReason = expected // Act & Assert @@ -64658,7 +64103,7 @@ func TestGettersReceivedEmailSummary(t *testing.T) { t.Run("GetBlockedReason_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &ReceivedEmailSummary{} + obj := &ReceivedEmail{} obj.BlockedReason = nil // Act & Assert @@ -64667,7 +64112,7 @@ func TestGettersReceivedEmailSummary(t *testing.T) { t.Run("GetBlockedReason_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *ReceivedEmailSummary + var obj *ReceivedEmail // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -64680,7 +64125,7 @@ func TestGettersReceivedEmailSummary(t *testing.T) { t.Run("GetMailFrom", func(t *testing.T) { t.Parallel() // Arrange - obj := &ReceivedEmailSummary{} + obj := &ReceivedEmail{} var expected string obj.MailFrom = expected @@ -64690,7 +64135,7 @@ func TestGettersReceivedEmailSummary(t *testing.T) { t.Run("GetMailFrom_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *ReceivedEmailSummary + var obj *ReceivedEmail // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -64703,7 +64148,7 @@ func TestGettersReceivedEmailSummary(t *testing.T) { t.Run("GetRecipients", func(t *testing.T) { t.Parallel() // Arrange - obj := &ReceivedEmailSummary{} + obj := &ReceivedEmail{} var expected []string obj.Recipients = expected @@ -64714,7 +64159,7 @@ func TestGettersReceivedEmailSummary(t *testing.T) { t.Run("GetRecipients_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &ReceivedEmailSummary{} + obj := &ReceivedEmail{} obj.Recipients = nil // Act & Assert @@ -64723,7 +64168,7 @@ func TestGettersReceivedEmailSummary(t *testing.T) { t.Run("GetRecipients_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *ReceivedEmailSummary + var obj *ReceivedEmail // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -64736,7 +64181,7 @@ func TestGettersReceivedEmailSummary(t *testing.T) { t.Run("GetFrom", func(t *testing.T) { t.Parallel() // Arrange - obj := &ReceivedEmailSummary{} + obj := &ReceivedEmail{} var expected *string obj.From = expected @@ -64747,7 +64192,7 @@ func TestGettersReceivedEmailSummary(t *testing.T) { t.Run("GetFrom_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &ReceivedEmailSummary{} + obj := &ReceivedEmail{} obj.From = nil // Act & Assert @@ -64756,7 +64201,7 @@ func TestGettersReceivedEmailSummary(t *testing.T) { t.Run("GetFrom_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *ReceivedEmailSummary + var obj *ReceivedEmail // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -64769,7 +64214,7 @@ func TestGettersReceivedEmailSummary(t *testing.T) { t.Run("GetTo", func(t *testing.T) { t.Parallel() // Arrange - obj := &ReceivedEmailSummary{} + obj := &ReceivedEmail{} var expected []string obj.To = expected @@ -64780,7 +64225,7 @@ func TestGettersReceivedEmailSummary(t *testing.T) { t.Run("GetTo_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &ReceivedEmailSummary{} + obj := &ReceivedEmail{} obj.To = nil // Act & Assert @@ -64789,7 +64234,7 @@ func TestGettersReceivedEmailSummary(t *testing.T) { t.Run("GetTo_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *ReceivedEmailSummary + var obj *ReceivedEmail // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -64802,7 +64247,7 @@ func TestGettersReceivedEmailSummary(t *testing.T) { t.Run("GetCc", func(t *testing.T) { t.Parallel() // Arrange - obj := &ReceivedEmailSummary{} + obj := &ReceivedEmail{} var expected []string obj.Cc = expected @@ -64813,7 +64258,7 @@ func TestGettersReceivedEmailSummary(t *testing.T) { t.Run("GetCc_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &ReceivedEmailSummary{} + obj := &ReceivedEmail{} obj.Cc = nil // Act & Assert @@ -64822,7 +64267,7 @@ func TestGettersReceivedEmailSummary(t *testing.T) { t.Run("GetCc_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *ReceivedEmailSummary + var obj *ReceivedEmail // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -64835,7 +64280,7 @@ func TestGettersReceivedEmailSummary(t *testing.T) { t.Run("GetSubject", func(t *testing.T) { t.Parallel() // Arrange - obj := &ReceivedEmailSummary{} + obj := &ReceivedEmail{} var expected *string obj.Subject = expected @@ -64846,7 +64291,7 @@ func TestGettersReceivedEmailSummary(t *testing.T) { t.Run("GetSubject_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &ReceivedEmailSummary{} + obj := &ReceivedEmail{} obj.Subject = nil // Act & Assert @@ -64855,7 +64300,7 @@ func TestGettersReceivedEmailSummary(t *testing.T) { t.Run("GetSubject_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *ReceivedEmailSummary + var obj *ReceivedEmail // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -64868,7 +64313,7 @@ func TestGettersReceivedEmailSummary(t *testing.T) { t.Run("GetMessageID", func(t *testing.T) { t.Parallel() // Arrange - obj := &ReceivedEmailSummary{} + obj := &ReceivedEmail{} var expected *string obj.MessageID = expected @@ -64879,7 +64324,7 @@ func TestGettersReceivedEmailSummary(t *testing.T) { t.Run("GetMessageID_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &ReceivedEmailSummary{} + obj := &ReceivedEmail{} obj.MessageID = nil // Act & Assert @@ -64888,7 +64333,7 @@ func TestGettersReceivedEmailSummary(t *testing.T) { t.Run("GetMessageID_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *ReceivedEmailSummary + var obj *ReceivedEmail // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -64901,7 +64346,7 @@ func TestGettersReceivedEmailSummary(t *testing.T) { t.Run("GetAttachments", func(t *testing.T) { t.Parallel() // Arrange - obj := &ReceivedEmailSummary{} + obj := &ReceivedEmail{} var expected []*ReceivedEmailAttachment obj.Attachments = expected @@ -64912,7 +64357,7 @@ func TestGettersReceivedEmailSummary(t *testing.T) { t.Run("GetAttachments_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &ReceivedEmailSummary{} + obj := &ReceivedEmail{} obj.Attachments = nil // Act & Assert @@ -64921,7 +64366,7 @@ func TestGettersReceivedEmailSummary(t *testing.T) { t.Run("GetAttachments_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *ReceivedEmailSummary + var obj *ReceivedEmail // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -64934,7 +64379,7 @@ func TestGettersReceivedEmailSummary(t *testing.T) { t.Run("GetSize", func(t *testing.T) { t.Parallel() // Arrange - obj := &ReceivedEmailSummary{} + obj := &ReceivedEmail{} var expected int64 obj.Size = expected @@ -64944,7 +64389,7 @@ func TestGettersReceivedEmailSummary(t *testing.T) { t.Run("GetSize_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *ReceivedEmailSummary + var obj *ReceivedEmail // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -64957,7 +64402,7 @@ func TestGettersReceivedEmailSummary(t *testing.T) { t.Run("GetSpam", func(t *testing.T) { t.Parallel() // Arrange - obj := &ReceivedEmailSummary{} + obj := &ReceivedEmail{} var expected bool obj.Spam = expected @@ -64967,7 +64412,7 @@ func TestGettersReceivedEmailSummary(t *testing.T) { t.Run("GetSpam_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *ReceivedEmailSummary + var obj *ReceivedEmail // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -64980,7 +64425,7 @@ func TestGettersReceivedEmailSummary(t *testing.T) { t.Run("GetVerdicts", func(t *testing.T) { t.Parallel() // Arrange - obj := &ReceivedEmailSummary{} + obj := &ReceivedEmail{} var expected *ReceivedEmailVerdicts obj.Verdicts = expected @@ -64991,7 +64436,7 @@ func TestGettersReceivedEmailSummary(t *testing.T) { t.Run("GetVerdicts_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &ReceivedEmailSummary{} + obj := &ReceivedEmail{} obj.Verdicts = nil // Act & Assert @@ -65000,7 +64445,7 @@ func TestGettersReceivedEmailSummary(t *testing.T) { t.Run("GetVerdicts_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *ReceivedEmailSummary + var obj *ReceivedEmail // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -65013,7 +64458,7 @@ func TestGettersReceivedEmailSummary(t *testing.T) { t.Run("GetSandbox", func(t *testing.T) { t.Parallel() // Arrange - obj := &ReceivedEmailSummary{} + obj := &ReceivedEmail{} var expected bool obj.Sandbox = expected @@ -65023,7 +64468,7 @@ func TestGettersReceivedEmailSummary(t *testing.T) { t.Run("GetSandbox_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *ReceivedEmailSummary + var obj *ReceivedEmail // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -65036,7 +64481,7 @@ func TestGettersReceivedEmailSummary(t *testing.T) { t.Run("GetReceivedAt", func(t *testing.T) { t.Parallel() // Arrange - obj := &ReceivedEmailSummary{} + obj := &ReceivedEmail{} var expected time.Time obj.ReceivedAt = expected @@ -65046,7 +64491,7 @@ func TestGettersReceivedEmailSummary(t *testing.T) { t.Run("GetReceivedAt_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *ReceivedEmailSummary + var obj *ReceivedEmail // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -65056,14 +64501,268 @@ func TestGettersReceivedEmailSummary(t *testing.T) { _ = obj.GetReceivedAt() // Should return zero value }) + t.Run("GetReplyTo", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &ReceivedEmail{} + var expected []string + obj.ReplyTo = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetReplyTo(), "getter should return the property value") + }) + + t.Run("GetReplyTo_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &ReceivedEmail{} + obj.ReplyTo = nil + + // Act & Assert + assert.Nil(t, obj.GetReplyTo(), "getter should return nil when property is nil") + }) + + t.Run("GetReplyTo_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *ReceivedEmail + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetReplyTo() // Should return zero value + }) + + t.Run("GetInReplyTo", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &ReceivedEmail{} + var expected *string + obj.InReplyTo = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetInReplyTo(), "getter should return the property value") + }) + + t.Run("GetInReplyTo_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &ReceivedEmail{} + obj.InReplyTo = nil + + // Act & Assert + assert.Nil(t, obj.GetInReplyTo(), "getter should return nil when property is nil") + }) + + t.Run("GetInReplyTo_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *ReceivedEmail + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetInReplyTo() // Should return zero value + }) + + t.Run("GetReferences", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &ReceivedEmail{} + var expected []string + obj.References = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetReferences(), "getter should return the property value") + }) + + t.Run("GetReferences_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &ReceivedEmail{} + obj.References = nil + + // Act & Assert + assert.Nil(t, obj.GetReferences(), "getter should return nil when property is nil") + }) + + t.Run("GetReferences_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *ReceivedEmail + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetReferences() // Should return zero value + }) + + t.Run("GetSentAt", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &ReceivedEmail{} + var expected *time.Time + obj.SentAt = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetSentAt(), "getter should return the property value") + }) + + t.Run("GetSentAt_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &ReceivedEmail{} + obj.SentAt = nil + + // Act & Assert + assert.Nil(t, obj.GetSentAt(), "getter should return nil when property is nil") + }) + + t.Run("GetSentAt_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *ReceivedEmail + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetSentAt() // Should return zero value + }) + + t.Run("GetHeaders", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &ReceivedEmail{} + var expected []*ReceivedEmailHeadersItem + obj.Headers = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetHeaders(), "getter should return the property value") + }) + + t.Run("GetHeaders_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &ReceivedEmail{} + obj.Headers = nil + + // Act & Assert + assert.Nil(t, obj.GetHeaders(), "getter should return nil when property is nil") + }) + + t.Run("GetHeaders_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *ReceivedEmail + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetHeaders() // Should return zero value + }) + + t.Run("GetText", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &ReceivedEmail{} + var expected *string + obj.Text = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetText(), "getter should return the property value") + }) + + t.Run("GetText_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &ReceivedEmail{} + obj.Text = nil + + // Act & Assert + assert.Nil(t, obj.GetText(), "getter should return nil when property is nil") + }) + + t.Run("GetText_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *ReceivedEmail + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetText() // Should return zero value + }) + + t.Run("GetHTML", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &ReceivedEmail{} + var expected *string + obj.HTML = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetHTML(), "getter should return the property value") + }) + + t.Run("GetHTML_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &ReceivedEmail{} + obj.HTML = nil + + // Act & Assert + assert.Nil(t, obj.GetHTML(), "getter should return nil when property is nil") + }) + + t.Run("GetHTML_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *ReceivedEmail + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetHTML() // Should return zero value + }) + + t.Run("GetTruncated", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &ReceivedEmail{} + var expected bool + obj.Truncated = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetTruncated(), "getter should return the property value") + }) + + t.Run("GetTruncated_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *ReceivedEmail + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetTruncated() // Should return zero value + }) + } -func TestSettersMarkExplicitReceivedEmailSummary(t *testing.T) { +func TestSettersMarkExplicitReceivedEmail(t *testing.T) { t.Run("SetObject_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &ReceivedEmailSummary{} - var fernTestValueObject ReceivedEmailSummaryObject + obj := &ReceivedEmail{} + var fernTestValueObject ReceivedEmailObject // Act obj.SetObject(fernTestValueObject) @@ -65093,7 +64792,7 @@ func TestSettersMarkExplicitReceivedEmailSummary(t *testing.T) { t.Run("SetID_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &ReceivedEmailSummary{} + obj := &ReceivedEmail{} var fernTestValueID string // Act @@ -65124,8 +64823,8 @@ func TestSettersMarkExplicitReceivedEmailSummary(t *testing.T) { t.Run("SetStatus_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &ReceivedEmailSummary{} - var fernTestValueStatus ReceivedEmailSummaryStatus + obj := &ReceivedEmail{} + var fernTestValueStatus ReceivedEmailStatus // Act obj.SetStatus(fernTestValueStatus) @@ -65155,8 +64854,8 @@ func TestSettersMarkExplicitReceivedEmailSummary(t *testing.T) { t.Run("SetBlockedReason_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &ReceivedEmailSummary{} - var fernTestValueBlockedReason *ReceivedEmailSummaryBlockedReason + obj := &ReceivedEmail{} + var fernTestValueBlockedReason *ReceivedEmailBlockedReason // Act obj.SetBlockedReason(fernTestValueBlockedReason) @@ -65186,7 +64885,7 @@ func TestSettersMarkExplicitReceivedEmailSummary(t *testing.T) { t.Run("SetMailFrom_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &ReceivedEmailSummary{} + obj := &ReceivedEmail{} var fernTestValueMailFrom string // Act @@ -65217,7 +64916,7 @@ func TestSettersMarkExplicitReceivedEmailSummary(t *testing.T) { t.Run("SetRecipients_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &ReceivedEmailSummary{} + obj := &ReceivedEmail{} var fernTestValueRecipients []string // Act @@ -65248,7 +64947,7 @@ func TestSettersMarkExplicitReceivedEmailSummary(t *testing.T) { t.Run("SetFrom_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &ReceivedEmailSummary{} + obj := &ReceivedEmail{} var fernTestValueFrom *string // Act @@ -65279,7 +64978,7 @@ func TestSettersMarkExplicitReceivedEmailSummary(t *testing.T) { t.Run("SetTo_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &ReceivedEmailSummary{} + obj := &ReceivedEmail{} var fernTestValueTo []string // Act @@ -65310,7 +65009,7 @@ func TestSettersMarkExplicitReceivedEmailSummary(t *testing.T) { t.Run("SetCc_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &ReceivedEmailSummary{} + obj := &ReceivedEmail{} var fernTestValueCc []string // Act @@ -65341,7 +65040,7 @@ func TestSettersMarkExplicitReceivedEmailSummary(t *testing.T) { t.Run("SetSubject_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &ReceivedEmailSummary{} + obj := &ReceivedEmail{} var fernTestValueSubject *string // Act @@ -65372,7 +65071,7 @@ func TestSettersMarkExplicitReceivedEmailSummary(t *testing.T) { t.Run("SetMessageID_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &ReceivedEmailSummary{} + obj := &ReceivedEmail{} var fernTestValueMessageID *string // Act @@ -65403,7 +65102,7 @@ func TestSettersMarkExplicitReceivedEmailSummary(t *testing.T) { t.Run("SetAttachments_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &ReceivedEmailSummary{} + obj := &ReceivedEmail{} var fernTestValueAttachments []*ReceivedEmailAttachment // Act @@ -65434,7 +65133,7 @@ func TestSettersMarkExplicitReceivedEmailSummary(t *testing.T) { t.Run("SetSize_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &ReceivedEmailSummary{} + obj := &ReceivedEmail{} var fernTestValueSize int64 // Act @@ -65465,7 +65164,7 @@ func TestSettersMarkExplicitReceivedEmailSummary(t *testing.T) { t.Run("SetSpam_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &ReceivedEmailSummary{} + obj := &ReceivedEmail{} var fernTestValueSpam bool // Act @@ -65496,7 +65195,7 @@ func TestSettersMarkExplicitReceivedEmailSummary(t *testing.T) { t.Run("SetVerdicts_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &ReceivedEmailSummary{} + obj := &ReceivedEmail{} var fernTestValueVerdicts *ReceivedEmailVerdicts // Act @@ -65527,7 +65226,7 @@ func TestSettersMarkExplicitReceivedEmailSummary(t *testing.T) { t.Run("SetSandbox_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &ReceivedEmailSummary{} + obj := &ReceivedEmail{} var fernTestValueSandbox bool // Act @@ -65558,7 +65257,7 @@ func TestSettersMarkExplicitReceivedEmailSummary(t *testing.T) { t.Run("SetReceivedAt_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &ReceivedEmailSummary{} + obj := &ReceivedEmail{} var fernTestValueReceivedAt time.Time // Act @@ -65586,300 +65285,107 @@ func TestSettersMarkExplicitReceivedEmailSummary(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) -} + t.Run("SetReplyTo_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &ReceivedEmail{} + var fernTestValueReplyTo []string -func TestSettersReceivedEmailVerdicts(t *testing.T) { - t.Run("SetSpam", func(t *testing.T) { - obj := &ReceivedEmailVerdicts{} - var fernTestValueSpam *ReceivedEmailVerdictsSpam - obj.SetSpam(fernTestValueSpam) - assert.Equal(t, fernTestValueSpam, obj.Spam) - assert.NotNil(t, obj.explicitFields) - }) + // Act + obj.SetReplyTo(fernTestValueReplyTo) - t.Run("SetVirus", func(t *testing.T) { - obj := &ReceivedEmailVerdicts{} - var fernTestValueVirus *ReceivedEmailVerdictsVirus - obj.SetVirus(fernTestValueVirus) - assert.Equal(t, fernTestValueVirus, obj.Virus) - assert.NotNil(t, obj.explicitFields) - }) + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") - t.Run("SetSpf", func(t *testing.T) { - obj := &ReceivedEmailVerdicts{} - var fernTestValueSpf *ReceivedEmailVerdictsSpf - obj.SetSpf(fernTestValueSpf) - assert.Equal(t, fernTestValueSpf, obj.Spf) - assert.NotNil(t, obj.explicitFields) - }) + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } - t.Run("SetDkim", func(t *testing.T) { - obj := &ReceivedEmailVerdicts{} - var fernTestValueDkim *ReceivedEmailVerdictsDkim - obj.SetDkim(fernTestValueDkim) - assert.Equal(t, fernTestValueDkim, obj.Dkim) - assert.NotNil(t, obj.explicitFields) + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetDmarc", func(t *testing.T) { - obj := &ReceivedEmailVerdicts{} - var fernTestValueDmarc *ReceivedEmailVerdictsDmarc - obj.SetDmarc(fernTestValueDmarc) - assert.Equal(t, fernTestValueDmarc, obj.Dmarc) - assert.NotNil(t, obj.explicitFields) - }) + t.Run("SetInReplyTo_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &ReceivedEmail{} + var fernTestValueInReplyTo *string - t.Run("SetDmarcPolicy", func(t *testing.T) { - obj := &ReceivedEmailVerdicts{} - var fernTestValueDmarcPolicy *string - obj.SetDmarcPolicy(fernTestValueDmarcPolicy) - assert.Equal(t, fernTestValueDmarcPolicy, obj.DmarcPolicy) - assert.NotNil(t, obj.explicitFields) - }) + // Act + obj.SetInReplyTo(fernTestValueInReplyTo) -} + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") -func TestGettersReceivedEmailVerdicts(t *testing.T) { - t.Run("GetSpam", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &ReceivedEmailVerdicts{} - var expected *ReceivedEmailVerdictsSpam - obj.Spam = expected + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } - // Act & Assert - assert.Equal(t, expected, obj.GetSpam(), "getter should return the property value") + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("GetSpam_NilValue", func(t *testing.T) { + t.Run("SetReferences_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &ReceivedEmailVerdicts{} - obj.Spam = nil + obj := &ReceivedEmail{} + var fernTestValueReferences []string - // Act & Assert - assert.Nil(t, obj.GetSpam(), "getter should return nil when property is nil") - }) + // Act + obj.SetReferences(fernTestValueReferences) - t.Run("GetSpam_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *ReceivedEmailVerdicts - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetSpam() // Should return zero value - }) + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") - t.Run("GetVirus", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &ReceivedEmailVerdicts{} - var expected *ReceivedEmailVerdictsVirus - obj.Virus = expected + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } - // Act & Assert - assert.Equal(t, expected, obj.GetVirus(), "getter should return the property value") + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("GetVirus_NilValue", func(t *testing.T) { + t.Run("SetSentAt_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &ReceivedEmailVerdicts{} - obj.Virus = nil + obj := &ReceivedEmail{} + var fernTestValueSentAt *time.Time - // Act & Assert - assert.Nil(t, obj.GetVirus(), "getter should return nil when property is nil") - }) - - t.Run("GetVirus_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *ReceivedEmailVerdicts - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetVirus() // Should return zero value - }) - - t.Run("GetSpf", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &ReceivedEmailVerdicts{} - var expected *ReceivedEmailVerdictsSpf - obj.Spf = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetSpf(), "getter should return the property value") - }) - - t.Run("GetSpf_NilValue", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &ReceivedEmailVerdicts{} - obj.Spf = nil - - // Act & Assert - assert.Nil(t, obj.GetSpf(), "getter should return nil when property is nil") - }) - - t.Run("GetSpf_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *ReceivedEmailVerdicts - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetSpf() // Should return zero value - }) - - t.Run("GetDkim", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &ReceivedEmailVerdicts{} - var expected *ReceivedEmailVerdictsDkim - obj.Dkim = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetDkim(), "getter should return the property value") - }) - - t.Run("GetDkim_NilValue", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &ReceivedEmailVerdicts{} - obj.Dkim = nil - - // Act & Assert - assert.Nil(t, obj.GetDkim(), "getter should return nil when property is nil") - }) - - t.Run("GetDkim_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *ReceivedEmailVerdicts - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetDkim() // Should return zero value - }) - - t.Run("GetDmarc", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &ReceivedEmailVerdicts{} - var expected *ReceivedEmailVerdictsDmarc - obj.Dmarc = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetDmarc(), "getter should return the property value") - }) - - t.Run("GetDmarc_NilValue", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &ReceivedEmailVerdicts{} - obj.Dmarc = nil - - // Act & Assert - assert.Nil(t, obj.GetDmarc(), "getter should return nil when property is nil") - }) - - t.Run("GetDmarc_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *ReceivedEmailVerdicts - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetDmarc() // Should return zero value - }) - - t.Run("GetDmarcPolicy", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &ReceivedEmailVerdicts{} - var expected *string - obj.DmarcPolicy = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetDmarcPolicy(), "getter should return the property value") - }) - - t.Run("GetDmarcPolicy_NilValue", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &ReceivedEmailVerdicts{} - obj.DmarcPolicy = nil - - // Act & Assert - assert.Nil(t, obj.GetDmarcPolicy(), "getter should return nil when property is nil") - }) - - t.Run("GetDmarcPolicy_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *ReceivedEmailVerdicts - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetDmarcPolicy() // Should return zero value - }) - -} - -func TestSettersMarkExplicitReceivedEmailVerdicts(t *testing.T) { - t.Run("SetSpam_MarksExplicit", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &ReceivedEmailVerdicts{} - var fernTestValueSpam *ReceivedEmailVerdictsSpam - - // Act - obj.SetSpam(fernTestValueSpam) - - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") - - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } - - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip - }) - - t.Run("SetVirus_MarksExplicit", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &ReceivedEmailVerdicts{} - var fernTestValueVirus *ReceivedEmailVerdictsVirus - - // Act - obj.SetVirus(fernTestValueVirus) + // Act + obj.SetSentAt(fernTestValueSentAt) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -65903,14 +65409,14 @@ func TestSettersMarkExplicitReceivedEmailVerdicts(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetSpf_MarksExplicit", func(t *testing.T) { + t.Run("SetHeaders_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &ReceivedEmailVerdicts{} - var fernTestValueSpf *ReceivedEmailVerdictsSpf + obj := &ReceivedEmail{} + var fernTestValueHeaders []*ReceivedEmailHeadersItem // Act - obj.SetSpf(fernTestValueSpf) + obj.SetHeaders(fernTestValueHeaders) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -65934,14 +65440,14 @@ func TestSettersMarkExplicitReceivedEmailVerdicts(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetDkim_MarksExplicit", func(t *testing.T) { + t.Run("SetText_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &ReceivedEmailVerdicts{} - var fernTestValueDkim *ReceivedEmailVerdictsDkim + obj := &ReceivedEmail{} + var fernTestValueText *string // Act - obj.SetDkim(fernTestValueDkim) + obj.SetText(fernTestValueText) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -65965,14 +65471,14 @@ func TestSettersMarkExplicitReceivedEmailVerdicts(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetDmarc_MarksExplicit", func(t *testing.T) { + t.Run("SetHTML_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &ReceivedEmailVerdicts{} - var fernTestValueDmarc *ReceivedEmailVerdictsDmarc + obj := &ReceivedEmail{} + var fernTestValueHTML *string // Act - obj.SetDmarc(fernTestValueDmarc) + obj.SetHTML(fernTestValueHTML) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -65996,14 +65502,14 @@ func TestSettersMarkExplicitReceivedEmailVerdicts(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetDmarcPolicy_MarksExplicit", func(t *testing.T) { + t.Run("SetTruncated_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &ReceivedEmailVerdicts{} - var fernTestValueDmarcPolicy *string + obj := &ReceivedEmail{} + var fernTestValueTruncated bool // Act - obj.SetDmarcPolicy(fernTestValueDmarcPolicy) + obj.SetTruncated(fernTestValueTruncated) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -66029,109 +65535,62 @@ func TestSettersMarkExplicitReceivedEmailVerdicts(t *testing.T) { } -func TestSettersReceivedSms(t *testing.T) { - t.Run("SetObject", func(t *testing.T) { - obj := &ReceivedSms{} - var fernTestValueObject ReceivedSmsObject - obj.SetObject(fernTestValueObject) - assert.Equal(t, fernTestValueObject, obj.Object) - assert.NotNil(t, obj.explicitFields) - }) - +func TestSettersReceivedEmailAttachment(t *testing.T) { t.Run("SetID", func(t *testing.T) { - obj := &ReceivedSms{} + obj := &ReceivedEmailAttachment{} var fernTestValueID string obj.SetID(fernTestValueID) assert.Equal(t, fernTestValueID, obj.ID) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetFrom", func(t *testing.T) { - obj := &ReceivedSms{} - var fernTestValueFrom string - obj.SetFrom(fernTestValueFrom) - assert.Equal(t, fernTestValueFrom, obj.From) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetTo", func(t *testing.T) { - obj := &ReceivedSms{} - var fernTestValueTo string - obj.SetTo(fernTestValueTo) - assert.Equal(t, fernTestValueTo, obj.To) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetBody", func(t *testing.T) { - obj := &ReceivedSms{} - var fernTestValueBody string - obj.SetBody(fernTestValueBody) - assert.Equal(t, fernTestValueBody, obj.Body) + t.Run("SetFilename", func(t *testing.T) { + obj := &ReceivedEmailAttachment{} + var fernTestValueFilename *string + obj.SetFilename(fernTestValueFilename) + assert.Equal(t, fernTestValueFilename, obj.Filename) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetSegments", func(t *testing.T) { - obj := &ReceivedSms{} - var fernTestValueSegments int64 - obj.SetSegments(fernTestValueSegments) - assert.Equal(t, fernTestValueSegments, obj.Segments) + t.Run("SetContentType", func(t *testing.T) { + obj := &ReceivedEmailAttachment{} + var fernTestValueContentType string + obj.SetContentType(fernTestValueContentType) + assert.Equal(t, fernTestValueContentType, obj.ContentType) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetKeyword", func(t *testing.T) { - obj := &ReceivedSms{} - var fernTestValueKeyword *ReceivedSmsKeyword - obj.SetKeyword(fernTestValueKeyword) - assert.Equal(t, fernTestValueKeyword, obj.Keyword) + t.Run("SetContentID", func(t *testing.T) { + obj := &ReceivedEmailAttachment{} + var fernTestValueContentID *string + obj.SetContentID(fernTestValueContentID) + assert.Equal(t, fernTestValueContentID, obj.ContentID) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetSandbox", func(t *testing.T) { - obj := &ReceivedSms{} - var fernTestValueSandbox bool - obj.SetSandbox(fernTestValueSandbox) - assert.Equal(t, fernTestValueSandbox, obj.Sandbox) + t.Run("SetDisposition", func(t *testing.T) { + obj := &ReceivedEmailAttachment{} + var fernTestValueDisposition ReceivedEmailAttachmentDisposition + obj.SetDisposition(fernTestValueDisposition) + assert.Equal(t, fernTestValueDisposition, obj.Disposition) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetCreatedAt", func(t *testing.T) { - obj := &ReceivedSms{} - var fernTestValueCreatedAt time.Time - obj.SetCreatedAt(fernTestValueCreatedAt) - assert.Equal(t, fernTestValueCreatedAt, obj.CreatedAt) + t.Run("SetSize", func(t *testing.T) { + obj := &ReceivedEmailAttachment{} + var fernTestValueSize int64 + obj.SetSize(fernTestValueSize) + assert.Equal(t, fernTestValueSize, obj.Size) assert.NotNil(t, obj.explicitFields) }) } -func TestGettersReceivedSms(t *testing.T) { - t.Run("GetObject", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &ReceivedSms{} - var expected ReceivedSmsObject - obj.Object = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetObject(), "getter should return the property value") - }) - - t.Run("GetObject_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *ReceivedSms - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetObject() // Should return zero value - }) - +func TestGettersReceivedEmailAttachment(t *testing.T) { t.Run("GetID", func(t *testing.T) { t.Parallel() // Arrange - obj := &ReceivedSms{} + obj := &ReceivedEmailAttachment{} var expected string obj.ID = expected @@ -66141,7 +65600,7 @@ func TestGettersReceivedSms(t *testing.T) { t.Run("GetID_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *ReceivedSms + var obj *ReceivedEmailAttachment // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -66151,188 +65610,152 @@ func TestGettersReceivedSms(t *testing.T) { _ = obj.GetID() // Should return zero value }) - t.Run("GetFrom", func(t *testing.T) { + t.Run("GetFilename", func(t *testing.T) { t.Parallel() // Arrange - obj := &ReceivedSms{} - var expected string - obj.From = expected + obj := &ReceivedEmailAttachment{} + var expected *string + obj.Filename = expected // Act & Assert - assert.Equal(t, expected, obj.GetFrom(), "getter should return the property value") - }) - - t.Run("GetFrom_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *ReceivedSms - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetFrom() // Should return zero value + assert.Equal(t, expected, obj.GetFilename(), "getter should return the property value") }) - t.Run("GetTo", func(t *testing.T) { + t.Run("GetFilename_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &ReceivedSms{} - var expected string - obj.To = expected + obj := &ReceivedEmailAttachment{} + obj.Filename = nil // Act & Assert - assert.Equal(t, expected, obj.GetTo(), "getter should return the property value") + assert.Nil(t, obj.GetFilename(), "getter should return nil when property is nil") }) - t.Run("GetTo_NilReceiver", func(t *testing.T) { + t.Run("GetFilename_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *ReceivedSms + var obj *ReceivedEmailAttachment // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetTo() // Should return zero value + _ = obj.GetFilename() // Should return zero value }) - t.Run("GetBody", func(t *testing.T) { + t.Run("GetContentType", func(t *testing.T) { t.Parallel() // Arrange - obj := &ReceivedSms{} + obj := &ReceivedEmailAttachment{} var expected string - obj.Body = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetBody(), "getter should return the property value") - }) - - t.Run("GetBody_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *ReceivedSms - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetBody() // Should return zero value - }) - - t.Run("GetSegments", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &ReceivedSms{} - var expected int64 - obj.Segments = expected + obj.ContentType = expected // Act & Assert - assert.Equal(t, expected, obj.GetSegments(), "getter should return the property value") + assert.Equal(t, expected, obj.GetContentType(), "getter should return the property value") }) - t.Run("GetSegments_NilReceiver", func(t *testing.T) { + t.Run("GetContentType_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *ReceivedSms + var obj *ReceivedEmailAttachment // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetSegments() // Should return zero value + _ = obj.GetContentType() // Should return zero value }) - t.Run("GetKeyword", func(t *testing.T) { + t.Run("GetContentID", func(t *testing.T) { t.Parallel() // Arrange - obj := &ReceivedSms{} - var expected *ReceivedSmsKeyword - obj.Keyword = expected + obj := &ReceivedEmailAttachment{} + var expected *string + obj.ContentID = expected // Act & Assert - assert.Equal(t, expected, obj.GetKeyword(), "getter should return the property value") + assert.Equal(t, expected, obj.GetContentID(), "getter should return the property value") }) - t.Run("GetKeyword_NilValue", func(t *testing.T) { + t.Run("GetContentID_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &ReceivedSms{} - obj.Keyword = nil + obj := &ReceivedEmailAttachment{} + obj.ContentID = nil // Act & Assert - assert.Nil(t, obj.GetKeyword(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetContentID(), "getter should return nil when property is nil") }) - t.Run("GetKeyword_NilReceiver", func(t *testing.T) { + t.Run("GetContentID_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *ReceivedSms + var obj *ReceivedEmailAttachment // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetKeyword() // Should return zero value + _ = obj.GetContentID() // Should return zero value }) - t.Run("GetSandbox", func(t *testing.T) { + t.Run("GetDisposition", func(t *testing.T) { t.Parallel() // Arrange - obj := &ReceivedSms{} - var expected bool - obj.Sandbox = expected + obj := &ReceivedEmailAttachment{} + var expected ReceivedEmailAttachmentDisposition + obj.Disposition = expected // Act & Assert - assert.Equal(t, expected, obj.GetSandbox(), "getter should return the property value") + assert.Equal(t, expected, obj.GetDisposition(), "getter should return the property value") }) - t.Run("GetSandbox_NilReceiver", func(t *testing.T) { + t.Run("GetDisposition_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *ReceivedSms + var obj *ReceivedEmailAttachment // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetSandbox() // Should return zero value + _ = obj.GetDisposition() // Should return zero value }) - t.Run("GetCreatedAt", func(t *testing.T) { + t.Run("GetSize", func(t *testing.T) { t.Parallel() // Arrange - obj := &ReceivedSms{} - var expected time.Time - obj.CreatedAt = expected + obj := &ReceivedEmailAttachment{} + var expected int64 + obj.Size = expected // Act & Assert - assert.Equal(t, expected, obj.GetCreatedAt(), "getter should return the property value") + assert.Equal(t, expected, obj.GetSize(), "getter should return the property value") }) - t.Run("GetCreatedAt_NilReceiver", func(t *testing.T) { + t.Run("GetSize_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *ReceivedSms + var obj *ReceivedEmailAttachment // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetCreatedAt() // Should return zero value + _ = obj.GetSize() // Should return zero value }) } -func TestSettersMarkExplicitReceivedSms(t *testing.T) { - t.Run("SetObject_MarksExplicit", func(t *testing.T) { +func TestSettersMarkExplicitReceivedEmailAttachment(t *testing.T) { + t.Run("SetID_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &ReceivedSms{} - var fernTestValueObject ReceivedSmsObject + obj := &ReceivedEmailAttachment{} + var fernTestValueID string // Act - obj.SetObject(fernTestValueObject) + obj.SetID(fernTestValueID) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -66356,14 +65779,14 @@ func TestSettersMarkExplicitReceivedSms(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetID_MarksExplicit", func(t *testing.T) { + t.Run("SetFilename_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &ReceivedSms{} - var fernTestValueID string + obj := &ReceivedEmailAttachment{} + var fernTestValueFilename *string // Act - obj.SetID(fernTestValueID) + obj.SetFilename(fernTestValueFilename) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -66387,14 +65810,14 @@ func TestSettersMarkExplicitReceivedSms(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetFrom_MarksExplicit", func(t *testing.T) { + t.Run("SetContentType_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &ReceivedSms{} - var fernTestValueFrom string + obj := &ReceivedEmailAttachment{} + var fernTestValueContentType string // Act - obj.SetFrom(fernTestValueFrom) + obj.SetContentType(fernTestValueContentType) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -66418,14 +65841,14 @@ func TestSettersMarkExplicitReceivedSms(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetTo_MarksExplicit", func(t *testing.T) { + t.Run("SetContentID_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &ReceivedSms{} - var fernTestValueTo string + obj := &ReceivedEmailAttachment{} + var fernTestValueContentID *string // Act - obj.SetTo(fernTestValueTo) + obj.SetContentID(fernTestValueContentID) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -66449,14 +65872,14 @@ func TestSettersMarkExplicitReceivedSms(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetBody_MarksExplicit", func(t *testing.T) { + t.Run("SetDisposition_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &ReceivedSms{} - var fernTestValueBody string + obj := &ReceivedEmailAttachment{} + var fernTestValueDisposition ReceivedEmailAttachmentDisposition // Act - obj.SetBody(fernTestValueBody) + obj.SetDisposition(fernTestValueDisposition) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -66480,14 +65903,14 @@ func TestSettersMarkExplicitReceivedSms(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetSegments_MarksExplicit", func(t *testing.T) { + t.Run("SetSize_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &ReceivedSms{} - var fernTestValueSegments int64 + obj := &ReceivedEmailAttachment{} + var fernTestValueSize int64 // Act - obj.SetSegments(fernTestValueSegments) + obj.SetSize(fernTestValueSize) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -66511,45 +65934,85 @@ func TestSettersMarkExplicitReceivedSms(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetKeyword_MarksExplicit", func(t *testing.T) { +} + +func TestSettersReceivedEmailHeadersItem(t *testing.T) { + t.Run("SetName", func(t *testing.T) { + obj := &ReceivedEmailHeadersItem{} + var fernTestValueName string + obj.SetName(fernTestValueName) + assert.Equal(t, fernTestValueName, obj.Name) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetValue", func(t *testing.T) { + obj := &ReceivedEmailHeadersItem{} + var fernTestValueValue string + obj.SetValue(fernTestValueValue) + assert.Equal(t, fernTestValueValue, obj.Value) + assert.NotNil(t, obj.explicitFields) + }) + +} + +func TestGettersReceivedEmailHeadersItem(t *testing.T) { + t.Run("GetName", func(t *testing.T) { t.Parallel() // Arrange - obj := &ReceivedSms{} - var fernTestValueKeyword *ReceivedSmsKeyword + obj := &ReceivedEmailHeadersItem{} + var expected string + obj.Name = expected - // Act - obj.SetKeyword(fernTestValueKeyword) + // Act & Assert + assert.Equal(t, expected, obj.GetName(), "getter should return the property value") + }) - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") + t.Run("GetName_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *ReceivedEmailHeadersItem + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetName() // Should return zero value + }) - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } + t.Run("GetValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &ReceivedEmailHeadersItem{} + var expected string + obj.Value = expected - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip + // Act & Assert + assert.Equal(t, expected, obj.GetValue(), "getter should return the property value") }) - t.Run("SetSandbox_MarksExplicit", func(t *testing.T) { + t.Run("GetValue_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *ReceivedEmailHeadersItem + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetValue() // Should return zero value + }) + +} + +func TestSettersMarkExplicitReceivedEmailHeadersItem(t *testing.T) { + t.Run("SetName_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &ReceivedSms{} - var fernTestValueSandbox bool + obj := &ReceivedEmailHeadersItem{} + var fernTestValueName string // Act - obj.SetSandbox(fernTestValueSandbox) + obj.SetName(fernTestValueName) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -66573,14 +66036,14 @@ func TestSettersMarkExplicitReceivedSms(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetCreatedAt_MarksExplicit", func(t *testing.T) { + t.Run("SetValue_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &ReceivedSms{} - var fernTestValueCreatedAt time.Time + obj := &ReceivedEmailHeadersItem{} + var fernTestValueValue string // Act - obj.SetCreatedAt(fernTestValueCreatedAt) + obj.SetValue(fernTestValueValue) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -66606,25 +66069,25 @@ func TestSettersMarkExplicitReceivedSms(t *testing.T) { } -func TestSettersReceivedSmsList(t *testing.T) { +func TestSettersReceivedEmailList(t *testing.T) { t.Run("SetObject", func(t *testing.T) { - obj := &ReceivedSmsList{} - var fernTestValueObject ReceivedSmsListObject + obj := &ReceivedEmailList{} + var fernTestValueObject ReceivedEmailListObject obj.SetObject(fernTestValueObject) assert.Equal(t, fernTestValueObject, obj.Object) assert.NotNil(t, obj.explicitFields) }) t.Run("SetData", func(t *testing.T) { - obj := &ReceivedSmsList{} - var fernTestValueData []*ReceivedSms + obj := &ReceivedEmailList{} + var fernTestValueData []*ReceivedEmailSummary obj.SetData(fernTestValueData) assert.Equal(t, fernTestValueData, obj.Data) assert.NotNil(t, obj.explicitFields) }) t.Run("SetHasMore", func(t *testing.T) { - obj := &ReceivedSmsList{} + obj := &ReceivedEmailList{} var fernTestValueHasMore bool obj.SetHasMore(fernTestValueHasMore) assert.Equal(t, fernTestValueHasMore, obj.HasMore) @@ -66633,12 +66096,12 @@ func TestSettersReceivedSmsList(t *testing.T) { } -func TestGettersReceivedSmsList(t *testing.T) { +func TestGettersReceivedEmailList(t *testing.T) { t.Run("GetObject", func(t *testing.T) { t.Parallel() // Arrange - obj := &ReceivedSmsList{} - var expected ReceivedSmsListObject + obj := &ReceivedEmailList{} + var expected ReceivedEmailListObject obj.Object = expected // Act & Assert @@ -66647,7 +66110,7 @@ func TestGettersReceivedSmsList(t *testing.T) { t.Run("GetObject_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *ReceivedSmsList + var obj *ReceivedEmailList // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -66660,8 +66123,8 @@ func TestGettersReceivedSmsList(t *testing.T) { t.Run("GetData", func(t *testing.T) { t.Parallel() // Arrange - obj := &ReceivedSmsList{} - var expected []*ReceivedSms + obj := &ReceivedEmailList{} + var expected []*ReceivedEmailSummary obj.Data = expected // Act & Assert @@ -66671,7 +66134,7 @@ func TestGettersReceivedSmsList(t *testing.T) { t.Run("GetData_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &ReceivedSmsList{} + obj := &ReceivedEmailList{} obj.Data = nil // Act & Assert @@ -66680,7 +66143,7 @@ func TestGettersReceivedSmsList(t *testing.T) { t.Run("GetData_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *ReceivedSmsList + var obj *ReceivedEmailList // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -66693,7 +66156,7 @@ func TestGettersReceivedSmsList(t *testing.T) { t.Run("GetHasMore", func(t *testing.T) { t.Parallel() // Arrange - obj := &ReceivedSmsList{} + obj := &ReceivedEmailList{} var expected bool obj.HasMore = expected @@ -66703,7 +66166,7 @@ func TestGettersReceivedSmsList(t *testing.T) { t.Run("GetHasMore_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *ReceivedSmsList + var obj *ReceivedEmailList // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -66715,12 +66178,12 @@ func TestGettersReceivedSmsList(t *testing.T) { } -func TestSettersMarkExplicitReceivedSmsList(t *testing.T) { +func TestSettersMarkExplicitReceivedEmailList(t *testing.T) { t.Run("SetObject_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &ReceivedSmsList{} - var fernTestValueObject ReceivedSmsListObject + obj := &ReceivedEmailList{} + var fernTestValueObject ReceivedEmailListObject // Act obj.SetObject(fernTestValueObject) @@ -66750,8 +66213,8 @@ func TestSettersMarkExplicitReceivedSmsList(t *testing.T) { t.Run("SetData_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &ReceivedSmsList{} - var fernTestValueData []*ReceivedSms + obj := &ReceivedEmailList{} + var fernTestValueData []*ReceivedEmailSummary // Act obj.SetData(fernTestValueData) @@ -66781,7 +66244,7 @@ func TestSettersMarkExplicitReceivedSmsList(t *testing.T) { t.Run("SetHasMore_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &ReceivedSmsList{} + obj := &ReceivedEmailList{} var fernTestValueHasMore bool // Act @@ -66811,556 +66274,638 @@ func TestSettersMarkExplicitReceivedSmsList(t *testing.T) { } -func TestSettersReceivingDomain(t *testing.T) { - t.Run("SetHostname", func(t *testing.T) { - obj := &ReceivingDomain{} - var fernTestValueHostname string - obj.SetHostname(fernTestValueHostname) - assert.Equal(t, fernTestValueHostname, obj.Hostname) +func TestSettersReceivedEmailSummary(t *testing.T) { + t.Run("SetObject", func(t *testing.T) { + obj := &ReceivedEmailSummary{} + var fernTestValueObject ReceivedEmailSummaryObject + obj.SetObject(fernTestValueObject) + assert.Equal(t, fernTestValueObject, obj.Object) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetEnvironmentID", func(t *testing.T) { - obj := &ReceivingDomain{} - var fernTestValueEnvironmentID string - obj.SetEnvironmentID(fernTestValueEnvironmentID) - assert.Equal(t, fernTestValueEnvironmentID, obj.EnvironmentID) + t.Run("SetID", func(t *testing.T) { + obj := &ReceivedEmailSummary{} + var fernTestValueID string + obj.SetID(fernTestValueID) + assert.Equal(t, fernTestValueID, obj.ID) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetRecord", func(t *testing.T) { - obj := &ReceivingDomain{} - var fernTestValueRecord *ReceivingDomainRecord - obj.SetRecord(fernTestValueRecord) - assert.Equal(t, fernTestValueRecord, obj.Record) + t.Run("SetStatus", func(t *testing.T) { + obj := &ReceivedEmailSummary{} + var fernTestValueStatus ReceivedEmailSummaryStatus + obj.SetStatus(fernTestValueStatus) + assert.Equal(t, fernTestValueStatus, obj.Status) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetCreatedAt", func(t *testing.T) { - obj := &ReceivingDomain{} - var fernTestValueCreatedAt time.Time - obj.SetCreatedAt(fernTestValueCreatedAt) - assert.Equal(t, fernTestValueCreatedAt, obj.CreatedAt) + t.Run("SetBlockedReason", func(t *testing.T) { + obj := &ReceivedEmailSummary{} + var fernTestValueBlockedReason *ReceivedEmailSummaryBlockedReason + obj.SetBlockedReason(fernTestValueBlockedReason) + assert.Equal(t, fernTestValueBlockedReason, obj.BlockedReason) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetLastCheckedAt", func(t *testing.T) { - obj := &ReceivingDomain{} - var fernTestValueLastCheckedAt *time.Time - obj.SetLastCheckedAt(fernTestValueLastCheckedAt) - assert.Equal(t, fernTestValueLastCheckedAt, obj.LastCheckedAt) + t.Run("SetMailFrom", func(t *testing.T) { + obj := &ReceivedEmailSummary{} + var fernTestValueMailFrom string + obj.SetMailFrom(fernTestValueMailFrom) + assert.Equal(t, fernTestValueMailFrom, obj.MailFrom) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetRecipients", func(t *testing.T) { + obj := &ReceivedEmailSummary{} + var fernTestValueRecipients []string + obj.SetRecipients(fernTestValueRecipients) + assert.Equal(t, fernTestValueRecipients, obj.Recipients) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetFrom", func(t *testing.T) { + obj := &ReceivedEmailSummary{} + var fernTestValueFrom *string + obj.SetFrom(fernTestValueFrom) + assert.Equal(t, fernTestValueFrom, obj.From) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetTo", func(t *testing.T) { + obj := &ReceivedEmailSummary{} + var fernTestValueTo []string + obj.SetTo(fernTestValueTo) + assert.Equal(t, fernTestValueTo, obj.To) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetCc", func(t *testing.T) { + obj := &ReceivedEmailSummary{} + var fernTestValueCc []string + obj.SetCc(fernTestValueCc) + assert.Equal(t, fernTestValueCc, obj.Cc) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetSubject", func(t *testing.T) { + obj := &ReceivedEmailSummary{} + var fernTestValueSubject *string + obj.SetSubject(fernTestValueSubject) + assert.Equal(t, fernTestValueSubject, obj.Subject) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetMessageID", func(t *testing.T) { + obj := &ReceivedEmailSummary{} + var fernTestValueMessageID *string + obj.SetMessageID(fernTestValueMessageID) + assert.Equal(t, fernTestValueMessageID, obj.MessageID) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetAttachments", func(t *testing.T) { + obj := &ReceivedEmailSummary{} + var fernTestValueAttachments []*ReceivedEmailAttachment + obj.SetAttachments(fernTestValueAttachments) + assert.Equal(t, fernTestValueAttachments, obj.Attachments) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetSize", func(t *testing.T) { + obj := &ReceivedEmailSummary{} + var fernTestValueSize int64 + obj.SetSize(fernTestValueSize) + assert.Equal(t, fernTestValueSize, obj.Size) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetSpam", func(t *testing.T) { + obj := &ReceivedEmailSummary{} + var fernTestValueSpam bool + obj.SetSpam(fernTestValueSpam) + assert.Equal(t, fernTestValueSpam, obj.Spam) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetVerdicts", func(t *testing.T) { + obj := &ReceivedEmailSummary{} + var fernTestValueVerdicts *ReceivedEmailVerdicts + obj.SetVerdicts(fernTestValueVerdicts) + assert.Equal(t, fernTestValueVerdicts, obj.Verdicts) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetSandbox", func(t *testing.T) { + obj := &ReceivedEmailSummary{} + var fernTestValueSandbox bool + obj.SetSandbox(fernTestValueSandbox) + assert.Equal(t, fernTestValueSandbox, obj.Sandbox) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetReceivedAt", func(t *testing.T) { + obj := &ReceivedEmailSummary{} + var fernTestValueReceivedAt time.Time + obj.SetReceivedAt(fernTestValueReceivedAt) + assert.Equal(t, fernTestValueReceivedAt, obj.ReceivedAt) assert.NotNil(t, obj.explicitFields) }) } -func TestGettersReceivingDomain(t *testing.T) { - t.Run("GetHostname", func(t *testing.T) { +func TestGettersReceivedEmailSummary(t *testing.T) { + t.Run("GetObject", func(t *testing.T) { t.Parallel() // Arrange - obj := &ReceivingDomain{} - var expected string - obj.Hostname = expected + obj := &ReceivedEmailSummary{} + var expected ReceivedEmailSummaryObject + obj.Object = expected // Act & Assert - assert.Equal(t, expected, obj.GetHostname(), "getter should return the property value") + assert.Equal(t, expected, obj.GetObject(), "getter should return the property value") }) - t.Run("GetHostname_NilReceiver", func(t *testing.T) { + t.Run("GetObject_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *ReceivingDomain + var obj *ReceivedEmailSummary // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetHostname() // Should return zero value + _ = obj.GetObject() // Should return zero value }) - t.Run("GetEnvironmentID", func(t *testing.T) { + t.Run("GetID", func(t *testing.T) { t.Parallel() // Arrange - obj := &ReceivingDomain{} + obj := &ReceivedEmailSummary{} var expected string - obj.EnvironmentID = expected + obj.ID = expected // Act & Assert - assert.Equal(t, expected, obj.GetEnvironmentID(), "getter should return the property value") + assert.Equal(t, expected, obj.GetID(), "getter should return the property value") }) - t.Run("GetEnvironmentID_NilReceiver", func(t *testing.T) { + t.Run("GetID_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *ReceivingDomain + var obj *ReceivedEmailSummary // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetEnvironmentID() // Should return zero value + _ = obj.GetID() // Should return zero value }) - t.Run("GetRecord", func(t *testing.T) { + t.Run("GetStatus", func(t *testing.T) { t.Parallel() // Arrange - obj := &ReceivingDomain{} - var expected *ReceivingDomainRecord - obj.Record = expected + obj := &ReceivedEmailSummary{} + var expected ReceivedEmailSummaryStatus + obj.Status = expected // Act & Assert - assert.Equal(t, expected, obj.GetRecord(), "getter should return the property value") + assert.Equal(t, expected, obj.GetStatus(), "getter should return the property value") }) - t.Run("GetRecord_NilValue", func(t *testing.T) { + t.Run("GetStatus_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *ReceivedEmailSummary + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetStatus() // Should return zero value + }) + + t.Run("GetBlockedReason", func(t *testing.T) { t.Parallel() // Arrange - obj := &ReceivingDomain{} - obj.Record = nil + obj := &ReceivedEmailSummary{} + var expected *ReceivedEmailSummaryBlockedReason + obj.BlockedReason = expected // Act & Assert - assert.Nil(t, obj.GetRecord(), "getter should return nil when property is nil") + assert.Equal(t, expected, obj.GetBlockedReason(), "getter should return the property value") }) - t.Run("GetRecord_NilReceiver", func(t *testing.T) { + t.Run("GetBlockedReason_NilValue", func(t *testing.T) { t.Parallel() - var obj *ReceivingDomain + // Arrange + obj := &ReceivedEmailSummary{} + obj.BlockedReason = nil + + // Act & Assert + assert.Nil(t, obj.GetBlockedReason(), "getter should return nil when property is nil") + }) + + t.Run("GetBlockedReason_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *ReceivedEmailSummary // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetRecord() // Should return zero value + _ = obj.GetBlockedReason() // Should return zero value }) - t.Run("GetCreatedAt", func(t *testing.T) { + t.Run("GetMailFrom", func(t *testing.T) { t.Parallel() // Arrange - obj := &ReceivingDomain{} - var expected time.Time - obj.CreatedAt = expected + obj := &ReceivedEmailSummary{} + var expected string + obj.MailFrom = expected // Act & Assert - assert.Equal(t, expected, obj.GetCreatedAt(), "getter should return the property value") + assert.Equal(t, expected, obj.GetMailFrom(), "getter should return the property value") }) - t.Run("GetCreatedAt_NilReceiver", func(t *testing.T) { + t.Run("GetMailFrom_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *ReceivingDomain + var obj *ReceivedEmailSummary // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetCreatedAt() // Should return zero value + _ = obj.GetMailFrom() // Should return zero value }) - t.Run("GetLastCheckedAt", func(t *testing.T) { + t.Run("GetRecipients", func(t *testing.T) { t.Parallel() // Arrange - obj := &ReceivingDomain{} - var expected *time.Time - obj.LastCheckedAt = expected + obj := &ReceivedEmailSummary{} + var expected []string + obj.Recipients = expected // Act & Assert - assert.Equal(t, expected, obj.GetLastCheckedAt(), "getter should return the property value") + assert.Equal(t, expected, obj.GetRecipients(), "getter should return the property value") }) - t.Run("GetLastCheckedAt_NilValue", func(t *testing.T) { + t.Run("GetRecipients_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &ReceivingDomain{} - obj.LastCheckedAt = nil + obj := &ReceivedEmailSummary{} + obj.Recipients = nil // Act & Assert - assert.Nil(t, obj.GetLastCheckedAt(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetRecipients(), "getter should return nil when property is nil") }) - t.Run("GetLastCheckedAt_NilReceiver", func(t *testing.T) { + t.Run("GetRecipients_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *ReceivingDomain + var obj *ReceivedEmailSummary // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetLastCheckedAt() // Should return zero value + _ = obj.GetRecipients() // Should return zero value }) -} - -func TestSettersMarkExplicitReceivingDomain(t *testing.T) { - t.Run("SetHostname_MarksExplicit", func(t *testing.T) { + t.Run("GetFrom", func(t *testing.T) { t.Parallel() // Arrange - obj := &ReceivingDomain{} - var fernTestValueHostname string + obj := &ReceivedEmailSummary{} + var expected *string + obj.From = expected - // Act - obj.SetHostname(fernTestValueHostname) + // Act & Assert + assert.Equal(t, expected, obj.GetFrom(), "getter should return the property value") + }) - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") + t.Run("GetFrom_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &ReceivedEmailSummary{} + obj.From = nil - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } + // Act & Assert + assert.Nil(t, obj.GetFrom(), "getter should return nil when property is nil") + }) - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip + t.Run("GetFrom_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *ReceivedEmailSummary + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetFrom() // Should return zero value }) - t.Run("SetEnvironmentID_MarksExplicit", func(t *testing.T) { + t.Run("GetTo", func(t *testing.T) { t.Parallel() // Arrange - obj := &ReceivingDomain{} - var fernTestValueEnvironmentID string + obj := &ReceivedEmailSummary{} + var expected []string + obj.To = expected - // Act - obj.SetEnvironmentID(fernTestValueEnvironmentID) + // Act & Assert + assert.Equal(t, expected, obj.GetTo(), "getter should return the property value") + }) - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") + t.Run("GetTo_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &ReceivedEmailSummary{} + obj.To = nil - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } + // Act & Assert + assert.Nil(t, obj.GetTo(), "getter should return nil when property is nil") + }) - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip + t.Run("GetTo_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *ReceivedEmailSummary + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetTo() // Should return zero value }) - t.Run("SetRecord_MarksExplicit", func(t *testing.T) { + t.Run("GetCc", func(t *testing.T) { t.Parallel() // Arrange - obj := &ReceivingDomain{} - var fernTestValueRecord *ReceivingDomainRecord - - // Act - obj.SetRecord(fernTestValueRecord) + obj := &ReceivedEmailSummary{} + var expected []string + obj.Cc = expected - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") - - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } - - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip + // Act & Assert + assert.Equal(t, expected, obj.GetCc(), "getter should return the property value") }) - t.Run("SetCreatedAt_MarksExplicit", func(t *testing.T) { + t.Run("GetCc_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &ReceivingDomain{} - var fernTestValueCreatedAt time.Time - - // Act - obj.SetCreatedAt(fernTestValueCreatedAt) - - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") - - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } + obj := &ReceivedEmailSummary{} + obj.Cc = nil - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip + // Act & Assert + assert.Nil(t, obj.GetCc(), "getter should return nil when property is nil") }) - t.Run("SetLastCheckedAt_MarksExplicit", func(t *testing.T) { + t.Run("GetCc_NilReceiver", func(t *testing.T) { t.Parallel() - // Arrange - obj := &ReceivingDomain{} - var fernTestValueLastCheckedAt *time.Time - - // Act - obj.SetLastCheckedAt(fernTestValueLastCheckedAt) - - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") - - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } - - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip + var obj *ReceivedEmailSummary + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetCc() // Should return zero value }) -} + t.Run("GetSubject", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &ReceivedEmailSummary{} + var expected *string + obj.Subject = expected -func TestSettersReceivingDomainRecord(t *testing.T) { - t.Run("SetType", func(t *testing.T) { - obj := &ReceivingDomainRecord{} - var fernTestValueType ReceivingDomainRecordType - obj.SetType(fernTestValueType) - assert.Equal(t, fernTestValueType, obj.Type) - assert.NotNil(t, obj.explicitFields) + // Act & Assert + assert.Equal(t, expected, obj.GetSubject(), "getter should return the property value") }) - t.Run("SetName", func(t *testing.T) { - obj := &ReceivingDomainRecord{} - var fernTestValueName string - obj.SetName(fernTestValueName) - assert.Equal(t, fernTestValueName, obj.Name) - assert.NotNil(t, obj.explicitFields) - }) + t.Run("GetSubject_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &ReceivedEmailSummary{} + obj.Subject = nil - t.Run("SetValue", func(t *testing.T) { - obj := &ReceivingDomainRecord{} - var fernTestValueValue string - obj.SetValue(fernTestValueValue) - assert.Equal(t, fernTestValueValue, obj.Value) - assert.NotNil(t, obj.explicitFields) + // Act & Assert + assert.Nil(t, obj.GetSubject(), "getter should return nil when property is nil") }) - t.Run("SetPriority", func(t *testing.T) { - obj := &ReceivingDomainRecord{} - var fernTestValuePriority int64 - obj.SetPriority(fernTestValuePriority) - assert.Equal(t, fernTestValuePriority, obj.Priority) - assert.NotNil(t, obj.explicitFields) + t.Run("GetSubject_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *ReceivedEmailSummary + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetSubject() // Should return zero value }) - t.Run("SetStatus", func(t *testing.T) { - obj := &ReceivingDomainRecord{} - var fernTestValueStatus ReceivingDomainRecordStatus - obj.SetStatus(fernTestValueStatus) - assert.Equal(t, fernTestValueStatus, obj.Status) - assert.NotNil(t, obj.explicitFields) - }) + t.Run("GetMessageID", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &ReceivedEmailSummary{} + var expected *string + obj.MessageID = expected - t.Run("SetFound", func(t *testing.T) { - obj := &ReceivingDomainRecord{} - var fernTestValueFound []string - obj.SetFound(fernTestValueFound) - assert.Equal(t, fernTestValueFound, obj.Found) - assert.NotNil(t, obj.explicitFields) + // Act & Assert + assert.Equal(t, expected, obj.GetMessageID(), "getter should return the property value") }) -} - -func TestGettersReceivingDomainRecord(t *testing.T) { - t.Run("GetType", func(t *testing.T) { + t.Run("GetMessageID_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &ReceivingDomainRecord{} - var expected ReceivingDomainRecordType - obj.Type = expected + obj := &ReceivedEmailSummary{} + obj.MessageID = nil // Act & Assert - assert.Equal(t, expected, obj.GetType(), "getter should return the property value") + assert.Nil(t, obj.GetMessageID(), "getter should return nil when property is nil") }) - t.Run("GetType_NilReceiver", func(t *testing.T) { + t.Run("GetMessageID_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *ReceivingDomainRecord + var obj *ReceivedEmailSummary // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetType() // Should return zero value + _ = obj.GetMessageID() // Should return zero value }) - t.Run("GetName", func(t *testing.T) { + t.Run("GetAttachments", func(t *testing.T) { t.Parallel() // Arrange - obj := &ReceivingDomainRecord{} - var expected string - obj.Name = expected + obj := &ReceivedEmailSummary{} + var expected []*ReceivedEmailAttachment + obj.Attachments = expected // Act & Assert - assert.Equal(t, expected, obj.GetName(), "getter should return the property value") + assert.Equal(t, expected, obj.GetAttachments(), "getter should return the property value") }) - t.Run("GetName_NilReceiver", func(t *testing.T) { + t.Run("GetAttachments_NilValue", func(t *testing.T) { t.Parallel() - var obj *ReceivingDomainRecord + // Arrange + obj := &ReceivedEmailSummary{} + obj.Attachments = nil + + // Act & Assert + assert.Nil(t, obj.GetAttachments(), "getter should return nil when property is nil") + }) + + t.Run("GetAttachments_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *ReceivedEmailSummary // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetName() // Should return zero value + _ = obj.GetAttachments() // Should return zero value }) - t.Run("GetValue", func(t *testing.T) { + t.Run("GetSize", func(t *testing.T) { t.Parallel() // Arrange - obj := &ReceivingDomainRecord{} - var expected string - obj.Value = expected + obj := &ReceivedEmailSummary{} + var expected int64 + obj.Size = expected // Act & Assert - assert.Equal(t, expected, obj.GetValue(), "getter should return the property value") + assert.Equal(t, expected, obj.GetSize(), "getter should return the property value") }) - t.Run("GetValue_NilReceiver", func(t *testing.T) { + t.Run("GetSize_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *ReceivingDomainRecord + var obj *ReceivedEmailSummary // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetValue() // Should return zero value + _ = obj.GetSize() // Should return zero value }) - t.Run("GetPriority", func(t *testing.T) { + t.Run("GetSpam", func(t *testing.T) { t.Parallel() // Arrange - obj := &ReceivingDomainRecord{} - var expected int64 - obj.Priority = expected + obj := &ReceivedEmailSummary{} + var expected bool + obj.Spam = expected // Act & Assert - assert.Equal(t, expected, obj.GetPriority(), "getter should return the property value") + assert.Equal(t, expected, obj.GetSpam(), "getter should return the property value") }) - t.Run("GetPriority_NilReceiver", func(t *testing.T) { + t.Run("GetSpam_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *ReceivingDomainRecord + var obj *ReceivedEmailSummary // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetPriority() // Should return zero value + _ = obj.GetSpam() // Should return zero value }) - t.Run("GetStatus", func(t *testing.T) { + t.Run("GetVerdicts", func(t *testing.T) { t.Parallel() // Arrange - obj := &ReceivingDomainRecord{} - var expected ReceivingDomainRecordStatus - obj.Status = expected + obj := &ReceivedEmailSummary{} + var expected *ReceivedEmailVerdicts + obj.Verdicts = expected // Act & Assert - assert.Equal(t, expected, obj.GetStatus(), "getter should return the property value") + assert.Equal(t, expected, obj.GetVerdicts(), "getter should return the property value") }) - t.Run("GetStatus_NilReceiver", func(t *testing.T) { + t.Run("GetVerdicts_NilValue", func(t *testing.T) { t.Parallel() - var obj *ReceivingDomainRecord + // Arrange + obj := &ReceivedEmailSummary{} + obj.Verdicts = nil + + // Act & Assert + assert.Nil(t, obj.GetVerdicts(), "getter should return nil when property is nil") + }) + + t.Run("GetVerdicts_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *ReceivedEmailSummary // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetStatus() // Should return zero value + _ = obj.GetVerdicts() // Should return zero value }) - t.Run("GetFound", func(t *testing.T) { + t.Run("GetSandbox", func(t *testing.T) { t.Parallel() // Arrange - obj := &ReceivingDomainRecord{} - var expected []string - obj.Found = expected + obj := &ReceivedEmailSummary{} + var expected bool + obj.Sandbox = expected // Act & Assert - assert.Equal(t, expected, obj.GetFound(), "getter should return the property value") + assert.Equal(t, expected, obj.GetSandbox(), "getter should return the property value") }) - t.Run("GetFound_NilValue", func(t *testing.T) { + t.Run("GetSandbox_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *ReceivedEmailSummary + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetSandbox() // Should return zero value + }) + + t.Run("GetReceivedAt", func(t *testing.T) { t.Parallel() // Arrange - obj := &ReceivingDomainRecord{} - obj.Found = nil + obj := &ReceivedEmailSummary{} + var expected time.Time + obj.ReceivedAt = expected // Act & Assert - assert.Nil(t, obj.GetFound(), "getter should return nil when property is nil") + assert.Equal(t, expected, obj.GetReceivedAt(), "getter should return the property value") }) - t.Run("GetFound_NilReceiver", func(t *testing.T) { + t.Run("GetReceivedAt_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *ReceivingDomainRecord + var obj *ReceivedEmailSummary // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetFound() // Should return zero value + _ = obj.GetReceivedAt() // Should return zero value }) } -func TestSettersMarkExplicitReceivingDomainRecord(t *testing.T) { - t.Run("SetType_MarksExplicit", func(t *testing.T) { +func TestSettersMarkExplicitReceivedEmailSummary(t *testing.T) { + t.Run("SetObject_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &ReceivingDomainRecord{} - var fernTestValueType ReceivingDomainRecordType + obj := &ReceivedEmailSummary{} + var fernTestValueObject ReceivedEmailSummaryObject // Act - obj.SetType(fernTestValueType) + obj.SetObject(fernTestValueObject) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -67384,14 +66929,14 @@ func TestSettersMarkExplicitReceivingDomainRecord(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetName_MarksExplicit", func(t *testing.T) { + t.Run("SetID_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &ReceivingDomainRecord{} - var fernTestValueName string + obj := &ReceivedEmailSummary{} + var fernTestValueID string // Act - obj.SetName(fernTestValueName) + obj.SetID(fernTestValueID) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -67415,14 +66960,14 @@ func TestSettersMarkExplicitReceivingDomainRecord(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetValue_MarksExplicit", func(t *testing.T) { + t.Run("SetStatus_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &ReceivingDomainRecord{} - var fernTestValueValue string + obj := &ReceivedEmailSummary{} + var fernTestValueStatus ReceivedEmailSummaryStatus // Act - obj.SetValue(fernTestValueValue) + obj.SetStatus(fernTestValueStatus) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -67446,14 +66991,14 @@ func TestSettersMarkExplicitReceivingDomainRecord(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetPriority_MarksExplicit", func(t *testing.T) { + t.Run("SetBlockedReason_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &ReceivingDomainRecord{} - var fernTestValuePriority int64 + obj := &ReceivedEmailSummary{} + var fernTestValueBlockedReason *ReceivedEmailSummaryBlockedReason // Act - obj.SetPriority(fernTestValuePriority) + obj.SetBlockedReason(fernTestValueBlockedReason) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -67477,14 +67022,14 @@ func TestSettersMarkExplicitReceivingDomainRecord(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetStatus_MarksExplicit", func(t *testing.T) { + t.Run("SetMailFrom_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &ReceivingDomainRecord{} - var fernTestValueStatus ReceivingDomainRecordStatus + obj := &ReceivedEmailSummary{} + var fernTestValueMailFrom string // Act - obj.SetStatus(fernTestValueStatus) + obj.SetMailFrom(fernTestValueMailFrom) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -67508,14 +67053,14 @@ func TestSettersMarkExplicitReceivingDomainRecord(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetFound_MarksExplicit", func(t *testing.T) { + t.Run("SetRecipients_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &ReceivingDomainRecord{} - var fernTestValueFound []string + obj := &ReceivedEmailSummary{} + var fernTestValueRecipients []string // Act - obj.SetFound(fernTestValueFound) + obj.SetRecipients(fernTestValueRecipients) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -67539,270 +67084,138 @@ func TestSettersMarkExplicitReceivingDomainRecord(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) -} - -func TestSettersRenderedEmailTemplate(t *testing.T) { - t.Run("SetObject", func(t *testing.T) { - obj := &RenderedEmailTemplate{} - var fernTestValueObject RenderedEmailTemplateObject - obj.SetObject(fernTestValueObject) - assert.Equal(t, fernTestValueObject, obj.Object) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetTemplateID", func(t *testing.T) { - obj := &RenderedEmailTemplate{} - var fernTestValueTemplateID string - obj.SetTemplateID(fernTestValueTemplateID) - assert.Equal(t, fernTestValueTemplateID, obj.TemplateID) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetVersion", func(t *testing.T) { - obj := &RenderedEmailTemplate{} - var fernTestValueVersion *int64 - obj.SetVersion(fernTestValueVersion) - assert.Equal(t, fernTestValueVersion, obj.Version) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetLocale", func(t *testing.T) { - obj := &RenderedEmailTemplate{} - var fernTestValueLocale string - obj.SetLocale(fernTestValueLocale) - assert.Equal(t, fernTestValueLocale, obj.Locale) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetSubject", func(t *testing.T) { - obj := &RenderedEmailTemplate{} - var fernTestValueSubject string - obj.SetSubject(fernTestValueSubject) - assert.Equal(t, fernTestValueSubject, obj.Subject) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetHTML", func(t *testing.T) { - obj := &RenderedEmailTemplate{} - var fernTestValueHTML *string - obj.SetHTML(fernTestValueHTML) - assert.Equal(t, fernTestValueHTML, obj.HTML) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetText", func(t *testing.T) { - obj := &RenderedEmailTemplate{} - var fernTestValueText *string - obj.SetText(fernTestValueText) - assert.Equal(t, fernTestValueText, obj.Text) - assert.NotNil(t, obj.explicitFields) - }) - -} - -func TestGettersRenderedEmailTemplate(t *testing.T) { - t.Run("GetObject", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &RenderedEmailTemplate{} - var expected RenderedEmailTemplateObject - obj.Object = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetObject(), "getter should return the property value") - }) - - t.Run("GetObject_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *RenderedEmailTemplate - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetObject() // Should return zero value - }) - - t.Run("GetTemplateID", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &RenderedEmailTemplate{} - var expected string - obj.TemplateID = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetTemplateID(), "getter should return the property value") - }) - - t.Run("GetTemplateID_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *RenderedEmailTemplate - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetTemplateID() // Should return zero value - }) - - t.Run("GetVersion", func(t *testing.T) { + t.Run("SetFrom_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &RenderedEmailTemplate{} - var expected *int64 - obj.Version = expected + obj := &ReceivedEmailSummary{} + var fernTestValueFrom *string - // Act & Assert - assert.Equal(t, expected, obj.GetVersion(), "getter should return the property value") - }) + // Act + obj.SetFrom(fernTestValueFrom) - t.Run("GetVersion_NilValue", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &RenderedEmailTemplate{} - obj.Version = nil + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") - // Act & Assert - assert.Nil(t, obj.GetVersion(), "getter should return nil when property is nil") - }) + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } - t.Run("GetVersion_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *RenderedEmailTemplate - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetVersion() // Should return zero value + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("GetLocale", func(t *testing.T) { + t.Run("SetTo_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &RenderedEmailTemplate{} - var expected string - obj.Locale = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetLocale(), "getter should return the property value") - }) + obj := &ReceivedEmailSummary{} + var fernTestValueTo []string - t.Run("GetLocale_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *RenderedEmailTemplate - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetLocale() // Should return zero value - }) + // Act + obj.SetTo(fernTestValueTo) - t.Run("GetSubject", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &RenderedEmailTemplate{} - var expected string - obj.Subject = expected + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") - // Act & Assert - assert.Equal(t, expected, obj.GetSubject(), "getter should return the property value") - }) + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } - t.Run("GetSubject_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *RenderedEmailTemplate - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetSubject() // Should return zero value + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("GetHTML", func(t *testing.T) { + t.Run("SetCc_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &RenderedEmailTemplate{} - var expected *string - obj.HTML = expected + obj := &ReceivedEmailSummary{} + var fernTestValueCc []string - // Act & Assert - assert.Equal(t, expected, obj.GetHTML(), "getter should return the property value") - }) + // Act + obj.SetCc(fernTestValueCc) - t.Run("GetHTML_NilValue", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &RenderedEmailTemplate{} - obj.HTML = nil + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") - // Act & Assert - assert.Nil(t, obj.GetHTML(), "getter should return nil when property is nil") - }) + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } - t.Run("GetHTML_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *RenderedEmailTemplate - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetHTML() // Should return zero value + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("GetText", func(t *testing.T) { + t.Run("SetSubject_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &RenderedEmailTemplate{} - var expected *string - obj.Text = expected + obj := &ReceivedEmailSummary{} + var fernTestValueSubject *string - // Act & Assert - assert.Equal(t, expected, obj.GetText(), "getter should return the property value") - }) + // Act + obj.SetSubject(fernTestValueSubject) - t.Run("GetText_NilValue", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &RenderedEmailTemplate{} - obj.Text = nil + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") - // Act & Assert - assert.Nil(t, obj.GetText(), "getter should return nil when property is nil") - }) + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } - t.Run("GetText_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *RenderedEmailTemplate - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetText() // Should return zero value + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip }) -} - -func TestSettersMarkExplicitRenderedEmailTemplate(t *testing.T) { - t.Run("SetObject_MarksExplicit", func(t *testing.T) { + t.Run("SetMessageID_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &RenderedEmailTemplate{} - var fernTestValueObject RenderedEmailTemplateObject + obj := &ReceivedEmailSummary{} + var fernTestValueMessageID *string // Act - obj.SetObject(fernTestValueObject) + obj.SetMessageID(fernTestValueMessageID) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -67826,14 +67239,14 @@ func TestSettersMarkExplicitRenderedEmailTemplate(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetTemplateID_MarksExplicit", func(t *testing.T) { + t.Run("SetAttachments_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &RenderedEmailTemplate{} - var fernTestValueTemplateID string + obj := &ReceivedEmailSummary{} + var fernTestValueAttachments []*ReceivedEmailAttachment // Act - obj.SetTemplateID(fernTestValueTemplateID) + obj.SetAttachments(fernTestValueAttachments) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -67857,14 +67270,14 @@ func TestSettersMarkExplicitRenderedEmailTemplate(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetVersion_MarksExplicit", func(t *testing.T) { + t.Run("SetSize_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &RenderedEmailTemplate{} - var fernTestValueVersion *int64 + obj := &ReceivedEmailSummary{} + var fernTestValueSize int64 // Act - obj.SetVersion(fernTestValueVersion) + obj.SetSize(fernTestValueSize) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -67888,14 +67301,14 @@ func TestSettersMarkExplicitRenderedEmailTemplate(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetLocale_MarksExplicit", func(t *testing.T) { + t.Run("SetSpam_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &RenderedEmailTemplate{} - var fernTestValueLocale string + obj := &ReceivedEmailSummary{} + var fernTestValueSpam bool // Act - obj.SetLocale(fernTestValueLocale) + obj.SetSpam(fernTestValueSpam) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -67919,14 +67332,14 @@ func TestSettersMarkExplicitRenderedEmailTemplate(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetSubject_MarksExplicit", func(t *testing.T) { + t.Run("SetVerdicts_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &RenderedEmailTemplate{} - var fernTestValueSubject string + obj := &ReceivedEmailSummary{} + var fernTestValueVerdicts *ReceivedEmailVerdicts // Act - obj.SetSubject(fernTestValueSubject) + obj.SetVerdicts(fernTestValueVerdicts) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -67950,14 +67363,14 @@ func TestSettersMarkExplicitRenderedEmailTemplate(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetHTML_MarksExplicit", func(t *testing.T) { + t.Run("SetSandbox_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &RenderedEmailTemplate{} - var fernTestValueHTML *string + obj := &ReceivedEmailSummary{} + var fernTestValueSandbox bool // Act - obj.SetHTML(fernTestValueHTML) + obj.SetSandbox(fernTestValueSandbox) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -67981,14 +67394,14 @@ func TestSettersMarkExplicitRenderedEmailTemplate(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetText_MarksExplicit", func(t *testing.T) { + t.Run("SetReceivedAt_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &RenderedEmailTemplate{} - var fernTestValueText *string + obj := &ReceivedEmailSummary{} + var fernTestValueReceivedAt time.Time // Act - obj.SetText(fernTestValueText) + obj.SetReceivedAt(fernTestValueReceivedAt) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -68014,535 +67427,298 @@ func TestSettersMarkExplicitRenderedEmailTemplate(t *testing.T) { } -func TestSettersRiskAssessment(t *testing.T) { - t.Run("SetObject", func(t *testing.T) { - obj := &RiskAssessment{} - var fernTestValueObject RiskAssessmentObject - obj.SetObject(fernTestValueObject) - assert.Equal(t, fernTestValueObject, obj.Object) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetID", func(t *testing.T) { - obj := &RiskAssessment{} - var fernTestValueID string - obj.SetID(fernTestValueID) - assert.Equal(t, fernTestValueID, obj.ID) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetEvent", func(t *testing.T) { - obj := &RiskAssessment{} - var fernTestValueEvent RiskEvent - obj.SetEvent(fernTestValueEvent) - assert.Equal(t, fernTestValueEvent, obj.Event) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetEventName", func(t *testing.T) { - obj := &RiskAssessment{} - var fernTestValueEventName *string - obj.SetEventName(fernTestValueEventName) - assert.Equal(t, fernTestValueEventName, obj.EventName) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetDecision", func(t *testing.T) { - obj := &RiskAssessment{} - var fernTestValueDecision RiskDecision - obj.SetDecision(fernTestValueDecision) - assert.Equal(t, fernTestValueDecision, obj.Decision) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetScore", func(t *testing.T) { - obj := &RiskAssessment{} - var fernTestValueScore float64 - obj.SetScore(fernTestValueScore) - assert.Equal(t, fernTestValueScore, obj.Score) +func TestSettersReceivedEmailVerdicts(t *testing.T) { + t.Run("SetSpam", func(t *testing.T) { + obj := &ReceivedEmailVerdicts{} + var fernTestValueSpam *ReceivedEmailVerdictsSpam + obj.SetSpam(fernTestValueSpam) + assert.Equal(t, fernTestValueSpam, obj.Spam) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetReasons", func(t *testing.T) { - obj := &RiskAssessment{} - var fernTestValueReasons []*RiskReason - obj.SetReasons(fernTestValueReasons) - assert.Equal(t, fernTestValueReasons, obj.Reasons) + t.Run("SetVirus", func(t *testing.T) { + obj := &ReceivedEmailVerdicts{} + var fernTestValueVirus *ReceivedEmailVerdictsVirus + obj.SetVirus(fernTestValueVirus) + assert.Equal(t, fernTestValueVirus, obj.Virus) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetSignals", func(t *testing.T) { - obj := &RiskAssessment{} - var fernTestValueSignals *RiskAssessmentSignals - obj.SetSignals(fernTestValueSignals) - assert.Equal(t, fernTestValueSignals, obj.Signals) + t.Run("SetSpf", func(t *testing.T) { + obj := &ReceivedEmailVerdicts{} + var fernTestValueSpf *ReceivedEmailVerdictsSpf + obj.SetSpf(fernTestValueSpf) + assert.Equal(t, fernTestValueSpf, obj.Spf) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetUser", func(t *testing.T) { - obj := &RiskAssessment{} - var fernTestValueUser *RiskAssessmentUser - obj.SetUser(fernTestValueUser) - assert.Equal(t, fernTestValueUser, obj.User) + t.Run("SetDkim", func(t *testing.T) { + obj := &ReceivedEmailVerdicts{} + var fernTestValueDkim *ReceivedEmailVerdictsDkim + obj.SetDkim(fernTestValueDkim) + assert.Equal(t, fernTestValueDkim, obj.Dkim) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetIP", func(t *testing.T) { - obj := &RiskAssessment{} - var fernTestValueIP *string - obj.SetIP(fernTestValueIP) - assert.Equal(t, fernTestValueIP, obj.IP) + t.Run("SetDmarc", func(t *testing.T) { + obj := &ReceivedEmailVerdicts{} + var fernTestValueDmarc *ReceivedEmailVerdictsDmarc + obj.SetDmarc(fernTestValueDmarc) + assert.Equal(t, fernTestValueDmarc, obj.Dmarc) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetDegraded", func(t *testing.T) { - obj := &RiskAssessment{} - var fernTestValueDegraded []RiskAssessmentDegradedItem - obj.SetDegraded(fernTestValueDegraded) - assert.Equal(t, fernTestValueDegraded, obj.Degraded) + t.Run("SetDmarcPolicy", func(t *testing.T) { + obj := &ReceivedEmailVerdicts{} + var fernTestValueDmarcPolicy *string + obj.SetDmarcPolicy(fernTestValueDmarcPolicy) + assert.Equal(t, fernTestValueDmarcPolicy, obj.DmarcPolicy) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetOutcome", func(t *testing.T) { - obj := &RiskAssessment{} - var fernTestValueOutcome *RiskOutcome - obj.SetOutcome(fernTestValueOutcome) - assert.Equal(t, fernTestValueOutcome, obj.Outcome) - assert.NotNil(t, obj.explicitFields) - }) +} - t.Run("SetReviewStatus", func(t *testing.T) { - obj := &RiskAssessment{} - var fernTestValueReviewStatus *RiskAssessmentReviewStatus - obj.SetReviewStatus(fernTestValueReviewStatus) - assert.Equal(t, fernTestValueReviewStatus, obj.ReviewStatus) - assert.NotNil(t, obj.explicitFields) - }) +func TestGettersReceivedEmailVerdicts(t *testing.T) { + t.Run("GetSpam", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &ReceivedEmailVerdicts{} + var expected *ReceivedEmailVerdictsSpam + obj.Spam = expected - t.Run("SetCreatedAt", func(t *testing.T) { - obj := &RiskAssessment{} - var fernTestValueCreatedAt time.Time - obj.SetCreatedAt(fernTestValueCreatedAt) - assert.Equal(t, fernTestValueCreatedAt, obj.CreatedAt) - assert.NotNil(t, obj.explicitFields) + // Act & Assert + assert.Equal(t, expected, obj.GetSpam(), "getter should return the property value") }) -} - -func TestGettersRiskAssessment(t *testing.T) { - t.Run("GetObject", func(t *testing.T) { + t.Run("GetSpam_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskAssessment{} - var expected RiskAssessmentObject - obj.Object = expected + obj := &ReceivedEmailVerdicts{} + obj.Spam = nil // Act & Assert - assert.Equal(t, expected, obj.GetObject(), "getter should return the property value") + assert.Nil(t, obj.GetSpam(), "getter should return nil when property is nil") }) - t.Run("GetObject_NilReceiver", func(t *testing.T) { + t.Run("GetSpam_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *RiskAssessment + var obj *ReceivedEmailVerdicts // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetObject() // Should return zero value + _ = obj.GetSpam() // Should return zero value }) - t.Run("GetID", func(t *testing.T) { + t.Run("GetVirus", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskAssessment{} - var expected string - obj.ID = expected + obj := &ReceivedEmailVerdicts{} + var expected *ReceivedEmailVerdictsVirus + obj.Virus = expected // Act & Assert - assert.Equal(t, expected, obj.GetID(), "getter should return the property value") - }) - - t.Run("GetID_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *RiskAssessment - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetID() // Should return zero value + assert.Equal(t, expected, obj.GetVirus(), "getter should return the property value") }) - t.Run("GetEvent", func(t *testing.T) { + t.Run("GetVirus_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskAssessment{} - var expected RiskEvent - obj.Event = expected + obj := &ReceivedEmailVerdicts{} + obj.Virus = nil // Act & Assert - assert.Equal(t, expected, obj.GetEvent(), "getter should return the property value") + assert.Nil(t, obj.GetVirus(), "getter should return nil when property is nil") }) - t.Run("GetEvent_NilReceiver", func(t *testing.T) { + t.Run("GetVirus_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *RiskAssessment + var obj *ReceivedEmailVerdicts // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetEvent() // Should return zero value + _ = obj.GetVirus() // Should return zero value }) - t.Run("GetEventName", func(t *testing.T) { + t.Run("GetSpf", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskAssessment{} - var expected *string - obj.EventName = expected + obj := &ReceivedEmailVerdicts{} + var expected *ReceivedEmailVerdictsSpf + obj.Spf = expected // Act & Assert - assert.Equal(t, expected, obj.GetEventName(), "getter should return the property value") + assert.Equal(t, expected, obj.GetSpf(), "getter should return the property value") }) - t.Run("GetEventName_NilValue", func(t *testing.T) { + t.Run("GetSpf_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskAssessment{} - obj.EventName = nil + obj := &ReceivedEmailVerdicts{} + obj.Spf = nil // Act & Assert - assert.Nil(t, obj.GetEventName(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetSpf(), "getter should return nil when property is nil") }) - t.Run("GetEventName_NilReceiver", func(t *testing.T) { + t.Run("GetSpf_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *RiskAssessment + var obj *ReceivedEmailVerdicts // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetEventName() // Should return zero value + _ = obj.GetSpf() // Should return zero value }) - t.Run("GetDecision", func(t *testing.T) { + t.Run("GetDkim", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskAssessment{} - var expected RiskDecision - obj.Decision = expected + obj := &ReceivedEmailVerdicts{} + var expected *ReceivedEmailVerdictsDkim + obj.Dkim = expected // Act & Assert - assert.Equal(t, expected, obj.GetDecision(), "getter should return the property value") - }) - - t.Run("GetDecision_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *RiskAssessment - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetDecision() // Should return zero value + assert.Equal(t, expected, obj.GetDkim(), "getter should return the property value") }) - t.Run("GetScore", func(t *testing.T) { + t.Run("GetDkim_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskAssessment{} - var expected float64 - obj.Score = expected + obj := &ReceivedEmailVerdicts{} + obj.Dkim = nil // Act & Assert - assert.Equal(t, expected, obj.GetScore(), "getter should return the property value") + assert.Nil(t, obj.GetDkim(), "getter should return nil when property is nil") }) - t.Run("GetScore_NilReceiver", func(t *testing.T) { + t.Run("GetDkim_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *RiskAssessment + var obj *ReceivedEmailVerdicts // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetScore() // Should return zero value + _ = obj.GetDkim() // Should return zero value }) - t.Run("GetReasons", func(t *testing.T) { + t.Run("GetDmarc", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskAssessment{} - var expected []*RiskReason - obj.Reasons = expected + obj := &ReceivedEmailVerdicts{} + var expected *ReceivedEmailVerdictsDmarc + obj.Dmarc = expected // Act & Assert - assert.Equal(t, expected, obj.GetReasons(), "getter should return the property value") + assert.Equal(t, expected, obj.GetDmarc(), "getter should return the property value") }) - t.Run("GetReasons_NilValue", func(t *testing.T) { + t.Run("GetDmarc_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskAssessment{} - obj.Reasons = nil + obj := &ReceivedEmailVerdicts{} + obj.Dmarc = nil // Act & Assert - assert.Nil(t, obj.GetReasons(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetDmarc(), "getter should return nil when property is nil") }) - t.Run("GetReasons_NilReceiver", func(t *testing.T) { + t.Run("GetDmarc_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *RiskAssessment + var obj *ReceivedEmailVerdicts // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetReasons() // Should return zero value + _ = obj.GetDmarc() // Should return zero value }) - t.Run("GetSignals", func(t *testing.T) { + t.Run("GetDmarcPolicy", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskAssessment{} - var expected *RiskAssessmentSignals - obj.Signals = expected + obj := &ReceivedEmailVerdicts{} + var expected *string + obj.DmarcPolicy = expected // Act & Assert - assert.Equal(t, expected, obj.GetSignals(), "getter should return the property value") + assert.Equal(t, expected, obj.GetDmarcPolicy(), "getter should return the property value") }) - t.Run("GetSignals_NilValue", func(t *testing.T) { + t.Run("GetDmarcPolicy_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskAssessment{} - obj.Signals = nil + obj := &ReceivedEmailVerdicts{} + obj.DmarcPolicy = nil // Act & Assert - assert.Nil(t, obj.GetSignals(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetDmarcPolicy(), "getter should return nil when property is nil") }) - t.Run("GetSignals_NilReceiver", func(t *testing.T) { + t.Run("GetDmarcPolicy_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *RiskAssessment + var obj *ReceivedEmailVerdicts // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetSignals() // Should return zero value + _ = obj.GetDmarcPolicy() // Should return zero value }) - t.Run("GetUser", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &RiskAssessment{} - var expected *RiskAssessmentUser - obj.User = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetUser(), "getter should return the property value") - }) - - t.Run("GetUser_NilValue", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &RiskAssessment{} - obj.User = nil - - // Act & Assert - assert.Nil(t, obj.GetUser(), "getter should return nil when property is nil") - }) - - t.Run("GetUser_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *RiskAssessment - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetUser() // Should return zero value - }) - - t.Run("GetIP", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &RiskAssessment{} - var expected *string - obj.IP = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetIP(), "getter should return the property value") - }) - - t.Run("GetIP_NilValue", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &RiskAssessment{} - obj.IP = nil - - // Act & Assert - assert.Nil(t, obj.GetIP(), "getter should return nil when property is nil") - }) - - t.Run("GetIP_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *RiskAssessment - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetIP() // Should return zero value - }) - - t.Run("GetDegraded", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &RiskAssessment{} - var expected []RiskAssessmentDegradedItem - obj.Degraded = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetDegraded(), "getter should return the property value") - }) - - t.Run("GetDegraded_NilValue", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &RiskAssessment{} - obj.Degraded = nil - - // Act & Assert - assert.Nil(t, obj.GetDegraded(), "getter should return nil when property is nil") - }) - - t.Run("GetDegraded_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *RiskAssessment - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetDegraded() // Should return zero value - }) - - t.Run("GetOutcome", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &RiskAssessment{} - var expected *RiskOutcome - obj.Outcome = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetOutcome(), "getter should return the property value") - }) - - t.Run("GetOutcome_NilValue", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &RiskAssessment{} - obj.Outcome = nil - - // Act & Assert - assert.Nil(t, obj.GetOutcome(), "getter should return nil when property is nil") - }) - - t.Run("GetOutcome_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *RiskAssessment - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetOutcome() // Should return zero value - }) - - t.Run("GetReviewStatus", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &RiskAssessment{} - var expected *RiskAssessmentReviewStatus - obj.ReviewStatus = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetReviewStatus(), "getter should return the property value") - }) +} - t.Run("GetReviewStatus_NilValue", func(t *testing.T) { +func TestSettersMarkExplicitReceivedEmailVerdicts(t *testing.T) { + t.Run("SetSpam_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskAssessment{} - obj.ReviewStatus = nil - - // Act & Assert - assert.Nil(t, obj.GetReviewStatus(), "getter should return nil when property is nil") - }) + obj := &ReceivedEmailVerdicts{} + var fernTestValueSpam *ReceivedEmailVerdictsSpam - t.Run("GetReviewStatus_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *RiskAssessment - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetReviewStatus() // Should return zero value - }) + // Act + obj.SetSpam(fernTestValueSpam) - t.Run("GetCreatedAt", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &RiskAssessment{} - var expected time.Time - obj.CreatedAt = expected + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") - // Act & Assert - assert.Equal(t, expected, obj.GetCreatedAt(), "getter should return the property value") - }) + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } - t.Run("GetCreatedAt_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *RiskAssessment - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetCreatedAt() // Should return zero value + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip }) -} - -func TestSettersMarkExplicitRiskAssessment(t *testing.T) { - t.Run("SetObject_MarksExplicit", func(t *testing.T) { + t.Run("SetVirus_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskAssessment{} - var fernTestValueObject RiskAssessmentObject + obj := &ReceivedEmailVerdicts{} + var fernTestValueVirus *ReceivedEmailVerdictsVirus // Act - obj.SetObject(fernTestValueObject) + obj.SetVirus(fernTestValueVirus) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -68566,14 +67742,14 @@ func TestSettersMarkExplicitRiskAssessment(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetID_MarksExplicit", func(t *testing.T) { + t.Run("SetSpf_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskAssessment{} - var fernTestValueID string + obj := &ReceivedEmailVerdicts{} + var fernTestValueSpf *ReceivedEmailVerdictsSpf // Act - obj.SetID(fernTestValueID) + obj.SetSpf(fernTestValueSpf) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -68597,14 +67773,14 @@ func TestSettersMarkExplicitRiskAssessment(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetEvent_MarksExplicit", func(t *testing.T) { + t.Run("SetDkim_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskAssessment{} - var fernTestValueEvent RiskEvent + obj := &ReceivedEmailVerdicts{} + var fernTestValueDkim *ReceivedEmailVerdictsDkim // Act - obj.SetEvent(fernTestValueEvent) + obj.SetDkim(fernTestValueDkim) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -68628,14 +67804,14 @@ func TestSettersMarkExplicitRiskAssessment(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetEventName_MarksExplicit", func(t *testing.T) { + t.Run("SetDmarc_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskAssessment{} - var fernTestValueEventName *string + obj := &ReceivedEmailVerdicts{} + var fernTestValueDmarc *ReceivedEmailVerdictsDmarc // Act - obj.SetEventName(fernTestValueEventName) + obj.SetDmarc(fernTestValueDmarc) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -68659,14 +67835,14 @@ func TestSettersMarkExplicitRiskAssessment(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetDecision_MarksExplicit", func(t *testing.T) { + t.Run("SetDmarcPolicy_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskAssessment{} - var fernTestValueDecision RiskDecision + obj := &ReceivedEmailVerdicts{} + var fernTestValueDmarcPolicy *string // Act - obj.SetDecision(fernTestValueDecision) + obj.SetDmarcPolicy(fernTestValueDmarcPolicy) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -68690,14 +67866,312 @@ func TestSettersMarkExplicitRiskAssessment(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetScore_MarksExplicit", func(t *testing.T) { +} + +func TestSettersReceivedSms(t *testing.T) { + t.Run("SetObject", func(t *testing.T) { + obj := &ReceivedSms{} + var fernTestValueObject ReceivedSmsObject + obj.SetObject(fernTestValueObject) + assert.Equal(t, fernTestValueObject, obj.Object) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetID", func(t *testing.T) { + obj := &ReceivedSms{} + var fernTestValueID string + obj.SetID(fernTestValueID) + assert.Equal(t, fernTestValueID, obj.ID) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetFrom", func(t *testing.T) { + obj := &ReceivedSms{} + var fernTestValueFrom string + obj.SetFrom(fernTestValueFrom) + assert.Equal(t, fernTestValueFrom, obj.From) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetTo", func(t *testing.T) { + obj := &ReceivedSms{} + var fernTestValueTo string + obj.SetTo(fernTestValueTo) + assert.Equal(t, fernTestValueTo, obj.To) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetBody", func(t *testing.T) { + obj := &ReceivedSms{} + var fernTestValueBody string + obj.SetBody(fernTestValueBody) + assert.Equal(t, fernTestValueBody, obj.Body) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetSegments", func(t *testing.T) { + obj := &ReceivedSms{} + var fernTestValueSegments int64 + obj.SetSegments(fernTestValueSegments) + assert.Equal(t, fernTestValueSegments, obj.Segments) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetKeyword", func(t *testing.T) { + obj := &ReceivedSms{} + var fernTestValueKeyword *ReceivedSmsKeyword + obj.SetKeyword(fernTestValueKeyword) + assert.Equal(t, fernTestValueKeyword, obj.Keyword) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetSandbox", func(t *testing.T) { + obj := &ReceivedSms{} + var fernTestValueSandbox bool + obj.SetSandbox(fernTestValueSandbox) + assert.Equal(t, fernTestValueSandbox, obj.Sandbox) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetCreatedAt", func(t *testing.T) { + obj := &ReceivedSms{} + var fernTestValueCreatedAt time.Time + obj.SetCreatedAt(fernTestValueCreatedAt) + assert.Equal(t, fernTestValueCreatedAt, obj.CreatedAt) + assert.NotNil(t, obj.explicitFields) + }) + +} + +func TestGettersReceivedSms(t *testing.T) { + t.Run("GetObject", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskAssessment{} - var fernTestValueScore float64 + obj := &ReceivedSms{} + var expected ReceivedSmsObject + obj.Object = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetObject(), "getter should return the property value") + }) + + t.Run("GetObject_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *ReceivedSms + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetObject() // Should return zero value + }) + + t.Run("GetID", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &ReceivedSms{} + var expected string + obj.ID = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetID(), "getter should return the property value") + }) + + t.Run("GetID_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *ReceivedSms + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetID() // Should return zero value + }) + + t.Run("GetFrom", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &ReceivedSms{} + var expected string + obj.From = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetFrom(), "getter should return the property value") + }) + + t.Run("GetFrom_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *ReceivedSms + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetFrom() // Should return zero value + }) + + t.Run("GetTo", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &ReceivedSms{} + var expected string + obj.To = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetTo(), "getter should return the property value") + }) + + t.Run("GetTo_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *ReceivedSms + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetTo() // Should return zero value + }) + + t.Run("GetBody", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &ReceivedSms{} + var expected string + obj.Body = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetBody(), "getter should return the property value") + }) + + t.Run("GetBody_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *ReceivedSms + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetBody() // Should return zero value + }) + + t.Run("GetSegments", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &ReceivedSms{} + var expected int64 + obj.Segments = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetSegments(), "getter should return the property value") + }) + + t.Run("GetSegments_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *ReceivedSms + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetSegments() // Should return zero value + }) + + t.Run("GetKeyword", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &ReceivedSms{} + var expected *ReceivedSmsKeyword + obj.Keyword = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetKeyword(), "getter should return the property value") + }) + + t.Run("GetKeyword_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &ReceivedSms{} + obj.Keyword = nil + + // Act & Assert + assert.Nil(t, obj.GetKeyword(), "getter should return nil when property is nil") + }) + + t.Run("GetKeyword_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *ReceivedSms + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetKeyword() // Should return zero value + }) + + t.Run("GetSandbox", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &ReceivedSms{} + var expected bool + obj.Sandbox = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetSandbox(), "getter should return the property value") + }) + + t.Run("GetSandbox_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *ReceivedSms + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetSandbox() // Should return zero value + }) + + t.Run("GetCreatedAt", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &ReceivedSms{} + var expected time.Time + obj.CreatedAt = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetCreatedAt(), "getter should return the property value") + }) + + t.Run("GetCreatedAt_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *ReceivedSms + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetCreatedAt() // Should return zero value + }) + +} + +func TestSettersMarkExplicitReceivedSms(t *testing.T) { + t.Run("SetObject_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &ReceivedSms{} + var fernTestValueObject ReceivedSmsObject // Act - obj.SetScore(fernTestValueScore) + obj.SetObject(fernTestValueObject) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -68721,14 +68195,14 @@ func TestSettersMarkExplicitRiskAssessment(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetReasons_MarksExplicit", func(t *testing.T) { + t.Run("SetID_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskAssessment{} - var fernTestValueReasons []*RiskReason + obj := &ReceivedSms{} + var fernTestValueID string // Act - obj.SetReasons(fernTestValueReasons) + obj.SetID(fernTestValueID) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -68752,14 +68226,14 @@ func TestSettersMarkExplicitRiskAssessment(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetSignals_MarksExplicit", func(t *testing.T) { + t.Run("SetFrom_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskAssessment{} - var fernTestValueSignals *RiskAssessmentSignals + obj := &ReceivedSms{} + var fernTestValueFrom string // Act - obj.SetSignals(fernTestValueSignals) + obj.SetFrom(fernTestValueFrom) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -68783,14 +68257,14 @@ func TestSettersMarkExplicitRiskAssessment(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetUser_MarksExplicit", func(t *testing.T) { + t.Run("SetTo_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskAssessment{} - var fernTestValueUser *RiskAssessmentUser + obj := &ReceivedSms{} + var fernTestValueTo string // Act - obj.SetUser(fernTestValueUser) + obj.SetTo(fernTestValueTo) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -68814,14 +68288,14 @@ func TestSettersMarkExplicitRiskAssessment(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetIP_MarksExplicit", func(t *testing.T) { + t.Run("SetBody_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskAssessment{} - var fernTestValueIP *string + obj := &ReceivedSms{} + var fernTestValueBody string // Act - obj.SetIP(fernTestValueIP) + obj.SetBody(fernTestValueBody) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -68845,14 +68319,14 @@ func TestSettersMarkExplicitRiskAssessment(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetDegraded_MarksExplicit", func(t *testing.T) { + t.Run("SetSegments_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskAssessment{} - var fernTestValueDegraded []RiskAssessmentDegradedItem + obj := &ReceivedSms{} + var fernTestValueSegments int64 // Act - obj.SetDegraded(fernTestValueDegraded) + obj.SetSegments(fernTestValueSegments) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -68876,14 +68350,14 @@ func TestSettersMarkExplicitRiskAssessment(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetOutcome_MarksExplicit", func(t *testing.T) { + t.Run("SetKeyword_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskAssessment{} - var fernTestValueOutcome *RiskOutcome + obj := &ReceivedSms{} + var fernTestValueKeyword *ReceivedSmsKeyword // Act - obj.SetOutcome(fernTestValueOutcome) + obj.SetKeyword(fernTestValueKeyword) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -68907,14 +68381,14 @@ func TestSettersMarkExplicitRiskAssessment(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetReviewStatus_MarksExplicit", func(t *testing.T) { + t.Run("SetSandbox_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskAssessment{} - var fernTestValueReviewStatus *RiskAssessmentReviewStatus + obj := &ReceivedSms{} + var fernTestValueSandbox bool // Act - obj.SetReviewStatus(fernTestValueReviewStatus) + obj.SetSandbox(fernTestValueSandbox) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -68941,7 +68415,7 @@ func TestSettersMarkExplicitRiskAssessment(t *testing.T) { t.Run("SetCreatedAt_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskAssessment{} + obj := &ReceivedSms{} var fernTestValueCreatedAt time.Time // Act @@ -68971,25 +68445,25 @@ func TestSettersMarkExplicitRiskAssessment(t *testing.T) { } -func TestSettersRiskAssessmentList(t *testing.T) { +func TestSettersReceivedSmsList(t *testing.T) { t.Run("SetObject", func(t *testing.T) { - obj := &RiskAssessmentList{} - var fernTestValueObject RiskAssessmentListObject + obj := &ReceivedSmsList{} + var fernTestValueObject ReceivedSmsListObject obj.SetObject(fernTestValueObject) assert.Equal(t, fernTestValueObject, obj.Object) assert.NotNil(t, obj.explicitFields) }) t.Run("SetData", func(t *testing.T) { - obj := &RiskAssessmentList{} - var fernTestValueData []*RiskAssessment + obj := &ReceivedSmsList{} + var fernTestValueData []*ReceivedSms obj.SetData(fernTestValueData) assert.Equal(t, fernTestValueData, obj.Data) assert.NotNil(t, obj.explicitFields) }) t.Run("SetHasMore", func(t *testing.T) { - obj := &RiskAssessmentList{} + obj := &ReceivedSmsList{} var fernTestValueHasMore bool obj.SetHasMore(fernTestValueHasMore) assert.Equal(t, fernTestValueHasMore, obj.HasMore) @@ -68998,12 +68472,12 @@ func TestSettersRiskAssessmentList(t *testing.T) { } -func TestGettersRiskAssessmentList(t *testing.T) { +func TestGettersReceivedSmsList(t *testing.T) { t.Run("GetObject", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskAssessmentList{} - var expected RiskAssessmentListObject + obj := &ReceivedSmsList{} + var expected ReceivedSmsListObject obj.Object = expected // Act & Assert @@ -69012,7 +68486,7 @@ func TestGettersRiskAssessmentList(t *testing.T) { t.Run("GetObject_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *RiskAssessmentList + var obj *ReceivedSmsList // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -69025,8 +68499,8 @@ func TestGettersRiskAssessmentList(t *testing.T) { t.Run("GetData", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskAssessmentList{} - var expected []*RiskAssessment + obj := &ReceivedSmsList{} + var expected []*ReceivedSms obj.Data = expected // Act & Assert @@ -69036,7 +68510,7 @@ func TestGettersRiskAssessmentList(t *testing.T) { t.Run("GetData_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskAssessmentList{} + obj := &ReceivedSmsList{} obj.Data = nil // Act & Assert @@ -69045,7 +68519,7 @@ func TestGettersRiskAssessmentList(t *testing.T) { t.Run("GetData_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *RiskAssessmentList + var obj *ReceivedSmsList // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -69058,7 +68532,7 @@ func TestGettersRiskAssessmentList(t *testing.T) { t.Run("GetHasMore", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskAssessmentList{} + obj := &ReceivedSmsList{} var expected bool obj.HasMore = expected @@ -69068,7 +68542,7 @@ func TestGettersRiskAssessmentList(t *testing.T) { t.Run("GetHasMore_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *RiskAssessmentList + var obj *ReceivedSmsList // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -69080,12 +68554,12 @@ func TestGettersRiskAssessmentList(t *testing.T) { } -func TestSettersMarkExplicitRiskAssessmentList(t *testing.T) { +func TestSettersMarkExplicitReceivedSmsList(t *testing.T) { t.Run("SetObject_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskAssessmentList{} - var fernTestValueObject RiskAssessmentListObject + obj := &ReceivedSmsList{} + var fernTestValueObject ReceivedSmsListObject // Act obj.SetObject(fernTestValueObject) @@ -69115,8 +68589,8 @@ func TestSettersMarkExplicitRiskAssessmentList(t *testing.T) { t.Run("SetData_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskAssessmentList{} - var fernTestValueData []*RiskAssessment + obj := &ReceivedSmsList{} + var fernTestValueData []*ReceivedSms // Act obj.SetData(fernTestValueData) @@ -69146,7 +68620,7 @@ func TestSettersMarkExplicitRiskAssessmentList(t *testing.T) { t.Run("SetHasMore_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskAssessmentList{} + obj := &ReceivedSmsList{} var fernTestValueHasMore bool // Act @@ -69176,349 +68650,196 @@ func TestSettersMarkExplicitRiskAssessmentList(t *testing.T) { } -func TestSettersRiskAssessmentSignals(t *testing.T) { - t.Run("SetEmail", func(t *testing.T) { - obj := &RiskAssessmentSignals{} - var fernTestValueEmail *RiskEmailSignals - obj.SetEmail(fernTestValueEmail) - assert.Equal(t, fernTestValueEmail, obj.Email) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetIP", func(t *testing.T) { - obj := &RiskAssessmentSignals{} - var fernTestValueIP *RiskIPSignals - obj.SetIP(fernTestValueIP) - assert.Equal(t, fernTestValueIP, obj.IP) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetVelocity", func(t *testing.T) { - obj := &RiskAssessmentSignals{} - var fernTestValueVelocity *RiskVelocitySignals - obj.SetVelocity(fernTestValueVelocity) - assert.Equal(t, fernTestValueVelocity, obj.Velocity) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetCaptcha", func(t *testing.T) { - obj := &RiskAssessmentSignals{} - var fernTestValueCaptcha *RiskCaptchaSignals - obj.SetCaptcha(fernTestValueCaptcha) - assert.Equal(t, fernTestValueCaptcha, obj.Captcha) +func TestSettersReceivingDomain(t *testing.T) { + t.Run("SetHostname", func(t *testing.T) { + obj := &ReceivingDomain{} + var fernTestValueHostname string + obj.SetHostname(fernTestValueHostname) + assert.Equal(t, fernTestValueHostname, obj.Hostname) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetLogin", func(t *testing.T) { - obj := &RiskAssessmentSignals{} - var fernTestValueLogin *RiskLoginSignals - obj.SetLogin(fernTestValueLogin) - assert.Equal(t, fernTestValueLogin, obj.Login) + t.Run("SetEnvironmentID", func(t *testing.T) { + obj := &ReceivingDomain{} + var fernTestValueEnvironmentID string + obj.SetEnvironmentID(fernTestValueEnvironmentID) + assert.Equal(t, fernTestValueEnvironmentID, obj.EnvironmentID) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetContent", func(t *testing.T) { - obj := &RiskAssessmentSignals{} - var fernTestValueContent *RiskContentSignals - obj.SetContent(fernTestValueContent) - assert.Equal(t, fernTestValueContent, obj.Content) + t.Run("SetRecord", func(t *testing.T) { + obj := &ReceivingDomain{} + var fernTestValueRecord *ReceivingDomainRecord + obj.SetRecord(fernTestValueRecord) + assert.Equal(t, fernTestValueRecord, obj.Record) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetCheckout", func(t *testing.T) { - obj := &RiskAssessmentSignals{} - var fernTestValueCheckout *RiskCheckoutSignals - obj.SetCheckout(fernTestValueCheckout) - assert.Equal(t, fernTestValueCheckout, obj.Checkout) + t.Run("SetCreatedAt", func(t *testing.T) { + obj := &ReceivingDomain{} + var fernTestValueCreatedAt time.Time + obj.SetCreatedAt(fernTestValueCreatedAt) + assert.Equal(t, fernTestValueCreatedAt, obj.CreatedAt) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetDevice", func(t *testing.T) { - obj := &RiskAssessmentSignals{} - var fernTestValueDevice *RiskDeviceSignals - obj.SetDevice(fernTestValueDevice) - assert.Equal(t, fernTestValueDevice, obj.Device) + t.Run("SetLastCheckedAt", func(t *testing.T) { + obj := &ReceivingDomain{} + var fernTestValueLastCheckedAt *time.Time + obj.SetLastCheckedAt(fernTestValueLastCheckedAt) + assert.Equal(t, fernTestValueLastCheckedAt, obj.LastCheckedAt) assert.NotNil(t, obj.explicitFields) }) } -func TestGettersRiskAssessmentSignals(t *testing.T) { - t.Run("GetEmail", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &RiskAssessmentSignals{} - var expected *RiskEmailSignals - obj.Email = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetEmail(), "getter should return the property value") - }) - - t.Run("GetEmail_NilValue", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &RiskAssessmentSignals{} - obj.Email = nil - - // Act & Assert - assert.Nil(t, obj.GetEmail(), "getter should return nil when property is nil") - }) - - t.Run("GetEmail_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *RiskAssessmentSignals - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetEmail() // Should return zero value - }) - - t.Run("GetIP", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &RiskAssessmentSignals{} - var expected *RiskIPSignals - obj.IP = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetIP(), "getter should return the property value") - }) - - t.Run("GetIP_NilValue", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &RiskAssessmentSignals{} - obj.IP = nil - - // Act & Assert - assert.Nil(t, obj.GetIP(), "getter should return nil when property is nil") - }) - - t.Run("GetIP_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *RiskAssessmentSignals - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetIP() // Should return zero value - }) - - t.Run("GetVelocity", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &RiskAssessmentSignals{} - var expected *RiskVelocitySignals - obj.Velocity = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetVelocity(), "getter should return the property value") - }) - - t.Run("GetVelocity_NilValue", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &RiskAssessmentSignals{} - obj.Velocity = nil - - // Act & Assert - assert.Nil(t, obj.GetVelocity(), "getter should return nil when property is nil") - }) - - t.Run("GetVelocity_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *RiskAssessmentSignals - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetVelocity() // Should return zero value - }) - - t.Run("GetCaptcha", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &RiskAssessmentSignals{} - var expected *RiskCaptchaSignals - obj.Captcha = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetCaptcha(), "getter should return the property value") - }) - - t.Run("GetCaptcha_NilValue", func(t *testing.T) { +func TestGettersReceivingDomain(t *testing.T) { + t.Run("GetHostname", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskAssessmentSignals{} - obj.Captcha = nil + obj := &ReceivingDomain{} + var expected string + obj.Hostname = expected // Act & Assert - assert.Nil(t, obj.GetCaptcha(), "getter should return nil when property is nil") + assert.Equal(t, expected, obj.GetHostname(), "getter should return the property value") }) - t.Run("GetCaptcha_NilReceiver", func(t *testing.T) { + t.Run("GetHostname_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *RiskAssessmentSignals + var obj *ReceivingDomain // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetCaptcha() // Should return zero value - }) - - t.Run("GetLogin", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &RiskAssessmentSignals{} - var expected *RiskLoginSignals - obj.Login = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetLogin(), "getter should return the property value") + _ = obj.GetHostname() // Should return zero value }) - t.Run("GetLogin_NilValue", func(t *testing.T) { + t.Run("GetEnvironmentID", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskAssessmentSignals{} - obj.Login = nil + obj := &ReceivingDomain{} + var expected string + obj.EnvironmentID = expected // Act & Assert - assert.Nil(t, obj.GetLogin(), "getter should return nil when property is nil") + assert.Equal(t, expected, obj.GetEnvironmentID(), "getter should return the property value") }) - t.Run("GetLogin_NilReceiver", func(t *testing.T) { + t.Run("GetEnvironmentID_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *RiskAssessmentSignals + var obj *ReceivingDomain // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetLogin() // Should return zero value + _ = obj.GetEnvironmentID() // Should return zero value }) - t.Run("GetContent", func(t *testing.T) { + t.Run("GetRecord", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskAssessmentSignals{} - var expected *RiskContentSignals - obj.Content = expected + obj := &ReceivingDomain{} + var expected *ReceivingDomainRecord + obj.Record = expected // Act & Assert - assert.Equal(t, expected, obj.GetContent(), "getter should return the property value") + assert.Equal(t, expected, obj.GetRecord(), "getter should return the property value") }) - t.Run("GetContent_NilValue", func(t *testing.T) { + t.Run("GetRecord_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskAssessmentSignals{} - obj.Content = nil + obj := &ReceivingDomain{} + obj.Record = nil // Act & Assert - assert.Nil(t, obj.GetContent(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetRecord(), "getter should return nil when property is nil") }) - t.Run("GetContent_NilReceiver", func(t *testing.T) { + t.Run("GetRecord_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *RiskAssessmentSignals + var obj *ReceivingDomain // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetContent() // Should return zero value - }) - - t.Run("GetCheckout", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &RiskAssessmentSignals{} - var expected *RiskCheckoutSignals - obj.Checkout = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetCheckout(), "getter should return the property value") + _ = obj.GetRecord() // Should return zero value }) - t.Run("GetCheckout_NilValue", func(t *testing.T) { + t.Run("GetCreatedAt", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskAssessmentSignals{} - obj.Checkout = nil + obj := &ReceivingDomain{} + var expected time.Time + obj.CreatedAt = expected // Act & Assert - assert.Nil(t, obj.GetCheckout(), "getter should return nil when property is nil") + assert.Equal(t, expected, obj.GetCreatedAt(), "getter should return the property value") }) - t.Run("GetCheckout_NilReceiver", func(t *testing.T) { + t.Run("GetCreatedAt_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *RiskAssessmentSignals + var obj *ReceivingDomain // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetCheckout() // Should return zero value + _ = obj.GetCreatedAt() // Should return zero value }) - t.Run("GetDevice", func(t *testing.T) { + t.Run("GetLastCheckedAt", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskAssessmentSignals{} - var expected *RiskDeviceSignals - obj.Device = expected + obj := &ReceivingDomain{} + var expected *time.Time + obj.LastCheckedAt = expected // Act & Assert - assert.Equal(t, expected, obj.GetDevice(), "getter should return the property value") + assert.Equal(t, expected, obj.GetLastCheckedAt(), "getter should return the property value") }) - t.Run("GetDevice_NilValue", func(t *testing.T) { + t.Run("GetLastCheckedAt_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskAssessmentSignals{} - obj.Device = nil + obj := &ReceivingDomain{} + obj.LastCheckedAt = nil // Act & Assert - assert.Nil(t, obj.GetDevice(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetLastCheckedAt(), "getter should return nil when property is nil") }) - t.Run("GetDevice_NilReceiver", func(t *testing.T) { + t.Run("GetLastCheckedAt_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *RiskAssessmentSignals + var obj *ReceivingDomain // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetDevice() // Should return zero value + _ = obj.GetLastCheckedAt() // Should return zero value }) } -func TestSettersMarkExplicitRiskAssessmentSignals(t *testing.T) { - t.Run("SetEmail_MarksExplicit", func(t *testing.T) { +func TestSettersMarkExplicitReceivingDomain(t *testing.T) { + t.Run("SetHostname_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskAssessmentSignals{} - var fernTestValueEmail *RiskEmailSignals + obj := &ReceivingDomain{} + var fernTestValueHostname string // Act - obj.SetEmail(fernTestValueEmail) + obj.SetHostname(fernTestValueHostname) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -69542,14 +68863,14 @@ func TestSettersMarkExplicitRiskAssessmentSignals(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetIP_MarksExplicit", func(t *testing.T) { + t.Run("SetEnvironmentID_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskAssessmentSignals{} - var fernTestValueIP *RiskIPSignals + obj := &ReceivingDomain{} + var fernTestValueEnvironmentID string // Act - obj.SetIP(fernTestValueIP) + obj.SetEnvironmentID(fernTestValueEnvironmentID) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -69573,14 +68894,14 @@ func TestSettersMarkExplicitRiskAssessmentSignals(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetVelocity_MarksExplicit", func(t *testing.T) { + t.Run("SetRecord_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskAssessmentSignals{} - var fernTestValueVelocity *RiskVelocitySignals + obj := &ReceivingDomain{} + var fernTestValueRecord *ReceivingDomainRecord // Act - obj.SetVelocity(fernTestValueVelocity) + obj.SetRecord(fernTestValueRecord) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -69604,14 +68925,14 @@ func TestSettersMarkExplicitRiskAssessmentSignals(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetCaptcha_MarksExplicit", func(t *testing.T) { + t.Run("SetCreatedAt_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskAssessmentSignals{} - var fernTestValueCaptcha *RiskCaptchaSignals + obj := &ReceivingDomain{} + var fernTestValueCreatedAt time.Time // Act - obj.SetCaptcha(fernTestValueCaptcha) + obj.SetCreatedAt(fernTestValueCreatedAt) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -69635,14 +68956,14 @@ func TestSettersMarkExplicitRiskAssessmentSignals(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetLogin_MarksExplicit", func(t *testing.T) { + t.Run("SetLastCheckedAt_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskAssessmentSignals{} - var fernTestValueLogin *RiskLoginSignals + obj := &ReceivingDomain{} + var fernTestValueLastCheckedAt *time.Time // Act - obj.SetLogin(fernTestValueLogin) + obj.SetLastCheckedAt(fernTestValueLastCheckedAt) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -69666,198 +68987,219 @@ func TestSettersMarkExplicitRiskAssessmentSignals(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetContent_MarksExplicit", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &RiskAssessmentSignals{} - var fernTestValueContent *RiskContentSignals +} - // Act - obj.SetContent(fernTestValueContent) +func TestSettersReceivingDomainRecord(t *testing.T) { + t.Run("SetType", func(t *testing.T) { + obj := &ReceivingDomainRecord{} + var fernTestValueType ReceivingDomainRecordType + obj.SetType(fernTestValueType) + assert.Equal(t, fernTestValueType, obj.Type) + assert.NotNil(t, obj.explicitFields) + }) - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") + t.Run("SetName", func(t *testing.T) { + obj := &ReceivingDomainRecord{} + var fernTestValueName string + obj.SetName(fernTestValueName) + assert.Equal(t, fernTestValueName, obj.Name) + assert.NotNil(t, obj.explicitFields) + }) - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } + t.Run("SetValue", func(t *testing.T) { + obj := &ReceivingDomainRecord{} + var fernTestValueValue string + obj.SetValue(fernTestValueValue) + assert.Equal(t, fernTestValueValue, obj.Value) + assert.NotNil(t, obj.explicitFields) + }) - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip + t.Run("SetPriority", func(t *testing.T) { + obj := &ReceivingDomainRecord{} + var fernTestValuePriority int64 + obj.SetPriority(fernTestValuePriority) + assert.Equal(t, fernTestValuePriority, obj.Priority) + assert.NotNil(t, obj.explicitFields) }) - t.Run("SetCheckout_MarksExplicit", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &RiskAssessmentSignals{} - var fernTestValueCheckout *RiskCheckoutSignals + t.Run("SetStatus", func(t *testing.T) { + obj := &ReceivingDomainRecord{} + var fernTestValueStatus ReceivingDomainRecordStatus + obj.SetStatus(fernTestValueStatus) + assert.Equal(t, fernTestValueStatus, obj.Status) + assert.NotNil(t, obj.explicitFields) + }) - // Act - obj.SetCheckout(fernTestValueCheckout) + t.Run("SetFound", func(t *testing.T) { + obj := &ReceivingDomainRecord{} + var fernTestValueFound []string + obj.SetFound(fernTestValueFound) + assert.Equal(t, fernTestValueFound, obj.Found) + assert.NotNil(t, obj.explicitFields) + }) - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") +} - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } +func TestGettersReceivingDomainRecord(t *testing.T) { + t.Run("GetType", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &ReceivingDomainRecord{} + var expected ReceivingDomainRecordType + obj.Type = expected - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip + // Act & Assert + assert.Equal(t, expected, obj.GetType(), "getter should return the property value") }) - t.Run("SetDevice_MarksExplicit", func(t *testing.T) { + t.Run("GetType_NilReceiver", func(t *testing.T) { t.Parallel() - // Arrange - obj := &RiskAssessmentSignals{} - var fernTestValueDevice *RiskDeviceSignals - - // Act - obj.SetDevice(fernTestValueDevice) + var obj *ReceivingDomainRecord + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetType() // Should return zero value + }) - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") + t.Run("GetName", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &ReceivingDomainRecord{} + var expected string + obj.Name = expected - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } + // Act & Assert + assert.Equal(t, expected, obj.GetName(), "getter should return the property value") + }) - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip + t.Run("GetName_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *ReceivingDomainRecord + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetName() // Should return zero value }) -} + t.Run("GetValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &ReceivingDomainRecord{} + var expected string + obj.Value = expected -func TestSettersRiskAssessmentUser(t *testing.T) { - t.Run("SetID", func(t *testing.T) { - obj := &RiskAssessmentUser{} - var fernTestValueID *string - obj.SetID(fernTestValueID) - assert.Equal(t, fernTestValueID, obj.ID) - assert.NotNil(t, obj.explicitFields) + // Act & Assert + assert.Equal(t, expected, obj.GetValue(), "getter should return the property value") }) - t.Run("SetEmail", func(t *testing.T) { - obj := &RiskAssessmentUser{} - var fernTestValueEmail *string - obj.SetEmail(fernTestValueEmail) - assert.Equal(t, fernTestValueEmail, obj.Email) - assert.NotNil(t, obj.explicitFields) + t.Run("GetValue_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *ReceivingDomainRecord + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetValue() // Should return zero value }) -} - -func TestGettersRiskAssessmentUser(t *testing.T) { - t.Run("GetID", func(t *testing.T) { + t.Run("GetPriority", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskAssessmentUser{} - var expected *string - obj.ID = expected + obj := &ReceivingDomainRecord{} + var expected int64 + obj.Priority = expected // Act & Assert - assert.Equal(t, expected, obj.GetID(), "getter should return the property value") + assert.Equal(t, expected, obj.GetPriority(), "getter should return the property value") }) - t.Run("GetID_NilValue", func(t *testing.T) { + t.Run("GetPriority_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *ReceivingDomainRecord + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetPriority() // Should return zero value + }) + + t.Run("GetStatus", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskAssessmentUser{} - obj.ID = nil + obj := &ReceivingDomainRecord{} + var expected ReceivingDomainRecordStatus + obj.Status = expected // Act & Assert - assert.Nil(t, obj.GetID(), "getter should return nil when property is nil") + assert.Equal(t, expected, obj.GetStatus(), "getter should return the property value") }) - t.Run("GetID_NilReceiver", func(t *testing.T) { + t.Run("GetStatus_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *RiskAssessmentUser + var obj *ReceivingDomainRecord // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetID() // Should return zero value + _ = obj.GetStatus() // Should return zero value }) - t.Run("GetEmail", func(t *testing.T) { + t.Run("GetFound", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskAssessmentUser{} - var expected *string - obj.Email = expected + obj := &ReceivingDomainRecord{} + var expected []string + obj.Found = expected // Act & Assert - assert.Equal(t, expected, obj.GetEmail(), "getter should return the property value") + assert.Equal(t, expected, obj.GetFound(), "getter should return the property value") }) - t.Run("GetEmail_NilValue", func(t *testing.T) { + t.Run("GetFound_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskAssessmentUser{} - obj.Email = nil + obj := &ReceivingDomainRecord{} + obj.Found = nil // Act & Assert - assert.Nil(t, obj.GetEmail(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetFound(), "getter should return nil when property is nil") }) - t.Run("GetEmail_NilReceiver", func(t *testing.T) { + t.Run("GetFound_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *RiskAssessmentUser + var obj *ReceivingDomainRecord // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetEmail() // Should return zero value + _ = obj.GetFound() // Should return zero value }) } -func TestSettersMarkExplicitRiskAssessmentUser(t *testing.T) { - t.Run("SetID_MarksExplicit", func(t *testing.T) { +func TestSettersMarkExplicitReceivingDomainRecord(t *testing.T) { + t.Run("SetType_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskAssessmentUser{} - var fernTestValueID *string + obj := &ReceivingDomainRecord{} + var fernTestValueType ReceivingDomainRecordType // Act - obj.SetID(fernTestValueID) + obj.SetType(fernTestValueType) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -69881,14 +69223,14 @@ func TestSettersMarkExplicitRiskAssessmentUser(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetEmail_MarksExplicit", func(t *testing.T) { + t.Run("SetName_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskAssessmentUser{} - var fernTestValueEmail *string + obj := &ReceivingDomainRecord{} + var fernTestValueName string // Act - obj.SetEmail(fernTestValueEmail) + obj.SetName(fernTestValueName) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -69912,95 +69254,76 @@ func TestSettersMarkExplicitRiskAssessmentUser(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) -} - -func TestSettersRiskCaptchaSignals(t *testing.T) { - t.Run("SetProvided", func(t *testing.T) { - obj := &RiskCaptchaSignals{} - var fernTestValueProvided bool - obj.SetProvided(fernTestValueProvided) - assert.Equal(t, fernTestValueProvided, obj.Provided) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetPassed", func(t *testing.T) { - obj := &RiskCaptchaSignals{} - var fernTestValuePassed *bool - obj.SetPassed(fernTestValuePassed) - assert.Equal(t, fernTestValuePassed, obj.Passed) - assert.NotNil(t, obj.explicitFields) - }) - -} - -func TestGettersRiskCaptchaSignals(t *testing.T) { - t.Run("GetProvided", func(t *testing.T) { + t.Run("SetValue_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskCaptchaSignals{} - var expected bool - obj.Provided = expected + obj := &ReceivingDomainRecord{} + var fernTestValueValue string - // Act & Assert - assert.Equal(t, expected, obj.GetProvided(), "getter should return the property value") - }) + // Act + obj.SetValue(fernTestValueValue) - t.Run("GetProvided_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *RiskCaptchaSignals - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetProvided() // Should return zero value - }) + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") - t.Run("GetPassed", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &RiskCaptchaSignals{} - var expected *bool - obj.Passed = expected + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } - // Act & Assert - assert.Equal(t, expected, obj.GetPassed(), "getter should return the property value") + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("GetPassed_NilValue", func(t *testing.T) { + t.Run("SetPriority_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskCaptchaSignals{} - obj.Passed = nil + obj := &ReceivingDomainRecord{} + var fernTestValuePriority int64 - // Act & Assert - assert.Nil(t, obj.GetPassed(), "getter should return nil when property is nil") - }) + // Act + obj.SetPriority(fernTestValuePriority) - t.Run("GetPassed_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *RiskCaptchaSignals - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetPassed() // Should return zero value - }) + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") -} + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } -func TestSettersMarkExplicitRiskCaptchaSignals(t *testing.T) { - t.Run("SetProvided_MarksExplicit", func(t *testing.T) { + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetStatus_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskCaptchaSignals{} - var fernTestValueProvided bool + obj := &ReceivingDomainRecord{} + var fernTestValueStatus ReceivingDomainRecordStatus // Act - obj.SetProvided(fernTestValueProvided) + obj.SetStatus(fernTestValueStatus) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -70024,14 +69347,14 @@ func TestSettersMarkExplicitRiskCaptchaSignals(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetPassed_MarksExplicit", func(t *testing.T) { + t.Run("SetFound_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskCaptchaSignals{} - var fernTestValuePassed *bool + obj := &ReceivingDomainRecord{} + var fernTestValueFound []string // Act - obj.SetPassed(fernTestValuePassed) + obj.SetFound(fernTestValueFound) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -70057,247 +69380,268 @@ func TestSettersMarkExplicitRiskCaptchaSignals(t *testing.T) { } -func TestSettersRiskCheckoutSignals(t *testing.T) { - t.Run("SetAmount", func(t *testing.T) { - obj := &RiskCheckoutSignals{} - var fernTestValueAmount int64 - obj.SetAmount(fernTestValueAmount) - assert.Equal(t, fernTestValueAmount, obj.Amount) +func TestSettersRenderedEmailTemplate(t *testing.T) { + t.Run("SetObject", func(t *testing.T) { + obj := &RenderedEmailTemplate{} + var fernTestValueObject RenderedEmailTemplateObject + obj.SetObject(fernTestValueObject) + assert.Equal(t, fernTestValueObject, obj.Object) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetCurrency", func(t *testing.T) { - obj := &RiskCheckoutSignals{} - var fernTestValueCurrency string - obj.SetCurrency(fernTestValueCurrency) - assert.Equal(t, fernTestValueCurrency, obj.Currency) + t.Run("SetTemplateID", func(t *testing.T) { + obj := &RenderedEmailTemplate{} + var fernTestValueTemplateID string + obj.SetTemplateID(fernTestValueTemplateID) + assert.Equal(t, fernTestValueTemplateID, obj.TemplateID) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetCardCountry", func(t *testing.T) { - obj := &RiskCheckoutSignals{} - var fernTestValueCardCountry *string - obj.SetCardCountry(fernTestValueCardCountry) - assert.Equal(t, fernTestValueCardCountry, obj.CardCountry) + t.Run("SetVersion", func(t *testing.T) { + obj := &RenderedEmailTemplate{} + var fernTestValueVersion *int64 + obj.SetVersion(fernTestValueVersion) + assert.Equal(t, fernTestValueVersion, obj.Version) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetCardFunding", func(t *testing.T) { - obj := &RiskCheckoutSignals{} - var fernTestValueCardFunding *RiskCheckoutSignalsCardFunding - obj.SetCardFunding(fernTestValueCardFunding) - assert.Equal(t, fernTestValueCardFunding, obj.CardFunding) + t.Run("SetLocale", func(t *testing.T) { + obj := &RenderedEmailTemplate{} + var fernTestValueLocale string + obj.SetLocale(fernTestValueLocale) + assert.Equal(t, fernTestValueLocale, obj.Locale) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetBillingCountry", func(t *testing.T) { - obj := &RiskCheckoutSignals{} - var fernTestValueBillingCountry *string - obj.SetBillingCountry(fernTestValueBillingCountry) - assert.Equal(t, fernTestValueBillingCountry, obj.BillingCountry) + t.Run("SetSubject", func(t *testing.T) { + obj := &RenderedEmailTemplate{} + var fernTestValueSubject string + obj.SetSubject(fernTestValueSubject) + assert.Equal(t, fernTestValueSubject, obj.Subject) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetShippingCountry", func(t *testing.T) { - obj := &RiskCheckoutSignals{} - var fernTestValueShippingCountry *string - obj.SetShippingCountry(fernTestValueShippingCountry) - assert.Equal(t, fernTestValueShippingCountry, obj.ShippingCountry) + t.Run("SetHTML", func(t *testing.T) { + obj := &RenderedEmailTemplate{} + var fernTestValueHTML *string + obj.SetHTML(fernTestValueHTML) + assert.Equal(t, fernTestValueHTML, obj.HTML) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetText", func(t *testing.T) { + obj := &RenderedEmailTemplate{} + var fernTestValueText *string + obj.SetText(fernTestValueText) + assert.Equal(t, fernTestValueText, obj.Text) assert.NotNil(t, obj.explicitFields) }) } -func TestGettersRiskCheckoutSignals(t *testing.T) { - t.Run("GetAmount", func(t *testing.T) { +func TestGettersRenderedEmailTemplate(t *testing.T) { + t.Run("GetObject", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskCheckoutSignals{} - var expected int64 - obj.Amount = expected + obj := &RenderedEmailTemplate{} + var expected RenderedEmailTemplateObject + obj.Object = expected // Act & Assert - assert.Equal(t, expected, obj.GetAmount(), "getter should return the property value") + assert.Equal(t, expected, obj.GetObject(), "getter should return the property value") }) - t.Run("GetAmount_NilReceiver", func(t *testing.T) { + t.Run("GetObject_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *RiskCheckoutSignals + var obj *RenderedEmailTemplate // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetAmount() // Should return zero value + _ = obj.GetObject() // Should return zero value }) - t.Run("GetCurrency", func(t *testing.T) { + t.Run("GetTemplateID", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskCheckoutSignals{} + obj := &RenderedEmailTemplate{} var expected string - obj.Currency = expected + obj.TemplateID = expected // Act & Assert - assert.Equal(t, expected, obj.GetCurrency(), "getter should return the property value") + assert.Equal(t, expected, obj.GetTemplateID(), "getter should return the property value") }) - t.Run("GetCurrency_NilReceiver", func(t *testing.T) { + t.Run("GetTemplateID_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *RiskCheckoutSignals + var obj *RenderedEmailTemplate // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetCurrency() // Should return zero value + _ = obj.GetTemplateID() // Should return zero value }) - t.Run("GetCardCountry", func(t *testing.T) { + t.Run("GetVersion", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskCheckoutSignals{} - var expected *string - obj.CardCountry = expected + obj := &RenderedEmailTemplate{} + var expected *int64 + obj.Version = expected // Act & Assert - assert.Equal(t, expected, obj.GetCardCountry(), "getter should return the property value") + assert.Equal(t, expected, obj.GetVersion(), "getter should return the property value") }) - t.Run("GetCardCountry_NilValue", func(t *testing.T) { + t.Run("GetVersion_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskCheckoutSignals{} - obj.CardCountry = nil + obj := &RenderedEmailTemplate{} + obj.Version = nil // Act & Assert - assert.Nil(t, obj.GetCardCountry(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetVersion(), "getter should return nil when property is nil") }) - t.Run("GetCardCountry_NilReceiver", func(t *testing.T) { + t.Run("GetVersion_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *RiskCheckoutSignals + var obj *RenderedEmailTemplate // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetCardCountry() // Should return zero value + _ = obj.GetVersion() // Should return zero value }) - t.Run("GetCardFunding", func(t *testing.T) { + t.Run("GetLocale", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskCheckoutSignals{} - var expected *RiskCheckoutSignalsCardFunding - obj.CardFunding = expected + obj := &RenderedEmailTemplate{} + var expected string + obj.Locale = expected // Act & Assert - assert.Equal(t, expected, obj.GetCardFunding(), "getter should return the property value") + assert.Equal(t, expected, obj.GetLocale(), "getter should return the property value") }) - t.Run("GetCardFunding_NilValue", func(t *testing.T) { + t.Run("GetLocale_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *RenderedEmailTemplate + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetLocale() // Should return zero value + }) + + t.Run("GetSubject", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskCheckoutSignals{} - obj.CardFunding = nil + obj := &RenderedEmailTemplate{} + var expected string + obj.Subject = expected // Act & Assert - assert.Nil(t, obj.GetCardFunding(), "getter should return nil when property is nil") + assert.Equal(t, expected, obj.GetSubject(), "getter should return the property value") }) - t.Run("GetCardFunding_NilReceiver", func(t *testing.T) { + t.Run("GetSubject_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *RiskCheckoutSignals + var obj *RenderedEmailTemplate // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetCardFunding() // Should return zero value + _ = obj.GetSubject() // Should return zero value }) - t.Run("GetBillingCountry", func(t *testing.T) { + t.Run("GetHTML", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskCheckoutSignals{} + obj := &RenderedEmailTemplate{} var expected *string - obj.BillingCountry = expected + obj.HTML = expected // Act & Assert - assert.Equal(t, expected, obj.GetBillingCountry(), "getter should return the property value") + assert.Equal(t, expected, obj.GetHTML(), "getter should return the property value") }) - t.Run("GetBillingCountry_NilValue", func(t *testing.T) { + t.Run("GetHTML_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskCheckoutSignals{} - obj.BillingCountry = nil + obj := &RenderedEmailTemplate{} + obj.HTML = nil // Act & Assert - assert.Nil(t, obj.GetBillingCountry(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetHTML(), "getter should return nil when property is nil") }) - t.Run("GetBillingCountry_NilReceiver", func(t *testing.T) { + t.Run("GetHTML_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *RiskCheckoutSignals + var obj *RenderedEmailTemplate // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetBillingCountry() // Should return zero value + _ = obj.GetHTML() // Should return zero value }) - t.Run("GetShippingCountry", func(t *testing.T) { + t.Run("GetText", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskCheckoutSignals{} + obj := &RenderedEmailTemplate{} var expected *string - obj.ShippingCountry = expected + obj.Text = expected // Act & Assert - assert.Equal(t, expected, obj.GetShippingCountry(), "getter should return the property value") + assert.Equal(t, expected, obj.GetText(), "getter should return the property value") }) - t.Run("GetShippingCountry_NilValue", func(t *testing.T) { + t.Run("GetText_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskCheckoutSignals{} - obj.ShippingCountry = nil + obj := &RenderedEmailTemplate{} + obj.Text = nil // Act & Assert - assert.Nil(t, obj.GetShippingCountry(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetText(), "getter should return nil when property is nil") }) - t.Run("GetShippingCountry_NilReceiver", func(t *testing.T) { + t.Run("GetText_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *RiskCheckoutSignals + var obj *RenderedEmailTemplate // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetShippingCountry() // Should return zero value + _ = obj.GetText() // Should return zero value }) } -func TestSettersMarkExplicitRiskCheckoutSignals(t *testing.T) { - t.Run("SetAmount_MarksExplicit", func(t *testing.T) { +func TestSettersMarkExplicitRenderedEmailTemplate(t *testing.T) { + t.Run("SetObject_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskCheckoutSignals{} - var fernTestValueAmount int64 + obj := &RenderedEmailTemplate{} + var fernTestValueObject RenderedEmailTemplateObject // Act - obj.SetAmount(fernTestValueAmount) + obj.SetObject(fernTestValueObject) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -70321,14 +69665,14 @@ func TestSettersMarkExplicitRiskCheckoutSignals(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetCurrency_MarksExplicit", func(t *testing.T) { + t.Run("SetTemplateID_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskCheckoutSignals{} - var fernTestValueCurrency string + obj := &RenderedEmailTemplate{} + var fernTestValueTemplateID string // Act - obj.SetCurrency(fernTestValueCurrency) + obj.SetTemplateID(fernTestValueTemplateID) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -70352,14 +69696,14 @@ func TestSettersMarkExplicitRiskCheckoutSignals(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetCardCountry_MarksExplicit", func(t *testing.T) { + t.Run("SetVersion_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskCheckoutSignals{} - var fernTestValueCardCountry *string + obj := &RenderedEmailTemplate{} + var fernTestValueVersion *int64 // Act - obj.SetCardCountry(fernTestValueCardCountry) + obj.SetVersion(fernTestValueVersion) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -70383,14 +69727,14 @@ func TestSettersMarkExplicitRiskCheckoutSignals(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetCardFunding_MarksExplicit", func(t *testing.T) { + t.Run("SetLocale_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskCheckoutSignals{} - var fernTestValueCardFunding *RiskCheckoutSignalsCardFunding + obj := &RenderedEmailTemplate{} + var fernTestValueLocale string // Act - obj.SetCardFunding(fernTestValueCardFunding) + obj.SetLocale(fernTestValueLocale) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -70414,14 +69758,14 @@ func TestSettersMarkExplicitRiskCheckoutSignals(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetBillingCountry_MarksExplicit", func(t *testing.T) { + t.Run("SetSubject_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskCheckoutSignals{} - var fernTestValueBillingCountry *string + obj := &RenderedEmailTemplate{} + var fernTestValueSubject string // Act - obj.SetBillingCountry(fernTestValueBillingCountry) + obj.SetSubject(fernTestValueSubject) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -70445,14 +69789,45 @@ func TestSettersMarkExplicitRiskCheckoutSignals(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetShippingCountry_MarksExplicit", func(t *testing.T) { + t.Run("SetHTML_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskCheckoutSignals{} - var fernTestValueShippingCountry *string + obj := &RenderedEmailTemplate{} + var fernTestValueHTML *string // Act - obj.SetShippingCountry(fernTestValueShippingCountry) + obj.SetHTML(fernTestValueHTML) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetText_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RenderedEmailTemplate{} + var fernTestValueText *string + + // Act + obj.SetText(fernTestValueText) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -70478,576 +69853,535 @@ func TestSettersMarkExplicitRiskCheckoutSignals(t *testing.T) { } -func TestSettersRiskContentSignals(t *testing.T) { - t.Run("SetSpam", func(t *testing.T) { - obj := &RiskContentSignals{} - var fernTestValueSpam float64 - obj.SetSpam(fernTestValueSpam) - assert.Equal(t, fernTestValueSpam, obj.Spam) +func TestSettersRiskAssessment(t *testing.T) { + t.Run("SetObject", func(t *testing.T) { + obj := &RiskAssessment{} + var fernTestValueObject RiskAssessmentObject + obj.SetObject(fernTestValueObject) + assert.Equal(t, fernTestValueObject, obj.Object) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetPhishing", func(t *testing.T) { - obj := &RiskContentSignals{} - var fernTestValuePhishing float64 - obj.SetPhishing(fernTestValuePhishing) - assert.Equal(t, fernTestValuePhishing, obj.Phishing) + t.Run("SetID", func(t *testing.T) { + obj := &RiskAssessment{} + var fernTestValueID string + obj.SetID(fernTestValueID) + assert.Equal(t, fernTestValueID, obj.ID) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetMalware", func(t *testing.T) { - obj := &RiskContentSignals{} - var fernTestValueMalware float64 - obj.SetMalware(fernTestValueMalware) - assert.Equal(t, fernTestValueMalware, obj.Malware) + t.Run("SetEvent", func(t *testing.T) { + obj := &RiskAssessment{} + var fernTestValueEvent RiskEvent + obj.SetEvent(fernTestValueEvent) + assert.Equal(t, fernTestValueEvent, obj.Event) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetFraud", func(t *testing.T) { - obj := &RiskContentSignals{} - var fernTestValueFraud float64 - obj.SetFraud(fernTestValueFraud) - assert.Equal(t, fernTestValueFraud, obj.Fraud) + t.Run("SetEventName", func(t *testing.T) { + obj := &RiskAssessment{} + var fernTestValueEventName *string + obj.SetEventName(fernTestValueEventName) + assert.Equal(t, fernTestValueEventName, obj.EventName) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetDecision", func(t *testing.T) { + obj := &RiskAssessment{} + var fernTestValueDecision RiskDecision + obj.SetDecision(fernTestValueDecision) + assert.Equal(t, fernTestValueDecision, obj.Decision) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetScore", func(t *testing.T) { + obj := &RiskAssessment{} + var fernTestValueScore float64 + obj.SetScore(fernTestValueScore) + assert.Equal(t, fernTestValueScore, obj.Score) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetReasons", func(t *testing.T) { + obj := &RiskAssessment{} + var fernTestValueReasons []*RiskReason + obj.SetReasons(fernTestValueReasons) + assert.Equal(t, fernTestValueReasons, obj.Reasons) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetSignals", func(t *testing.T) { + obj := &RiskAssessment{} + var fernTestValueSignals *RiskAssessmentSignals + obj.SetSignals(fernTestValueSignals) + assert.Equal(t, fernTestValueSignals, obj.Signals) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetUser", func(t *testing.T) { + obj := &RiskAssessment{} + var fernTestValueUser *RiskAssessmentUser + obj.SetUser(fernTestValueUser) + assert.Equal(t, fernTestValueUser, obj.User) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetIP", func(t *testing.T) { + obj := &RiskAssessment{} + var fernTestValueIP *string + obj.SetIP(fernTestValueIP) + assert.Equal(t, fernTestValueIP, obj.IP) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetDegraded", func(t *testing.T) { + obj := &RiskAssessment{} + var fernTestValueDegraded []RiskAssessmentDegradedItem + obj.SetDegraded(fernTestValueDegraded) + assert.Equal(t, fernTestValueDegraded, obj.Degraded) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetOutcome", func(t *testing.T) { + obj := &RiskAssessment{} + var fernTestValueOutcome *RiskOutcome + obj.SetOutcome(fernTestValueOutcome) + assert.Equal(t, fernTestValueOutcome, obj.Outcome) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetReviewStatus", func(t *testing.T) { + obj := &RiskAssessment{} + var fernTestValueReviewStatus *RiskAssessmentReviewStatus + obj.SetReviewStatus(fernTestValueReviewStatus) + assert.Equal(t, fernTestValueReviewStatus, obj.ReviewStatus) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetCreatedAt", func(t *testing.T) { + obj := &RiskAssessment{} + var fernTestValueCreatedAt time.Time + obj.SetCreatedAt(fernTestValueCreatedAt) + assert.Equal(t, fernTestValueCreatedAt, obj.CreatedAt) assert.NotNil(t, obj.explicitFields) }) } -func TestGettersRiskContentSignals(t *testing.T) { - t.Run("GetSpam", func(t *testing.T) { +func TestGettersRiskAssessment(t *testing.T) { + t.Run("GetObject", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskContentSignals{} - var expected float64 - obj.Spam = expected + obj := &RiskAssessment{} + var expected RiskAssessmentObject + obj.Object = expected // Act & Assert - assert.Equal(t, expected, obj.GetSpam(), "getter should return the property value") + assert.Equal(t, expected, obj.GetObject(), "getter should return the property value") }) - t.Run("GetSpam_NilReceiver", func(t *testing.T) { + t.Run("GetObject_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *RiskContentSignals + var obj *RiskAssessment // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetSpam() // Should return zero value + _ = obj.GetObject() // Should return zero value }) - t.Run("GetPhishing", func(t *testing.T) { + t.Run("GetID", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskContentSignals{} - var expected float64 - obj.Phishing = expected + obj := &RiskAssessment{} + var expected string + obj.ID = expected // Act & Assert - assert.Equal(t, expected, obj.GetPhishing(), "getter should return the property value") + assert.Equal(t, expected, obj.GetID(), "getter should return the property value") }) - t.Run("GetPhishing_NilReceiver", func(t *testing.T) { + t.Run("GetID_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *RiskContentSignals + var obj *RiskAssessment // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetPhishing() // Should return zero value + _ = obj.GetID() // Should return zero value }) - t.Run("GetMalware", func(t *testing.T) { + t.Run("GetEvent", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskContentSignals{} - var expected float64 - obj.Malware = expected + obj := &RiskAssessment{} + var expected RiskEvent + obj.Event = expected // Act & Assert - assert.Equal(t, expected, obj.GetMalware(), "getter should return the property value") + assert.Equal(t, expected, obj.GetEvent(), "getter should return the property value") }) - t.Run("GetMalware_NilReceiver", func(t *testing.T) { + t.Run("GetEvent_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *RiskContentSignals + var obj *RiskAssessment // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetMalware() // Should return zero value + _ = obj.GetEvent() // Should return zero value }) - t.Run("GetFraud", func(t *testing.T) { + t.Run("GetEventName", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskContentSignals{} - var expected float64 - obj.Fraud = expected + obj := &RiskAssessment{} + var expected *string + obj.EventName = expected // Act & Assert - assert.Equal(t, expected, obj.GetFraud(), "getter should return the property value") + assert.Equal(t, expected, obj.GetEventName(), "getter should return the property value") }) - t.Run("GetFraud_NilReceiver", func(t *testing.T) { + t.Run("GetEventName_NilValue", func(t *testing.T) { t.Parallel() - var obj *RiskContentSignals + // Arrange + obj := &RiskAssessment{} + obj.EventName = nil + + // Act & Assert + assert.Nil(t, obj.GetEventName(), "getter should return nil when property is nil") + }) + + t.Run("GetEventName_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *RiskAssessment // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetFraud() // Should return zero value + _ = obj.GetEventName() // Should return zero value }) -} - -func TestSettersMarkExplicitRiskContentSignals(t *testing.T) { - t.Run("SetSpam_MarksExplicit", func(t *testing.T) { + t.Run("GetDecision", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskContentSignals{} - var fernTestValueSpam float64 - - // Act - obj.SetSpam(fernTestValueSpam) - - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") + obj := &RiskAssessment{} + var expected RiskDecision + obj.Decision = expected - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } + // Act & Assert + assert.Equal(t, expected, obj.GetDecision(), "getter should return the property value") + }) - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip + t.Run("GetDecision_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *RiskAssessment + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetDecision() // Should return zero value }) - t.Run("SetPhishing_MarksExplicit", func(t *testing.T) { + t.Run("GetScore", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskContentSignals{} - var fernTestValuePhishing float64 + obj := &RiskAssessment{} + var expected float64 + obj.Score = expected - // Act - obj.SetPhishing(fernTestValuePhishing) + // Act & Assert + assert.Equal(t, expected, obj.GetScore(), "getter should return the property value") + }) - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") + t.Run("GetScore_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *RiskAssessment + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetScore() // Should return zero value + }) - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } + t.Run("GetReasons", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskAssessment{} + var expected []*RiskReason + obj.Reasons = expected - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip + // Act & Assert + assert.Equal(t, expected, obj.GetReasons(), "getter should return the property value") }) - t.Run("SetMalware_MarksExplicit", func(t *testing.T) { + t.Run("GetReasons_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskContentSignals{} - var fernTestValueMalware float64 + obj := &RiskAssessment{} + obj.Reasons = nil - // Act - obj.SetMalware(fernTestValueMalware) + // Act & Assert + assert.Nil(t, obj.GetReasons(), "getter should return nil when property is nil") + }) - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") + t.Run("GetReasons_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *RiskAssessment + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetReasons() // Should return zero value + }) - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } + t.Run("GetSignals", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskAssessment{} + var expected *RiskAssessmentSignals + obj.Signals = expected - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip + // Act & Assert + assert.Equal(t, expected, obj.GetSignals(), "getter should return the property value") }) - t.Run("SetFraud_MarksExplicit", func(t *testing.T) { + t.Run("GetSignals_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskContentSignals{} - var fernTestValueFraud float64 - - // Act - obj.SetFraud(fernTestValueFraud) + obj := &RiskAssessment{} + obj.Signals = nil - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") + // Act & Assert + assert.Nil(t, obj.GetSignals(), "getter should return nil when property is nil") + }) - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } - - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip - }) - -} - -func TestSettersRiskDeviceSignals(t *testing.T) { - t.Run("SetValid", func(t *testing.T) { - obj := &RiskDeviceSignals{} - var fernTestValueValid bool - obj.SetValid(fernTestValueValid) - assert.Equal(t, fernTestValueValid, obj.Valid) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetAutomation", func(t *testing.T) { - obj := &RiskDeviceSignals{} - var fernTestValueAutomation bool - obj.SetAutomation(fernTestValueAutomation) - assert.Equal(t, fernTestValueAutomation, obj.Automation) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetTimezone", func(t *testing.T) { - obj := &RiskDeviceSignals{} - var fernTestValueTimezone *string - obj.SetTimezone(fernTestValueTimezone) - assert.Equal(t, fernTestValueTimezone, obj.Timezone) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetLanguage", func(t *testing.T) { - obj := &RiskDeviceSignals{} - var fernTestValueLanguage *string - obj.SetLanguage(fernTestValueLanguage) - assert.Equal(t, fernTestValueLanguage, obj.Language) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetPlatform", func(t *testing.T) { - obj := &RiskDeviceSignals{} - var fernTestValuePlatform *string - obj.SetPlatform(fernTestValuePlatform) - assert.Equal(t, fernTestValuePlatform, obj.Platform) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetScreen", func(t *testing.T) { - obj := &RiskDeviceSignals{} - var fernTestValueScreen *string - obj.SetScreen(fernTestValueScreen) - assert.Equal(t, fernTestValueScreen, obj.Screen) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetTouch", func(t *testing.T) { - obj := &RiskDeviceSignals{} - var fernTestValueTouch *bool - obj.SetTouch(fernTestValueTouch) - assert.Equal(t, fernTestValueTouch, obj.Touch) - assert.NotNil(t, obj.explicitFields) - }) - -} - -func TestGettersRiskDeviceSignals(t *testing.T) { - t.Run("GetValid", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &RiskDeviceSignals{} - var expected bool - obj.Valid = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetValid(), "getter should return the property value") - }) - - t.Run("GetValid_NilReceiver", func(t *testing.T) { + t.Run("GetSignals_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *RiskDeviceSignals + var obj *RiskAssessment // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetValid() // Should return zero value + _ = obj.GetSignals() // Should return zero value }) - t.Run("GetAutomation", func(t *testing.T) { + t.Run("GetUser", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskDeviceSignals{} - var expected bool - obj.Automation = expected + obj := &RiskAssessment{} + var expected *RiskAssessmentUser + obj.User = expected // Act & Assert - assert.Equal(t, expected, obj.GetAutomation(), "getter should return the property value") + assert.Equal(t, expected, obj.GetUser(), "getter should return the property value") }) - t.Run("GetAutomation_NilReceiver", func(t *testing.T) { + t.Run("GetUser_NilValue", func(t *testing.T) { t.Parallel() - var obj *RiskDeviceSignals + // Arrange + obj := &RiskAssessment{} + obj.User = nil + + // Act & Assert + assert.Nil(t, obj.GetUser(), "getter should return nil when property is nil") + }) + + t.Run("GetUser_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *RiskAssessment // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetAutomation() // Should return zero value + _ = obj.GetUser() // Should return zero value }) - t.Run("GetTimezone", func(t *testing.T) { + t.Run("GetIP", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskDeviceSignals{} + obj := &RiskAssessment{} var expected *string - obj.Timezone = expected + obj.IP = expected // Act & Assert - assert.Equal(t, expected, obj.GetTimezone(), "getter should return the property value") + assert.Equal(t, expected, obj.GetIP(), "getter should return the property value") }) - t.Run("GetTimezone_NilValue", func(t *testing.T) { + t.Run("GetIP_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskDeviceSignals{} - obj.Timezone = nil + obj := &RiskAssessment{} + obj.IP = nil // Act & Assert - assert.Nil(t, obj.GetTimezone(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetIP(), "getter should return nil when property is nil") }) - t.Run("GetTimezone_NilReceiver", func(t *testing.T) { + t.Run("GetIP_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *RiskDeviceSignals + var obj *RiskAssessment // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetTimezone() // Should return zero value + _ = obj.GetIP() // Should return zero value }) - t.Run("GetLanguage", func(t *testing.T) { + t.Run("GetDegraded", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskDeviceSignals{} - var expected *string - obj.Language = expected + obj := &RiskAssessment{} + var expected []RiskAssessmentDegradedItem + obj.Degraded = expected // Act & Assert - assert.Equal(t, expected, obj.GetLanguage(), "getter should return the property value") + assert.Equal(t, expected, obj.GetDegraded(), "getter should return the property value") }) - t.Run("GetLanguage_NilValue", func(t *testing.T) { + t.Run("GetDegraded_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskDeviceSignals{} - obj.Language = nil + obj := &RiskAssessment{} + obj.Degraded = nil // Act & Assert - assert.Nil(t, obj.GetLanguage(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetDegraded(), "getter should return nil when property is nil") }) - t.Run("GetLanguage_NilReceiver", func(t *testing.T) { + t.Run("GetDegraded_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *RiskDeviceSignals + var obj *RiskAssessment // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetLanguage() // Should return zero value + _ = obj.GetDegraded() // Should return zero value }) - t.Run("GetPlatform", func(t *testing.T) { + t.Run("GetOutcome", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskDeviceSignals{} - var expected *string - obj.Platform = expected + obj := &RiskAssessment{} + var expected *RiskOutcome + obj.Outcome = expected // Act & Assert - assert.Equal(t, expected, obj.GetPlatform(), "getter should return the property value") + assert.Equal(t, expected, obj.GetOutcome(), "getter should return the property value") }) - t.Run("GetPlatform_NilValue", func(t *testing.T) { + t.Run("GetOutcome_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskDeviceSignals{} - obj.Platform = nil + obj := &RiskAssessment{} + obj.Outcome = nil // Act & Assert - assert.Nil(t, obj.GetPlatform(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetOutcome(), "getter should return nil when property is nil") }) - t.Run("GetPlatform_NilReceiver", func(t *testing.T) { + t.Run("GetOutcome_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *RiskDeviceSignals + var obj *RiskAssessment // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetPlatform() // Should return zero value + _ = obj.GetOutcome() // Should return zero value }) - t.Run("GetScreen", func(t *testing.T) { + t.Run("GetReviewStatus", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskDeviceSignals{} - var expected *string - obj.Screen = expected + obj := &RiskAssessment{} + var expected *RiskAssessmentReviewStatus + obj.ReviewStatus = expected // Act & Assert - assert.Equal(t, expected, obj.GetScreen(), "getter should return the property value") + assert.Equal(t, expected, obj.GetReviewStatus(), "getter should return the property value") }) - t.Run("GetScreen_NilValue", func(t *testing.T) { + t.Run("GetReviewStatus_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskDeviceSignals{} - obj.Screen = nil + obj := &RiskAssessment{} + obj.ReviewStatus = nil // Act & Assert - assert.Nil(t, obj.GetScreen(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetReviewStatus(), "getter should return nil when property is nil") }) - t.Run("GetScreen_NilReceiver", func(t *testing.T) { + t.Run("GetReviewStatus_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *RiskDeviceSignals + var obj *RiskAssessment // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetScreen() // Should return zero value - }) - - t.Run("GetTouch", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &RiskDeviceSignals{} - var expected *bool - obj.Touch = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetTouch(), "getter should return the property value") + _ = obj.GetReviewStatus() // Should return zero value }) - t.Run("GetTouch_NilValue", func(t *testing.T) { + t.Run("GetCreatedAt", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskDeviceSignals{} - obj.Touch = nil + obj := &RiskAssessment{} + var expected time.Time + obj.CreatedAt = expected // Act & Assert - assert.Nil(t, obj.GetTouch(), "getter should return nil when property is nil") + assert.Equal(t, expected, obj.GetCreatedAt(), "getter should return the property value") }) - t.Run("GetTouch_NilReceiver", func(t *testing.T) { + t.Run("GetCreatedAt_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *RiskDeviceSignals + var obj *RiskAssessment // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetTouch() // Should return zero value + _ = obj.GetCreatedAt() // Should return zero value }) } -func TestSettersMarkExplicitRiskDeviceSignals(t *testing.T) { - t.Run("SetValid_MarksExplicit", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &RiskDeviceSignals{} - var fernTestValueValid bool - - // Act - obj.SetValid(fernTestValueValid) - - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") - - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } - - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip - }) - - t.Run("SetAutomation_MarksExplicit", func(t *testing.T) { +func TestSettersMarkExplicitRiskAssessment(t *testing.T) { + t.Run("SetObject_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskDeviceSignals{} - var fernTestValueAutomation bool + obj := &RiskAssessment{} + var fernTestValueObject RiskAssessmentObject // Act - obj.SetAutomation(fernTestValueAutomation) + obj.SetObject(fernTestValueObject) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -71071,14 +70405,14 @@ func TestSettersMarkExplicitRiskDeviceSignals(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetTimezone_MarksExplicit", func(t *testing.T) { + t.Run("SetID_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskDeviceSignals{} - var fernTestValueTimezone *string + obj := &RiskAssessment{} + var fernTestValueID string // Act - obj.SetTimezone(fernTestValueTimezone) + obj.SetID(fernTestValueID) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -71102,14 +70436,14 @@ func TestSettersMarkExplicitRiskDeviceSignals(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetLanguage_MarksExplicit", func(t *testing.T) { + t.Run("SetEvent_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskDeviceSignals{} - var fernTestValueLanguage *string + obj := &RiskAssessment{} + var fernTestValueEvent RiskEvent // Act - obj.SetLanguage(fernTestValueLanguage) + obj.SetEvent(fernTestValueEvent) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -71133,14 +70467,14 @@ func TestSettersMarkExplicitRiskDeviceSignals(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetPlatform_MarksExplicit", func(t *testing.T) { + t.Run("SetEventName_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskDeviceSignals{} - var fernTestValuePlatform *string + obj := &RiskAssessment{} + var fernTestValueEventName *string // Act - obj.SetPlatform(fernTestValuePlatform) + obj.SetEventName(fernTestValueEventName) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -71164,14 +70498,14 @@ func TestSettersMarkExplicitRiskDeviceSignals(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetScreen_MarksExplicit", func(t *testing.T) { + t.Run("SetDecision_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskDeviceSignals{} - var fernTestValueScreen *string + obj := &RiskAssessment{} + var fernTestValueDecision RiskDecision // Act - obj.SetScreen(fernTestValueScreen) + obj.SetDecision(fernTestValueDecision) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -71195,14 +70529,14 @@ func TestSettersMarkExplicitRiskDeviceSignals(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetTouch_MarksExplicit", func(t *testing.T) { + t.Run("SetScore_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskDeviceSignals{} - var fernTestValueTouch *bool + obj := &RiskAssessment{} + var fernTestValueScore float64 // Act - obj.SetTouch(fernTestValueTouch) + obj.SetScore(fernTestValueScore) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -71226,301 +70560,14 @@ func TestSettersMarkExplicitRiskDeviceSignals(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) -} - -func TestSettersRiskEmailSignals(t *testing.T) { - t.Run("SetDomain", func(t *testing.T) { - obj := &RiskEmailSignals{} - var fernTestValueDomain *string - obj.SetDomain(fernTestValueDomain) - assert.Equal(t, fernTestValueDomain, obj.Domain) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetValid", func(t *testing.T) { - obj := &RiskEmailSignals{} - var fernTestValueValid bool - obj.SetValid(fernTestValueValid) - assert.Equal(t, fernTestValueValid, obj.Valid) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetDisposable", func(t *testing.T) { - obj := &RiskEmailSignals{} - var fernTestValueDisposable bool - obj.SetDisposable(fernTestValueDisposable) - assert.Equal(t, fernTestValueDisposable, obj.Disposable) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetDeliverability", func(t *testing.T) { - obj := &RiskEmailSignals{} - var fernTestValueDeliverability RiskEmailSignalsDeliverability - obj.SetDeliverability(fernTestValueDeliverability) - assert.Equal(t, fernTestValueDeliverability, obj.Deliverability) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetRoleAccount", func(t *testing.T) { - obj := &RiskEmailSignals{} - var fernTestValueRoleAccount bool - obj.SetRoleAccount(fernTestValueRoleAccount) - assert.Equal(t, fernTestValueRoleAccount, obj.RoleAccount) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetFreeProvider", func(t *testing.T) { - obj := &RiskEmailSignals{} - var fernTestValueFreeProvider bool - obj.SetFreeProvider(fernTestValueFreeProvider) - assert.Equal(t, fernTestValueFreeProvider, obj.FreeProvider) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetSuggestion", func(t *testing.T) { - obj := &RiskEmailSignals{} - var fernTestValueSuggestion *string - obj.SetSuggestion(fernTestValueSuggestion) - assert.Equal(t, fernTestValueSuggestion, obj.Suggestion) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetDomainAgeDays", func(t *testing.T) { - obj := &RiskEmailSignals{} - var fernTestValueDomainAgeDays *int64 - obj.SetDomainAgeDays(fernTestValueDomainAgeDays) - assert.Equal(t, fernTestValueDomainAgeDays, obj.DomainAgeDays) - assert.NotNil(t, obj.explicitFields) - }) - -} - -func TestGettersRiskEmailSignals(t *testing.T) { - t.Run("GetDomain", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &RiskEmailSignals{} - var expected *string - obj.Domain = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetDomain(), "getter should return the property value") - }) - - t.Run("GetDomain_NilValue", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &RiskEmailSignals{} - obj.Domain = nil - - // Act & Assert - assert.Nil(t, obj.GetDomain(), "getter should return nil when property is nil") - }) - - t.Run("GetDomain_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *RiskEmailSignals - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetDomain() // Should return zero value - }) - - t.Run("GetValid", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &RiskEmailSignals{} - var expected bool - obj.Valid = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetValid(), "getter should return the property value") - }) - - t.Run("GetValid_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *RiskEmailSignals - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetValid() // Should return zero value - }) - - t.Run("GetDisposable", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &RiskEmailSignals{} - var expected bool - obj.Disposable = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetDisposable(), "getter should return the property value") - }) - - t.Run("GetDisposable_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *RiskEmailSignals - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetDisposable() // Should return zero value - }) - - t.Run("GetDeliverability", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &RiskEmailSignals{} - var expected RiskEmailSignalsDeliverability - obj.Deliverability = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetDeliverability(), "getter should return the property value") - }) - - t.Run("GetDeliverability_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *RiskEmailSignals - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetDeliverability() // Should return zero value - }) - - t.Run("GetRoleAccount", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &RiskEmailSignals{} - var expected bool - obj.RoleAccount = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetRoleAccount(), "getter should return the property value") - }) - - t.Run("GetRoleAccount_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *RiskEmailSignals - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetRoleAccount() // Should return zero value - }) - - t.Run("GetFreeProvider", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &RiskEmailSignals{} - var expected bool - obj.FreeProvider = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetFreeProvider(), "getter should return the property value") - }) - - t.Run("GetFreeProvider_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *RiskEmailSignals - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetFreeProvider() // Should return zero value - }) - - t.Run("GetSuggestion", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &RiskEmailSignals{} - var expected *string - obj.Suggestion = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetSuggestion(), "getter should return the property value") - }) - - t.Run("GetSuggestion_NilValue", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &RiskEmailSignals{} - obj.Suggestion = nil - - // Act & Assert - assert.Nil(t, obj.GetSuggestion(), "getter should return nil when property is nil") - }) - - t.Run("GetSuggestion_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *RiskEmailSignals - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetSuggestion() // Should return zero value - }) - - t.Run("GetDomainAgeDays", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &RiskEmailSignals{} - var expected *int64 - obj.DomainAgeDays = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetDomainAgeDays(), "getter should return the property value") - }) - - t.Run("GetDomainAgeDays_NilValue", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &RiskEmailSignals{} - obj.DomainAgeDays = nil - - // Act & Assert - assert.Nil(t, obj.GetDomainAgeDays(), "getter should return nil when property is nil") - }) - - t.Run("GetDomainAgeDays_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *RiskEmailSignals - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetDomainAgeDays() // Should return zero value - }) - -} - -func TestSettersMarkExplicitRiskEmailSignals(t *testing.T) { - t.Run("SetDomain_MarksExplicit", func(t *testing.T) { + t.Run("SetReasons_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskEmailSignals{} - var fernTestValueDomain *string + obj := &RiskAssessment{} + var fernTestValueReasons []*RiskReason // Act - obj.SetDomain(fernTestValueDomain) + obj.SetReasons(fernTestValueReasons) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -71544,14 +70591,14 @@ func TestSettersMarkExplicitRiskEmailSignals(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetValid_MarksExplicit", func(t *testing.T) { + t.Run("SetSignals_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskEmailSignals{} - var fernTestValueValid bool + obj := &RiskAssessment{} + var fernTestValueSignals *RiskAssessmentSignals // Act - obj.SetValid(fernTestValueValid) + obj.SetSignals(fernTestValueSignals) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -71575,14 +70622,14 @@ func TestSettersMarkExplicitRiskEmailSignals(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetDisposable_MarksExplicit", func(t *testing.T) { + t.Run("SetUser_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskEmailSignals{} - var fernTestValueDisposable bool + obj := &RiskAssessment{} + var fernTestValueUser *RiskAssessmentUser // Act - obj.SetDisposable(fernTestValueDisposable) + obj.SetUser(fernTestValueUser) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -71606,14 +70653,14 @@ func TestSettersMarkExplicitRiskEmailSignals(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetDeliverability_MarksExplicit", func(t *testing.T) { + t.Run("SetIP_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskEmailSignals{} - var fernTestValueDeliverability RiskEmailSignalsDeliverability + obj := &RiskAssessment{} + var fernTestValueIP *string // Act - obj.SetDeliverability(fernTestValueDeliverability) + obj.SetIP(fernTestValueIP) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -71637,14 +70684,14 @@ func TestSettersMarkExplicitRiskEmailSignals(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetRoleAccount_MarksExplicit", func(t *testing.T) { + t.Run("SetDegraded_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskEmailSignals{} - var fernTestValueRoleAccount bool + obj := &RiskAssessment{} + var fernTestValueDegraded []RiskAssessmentDegradedItem // Act - obj.SetRoleAccount(fernTestValueRoleAccount) + obj.SetDegraded(fernTestValueDegraded) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -71668,14 +70715,14 @@ func TestSettersMarkExplicitRiskEmailSignals(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetFreeProvider_MarksExplicit", func(t *testing.T) { + t.Run("SetOutcome_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskEmailSignals{} - var fernTestValueFreeProvider bool + obj := &RiskAssessment{} + var fernTestValueOutcome *RiskOutcome // Act - obj.SetFreeProvider(fernTestValueFreeProvider) + obj.SetOutcome(fernTestValueOutcome) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -71699,14 +70746,14 @@ func TestSettersMarkExplicitRiskEmailSignals(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetSuggestion_MarksExplicit", func(t *testing.T) { + t.Run("SetReviewStatus_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskEmailSignals{} - var fernTestValueSuggestion *string + obj := &RiskAssessment{} + var fernTestValueReviewStatus *RiskAssessmentReviewStatus // Act - obj.SetSuggestion(fernTestValueSuggestion) + obj.SetReviewStatus(fernTestValueReviewStatus) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -71730,14 +70777,14 @@ func TestSettersMarkExplicitRiskEmailSignals(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetDomainAgeDays_MarksExplicit", func(t *testing.T) { + t.Run("SetCreatedAt_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskEmailSignals{} - var fernTestValueDomainAgeDays *int64 + obj := &RiskAssessment{} + var fernTestValueCreatedAt time.Time // Act - obj.SetDomainAgeDays(fernTestValueDomainAgeDays) + obj.SetCreatedAt(fernTestValueCreatedAt) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -71763,186 +70810,124 @@ func TestSettersMarkExplicitRiskEmailSignals(t *testing.T) { } -func TestSettersRiskIPPrivacy(t *testing.T) { - t.Run("SetVpn", func(t *testing.T) { - obj := &RiskIPPrivacy{} - var fernTestValueVpn bool - obj.SetVpn(fernTestValueVpn) - assert.Equal(t, fernTestValueVpn, obj.Vpn) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetProxy", func(t *testing.T) { - obj := &RiskIPPrivacy{} - var fernTestValueProxy bool - obj.SetProxy(fernTestValueProxy) - assert.Equal(t, fernTestValueProxy, obj.Proxy) +func TestSettersRiskAssessmentList(t *testing.T) { + t.Run("SetObject", func(t *testing.T) { + obj := &RiskAssessmentList{} + var fernTestValueObject RiskAssessmentListObject + obj.SetObject(fernTestValueObject) + assert.Equal(t, fernTestValueObject, obj.Object) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetRelay", func(t *testing.T) { - obj := &RiskIPPrivacy{} - var fernTestValueRelay bool - obj.SetRelay(fernTestValueRelay) - assert.Equal(t, fernTestValueRelay, obj.Relay) + t.Run("SetData", func(t *testing.T) { + obj := &RiskAssessmentList{} + var fernTestValueData []*RiskAssessment + obj.SetData(fernTestValueData) + assert.Equal(t, fernTestValueData, obj.Data) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetService", func(t *testing.T) { - obj := &RiskIPPrivacy{} - var fernTestValueService *string - obj.SetService(fernTestValueService) - assert.Equal(t, fernTestValueService, obj.Service) + t.Run("SetHasMore", func(t *testing.T) { + obj := &RiskAssessmentList{} + var fernTestValueHasMore bool + obj.SetHasMore(fernTestValueHasMore) + assert.Equal(t, fernTestValueHasMore, obj.HasMore) assert.NotNil(t, obj.explicitFields) }) } -func TestGettersRiskIPPrivacy(t *testing.T) { - t.Run("GetVpn", func(t *testing.T) { +func TestGettersRiskAssessmentList(t *testing.T) { + t.Run("GetObject", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskIPPrivacy{} - var expected bool - obj.Vpn = expected + obj := &RiskAssessmentList{} + var expected RiskAssessmentListObject + obj.Object = expected // Act & Assert - assert.Equal(t, expected, obj.GetVpn(), "getter should return the property value") + assert.Equal(t, expected, obj.GetObject(), "getter should return the property value") }) - t.Run("GetVpn_NilReceiver", func(t *testing.T) { + t.Run("GetObject_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *RiskIPPrivacy + var obj *RiskAssessmentList // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetVpn() // Should return zero value + _ = obj.GetObject() // Should return zero value }) - t.Run("GetProxy", func(t *testing.T) { + t.Run("GetData", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskIPPrivacy{} - var expected bool - obj.Proxy = expected + obj := &RiskAssessmentList{} + var expected []*RiskAssessment + obj.Data = expected // Act & Assert - assert.Equal(t, expected, obj.GetProxy(), "getter should return the property value") - }) - - t.Run("GetProxy_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *RiskIPPrivacy - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetProxy() // Should return zero value + assert.Equal(t, expected, obj.GetData(), "getter should return the property value") }) - t.Run("GetRelay", func(t *testing.T) { + t.Run("GetData_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskIPPrivacy{} - var expected bool - obj.Relay = expected + obj := &RiskAssessmentList{} + obj.Data = nil // Act & Assert - assert.Equal(t, expected, obj.GetRelay(), "getter should return the property value") + assert.Nil(t, obj.GetData(), "getter should return nil when property is nil") }) - t.Run("GetRelay_NilReceiver", func(t *testing.T) { + t.Run("GetData_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *RiskIPPrivacy + var obj *RiskAssessmentList // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetRelay() // Should return zero value - }) - - t.Run("GetService", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &RiskIPPrivacy{} - var expected *string - obj.Service = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetService(), "getter should return the property value") + _ = obj.GetData() // Should return zero value }) - t.Run("GetService_NilValue", func(t *testing.T) { + t.Run("GetHasMore", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskIPPrivacy{} - obj.Service = nil + obj := &RiskAssessmentList{} + var expected bool + obj.HasMore = expected // Act & Assert - assert.Nil(t, obj.GetService(), "getter should return nil when property is nil") + assert.Equal(t, expected, obj.GetHasMore(), "getter should return the property value") }) - t.Run("GetService_NilReceiver", func(t *testing.T) { + t.Run("GetHasMore_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *RiskIPPrivacy + var obj *RiskAssessmentList // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetService() // Should return zero value + _ = obj.GetHasMore() // Should return zero value }) } -func TestSettersMarkExplicitRiskIPPrivacy(t *testing.T) { - t.Run("SetVpn_MarksExplicit", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &RiskIPPrivacy{} - var fernTestValueVpn bool - - // Act - obj.SetVpn(fernTestValueVpn) - - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") - - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } - - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip - }) - - t.Run("SetProxy_MarksExplicit", func(t *testing.T) { +func TestSettersMarkExplicitRiskAssessmentList(t *testing.T) { + t.Run("SetObject_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskIPPrivacy{} - var fernTestValueProxy bool + obj := &RiskAssessmentList{} + var fernTestValueObject RiskAssessmentListObject // Act - obj.SetProxy(fernTestValueProxy) + obj.SetObject(fernTestValueObject) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -71966,14 +70951,14 @@ func TestSettersMarkExplicitRiskIPPrivacy(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetRelay_MarksExplicit", func(t *testing.T) { + t.Run("SetData_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskIPPrivacy{} - var fernTestValueRelay bool + obj := &RiskAssessmentList{} + var fernTestValueData []*RiskAssessment // Act - obj.SetRelay(fernTestValueRelay) + obj.SetData(fernTestValueData) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -71997,14 +70982,14 @@ func TestSettersMarkExplicitRiskIPPrivacy(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetService_MarksExplicit", func(t *testing.T) { + t.Run("SetHasMore_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskIPPrivacy{} - var fernTestValueService *string + obj := &RiskAssessmentList{} + var fernTestValueHasMore bool // Act - obj.SetService(fernTestValueService) + obj.SetHasMore(fernTestValueHasMore) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -72030,391 +71015,349 @@ func TestSettersMarkExplicitRiskIPPrivacy(t *testing.T) { } -func TestSettersRiskIPSignals(t *testing.T) { - t.Run("SetVersion", func(t *testing.T) { - obj := &RiskIPSignals{} - var fernTestValueVersion float64 - obj.SetVersion(fernTestValueVersion) - assert.Equal(t, fernTestValueVersion, obj.Version) +func TestSettersRiskAssessmentSignals(t *testing.T) { + t.Run("SetEmail", func(t *testing.T) { + obj := &RiskAssessmentSignals{} + var fernTestValueEmail *RiskEmailSignals + obj.SetEmail(fernTestValueEmail) + assert.Equal(t, fernTestValueEmail, obj.Email) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetPrivate", func(t *testing.T) { - obj := &RiskIPSignals{} - var fernTestValuePrivate bool - obj.SetPrivate(fernTestValuePrivate) - assert.Equal(t, fernTestValuePrivate, obj.Private) + t.Run("SetIP", func(t *testing.T) { + obj := &RiskAssessmentSignals{} + var fernTestValueIP *RiskIPSignals + obj.SetIP(fernTestValueIP) + assert.Equal(t, fernTestValueIP, obj.IP) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetTor", func(t *testing.T) { - obj := &RiskIPSignals{} - var fernTestValueTor bool - obj.SetTor(fernTestValueTor) - assert.Equal(t, fernTestValueTor, obj.Tor) + t.Run("SetVelocity", func(t *testing.T) { + obj := &RiskAssessmentSignals{} + var fernTestValueVelocity *RiskVelocitySignals + obj.SetVelocity(fernTestValueVelocity) + assert.Equal(t, fernTestValueVelocity, obj.Velocity) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetHosting", func(t *testing.T) { - obj := &RiskIPSignals{} - var fernTestValueHosting bool - obj.SetHosting(fernTestValueHosting) - assert.Equal(t, fernTestValueHosting, obj.Hosting) + t.Run("SetCaptcha", func(t *testing.T) { + obj := &RiskAssessmentSignals{} + var fernTestValueCaptcha *RiskCaptchaSignals + obj.SetCaptcha(fernTestValueCaptcha) + assert.Equal(t, fernTestValueCaptcha, obj.Captcha) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetHostingProvider", func(t *testing.T) { - obj := &RiskIPSignals{} - var fernTestValueHostingProvider *string - obj.SetHostingProvider(fernTestValueHostingProvider) - assert.Equal(t, fernTestValueHostingProvider, obj.HostingProvider) + t.Run("SetLogin", func(t *testing.T) { + obj := &RiskAssessmentSignals{} + var fernTestValueLogin *RiskLoginSignals + obj.SetLogin(fernTestValueLogin) + assert.Equal(t, fernTestValueLogin, obj.Login) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetHostingKind", func(t *testing.T) { - obj := &RiskIPSignals{} - var fernTestValueHostingKind *RiskIPSignalsHostingKind - obj.SetHostingKind(fernTestValueHostingKind) - assert.Equal(t, fernTestValueHostingKind, obj.HostingKind) + t.Run("SetContent", func(t *testing.T) { + obj := &RiskAssessmentSignals{} + var fernTestValueContent *RiskContentSignals + obj.SetContent(fernTestValueContent) + assert.Equal(t, fernTestValueContent, obj.Content) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetAsn", func(t *testing.T) { - obj := &RiskIPSignals{} - var fernTestValueAsn *int64 - obj.SetAsn(fernTestValueAsn) - assert.Equal(t, fernTestValueAsn, obj.Asn) + t.Run("SetCheckout", func(t *testing.T) { + obj := &RiskAssessmentSignals{} + var fernTestValueCheckout *RiskCheckoutSignals + obj.SetCheckout(fernTestValueCheckout) + assert.Equal(t, fernTestValueCheckout, obj.Checkout) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetAsName", func(t *testing.T) { - obj := &RiskIPSignals{} - var fernTestValueAsName *string - obj.SetAsName(fernTestValueAsName) - assert.Equal(t, fernTestValueAsName, obj.AsName) + t.Run("SetDevice", func(t *testing.T) { + obj := &RiskAssessmentSignals{} + var fernTestValueDevice *RiskDeviceSignals + obj.SetDevice(fernTestValueDevice) + assert.Equal(t, fernTestValueDevice, obj.Device) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetCountry", func(t *testing.T) { - obj := &RiskIPSignals{} - var fernTestValueCountry *string - obj.SetCountry(fernTestValueCountry) - assert.Equal(t, fernTestValueCountry, obj.Country) - assert.NotNil(t, obj.explicitFields) - }) +} - t.Run("SetPrivacy", func(t *testing.T) { - obj := &RiskIPSignals{} - var fernTestValuePrivacy *RiskIPPrivacy - obj.SetPrivacy(fernTestValuePrivacy) - assert.Equal(t, fernTestValuePrivacy, obj.Privacy) - assert.NotNil(t, obj.explicitFields) - }) +func TestGettersRiskAssessmentSignals(t *testing.T) { + t.Run("GetEmail", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskAssessmentSignals{} + var expected *RiskEmailSignals + obj.Email = expected -} + // Act & Assert + assert.Equal(t, expected, obj.GetEmail(), "getter should return the property value") + }) -func TestGettersRiskIPSignals(t *testing.T) { - t.Run("GetVersion", func(t *testing.T) { + t.Run("GetEmail_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskIPSignals{} - var expected float64 - obj.Version = expected + obj := &RiskAssessmentSignals{} + obj.Email = nil // Act & Assert - assert.Equal(t, expected, obj.GetVersion(), "getter should return the property value") + assert.Nil(t, obj.GetEmail(), "getter should return nil when property is nil") }) - t.Run("GetVersion_NilReceiver", func(t *testing.T) { + t.Run("GetEmail_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *RiskIPSignals + var obj *RiskAssessmentSignals // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetVersion() // Should return zero value + _ = obj.GetEmail() // Should return zero value }) - t.Run("GetPrivate", func(t *testing.T) { + t.Run("GetIP", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskIPSignals{} - var expected bool - obj.Private = expected + obj := &RiskAssessmentSignals{} + var expected *RiskIPSignals + obj.IP = expected // Act & Assert - assert.Equal(t, expected, obj.GetPrivate(), "getter should return the property value") + assert.Equal(t, expected, obj.GetIP(), "getter should return the property value") }) - t.Run("GetPrivate_NilReceiver", func(t *testing.T) { + t.Run("GetIP_NilValue", func(t *testing.T) { t.Parallel() - var obj *RiskIPSignals + // Arrange + obj := &RiskAssessmentSignals{} + obj.IP = nil + + // Act & Assert + assert.Nil(t, obj.GetIP(), "getter should return nil when property is nil") + }) + + t.Run("GetIP_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *RiskAssessmentSignals // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetPrivate() // Should return zero value + _ = obj.GetIP() // Should return zero value }) - t.Run("GetTor", func(t *testing.T) { + t.Run("GetVelocity", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskIPSignals{} - var expected bool - obj.Tor = expected + obj := &RiskAssessmentSignals{} + var expected *RiskVelocitySignals + obj.Velocity = expected // Act & Assert - assert.Equal(t, expected, obj.GetTor(), "getter should return the property value") + assert.Equal(t, expected, obj.GetVelocity(), "getter should return the property value") }) - t.Run("GetTor_NilReceiver", func(t *testing.T) { + t.Run("GetVelocity_NilValue", func(t *testing.T) { t.Parallel() - var obj *RiskIPSignals + // Arrange + obj := &RiskAssessmentSignals{} + obj.Velocity = nil + + // Act & Assert + assert.Nil(t, obj.GetVelocity(), "getter should return nil when property is nil") + }) + + t.Run("GetVelocity_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *RiskAssessmentSignals // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetTor() // Should return zero value + _ = obj.GetVelocity() // Should return zero value }) - t.Run("GetHosting", func(t *testing.T) { + t.Run("GetCaptcha", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskIPSignals{} - var expected bool - obj.Hosting = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetHosting(), "getter should return the property value") - }) - - t.Run("GetHosting_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *RiskIPSignals - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetHosting() // Should return zero value - }) - - t.Run("GetHostingProvider", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &RiskIPSignals{} - var expected *string - obj.HostingProvider = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetHostingProvider(), "getter should return the property value") - }) - - t.Run("GetHostingProvider_NilValue", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &RiskIPSignals{} - obj.HostingProvider = nil - - // Act & Assert - assert.Nil(t, obj.GetHostingProvider(), "getter should return nil when property is nil") - }) - - t.Run("GetHostingProvider_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *RiskIPSignals - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetHostingProvider() // Should return zero value - }) - - t.Run("GetHostingKind", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &RiskIPSignals{} - var expected *RiskIPSignalsHostingKind - obj.HostingKind = expected + obj := &RiskAssessmentSignals{} + var expected *RiskCaptchaSignals + obj.Captcha = expected // Act & Assert - assert.Equal(t, expected, obj.GetHostingKind(), "getter should return the property value") + assert.Equal(t, expected, obj.GetCaptcha(), "getter should return the property value") }) - t.Run("GetHostingKind_NilValue", func(t *testing.T) { + t.Run("GetCaptcha_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskIPSignals{} - obj.HostingKind = nil + obj := &RiskAssessmentSignals{} + obj.Captcha = nil // Act & Assert - assert.Nil(t, obj.GetHostingKind(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetCaptcha(), "getter should return nil when property is nil") }) - t.Run("GetHostingKind_NilReceiver", func(t *testing.T) { + t.Run("GetCaptcha_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *RiskIPSignals + var obj *RiskAssessmentSignals // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetHostingKind() // Should return zero value + _ = obj.GetCaptcha() // Should return zero value }) - t.Run("GetAsn", func(t *testing.T) { + t.Run("GetLogin", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskIPSignals{} - var expected *int64 - obj.Asn = expected + obj := &RiskAssessmentSignals{} + var expected *RiskLoginSignals + obj.Login = expected // Act & Assert - assert.Equal(t, expected, obj.GetAsn(), "getter should return the property value") + assert.Equal(t, expected, obj.GetLogin(), "getter should return the property value") }) - t.Run("GetAsn_NilValue", func(t *testing.T) { + t.Run("GetLogin_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskIPSignals{} - obj.Asn = nil + obj := &RiskAssessmentSignals{} + obj.Login = nil // Act & Assert - assert.Nil(t, obj.GetAsn(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetLogin(), "getter should return nil when property is nil") }) - t.Run("GetAsn_NilReceiver", func(t *testing.T) { + t.Run("GetLogin_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *RiskIPSignals + var obj *RiskAssessmentSignals // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetAsn() // Should return zero value + _ = obj.GetLogin() // Should return zero value }) - t.Run("GetAsName", func(t *testing.T) { + t.Run("GetContent", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskIPSignals{} - var expected *string - obj.AsName = expected + obj := &RiskAssessmentSignals{} + var expected *RiskContentSignals + obj.Content = expected // Act & Assert - assert.Equal(t, expected, obj.GetAsName(), "getter should return the property value") + assert.Equal(t, expected, obj.GetContent(), "getter should return the property value") }) - t.Run("GetAsName_NilValue", func(t *testing.T) { + t.Run("GetContent_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskIPSignals{} - obj.AsName = nil + obj := &RiskAssessmentSignals{} + obj.Content = nil // Act & Assert - assert.Nil(t, obj.GetAsName(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetContent(), "getter should return nil when property is nil") }) - t.Run("GetAsName_NilReceiver", func(t *testing.T) { + t.Run("GetContent_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *RiskIPSignals + var obj *RiskAssessmentSignals // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetAsName() // Should return zero value + _ = obj.GetContent() // Should return zero value }) - t.Run("GetCountry", func(t *testing.T) { + t.Run("GetCheckout", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskIPSignals{} - var expected *string - obj.Country = expected + obj := &RiskAssessmentSignals{} + var expected *RiskCheckoutSignals + obj.Checkout = expected // Act & Assert - assert.Equal(t, expected, obj.GetCountry(), "getter should return the property value") + assert.Equal(t, expected, obj.GetCheckout(), "getter should return the property value") }) - t.Run("GetCountry_NilValue", func(t *testing.T) { + t.Run("GetCheckout_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskIPSignals{} - obj.Country = nil + obj := &RiskAssessmentSignals{} + obj.Checkout = nil // Act & Assert - assert.Nil(t, obj.GetCountry(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetCheckout(), "getter should return nil when property is nil") }) - t.Run("GetCountry_NilReceiver", func(t *testing.T) { + t.Run("GetCheckout_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *RiskIPSignals + var obj *RiskAssessmentSignals // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetCountry() // Should return zero value + _ = obj.GetCheckout() // Should return zero value }) - t.Run("GetPrivacy", func(t *testing.T) { + t.Run("GetDevice", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskIPSignals{} - var expected *RiskIPPrivacy - obj.Privacy = expected + obj := &RiskAssessmentSignals{} + var expected *RiskDeviceSignals + obj.Device = expected // Act & Assert - assert.Equal(t, expected, obj.GetPrivacy(), "getter should return the property value") + assert.Equal(t, expected, obj.GetDevice(), "getter should return the property value") }) - t.Run("GetPrivacy_NilValue", func(t *testing.T) { + t.Run("GetDevice_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskIPSignals{} - obj.Privacy = nil + obj := &RiskAssessmentSignals{} + obj.Device = nil // Act & Assert - assert.Nil(t, obj.GetPrivacy(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetDevice(), "getter should return nil when property is nil") }) - t.Run("GetPrivacy_NilReceiver", func(t *testing.T) { + t.Run("GetDevice_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *RiskIPSignals + var obj *RiskAssessmentSignals // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetPrivacy() // Should return zero value + _ = obj.GetDevice() // Should return zero value }) } -func TestSettersMarkExplicitRiskIPSignals(t *testing.T) { - t.Run("SetVersion_MarksExplicit", func(t *testing.T) { +func TestSettersMarkExplicitRiskAssessmentSignals(t *testing.T) { + t.Run("SetEmail_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskIPSignals{} - var fernTestValueVersion float64 + obj := &RiskAssessmentSignals{} + var fernTestValueEmail *RiskEmailSignals // Act - obj.SetVersion(fernTestValueVersion) + obj.SetEmail(fernTestValueEmail) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -72438,14 +71381,14 @@ func TestSettersMarkExplicitRiskIPSignals(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetPrivate_MarksExplicit", func(t *testing.T) { + t.Run("SetIP_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskIPSignals{} - var fernTestValuePrivate bool + obj := &RiskAssessmentSignals{} + var fernTestValueIP *RiskIPSignals // Act - obj.SetPrivate(fernTestValuePrivate) + obj.SetIP(fernTestValueIP) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -72469,14 +71412,14 @@ func TestSettersMarkExplicitRiskIPSignals(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetTor_MarksExplicit", func(t *testing.T) { + t.Run("SetVelocity_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskIPSignals{} - var fernTestValueTor bool + obj := &RiskAssessmentSignals{} + var fernTestValueVelocity *RiskVelocitySignals // Act - obj.SetTor(fernTestValueTor) + obj.SetVelocity(fernTestValueVelocity) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -72500,14 +71443,14 @@ func TestSettersMarkExplicitRiskIPSignals(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetHosting_MarksExplicit", func(t *testing.T) { + t.Run("SetCaptcha_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskIPSignals{} - var fernTestValueHosting bool + obj := &RiskAssessmentSignals{} + var fernTestValueCaptcha *RiskCaptchaSignals // Act - obj.SetHosting(fernTestValueHosting) + obj.SetCaptcha(fernTestValueCaptcha) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -72531,14 +71474,14 @@ func TestSettersMarkExplicitRiskIPSignals(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetHostingProvider_MarksExplicit", func(t *testing.T) { + t.Run("SetLogin_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskIPSignals{} - var fernTestValueHostingProvider *string + obj := &RiskAssessmentSignals{} + var fernTestValueLogin *RiskLoginSignals // Act - obj.SetHostingProvider(fernTestValueHostingProvider) + obj.SetLogin(fernTestValueLogin) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -72562,14 +71505,14 @@ func TestSettersMarkExplicitRiskIPSignals(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetHostingKind_MarksExplicit", func(t *testing.T) { + t.Run("SetContent_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskIPSignals{} - var fernTestValueHostingKind *RiskIPSignalsHostingKind + obj := &RiskAssessmentSignals{} + var fernTestValueContent *RiskContentSignals // Act - obj.SetHostingKind(fernTestValueHostingKind) + obj.SetContent(fernTestValueContent) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -72593,14 +71536,14 @@ func TestSettersMarkExplicitRiskIPSignals(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetAsn_MarksExplicit", func(t *testing.T) { + t.Run("SetCheckout_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskIPSignals{} - var fernTestValueAsn *int64 + obj := &RiskAssessmentSignals{} + var fernTestValueCheckout *RiskCheckoutSignals // Act - obj.SetAsn(fernTestValueAsn) + obj.SetCheckout(fernTestValueCheckout) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -72624,14 +71567,14 @@ func TestSettersMarkExplicitRiskIPSignals(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetAsName_MarksExplicit", func(t *testing.T) { + t.Run("SetDevice_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskIPSignals{} - var fernTestValueAsName *string + obj := &RiskAssessmentSignals{} + var fernTestValueDevice *RiskDeviceSignals // Act - obj.SetAsName(fernTestValueAsName) + obj.SetDevice(fernTestValueDevice) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -72655,14 +71598,105 @@ func TestSettersMarkExplicitRiskIPSignals(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetCountry_MarksExplicit", func(t *testing.T) { +} + +func TestSettersRiskAssessmentUser(t *testing.T) { + t.Run("SetID", func(t *testing.T) { + obj := &RiskAssessmentUser{} + var fernTestValueID *string + obj.SetID(fernTestValueID) + assert.Equal(t, fernTestValueID, obj.ID) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetEmail", func(t *testing.T) { + obj := &RiskAssessmentUser{} + var fernTestValueEmail *string + obj.SetEmail(fernTestValueEmail) + assert.Equal(t, fernTestValueEmail, obj.Email) + assert.NotNil(t, obj.explicitFields) + }) + +} + +func TestGettersRiskAssessmentUser(t *testing.T) { + t.Run("GetID", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskIPSignals{} - var fernTestValueCountry *string + obj := &RiskAssessmentUser{} + var expected *string + obj.ID = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetID(), "getter should return the property value") + }) + + t.Run("GetID_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskAssessmentUser{} + obj.ID = nil + + // Act & Assert + assert.Nil(t, obj.GetID(), "getter should return nil when property is nil") + }) + + t.Run("GetID_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *RiskAssessmentUser + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetID() // Should return zero value + }) + + t.Run("GetEmail", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskAssessmentUser{} + var expected *string + obj.Email = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetEmail(), "getter should return the property value") + }) + + t.Run("GetEmail_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskAssessmentUser{} + obj.Email = nil + + // Act & Assert + assert.Nil(t, obj.GetEmail(), "getter should return nil when property is nil") + }) + + t.Run("GetEmail_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *RiskAssessmentUser + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetEmail() // Should return zero value + }) + +} + +func TestSettersMarkExplicitRiskAssessmentUser(t *testing.T) { + t.Run("SetID_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskAssessmentUser{} + var fernTestValueID *string // Act - obj.SetCountry(fernTestValueCountry) + obj.SetID(fernTestValueID) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -72686,14 +71720,14 @@ func TestSettersMarkExplicitRiskIPSignals(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetPrivacy_MarksExplicit", func(t *testing.T) { + t.Run("SetEmail_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskIPSignals{} - var fernTestValuePrivacy *RiskIPPrivacy + obj := &RiskAssessmentUser{} + var fernTestValueEmail *string // Act - obj.SetPrivacy(fernTestValuePrivacy) + obj.SetEmail(fernTestValueEmail) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -72719,393 +71753,390 @@ func TestSettersMarkExplicitRiskIPSignals(t *testing.T) { } -func TestSettersRiskLimitBucket(t *testing.T) { - t.Run("SetObject", func(t *testing.T) { - obj := &RiskLimitBucket{} - var fernTestValueObject RiskLimitBucketObject - obj.SetObject(fernTestValueObject) - assert.Equal(t, fernTestValueObject, obj.Object) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetID", func(t *testing.T) { - obj := &RiskLimitBucket{} - var fernTestValueID string - obj.SetID(fernTestValueID) - assert.Equal(t, fernTestValueID, obj.ID) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetName", func(t *testing.T) { - obj := &RiskLimitBucket{} - var fernTestValueName string - obj.SetName(fernTestValueName) - assert.Equal(t, fernTestValueName, obj.Name) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetLimit", func(t *testing.T) { - obj := &RiskLimitBucket{} - var fernTestValueLimit int64 - obj.SetLimit(fernTestValueLimit) - assert.Equal(t, fernTestValueLimit, obj.Limit) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetPeriodSeconds", func(t *testing.T) { - obj := &RiskLimitBucket{} - var fernTestValuePeriodSeconds int64 - obj.SetPeriodSeconds(fernTestValuePeriodSeconds) - assert.Equal(t, fernTestValuePeriodSeconds, obj.PeriodSeconds) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetBurst", func(t *testing.T) { - obj := &RiskLimitBucket{} - var fernTestValueBurst int64 - obj.SetBurst(fernTestValueBurst) - assert.Equal(t, fernTestValueBurst, obj.Burst) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetOnFailure", func(t *testing.T) { - obj := &RiskLimitBucket{} - var fernTestValueOnFailure RiskLimitBucketOnFailure - obj.SetOnFailure(fernTestValueOnFailure) - assert.Equal(t, fernTestValueOnFailure, obj.OnFailure) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetCreatedAt", func(t *testing.T) { - obj := &RiskLimitBucket{} - var fernTestValueCreatedAt time.Time - obj.SetCreatedAt(fernTestValueCreatedAt) - assert.Equal(t, fernTestValueCreatedAt, obj.CreatedAt) +func TestSettersRiskCaptchaSignals(t *testing.T) { + t.Run("SetProvided", func(t *testing.T) { + obj := &RiskCaptchaSignals{} + var fernTestValueProvided bool + obj.SetProvided(fernTestValueProvided) + assert.Equal(t, fernTestValueProvided, obj.Provided) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetUpdatedAt", func(t *testing.T) { - obj := &RiskLimitBucket{} - var fernTestValueUpdatedAt time.Time - obj.SetUpdatedAt(fernTestValueUpdatedAt) - assert.Equal(t, fernTestValueUpdatedAt, obj.UpdatedAt) + t.Run("SetPassed", func(t *testing.T) { + obj := &RiskCaptchaSignals{} + var fernTestValuePassed *bool + obj.SetPassed(fernTestValuePassed) + assert.Equal(t, fernTestValuePassed, obj.Passed) assert.NotNil(t, obj.explicitFields) }) } -func TestGettersRiskLimitBucket(t *testing.T) { - t.Run("GetObject", func(t *testing.T) { +func TestGettersRiskCaptchaSignals(t *testing.T) { + t.Run("GetProvided", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskLimitBucket{} - var expected RiskLimitBucketObject - obj.Object = expected + obj := &RiskCaptchaSignals{} + var expected bool + obj.Provided = expected // Act & Assert - assert.Equal(t, expected, obj.GetObject(), "getter should return the property value") + assert.Equal(t, expected, obj.GetProvided(), "getter should return the property value") }) - t.Run("GetObject_NilReceiver", func(t *testing.T) { + t.Run("GetProvided_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *RiskLimitBucket + var obj *RiskCaptchaSignals // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetObject() // Should return zero value + _ = obj.GetProvided() // Should return zero value }) - t.Run("GetID", func(t *testing.T) { + t.Run("GetPassed", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskLimitBucket{} - var expected string - obj.ID = expected + obj := &RiskCaptchaSignals{} + var expected *bool + obj.Passed = expected // Act & Assert - assert.Equal(t, expected, obj.GetID(), "getter should return the property value") - }) - - t.Run("GetID_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *RiskLimitBucket - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetID() // Should return zero value + assert.Equal(t, expected, obj.GetPassed(), "getter should return the property value") }) - t.Run("GetName", func(t *testing.T) { + t.Run("GetPassed_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskLimitBucket{} - var expected string - obj.Name = expected + obj := &RiskCaptchaSignals{} + obj.Passed = nil // Act & Assert - assert.Equal(t, expected, obj.GetName(), "getter should return the property value") + assert.Nil(t, obj.GetPassed(), "getter should return nil when property is nil") }) - t.Run("GetName_NilReceiver", func(t *testing.T) { + t.Run("GetPassed_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *RiskLimitBucket + var obj *RiskCaptchaSignals // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetName() // Should return zero value + _ = obj.GetPassed() // Should return zero value }) - t.Run("GetLimit", func(t *testing.T) { +} + +func TestSettersMarkExplicitRiskCaptchaSignals(t *testing.T) { + t.Run("SetProvided_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskLimitBucket{} - var expected int64 - obj.Limit = expected + obj := &RiskCaptchaSignals{} + var fernTestValueProvided bool - // Act & Assert - assert.Equal(t, expected, obj.GetLimit(), "getter should return the property value") + // Act + obj.SetProvided(fernTestValueProvided) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("GetLimit_NilReceiver", func(t *testing.T) { + t.Run("SetPassed_MarksExplicit", func(t *testing.T) { t.Parallel() - var obj *RiskLimitBucket - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetLimit() // Should return zero value + // Arrange + obj := &RiskCaptchaSignals{} + var fernTestValuePassed *bool + + // Act + obj.SetPassed(fernTestValuePassed) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("GetPeriodSeconds", func(t *testing.T) { +} + +func TestSettersRiskCheckoutSignals(t *testing.T) { + t.Run("SetAmount", func(t *testing.T) { + obj := &RiskCheckoutSignals{} + var fernTestValueAmount int64 + obj.SetAmount(fernTestValueAmount) + assert.Equal(t, fernTestValueAmount, obj.Amount) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetCurrency", func(t *testing.T) { + obj := &RiskCheckoutSignals{} + var fernTestValueCurrency string + obj.SetCurrency(fernTestValueCurrency) + assert.Equal(t, fernTestValueCurrency, obj.Currency) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetCardCountry", func(t *testing.T) { + obj := &RiskCheckoutSignals{} + var fernTestValueCardCountry *string + obj.SetCardCountry(fernTestValueCardCountry) + assert.Equal(t, fernTestValueCardCountry, obj.CardCountry) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetCardFunding", func(t *testing.T) { + obj := &RiskCheckoutSignals{} + var fernTestValueCardFunding *RiskCheckoutSignalsCardFunding + obj.SetCardFunding(fernTestValueCardFunding) + assert.Equal(t, fernTestValueCardFunding, obj.CardFunding) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetBillingCountry", func(t *testing.T) { + obj := &RiskCheckoutSignals{} + var fernTestValueBillingCountry *string + obj.SetBillingCountry(fernTestValueBillingCountry) + assert.Equal(t, fernTestValueBillingCountry, obj.BillingCountry) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetShippingCountry", func(t *testing.T) { + obj := &RiskCheckoutSignals{} + var fernTestValueShippingCountry *string + obj.SetShippingCountry(fernTestValueShippingCountry) + assert.Equal(t, fernTestValueShippingCountry, obj.ShippingCountry) + assert.NotNil(t, obj.explicitFields) + }) + +} + +func TestGettersRiskCheckoutSignals(t *testing.T) { + t.Run("GetAmount", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskLimitBucket{} + obj := &RiskCheckoutSignals{} var expected int64 - obj.PeriodSeconds = expected + obj.Amount = expected // Act & Assert - assert.Equal(t, expected, obj.GetPeriodSeconds(), "getter should return the property value") + assert.Equal(t, expected, obj.GetAmount(), "getter should return the property value") }) - t.Run("GetPeriodSeconds_NilReceiver", func(t *testing.T) { + t.Run("GetAmount_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *RiskLimitBucket + var obj *RiskCheckoutSignals // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetPeriodSeconds() // Should return zero value + _ = obj.GetAmount() // Should return zero value }) - t.Run("GetBurst", func(t *testing.T) { + t.Run("GetCurrency", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskLimitBucket{} - var expected int64 - obj.Burst = expected + obj := &RiskCheckoutSignals{} + var expected string + obj.Currency = expected // Act & Assert - assert.Equal(t, expected, obj.GetBurst(), "getter should return the property value") + assert.Equal(t, expected, obj.GetCurrency(), "getter should return the property value") }) - t.Run("GetBurst_NilReceiver", func(t *testing.T) { + t.Run("GetCurrency_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *RiskLimitBucket + var obj *RiskCheckoutSignals // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetBurst() // Should return zero value + _ = obj.GetCurrency() // Should return zero value }) - t.Run("GetOnFailure", func(t *testing.T) { + t.Run("GetCardCountry", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskLimitBucket{} - var expected RiskLimitBucketOnFailure - obj.OnFailure = expected + obj := &RiskCheckoutSignals{} + var expected *string + obj.CardCountry = expected // Act & Assert - assert.Equal(t, expected, obj.GetOnFailure(), "getter should return the property value") + assert.Equal(t, expected, obj.GetCardCountry(), "getter should return the property value") }) - t.Run("GetOnFailure_NilReceiver", func(t *testing.T) { + t.Run("GetCardCountry_NilValue", func(t *testing.T) { t.Parallel() - var obj *RiskLimitBucket + // Arrange + obj := &RiskCheckoutSignals{} + obj.CardCountry = nil + + // Act & Assert + assert.Nil(t, obj.GetCardCountry(), "getter should return nil when property is nil") + }) + + t.Run("GetCardCountry_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *RiskCheckoutSignals // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetOnFailure() // Should return zero value + _ = obj.GetCardCountry() // Should return zero value }) - t.Run("GetCreatedAt", func(t *testing.T) { + t.Run("GetCardFunding", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskLimitBucket{} - var expected time.Time - obj.CreatedAt = expected + obj := &RiskCheckoutSignals{} + var expected *RiskCheckoutSignalsCardFunding + obj.CardFunding = expected // Act & Assert - assert.Equal(t, expected, obj.GetCreatedAt(), "getter should return the property value") + assert.Equal(t, expected, obj.GetCardFunding(), "getter should return the property value") }) - t.Run("GetCreatedAt_NilReceiver", func(t *testing.T) { + t.Run("GetCardFunding_NilValue", func(t *testing.T) { t.Parallel() - var obj *RiskLimitBucket + // Arrange + obj := &RiskCheckoutSignals{} + obj.CardFunding = nil + + // Act & Assert + assert.Nil(t, obj.GetCardFunding(), "getter should return nil when property is nil") + }) + + t.Run("GetCardFunding_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *RiskCheckoutSignals // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetCreatedAt() // Should return zero value + _ = obj.GetCardFunding() // Should return zero value }) - t.Run("GetUpdatedAt", func(t *testing.T) { + t.Run("GetBillingCountry", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskLimitBucket{} - var expected time.Time - obj.UpdatedAt = expected + obj := &RiskCheckoutSignals{} + var expected *string + obj.BillingCountry = expected // Act & Assert - assert.Equal(t, expected, obj.GetUpdatedAt(), "getter should return the property value") + assert.Equal(t, expected, obj.GetBillingCountry(), "getter should return the property value") }) - t.Run("GetUpdatedAt_NilReceiver", func(t *testing.T) { + t.Run("GetBillingCountry_NilValue", func(t *testing.T) { t.Parallel() - var obj *RiskLimitBucket + // Arrange + obj := &RiskCheckoutSignals{} + obj.BillingCountry = nil + + // Act & Assert + assert.Nil(t, obj.GetBillingCountry(), "getter should return nil when property is nil") + }) + + t.Run("GetBillingCountry_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *RiskCheckoutSignals // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetUpdatedAt() // Should return zero value + _ = obj.GetBillingCountry() // Should return zero value }) -} - -func TestSettersMarkExplicitRiskLimitBucket(t *testing.T) { - t.Run("SetObject_MarksExplicit", func(t *testing.T) { + t.Run("GetShippingCountry", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskLimitBucket{} - var fernTestValueObject RiskLimitBucketObject - - // Act - obj.SetObject(fernTestValueObject) - - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") - - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } + obj := &RiskCheckoutSignals{} + var expected *string + obj.ShippingCountry = expected - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip + // Act & Assert + assert.Equal(t, expected, obj.GetShippingCountry(), "getter should return the property value") }) - t.Run("SetID_MarksExplicit", func(t *testing.T) { + t.Run("GetShippingCountry_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskLimitBucket{} - var fernTestValueID string - - // Act - obj.SetID(fernTestValueID) - - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") - - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } + obj := &RiskCheckoutSignals{} + obj.ShippingCountry = nil - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip + // Act & Assert + assert.Nil(t, obj.GetShippingCountry(), "getter should return nil when property is nil") }) - t.Run("SetName_MarksExplicit", func(t *testing.T) { + t.Run("GetShippingCountry_NilReceiver", func(t *testing.T) { t.Parallel() - // Arrange - obj := &RiskLimitBucket{} - var fernTestValueName string - - // Act - obj.SetName(fernTestValueName) - - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") - - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } - - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip + var obj *RiskCheckoutSignals + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetShippingCountry() // Should return zero value }) - t.Run("SetLimit_MarksExplicit", func(t *testing.T) { +} + +func TestSettersMarkExplicitRiskCheckoutSignals(t *testing.T) { + t.Run("SetAmount_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskLimitBucket{} - var fernTestValueLimit int64 + obj := &RiskCheckoutSignals{} + var fernTestValueAmount int64 // Act - obj.SetLimit(fernTestValueLimit) + obj.SetAmount(fernTestValueAmount) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -73129,14 +72160,14 @@ func TestSettersMarkExplicitRiskLimitBucket(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetPeriodSeconds_MarksExplicit", func(t *testing.T) { + t.Run("SetCurrency_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskLimitBucket{} - var fernTestValuePeriodSeconds int64 + obj := &RiskCheckoutSignals{} + var fernTestValueCurrency string // Act - obj.SetPeriodSeconds(fernTestValuePeriodSeconds) + obj.SetCurrency(fernTestValueCurrency) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -73160,14 +72191,14 @@ func TestSettersMarkExplicitRiskLimitBucket(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetBurst_MarksExplicit", func(t *testing.T) { + t.Run("SetCardCountry_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskLimitBucket{} - var fernTestValueBurst int64 + obj := &RiskCheckoutSignals{} + var fernTestValueCardCountry *string // Act - obj.SetBurst(fernTestValueBurst) + obj.SetCardCountry(fernTestValueCardCountry) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -73191,14 +72222,14 @@ func TestSettersMarkExplicitRiskLimitBucket(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetOnFailure_MarksExplicit", func(t *testing.T) { + t.Run("SetCardFunding_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskLimitBucket{} - var fernTestValueOnFailure RiskLimitBucketOnFailure + obj := &RiskCheckoutSignals{} + var fernTestValueCardFunding *RiskCheckoutSignalsCardFunding // Act - obj.SetOnFailure(fernTestValueOnFailure) + obj.SetCardFunding(fernTestValueCardFunding) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -73222,14 +72253,14 @@ func TestSettersMarkExplicitRiskLimitBucket(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetCreatedAt_MarksExplicit", func(t *testing.T) { + t.Run("SetBillingCountry_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskLimitBucket{} - var fernTestValueCreatedAt time.Time + obj := &RiskCheckoutSignals{} + var fernTestValueBillingCountry *string // Act - obj.SetCreatedAt(fernTestValueCreatedAt) + obj.SetBillingCountry(fernTestValueBillingCountry) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -73253,14 +72284,14 @@ func TestSettersMarkExplicitRiskLimitBucket(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetUpdatedAt_MarksExplicit", func(t *testing.T) { + t.Run("SetShippingCountry_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskLimitBucket{} - var fernTestValueUpdatedAt time.Time + obj := &RiskCheckoutSignals{} + var fernTestValueShippingCountry *string // Act - obj.SetUpdatedAt(fernTestValueUpdatedAt) + obj.SetShippingCountry(fernTestValueShippingCountry) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -73286,124 +72317,145 @@ func TestSettersMarkExplicitRiskLimitBucket(t *testing.T) { } -func TestSettersRiskLimitBucketList(t *testing.T) { - t.Run("SetObject", func(t *testing.T) { - obj := &RiskLimitBucketList{} - var fernTestValueObject RiskLimitBucketListObject - obj.SetObject(fernTestValueObject) - assert.Equal(t, fernTestValueObject, obj.Object) +func TestSettersRiskContentSignals(t *testing.T) { + t.Run("SetSpam", func(t *testing.T) { + obj := &RiskContentSignals{} + var fernTestValueSpam float64 + obj.SetSpam(fernTestValueSpam) + assert.Equal(t, fernTestValueSpam, obj.Spam) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetData", func(t *testing.T) { - obj := &RiskLimitBucketList{} - var fernTestValueData []*RiskLimitBucket - obj.SetData(fernTestValueData) - assert.Equal(t, fernTestValueData, obj.Data) + t.Run("SetPhishing", func(t *testing.T) { + obj := &RiskContentSignals{} + var fernTestValuePhishing float64 + obj.SetPhishing(fernTestValuePhishing) + assert.Equal(t, fernTestValuePhishing, obj.Phishing) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetHasMore", func(t *testing.T) { - obj := &RiskLimitBucketList{} - var fernTestValueHasMore bool - obj.SetHasMore(fernTestValueHasMore) - assert.Equal(t, fernTestValueHasMore, obj.HasMore) + t.Run("SetMalware", func(t *testing.T) { + obj := &RiskContentSignals{} + var fernTestValueMalware float64 + obj.SetMalware(fernTestValueMalware) + assert.Equal(t, fernTestValueMalware, obj.Malware) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetFraud", func(t *testing.T) { + obj := &RiskContentSignals{} + var fernTestValueFraud float64 + obj.SetFraud(fernTestValueFraud) + assert.Equal(t, fernTestValueFraud, obj.Fraud) assert.NotNil(t, obj.explicitFields) }) } -func TestGettersRiskLimitBucketList(t *testing.T) { - t.Run("GetObject", func(t *testing.T) { +func TestGettersRiskContentSignals(t *testing.T) { + t.Run("GetSpam", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskLimitBucketList{} - var expected RiskLimitBucketListObject - obj.Object = expected + obj := &RiskContentSignals{} + var expected float64 + obj.Spam = expected // Act & Assert - assert.Equal(t, expected, obj.GetObject(), "getter should return the property value") + assert.Equal(t, expected, obj.GetSpam(), "getter should return the property value") }) - t.Run("GetObject_NilReceiver", func(t *testing.T) { + t.Run("GetSpam_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *RiskLimitBucketList + var obj *RiskContentSignals // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetObject() // Should return zero value + _ = obj.GetSpam() // Should return zero value }) - t.Run("GetData", func(t *testing.T) { + t.Run("GetPhishing", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskLimitBucketList{} - var expected []*RiskLimitBucket - obj.Data = expected + obj := &RiskContentSignals{} + var expected float64 + obj.Phishing = expected // Act & Assert - assert.Equal(t, expected, obj.GetData(), "getter should return the property value") + assert.Equal(t, expected, obj.GetPhishing(), "getter should return the property value") }) - t.Run("GetData_NilValue", func(t *testing.T) { + t.Run("GetPhishing_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *RiskContentSignals + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetPhishing() // Should return zero value + }) + + t.Run("GetMalware", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskLimitBucketList{} - obj.Data = nil + obj := &RiskContentSignals{} + var expected float64 + obj.Malware = expected // Act & Assert - assert.Nil(t, obj.GetData(), "getter should return nil when property is nil") + assert.Equal(t, expected, obj.GetMalware(), "getter should return the property value") }) - t.Run("GetData_NilReceiver", func(t *testing.T) { + t.Run("GetMalware_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *RiskLimitBucketList + var obj *RiskContentSignals // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetData() // Should return zero value + _ = obj.GetMalware() // Should return zero value }) - t.Run("GetHasMore", func(t *testing.T) { + t.Run("GetFraud", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskLimitBucketList{} - var expected bool - obj.HasMore = expected + obj := &RiskContentSignals{} + var expected float64 + obj.Fraud = expected // Act & Assert - assert.Equal(t, expected, obj.GetHasMore(), "getter should return the property value") + assert.Equal(t, expected, obj.GetFraud(), "getter should return the property value") }) - t.Run("GetHasMore_NilReceiver", func(t *testing.T) { + t.Run("GetFraud_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *RiskLimitBucketList + var obj *RiskContentSignals // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetHasMore() // Should return zero value + _ = obj.GetFraud() // Should return zero value }) } -func TestSettersMarkExplicitRiskLimitBucketList(t *testing.T) { - t.Run("SetObject_MarksExplicit", func(t *testing.T) { +func TestSettersMarkExplicitRiskContentSignals(t *testing.T) { + t.Run("SetSpam_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskLimitBucketList{} - var fernTestValueObject RiskLimitBucketListObject + obj := &RiskContentSignals{} + var fernTestValueSpam float64 // Act - obj.SetObject(fernTestValueObject) + obj.SetSpam(fernTestValueSpam) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -73427,14 +72479,14 @@ func TestSettersMarkExplicitRiskLimitBucketList(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetData_MarksExplicit", func(t *testing.T) { + t.Run("SetPhishing_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskLimitBucketList{} - var fernTestValueData []*RiskLimitBucket + obj := &RiskContentSignals{} + var fernTestValuePhishing float64 // Act - obj.SetData(fernTestValueData) + obj.SetPhishing(fernTestValuePhishing) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -73458,14 +72510,14 @@ func TestSettersMarkExplicitRiskLimitBucketList(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetHasMore_MarksExplicit", func(t *testing.T) { + t.Run("SetMalware_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskLimitBucketList{} - var fernTestValueHasMore bool + obj := &RiskContentSignals{} + var fernTestValueMalware float64 // Act - obj.SetHasMore(fernTestValueHasMore) + obj.SetMalware(fernTestValueMalware) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -73489,291 +72541,321 @@ func TestSettersMarkExplicitRiskLimitBucketList(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) -} + t.Run("SetFraud_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskContentSignals{} + var fernTestValueFraud float64 -func TestSettersRiskListEntry(t *testing.T) { - t.Run("SetObject", func(t *testing.T) { - obj := &RiskListEntry{} - var fernTestValueObject RiskListEntryObject - obj.SetObject(fernTestValueObject) - assert.Equal(t, fernTestValueObject, obj.Object) - assert.NotNil(t, obj.explicitFields) - }) + // Act + obj.SetFraud(fernTestValueFraud) - t.Run("SetID", func(t *testing.T) { - obj := &RiskListEntry{} - var fernTestValueID string - obj.SetID(fernTestValueID) - assert.Equal(t, fernTestValueID, obj.ID) + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + +} + +func TestSettersRiskDeviceSignals(t *testing.T) { + t.Run("SetValid", func(t *testing.T) { + obj := &RiskDeviceSignals{} + var fernTestValueValid bool + obj.SetValid(fernTestValueValid) + assert.Equal(t, fernTestValueValid, obj.Valid) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetList", func(t *testing.T) { - obj := &RiskListEntry{} - var fernTestValueList RiskList - obj.SetList(fernTestValueList) - assert.Equal(t, fernTestValueList, obj.List) + t.Run("SetAutomation", func(t *testing.T) { + obj := &RiskDeviceSignals{} + var fernTestValueAutomation bool + obj.SetAutomation(fernTestValueAutomation) + assert.Equal(t, fernTestValueAutomation, obj.Automation) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetType", func(t *testing.T) { - obj := &RiskListEntry{} - var fernTestValueType RiskListEntryType - obj.SetType(fernTestValueType) - assert.Equal(t, fernTestValueType, obj.Type) + t.Run("SetTimezone", func(t *testing.T) { + obj := &RiskDeviceSignals{} + var fernTestValueTimezone *string + obj.SetTimezone(fernTestValueTimezone) + assert.Equal(t, fernTestValueTimezone, obj.Timezone) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetValue", func(t *testing.T) { - obj := &RiskListEntry{} - var fernTestValueValue string - obj.SetValue(fernTestValueValue) - assert.Equal(t, fernTestValueValue, obj.Value) + t.Run("SetLanguage", func(t *testing.T) { + obj := &RiskDeviceSignals{} + var fernTestValueLanguage *string + obj.SetLanguage(fernTestValueLanguage) + assert.Equal(t, fernTestValueLanguage, obj.Language) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetNote", func(t *testing.T) { - obj := &RiskListEntry{} - var fernTestValueNote *string - obj.SetNote(fernTestValueNote) - assert.Equal(t, fernTestValueNote, obj.Note) + t.Run("SetPlatform", func(t *testing.T) { + obj := &RiskDeviceSignals{} + var fernTestValuePlatform *string + obj.SetPlatform(fernTestValuePlatform) + assert.Equal(t, fernTestValuePlatform, obj.Platform) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetExpiresAt", func(t *testing.T) { - obj := &RiskListEntry{} - var fernTestValueExpiresAt *time.Time - obj.SetExpiresAt(fernTestValueExpiresAt) - assert.Equal(t, fernTestValueExpiresAt, obj.ExpiresAt) + t.Run("SetScreen", func(t *testing.T) { + obj := &RiskDeviceSignals{} + var fernTestValueScreen *string + obj.SetScreen(fernTestValueScreen) + assert.Equal(t, fernTestValueScreen, obj.Screen) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetCreatedAt", func(t *testing.T) { - obj := &RiskListEntry{} - var fernTestValueCreatedAt time.Time - obj.SetCreatedAt(fernTestValueCreatedAt) - assert.Equal(t, fernTestValueCreatedAt, obj.CreatedAt) + t.Run("SetTouch", func(t *testing.T) { + obj := &RiskDeviceSignals{} + var fernTestValueTouch *bool + obj.SetTouch(fernTestValueTouch) + assert.Equal(t, fernTestValueTouch, obj.Touch) assert.NotNil(t, obj.explicitFields) }) } -func TestGettersRiskListEntry(t *testing.T) { - t.Run("GetObject", func(t *testing.T) { +func TestGettersRiskDeviceSignals(t *testing.T) { + t.Run("GetValid", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskListEntry{} - var expected RiskListEntryObject - obj.Object = expected + obj := &RiskDeviceSignals{} + var expected bool + obj.Valid = expected // Act & Assert - assert.Equal(t, expected, obj.GetObject(), "getter should return the property value") + assert.Equal(t, expected, obj.GetValid(), "getter should return the property value") }) - t.Run("GetObject_NilReceiver", func(t *testing.T) { + t.Run("GetValid_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *RiskListEntry + var obj *RiskDeviceSignals // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetObject() // Should return zero value + _ = obj.GetValid() // Should return zero value }) - t.Run("GetID", func(t *testing.T) { + t.Run("GetAutomation", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskListEntry{} - var expected string - obj.ID = expected + obj := &RiskDeviceSignals{} + var expected bool + obj.Automation = expected // Act & Assert - assert.Equal(t, expected, obj.GetID(), "getter should return the property value") + assert.Equal(t, expected, obj.GetAutomation(), "getter should return the property value") }) - t.Run("GetID_NilReceiver", func(t *testing.T) { + t.Run("GetAutomation_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *RiskListEntry + var obj *RiskDeviceSignals // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetID() // Should return zero value + _ = obj.GetAutomation() // Should return zero value }) - t.Run("GetList", func(t *testing.T) { + t.Run("GetTimezone", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskListEntry{} - var expected RiskList - obj.List = expected + obj := &RiskDeviceSignals{} + var expected *string + obj.Timezone = expected // Act & Assert - assert.Equal(t, expected, obj.GetList(), "getter should return the property value") - }) - - t.Run("GetList_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *RiskListEntry - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetList() // Should return zero value + assert.Equal(t, expected, obj.GetTimezone(), "getter should return the property value") }) - t.Run("GetType", func(t *testing.T) { + t.Run("GetTimezone_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskListEntry{} - var expected RiskListEntryType - obj.Type = expected + obj := &RiskDeviceSignals{} + obj.Timezone = nil // Act & Assert - assert.Equal(t, expected, obj.GetType(), "getter should return the property value") + assert.Nil(t, obj.GetTimezone(), "getter should return nil when property is nil") }) - t.Run("GetType_NilReceiver", func(t *testing.T) { + t.Run("GetTimezone_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *RiskListEntry + var obj *RiskDeviceSignals // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetType() // Should return zero value + _ = obj.GetTimezone() // Should return zero value }) - t.Run("GetValue", func(t *testing.T) { + t.Run("GetLanguage", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskListEntry{} - var expected string - obj.Value = expected + obj := &RiskDeviceSignals{} + var expected *string + obj.Language = expected // Act & Assert - assert.Equal(t, expected, obj.GetValue(), "getter should return the property value") + assert.Equal(t, expected, obj.GetLanguage(), "getter should return the property value") }) - t.Run("GetValue_NilReceiver", func(t *testing.T) { + t.Run("GetLanguage_NilValue", func(t *testing.T) { t.Parallel() - var obj *RiskListEntry + // Arrange + obj := &RiskDeviceSignals{} + obj.Language = nil + + // Act & Assert + assert.Nil(t, obj.GetLanguage(), "getter should return nil when property is nil") + }) + + t.Run("GetLanguage_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *RiskDeviceSignals // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetValue() // Should return zero value + _ = obj.GetLanguage() // Should return zero value }) - t.Run("GetNote", func(t *testing.T) { + t.Run("GetPlatform", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskListEntry{} + obj := &RiskDeviceSignals{} var expected *string - obj.Note = expected + obj.Platform = expected // Act & Assert - assert.Equal(t, expected, obj.GetNote(), "getter should return the property value") + assert.Equal(t, expected, obj.GetPlatform(), "getter should return the property value") }) - t.Run("GetNote_NilValue", func(t *testing.T) { + t.Run("GetPlatform_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskListEntry{} - obj.Note = nil + obj := &RiskDeviceSignals{} + obj.Platform = nil // Act & Assert - assert.Nil(t, obj.GetNote(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetPlatform(), "getter should return nil when property is nil") }) - t.Run("GetNote_NilReceiver", func(t *testing.T) { + t.Run("GetPlatform_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *RiskListEntry + var obj *RiskDeviceSignals // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetNote() // Should return zero value + _ = obj.GetPlatform() // Should return zero value }) - t.Run("GetExpiresAt", func(t *testing.T) { + t.Run("GetScreen", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskListEntry{} - var expected *time.Time - obj.ExpiresAt = expected + obj := &RiskDeviceSignals{} + var expected *string + obj.Screen = expected // Act & Assert - assert.Equal(t, expected, obj.GetExpiresAt(), "getter should return the property value") + assert.Equal(t, expected, obj.GetScreen(), "getter should return the property value") }) - t.Run("GetExpiresAt_NilValue", func(t *testing.T) { + t.Run("GetScreen_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskListEntry{} - obj.ExpiresAt = nil + obj := &RiskDeviceSignals{} + obj.Screen = nil // Act & Assert - assert.Nil(t, obj.GetExpiresAt(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetScreen(), "getter should return nil when property is nil") }) - t.Run("GetExpiresAt_NilReceiver", func(t *testing.T) { + t.Run("GetScreen_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *RiskListEntry + var obj *RiskDeviceSignals // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetExpiresAt() // Should return zero value + _ = obj.GetScreen() // Should return zero value }) - t.Run("GetCreatedAt", func(t *testing.T) { + t.Run("GetTouch", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskListEntry{} - var expected time.Time - obj.CreatedAt = expected + obj := &RiskDeviceSignals{} + var expected *bool + obj.Touch = expected // Act & Assert - assert.Equal(t, expected, obj.GetCreatedAt(), "getter should return the property value") + assert.Equal(t, expected, obj.GetTouch(), "getter should return the property value") }) - t.Run("GetCreatedAt_NilReceiver", func(t *testing.T) { + t.Run("GetTouch_NilValue", func(t *testing.T) { t.Parallel() - var obj *RiskListEntry + // Arrange + obj := &RiskDeviceSignals{} + obj.Touch = nil + + // Act & Assert + assert.Nil(t, obj.GetTouch(), "getter should return nil when property is nil") + }) + + t.Run("GetTouch_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *RiskDeviceSignals // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetCreatedAt() // Should return zero value + _ = obj.GetTouch() // Should return zero value }) } -func TestSettersMarkExplicitRiskListEntry(t *testing.T) { - t.Run("SetObject_MarksExplicit", func(t *testing.T) { +func TestSettersMarkExplicitRiskDeviceSignals(t *testing.T) { + t.Run("SetValid_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskListEntry{} - var fernTestValueObject RiskListEntryObject + obj := &RiskDeviceSignals{} + var fernTestValueValid bool // Act - obj.SetObject(fernTestValueObject) + obj.SetValid(fernTestValueValid) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -73797,14 +72879,14 @@ func TestSettersMarkExplicitRiskListEntry(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetID_MarksExplicit", func(t *testing.T) { + t.Run("SetAutomation_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskListEntry{} - var fernTestValueID string + obj := &RiskDeviceSignals{} + var fernTestValueAutomation bool // Act - obj.SetID(fernTestValueID) + obj.SetAutomation(fernTestValueAutomation) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -73828,14 +72910,14 @@ func TestSettersMarkExplicitRiskListEntry(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetList_MarksExplicit", func(t *testing.T) { + t.Run("SetTimezone_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskListEntry{} - var fernTestValueList RiskList + obj := &RiskDeviceSignals{} + var fernTestValueTimezone *string // Act - obj.SetList(fernTestValueList) + obj.SetTimezone(fernTestValueTimezone) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -73859,14 +72941,14 @@ func TestSettersMarkExplicitRiskListEntry(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetType_MarksExplicit", func(t *testing.T) { + t.Run("SetLanguage_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskListEntry{} - var fernTestValueType RiskListEntryType + obj := &RiskDeviceSignals{} + var fernTestValueLanguage *string // Act - obj.SetType(fernTestValueType) + obj.SetLanguage(fernTestValueLanguage) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -73890,14 +72972,14 @@ func TestSettersMarkExplicitRiskListEntry(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetValue_MarksExplicit", func(t *testing.T) { + t.Run("SetPlatform_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskListEntry{} - var fernTestValueValue string + obj := &RiskDeviceSignals{} + var fernTestValuePlatform *string // Act - obj.SetValue(fernTestValueValue) + obj.SetPlatform(fernTestValuePlatform) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -73921,14 +73003,14 @@ func TestSettersMarkExplicitRiskListEntry(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetNote_MarksExplicit", func(t *testing.T) { + t.Run("SetScreen_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskListEntry{} - var fernTestValueNote *string + obj := &RiskDeviceSignals{} + var fernTestValueScreen *string // Act - obj.SetNote(fernTestValueNote) + obj.SetScreen(fernTestValueScreen) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -73952,14 +73034,14 @@ func TestSettersMarkExplicitRiskListEntry(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetExpiresAt_MarksExplicit", func(t *testing.T) { + t.Run("SetTouch_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskListEntry{} - var fernTestValueExpiresAt *time.Time + obj := &RiskDeviceSignals{} + var fernTestValueTouch *bool // Act - obj.SetExpiresAt(fernTestValueExpiresAt) + obj.SetTouch(fernTestValueTouch) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -73983,157 +73065,301 @@ func TestSettersMarkExplicitRiskListEntry(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetCreatedAt_MarksExplicit", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &RiskListEntry{} - var fernTestValueCreatedAt time.Time +} - // Act - obj.SetCreatedAt(fernTestValueCreatedAt) +func TestSettersRiskEmailSignals(t *testing.T) { + t.Run("SetDomain", func(t *testing.T) { + obj := &RiskEmailSignals{} + var fernTestValueDomain *string + obj.SetDomain(fernTestValueDomain) + assert.Equal(t, fernTestValueDomain, obj.Domain) + assert.NotNil(t, obj.explicitFields) + }) - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") + t.Run("SetValid", func(t *testing.T) { + obj := &RiskEmailSignals{} + var fernTestValueValid bool + obj.SetValid(fernTestValueValid) + assert.Equal(t, fernTestValueValid, obj.Valid) + assert.NotNil(t, obj.explicitFields) + }) - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } + t.Run("SetDisposable", func(t *testing.T) { + obj := &RiskEmailSignals{} + var fernTestValueDisposable bool + obj.SetDisposable(fernTestValueDisposable) + assert.Equal(t, fernTestValueDisposable, obj.Disposable) + assert.NotNil(t, obj.explicitFields) + }) - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip + t.Run("SetDeliverability", func(t *testing.T) { + obj := &RiskEmailSignals{} + var fernTestValueDeliverability RiskEmailSignalsDeliverability + obj.SetDeliverability(fernTestValueDeliverability) + assert.Equal(t, fernTestValueDeliverability, obj.Deliverability) + assert.NotNil(t, obj.explicitFields) }) -} + t.Run("SetRoleAccount", func(t *testing.T) { + obj := &RiskEmailSignals{} + var fernTestValueRoleAccount bool + obj.SetRoleAccount(fernTestValueRoleAccount) + assert.Equal(t, fernTestValueRoleAccount, obj.RoleAccount) + assert.NotNil(t, obj.explicitFields) + }) -func TestSettersRiskListEntryList(t *testing.T) { - t.Run("SetObject", func(t *testing.T) { - obj := &RiskListEntryList{} - var fernTestValueObject RiskListEntryListObject - obj.SetObject(fernTestValueObject) - assert.Equal(t, fernTestValueObject, obj.Object) + t.Run("SetFreeProvider", func(t *testing.T) { + obj := &RiskEmailSignals{} + var fernTestValueFreeProvider bool + obj.SetFreeProvider(fernTestValueFreeProvider) + assert.Equal(t, fernTestValueFreeProvider, obj.FreeProvider) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetData", func(t *testing.T) { - obj := &RiskListEntryList{} - var fernTestValueData []*RiskListEntry - obj.SetData(fernTestValueData) - assert.Equal(t, fernTestValueData, obj.Data) + t.Run("SetSuggestion", func(t *testing.T) { + obj := &RiskEmailSignals{} + var fernTestValueSuggestion *string + obj.SetSuggestion(fernTestValueSuggestion) + assert.Equal(t, fernTestValueSuggestion, obj.Suggestion) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetHasMore", func(t *testing.T) { - obj := &RiskListEntryList{} - var fernTestValueHasMore bool - obj.SetHasMore(fernTestValueHasMore) - assert.Equal(t, fernTestValueHasMore, obj.HasMore) + t.Run("SetDomainAgeDays", func(t *testing.T) { + obj := &RiskEmailSignals{} + var fernTestValueDomainAgeDays *int64 + obj.SetDomainAgeDays(fernTestValueDomainAgeDays) + assert.Equal(t, fernTestValueDomainAgeDays, obj.DomainAgeDays) assert.NotNil(t, obj.explicitFields) }) } -func TestGettersRiskListEntryList(t *testing.T) { - t.Run("GetObject", func(t *testing.T) { +func TestGettersRiskEmailSignals(t *testing.T) { + t.Run("GetDomain", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskListEntryList{} - var expected RiskListEntryListObject - obj.Object = expected + obj := &RiskEmailSignals{} + var expected *string + obj.Domain = expected // Act & Assert - assert.Equal(t, expected, obj.GetObject(), "getter should return the property value") + assert.Equal(t, expected, obj.GetDomain(), "getter should return the property value") }) - t.Run("GetObject_NilReceiver", func(t *testing.T) { + t.Run("GetDomain_NilValue", func(t *testing.T) { t.Parallel() - var obj *RiskListEntryList + // Arrange + obj := &RiskEmailSignals{} + obj.Domain = nil + + // Act & Assert + assert.Nil(t, obj.GetDomain(), "getter should return nil when property is nil") + }) + + t.Run("GetDomain_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *RiskEmailSignals // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetObject() // Should return zero value + _ = obj.GetDomain() // Should return zero value }) - t.Run("GetData", func(t *testing.T) { + t.Run("GetValid", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskListEntryList{} - var expected []*RiskListEntry - obj.Data = expected + obj := &RiskEmailSignals{} + var expected bool + obj.Valid = expected // Act & Assert - assert.Equal(t, expected, obj.GetData(), "getter should return the property value") + assert.Equal(t, expected, obj.GetValid(), "getter should return the property value") }) - t.Run("GetData_NilValue", func(t *testing.T) { + t.Run("GetValid_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *RiskEmailSignals + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetValid() // Should return zero value + }) + + t.Run("GetDisposable", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskListEntryList{} - obj.Data = nil + obj := &RiskEmailSignals{} + var expected bool + obj.Disposable = expected // Act & Assert - assert.Nil(t, obj.GetData(), "getter should return nil when property is nil") + assert.Equal(t, expected, obj.GetDisposable(), "getter should return the property value") }) - t.Run("GetData_NilReceiver", func(t *testing.T) { + t.Run("GetDisposable_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *RiskListEntryList + var obj *RiskEmailSignals // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetData() // Should return zero value + _ = obj.GetDisposable() // Should return zero value }) - t.Run("GetHasMore", func(t *testing.T) { + t.Run("GetDeliverability", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskListEntryList{} + obj := &RiskEmailSignals{} + var expected RiskEmailSignalsDeliverability + obj.Deliverability = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetDeliverability(), "getter should return the property value") + }) + + t.Run("GetDeliverability_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *RiskEmailSignals + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetDeliverability() // Should return zero value + }) + + t.Run("GetRoleAccount", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskEmailSignals{} var expected bool - obj.HasMore = expected + obj.RoleAccount = expected // Act & Assert - assert.Equal(t, expected, obj.GetHasMore(), "getter should return the property value") + assert.Equal(t, expected, obj.GetRoleAccount(), "getter should return the property value") }) - t.Run("GetHasMore_NilReceiver", func(t *testing.T) { + t.Run("GetRoleAccount_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *RiskListEntryList + var obj *RiskEmailSignals // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetHasMore() // Should return zero value + _ = obj.GetRoleAccount() // Should return zero value + }) + + t.Run("GetFreeProvider", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskEmailSignals{} + var expected bool + obj.FreeProvider = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetFreeProvider(), "getter should return the property value") + }) + + t.Run("GetFreeProvider_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *RiskEmailSignals + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetFreeProvider() // Should return zero value + }) + + t.Run("GetSuggestion", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskEmailSignals{} + var expected *string + obj.Suggestion = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetSuggestion(), "getter should return the property value") + }) + + t.Run("GetSuggestion_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskEmailSignals{} + obj.Suggestion = nil + + // Act & Assert + assert.Nil(t, obj.GetSuggestion(), "getter should return nil when property is nil") + }) + + t.Run("GetSuggestion_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *RiskEmailSignals + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetSuggestion() // Should return zero value + }) + + t.Run("GetDomainAgeDays", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskEmailSignals{} + var expected *int64 + obj.DomainAgeDays = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetDomainAgeDays(), "getter should return the property value") + }) + + t.Run("GetDomainAgeDays_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskEmailSignals{} + obj.DomainAgeDays = nil + + // Act & Assert + assert.Nil(t, obj.GetDomainAgeDays(), "getter should return nil when property is nil") + }) + + t.Run("GetDomainAgeDays_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *RiskEmailSignals + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetDomainAgeDays() // Should return zero value }) } -func TestSettersMarkExplicitRiskListEntryList(t *testing.T) { - t.Run("SetObject_MarksExplicit", func(t *testing.T) { +func TestSettersMarkExplicitRiskEmailSignals(t *testing.T) { + t.Run("SetDomain_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskListEntryList{} - var fernTestValueObject RiskListEntryListObject + obj := &RiskEmailSignals{} + var fernTestValueDomain *string // Act - obj.SetObject(fernTestValueObject) + obj.SetDomain(fernTestValueDomain) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -74157,14 +73383,14 @@ func TestSettersMarkExplicitRiskListEntryList(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetData_MarksExplicit", func(t *testing.T) { + t.Run("SetValid_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskListEntryList{} - var fernTestValueData []*RiskListEntry + obj := &RiskEmailSignals{} + var fernTestValueValid bool // Act - obj.SetData(fernTestValueData) + obj.SetValid(fernTestValueValid) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -74188,14 +73414,14 @@ func TestSettersMarkExplicitRiskListEntryList(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetHasMore_MarksExplicit", func(t *testing.T) { + t.Run("SetDisposable_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskListEntryList{} - var fernTestValueHasMore bool + obj := &RiskEmailSignals{} + var fernTestValueDisposable bool // Act - obj.SetHasMore(fernTestValueHasMore) + obj.SetDisposable(fernTestValueDisposable) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -74219,85 +73445,45 @@ func TestSettersMarkExplicitRiskListEntryList(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) -} - -func TestSettersRiskLoginSignals(t *testing.T) { - t.Run("SetNewCountry", func(t *testing.T) { - obj := &RiskLoginSignals{} - var fernTestValueNewCountry bool - obj.SetNewCountry(fernTestValueNewCountry) - assert.Equal(t, fernTestValueNewCountry, obj.NewCountry) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetNewNetwork", func(t *testing.T) { - obj := &RiskLoginSignals{} - var fernTestValueNewNetwork bool - obj.SetNewNetwork(fernTestValueNewNetwork) - assert.Equal(t, fernTestValueNewNetwork, obj.NewNetwork) - assert.NotNil(t, obj.explicitFields) - }) - -} - -func TestGettersRiskLoginSignals(t *testing.T) { - t.Run("GetNewCountry", func(t *testing.T) { + t.Run("SetDeliverability_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskLoginSignals{} - var expected bool - obj.NewCountry = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetNewCountry(), "getter should return the property value") - }) + obj := &RiskEmailSignals{} + var fernTestValueDeliverability RiskEmailSignalsDeliverability - t.Run("GetNewCountry_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *RiskLoginSignals - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetNewCountry() // Should return zero value - }) + // Act + obj.SetDeliverability(fernTestValueDeliverability) - t.Run("GetNewNetwork", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &RiskLoginSignals{} - var expected bool - obj.NewNetwork = expected + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") - // Act & Assert - assert.Equal(t, expected, obj.GetNewNetwork(), "getter should return the property value") - }) + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } - t.Run("GetNewNetwork_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *RiskLoginSignals - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetNewNetwork() // Should return zero value + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip }) -} - -func TestSettersMarkExplicitRiskLoginSignals(t *testing.T) { - t.Run("SetNewCountry_MarksExplicit", func(t *testing.T) { + t.Run("SetRoleAccount_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskLoginSignals{} - var fernTestValueNewCountry bool + obj := &RiskEmailSignals{} + var fernTestValueRoleAccount bool // Act - obj.SetNewCountry(fernTestValueNewCountry) + obj.SetRoleAccount(fernTestValueRoleAccount) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -74321,14 +73507,14 @@ func TestSettersMarkExplicitRiskLoginSignals(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetNewNetwork_MarksExplicit", func(t *testing.T) { + t.Run("SetFreeProvider_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskLoginSignals{} - var fernTestValueNewNetwork bool + obj := &RiskEmailSignals{} + var fernTestValueFreeProvider bool // Act - obj.SetNewNetwork(fernTestValueNewNetwork) + obj.SetFreeProvider(fernTestValueFreeProvider) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -74352,629 +73538,722 @@ func TestSettersMarkExplicitRiskLoginSignals(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) -} + t.Run("SetSuggestion_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskEmailSignals{} + var fernTestValueSuggestion *string -func TestSettersRiskReason(t *testing.T) { - t.Run("SetCode", func(t *testing.T) { - obj := &RiskReason{} - var fernTestValueCode RiskReasonCode - obj.SetCode(fernTestValueCode) - assert.Equal(t, fernTestValueCode, obj.Code) - assert.NotNil(t, obj.explicitFields) - }) + // Act + obj.SetSuggestion(fernTestValueSuggestion) - t.Run("SetMessage", func(t *testing.T) { - obj := &RiskReason{} - var fernTestValueMessage string - obj.SetMessage(fernTestValueMessage) - assert.Equal(t, fernTestValueMessage, obj.Message) - assert.NotNil(t, obj.explicitFields) - }) + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") - t.Run("SetValue", func(t *testing.T) { - obj := &RiskReason{} - var fernTestValueValue *float64 - obj.SetValue(fernTestValueValue) - assert.Equal(t, fernTestValueValue, obj.Value) - assert.NotNil(t, obj.explicitFields) - }) + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } - t.Run("SetThreshold", func(t *testing.T) { - obj := &RiskReason{} - var fernTestValueThreshold *float64 - obj.SetThreshold(fernTestValueThreshold) - assert.Equal(t, fernTestValueThreshold, obj.Threshold) - assert.NotNil(t, obj.explicitFields) + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetWindow", func(t *testing.T) { - obj := &RiskReason{} - var fernTestValueWindow *RiskReasonWindow - obj.SetWindow(fernTestValueWindow) - assert.Equal(t, fernTestValueWindow, obj.Window) - assert.NotNil(t, obj.explicitFields) - }) + t.Run("SetDomainAgeDays_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskEmailSignals{} + var fernTestValueDomainAgeDays *int64 - t.Run("SetSuggestion", func(t *testing.T) { - obj := &RiskReason{} - var fernTestValueSuggestion *string - obj.SetSuggestion(fernTestValueSuggestion) - assert.Equal(t, fernTestValueSuggestion, obj.Suggestion) - assert.NotNil(t, obj.explicitFields) - }) + // Act + obj.SetDomainAgeDays(fernTestValueDomainAgeDays) - t.Run("SetProvider", func(t *testing.T) { - obj := &RiskReason{} - var fernTestValueProvider *string - obj.SetProvider(fernTestValueProvider) - assert.Equal(t, fernTestValueProvider, obj.Provider) - assert.NotNil(t, obj.explicitFields) - }) + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") - t.Run("SetPreviousUser", func(t *testing.T) { - obj := &RiskReason{} - var fernTestValuePreviousUser *string - obj.SetPreviousUser(fernTestValuePreviousUser) - assert.Equal(t, fernTestValuePreviousUser, obj.PreviousUser) - assert.NotNil(t, obj.explicitFields) - }) + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } - t.Run("SetPreviousAssessment", func(t *testing.T) { - obj := &RiskReason{} - var fernTestValuePreviousAssessment *string - obj.SetPreviousAssessment(fernTestValuePreviousAssessment) - assert.Equal(t, fernTestValuePreviousAssessment, obj.PreviousAssessment) - assert.NotNil(t, obj.explicitFields) + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetEntry", func(t *testing.T) { - obj := &RiskReason{} - var fernTestValueEntry *string - obj.SetEntry(fernTestValueEntry) - assert.Equal(t, fernTestValueEntry, obj.Entry) +} + +func TestSettersRiskIPPrivacy(t *testing.T) { + t.Run("SetVpn", func(t *testing.T) { + obj := &RiskIPPrivacy{} + var fernTestValueVpn bool + obj.SetVpn(fernTestValueVpn) + assert.Equal(t, fernTestValueVpn, obj.Vpn) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetRule", func(t *testing.T) { - obj := &RiskReason{} - var fernTestValueRule *string - obj.SetRule(fernTestValueRule) - assert.Equal(t, fernTestValueRule, obj.Rule) + t.Run("SetProxy", func(t *testing.T) { + obj := &RiskIPPrivacy{} + var fernTestValueProxy bool + obj.SetProxy(fernTestValueProxy) + assert.Equal(t, fernTestValueProxy, obj.Proxy) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetName", func(t *testing.T) { - obj := &RiskReason{} - var fernTestValueName *string - obj.SetName(fernTestValueName) - assert.Equal(t, fernTestValueName, obj.Name) + t.Run("SetRelay", func(t *testing.T) { + obj := &RiskIPPrivacy{} + var fernTestValueRelay bool + obj.SetRelay(fernTestValueRelay) + assert.Equal(t, fernTestValueRelay, obj.Relay) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetType", func(t *testing.T) { - obj := &RiskReason{} - var fernTestValueType *RiskReasonType - obj.SetType(fernTestValueType) - assert.Equal(t, fernTestValueType, obj.Type) + t.Run("SetService", func(t *testing.T) { + obj := &RiskIPPrivacy{} + var fernTestValueService *string + obj.SetService(fernTestValueService) + assert.Equal(t, fernTestValueService, obj.Service) assert.NotNil(t, obj.explicitFields) }) } -func TestGettersRiskReason(t *testing.T) { - t.Run("GetCode", func(t *testing.T) { +func TestGettersRiskIPPrivacy(t *testing.T) { + t.Run("GetVpn", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskReason{} - var expected RiskReasonCode - obj.Code = expected + obj := &RiskIPPrivacy{} + var expected bool + obj.Vpn = expected // Act & Assert - assert.Equal(t, expected, obj.GetCode(), "getter should return the property value") + assert.Equal(t, expected, obj.GetVpn(), "getter should return the property value") }) - t.Run("GetCode_NilReceiver", func(t *testing.T) { + t.Run("GetVpn_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *RiskReason + var obj *RiskIPPrivacy // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetCode() // Should return zero value + _ = obj.GetVpn() // Should return zero value }) - t.Run("GetMessage", func(t *testing.T) { + t.Run("GetProxy", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskReason{} - var expected string - obj.Message = expected + obj := &RiskIPPrivacy{} + var expected bool + obj.Proxy = expected // Act & Assert - assert.Equal(t, expected, obj.GetMessage(), "getter should return the property value") + assert.Equal(t, expected, obj.GetProxy(), "getter should return the property value") }) - t.Run("GetMessage_NilReceiver", func(t *testing.T) { + t.Run("GetProxy_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *RiskReason + var obj *RiskIPPrivacy // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetMessage() // Should return zero value - }) - - t.Run("GetValue", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &RiskReason{} - var expected *float64 - obj.Value = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetValue(), "getter should return the property value") + _ = obj.GetProxy() // Should return zero value }) - t.Run("GetValue_NilValue", func(t *testing.T) { + t.Run("GetRelay", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskReason{} - obj.Value = nil + obj := &RiskIPPrivacy{} + var expected bool + obj.Relay = expected // Act & Assert - assert.Nil(t, obj.GetValue(), "getter should return nil when property is nil") + assert.Equal(t, expected, obj.GetRelay(), "getter should return the property value") }) - t.Run("GetValue_NilReceiver", func(t *testing.T) { + t.Run("GetRelay_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *RiskReason + var obj *RiskIPPrivacy // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetValue() // Should return zero value + _ = obj.GetRelay() // Should return zero value }) - t.Run("GetThreshold", func(t *testing.T) { + t.Run("GetService", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskReason{} - var expected *float64 - obj.Threshold = expected + obj := &RiskIPPrivacy{} + var expected *string + obj.Service = expected // Act & Assert - assert.Equal(t, expected, obj.GetThreshold(), "getter should return the property value") + assert.Equal(t, expected, obj.GetService(), "getter should return the property value") }) - t.Run("GetThreshold_NilValue", func(t *testing.T) { + t.Run("GetService_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskReason{} - obj.Threshold = nil + obj := &RiskIPPrivacy{} + obj.Service = nil // Act & Assert - assert.Nil(t, obj.GetThreshold(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetService(), "getter should return nil when property is nil") }) - t.Run("GetThreshold_NilReceiver", func(t *testing.T) { + t.Run("GetService_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *RiskReason + var obj *RiskIPPrivacy // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetThreshold() // Should return zero value + _ = obj.GetService() // Should return zero value }) - t.Run("GetWindow", func(t *testing.T) { +} + +func TestSettersMarkExplicitRiskIPPrivacy(t *testing.T) { + t.Run("SetVpn_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskReason{} - var expected *RiskReasonWindow - obj.Window = expected + obj := &RiskIPPrivacy{} + var fernTestValueVpn bool - // Act & Assert - assert.Equal(t, expected, obj.GetWindow(), "getter should return the property value") - }) + // Act + obj.SetVpn(fernTestValueVpn) - t.Run("GetWindow_NilValue", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &RiskReason{} - obj.Window = nil + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") - // Act & Assert - assert.Nil(t, obj.GetWindow(), "getter should return nil when property is nil") - }) + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } - t.Run("GetWindow_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *RiskReason - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetWindow() // Should return zero value + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("GetSuggestion", func(t *testing.T) { + t.Run("SetProxy_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskReason{} - var expected *string - obj.Suggestion = expected + obj := &RiskIPPrivacy{} + var fernTestValueProxy bool - // Act & Assert - assert.Equal(t, expected, obj.GetSuggestion(), "getter should return the property value") + // Act + obj.SetProxy(fernTestValueProxy) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("GetSuggestion_NilValue", func(t *testing.T) { + t.Run("SetRelay_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskReason{} - obj.Suggestion = nil + obj := &RiskIPPrivacy{} + var fernTestValueRelay bool + + // Act + obj.SetRelay(fernTestValueRelay) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetService_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskIPPrivacy{} + var fernTestValueService *string + + // Act + obj.SetService(fernTestValueService) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + +} + +func TestSettersRiskIPSignals(t *testing.T) { + t.Run("SetVersion", func(t *testing.T) { + obj := &RiskIPSignals{} + var fernTestValueVersion float64 + obj.SetVersion(fernTestValueVersion) + assert.Equal(t, fernTestValueVersion, obj.Version) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetPrivate", func(t *testing.T) { + obj := &RiskIPSignals{} + var fernTestValuePrivate bool + obj.SetPrivate(fernTestValuePrivate) + assert.Equal(t, fernTestValuePrivate, obj.Private) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetTor", func(t *testing.T) { + obj := &RiskIPSignals{} + var fernTestValueTor bool + obj.SetTor(fernTestValueTor) + assert.Equal(t, fernTestValueTor, obj.Tor) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetHosting", func(t *testing.T) { + obj := &RiskIPSignals{} + var fernTestValueHosting bool + obj.SetHosting(fernTestValueHosting) + assert.Equal(t, fernTestValueHosting, obj.Hosting) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetHostingProvider", func(t *testing.T) { + obj := &RiskIPSignals{} + var fernTestValueHostingProvider *string + obj.SetHostingProvider(fernTestValueHostingProvider) + assert.Equal(t, fernTestValueHostingProvider, obj.HostingProvider) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetHostingKind", func(t *testing.T) { + obj := &RiskIPSignals{} + var fernTestValueHostingKind *RiskIPSignalsHostingKind + obj.SetHostingKind(fernTestValueHostingKind) + assert.Equal(t, fernTestValueHostingKind, obj.HostingKind) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetAsn", func(t *testing.T) { + obj := &RiskIPSignals{} + var fernTestValueAsn *int64 + obj.SetAsn(fernTestValueAsn) + assert.Equal(t, fernTestValueAsn, obj.Asn) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetAsName", func(t *testing.T) { + obj := &RiskIPSignals{} + var fernTestValueAsName *string + obj.SetAsName(fernTestValueAsName) + assert.Equal(t, fernTestValueAsName, obj.AsName) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetCountry", func(t *testing.T) { + obj := &RiskIPSignals{} + var fernTestValueCountry *string + obj.SetCountry(fernTestValueCountry) + assert.Equal(t, fernTestValueCountry, obj.Country) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetPrivacy", func(t *testing.T) { + obj := &RiskIPSignals{} + var fernTestValuePrivacy *RiskIPPrivacy + obj.SetPrivacy(fernTestValuePrivacy) + assert.Equal(t, fernTestValuePrivacy, obj.Privacy) + assert.NotNil(t, obj.explicitFields) + }) + +} + +func TestGettersRiskIPSignals(t *testing.T) { + t.Run("GetVersion", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskIPSignals{} + var expected float64 + obj.Version = expected // Act & Assert - assert.Nil(t, obj.GetSuggestion(), "getter should return nil when property is nil") + assert.Equal(t, expected, obj.GetVersion(), "getter should return the property value") }) - t.Run("GetSuggestion_NilReceiver", func(t *testing.T) { + t.Run("GetVersion_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *RiskReason + var obj *RiskIPSignals // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetSuggestion() // Should return zero value - }) - - t.Run("GetProvider", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &RiskReason{} - var expected *string - obj.Provider = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetProvider(), "getter should return the property value") + _ = obj.GetVersion() // Should return zero value }) - t.Run("GetProvider_NilValue", func(t *testing.T) { + t.Run("GetPrivate", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskReason{} - obj.Provider = nil + obj := &RiskIPSignals{} + var expected bool + obj.Private = expected // Act & Assert - assert.Nil(t, obj.GetProvider(), "getter should return nil when property is nil") + assert.Equal(t, expected, obj.GetPrivate(), "getter should return the property value") }) - t.Run("GetProvider_NilReceiver", func(t *testing.T) { + t.Run("GetPrivate_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *RiskReason + var obj *RiskIPSignals // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetProvider() // Should return zero value + _ = obj.GetPrivate() // Should return zero value }) - t.Run("GetPreviousUser", func(t *testing.T) { + t.Run("GetTor", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskReason{} - var expected *string - obj.PreviousUser = expected + obj := &RiskIPSignals{} + var expected bool + obj.Tor = expected // Act & Assert - assert.Equal(t, expected, obj.GetPreviousUser(), "getter should return the property value") + assert.Equal(t, expected, obj.GetTor(), "getter should return the property value") }) - t.Run("GetPreviousUser_NilValue", func(t *testing.T) { + t.Run("GetTor_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *RiskIPSignals + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetTor() // Should return zero value + }) + + t.Run("GetHosting", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskReason{} - obj.PreviousUser = nil + obj := &RiskIPSignals{} + var expected bool + obj.Hosting = expected // Act & Assert - assert.Nil(t, obj.GetPreviousUser(), "getter should return nil when property is nil") + assert.Equal(t, expected, obj.GetHosting(), "getter should return the property value") }) - t.Run("GetPreviousUser_NilReceiver", func(t *testing.T) { + t.Run("GetHosting_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *RiskReason + var obj *RiskIPSignals // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetPreviousUser() // Should return zero value + _ = obj.GetHosting() // Should return zero value }) - t.Run("GetPreviousAssessment", func(t *testing.T) { + t.Run("GetHostingProvider", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskReason{} + obj := &RiskIPSignals{} var expected *string - obj.PreviousAssessment = expected + obj.HostingProvider = expected // Act & Assert - assert.Equal(t, expected, obj.GetPreviousAssessment(), "getter should return the property value") + assert.Equal(t, expected, obj.GetHostingProvider(), "getter should return the property value") }) - t.Run("GetPreviousAssessment_NilValue", func(t *testing.T) { + t.Run("GetHostingProvider_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskReason{} - obj.PreviousAssessment = nil + obj := &RiskIPSignals{} + obj.HostingProvider = nil // Act & Assert - assert.Nil(t, obj.GetPreviousAssessment(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetHostingProvider(), "getter should return nil when property is nil") }) - t.Run("GetPreviousAssessment_NilReceiver", func(t *testing.T) { + t.Run("GetHostingProvider_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *RiskReason + var obj *RiskIPSignals // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetPreviousAssessment() // Should return zero value + _ = obj.GetHostingProvider() // Should return zero value }) - t.Run("GetEntry", func(t *testing.T) { + t.Run("GetHostingKind", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskReason{} - var expected *string - obj.Entry = expected + obj := &RiskIPSignals{} + var expected *RiskIPSignalsHostingKind + obj.HostingKind = expected // Act & Assert - assert.Equal(t, expected, obj.GetEntry(), "getter should return the property value") + assert.Equal(t, expected, obj.GetHostingKind(), "getter should return the property value") }) - t.Run("GetEntry_NilValue", func(t *testing.T) { + t.Run("GetHostingKind_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskReason{} - obj.Entry = nil + obj := &RiskIPSignals{} + obj.HostingKind = nil // Act & Assert - assert.Nil(t, obj.GetEntry(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetHostingKind(), "getter should return nil when property is nil") }) - t.Run("GetEntry_NilReceiver", func(t *testing.T) { + t.Run("GetHostingKind_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *RiskReason + var obj *RiskIPSignals // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetEntry() // Should return zero value + _ = obj.GetHostingKind() // Should return zero value }) - t.Run("GetRule", func(t *testing.T) { + t.Run("GetAsn", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskReason{} - var expected *string - obj.Rule = expected + obj := &RiskIPSignals{} + var expected *int64 + obj.Asn = expected // Act & Assert - assert.Equal(t, expected, obj.GetRule(), "getter should return the property value") + assert.Equal(t, expected, obj.GetAsn(), "getter should return the property value") }) - t.Run("GetRule_NilValue", func(t *testing.T) { + t.Run("GetAsn_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskReason{} - obj.Rule = nil + obj := &RiskIPSignals{} + obj.Asn = nil // Act & Assert - assert.Nil(t, obj.GetRule(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetAsn(), "getter should return nil when property is nil") }) - t.Run("GetRule_NilReceiver", func(t *testing.T) { + t.Run("GetAsn_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *RiskReason + var obj *RiskIPSignals // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetRule() // Should return zero value + _ = obj.GetAsn() // Should return zero value }) - t.Run("GetName", func(t *testing.T) { + t.Run("GetAsName", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskReason{} + obj := &RiskIPSignals{} var expected *string - obj.Name = expected + obj.AsName = expected // Act & Assert - assert.Equal(t, expected, obj.GetName(), "getter should return the property value") + assert.Equal(t, expected, obj.GetAsName(), "getter should return the property value") }) - t.Run("GetName_NilValue", func(t *testing.T) { + t.Run("GetAsName_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskReason{} - obj.Name = nil + obj := &RiskIPSignals{} + obj.AsName = nil // Act & Assert - assert.Nil(t, obj.GetName(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetAsName(), "getter should return nil when property is nil") }) - t.Run("GetName_NilReceiver", func(t *testing.T) { + t.Run("GetAsName_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *RiskReason + var obj *RiskIPSignals // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetName() // Should return zero value + _ = obj.GetAsName() // Should return zero value }) - t.Run("GetType", func(t *testing.T) { + t.Run("GetCountry", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskReason{} - var expected *RiskReasonType - obj.Type = expected + obj := &RiskIPSignals{} + var expected *string + obj.Country = expected // Act & Assert - assert.Equal(t, expected, obj.GetType(), "getter should return the property value") + assert.Equal(t, expected, obj.GetCountry(), "getter should return the property value") }) - t.Run("GetType_NilValue", func(t *testing.T) { + t.Run("GetCountry_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskReason{} - obj.Type = nil + obj := &RiskIPSignals{} + obj.Country = nil // Act & Assert - assert.Nil(t, obj.GetType(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetCountry(), "getter should return nil when property is nil") }) - t.Run("GetType_NilReceiver", func(t *testing.T) { + t.Run("GetCountry_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *RiskReason + var obj *RiskIPSignals // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetType() // Should return zero value + _ = obj.GetCountry() // Should return zero value }) -} - -func TestSettersMarkExplicitRiskReason(t *testing.T) { - t.Run("SetCode_MarksExplicit", func(t *testing.T) { + t.Run("GetPrivacy", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskReason{} - var fernTestValueCode RiskReasonCode - - // Act - obj.SetCode(fernTestValueCode) - - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") - - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } + obj := &RiskIPSignals{} + var expected *RiskIPPrivacy + obj.Privacy = expected - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip + // Act & Assert + assert.Equal(t, expected, obj.GetPrivacy(), "getter should return the property value") }) - t.Run("SetMessage_MarksExplicit", func(t *testing.T) { + t.Run("GetPrivacy_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskReason{} - var fernTestValueMessage string - - // Act - obj.SetMessage(fernTestValueMessage) - - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") - - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } + obj := &RiskIPSignals{} + obj.Privacy = nil - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip + // Act & Assert + assert.Nil(t, obj.GetPrivacy(), "getter should return nil when property is nil") }) - t.Run("SetValue_MarksExplicit", func(t *testing.T) { + t.Run("GetPrivacy_NilReceiver", func(t *testing.T) { t.Parallel() - // Arrange - obj := &RiskReason{} - var fernTestValueValue *float64 - - // Act - obj.SetValue(fernTestValueValue) - - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") - - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } - - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip + var obj *RiskIPSignals + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetPrivacy() // Should return zero value }) - t.Run("SetThreshold_MarksExplicit", func(t *testing.T) { +} + +func TestSettersMarkExplicitRiskIPSignals(t *testing.T) { + t.Run("SetVersion_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskReason{} - var fernTestValueThreshold *float64 + obj := &RiskIPSignals{} + var fernTestValueVersion float64 // Act - obj.SetThreshold(fernTestValueThreshold) + obj.SetVersion(fernTestValueVersion) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -74998,14 +74277,14 @@ func TestSettersMarkExplicitRiskReason(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetWindow_MarksExplicit", func(t *testing.T) { + t.Run("SetPrivate_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskReason{} - var fernTestValueWindow *RiskReasonWindow + obj := &RiskIPSignals{} + var fernTestValuePrivate bool // Act - obj.SetWindow(fernTestValueWindow) + obj.SetPrivate(fernTestValuePrivate) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -75029,14 +74308,14 @@ func TestSettersMarkExplicitRiskReason(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetSuggestion_MarksExplicit", func(t *testing.T) { + t.Run("SetTor_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskReason{} - var fernTestValueSuggestion *string + obj := &RiskIPSignals{} + var fernTestValueTor bool // Act - obj.SetSuggestion(fernTestValueSuggestion) + obj.SetTor(fernTestValueTor) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -75060,14 +74339,14 @@ func TestSettersMarkExplicitRiskReason(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetProvider_MarksExplicit", func(t *testing.T) { + t.Run("SetHosting_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskReason{} - var fernTestValueProvider *string + obj := &RiskIPSignals{} + var fernTestValueHosting bool // Act - obj.SetProvider(fernTestValueProvider) + obj.SetHosting(fernTestValueHosting) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -75091,14 +74370,14 @@ func TestSettersMarkExplicitRiskReason(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetPreviousUser_MarksExplicit", func(t *testing.T) { + t.Run("SetHostingProvider_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskReason{} - var fernTestValuePreviousUser *string + obj := &RiskIPSignals{} + var fernTestValueHostingProvider *string // Act - obj.SetPreviousUser(fernTestValuePreviousUser) + obj.SetHostingProvider(fernTestValueHostingProvider) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -75122,14 +74401,14 @@ func TestSettersMarkExplicitRiskReason(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetPreviousAssessment_MarksExplicit", func(t *testing.T) { + t.Run("SetHostingKind_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskReason{} - var fernTestValuePreviousAssessment *string + obj := &RiskIPSignals{} + var fernTestValueHostingKind *RiskIPSignalsHostingKind // Act - obj.SetPreviousAssessment(fernTestValuePreviousAssessment) + obj.SetHostingKind(fernTestValueHostingKind) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -75153,14 +74432,14 @@ func TestSettersMarkExplicitRiskReason(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetEntry_MarksExplicit", func(t *testing.T) { + t.Run("SetAsn_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskReason{} - var fernTestValueEntry *string + obj := &RiskIPSignals{} + var fernTestValueAsn *int64 // Act - obj.SetEntry(fernTestValueEntry) + obj.SetAsn(fernTestValueAsn) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -75184,14 +74463,14 @@ func TestSettersMarkExplicitRiskReason(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetRule_MarksExplicit", func(t *testing.T) { + t.Run("SetAsName_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskReason{} - var fernTestValueRule *string + obj := &RiskIPSignals{} + var fernTestValueAsName *string // Act - obj.SetRule(fernTestValueRule) + obj.SetAsName(fernTestValueAsName) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -75215,14 +74494,14 @@ func TestSettersMarkExplicitRiskReason(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetName_MarksExplicit", func(t *testing.T) { + t.Run("SetCountry_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskReason{} - var fernTestValueName *string + obj := &RiskIPSignals{} + var fernTestValueCountry *string // Act - obj.SetName(fernTestValueName) + obj.SetCountry(fernTestValueCountry) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -75246,14 +74525,14 @@ func TestSettersMarkExplicitRiskReason(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetType_MarksExplicit", func(t *testing.T) { + t.Run("SetPrivacy_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskReason{} - var fernTestValueType *RiskReasonType + obj := &RiskIPSignals{} + var fernTestValuePrivacy *RiskIPPrivacy // Act - obj.SetType(fernTestValueType) + obj.SetPrivacy(fernTestValuePrivacy) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -75279,17 +74558,17 @@ func TestSettersMarkExplicitRiskReason(t *testing.T) { } -func TestSettersRiskRule(t *testing.T) { +func TestSettersRiskLimitBucket(t *testing.T) { t.Run("SetObject", func(t *testing.T) { - obj := &RiskRule{} - var fernTestValueObject RiskRuleObject + obj := &RiskLimitBucket{} + var fernTestValueObject RiskLimitBucketObject obj.SetObject(fernTestValueObject) assert.Equal(t, fernTestValueObject, obj.Object) assert.NotNil(t, obj.explicitFields) }) t.Run("SetID", func(t *testing.T) { - obj := &RiskRule{} + obj := &RiskLimitBucket{} var fernTestValueID string obj.SetID(fernTestValueID) assert.Equal(t, fernTestValueID, obj.ID) @@ -75297,63 +74576,47 @@ func TestSettersRiskRule(t *testing.T) { }) t.Run("SetName", func(t *testing.T) { - obj := &RiskRule{} + obj := &RiskLimitBucket{} var fernTestValueName string obj.SetName(fernTestValueName) assert.Equal(t, fernTestValueName, obj.Name) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetEnabled", func(t *testing.T) { - obj := &RiskRule{} - var fernTestValueEnabled bool - obj.SetEnabled(fernTestValueEnabled) - assert.Equal(t, fernTestValueEnabled, obj.Enabled) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetPosition", func(t *testing.T) { - obj := &RiskRule{} - var fernTestValuePosition int64 - obj.SetPosition(fernTestValuePosition) - assert.Equal(t, fernTestValuePosition, obj.Position) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetEvents", func(t *testing.T) { - obj := &RiskRule{} - var fernTestValueEvents []RiskEvent - obj.SetEvents(fernTestValueEvents) - assert.Equal(t, fernTestValueEvents, obj.Events) + t.Run("SetLimit", func(t *testing.T) { + obj := &RiskLimitBucket{} + var fernTestValueLimit int64 + obj.SetLimit(fernTestValueLimit) + assert.Equal(t, fernTestValueLimit, obj.Limit) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetMatch", func(t *testing.T) { - obj := &RiskRule{} - var fernTestValueMatch RiskRuleMatch - obj.SetMatch(fernTestValueMatch) - assert.Equal(t, fernTestValueMatch, obj.Match) + t.Run("SetPeriodSeconds", func(t *testing.T) { + obj := &RiskLimitBucket{} + var fernTestValuePeriodSeconds int64 + obj.SetPeriodSeconds(fernTestValuePeriodSeconds) + assert.Equal(t, fernTestValuePeriodSeconds, obj.PeriodSeconds) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetConditions", func(t *testing.T) { - obj := &RiskRule{} - var fernTestValueConditions []*RiskRuleCondition - obj.SetConditions(fernTestValueConditions) - assert.Equal(t, fernTestValueConditions, obj.Conditions) + t.Run("SetBurst", func(t *testing.T) { + obj := &RiskLimitBucket{} + var fernTestValueBurst int64 + obj.SetBurst(fernTestValueBurst) + assert.Equal(t, fernTestValueBurst, obj.Burst) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetAction", func(t *testing.T) { - obj := &RiskRule{} - var fernTestValueAction RiskDecision - obj.SetAction(fernTestValueAction) - assert.Equal(t, fernTestValueAction, obj.Action) + t.Run("SetOnFailure", func(t *testing.T) { + obj := &RiskLimitBucket{} + var fernTestValueOnFailure RiskLimitBucketOnFailure + obj.SetOnFailure(fernTestValueOnFailure) + assert.Equal(t, fernTestValueOnFailure, obj.OnFailure) assert.NotNil(t, obj.explicitFields) }) t.Run("SetCreatedAt", func(t *testing.T) { - obj := &RiskRule{} + obj := &RiskLimitBucket{} var fernTestValueCreatedAt time.Time obj.SetCreatedAt(fernTestValueCreatedAt) assert.Equal(t, fernTestValueCreatedAt, obj.CreatedAt) @@ -75361,7 +74624,7 @@ func TestSettersRiskRule(t *testing.T) { }) t.Run("SetUpdatedAt", func(t *testing.T) { - obj := &RiskRule{} + obj := &RiskLimitBucket{} var fernTestValueUpdatedAt time.Time obj.SetUpdatedAt(fernTestValueUpdatedAt) assert.Equal(t, fernTestValueUpdatedAt, obj.UpdatedAt) @@ -75370,12 +74633,12 @@ func TestSettersRiskRule(t *testing.T) { } -func TestGettersRiskRule(t *testing.T) { +func TestGettersRiskLimitBucket(t *testing.T) { t.Run("GetObject", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskRule{} - var expected RiskRuleObject + obj := &RiskLimitBucket{} + var expected RiskLimitBucketObject obj.Object = expected // Act & Assert @@ -75384,7 +74647,7 @@ func TestGettersRiskRule(t *testing.T) { t.Run("GetObject_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *RiskRule + var obj *RiskLimitBucket // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -75397,7 +74660,7 @@ func TestGettersRiskRule(t *testing.T) { t.Run("GetID", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskRule{} + obj := &RiskLimitBucket{} var expected string obj.ID = expected @@ -75407,7 +74670,7 @@ func TestGettersRiskRule(t *testing.T) { t.Run("GetID_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *RiskRule + var obj *RiskLimitBucket // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -75420,7 +74683,7 @@ func TestGettersRiskRule(t *testing.T) { t.Run("GetName", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskRule{} + obj := &RiskLimitBucket{} var expected string obj.Name = expected @@ -75430,7 +74693,7 @@ func TestGettersRiskRule(t *testing.T) { t.Run("GetName_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *RiskRule + var obj *RiskLimitBucket // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -75440,168 +74703,102 @@ func TestGettersRiskRule(t *testing.T) { _ = obj.GetName() // Should return zero value }) - t.Run("GetEnabled", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &RiskRule{} - var expected bool - obj.Enabled = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetEnabled(), "getter should return the property value") - }) - - t.Run("GetEnabled_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *RiskRule - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetEnabled() // Should return zero value - }) - - t.Run("GetPosition", func(t *testing.T) { + t.Run("GetLimit", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskRule{} + obj := &RiskLimitBucket{} var expected int64 - obj.Position = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetPosition(), "getter should return the property value") - }) - - t.Run("GetPosition_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *RiskRule - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetPosition() // Should return zero value - }) - - t.Run("GetEvents", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &RiskRule{} - var expected []RiskEvent - obj.Events = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetEvents(), "getter should return the property value") - }) - - t.Run("GetEvents_NilValue", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &RiskRule{} - obj.Events = nil + obj.Limit = expected // Act & Assert - assert.Nil(t, obj.GetEvents(), "getter should return nil when property is nil") + assert.Equal(t, expected, obj.GetLimit(), "getter should return the property value") }) - t.Run("GetEvents_NilReceiver", func(t *testing.T) { + t.Run("GetLimit_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *RiskRule + var obj *RiskLimitBucket // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetEvents() // Should return zero value + _ = obj.GetLimit() // Should return zero value }) - t.Run("GetMatch", func(t *testing.T) { + t.Run("GetPeriodSeconds", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskRule{} - var expected RiskRuleMatch - obj.Match = expected + obj := &RiskLimitBucket{} + var expected int64 + obj.PeriodSeconds = expected // Act & Assert - assert.Equal(t, expected, obj.GetMatch(), "getter should return the property value") + assert.Equal(t, expected, obj.GetPeriodSeconds(), "getter should return the property value") }) - t.Run("GetMatch_NilReceiver", func(t *testing.T) { + t.Run("GetPeriodSeconds_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *RiskRule + var obj *RiskLimitBucket // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetMatch() // Should return zero value - }) - - t.Run("GetConditions", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &RiskRule{} - var expected []*RiskRuleCondition - obj.Conditions = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetConditions(), "getter should return the property value") + _ = obj.GetPeriodSeconds() // Should return zero value }) - t.Run("GetConditions_NilValue", func(t *testing.T) { + t.Run("GetBurst", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskRule{} - obj.Conditions = nil + obj := &RiskLimitBucket{} + var expected int64 + obj.Burst = expected // Act & Assert - assert.Nil(t, obj.GetConditions(), "getter should return nil when property is nil") + assert.Equal(t, expected, obj.GetBurst(), "getter should return the property value") }) - t.Run("GetConditions_NilReceiver", func(t *testing.T) { + t.Run("GetBurst_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *RiskRule + var obj *RiskLimitBucket // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetConditions() // Should return zero value + _ = obj.GetBurst() // Should return zero value }) - t.Run("GetAction", func(t *testing.T) { + t.Run("GetOnFailure", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskRule{} - var expected RiskDecision - obj.Action = expected + obj := &RiskLimitBucket{} + var expected RiskLimitBucketOnFailure + obj.OnFailure = expected // Act & Assert - assert.Equal(t, expected, obj.GetAction(), "getter should return the property value") + assert.Equal(t, expected, obj.GetOnFailure(), "getter should return the property value") }) - t.Run("GetAction_NilReceiver", func(t *testing.T) { + t.Run("GetOnFailure_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *RiskRule + var obj *RiskLimitBucket // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetAction() // Should return zero value + _ = obj.GetOnFailure() // Should return zero value }) t.Run("GetCreatedAt", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskRule{} + obj := &RiskLimitBucket{} var expected time.Time obj.CreatedAt = expected @@ -75611,7 +74808,7 @@ func TestGettersRiskRule(t *testing.T) { t.Run("GetCreatedAt_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *RiskRule + var obj *RiskLimitBucket // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -75624,7 +74821,7 @@ func TestGettersRiskRule(t *testing.T) { t.Run("GetUpdatedAt", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskRule{} + obj := &RiskLimitBucket{} var expected time.Time obj.UpdatedAt = expected @@ -75634,7 +74831,7 @@ func TestGettersRiskRule(t *testing.T) { t.Run("GetUpdatedAt_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *RiskRule + var obj *RiskLimitBucket // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -75646,12 +74843,12 @@ func TestGettersRiskRule(t *testing.T) { } -func TestSettersMarkExplicitRiskRule(t *testing.T) { +func TestSettersMarkExplicitRiskLimitBucket(t *testing.T) { t.Run("SetObject_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskRule{} - var fernTestValueObject RiskRuleObject + obj := &RiskLimitBucket{} + var fernTestValueObject RiskLimitBucketObject // Act obj.SetObject(fernTestValueObject) @@ -75681,7 +74878,7 @@ func TestSettersMarkExplicitRiskRule(t *testing.T) { t.Run("SetID_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskRule{} + obj := &RiskLimitBucket{} var fernTestValueID string // Act @@ -75712,7 +74909,7 @@ func TestSettersMarkExplicitRiskRule(t *testing.T) { t.Run("SetName_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskRule{} + obj := &RiskLimitBucket{} var fernTestValueName string // Act @@ -75740,76 +74937,14 @@ func TestSettersMarkExplicitRiskRule(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetEnabled_MarksExplicit", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &RiskRule{} - var fernTestValueEnabled bool - - // Act - obj.SetEnabled(fernTestValueEnabled) - - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") - - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } - - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip - }) - - t.Run("SetPosition_MarksExplicit", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &RiskRule{} - var fernTestValuePosition int64 - - // Act - obj.SetPosition(fernTestValuePosition) - - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") - - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } - - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip - }) - - t.Run("SetEvents_MarksExplicit", func(t *testing.T) { + t.Run("SetLimit_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskRule{} - var fernTestValueEvents []RiskEvent + obj := &RiskLimitBucket{} + var fernTestValueLimit int64 // Act - obj.SetEvents(fernTestValueEvents) + obj.SetLimit(fernTestValueLimit) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -75833,14 +74968,14 @@ func TestSettersMarkExplicitRiskRule(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetMatch_MarksExplicit", func(t *testing.T) { + t.Run("SetPeriodSeconds_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskRule{} - var fernTestValueMatch RiskRuleMatch + obj := &RiskLimitBucket{} + var fernTestValuePeriodSeconds int64 // Act - obj.SetMatch(fernTestValueMatch) + obj.SetPeriodSeconds(fernTestValuePeriodSeconds) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -75864,14 +74999,14 @@ func TestSettersMarkExplicitRiskRule(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetConditions_MarksExplicit", func(t *testing.T) { + t.Run("SetBurst_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskRule{} - var fernTestValueConditions []*RiskRuleCondition + obj := &RiskLimitBucket{} + var fernTestValueBurst int64 // Act - obj.SetConditions(fernTestValueConditions) + obj.SetBurst(fernTestValueBurst) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -75895,14 +75030,14 @@ func TestSettersMarkExplicitRiskRule(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetAction_MarksExplicit", func(t *testing.T) { + t.Run("SetOnFailure_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskRule{} - var fernTestValueAction RiskDecision + obj := &RiskLimitBucket{} + var fernTestValueOnFailure RiskLimitBucketOnFailure // Act - obj.SetAction(fernTestValueAction) + obj.SetOnFailure(fernTestValueOnFailure) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -75929,7 +75064,7 @@ func TestSettersMarkExplicitRiskRule(t *testing.T) { t.Run("SetCreatedAt_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskRule{} + obj := &RiskLimitBucket{} var fernTestValueCreatedAt time.Time // Act @@ -75960,7 +75095,7 @@ func TestSettersMarkExplicitRiskRule(t *testing.T) { t.Run("SetUpdatedAt_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskRule{} + obj := &RiskLimitBucket{} var fernTestValueUpdatedAt time.Time // Act @@ -75990,124 +75125,124 @@ func TestSettersMarkExplicitRiskRule(t *testing.T) { } -func TestSettersRiskRuleCondition(t *testing.T) { - t.Run("SetField", func(t *testing.T) { - obj := &RiskRuleCondition{} - var fernTestValueField RiskRuleConditionField - obj.SetField(fernTestValueField) - assert.Equal(t, fernTestValueField, obj.Field) +func TestSettersRiskLimitBucketList(t *testing.T) { + t.Run("SetObject", func(t *testing.T) { + obj := &RiskLimitBucketList{} + var fernTestValueObject RiskLimitBucketListObject + obj.SetObject(fernTestValueObject) + assert.Equal(t, fernTestValueObject, obj.Object) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetOperator", func(t *testing.T) { - obj := &RiskRuleCondition{} - var fernTestValueOperator RiskRuleConditionOperator - obj.SetOperator(fernTestValueOperator) - assert.Equal(t, fernTestValueOperator, obj.Operator) + t.Run("SetData", func(t *testing.T) { + obj := &RiskLimitBucketList{} + var fernTestValueData []*RiskLimitBucket + obj.SetData(fernTestValueData) + assert.Equal(t, fernTestValueData, obj.Data) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetValue", func(t *testing.T) { - obj := &RiskRuleCondition{} - var fernTestValueValue *RiskRuleConditionValue - obj.SetValue(fernTestValueValue) - assert.Equal(t, fernTestValueValue, obj.Value) + t.Run("SetHasMore", func(t *testing.T) { + obj := &RiskLimitBucketList{} + var fernTestValueHasMore bool + obj.SetHasMore(fernTestValueHasMore) + assert.Equal(t, fernTestValueHasMore, obj.HasMore) assert.NotNil(t, obj.explicitFields) }) } -func TestGettersRiskRuleCondition(t *testing.T) { - t.Run("GetField", func(t *testing.T) { +func TestGettersRiskLimitBucketList(t *testing.T) { + t.Run("GetObject", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskRuleCondition{} - var expected RiskRuleConditionField - obj.Field = expected + obj := &RiskLimitBucketList{} + var expected RiskLimitBucketListObject + obj.Object = expected // Act & Assert - assert.Equal(t, expected, obj.GetField(), "getter should return the property value") + assert.Equal(t, expected, obj.GetObject(), "getter should return the property value") }) - t.Run("GetField_NilReceiver", func(t *testing.T) { + t.Run("GetObject_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *RiskRuleCondition + var obj *RiskLimitBucketList // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetField() // Should return zero value + _ = obj.GetObject() // Should return zero value }) - t.Run("GetOperator", func(t *testing.T) { + t.Run("GetData", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskRuleCondition{} - var expected RiskRuleConditionOperator - obj.Operator = expected + obj := &RiskLimitBucketList{} + var expected []*RiskLimitBucket + obj.Data = expected // Act & Assert - assert.Equal(t, expected, obj.GetOperator(), "getter should return the property value") + assert.Equal(t, expected, obj.GetData(), "getter should return the property value") }) - t.Run("GetOperator_NilReceiver", func(t *testing.T) { + t.Run("GetData_NilValue", func(t *testing.T) { t.Parallel() - var obj *RiskRuleCondition + // Arrange + obj := &RiskLimitBucketList{} + obj.Data = nil + + // Act & Assert + assert.Nil(t, obj.GetData(), "getter should return nil when property is nil") + }) + + t.Run("GetData_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *RiskLimitBucketList // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetOperator() // Should return zero value - }) - - t.Run("GetValue", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &RiskRuleCondition{} - var expected *RiskRuleConditionValue - obj.Value = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetValue(), "getter should return the property value") + _ = obj.GetData() // Should return zero value }) - t.Run("GetValue_NilValue", func(t *testing.T) { + t.Run("GetHasMore", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskRuleCondition{} - obj.Value = nil + obj := &RiskLimitBucketList{} + var expected bool + obj.HasMore = expected // Act & Assert - assert.Nil(t, obj.GetValue(), "getter should return nil when property is nil") + assert.Equal(t, expected, obj.GetHasMore(), "getter should return the property value") }) - t.Run("GetValue_NilReceiver", func(t *testing.T) { + t.Run("GetHasMore_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *RiskRuleCondition + var obj *RiskLimitBucketList // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetValue() // Should return zero value + _ = obj.GetHasMore() // Should return zero value }) } -func TestSettersMarkExplicitRiskRuleCondition(t *testing.T) { - t.Run("SetField_MarksExplicit", func(t *testing.T) { +func TestSettersMarkExplicitRiskLimitBucketList(t *testing.T) { + t.Run("SetObject_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskRuleCondition{} - var fernTestValueField RiskRuleConditionField + obj := &RiskLimitBucketList{} + var fernTestValueObject RiskLimitBucketListObject // Act - obj.SetField(fernTestValueField) + obj.SetObject(fernTestValueObject) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -76131,14 +75266,14 @@ func TestSettersMarkExplicitRiskRuleCondition(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetOperator_MarksExplicit", func(t *testing.T) { + t.Run("SetData_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskRuleCondition{} - var fernTestValueOperator RiskRuleConditionOperator + obj := &RiskLimitBucketList{} + var fernTestValueData []*RiskLimitBucket // Act - obj.SetOperator(fernTestValueOperator) + obj.SetData(fernTestValueData) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -76162,14 +75297,14 @@ func TestSettersMarkExplicitRiskRuleCondition(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetValue_MarksExplicit", func(t *testing.T) { + t.Run("SetHasMore_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskRuleCondition{} - var fernTestValueValue *RiskRuleConditionValue + obj := &RiskLimitBucketList{} + var fernTestValueHasMore bool // Act - obj.SetValue(fernTestValueValue) + obj.SetHasMore(fernTestValueHasMore) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -76195,226 +75330,286 @@ func TestSettersMarkExplicitRiskRuleCondition(t *testing.T) { } -func TestGettersRiskRuleConditionValue(t *testing.T) { - t.Run("GetBoolean", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &RiskRuleConditionValue{} - var expected bool - obj.Boolean = expected - +func TestSettersRiskListEntry(t *testing.T) { + t.Run("SetObject", func(t *testing.T) { + obj := &RiskListEntry{} + var fernTestValueObject RiskListEntryObject + obj.SetObject(fernTestValueObject) + assert.Equal(t, fernTestValueObject, obj.Object) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetID", func(t *testing.T) { + obj := &RiskListEntry{} + var fernTestValueID string + obj.SetID(fernTestValueID) + assert.Equal(t, fernTestValueID, obj.ID) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetList", func(t *testing.T) { + obj := &RiskListEntry{} + var fernTestValueList RiskList + obj.SetList(fernTestValueList) + assert.Equal(t, fernTestValueList, obj.List) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetType", func(t *testing.T) { + obj := &RiskListEntry{} + var fernTestValueType RiskListEntryType + obj.SetType(fernTestValueType) + assert.Equal(t, fernTestValueType, obj.Type) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetValue", func(t *testing.T) { + obj := &RiskListEntry{} + var fernTestValueValue string + obj.SetValue(fernTestValueValue) + assert.Equal(t, fernTestValueValue, obj.Value) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetNote", func(t *testing.T) { + obj := &RiskListEntry{} + var fernTestValueNote *string + obj.SetNote(fernTestValueNote) + assert.Equal(t, fernTestValueNote, obj.Note) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetExpiresAt", func(t *testing.T) { + obj := &RiskListEntry{} + var fernTestValueExpiresAt *time.Time + obj.SetExpiresAt(fernTestValueExpiresAt) + assert.Equal(t, fernTestValueExpiresAt, obj.ExpiresAt) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetCreatedAt", func(t *testing.T) { + obj := &RiskListEntry{} + var fernTestValueCreatedAt time.Time + obj.SetCreatedAt(fernTestValueCreatedAt) + assert.Equal(t, fernTestValueCreatedAt, obj.CreatedAt) + assert.NotNil(t, obj.explicitFields) + }) + +} + +func TestGettersRiskListEntry(t *testing.T) { + t.Run("GetObject", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskListEntry{} + var expected RiskListEntryObject + obj.Object = expected + // Act & Assert - assert.Equal(t, expected, obj.GetBoolean(), "getter should return the property value") + assert.Equal(t, expected, obj.GetObject(), "getter should return the property value") }) - t.Run("GetBoolean_NilReceiver", func(t *testing.T) { + t.Run("GetObject_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *RiskRuleConditionValue + var obj *RiskListEntry // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetBoolean() // Should return zero value + _ = obj.GetObject() // Should return zero value }) - t.Run("GetDouble", func(t *testing.T) { + t.Run("GetID", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskRuleConditionValue{} - var expected float64 - obj.Double = expected + obj := &RiskListEntry{} + var expected string + obj.ID = expected // Act & Assert - assert.Equal(t, expected, obj.GetDouble(), "getter should return the property value") + assert.Equal(t, expected, obj.GetID(), "getter should return the property value") }) - t.Run("GetDouble_NilReceiver", func(t *testing.T) { + t.Run("GetID_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *RiskRuleConditionValue + var obj *RiskListEntry // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetDouble() // Should return zero value + _ = obj.GetID() // Should return zero value }) - t.Run("GetString", func(t *testing.T) { + t.Run("GetList", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskRuleConditionValue{} - var expected string - obj.String = expected + obj := &RiskListEntry{} + var expected RiskList + obj.List = expected // Act & Assert - assert.Equal(t, expected, obj.GetString(), "getter should return the property value") + assert.Equal(t, expected, obj.GetList(), "getter should return the property value") }) - t.Run("GetString_NilReceiver", func(t *testing.T) { + t.Run("GetList_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *RiskRuleConditionValue + var obj *RiskListEntry // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetString() // Should return zero value + _ = obj.GetList() // Should return zero value }) - t.Run("GetStringList", func(t *testing.T) { + t.Run("GetType", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskRuleConditionValue{} - var expected []string - obj.StringList = expected + obj := &RiskListEntry{} + var expected RiskListEntryType + obj.Type = expected // Act & Assert - assert.Equal(t, expected, obj.GetStringList(), "getter should return the property value") + assert.Equal(t, expected, obj.GetType(), "getter should return the property value") }) - t.Run("GetStringList_NilValue", func(t *testing.T) { + t.Run("GetType_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *RiskListEntry + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetType() // Should return zero value + }) + + t.Run("GetValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskRuleConditionValue{} - obj.StringList = nil + obj := &RiskListEntry{} + var expected string + obj.Value = expected // Act & Assert - assert.Nil(t, obj.GetStringList(), "getter should return nil when property is nil") + assert.Equal(t, expected, obj.GetValue(), "getter should return the property value") }) - t.Run("GetStringList_NilReceiver", func(t *testing.T) { + t.Run("GetValue_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *RiskRuleConditionValue + var obj *RiskListEntry // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetStringList() // Should return zero value - }) - -} - -func TestSettersRiskRuleList(t *testing.T) { - t.Run("SetObject", func(t *testing.T) { - obj := &RiskRuleList{} - var fernTestValueObject RiskRuleListObject - obj.SetObject(fernTestValueObject) - assert.Equal(t, fernTestValueObject, obj.Object) - assert.NotNil(t, obj.explicitFields) + _ = obj.GetValue() // Should return zero value }) - t.Run("SetData", func(t *testing.T) { - obj := &RiskRuleList{} - var fernTestValueData []*RiskRule - obj.SetData(fernTestValueData) - assert.Equal(t, fernTestValueData, obj.Data) - assert.NotNil(t, obj.explicitFields) - }) + t.Run("GetNote", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskListEntry{} + var expected *string + obj.Note = expected - t.Run("SetHasMore", func(t *testing.T) { - obj := &RiskRuleList{} - var fernTestValueHasMore bool - obj.SetHasMore(fernTestValueHasMore) - assert.Equal(t, fernTestValueHasMore, obj.HasMore) - assert.NotNil(t, obj.explicitFields) + // Act & Assert + assert.Equal(t, expected, obj.GetNote(), "getter should return the property value") }) -} - -func TestGettersRiskRuleList(t *testing.T) { - t.Run("GetObject", func(t *testing.T) { + t.Run("GetNote_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskRuleList{} - var expected RiskRuleListObject - obj.Object = expected + obj := &RiskListEntry{} + obj.Note = nil // Act & Assert - assert.Equal(t, expected, obj.GetObject(), "getter should return the property value") + assert.Nil(t, obj.GetNote(), "getter should return nil when property is nil") }) - t.Run("GetObject_NilReceiver", func(t *testing.T) { + t.Run("GetNote_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *RiskRuleList + var obj *RiskListEntry // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetObject() // Should return zero value + _ = obj.GetNote() // Should return zero value }) - t.Run("GetData", func(t *testing.T) { + t.Run("GetExpiresAt", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskRuleList{} - var expected []*RiskRule - obj.Data = expected + obj := &RiskListEntry{} + var expected *time.Time + obj.ExpiresAt = expected // Act & Assert - assert.Equal(t, expected, obj.GetData(), "getter should return the property value") + assert.Equal(t, expected, obj.GetExpiresAt(), "getter should return the property value") }) - t.Run("GetData_NilValue", func(t *testing.T) { + t.Run("GetExpiresAt_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskRuleList{} - obj.Data = nil + obj := &RiskListEntry{} + obj.ExpiresAt = nil // Act & Assert - assert.Nil(t, obj.GetData(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetExpiresAt(), "getter should return nil when property is nil") }) - t.Run("GetData_NilReceiver", func(t *testing.T) { + t.Run("GetExpiresAt_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *RiskRuleList + var obj *RiskListEntry // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetData() // Should return zero value + _ = obj.GetExpiresAt() // Should return zero value }) - t.Run("GetHasMore", func(t *testing.T) { + t.Run("GetCreatedAt", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskRuleList{} - var expected bool - obj.HasMore = expected + obj := &RiskListEntry{} + var expected time.Time + obj.CreatedAt = expected // Act & Assert - assert.Equal(t, expected, obj.GetHasMore(), "getter should return the property value") + assert.Equal(t, expected, obj.GetCreatedAt(), "getter should return the property value") }) - t.Run("GetHasMore_NilReceiver", func(t *testing.T) { + t.Run("GetCreatedAt_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *RiskRuleList + var obj *RiskListEntry // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetHasMore() // Should return zero value + _ = obj.GetCreatedAt() // Should return zero value }) } -func TestSettersMarkExplicitRiskRuleList(t *testing.T) { +func TestSettersMarkExplicitRiskListEntry(t *testing.T) { t.Run("SetObject_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskRuleList{} - var fernTestValueObject RiskRuleListObject + obj := &RiskListEntry{} + var fernTestValueObject RiskListEntryObject // Act obj.SetObject(fernTestValueObject) @@ -76441,14 +75636,14 @@ func TestSettersMarkExplicitRiskRuleList(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetData_MarksExplicit", func(t *testing.T) { + t.Run("SetID_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskRuleList{} - var fernTestValueData []*RiskRule + obj := &RiskListEntry{} + var fernTestValueID string // Act - obj.SetData(fernTestValueData) + obj.SetID(fernTestValueID) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -76472,14 +75667,14 @@ func TestSettersMarkExplicitRiskRuleList(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetHasMore_MarksExplicit", func(t *testing.T) { + t.Run("SetList_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskRuleList{} - var fernTestValueHasMore bool + obj := &RiskListEntry{} + var fernTestValueList RiskList // Act - obj.SetHasMore(fernTestValueHasMore) + obj.SetList(fernTestValueList) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -76503,321 +75698,14 @@ func TestSettersMarkExplicitRiskRuleList(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) -} - -func TestSettersRiskSettings(t *testing.T) { - t.Run("SetObject", func(t *testing.T) { - obj := &RiskSettings{} - var fernTestValueObject RiskSettingsObject - obj.SetObject(fernTestValueObject) - assert.Equal(t, fernTestValueObject, obj.Object) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetReviewThreshold", func(t *testing.T) { - obj := &RiskSettings{} - var fernTestValueReviewThreshold float64 - obj.SetReviewThreshold(fernTestValueReviewThreshold) - assert.Equal(t, fernTestValueReviewThreshold, obj.ReviewThreshold) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetBlockThreshold", func(t *testing.T) { - obj := &RiskSettings{} - var fernTestValueBlockThreshold float64 - obj.SetBlockThreshold(fernTestValueBlockThreshold) - assert.Equal(t, fernTestValueBlockThreshold, obj.BlockThreshold) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetDisabledReasons", func(t *testing.T) { - obj := &RiskSettings{} - var fernTestValueDisabledReasons []RiskSettingsDisabledReasonsItem - obj.SetDisabledReasons(fernTestValueDisabledReasons) - assert.Equal(t, fernTestValueDisabledReasons, obj.DisabledReasons) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetCaptcha", func(t *testing.T) { - obj := &RiskSettings{} - var fernTestValueCaptcha *RiskSettingsCaptcha - obj.SetCaptcha(fernTestValueCaptcha) - assert.Equal(t, fernTestValueCaptcha, obj.Captcha) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetContentThresholds", func(t *testing.T) { - obj := &RiskSettings{} - var fernTestValueContentThresholds *RiskSettingsContentThresholds - obj.SetContentThresholds(fernTestValueContentThresholds) - assert.Equal(t, fernTestValueContentThresholds, obj.ContentThresholds) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetReasonWeights", func(t *testing.T) { - obj := &RiskSettings{} - var fernTestValueReasonWeights *RiskSettingsReasonWeights - obj.SetReasonWeights(fernTestValueReasonWeights) - assert.Equal(t, fernTestValueReasonWeights, obj.ReasonWeights) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetUpdatedAt", func(t *testing.T) { - obj := &RiskSettings{} - var fernTestValueUpdatedAt *time.Time - obj.SetUpdatedAt(fernTestValueUpdatedAt) - assert.Equal(t, fernTestValueUpdatedAt, obj.UpdatedAt) - assert.NotNil(t, obj.explicitFields) - }) - -} - -func TestGettersRiskSettings(t *testing.T) { - t.Run("GetObject", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &RiskSettings{} - var expected RiskSettingsObject - obj.Object = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetObject(), "getter should return the property value") - }) - - t.Run("GetObject_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *RiskSettings - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetObject() // Should return zero value - }) - - t.Run("GetReviewThreshold", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &RiskSettings{} - var expected float64 - obj.ReviewThreshold = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetReviewThreshold(), "getter should return the property value") - }) - - t.Run("GetReviewThreshold_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *RiskSettings - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetReviewThreshold() // Should return zero value - }) - - t.Run("GetBlockThreshold", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &RiskSettings{} - var expected float64 - obj.BlockThreshold = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetBlockThreshold(), "getter should return the property value") - }) - - t.Run("GetBlockThreshold_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *RiskSettings - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetBlockThreshold() // Should return zero value - }) - - t.Run("GetDisabledReasons", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &RiskSettings{} - var expected []RiskSettingsDisabledReasonsItem - obj.DisabledReasons = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetDisabledReasons(), "getter should return the property value") - }) - - t.Run("GetDisabledReasons_NilValue", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &RiskSettings{} - obj.DisabledReasons = nil - - // Act & Assert - assert.Nil(t, obj.GetDisabledReasons(), "getter should return nil when property is nil") - }) - - t.Run("GetDisabledReasons_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *RiskSettings - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetDisabledReasons() // Should return zero value - }) - - t.Run("GetCaptcha", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &RiskSettings{} - var expected *RiskSettingsCaptcha - obj.Captcha = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetCaptcha(), "getter should return the property value") - }) - - t.Run("GetCaptcha_NilValue", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &RiskSettings{} - obj.Captcha = nil - - // Act & Assert - assert.Nil(t, obj.GetCaptcha(), "getter should return nil when property is nil") - }) - - t.Run("GetCaptcha_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *RiskSettings - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetCaptcha() // Should return zero value - }) - - t.Run("GetContentThresholds", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &RiskSettings{} - var expected *RiskSettingsContentThresholds - obj.ContentThresholds = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetContentThresholds(), "getter should return the property value") - }) - - t.Run("GetContentThresholds_NilValue", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &RiskSettings{} - obj.ContentThresholds = nil - - // Act & Assert - assert.Nil(t, obj.GetContentThresholds(), "getter should return nil when property is nil") - }) - - t.Run("GetContentThresholds_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *RiskSettings - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetContentThresholds() // Should return zero value - }) - - t.Run("GetReasonWeights", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &RiskSettings{} - var expected *RiskSettingsReasonWeights - obj.ReasonWeights = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetReasonWeights(), "getter should return the property value") - }) - - t.Run("GetReasonWeights_NilValue", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &RiskSettings{} - obj.ReasonWeights = nil - - // Act & Assert - assert.Nil(t, obj.GetReasonWeights(), "getter should return nil when property is nil") - }) - - t.Run("GetReasonWeights_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *RiskSettings - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetReasonWeights() // Should return zero value - }) - - t.Run("GetUpdatedAt", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &RiskSettings{} - var expected *time.Time - obj.UpdatedAt = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetUpdatedAt(), "getter should return the property value") - }) - - t.Run("GetUpdatedAt_NilValue", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &RiskSettings{} - obj.UpdatedAt = nil - - // Act & Assert - assert.Nil(t, obj.GetUpdatedAt(), "getter should return nil when property is nil") - }) - - t.Run("GetUpdatedAt_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *RiskSettings - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetUpdatedAt() // Should return zero value - }) - -} - -func TestSettersMarkExplicitRiskSettings(t *testing.T) { - t.Run("SetObject_MarksExplicit", func(t *testing.T) { + t.Run("SetType_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskSettings{} - var fernTestValueObject RiskSettingsObject + obj := &RiskListEntry{} + var fernTestValueType RiskListEntryType // Act - obj.SetObject(fernTestValueObject) + obj.SetType(fernTestValueType) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -76841,14 +75729,14 @@ func TestSettersMarkExplicitRiskSettings(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetReviewThreshold_MarksExplicit", func(t *testing.T) { + t.Run("SetValue_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskSettings{} - var fernTestValueReviewThreshold float64 + obj := &RiskListEntry{} + var fernTestValueValue string // Act - obj.SetReviewThreshold(fernTestValueReviewThreshold) + obj.SetValue(fernTestValueValue) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -76872,14 +75760,14 @@ func TestSettersMarkExplicitRiskSettings(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetBlockThreshold_MarksExplicit", func(t *testing.T) { + t.Run("SetNote_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskSettings{} - var fernTestValueBlockThreshold float64 + obj := &RiskListEntry{} + var fernTestValueNote *string // Act - obj.SetBlockThreshold(fernTestValueBlockThreshold) + obj.SetNote(fernTestValueNote) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -76903,14 +75791,14 @@ func TestSettersMarkExplicitRiskSettings(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetDisabledReasons_MarksExplicit", func(t *testing.T) { + t.Run("SetExpiresAt_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskSettings{} - var fernTestValueDisabledReasons []RiskSettingsDisabledReasonsItem + obj := &RiskListEntry{} + var fernTestValueExpiresAt *time.Time // Act - obj.SetDisabledReasons(fernTestValueDisabledReasons) + obj.SetExpiresAt(fernTestValueExpiresAt) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -76934,14 +75822,14 @@ func TestSettersMarkExplicitRiskSettings(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetCaptcha_MarksExplicit", func(t *testing.T) { + t.Run("SetCreatedAt_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskSettings{} - var fernTestValueCaptcha *RiskSettingsCaptcha + obj := &RiskListEntry{} + var fernTestValueCreatedAt time.Time // Act - obj.SetCaptcha(fernTestValueCaptcha) + obj.SetCreatedAt(fernTestValueCreatedAt) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -76965,14 +75853,126 @@ func TestSettersMarkExplicitRiskSettings(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetContentThresholds_MarksExplicit", func(t *testing.T) { +} + +func TestSettersRiskListEntryList(t *testing.T) { + t.Run("SetObject", func(t *testing.T) { + obj := &RiskListEntryList{} + var fernTestValueObject RiskListEntryListObject + obj.SetObject(fernTestValueObject) + assert.Equal(t, fernTestValueObject, obj.Object) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetData", func(t *testing.T) { + obj := &RiskListEntryList{} + var fernTestValueData []*RiskListEntry + obj.SetData(fernTestValueData) + assert.Equal(t, fernTestValueData, obj.Data) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetHasMore", func(t *testing.T) { + obj := &RiskListEntryList{} + var fernTestValueHasMore bool + obj.SetHasMore(fernTestValueHasMore) + assert.Equal(t, fernTestValueHasMore, obj.HasMore) + assert.NotNil(t, obj.explicitFields) + }) + +} + +func TestGettersRiskListEntryList(t *testing.T) { + t.Run("GetObject", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskSettings{} - var fernTestValueContentThresholds *RiskSettingsContentThresholds + obj := &RiskListEntryList{} + var expected RiskListEntryListObject + obj.Object = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetObject(), "getter should return the property value") + }) + + t.Run("GetObject_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *RiskListEntryList + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetObject() // Should return zero value + }) + + t.Run("GetData", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskListEntryList{} + var expected []*RiskListEntry + obj.Data = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetData(), "getter should return the property value") + }) + + t.Run("GetData_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskListEntryList{} + obj.Data = nil + + // Act & Assert + assert.Nil(t, obj.GetData(), "getter should return nil when property is nil") + }) + + t.Run("GetData_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *RiskListEntryList + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetData() // Should return zero value + }) + + t.Run("GetHasMore", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskListEntryList{} + var expected bool + obj.HasMore = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetHasMore(), "getter should return the property value") + }) + + t.Run("GetHasMore_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *RiskListEntryList + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetHasMore() // Should return zero value + }) + +} + +func TestSettersMarkExplicitRiskListEntryList(t *testing.T) { + t.Run("SetObject_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskListEntryList{} + var fernTestValueObject RiskListEntryListObject // Act - obj.SetContentThresholds(fernTestValueContentThresholds) + obj.SetObject(fernTestValueObject) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -76996,14 +75996,14 @@ func TestSettersMarkExplicitRiskSettings(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetReasonWeights_MarksExplicit", func(t *testing.T) { + t.Run("SetData_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskSettings{} - var fernTestValueReasonWeights *RiskSettingsReasonWeights + obj := &RiskListEntryList{} + var fernTestValueData []*RiskListEntry // Act - obj.SetReasonWeights(fernTestValueReasonWeights) + obj.SetData(fernTestValueData) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -77027,14 +76027,14 @@ func TestSettersMarkExplicitRiskSettings(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetUpdatedAt_MarksExplicit", func(t *testing.T) { + t.Run("SetHasMore_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskSettings{} - var fernTestValueUpdatedAt *time.Time + obj := &RiskListEntryList{} + var fernTestValueHasMore bool // Act - obj.SetUpdatedAt(fernTestValueUpdatedAt) + obj.SetHasMore(fernTestValueHasMore) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -77060,83 +76060,83 @@ func TestSettersMarkExplicitRiskSettings(t *testing.T) { } -func TestSettersRiskSettingsCaptcha(t *testing.T) { - t.Run("SetProvider", func(t *testing.T) { - obj := &RiskSettingsCaptcha{} - var fernTestValueProvider RiskSettingsCaptchaProvider - obj.SetProvider(fernTestValueProvider) - assert.Equal(t, fernTestValueProvider, obj.Provider) +func TestSettersRiskLoginSignals(t *testing.T) { + t.Run("SetNewCountry", func(t *testing.T) { + obj := &RiskLoginSignals{} + var fernTestValueNewCountry bool + obj.SetNewCountry(fernTestValueNewCountry) + assert.Equal(t, fernTestValueNewCountry, obj.NewCountry) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetRequired", func(t *testing.T) { - obj := &RiskSettingsCaptcha{} - var fernTestValueRequired bool - obj.SetRequired(fernTestValueRequired) - assert.Equal(t, fernTestValueRequired, obj.Required) + t.Run("SetNewNetwork", func(t *testing.T) { + obj := &RiskLoginSignals{} + var fernTestValueNewNetwork bool + obj.SetNewNetwork(fernTestValueNewNetwork) + assert.Equal(t, fernTestValueNewNetwork, obj.NewNetwork) assert.NotNil(t, obj.explicitFields) }) } -func TestGettersRiskSettingsCaptcha(t *testing.T) { - t.Run("GetProvider", func(t *testing.T) { +func TestGettersRiskLoginSignals(t *testing.T) { + t.Run("GetNewCountry", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskSettingsCaptcha{} - var expected RiskSettingsCaptchaProvider - obj.Provider = expected + obj := &RiskLoginSignals{} + var expected bool + obj.NewCountry = expected // Act & Assert - assert.Equal(t, expected, obj.GetProvider(), "getter should return the property value") + assert.Equal(t, expected, obj.GetNewCountry(), "getter should return the property value") }) - t.Run("GetProvider_NilReceiver", func(t *testing.T) { + t.Run("GetNewCountry_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *RiskSettingsCaptcha + var obj *RiskLoginSignals // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetProvider() // Should return zero value + _ = obj.GetNewCountry() // Should return zero value }) - t.Run("GetRequired", func(t *testing.T) { + t.Run("GetNewNetwork", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskSettingsCaptcha{} + obj := &RiskLoginSignals{} var expected bool - obj.Required = expected + obj.NewNetwork = expected // Act & Assert - assert.Equal(t, expected, obj.GetRequired(), "getter should return the property value") + assert.Equal(t, expected, obj.GetNewNetwork(), "getter should return the property value") }) - t.Run("GetRequired_NilReceiver", func(t *testing.T) { + t.Run("GetNewNetwork_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *RiskSettingsCaptcha + var obj *RiskLoginSignals // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetRequired() // Should return zero value + _ = obj.GetNewNetwork() // Should return zero value }) } -func TestSettersMarkExplicitRiskSettingsCaptcha(t *testing.T) { - t.Run("SetProvider_MarksExplicit", func(t *testing.T) { +func TestSettersMarkExplicitRiskLoginSignals(t *testing.T) { + t.Run("SetNewCountry_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskSettingsCaptcha{} - var fernTestValueProvider RiskSettingsCaptchaProvider + obj := &RiskLoginSignals{} + var fernTestValueNewCountry bool // Act - obj.SetProvider(fernTestValueProvider) + obj.SetNewCountry(fernTestValueNewCountry) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -77160,14 +76160,14 @@ func TestSettersMarkExplicitRiskSettingsCaptcha(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetRequired_MarksExplicit", func(t *testing.T) { + t.Run("SetNewNetwork_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskSettingsCaptcha{} - var fernTestValueRequired bool + obj := &RiskLoginSignals{} + var fernTestValueNewNetwork bool // Act - obj.SetRequired(fernTestValueRequired) + obj.SetNewNetwork(fernTestValueNewNetwork) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -77193,185 +76193,534 @@ func TestSettersMarkExplicitRiskSettingsCaptcha(t *testing.T) { } -func TestSettersRiskSettingsContentThresholds(t *testing.T) { - t.Run("SetSpam", func(t *testing.T) { - obj := &RiskSettingsContentThresholds{} - var fernTestValueSpam *float64 - obj.SetSpam(fernTestValueSpam) - assert.Equal(t, fernTestValueSpam, obj.Spam) +func TestSettersRiskReason(t *testing.T) { + t.Run("SetCode", func(t *testing.T) { + obj := &RiskReason{} + var fernTestValueCode RiskReasonCode + obj.SetCode(fernTestValueCode) + assert.Equal(t, fernTestValueCode, obj.Code) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetPhishing", func(t *testing.T) { - obj := &RiskSettingsContentThresholds{} - var fernTestValuePhishing *float64 - obj.SetPhishing(fernTestValuePhishing) - assert.Equal(t, fernTestValuePhishing, obj.Phishing) + t.Run("SetMessage", func(t *testing.T) { + obj := &RiskReason{} + var fernTestValueMessage string + obj.SetMessage(fernTestValueMessage) + assert.Equal(t, fernTestValueMessage, obj.Message) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetMalware", func(t *testing.T) { - obj := &RiskSettingsContentThresholds{} - var fernTestValueMalware *float64 - obj.SetMalware(fernTestValueMalware) - assert.Equal(t, fernTestValueMalware, obj.Malware) + t.Run("SetValue", func(t *testing.T) { + obj := &RiskReason{} + var fernTestValueValue *float64 + obj.SetValue(fernTestValueValue) + assert.Equal(t, fernTestValueValue, obj.Value) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetFraud", func(t *testing.T) { - obj := &RiskSettingsContentThresholds{} - var fernTestValueFraud *float64 - obj.SetFraud(fernTestValueFraud) - assert.Equal(t, fernTestValueFraud, obj.Fraud) + t.Run("SetThreshold", func(t *testing.T) { + obj := &RiskReason{} + var fernTestValueThreshold *float64 + obj.SetThreshold(fernTestValueThreshold) + assert.Equal(t, fernTestValueThreshold, obj.Threshold) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetWindow", func(t *testing.T) { + obj := &RiskReason{} + var fernTestValueWindow *RiskReasonWindow + obj.SetWindow(fernTestValueWindow) + assert.Equal(t, fernTestValueWindow, obj.Window) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetSuggestion", func(t *testing.T) { + obj := &RiskReason{} + var fernTestValueSuggestion *string + obj.SetSuggestion(fernTestValueSuggestion) + assert.Equal(t, fernTestValueSuggestion, obj.Suggestion) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetProvider", func(t *testing.T) { + obj := &RiskReason{} + var fernTestValueProvider *string + obj.SetProvider(fernTestValueProvider) + assert.Equal(t, fernTestValueProvider, obj.Provider) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetPreviousUser", func(t *testing.T) { + obj := &RiskReason{} + var fernTestValuePreviousUser *string + obj.SetPreviousUser(fernTestValuePreviousUser) + assert.Equal(t, fernTestValuePreviousUser, obj.PreviousUser) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetPreviousAssessment", func(t *testing.T) { + obj := &RiskReason{} + var fernTestValuePreviousAssessment *string + obj.SetPreviousAssessment(fernTestValuePreviousAssessment) + assert.Equal(t, fernTestValuePreviousAssessment, obj.PreviousAssessment) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetEntry", func(t *testing.T) { + obj := &RiskReason{} + var fernTestValueEntry *string + obj.SetEntry(fernTestValueEntry) + assert.Equal(t, fernTestValueEntry, obj.Entry) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetRule", func(t *testing.T) { + obj := &RiskReason{} + var fernTestValueRule *string + obj.SetRule(fernTestValueRule) + assert.Equal(t, fernTestValueRule, obj.Rule) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetName", func(t *testing.T) { + obj := &RiskReason{} + var fernTestValueName *string + obj.SetName(fernTestValueName) + assert.Equal(t, fernTestValueName, obj.Name) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetType", func(t *testing.T) { + obj := &RiskReason{} + var fernTestValueType *RiskReasonType + obj.SetType(fernTestValueType) + assert.Equal(t, fernTestValueType, obj.Type) assert.NotNil(t, obj.explicitFields) }) } -func TestGettersRiskSettingsContentThresholds(t *testing.T) { - t.Run("GetSpam", func(t *testing.T) { +func TestGettersRiskReason(t *testing.T) { + t.Run("GetCode", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskSettingsContentThresholds{} - var expected *float64 - obj.Spam = expected + obj := &RiskReason{} + var expected RiskReasonCode + obj.Code = expected // Act & Assert - assert.Equal(t, expected, obj.GetSpam(), "getter should return the property value") + assert.Equal(t, expected, obj.GetCode(), "getter should return the property value") }) - t.Run("GetSpam_NilValue", func(t *testing.T) { + t.Run("GetCode_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *RiskReason + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetCode() // Should return zero value + }) + + t.Run("GetMessage", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskSettingsContentThresholds{} - obj.Spam = nil + obj := &RiskReason{} + var expected string + obj.Message = expected // Act & Assert - assert.Nil(t, obj.GetSpam(), "getter should return nil when property is nil") + assert.Equal(t, expected, obj.GetMessage(), "getter should return the property value") }) - t.Run("GetSpam_NilReceiver", func(t *testing.T) { + t.Run("GetMessage_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *RiskSettingsContentThresholds + var obj *RiskReason // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetSpam() // Should return zero value + _ = obj.GetMessage() // Should return zero value }) - t.Run("GetPhishing", func(t *testing.T) { + t.Run("GetValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskSettingsContentThresholds{} + obj := &RiskReason{} var expected *float64 - obj.Phishing = expected + obj.Value = expected // Act & Assert - assert.Equal(t, expected, obj.GetPhishing(), "getter should return the property value") + assert.Equal(t, expected, obj.GetValue(), "getter should return the property value") }) - t.Run("GetPhishing_NilValue", func(t *testing.T) { + t.Run("GetValue_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskSettingsContentThresholds{} - obj.Phishing = nil + obj := &RiskReason{} + obj.Value = nil // Act & Assert - assert.Nil(t, obj.GetPhishing(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetValue(), "getter should return nil when property is nil") }) - t.Run("GetPhishing_NilReceiver", func(t *testing.T) { + t.Run("GetValue_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *RiskSettingsContentThresholds + var obj *RiskReason // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetPhishing() // Should return zero value + _ = obj.GetValue() // Should return zero value }) - t.Run("GetMalware", func(t *testing.T) { + t.Run("GetThreshold", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskSettingsContentThresholds{} + obj := &RiskReason{} var expected *float64 - obj.Malware = expected + obj.Threshold = expected // Act & Assert - assert.Equal(t, expected, obj.GetMalware(), "getter should return the property value") + assert.Equal(t, expected, obj.GetThreshold(), "getter should return the property value") }) - t.Run("GetMalware_NilValue", func(t *testing.T) { + t.Run("GetThreshold_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskSettingsContentThresholds{} - obj.Malware = nil + obj := &RiskReason{} + obj.Threshold = nil // Act & Assert - assert.Nil(t, obj.GetMalware(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetThreshold(), "getter should return nil when property is nil") }) - t.Run("GetMalware_NilReceiver", func(t *testing.T) { + t.Run("GetThreshold_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *RiskSettingsContentThresholds + var obj *RiskReason // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetMalware() // Should return zero value + _ = obj.GetThreshold() // Should return zero value }) - t.Run("GetFraud", func(t *testing.T) { + t.Run("GetWindow", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskSettingsContentThresholds{} - var expected *float64 - obj.Fraud = expected + obj := &RiskReason{} + var expected *RiskReasonWindow + obj.Window = expected // Act & Assert - assert.Equal(t, expected, obj.GetFraud(), "getter should return the property value") + assert.Equal(t, expected, obj.GetWindow(), "getter should return the property value") }) - t.Run("GetFraud_NilValue", func(t *testing.T) { + t.Run("GetWindow_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskSettingsContentThresholds{} - obj.Fraud = nil + obj := &RiskReason{} + obj.Window = nil // Act & Assert - assert.Nil(t, obj.GetFraud(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetWindow(), "getter should return nil when property is nil") }) - t.Run("GetFraud_NilReceiver", func(t *testing.T) { + t.Run("GetWindow_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *RiskSettingsContentThresholds + var obj *RiskReason // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetFraud() // Should return zero value + _ = obj.GetWindow() // Should return zero value + }) + + t.Run("GetSuggestion", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskReason{} + var expected *string + obj.Suggestion = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetSuggestion(), "getter should return the property value") + }) + + t.Run("GetSuggestion_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskReason{} + obj.Suggestion = nil + + // Act & Assert + assert.Nil(t, obj.GetSuggestion(), "getter should return nil when property is nil") + }) + + t.Run("GetSuggestion_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *RiskReason + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetSuggestion() // Should return zero value + }) + + t.Run("GetProvider", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskReason{} + var expected *string + obj.Provider = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetProvider(), "getter should return the property value") + }) + + t.Run("GetProvider_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskReason{} + obj.Provider = nil + + // Act & Assert + assert.Nil(t, obj.GetProvider(), "getter should return nil when property is nil") + }) + + t.Run("GetProvider_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *RiskReason + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetProvider() // Should return zero value + }) + + t.Run("GetPreviousUser", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskReason{} + var expected *string + obj.PreviousUser = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetPreviousUser(), "getter should return the property value") + }) + + t.Run("GetPreviousUser_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskReason{} + obj.PreviousUser = nil + + // Act & Assert + assert.Nil(t, obj.GetPreviousUser(), "getter should return nil when property is nil") + }) + + t.Run("GetPreviousUser_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *RiskReason + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetPreviousUser() // Should return zero value + }) + + t.Run("GetPreviousAssessment", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskReason{} + var expected *string + obj.PreviousAssessment = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetPreviousAssessment(), "getter should return the property value") + }) + + t.Run("GetPreviousAssessment_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskReason{} + obj.PreviousAssessment = nil + + // Act & Assert + assert.Nil(t, obj.GetPreviousAssessment(), "getter should return nil when property is nil") + }) + + t.Run("GetPreviousAssessment_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *RiskReason + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetPreviousAssessment() // Should return zero value + }) + + t.Run("GetEntry", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskReason{} + var expected *string + obj.Entry = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetEntry(), "getter should return the property value") + }) + + t.Run("GetEntry_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskReason{} + obj.Entry = nil + + // Act & Assert + assert.Nil(t, obj.GetEntry(), "getter should return nil when property is nil") + }) + + t.Run("GetEntry_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *RiskReason + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetEntry() // Should return zero value + }) + + t.Run("GetRule", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskReason{} + var expected *string + obj.Rule = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetRule(), "getter should return the property value") + }) + + t.Run("GetRule_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskReason{} + obj.Rule = nil + + // Act & Assert + assert.Nil(t, obj.GetRule(), "getter should return nil when property is nil") + }) + + t.Run("GetRule_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *RiskReason + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetRule() // Should return zero value + }) + + t.Run("GetName", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskReason{} + var expected *string + obj.Name = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetName(), "getter should return the property value") + }) + + t.Run("GetName_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskReason{} + obj.Name = nil + + // Act & Assert + assert.Nil(t, obj.GetName(), "getter should return nil when property is nil") + }) + + t.Run("GetName_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *RiskReason + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetName() // Should return zero value + }) + + t.Run("GetType", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskReason{} + var expected *RiskReasonType + obj.Type = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetType(), "getter should return the property value") + }) + + t.Run("GetType_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskReason{} + obj.Type = nil + + // Act & Assert + assert.Nil(t, obj.GetType(), "getter should return nil when property is nil") + }) + + t.Run("GetType_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *RiskReason + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetType() // Should return zero value }) } -func TestSettersMarkExplicitRiskSettingsContentThresholds(t *testing.T) { - t.Run("SetSpam_MarksExplicit", func(t *testing.T) { +func TestSettersMarkExplicitRiskReason(t *testing.T) { + t.Run("SetCode_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskSettingsContentThresholds{} - var fernTestValueSpam *float64 + obj := &RiskReason{} + var fernTestValueCode RiskReasonCode // Act - obj.SetSpam(fernTestValueSpam) + obj.SetCode(fernTestValueCode) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -77395,14 +76744,14 @@ func TestSettersMarkExplicitRiskSettingsContentThresholds(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetPhishing_MarksExplicit", func(t *testing.T) { + t.Run("SetMessage_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskSettingsContentThresholds{} - var fernTestValuePhishing *float64 + obj := &RiskReason{} + var fernTestValueMessage string // Act - obj.SetPhishing(fernTestValuePhishing) + obj.SetMessage(fernTestValueMessage) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -77426,14 +76775,14 @@ func TestSettersMarkExplicitRiskSettingsContentThresholds(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetMalware_MarksExplicit", func(t *testing.T) { + t.Run("SetValue_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskSettingsContentThresholds{} - var fernTestValueMalware *float64 + obj := &RiskReason{} + var fernTestValueValue *float64 // Act - obj.SetMalware(fernTestValueMalware) + obj.SetValue(fernTestValueValue) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -77457,14 +76806,14 @@ func TestSettersMarkExplicitRiskSettingsContentThresholds(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetFraud_MarksExplicit", func(t *testing.T) { + t.Run("SetThreshold_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskSettingsContentThresholds{} - var fernTestValueFraud *float64 + obj := &RiskReason{} + var fernTestValueThreshold *float64 // Act - obj.SetFraud(fernTestValueFraud) + obj.SetThreshold(fernTestValueThreshold) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -77488,1950 +76837,1826 @@ func TestSettersMarkExplicitRiskSettingsContentThresholds(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) -} + t.Run("SetWindow_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskReason{} + var fernTestValueWindow *RiskReasonWindow -func TestSettersRiskSettingsReasonWeights(t *testing.T) { - t.Run("SetEmailInvalid", func(t *testing.T) { - obj := &RiskSettingsReasonWeights{} - var fernTestValueEmailInvalid *float64 - obj.SetEmailInvalid(fernTestValueEmailInvalid) - assert.Equal(t, fernTestValueEmailInvalid, obj.EmailInvalid) - assert.NotNil(t, obj.explicitFields) - }) + // Act + obj.SetWindow(fernTestValueWindow) - t.Run("SetEmailDisposable", func(t *testing.T) { - obj := &RiskSettingsReasonWeights{} - var fernTestValueEmailDisposable *float64 - obj.SetEmailDisposable(fernTestValueEmailDisposable) - assert.Equal(t, fernTestValueEmailDisposable, obj.EmailDisposable) - assert.NotNil(t, obj.explicitFields) - }) + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") - t.Run("SetEmailUndeliverable", func(t *testing.T) { - obj := &RiskSettingsReasonWeights{} - var fernTestValueEmailUndeliverable *float64 - obj.SetEmailUndeliverable(fernTestValueEmailUndeliverable) - assert.Equal(t, fernTestValueEmailUndeliverable, obj.EmailUndeliverable) - assert.NotNil(t, obj.explicitFields) - }) + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } - t.Run("SetEmailRoleAccount", func(t *testing.T) { - obj := &RiskSettingsReasonWeights{} - var fernTestValueEmailRoleAccount *float64 - obj.SetEmailRoleAccount(fernTestValueEmailRoleAccount) - assert.Equal(t, fernTestValueEmailRoleAccount, obj.EmailRoleAccount) - assert.NotNil(t, obj.explicitFields) + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetEmailTypo", func(t *testing.T) { - obj := &RiskSettingsReasonWeights{} - var fernTestValueEmailTypo *float64 - obj.SetEmailTypo(fernTestValueEmailTypo) - assert.Equal(t, fernTestValueEmailTypo, obj.EmailTypo) - assert.NotNil(t, obj.explicitFields) - }) + t.Run("SetSuggestion_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskReason{} + var fernTestValueSuggestion *string - t.Run("SetEmailDomainNew", func(t *testing.T) { - obj := &RiskSettingsReasonWeights{} - var fernTestValueEmailDomainNew *float64 - obj.SetEmailDomainNew(fernTestValueEmailDomainNew) - assert.Equal(t, fernTestValueEmailDomainNew, obj.EmailDomainNew) - assert.NotNil(t, obj.explicitFields) - }) + // Act + obj.SetSuggestion(fernTestValueSuggestion) - t.Run("SetIPTor", func(t *testing.T) { - obj := &RiskSettingsReasonWeights{} - var fernTestValueIPTor *float64 - obj.SetIPTor(fernTestValueIPTor) - assert.Equal(t, fernTestValueIPTor, obj.IPTor) - assert.NotNil(t, obj.explicitFields) - }) + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") - t.Run("SetIPVpnNetwork", func(t *testing.T) { - obj := &RiskSettingsReasonWeights{} - var fernTestValueIPVpnNetwork *float64 - obj.SetIPVpnNetwork(fernTestValueIPVpnNetwork) - assert.Equal(t, fernTestValueIPVpnNetwork, obj.IPVpnNetwork) - assert.NotNil(t, obj.explicitFields) - }) + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } - t.Run("SetIPHostingProvider", func(t *testing.T) { - obj := &RiskSettingsReasonWeights{} - var fernTestValueIPHostingProvider *float64 - obj.SetIPHostingProvider(fernTestValueIPHostingProvider) - assert.Equal(t, fernTestValueIPHostingProvider, obj.IPHostingProvider) - assert.NotNil(t, obj.explicitFields) + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetIPVpn", func(t *testing.T) { - obj := &RiskSettingsReasonWeights{} - var fernTestValueIPVpn *float64 - obj.SetIPVpn(fernTestValueIPVpn) - assert.Equal(t, fernTestValueIPVpn, obj.IPVpn) - assert.NotNil(t, obj.explicitFields) - }) + t.Run("SetProvider_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskReason{} + var fernTestValueProvider *string - t.Run("SetIPProxy", func(t *testing.T) { - obj := &RiskSettingsReasonWeights{} - var fernTestValueIPProxy *float64 - obj.SetIPProxy(fernTestValueIPProxy) - assert.Equal(t, fernTestValueIPProxy, obj.IPProxy) - assert.NotNil(t, obj.explicitFields) - }) + // Act + obj.SetProvider(fernTestValueProvider) - t.Run("SetIPRelay", func(t *testing.T) { - obj := &RiskSettingsReasonWeights{} - var fernTestValueIPRelay *float64 - obj.SetIPRelay(fernTestValueIPRelay) - assert.Equal(t, fernTestValueIPRelay, obj.IPRelay) - assert.NotNil(t, obj.explicitFields) - }) + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") - t.Run("SetIPPrivate", func(t *testing.T) { - obj := &RiskSettingsReasonWeights{} - var fernTestValueIPPrivate *float64 - obj.SetIPPrivate(fernTestValueIPPrivate) - assert.Equal(t, fernTestValueIPPrivate, obj.IPPrivate) - assert.NotNil(t, obj.explicitFields) - }) + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } - t.Run("SetVelocitySignupsPerIP1H", func(t *testing.T) { - obj := &RiskSettingsReasonWeights{} - var fernTestValueVelocitySignupsPerIP1H *float64 - obj.SetVelocitySignupsPerIP1H(fernTestValueVelocitySignupsPerIP1H) - assert.Equal(t, fernTestValueVelocitySignupsPerIP1H, obj.VelocitySignupsPerIP1H) - assert.NotNil(t, obj.explicitFields) + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetVelocitySignupsPerIP24H", func(t *testing.T) { - obj := &RiskSettingsReasonWeights{} - var fernTestValueVelocitySignupsPerIP24H *float64 - obj.SetVelocitySignupsPerIP24H(fernTestValueVelocitySignupsPerIP24H) - assert.Equal(t, fernTestValueVelocitySignupsPerIP24H, obj.VelocitySignupsPerIP24H) - assert.NotNil(t, obj.explicitFields) - }) + t.Run("SetPreviousUser_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskReason{} + var fernTestValuePreviousUser *string - t.Run("SetVelocitySignupsPerSubnet1H", func(t *testing.T) { - obj := &RiskSettingsReasonWeights{} - var fernTestValueVelocitySignupsPerSubnet1H *float64 - obj.SetVelocitySignupsPerSubnet1H(fernTestValueVelocitySignupsPerSubnet1H) - assert.Equal(t, fernTestValueVelocitySignupsPerSubnet1H, obj.VelocitySignupsPerSubnet1H) - assert.NotNil(t, obj.explicitFields) - }) + // Act + obj.SetPreviousUser(fernTestValuePreviousUser) - t.Run("SetVelocitySignupsPerEmailDomain1H", func(t *testing.T) { - obj := &RiskSettingsReasonWeights{} - var fernTestValueVelocitySignupsPerEmailDomain1H *float64 - obj.SetVelocitySignupsPerEmailDomain1H(fernTestValueVelocitySignupsPerEmailDomain1H) - assert.Equal(t, fernTestValueVelocitySignupsPerEmailDomain1H, obj.VelocitySignupsPerEmailDomain1H) - assert.NotNil(t, obj.explicitFields) - }) + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") - t.Run("SetVelocitySignupsPerMailbox24H", func(t *testing.T) { - obj := &RiskSettingsReasonWeights{} - var fernTestValueVelocitySignupsPerMailbox24H *float64 - obj.SetVelocitySignupsPerMailbox24H(fernTestValueVelocitySignupsPerMailbox24H) - assert.Equal(t, fernTestValueVelocitySignupsPerMailbox24H, obj.VelocitySignupsPerMailbox24H) - assert.NotNil(t, obj.explicitFields) - }) + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } - t.Run("SetVelocitySignupsPerDevice24H", func(t *testing.T) { - obj := &RiskSettingsReasonWeights{} - var fernTestValueVelocitySignupsPerDevice24H *float64 - obj.SetVelocitySignupsPerDevice24H(fernTestValueVelocitySignupsPerDevice24H) - assert.Equal(t, fernTestValueVelocitySignupsPerDevice24H, obj.VelocitySignupsPerDevice24H) - assert.NotNil(t, obj.explicitFields) + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetVelocityCheckoutsPerIP1H", func(t *testing.T) { - obj := &RiskSettingsReasonWeights{} - var fernTestValueVelocityCheckoutsPerIP1H *float64 - obj.SetVelocityCheckoutsPerIP1H(fernTestValueVelocityCheckoutsPerIP1H) - assert.Equal(t, fernTestValueVelocityCheckoutsPerIP1H, obj.VelocityCheckoutsPerIP1H) - assert.NotNil(t, obj.explicitFields) - }) + t.Run("SetPreviousAssessment_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskReason{} + var fernTestValuePreviousAssessment *string - t.Run("SetVelocityCheckoutsPerUser1H", func(t *testing.T) { - obj := &RiskSettingsReasonWeights{} - var fernTestValueVelocityCheckoutsPerUser1H *float64 - obj.SetVelocityCheckoutsPerUser1H(fernTestValueVelocityCheckoutsPerUser1H) - assert.Equal(t, fernTestValueVelocityCheckoutsPerUser1H, obj.VelocityCheckoutsPerUser1H) - assert.NotNil(t, obj.explicitFields) - }) + // Act + obj.SetPreviousAssessment(fernTestValuePreviousAssessment) - t.Run("SetVelocityCheckoutsPerCard24H", func(t *testing.T) { - obj := &RiskSettingsReasonWeights{} - var fernTestValueVelocityCheckoutsPerCard24H *float64 - obj.SetVelocityCheckoutsPerCard24H(fernTestValueVelocityCheckoutsPerCard24H) - assert.Equal(t, fernTestValueVelocityCheckoutsPerCard24H, obj.VelocityCheckoutsPerCard24H) - assert.NotNil(t, obj.explicitFields) - }) + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") - t.Run("SetVelocityLoginsPerIP1H", func(t *testing.T) { - obj := &RiskSettingsReasonWeights{} - var fernTestValueVelocityLoginsPerIP1H *float64 - obj.SetVelocityLoginsPerIP1H(fernTestValueVelocityLoginsPerIP1H) - assert.Equal(t, fernTestValueVelocityLoginsPerIP1H, obj.VelocityLoginsPerIP1H) - assert.NotNil(t, obj.explicitFields) - }) + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } - t.Run("SetVelocityLoginsPerUser1H", func(t *testing.T) { - obj := &RiskSettingsReasonWeights{} - var fernTestValueVelocityLoginsPerUser1H *float64 - obj.SetVelocityLoginsPerUser1H(fernTestValueVelocityLoginsPerUser1H) - assert.Equal(t, fernTestValueVelocityLoginsPerUser1H, obj.VelocityLoginsPerUser1H) - assert.NotNil(t, obj.explicitFields) + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetVelocityEventsPerIP1H", func(t *testing.T) { - obj := &RiskSettingsReasonWeights{} - var fernTestValueVelocityEventsPerIP1H *float64 - obj.SetVelocityEventsPerIP1H(fernTestValueVelocityEventsPerIP1H) - assert.Equal(t, fernTestValueVelocityEventsPerIP1H, obj.VelocityEventsPerIP1H) - assert.NotNil(t, obj.explicitFields) - }) + t.Run("SetEntry_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskReason{} + var fernTestValueEntry *string - t.Run("SetVelocityEventsPerUser1H", func(t *testing.T) { - obj := &RiskSettingsReasonWeights{} - var fernTestValueVelocityEventsPerUser1H *float64 - obj.SetVelocityEventsPerUser1H(fernTestValueVelocityEventsPerUser1H) - assert.Equal(t, fernTestValueVelocityEventsPerUser1H, obj.VelocityEventsPerUser1H) - assert.NotNil(t, obj.explicitFields) - }) + // Act + obj.SetEntry(fernTestValueEntry) - t.Run("SetDuplicateCanonicalMailbox", func(t *testing.T) { - obj := &RiskSettingsReasonWeights{} - var fernTestValueDuplicateCanonicalMailbox *float64 - obj.SetDuplicateCanonicalMailbox(fernTestValueDuplicateCanonicalMailbox) - assert.Equal(t, fernTestValueDuplicateCanonicalMailbox, obj.DuplicateCanonicalMailbox) - assert.NotNil(t, obj.explicitFields) - }) + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") - t.Run("SetDuplicateDevice", func(t *testing.T) { - obj := &RiskSettingsReasonWeights{} - var fernTestValueDuplicateDevice *float64 - obj.SetDuplicateDevice(fernTestValueDuplicateDevice) - assert.Equal(t, fernTestValueDuplicateDevice, obj.DuplicateDevice) - assert.NotNil(t, obj.explicitFields) - }) + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } - t.Run("SetHistoryFraudMailbox", func(t *testing.T) { - obj := &RiskSettingsReasonWeights{} - var fernTestValueHistoryFraudMailbox *float64 - obj.SetHistoryFraudMailbox(fernTestValueHistoryFraudMailbox) - assert.Equal(t, fernTestValueHistoryFraudMailbox, obj.HistoryFraudMailbox) - assert.NotNil(t, obj.explicitFields) + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetHistoryFraudUser", func(t *testing.T) { - obj := &RiskSettingsReasonWeights{} - var fernTestValueHistoryFraudUser *float64 - obj.SetHistoryFraudUser(fernTestValueHistoryFraudUser) - assert.Equal(t, fernTestValueHistoryFraudUser, obj.HistoryFraudUser) - assert.NotNil(t, obj.explicitFields) - }) + t.Run("SetRule_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskReason{} + var fernTestValueRule *string - t.Run("SetHistoryFraudIP", func(t *testing.T) { - obj := &RiskSettingsReasonWeights{} - var fernTestValueHistoryFraudIP *float64 - obj.SetHistoryFraudIP(fernTestValueHistoryFraudIP) - assert.Equal(t, fernTestValueHistoryFraudIP, obj.HistoryFraudIP) - assert.NotNil(t, obj.explicitFields) - }) + // Act + obj.SetRule(fernTestValueRule) - t.Run("SetHistoryFraudSubnet", func(t *testing.T) { - obj := &RiskSettingsReasonWeights{} - var fernTestValueHistoryFraudSubnet *float64 - obj.SetHistoryFraudSubnet(fernTestValueHistoryFraudSubnet) - assert.Equal(t, fernTestValueHistoryFraudSubnet, obj.HistoryFraudSubnet) - assert.NotNil(t, obj.explicitFields) - }) + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") - t.Run("SetHistoryFraudCard", func(t *testing.T) { - obj := &RiskSettingsReasonWeights{} - var fernTestValueHistoryFraudCard *float64 - obj.SetHistoryFraudCard(fernTestValueHistoryFraudCard) - assert.Equal(t, fernTestValueHistoryFraudCard, obj.HistoryFraudCard) - assert.NotNil(t, obj.explicitFields) - }) + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } - t.Run("SetHistoryFraudDevice", func(t *testing.T) { - obj := &RiskSettingsReasonWeights{} - var fernTestValueHistoryFraudDevice *float64 - obj.SetHistoryFraudDevice(fernTestValueHistoryFraudDevice) - assert.Equal(t, fernTestValueHistoryFraudDevice, obj.HistoryFraudDevice) - assert.NotNil(t, obj.explicitFields) + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetCheckoutCardCountryMismatch", func(t *testing.T) { - obj := &RiskSettingsReasonWeights{} - var fernTestValueCheckoutCardCountryMismatch *float64 - obj.SetCheckoutCardCountryMismatch(fernTestValueCheckoutCardCountryMismatch) - assert.Equal(t, fernTestValueCheckoutCardCountryMismatch, obj.CheckoutCardCountryMismatch) - assert.NotNil(t, obj.explicitFields) + t.Run("SetName_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskReason{} + var fernTestValueName *string + + // Act + obj.SetName(fernTestValueName) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetCheckoutBillingCountryMismatch", func(t *testing.T) { - obj := &RiskSettingsReasonWeights{} - var fernTestValueCheckoutBillingCountryMismatch *float64 - obj.SetCheckoutBillingCountryMismatch(fernTestValueCheckoutBillingCountryMismatch) - assert.Equal(t, fernTestValueCheckoutBillingCountryMismatch, obj.CheckoutBillingCountryMismatch) - assert.NotNil(t, obj.explicitFields) + t.Run("SetType_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskReason{} + var fernTestValueType *RiskReasonType + + // Act + obj.SetType(fernTestValueType) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetCheckoutPrepaidCard", func(t *testing.T) { - obj := &RiskSettingsReasonWeights{} - var fernTestValueCheckoutPrepaidCard *float64 - obj.SetCheckoutPrepaidCard(fernTestValueCheckoutPrepaidCard) - assert.Equal(t, fernTestValueCheckoutPrepaidCard, obj.CheckoutPrepaidCard) +} + +func TestSettersRiskRule(t *testing.T) { + t.Run("SetObject", func(t *testing.T) { + obj := &RiskRule{} + var fernTestValueObject RiskRuleObject + obj.SetObject(fernTestValueObject) + assert.Equal(t, fernTestValueObject, obj.Object) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetDeviceAutomation", func(t *testing.T) { - obj := &RiskSettingsReasonWeights{} - var fernTestValueDeviceAutomation *float64 - obj.SetDeviceAutomation(fernTestValueDeviceAutomation) - assert.Equal(t, fernTestValueDeviceAutomation, obj.DeviceAutomation) + t.Run("SetID", func(t *testing.T) { + obj := &RiskRule{} + var fernTestValueID string + obj.SetID(fernTestValueID) + assert.Equal(t, fernTestValueID, obj.ID) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetDeviceInvalid", func(t *testing.T) { - obj := &RiskSettingsReasonWeights{} - var fernTestValueDeviceInvalid *float64 - obj.SetDeviceInvalid(fernTestValueDeviceInvalid) - assert.Equal(t, fernTestValueDeviceInvalid, obj.DeviceInvalid) + t.Run("SetName", func(t *testing.T) { + obj := &RiskRule{} + var fernTestValueName string + obj.SetName(fernTestValueName) + assert.Equal(t, fernTestValueName, obj.Name) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetLoginNewCountry", func(t *testing.T) { - obj := &RiskSettingsReasonWeights{} - var fernTestValueLoginNewCountry *float64 - obj.SetLoginNewCountry(fernTestValueLoginNewCountry) - assert.Equal(t, fernTestValueLoginNewCountry, obj.LoginNewCountry) + t.Run("SetEnabled", func(t *testing.T) { + obj := &RiskRule{} + var fernTestValueEnabled bool + obj.SetEnabled(fernTestValueEnabled) + assert.Equal(t, fernTestValueEnabled, obj.Enabled) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetLoginNewNetwork", func(t *testing.T) { - obj := &RiskSettingsReasonWeights{} - var fernTestValueLoginNewNetwork *float64 - obj.SetLoginNewNetwork(fernTestValueLoginNewNetwork) - assert.Equal(t, fernTestValueLoginNewNetwork, obj.LoginNewNetwork) + t.Run("SetPosition", func(t *testing.T) { + obj := &RiskRule{} + var fernTestValuePosition int64 + obj.SetPosition(fernTestValuePosition) + assert.Equal(t, fernTestValuePosition, obj.Position) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetCaptchaFailed", func(t *testing.T) { - obj := &RiskSettingsReasonWeights{} - var fernTestValueCaptchaFailed *float64 - obj.SetCaptchaFailed(fernTestValueCaptchaFailed) - assert.Equal(t, fernTestValueCaptchaFailed, obj.CaptchaFailed) + t.Run("SetEvents", func(t *testing.T) { + obj := &RiskRule{} + var fernTestValueEvents []RiskEvent + obj.SetEvents(fernTestValueEvents) + assert.Equal(t, fernTestValueEvents, obj.Events) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetCaptchaMissing", func(t *testing.T) { - obj := &RiskSettingsReasonWeights{} - var fernTestValueCaptchaMissing *float64 - obj.SetCaptchaMissing(fernTestValueCaptchaMissing) - assert.Equal(t, fernTestValueCaptchaMissing, obj.CaptchaMissing) + t.Run("SetMatch", func(t *testing.T) { + obj := &RiskRule{} + var fernTestValueMatch RiskRuleMatch + obj.SetMatch(fernTestValueMatch) + assert.Equal(t, fernTestValueMatch, obj.Match) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetContentSpam", func(t *testing.T) { - obj := &RiskSettingsReasonWeights{} - var fernTestValueContentSpam *float64 - obj.SetContentSpam(fernTestValueContentSpam) - assert.Equal(t, fernTestValueContentSpam, obj.ContentSpam) + t.Run("SetConditions", func(t *testing.T) { + obj := &RiskRule{} + var fernTestValueConditions []*RiskRuleCondition + obj.SetConditions(fernTestValueConditions) + assert.Equal(t, fernTestValueConditions, obj.Conditions) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetContentPhishing", func(t *testing.T) { - obj := &RiskSettingsReasonWeights{} - var fernTestValueContentPhishing *float64 - obj.SetContentPhishing(fernTestValueContentPhishing) - assert.Equal(t, fernTestValueContentPhishing, obj.ContentPhishing) + t.Run("SetAction", func(t *testing.T) { + obj := &RiskRule{} + var fernTestValueAction RiskDecision + obj.SetAction(fernTestValueAction) + assert.Equal(t, fernTestValueAction, obj.Action) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetContentMalware", func(t *testing.T) { - obj := &RiskSettingsReasonWeights{} - var fernTestValueContentMalware *float64 - obj.SetContentMalware(fernTestValueContentMalware) - assert.Equal(t, fernTestValueContentMalware, obj.ContentMalware) + t.Run("SetCreatedAt", func(t *testing.T) { + obj := &RiskRule{} + var fernTestValueCreatedAt time.Time + obj.SetCreatedAt(fernTestValueCreatedAt) + assert.Equal(t, fernTestValueCreatedAt, obj.CreatedAt) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetContentFraud", func(t *testing.T) { - obj := &RiskSettingsReasonWeights{} - var fernTestValueContentFraud *float64 - obj.SetContentFraud(fernTestValueContentFraud) - assert.Equal(t, fernTestValueContentFraud, obj.ContentFraud) + t.Run("SetUpdatedAt", func(t *testing.T) { + obj := &RiskRule{} + var fernTestValueUpdatedAt time.Time + obj.SetUpdatedAt(fernTestValueUpdatedAt) + assert.Equal(t, fernTestValueUpdatedAt, obj.UpdatedAt) assert.NotNil(t, obj.explicitFields) }) } -func TestGettersRiskSettingsReasonWeights(t *testing.T) { - t.Run("GetEmailInvalid", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &RiskSettingsReasonWeights{} - var expected *float64 - obj.EmailInvalid = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetEmailInvalid(), "getter should return the property value") - }) - - t.Run("GetEmailInvalid_NilValue", func(t *testing.T) { +func TestGettersRiskRule(t *testing.T) { + t.Run("GetObject", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskSettingsReasonWeights{} - obj.EmailInvalid = nil + obj := &RiskRule{} + var expected RiskRuleObject + obj.Object = expected // Act & Assert - assert.Nil(t, obj.GetEmailInvalid(), "getter should return nil when property is nil") + assert.Equal(t, expected, obj.GetObject(), "getter should return the property value") }) - t.Run("GetEmailInvalid_NilReceiver", func(t *testing.T) { + t.Run("GetObject_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *RiskSettingsReasonWeights + var obj *RiskRule // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetEmailInvalid() // Should return zero value - }) - - t.Run("GetEmailDisposable", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &RiskSettingsReasonWeights{} - var expected *float64 - obj.EmailDisposable = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetEmailDisposable(), "getter should return the property value") + _ = obj.GetObject() // Should return zero value }) - t.Run("GetEmailDisposable_NilValue", func(t *testing.T) { + t.Run("GetID", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskSettingsReasonWeights{} - obj.EmailDisposable = nil + obj := &RiskRule{} + var expected string + obj.ID = expected // Act & Assert - assert.Nil(t, obj.GetEmailDisposable(), "getter should return nil when property is nil") + assert.Equal(t, expected, obj.GetID(), "getter should return the property value") }) - t.Run("GetEmailDisposable_NilReceiver", func(t *testing.T) { + t.Run("GetID_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *RiskSettingsReasonWeights + var obj *RiskRule // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetEmailDisposable() // Should return zero value - }) - - t.Run("GetEmailUndeliverable", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &RiskSettingsReasonWeights{} - var expected *float64 - obj.EmailUndeliverable = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetEmailUndeliverable(), "getter should return the property value") + _ = obj.GetID() // Should return zero value }) - t.Run("GetEmailUndeliverable_NilValue", func(t *testing.T) { + t.Run("GetName", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskSettingsReasonWeights{} - obj.EmailUndeliverable = nil + obj := &RiskRule{} + var expected string + obj.Name = expected // Act & Assert - assert.Nil(t, obj.GetEmailUndeliverable(), "getter should return nil when property is nil") + assert.Equal(t, expected, obj.GetName(), "getter should return the property value") }) - t.Run("GetEmailUndeliverable_NilReceiver", func(t *testing.T) { + t.Run("GetName_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *RiskSettingsReasonWeights + var obj *RiskRule // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetEmailUndeliverable() // Should return zero value + _ = obj.GetName() // Should return zero value }) - t.Run("GetEmailRoleAccount", func(t *testing.T) { + t.Run("GetEnabled", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskSettingsReasonWeights{} - var expected *float64 - obj.EmailRoleAccount = expected + obj := &RiskRule{} + var expected bool + obj.Enabled = expected // Act & Assert - assert.Equal(t, expected, obj.GetEmailRoleAccount(), "getter should return the property value") + assert.Equal(t, expected, obj.GetEnabled(), "getter should return the property value") }) - t.Run("GetEmailRoleAccount_NilValue", func(t *testing.T) { + t.Run("GetEnabled_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *RiskRule + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetEnabled() // Should return zero value + }) + + t.Run("GetPosition", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskSettingsReasonWeights{} - obj.EmailRoleAccount = nil + obj := &RiskRule{} + var expected int64 + obj.Position = expected // Act & Assert - assert.Nil(t, obj.GetEmailRoleAccount(), "getter should return nil when property is nil") + assert.Equal(t, expected, obj.GetPosition(), "getter should return the property value") }) - t.Run("GetEmailRoleAccount_NilReceiver", func(t *testing.T) { + t.Run("GetPosition_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *RiskSettingsReasonWeights + var obj *RiskRule // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetEmailRoleAccount() // Should return zero value + _ = obj.GetPosition() // Should return zero value }) - t.Run("GetEmailTypo", func(t *testing.T) { + t.Run("GetEvents", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskSettingsReasonWeights{} - var expected *float64 - obj.EmailTypo = expected + obj := &RiskRule{} + var expected []RiskEvent + obj.Events = expected // Act & Assert - assert.Equal(t, expected, obj.GetEmailTypo(), "getter should return the property value") + assert.Equal(t, expected, obj.GetEvents(), "getter should return the property value") }) - t.Run("GetEmailTypo_NilValue", func(t *testing.T) { + t.Run("GetEvents_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskSettingsReasonWeights{} - obj.EmailTypo = nil + obj := &RiskRule{} + obj.Events = nil // Act & Assert - assert.Nil(t, obj.GetEmailTypo(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetEvents(), "getter should return nil when property is nil") }) - t.Run("GetEmailTypo_NilReceiver", func(t *testing.T) { + t.Run("GetEvents_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *RiskSettingsReasonWeights + var obj *RiskRule // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetEmailTypo() // Should return zero value - }) - - t.Run("GetEmailDomainNew", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &RiskSettingsReasonWeights{} - var expected *float64 - obj.EmailDomainNew = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetEmailDomainNew(), "getter should return the property value") + _ = obj.GetEvents() // Should return zero value }) - t.Run("GetEmailDomainNew_NilValue", func(t *testing.T) { + t.Run("GetMatch", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskSettingsReasonWeights{} - obj.EmailDomainNew = nil + obj := &RiskRule{} + var expected RiskRuleMatch + obj.Match = expected // Act & Assert - assert.Nil(t, obj.GetEmailDomainNew(), "getter should return nil when property is nil") + assert.Equal(t, expected, obj.GetMatch(), "getter should return the property value") }) - t.Run("GetEmailDomainNew_NilReceiver", func(t *testing.T) { + t.Run("GetMatch_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *RiskSettingsReasonWeights + var obj *RiskRule // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetEmailDomainNew() // Should return zero value + _ = obj.GetMatch() // Should return zero value }) - t.Run("GetIPTor", func(t *testing.T) { + t.Run("GetConditions", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskSettingsReasonWeights{} - var expected *float64 - obj.IPTor = expected + obj := &RiskRule{} + var expected []*RiskRuleCondition + obj.Conditions = expected // Act & Assert - assert.Equal(t, expected, obj.GetIPTor(), "getter should return the property value") + assert.Equal(t, expected, obj.GetConditions(), "getter should return the property value") }) - t.Run("GetIPTor_NilValue", func(t *testing.T) { + t.Run("GetConditions_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskSettingsReasonWeights{} - obj.IPTor = nil + obj := &RiskRule{} + obj.Conditions = nil // Act & Assert - assert.Nil(t, obj.GetIPTor(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetConditions(), "getter should return nil when property is nil") }) - t.Run("GetIPTor_NilReceiver", func(t *testing.T) { + t.Run("GetConditions_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *RiskSettingsReasonWeights + var obj *RiskRule // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetIPTor() // Should return zero value - }) - - t.Run("GetIPVpnNetwork", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &RiskSettingsReasonWeights{} - var expected *float64 - obj.IPVpnNetwork = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetIPVpnNetwork(), "getter should return the property value") + _ = obj.GetConditions() // Should return zero value }) - t.Run("GetIPVpnNetwork_NilValue", func(t *testing.T) { + t.Run("GetAction", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskSettingsReasonWeights{} - obj.IPVpnNetwork = nil + obj := &RiskRule{} + var expected RiskDecision + obj.Action = expected // Act & Assert - assert.Nil(t, obj.GetIPVpnNetwork(), "getter should return nil when property is nil") + assert.Equal(t, expected, obj.GetAction(), "getter should return the property value") }) - t.Run("GetIPVpnNetwork_NilReceiver", func(t *testing.T) { + t.Run("GetAction_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *RiskSettingsReasonWeights + var obj *RiskRule // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetIPVpnNetwork() // Should return zero value - }) - - t.Run("GetIPHostingProvider", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &RiskSettingsReasonWeights{} - var expected *float64 - obj.IPHostingProvider = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetIPHostingProvider(), "getter should return the property value") + _ = obj.GetAction() // Should return zero value }) - t.Run("GetIPHostingProvider_NilValue", func(t *testing.T) { + t.Run("GetCreatedAt", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskSettingsReasonWeights{} - obj.IPHostingProvider = nil + obj := &RiskRule{} + var expected time.Time + obj.CreatedAt = expected // Act & Assert - assert.Nil(t, obj.GetIPHostingProvider(), "getter should return nil when property is nil") + assert.Equal(t, expected, obj.GetCreatedAt(), "getter should return the property value") }) - t.Run("GetIPHostingProvider_NilReceiver", func(t *testing.T) { + t.Run("GetCreatedAt_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *RiskSettingsReasonWeights + var obj *RiskRule // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetIPHostingProvider() // Should return zero value - }) - - t.Run("GetIPVpn", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &RiskSettingsReasonWeights{} - var expected *float64 - obj.IPVpn = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetIPVpn(), "getter should return the property value") + _ = obj.GetCreatedAt() // Should return zero value }) - t.Run("GetIPVpn_NilValue", func(t *testing.T) { + t.Run("GetUpdatedAt", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskSettingsReasonWeights{} - obj.IPVpn = nil + obj := &RiskRule{} + var expected time.Time + obj.UpdatedAt = expected // Act & Assert - assert.Nil(t, obj.GetIPVpn(), "getter should return nil when property is nil") + assert.Equal(t, expected, obj.GetUpdatedAt(), "getter should return the property value") }) - t.Run("GetIPVpn_NilReceiver", func(t *testing.T) { + t.Run("GetUpdatedAt_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *RiskSettingsReasonWeights + var obj *RiskRule // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetIPVpn() // Should return zero value + _ = obj.GetUpdatedAt() // Should return zero value }) - t.Run("GetIPProxy", func(t *testing.T) { +} + +func TestSettersMarkExplicitRiskRule(t *testing.T) { + t.Run("SetObject_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskSettingsReasonWeights{} - var expected *float64 - obj.IPProxy = expected + obj := &RiskRule{} + var fernTestValueObject RiskRuleObject - // Act & Assert - assert.Equal(t, expected, obj.GetIPProxy(), "getter should return the property value") - }) + // Act + obj.SetObject(fernTestValueObject) - t.Run("GetIPProxy_NilValue", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &RiskSettingsReasonWeights{} - obj.IPProxy = nil + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") - // Act & Assert - assert.Nil(t, obj.GetIPProxy(), "getter should return nil when property is nil") - }) + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } - t.Run("GetIPProxy_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *RiskSettingsReasonWeights - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetIPProxy() // Should return zero value + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("GetIPRelay", func(t *testing.T) { + t.Run("SetID_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskSettingsReasonWeights{} - var expected *float64 - obj.IPRelay = expected + obj := &RiskRule{} + var fernTestValueID string - // Act & Assert - assert.Equal(t, expected, obj.GetIPRelay(), "getter should return the property value") - }) + // Act + obj.SetID(fernTestValueID) - t.Run("GetIPRelay_NilValue", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &RiskSettingsReasonWeights{} - obj.IPRelay = nil + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") - // Act & Assert - assert.Nil(t, obj.GetIPRelay(), "getter should return nil when property is nil") - }) + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } - t.Run("GetIPRelay_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *RiskSettingsReasonWeights - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetIPRelay() // Should return zero value + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("GetIPPrivate", func(t *testing.T) { + t.Run("SetName_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskSettingsReasonWeights{} - var expected *float64 - obj.IPPrivate = expected + obj := &RiskRule{} + var fernTestValueName string - // Act & Assert - assert.Equal(t, expected, obj.GetIPPrivate(), "getter should return the property value") - }) + // Act + obj.SetName(fernTestValueName) - t.Run("GetIPPrivate_NilValue", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &RiskSettingsReasonWeights{} - obj.IPPrivate = nil + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") - // Act & Assert - assert.Nil(t, obj.GetIPPrivate(), "getter should return nil when property is nil") - }) + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } - t.Run("GetIPPrivate_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *RiskSettingsReasonWeights - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetIPPrivate() // Should return zero value + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("GetVelocitySignupsPerIP1H", func(t *testing.T) { + t.Run("SetEnabled_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskSettingsReasonWeights{} - var expected *float64 - obj.VelocitySignupsPerIP1H = expected + obj := &RiskRule{} + var fernTestValueEnabled bool - // Act & Assert - assert.Equal(t, expected, obj.GetVelocitySignupsPerIP1H(), "getter should return the property value") - }) + // Act + obj.SetEnabled(fernTestValueEnabled) - t.Run("GetVelocitySignupsPerIP1H_NilValue", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &RiskSettingsReasonWeights{} - obj.VelocitySignupsPerIP1H = nil + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") - // Act & Assert - assert.Nil(t, obj.GetVelocitySignupsPerIP1H(), "getter should return nil when property is nil") - }) + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } - t.Run("GetVelocitySignupsPerIP1H_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *RiskSettingsReasonWeights - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetVelocitySignupsPerIP1H() // Should return zero value + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("GetVelocitySignupsPerIP24H", func(t *testing.T) { + t.Run("SetPosition_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskSettingsReasonWeights{} - var expected *float64 - obj.VelocitySignupsPerIP24H = expected + obj := &RiskRule{} + var fernTestValuePosition int64 - // Act & Assert - assert.Equal(t, expected, obj.GetVelocitySignupsPerIP24H(), "getter should return the property value") - }) + // Act + obj.SetPosition(fernTestValuePosition) - t.Run("GetVelocitySignupsPerIP24H_NilValue", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &RiskSettingsReasonWeights{} - obj.VelocitySignupsPerIP24H = nil + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") - // Act & Assert - assert.Nil(t, obj.GetVelocitySignupsPerIP24H(), "getter should return nil when property is nil") - }) + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } - t.Run("GetVelocitySignupsPerIP24H_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *RiskSettingsReasonWeights - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetVelocitySignupsPerIP24H() // Should return zero value + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("GetVelocitySignupsPerSubnet1H", func(t *testing.T) { + t.Run("SetEvents_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskSettingsReasonWeights{} - var expected *float64 - obj.VelocitySignupsPerSubnet1H = expected + obj := &RiskRule{} + var fernTestValueEvents []RiskEvent - // Act & Assert - assert.Equal(t, expected, obj.GetVelocitySignupsPerSubnet1H(), "getter should return the property value") + // Act + obj.SetEvents(fernTestValueEvents) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("GetVelocitySignupsPerSubnet1H_NilValue", func(t *testing.T) { + t.Run("SetMatch_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskSettingsReasonWeights{} - obj.VelocitySignupsPerSubnet1H = nil + obj := &RiskRule{} + var fernTestValueMatch RiskRuleMatch - // Act & Assert - assert.Nil(t, obj.GetVelocitySignupsPerSubnet1H(), "getter should return nil when property is nil") - }) + // Act + obj.SetMatch(fernTestValueMatch) - t.Run("GetVelocitySignupsPerSubnet1H_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *RiskSettingsReasonWeights - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetVelocitySignupsPerSubnet1H() // Should return zero value + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("GetVelocitySignupsPerEmailDomain1H", func(t *testing.T) { + t.Run("SetConditions_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskSettingsReasonWeights{} - var expected *float64 - obj.VelocitySignupsPerEmailDomain1H = expected + obj := &RiskRule{} + var fernTestValueConditions []*RiskRuleCondition - // Act & Assert - assert.Equal(t, expected, obj.GetVelocitySignupsPerEmailDomain1H(), "getter should return the property value") + // Act + obj.SetConditions(fernTestValueConditions) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("GetVelocitySignupsPerEmailDomain1H_NilValue", func(t *testing.T) { + t.Run("SetAction_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskSettingsReasonWeights{} - obj.VelocitySignupsPerEmailDomain1H = nil + obj := &RiskRule{} + var fernTestValueAction RiskDecision - // Act & Assert - assert.Nil(t, obj.GetVelocitySignupsPerEmailDomain1H(), "getter should return nil when property is nil") - }) + // Act + obj.SetAction(fernTestValueAction) - t.Run("GetVelocitySignupsPerEmailDomain1H_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *RiskSettingsReasonWeights - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetVelocitySignupsPerEmailDomain1H() // Should return zero value + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("GetVelocitySignupsPerMailbox24H", func(t *testing.T) { + t.Run("SetCreatedAt_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskSettingsReasonWeights{} - var expected *float64 - obj.VelocitySignupsPerMailbox24H = expected + obj := &RiskRule{} + var fernTestValueCreatedAt time.Time - // Act & Assert - assert.Equal(t, expected, obj.GetVelocitySignupsPerMailbox24H(), "getter should return the property value") + // Act + obj.SetCreatedAt(fernTestValueCreatedAt) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("GetVelocitySignupsPerMailbox24H_NilValue", func(t *testing.T) { + t.Run("SetUpdatedAt_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskSettingsReasonWeights{} - obj.VelocitySignupsPerMailbox24H = nil + obj := &RiskRule{} + var fernTestValueUpdatedAt time.Time - // Act & Assert - assert.Nil(t, obj.GetVelocitySignupsPerMailbox24H(), "getter should return nil when property is nil") + // Act + obj.SetUpdatedAt(fernTestValueUpdatedAt) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("GetVelocitySignupsPerMailbox24H_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *RiskSettingsReasonWeights - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetVelocitySignupsPerMailbox24H() // Should return zero value +} + +func TestSettersRiskRuleCondition(t *testing.T) { + t.Run("SetField", func(t *testing.T) { + obj := &RiskRuleCondition{} + var fernTestValueField RiskRuleConditionField + obj.SetField(fernTestValueField) + assert.Equal(t, fernTestValueField, obj.Field) + assert.NotNil(t, obj.explicitFields) }) - t.Run("GetVelocitySignupsPerDevice24H", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &RiskSettingsReasonWeights{} - var expected *float64 - obj.VelocitySignupsPerDevice24H = expected + t.Run("SetOperator", func(t *testing.T) { + obj := &RiskRuleCondition{} + var fernTestValueOperator RiskRuleConditionOperator + obj.SetOperator(fernTestValueOperator) + assert.Equal(t, fernTestValueOperator, obj.Operator) + assert.NotNil(t, obj.explicitFields) + }) - // Act & Assert - assert.Equal(t, expected, obj.GetVelocitySignupsPerDevice24H(), "getter should return the property value") + t.Run("SetValue", func(t *testing.T) { + obj := &RiskRuleCondition{} + var fernTestValueValue *RiskRuleConditionValue + obj.SetValue(fernTestValueValue) + assert.Equal(t, fernTestValueValue, obj.Value) + assert.NotNil(t, obj.explicitFields) }) - t.Run("GetVelocitySignupsPerDevice24H_NilValue", func(t *testing.T) { +} + +func TestGettersRiskRuleCondition(t *testing.T) { + t.Run("GetField", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskSettingsReasonWeights{} - obj.VelocitySignupsPerDevice24H = nil + obj := &RiskRuleCondition{} + var expected RiskRuleConditionField + obj.Field = expected // Act & Assert - assert.Nil(t, obj.GetVelocitySignupsPerDevice24H(), "getter should return nil when property is nil") + assert.Equal(t, expected, obj.GetField(), "getter should return the property value") }) - t.Run("GetVelocitySignupsPerDevice24H_NilReceiver", func(t *testing.T) { + t.Run("GetField_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *RiskSettingsReasonWeights + var obj *RiskRuleCondition // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetVelocitySignupsPerDevice24H() // Should return zero value - }) - - t.Run("GetVelocityCheckoutsPerIP1H", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &RiskSettingsReasonWeights{} - var expected *float64 - obj.VelocityCheckoutsPerIP1H = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetVelocityCheckoutsPerIP1H(), "getter should return the property value") + _ = obj.GetField() // Should return zero value }) - t.Run("GetVelocityCheckoutsPerIP1H_NilValue", func(t *testing.T) { + t.Run("GetOperator", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskSettingsReasonWeights{} - obj.VelocityCheckoutsPerIP1H = nil + obj := &RiskRuleCondition{} + var expected RiskRuleConditionOperator + obj.Operator = expected // Act & Assert - assert.Nil(t, obj.GetVelocityCheckoutsPerIP1H(), "getter should return nil when property is nil") + assert.Equal(t, expected, obj.GetOperator(), "getter should return the property value") }) - t.Run("GetVelocityCheckoutsPerIP1H_NilReceiver", func(t *testing.T) { + t.Run("GetOperator_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *RiskSettingsReasonWeights + var obj *RiskRuleCondition // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetVelocityCheckoutsPerIP1H() // Should return zero value + _ = obj.GetOperator() // Should return zero value }) - t.Run("GetVelocityCheckoutsPerUser1H", func(t *testing.T) { + t.Run("GetValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskSettingsReasonWeights{} - var expected *float64 - obj.VelocityCheckoutsPerUser1H = expected + obj := &RiskRuleCondition{} + var expected *RiskRuleConditionValue + obj.Value = expected // Act & Assert - assert.Equal(t, expected, obj.GetVelocityCheckoutsPerUser1H(), "getter should return the property value") + assert.Equal(t, expected, obj.GetValue(), "getter should return the property value") }) - t.Run("GetVelocityCheckoutsPerUser1H_NilValue", func(t *testing.T) { + t.Run("GetValue_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskSettingsReasonWeights{} - obj.VelocityCheckoutsPerUser1H = nil + obj := &RiskRuleCondition{} + obj.Value = nil // Act & Assert - assert.Nil(t, obj.GetVelocityCheckoutsPerUser1H(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetValue(), "getter should return nil when property is nil") }) - t.Run("GetVelocityCheckoutsPerUser1H_NilReceiver", func(t *testing.T) { + t.Run("GetValue_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *RiskSettingsReasonWeights + var obj *RiskRuleCondition // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetVelocityCheckoutsPerUser1H() // Should return zero value + _ = obj.GetValue() // Should return zero value }) - t.Run("GetVelocityCheckoutsPerCard24H", func(t *testing.T) { +} + +func TestSettersMarkExplicitRiskRuleCondition(t *testing.T) { + t.Run("SetField_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskSettingsReasonWeights{} - var expected *float64 - obj.VelocityCheckoutsPerCard24H = expected + obj := &RiskRuleCondition{} + var fernTestValueField RiskRuleConditionField - // Act & Assert - assert.Equal(t, expected, obj.GetVelocityCheckoutsPerCard24H(), "getter should return the property value") + // Act + obj.SetField(fernTestValueField) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("GetVelocityCheckoutsPerCard24H_NilValue", func(t *testing.T) { + t.Run("SetOperator_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskSettingsReasonWeights{} - obj.VelocityCheckoutsPerCard24H = nil + obj := &RiskRuleCondition{} + var fernTestValueOperator RiskRuleConditionOperator - // Act & Assert - assert.Nil(t, obj.GetVelocityCheckoutsPerCard24H(), "getter should return nil when property is nil") - }) + // Act + obj.SetOperator(fernTestValueOperator) - t.Run("GetVelocityCheckoutsPerCard24H_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *RiskSettingsReasonWeights - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetVelocityCheckoutsPerCard24H() // Should return zero value + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("GetVelocityLoginsPerIP1H", func(t *testing.T) { + t.Run("SetValue_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskSettingsReasonWeights{} - var expected *float64 - obj.VelocityLoginsPerIP1H = expected + obj := &RiskRuleCondition{} + var fernTestValueValue *RiskRuleConditionValue - // Act & Assert - assert.Equal(t, expected, obj.GetVelocityLoginsPerIP1H(), "getter should return the property value") + // Act + obj.SetValue(fernTestValueValue) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("GetVelocityLoginsPerIP1H_NilValue", func(t *testing.T) { +} + +func TestGettersRiskRuleConditionValue(t *testing.T) { + t.Run("GetBoolean", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskSettingsReasonWeights{} - obj.VelocityLoginsPerIP1H = nil + obj := &RiskRuleConditionValue{} + var expected bool + obj.Boolean = expected // Act & Assert - assert.Nil(t, obj.GetVelocityLoginsPerIP1H(), "getter should return nil when property is nil") + assert.Equal(t, expected, obj.GetBoolean(), "getter should return the property value") }) - t.Run("GetVelocityLoginsPerIP1H_NilReceiver", func(t *testing.T) { + t.Run("GetBoolean_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *RiskSettingsReasonWeights + var obj *RiskRuleConditionValue // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetVelocityLoginsPerIP1H() // Should return zero value - }) - - t.Run("GetVelocityLoginsPerUser1H", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &RiskSettingsReasonWeights{} - var expected *float64 - obj.VelocityLoginsPerUser1H = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetVelocityLoginsPerUser1H(), "getter should return the property value") + _ = obj.GetBoolean() // Should return zero value }) - t.Run("GetVelocityLoginsPerUser1H_NilValue", func(t *testing.T) { + t.Run("GetDouble", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskSettingsReasonWeights{} - obj.VelocityLoginsPerUser1H = nil + obj := &RiskRuleConditionValue{} + var expected float64 + obj.Double = expected // Act & Assert - assert.Nil(t, obj.GetVelocityLoginsPerUser1H(), "getter should return nil when property is nil") + assert.Equal(t, expected, obj.GetDouble(), "getter should return the property value") }) - t.Run("GetVelocityLoginsPerUser1H_NilReceiver", func(t *testing.T) { + t.Run("GetDouble_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *RiskSettingsReasonWeights + var obj *RiskRuleConditionValue // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetVelocityLoginsPerUser1H() // Should return zero value - }) - - t.Run("GetVelocityEventsPerIP1H", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &RiskSettingsReasonWeights{} - var expected *float64 - obj.VelocityEventsPerIP1H = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetVelocityEventsPerIP1H(), "getter should return the property value") + _ = obj.GetDouble() // Should return zero value }) - t.Run("GetVelocityEventsPerIP1H_NilValue", func(t *testing.T) { + t.Run("GetString", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskSettingsReasonWeights{} - obj.VelocityEventsPerIP1H = nil + obj := &RiskRuleConditionValue{} + var expected string + obj.String = expected // Act & Assert - assert.Nil(t, obj.GetVelocityEventsPerIP1H(), "getter should return nil when property is nil") + assert.Equal(t, expected, obj.GetString(), "getter should return the property value") }) - t.Run("GetVelocityEventsPerIP1H_NilReceiver", func(t *testing.T) { + t.Run("GetString_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *RiskSettingsReasonWeights + var obj *RiskRuleConditionValue // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetVelocityEventsPerIP1H() // Should return zero value + _ = obj.GetString() // Should return zero value }) - t.Run("GetVelocityEventsPerUser1H", func(t *testing.T) { + t.Run("GetStringList", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskSettingsReasonWeights{} - var expected *float64 - obj.VelocityEventsPerUser1H = expected + obj := &RiskRuleConditionValue{} + var expected []string + obj.StringList = expected // Act & Assert - assert.Equal(t, expected, obj.GetVelocityEventsPerUser1H(), "getter should return the property value") + assert.Equal(t, expected, obj.GetStringList(), "getter should return the property value") }) - t.Run("GetVelocityEventsPerUser1H_NilValue", func(t *testing.T) { + t.Run("GetStringList_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskSettingsReasonWeights{} - obj.VelocityEventsPerUser1H = nil + obj := &RiskRuleConditionValue{} + obj.StringList = nil // Act & Assert - assert.Nil(t, obj.GetVelocityEventsPerUser1H(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetStringList(), "getter should return nil when property is nil") }) - t.Run("GetVelocityEventsPerUser1H_NilReceiver", func(t *testing.T) { + t.Run("GetStringList_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *RiskSettingsReasonWeights + var obj *RiskRuleConditionValue // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetVelocityEventsPerUser1H() // Should return zero value + _ = obj.GetStringList() // Should return zero value }) - t.Run("GetDuplicateCanonicalMailbox", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &RiskSettingsReasonWeights{} - var expected *float64 - obj.DuplicateCanonicalMailbox = expected +} - // Act & Assert - assert.Equal(t, expected, obj.GetDuplicateCanonicalMailbox(), "getter should return the property value") +func TestSettersRiskRuleList(t *testing.T) { + t.Run("SetObject", func(t *testing.T) { + obj := &RiskRuleList{} + var fernTestValueObject RiskRuleListObject + obj.SetObject(fernTestValueObject) + assert.Equal(t, fernTestValueObject, obj.Object) + assert.NotNil(t, obj.explicitFields) }) - t.Run("GetDuplicateCanonicalMailbox_NilValue", func(t *testing.T) { + t.Run("SetData", func(t *testing.T) { + obj := &RiskRuleList{} + var fernTestValueData []*RiskRule + obj.SetData(fernTestValueData) + assert.Equal(t, fernTestValueData, obj.Data) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetHasMore", func(t *testing.T) { + obj := &RiskRuleList{} + var fernTestValueHasMore bool + obj.SetHasMore(fernTestValueHasMore) + assert.Equal(t, fernTestValueHasMore, obj.HasMore) + assert.NotNil(t, obj.explicitFields) + }) + +} + +func TestGettersRiskRuleList(t *testing.T) { + t.Run("GetObject", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskSettingsReasonWeights{} - obj.DuplicateCanonicalMailbox = nil + obj := &RiskRuleList{} + var expected RiskRuleListObject + obj.Object = expected // Act & Assert - assert.Nil(t, obj.GetDuplicateCanonicalMailbox(), "getter should return nil when property is nil") + assert.Equal(t, expected, obj.GetObject(), "getter should return the property value") }) - t.Run("GetDuplicateCanonicalMailbox_NilReceiver", func(t *testing.T) { + t.Run("GetObject_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *RiskSettingsReasonWeights + var obj *RiskRuleList // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetDuplicateCanonicalMailbox() // Should return zero value + _ = obj.GetObject() // Should return zero value }) - t.Run("GetDuplicateDevice", func(t *testing.T) { + t.Run("GetData", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskSettingsReasonWeights{} - var expected *float64 - obj.DuplicateDevice = expected + obj := &RiskRuleList{} + var expected []*RiskRule + obj.Data = expected // Act & Assert - assert.Equal(t, expected, obj.GetDuplicateDevice(), "getter should return the property value") + assert.Equal(t, expected, obj.GetData(), "getter should return the property value") }) - t.Run("GetDuplicateDevice_NilValue", func(t *testing.T) { + t.Run("GetData_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskSettingsReasonWeights{} - obj.DuplicateDevice = nil + obj := &RiskRuleList{} + obj.Data = nil // Act & Assert - assert.Nil(t, obj.GetDuplicateDevice(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetData(), "getter should return nil when property is nil") }) - t.Run("GetDuplicateDevice_NilReceiver", func(t *testing.T) { + t.Run("GetData_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *RiskSettingsReasonWeights + var obj *RiskRuleList // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetDuplicateDevice() // Should return zero value - }) - - t.Run("GetHistoryFraudMailbox", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &RiskSettingsReasonWeights{} - var expected *float64 - obj.HistoryFraudMailbox = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetHistoryFraudMailbox(), "getter should return the property value") + _ = obj.GetData() // Should return zero value }) - t.Run("GetHistoryFraudMailbox_NilValue", func(t *testing.T) { + t.Run("GetHasMore", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskSettingsReasonWeights{} - obj.HistoryFraudMailbox = nil + obj := &RiskRuleList{} + var expected bool + obj.HasMore = expected // Act & Assert - assert.Nil(t, obj.GetHistoryFraudMailbox(), "getter should return nil when property is nil") + assert.Equal(t, expected, obj.GetHasMore(), "getter should return the property value") }) - t.Run("GetHistoryFraudMailbox_NilReceiver", func(t *testing.T) { + t.Run("GetHasMore_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *RiskSettingsReasonWeights + var obj *RiskRuleList // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetHistoryFraudMailbox() // Should return zero value + _ = obj.GetHasMore() // Should return zero value }) - t.Run("GetHistoryFraudUser", func(t *testing.T) { +} + +func TestSettersMarkExplicitRiskRuleList(t *testing.T) { + t.Run("SetObject_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskSettingsReasonWeights{} - var expected *float64 - obj.HistoryFraudUser = expected + obj := &RiskRuleList{} + var fernTestValueObject RiskRuleListObject - // Act & Assert - assert.Equal(t, expected, obj.GetHistoryFraudUser(), "getter should return the property value") - }) - - t.Run("GetHistoryFraudUser_NilValue", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &RiskSettingsReasonWeights{} - obj.HistoryFraudUser = nil - - // Act & Assert - assert.Nil(t, obj.GetHistoryFraudUser(), "getter should return nil when property is nil") - }) - - t.Run("GetHistoryFraudUser_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *RiskSettingsReasonWeights - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetHistoryFraudUser() // Should return zero value - }) - - t.Run("GetHistoryFraudIP", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &RiskSettingsReasonWeights{} - var expected *float64 - obj.HistoryFraudIP = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetHistoryFraudIP(), "getter should return the property value") - }) - - t.Run("GetHistoryFraudIP_NilValue", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &RiskSettingsReasonWeights{} - obj.HistoryFraudIP = nil - - // Act & Assert - assert.Nil(t, obj.GetHistoryFraudIP(), "getter should return nil when property is nil") - }) - - t.Run("GetHistoryFraudIP_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *RiskSettingsReasonWeights - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetHistoryFraudIP() // Should return zero value - }) - - t.Run("GetHistoryFraudSubnet", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &RiskSettingsReasonWeights{} - var expected *float64 - obj.HistoryFraudSubnet = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetHistoryFraudSubnet(), "getter should return the property value") - }) - - t.Run("GetHistoryFraudSubnet_NilValue", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &RiskSettingsReasonWeights{} - obj.HistoryFraudSubnet = nil - - // Act & Assert - assert.Nil(t, obj.GetHistoryFraudSubnet(), "getter should return nil when property is nil") - }) - - t.Run("GetHistoryFraudSubnet_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *RiskSettingsReasonWeights - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetHistoryFraudSubnet() // Should return zero value - }) - - t.Run("GetHistoryFraudCard", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &RiskSettingsReasonWeights{} - var expected *float64 - obj.HistoryFraudCard = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetHistoryFraudCard(), "getter should return the property value") - }) - - t.Run("GetHistoryFraudCard_NilValue", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &RiskSettingsReasonWeights{} - obj.HistoryFraudCard = nil - - // Act & Assert - assert.Nil(t, obj.GetHistoryFraudCard(), "getter should return nil when property is nil") - }) - - t.Run("GetHistoryFraudCard_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *RiskSettingsReasonWeights - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetHistoryFraudCard() // Should return zero value - }) - - t.Run("GetHistoryFraudDevice", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &RiskSettingsReasonWeights{} - var expected *float64 - obj.HistoryFraudDevice = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetHistoryFraudDevice(), "getter should return the property value") - }) - - t.Run("GetHistoryFraudDevice_NilValue", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &RiskSettingsReasonWeights{} - obj.HistoryFraudDevice = nil - - // Act & Assert - assert.Nil(t, obj.GetHistoryFraudDevice(), "getter should return nil when property is nil") - }) + // Act + obj.SetObject(fernTestValueObject) - t.Run("GetHistoryFraudDevice_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *RiskSettingsReasonWeights - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetHistoryFraudDevice() // Should return zero value - }) + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") - t.Run("GetCheckoutCardCountryMismatch", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &RiskSettingsReasonWeights{} - var expected *float64 - obj.CheckoutCardCountryMismatch = expected + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } - // Act & Assert - assert.Equal(t, expected, obj.GetCheckoutCardCountryMismatch(), "getter should return the property value") + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("GetCheckoutCardCountryMismatch_NilValue", func(t *testing.T) { + t.Run("SetData_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskSettingsReasonWeights{} - obj.CheckoutCardCountryMismatch = nil + obj := &RiskRuleList{} + var fernTestValueData []*RiskRule - // Act & Assert - assert.Nil(t, obj.GetCheckoutCardCountryMismatch(), "getter should return nil when property is nil") - }) + // Act + obj.SetData(fernTestValueData) - t.Run("GetCheckoutCardCountryMismatch_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *RiskSettingsReasonWeights - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetCheckoutCardCountryMismatch() // Should return zero value - }) + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") - t.Run("GetCheckoutBillingCountryMismatch", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &RiskSettingsReasonWeights{} - var expected *float64 - obj.CheckoutBillingCountryMismatch = expected + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } - // Act & Assert - assert.Equal(t, expected, obj.GetCheckoutBillingCountryMismatch(), "getter should return the property value") + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("GetCheckoutBillingCountryMismatch_NilValue", func(t *testing.T) { + t.Run("SetHasMore_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskSettingsReasonWeights{} - obj.CheckoutBillingCountryMismatch = nil + obj := &RiskRuleList{} + var fernTestValueHasMore bool - // Act & Assert - assert.Nil(t, obj.GetCheckoutBillingCountryMismatch(), "getter should return nil when property is nil") - }) + // Act + obj.SetHasMore(fernTestValueHasMore) - t.Run("GetCheckoutBillingCountryMismatch_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *RiskSettingsReasonWeights - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetCheckoutBillingCountryMismatch() // Should return zero value - }) + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") - t.Run("GetCheckoutPrepaidCard", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &RiskSettingsReasonWeights{} - var expected *float64 - obj.CheckoutPrepaidCard = expected + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } - // Act & Assert - assert.Equal(t, expected, obj.GetCheckoutPrepaidCard(), "getter should return the property value") + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("GetCheckoutPrepaidCard_NilValue", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &RiskSettingsReasonWeights{} - obj.CheckoutPrepaidCard = nil +} - // Act & Assert - assert.Nil(t, obj.GetCheckoutPrepaidCard(), "getter should return nil when property is nil") +func TestSettersRiskSettings(t *testing.T) { + t.Run("SetObject", func(t *testing.T) { + obj := &RiskSettings{} + var fernTestValueObject RiskSettingsObject + obj.SetObject(fernTestValueObject) + assert.Equal(t, fernTestValueObject, obj.Object) + assert.NotNil(t, obj.explicitFields) }) - t.Run("GetCheckoutPrepaidCard_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *RiskSettingsReasonWeights - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetCheckoutPrepaidCard() // Should return zero value + t.Run("SetReviewThreshold", func(t *testing.T) { + obj := &RiskSettings{} + var fernTestValueReviewThreshold float64 + obj.SetReviewThreshold(fernTestValueReviewThreshold) + assert.Equal(t, fernTestValueReviewThreshold, obj.ReviewThreshold) + assert.NotNil(t, obj.explicitFields) }) - t.Run("GetDeviceAutomation", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &RiskSettingsReasonWeights{} - var expected *float64 - obj.DeviceAutomation = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetDeviceAutomation(), "getter should return the property value") + t.Run("SetBlockThreshold", func(t *testing.T) { + obj := &RiskSettings{} + var fernTestValueBlockThreshold float64 + obj.SetBlockThreshold(fernTestValueBlockThreshold) + assert.Equal(t, fernTestValueBlockThreshold, obj.BlockThreshold) + assert.NotNil(t, obj.explicitFields) }) - t.Run("GetDeviceAutomation_NilValue", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &RiskSettingsReasonWeights{} - obj.DeviceAutomation = nil - - // Act & Assert - assert.Nil(t, obj.GetDeviceAutomation(), "getter should return nil when property is nil") + t.Run("SetDisabledReasons", func(t *testing.T) { + obj := &RiskSettings{} + var fernTestValueDisabledReasons []RiskSettingsDisabledReasonsItem + obj.SetDisabledReasons(fernTestValueDisabledReasons) + assert.Equal(t, fernTestValueDisabledReasons, obj.DisabledReasons) + assert.NotNil(t, obj.explicitFields) }) - t.Run("GetDeviceAutomation_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *RiskSettingsReasonWeights - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetDeviceAutomation() // Should return zero value + t.Run("SetCaptcha", func(t *testing.T) { + obj := &RiskSettings{} + var fernTestValueCaptcha *RiskSettingsCaptcha + obj.SetCaptcha(fernTestValueCaptcha) + assert.Equal(t, fernTestValueCaptcha, obj.Captcha) + assert.NotNil(t, obj.explicitFields) }) - t.Run("GetDeviceInvalid", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &RiskSettingsReasonWeights{} - var expected *float64 - obj.DeviceInvalid = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetDeviceInvalid(), "getter should return the property value") + t.Run("SetContentThresholds", func(t *testing.T) { + obj := &RiskSettings{} + var fernTestValueContentThresholds *RiskSettingsContentThresholds + obj.SetContentThresholds(fernTestValueContentThresholds) + assert.Equal(t, fernTestValueContentThresholds, obj.ContentThresholds) + assert.NotNil(t, obj.explicitFields) }) - t.Run("GetDeviceInvalid_NilValue", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &RiskSettingsReasonWeights{} - obj.DeviceInvalid = nil - - // Act & Assert - assert.Nil(t, obj.GetDeviceInvalid(), "getter should return nil when property is nil") + t.Run("SetReasonWeights", func(t *testing.T) { + obj := &RiskSettings{} + var fernTestValueReasonWeights *RiskSettingsReasonWeights + obj.SetReasonWeights(fernTestValueReasonWeights) + assert.Equal(t, fernTestValueReasonWeights, obj.ReasonWeights) + assert.NotNil(t, obj.explicitFields) }) - t.Run("GetDeviceInvalid_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *RiskSettingsReasonWeights - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetDeviceInvalid() // Should return zero value + t.Run("SetUpdatedAt", func(t *testing.T) { + obj := &RiskSettings{} + var fernTestValueUpdatedAt *time.Time + obj.SetUpdatedAt(fernTestValueUpdatedAt) + assert.Equal(t, fernTestValueUpdatedAt, obj.UpdatedAt) + assert.NotNil(t, obj.explicitFields) }) - t.Run("GetLoginNewCountry", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &RiskSettingsReasonWeights{} - var expected *float64 - obj.LoginNewCountry = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetLoginNewCountry(), "getter should return the property value") - }) +} - t.Run("GetLoginNewCountry_NilValue", func(t *testing.T) { +func TestGettersRiskSettings(t *testing.T) { + t.Run("GetObject", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskSettingsReasonWeights{} - obj.LoginNewCountry = nil + obj := &RiskSettings{} + var expected RiskSettingsObject + obj.Object = expected // Act & Assert - assert.Nil(t, obj.GetLoginNewCountry(), "getter should return nil when property is nil") + assert.Equal(t, expected, obj.GetObject(), "getter should return the property value") }) - t.Run("GetLoginNewCountry_NilReceiver", func(t *testing.T) { + t.Run("GetObject_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *RiskSettingsReasonWeights + var obj *RiskSettings // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetLoginNewCountry() // Should return zero value - }) - - t.Run("GetLoginNewNetwork", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &RiskSettingsReasonWeights{} - var expected *float64 - obj.LoginNewNetwork = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetLoginNewNetwork(), "getter should return the property value") + _ = obj.GetObject() // Should return zero value }) - t.Run("GetLoginNewNetwork_NilValue", func(t *testing.T) { + t.Run("GetReviewThreshold", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskSettingsReasonWeights{} - obj.LoginNewNetwork = nil + obj := &RiskSettings{} + var expected float64 + obj.ReviewThreshold = expected // Act & Assert - assert.Nil(t, obj.GetLoginNewNetwork(), "getter should return nil when property is nil") + assert.Equal(t, expected, obj.GetReviewThreshold(), "getter should return the property value") }) - t.Run("GetLoginNewNetwork_NilReceiver", func(t *testing.T) { + t.Run("GetReviewThreshold_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *RiskSettingsReasonWeights + var obj *RiskSettings // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetLoginNewNetwork() // Should return zero value - }) - - t.Run("GetCaptchaFailed", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &RiskSettingsReasonWeights{} - var expected *float64 - obj.CaptchaFailed = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetCaptchaFailed(), "getter should return the property value") + _ = obj.GetReviewThreshold() // Should return zero value }) - t.Run("GetCaptchaFailed_NilValue", func(t *testing.T) { + t.Run("GetBlockThreshold", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskSettingsReasonWeights{} - obj.CaptchaFailed = nil + obj := &RiskSettings{} + var expected float64 + obj.BlockThreshold = expected // Act & Assert - assert.Nil(t, obj.GetCaptchaFailed(), "getter should return nil when property is nil") + assert.Equal(t, expected, obj.GetBlockThreshold(), "getter should return the property value") }) - t.Run("GetCaptchaFailed_NilReceiver", func(t *testing.T) { + t.Run("GetBlockThreshold_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *RiskSettingsReasonWeights + var obj *RiskSettings // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetCaptchaFailed() // Should return zero value + _ = obj.GetBlockThreshold() // Should return zero value }) - t.Run("GetCaptchaMissing", func(t *testing.T) { + t.Run("GetDisabledReasons", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskSettingsReasonWeights{} - var expected *float64 - obj.CaptchaMissing = expected + obj := &RiskSettings{} + var expected []RiskSettingsDisabledReasonsItem + obj.DisabledReasons = expected // Act & Assert - assert.Equal(t, expected, obj.GetCaptchaMissing(), "getter should return the property value") + assert.Equal(t, expected, obj.GetDisabledReasons(), "getter should return the property value") }) - t.Run("GetCaptchaMissing_NilValue", func(t *testing.T) { + t.Run("GetDisabledReasons_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskSettingsReasonWeights{} - obj.CaptchaMissing = nil + obj := &RiskSettings{} + obj.DisabledReasons = nil // Act & Assert - assert.Nil(t, obj.GetCaptchaMissing(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetDisabledReasons(), "getter should return nil when property is nil") }) - t.Run("GetCaptchaMissing_NilReceiver", func(t *testing.T) { + t.Run("GetDisabledReasons_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *RiskSettingsReasonWeights + var obj *RiskSettings // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetCaptchaMissing() // Should return zero value + _ = obj.GetDisabledReasons() // Should return zero value }) - t.Run("GetContentSpam", func(t *testing.T) { + t.Run("GetCaptcha", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskSettingsReasonWeights{} - var expected *float64 - obj.ContentSpam = expected + obj := &RiskSettings{} + var expected *RiskSettingsCaptcha + obj.Captcha = expected // Act & Assert - assert.Equal(t, expected, obj.GetContentSpam(), "getter should return the property value") + assert.Equal(t, expected, obj.GetCaptcha(), "getter should return the property value") }) - t.Run("GetContentSpam_NilValue", func(t *testing.T) { + t.Run("GetCaptcha_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskSettingsReasonWeights{} - obj.ContentSpam = nil + obj := &RiskSettings{} + obj.Captcha = nil // Act & Assert - assert.Nil(t, obj.GetContentSpam(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetCaptcha(), "getter should return nil when property is nil") }) - t.Run("GetContentSpam_NilReceiver", func(t *testing.T) { + t.Run("GetCaptcha_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *RiskSettingsReasonWeights + var obj *RiskSettings // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetContentSpam() // Should return zero value + _ = obj.GetCaptcha() // Should return zero value }) - t.Run("GetContentPhishing", func(t *testing.T) { + t.Run("GetContentThresholds", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskSettingsReasonWeights{} - var expected *float64 - obj.ContentPhishing = expected + obj := &RiskSettings{} + var expected *RiskSettingsContentThresholds + obj.ContentThresholds = expected // Act & Assert - assert.Equal(t, expected, obj.GetContentPhishing(), "getter should return the property value") + assert.Equal(t, expected, obj.GetContentThresholds(), "getter should return the property value") }) - t.Run("GetContentPhishing_NilValue", func(t *testing.T) { + t.Run("GetContentThresholds_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskSettingsReasonWeights{} - obj.ContentPhishing = nil + obj := &RiskSettings{} + obj.ContentThresholds = nil // Act & Assert - assert.Nil(t, obj.GetContentPhishing(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetContentThresholds(), "getter should return nil when property is nil") }) - t.Run("GetContentPhishing_NilReceiver", func(t *testing.T) { + t.Run("GetContentThresholds_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *RiskSettingsReasonWeights + var obj *RiskSettings // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetContentPhishing() // Should return zero value + _ = obj.GetContentThresholds() // Should return zero value }) - t.Run("GetContentMalware", func(t *testing.T) { + t.Run("GetReasonWeights", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskSettingsReasonWeights{} - var expected *float64 - obj.ContentMalware = expected + obj := &RiskSettings{} + var expected *RiskSettingsReasonWeights + obj.ReasonWeights = expected // Act & Assert - assert.Equal(t, expected, obj.GetContentMalware(), "getter should return the property value") + assert.Equal(t, expected, obj.GetReasonWeights(), "getter should return the property value") }) - t.Run("GetContentMalware_NilValue", func(t *testing.T) { + t.Run("GetReasonWeights_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskSettingsReasonWeights{} - obj.ContentMalware = nil + obj := &RiskSettings{} + obj.ReasonWeights = nil // Act & Assert - assert.Nil(t, obj.GetContentMalware(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetReasonWeights(), "getter should return nil when property is nil") }) - t.Run("GetContentMalware_NilReceiver", func(t *testing.T) { + t.Run("GetReasonWeights_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *RiskSettingsReasonWeights + var obj *RiskSettings // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetContentMalware() // Should return zero value + _ = obj.GetReasonWeights() // Should return zero value }) - t.Run("GetContentFraud", func(t *testing.T) { + t.Run("GetUpdatedAt", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskSettingsReasonWeights{} - var expected *float64 - obj.ContentFraud = expected + obj := &RiskSettings{} + var expected *time.Time + obj.UpdatedAt = expected // Act & Assert - assert.Equal(t, expected, obj.GetContentFraud(), "getter should return the property value") + assert.Equal(t, expected, obj.GetUpdatedAt(), "getter should return the property value") }) - t.Run("GetContentFraud_NilValue", func(t *testing.T) { + t.Run("GetUpdatedAt_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskSettingsReasonWeights{} - obj.ContentFraud = nil + obj := &RiskSettings{} + obj.UpdatedAt = nil // Act & Assert - assert.Nil(t, obj.GetContentFraud(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetUpdatedAt(), "getter should return nil when property is nil") }) - t.Run("GetContentFraud_NilReceiver", func(t *testing.T) { + t.Run("GetUpdatedAt_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *RiskSettingsReasonWeights + var obj *RiskSettings // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetContentFraud() // Should return zero value + _ = obj.GetUpdatedAt() // Should return zero value }) } -func TestSettersMarkExplicitRiskSettingsReasonWeights(t *testing.T) { - t.Run("SetEmailInvalid_MarksExplicit", func(t *testing.T) { +func TestSettersMarkExplicitRiskSettings(t *testing.T) { + t.Run("SetObject_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskSettingsReasonWeights{} - var fernTestValueEmailInvalid *float64 + obj := &RiskSettings{} + var fernTestValueObject RiskSettingsObject // Act - obj.SetEmailInvalid(fernTestValueEmailInvalid) + obj.SetObject(fernTestValueObject) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -79455,14 +78680,14 @@ func TestSettersMarkExplicitRiskSettingsReasonWeights(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetEmailDisposable_MarksExplicit", func(t *testing.T) { + t.Run("SetReviewThreshold_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskSettingsReasonWeights{} - var fernTestValueEmailDisposable *float64 + obj := &RiskSettings{} + var fernTestValueReviewThreshold float64 // Act - obj.SetEmailDisposable(fernTestValueEmailDisposable) + obj.SetReviewThreshold(fernTestValueReviewThreshold) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -79486,14 +78711,14 @@ func TestSettersMarkExplicitRiskSettingsReasonWeights(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetEmailUndeliverable_MarksExplicit", func(t *testing.T) { + t.Run("SetBlockThreshold_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskSettingsReasonWeights{} - var fernTestValueEmailUndeliverable *float64 + obj := &RiskSettings{} + var fernTestValueBlockThreshold float64 // Act - obj.SetEmailUndeliverable(fernTestValueEmailUndeliverable) + obj.SetBlockThreshold(fernTestValueBlockThreshold) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -79517,14 +78742,14 @@ func TestSettersMarkExplicitRiskSettingsReasonWeights(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetEmailRoleAccount_MarksExplicit", func(t *testing.T) { + t.Run("SetDisabledReasons_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskSettingsReasonWeights{} - var fernTestValueEmailRoleAccount *float64 + obj := &RiskSettings{} + var fernTestValueDisabledReasons []RiskSettingsDisabledReasonsItem // Act - obj.SetEmailRoleAccount(fernTestValueEmailRoleAccount) + obj.SetDisabledReasons(fernTestValueDisabledReasons) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -79548,14 +78773,14 @@ func TestSettersMarkExplicitRiskSettingsReasonWeights(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetEmailTypo_MarksExplicit", func(t *testing.T) { + t.Run("SetCaptcha_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskSettingsReasonWeights{} - var fernTestValueEmailTypo *float64 + obj := &RiskSettings{} + var fernTestValueCaptcha *RiskSettingsCaptcha // Act - obj.SetEmailTypo(fernTestValueEmailTypo) + obj.SetCaptcha(fernTestValueCaptcha) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -79579,14 +78804,14 @@ func TestSettersMarkExplicitRiskSettingsReasonWeights(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetEmailDomainNew_MarksExplicit", func(t *testing.T) { + t.Run("SetContentThresholds_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskSettingsReasonWeights{} - var fernTestValueEmailDomainNew *float64 + obj := &RiskSettings{} + var fernTestValueContentThresholds *RiskSettingsContentThresholds // Act - obj.SetEmailDomainNew(fernTestValueEmailDomainNew) + obj.SetContentThresholds(fernTestValueContentThresholds) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -79610,14 +78835,14 @@ func TestSettersMarkExplicitRiskSettingsReasonWeights(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetIPTor_MarksExplicit", func(t *testing.T) { + t.Run("SetReasonWeights_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskSettingsReasonWeights{} - var fernTestValueIPTor *float64 + obj := &RiskSettings{} + var fernTestValueReasonWeights *RiskSettingsReasonWeights // Act - obj.SetIPTor(fernTestValueIPTor) + obj.SetReasonWeights(fernTestValueReasonWeights) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -79641,14 +78866,14 @@ func TestSettersMarkExplicitRiskSettingsReasonWeights(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetIPVpnNetwork_MarksExplicit", func(t *testing.T) { + t.Run("SetUpdatedAt_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskSettingsReasonWeights{} - var fernTestValueIPVpnNetwork *float64 + obj := &RiskSettings{} + var fernTestValueUpdatedAt *time.Time // Act - obj.SetIPVpnNetwork(fernTestValueIPVpnNetwork) + obj.SetUpdatedAt(fernTestValueUpdatedAt) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -79672,45 +78897,85 @@ func TestSettersMarkExplicitRiskSettingsReasonWeights(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetIPHostingProvider_MarksExplicit", func(t *testing.T) { +} + +func TestSettersRiskSettingsCaptcha(t *testing.T) { + t.Run("SetProvider", func(t *testing.T) { + obj := &RiskSettingsCaptcha{} + var fernTestValueProvider RiskSettingsCaptchaProvider + obj.SetProvider(fernTestValueProvider) + assert.Equal(t, fernTestValueProvider, obj.Provider) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetRequired", func(t *testing.T) { + obj := &RiskSettingsCaptcha{} + var fernTestValueRequired bool + obj.SetRequired(fernTestValueRequired) + assert.Equal(t, fernTestValueRequired, obj.Required) + assert.NotNil(t, obj.explicitFields) + }) + +} + +func TestGettersRiskSettingsCaptcha(t *testing.T) { + t.Run("GetProvider", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskSettingsReasonWeights{} - var fernTestValueIPHostingProvider *float64 + obj := &RiskSettingsCaptcha{} + var expected RiskSettingsCaptchaProvider + obj.Provider = expected - // Act - obj.SetIPHostingProvider(fernTestValueIPHostingProvider) + // Act & Assert + assert.Equal(t, expected, obj.GetProvider(), "getter should return the property value") + }) - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") + t.Run("GetProvider_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *RiskSettingsCaptcha + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetProvider() // Should return zero value + }) - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } + t.Run("GetRequired", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskSettingsCaptcha{} + var expected bool + obj.Required = expected - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip + // Act & Assert + assert.Equal(t, expected, obj.GetRequired(), "getter should return the property value") }) - t.Run("SetIPVpn_MarksExplicit", func(t *testing.T) { + t.Run("GetRequired_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *RiskSettingsCaptcha + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetRequired() // Should return zero value + }) + +} + +func TestSettersMarkExplicitRiskSettingsCaptcha(t *testing.T) { + t.Run("SetProvider_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskSettingsReasonWeights{} - var fernTestValueIPVpn *float64 + obj := &RiskSettingsCaptcha{} + var fernTestValueProvider RiskSettingsCaptchaProvider // Act - obj.SetIPVpn(fernTestValueIPVpn) + obj.SetProvider(fernTestValueProvider) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -79734,14 +78999,14 @@ func TestSettersMarkExplicitRiskSettingsReasonWeights(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetIPProxy_MarksExplicit", func(t *testing.T) { + t.Run("SetRequired_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskSettingsReasonWeights{} - var fernTestValueIPProxy *float64 + obj := &RiskSettingsCaptcha{} + var fernTestValueRequired bool // Act - obj.SetIPProxy(fernTestValueIPProxy) + obj.SetRequired(fernTestValueRequired) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -79765,107 +79030,187 @@ func TestSettersMarkExplicitRiskSettingsReasonWeights(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetIPRelay_MarksExplicit", func(t *testing.T) { +} + +func TestSettersRiskSettingsContentThresholds(t *testing.T) { + t.Run("SetSpam", func(t *testing.T) { + obj := &RiskSettingsContentThresholds{} + var fernTestValueSpam *float64 + obj.SetSpam(fernTestValueSpam) + assert.Equal(t, fernTestValueSpam, obj.Spam) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetPhishing", func(t *testing.T) { + obj := &RiskSettingsContentThresholds{} + var fernTestValuePhishing *float64 + obj.SetPhishing(fernTestValuePhishing) + assert.Equal(t, fernTestValuePhishing, obj.Phishing) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetMalware", func(t *testing.T) { + obj := &RiskSettingsContentThresholds{} + var fernTestValueMalware *float64 + obj.SetMalware(fernTestValueMalware) + assert.Equal(t, fernTestValueMalware, obj.Malware) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetFraud", func(t *testing.T) { + obj := &RiskSettingsContentThresholds{} + var fernTestValueFraud *float64 + obj.SetFraud(fernTestValueFraud) + assert.Equal(t, fernTestValueFraud, obj.Fraud) + assert.NotNil(t, obj.explicitFields) + }) + +} + +func TestGettersRiskSettingsContentThresholds(t *testing.T) { + t.Run("GetSpam", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskSettingsReasonWeights{} - var fernTestValueIPRelay *float64 + obj := &RiskSettingsContentThresholds{} + var expected *float64 + obj.Spam = expected - // Act - obj.SetIPRelay(fernTestValueIPRelay) + // Act & Assert + assert.Equal(t, expected, obj.GetSpam(), "getter should return the property value") + }) - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") + t.Run("GetSpam_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskSettingsContentThresholds{} + obj.Spam = nil - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } + // Act & Assert + assert.Nil(t, obj.GetSpam(), "getter should return nil when property is nil") + }) - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip + t.Run("GetSpam_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *RiskSettingsContentThresholds + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetSpam() // Should return zero value }) - t.Run("SetIPPrivate_MarksExplicit", func(t *testing.T) { + t.Run("GetPhishing", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskSettingsReasonWeights{} - var fernTestValueIPPrivate *float64 + obj := &RiskSettingsContentThresholds{} + var expected *float64 + obj.Phishing = expected - // Act - obj.SetIPPrivate(fernTestValueIPPrivate) + // Act & Assert + assert.Equal(t, expected, obj.GetPhishing(), "getter should return the property value") + }) - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") + t.Run("GetPhishing_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskSettingsContentThresholds{} + obj.Phishing = nil - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } + // Act & Assert + assert.Nil(t, obj.GetPhishing(), "getter should return nil when property is nil") + }) - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip + t.Run("GetPhishing_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *RiskSettingsContentThresholds + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetPhishing() // Should return zero value }) - t.Run("SetVelocitySignupsPerIP1H_MarksExplicit", func(t *testing.T) { + t.Run("GetMalware", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskSettingsReasonWeights{} - var fernTestValueVelocitySignupsPerIP1H *float64 + obj := &RiskSettingsContentThresholds{} + var expected *float64 + obj.Malware = expected - // Act - obj.SetVelocitySignupsPerIP1H(fernTestValueVelocitySignupsPerIP1H) + // Act & Assert + assert.Equal(t, expected, obj.GetMalware(), "getter should return the property value") + }) - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") + t.Run("GetMalware_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskSettingsContentThresholds{} + obj.Malware = nil - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } + // Act & Assert + assert.Nil(t, obj.GetMalware(), "getter should return nil when property is nil") + }) - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip + t.Run("GetMalware_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *RiskSettingsContentThresholds + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetMalware() // Should return zero value }) - t.Run("SetVelocitySignupsPerIP24H_MarksExplicit", func(t *testing.T) { + t.Run("GetFraud", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskSettingsReasonWeights{} - var fernTestValueVelocitySignupsPerIP24H *float64 + obj := &RiskSettingsContentThresholds{} + var expected *float64 + obj.Fraud = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetFraud(), "getter should return the property value") + }) + + t.Run("GetFraud_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskSettingsContentThresholds{} + obj.Fraud = nil + + // Act & Assert + assert.Nil(t, obj.GetFraud(), "getter should return nil when property is nil") + }) + + t.Run("GetFraud_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *RiskSettingsContentThresholds + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetFraud() // Should return zero value + }) + +} + +func TestSettersMarkExplicitRiskSettingsContentThresholds(t *testing.T) { + t.Run("SetSpam_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskSettingsContentThresholds{} + var fernTestValueSpam *float64 // Act - obj.SetVelocitySignupsPerIP24H(fernTestValueVelocitySignupsPerIP24H) + obj.SetSpam(fernTestValueSpam) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -79889,14 +79234,14 @@ func TestSettersMarkExplicitRiskSettingsReasonWeights(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetVelocitySignupsPerSubnet1H_MarksExplicit", func(t *testing.T) { + t.Run("SetPhishing_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskSettingsReasonWeights{} - var fernTestValueVelocitySignupsPerSubnet1H *float64 + obj := &RiskSettingsContentThresholds{} + var fernTestValuePhishing *float64 // Act - obj.SetVelocitySignupsPerSubnet1H(fernTestValueVelocitySignupsPerSubnet1H) + obj.SetPhishing(fernTestValuePhishing) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -79920,14 +79265,14 @@ func TestSettersMarkExplicitRiskSettingsReasonWeights(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetVelocitySignupsPerEmailDomain1H_MarksExplicit", func(t *testing.T) { + t.Run("SetMalware_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskSettingsReasonWeights{} - var fernTestValueVelocitySignupsPerEmailDomain1H *float64 + obj := &RiskSettingsContentThresholds{} + var fernTestValueMalware *float64 // Act - obj.SetVelocitySignupsPerEmailDomain1H(fernTestValueVelocitySignupsPerEmailDomain1H) + obj.SetMalware(fernTestValueMalware) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -79951,14 +79296,14 @@ func TestSettersMarkExplicitRiskSettingsReasonWeights(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetVelocitySignupsPerMailbox24H_MarksExplicit", func(t *testing.T) { + t.Run("SetFraud_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskSettingsReasonWeights{} - var fernTestValueVelocitySignupsPerMailbox24H *float64 + obj := &RiskSettingsContentThresholds{} + var fernTestValueFraud *float64 // Act - obj.SetVelocitySignupsPerMailbox24H(fernTestValueVelocitySignupsPerMailbox24H) + obj.SetFraud(fernTestValueFraud) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -79982,14 +79327,11179 @@ func TestSettersMarkExplicitRiskSettingsReasonWeights(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetVelocitySignupsPerDevice24H_MarksExplicit", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &RiskSettingsReasonWeights{} - var fernTestValueVelocitySignupsPerDevice24H *float64 +} - // Act - obj.SetVelocitySignupsPerDevice24H(fernTestValueVelocitySignupsPerDevice24H) +func TestSettersRiskSettingsReasonWeights(t *testing.T) { + t.Run("SetEmailInvalid", func(t *testing.T) { + obj := &RiskSettingsReasonWeights{} + var fernTestValueEmailInvalid *float64 + obj.SetEmailInvalid(fernTestValueEmailInvalid) + assert.Equal(t, fernTestValueEmailInvalid, obj.EmailInvalid) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetEmailDisposable", func(t *testing.T) { + obj := &RiskSettingsReasonWeights{} + var fernTestValueEmailDisposable *float64 + obj.SetEmailDisposable(fernTestValueEmailDisposable) + assert.Equal(t, fernTestValueEmailDisposable, obj.EmailDisposable) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetEmailUndeliverable", func(t *testing.T) { + obj := &RiskSettingsReasonWeights{} + var fernTestValueEmailUndeliverable *float64 + obj.SetEmailUndeliverable(fernTestValueEmailUndeliverable) + assert.Equal(t, fernTestValueEmailUndeliverable, obj.EmailUndeliverable) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetEmailRoleAccount", func(t *testing.T) { + obj := &RiskSettingsReasonWeights{} + var fernTestValueEmailRoleAccount *float64 + obj.SetEmailRoleAccount(fernTestValueEmailRoleAccount) + assert.Equal(t, fernTestValueEmailRoleAccount, obj.EmailRoleAccount) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetEmailTypo", func(t *testing.T) { + obj := &RiskSettingsReasonWeights{} + var fernTestValueEmailTypo *float64 + obj.SetEmailTypo(fernTestValueEmailTypo) + assert.Equal(t, fernTestValueEmailTypo, obj.EmailTypo) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetEmailDomainNew", func(t *testing.T) { + obj := &RiskSettingsReasonWeights{} + var fernTestValueEmailDomainNew *float64 + obj.SetEmailDomainNew(fernTestValueEmailDomainNew) + assert.Equal(t, fernTestValueEmailDomainNew, obj.EmailDomainNew) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetIPTor", func(t *testing.T) { + obj := &RiskSettingsReasonWeights{} + var fernTestValueIPTor *float64 + obj.SetIPTor(fernTestValueIPTor) + assert.Equal(t, fernTestValueIPTor, obj.IPTor) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetIPVpnNetwork", func(t *testing.T) { + obj := &RiskSettingsReasonWeights{} + var fernTestValueIPVpnNetwork *float64 + obj.SetIPVpnNetwork(fernTestValueIPVpnNetwork) + assert.Equal(t, fernTestValueIPVpnNetwork, obj.IPVpnNetwork) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetIPHostingProvider", func(t *testing.T) { + obj := &RiskSettingsReasonWeights{} + var fernTestValueIPHostingProvider *float64 + obj.SetIPHostingProvider(fernTestValueIPHostingProvider) + assert.Equal(t, fernTestValueIPHostingProvider, obj.IPHostingProvider) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetIPVpn", func(t *testing.T) { + obj := &RiskSettingsReasonWeights{} + var fernTestValueIPVpn *float64 + obj.SetIPVpn(fernTestValueIPVpn) + assert.Equal(t, fernTestValueIPVpn, obj.IPVpn) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetIPProxy", func(t *testing.T) { + obj := &RiskSettingsReasonWeights{} + var fernTestValueIPProxy *float64 + obj.SetIPProxy(fernTestValueIPProxy) + assert.Equal(t, fernTestValueIPProxy, obj.IPProxy) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetIPRelay", func(t *testing.T) { + obj := &RiskSettingsReasonWeights{} + var fernTestValueIPRelay *float64 + obj.SetIPRelay(fernTestValueIPRelay) + assert.Equal(t, fernTestValueIPRelay, obj.IPRelay) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetIPPrivate", func(t *testing.T) { + obj := &RiskSettingsReasonWeights{} + var fernTestValueIPPrivate *float64 + obj.SetIPPrivate(fernTestValueIPPrivate) + assert.Equal(t, fernTestValueIPPrivate, obj.IPPrivate) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetVelocitySignupsPerIP1H", func(t *testing.T) { + obj := &RiskSettingsReasonWeights{} + var fernTestValueVelocitySignupsPerIP1H *float64 + obj.SetVelocitySignupsPerIP1H(fernTestValueVelocitySignupsPerIP1H) + assert.Equal(t, fernTestValueVelocitySignupsPerIP1H, obj.VelocitySignupsPerIP1H) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetVelocitySignupsPerIP24H", func(t *testing.T) { + obj := &RiskSettingsReasonWeights{} + var fernTestValueVelocitySignupsPerIP24H *float64 + obj.SetVelocitySignupsPerIP24H(fernTestValueVelocitySignupsPerIP24H) + assert.Equal(t, fernTestValueVelocitySignupsPerIP24H, obj.VelocitySignupsPerIP24H) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetVelocitySignupsPerSubnet1H", func(t *testing.T) { + obj := &RiskSettingsReasonWeights{} + var fernTestValueVelocitySignupsPerSubnet1H *float64 + obj.SetVelocitySignupsPerSubnet1H(fernTestValueVelocitySignupsPerSubnet1H) + assert.Equal(t, fernTestValueVelocitySignupsPerSubnet1H, obj.VelocitySignupsPerSubnet1H) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetVelocitySignupsPerEmailDomain1H", func(t *testing.T) { + obj := &RiskSettingsReasonWeights{} + var fernTestValueVelocitySignupsPerEmailDomain1H *float64 + obj.SetVelocitySignupsPerEmailDomain1H(fernTestValueVelocitySignupsPerEmailDomain1H) + assert.Equal(t, fernTestValueVelocitySignupsPerEmailDomain1H, obj.VelocitySignupsPerEmailDomain1H) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetVelocitySignupsPerMailbox24H", func(t *testing.T) { + obj := &RiskSettingsReasonWeights{} + var fernTestValueVelocitySignupsPerMailbox24H *float64 + obj.SetVelocitySignupsPerMailbox24H(fernTestValueVelocitySignupsPerMailbox24H) + assert.Equal(t, fernTestValueVelocitySignupsPerMailbox24H, obj.VelocitySignupsPerMailbox24H) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetVelocitySignupsPerDevice24H", func(t *testing.T) { + obj := &RiskSettingsReasonWeights{} + var fernTestValueVelocitySignupsPerDevice24H *float64 + obj.SetVelocitySignupsPerDevice24H(fernTestValueVelocitySignupsPerDevice24H) + assert.Equal(t, fernTestValueVelocitySignupsPerDevice24H, obj.VelocitySignupsPerDevice24H) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetVelocityCheckoutsPerIP1H", func(t *testing.T) { + obj := &RiskSettingsReasonWeights{} + var fernTestValueVelocityCheckoutsPerIP1H *float64 + obj.SetVelocityCheckoutsPerIP1H(fernTestValueVelocityCheckoutsPerIP1H) + assert.Equal(t, fernTestValueVelocityCheckoutsPerIP1H, obj.VelocityCheckoutsPerIP1H) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetVelocityCheckoutsPerUser1H", func(t *testing.T) { + obj := &RiskSettingsReasonWeights{} + var fernTestValueVelocityCheckoutsPerUser1H *float64 + obj.SetVelocityCheckoutsPerUser1H(fernTestValueVelocityCheckoutsPerUser1H) + assert.Equal(t, fernTestValueVelocityCheckoutsPerUser1H, obj.VelocityCheckoutsPerUser1H) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetVelocityCheckoutsPerCard24H", func(t *testing.T) { + obj := &RiskSettingsReasonWeights{} + var fernTestValueVelocityCheckoutsPerCard24H *float64 + obj.SetVelocityCheckoutsPerCard24H(fernTestValueVelocityCheckoutsPerCard24H) + assert.Equal(t, fernTestValueVelocityCheckoutsPerCard24H, obj.VelocityCheckoutsPerCard24H) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetVelocityLoginsPerIP1H", func(t *testing.T) { + obj := &RiskSettingsReasonWeights{} + var fernTestValueVelocityLoginsPerIP1H *float64 + obj.SetVelocityLoginsPerIP1H(fernTestValueVelocityLoginsPerIP1H) + assert.Equal(t, fernTestValueVelocityLoginsPerIP1H, obj.VelocityLoginsPerIP1H) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetVelocityLoginsPerUser1H", func(t *testing.T) { + obj := &RiskSettingsReasonWeights{} + var fernTestValueVelocityLoginsPerUser1H *float64 + obj.SetVelocityLoginsPerUser1H(fernTestValueVelocityLoginsPerUser1H) + assert.Equal(t, fernTestValueVelocityLoginsPerUser1H, obj.VelocityLoginsPerUser1H) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetVelocityEventsPerIP1H", func(t *testing.T) { + obj := &RiskSettingsReasonWeights{} + var fernTestValueVelocityEventsPerIP1H *float64 + obj.SetVelocityEventsPerIP1H(fernTestValueVelocityEventsPerIP1H) + assert.Equal(t, fernTestValueVelocityEventsPerIP1H, obj.VelocityEventsPerIP1H) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetVelocityEventsPerUser1H", func(t *testing.T) { + obj := &RiskSettingsReasonWeights{} + var fernTestValueVelocityEventsPerUser1H *float64 + obj.SetVelocityEventsPerUser1H(fernTestValueVelocityEventsPerUser1H) + assert.Equal(t, fernTestValueVelocityEventsPerUser1H, obj.VelocityEventsPerUser1H) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetDuplicateCanonicalMailbox", func(t *testing.T) { + obj := &RiskSettingsReasonWeights{} + var fernTestValueDuplicateCanonicalMailbox *float64 + obj.SetDuplicateCanonicalMailbox(fernTestValueDuplicateCanonicalMailbox) + assert.Equal(t, fernTestValueDuplicateCanonicalMailbox, obj.DuplicateCanonicalMailbox) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetDuplicateDevice", func(t *testing.T) { + obj := &RiskSettingsReasonWeights{} + var fernTestValueDuplicateDevice *float64 + obj.SetDuplicateDevice(fernTestValueDuplicateDevice) + assert.Equal(t, fernTestValueDuplicateDevice, obj.DuplicateDevice) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetHistoryFraudMailbox", func(t *testing.T) { + obj := &RiskSettingsReasonWeights{} + var fernTestValueHistoryFraudMailbox *float64 + obj.SetHistoryFraudMailbox(fernTestValueHistoryFraudMailbox) + assert.Equal(t, fernTestValueHistoryFraudMailbox, obj.HistoryFraudMailbox) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetHistoryFraudUser", func(t *testing.T) { + obj := &RiskSettingsReasonWeights{} + var fernTestValueHistoryFraudUser *float64 + obj.SetHistoryFraudUser(fernTestValueHistoryFraudUser) + assert.Equal(t, fernTestValueHistoryFraudUser, obj.HistoryFraudUser) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetHistoryFraudIP", func(t *testing.T) { + obj := &RiskSettingsReasonWeights{} + var fernTestValueHistoryFraudIP *float64 + obj.SetHistoryFraudIP(fernTestValueHistoryFraudIP) + assert.Equal(t, fernTestValueHistoryFraudIP, obj.HistoryFraudIP) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetHistoryFraudSubnet", func(t *testing.T) { + obj := &RiskSettingsReasonWeights{} + var fernTestValueHistoryFraudSubnet *float64 + obj.SetHistoryFraudSubnet(fernTestValueHistoryFraudSubnet) + assert.Equal(t, fernTestValueHistoryFraudSubnet, obj.HistoryFraudSubnet) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetHistoryFraudCard", func(t *testing.T) { + obj := &RiskSettingsReasonWeights{} + var fernTestValueHistoryFraudCard *float64 + obj.SetHistoryFraudCard(fernTestValueHistoryFraudCard) + assert.Equal(t, fernTestValueHistoryFraudCard, obj.HistoryFraudCard) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetHistoryFraudDevice", func(t *testing.T) { + obj := &RiskSettingsReasonWeights{} + var fernTestValueHistoryFraudDevice *float64 + obj.SetHistoryFraudDevice(fernTestValueHistoryFraudDevice) + assert.Equal(t, fernTestValueHistoryFraudDevice, obj.HistoryFraudDevice) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetCheckoutCardCountryMismatch", func(t *testing.T) { + obj := &RiskSettingsReasonWeights{} + var fernTestValueCheckoutCardCountryMismatch *float64 + obj.SetCheckoutCardCountryMismatch(fernTestValueCheckoutCardCountryMismatch) + assert.Equal(t, fernTestValueCheckoutCardCountryMismatch, obj.CheckoutCardCountryMismatch) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetCheckoutBillingCountryMismatch", func(t *testing.T) { + obj := &RiskSettingsReasonWeights{} + var fernTestValueCheckoutBillingCountryMismatch *float64 + obj.SetCheckoutBillingCountryMismatch(fernTestValueCheckoutBillingCountryMismatch) + assert.Equal(t, fernTestValueCheckoutBillingCountryMismatch, obj.CheckoutBillingCountryMismatch) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetCheckoutPrepaidCard", func(t *testing.T) { + obj := &RiskSettingsReasonWeights{} + var fernTestValueCheckoutPrepaidCard *float64 + obj.SetCheckoutPrepaidCard(fernTestValueCheckoutPrepaidCard) + assert.Equal(t, fernTestValueCheckoutPrepaidCard, obj.CheckoutPrepaidCard) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetDeviceAutomation", func(t *testing.T) { + obj := &RiskSettingsReasonWeights{} + var fernTestValueDeviceAutomation *float64 + obj.SetDeviceAutomation(fernTestValueDeviceAutomation) + assert.Equal(t, fernTestValueDeviceAutomation, obj.DeviceAutomation) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetDeviceInvalid", func(t *testing.T) { + obj := &RiskSettingsReasonWeights{} + var fernTestValueDeviceInvalid *float64 + obj.SetDeviceInvalid(fernTestValueDeviceInvalid) + assert.Equal(t, fernTestValueDeviceInvalid, obj.DeviceInvalid) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetLoginNewCountry", func(t *testing.T) { + obj := &RiskSettingsReasonWeights{} + var fernTestValueLoginNewCountry *float64 + obj.SetLoginNewCountry(fernTestValueLoginNewCountry) + assert.Equal(t, fernTestValueLoginNewCountry, obj.LoginNewCountry) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetLoginNewNetwork", func(t *testing.T) { + obj := &RiskSettingsReasonWeights{} + var fernTestValueLoginNewNetwork *float64 + obj.SetLoginNewNetwork(fernTestValueLoginNewNetwork) + assert.Equal(t, fernTestValueLoginNewNetwork, obj.LoginNewNetwork) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetCaptchaFailed", func(t *testing.T) { + obj := &RiskSettingsReasonWeights{} + var fernTestValueCaptchaFailed *float64 + obj.SetCaptchaFailed(fernTestValueCaptchaFailed) + assert.Equal(t, fernTestValueCaptchaFailed, obj.CaptchaFailed) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetCaptchaMissing", func(t *testing.T) { + obj := &RiskSettingsReasonWeights{} + var fernTestValueCaptchaMissing *float64 + obj.SetCaptchaMissing(fernTestValueCaptchaMissing) + assert.Equal(t, fernTestValueCaptchaMissing, obj.CaptchaMissing) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetContentSpam", func(t *testing.T) { + obj := &RiskSettingsReasonWeights{} + var fernTestValueContentSpam *float64 + obj.SetContentSpam(fernTestValueContentSpam) + assert.Equal(t, fernTestValueContentSpam, obj.ContentSpam) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetContentPhishing", func(t *testing.T) { + obj := &RiskSettingsReasonWeights{} + var fernTestValueContentPhishing *float64 + obj.SetContentPhishing(fernTestValueContentPhishing) + assert.Equal(t, fernTestValueContentPhishing, obj.ContentPhishing) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetContentMalware", func(t *testing.T) { + obj := &RiskSettingsReasonWeights{} + var fernTestValueContentMalware *float64 + obj.SetContentMalware(fernTestValueContentMalware) + assert.Equal(t, fernTestValueContentMalware, obj.ContentMalware) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetContentFraud", func(t *testing.T) { + obj := &RiskSettingsReasonWeights{} + var fernTestValueContentFraud *float64 + obj.SetContentFraud(fernTestValueContentFraud) + assert.Equal(t, fernTestValueContentFraud, obj.ContentFraud) + assert.NotNil(t, obj.explicitFields) + }) + +} + +func TestGettersRiskSettingsReasonWeights(t *testing.T) { + t.Run("GetEmailInvalid", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskSettingsReasonWeights{} + var expected *float64 + obj.EmailInvalid = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetEmailInvalid(), "getter should return the property value") + }) + + t.Run("GetEmailInvalid_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskSettingsReasonWeights{} + obj.EmailInvalid = nil + + // Act & Assert + assert.Nil(t, obj.GetEmailInvalid(), "getter should return nil when property is nil") + }) + + t.Run("GetEmailInvalid_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *RiskSettingsReasonWeights + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetEmailInvalid() // Should return zero value + }) + + t.Run("GetEmailDisposable", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskSettingsReasonWeights{} + var expected *float64 + obj.EmailDisposable = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetEmailDisposable(), "getter should return the property value") + }) + + t.Run("GetEmailDisposable_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskSettingsReasonWeights{} + obj.EmailDisposable = nil + + // Act & Assert + assert.Nil(t, obj.GetEmailDisposable(), "getter should return nil when property is nil") + }) + + t.Run("GetEmailDisposable_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *RiskSettingsReasonWeights + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetEmailDisposable() // Should return zero value + }) + + t.Run("GetEmailUndeliverable", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskSettingsReasonWeights{} + var expected *float64 + obj.EmailUndeliverable = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetEmailUndeliverable(), "getter should return the property value") + }) + + t.Run("GetEmailUndeliverable_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskSettingsReasonWeights{} + obj.EmailUndeliverable = nil + + // Act & Assert + assert.Nil(t, obj.GetEmailUndeliverable(), "getter should return nil when property is nil") + }) + + t.Run("GetEmailUndeliverable_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *RiskSettingsReasonWeights + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetEmailUndeliverable() // Should return zero value + }) + + t.Run("GetEmailRoleAccount", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskSettingsReasonWeights{} + var expected *float64 + obj.EmailRoleAccount = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetEmailRoleAccount(), "getter should return the property value") + }) + + t.Run("GetEmailRoleAccount_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskSettingsReasonWeights{} + obj.EmailRoleAccount = nil + + // Act & Assert + assert.Nil(t, obj.GetEmailRoleAccount(), "getter should return nil when property is nil") + }) + + t.Run("GetEmailRoleAccount_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *RiskSettingsReasonWeights + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetEmailRoleAccount() // Should return zero value + }) + + t.Run("GetEmailTypo", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskSettingsReasonWeights{} + var expected *float64 + obj.EmailTypo = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetEmailTypo(), "getter should return the property value") + }) + + t.Run("GetEmailTypo_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskSettingsReasonWeights{} + obj.EmailTypo = nil + + // Act & Assert + assert.Nil(t, obj.GetEmailTypo(), "getter should return nil when property is nil") + }) + + t.Run("GetEmailTypo_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *RiskSettingsReasonWeights + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetEmailTypo() // Should return zero value + }) + + t.Run("GetEmailDomainNew", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskSettingsReasonWeights{} + var expected *float64 + obj.EmailDomainNew = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetEmailDomainNew(), "getter should return the property value") + }) + + t.Run("GetEmailDomainNew_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskSettingsReasonWeights{} + obj.EmailDomainNew = nil + + // Act & Assert + assert.Nil(t, obj.GetEmailDomainNew(), "getter should return nil when property is nil") + }) + + t.Run("GetEmailDomainNew_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *RiskSettingsReasonWeights + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetEmailDomainNew() // Should return zero value + }) + + t.Run("GetIPTor", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskSettingsReasonWeights{} + var expected *float64 + obj.IPTor = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetIPTor(), "getter should return the property value") + }) + + t.Run("GetIPTor_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskSettingsReasonWeights{} + obj.IPTor = nil + + // Act & Assert + assert.Nil(t, obj.GetIPTor(), "getter should return nil when property is nil") + }) + + t.Run("GetIPTor_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *RiskSettingsReasonWeights + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetIPTor() // Should return zero value + }) + + t.Run("GetIPVpnNetwork", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskSettingsReasonWeights{} + var expected *float64 + obj.IPVpnNetwork = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetIPVpnNetwork(), "getter should return the property value") + }) + + t.Run("GetIPVpnNetwork_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskSettingsReasonWeights{} + obj.IPVpnNetwork = nil + + // Act & Assert + assert.Nil(t, obj.GetIPVpnNetwork(), "getter should return nil when property is nil") + }) + + t.Run("GetIPVpnNetwork_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *RiskSettingsReasonWeights + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetIPVpnNetwork() // Should return zero value + }) + + t.Run("GetIPHostingProvider", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskSettingsReasonWeights{} + var expected *float64 + obj.IPHostingProvider = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetIPHostingProvider(), "getter should return the property value") + }) + + t.Run("GetIPHostingProvider_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskSettingsReasonWeights{} + obj.IPHostingProvider = nil + + // Act & Assert + assert.Nil(t, obj.GetIPHostingProvider(), "getter should return nil when property is nil") + }) + + t.Run("GetIPHostingProvider_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *RiskSettingsReasonWeights + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetIPHostingProvider() // Should return zero value + }) + + t.Run("GetIPVpn", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskSettingsReasonWeights{} + var expected *float64 + obj.IPVpn = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetIPVpn(), "getter should return the property value") + }) + + t.Run("GetIPVpn_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskSettingsReasonWeights{} + obj.IPVpn = nil + + // Act & Assert + assert.Nil(t, obj.GetIPVpn(), "getter should return nil when property is nil") + }) + + t.Run("GetIPVpn_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *RiskSettingsReasonWeights + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetIPVpn() // Should return zero value + }) + + t.Run("GetIPProxy", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskSettingsReasonWeights{} + var expected *float64 + obj.IPProxy = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetIPProxy(), "getter should return the property value") + }) + + t.Run("GetIPProxy_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskSettingsReasonWeights{} + obj.IPProxy = nil + + // Act & Assert + assert.Nil(t, obj.GetIPProxy(), "getter should return nil when property is nil") + }) + + t.Run("GetIPProxy_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *RiskSettingsReasonWeights + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetIPProxy() // Should return zero value + }) + + t.Run("GetIPRelay", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskSettingsReasonWeights{} + var expected *float64 + obj.IPRelay = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetIPRelay(), "getter should return the property value") + }) + + t.Run("GetIPRelay_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskSettingsReasonWeights{} + obj.IPRelay = nil + + // Act & Assert + assert.Nil(t, obj.GetIPRelay(), "getter should return nil when property is nil") + }) + + t.Run("GetIPRelay_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *RiskSettingsReasonWeights + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetIPRelay() // Should return zero value + }) + + t.Run("GetIPPrivate", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskSettingsReasonWeights{} + var expected *float64 + obj.IPPrivate = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetIPPrivate(), "getter should return the property value") + }) + + t.Run("GetIPPrivate_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskSettingsReasonWeights{} + obj.IPPrivate = nil + + // Act & Assert + assert.Nil(t, obj.GetIPPrivate(), "getter should return nil when property is nil") + }) + + t.Run("GetIPPrivate_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *RiskSettingsReasonWeights + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetIPPrivate() // Should return zero value + }) + + t.Run("GetVelocitySignupsPerIP1H", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskSettingsReasonWeights{} + var expected *float64 + obj.VelocitySignupsPerIP1H = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetVelocitySignupsPerIP1H(), "getter should return the property value") + }) + + t.Run("GetVelocitySignupsPerIP1H_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskSettingsReasonWeights{} + obj.VelocitySignupsPerIP1H = nil + + // Act & Assert + assert.Nil(t, obj.GetVelocitySignupsPerIP1H(), "getter should return nil when property is nil") + }) + + t.Run("GetVelocitySignupsPerIP1H_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *RiskSettingsReasonWeights + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetVelocitySignupsPerIP1H() // Should return zero value + }) + + t.Run("GetVelocitySignupsPerIP24H", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskSettingsReasonWeights{} + var expected *float64 + obj.VelocitySignupsPerIP24H = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetVelocitySignupsPerIP24H(), "getter should return the property value") + }) + + t.Run("GetVelocitySignupsPerIP24H_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskSettingsReasonWeights{} + obj.VelocitySignupsPerIP24H = nil + + // Act & Assert + assert.Nil(t, obj.GetVelocitySignupsPerIP24H(), "getter should return nil when property is nil") + }) + + t.Run("GetVelocitySignupsPerIP24H_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *RiskSettingsReasonWeights + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetVelocitySignupsPerIP24H() // Should return zero value + }) + + t.Run("GetVelocitySignupsPerSubnet1H", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskSettingsReasonWeights{} + var expected *float64 + obj.VelocitySignupsPerSubnet1H = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetVelocitySignupsPerSubnet1H(), "getter should return the property value") + }) + + t.Run("GetVelocitySignupsPerSubnet1H_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskSettingsReasonWeights{} + obj.VelocitySignupsPerSubnet1H = nil + + // Act & Assert + assert.Nil(t, obj.GetVelocitySignupsPerSubnet1H(), "getter should return nil when property is nil") + }) + + t.Run("GetVelocitySignupsPerSubnet1H_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *RiskSettingsReasonWeights + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetVelocitySignupsPerSubnet1H() // Should return zero value + }) + + t.Run("GetVelocitySignupsPerEmailDomain1H", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskSettingsReasonWeights{} + var expected *float64 + obj.VelocitySignupsPerEmailDomain1H = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetVelocitySignupsPerEmailDomain1H(), "getter should return the property value") + }) + + t.Run("GetVelocitySignupsPerEmailDomain1H_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskSettingsReasonWeights{} + obj.VelocitySignupsPerEmailDomain1H = nil + + // Act & Assert + assert.Nil(t, obj.GetVelocitySignupsPerEmailDomain1H(), "getter should return nil when property is nil") + }) + + t.Run("GetVelocitySignupsPerEmailDomain1H_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *RiskSettingsReasonWeights + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetVelocitySignupsPerEmailDomain1H() // Should return zero value + }) + + t.Run("GetVelocitySignupsPerMailbox24H", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskSettingsReasonWeights{} + var expected *float64 + obj.VelocitySignupsPerMailbox24H = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetVelocitySignupsPerMailbox24H(), "getter should return the property value") + }) + + t.Run("GetVelocitySignupsPerMailbox24H_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskSettingsReasonWeights{} + obj.VelocitySignupsPerMailbox24H = nil + + // Act & Assert + assert.Nil(t, obj.GetVelocitySignupsPerMailbox24H(), "getter should return nil when property is nil") + }) + + t.Run("GetVelocitySignupsPerMailbox24H_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *RiskSettingsReasonWeights + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetVelocitySignupsPerMailbox24H() // Should return zero value + }) + + t.Run("GetVelocitySignupsPerDevice24H", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskSettingsReasonWeights{} + var expected *float64 + obj.VelocitySignupsPerDevice24H = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetVelocitySignupsPerDevice24H(), "getter should return the property value") + }) + + t.Run("GetVelocitySignupsPerDevice24H_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskSettingsReasonWeights{} + obj.VelocitySignupsPerDevice24H = nil + + // Act & Assert + assert.Nil(t, obj.GetVelocitySignupsPerDevice24H(), "getter should return nil when property is nil") + }) + + t.Run("GetVelocitySignupsPerDevice24H_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *RiskSettingsReasonWeights + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetVelocitySignupsPerDevice24H() // Should return zero value + }) + + t.Run("GetVelocityCheckoutsPerIP1H", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskSettingsReasonWeights{} + var expected *float64 + obj.VelocityCheckoutsPerIP1H = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetVelocityCheckoutsPerIP1H(), "getter should return the property value") + }) + + t.Run("GetVelocityCheckoutsPerIP1H_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskSettingsReasonWeights{} + obj.VelocityCheckoutsPerIP1H = nil + + // Act & Assert + assert.Nil(t, obj.GetVelocityCheckoutsPerIP1H(), "getter should return nil when property is nil") + }) + + t.Run("GetVelocityCheckoutsPerIP1H_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *RiskSettingsReasonWeights + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetVelocityCheckoutsPerIP1H() // Should return zero value + }) + + t.Run("GetVelocityCheckoutsPerUser1H", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskSettingsReasonWeights{} + var expected *float64 + obj.VelocityCheckoutsPerUser1H = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetVelocityCheckoutsPerUser1H(), "getter should return the property value") + }) + + t.Run("GetVelocityCheckoutsPerUser1H_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskSettingsReasonWeights{} + obj.VelocityCheckoutsPerUser1H = nil + + // Act & Assert + assert.Nil(t, obj.GetVelocityCheckoutsPerUser1H(), "getter should return nil when property is nil") + }) + + t.Run("GetVelocityCheckoutsPerUser1H_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *RiskSettingsReasonWeights + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetVelocityCheckoutsPerUser1H() // Should return zero value + }) + + t.Run("GetVelocityCheckoutsPerCard24H", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskSettingsReasonWeights{} + var expected *float64 + obj.VelocityCheckoutsPerCard24H = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetVelocityCheckoutsPerCard24H(), "getter should return the property value") + }) + + t.Run("GetVelocityCheckoutsPerCard24H_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskSettingsReasonWeights{} + obj.VelocityCheckoutsPerCard24H = nil + + // Act & Assert + assert.Nil(t, obj.GetVelocityCheckoutsPerCard24H(), "getter should return nil when property is nil") + }) + + t.Run("GetVelocityCheckoutsPerCard24H_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *RiskSettingsReasonWeights + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetVelocityCheckoutsPerCard24H() // Should return zero value + }) + + t.Run("GetVelocityLoginsPerIP1H", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskSettingsReasonWeights{} + var expected *float64 + obj.VelocityLoginsPerIP1H = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetVelocityLoginsPerIP1H(), "getter should return the property value") + }) + + t.Run("GetVelocityLoginsPerIP1H_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskSettingsReasonWeights{} + obj.VelocityLoginsPerIP1H = nil + + // Act & Assert + assert.Nil(t, obj.GetVelocityLoginsPerIP1H(), "getter should return nil when property is nil") + }) + + t.Run("GetVelocityLoginsPerIP1H_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *RiskSettingsReasonWeights + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetVelocityLoginsPerIP1H() // Should return zero value + }) + + t.Run("GetVelocityLoginsPerUser1H", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskSettingsReasonWeights{} + var expected *float64 + obj.VelocityLoginsPerUser1H = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetVelocityLoginsPerUser1H(), "getter should return the property value") + }) + + t.Run("GetVelocityLoginsPerUser1H_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskSettingsReasonWeights{} + obj.VelocityLoginsPerUser1H = nil + + // Act & Assert + assert.Nil(t, obj.GetVelocityLoginsPerUser1H(), "getter should return nil when property is nil") + }) + + t.Run("GetVelocityLoginsPerUser1H_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *RiskSettingsReasonWeights + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetVelocityLoginsPerUser1H() // Should return zero value + }) + + t.Run("GetVelocityEventsPerIP1H", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskSettingsReasonWeights{} + var expected *float64 + obj.VelocityEventsPerIP1H = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetVelocityEventsPerIP1H(), "getter should return the property value") + }) + + t.Run("GetVelocityEventsPerIP1H_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskSettingsReasonWeights{} + obj.VelocityEventsPerIP1H = nil + + // Act & Assert + assert.Nil(t, obj.GetVelocityEventsPerIP1H(), "getter should return nil when property is nil") + }) + + t.Run("GetVelocityEventsPerIP1H_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *RiskSettingsReasonWeights + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetVelocityEventsPerIP1H() // Should return zero value + }) + + t.Run("GetVelocityEventsPerUser1H", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskSettingsReasonWeights{} + var expected *float64 + obj.VelocityEventsPerUser1H = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetVelocityEventsPerUser1H(), "getter should return the property value") + }) + + t.Run("GetVelocityEventsPerUser1H_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskSettingsReasonWeights{} + obj.VelocityEventsPerUser1H = nil + + // Act & Assert + assert.Nil(t, obj.GetVelocityEventsPerUser1H(), "getter should return nil when property is nil") + }) + + t.Run("GetVelocityEventsPerUser1H_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *RiskSettingsReasonWeights + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetVelocityEventsPerUser1H() // Should return zero value + }) + + t.Run("GetDuplicateCanonicalMailbox", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskSettingsReasonWeights{} + var expected *float64 + obj.DuplicateCanonicalMailbox = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetDuplicateCanonicalMailbox(), "getter should return the property value") + }) + + t.Run("GetDuplicateCanonicalMailbox_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskSettingsReasonWeights{} + obj.DuplicateCanonicalMailbox = nil + + // Act & Assert + assert.Nil(t, obj.GetDuplicateCanonicalMailbox(), "getter should return nil when property is nil") + }) + + t.Run("GetDuplicateCanonicalMailbox_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *RiskSettingsReasonWeights + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetDuplicateCanonicalMailbox() // Should return zero value + }) + + t.Run("GetDuplicateDevice", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskSettingsReasonWeights{} + var expected *float64 + obj.DuplicateDevice = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetDuplicateDevice(), "getter should return the property value") + }) + + t.Run("GetDuplicateDevice_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskSettingsReasonWeights{} + obj.DuplicateDevice = nil + + // Act & Assert + assert.Nil(t, obj.GetDuplicateDevice(), "getter should return nil when property is nil") + }) + + t.Run("GetDuplicateDevice_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *RiskSettingsReasonWeights + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetDuplicateDevice() // Should return zero value + }) + + t.Run("GetHistoryFraudMailbox", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskSettingsReasonWeights{} + var expected *float64 + obj.HistoryFraudMailbox = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetHistoryFraudMailbox(), "getter should return the property value") + }) + + t.Run("GetHistoryFraudMailbox_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskSettingsReasonWeights{} + obj.HistoryFraudMailbox = nil + + // Act & Assert + assert.Nil(t, obj.GetHistoryFraudMailbox(), "getter should return nil when property is nil") + }) + + t.Run("GetHistoryFraudMailbox_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *RiskSettingsReasonWeights + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetHistoryFraudMailbox() // Should return zero value + }) + + t.Run("GetHistoryFraudUser", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskSettingsReasonWeights{} + var expected *float64 + obj.HistoryFraudUser = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetHistoryFraudUser(), "getter should return the property value") + }) + + t.Run("GetHistoryFraudUser_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskSettingsReasonWeights{} + obj.HistoryFraudUser = nil + + // Act & Assert + assert.Nil(t, obj.GetHistoryFraudUser(), "getter should return nil when property is nil") + }) + + t.Run("GetHistoryFraudUser_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *RiskSettingsReasonWeights + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetHistoryFraudUser() // Should return zero value + }) + + t.Run("GetHistoryFraudIP", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskSettingsReasonWeights{} + var expected *float64 + obj.HistoryFraudIP = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetHistoryFraudIP(), "getter should return the property value") + }) + + t.Run("GetHistoryFraudIP_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskSettingsReasonWeights{} + obj.HistoryFraudIP = nil + + // Act & Assert + assert.Nil(t, obj.GetHistoryFraudIP(), "getter should return nil when property is nil") + }) + + t.Run("GetHistoryFraudIP_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *RiskSettingsReasonWeights + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetHistoryFraudIP() // Should return zero value + }) + + t.Run("GetHistoryFraudSubnet", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskSettingsReasonWeights{} + var expected *float64 + obj.HistoryFraudSubnet = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetHistoryFraudSubnet(), "getter should return the property value") + }) + + t.Run("GetHistoryFraudSubnet_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskSettingsReasonWeights{} + obj.HistoryFraudSubnet = nil + + // Act & Assert + assert.Nil(t, obj.GetHistoryFraudSubnet(), "getter should return nil when property is nil") + }) + + t.Run("GetHistoryFraudSubnet_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *RiskSettingsReasonWeights + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetHistoryFraudSubnet() // Should return zero value + }) + + t.Run("GetHistoryFraudCard", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskSettingsReasonWeights{} + var expected *float64 + obj.HistoryFraudCard = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetHistoryFraudCard(), "getter should return the property value") + }) + + t.Run("GetHistoryFraudCard_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskSettingsReasonWeights{} + obj.HistoryFraudCard = nil + + // Act & Assert + assert.Nil(t, obj.GetHistoryFraudCard(), "getter should return nil when property is nil") + }) + + t.Run("GetHistoryFraudCard_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *RiskSettingsReasonWeights + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetHistoryFraudCard() // Should return zero value + }) + + t.Run("GetHistoryFraudDevice", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskSettingsReasonWeights{} + var expected *float64 + obj.HistoryFraudDevice = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetHistoryFraudDevice(), "getter should return the property value") + }) + + t.Run("GetHistoryFraudDevice_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskSettingsReasonWeights{} + obj.HistoryFraudDevice = nil + + // Act & Assert + assert.Nil(t, obj.GetHistoryFraudDevice(), "getter should return nil when property is nil") + }) + + t.Run("GetHistoryFraudDevice_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *RiskSettingsReasonWeights + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetHistoryFraudDevice() // Should return zero value + }) + + t.Run("GetCheckoutCardCountryMismatch", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskSettingsReasonWeights{} + var expected *float64 + obj.CheckoutCardCountryMismatch = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetCheckoutCardCountryMismatch(), "getter should return the property value") + }) + + t.Run("GetCheckoutCardCountryMismatch_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskSettingsReasonWeights{} + obj.CheckoutCardCountryMismatch = nil + + // Act & Assert + assert.Nil(t, obj.GetCheckoutCardCountryMismatch(), "getter should return nil when property is nil") + }) + + t.Run("GetCheckoutCardCountryMismatch_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *RiskSettingsReasonWeights + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetCheckoutCardCountryMismatch() // Should return zero value + }) + + t.Run("GetCheckoutBillingCountryMismatch", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskSettingsReasonWeights{} + var expected *float64 + obj.CheckoutBillingCountryMismatch = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetCheckoutBillingCountryMismatch(), "getter should return the property value") + }) + + t.Run("GetCheckoutBillingCountryMismatch_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskSettingsReasonWeights{} + obj.CheckoutBillingCountryMismatch = nil + + // Act & Assert + assert.Nil(t, obj.GetCheckoutBillingCountryMismatch(), "getter should return nil when property is nil") + }) + + t.Run("GetCheckoutBillingCountryMismatch_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *RiskSettingsReasonWeights + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetCheckoutBillingCountryMismatch() // Should return zero value + }) + + t.Run("GetCheckoutPrepaidCard", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskSettingsReasonWeights{} + var expected *float64 + obj.CheckoutPrepaidCard = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetCheckoutPrepaidCard(), "getter should return the property value") + }) + + t.Run("GetCheckoutPrepaidCard_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskSettingsReasonWeights{} + obj.CheckoutPrepaidCard = nil + + // Act & Assert + assert.Nil(t, obj.GetCheckoutPrepaidCard(), "getter should return nil when property is nil") + }) + + t.Run("GetCheckoutPrepaidCard_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *RiskSettingsReasonWeights + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetCheckoutPrepaidCard() // Should return zero value + }) + + t.Run("GetDeviceAutomation", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskSettingsReasonWeights{} + var expected *float64 + obj.DeviceAutomation = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetDeviceAutomation(), "getter should return the property value") + }) + + t.Run("GetDeviceAutomation_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskSettingsReasonWeights{} + obj.DeviceAutomation = nil + + // Act & Assert + assert.Nil(t, obj.GetDeviceAutomation(), "getter should return nil when property is nil") + }) + + t.Run("GetDeviceAutomation_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *RiskSettingsReasonWeights + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetDeviceAutomation() // Should return zero value + }) + + t.Run("GetDeviceInvalid", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskSettingsReasonWeights{} + var expected *float64 + obj.DeviceInvalid = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetDeviceInvalid(), "getter should return the property value") + }) + + t.Run("GetDeviceInvalid_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskSettingsReasonWeights{} + obj.DeviceInvalid = nil + + // Act & Assert + assert.Nil(t, obj.GetDeviceInvalid(), "getter should return nil when property is nil") + }) + + t.Run("GetDeviceInvalid_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *RiskSettingsReasonWeights + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetDeviceInvalid() // Should return zero value + }) + + t.Run("GetLoginNewCountry", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskSettingsReasonWeights{} + var expected *float64 + obj.LoginNewCountry = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetLoginNewCountry(), "getter should return the property value") + }) + + t.Run("GetLoginNewCountry_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskSettingsReasonWeights{} + obj.LoginNewCountry = nil + + // Act & Assert + assert.Nil(t, obj.GetLoginNewCountry(), "getter should return nil when property is nil") + }) + + t.Run("GetLoginNewCountry_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *RiskSettingsReasonWeights + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetLoginNewCountry() // Should return zero value + }) + + t.Run("GetLoginNewNetwork", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskSettingsReasonWeights{} + var expected *float64 + obj.LoginNewNetwork = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetLoginNewNetwork(), "getter should return the property value") + }) + + t.Run("GetLoginNewNetwork_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskSettingsReasonWeights{} + obj.LoginNewNetwork = nil + + // Act & Assert + assert.Nil(t, obj.GetLoginNewNetwork(), "getter should return nil when property is nil") + }) + + t.Run("GetLoginNewNetwork_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *RiskSettingsReasonWeights + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetLoginNewNetwork() // Should return zero value + }) + + t.Run("GetCaptchaFailed", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskSettingsReasonWeights{} + var expected *float64 + obj.CaptchaFailed = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetCaptchaFailed(), "getter should return the property value") + }) + + t.Run("GetCaptchaFailed_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskSettingsReasonWeights{} + obj.CaptchaFailed = nil + + // Act & Assert + assert.Nil(t, obj.GetCaptchaFailed(), "getter should return nil when property is nil") + }) + + t.Run("GetCaptchaFailed_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *RiskSettingsReasonWeights + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetCaptchaFailed() // Should return zero value + }) + + t.Run("GetCaptchaMissing", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskSettingsReasonWeights{} + var expected *float64 + obj.CaptchaMissing = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetCaptchaMissing(), "getter should return the property value") + }) + + t.Run("GetCaptchaMissing_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskSettingsReasonWeights{} + obj.CaptchaMissing = nil + + // Act & Assert + assert.Nil(t, obj.GetCaptchaMissing(), "getter should return nil when property is nil") + }) + + t.Run("GetCaptchaMissing_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *RiskSettingsReasonWeights + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetCaptchaMissing() // Should return zero value + }) + + t.Run("GetContentSpam", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskSettingsReasonWeights{} + var expected *float64 + obj.ContentSpam = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetContentSpam(), "getter should return the property value") + }) + + t.Run("GetContentSpam_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskSettingsReasonWeights{} + obj.ContentSpam = nil + + // Act & Assert + assert.Nil(t, obj.GetContentSpam(), "getter should return nil when property is nil") + }) + + t.Run("GetContentSpam_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *RiskSettingsReasonWeights + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetContentSpam() // Should return zero value + }) + + t.Run("GetContentPhishing", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskSettingsReasonWeights{} + var expected *float64 + obj.ContentPhishing = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetContentPhishing(), "getter should return the property value") + }) + + t.Run("GetContentPhishing_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskSettingsReasonWeights{} + obj.ContentPhishing = nil + + // Act & Assert + assert.Nil(t, obj.GetContentPhishing(), "getter should return nil when property is nil") + }) + + t.Run("GetContentPhishing_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *RiskSettingsReasonWeights + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetContentPhishing() // Should return zero value + }) + + t.Run("GetContentMalware", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskSettingsReasonWeights{} + var expected *float64 + obj.ContentMalware = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetContentMalware(), "getter should return the property value") + }) + + t.Run("GetContentMalware_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskSettingsReasonWeights{} + obj.ContentMalware = nil + + // Act & Assert + assert.Nil(t, obj.GetContentMalware(), "getter should return nil when property is nil") + }) + + t.Run("GetContentMalware_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *RiskSettingsReasonWeights + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetContentMalware() // Should return zero value + }) + + t.Run("GetContentFraud", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskSettingsReasonWeights{} + var expected *float64 + obj.ContentFraud = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetContentFraud(), "getter should return the property value") + }) + + t.Run("GetContentFraud_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskSettingsReasonWeights{} + obj.ContentFraud = nil + + // Act & Assert + assert.Nil(t, obj.GetContentFraud(), "getter should return nil when property is nil") + }) + + t.Run("GetContentFraud_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *RiskSettingsReasonWeights + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetContentFraud() // Should return zero value + }) + +} + +func TestSettersMarkExplicitRiskSettingsReasonWeights(t *testing.T) { + t.Run("SetEmailInvalid_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskSettingsReasonWeights{} + var fernTestValueEmailInvalid *float64 + + // Act + obj.SetEmailInvalid(fernTestValueEmailInvalid) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetEmailDisposable_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskSettingsReasonWeights{} + var fernTestValueEmailDisposable *float64 + + // Act + obj.SetEmailDisposable(fernTestValueEmailDisposable) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetEmailUndeliverable_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskSettingsReasonWeights{} + var fernTestValueEmailUndeliverable *float64 + + // Act + obj.SetEmailUndeliverable(fernTestValueEmailUndeliverable) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetEmailRoleAccount_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskSettingsReasonWeights{} + var fernTestValueEmailRoleAccount *float64 + + // Act + obj.SetEmailRoleAccount(fernTestValueEmailRoleAccount) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetEmailTypo_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskSettingsReasonWeights{} + var fernTestValueEmailTypo *float64 + + // Act + obj.SetEmailTypo(fernTestValueEmailTypo) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetEmailDomainNew_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskSettingsReasonWeights{} + var fernTestValueEmailDomainNew *float64 + + // Act + obj.SetEmailDomainNew(fernTestValueEmailDomainNew) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetIPTor_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskSettingsReasonWeights{} + var fernTestValueIPTor *float64 + + // Act + obj.SetIPTor(fernTestValueIPTor) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetIPVpnNetwork_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskSettingsReasonWeights{} + var fernTestValueIPVpnNetwork *float64 + + // Act + obj.SetIPVpnNetwork(fernTestValueIPVpnNetwork) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetIPHostingProvider_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskSettingsReasonWeights{} + var fernTestValueIPHostingProvider *float64 + + // Act + obj.SetIPHostingProvider(fernTestValueIPHostingProvider) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetIPVpn_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskSettingsReasonWeights{} + var fernTestValueIPVpn *float64 + + // Act + obj.SetIPVpn(fernTestValueIPVpn) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetIPProxy_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskSettingsReasonWeights{} + var fernTestValueIPProxy *float64 + + // Act + obj.SetIPProxy(fernTestValueIPProxy) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetIPRelay_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskSettingsReasonWeights{} + var fernTestValueIPRelay *float64 + + // Act + obj.SetIPRelay(fernTestValueIPRelay) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetIPPrivate_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskSettingsReasonWeights{} + var fernTestValueIPPrivate *float64 + + // Act + obj.SetIPPrivate(fernTestValueIPPrivate) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetVelocitySignupsPerIP1H_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskSettingsReasonWeights{} + var fernTestValueVelocitySignupsPerIP1H *float64 + + // Act + obj.SetVelocitySignupsPerIP1H(fernTestValueVelocitySignupsPerIP1H) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetVelocitySignupsPerIP24H_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskSettingsReasonWeights{} + var fernTestValueVelocitySignupsPerIP24H *float64 + + // Act + obj.SetVelocitySignupsPerIP24H(fernTestValueVelocitySignupsPerIP24H) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetVelocitySignupsPerSubnet1H_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskSettingsReasonWeights{} + var fernTestValueVelocitySignupsPerSubnet1H *float64 + + // Act + obj.SetVelocitySignupsPerSubnet1H(fernTestValueVelocitySignupsPerSubnet1H) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetVelocitySignupsPerEmailDomain1H_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskSettingsReasonWeights{} + var fernTestValueVelocitySignupsPerEmailDomain1H *float64 + + // Act + obj.SetVelocitySignupsPerEmailDomain1H(fernTestValueVelocitySignupsPerEmailDomain1H) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetVelocitySignupsPerMailbox24H_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskSettingsReasonWeights{} + var fernTestValueVelocitySignupsPerMailbox24H *float64 + + // Act + obj.SetVelocitySignupsPerMailbox24H(fernTestValueVelocitySignupsPerMailbox24H) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetVelocitySignupsPerDevice24H_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskSettingsReasonWeights{} + var fernTestValueVelocitySignupsPerDevice24H *float64 + + // Act + obj.SetVelocitySignupsPerDevice24H(fernTestValueVelocitySignupsPerDevice24H) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetVelocityCheckoutsPerIP1H_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskSettingsReasonWeights{} + var fernTestValueVelocityCheckoutsPerIP1H *float64 + + // Act + obj.SetVelocityCheckoutsPerIP1H(fernTestValueVelocityCheckoutsPerIP1H) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetVelocityCheckoutsPerUser1H_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskSettingsReasonWeights{} + var fernTestValueVelocityCheckoutsPerUser1H *float64 + + // Act + obj.SetVelocityCheckoutsPerUser1H(fernTestValueVelocityCheckoutsPerUser1H) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetVelocityCheckoutsPerCard24H_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskSettingsReasonWeights{} + var fernTestValueVelocityCheckoutsPerCard24H *float64 + + // Act + obj.SetVelocityCheckoutsPerCard24H(fernTestValueVelocityCheckoutsPerCard24H) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetVelocityLoginsPerIP1H_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskSettingsReasonWeights{} + var fernTestValueVelocityLoginsPerIP1H *float64 + + // Act + obj.SetVelocityLoginsPerIP1H(fernTestValueVelocityLoginsPerIP1H) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetVelocityLoginsPerUser1H_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskSettingsReasonWeights{} + var fernTestValueVelocityLoginsPerUser1H *float64 + + // Act + obj.SetVelocityLoginsPerUser1H(fernTestValueVelocityLoginsPerUser1H) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetVelocityEventsPerIP1H_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskSettingsReasonWeights{} + var fernTestValueVelocityEventsPerIP1H *float64 + + // Act + obj.SetVelocityEventsPerIP1H(fernTestValueVelocityEventsPerIP1H) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetVelocityEventsPerUser1H_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskSettingsReasonWeights{} + var fernTestValueVelocityEventsPerUser1H *float64 + + // Act + obj.SetVelocityEventsPerUser1H(fernTestValueVelocityEventsPerUser1H) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetDuplicateCanonicalMailbox_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskSettingsReasonWeights{} + var fernTestValueDuplicateCanonicalMailbox *float64 + + // Act + obj.SetDuplicateCanonicalMailbox(fernTestValueDuplicateCanonicalMailbox) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetDuplicateDevice_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskSettingsReasonWeights{} + var fernTestValueDuplicateDevice *float64 + + // Act + obj.SetDuplicateDevice(fernTestValueDuplicateDevice) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetHistoryFraudMailbox_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskSettingsReasonWeights{} + var fernTestValueHistoryFraudMailbox *float64 + + // Act + obj.SetHistoryFraudMailbox(fernTestValueHistoryFraudMailbox) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetHistoryFraudUser_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskSettingsReasonWeights{} + var fernTestValueHistoryFraudUser *float64 + + // Act + obj.SetHistoryFraudUser(fernTestValueHistoryFraudUser) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetHistoryFraudIP_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskSettingsReasonWeights{} + var fernTestValueHistoryFraudIP *float64 + + // Act + obj.SetHistoryFraudIP(fernTestValueHistoryFraudIP) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetHistoryFraudSubnet_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskSettingsReasonWeights{} + var fernTestValueHistoryFraudSubnet *float64 + + // Act + obj.SetHistoryFraudSubnet(fernTestValueHistoryFraudSubnet) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetHistoryFraudCard_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskSettingsReasonWeights{} + var fernTestValueHistoryFraudCard *float64 + + // Act + obj.SetHistoryFraudCard(fernTestValueHistoryFraudCard) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetHistoryFraudDevice_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskSettingsReasonWeights{} + var fernTestValueHistoryFraudDevice *float64 + + // Act + obj.SetHistoryFraudDevice(fernTestValueHistoryFraudDevice) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetCheckoutCardCountryMismatch_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskSettingsReasonWeights{} + var fernTestValueCheckoutCardCountryMismatch *float64 + + // Act + obj.SetCheckoutCardCountryMismatch(fernTestValueCheckoutCardCountryMismatch) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetCheckoutBillingCountryMismatch_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskSettingsReasonWeights{} + var fernTestValueCheckoutBillingCountryMismatch *float64 + + // Act + obj.SetCheckoutBillingCountryMismatch(fernTestValueCheckoutBillingCountryMismatch) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetCheckoutPrepaidCard_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskSettingsReasonWeights{} + var fernTestValueCheckoutPrepaidCard *float64 + + // Act + obj.SetCheckoutPrepaidCard(fernTestValueCheckoutPrepaidCard) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetDeviceAutomation_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskSettingsReasonWeights{} + var fernTestValueDeviceAutomation *float64 + + // Act + obj.SetDeviceAutomation(fernTestValueDeviceAutomation) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetDeviceInvalid_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskSettingsReasonWeights{} + var fernTestValueDeviceInvalid *float64 + + // Act + obj.SetDeviceInvalid(fernTestValueDeviceInvalid) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetLoginNewCountry_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskSettingsReasonWeights{} + var fernTestValueLoginNewCountry *float64 + + // Act + obj.SetLoginNewCountry(fernTestValueLoginNewCountry) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetLoginNewNetwork_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskSettingsReasonWeights{} + var fernTestValueLoginNewNetwork *float64 + + // Act + obj.SetLoginNewNetwork(fernTestValueLoginNewNetwork) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetCaptchaFailed_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskSettingsReasonWeights{} + var fernTestValueCaptchaFailed *float64 + + // Act + obj.SetCaptchaFailed(fernTestValueCaptchaFailed) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetCaptchaMissing_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskSettingsReasonWeights{} + var fernTestValueCaptchaMissing *float64 + + // Act + obj.SetCaptchaMissing(fernTestValueCaptchaMissing) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetContentSpam_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskSettingsReasonWeights{} + var fernTestValueContentSpam *float64 + + // Act + obj.SetContentSpam(fernTestValueContentSpam) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetContentPhishing_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskSettingsReasonWeights{} + var fernTestValueContentPhishing *float64 + + // Act + obj.SetContentPhishing(fernTestValueContentPhishing) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetContentMalware_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskSettingsReasonWeights{} + var fernTestValueContentMalware *float64 + + // Act + obj.SetContentMalware(fernTestValueContentMalware) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetContentFraud_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &RiskSettingsReasonWeights{} + var fernTestValueContentFraud *float64 + + // Act + obj.SetContentFraud(fernTestValueContentFraud) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + +} + +func TestSettersSchedulingAttendeeErasure(t *testing.T) { + t.Run("SetObject", func(t *testing.T) { + obj := &SchedulingAttendeeErasure{} + var fernTestValueObject SchedulingAttendeeErasureObject + obj.SetObject(fernTestValueObject) + assert.Equal(t, fernTestValueObject, obj.Object) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetUID", func(t *testing.T) { + obj := &SchedulingAttendeeErasure{} + var fernTestValueUID string + obj.SetUID(fernTestValueUID) + assert.Equal(t, fernTestValueUID, obj.UID) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetErased", func(t *testing.T) { + obj := &SchedulingAttendeeErasure{} + var fernTestValueErased float64 + obj.SetErased(fernTestValueErased) + assert.Equal(t, fernTestValueErased, obj.Erased) + assert.NotNil(t, obj.explicitFields) + }) + +} + +func TestGettersSchedulingAttendeeErasure(t *testing.T) { + t.Run("GetObject", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingAttendeeErasure{} + var expected SchedulingAttendeeErasureObject + obj.Object = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetObject(), "getter should return the property value") + }) + + t.Run("GetObject_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingAttendeeErasure + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetObject() // Should return zero value + }) + + t.Run("GetUID", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingAttendeeErasure{} + var expected string + obj.UID = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetUID(), "getter should return the property value") + }) + + t.Run("GetUID_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingAttendeeErasure + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetUID() // Should return zero value + }) + + t.Run("GetErased", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingAttendeeErasure{} + var expected float64 + obj.Erased = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetErased(), "getter should return the property value") + }) + + t.Run("GetErased_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingAttendeeErasure + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetErased() // Should return zero value + }) + +} + +func TestSettersMarkExplicitSchedulingAttendeeErasure(t *testing.T) { + t.Run("SetObject_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingAttendeeErasure{} + var fernTestValueObject SchedulingAttendeeErasureObject + + // Act + obj.SetObject(fernTestValueObject) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetUID_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingAttendeeErasure{} + var fernTestValueUID string + + // Act + obj.SetUID(fernTestValueUID) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetErased_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingAttendeeErasure{} + var fernTestValueErased float64 + + // Act + obj.SetErased(fernTestValueErased) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + +} + +func TestSettersSchedulingAttendeeErasureByEmail(t *testing.T) { + t.Run("SetObject", func(t *testing.T) { + obj := &SchedulingAttendeeErasureByEmail{} + var fernTestValueObject SchedulingAttendeeErasureByEmailObject + obj.SetObject(fernTestValueObject) + assert.Equal(t, fernTestValueObject, obj.Object) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetErased", func(t *testing.T) { + obj := &SchedulingAttendeeErasureByEmail{} + var fernTestValueErased float64 + obj.SetErased(fernTestValueErased) + assert.Equal(t, fernTestValueErased, obj.Erased) + assert.NotNil(t, obj.explicitFields) + }) + +} + +func TestGettersSchedulingAttendeeErasureByEmail(t *testing.T) { + t.Run("GetObject", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingAttendeeErasureByEmail{} + var expected SchedulingAttendeeErasureByEmailObject + obj.Object = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetObject(), "getter should return the property value") + }) + + t.Run("GetObject_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingAttendeeErasureByEmail + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetObject() // Should return zero value + }) + + t.Run("GetErased", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingAttendeeErasureByEmail{} + var expected float64 + obj.Erased = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetErased(), "getter should return the property value") + }) + + t.Run("GetErased_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingAttendeeErasureByEmail + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetErased() // Should return zero value + }) + +} + +func TestSettersMarkExplicitSchedulingAttendeeErasureByEmail(t *testing.T) { + t.Run("SetObject_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingAttendeeErasureByEmail{} + var fernTestValueObject SchedulingAttendeeErasureByEmailObject + + // Act + obj.SetObject(fernTestValueObject) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetErased_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingAttendeeErasureByEmail{} + var fernTestValueErased float64 + + // Act + obj.SetErased(fernTestValueErased) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + +} + +func TestSettersSchedulingAttendeeInput(t *testing.T) { + t.Run("SetUID", func(t *testing.T) { + obj := &SchedulingAttendeeInput{} + var fernTestValueUID *string + obj.SetUID(fernTestValueUID) + assert.Equal(t, fernTestValueUID, obj.UID) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetName", func(t *testing.T) { + obj := &SchedulingAttendeeInput{} + var fernTestValueName *string + obj.SetName(fernTestValueName) + assert.Equal(t, fernTestValueName, obj.Name) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetEmail", func(t *testing.T) { + obj := &SchedulingAttendeeInput{} + var fernTestValueEmail *string + obj.SetEmail(fernTestValueEmail) + assert.Equal(t, fernTestValueEmail, obj.Email) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetPhone", func(t *testing.T) { + obj := &SchedulingAttendeeInput{} + var fernTestValuePhone *string + obj.SetPhone(fernTestValuePhone) + assert.Equal(t, fernTestValuePhone, obj.Phone) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetTimeZone", func(t *testing.T) { + obj := &SchedulingAttendeeInput{} + var fernTestValueTimeZone string + obj.SetTimeZone(fernTestValueTimeZone) + assert.Equal(t, fernTestValueTimeZone, obj.TimeZone) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetLocale", func(t *testing.T) { + obj := &SchedulingAttendeeInput{} + var fernTestValueLocale *string + obj.SetLocale(fernTestValueLocale) + assert.Equal(t, fernTestValueLocale, obj.Locale) + assert.NotNil(t, obj.explicitFields) + }) + +} + +func TestGettersSchedulingAttendeeInput(t *testing.T) { + t.Run("GetUID", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingAttendeeInput{} + var expected *string + obj.UID = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetUID(), "getter should return the property value") + }) + + t.Run("GetUID_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingAttendeeInput{} + obj.UID = nil + + // Act & Assert + assert.Nil(t, obj.GetUID(), "getter should return nil when property is nil") + }) + + t.Run("GetUID_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingAttendeeInput + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetUID() // Should return zero value + }) + + t.Run("GetName", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingAttendeeInput{} + var expected *string + obj.Name = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetName(), "getter should return the property value") + }) + + t.Run("GetName_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingAttendeeInput{} + obj.Name = nil + + // Act & Assert + assert.Nil(t, obj.GetName(), "getter should return nil when property is nil") + }) + + t.Run("GetName_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingAttendeeInput + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetName() // Should return zero value + }) + + t.Run("GetEmail", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingAttendeeInput{} + var expected *string + obj.Email = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetEmail(), "getter should return the property value") + }) + + t.Run("GetEmail_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingAttendeeInput{} + obj.Email = nil + + // Act & Assert + assert.Nil(t, obj.GetEmail(), "getter should return nil when property is nil") + }) + + t.Run("GetEmail_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingAttendeeInput + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetEmail() // Should return zero value + }) + + t.Run("GetPhone", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingAttendeeInput{} + var expected *string + obj.Phone = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetPhone(), "getter should return the property value") + }) + + t.Run("GetPhone_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingAttendeeInput{} + obj.Phone = nil + + // Act & Assert + assert.Nil(t, obj.GetPhone(), "getter should return nil when property is nil") + }) + + t.Run("GetPhone_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingAttendeeInput + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetPhone() // Should return zero value + }) + + t.Run("GetTimeZone", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingAttendeeInput{} + var expected string + obj.TimeZone = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetTimeZone(), "getter should return the property value") + }) + + t.Run("GetTimeZone_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingAttendeeInput + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetTimeZone() // Should return zero value + }) + + t.Run("GetLocale", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingAttendeeInput{} + var expected *string + obj.Locale = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetLocale(), "getter should return the property value") + }) + + t.Run("GetLocale_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingAttendeeInput{} + obj.Locale = nil + + // Act & Assert + assert.Nil(t, obj.GetLocale(), "getter should return nil when property is nil") + }) + + t.Run("GetLocale_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingAttendeeInput + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetLocale() // Should return zero value + }) + +} + +func TestSettersMarkExplicitSchedulingAttendeeInput(t *testing.T) { + t.Run("SetUID_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingAttendeeInput{} + var fernTestValueUID *string + + // Act + obj.SetUID(fernTestValueUID) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetName_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingAttendeeInput{} + var fernTestValueName *string + + // Act + obj.SetName(fernTestValueName) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetEmail_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingAttendeeInput{} + var fernTestValueEmail *string + + // Act + obj.SetEmail(fernTestValueEmail) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetPhone_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingAttendeeInput{} + var fernTestValuePhone *string + + // Act + obj.SetPhone(fernTestValuePhone) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetTimeZone_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingAttendeeInput{} + var fernTestValueTimeZone string + + // Act + obj.SetTimeZone(fernTestValueTimeZone) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetLocale_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingAttendeeInput{} + var fernTestValueLocale *string + + // Act + obj.SetLocale(fernTestValueLocale) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + +} + +func TestSettersSchedulingAvailabilitySearchResult(t *testing.T) { + t.Run("SetObject", func(t *testing.T) { + obj := &SchedulingAvailabilitySearchResult{} + var fernTestValueObject SchedulingAvailabilitySearchResultObject + obj.SetObject(fernTestValueObject) + assert.Equal(t, fernTestValueObject, obj.Object) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetData", func(t *testing.T) { + obj := &SchedulingAvailabilitySearchResult{} + var fernTestValueData []*SchedulingAvailabilitySearchResultDataItem + obj.SetData(fernTestValueData) + assert.Equal(t, fernTestValueData, obj.Data) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetHasMore", func(t *testing.T) { + obj := &SchedulingAvailabilitySearchResult{} + var fernTestValueHasMore bool + obj.SetHasMore(fernTestValueHasMore) + assert.Equal(t, fernTestValueHasMore, obj.HasMore) + assert.NotNil(t, obj.explicitFields) + }) + +} + +func TestGettersSchedulingAvailabilitySearchResult(t *testing.T) { + t.Run("GetObject", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingAvailabilitySearchResult{} + var expected SchedulingAvailabilitySearchResultObject + obj.Object = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetObject(), "getter should return the property value") + }) + + t.Run("GetObject_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingAvailabilitySearchResult + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetObject() // Should return zero value + }) + + t.Run("GetData", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingAvailabilitySearchResult{} + var expected []*SchedulingAvailabilitySearchResultDataItem + obj.Data = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetData(), "getter should return the property value") + }) + + t.Run("GetData_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingAvailabilitySearchResult{} + obj.Data = nil + + // Act & Assert + assert.Nil(t, obj.GetData(), "getter should return nil when property is nil") + }) + + t.Run("GetData_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingAvailabilitySearchResult + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetData() // Should return zero value + }) + + t.Run("GetHasMore", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingAvailabilitySearchResult{} + var expected bool + obj.HasMore = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetHasMore(), "getter should return the property value") + }) + + t.Run("GetHasMore_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingAvailabilitySearchResult + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetHasMore() // Should return zero value + }) + +} + +func TestSettersMarkExplicitSchedulingAvailabilitySearchResult(t *testing.T) { + t.Run("SetObject_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingAvailabilitySearchResult{} + var fernTestValueObject SchedulingAvailabilitySearchResultObject + + // Act + obj.SetObject(fernTestValueObject) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetData_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingAvailabilitySearchResult{} + var fernTestValueData []*SchedulingAvailabilitySearchResultDataItem + + // Act + obj.SetData(fernTestValueData) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetHasMore_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingAvailabilitySearchResult{} + var fernTestValueHasMore bool + + // Act + obj.SetHasMore(fernTestValueHasMore) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + +} + +func TestSettersSchedulingAvailabilitySearchResultDataItem(t *testing.T) { + t.Run("SetHost", func(t *testing.T) { + obj := &SchedulingAvailabilitySearchResultDataItem{} + var fernTestValueHost string + obj.SetHost(fernTestValueHost) + assert.Equal(t, fernTestValueHost, obj.Host) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetUID", func(t *testing.T) { + obj := &SchedulingAvailabilitySearchResultDataItem{} + var fernTestValueUID *string + obj.SetUID(fernTestValueUID) + assert.Equal(t, fernTestValueUID, obj.UID) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetSlots", func(t *testing.T) { + obj := &SchedulingAvailabilitySearchResultDataItem{} + var fernTestValueSlots []*SchedulingAvailabilitySearchResultDataItemSlotsItem + obj.SetSlots(fernTestValueSlots) + assert.Equal(t, fernTestValueSlots, obj.Slots) + assert.NotNil(t, obj.explicitFields) + }) + +} + +func TestGettersSchedulingAvailabilitySearchResultDataItem(t *testing.T) { + t.Run("GetHost", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingAvailabilitySearchResultDataItem{} + var expected string + obj.Host = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetHost(), "getter should return the property value") + }) + + t.Run("GetHost_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingAvailabilitySearchResultDataItem + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetHost() // Should return zero value + }) + + t.Run("GetUID", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingAvailabilitySearchResultDataItem{} + var expected *string + obj.UID = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetUID(), "getter should return the property value") + }) + + t.Run("GetUID_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingAvailabilitySearchResultDataItem{} + obj.UID = nil + + // Act & Assert + assert.Nil(t, obj.GetUID(), "getter should return nil when property is nil") + }) + + t.Run("GetUID_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingAvailabilitySearchResultDataItem + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetUID() // Should return zero value + }) + + t.Run("GetSlots", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingAvailabilitySearchResultDataItem{} + var expected []*SchedulingAvailabilitySearchResultDataItemSlotsItem + obj.Slots = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetSlots(), "getter should return the property value") + }) + + t.Run("GetSlots_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingAvailabilitySearchResultDataItem{} + obj.Slots = nil + + // Act & Assert + assert.Nil(t, obj.GetSlots(), "getter should return nil when property is nil") + }) + + t.Run("GetSlots_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingAvailabilitySearchResultDataItem + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetSlots() // Should return zero value + }) + +} + +func TestSettersMarkExplicitSchedulingAvailabilitySearchResultDataItem(t *testing.T) { + t.Run("SetHost_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingAvailabilitySearchResultDataItem{} + var fernTestValueHost string + + // Act + obj.SetHost(fernTestValueHost) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetUID_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingAvailabilitySearchResultDataItem{} + var fernTestValueUID *string + + // Act + obj.SetUID(fernTestValueUID) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetSlots_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingAvailabilitySearchResultDataItem{} + var fernTestValueSlots []*SchedulingAvailabilitySearchResultDataItemSlotsItem + + // Act + obj.SetSlots(fernTestValueSlots) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + +} + +func TestSettersSchedulingAvailabilitySearchResultDataItemSlotsItem(t *testing.T) { + t.Run("SetStart", func(t *testing.T) { + obj := &SchedulingAvailabilitySearchResultDataItemSlotsItem{} + var fernTestValueStart string + obj.SetStart(fernTestValueStart) + assert.Equal(t, fernTestValueStart, obj.Start) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetEnd", func(t *testing.T) { + obj := &SchedulingAvailabilitySearchResultDataItemSlotsItem{} + var fernTestValueEnd string + obj.SetEnd(fernTestValueEnd) + assert.Equal(t, fernTestValueEnd, obj.End) + assert.NotNil(t, obj.explicitFields) + }) + +} + +func TestGettersSchedulingAvailabilitySearchResultDataItemSlotsItem(t *testing.T) { + t.Run("GetStart", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingAvailabilitySearchResultDataItemSlotsItem{} + var expected string + obj.Start = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetStart(), "getter should return the property value") + }) + + t.Run("GetStart_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingAvailabilitySearchResultDataItemSlotsItem + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetStart() // Should return zero value + }) + + t.Run("GetEnd", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingAvailabilitySearchResultDataItemSlotsItem{} + var expected string + obj.End = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetEnd(), "getter should return the property value") + }) + + t.Run("GetEnd_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingAvailabilitySearchResultDataItemSlotsItem + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetEnd() // Should return zero value + }) + +} + +func TestSettersMarkExplicitSchedulingAvailabilitySearchResultDataItemSlotsItem(t *testing.T) { + t.Run("SetStart_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingAvailabilitySearchResultDataItemSlotsItem{} + var fernTestValueStart string + + // Act + obj.SetStart(fernTestValueStart) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetEnd_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingAvailabilitySearchResultDataItemSlotsItem{} + var fernTestValueEnd string + + // Act + obj.SetEnd(fernTestValueEnd) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + +} + +func TestSettersSchedulingBooking(t *testing.T) { + t.Run("SetObject", func(t *testing.T) { + obj := &SchedulingBooking{} + var fernTestValueObject SchedulingBookingObject + obj.SetObject(fernTestValueObject) + assert.Equal(t, fernTestValueObject, obj.Object) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetID", func(t *testing.T) { + obj := &SchedulingBooking{} + var fernTestValueID string + obj.SetID(fernTestValueID) + assert.Equal(t, fernTestValueID, obj.ID) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetEventType", func(t *testing.T) { + obj := &SchedulingBooking{} + var fernTestValueEventType string + obj.SetEventType(fernTestValueEventType) + assert.Equal(t, fernTestValueEventType, obj.EventType) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetStatus", func(t *testing.T) { + obj := &SchedulingBooking{} + var fernTestValueStatus SchedulingBookingStatus + obj.SetStatus(fernTestValueStatus) + assert.Equal(t, fernTestValueStatus, obj.Status) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetTitle", func(t *testing.T) { + obj := &SchedulingBooking{} + var fernTestValueTitle string + obj.SetTitle(fernTestValueTitle) + assert.Equal(t, fernTestValueTitle, obj.Title) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetStart", func(t *testing.T) { + obj := &SchedulingBooking{} + var fernTestValueStart string + obj.SetStart(fernTestValueStart) + assert.Equal(t, fernTestValueStart, obj.Start) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetEnd", func(t *testing.T) { + obj := &SchedulingBooking{} + var fernTestValueEnd string + obj.SetEnd(fernTestValueEnd) + assert.Equal(t, fernTestValueEnd, obj.End) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetHosts", func(t *testing.T) { + obj := &SchedulingBooking{} + var fernTestValueHosts []string + obj.SetHosts(fernTestValueHosts) + assert.Equal(t, fernTestValueHosts, obj.Hosts) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetAttendees", func(t *testing.T) { + obj := &SchedulingBooking{} + var fernTestValueAttendees []*SchedulingBookingAttendeesItem + obj.SetAttendees(fernTestValueAttendees) + assert.Equal(t, fernTestValueAttendees, obj.Attendees) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetLocation", func(t *testing.T) { + obj := &SchedulingBooking{} + var fernTestValueLocation *SchedulingLocation + obj.SetLocation(fernTestValueLocation) + assert.Equal(t, fernTestValueLocation, obj.Location) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetHoldExpiresAt", func(t *testing.T) { + obj := &SchedulingBooking{} + var fernTestValueHoldExpiresAt *string + obj.SetHoldExpiresAt(fernTestValueHoldExpiresAt) + assert.Equal(t, fernTestValueHoldExpiresAt, obj.HoldExpiresAt) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetApprovalExpiresAt", func(t *testing.T) { + obj := &SchedulingBooking{} + var fernTestValueApprovalExpiresAt *string + obj.SetApprovalExpiresAt(fernTestValueApprovalExpiresAt) + assert.Equal(t, fernTestValueApprovalExpiresAt, obj.ApprovalExpiresAt) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetSeries", func(t *testing.T) { + obj := &SchedulingBooking{} + var fernTestValueSeries *string + obj.SetSeries(fernTestValueSeries) + assert.Equal(t, fernTestValueSeries, obj.Series) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetSeriesIndex", func(t *testing.T) { + obj := &SchedulingBooking{} + var fernTestValueSeriesIndex *float64 + obj.SetSeriesIndex(fernTestValueSeriesIndex) + assert.Equal(t, fernTestValueSeriesIndex, obj.SeriesIndex) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetGroupSession", func(t *testing.T) { + obj := &SchedulingBooking{} + var fernTestValueGroupSession *string + obj.SetGroupSession(fernTestValueGroupSession) + assert.Equal(t, fernTestValueGroupSession, obj.GroupSession) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetCalendarUnverified", func(t *testing.T) { + obj := &SchedulingBooking{} + var fernTestValueCalendarUnverified bool + obj.SetCalendarUnverified(fernTestValueCalendarUnverified) + assert.Equal(t, fernTestValueCalendarUnverified, obj.CalendarUnverified) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetExternalConflictAt", func(t *testing.T) { + obj := &SchedulingBooking{} + var fernTestValueExternalConflictAt *string + obj.SetExternalConflictAt(fernTestValueExternalConflictAt) + assert.Equal(t, fernTestValueExternalConflictAt, obj.ExternalConflictAt) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetNoShowAt", func(t *testing.T) { + obj := &SchedulingBooking{} + var fernTestValueNoShowAt *string + obj.SetNoShowAt(fernTestValueNoShowAt) + assert.Equal(t, fernTestValueNoShowAt, obj.NoShowAt) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetCancelledAt", func(t *testing.T) { + obj := &SchedulingBooking{} + var fernTestValueCancelledAt *string + obj.SetCancelledAt(fernTestValueCancelledAt) + assert.Equal(t, fernTestValueCancelledAt, obj.CancelledAt) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetCancelledBy", func(t *testing.T) { + obj := &SchedulingBooking{} + var fernTestValueCancelledBy *SchedulingBookingCancelledBy + obj.SetCancelledBy(fernTestValueCancelledBy) + assert.Equal(t, fernTestValueCancelledBy, obj.CancelledBy) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetCancellationReason", func(t *testing.T) { + obj := &SchedulingBooking{} + var fernTestValueCancellationReason *string + obj.SetCancellationReason(fernTestValueCancellationReason) + assert.Equal(t, fernTestValueCancellationReason, obj.CancellationReason) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetMetadata", func(t *testing.T) { + obj := &SchedulingBooking{} + var fernTestValueMetadata map[string]string + obj.SetMetadata(fernTestValueMetadata) + assert.Equal(t, fernTestValueMetadata, obj.Metadata) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetCreatedAt", func(t *testing.T) { + obj := &SchedulingBooking{} + var fernTestValueCreatedAt string + obj.SetCreatedAt(fernTestValueCreatedAt) + assert.Equal(t, fernTestValueCreatedAt, obj.CreatedAt) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetUpdatedAt", func(t *testing.T) { + obj := &SchedulingBooking{} + var fernTestValueUpdatedAt string + obj.SetUpdatedAt(fernTestValueUpdatedAt) + assert.Equal(t, fernTestValueUpdatedAt, obj.UpdatedAt) + assert.NotNil(t, obj.explicitFields) + }) + +} + +func TestGettersSchedulingBooking(t *testing.T) { + t.Run("GetObject", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingBooking{} + var expected SchedulingBookingObject + obj.Object = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetObject(), "getter should return the property value") + }) + + t.Run("GetObject_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingBooking + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetObject() // Should return zero value + }) + + t.Run("GetID", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingBooking{} + var expected string + obj.ID = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetID(), "getter should return the property value") + }) + + t.Run("GetID_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingBooking + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetID() // Should return zero value + }) + + t.Run("GetEventType", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingBooking{} + var expected string + obj.EventType = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetEventType(), "getter should return the property value") + }) + + t.Run("GetEventType_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingBooking + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetEventType() // Should return zero value + }) + + t.Run("GetStatus", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingBooking{} + var expected SchedulingBookingStatus + obj.Status = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetStatus(), "getter should return the property value") + }) + + t.Run("GetStatus_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingBooking + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetStatus() // Should return zero value + }) + + t.Run("GetTitle", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingBooking{} + var expected string + obj.Title = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetTitle(), "getter should return the property value") + }) + + t.Run("GetTitle_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingBooking + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetTitle() // Should return zero value + }) + + t.Run("GetStart", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingBooking{} + var expected string + obj.Start = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetStart(), "getter should return the property value") + }) + + t.Run("GetStart_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingBooking + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetStart() // Should return zero value + }) + + t.Run("GetEnd", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingBooking{} + var expected string + obj.End = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetEnd(), "getter should return the property value") + }) + + t.Run("GetEnd_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingBooking + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetEnd() // Should return zero value + }) + + t.Run("GetHosts", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingBooking{} + var expected []string + obj.Hosts = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetHosts(), "getter should return the property value") + }) + + t.Run("GetHosts_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingBooking{} + obj.Hosts = nil + + // Act & Assert + assert.Nil(t, obj.GetHosts(), "getter should return nil when property is nil") + }) + + t.Run("GetHosts_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingBooking + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetHosts() // Should return zero value + }) + + t.Run("GetAttendees", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingBooking{} + var expected []*SchedulingBookingAttendeesItem + obj.Attendees = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetAttendees(), "getter should return the property value") + }) + + t.Run("GetAttendees_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingBooking{} + obj.Attendees = nil + + // Act & Assert + assert.Nil(t, obj.GetAttendees(), "getter should return nil when property is nil") + }) + + t.Run("GetAttendees_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingBooking + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetAttendees() // Should return zero value + }) + + t.Run("GetLocation", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingBooking{} + var expected *SchedulingLocation + obj.Location = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetLocation(), "getter should return the property value") + }) + + t.Run("GetLocation_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingBooking{} + obj.Location = nil + + // Act & Assert + assert.Nil(t, obj.GetLocation(), "getter should return nil when property is nil") + }) + + t.Run("GetLocation_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingBooking + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetLocation() // Should return zero value + }) + + t.Run("GetHoldExpiresAt", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingBooking{} + var expected *string + obj.HoldExpiresAt = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetHoldExpiresAt(), "getter should return the property value") + }) + + t.Run("GetHoldExpiresAt_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingBooking{} + obj.HoldExpiresAt = nil + + // Act & Assert + assert.Nil(t, obj.GetHoldExpiresAt(), "getter should return nil when property is nil") + }) + + t.Run("GetHoldExpiresAt_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingBooking + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetHoldExpiresAt() // Should return zero value + }) + + t.Run("GetApprovalExpiresAt", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingBooking{} + var expected *string + obj.ApprovalExpiresAt = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetApprovalExpiresAt(), "getter should return the property value") + }) + + t.Run("GetApprovalExpiresAt_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingBooking{} + obj.ApprovalExpiresAt = nil + + // Act & Assert + assert.Nil(t, obj.GetApprovalExpiresAt(), "getter should return nil when property is nil") + }) + + t.Run("GetApprovalExpiresAt_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingBooking + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetApprovalExpiresAt() // Should return zero value + }) + + t.Run("GetSeries", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingBooking{} + var expected *string + obj.Series = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetSeries(), "getter should return the property value") + }) + + t.Run("GetSeries_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingBooking{} + obj.Series = nil + + // Act & Assert + assert.Nil(t, obj.GetSeries(), "getter should return nil when property is nil") + }) + + t.Run("GetSeries_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingBooking + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetSeries() // Should return zero value + }) + + t.Run("GetSeriesIndex", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingBooking{} + var expected *float64 + obj.SeriesIndex = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetSeriesIndex(), "getter should return the property value") + }) + + t.Run("GetSeriesIndex_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingBooking{} + obj.SeriesIndex = nil + + // Act & Assert + assert.Nil(t, obj.GetSeriesIndex(), "getter should return nil when property is nil") + }) + + t.Run("GetSeriesIndex_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingBooking + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetSeriesIndex() // Should return zero value + }) + + t.Run("GetGroupSession", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingBooking{} + var expected *string + obj.GroupSession = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetGroupSession(), "getter should return the property value") + }) + + t.Run("GetGroupSession_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingBooking{} + obj.GroupSession = nil + + // Act & Assert + assert.Nil(t, obj.GetGroupSession(), "getter should return nil when property is nil") + }) + + t.Run("GetGroupSession_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingBooking + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetGroupSession() // Should return zero value + }) + + t.Run("GetCalendarUnverified", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingBooking{} + var expected bool + obj.CalendarUnverified = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetCalendarUnverified(), "getter should return the property value") + }) + + t.Run("GetCalendarUnverified_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingBooking + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetCalendarUnverified() // Should return zero value + }) + + t.Run("GetExternalConflictAt", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingBooking{} + var expected *string + obj.ExternalConflictAt = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetExternalConflictAt(), "getter should return the property value") + }) + + t.Run("GetExternalConflictAt_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingBooking{} + obj.ExternalConflictAt = nil + + // Act & Assert + assert.Nil(t, obj.GetExternalConflictAt(), "getter should return nil when property is nil") + }) + + t.Run("GetExternalConflictAt_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingBooking + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetExternalConflictAt() // Should return zero value + }) + + t.Run("GetNoShowAt", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingBooking{} + var expected *string + obj.NoShowAt = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetNoShowAt(), "getter should return the property value") + }) + + t.Run("GetNoShowAt_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingBooking{} + obj.NoShowAt = nil + + // Act & Assert + assert.Nil(t, obj.GetNoShowAt(), "getter should return nil when property is nil") + }) + + t.Run("GetNoShowAt_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingBooking + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetNoShowAt() // Should return zero value + }) + + t.Run("GetCancelledAt", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingBooking{} + var expected *string + obj.CancelledAt = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetCancelledAt(), "getter should return the property value") + }) + + t.Run("GetCancelledAt_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingBooking{} + obj.CancelledAt = nil + + // Act & Assert + assert.Nil(t, obj.GetCancelledAt(), "getter should return nil when property is nil") + }) + + t.Run("GetCancelledAt_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingBooking + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetCancelledAt() // Should return zero value + }) + + t.Run("GetCancelledBy", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingBooking{} + var expected *SchedulingBookingCancelledBy + obj.CancelledBy = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetCancelledBy(), "getter should return the property value") + }) + + t.Run("GetCancelledBy_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingBooking{} + obj.CancelledBy = nil + + // Act & Assert + assert.Nil(t, obj.GetCancelledBy(), "getter should return nil when property is nil") + }) + + t.Run("GetCancelledBy_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingBooking + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetCancelledBy() // Should return zero value + }) + + t.Run("GetCancellationReason", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingBooking{} + var expected *string + obj.CancellationReason = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetCancellationReason(), "getter should return the property value") + }) + + t.Run("GetCancellationReason_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingBooking{} + obj.CancellationReason = nil + + // Act & Assert + assert.Nil(t, obj.GetCancellationReason(), "getter should return nil when property is nil") + }) + + t.Run("GetCancellationReason_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingBooking + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetCancellationReason() // Should return zero value + }) + + t.Run("GetMetadata", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingBooking{} + var expected map[string]string + obj.Metadata = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetMetadata(), "getter should return the property value") + }) + + t.Run("GetMetadata_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingBooking{} + obj.Metadata = nil + + // Act & Assert + assert.Nil(t, obj.GetMetadata(), "getter should return nil when property is nil") + }) + + t.Run("GetMetadata_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingBooking + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetMetadata() // Should return zero value + }) + + t.Run("GetCreatedAt", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingBooking{} + var expected string + obj.CreatedAt = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetCreatedAt(), "getter should return the property value") + }) + + t.Run("GetCreatedAt_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingBooking + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetCreatedAt() // Should return zero value + }) + + t.Run("GetUpdatedAt", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingBooking{} + var expected string + obj.UpdatedAt = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetUpdatedAt(), "getter should return the property value") + }) + + t.Run("GetUpdatedAt_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingBooking + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetUpdatedAt() // Should return zero value + }) + +} + +func TestSettersMarkExplicitSchedulingBooking(t *testing.T) { + t.Run("SetObject_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingBooking{} + var fernTestValueObject SchedulingBookingObject + + // Act + obj.SetObject(fernTestValueObject) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetID_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingBooking{} + var fernTestValueID string + + // Act + obj.SetID(fernTestValueID) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetEventType_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingBooking{} + var fernTestValueEventType string + + // Act + obj.SetEventType(fernTestValueEventType) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetStatus_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingBooking{} + var fernTestValueStatus SchedulingBookingStatus + + // Act + obj.SetStatus(fernTestValueStatus) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetTitle_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingBooking{} + var fernTestValueTitle string + + // Act + obj.SetTitle(fernTestValueTitle) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetStart_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingBooking{} + var fernTestValueStart string + + // Act + obj.SetStart(fernTestValueStart) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetEnd_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingBooking{} + var fernTestValueEnd string + + // Act + obj.SetEnd(fernTestValueEnd) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetHosts_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingBooking{} + var fernTestValueHosts []string + + // Act + obj.SetHosts(fernTestValueHosts) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetAttendees_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingBooking{} + var fernTestValueAttendees []*SchedulingBookingAttendeesItem + + // Act + obj.SetAttendees(fernTestValueAttendees) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetLocation_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingBooking{} + var fernTestValueLocation *SchedulingLocation + + // Act + obj.SetLocation(fernTestValueLocation) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetHoldExpiresAt_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingBooking{} + var fernTestValueHoldExpiresAt *string + + // Act + obj.SetHoldExpiresAt(fernTestValueHoldExpiresAt) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetApprovalExpiresAt_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingBooking{} + var fernTestValueApprovalExpiresAt *string + + // Act + obj.SetApprovalExpiresAt(fernTestValueApprovalExpiresAt) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetSeries_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingBooking{} + var fernTestValueSeries *string + + // Act + obj.SetSeries(fernTestValueSeries) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetSeriesIndex_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingBooking{} + var fernTestValueSeriesIndex *float64 + + // Act + obj.SetSeriesIndex(fernTestValueSeriesIndex) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetGroupSession_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingBooking{} + var fernTestValueGroupSession *string + + // Act + obj.SetGroupSession(fernTestValueGroupSession) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetCalendarUnverified_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingBooking{} + var fernTestValueCalendarUnverified bool + + // Act + obj.SetCalendarUnverified(fernTestValueCalendarUnverified) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetExternalConflictAt_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingBooking{} + var fernTestValueExternalConflictAt *string + + // Act + obj.SetExternalConflictAt(fernTestValueExternalConflictAt) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetNoShowAt_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingBooking{} + var fernTestValueNoShowAt *string + + // Act + obj.SetNoShowAt(fernTestValueNoShowAt) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetCancelledAt_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingBooking{} + var fernTestValueCancelledAt *string + + // Act + obj.SetCancelledAt(fernTestValueCancelledAt) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetCancelledBy_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingBooking{} + var fernTestValueCancelledBy *SchedulingBookingCancelledBy + + // Act + obj.SetCancelledBy(fernTestValueCancelledBy) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetCancellationReason_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingBooking{} + var fernTestValueCancellationReason *string + + // Act + obj.SetCancellationReason(fernTestValueCancellationReason) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetMetadata_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingBooking{} + var fernTestValueMetadata map[string]string + + // Act + obj.SetMetadata(fernTestValueMetadata) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetCreatedAt_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingBooking{} + var fernTestValueCreatedAt string + + // Act + obj.SetCreatedAt(fernTestValueCreatedAt) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetUpdatedAt_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingBooking{} + var fernTestValueUpdatedAt string + + // Act + obj.SetUpdatedAt(fernTestValueUpdatedAt) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + +} + +func TestSettersSchedulingBookingAttendeesItem(t *testing.T) { + t.Run("SetID", func(t *testing.T) { + obj := &SchedulingBookingAttendeesItem{} + var fernTestValueID string + obj.SetID(fernTestValueID) + assert.Equal(t, fernTestValueID, obj.ID) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetRole", func(t *testing.T) { + obj := &SchedulingBookingAttendeesItem{} + var fernTestValueRole SchedulingBookingAttendeesItemRole + obj.SetRole(fernTestValueRole) + assert.Equal(t, fernTestValueRole, obj.Role) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetUID", func(t *testing.T) { + obj := &SchedulingBookingAttendeesItem{} + var fernTestValueUID *string + obj.SetUID(fernTestValueUID) + assert.Equal(t, fernTestValueUID, obj.UID) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetName", func(t *testing.T) { + obj := &SchedulingBookingAttendeesItem{} + var fernTestValueName *string + obj.SetName(fernTestValueName) + assert.Equal(t, fernTestValueName, obj.Name) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetEmail", func(t *testing.T) { + obj := &SchedulingBookingAttendeesItem{} + var fernTestValueEmail *string + obj.SetEmail(fernTestValueEmail) + assert.Equal(t, fernTestValueEmail, obj.Email) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetPhone", func(t *testing.T) { + obj := &SchedulingBookingAttendeesItem{} + var fernTestValuePhone *string + obj.SetPhone(fernTestValuePhone) + assert.Equal(t, fernTestValuePhone, obj.Phone) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetTimeZone", func(t *testing.T) { + obj := &SchedulingBookingAttendeesItem{} + var fernTestValueTimeZone string + obj.SetTimeZone(fernTestValueTimeZone) + assert.Equal(t, fernTestValueTimeZone, obj.TimeZone) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetLocale", func(t *testing.T) { + obj := &SchedulingBookingAttendeesItem{} + var fernTestValueLocale *string + obj.SetLocale(fernTestValueLocale) + assert.Equal(t, fernTestValueLocale, obj.Locale) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetAnswers", func(t *testing.T) { + obj := &SchedulingBookingAttendeesItem{} + var fernTestValueAnswers map[string]*SchedulingBookingAttendeesItemAnswersValue + obj.SetAnswers(fernTestValueAnswers) + assert.Equal(t, fernTestValueAnswers, obj.Answers) + assert.NotNil(t, obj.explicitFields) + }) + +} + +func TestGettersSchedulingBookingAttendeesItem(t *testing.T) { + t.Run("GetID", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingBookingAttendeesItem{} + var expected string + obj.ID = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetID(), "getter should return the property value") + }) + + t.Run("GetID_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingBookingAttendeesItem + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetID() // Should return zero value + }) + + t.Run("GetRole", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingBookingAttendeesItem{} + var expected SchedulingBookingAttendeesItemRole + obj.Role = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetRole(), "getter should return the property value") + }) + + t.Run("GetRole_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingBookingAttendeesItem + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetRole() // Should return zero value + }) + + t.Run("GetUID", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingBookingAttendeesItem{} + var expected *string + obj.UID = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetUID(), "getter should return the property value") + }) + + t.Run("GetUID_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingBookingAttendeesItem{} + obj.UID = nil + + // Act & Assert + assert.Nil(t, obj.GetUID(), "getter should return nil when property is nil") + }) + + t.Run("GetUID_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingBookingAttendeesItem + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetUID() // Should return zero value + }) + + t.Run("GetName", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingBookingAttendeesItem{} + var expected *string + obj.Name = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetName(), "getter should return the property value") + }) + + t.Run("GetName_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingBookingAttendeesItem{} + obj.Name = nil + + // Act & Assert + assert.Nil(t, obj.GetName(), "getter should return nil when property is nil") + }) + + t.Run("GetName_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingBookingAttendeesItem + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetName() // Should return zero value + }) + + t.Run("GetEmail", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingBookingAttendeesItem{} + var expected *string + obj.Email = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetEmail(), "getter should return the property value") + }) + + t.Run("GetEmail_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingBookingAttendeesItem{} + obj.Email = nil + + // Act & Assert + assert.Nil(t, obj.GetEmail(), "getter should return nil when property is nil") + }) + + t.Run("GetEmail_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingBookingAttendeesItem + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetEmail() // Should return zero value + }) + + t.Run("GetPhone", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingBookingAttendeesItem{} + var expected *string + obj.Phone = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetPhone(), "getter should return the property value") + }) + + t.Run("GetPhone_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingBookingAttendeesItem{} + obj.Phone = nil + + // Act & Assert + assert.Nil(t, obj.GetPhone(), "getter should return nil when property is nil") + }) + + t.Run("GetPhone_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingBookingAttendeesItem + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetPhone() // Should return zero value + }) + + t.Run("GetTimeZone", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingBookingAttendeesItem{} + var expected string + obj.TimeZone = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetTimeZone(), "getter should return the property value") + }) + + t.Run("GetTimeZone_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingBookingAttendeesItem + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetTimeZone() // Should return zero value + }) + + t.Run("GetLocale", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingBookingAttendeesItem{} + var expected *string + obj.Locale = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetLocale(), "getter should return the property value") + }) + + t.Run("GetLocale_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingBookingAttendeesItem{} + obj.Locale = nil + + // Act & Assert + assert.Nil(t, obj.GetLocale(), "getter should return nil when property is nil") + }) + + t.Run("GetLocale_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingBookingAttendeesItem + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetLocale() // Should return zero value + }) + + t.Run("GetAnswers", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingBookingAttendeesItem{} + var expected map[string]*SchedulingBookingAttendeesItemAnswersValue + obj.Answers = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetAnswers(), "getter should return the property value") + }) + + t.Run("GetAnswers_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingBookingAttendeesItem{} + obj.Answers = nil + + // Act & Assert + assert.Nil(t, obj.GetAnswers(), "getter should return nil when property is nil") + }) + + t.Run("GetAnswers_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingBookingAttendeesItem + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetAnswers() // Should return zero value + }) + +} + +func TestSettersMarkExplicitSchedulingBookingAttendeesItem(t *testing.T) { + t.Run("SetID_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingBookingAttendeesItem{} + var fernTestValueID string + + // Act + obj.SetID(fernTestValueID) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetRole_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingBookingAttendeesItem{} + var fernTestValueRole SchedulingBookingAttendeesItemRole + + // Act + obj.SetRole(fernTestValueRole) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetUID_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingBookingAttendeesItem{} + var fernTestValueUID *string + + // Act + obj.SetUID(fernTestValueUID) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetName_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingBookingAttendeesItem{} + var fernTestValueName *string + + // Act + obj.SetName(fernTestValueName) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetEmail_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingBookingAttendeesItem{} + var fernTestValueEmail *string + + // Act + obj.SetEmail(fernTestValueEmail) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetPhone_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingBookingAttendeesItem{} + var fernTestValuePhone *string + + // Act + obj.SetPhone(fernTestValuePhone) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetTimeZone_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingBookingAttendeesItem{} + var fernTestValueTimeZone string + + // Act + obj.SetTimeZone(fernTestValueTimeZone) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetLocale_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingBookingAttendeesItem{} + var fernTestValueLocale *string + + // Act + obj.SetLocale(fernTestValueLocale) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetAnswers_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingBookingAttendeesItem{} + var fernTestValueAnswers map[string]*SchedulingBookingAttendeesItemAnswersValue + + // Act + obj.SetAnswers(fernTestValueAnswers) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + +} + +func TestGettersSchedulingBookingAttendeesItemAnswersValue(t *testing.T) { + t.Run("GetString", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingBookingAttendeesItemAnswersValue{} + var expected string + obj.String = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetString(), "getter should return the property value") + }) + + t.Run("GetString_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingBookingAttendeesItemAnswersValue + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetString() // Should return zero value + }) + + t.Run("GetStringList", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingBookingAttendeesItemAnswersValue{} + var expected []string + obj.StringList = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetStringList(), "getter should return the property value") + }) + + t.Run("GetStringList_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingBookingAttendeesItemAnswersValue{} + obj.StringList = nil + + // Act & Assert + assert.Nil(t, obj.GetStringList(), "getter should return nil when property is nil") + }) + + t.Run("GetStringList_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingBookingAttendeesItemAnswersValue + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetStringList() // Should return zero value + }) + +} + +func TestSettersSchedulingBookingEvent(t *testing.T) { + t.Run("SetObject", func(t *testing.T) { + obj := &SchedulingBookingEvent{} + var fernTestValueObject SchedulingBookingEventObject + obj.SetObject(fernTestValueObject) + assert.Equal(t, fernTestValueObject, obj.Object) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetID", func(t *testing.T) { + obj := &SchedulingBookingEvent{} + var fernTestValueID string + obj.SetID(fernTestValueID) + assert.Equal(t, fernTestValueID, obj.ID) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetSequence", func(t *testing.T) { + obj := &SchedulingBookingEvent{} + var fernTestValueSequence float64 + obj.SetSequence(fernTestValueSequence) + assert.Equal(t, fernTestValueSequence, obj.Sequence) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetType", func(t *testing.T) { + obj := &SchedulingBookingEvent{} + var fernTestValueType string + obj.SetType(fernTestValueType) + assert.Equal(t, fernTestValueType, obj.Type) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetActor", func(t *testing.T) { + obj := &SchedulingBookingEvent{} + var fernTestValueActor *SchedulingBookingEventActor + obj.SetActor(fernTestValueActor) + assert.Equal(t, fernTestValueActor, obj.Actor) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetDetails", func(t *testing.T) { + obj := &SchedulingBookingEvent{} + var fernTestValueDetails map[string]any + obj.SetDetails(fernTestValueDetails) + assert.Equal(t, fernTestValueDetails, obj.Details) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetOccurredAt", func(t *testing.T) { + obj := &SchedulingBookingEvent{} + var fernTestValueOccurredAt string + obj.SetOccurredAt(fernTestValueOccurredAt) + assert.Equal(t, fernTestValueOccurredAt, obj.OccurredAt) + assert.NotNil(t, obj.explicitFields) + }) + +} + +func TestGettersSchedulingBookingEvent(t *testing.T) { + t.Run("GetObject", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingBookingEvent{} + var expected SchedulingBookingEventObject + obj.Object = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetObject(), "getter should return the property value") + }) + + t.Run("GetObject_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingBookingEvent + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetObject() // Should return zero value + }) + + t.Run("GetID", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingBookingEvent{} + var expected string + obj.ID = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetID(), "getter should return the property value") + }) + + t.Run("GetID_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingBookingEvent + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetID() // Should return zero value + }) + + t.Run("GetSequence", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingBookingEvent{} + var expected float64 + obj.Sequence = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetSequence(), "getter should return the property value") + }) + + t.Run("GetSequence_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingBookingEvent + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetSequence() // Should return zero value + }) + + t.Run("GetType", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingBookingEvent{} + var expected string + obj.Type = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetType(), "getter should return the property value") + }) + + t.Run("GetType_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingBookingEvent + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetType() // Should return zero value + }) + + t.Run("GetActor", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingBookingEvent{} + var expected *SchedulingBookingEventActor + obj.Actor = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetActor(), "getter should return the property value") + }) + + t.Run("GetActor_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingBookingEvent{} + obj.Actor = nil + + // Act & Assert + assert.Nil(t, obj.GetActor(), "getter should return nil when property is nil") + }) + + t.Run("GetActor_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingBookingEvent + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetActor() // Should return zero value + }) + + t.Run("GetDetails", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingBookingEvent{} + var expected map[string]any + obj.Details = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetDetails(), "getter should return the property value") + }) + + t.Run("GetDetails_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingBookingEvent{} + obj.Details = nil + + // Act & Assert + assert.Nil(t, obj.GetDetails(), "getter should return nil when property is nil") + }) + + t.Run("GetDetails_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingBookingEvent + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetDetails() // Should return zero value + }) + + t.Run("GetOccurredAt", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingBookingEvent{} + var expected string + obj.OccurredAt = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetOccurredAt(), "getter should return the property value") + }) + + t.Run("GetOccurredAt_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingBookingEvent + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetOccurredAt() // Should return zero value + }) + +} + +func TestSettersMarkExplicitSchedulingBookingEvent(t *testing.T) { + t.Run("SetObject_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingBookingEvent{} + var fernTestValueObject SchedulingBookingEventObject + + // Act + obj.SetObject(fernTestValueObject) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetID_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingBookingEvent{} + var fernTestValueID string + + // Act + obj.SetID(fernTestValueID) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetSequence_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingBookingEvent{} + var fernTestValueSequence float64 + + // Act + obj.SetSequence(fernTestValueSequence) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetType_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingBookingEvent{} + var fernTestValueType string + + // Act + obj.SetType(fernTestValueType) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetActor_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingBookingEvent{} + var fernTestValueActor *SchedulingBookingEventActor + + // Act + obj.SetActor(fernTestValueActor) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetDetails_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingBookingEvent{} + var fernTestValueDetails map[string]any + + // Act + obj.SetDetails(fernTestValueDetails) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetOccurredAt_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingBookingEvent{} + var fernTestValueOccurredAt string + + // Act + obj.SetOccurredAt(fernTestValueOccurredAt) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + +} + +func TestSettersSchedulingBookingEventActor(t *testing.T) { + t.Run("SetKind", func(t *testing.T) { + obj := &SchedulingBookingEventActor{} + var fernTestValueKind SchedulingBookingEventActorKind + obj.SetKind(fernTestValueKind) + assert.Equal(t, fernTestValueKind, obj.Kind) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetID", func(t *testing.T) { + obj := &SchedulingBookingEventActor{} + var fernTestValueID *string + obj.SetID(fernTestValueID) + assert.Equal(t, fernTestValueID, obj.ID) + assert.NotNil(t, obj.explicitFields) + }) + +} + +func TestGettersSchedulingBookingEventActor(t *testing.T) { + t.Run("GetKind", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingBookingEventActor{} + var expected SchedulingBookingEventActorKind + obj.Kind = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetKind(), "getter should return the property value") + }) + + t.Run("GetKind_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingBookingEventActor + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetKind() // Should return zero value + }) + + t.Run("GetID", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingBookingEventActor{} + var expected *string + obj.ID = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetID(), "getter should return the property value") + }) + + t.Run("GetID_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingBookingEventActor{} + obj.ID = nil + + // Act & Assert + assert.Nil(t, obj.GetID(), "getter should return nil when property is nil") + }) + + t.Run("GetID_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingBookingEventActor + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetID() // Should return zero value + }) + +} + +func TestSettersMarkExplicitSchedulingBookingEventActor(t *testing.T) { + t.Run("SetKind_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingBookingEventActor{} + var fernTestValueKind SchedulingBookingEventActorKind + + // Act + obj.SetKind(fernTestValueKind) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetID_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingBookingEventActor{} + var fernTestValueID *string + + // Act + obj.SetID(fernTestValueID) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + +} + +func TestSettersSchedulingBookingEventList(t *testing.T) { + t.Run("SetObject", func(t *testing.T) { + obj := &SchedulingBookingEventList{} + var fernTestValueObject SchedulingBookingEventListObject + obj.SetObject(fernTestValueObject) + assert.Equal(t, fernTestValueObject, obj.Object) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetData", func(t *testing.T) { + obj := &SchedulingBookingEventList{} + var fernTestValueData []*SchedulingBookingEvent + obj.SetData(fernTestValueData) + assert.Equal(t, fernTestValueData, obj.Data) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetHasMore", func(t *testing.T) { + obj := &SchedulingBookingEventList{} + var fernTestValueHasMore bool + obj.SetHasMore(fernTestValueHasMore) + assert.Equal(t, fernTestValueHasMore, obj.HasMore) + assert.NotNil(t, obj.explicitFields) + }) + +} + +func TestGettersSchedulingBookingEventList(t *testing.T) { + t.Run("GetObject", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingBookingEventList{} + var expected SchedulingBookingEventListObject + obj.Object = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetObject(), "getter should return the property value") + }) + + t.Run("GetObject_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingBookingEventList + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetObject() // Should return zero value + }) + + t.Run("GetData", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingBookingEventList{} + var expected []*SchedulingBookingEvent + obj.Data = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetData(), "getter should return the property value") + }) + + t.Run("GetData_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingBookingEventList{} + obj.Data = nil + + // Act & Assert + assert.Nil(t, obj.GetData(), "getter should return nil when property is nil") + }) + + t.Run("GetData_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingBookingEventList + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetData() // Should return zero value + }) + + t.Run("GetHasMore", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingBookingEventList{} + var expected bool + obj.HasMore = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetHasMore(), "getter should return the property value") + }) + + t.Run("GetHasMore_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingBookingEventList + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetHasMore() // Should return zero value + }) + +} + +func TestSettersMarkExplicitSchedulingBookingEventList(t *testing.T) { + t.Run("SetObject_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingBookingEventList{} + var fernTestValueObject SchedulingBookingEventListObject + + // Act + obj.SetObject(fernTestValueObject) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetData_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingBookingEventList{} + var fernTestValueData []*SchedulingBookingEvent + + // Act + obj.SetData(fernTestValueData) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetHasMore_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingBookingEventList{} + var fernTestValueHasMore bool + + // Act + obj.SetHasMore(fernTestValueHasMore) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + +} + +func TestSettersSchedulingBookingList(t *testing.T) { + t.Run("SetObject", func(t *testing.T) { + obj := &SchedulingBookingList{} + var fernTestValueObject SchedulingBookingListObject + obj.SetObject(fernTestValueObject) + assert.Equal(t, fernTestValueObject, obj.Object) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetData", func(t *testing.T) { + obj := &SchedulingBookingList{} + var fernTestValueData []*SchedulingBooking + obj.SetData(fernTestValueData) + assert.Equal(t, fernTestValueData, obj.Data) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetHasMore", func(t *testing.T) { + obj := &SchedulingBookingList{} + var fernTestValueHasMore bool + obj.SetHasMore(fernTestValueHasMore) + assert.Equal(t, fernTestValueHasMore, obj.HasMore) + assert.NotNil(t, obj.explicitFields) + }) + +} + +func TestGettersSchedulingBookingList(t *testing.T) { + t.Run("GetObject", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingBookingList{} + var expected SchedulingBookingListObject + obj.Object = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetObject(), "getter should return the property value") + }) + + t.Run("GetObject_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingBookingList + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetObject() // Should return zero value + }) + + t.Run("GetData", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingBookingList{} + var expected []*SchedulingBooking + obj.Data = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetData(), "getter should return the property value") + }) + + t.Run("GetData_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingBookingList{} + obj.Data = nil + + // Act & Assert + assert.Nil(t, obj.GetData(), "getter should return nil when property is nil") + }) + + t.Run("GetData_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingBookingList + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetData() // Should return zero value + }) + + t.Run("GetHasMore", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingBookingList{} + var expected bool + obj.HasMore = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetHasMore(), "getter should return the property value") + }) + + t.Run("GetHasMore_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingBookingList + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetHasMore() // Should return zero value + }) + +} + +func TestSettersMarkExplicitSchedulingBookingList(t *testing.T) { + t.Run("SetObject_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingBookingList{} + var fernTestValueObject SchedulingBookingListObject + + // Act + obj.SetObject(fernTestValueObject) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetData_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingBookingList{} + var fernTestValueData []*SchedulingBooking + + // Act + obj.SetData(fernTestValueData) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetHasMore_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingBookingList{} + var fernTestValueHasMore bool + + // Act + obj.SetHasMore(fernTestValueHasMore) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + +} + +func TestSettersSchedulingBookingNotification(t *testing.T) { + t.Run("SetObject", func(t *testing.T) { + obj := &SchedulingBookingNotification{} + var fernTestValueObject SchedulingBookingNotificationObject + obj.SetObject(fernTestValueObject) + assert.Equal(t, fernTestValueObject, obj.Object) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetID", func(t *testing.T) { + obj := &SchedulingBookingNotification{} + var fernTestValueID string + obj.SetID(fernTestValueID) + assert.Equal(t, fernTestValueID, obj.ID) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetKind", func(t *testing.T) { + obj := &SchedulingBookingNotification{} + var fernTestValueKind string + obj.SetKind(fernTestValueKind) + assert.Equal(t, fernTestValueKind, obj.Kind) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetReminderKey", func(t *testing.T) { + obj := &SchedulingBookingNotification{} + var fernTestValueReminderKey *string + obj.SetReminderKey(fernTestValueReminderKey) + assert.Equal(t, fernTestValueReminderKey, obj.ReminderKey) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetChannel", func(t *testing.T) { + obj := &SchedulingBookingNotification{} + var fernTestValueChannel SchedulingBookingNotificationChannel + obj.SetChannel(fernTestValueChannel) + assert.Equal(t, fernTestValueChannel, obj.Channel) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetRecipient", func(t *testing.T) { + obj := &SchedulingBookingNotification{} + var fernTestValueRecipient SchedulingBookingNotificationRecipient + obj.SetRecipient(fernTestValueRecipient) + assert.Equal(t, fernTestValueRecipient, obj.Recipient) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetDueAt", func(t *testing.T) { + obj := &SchedulingBookingNotification{} + var fernTestValueDueAt string + obj.SetDueAt(fernTestValueDueAt) + assert.Equal(t, fernTestValueDueAt, obj.DueAt) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetFinishedAt", func(t *testing.T) { + obj := &SchedulingBookingNotification{} + var fernTestValueFinishedAt *string + obj.SetFinishedAt(fernTestValueFinishedAt) + assert.Equal(t, fernTestValueFinishedAt, obj.FinishedAt) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetOutcome", func(t *testing.T) { + obj := &SchedulingBookingNotification{} + var fernTestValueOutcome *string + obj.SetOutcome(fernTestValueOutcome) + assert.Equal(t, fernTestValueOutcome, obj.Outcome) + assert.NotNil(t, obj.explicitFields) + }) + +} + +func TestGettersSchedulingBookingNotification(t *testing.T) { + t.Run("GetObject", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingBookingNotification{} + var expected SchedulingBookingNotificationObject + obj.Object = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetObject(), "getter should return the property value") + }) + + t.Run("GetObject_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingBookingNotification + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetObject() // Should return zero value + }) + + t.Run("GetID", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingBookingNotification{} + var expected string + obj.ID = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetID(), "getter should return the property value") + }) + + t.Run("GetID_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingBookingNotification + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetID() // Should return zero value + }) + + t.Run("GetKind", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingBookingNotification{} + var expected string + obj.Kind = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetKind(), "getter should return the property value") + }) + + t.Run("GetKind_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingBookingNotification + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetKind() // Should return zero value + }) + + t.Run("GetReminderKey", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingBookingNotification{} + var expected *string + obj.ReminderKey = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetReminderKey(), "getter should return the property value") + }) + + t.Run("GetReminderKey_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingBookingNotification{} + obj.ReminderKey = nil + + // Act & Assert + assert.Nil(t, obj.GetReminderKey(), "getter should return nil when property is nil") + }) + + t.Run("GetReminderKey_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingBookingNotification + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetReminderKey() // Should return zero value + }) + + t.Run("GetChannel", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingBookingNotification{} + var expected SchedulingBookingNotificationChannel + obj.Channel = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetChannel(), "getter should return the property value") + }) + + t.Run("GetChannel_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingBookingNotification + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetChannel() // Should return zero value + }) + + t.Run("GetRecipient", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingBookingNotification{} + var expected SchedulingBookingNotificationRecipient + obj.Recipient = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetRecipient(), "getter should return the property value") + }) + + t.Run("GetRecipient_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingBookingNotification + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetRecipient() // Should return zero value + }) + + t.Run("GetDueAt", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingBookingNotification{} + var expected string + obj.DueAt = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetDueAt(), "getter should return the property value") + }) + + t.Run("GetDueAt_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingBookingNotification + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetDueAt() // Should return zero value + }) + + t.Run("GetFinishedAt", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingBookingNotification{} + var expected *string + obj.FinishedAt = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetFinishedAt(), "getter should return the property value") + }) + + t.Run("GetFinishedAt_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingBookingNotification{} + obj.FinishedAt = nil + + // Act & Assert + assert.Nil(t, obj.GetFinishedAt(), "getter should return nil when property is nil") + }) + + t.Run("GetFinishedAt_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingBookingNotification + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetFinishedAt() // Should return zero value + }) + + t.Run("GetOutcome", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingBookingNotification{} + var expected *string + obj.Outcome = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetOutcome(), "getter should return the property value") + }) + + t.Run("GetOutcome_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingBookingNotification{} + obj.Outcome = nil + + // Act & Assert + assert.Nil(t, obj.GetOutcome(), "getter should return nil when property is nil") + }) + + t.Run("GetOutcome_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingBookingNotification + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetOutcome() // Should return zero value + }) + +} + +func TestSettersMarkExplicitSchedulingBookingNotification(t *testing.T) { + t.Run("SetObject_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingBookingNotification{} + var fernTestValueObject SchedulingBookingNotificationObject + + // Act + obj.SetObject(fernTestValueObject) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetID_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingBookingNotification{} + var fernTestValueID string + + // Act + obj.SetID(fernTestValueID) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetKind_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingBookingNotification{} + var fernTestValueKind string + + // Act + obj.SetKind(fernTestValueKind) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetReminderKey_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingBookingNotification{} + var fernTestValueReminderKey *string + + // Act + obj.SetReminderKey(fernTestValueReminderKey) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetChannel_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingBookingNotification{} + var fernTestValueChannel SchedulingBookingNotificationChannel + + // Act + obj.SetChannel(fernTestValueChannel) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetRecipient_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingBookingNotification{} + var fernTestValueRecipient SchedulingBookingNotificationRecipient + + // Act + obj.SetRecipient(fernTestValueRecipient) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetDueAt_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingBookingNotification{} + var fernTestValueDueAt string + + // Act + obj.SetDueAt(fernTestValueDueAt) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetFinishedAt_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingBookingNotification{} + var fernTestValueFinishedAt *string + + // Act + obj.SetFinishedAt(fernTestValueFinishedAt) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetOutcome_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingBookingNotification{} + var fernTestValueOutcome *string + + // Act + obj.SetOutcome(fernTestValueOutcome) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + +} + +func TestSettersSchedulingBookingNotificationList(t *testing.T) { + t.Run("SetObject", func(t *testing.T) { + obj := &SchedulingBookingNotificationList{} + var fernTestValueObject SchedulingBookingNotificationListObject + obj.SetObject(fernTestValueObject) + assert.Equal(t, fernTestValueObject, obj.Object) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetData", func(t *testing.T) { + obj := &SchedulingBookingNotificationList{} + var fernTestValueData []*SchedulingBookingNotification + obj.SetData(fernTestValueData) + assert.Equal(t, fernTestValueData, obj.Data) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetHasMore", func(t *testing.T) { + obj := &SchedulingBookingNotificationList{} + var fernTestValueHasMore bool + obj.SetHasMore(fernTestValueHasMore) + assert.Equal(t, fernTestValueHasMore, obj.HasMore) + assert.NotNil(t, obj.explicitFields) + }) + +} + +func TestGettersSchedulingBookingNotificationList(t *testing.T) { + t.Run("GetObject", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingBookingNotificationList{} + var expected SchedulingBookingNotificationListObject + obj.Object = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetObject(), "getter should return the property value") + }) + + t.Run("GetObject_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingBookingNotificationList + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetObject() // Should return zero value + }) + + t.Run("GetData", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingBookingNotificationList{} + var expected []*SchedulingBookingNotification + obj.Data = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetData(), "getter should return the property value") + }) + + t.Run("GetData_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingBookingNotificationList{} + obj.Data = nil + + // Act & Assert + assert.Nil(t, obj.GetData(), "getter should return nil when property is nil") + }) + + t.Run("GetData_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingBookingNotificationList + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetData() // Should return zero value + }) + + t.Run("GetHasMore", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingBookingNotificationList{} + var expected bool + obj.HasMore = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetHasMore(), "getter should return the property value") + }) + + t.Run("GetHasMore_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingBookingNotificationList + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetHasMore() // Should return zero value + }) + +} + +func TestSettersMarkExplicitSchedulingBookingNotificationList(t *testing.T) { + t.Run("SetObject_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingBookingNotificationList{} + var fernTestValueObject SchedulingBookingNotificationListObject + + // Act + obj.SetObject(fernTestValueObject) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetData_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingBookingNotificationList{} + var fernTestValueData []*SchedulingBookingNotification + + // Act + obj.SetData(fernTestValueData) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetHasMore_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingBookingNotificationList{} + var fernTestValueHasMore bool + + // Act + obj.SetHasMore(fernTestValueHasMore) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + +} + +func TestGettersSchedulingBookingWindow(t *testing.T) { + t.Run("GetSchedulingBookingWindowDays", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingBookingWindow{} + var expected *SchedulingBookingWindowDays + obj.SchedulingBookingWindowDays = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetSchedulingBookingWindowDays(), "getter should return the property value") + }) + + t.Run("GetSchedulingBookingWindowDays_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingBookingWindow{} + obj.SchedulingBookingWindowDays = nil + + // Act & Assert + assert.Nil(t, obj.GetSchedulingBookingWindowDays(), "getter should return nil when property is nil") + }) + + t.Run("GetSchedulingBookingWindowDays_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingBookingWindow + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetSchedulingBookingWindowDays() // Should return zero value + }) + + t.Run("GetSchedulingBookingWindowFrom", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingBookingWindow{} + var expected *SchedulingBookingWindowFrom + obj.SchedulingBookingWindowFrom = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetSchedulingBookingWindowFrom(), "getter should return the property value") + }) + + t.Run("GetSchedulingBookingWindowFrom_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingBookingWindow{} + obj.SchedulingBookingWindowFrom = nil + + // Act & Assert + assert.Nil(t, obj.GetSchedulingBookingWindowFrom(), "getter should return nil when property is nil") + }) + + t.Run("GetSchedulingBookingWindowFrom_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingBookingWindow + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetSchedulingBookingWindowFrom() // Should return zero value + }) + +} + +func TestSettersSchedulingBookingWindowDays(t *testing.T) { + t.Run("SetKind", func(t *testing.T) { + obj := &SchedulingBookingWindowDays{} + var fernTestValueKind SchedulingBookingWindowDaysKind + obj.SetKind(fernTestValueKind) + assert.Equal(t, fernTestValueKind, obj.Kind) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetDays", func(t *testing.T) { + obj := &SchedulingBookingWindowDays{} + var fernTestValueDays int + obj.SetDays(fernTestValueDays) + assert.Equal(t, fernTestValueDays, obj.Days) + assert.NotNil(t, obj.explicitFields) + }) + +} + +func TestGettersSchedulingBookingWindowDays(t *testing.T) { + t.Run("GetKind", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingBookingWindowDays{} + var expected SchedulingBookingWindowDaysKind + obj.Kind = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetKind(), "getter should return the property value") + }) + + t.Run("GetKind_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingBookingWindowDays + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetKind() // Should return zero value + }) + + t.Run("GetDays", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingBookingWindowDays{} + var expected int + obj.Days = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetDays(), "getter should return the property value") + }) + + t.Run("GetDays_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingBookingWindowDays + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetDays() // Should return zero value + }) + +} + +func TestSettersMarkExplicitSchedulingBookingWindowDays(t *testing.T) { + t.Run("SetKind_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingBookingWindowDays{} + var fernTestValueKind SchedulingBookingWindowDaysKind + + // Act + obj.SetKind(fernTestValueKind) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetDays_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingBookingWindowDays{} + var fernTestValueDays int + + // Act + obj.SetDays(fernTestValueDays) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + +} + +func TestSettersSchedulingBookingWindowFrom(t *testing.T) { + t.Run("SetKind", func(t *testing.T) { + obj := &SchedulingBookingWindowFrom{} + var fernTestValueKind SchedulingBookingWindowFromKind + obj.SetKind(fernTestValueKind) + assert.Equal(t, fernTestValueKind, obj.Kind) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetFrom", func(t *testing.T) { + obj := &SchedulingBookingWindowFrom{} + var fernTestValueFrom string + obj.SetFrom(fernTestValueFrom) + assert.Equal(t, fernTestValueFrom, obj.From) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetTo", func(t *testing.T) { + obj := &SchedulingBookingWindowFrom{} + var fernTestValueTo string + obj.SetTo(fernTestValueTo) + assert.Equal(t, fernTestValueTo, obj.To) + assert.NotNil(t, obj.explicitFields) + }) + +} + +func TestGettersSchedulingBookingWindowFrom(t *testing.T) { + t.Run("GetKind", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingBookingWindowFrom{} + var expected SchedulingBookingWindowFromKind + obj.Kind = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetKind(), "getter should return the property value") + }) + + t.Run("GetKind_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingBookingWindowFrom + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetKind() // Should return zero value + }) + + t.Run("GetFrom", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingBookingWindowFrom{} + var expected string + obj.From = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetFrom(), "getter should return the property value") + }) + + t.Run("GetFrom_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingBookingWindowFrom + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetFrom() // Should return zero value + }) + + t.Run("GetTo", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingBookingWindowFrom{} + var expected string + obj.To = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetTo(), "getter should return the property value") + }) + + t.Run("GetTo_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingBookingWindowFrom + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetTo() // Should return zero value + }) + +} + +func TestSettersMarkExplicitSchedulingBookingWindowFrom(t *testing.T) { + t.Run("SetKind_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingBookingWindowFrom{} + var fernTestValueKind SchedulingBookingWindowFromKind + + // Act + obj.SetKind(fernTestValueKind) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetFrom_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingBookingWindowFrom{} + var fernTestValueFrom string + + // Act + obj.SetFrom(fernTestValueFrom) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetTo_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingBookingWindowFrom{} + var fernTestValueTo string + + // Act + obj.SetTo(fernTestValueTo) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + +} + +func TestSettersSchedulingCalendarAuthorization(t *testing.T) { + t.Run("SetObject", func(t *testing.T) { + obj := &SchedulingCalendarAuthorization{} + var fernTestValueObject SchedulingCalendarAuthorizationObject + obj.SetObject(fernTestValueObject) + assert.Equal(t, fernTestValueObject, obj.Object) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetURL", func(t *testing.T) { + obj := &SchedulingCalendarAuthorization{} + var fernTestValueURL string + obj.SetURL(fernTestValueURL) + assert.Equal(t, fernTestValueURL, obj.URL) + assert.NotNil(t, obj.explicitFields) + }) + +} + +func TestGettersSchedulingCalendarAuthorization(t *testing.T) { + t.Run("GetObject", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingCalendarAuthorization{} + var expected SchedulingCalendarAuthorizationObject + obj.Object = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetObject(), "getter should return the property value") + }) + + t.Run("GetObject_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingCalendarAuthorization + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetObject() // Should return zero value + }) + + t.Run("GetURL", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingCalendarAuthorization{} + var expected string + obj.URL = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetURL(), "getter should return the property value") + }) + + t.Run("GetURL_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingCalendarAuthorization + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetURL() // Should return zero value + }) + +} + +func TestSettersMarkExplicitSchedulingCalendarAuthorization(t *testing.T) { + t.Run("SetObject_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingCalendarAuthorization{} + var fernTestValueObject SchedulingCalendarAuthorizationObject + + // Act + obj.SetObject(fernTestValueObject) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetURL_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingCalendarAuthorization{} + var fernTestValueURL string + + // Act + obj.SetURL(fernTestValueURL) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + +} + +func TestSettersSchedulingCalendarConnection(t *testing.T) { + t.Run("SetObject", func(t *testing.T) { + obj := &SchedulingCalendarConnection{} + var fernTestValueObject SchedulingCalendarConnectionObject + obj.SetObject(fernTestValueObject) + assert.Equal(t, fernTestValueObject, obj.Object) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetID", func(t *testing.T) { + obj := &SchedulingCalendarConnection{} + var fernTestValueID string + obj.SetID(fernTestValueID) + assert.Equal(t, fernTestValueID, obj.ID) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetHost", func(t *testing.T) { + obj := &SchedulingCalendarConnection{} + var fernTestValueHost string + obj.SetHost(fernTestValueHost) + assert.Equal(t, fernTestValueHost, obj.Host) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetProvider", func(t *testing.T) { + obj := &SchedulingCalendarConnection{} + var fernTestValueProvider SchedulingCalendarConnectionProvider + obj.SetProvider(fernTestValueProvider) + assert.Equal(t, fernTestValueProvider, obj.Provider) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetAccount", func(t *testing.T) { + obj := &SchedulingCalendarConnection{} + var fernTestValueAccount string + obj.SetAccount(fernTestValueAccount) + assert.Equal(t, fernTestValueAccount, obj.Account) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetStatus", func(t *testing.T) { + obj := &SchedulingCalendarConnection{} + var fernTestValueStatus SchedulingCalendarConnectionStatus + obj.SetStatus(fernTestValueStatus) + assert.Equal(t, fernTestValueStatus, obj.Status) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetOauthApp", func(t *testing.T) { + obj := &SchedulingCalendarConnection{} + var fernTestValueOauthApp *string + obj.SetOauthApp(fernTestValueOauthApp) + assert.Equal(t, fernTestValueOauthApp, obj.OauthApp) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetDelegation", func(t *testing.T) { + obj := &SchedulingCalendarConnection{} + var fernTestValueDelegation *string + obj.SetDelegation(fernTestValueDelegation) + assert.Equal(t, fernTestValueDelegation, obj.Delegation) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetCalendars", func(t *testing.T) { + obj := &SchedulingCalendarConnection{} + var fernTestValueCalendars []*SchedulingCalendarConnectionCalendarsItem + obj.SetCalendars(fernTestValueCalendars) + assert.Equal(t, fernTestValueCalendars, obj.Calendars) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetCreatedAt", func(t *testing.T) { + obj := &SchedulingCalendarConnection{} + var fernTestValueCreatedAt string + obj.SetCreatedAt(fernTestValueCreatedAt) + assert.Equal(t, fernTestValueCreatedAt, obj.CreatedAt) + assert.NotNil(t, obj.explicitFields) + }) + +} + +func TestGettersSchedulingCalendarConnection(t *testing.T) { + t.Run("GetObject", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingCalendarConnection{} + var expected SchedulingCalendarConnectionObject + obj.Object = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetObject(), "getter should return the property value") + }) + + t.Run("GetObject_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingCalendarConnection + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetObject() // Should return zero value + }) + + t.Run("GetID", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingCalendarConnection{} + var expected string + obj.ID = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetID(), "getter should return the property value") + }) + + t.Run("GetID_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingCalendarConnection + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetID() // Should return zero value + }) + + t.Run("GetHost", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingCalendarConnection{} + var expected string + obj.Host = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetHost(), "getter should return the property value") + }) + + t.Run("GetHost_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingCalendarConnection + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetHost() // Should return zero value + }) + + t.Run("GetProvider", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingCalendarConnection{} + var expected SchedulingCalendarConnectionProvider + obj.Provider = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetProvider(), "getter should return the property value") + }) + + t.Run("GetProvider_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingCalendarConnection + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetProvider() // Should return zero value + }) + + t.Run("GetAccount", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingCalendarConnection{} + var expected string + obj.Account = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetAccount(), "getter should return the property value") + }) + + t.Run("GetAccount_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingCalendarConnection + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetAccount() // Should return zero value + }) + + t.Run("GetStatus", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingCalendarConnection{} + var expected SchedulingCalendarConnectionStatus + obj.Status = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetStatus(), "getter should return the property value") + }) + + t.Run("GetStatus_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingCalendarConnection + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetStatus() // Should return zero value + }) + + t.Run("GetOauthApp", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingCalendarConnection{} + var expected *string + obj.OauthApp = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetOauthApp(), "getter should return the property value") + }) + + t.Run("GetOauthApp_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingCalendarConnection{} + obj.OauthApp = nil + + // Act & Assert + assert.Nil(t, obj.GetOauthApp(), "getter should return nil when property is nil") + }) + + t.Run("GetOauthApp_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingCalendarConnection + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetOauthApp() // Should return zero value + }) + + t.Run("GetDelegation", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingCalendarConnection{} + var expected *string + obj.Delegation = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetDelegation(), "getter should return the property value") + }) + + t.Run("GetDelegation_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingCalendarConnection{} + obj.Delegation = nil + + // Act & Assert + assert.Nil(t, obj.GetDelegation(), "getter should return nil when property is nil") + }) + + t.Run("GetDelegation_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingCalendarConnection + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetDelegation() // Should return zero value + }) + + t.Run("GetCalendars", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingCalendarConnection{} + var expected []*SchedulingCalendarConnectionCalendarsItem + obj.Calendars = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetCalendars(), "getter should return the property value") + }) + + t.Run("GetCalendars_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingCalendarConnection{} + obj.Calendars = nil + + // Act & Assert + assert.Nil(t, obj.GetCalendars(), "getter should return nil when property is nil") + }) + + t.Run("GetCalendars_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingCalendarConnection + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetCalendars() // Should return zero value + }) + + t.Run("GetCreatedAt", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingCalendarConnection{} + var expected string + obj.CreatedAt = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetCreatedAt(), "getter should return the property value") + }) + + t.Run("GetCreatedAt_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingCalendarConnection + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetCreatedAt() // Should return zero value + }) + +} + +func TestSettersMarkExplicitSchedulingCalendarConnection(t *testing.T) { + t.Run("SetObject_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingCalendarConnection{} + var fernTestValueObject SchedulingCalendarConnectionObject + + // Act + obj.SetObject(fernTestValueObject) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetID_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingCalendarConnection{} + var fernTestValueID string + + // Act + obj.SetID(fernTestValueID) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetHost_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingCalendarConnection{} + var fernTestValueHost string + + // Act + obj.SetHost(fernTestValueHost) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetProvider_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingCalendarConnection{} + var fernTestValueProvider SchedulingCalendarConnectionProvider + + // Act + obj.SetProvider(fernTestValueProvider) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetAccount_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingCalendarConnection{} + var fernTestValueAccount string + + // Act + obj.SetAccount(fernTestValueAccount) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetStatus_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingCalendarConnection{} + var fernTestValueStatus SchedulingCalendarConnectionStatus + + // Act + obj.SetStatus(fernTestValueStatus) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetOauthApp_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingCalendarConnection{} + var fernTestValueOauthApp *string + + // Act + obj.SetOauthApp(fernTestValueOauthApp) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetDelegation_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingCalendarConnection{} + var fernTestValueDelegation *string + + // Act + obj.SetDelegation(fernTestValueDelegation) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetCalendars_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingCalendarConnection{} + var fernTestValueCalendars []*SchedulingCalendarConnectionCalendarsItem + + // Act + obj.SetCalendars(fernTestValueCalendars) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetCreatedAt_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingCalendarConnection{} + var fernTestValueCreatedAt string + + // Act + obj.SetCreatedAt(fernTestValueCreatedAt) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + +} + +func TestSettersSchedulingCalendarConnectionCalendarsItem(t *testing.T) { + t.Run("SetID", func(t *testing.T) { + obj := &SchedulingCalendarConnectionCalendarsItem{} + var fernTestValueID string + obj.SetID(fernTestValueID) + assert.Equal(t, fernTestValueID, obj.ID) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetExternalID", func(t *testing.T) { + obj := &SchedulingCalendarConnectionCalendarsItem{} + var fernTestValueExternalID string + obj.SetExternalID(fernTestValueExternalID) + assert.Equal(t, fernTestValueExternalID, obj.ExternalID) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetReadBusy", func(t *testing.T) { + obj := &SchedulingCalendarConnectionCalendarsItem{} + var fernTestValueReadBusy bool + obj.SetReadBusy(fernTestValueReadBusy) + assert.Equal(t, fernTestValueReadBusy, obj.ReadBusy) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetWriteTarget", func(t *testing.T) { + obj := &SchedulingCalendarConnectionCalendarsItem{} + var fernTestValueWriteTarget bool + obj.SetWriteTarget(fernTestValueWriteTarget) + assert.Equal(t, fernTestValueWriteTarget, obj.WriteTarget) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetVerifiedAt", func(t *testing.T) { + obj := &SchedulingCalendarConnectionCalendarsItem{} + var fernTestValueVerifiedAt *string + obj.SetVerifiedAt(fernTestValueVerifiedAt) + assert.Equal(t, fernTestValueVerifiedAt, obj.VerifiedAt) + assert.NotNil(t, obj.explicitFields) + }) + +} + +func TestGettersSchedulingCalendarConnectionCalendarsItem(t *testing.T) { + t.Run("GetID", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingCalendarConnectionCalendarsItem{} + var expected string + obj.ID = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetID(), "getter should return the property value") + }) + + t.Run("GetID_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingCalendarConnectionCalendarsItem + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetID() // Should return zero value + }) + + t.Run("GetExternalID", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingCalendarConnectionCalendarsItem{} + var expected string + obj.ExternalID = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetExternalID(), "getter should return the property value") + }) + + t.Run("GetExternalID_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingCalendarConnectionCalendarsItem + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetExternalID() // Should return zero value + }) + + t.Run("GetReadBusy", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingCalendarConnectionCalendarsItem{} + var expected bool + obj.ReadBusy = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetReadBusy(), "getter should return the property value") + }) + + t.Run("GetReadBusy_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingCalendarConnectionCalendarsItem + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetReadBusy() // Should return zero value + }) + + t.Run("GetWriteTarget", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingCalendarConnectionCalendarsItem{} + var expected bool + obj.WriteTarget = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetWriteTarget(), "getter should return the property value") + }) + + t.Run("GetWriteTarget_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingCalendarConnectionCalendarsItem + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetWriteTarget() // Should return zero value + }) + + t.Run("GetVerifiedAt", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingCalendarConnectionCalendarsItem{} + var expected *string + obj.VerifiedAt = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetVerifiedAt(), "getter should return the property value") + }) + + t.Run("GetVerifiedAt_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingCalendarConnectionCalendarsItem{} + obj.VerifiedAt = nil + + // Act & Assert + assert.Nil(t, obj.GetVerifiedAt(), "getter should return nil when property is nil") + }) + + t.Run("GetVerifiedAt_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingCalendarConnectionCalendarsItem + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetVerifiedAt() // Should return zero value + }) + +} + +func TestSettersMarkExplicitSchedulingCalendarConnectionCalendarsItem(t *testing.T) { + t.Run("SetID_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingCalendarConnectionCalendarsItem{} + var fernTestValueID string + + // Act + obj.SetID(fernTestValueID) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetExternalID_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingCalendarConnectionCalendarsItem{} + var fernTestValueExternalID string + + // Act + obj.SetExternalID(fernTestValueExternalID) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetReadBusy_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingCalendarConnectionCalendarsItem{} + var fernTestValueReadBusy bool + + // Act + obj.SetReadBusy(fernTestValueReadBusy) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetWriteTarget_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingCalendarConnectionCalendarsItem{} + var fernTestValueWriteTarget bool + + // Act + obj.SetWriteTarget(fernTestValueWriteTarget) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetVerifiedAt_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingCalendarConnectionCalendarsItem{} + var fernTestValueVerifiedAt *string + + // Act + obj.SetVerifiedAt(fernTestValueVerifiedAt) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + +} + +func TestSettersSchedulingCalendarConnectionList(t *testing.T) { + t.Run("SetObject", func(t *testing.T) { + obj := &SchedulingCalendarConnectionList{} + var fernTestValueObject SchedulingCalendarConnectionListObject + obj.SetObject(fernTestValueObject) + assert.Equal(t, fernTestValueObject, obj.Object) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetData", func(t *testing.T) { + obj := &SchedulingCalendarConnectionList{} + var fernTestValueData []*SchedulingCalendarConnection + obj.SetData(fernTestValueData) + assert.Equal(t, fernTestValueData, obj.Data) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetHasMore", func(t *testing.T) { + obj := &SchedulingCalendarConnectionList{} + var fernTestValueHasMore bool + obj.SetHasMore(fernTestValueHasMore) + assert.Equal(t, fernTestValueHasMore, obj.HasMore) + assert.NotNil(t, obj.explicitFields) + }) + +} + +func TestGettersSchedulingCalendarConnectionList(t *testing.T) { + t.Run("GetObject", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingCalendarConnectionList{} + var expected SchedulingCalendarConnectionListObject + obj.Object = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetObject(), "getter should return the property value") + }) + + t.Run("GetObject_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingCalendarConnectionList + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetObject() // Should return zero value + }) + + t.Run("GetData", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingCalendarConnectionList{} + var expected []*SchedulingCalendarConnection + obj.Data = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetData(), "getter should return the property value") + }) + + t.Run("GetData_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingCalendarConnectionList{} + obj.Data = nil + + // Act & Assert + assert.Nil(t, obj.GetData(), "getter should return nil when property is nil") + }) + + t.Run("GetData_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingCalendarConnectionList + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetData() // Should return zero value + }) + + t.Run("GetHasMore", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingCalendarConnectionList{} + var expected bool + obj.HasMore = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetHasMore(), "getter should return the property value") + }) + + t.Run("GetHasMore_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingCalendarConnectionList + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetHasMore() // Should return zero value + }) + +} + +func TestSettersMarkExplicitSchedulingCalendarConnectionList(t *testing.T) { + t.Run("SetObject_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingCalendarConnectionList{} + var fernTestValueObject SchedulingCalendarConnectionListObject + + // Act + obj.SetObject(fernTestValueObject) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetData_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingCalendarConnectionList{} + var fernTestValueData []*SchedulingCalendarConnection + + // Act + obj.SetData(fernTestValueData) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetHasMore_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingCalendarConnectionList{} + var fernTestValueHasMore bool + + // Act + obj.SetHasMore(fernTestValueHasMore) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + +} + +func TestSettersSchedulingCalendarDelegation(t *testing.T) { + t.Run("SetObject", func(t *testing.T) { + obj := &SchedulingCalendarDelegation{} + var fernTestValueObject SchedulingCalendarDelegationObject + obj.SetObject(fernTestValueObject) + assert.Equal(t, fernTestValueObject, obj.Object) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetID", func(t *testing.T) { + obj := &SchedulingCalendarDelegation{} + var fernTestValueID string + obj.SetID(fernTestValueID) + assert.Equal(t, fernTestValueID, obj.ID) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetProvider", func(t *testing.T) { + obj := &SchedulingCalendarDelegation{} + var fernTestValueProvider SchedulingCalendarDelegationProvider + obj.SetProvider(fernTestValueProvider) + assert.Equal(t, fernTestValueProvider, obj.Provider) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetDomain", func(t *testing.T) { + obj := &SchedulingCalendarDelegation{} + var fernTestValueDomain string + obj.SetDomain(fernTestValueDomain) + assert.Equal(t, fernTestValueDomain, obj.Domain) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetStatus", func(t *testing.T) { + obj := &SchedulingCalendarDelegation{} + var fernTestValueStatus SchedulingCalendarDelegationStatus + obj.SetStatus(fernTestValueStatus) + assert.Equal(t, fernTestValueStatus, obj.Status) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetMatchHostEmail", func(t *testing.T) { + obj := &SchedulingCalendarDelegation{} + var fernTestValueMatchHostEmail bool + obj.SetMatchHostEmail(fernTestValueMatchHostEmail) + assert.Equal(t, fernTestValueMatchHostEmail, obj.MatchHostEmail) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetClientID", func(t *testing.T) { + obj := &SchedulingCalendarDelegation{} + var fernTestValueClientID string + obj.SetClientID(fernTestValueClientID) + assert.Equal(t, fernTestValueClientID, obj.ClientID) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetTenantID", func(t *testing.T) { + obj := &SchedulingCalendarDelegation{} + var fernTestValueTenantID *string + obj.SetTenantID(fernTestValueTenantID) + assert.Equal(t, fernTestValueTenantID, obj.TenantID) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetScopes", func(t *testing.T) { + obj := &SchedulingCalendarDelegation{} + var fernTestValueScopes []string + obj.SetScopes(fernTestValueScopes) + assert.Equal(t, fernTestValueScopes, obj.Scopes) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetVerifiedAccount", func(t *testing.T) { + obj := &SchedulingCalendarDelegation{} + var fernTestValueVerifiedAccount *string + obj.SetVerifiedAccount(fernTestValueVerifiedAccount) + assert.Equal(t, fernTestValueVerifiedAccount, obj.VerifiedAccount) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetLastErrorCode", func(t *testing.T) { + obj := &SchedulingCalendarDelegation{} + var fernTestValueLastErrorCode *string + obj.SetLastErrorCode(fernTestValueLastErrorCode) + assert.Equal(t, fernTestValueLastErrorCode, obj.LastErrorCode) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetFailingSince", func(t *testing.T) { + obj := &SchedulingCalendarDelegation{} + var fernTestValueFailingSince *string + obj.SetFailingSince(fernTestValueFailingSince) + assert.Equal(t, fernTestValueFailingSince, obj.FailingSince) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetSecretExpiresAt", func(t *testing.T) { + obj := &SchedulingCalendarDelegation{} + var fernTestValueSecretExpiresAt *string + obj.SetSecretExpiresAt(fernTestValueSecretExpiresAt) + assert.Equal(t, fernTestValueSecretExpiresAt, obj.SecretExpiresAt) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetHostsConnected", func(t *testing.T) { + obj := &SchedulingCalendarDelegation{} + var fernTestValueHostsConnected int64 + obj.SetHostsConnected(fernTestValueHostsConnected) + assert.Equal(t, fernTestValueHostsConnected, obj.HostsConnected) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetHostsFailed", func(t *testing.T) { + obj := &SchedulingCalendarDelegation{} + var fernTestValueHostsFailed int64 + obj.SetHostsFailed(fernTestValueHostsFailed) + assert.Equal(t, fernTestValueHostsFailed, obj.HostsFailed) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetCreatedAt", func(t *testing.T) { + obj := &SchedulingCalendarDelegation{} + var fernTestValueCreatedAt string + obj.SetCreatedAt(fernTestValueCreatedAt) + assert.Equal(t, fernTestValueCreatedAt, obj.CreatedAt) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetUpdatedAt", func(t *testing.T) { + obj := &SchedulingCalendarDelegation{} + var fernTestValueUpdatedAt string + obj.SetUpdatedAt(fernTestValueUpdatedAt) + assert.Equal(t, fernTestValueUpdatedAt, obj.UpdatedAt) + assert.NotNil(t, obj.explicitFields) + }) + +} + +func TestGettersSchedulingCalendarDelegation(t *testing.T) { + t.Run("GetObject", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingCalendarDelegation{} + var expected SchedulingCalendarDelegationObject + obj.Object = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetObject(), "getter should return the property value") + }) + + t.Run("GetObject_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingCalendarDelegation + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetObject() // Should return zero value + }) + + t.Run("GetID", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingCalendarDelegation{} + var expected string + obj.ID = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetID(), "getter should return the property value") + }) + + t.Run("GetID_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingCalendarDelegation + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetID() // Should return zero value + }) + + t.Run("GetProvider", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingCalendarDelegation{} + var expected SchedulingCalendarDelegationProvider + obj.Provider = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetProvider(), "getter should return the property value") + }) + + t.Run("GetProvider_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingCalendarDelegation + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetProvider() // Should return zero value + }) + + t.Run("GetDomain", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingCalendarDelegation{} + var expected string + obj.Domain = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetDomain(), "getter should return the property value") + }) + + t.Run("GetDomain_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingCalendarDelegation + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetDomain() // Should return zero value + }) + + t.Run("GetStatus", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingCalendarDelegation{} + var expected SchedulingCalendarDelegationStatus + obj.Status = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetStatus(), "getter should return the property value") + }) + + t.Run("GetStatus_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingCalendarDelegation + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetStatus() // Should return zero value + }) + + t.Run("GetMatchHostEmail", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingCalendarDelegation{} + var expected bool + obj.MatchHostEmail = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetMatchHostEmail(), "getter should return the property value") + }) + + t.Run("GetMatchHostEmail_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingCalendarDelegation + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetMatchHostEmail() // Should return zero value + }) + + t.Run("GetClientID", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingCalendarDelegation{} + var expected string + obj.ClientID = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetClientID(), "getter should return the property value") + }) + + t.Run("GetClientID_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingCalendarDelegation + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetClientID() // Should return zero value + }) + + t.Run("GetTenantID", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingCalendarDelegation{} + var expected *string + obj.TenantID = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetTenantID(), "getter should return the property value") + }) + + t.Run("GetTenantID_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingCalendarDelegation{} + obj.TenantID = nil + + // Act & Assert + assert.Nil(t, obj.GetTenantID(), "getter should return nil when property is nil") + }) + + t.Run("GetTenantID_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingCalendarDelegation + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetTenantID() // Should return zero value + }) + + t.Run("GetScopes", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingCalendarDelegation{} + var expected []string + obj.Scopes = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetScopes(), "getter should return the property value") + }) + + t.Run("GetScopes_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingCalendarDelegation{} + obj.Scopes = nil + + // Act & Assert + assert.Nil(t, obj.GetScopes(), "getter should return nil when property is nil") + }) + + t.Run("GetScopes_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingCalendarDelegation + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetScopes() // Should return zero value + }) + + t.Run("GetVerifiedAccount", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingCalendarDelegation{} + var expected *string + obj.VerifiedAccount = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetVerifiedAccount(), "getter should return the property value") + }) + + t.Run("GetVerifiedAccount_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingCalendarDelegation{} + obj.VerifiedAccount = nil + + // Act & Assert + assert.Nil(t, obj.GetVerifiedAccount(), "getter should return nil when property is nil") + }) + + t.Run("GetVerifiedAccount_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingCalendarDelegation + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetVerifiedAccount() // Should return zero value + }) + + t.Run("GetLastErrorCode", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingCalendarDelegation{} + var expected *string + obj.LastErrorCode = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetLastErrorCode(), "getter should return the property value") + }) + + t.Run("GetLastErrorCode_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingCalendarDelegation{} + obj.LastErrorCode = nil + + // Act & Assert + assert.Nil(t, obj.GetLastErrorCode(), "getter should return nil when property is nil") + }) + + t.Run("GetLastErrorCode_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingCalendarDelegation + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetLastErrorCode() // Should return zero value + }) + + t.Run("GetFailingSince", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingCalendarDelegation{} + var expected *string + obj.FailingSince = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetFailingSince(), "getter should return the property value") + }) + + t.Run("GetFailingSince_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingCalendarDelegation{} + obj.FailingSince = nil + + // Act & Assert + assert.Nil(t, obj.GetFailingSince(), "getter should return nil when property is nil") + }) + + t.Run("GetFailingSince_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingCalendarDelegation + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetFailingSince() // Should return zero value + }) + + t.Run("GetSecretExpiresAt", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingCalendarDelegation{} + var expected *string + obj.SecretExpiresAt = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetSecretExpiresAt(), "getter should return the property value") + }) + + t.Run("GetSecretExpiresAt_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingCalendarDelegation{} + obj.SecretExpiresAt = nil + + // Act & Assert + assert.Nil(t, obj.GetSecretExpiresAt(), "getter should return nil when property is nil") + }) + + t.Run("GetSecretExpiresAt_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingCalendarDelegation + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetSecretExpiresAt() // Should return zero value + }) + + t.Run("GetHostsConnected", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingCalendarDelegation{} + var expected int64 + obj.HostsConnected = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetHostsConnected(), "getter should return the property value") + }) + + t.Run("GetHostsConnected_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingCalendarDelegation + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetHostsConnected() // Should return zero value + }) + + t.Run("GetHostsFailed", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingCalendarDelegation{} + var expected int64 + obj.HostsFailed = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetHostsFailed(), "getter should return the property value") + }) + + t.Run("GetHostsFailed_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingCalendarDelegation + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetHostsFailed() // Should return zero value + }) + + t.Run("GetCreatedAt", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingCalendarDelegation{} + var expected string + obj.CreatedAt = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetCreatedAt(), "getter should return the property value") + }) + + t.Run("GetCreatedAt_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingCalendarDelegation + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetCreatedAt() // Should return zero value + }) + + t.Run("GetUpdatedAt", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingCalendarDelegation{} + var expected string + obj.UpdatedAt = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetUpdatedAt(), "getter should return the property value") + }) + + t.Run("GetUpdatedAt_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingCalendarDelegation + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetUpdatedAt() // Should return zero value + }) + +} + +func TestSettersMarkExplicitSchedulingCalendarDelegation(t *testing.T) { + t.Run("SetObject_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingCalendarDelegation{} + var fernTestValueObject SchedulingCalendarDelegationObject + + // Act + obj.SetObject(fernTestValueObject) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -80013,14 +90523,14 @@ func TestSettersMarkExplicitRiskSettingsReasonWeights(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetVelocityCheckoutsPerIP1H_MarksExplicit", func(t *testing.T) { + t.Run("SetID_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskSettingsReasonWeights{} - var fernTestValueVelocityCheckoutsPerIP1H *float64 + obj := &SchedulingCalendarDelegation{} + var fernTestValueID string // Act - obj.SetVelocityCheckoutsPerIP1H(fernTestValueVelocityCheckoutsPerIP1H) + obj.SetID(fernTestValueID) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -80044,14 +90554,14 @@ func TestSettersMarkExplicitRiskSettingsReasonWeights(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetVelocityCheckoutsPerUser1H_MarksExplicit", func(t *testing.T) { + t.Run("SetProvider_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskSettingsReasonWeights{} - var fernTestValueVelocityCheckoutsPerUser1H *float64 + obj := &SchedulingCalendarDelegation{} + var fernTestValueProvider SchedulingCalendarDelegationProvider // Act - obj.SetVelocityCheckoutsPerUser1H(fernTestValueVelocityCheckoutsPerUser1H) + obj.SetProvider(fernTestValueProvider) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -80075,14 +90585,14 @@ func TestSettersMarkExplicitRiskSettingsReasonWeights(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetVelocityCheckoutsPerCard24H_MarksExplicit", func(t *testing.T) { + t.Run("SetDomain_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskSettingsReasonWeights{} - var fernTestValueVelocityCheckoutsPerCard24H *float64 + obj := &SchedulingCalendarDelegation{} + var fernTestValueDomain string // Act - obj.SetVelocityCheckoutsPerCard24H(fernTestValueVelocityCheckoutsPerCard24H) + obj.SetDomain(fernTestValueDomain) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -80106,14 +90616,14 @@ func TestSettersMarkExplicitRiskSettingsReasonWeights(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetVelocityLoginsPerIP1H_MarksExplicit", func(t *testing.T) { + t.Run("SetStatus_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskSettingsReasonWeights{} - var fernTestValueVelocityLoginsPerIP1H *float64 + obj := &SchedulingCalendarDelegation{} + var fernTestValueStatus SchedulingCalendarDelegationStatus // Act - obj.SetVelocityLoginsPerIP1H(fernTestValueVelocityLoginsPerIP1H) + obj.SetStatus(fernTestValueStatus) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -80137,14 +90647,498 @@ func TestSettersMarkExplicitRiskSettingsReasonWeights(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetVelocityLoginsPerUser1H_MarksExplicit", func(t *testing.T) { + t.Run("SetMatchHostEmail_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingCalendarDelegation{} + var fernTestValueMatchHostEmail bool + + // Act + obj.SetMatchHostEmail(fernTestValueMatchHostEmail) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetClientID_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingCalendarDelegation{} + var fernTestValueClientID string + + // Act + obj.SetClientID(fernTestValueClientID) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetTenantID_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingCalendarDelegation{} + var fernTestValueTenantID *string + + // Act + obj.SetTenantID(fernTestValueTenantID) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetScopes_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingCalendarDelegation{} + var fernTestValueScopes []string + + // Act + obj.SetScopes(fernTestValueScopes) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetVerifiedAccount_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingCalendarDelegation{} + var fernTestValueVerifiedAccount *string + + // Act + obj.SetVerifiedAccount(fernTestValueVerifiedAccount) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetLastErrorCode_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingCalendarDelegation{} + var fernTestValueLastErrorCode *string + + // Act + obj.SetLastErrorCode(fernTestValueLastErrorCode) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetFailingSince_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingCalendarDelegation{} + var fernTestValueFailingSince *string + + // Act + obj.SetFailingSince(fernTestValueFailingSince) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetSecretExpiresAt_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingCalendarDelegation{} + var fernTestValueSecretExpiresAt *string + + // Act + obj.SetSecretExpiresAt(fernTestValueSecretExpiresAt) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetHostsConnected_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingCalendarDelegation{} + var fernTestValueHostsConnected int64 + + // Act + obj.SetHostsConnected(fernTestValueHostsConnected) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetHostsFailed_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingCalendarDelegation{} + var fernTestValueHostsFailed int64 + + // Act + obj.SetHostsFailed(fernTestValueHostsFailed) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetCreatedAt_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingCalendarDelegation{} + var fernTestValueCreatedAt string + + // Act + obj.SetCreatedAt(fernTestValueCreatedAt) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetUpdatedAt_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingCalendarDelegation{} + var fernTestValueUpdatedAt string + + // Act + obj.SetUpdatedAt(fernTestValueUpdatedAt) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + +} + +func TestSettersSchedulingCalendarDelegationList(t *testing.T) { + t.Run("SetObject", func(t *testing.T) { + obj := &SchedulingCalendarDelegationList{} + var fernTestValueObject SchedulingCalendarDelegationListObject + obj.SetObject(fernTestValueObject) + assert.Equal(t, fernTestValueObject, obj.Object) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetData", func(t *testing.T) { + obj := &SchedulingCalendarDelegationList{} + var fernTestValueData []*SchedulingCalendarDelegation + obj.SetData(fernTestValueData) + assert.Equal(t, fernTestValueData, obj.Data) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetHasMore", func(t *testing.T) { + obj := &SchedulingCalendarDelegationList{} + var fernTestValueHasMore bool + obj.SetHasMore(fernTestValueHasMore) + assert.Equal(t, fernTestValueHasMore, obj.HasMore) + assert.NotNil(t, obj.explicitFields) + }) + +} + +func TestGettersSchedulingCalendarDelegationList(t *testing.T) { + t.Run("GetObject", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingCalendarDelegationList{} + var expected SchedulingCalendarDelegationListObject + obj.Object = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetObject(), "getter should return the property value") + }) + + t.Run("GetObject_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingCalendarDelegationList + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetObject() // Should return zero value + }) + + t.Run("GetData", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingCalendarDelegationList{} + var expected []*SchedulingCalendarDelegation + obj.Data = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetData(), "getter should return the property value") + }) + + t.Run("GetData_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingCalendarDelegationList{} + obj.Data = nil + + // Act & Assert + assert.Nil(t, obj.GetData(), "getter should return nil when property is nil") + }) + + t.Run("GetData_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingCalendarDelegationList + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetData() // Should return zero value + }) + + t.Run("GetHasMore", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingCalendarDelegationList{} + var expected bool + obj.HasMore = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetHasMore(), "getter should return the property value") + }) + + t.Run("GetHasMore_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingCalendarDelegationList + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetHasMore() // Should return zero value + }) + +} + +func TestSettersMarkExplicitSchedulingCalendarDelegationList(t *testing.T) { + t.Run("SetObject_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskSettingsReasonWeights{} - var fernTestValueVelocityLoginsPerUser1H *float64 + obj := &SchedulingCalendarDelegationList{} + var fernTestValueObject SchedulingCalendarDelegationListObject // Act - obj.SetVelocityLoginsPerUser1H(fernTestValueVelocityLoginsPerUser1H) + obj.SetObject(fernTestValueObject) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -80168,14 +91162,14 @@ func TestSettersMarkExplicitRiskSettingsReasonWeights(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetVelocityEventsPerIP1H_MarksExplicit", func(t *testing.T) { + t.Run("SetData_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskSettingsReasonWeights{} - var fernTestValueVelocityEventsPerIP1H *float64 + obj := &SchedulingCalendarDelegationList{} + var fernTestValueData []*SchedulingCalendarDelegation // Act - obj.SetVelocityEventsPerIP1H(fernTestValueVelocityEventsPerIP1H) + obj.SetData(fernTestValueData) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -80199,14 +91193,14 @@ func TestSettersMarkExplicitRiskSettingsReasonWeights(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetVelocityEventsPerUser1H_MarksExplicit", func(t *testing.T) { + t.Run("SetHasMore_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskSettingsReasonWeights{} - var fernTestValueVelocityEventsPerUser1H *float64 + obj := &SchedulingCalendarDelegationList{} + var fernTestValueHasMore bool // Act - obj.SetVelocityEventsPerUser1H(fernTestValueVelocityEventsPerUser1H) + obj.SetHasMore(fernTestValueHasMore) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -80230,76 +91224,126 @@ func TestSettersMarkExplicitRiskSettingsReasonWeights(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetDuplicateCanonicalMailbox_MarksExplicit", func(t *testing.T) { +} + +func TestSettersSchedulingCancelledSeries(t *testing.T) { + t.Run("SetObject", func(t *testing.T) { + obj := &SchedulingCancelledSeries{} + var fernTestValueObject SchedulingCancelledSeriesObject + obj.SetObject(fernTestValueObject) + assert.Equal(t, fernTestValueObject, obj.Object) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetData", func(t *testing.T) { + obj := &SchedulingCancelledSeries{} + var fernTestValueData []*SchedulingBooking + obj.SetData(fernTestValueData) + assert.Equal(t, fernTestValueData, obj.Data) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetHasMore", func(t *testing.T) { + obj := &SchedulingCancelledSeries{} + var fernTestValueHasMore bool + obj.SetHasMore(fernTestValueHasMore) + assert.Equal(t, fernTestValueHasMore, obj.HasMore) + assert.NotNil(t, obj.explicitFields) + }) + +} + +func TestGettersSchedulingCancelledSeries(t *testing.T) { + t.Run("GetObject", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskSettingsReasonWeights{} - var fernTestValueDuplicateCanonicalMailbox *float64 + obj := &SchedulingCancelledSeries{} + var expected SchedulingCancelledSeriesObject + obj.Object = expected - // Act - obj.SetDuplicateCanonicalMailbox(fernTestValueDuplicateCanonicalMailbox) + // Act & Assert + assert.Equal(t, expected, obj.GetObject(), "getter should return the property value") + }) - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") + t.Run("GetObject_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingCancelledSeries + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetObject() // Should return zero value + }) - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } + t.Run("GetData", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingCancelledSeries{} + var expected []*SchedulingBooking + obj.Data = expected - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip + // Act & Assert + assert.Equal(t, expected, obj.GetData(), "getter should return the property value") }) - t.Run("SetDuplicateDevice_MarksExplicit", func(t *testing.T) { + t.Run("GetData_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskSettingsReasonWeights{} - var fernTestValueDuplicateDevice *float64 + obj := &SchedulingCancelledSeries{} + obj.Data = nil - // Act - obj.SetDuplicateDevice(fernTestValueDuplicateDevice) + // Act & Assert + assert.Nil(t, obj.GetData(), "getter should return nil when property is nil") + }) - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") + t.Run("GetData_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingCancelledSeries + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetData() // Should return zero value + }) - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } + t.Run("GetHasMore", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingCancelledSeries{} + var expected bool + obj.HasMore = expected - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip + // Act & Assert + assert.Equal(t, expected, obj.GetHasMore(), "getter should return the property value") }) - t.Run("SetHistoryFraudMailbox_MarksExplicit", func(t *testing.T) { + t.Run("GetHasMore_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingCancelledSeries + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetHasMore() // Should return zero value + }) + +} + +func TestSettersMarkExplicitSchedulingCancelledSeries(t *testing.T) { + t.Run("SetObject_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskSettingsReasonWeights{} - var fernTestValueHistoryFraudMailbox *float64 + obj := &SchedulingCancelledSeries{} + var fernTestValueObject SchedulingCancelledSeriesObject // Act - obj.SetHistoryFraudMailbox(fernTestValueHistoryFraudMailbox) + obj.SetObject(fernTestValueObject) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -80323,14 +91367,14 @@ func TestSettersMarkExplicitRiskSettingsReasonWeights(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetHistoryFraudUser_MarksExplicit", func(t *testing.T) { + t.Run("SetData_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskSettingsReasonWeights{} - var fernTestValueHistoryFraudUser *float64 + obj := &SchedulingCancelledSeries{} + var fernTestValueData []*SchedulingBooking // Act - obj.SetHistoryFraudUser(fernTestValueHistoryFraudUser) + obj.SetData(fernTestValueData) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -80354,14 +91398,14 @@ func TestSettersMarkExplicitRiskSettingsReasonWeights(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetHistoryFraudIP_MarksExplicit", func(t *testing.T) { + t.Run("SetHasMore_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskSettingsReasonWeights{} - var fernTestValueHistoryFraudIP *float64 + obj := &SchedulingCancelledSeries{} + var fernTestValueHasMore bool // Act - obj.SetHistoryFraudIP(fernTestValueHistoryFraudIP) + obj.SetHasMore(fernTestValueHasMore) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -80385,609 +91429,1255 @@ func TestSettersMarkExplicitRiskSettingsReasonWeights(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetHistoryFraudSubnet_MarksExplicit", func(t *testing.T) { +} + +func TestSettersSchedulingEventType(t *testing.T) { + t.Run("SetObject", func(t *testing.T) { + obj := &SchedulingEventType{} + var fernTestValueObject SchedulingEventTypeObject + obj.SetObject(fernTestValueObject) + assert.Equal(t, fernTestValueObject, obj.Object) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetID", func(t *testing.T) { + obj := &SchedulingEventType{} + var fernTestValueID string + obj.SetID(fernTestValueID) + assert.Equal(t, fernTestValueID, obj.ID) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetUID", func(t *testing.T) { + obj := &SchedulingEventType{} + var fernTestValueUID *string + obj.SetUID(fernTestValueUID) + assert.Equal(t, fernTestValueUID, obj.UID) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetDescription", func(t *testing.T) { + obj := &SchedulingEventType{} + var fernTestValueDescription *string + obj.SetDescription(fernTestValueDescription) + assert.Equal(t, fernTestValueDescription, obj.Description) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetTitle", func(t *testing.T) { + obj := &SchedulingEventType{} + var fernTestValueTitle string + obj.SetTitle(fernTestValueTitle) + assert.Equal(t, fernTestValueTitle, obj.Title) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetKind", func(t *testing.T) { + obj := &SchedulingEventType{} + var fernTestValueKind SchedulingEventTypeKind + obj.SetKind(fernTestValueKind) + assert.Equal(t, fernTestValueKind, obj.Kind) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetStatus", func(t *testing.T) { + obj := &SchedulingEventType{} + var fernTestValueStatus SchedulingEventTypeStatus + obj.SetStatus(fernTestValueStatus) + assert.Equal(t, fernTestValueStatus, obj.Status) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetDurationMinutes", func(t *testing.T) { + obj := &SchedulingEventType{} + var fernTestValueDurationMinutes float64 + obj.SetDurationMinutes(fernTestValueDurationMinutes) + assert.Equal(t, fernTestValueDurationMinutes, obj.DurationMinutes) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetDurationOptions", func(t *testing.T) { + obj := &SchedulingEventType{} + var fernTestValueDurationOptions []float64 + obj.SetDurationOptions(fernTestValueDurationOptions) + assert.Equal(t, fernTestValueDurationOptions, obj.DurationOptions) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetStepMinutes", func(t *testing.T) { + obj := &SchedulingEventType{} + var fernTestValueStepMinutes float64 + obj.SetStepMinutes(fernTestValueStepMinutes) + assert.Equal(t, fernTestValueStepMinutes, obj.StepMinutes) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetGridTimeZone", func(t *testing.T) { + obj := &SchedulingEventType{} + var fernTestValueGridTimeZone *string + obj.SetGridTimeZone(fernTestValueGridTimeZone) + assert.Equal(t, fernTestValueGridTimeZone, obj.GridTimeZone) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetBufferBeforeMinutes", func(t *testing.T) { + obj := &SchedulingEventType{} + var fernTestValueBufferBeforeMinutes float64 + obj.SetBufferBeforeMinutes(fernTestValueBufferBeforeMinutes) + assert.Equal(t, fernTestValueBufferBeforeMinutes, obj.BufferBeforeMinutes) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetBufferAfterMinutes", func(t *testing.T) { + obj := &SchedulingEventType{} + var fernTestValueBufferAfterMinutes float64 + obj.SetBufferAfterMinutes(fernTestValueBufferAfterMinutes) + assert.Equal(t, fernTestValueBufferAfterMinutes, obj.BufferAfterMinutes) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetMinNoticeMinutes", func(t *testing.T) { + obj := &SchedulingEventType{} + var fernTestValueMinNoticeMinutes float64 + obj.SetMinNoticeMinutes(fernTestValueMinNoticeMinutes) + assert.Equal(t, fernTestValueMinNoticeMinutes, obj.MinNoticeMinutes) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetBookingWindow", func(t *testing.T) { + obj := &SchedulingEventType{} + var fernTestValueBookingWindow *SchedulingBookingWindow + obj.SetBookingWindow(fernTestValueBookingWindow) + assert.Equal(t, fernTestValueBookingWindow, obj.BookingWindow) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetLimits", func(t *testing.T) { + obj := &SchedulingEventType{} + var fernTestValueLimits []*SchedulingLimit + obj.SetLimits(fernTestValueLimits) + assert.Equal(t, fernTestValueLimits, obj.Limits) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetCapacity", func(t *testing.T) { + obj := &SchedulingEventType{} + var fernTestValueCapacity *float64 + obj.SetCapacity(fernTestValueCapacity) + assert.Equal(t, fernTestValueCapacity, obj.Capacity) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetRequiresApproval", func(t *testing.T) { + obj := &SchedulingEventType{} + var fernTestValueRequiresApproval bool + obj.SetRequiresApproval(fernTestValueRequiresApproval) + assert.Equal(t, fernTestValueRequiresApproval, obj.RequiresApproval) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetReassignmentEnabled", func(t *testing.T) { + obj := &SchedulingEventType{} + var fernTestValueReassignmentEnabled bool + obj.SetReassignmentEnabled(fernTestValueReassignmentEnabled) + assert.Equal(t, fernTestValueReassignmentEnabled, obj.ReassignmentEnabled) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetApprovalTTLMinutes", func(t *testing.T) { + obj := &SchedulingEventType{} + var fernTestValueApprovalTTLMinutes float64 + obj.SetApprovalTTLMinutes(fernTestValueApprovalTTLMinutes) + assert.Equal(t, fernTestValueApprovalTTLMinutes, obj.ApprovalTTLMinutes) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetHoldTTLSeconds", func(t *testing.T) { + obj := &SchedulingEventType{} + var fernTestValueHoldTTLSeconds float64 + obj.SetHoldTTLSeconds(fernTestValueHoldTTLSeconds) + assert.Equal(t, fernTestValueHoldTTLSeconds, obj.HoldTTLSeconds) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetCancelNoticeMinutes", func(t *testing.T) { + obj := &SchedulingEventType{} + var fernTestValueCancelNoticeMinutes float64 + obj.SetCancelNoticeMinutes(fernTestValueCancelNoticeMinutes) + assert.Equal(t, fernTestValueCancelNoticeMinutes, obj.CancelNoticeMinutes) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetRescheduleNoticeMinutes", func(t *testing.T) { + obj := &SchedulingEventType{} + var fernTestValueRescheduleNoticeMinutes float64 + obj.SetRescheduleNoticeMinutes(fernTestValueRescheduleNoticeMinutes) + assert.Equal(t, fernTestValueRescheduleNoticeMinutes, obj.RescheduleNoticeMinutes) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetMaxGuests", func(t *testing.T) { + obj := &SchedulingEventType{} + var fernTestValueMaxGuests float64 + obj.SetMaxGuests(fernTestValueMaxGuests) + assert.Equal(t, fernTestValueMaxGuests, obj.MaxGuests) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetMaxActiveBookingsPerAttendee", func(t *testing.T) { + obj := &SchedulingEventType{} + var fernTestValueMaxActiveBookingsPerAttendee *float64 + obj.SetMaxActiveBookingsPerAttendee(fernTestValueMaxActiveBookingsPerAttendee) + assert.Equal(t, fernTestValueMaxActiveBookingsPerAttendee, obj.MaxActiveBookingsPerAttendee) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetHostCalendarDetails", func(t *testing.T) { + obj := &SchedulingEventType{} + var fernTestValueHostCalendarDetails SchedulingEventTypeHostCalendarDetails + obj.SetHostCalendarDetails(fernTestValueHostCalendarDetails) + assert.Equal(t, fernTestValueHostCalendarDetails, obj.HostCalendarDetails) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetQuestions", func(t *testing.T) { + obj := &SchedulingEventType{} + var fernTestValueQuestions []*SchedulingQuestion + obj.SetQuestions(fernTestValueQuestions) + assert.Equal(t, fernTestValueQuestions, obj.Questions) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetLocations", func(t *testing.T) { + obj := &SchedulingEventType{} + var fernTestValueLocations []*SchedulingLocation + obj.SetLocations(fernTestValueLocations) + assert.Equal(t, fernTestValueLocations, obj.Locations) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetHostFilter", func(t *testing.T) { + obj := &SchedulingEventType{} + var fernTestValueHostFilter map[string]*SchedulingEventTypeHostFilterValue + obj.SetHostFilter(fernTestValueHostFilter) + assert.Equal(t, fernTestValueHostFilter, obj.HostFilter) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetNotifications", func(t *testing.T) { + obj := &SchedulingEventType{} + var fernTestValueNotifications map[string]*SchedulingEventTypeNotificationsValue + obj.SetNotifications(fernTestValueNotifications) + assert.Equal(t, fernTestValueNotifications, obj.Notifications) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetReminders", func(t *testing.T) { + obj := &SchedulingEventType{} + var fernTestValueReminders []*SchedulingReminder + obj.SetReminders(fernTestValueReminders) + assert.Equal(t, fernTestValueReminders, obj.Reminders) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetHosts", func(t *testing.T) { + obj := &SchedulingEventType{} + var fernTestValueHosts []*SchedulingEventTypeHostsItem + obj.SetHosts(fernTestValueHosts) + assert.Equal(t, fernTestValueHosts, obj.Hosts) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetMetadata", func(t *testing.T) { + obj := &SchedulingEventType{} + var fernTestValueMetadata map[string]string + obj.SetMetadata(fernTestValueMetadata) + assert.Equal(t, fernTestValueMetadata, obj.Metadata) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetCreatedAt", func(t *testing.T) { + obj := &SchedulingEventType{} + var fernTestValueCreatedAt string + obj.SetCreatedAt(fernTestValueCreatedAt) + assert.Equal(t, fernTestValueCreatedAt, obj.CreatedAt) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetUpdatedAt", func(t *testing.T) { + obj := &SchedulingEventType{} + var fernTestValueUpdatedAt string + obj.SetUpdatedAt(fernTestValueUpdatedAt) + assert.Equal(t, fernTestValueUpdatedAt, obj.UpdatedAt) + assert.NotNil(t, obj.explicitFields) + }) + +} + +func TestGettersSchedulingEventType(t *testing.T) { + t.Run("GetObject", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskSettingsReasonWeights{} - var fernTestValueHistoryFraudSubnet *float64 + obj := &SchedulingEventType{} + var expected SchedulingEventTypeObject + obj.Object = expected - // Act - obj.SetHistoryFraudSubnet(fernTestValueHistoryFraudSubnet) + // Act & Assert + assert.Equal(t, expected, obj.GetObject(), "getter should return the property value") + }) - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") + t.Run("GetObject_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingEventType + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetObject() // Should return zero value + }) - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } + t.Run("GetID", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingEventType{} + var expected string + obj.ID = expected - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip + // Act & Assert + assert.Equal(t, expected, obj.GetID(), "getter should return the property value") }) - t.Run("SetHistoryFraudCard_MarksExplicit", func(t *testing.T) { + t.Run("GetID_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingEventType + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetID() // Should return zero value + }) + + t.Run("GetUID", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskSettingsReasonWeights{} - var fernTestValueHistoryFraudCard *float64 + obj := &SchedulingEventType{} + var expected *string + obj.UID = expected - // Act - obj.SetHistoryFraudCard(fernTestValueHistoryFraudCard) + // Act & Assert + assert.Equal(t, expected, obj.GetUID(), "getter should return the property value") + }) - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") + t.Run("GetUID_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingEventType{} + obj.UID = nil - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } + // Act & Assert + assert.Nil(t, obj.GetUID(), "getter should return nil when property is nil") + }) - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip + t.Run("GetUID_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingEventType + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetUID() // Should return zero value }) - t.Run("SetHistoryFraudDevice_MarksExplicit", func(t *testing.T) { + t.Run("GetDescription", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskSettingsReasonWeights{} - var fernTestValueHistoryFraudDevice *float64 + obj := &SchedulingEventType{} + var expected *string + obj.Description = expected - // Act - obj.SetHistoryFraudDevice(fernTestValueHistoryFraudDevice) + // Act & Assert + assert.Equal(t, expected, obj.GetDescription(), "getter should return the property value") + }) - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") + t.Run("GetDescription_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingEventType{} + obj.Description = nil - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } + // Act & Assert + assert.Nil(t, obj.GetDescription(), "getter should return nil when property is nil") + }) - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip + t.Run("GetDescription_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingEventType + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetDescription() // Should return zero value }) - t.Run("SetCheckoutCardCountryMismatch_MarksExplicit", func(t *testing.T) { + t.Run("GetTitle", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskSettingsReasonWeights{} - var fernTestValueCheckoutCardCountryMismatch *float64 + obj := &SchedulingEventType{} + var expected string + obj.Title = expected - // Act - obj.SetCheckoutCardCountryMismatch(fernTestValueCheckoutCardCountryMismatch) + // Act & Assert + assert.Equal(t, expected, obj.GetTitle(), "getter should return the property value") + }) - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") + t.Run("GetTitle_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingEventType + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetTitle() // Should return zero value + }) - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } + t.Run("GetKind", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingEventType{} + var expected SchedulingEventTypeKind + obj.Kind = expected - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip + // Act & Assert + assert.Equal(t, expected, obj.GetKind(), "getter should return the property value") }) - t.Run("SetCheckoutBillingCountryMismatch_MarksExplicit", func(t *testing.T) { + t.Run("GetKind_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingEventType + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetKind() // Should return zero value + }) + + t.Run("GetStatus", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskSettingsReasonWeights{} - var fernTestValueCheckoutBillingCountryMismatch *float64 + obj := &SchedulingEventType{} + var expected SchedulingEventTypeStatus + obj.Status = expected - // Act - obj.SetCheckoutBillingCountryMismatch(fernTestValueCheckoutBillingCountryMismatch) + // Act & Assert + assert.Equal(t, expected, obj.GetStatus(), "getter should return the property value") + }) - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") + t.Run("GetStatus_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingEventType + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetStatus() // Should return zero value + }) - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } + t.Run("GetDurationMinutes", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingEventType{} + var expected float64 + obj.DurationMinutes = expected - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip + // Act & Assert + assert.Equal(t, expected, obj.GetDurationMinutes(), "getter should return the property value") + }) + + t.Run("GetDurationMinutes_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingEventType + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetDurationMinutes() // Should return zero value + }) + + t.Run("GetDurationOptions", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingEventType{} + var expected []float64 + obj.DurationOptions = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetDurationOptions(), "getter should return the property value") + }) + + t.Run("GetDurationOptions_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingEventType{} + obj.DurationOptions = nil + + // Act & Assert + assert.Nil(t, obj.GetDurationOptions(), "getter should return nil when property is nil") + }) + + t.Run("GetDurationOptions_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingEventType + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetDurationOptions() // Should return zero value + }) + + t.Run("GetStepMinutes", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingEventType{} + var expected float64 + obj.StepMinutes = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetStepMinutes(), "getter should return the property value") + }) + + t.Run("GetStepMinutes_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingEventType + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetStepMinutes() // Should return zero value + }) + + t.Run("GetGridTimeZone", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingEventType{} + var expected *string + obj.GridTimeZone = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetGridTimeZone(), "getter should return the property value") + }) + + t.Run("GetGridTimeZone_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingEventType{} + obj.GridTimeZone = nil + + // Act & Assert + assert.Nil(t, obj.GetGridTimeZone(), "getter should return nil when property is nil") + }) + + t.Run("GetGridTimeZone_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingEventType + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetGridTimeZone() // Should return zero value + }) + + t.Run("GetBufferBeforeMinutes", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingEventType{} + var expected float64 + obj.BufferBeforeMinutes = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetBufferBeforeMinutes(), "getter should return the property value") + }) + + t.Run("GetBufferBeforeMinutes_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingEventType + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetBufferBeforeMinutes() // Should return zero value + }) + + t.Run("GetBufferAfterMinutes", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingEventType{} + var expected float64 + obj.BufferAfterMinutes = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetBufferAfterMinutes(), "getter should return the property value") + }) + + t.Run("GetBufferAfterMinutes_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingEventType + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetBufferAfterMinutes() // Should return zero value + }) + + t.Run("GetMinNoticeMinutes", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingEventType{} + var expected float64 + obj.MinNoticeMinutes = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetMinNoticeMinutes(), "getter should return the property value") + }) + + t.Run("GetMinNoticeMinutes_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingEventType + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetMinNoticeMinutes() // Should return zero value + }) + + t.Run("GetBookingWindow", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingEventType{} + var expected *SchedulingBookingWindow + obj.BookingWindow = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetBookingWindow(), "getter should return the property value") + }) + + t.Run("GetBookingWindow_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingEventType{} + obj.BookingWindow = nil + + // Act & Assert + assert.Nil(t, obj.GetBookingWindow(), "getter should return nil when property is nil") + }) + + t.Run("GetBookingWindow_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingEventType + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetBookingWindow() // Should return zero value + }) + + t.Run("GetLimits", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingEventType{} + var expected []*SchedulingLimit + obj.Limits = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetLimits(), "getter should return the property value") + }) + + t.Run("GetLimits_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingEventType{} + obj.Limits = nil + + // Act & Assert + assert.Nil(t, obj.GetLimits(), "getter should return nil when property is nil") + }) + + t.Run("GetLimits_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingEventType + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetLimits() // Should return zero value + }) + + t.Run("GetCapacity", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingEventType{} + var expected *float64 + obj.Capacity = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetCapacity(), "getter should return the property value") + }) + + t.Run("GetCapacity_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingEventType{} + obj.Capacity = nil + + // Act & Assert + assert.Nil(t, obj.GetCapacity(), "getter should return nil when property is nil") + }) + + t.Run("GetCapacity_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingEventType + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetCapacity() // Should return zero value + }) + + t.Run("GetRequiresApproval", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingEventType{} + var expected bool + obj.RequiresApproval = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetRequiresApproval(), "getter should return the property value") + }) + + t.Run("GetRequiresApproval_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingEventType + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetRequiresApproval() // Should return zero value }) - t.Run("SetCheckoutPrepaidCard_MarksExplicit", func(t *testing.T) { + t.Run("GetReassignmentEnabled", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskSettingsReasonWeights{} - var fernTestValueCheckoutPrepaidCard *float64 - - // Act - obj.SetCheckoutPrepaidCard(fernTestValueCheckoutPrepaidCard) - - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") + obj := &SchedulingEventType{} + var expected bool + obj.ReassignmentEnabled = expected - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } + // Act & Assert + assert.Equal(t, expected, obj.GetReassignmentEnabled(), "getter should return the property value") + }) - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip + t.Run("GetReassignmentEnabled_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingEventType + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetReassignmentEnabled() // Should return zero value }) - t.Run("SetDeviceAutomation_MarksExplicit", func(t *testing.T) { + t.Run("GetApprovalTTLMinutes", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskSettingsReasonWeights{} - var fernTestValueDeviceAutomation *float64 - - // Act - obj.SetDeviceAutomation(fernTestValueDeviceAutomation) - - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") + obj := &SchedulingEventType{} + var expected float64 + obj.ApprovalTTLMinutes = expected - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } + // Act & Assert + assert.Equal(t, expected, obj.GetApprovalTTLMinutes(), "getter should return the property value") + }) - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip + t.Run("GetApprovalTTLMinutes_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingEventType + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetApprovalTTLMinutes() // Should return zero value }) - t.Run("SetDeviceInvalid_MarksExplicit", func(t *testing.T) { + t.Run("GetHoldTTLSeconds", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskSettingsReasonWeights{} - var fernTestValueDeviceInvalid *float64 + obj := &SchedulingEventType{} + var expected float64 + obj.HoldTTLSeconds = expected - // Act - obj.SetDeviceInvalid(fernTestValueDeviceInvalid) + // Act & Assert + assert.Equal(t, expected, obj.GetHoldTTLSeconds(), "getter should return the property value") + }) - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") + t.Run("GetHoldTTLSeconds_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingEventType + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetHoldTTLSeconds() // Should return zero value + }) - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } + t.Run("GetCancelNoticeMinutes", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingEventType{} + var expected float64 + obj.CancelNoticeMinutes = expected - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip + // Act & Assert + assert.Equal(t, expected, obj.GetCancelNoticeMinutes(), "getter should return the property value") }) - t.Run("SetLoginNewCountry_MarksExplicit", func(t *testing.T) { + t.Run("GetCancelNoticeMinutes_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingEventType + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetCancelNoticeMinutes() // Should return zero value + }) + + t.Run("GetRescheduleNoticeMinutes", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskSettingsReasonWeights{} - var fernTestValueLoginNewCountry *float64 + obj := &SchedulingEventType{} + var expected float64 + obj.RescheduleNoticeMinutes = expected - // Act - obj.SetLoginNewCountry(fernTestValueLoginNewCountry) + // Act & Assert + assert.Equal(t, expected, obj.GetRescheduleNoticeMinutes(), "getter should return the property value") + }) - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") + t.Run("GetRescheduleNoticeMinutes_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingEventType + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetRescheduleNoticeMinutes() // Should return zero value + }) - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } + t.Run("GetMaxGuests", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingEventType{} + var expected float64 + obj.MaxGuests = expected - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip + // Act & Assert + assert.Equal(t, expected, obj.GetMaxGuests(), "getter should return the property value") }) - t.Run("SetLoginNewNetwork_MarksExplicit", func(t *testing.T) { + t.Run("GetMaxGuests_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingEventType + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetMaxGuests() // Should return zero value + }) + + t.Run("GetMaxActiveBookingsPerAttendee", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskSettingsReasonWeights{} - var fernTestValueLoginNewNetwork *float64 + obj := &SchedulingEventType{} + var expected *float64 + obj.MaxActiveBookingsPerAttendee = expected - // Act - obj.SetLoginNewNetwork(fernTestValueLoginNewNetwork) + // Act & Assert + assert.Equal(t, expected, obj.GetMaxActiveBookingsPerAttendee(), "getter should return the property value") + }) - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") + t.Run("GetMaxActiveBookingsPerAttendee_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingEventType{} + obj.MaxActiveBookingsPerAttendee = nil - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } + // Act & Assert + assert.Nil(t, obj.GetMaxActiveBookingsPerAttendee(), "getter should return nil when property is nil") + }) - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip + t.Run("GetMaxActiveBookingsPerAttendee_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingEventType + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetMaxActiveBookingsPerAttendee() // Should return zero value }) - t.Run("SetCaptchaFailed_MarksExplicit", func(t *testing.T) { + t.Run("GetHostCalendarDetails", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskSettingsReasonWeights{} - var fernTestValueCaptchaFailed *float64 + obj := &SchedulingEventType{} + var expected SchedulingEventTypeHostCalendarDetails + obj.HostCalendarDetails = expected - // Act - obj.SetCaptchaFailed(fernTestValueCaptchaFailed) + // Act & Assert + assert.Equal(t, expected, obj.GetHostCalendarDetails(), "getter should return the property value") + }) - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") + t.Run("GetHostCalendarDetails_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingEventType + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetHostCalendarDetails() // Should return zero value + }) - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } + t.Run("GetQuestions", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingEventType{} + var expected []*SchedulingQuestion + obj.Questions = expected - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip + // Act & Assert + assert.Equal(t, expected, obj.GetQuestions(), "getter should return the property value") }) - t.Run("SetCaptchaMissing_MarksExplicit", func(t *testing.T) { + t.Run("GetQuestions_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskSettingsReasonWeights{} - var fernTestValueCaptchaMissing *float64 + obj := &SchedulingEventType{} + obj.Questions = nil - // Act - obj.SetCaptchaMissing(fernTestValueCaptchaMissing) + // Act & Assert + assert.Nil(t, obj.GetQuestions(), "getter should return nil when property is nil") + }) - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") + t.Run("GetQuestions_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingEventType + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetQuestions() // Should return zero value + }) - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } + t.Run("GetLocations", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingEventType{} + var expected []*SchedulingLocation + obj.Locations = expected - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip + // Act & Assert + assert.Equal(t, expected, obj.GetLocations(), "getter should return the property value") }) - t.Run("SetContentSpam_MarksExplicit", func(t *testing.T) { + t.Run("GetLocations_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskSettingsReasonWeights{} - var fernTestValueContentSpam *float64 + obj := &SchedulingEventType{} + obj.Locations = nil - // Act - obj.SetContentSpam(fernTestValueContentSpam) + // Act & Assert + assert.Nil(t, obj.GetLocations(), "getter should return nil when property is nil") + }) - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") + t.Run("GetLocations_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingEventType + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetLocations() // Should return zero value + }) - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } + t.Run("GetHostFilter", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingEventType{} + var expected map[string]*SchedulingEventTypeHostFilterValue + obj.HostFilter = expected - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip + // Act & Assert + assert.Equal(t, expected, obj.GetHostFilter(), "getter should return the property value") }) - t.Run("SetContentPhishing_MarksExplicit", func(t *testing.T) { + t.Run("GetHostFilter_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskSettingsReasonWeights{} - var fernTestValueContentPhishing *float64 + obj := &SchedulingEventType{} + obj.HostFilter = nil - // Act - obj.SetContentPhishing(fernTestValueContentPhishing) + // Act & Assert + assert.Nil(t, obj.GetHostFilter(), "getter should return nil when property is nil") + }) - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") + t.Run("GetHostFilter_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingEventType + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetHostFilter() // Should return zero value + }) - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } + t.Run("GetNotifications", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingEventType{} + var expected map[string]*SchedulingEventTypeNotificationsValue + obj.Notifications = expected - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip + // Act & Assert + assert.Equal(t, expected, obj.GetNotifications(), "getter should return the property value") }) - t.Run("SetContentMalware_MarksExplicit", func(t *testing.T) { + t.Run("GetNotifications_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskSettingsReasonWeights{} - var fernTestValueContentMalware *float64 + obj := &SchedulingEventType{} + obj.Notifications = nil - // Act - obj.SetContentMalware(fernTestValueContentMalware) + // Act & Assert + assert.Nil(t, obj.GetNotifications(), "getter should return nil when property is nil") + }) - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") + t.Run("GetNotifications_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingEventType + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetNotifications() // Should return zero value + }) - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } + t.Run("GetReminders", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingEventType{} + var expected []*SchedulingReminder + obj.Reminders = expected - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip + // Act & Assert + assert.Equal(t, expected, obj.GetReminders(), "getter should return the property value") }) - t.Run("SetContentFraud_MarksExplicit", func(t *testing.T) { + t.Run("GetReminders_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &RiskSettingsReasonWeights{} - var fernTestValueContentFraud *float64 + obj := &SchedulingEventType{} + obj.Reminders = nil - // Act - obj.SetContentFraud(fernTestValueContentFraud) + // Act & Assert + assert.Nil(t, obj.GetReminders(), "getter should return nil when property is nil") + }) - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") + t.Run("GetReminders_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingEventType + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetReminders() // Should return zero value + }) - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } + t.Run("GetHosts", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingEventType{} + var expected []*SchedulingEventTypeHostsItem + obj.Hosts = expected - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip + // Act & Assert + assert.Equal(t, expected, obj.GetHosts(), "getter should return the property value") }) -} + t.Run("GetHosts_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingEventType{} + obj.Hosts = nil -func TestSettersSchedulingAttendeeErasure(t *testing.T) { - t.Run("SetObject", func(t *testing.T) { - obj := &SchedulingAttendeeErasure{} - var fernTestValueObject SchedulingAttendeeErasureObject - obj.SetObject(fernTestValueObject) - assert.Equal(t, fernTestValueObject, obj.Object) - assert.NotNil(t, obj.explicitFields) + // Act & Assert + assert.Nil(t, obj.GetHosts(), "getter should return nil when property is nil") }) - t.Run("SetUID", func(t *testing.T) { - obj := &SchedulingAttendeeErasure{} - var fernTestValueUID string - obj.SetUID(fernTestValueUID) - assert.Equal(t, fernTestValueUID, obj.UID) - assert.NotNil(t, obj.explicitFields) + t.Run("GetHosts_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingEventType + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetHosts() // Should return zero value }) - t.Run("SetErased", func(t *testing.T) { - obj := &SchedulingAttendeeErasure{} - var fernTestValueErased float64 - obj.SetErased(fernTestValueErased) - assert.Equal(t, fernTestValueErased, obj.Erased) - assert.NotNil(t, obj.explicitFields) - }) + t.Run("GetMetadata", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingEventType{} + var expected map[string]string + obj.Metadata = expected -} + // Act & Assert + assert.Equal(t, expected, obj.GetMetadata(), "getter should return the property value") + }) -func TestGettersSchedulingAttendeeErasure(t *testing.T) { - t.Run("GetObject", func(t *testing.T) { + t.Run("GetMetadata_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingAttendeeErasure{} - var expected SchedulingAttendeeErasureObject - obj.Object = expected + obj := &SchedulingEventType{} + obj.Metadata = nil // Act & Assert - assert.Equal(t, expected, obj.GetObject(), "getter should return the property value") + assert.Nil(t, obj.GetMetadata(), "getter should return nil when property is nil") }) - t.Run("GetObject_NilReceiver", func(t *testing.T) { + t.Run("GetMetadata_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *SchedulingAttendeeErasure + var obj *SchedulingEventType // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetObject() // Should return zero value + _ = obj.GetMetadata() // Should return zero value }) - t.Run("GetUID", func(t *testing.T) { + t.Run("GetCreatedAt", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingAttendeeErasure{} + obj := &SchedulingEventType{} var expected string - obj.UID = expected + obj.CreatedAt = expected // Act & Assert - assert.Equal(t, expected, obj.GetUID(), "getter should return the property value") + assert.Equal(t, expected, obj.GetCreatedAt(), "getter should return the property value") }) - t.Run("GetUID_NilReceiver", func(t *testing.T) { + t.Run("GetCreatedAt_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *SchedulingAttendeeErasure + var obj *SchedulingEventType // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetUID() // Should return zero value + _ = obj.GetCreatedAt() // Should return zero value }) - t.Run("GetErased", func(t *testing.T) { + t.Run("GetUpdatedAt", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingAttendeeErasure{} - var expected float64 - obj.Erased = expected + obj := &SchedulingEventType{} + var expected string + obj.UpdatedAt = expected // Act & Assert - assert.Equal(t, expected, obj.GetErased(), "getter should return the property value") + assert.Equal(t, expected, obj.GetUpdatedAt(), "getter should return the property value") }) - t.Run("GetErased_NilReceiver", func(t *testing.T) { + t.Run("GetUpdatedAt_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *SchedulingAttendeeErasure + var obj *SchedulingEventType // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetErased() // Should return zero value + _ = obj.GetUpdatedAt() // Should return zero value }) } -func TestSettersMarkExplicitSchedulingAttendeeErasure(t *testing.T) { +func TestSettersMarkExplicitSchedulingEventType(t *testing.T) { t.Run("SetObject_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingAttendeeErasure{} - var fernTestValueObject SchedulingAttendeeErasureObject + obj := &SchedulingEventType{} + var fernTestValueObject SchedulingEventTypeObject // Act obj.SetObject(fernTestValueObject) @@ -81014,14 +92704,14 @@ func TestSettersMarkExplicitSchedulingAttendeeErasure(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetUID_MarksExplicit", func(t *testing.T) { + t.Run("SetID_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingAttendeeErasure{} - var fernTestValueUID string + obj := &SchedulingEventType{} + var fernTestValueID string // Act - obj.SetUID(fernTestValueUID) + obj.SetID(fernTestValueID) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -81045,14 +92735,14 @@ func TestSettersMarkExplicitSchedulingAttendeeErasure(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetErased_MarksExplicit", func(t *testing.T) { + t.Run("SetUID_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingAttendeeErasure{} - var fernTestValueErased float64 + obj := &SchedulingEventType{} + var fernTestValueUID *string // Act - obj.SetErased(fernTestValueErased) + obj.SetUID(fernTestValueUID) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -81076,85 +92766,14 @@ func TestSettersMarkExplicitSchedulingAttendeeErasure(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) -} - -func TestSettersSchedulingAttendeeErasureByEmail(t *testing.T) { - t.Run("SetObject", func(t *testing.T) { - obj := &SchedulingAttendeeErasureByEmail{} - var fernTestValueObject SchedulingAttendeeErasureByEmailObject - obj.SetObject(fernTestValueObject) - assert.Equal(t, fernTestValueObject, obj.Object) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetErased", func(t *testing.T) { - obj := &SchedulingAttendeeErasureByEmail{} - var fernTestValueErased float64 - obj.SetErased(fernTestValueErased) - assert.Equal(t, fernTestValueErased, obj.Erased) - assert.NotNil(t, obj.explicitFields) - }) - -} - -func TestGettersSchedulingAttendeeErasureByEmail(t *testing.T) { - t.Run("GetObject", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &SchedulingAttendeeErasureByEmail{} - var expected SchedulingAttendeeErasureByEmailObject - obj.Object = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetObject(), "getter should return the property value") - }) - - t.Run("GetObject_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *SchedulingAttendeeErasureByEmail - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetObject() // Should return zero value - }) - - t.Run("GetErased", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &SchedulingAttendeeErasureByEmail{} - var expected float64 - obj.Erased = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetErased(), "getter should return the property value") - }) - - t.Run("GetErased_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *SchedulingAttendeeErasureByEmail - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetErased() // Should return zero value - }) - -} - -func TestSettersMarkExplicitSchedulingAttendeeErasureByEmail(t *testing.T) { - t.Run("SetObject_MarksExplicit", func(t *testing.T) { + t.Run("SetDescription_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingAttendeeErasureByEmail{} - var fernTestValueObject SchedulingAttendeeErasureByEmailObject + obj := &SchedulingEventType{} + var fernTestValueDescription *string // Act - obj.SetObject(fernTestValueObject) + obj.SetDescription(fernTestValueDescription) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -81178,14 +92797,14 @@ func TestSettersMarkExplicitSchedulingAttendeeErasureByEmail(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetErased_MarksExplicit", func(t *testing.T) { + t.Run("SetTitle_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingAttendeeErasureByEmail{} - var fernTestValueErased float64 + obj := &SchedulingEventType{} + var fernTestValueTitle string // Act - obj.SetErased(fernTestValueErased) + obj.SetTitle(fernTestValueTitle) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -81209,259 +92828,76 @@ func TestSettersMarkExplicitSchedulingAttendeeErasureByEmail(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) -} - -func TestSettersSchedulingAttendeeInput(t *testing.T) { - t.Run("SetUID", func(t *testing.T) { - obj := &SchedulingAttendeeInput{} - var fernTestValueUID *string - obj.SetUID(fernTestValueUID) - assert.Equal(t, fernTestValueUID, obj.UID) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetName", func(t *testing.T) { - obj := &SchedulingAttendeeInput{} - var fernTestValueName *string - obj.SetName(fernTestValueName) - assert.Equal(t, fernTestValueName, obj.Name) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetEmail", func(t *testing.T) { - obj := &SchedulingAttendeeInput{} - var fernTestValueEmail *string - obj.SetEmail(fernTestValueEmail) - assert.Equal(t, fernTestValueEmail, obj.Email) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetPhone", func(t *testing.T) { - obj := &SchedulingAttendeeInput{} - var fernTestValuePhone *string - obj.SetPhone(fernTestValuePhone) - assert.Equal(t, fernTestValuePhone, obj.Phone) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetTimeZone", func(t *testing.T) { - obj := &SchedulingAttendeeInput{} - var fernTestValueTimeZone string - obj.SetTimeZone(fernTestValueTimeZone) - assert.Equal(t, fernTestValueTimeZone, obj.TimeZone) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetLocale", func(t *testing.T) { - obj := &SchedulingAttendeeInput{} - var fernTestValueLocale *string - obj.SetLocale(fernTestValueLocale) - assert.Equal(t, fernTestValueLocale, obj.Locale) - assert.NotNil(t, obj.explicitFields) - }) - -} - -func TestGettersSchedulingAttendeeInput(t *testing.T) { - t.Run("GetUID", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &SchedulingAttendeeInput{} - var expected *string - obj.UID = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetUID(), "getter should return the property value") - }) - - t.Run("GetUID_NilValue", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &SchedulingAttendeeInput{} - obj.UID = nil - - // Act & Assert - assert.Nil(t, obj.GetUID(), "getter should return nil when property is nil") - }) - - t.Run("GetUID_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *SchedulingAttendeeInput - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetUID() // Should return zero value - }) - - t.Run("GetName", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &SchedulingAttendeeInput{} - var expected *string - obj.Name = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetName(), "getter should return the property value") - }) - - t.Run("GetName_NilValue", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &SchedulingAttendeeInput{} - obj.Name = nil - - // Act & Assert - assert.Nil(t, obj.GetName(), "getter should return nil when property is nil") - }) - - t.Run("GetName_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *SchedulingAttendeeInput - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetName() // Should return zero value - }) - - t.Run("GetEmail", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &SchedulingAttendeeInput{} - var expected *string - obj.Email = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetEmail(), "getter should return the property value") - }) - - t.Run("GetEmail_NilValue", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &SchedulingAttendeeInput{} - obj.Email = nil - - // Act & Assert - assert.Nil(t, obj.GetEmail(), "getter should return nil when property is nil") - }) - - t.Run("GetEmail_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *SchedulingAttendeeInput - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetEmail() // Should return zero value - }) - - t.Run("GetPhone", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &SchedulingAttendeeInput{} - var expected *string - obj.Phone = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetPhone(), "getter should return the property value") - }) - - t.Run("GetPhone_NilValue", func(t *testing.T) { + t.Run("SetKind_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingAttendeeInput{} - obj.Phone = nil - - // Act & Assert - assert.Nil(t, obj.GetPhone(), "getter should return nil when property is nil") - }) + obj := &SchedulingEventType{} + var fernTestValueKind SchedulingEventTypeKind - t.Run("GetPhone_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *SchedulingAttendeeInput - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetPhone() // Should return zero value - }) + // Act + obj.SetKind(fernTestValueKind) - t.Run("GetTimeZone", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &SchedulingAttendeeInput{} - var expected string - obj.TimeZone = expected + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") - // Act & Assert - assert.Equal(t, expected, obj.GetTimeZone(), "getter should return the property value") - }) + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } - t.Run("GetTimeZone_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *SchedulingAttendeeInput - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetTimeZone() // Should return zero value + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("GetLocale", func(t *testing.T) { + t.Run("SetStatus_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingAttendeeInput{} - var expected *string - obj.Locale = expected + obj := &SchedulingEventType{} + var fernTestValueStatus SchedulingEventTypeStatus - // Act & Assert - assert.Equal(t, expected, obj.GetLocale(), "getter should return the property value") - }) + // Act + obj.SetStatus(fernTestValueStatus) - t.Run("GetLocale_NilValue", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &SchedulingAttendeeInput{} - obj.Locale = nil + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") - // Act & Assert - assert.Nil(t, obj.GetLocale(), "getter should return nil when property is nil") - }) + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } - t.Run("GetLocale_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *SchedulingAttendeeInput - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetLocale() // Should return zero value + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip }) - -} - -func TestSettersMarkExplicitSchedulingAttendeeInput(t *testing.T) { - t.Run("SetUID_MarksExplicit", func(t *testing.T) { + + t.Run("SetDurationMinutes_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingAttendeeInput{} - var fernTestValueUID *string + obj := &SchedulingEventType{} + var fernTestValueDurationMinutes float64 // Act - obj.SetUID(fernTestValueUID) + obj.SetDurationMinutes(fernTestValueDurationMinutes) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -81485,14 +92921,14 @@ func TestSettersMarkExplicitSchedulingAttendeeInput(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetName_MarksExplicit", func(t *testing.T) { + t.Run("SetDurationOptions_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingAttendeeInput{} - var fernTestValueName *string + obj := &SchedulingEventType{} + var fernTestValueDurationOptions []float64 // Act - obj.SetName(fernTestValueName) + obj.SetDurationOptions(fernTestValueDurationOptions) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -81516,14 +92952,14 @@ func TestSettersMarkExplicitSchedulingAttendeeInput(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetEmail_MarksExplicit", func(t *testing.T) { + t.Run("SetStepMinutes_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingAttendeeInput{} - var fernTestValueEmail *string + obj := &SchedulingEventType{} + var fernTestValueStepMinutes float64 // Act - obj.SetEmail(fernTestValueEmail) + obj.SetStepMinutes(fernTestValueStepMinutes) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -81547,14 +92983,14 @@ func TestSettersMarkExplicitSchedulingAttendeeInput(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetPhone_MarksExplicit", func(t *testing.T) { + t.Run("SetGridTimeZone_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingAttendeeInput{} - var fernTestValuePhone *string + obj := &SchedulingEventType{} + var fernTestValueGridTimeZone *string // Act - obj.SetPhone(fernTestValuePhone) + obj.SetGridTimeZone(fernTestValueGridTimeZone) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -81578,14 +93014,14 @@ func TestSettersMarkExplicitSchedulingAttendeeInput(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetTimeZone_MarksExplicit", func(t *testing.T) { + t.Run("SetBufferBeforeMinutes_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingAttendeeInput{} - var fernTestValueTimeZone string + obj := &SchedulingEventType{} + var fernTestValueBufferBeforeMinutes float64 // Act - obj.SetTimeZone(fernTestValueTimeZone) + obj.SetBufferBeforeMinutes(fernTestValueBufferBeforeMinutes) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -81609,14 +93045,14 @@ func TestSettersMarkExplicitSchedulingAttendeeInput(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetLocale_MarksExplicit", func(t *testing.T) { + t.Run("SetBufferAfterMinutes_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingAttendeeInput{} - var fernTestValueLocale *string + obj := &SchedulingEventType{} + var fernTestValueBufferAfterMinutes float64 // Act - obj.SetLocale(fernTestValueLocale) + obj.SetBufferAfterMinutes(fernTestValueBufferAfterMinutes) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -81640,126 +93076,14 @@ func TestSettersMarkExplicitSchedulingAttendeeInput(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) -} - -func TestSettersSchedulingAvailabilitySearchResult(t *testing.T) { - t.Run("SetObject", func(t *testing.T) { - obj := &SchedulingAvailabilitySearchResult{} - var fernTestValueObject SchedulingAvailabilitySearchResultObject - obj.SetObject(fernTestValueObject) - assert.Equal(t, fernTestValueObject, obj.Object) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetData", func(t *testing.T) { - obj := &SchedulingAvailabilitySearchResult{} - var fernTestValueData []*SchedulingAvailabilitySearchResultDataItem - obj.SetData(fernTestValueData) - assert.Equal(t, fernTestValueData, obj.Data) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetHasMore", func(t *testing.T) { - obj := &SchedulingAvailabilitySearchResult{} - var fernTestValueHasMore bool - obj.SetHasMore(fernTestValueHasMore) - assert.Equal(t, fernTestValueHasMore, obj.HasMore) - assert.NotNil(t, obj.explicitFields) - }) - -} - -func TestGettersSchedulingAvailabilitySearchResult(t *testing.T) { - t.Run("GetObject", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &SchedulingAvailabilitySearchResult{} - var expected SchedulingAvailabilitySearchResultObject - obj.Object = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetObject(), "getter should return the property value") - }) - - t.Run("GetObject_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *SchedulingAvailabilitySearchResult - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetObject() // Should return zero value - }) - - t.Run("GetData", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &SchedulingAvailabilitySearchResult{} - var expected []*SchedulingAvailabilitySearchResultDataItem - obj.Data = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetData(), "getter should return the property value") - }) - - t.Run("GetData_NilValue", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &SchedulingAvailabilitySearchResult{} - obj.Data = nil - - // Act & Assert - assert.Nil(t, obj.GetData(), "getter should return nil when property is nil") - }) - - t.Run("GetData_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *SchedulingAvailabilitySearchResult - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetData() // Should return zero value - }) - - t.Run("GetHasMore", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &SchedulingAvailabilitySearchResult{} - var expected bool - obj.HasMore = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetHasMore(), "getter should return the property value") - }) - - t.Run("GetHasMore_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *SchedulingAvailabilitySearchResult - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetHasMore() // Should return zero value - }) - -} - -func TestSettersMarkExplicitSchedulingAvailabilitySearchResult(t *testing.T) { - t.Run("SetObject_MarksExplicit", func(t *testing.T) { + t.Run("SetMinNoticeMinutes_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingAvailabilitySearchResult{} - var fernTestValueObject SchedulingAvailabilitySearchResultObject + obj := &SchedulingEventType{} + var fernTestValueMinNoticeMinutes float64 // Act - obj.SetObject(fernTestValueObject) + obj.SetMinNoticeMinutes(fernTestValueMinNoticeMinutes) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -81783,14 +93107,14 @@ func TestSettersMarkExplicitSchedulingAvailabilitySearchResult(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetData_MarksExplicit", func(t *testing.T) { + t.Run("SetBookingWindow_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingAvailabilitySearchResult{} - var fernTestValueData []*SchedulingAvailabilitySearchResultDataItem + obj := &SchedulingEventType{} + var fernTestValueBookingWindow *SchedulingBookingWindow // Act - obj.SetData(fernTestValueData) + obj.SetBookingWindow(fernTestValueBookingWindow) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -81814,14 +93138,14 @@ func TestSettersMarkExplicitSchedulingAvailabilitySearchResult(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetHasMore_MarksExplicit", func(t *testing.T) { + t.Run("SetLimits_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingAvailabilitySearchResult{} - var fernTestValueHasMore bool + obj := &SchedulingEventType{} + var fernTestValueLimits []*SchedulingLimit // Act - obj.SetHasMore(fernTestValueHasMore) + obj.SetLimits(fernTestValueLimits) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -81845,136 +93169,45 @@ func TestSettersMarkExplicitSchedulingAvailabilitySearchResult(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) -} - -func TestSettersSchedulingAvailabilitySearchResultDataItem(t *testing.T) { - t.Run("SetHost", func(t *testing.T) { - obj := &SchedulingAvailabilitySearchResultDataItem{} - var fernTestValueHost string - obj.SetHost(fernTestValueHost) - assert.Equal(t, fernTestValueHost, obj.Host) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetUID", func(t *testing.T) { - obj := &SchedulingAvailabilitySearchResultDataItem{} - var fernTestValueUID *string - obj.SetUID(fernTestValueUID) - assert.Equal(t, fernTestValueUID, obj.UID) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetSlots", func(t *testing.T) { - obj := &SchedulingAvailabilitySearchResultDataItem{} - var fernTestValueSlots []*SchedulingAvailabilitySearchResultDataItemSlotsItem - obj.SetSlots(fernTestValueSlots) - assert.Equal(t, fernTestValueSlots, obj.Slots) - assert.NotNil(t, obj.explicitFields) - }) - -} - -func TestGettersSchedulingAvailabilitySearchResultDataItem(t *testing.T) { - t.Run("GetHost", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &SchedulingAvailabilitySearchResultDataItem{} - var expected string - obj.Host = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetHost(), "getter should return the property value") - }) - - t.Run("GetHost_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *SchedulingAvailabilitySearchResultDataItem - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetHost() // Should return zero value - }) - - t.Run("GetUID", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &SchedulingAvailabilitySearchResultDataItem{} - var expected *string - obj.UID = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetUID(), "getter should return the property value") - }) - - t.Run("GetUID_NilValue", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &SchedulingAvailabilitySearchResultDataItem{} - obj.UID = nil - - // Act & Assert - assert.Nil(t, obj.GetUID(), "getter should return nil when property is nil") - }) - - t.Run("GetUID_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *SchedulingAvailabilitySearchResultDataItem - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetUID() // Should return zero value - }) - - t.Run("GetSlots", func(t *testing.T) { + t.Run("SetCapacity_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingAvailabilitySearchResultDataItem{} - var expected []*SchedulingAvailabilitySearchResultDataItemSlotsItem - obj.Slots = expected + obj := &SchedulingEventType{} + var fernTestValueCapacity *float64 - // Act & Assert - assert.Equal(t, expected, obj.GetSlots(), "getter should return the property value") - }) + // Act + obj.SetCapacity(fernTestValueCapacity) - t.Run("GetSlots_NilValue", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &SchedulingAvailabilitySearchResultDataItem{} - obj.Slots = nil + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") - // Act & Assert - assert.Nil(t, obj.GetSlots(), "getter should return nil when property is nil") - }) + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } - t.Run("GetSlots_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *SchedulingAvailabilitySearchResultDataItem - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetSlots() // Should return zero value + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip }) -} - -func TestSettersMarkExplicitSchedulingAvailabilitySearchResultDataItem(t *testing.T) { - t.Run("SetHost_MarksExplicit", func(t *testing.T) { + t.Run("SetRequiresApproval_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingAvailabilitySearchResultDataItem{} - var fernTestValueHost string + obj := &SchedulingEventType{} + var fernTestValueRequiresApproval bool // Act - obj.SetHost(fernTestValueHost) + obj.SetRequiresApproval(fernTestValueRequiresApproval) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -81998,14 +93231,14 @@ func TestSettersMarkExplicitSchedulingAvailabilitySearchResultDataItem(t *testin // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetUID_MarksExplicit", func(t *testing.T) { + t.Run("SetReassignmentEnabled_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingAvailabilitySearchResultDataItem{} - var fernTestValueUID *string + obj := &SchedulingEventType{} + var fernTestValueReassignmentEnabled bool // Act - obj.SetUID(fernTestValueUID) + obj.SetReassignmentEnabled(fernTestValueReassignmentEnabled) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -82029,14 +93262,14 @@ func TestSettersMarkExplicitSchedulingAvailabilitySearchResultDataItem(t *testin // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetSlots_MarksExplicit", func(t *testing.T) { + t.Run("SetApprovalTTLMinutes_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingAvailabilitySearchResultDataItem{} - var fernTestValueSlots []*SchedulingAvailabilitySearchResultDataItemSlotsItem + obj := &SchedulingEventType{} + var fernTestValueApprovalTTLMinutes float64 // Act - obj.SetSlots(fernTestValueSlots) + obj.SetApprovalTTLMinutes(fernTestValueApprovalTTLMinutes) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -82060,85 +93293,45 @@ func TestSettersMarkExplicitSchedulingAvailabilitySearchResultDataItem(t *testin // It verifies that setting a field via setter allows successful JSON round-trip }) -} - -func TestSettersSchedulingAvailabilitySearchResultDataItemSlotsItem(t *testing.T) { - t.Run("SetStart", func(t *testing.T) { - obj := &SchedulingAvailabilitySearchResultDataItemSlotsItem{} - var fernTestValueStart string - obj.SetStart(fernTestValueStart) - assert.Equal(t, fernTestValueStart, obj.Start) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetEnd", func(t *testing.T) { - obj := &SchedulingAvailabilitySearchResultDataItemSlotsItem{} - var fernTestValueEnd string - obj.SetEnd(fernTestValueEnd) - assert.Equal(t, fernTestValueEnd, obj.End) - assert.NotNil(t, obj.explicitFields) - }) - -} - -func TestGettersSchedulingAvailabilitySearchResultDataItemSlotsItem(t *testing.T) { - t.Run("GetStart", func(t *testing.T) { + t.Run("SetHoldTTLSeconds_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingAvailabilitySearchResultDataItemSlotsItem{} - var expected string - obj.Start = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetStart(), "getter should return the property value") - }) + obj := &SchedulingEventType{} + var fernTestValueHoldTTLSeconds float64 - t.Run("GetStart_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *SchedulingAvailabilitySearchResultDataItemSlotsItem - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetStart() // Should return zero value - }) + // Act + obj.SetHoldTTLSeconds(fernTestValueHoldTTLSeconds) - t.Run("GetEnd", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &SchedulingAvailabilitySearchResultDataItemSlotsItem{} - var expected string - obj.End = expected + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") - // Act & Assert - assert.Equal(t, expected, obj.GetEnd(), "getter should return the property value") - }) + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } - t.Run("GetEnd_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *SchedulingAvailabilitySearchResultDataItemSlotsItem - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetEnd() // Should return zero value + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip }) -} - -func TestSettersMarkExplicitSchedulingAvailabilitySearchResultDataItemSlotsItem(t *testing.T) { - t.Run("SetStart_MarksExplicit", func(t *testing.T) { + t.Run("SetCancelNoticeMinutes_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingAvailabilitySearchResultDataItemSlotsItem{} - var fernTestValueStart string + obj := &SchedulingEventType{} + var fernTestValueCancelNoticeMinutes float64 // Act - obj.SetStart(fernTestValueStart) + obj.SetCancelNoticeMinutes(fernTestValueCancelNoticeMinutes) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -82162,14 +93355,14 @@ func TestSettersMarkExplicitSchedulingAvailabilitySearchResultDataItemSlotsItem( // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetEnd_MarksExplicit", func(t *testing.T) { + t.Run("SetRescheduleNoticeMinutes_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingAvailabilitySearchResultDataItemSlotsItem{} - var fernTestValueEnd string + obj := &SchedulingEventType{} + var fernTestValueRescheduleNoticeMinutes float64 // Act - obj.SetEnd(fernTestValueEnd) + obj.SetRescheduleNoticeMinutes(fernTestValueRescheduleNoticeMinutes) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -82193,907 +93386,608 @@ func TestSettersMarkExplicitSchedulingAvailabilitySearchResultDataItemSlotsItem( // It verifies that setting a field via setter allows successful JSON round-trip }) -} - -func TestSettersSchedulingBooking(t *testing.T) { - t.Run("SetObject", func(t *testing.T) { - obj := &SchedulingBooking{} - var fernTestValueObject SchedulingBookingObject - obj.SetObject(fernTestValueObject) - assert.Equal(t, fernTestValueObject, obj.Object) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetID", func(t *testing.T) { - obj := &SchedulingBooking{} - var fernTestValueID string - obj.SetID(fernTestValueID) - assert.Equal(t, fernTestValueID, obj.ID) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetEventType", func(t *testing.T) { - obj := &SchedulingBooking{} - var fernTestValueEventType string - obj.SetEventType(fernTestValueEventType) - assert.Equal(t, fernTestValueEventType, obj.EventType) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetStatus", func(t *testing.T) { - obj := &SchedulingBooking{} - var fernTestValueStatus SchedulingBookingStatus - obj.SetStatus(fernTestValueStatus) - assert.Equal(t, fernTestValueStatus, obj.Status) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetTitle", func(t *testing.T) { - obj := &SchedulingBooking{} - var fernTestValueTitle string - obj.SetTitle(fernTestValueTitle) - assert.Equal(t, fernTestValueTitle, obj.Title) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetStart", func(t *testing.T) { - obj := &SchedulingBooking{} - var fernTestValueStart string - obj.SetStart(fernTestValueStart) - assert.Equal(t, fernTestValueStart, obj.Start) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetEnd", func(t *testing.T) { - obj := &SchedulingBooking{} - var fernTestValueEnd string - obj.SetEnd(fernTestValueEnd) - assert.Equal(t, fernTestValueEnd, obj.End) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetHosts", func(t *testing.T) { - obj := &SchedulingBooking{} - var fernTestValueHosts []string - obj.SetHosts(fernTestValueHosts) - assert.Equal(t, fernTestValueHosts, obj.Hosts) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetAttendees", func(t *testing.T) { - obj := &SchedulingBooking{} - var fernTestValueAttendees []*SchedulingBookingAttendeesItem - obj.SetAttendees(fernTestValueAttendees) - assert.Equal(t, fernTestValueAttendees, obj.Attendees) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetLocation", func(t *testing.T) { - obj := &SchedulingBooking{} - var fernTestValueLocation *SchedulingLocation - obj.SetLocation(fernTestValueLocation) - assert.Equal(t, fernTestValueLocation, obj.Location) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetHoldExpiresAt", func(t *testing.T) { - obj := &SchedulingBooking{} - var fernTestValueHoldExpiresAt *string - obj.SetHoldExpiresAt(fernTestValueHoldExpiresAt) - assert.Equal(t, fernTestValueHoldExpiresAt, obj.HoldExpiresAt) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetApprovalExpiresAt", func(t *testing.T) { - obj := &SchedulingBooking{} - var fernTestValueApprovalExpiresAt *string - obj.SetApprovalExpiresAt(fernTestValueApprovalExpiresAt) - assert.Equal(t, fernTestValueApprovalExpiresAt, obj.ApprovalExpiresAt) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetSeries", func(t *testing.T) { - obj := &SchedulingBooking{} - var fernTestValueSeries *string - obj.SetSeries(fernTestValueSeries) - assert.Equal(t, fernTestValueSeries, obj.Series) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetSeriesIndex", func(t *testing.T) { - obj := &SchedulingBooking{} - var fernTestValueSeriesIndex *float64 - obj.SetSeriesIndex(fernTestValueSeriesIndex) - assert.Equal(t, fernTestValueSeriesIndex, obj.SeriesIndex) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetGroupSession", func(t *testing.T) { - obj := &SchedulingBooking{} - var fernTestValueGroupSession *string - obj.SetGroupSession(fernTestValueGroupSession) - assert.Equal(t, fernTestValueGroupSession, obj.GroupSession) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetCalendarUnverified", func(t *testing.T) { - obj := &SchedulingBooking{} - var fernTestValueCalendarUnverified bool - obj.SetCalendarUnverified(fernTestValueCalendarUnverified) - assert.Equal(t, fernTestValueCalendarUnverified, obj.CalendarUnverified) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetExternalConflictAt", func(t *testing.T) { - obj := &SchedulingBooking{} - var fernTestValueExternalConflictAt *string - obj.SetExternalConflictAt(fernTestValueExternalConflictAt) - assert.Equal(t, fernTestValueExternalConflictAt, obj.ExternalConflictAt) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetNoShowAt", func(t *testing.T) { - obj := &SchedulingBooking{} - var fernTestValueNoShowAt *string - obj.SetNoShowAt(fernTestValueNoShowAt) - assert.Equal(t, fernTestValueNoShowAt, obj.NoShowAt) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetCancelledAt", func(t *testing.T) { - obj := &SchedulingBooking{} - var fernTestValueCancelledAt *string - obj.SetCancelledAt(fernTestValueCancelledAt) - assert.Equal(t, fernTestValueCancelledAt, obj.CancelledAt) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetCancelledBy", func(t *testing.T) { - obj := &SchedulingBooking{} - var fernTestValueCancelledBy *SchedulingBookingCancelledBy - obj.SetCancelledBy(fernTestValueCancelledBy) - assert.Equal(t, fernTestValueCancelledBy, obj.CancelledBy) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetCancellationReason", func(t *testing.T) { - obj := &SchedulingBooking{} - var fernTestValueCancellationReason *string - obj.SetCancellationReason(fernTestValueCancellationReason) - assert.Equal(t, fernTestValueCancellationReason, obj.CancellationReason) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetMetadata", func(t *testing.T) { - obj := &SchedulingBooking{} - var fernTestValueMetadata map[string]string - obj.SetMetadata(fernTestValueMetadata) - assert.Equal(t, fernTestValueMetadata, obj.Metadata) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetCreatedAt", func(t *testing.T) { - obj := &SchedulingBooking{} - var fernTestValueCreatedAt string - obj.SetCreatedAt(fernTestValueCreatedAt) - assert.Equal(t, fernTestValueCreatedAt, obj.CreatedAt) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetUpdatedAt", func(t *testing.T) { - obj := &SchedulingBooking{} - var fernTestValueUpdatedAt string - obj.SetUpdatedAt(fernTestValueUpdatedAt) - assert.Equal(t, fernTestValueUpdatedAt, obj.UpdatedAt) - assert.NotNil(t, obj.explicitFields) - }) - -} - -func TestGettersSchedulingBooking(t *testing.T) { - t.Run("GetObject", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &SchedulingBooking{} - var expected SchedulingBookingObject - obj.Object = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetObject(), "getter should return the property value") - }) - - t.Run("GetObject_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *SchedulingBooking - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetObject() // Should return zero value - }) - - t.Run("GetID", func(t *testing.T) { + t.Run("SetMaxGuests_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingBooking{} - var expected string - obj.ID = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetID(), "getter should return the property value") - }) + obj := &SchedulingEventType{} + var fernTestValueMaxGuests float64 - t.Run("GetID_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *SchedulingBooking - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetID() // Should return zero value - }) + // Act + obj.SetMaxGuests(fernTestValueMaxGuests) - t.Run("GetEventType", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &SchedulingBooking{} - var expected string - obj.EventType = expected + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") - // Act & Assert - assert.Equal(t, expected, obj.GetEventType(), "getter should return the property value") - }) + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } - t.Run("GetEventType_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *SchedulingBooking - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetEventType() // Should return zero value + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("GetStatus", func(t *testing.T) { + t.Run("SetMaxActiveBookingsPerAttendee_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingBooking{} - var expected SchedulingBookingStatus - obj.Status = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetStatus(), "getter should return the property value") - }) + obj := &SchedulingEventType{} + var fernTestValueMaxActiveBookingsPerAttendee *float64 - t.Run("GetStatus_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *SchedulingBooking - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetStatus() // Should return zero value - }) + // Act + obj.SetMaxActiveBookingsPerAttendee(fernTestValueMaxActiveBookingsPerAttendee) - t.Run("GetTitle", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &SchedulingBooking{} - var expected string - obj.Title = expected + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") - // Act & Assert - assert.Equal(t, expected, obj.GetTitle(), "getter should return the property value") - }) + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } - t.Run("GetTitle_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *SchedulingBooking - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetTitle() // Should return zero value + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("GetStart", func(t *testing.T) { + t.Run("SetHostCalendarDetails_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingBooking{} - var expected string - obj.Start = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetStart(), "getter should return the property value") - }) + obj := &SchedulingEventType{} + var fernTestValueHostCalendarDetails SchedulingEventTypeHostCalendarDetails - t.Run("GetStart_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *SchedulingBooking - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetStart() // Should return zero value - }) + // Act + obj.SetHostCalendarDetails(fernTestValueHostCalendarDetails) - t.Run("GetEnd", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &SchedulingBooking{} - var expected string - obj.End = expected + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") - // Act & Assert - assert.Equal(t, expected, obj.GetEnd(), "getter should return the property value") - }) + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } - t.Run("GetEnd_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *SchedulingBooking - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetEnd() // Should return zero value + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("GetHosts", func(t *testing.T) { + t.Run("SetQuestions_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingBooking{} - var expected []string - obj.Hosts = expected + obj := &SchedulingEventType{} + var fernTestValueQuestions []*SchedulingQuestion - // Act & Assert - assert.Equal(t, expected, obj.GetHosts(), "getter should return the property value") - }) + // Act + obj.SetQuestions(fernTestValueQuestions) - t.Run("GetHosts_NilValue", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &SchedulingBooking{} - obj.Hosts = nil + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") - // Act & Assert - assert.Nil(t, obj.GetHosts(), "getter should return nil when property is nil") - }) + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } - t.Run("GetHosts_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *SchedulingBooking - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetHosts() // Should return zero value + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("GetAttendees", func(t *testing.T) { + t.Run("SetLocations_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingBooking{} - var expected []*SchedulingBookingAttendeesItem - obj.Attendees = expected + obj := &SchedulingEventType{} + var fernTestValueLocations []*SchedulingLocation - // Act & Assert - assert.Equal(t, expected, obj.GetAttendees(), "getter should return the property value") - }) + // Act + obj.SetLocations(fernTestValueLocations) - t.Run("GetAttendees_NilValue", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &SchedulingBooking{} - obj.Attendees = nil + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") - // Act & Assert - assert.Nil(t, obj.GetAttendees(), "getter should return nil when property is nil") - }) + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } - t.Run("GetAttendees_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *SchedulingBooking - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetAttendees() // Should return zero value + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("GetLocation", func(t *testing.T) { + t.Run("SetHostFilter_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingBooking{} - var expected *SchedulingLocation - obj.Location = expected + obj := &SchedulingEventType{} + var fernTestValueHostFilter map[string]*SchedulingEventTypeHostFilterValue - // Act & Assert - assert.Equal(t, expected, obj.GetLocation(), "getter should return the property value") - }) + // Act + obj.SetHostFilter(fernTestValueHostFilter) - t.Run("GetLocation_NilValue", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &SchedulingBooking{} - obj.Location = nil + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") - // Act & Assert - assert.Nil(t, obj.GetLocation(), "getter should return nil when property is nil") - }) + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } - t.Run("GetLocation_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *SchedulingBooking - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetLocation() // Should return zero value + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("GetHoldExpiresAt", func(t *testing.T) { + t.Run("SetNotifications_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingBooking{} - var expected *string - obj.HoldExpiresAt = expected + obj := &SchedulingEventType{} + var fernTestValueNotifications map[string]*SchedulingEventTypeNotificationsValue - // Act & Assert - assert.Equal(t, expected, obj.GetHoldExpiresAt(), "getter should return the property value") - }) + // Act + obj.SetNotifications(fernTestValueNotifications) - t.Run("GetHoldExpiresAt_NilValue", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &SchedulingBooking{} - obj.HoldExpiresAt = nil + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") - // Act & Assert - assert.Nil(t, obj.GetHoldExpiresAt(), "getter should return nil when property is nil") - }) + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } - t.Run("GetHoldExpiresAt_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *SchedulingBooking - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetHoldExpiresAt() // Should return zero value + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("GetApprovalExpiresAt", func(t *testing.T) { + t.Run("SetReminders_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingBooking{} - var expected *string - obj.ApprovalExpiresAt = expected + obj := &SchedulingEventType{} + var fernTestValueReminders []*SchedulingReminder - // Act & Assert - assert.Equal(t, expected, obj.GetApprovalExpiresAt(), "getter should return the property value") - }) + // Act + obj.SetReminders(fernTestValueReminders) - t.Run("GetApprovalExpiresAt_NilValue", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &SchedulingBooking{} - obj.ApprovalExpiresAt = nil + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") - // Act & Assert - assert.Nil(t, obj.GetApprovalExpiresAt(), "getter should return nil when property is nil") - }) + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } - t.Run("GetApprovalExpiresAt_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *SchedulingBooking - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetApprovalExpiresAt() // Should return zero value + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("GetSeries", func(t *testing.T) { + t.Run("SetHosts_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingBooking{} - var expected *string - obj.Series = expected + obj := &SchedulingEventType{} + var fernTestValueHosts []*SchedulingEventTypeHostsItem - // Act & Assert - assert.Equal(t, expected, obj.GetSeries(), "getter should return the property value") - }) + // Act + obj.SetHosts(fernTestValueHosts) - t.Run("GetSeries_NilValue", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &SchedulingBooking{} - obj.Series = nil + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") - // Act & Assert - assert.Nil(t, obj.GetSeries(), "getter should return nil when property is nil") - }) + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } - t.Run("GetSeries_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *SchedulingBooking - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetSeries() // Should return zero value + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("GetSeriesIndex", func(t *testing.T) { + t.Run("SetMetadata_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingBooking{} - var expected *float64 - obj.SeriesIndex = expected + obj := &SchedulingEventType{} + var fernTestValueMetadata map[string]string - // Act & Assert - assert.Equal(t, expected, obj.GetSeriesIndex(), "getter should return the property value") - }) + // Act + obj.SetMetadata(fernTestValueMetadata) - t.Run("GetSeriesIndex_NilValue", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &SchedulingBooking{} - obj.SeriesIndex = nil + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") - // Act & Assert - assert.Nil(t, obj.GetSeriesIndex(), "getter should return nil when property is nil") - }) + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } - t.Run("GetSeriesIndex_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *SchedulingBooking - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetSeriesIndex() // Should return zero value + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("GetGroupSession", func(t *testing.T) { + t.Run("SetCreatedAt_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingBooking{} - var expected *string - obj.GroupSession = expected + obj := &SchedulingEventType{} + var fernTestValueCreatedAt string - // Act & Assert - assert.Equal(t, expected, obj.GetGroupSession(), "getter should return the property value") - }) + // Act + obj.SetCreatedAt(fernTestValueCreatedAt) - t.Run("GetGroupSession_NilValue", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &SchedulingBooking{} - obj.GroupSession = nil + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") - // Act & Assert - assert.Nil(t, obj.GetGroupSession(), "getter should return nil when property is nil") - }) + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } - t.Run("GetGroupSession_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *SchedulingBooking - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetGroupSession() // Should return zero value + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("GetCalendarUnverified", func(t *testing.T) { + t.Run("SetUpdatedAt_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingBooking{} - var expected bool - obj.CalendarUnverified = expected + obj := &SchedulingEventType{} + var fernTestValueUpdatedAt string - // Act & Assert - assert.Equal(t, expected, obj.GetCalendarUnverified(), "getter should return the property value") - }) + // Act + obj.SetUpdatedAt(fernTestValueUpdatedAt) - t.Run("GetCalendarUnverified_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *SchedulingBooking - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetCalendarUnverified() // Should return zero value - }) + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") - t.Run("GetExternalConflictAt", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &SchedulingBooking{} - var expected *string - obj.ExternalConflictAt = expected + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } - // Act & Assert - assert.Equal(t, expected, obj.GetExternalConflictAt(), "getter should return the property value") + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("GetExternalConflictAt_NilValue", func(t *testing.T) { +} + +func TestGettersSchedulingEventTypeHostFilterValue(t *testing.T) { + t.Run("GetString", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingBooking{} - obj.ExternalConflictAt = nil + obj := &SchedulingEventTypeHostFilterValue{} + var expected string + obj.String = expected // Act & Assert - assert.Nil(t, obj.GetExternalConflictAt(), "getter should return nil when property is nil") + assert.Equal(t, expected, obj.GetString(), "getter should return the property value") }) - t.Run("GetExternalConflictAt_NilReceiver", func(t *testing.T) { + t.Run("GetString_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *SchedulingBooking + var obj *SchedulingEventTypeHostFilterValue // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetExternalConflictAt() // Should return zero value + _ = obj.GetString() // Should return zero value }) - t.Run("GetNoShowAt", func(t *testing.T) { + t.Run("GetStringList", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingBooking{} - var expected *string - obj.NoShowAt = expected + obj := &SchedulingEventTypeHostFilterValue{} + var expected []string + obj.StringList = expected // Act & Assert - assert.Equal(t, expected, obj.GetNoShowAt(), "getter should return the property value") + assert.Equal(t, expected, obj.GetStringList(), "getter should return the property value") }) - t.Run("GetNoShowAt_NilValue", func(t *testing.T) { + t.Run("GetStringList_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingBooking{} - obj.NoShowAt = nil + obj := &SchedulingEventTypeHostFilterValue{} + obj.StringList = nil // Act & Assert - assert.Nil(t, obj.GetNoShowAt(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetStringList(), "getter should return nil when property is nil") }) - t.Run("GetNoShowAt_NilReceiver", func(t *testing.T) { + t.Run("GetStringList_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *SchedulingBooking + var obj *SchedulingEventTypeHostFilterValue // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetNoShowAt() // Should return zero value + _ = obj.GetStringList() // Should return zero value }) - t.Run("GetCancelledAt", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &SchedulingBooking{} - var expected *string - obj.CancelledAt = expected +} - // Act & Assert - assert.Equal(t, expected, obj.GetCancelledAt(), "getter should return the property value") +func TestSettersSchedulingEventTypeHostInput(t *testing.T) { + t.Run("SetHost", func(t *testing.T) { + obj := &SchedulingEventTypeHostInput{} + var fernTestValueHost string + obj.SetHost(fernTestValueHost) + assert.Equal(t, fernTestValueHost, obj.Host) + assert.NotNil(t, obj.explicitFields) }) - t.Run("GetCancelledAt_NilValue", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &SchedulingBooking{} - obj.CancelledAt = nil - - // Act & Assert - assert.Nil(t, obj.GetCancelledAt(), "getter should return nil when property is nil") + t.Run("SetRole", func(t *testing.T) { + obj := &SchedulingEventTypeHostInput{} + var fernTestValueRole *SchedulingEventTypeHostInputRole + obj.SetRole(fernTestValueRole) + assert.Equal(t, fernTestValueRole, obj.Role) + assert.NotNil(t, obj.explicitFields) }) - t.Run("GetCancelledAt_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *SchedulingBooking - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetCancelledAt() // Should return zero value + t.Run("SetWeight", func(t *testing.T) { + obj := &SchedulingEventTypeHostInput{} + var fernTestValueWeight *int + obj.SetWeight(fernTestValueWeight) + assert.Equal(t, fernTestValueWeight, obj.Weight) + assert.NotNil(t, obj.explicitFields) }) - t.Run("GetCancelledBy", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &SchedulingBooking{} - var expected *SchedulingBookingCancelledBy - obj.CancelledBy = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetCancelledBy(), "getter should return the property value") + t.Run("SetSchedule", func(t *testing.T) { + obj := &SchedulingEventTypeHostInput{} + var fernTestValueSchedule *string + obj.SetSchedule(fernTestValueSchedule) + assert.Equal(t, fernTestValueSchedule, obj.Schedule) + assert.NotNil(t, obj.explicitFields) }) - t.Run("GetCancelledBy_NilValue", func(t *testing.T) { +} + +func TestGettersSchedulingEventTypeHostInput(t *testing.T) { + t.Run("GetHost", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingBooking{} - obj.CancelledBy = nil + obj := &SchedulingEventTypeHostInput{} + var expected string + obj.Host = expected // Act & Assert - assert.Nil(t, obj.GetCancelledBy(), "getter should return nil when property is nil") + assert.Equal(t, expected, obj.GetHost(), "getter should return the property value") }) - t.Run("GetCancelledBy_NilReceiver", func(t *testing.T) { + t.Run("GetHost_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *SchedulingBooking + var obj *SchedulingEventTypeHostInput // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetCancelledBy() // Should return zero value + _ = obj.GetHost() // Should return zero value }) - t.Run("GetCancellationReason", func(t *testing.T) { + t.Run("GetRole", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingBooking{} - var expected *string - obj.CancellationReason = expected + obj := &SchedulingEventTypeHostInput{} + var expected *SchedulingEventTypeHostInputRole + obj.Role = expected // Act & Assert - assert.Equal(t, expected, obj.GetCancellationReason(), "getter should return the property value") + assert.Equal(t, expected, obj.GetRole(), "getter should return the property value") }) - t.Run("GetCancellationReason_NilValue", func(t *testing.T) { + t.Run("GetRole_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingBooking{} - obj.CancellationReason = nil + obj := &SchedulingEventTypeHostInput{} + obj.Role = nil // Act & Assert - assert.Nil(t, obj.GetCancellationReason(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetRole(), "getter should return nil when property is nil") }) - t.Run("GetCancellationReason_NilReceiver", func(t *testing.T) { + t.Run("GetRole_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *SchedulingBooking + var obj *SchedulingEventTypeHostInput // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetCancellationReason() // Should return zero value + _ = obj.GetRole() // Should return zero value }) - t.Run("GetMetadata", func(t *testing.T) { + t.Run("GetWeight", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingBooking{} - var expected map[string]string - obj.Metadata = expected + obj := &SchedulingEventTypeHostInput{} + var expected *int + obj.Weight = expected // Act & Assert - assert.Equal(t, expected, obj.GetMetadata(), "getter should return the property value") + assert.Equal(t, expected, obj.GetWeight(), "getter should return the property value") }) - t.Run("GetMetadata_NilValue", func(t *testing.T) { + t.Run("GetWeight_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingBooking{} - obj.Metadata = nil + obj := &SchedulingEventTypeHostInput{} + obj.Weight = nil // Act & Assert - assert.Nil(t, obj.GetMetadata(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetWeight(), "getter should return nil when property is nil") }) - t.Run("GetMetadata_NilReceiver", func(t *testing.T) { + t.Run("GetWeight_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *SchedulingBooking + var obj *SchedulingEventTypeHostInput // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetMetadata() // Should return zero value + _ = obj.GetWeight() // Should return zero value }) - t.Run("GetCreatedAt", func(t *testing.T) { + t.Run("GetSchedule", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingBooking{} - var expected string - obj.CreatedAt = expected + obj := &SchedulingEventTypeHostInput{} + var expected *string + obj.Schedule = expected // Act & Assert - assert.Equal(t, expected, obj.GetCreatedAt(), "getter should return the property value") - }) - - t.Run("GetCreatedAt_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *SchedulingBooking - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetCreatedAt() // Should return zero value + assert.Equal(t, expected, obj.GetSchedule(), "getter should return the property value") }) - t.Run("GetUpdatedAt", func(t *testing.T) { + t.Run("GetSchedule_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingBooking{} - var expected string - obj.UpdatedAt = expected + obj := &SchedulingEventTypeHostInput{} + obj.Schedule = nil // Act & Assert - assert.Equal(t, expected, obj.GetUpdatedAt(), "getter should return the property value") + assert.Nil(t, obj.GetSchedule(), "getter should return nil when property is nil") }) - t.Run("GetUpdatedAt_NilReceiver", func(t *testing.T) { + t.Run("GetSchedule_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *SchedulingBooking + var obj *SchedulingEventTypeHostInput // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetUpdatedAt() // Should return zero value + _ = obj.GetSchedule() // Should return zero value }) } -func TestSettersMarkExplicitSchedulingBooking(t *testing.T) { - t.Run("SetObject_MarksExplicit", func(t *testing.T) { +func TestSettersMarkExplicitSchedulingEventTypeHostInput(t *testing.T) { + t.Run("SetHost_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingBooking{} - var fernTestValueObject SchedulingBookingObject + obj := &SchedulingEventTypeHostInput{} + var fernTestValueHost string // Act - obj.SetObject(fernTestValueObject) + obj.SetHost(fernTestValueHost) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -83117,14 +94011,14 @@ func TestSettersMarkExplicitSchedulingBooking(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetID_MarksExplicit", func(t *testing.T) { + t.Run("SetRole_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingBooking{} - var fernTestValueID string + obj := &SchedulingEventTypeHostInput{} + var fernTestValueRole *SchedulingEventTypeHostInputRole // Act - obj.SetID(fernTestValueID) + obj.SetRole(fernTestValueRole) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -83148,14 +94042,14 @@ func TestSettersMarkExplicitSchedulingBooking(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetEventType_MarksExplicit", func(t *testing.T) { + t.Run("SetWeight_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingBooking{} - var fernTestValueEventType string + obj := &SchedulingEventTypeHostInput{} + var fernTestValueWeight *int // Act - obj.SetEventType(fernTestValueEventType) + obj.SetWeight(fernTestValueWeight) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -83179,14 +94073,14 @@ func TestSettersMarkExplicitSchedulingBooking(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetStatus_MarksExplicit", func(t *testing.T) { + t.Run("SetSchedule_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingBooking{} - var fernTestValueStatus SchedulingBookingStatus + obj := &SchedulingEventTypeHostInput{} + var fernTestValueSchedule *string // Act - obj.SetStatus(fernTestValueStatus) + obj.SetSchedule(fernTestValueSchedule) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -83210,76 +94104,157 @@ func TestSettersMarkExplicitSchedulingBooking(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetTitle_MarksExplicit", func(t *testing.T) { +} + +func TestSettersSchedulingEventTypeHostsItem(t *testing.T) { + t.Run("SetHost", func(t *testing.T) { + obj := &SchedulingEventTypeHostsItem{} + var fernTestValueHost string + obj.SetHost(fernTestValueHost) + assert.Equal(t, fernTestValueHost, obj.Host) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetRole", func(t *testing.T) { + obj := &SchedulingEventTypeHostsItem{} + var fernTestValueRole SchedulingEventTypeHostsItemRole + obj.SetRole(fernTestValueRole) + assert.Equal(t, fernTestValueRole, obj.Role) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetWeight", func(t *testing.T) { + obj := &SchedulingEventTypeHostsItem{} + var fernTestValueWeight float64 + obj.SetWeight(fernTestValueWeight) + assert.Equal(t, fernTestValueWeight, obj.Weight) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetSchedule", func(t *testing.T) { + obj := &SchedulingEventTypeHostsItem{} + var fernTestValueSchedule *string + obj.SetSchedule(fernTestValueSchedule) + assert.Equal(t, fernTestValueSchedule, obj.Schedule) + assert.NotNil(t, obj.explicitFields) + }) + +} + +func TestGettersSchedulingEventTypeHostsItem(t *testing.T) { + t.Run("GetHost", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingBooking{} - var fernTestValueTitle string + obj := &SchedulingEventTypeHostsItem{} + var expected string + obj.Host = expected - // Act - obj.SetTitle(fernTestValueTitle) + // Act & Assert + assert.Equal(t, expected, obj.GetHost(), "getter should return the property value") + }) - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") + t.Run("GetHost_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingEventTypeHostsItem + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetHost() // Should return zero value + }) - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } + t.Run("GetRole", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingEventTypeHostsItem{} + var expected SchedulingEventTypeHostsItemRole + obj.Role = expected - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip + // Act & Assert + assert.Equal(t, expected, obj.GetRole(), "getter should return the property value") }) - t.Run("SetStart_MarksExplicit", func(t *testing.T) { + t.Run("GetRole_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingEventTypeHostsItem + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetRole() // Should return zero value + }) + + t.Run("GetWeight", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingBooking{} - var fernTestValueStart string + obj := &SchedulingEventTypeHostsItem{} + var expected float64 + obj.Weight = expected - // Act - obj.SetStart(fernTestValueStart) + // Act & Assert + assert.Equal(t, expected, obj.GetWeight(), "getter should return the property value") + }) - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") + t.Run("GetWeight_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingEventTypeHostsItem + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetWeight() // Should return zero value + }) - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } + t.Run("GetSchedule", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingEventTypeHostsItem{} + var expected *string + obj.Schedule = expected - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip + // Act & Assert + assert.Equal(t, expected, obj.GetSchedule(), "getter should return the property value") }) - t.Run("SetEnd_MarksExplicit", func(t *testing.T) { + t.Run("GetSchedule_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingBooking{} - var fernTestValueEnd string + obj := &SchedulingEventTypeHostsItem{} + obj.Schedule = nil + + // Act & Assert + assert.Nil(t, obj.GetSchedule(), "getter should return nil when property is nil") + }) + + t.Run("GetSchedule_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingEventTypeHostsItem + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetSchedule() // Should return zero value + }) + +} + +func TestSettersMarkExplicitSchedulingEventTypeHostsItem(t *testing.T) { + t.Run("SetHost_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingEventTypeHostsItem{} + var fernTestValueHost string // Act - obj.SetEnd(fernTestValueEnd) + obj.SetHost(fernTestValueHost) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -83303,14 +94278,14 @@ func TestSettersMarkExplicitSchedulingBooking(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetHosts_MarksExplicit", func(t *testing.T) { + t.Run("SetRole_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingBooking{} - var fernTestValueHosts []string + obj := &SchedulingEventTypeHostsItem{} + var fernTestValueRole SchedulingEventTypeHostsItemRole // Act - obj.SetHosts(fernTestValueHosts) + obj.SetRole(fernTestValueRole) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -83334,14 +94309,14 @@ func TestSettersMarkExplicitSchedulingBooking(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetAttendees_MarksExplicit", func(t *testing.T) { + t.Run("SetWeight_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingBooking{} - var fernTestValueAttendees []*SchedulingBookingAttendeesItem + obj := &SchedulingEventTypeHostsItem{} + var fernTestValueWeight float64 // Act - obj.SetAttendees(fernTestValueAttendees) + obj.SetWeight(fernTestValueWeight) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -83365,14 +94340,14 @@ func TestSettersMarkExplicitSchedulingBooking(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetLocation_MarksExplicit", func(t *testing.T) { + t.Run("SetSchedule_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingBooking{} - var fernTestValueLocation *SchedulingLocation + obj := &SchedulingEventTypeHostsItem{} + var fernTestValueSchedule *string // Act - obj.SetLocation(fernTestValueLocation) + obj.SetSchedule(fernTestValueSchedule) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -83396,76 +94371,126 @@ func TestSettersMarkExplicitSchedulingBooking(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetHoldExpiresAt_MarksExplicit", func(t *testing.T) { +} + +func TestSettersSchedulingEventTypeList(t *testing.T) { + t.Run("SetObject", func(t *testing.T) { + obj := &SchedulingEventTypeList{} + var fernTestValueObject SchedulingEventTypeListObject + obj.SetObject(fernTestValueObject) + assert.Equal(t, fernTestValueObject, obj.Object) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetData", func(t *testing.T) { + obj := &SchedulingEventTypeList{} + var fernTestValueData []*SchedulingEventType + obj.SetData(fernTestValueData) + assert.Equal(t, fernTestValueData, obj.Data) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetHasMore", func(t *testing.T) { + obj := &SchedulingEventTypeList{} + var fernTestValueHasMore bool + obj.SetHasMore(fernTestValueHasMore) + assert.Equal(t, fernTestValueHasMore, obj.HasMore) + assert.NotNil(t, obj.explicitFields) + }) + +} + +func TestGettersSchedulingEventTypeList(t *testing.T) { + t.Run("GetObject", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingBooking{} - var fernTestValueHoldExpiresAt *string + obj := &SchedulingEventTypeList{} + var expected SchedulingEventTypeListObject + obj.Object = expected - // Act - obj.SetHoldExpiresAt(fernTestValueHoldExpiresAt) + // Act & Assert + assert.Equal(t, expected, obj.GetObject(), "getter should return the property value") + }) - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") + t.Run("GetObject_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingEventTypeList + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetObject() // Should return zero value + }) - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } + t.Run("GetData", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingEventTypeList{} + var expected []*SchedulingEventType + obj.Data = expected - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip + // Act & Assert + assert.Equal(t, expected, obj.GetData(), "getter should return the property value") }) - t.Run("SetApprovalExpiresAt_MarksExplicit", func(t *testing.T) { + t.Run("GetData_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingBooking{} - var fernTestValueApprovalExpiresAt *string + obj := &SchedulingEventTypeList{} + obj.Data = nil - // Act - obj.SetApprovalExpiresAt(fernTestValueApprovalExpiresAt) + // Act & Assert + assert.Nil(t, obj.GetData(), "getter should return nil when property is nil") + }) - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") + t.Run("GetData_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingEventTypeList + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetData() // Should return zero value + }) - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } + t.Run("GetHasMore", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingEventTypeList{} + var expected bool + obj.HasMore = expected - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip + // Act & Assert + assert.Equal(t, expected, obj.GetHasMore(), "getter should return the property value") }) - t.Run("SetSeries_MarksExplicit", func(t *testing.T) { + t.Run("GetHasMore_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingEventTypeList + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetHasMore() // Should return zero value + }) + +} + +func TestSettersMarkExplicitSchedulingEventTypeList(t *testing.T) { + t.Run("SetObject_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingBooking{} - var fernTestValueSeries *string + obj := &SchedulingEventTypeList{} + var fernTestValueObject SchedulingEventTypeListObject // Act - obj.SetSeries(fernTestValueSeries) + obj.SetObject(fernTestValueObject) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -83489,14 +94514,14 @@ func TestSettersMarkExplicitSchedulingBooking(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetSeriesIndex_MarksExplicit", func(t *testing.T) { + t.Run("SetData_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingBooking{} - var fernTestValueSeriesIndex *float64 + obj := &SchedulingEventTypeList{} + var fernTestValueData []*SchedulingEventType // Act - obj.SetSeriesIndex(fernTestValueSeriesIndex) + obj.SetData(fernTestValueData) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -83520,14 +94545,14 @@ func TestSettersMarkExplicitSchedulingBooking(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetGroupSession_MarksExplicit", func(t *testing.T) { + t.Run("SetHasMore_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingBooking{} - var fernTestValueGroupSession *string + obj := &SchedulingEventTypeList{} + var fernTestValueHasMore bool // Act - obj.SetGroupSession(fernTestValueGroupSession) + obj.SetHasMore(fernTestValueHasMore) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -83551,76 +94576,146 @@ func TestSettersMarkExplicitSchedulingBooking(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetCalendarUnverified_MarksExplicit", func(t *testing.T) { +} + +func TestSettersSchedulingEventTypeNotificationsValue(t *testing.T) { + t.Run("SetEmailAttendee", func(t *testing.T) { + obj := &SchedulingEventTypeNotificationsValue{} + var fernTestValueEmailAttendee *bool + obj.SetEmailAttendee(fernTestValueEmailAttendee) + assert.Equal(t, fernTestValueEmailAttendee, obj.EmailAttendee) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetEmailHost", func(t *testing.T) { + obj := &SchedulingEventTypeNotificationsValue{} + var fernTestValueEmailHost *bool + obj.SetEmailHost(fernTestValueEmailHost) + assert.Equal(t, fernTestValueEmailHost, obj.EmailHost) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetSmsAttendee", func(t *testing.T) { + obj := &SchedulingEventTypeNotificationsValue{} + var fernTestValueSmsAttendee *bool + obj.SetSmsAttendee(fernTestValueSmsAttendee) + assert.Equal(t, fernTestValueSmsAttendee, obj.SmsAttendee) + assert.NotNil(t, obj.explicitFields) + }) + +} + +func TestGettersSchedulingEventTypeNotificationsValue(t *testing.T) { + t.Run("GetEmailAttendee", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingBooking{} - var fernTestValueCalendarUnverified bool + obj := &SchedulingEventTypeNotificationsValue{} + var expected *bool + obj.EmailAttendee = expected - // Act - obj.SetCalendarUnverified(fernTestValueCalendarUnverified) + // Act & Assert + assert.Equal(t, expected, obj.GetEmailAttendee(), "getter should return the property value") + }) - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") + t.Run("GetEmailAttendee_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingEventTypeNotificationsValue{} + obj.EmailAttendee = nil - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } + // Act & Assert + assert.Nil(t, obj.GetEmailAttendee(), "getter should return nil when property is nil") + }) - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip + t.Run("GetEmailAttendee_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingEventTypeNotificationsValue + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetEmailAttendee() // Should return zero value }) - t.Run("SetExternalConflictAt_MarksExplicit", func(t *testing.T) { + t.Run("GetEmailHost", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingBooking{} - var fernTestValueExternalConflictAt *string + obj := &SchedulingEventTypeNotificationsValue{} + var expected *bool + obj.EmailHost = expected - // Act - obj.SetExternalConflictAt(fernTestValueExternalConflictAt) + // Act & Assert + assert.Equal(t, expected, obj.GetEmailHost(), "getter should return the property value") + }) - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") + t.Run("GetEmailHost_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingEventTypeNotificationsValue{} + obj.EmailHost = nil - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } + // Act & Assert + assert.Nil(t, obj.GetEmailHost(), "getter should return nil when property is nil") + }) - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip + t.Run("GetEmailHost_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingEventTypeNotificationsValue + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetEmailHost() // Should return zero value + }) + + t.Run("GetSmsAttendee", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingEventTypeNotificationsValue{} + var expected *bool + obj.SmsAttendee = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetSmsAttendee(), "getter should return the property value") + }) + + t.Run("GetSmsAttendee_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingEventTypeNotificationsValue{} + obj.SmsAttendee = nil + + // Act & Assert + assert.Nil(t, obj.GetSmsAttendee(), "getter should return nil when property is nil") + }) + + t.Run("GetSmsAttendee_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingEventTypeNotificationsValue + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetSmsAttendee() // Should return zero value }) - t.Run("SetNoShowAt_MarksExplicit", func(t *testing.T) { +} + +func TestSettersMarkExplicitSchedulingEventTypeNotificationsValue(t *testing.T) { + t.Run("SetEmailAttendee_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingBooking{} - var fernTestValueNoShowAt *string + obj := &SchedulingEventTypeNotificationsValue{} + var fernTestValueEmailAttendee *bool // Act - obj.SetNoShowAt(fernTestValueNoShowAt) + obj.SetEmailAttendee(fernTestValueEmailAttendee) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -83644,14 +94739,14 @@ func TestSettersMarkExplicitSchedulingBooking(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetCancelledAt_MarksExplicit", func(t *testing.T) { + t.Run("SetEmailHost_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingBooking{} - var fernTestValueCancelledAt *string + obj := &SchedulingEventTypeNotificationsValue{} + var fernTestValueEmailHost *bool // Act - obj.SetCancelledAt(fernTestValueCancelledAt) + obj.SetEmailHost(fernTestValueEmailHost) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -83675,14 +94770,14 @@ func TestSettersMarkExplicitSchedulingBooking(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetCancelledBy_MarksExplicit", func(t *testing.T) { + t.Run("SetSmsAttendee_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingBooking{} - var fernTestValueCancelledBy *SchedulingBookingCancelledBy + obj := &SchedulingEventTypeNotificationsValue{} + var fernTestValueSmsAttendee *bool // Act - obj.SetCancelledBy(fernTestValueCancelledBy) + obj.SetSmsAttendee(fernTestValueSmsAttendee) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -83706,76 +94801,95 @@ func TestSettersMarkExplicitSchedulingBooking(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetCancellationReason_MarksExplicit", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &SchedulingBooking{} - var fernTestValueCancellationReason *string +} - // Act - obj.SetCancellationReason(fernTestValueCancellationReason) +func TestSettersSchedulingGuestInput(t *testing.T) { + t.Run("SetEmail", func(t *testing.T) { + obj := &SchedulingGuestInput{} + var fernTestValueEmail string + obj.SetEmail(fernTestValueEmail) + assert.Equal(t, fernTestValueEmail, obj.Email) + assert.NotNil(t, obj.explicitFields) + }) - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") + t.Run("SetName", func(t *testing.T) { + obj := &SchedulingGuestInput{} + var fernTestValueName *string + obj.SetName(fernTestValueName) + assert.Equal(t, fernTestValueName, obj.Name) + assert.NotNil(t, obj.explicitFields) + }) - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } +} - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip +func TestGettersSchedulingGuestInput(t *testing.T) { + t.Run("GetEmail", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingGuestInput{} + var expected string + obj.Email = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetEmail(), "getter should return the property value") }) - t.Run("SetMetadata_MarksExplicit", func(t *testing.T) { + t.Run("GetEmail_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingGuestInput + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetEmail() // Should return zero value + }) + + t.Run("GetName", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingBooking{} - var fernTestValueMetadata map[string]string + obj := &SchedulingGuestInput{} + var expected *string + obj.Name = expected - // Act - obj.SetMetadata(fernTestValueMetadata) + // Act & Assert + assert.Equal(t, expected, obj.GetName(), "getter should return the property value") + }) - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") + t.Run("GetName_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingGuestInput{} + obj.Name = nil - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } + // Act & Assert + assert.Nil(t, obj.GetName(), "getter should return nil when property is nil") + }) - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip + t.Run("GetName_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingGuestInput + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetName() // Should return zero value }) - t.Run("SetCreatedAt_MarksExplicit", func(t *testing.T) { +} + +func TestSettersMarkExplicitSchedulingGuestInput(t *testing.T) { + t.Run("SetEmail_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingBooking{} - var fernTestValueCreatedAt string + obj := &SchedulingGuestInput{} + var fernTestValueEmail string // Act - obj.SetCreatedAt(fernTestValueCreatedAt) + obj.SetEmail(fernTestValueEmail) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -83799,14 +94913,14 @@ func TestSettersMarkExplicitSchedulingBooking(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetUpdatedAt_MarksExplicit", func(t *testing.T) { + t.Run("SetName_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingBooking{} - var fernTestValueUpdatedAt string + obj := &SchedulingGuestInput{} + var fernTestValueName *string // Act - obj.SetUpdatedAt(fernTestValueUpdatedAt) + obj.SetName(fernTestValueName) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -83832,86 +94946,149 @@ func TestSettersMarkExplicitSchedulingBooking(t *testing.T) { } -func TestSettersSchedulingBookingAttendeesItem(t *testing.T) { +func TestSettersSchedulingHolidayCalendar(t *testing.T) { + t.Run("SetObject", func(t *testing.T) { + obj := &SchedulingHolidayCalendar{} + var fernTestValueObject SchedulingHolidayCalendarObject + obj.SetObject(fernTestValueObject) + assert.Equal(t, fernTestValueObject, obj.Object) + assert.NotNil(t, obj.explicitFields) + }) + t.Run("SetID", func(t *testing.T) { - obj := &SchedulingBookingAttendeesItem{} + obj := &SchedulingHolidayCalendar{} var fernTestValueID string obj.SetID(fernTestValueID) assert.Equal(t, fernTestValueID, obj.ID) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetRole", func(t *testing.T) { - obj := &SchedulingBookingAttendeesItem{} - var fernTestValueRole SchedulingBookingAttendeesItemRole - obj.SetRole(fernTestValueRole) - assert.Equal(t, fernTestValueRole, obj.Role) + t.Run("SetName", func(t *testing.T) { + obj := &SchedulingHolidayCalendar{} + var fernTestValueName string + obj.SetName(fernTestValueName) + assert.Equal(t, fernTestValueName, obj.Name) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetUID", func(t *testing.T) { - obj := &SchedulingBookingAttendeesItem{} - var fernTestValueUID *string - obj.SetUID(fernTestValueUID) - assert.Equal(t, fernTestValueUID, obj.UID) + t.Run("SetSource", func(t *testing.T) { + obj := &SchedulingHolidayCalendar{} + var fernTestValueSource SchedulingHolidayCalendarSource + obj.SetSource(fernTestValueSource) + assert.Equal(t, fernTestValueSource, obj.Source) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetName", func(t *testing.T) { - obj := &SchedulingBookingAttendeesItem{} - var fernTestValueName *string - obj.SetName(fernTestValueName) - assert.Equal(t, fernTestValueName, obj.Name) + t.Run("SetCountry", func(t *testing.T) { + obj := &SchedulingHolidayCalendar{} + var fernTestValueCountry *string + obj.SetCountry(fernTestValueCountry) + assert.Equal(t, fernTestValueCountry, obj.Country) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetEmail", func(t *testing.T) { - obj := &SchedulingBookingAttendeesItem{} - var fernTestValueEmail *string - obj.SetEmail(fernTestValueEmail) - assert.Equal(t, fernTestValueEmail, obj.Email) + t.Run("SetHosts", func(t *testing.T) { + obj := &SchedulingHolidayCalendar{} + var fernTestValueHosts []string + obj.SetHosts(fernTestValueHosts) + assert.Equal(t, fernTestValueHosts, obj.Hosts) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetPhone", func(t *testing.T) { - obj := &SchedulingBookingAttendeesItem{} - var fernTestValuePhone *string - obj.SetPhone(fernTestValuePhone) - assert.Equal(t, fernTestValuePhone, obj.Phone) + t.Run("SetHostFilter", func(t *testing.T) { + obj := &SchedulingHolidayCalendar{} + var fernTestValueHostFilter map[string]*SchedulingHolidayCalendarHostFilterValue + obj.SetHostFilter(fernTestValueHostFilter) + assert.Equal(t, fernTestValueHostFilter, obj.HostFilter) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetTimeZone", func(t *testing.T) { - obj := &SchedulingBookingAttendeesItem{} - var fernTestValueTimeZone string - obj.SetTimeZone(fernTestValueTimeZone) - assert.Equal(t, fernTestValueTimeZone, obj.TimeZone) + t.Run("SetRegions", func(t *testing.T) { + obj := &SchedulingHolidayCalendar{} + var fernTestValueRegions []string + obj.SetRegions(fernTestValueRegions) + assert.Equal(t, fernTestValueRegions, obj.Regions) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetLocale", func(t *testing.T) { - obj := &SchedulingBookingAttendeesItem{} - var fernTestValueLocale *string - obj.SetLocale(fernTestValueLocale) - assert.Equal(t, fernTestValueLocale, obj.Locale) + t.Run("SetDelegates", func(t *testing.T) { + obj := &SchedulingHolidayCalendar{} + var fernTestValueDelegates []string + obj.SetDelegates(fernTestValueDelegates) + assert.Equal(t, fernTestValueDelegates, obj.Delegates) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetAnswers", func(t *testing.T) { - obj := &SchedulingBookingAttendeesItem{} - var fernTestValueAnswers map[string]*SchedulingBookingAttendeesItemAnswersValue - obj.SetAnswers(fernTestValueAnswers) - assert.Equal(t, fernTestValueAnswers, obj.Answers) + t.Run("SetExistingBookings", func(t *testing.T) { + obj := &SchedulingHolidayCalendar{} + var fernTestValueExistingBookings SchedulingHolidayCalendarExistingBookings + obj.SetExistingBookings(fernTestValueExistingBookings) + assert.Equal(t, fernTestValueExistingBookings, obj.ExistingBookings) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetLastReadAt", func(t *testing.T) { + obj := &SchedulingHolidayCalendar{} + var fernTestValueLastReadAt *string + obj.SetLastReadAt(fernTestValueLastReadAt) + assert.Equal(t, fernTestValueLastReadAt, obj.LastReadAt) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetLastError", func(t *testing.T) { + obj := &SchedulingHolidayCalendar{} + var fernTestValueLastError *string + obj.SetLastError(fernTestValueLastError) + assert.Equal(t, fernTestValueLastError, obj.LastError) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetCreatedAt", func(t *testing.T) { + obj := &SchedulingHolidayCalendar{} + var fernTestValueCreatedAt string + obj.SetCreatedAt(fernTestValueCreatedAt) + assert.Equal(t, fernTestValueCreatedAt, obj.CreatedAt) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetUpdatedAt", func(t *testing.T) { + obj := &SchedulingHolidayCalendar{} + var fernTestValueUpdatedAt string + obj.SetUpdatedAt(fernTestValueUpdatedAt) + assert.Equal(t, fernTestValueUpdatedAt, obj.UpdatedAt) assert.NotNil(t, obj.explicitFields) }) } -func TestGettersSchedulingBookingAttendeesItem(t *testing.T) { +func TestGettersSchedulingHolidayCalendar(t *testing.T) { + t.Run("GetObject", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingHolidayCalendar{} + var expected SchedulingHolidayCalendarObject + obj.Object = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetObject(), "getter should return the property value") + }) + + t.Run("GetObject_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingHolidayCalendar + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetObject() // Should return zero value + }) + t.Run("GetID", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingBookingAttendeesItem{} + obj := &SchedulingHolidayCalendar{} var expected string obj.ID = expected @@ -83921,7 +95098,7 @@ func TestGettersSchedulingBookingAttendeesItem(t *testing.T) { t.Run("GetID_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *SchedulingBookingAttendeesItem + var obj *SchedulingHolidayCalendar // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -83931,292 +95108,363 @@ func TestGettersSchedulingBookingAttendeesItem(t *testing.T) { _ = obj.GetID() // Should return zero value }) - t.Run("GetRole", func(t *testing.T) { + t.Run("GetName", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingBookingAttendeesItem{} - var expected SchedulingBookingAttendeesItemRole - obj.Role = expected + obj := &SchedulingHolidayCalendar{} + var expected string + obj.Name = expected // Act & Assert - assert.Equal(t, expected, obj.GetRole(), "getter should return the property value") + assert.Equal(t, expected, obj.GetName(), "getter should return the property value") }) - t.Run("GetRole_NilReceiver", func(t *testing.T) { + t.Run("GetName_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *SchedulingBookingAttendeesItem + var obj *SchedulingHolidayCalendar // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetRole() // Should return zero value + _ = obj.GetName() // Should return zero value }) - t.Run("GetUID", func(t *testing.T) { + t.Run("GetSource", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingBookingAttendeesItem{} + obj := &SchedulingHolidayCalendar{} + var expected SchedulingHolidayCalendarSource + obj.Source = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetSource(), "getter should return the property value") + }) + + t.Run("GetSource_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingHolidayCalendar + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetSource() // Should return zero value + }) + + t.Run("GetCountry", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingHolidayCalendar{} var expected *string - obj.UID = expected + obj.Country = expected // Act & Assert - assert.Equal(t, expected, obj.GetUID(), "getter should return the property value") + assert.Equal(t, expected, obj.GetCountry(), "getter should return the property value") }) - t.Run("GetUID_NilValue", func(t *testing.T) { + t.Run("GetCountry_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingBookingAttendeesItem{} - obj.UID = nil + obj := &SchedulingHolidayCalendar{} + obj.Country = nil // Act & Assert - assert.Nil(t, obj.GetUID(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetCountry(), "getter should return nil when property is nil") }) - t.Run("GetUID_NilReceiver", func(t *testing.T) { + t.Run("GetCountry_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *SchedulingBookingAttendeesItem + var obj *SchedulingHolidayCalendar // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetUID() // Should return zero value + _ = obj.GetCountry() // Should return zero value }) - t.Run("GetName", func(t *testing.T) { + t.Run("GetHosts", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingBookingAttendeesItem{} - var expected *string - obj.Name = expected + obj := &SchedulingHolidayCalendar{} + var expected []string + obj.Hosts = expected // Act & Assert - assert.Equal(t, expected, obj.GetName(), "getter should return the property value") + assert.Equal(t, expected, obj.GetHosts(), "getter should return the property value") }) - t.Run("GetName_NilValue", func(t *testing.T) { + t.Run("GetHosts_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingBookingAttendeesItem{} - obj.Name = nil + obj := &SchedulingHolidayCalendar{} + obj.Hosts = nil // Act & Assert - assert.Nil(t, obj.GetName(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetHosts(), "getter should return nil when property is nil") }) - t.Run("GetName_NilReceiver", func(t *testing.T) { + t.Run("GetHosts_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *SchedulingBookingAttendeesItem + var obj *SchedulingHolidayCalendar // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetName() // Should return zero value + _ = obj.GetHosts() // Should return zero value }) - t.Run("GetEmail", func(t *testing.T) { + t.Run("GetHostFilter", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingBookingAttendeesItem{} - var expected *string - obj.Email = expected + obj := &SchedulingHolidayCalendar{} + var expected map[string]*SchedulingHolidayCalendarHostFilterValue + obj.HostFilter = expected // Act & Assert - assert.Equal(t, expected, obj.GetEmail(), "getter should return the property value") + assert.Equal(t, expected, obj.GetHostFilter(), "getter should return the property value") }) - t.Run("GetEmail_NilValue", func(t *testing.T) { + t.Run("GetHostFilter_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingBookingAttendeesItem{} - obj.Email = nil + obj := &SchedulingHolidayCalendar{} + obj.HostFilter = nil // Act & Assert - assert.Nil(t, obj.GetEmail(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetHostFilter(), "getter should return nil when property is nil") }) - t.Run("GetEmail_NilReceiver", func(t *testing.T) { + t.Run("GetHostFilter_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *SchedulingBookingAttendeesItem + var obj *SchedulingHolidayCalendar // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetEmail() // Should return zero value + _ = obj.GetHostFilter() // Should return zero value }) - t.Run("GetPhone", func(t *testing.T) { + t.Run("GetRegions", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingBookingAttendeesItem{} - var expected *string - obj.Phone = expected + obj := &SchedulingHolidayCalendar{} + var expected []string + obj.Regions = expected // Act & Assert - assert.Equal(t, expected, obj.GetPhone(), "getter should return the property value") + assert.Equal(t, expected, obj.GetRegions(), "getter should return the property value") }) - t.Run("GetPhone_NilValue", func(t *testing.T) { + t.Run("GetRegions_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingBookingAttendeesItem{} - obj.Phone = nil + obj := &SchedulingHolidayCalendar{} + obj.Regions = nil // Act & Assert - assert.Nil(t, obj.GetPhone(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetRegions(), "getter should return nil when property is nil") }) - t.Run("GetPhone_NilReceiver", func(t *testing.T) { + t.Run("GetRegions_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *SchedulingBookingAttendeesItem + var obj *SchedulingHolidayCalendar // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetPhone() // Should return zero value + _ = obj.GetRegions() // Should return zero value }) - t.Run("GetTimeZone", func(t *testing.T) { + t.Run("GetDelegates", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingBookingAttendeesItem{} - var expected string - obj.TimeZone = expected + obj := &SchedulingHolidayCalendar{} + var expected []string + obj.Delegates = expected // Act & Assert - assert.Equal(t, expected, obj.GetTimeZone(), "getter should return the property value") + assert.Equal(t, expected, obj.GetDelegates(), "getter should return the property value") }) - t.Run("GetTimeZone_NilReceiver", func(t *testing.T) { + t.Run("GetDelegates_NilValue", func(t *testing.T) { t.Parallel() - var obj *SchedulingBookingAttendeesItem + // Arrange + obj := &SchedulingHolidayCalendar{} + obj.Delegates = nil + + // Act & Assert + assert.Nil(t, obj.GetDelegates(), "getter should return nil when property is nil") + }) + + t.Run("GetDelegates_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingHolidayCalendar // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetTimeZone() // Should return zero value + _ = obj.GetDelegates() // Should return zero value }) - t.Run("GetLocale", func(t *testing.T) { + t.Run("GetExistingBookings", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingBookingAttendeesItem{} + obj := &SchedulingHolidayCalendar{} + var expected SchedulingHolidayCalendarExistingBookings + obj.ExistingBookings = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetExistingBookings(), "getter should return the property value") + }) + + t.Run("GetExistingBookings_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingHolidayCalendar + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetExistingBookings() // Should return zero value + }) + + t.Run("GetLastReadAt", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingHolidayCalendar{} var expected *string - obj.Locale = expected + obj.LastReadAt = expected // Act & Assert - assert.Equal(t, expected, obj.GetLocale(), "getter should return the property value") + assert.Equal(t, expected, obj.GetLastReadAt(), "getter should return the property value") }) - t.Run("GetLocale_NilValue", func(t *testing.T) { + t.Run("GetLastReadAt_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingBookingAttendeesItem{} - obj.Locale = nil + obj := &SchedulingHolidayCalendar{} + obj.LastReadAt = nil // Act & Assert - assert.Nil(t, obj.GetLocale(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetLastReadAt(), "getter should return nil when property is nil") }) - t.Run("GetLocale_NilReceiver", func(t *testing.T) { + t.Run("GetLastReadAt_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *SchedulingBookingAttendeesItem + var obj *SchedulingHolidayCalendar // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetLocale() // Should return zero value + _ = obj.GetLastReadAt() // Should return zero value }) - t.Run("GetAnswers", func(t *testing.T) { + t.Run("GetLastError", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingBookingAttendeesItem{} - var expected map[string]*SchedulingBookingAttendeesItemAnswersValue - obj.Answers = expected + obj := &SchedulingHolidayCalendar{} + var expected *string + obj.LastError = expected // Act & Assert - assert.Equal(t, expected, obj.GetAnswers(), "getter should return the property value") + assert.Equal(t, expected, obj.GetLastError(), "getter should return the property value") }) - t.Run("GetAnswers_NilValue", func(t *testing.T) { + t.Run("GetLastError_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingBookingAttendeesItem{} - obj.Answers = nil + obj := &SchedulingHolidayCalendar{} + obj.LastError = nil // Act & Assert - assert.Nil(t, obj.GetAnswers(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetLastError(), "getter should return nil when property is nil") }) - t.Run("GetAnswers_NilReceiver", func(t *testing.T) { + t.Run("GetLastError_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *SchedulingBookingAttendeesItem + var obj *SchedulingHolidayCalendar // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetAnswers() // Should return zero value + _ = obj.GetLastError() // Should return zero value }) -} - -func TestSettersMarkExplicitSchedulingBookingAttendeesItem(t *testing.T) { - t.Run("SetID_MarksExplicit", func(t *testing.T) { + t.Run("GetCreatedAt", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingBookingAttendeesItem{} - var fernTestValueID string + obj := &SchedulingHolidayCalendar{} + var expected string + obj.CreatedAt = expected - // Act - obj.SetID(fernTestValueID) + // Act & Assert + assert.Equal(t, expected, obj.GetCreatedAt(), "getter should return the property value") + }) - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") + t.Run("GetCreatedAt_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingHolidayCalendar + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetCreatedAt() // Should return zero value + }) - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } + t.Run("GetUpdatedAt", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingHolidayCalendar{} + var expected string + obj.UpdatedAt = expected - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip + // Act & Assert + assert.Equal(t, expected, obj.GetUpdatedAt(), "getter should return the property value") }) - t.Run("SetRole_MarksExplicit", func(t *testing.T) { + t.Run("GetUpdatedAt_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingHolidayCalendar + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetUpdatedAt() // Should return zero value + }) + +} + +func TestSettersMarkExplicitSchedulingHolidayCalendar(t *testing.T) { + t.Run("SetObject_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingBookingAttendeesItem{} - var fernTestValueRole SchedulingBookingAttendeesItemRole + obj := &SchedulingHolidayCalendar{} + var fernTestValueObject SchedulingHolidayCalendarObject // Act - obj.SetRole(fernTestValueRole) + obj.SetObject(fernTestValueObject) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -84240,14 +95488,14 @@ func TestSettersMarkExplicitSchedulingBookingAttendeesItem(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetUID_MarksExplicit", func(t *testing.T) { + t.Run("SetID_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingBookingAttendeesItem{} - var fernTestValueUID *string + obj := &SchedulingHolidayCalendar{} + var fernTestValueID string // Act - obj.SetUID(fernTestValueUID) + obj.SetID(fernTestValueID) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -84274,8 +95522,8 @@ func TestSettersMarkExplicitSchedulingBookingAttendeesItem(t *testing.T) { t.Run("SetName_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingBookingAttendeesItem{} - var fernTestValueName *string + obj := &SchedulingHolidayCalendar{} + var fernTestValueName string // Act obj.SetName(fernTestValueName) @@ -84302,14 +95550,14 @@ func TestSettersMarkExplicitSchedulingBookingAttendeesItem(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetEmail_MarksExplicit", func(t *testing.T) { + t.Run("SetSource_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingBookingAttendeesItem{} - var fernTestValueEmail *string + obj := &SchedulingHolidayCalendar{} + var fernTestValueSource SchedulingHolidayCalendarSource // Act - obj.SetEmail(fernTestValueEmail) + obj.SetSource(fernTestValueSource) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -84333,14 +95581,14 @@ func TestSettersMarkExplicitSchedulingBookingAttendeesItem(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetPhone_MarksExplicit", func(t *testing.T) { + t.Run("SetCountry_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingBookingAttendeesItem{} - var fernTestValuePhone *string + obj := &SchedulingHolidayCalendar{} + var fernTestValueCountry *string // Act - obj.SetPhone(fernTestValuePhone) + obj.SetCountry(fernTestValueCountry) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -84364,14 +95612,14 @@ func TestSettersMarkExplicitSchedulingBookingAttendeesItem(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetTimeZone_MarksExplicit", func(t *testing.T) { + t.Run("SetHosts_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingBookingAttendeesItem{} - var fernTestValueTimeZone string + obj := &SchedulingHolidayCalendar{} + var fernTestValueHosts []string // Act - obj.SetTimeZone(fernTestValueTimeZone) + obj.SetHosts(fernTestValueHosts) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -84395,14 +95643,14 @@ func TestSettersMarkExplicitSchedulingBookingAttendeesItem(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetLocale_MarksExplicit", func(t *testing.T) { + t.Run("SetHostFilter_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingBookingAttendeesItem{} - var fernTestValueLocale *string + obj := &SchedulingHolidayCalendar{} + var fernTestValueHostFilter map[string]*SchedulingHolidayCalendarHostFilterValue // Act - obj.SetLocale(fernTestValueLocale) + obj.SetHostFilter(fernTestValueHostFilter) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -84426,14 +95674,14 @@ func TestSettersMarkExplicitSchedulingBookingAttendeesItem(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetAnswers_MarksExplicit", func(t *testing.T) { + t.Run("SetRegions_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingBookingAttendeesItem{} - var fernTestValueAnswers map[string]*SchedulingBookingAttendeesItemAnswersValue + obj := &SchedulingHolidayCalendar{} + var fernTestValueRegions []string // Act - obj.SetAnswers(fernTestValueAnswers) + obj.SetRegions(fernTestValueRegions) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -84457,319 +95705,14 @@ func TestSettersMarkExplicitSchedulingBookingAttendeesItem(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) -} - -func TestGettersSchedulingBookingAttendeesItemAnswersValue(t *testing.T) { - t.Run("GetString", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &SchedulingBookingAttendeesItemAnswersValue{} - var expected string - obj.String = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetString(), "getter should return the property value") - }) - - t.Run("GetString_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *SchedulingBookingAttendeesItemAnswersValue - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetString() // Should return zero value - }) - - t.Run("GetStringList", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &SchedulingBookingAttendeesItemAnswersValue{} - var expected []string - obj.StringList = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetStringList(), "getter should return the property value") - }) - - t.Run("GetStringList_NilValue", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &SchedulingBookingAttendeesItemAnswersValue{} - obj.StringList = nil - - // Act & Assert - assert.Nil(t, obj.GetStringList(), "getter should return nil when property is nil") - }) - - t.Run("GetStringList_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *SchedulingBookingAttendeesItemAnswersValue - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetStringList() // Should return zero value - }) - -} - -func TestSettersSchedulingBookingEvent(t *testing.T) { - t.Run("SetObject", func(t *testing.T) { - obj := &SchedulingBookingEvent{} - var fernTestValueObject SchedulingBookingEventObject - obj.SetObject(fernTestValueObject) - assert.Equal(t, fernTestValueObject, obj.Object) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetID", func(t *testing.T) { - obj := &SchedulingBookingEvent{} - var fernTestValueID string - obj.SetID(fernTestValueID) - assert.Equal(t, fernTestValueID, obj.ID) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetSequence", func(t *testing.T) { - obj := &SchedulingBookingEvent{} - var fernTestValueSequence float64 - obj.SetSequence(fernTestValueSequence) - assert.Equal(t, fernTestValueSequence, obj.Sequence) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetType", func(t *testing.T) { - obj := &SchedulingBookingEvent{} - var fernTestValueType string - obj.SetType(fernTestValueType) - assert.Equal(t, fernTestValueType, obj.Type) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetActor", func(t *testing.T) { - obj := &SchedulingBookingEvent{} - var fernTestValueActor *SchedulingBookingEventActor - obj.SetActor(fernTestValueActor) - assert.Equal(t, fernTestValueActor, obj.Actor) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetDetails", func(t *testing.T) { - obj := &SchedulingBookingEvent{} - var fernTestValueDetails map[string]any - obj.SetDetails(fernTestValueDetails) - assert.Equal(t, fernTestValueDetails, obj.Details) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetOccurredAt", func(t *testing.T) { - obj := &SchedulingBookingEvent{} - var fernTestValueOccurredAt string - obj.SetOccurredAt(fernTestValueOccurredAt) - assert.Equal(t, fernTestValueOccurredAt, obj.OccurredAt) - assert.NotNil(t, obj.explicitFields) - }) - -} - -func TestGettersSchedulingBookingEvent(t *testing.T) { - t.Run("GetObject", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &SchedulingBookingEvent{} - var expected SchedulingBookingEventObject - obj.Object = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetObject(), "getter should return the property value") - }) - - t.Run("GetObject_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *SchedulingBookingEvent - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetObject() // Should return zero value - }) - - t.Run("GetID", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &SchedulingBookingEvent{} - var expected string - obj.ID = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetID(), "getter should return the property value") - }) - - t.Run("GetID_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *SchedulingBookingEvent - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetID() // Should return zero value - }) - - t.Run("GetSequence", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &SchedulingBookingEvent{} - var expected float64 - obj.Sequence = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetSequence(), "getter should return the property value") - }) - - t.Run("GetSequence_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *SchedulingBookingEvent - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetSequence() // Should return zero value - }) - - t.Run("GetType", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &SchedulingBookingEvent{} - var expected string - obj.Type = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetType(), "getter should return the property value") - }) - - t.Run("GetType_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *SchedulingBookingEvent - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetType() // Should return zero value - }) - - t.Run("GetActor", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &SchedulingBookingEvent{} - var expected *SchedulingBookingEventActor - obj.Actor = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetActor(), "getter should return the property value") - }) - - t.Run("GetActor_NilValue", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &SchedulingBookingEvent{} - obj.Actor = nil - - // Act & Assert - assert.Nil(t, obj.GetActor(), "getter should return nil when property is nil") - }) - - t.Run("GetActor_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *SchedulingBookingEvent - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetActor() // Should return zero value - }) - - t.Run("GetDetails", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &SchedulingBookingEvent{} - var expected map[string]any - obj.Details = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetDetails(), "getter should return the property value") - }) - - t.Run("GetDetails_NilValue", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &SchedulingBookingEvent{} - obj.Details = nil - - // Act & Assert - assert.Nil(t, obj.GetDetails(), "getter should return nil when property is nil") - }) - - t.Run("GetDetails_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *SchedulingBookingEvent - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetDetails() // Should return zero value - }) - - t.Run("GetOccurredAt", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &SchedulingBookingEvent{} - var expected string - obj.OccurredAt = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetOccurredAt(), "getter should return the property value") - }) - - t.Run("GetOccurredAt_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *SchedulingBookingEvent - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetOccurredAt() // Should return zero value - }) - -} - -func TestSettersMarkExplicitSchedulingBookingEvent(t *testing.T) { - t.Run("SetObject_MarksExplicit", func(t *testing.T) { + t.Run("SetDelegates_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingBookingEvent{} - var fernTestValueObject SchedulingBookingEventObject + obj := &SchedulingHolidayCalendar{} + var fernTestValueDelegates []string // Act - obj.SetObject(fernTestValueObject) + obj.SetDelegates(fernTestValueDelegates) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -84793,14 +95736,14 @@ func TestSettersMarkExplicitSchedulingBookingEvent(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetID_MarksExplicit", func(t *testing.T) { + t.Run("SetExistingBookings_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingBookingEvent{} - var fernTestValueID string + obj := &SchedulingHolidayCalendar{} + var fernTestValueExistingBookings SchedulingHolidayCalendarExistingBookings // Act - obj.SetID(fernTestValueID) + obj.SetExistingBookings(fernTestValueExistingBookings) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -84824,14 +95767,14 @@ func TestSettersMarkExplicitSchedulingBookingEvent(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetSequence_MarksExplicit", func(t *testing.T) { + t.Run("SetLastReadAt_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingBookingEvent{} - var fernTestValueSequence float64 + obj := &SchedulingHolidayCalendar{} + var fernTestValueLastReadAt *string // Act - obj.SetSequence(fernTestValueSequence) + obj.SetLastReadAt(fernTestValueLastReadAt) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -84855,14 +95798,14 @@ func TestSettersMarkExplicitSchedulingBookingEvent(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetType_MarksExplicit", func(t *testing.T) { + t.Run("SetLastError_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingBookingEvent{} - var fernTestValueType string + obj := &SchedulingHolidayCalendar{} + var fernTestValueLastError *string // Act - obj.SetType(fernTestValueType) + obj.SetLastError(fernTestValueLastError) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -84886,14 +95829,14 @@ func TestSettersMarkExplicitSchedulingBookingEvent(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetActor_MarksExplicit", func(t *testing.T) { + t.Run("SetCreatedAt_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingBookingEvent{} - var fernTestValueActor *SchedulingBookingEventActor + obj := &SchedulingHolidayCalendar{} + var fernTestValueCreatedAt string // Act - obj.SetActor(fernTestValueActor) + obj.SetCreatedAt(fernTestValueCreatedAt) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -84917,14 +95860,14 @@ func TestSettersMarkExplicitSchedulingBookingEvent(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetDetails_MarksExplicit", func(t *testing.T) { + t.Run("SetUpdatedAt_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingBookingEvent{} - var fernTestValueDetails map[string]any + obj := &SchedulingHolidayCalendar{} + var fernTestValueUpdatedAt string // Act - obj.SetDetails(fernTestValueDetails) + obj.SetUpdatedAt(fernTestValueUpdatedAt) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -84948,126 +95891,185 @@ func TestSettersMarkExplicitSchedulingBookingEvent(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetOccurredAt_MarksExplicit", func(t *testing.T) { +} + +func TestGettersSchedulingHolidayCalendarHostFilterValue(t *testing.T) { + t.Run("GetString", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingBookingEvent{} - var fernTestValueOccurredAt string + obj := &SchedulingHolidayCalendarHostFilterValue{} + var expected string + obj.String = expected - // Act - obj.SetOccurredAt(fernTestValueOccurredAt) + // Act & Assert + assert.Equal(t, expected, obj.GetString(), "getter should return the property value") + }) - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") + t.Run("GetString_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingHolidayCalendarHostFilterValue + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetString() // Should return zero value + }) - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } + t.Run("GetStringList", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingHolidayCalendarHostFilterValue{} + var expected []string + obj.StringList = expected - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip + // Act & Assert + assert.Equal(t, expected, obj.GetStringList(), "getter should return the property value") + }) + + t.Run("GetStringList_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingHolidayCalendarHostFilterValue{} + obj.StringList = nil + + // Act & Assert + assert.Nil(t, obj.GetStringList(), "getter should return nil when property is nil") + }) + + t.Run("GetStringList_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingHolidayCalendarHostFilterValue + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetStringList() // Should return zero value }) } -func TestSettersSchedulingBookingEventActor(t *testing.T) { - t.Run("SetKind", func(t *testing.T) { - obj := &SchedulingBookingEventActor{} - var fernTestValueKind SchedulingBookingEventActorKind - obj.SetKind(fernTestValueKind) - assert.Equal(t, fernTestValueKind, obj.Kind) +func TestSettersSchedulingHolidayCalendarList(t *testing.T) { + t.Run("SetObject", func(t *testing.T) { + obj := &SchedulingHolidayCalendarList{} + var fernTestValueObject SchedulingHolidayCalendarListObject + obj.SetObject(fernTestValueObject) + assert.Equal(t, fernTestValueObject, obj.Object) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetID", func(t *testing.T) { - obj := &SchedulingBookingEventActor{} - var fernTestValueID *string - obj.SetID(fernTestValueID) - assert.Equal(t, fernTestValueID, obj.ID) + t.Run("SetData", func(t *testing.T) { + obj := &SchedulingHolidayCalendarList{} + var fernTestValueData []*SchedulingHolidayCalendar + obj.SetData(fernTestValueData) + assert.Equal(t, fernTestValueData, obj.Data) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetHasMore", func(t *testing.T) { + obj := &SchedulingHolidayCalendarList{} + var fernTestValueHasMore bool + obj.SetHasMore(fernTestValueHasMore) + assert.Equal(t, fernTestValueHasMore, obj.HasMore) assert.NotNil(t, obj.explicitFields) }) } -func TestGettersSchedulingBookingEventActor(t *testing.T) { - t.Run("GetKind", func(t *testing.T) { +func TestGettersSchedulingHolidayCalendarList(t *testing.T) { + t.Run("GetObject", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingBookingEventActor{} - var expected SchedulingBookingEventActorKind - obj.Kind = expected + obj := &SchedulingHolidayCalendarList{} + var expected SchedulingHolidayCalendarListObject + obj.Object = expected // Act & Assert - assert.Equal(t, expected, obj.GetKind(), "getter should return the property value") + assert.Equal(t, expected, obj.GetObject(), "getter should return the property value") }) - t.Run("GetKind_NilReceiver", func(t *testing.T) { + t.Run("GetObject_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *SchedulingBookingEventActor + var obj *SchedulingHolidayCalendarList // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetKind() // Should return zero value + _ = obj.GetObject() // Should return zero value }) - t.Run("GetID", func(t *testing.T) { + t.Run("GetData", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingBookingEventActor{} - var expected *string - obj.ID = expected + obj := &SchedulingHolidayCalendarList{} + var expected []*SchedulingHolidayCalendar + obj.Data = expected // Act & Assert - assert.Equal(t, expected, obj.GetID(), "getter should return the property value") + assert.Equal(t, expected, obj.GetData(), "getter should return the property value") }) - t.Run("GetID_NilValue", func(t *testing.T) { + t.Run("GetData_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingHolidayCalendarList{} + obj.Data = nil + + // Act & Assert + assert.Nil(t, obj.GetData(), "getter should return nil when property is nil") + }) + + t.Run("GetData_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingHolidayCalendarList + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetData() // Should return zero value + }) + + t.Run("GetHasMore", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingBookingEventActor{} - obj.ID = nil + obj := &SchedulingHolidayCalendarList{} + var expected bool + obj.HasMore = expected // Act & Assert - assert.Nil(t, obj.GetID(), "getter should return nil when property is nil") + assert.Equal(t, expected, obj.GetHasMore(), "getter should return the property value") }) - t.Run("GetID_NilReceiver", func(t *testing.T) { + t.Run("GetHasMore_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *SchedulingBookingEventActor + var obj *SchedulingHolidayCalendarList // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetID() // Should return zero value + _ = obj.GetHasMore() // Should return zero value }) } -func TestSettersMarkExplicitSchedulingBookingEventActor(t *testing.T) { - t.Run("SetKind_MarksExplicit", func(t *testing.T) { +func TestSettersMarkExplicitSchedulingHolidayCalendarList(t *testing.T) { + t.Run("SetObject_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingBookingEventActor{} - var fernTestValueKind SchedulingBookingEventActorKind + obj := &SchedulingHolidayCalendarList{} + var fernTestValueObject SchedulingHolidayCalendarListObject // Act - obj.SetKind(fernTestValueKind) + obj.SetObject(fernTestValueObject) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -85091,14 +96093,45 @@ func TestSettersMarkExplicitSchedulingBookingEventActor(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetID_MarksExplicit", func(t *testing.T) { + t.Run("SetData_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingBookingEventActor{} - var fernTestValueID *string + obj := &SchedulingHolidayCalendarList{} + var fernTestValueData []*SchedulingHolidayCalendar // Act - obj.SetID(fernTestValueID) + obj.SetData(fernTestValueData) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetHasMore_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingHolidayCalendarList{} + var fernTestValueHasMore bool + + // Act + obj.SetHasMore(fernTestValueHasMore) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -85124,25 +96157,25 @@ func TestSettersMarkExplicitSchedulingBookingEventActor(t *testing.T) { } -func TestSettersSchedulingBookingEventList(t *testing.T) { +func TestSettersSchedulingHolidayList(t *testing.T) { t.Run("SetObject", func(t *testing.T) { - obj := &SchedulingBookingEventList{} - var fernTestValueObject SchedulingBookingEventListObject + obj := &SchedulingHolidayList{} + var fernTestValueObject SchedulingHolidayListObject obj.SetObject(fernTestValueObject) assert.Equal(t, fernTestValueObject, obj.Object) assert.NotNil(t, obj.explicitFields) }) t.Run("SetData", func(t *testing.T) { - obj := &SchedulingBookingEventList{} - var fernTestValueData []*SchedulingBookingEvent + obj := &SchedulingHolidayList{} + var fernTestValueData []*SchedulingHolidayListDataItem obj.SetData(fernTestValueData) assert.Equal(t, fernTestValueData, obj.Data) assert.NotNil(t, obj.explicitFields) }) t.Run("SetHasMore", func(t *testing.T) { - obj := &SchedulingBookingEventList{} + obj := &SchedulingHolidayList{} var fernTestValueHasMore bool obj.SetHasMore(fernTestValueHasMore) assert.Equal(t, fernTestValueHasMore, obj.HasMore) @@ -85151,12 +96184,12 @@ func TestSettersSchedulingBookingEventList(t *testing.T) { } -func TestGettersSchedulingBookingEventList(t *testing.T) { +func TestGettersSchedulingHolidayList(t *testing.T) { t.Run("GetObject", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingBookingEventList{} - var expected SchedulingBookingEventListObject + obj := &SchedulingHolidayList{} + var expected SchedulingHolidayListObject obj.Object = expected // Act & Assert @@ -85165,7 +96198,7 @@ func TestGettersSchedulingBookingEventList(t *testing.T) { t.Run("GetObject_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *SchedulingBookingEventList + var obj *SchedulingHolidayList // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -85178,8 +96211,8 @@ func TestGettersSchedulingBookingEventList(t *testing.T) { t.Run("GetData", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingBookingEventList{} - var expected []*SchedulingBookingEvent + obj := &SchedulingHolidayList{} + var expected []*SchedulingHolidayListDataItem obj.Data = expected // Act & Assert @@ -85189,7 +96222,7 @@ func TestGettersSchedulingBookingEventList(t *testing.T) { t.Run("GetData_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingBookingEventList{} + obj := &SchedulingHolidayList{} obj.Data = nil // Act & Assert @@ -85198,7 +96231,7 @@ func TestGettersSchedulingBookingEventList(t *testing.T) { t.Run("GetData_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *SchedulingBookingEventList + var obj *SchedulingHolidayList // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -85211,7 +96244,7 @@ func TestGettersSchedulingBookingEventList(t *testing.T) { t.Run("GetHasMore", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingBookingEventList{} + obj := &SchedulingHolidayList{} var expected bool obj.HasMore = expected @@ -85221,7 +96254,7 @@ func TestGettersSchedulingBookingEventList(t *testing.T) { t.Run("GetHasMore_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *SchedulingBookingEventList + var obj *SchedulingHolidayList // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -85233,12 +96266,12 @@ func TestGettersSchedulingBookingEventList(t *testing.T) { } -func TestSettersMarkExplicitSchedulingBookingEventList(t *testing.T) { +func TestSettersMarkExplicitSchedulingHolidayList(t *testing.T) { t.Run("SetObject_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingBookingEventList{} - var fernTestValueObject SchedulingBookingEventListObject + obj := &SchedulingHolidayList{} + var fernTestValueObject SchedulingHolidayListObject // Act obj.SetObject(fernTestValueObject) @@ -85268,8 +96301,8 @@ func TestSettersMarkExplicitSchedulingBookingEventList(t *testing.T) { t.Run("SetData_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingBookingEventList{} - var fernTestValueData []*SchedulingBookingEvent + obj := &SchedulingHolidayList{} + var fernTestValueData []*SchedulingHolidayListDataItem // Act obj.SetData(fernTestValueData) @@ -85299,7 +96332,7 @@ func TestSettersMarkExplicitSchedulingBookingEventList(t *testing.T) { t.Run("SetHasMore_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingBookingEventList{} + obj := &SchedulingHolidayList{} var fernTestValueHasMore bool // Act @@ -85329,124 +96362,124 @@ func TestSettersMarkExplicitSchedulingBookingEventList(t *testing.T) { } -func TestSettersSchedulingBookingList(t *testing.T) { - t.Run("SetObject", func(t *testing.T) { - obj := &SchedulingBookingList{} - var fernTestValueObject SchedulingBookingListObject - obj.SetObject(fernTestValueObject) - assert.Equal(t, fernTestValueObject, obj.Object) +func TestSettersSchedulingHolidayListDataItem(t *testing.T) { + t.Run("SetDate", func(t *testing.T) { + obj := &SchedulingHolidayListDataItem{} + var fernTestValueDate string + obj.SetDate(fernTestValueDate) + assert.Equal(t, fernTestValueDate, obj.Date) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetData", func(t *testing.T) { - obj := &SchedulingBookingList{} - var fernTestValueData []*SchedulingBooking - obj.SetData(fernTestValueData) - assert.Equal(t, fernTestValueData, obj.Data) + t.Run("SetName", func(t *testing.T) { + obj := &SchedulingHolidayListDataItem{} + var fernTestValueName string + obj.SetName(fernTestValueName) + assert.Equal(t, fernTestValueName, obj.Name) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetHasMore", func(t *testing.T) { - obj := &SchedulingBookingList{} - var fernTestValueHasMore bool - obj.SetHasMore(fernTestValueHasMore) - assert.Equal(t, fernTestValueHasMore, obj.HasMore) + t.Run("SetRegion", func(t *testing.T) { + obj := &SchedulingHolidayListDataItem{} + var fernTestValueRegion *string + obj.SetRegion(fernTestValueRegion) + assert.Equal(t, fernTestValueRegion, obj.Region) assert.NotNil(t, obj.explicitFields) }) } -func TestGettersSchedulingBookingList(t *testing.T) { - t.Run("GetObject", func(t *testing.T) { +func TestGettersSchedulingHolidayListDataItem(t *testing.T) { + t.Run("GetDate", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingBookingList{} - var expected SchedulingBookingListObject - obj.Object = expected + obj := &SchedulingHolidayListDataItem{} + var expected string + obj.Date = expected // Act & Assert - assert.Equal(t, expected, obj.GetObject(), "getter should return the property value") + assert.Equal(t, expected, obj.GetDate(), "getter should return the property value") }) - t.Run("GetObject_NilReceiver", func(t *testing.T) { + t.Run("GetDate_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *SchedulingBookingList + var obj *SchedulingHolidayListDataItem // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetObject() // Should return zero value - }) - - t.Run("GetData", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &SchedulingBookingList{} - var expected []*SchedulingBooking - obj.Data = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetData(), "getter should return the property value") + _ = obj.GetDate() // Should return zero value }) - t.Run("GetData_NilValue", func(t *testing.T) { + t.Run("GetName", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingBookingList{} - obj.Data = nil + obj := &SchedulingHolidayListDataItem{} + var expected string + obj.Name = expected // Act & Assert - assert.Nil(t, obj.GetData(), "getter should return nil when property is nil") + assert.Equal(t, expected, obj.GetName(), "getter should return the property value") }) - t.Run("GetData_NilReceiver", func(t *testing.T) { + t.Run("GetName_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *SchedulingBookingList + var obj *SchedulingHolidayListDataItem // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetData() // Should return zero value + _ = obj.GetName() // Should return zero value }) - t.Run("GetHasMore", func(t *testing.T) { + t.Run("GetRegion", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingBookingList{} - var expected bool - obj.HasMore = expected + obj := &SchedulingHolidayListDataItem{} + var expected *string + obj.Region = expected // Act & Assert - assert.Equal(t, expected, obj.GetHasMore(), "getter should return the property value") + assert.Equal(t, expected, obj.GetRegion(), "getter should return the property value") }) - t.Run("GetHasMore_NilReceiver", func(t *testing.T) { + t.Run("GetRegion_NilValue", func(t *testing.T) { t.Parallel() - var obj *SchedulingBookingList + // Arrange + obj := &SchedulingHolidayListDataItem{} + obj.Region = nil + + // Act & Assert + assert.Nil(t, obj.GetRegion(), "getter should return nil when property is nil") + }) + + t.Run("GetRegion_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingHolidayListDataItem // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetHasMore() // Should return zero value + _ = obj.GetRegion() // Should return zero value }) } -func TestSettersMarkExplicitSchedulingBookingList(t *testing.T) { - t.Run("SetObject_MarksExplicit", func(t *testing.T) { +func TestSettersMarkExplicitSchedulingHolidayListDataItem(t *testing.T) { + t.Run("SetDate_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingBookingList{} - var fernTestValueObject SchedulingBookingListObject + obj := &SchedulingHolidayListDataItem{} + var fernTestValueDate string // Act - obj.SetObject(fernTestValueObject) + obj.SetDate(fernTestValueDate) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -85470,14 +96503,14 @@ func TestSettersMarkExplicitSchedulingBookingList(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetData_MarksExplicit", func(t *testing.T) { + t.Run("SetName_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingBookingList{} - var fernTestValueData []*SchedulingBooking + obj := &SchedulingHolidayListDataItem{} + var fernTestValueName string // Act - obj.SetData(fernTestValueData) + obj.SetName(fernTestValueName) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -85501,14 +96534,14 @@ func TestSettersMarkExplicitSchedulingBookingList(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetHasMore_MarksExplicit", func(t *testing.T) { + t.Run("SetRegion_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingBookingList{} - var fernTestValueHasMore bool + obj := &SchedulingHolidayListDataItem{} + var fernTestValueRegion *string // Act - obj.SetHasMore(fernTestValueHasMore) + obj.SetRegion(fernTestValueRegion) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -85534,87 +96567,135 @@ func TestSettersMarkExplicitSchedulingBookingList(t *testing.T) { } -func TestSettersSchedulingBookingNotification(t *testing.T) { +func TestSettersSchedulingHost(t *testing.T) { t.Run("SetObject", func(t *testing.T) { - obj := &SchedulingBookingNotification{} - var fernTestValueObject SchedulingBookingNotificationObject + obj := &SchedulingHost{} + var fernTestValueObject SchedulingHostObject obj.SetObject(fernTestValueObject) assert.Equal(t, fernTestValueObject, obj.Object) assert.NotNil(t, obj.explicitFields) }) t.Run("SetID", func(t *testing.T) { - obj := &SchedulingBookingNotification{} + obj := &SchedulingHost{} var fernTestValueID string obj.SetID(fernTestValueID) assert.Equal(t, fernTestValueID, obj.ID) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetKind", func(t *testing.T) { - obj := &SchedulingBookingNotification{} - var fernTestValueKind string - obj.SetKind(fernTestValueKind) - assert.Equal(t, fernTestValueKind, obj.Kind) + t.Run("SetUID", func(t *testing.T) { + obj := &SchedulingHost{} + var fernTestValueUID *string + obj.SetUID(fernTestValueUID) + assert.Equal(t, fernTestValueUID, obj.UID) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetReminderKey", func(t *testing.T) { - obj := &SchedulingBookingNotification{} - var fernTestValueReminderKey *string - obj.SetReminderKey(fernTestValueReminderKey) - assert.Equal(t, fernTestValueReminderKey, obj.ReminderKey) + t.Run("SetName", func(t *testing.T) { + obj := &SchedulingHost{} + var fernTestValueName string + obj.SetName(fernTestValueName) + assert.Equal(t, fernTestValueName, obj.Name) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetChannel", func(t *testing.T) { - obj := &SchedulingBookingNotification{} - var fernTestValueChannel SchedulingBookingNotificationChannel - obj.SetChannel(fernTestValueChannel) - assert.Equal(t, fernTestValueChannel, obj.Channel) + t.Run("SetEmail", func(t *testing.T) { + obj := &SchedulingHost{} + var fernTestValueEmail *string + obj.SetEmail(fernTestValueEmail) + assert.Equal(t, fernTestValueEmail, obj.Email) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetRecipient", func(t *testing.T) { - obj := &SchedulingBookingNotification{} - var fernTestValueRecipient SchedulingBookingNotificationRecipient - obj.SetRecipient(fernTestValueRecipient) - assert.Equal(t, fernTestValueRecipient, obj.Recipient) + t.Run("SetPhone", func(t *testing.T) { + obj := &SchedulingHost{} + var fernTestValuePhone *string + obj.SetPhone(fernTestValuePhone) + assert.Equal(t, fernTestValuePhone, obj.Phone) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetDueAt", func(t *testing.T) { - obj := &SchedulingBookingNotification{} - var fernTestValueDueAt string - obj.SetDueAt(fernTestValueDueAt) - assert.Equal(t, fernTestValueDueAt, obj.DueAt) + t.Run("SetCalendarAccount", func(t *testing.T) { + obj := &SchedulingHost{} + var fernTestValueCalendarAccount *string + obj.SetCalendarAccount(fernTestValueCalendarAccount) + assert.Equal(t, fernTestValueCalendarAccount, obj.CalendarAccount) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetFinishedAt", func(t *testing.T) { - obj := &SchedulingBookingNotification{} - var fernTestValueFinishedAt *string - obj.SetFinishedAt(fernTestValueFinishedAt) - assert.Equal(t, fernTestValueFinishedAt, obj.FinishedAt) + t.Run("SetTimeZone", func(t *testing.T) { + obj := &SchedulingHost{} + var fernTestValueTimeZone string + obj.SetTimeZone(fernTestValueTimeZone) + assert.Equal(t, fernTestValueTimeZone, obj.TimeZone) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetOutcome", func(t *testing.T) { - obj := &SchedulingBookingNotification{} - var fernTestValueOutcome *string - obj.SetOutcome(fernTestValueOutcome) - assert.Equal(t, fernTestValueOutcome, obj.Outcome) + t.Run("SetLocale", func(t *testing.T) { + obj := &SchedulingHost{} + var fernTestValueLocale *string + obj.SetLocale(fernTestValueLocale) + assert.Equal(t, fernTestValueLocale, obj.Locale) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetAttributes", func(t *testing.T) { + obj := &SchedulingHost{} + var fernTestValueAttributes map[string]*SchedulingHostAttributesValue + obj.SetAttributes(fernTestValueAttributes) + assert.Equal(t, fernTestValueAttributes, obj.Attributes) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetLocations", func(t *testing.T) { + obj := &SchedulingHost{} + var fernTestValueLocations []*SchedulingHostLocation + obj.SetLocations(fernTestValueLocations) + assert.Equal(t, fernTestValueLocations, obj.Locations) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetMetadata", func(t *testing.T) { + obj := &SchedulingHost{} + var fernTestValueMetadata map[string]string + obj.SetMetadata(fernTestValueMetadata) + assert.Equal(t, fernTestValueMetadata, obj.Metadata) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetStatus", func(t *testing.T) { + obj := &SchedulingHost{} + var fernTestValueStatus SchedulingHostStatus + obj.SetStatus(fernTestValueStatus) + assert.Equal(t, fernTestValueStatus, obj.Status) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetCreatedAt", func(t *testing.T) { + obj := &SchedulingHost{} + var fernTestValueCreatedAt string + obj.SetCreatedAt(fernTestValueCreatedAt) + assert.Equal(t, fernTestValueCreatedAt, obj.CreatedAt) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetUpdatedAt", func(t *testing.T) { + obj := &SchedulingHost{} + var fernTestValueUpdatedAt string + obj.SetUpdatedAt(fernTestValueUpdatedAt) + assert.Equal(t, fernTestValueUpdatedAt, obj.UpdatedAt) assert.NotNil(t, obj.explicitFields) }) } -func TestGettersSchedulingBookingNotification(t *testing.T) { +func TestGettersSchedulingHost(t *testing.T) { t.Run("GetObject", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingBookingNotification{} - var expected SchedulingBookingNotificationObject + obj := &SchedulingHost{} + var expected SchedulingHostObject obj.Object = expected // Act & Assert @@ -85623,7 +96704,7 @@ func TestGettersSchedulingBookingNotification(t *testing.T) { t.Run("GetObject_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *SchedulingBookingNotification + var obj *SchedulingHost // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -85636,7 +96717,7 @@ func TestGettersSchedulingBookingNotification(t *testing.T) { t.Run("GetID", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingBookingNotification{} + obj := &SchedulingHost{} var expected string obj.ID = expected @@ -85646,7 +96727,7 @@ func TestGettersSchedulingBookingNotification(t *testing.T) { t.Run("GetID_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *SchedulingBookingNotification + var obj *SchedulingHost // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -85656,205 +96737,393 @@ func TestGettersSchedulingBookingNotification(t *testing.T) { _ = obj.GetID() // Should return zero value }) - t.Run("GetKind", func(t *testing.T) { + t.Run("GetUID", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingBookingNotification{} + obj := &SchedulingHost{} + var expected *string + obj.UID = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetUID(), "getter should return the property value") + }) + + t.Run("GetUID_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingHost{} + obj.UID = nil + + // Act & Assert + assert.Nil(t, obj.GetUID(), "getter should return nil when property is nil") + }) + + t.Run("GetUID_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingHost + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetUID() // Should return zero value + }) + + t.Run("GetName", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingHost{} var expected string - obj.Kind = expected + obj.Name = expected // Act & Assert - assert.Equal(t, expected, obj.GetKind(), "getter should return the property value") + assert.Equal(t, expected, obj.GetName(), "getter should return the property value") }) - t.Run("GetKind_NilReceiver", func(t *testing.T) { + t.Run("GetName_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *SchedulingBookingNotification + var obj *SchedulingHost // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetKind() // Should return zero value + _ = obj.GetName() // Should return zero value }) - t.Run("GetReminderKey", func(t *testing.T) { + t.Run("GetEmail", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingBookingNotification{} + obj := &SchedulingHost{} var expected *string - obj.ReminderKey = expected + obj.Email = expected // Act & Assert - assert.Equal(t, expected, obj.GetReminderKey(), "getter should return the property value") + assert.Equal(t, expected, obj.GetEmail(), "getter should return the property value") }) - t.Run("GetReminderKey_NilValue", func(t *testing.T) { + t.Run("GetEmail_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingBookingNotification{} - obj.ReminderKey = nil + obj := &SchedulingHost{} + obj.Email = nil // Act & Assert - assert.Nil(t, obj.GetReminderKey(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetEmail(), "getter should return nil when property is nil") }) - t.Run("GetReminderKey_NilReceiver", func(t *testing.T) { + t.Run("GetEmail_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *SchedulingBookingNotification + var obj *SchedulingHost // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetReminderKey() // Should return zero value + _ = obj.GetEmail() // Should return zero value }) - t.Run("GetChannel", func(t *testing.T) { + t.Run("GetPhone", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingBookingNotification{} - var expected SchedulingBookingNotificationChannel - obj.Channel = expected + obj := &SchedulingHost{} + var expected *string + obj.Phone = expected // Act & Assert - assert.Equal(t, expected, obj.GetChannel(), "getter should return the property value") + assert.Equal(t, expected, obj.GetPhone(), "getter should return the property value") }) - t.Run("GetChannel_NilReceiver", func(t *testing.T) { + t.Run("GetPhone_NilValue", func(t *testing.T) { t.Parallel() - var obj *SchedulingBookingNotification + // Arrange + obj := &SchedulingHost{} + obj.Phone = nil + + // Act & Assert + assert.Nil(t, obj.GetPhone(), "getter should return nil when property is nil") + }) + + t.Run("GetPhone_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingHost // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetChannel() // Should return zero value + _ = obj.GetPhone() // Should return zero value }) - t.Run("GetRecipient", func(t *testing.T) { + t.Run("GetCalendarAccount", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingBookingNotification{} - var expected SchedulingBookingNotificationRecipient - obj.Recipient = expected + obj := &SchedulingHost{} + var expected *string + obj.CalendarAccount = expected // Act & Assert - assert.Equal(t, expected, obj.GetRecipient(), "getter should return the property value") + assert.Equal(t, expected, obj.GetCalendarAccount(), "getter should return the property value") }) - t.Run("GetRecipient_NilReceiver", func(t *testing.T) { + t.Run("GetCalendarAccount_NilValue", func(t *testing.T) { t.Parallel() - var obj *SchedulingBookingNotification + // Arrange + obj := &SchedulingHost{} + obj.CalendarAccount = nil + + // Act & Assert + assert.Nil(t, obj.GetCalendarAccount(), "getter should return nil when property is nil") + }) + + t.Run("GetCalendarAccount_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingHost // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetRecipient() // Should return zero value + _ = obj.GetCalendarAccount() // Should return zero value }) - t.Run("GetDueAt", func(t *testing.T) { + t.Run("GetTimeZone", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingBookingNotification{} + obj := &SchedulingHost{} var expected string - obj.DueAt = expected + obj.TimeZone = expected // Act & Assert - assert.Equal(t, expected, obj.GetDueAt(), "getter should return the property value") + assert.Equal(t, expected, obj.GetTimeZone(), "getter should return the property value") }) - t.Run("GetDueAt_NilReceiver", func(t *testing.T) { + t.Run("GetTimeZone_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *SchedulingBookingNotification + var obj *SchedulingHost // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetDueAt() // Should return zero value + _ = obj.GetTimeZone() // Should return zero value }) - t.Run("GetFinishedAt", func(t *testing.T) { + t.Run("GetLocale", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingBookingNotification{} + obj := &SchedulingHost{} var expected *string - obj.FinishedAt = expected + obj.Locale = expected // Act & Assert - assert.Equal(t, expected, obj.GetFinishedAt(), "getter should return the property value") + assert.Equal(t, expected, obj.GetLocale(), "getter should return the property value") }) - t.Run("GetFinishedAt_NilValue", func(t *testing.T) { + t.Run("GetLocale_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingBookingNotification{} - obj.FinishedAt = nil + obj := &SchedulingHost{} + obj.Locale = nil // Act & Assert - assert.Nil(t, obj.GetFinishedAt(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetLocale(), "getter should return nil when property is nil") }) - t.Run("GetFinishedAt_NilReceiver", func(t *testing.T) { + t.Run("GetLocale_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *SchedulingBookingNotification + var obj *SchedulingHost // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetFinishedAt() // Should return zero value + _ = obj.GetLocale() // Should return zero value }) - t.Run("GetOutcome", func(t *testing.T) { + t.Run("GetAttributes", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingBookingNotification{} - var expected *string - obj.Outcome = expected + obj := &SchedulingHost{} + var expected map[string]*SchedulingHostAttributesValue + obj.Attributes = expected // Act & Assert - assert.Equal(t, expected, obj.GetOutcome(), "getter should return the property value") + assert.Equal(t, expected, obj.GetAttributes(), "getter should return the property value") }) - t.Run("GetOutcome_NilValue", func(t *testing.T) { + t.Run("GetAttributes_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingBookingNotification{} - obj.Outcome = nil + obj := &SchedulingHost{} + obj.Attributes = nil // Act & Assert - assert.Nil(t, obj.GetOutcome(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetAttributes(), "getter should return nil when property is nil") }) - t.Run("GetOutcome_NilReceiver", func(t *testing.T) { + t.Run("GetAttributes_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *SchedulingBookingNotification + var obj *SchedulingHost // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetOutcome() // Should return zero value + _ = obj.GetAttributes() // Should return zero value + }) + + t.Run("GetLocations", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingHost{} + var expected []*SchedulingHostLocation + obj.Locations = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetLocations(), "getter should return the property value") + }) + + t.Run("GetLocations_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingHost{} + obj.Locations = nil + + // Act & Assert + assert.Nil(t, obj.GetLocations(), "getter should return nil when property is nil") + }) + + t.Run("GetLocations_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingHost + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetLocations() // Should return zero value + }) + + t.Run("GetMetadata", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingHost{} + var expected map[string]string + obj.Metadata = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetMetadata(), "getter should return the property value") + }) + + t.Run("GetMetadata_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingHost{} + obj.Metadata = nil + + // Act & Assert + assert.Nil(t, obj.GetMetadata(), "getter should return nil when property is nil") + }) + + t.Run("GetMetadata_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingHost + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetMetadata() // Should return zero value + }) + + t.Run("GetStatus", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingHost{} + var expected SchedulingHostStatus + obj.Status = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetStatus(), "getter should return the property value") + }) + + t.Run("GetStatus_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingHost + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetStatus() // Should return zero value + }) + + t.Run("GetCreatedAt", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingHost{} + var expected string + obj.CreatedAt = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetCreatedAt(), "getter should return the property value") + }) + + t.Run("GetCreatedAt_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingHost + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetCreatedAt() // Should return zero value + }) + + t.Run("GetUpdatedAt", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingHost{} + var expected string + obj.UpdatedAt = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetUpdatedAt(), "getter should return the property value") + }) + + t.Run("GetUpdatedAt_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingHost + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetUpdatedAt() // Should return zero value }) } -func TestSettersMarkExplicitSchedulingBookingNotification(t *testing.T) { +func TestSettersMarkExplicitSchedulingHost(t *testing.T) { t.Run("SetObject_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingBookingNotification{} - var fernTestValueObject SchedulingBookingNotificationObject + obj := &SchedulingHost{} + var fernTestValueObject SchedulingHostObject // Act obj.SetObject(fernTestValueObject) @@ -85884,7 +97153,7 @@ func TestSettersMarkExplicitSchedulingBookingNotification(t *testing.T) { t.Run("SetID_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingBookingNotification{} + obj := &SchedulingHost{} var fernTestValueID string // Act @@ -85912,14 +97181,14 @@ func TestSettersMarkExplicitSchedulingBookingNotification(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetKind_MarksExplicit", func(t *testing.T) { + t.Run("SetUID_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingBookingNotification{} - var fernTestValueKind string + obj := &SchedulingHost{} + var fernTestValueUID *string // Act - obj.SetKind(fernTestValueKind) + obj.SetUID(fernTestValueUID) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -85943,14 +97212,14 @@ func TestSettersMarkExplicitSchedulingBookingNotification(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetReminderKey_MarksExplicit", func(t *testing.T) { + t.Run("SetName_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingBookingNotification{} - var fernTestValueReminderKey *string + obj := &SchedulingHost{} + var fernTestValueName string // Act - obj.SetReminderKey(fernTestValueReminderKey) + obj.SetName(fernTestValueName) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -85974,14 +97243,14 @@ func TestSettersMarkExplicitSchedulingBookingNotification(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetChannel_MarksExplicit", func(t *testing.T) { + t.Run("SetEmail_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingBookingNotification{} - var fernTestValueChannel SchedulingBookingNotificationChannel + obj := &SchedulingHost{} + var fernTestValueEmail *string // Act - obj.SetChannel(fernTestValueChannel) + obj.SetEmail(fernTestValueEmail) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -86005,14 +97274,14 @@ func TestSettersMarkExplicitSchedulingBookingNotification(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetRecipient_MarksExplicit", func(t *testing.T) { + t.Run("SetPhone_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingBookingNotification{} - var fernTestValueRecipient SchedulingBookingNotificationRecipient + obj := &SchedulingHost{} + var fernTestValuePhone *string // Act - obj.SetRecipient(fernTestValueRecipient) + obj.SetPhone(fernTestValuePhone) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -86036,14 +97305,14 @@ func TestSettersMarkExplicitSchedulingBookingNotification(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetDueAt_MarksExplicit", func(t *testing.T) { + t.Run("SetCalendarAccount_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingBookingNotification{} - var fernTestValueDueAt string + obj := &SchedulingHost{} + var fernTestValueCalendarAccount *string // Act - obj.SetDueAt(fernTestValueDueAt) + obj.SetCalendarAccount(fernTestValueCalendarAccount) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -86067,14 +97336,14 @@ func TestSettersMarkExplicitSchedulingBookingNotification(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetFinishedAt_MarksExplicit", func(t *testing.T) { + t.Run("SetTimeZone_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingBookingNotification{} - var fernTestValueFinishedAt *string + obj := &SchedulingHost{} + var fernTestValueTimeZone string // Act - obj.SetFinishedAt(fernTestValueFinishedAt) + obj.SetTimeZone(fernTestValueTimeZone) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -86098,14 +97367,14 @@ func TestSettersMarkExplicitSchedulingBookingNotification(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetOutcome_MarksExplicit", func(t *testing.T) { + t.Run("SetLocale_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingBookingNotification{} - var fernTestValueOutcome *string + obj := &SchedulingHost{} + var fernTestValueLocale *string // Act - obj.SetOutcome(fernTestValueOutcome) + obj.SetLocale(fernTestValueLocale) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -86129,126 +97398,107 @@ func TestSettersMarkExplicitSchedulingBookingNotification(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) -} + t.Run("SetAttributes_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingHost{} + var fernTestValueAttributes map[string]*SchedulingHostAttributesValue -func TestSettersSchedulingBookingNotificationList(t *testing.T) { - t.Run("SetObject", func(t *testing.T) { - obj := &SchedulingBookingNotificationList{} - var fernTestValueObject SchedulingBookingNotificationListObject - obj.SetObject(fernTestValueObject) - assert.Equal(t, fernTestValueObject, obj.Object) - assert.NotNil(t, obj.explicitFields) - }) + // Act + obj.SetAttributes(fernTestValueAttributes) - t.Run("SetData", func(t *testing.T) { - obj := &SchedulingBookingNotificationList{} - var fernTestValueData []*SchedulingBookingNotification - obj.SetData(fernTestValueData) - assert.Equal(t, fernTestValueData, obj.Data) - assert.NotNil(t, obj.explicitFields) - }) + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") - t.Run("SetHasMore", func(t *testing.T) { - obj := &SchedulingBookingNotificationList{} - var fernTestValueHasMore bool - obj.SetHasMore(fernTestValueHasMore) - assert.Equal(t, fernTestValueHasMore, obj.HasMore) - assert.NotNil(t, obj.explicitFields) - }) + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } -} + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) -func TestGettersSchedulingBookingNotificationList(t *testing.T) { - t.Run("GetObject", func(t *testing.T) { + t.Run("SetLocations_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingBookingNotificationList{} - var expected SchedulingBookingNotificationListObject - obj.Object = expected + obj := &SchedulingHost{} + var fernTestValueLocations []*SchedulingHostLocation - // Act & Assert - assert.Equal(t, expected, obj.GetObject(), "getter should return the property value") - }) + // Act + obj.SetLocations(fernTestValueLocations) - t.Run("GetObject_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *SchedulingBookingNotificationList - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetObject() // Should return zero value - }) + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") - t.Run("GetData", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &SchedulingBookingNotificationList{} - var expected []*SchedulingBookingNotification - obj.Data = expected + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } - // Act & Assert - assert.Equal(t, expected, obj.GetData(), "getter should return the property value") + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("GetData_NilValue", func(t *testing.T) { + t.Run("SetMetadata_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingBookingNotificationList{} - obj.Data = nil - - // Act & Assert - assert.Nil(t, obj.GetData(), "getter should return nil when property is nil") - }) + obj := &SchedulingHost{} + var fernTestValueMetadata map[string]string - t.Run("GetData_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *SchedulingBookingNotificationList - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetData() // Should return zero value - }) + // Act + obj.SetMetadata(fernTestValueMetadata) - t.Run("GetHasMore", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &SchedulingBookingNotificationList{} - var expected bool - obj.HasMore = expected + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") - // Act & Assert - assert.Equal(t, expected, obj.GetHasMore(), "getter should return the property value") - }) + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } - t.Run("GetHasMore_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *SchedulingBookingNotificationList - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetHasMore() // Should return zero value + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip }) -} - -func TestSettersMarkExplicitSchedulingBookingNotificationList(t *testing.T) { - t.Run("SetObject_MarksExplicit", func(t *testing.T) { + t.Run("SetStatus_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingBookingNotificationList{} - var fernTestValueObject SchedulingBookingNotificationListObject + obj := &SchedulingHost{} + var fernTestValueStatus SchedulingHostStatus // Act - obj.SetObject(fernTestValueObject) + obj.SetStatus(fernTestValueStatus) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -86272,14 +97522,14 @@ func TestSettersMarkExplicitSchedulingBookingNotificationList(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetData_MarksExplicit", func(t *testing.T) { + t.Run("SetCreatedAt_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingBookingNotificationList{} - var fernTestValueData []*SchedulingBookingNotification + obj := &SchedulingHost{} + var fernTestValueCreatedAt string // Act - obj.SetData(fernTestValueData) + obj.SetCreatedAt(fernTestValueCreatedAt) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -86303,14 +97553,14 @@ func TestSettersMarkExplicitSchedulingBookingNotificationList(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetHasMore_MarksExplicit", func(t *testing.T) { + t.Run("SetUpdatedAt_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingBookingNotificationList{} - var fernTestValueHasMore bool + obj := &SchedulingHost{} + var fernTestValueUpdatedAt string // Act - obj.SetHasMore(fernTestValueHasMore) + obj.SetUpdatedAt(fernTestValueUpdatedAt) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -86336,152 +97586,183 @@ func TestSettersMarkExplicitSchedulingBookingNotificationList(t *testing.T) { } -func TestGettersSchedulingBookingWindow(t *testing.T) { - t.Run("GetSchedulingBookingWindowDays", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &SchedulingBookingWindow{} - var expected *SchedulingBookingWindowDays - obj.SchedulingBookingWindowDays = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetSchedulingBookingWindowDays(), "getter should return the property value") - }) - - t.Run("GetSchedulingBookingWindowDays_NilValue", func(t *testing.T) { +func TestGettersSchedulingHostAttributesValue(t *testing.T) { + t.Run("GetString", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingBookingWindow{} - obj.SchedulingBookingWindowDays = nil + obj := &SchedulingHostAttributesValue{} + var expected string + obj.String = expected // Act & Assert - assert.Nil(t, obj.GetSchedulingBookingWindowDays(), "getter should return nil when property is nil") + assert.Equal(t, expected, obj.GetString(), "getter should return the property value") }) - t.Run("GetSchedulingBookingWindowDays_NilReceiver", func(t *testing.T) { + t.Run("GetString_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *SchedulingBookingWindow + var obj *SchedulingHostAttributesValue // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetSchedulingBookingWindowDays() // Should return zero value + _ = obj.GetString() // Should return zero value }) - t.Run("GetSchedulingBookingWindowFrom", func(t *testing.T) { + t.Run("GetStringList", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingBookingWindow{} - var expected *SchedulingBookingWindowFrom - obj.SchedulingBookingWindowFrom = expected + obj := &SchedulingHostAttributesValue{} + var expected []string + obj.StringList = expected // Act & Assert - assert.Equal(t, expected, obj.GetSchedulingBookingWindowFrom(), "getter should return the property value") + assert.Equal(t, expected, obj.GetStringList(), "getter should return the property value") }) - t.Run("GetSchedulingBookingWindowFrom_NilValue", func(t *testing.T) { + t.Run("GetStringList_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingBookingWindow{} - obj.SchedulingBookingWindowFrom = nil + obj := &SchedulingHostAttributesValue{} + obj.StringList = nil // Act & Assert - assert.Nil(t, obj.GetSchedulingBookingWindowFrom(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetStringList(), "getter should return nil when property is nil") }) - t.Run("GetSchedulingBookingWindowFrom_NilReceiver", func(t *testing.T) { + t.Run("GetStringList_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *SchedulingBookingWindow + var obj *SchedulingHostAttributesValue // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetSchedulingBookingWindowFrom() // Should return zero value + _ = obj.GetStringList() // Should return zero value }) } -func TestSettersSchedulingBookingWindowDays(t *testing.T) { - t.Run("SetKind", func(t *testing.T) { - obj := &SchedulingBookingWindowDays{} - var fernTestValueKind SchedulingBookingWindowDaysKind - obj.SetKind(fernTestValueKind) - assert.Equal(t, fernTestValueKind, obj.Kind) +func TestSettersSchedulingHostList(t *testing.T) { + t.Run("SetObject", func(t *testing.T) { + obj := &SchedulingHostList{} + var fernTestValueObject SchedulingHostListObject + obj.SetObject(fernTestValueObject) + assert.Equal(t, fernTestValueObject, obj.Object) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetDays", func(t *testing.T) { - obj := &SchedulingBookingWindowDays{} - var fernTestValueDays int - obj.SetDays(fernTestValueDays) - assert.Equal(t, fernTestValueDays, obj.Days) + t.Run("SetData", func(t *testing.T) { + obj := &SchedulingHostList{} + var fernTestValueData []*SchedulingHost + obj.SetData(fernTestValueData) + assert.Equal(t, fernTestValueData, obj.Data) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetHasMore", func(t *testing.T) { + obj := &SchedulingHostList{} + var fernTestValueHasMore bool + obj.SetHasMore(fernTestValueHasMore) + assert.Equal(t, fernTestValueHasMore, obj.HasMore) assert.NotNil(t, obj.explicitFields) }) } -func TestGettersSchedulingBookingWindowDays(t *testing.T) { - t.Run("GetKind", func(t *testing.T) { +func TestGettersSchedulingHostList(t *testing.T) { + t.Run("GetObject", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingBookingWindowDays{} - var expected SchedulingBookingWindowDaysKind - obj.Kind = expected + obj := &SchedulingHostList{} + var expected SchedulingHostListObject + obj.Object = expected // Act & Assert - assert.Equal(t, expected, obj.GetKind(), "getter should return the property value") + assert.Equal(t, expected, obj.GetObject(), "getter should return the property value") }) - t.Run("GetKind_NilReceiver", func(t *testing.T) { + t.Run("GetObject_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *SchedulingBookingWindowDays + var obj *SchedulingHostList + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetObject() // Should return zero value + }) + + t.Run("GetData", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingHostList{} + var expected []*SchedulingHost + obj.Data = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetData(), "getter should return the property value") + }) + + t.Run("GetData_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingHostList{} + obj.Data = nil + + // Act & Assert + assert.Nil(t, obj.GetData(), "getter should return nil when property is nil") + }) + + t.Run("GetData_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingHostList // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetKind() // Should return zero value + _ = obj.GetData() // Should return zero value }) - t.Run("GetDays", func(t *testing.T) { + t.Run("GetHasMore", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingBookingWindowDays{} - var expected int - obj.Days = expected + obj := &SchedulingHostList{} + var expected bool + obj.HasMore = expected // Act & Assert - assert.Equal(t, expected, obj.GetDays(), "getter should return the property value") + assert.Equal(t, expected, obj.GetHasMore(), "getter should return the property value") }) - t.Run("GetDays_NilReceiver", func(t *testing.T) { + t.Run("GetHasMore_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *SchedulingBookingWindowDays + var obj *SchedulingHostList // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetDays() // Should return zero value + _ = obj.GetHasMore() // Should return zero value }) } -func TestSettersMarkExplicitSchedulingBookingWindowDays(t *testing.T) { - t.Run("SetKind_MarksExplicit", func(t *testing.T) { +func TestSettersMarkExplicitSchedulingHostList(t *testing.T) { + t.Run("SetObject_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingBookingWindowDays{} - var fernTestValueKind SchedulingBookingWindowDaysKind + obj := &SchedulingHostList{} + var fernTestValueObject SchedulingHostListObject // Act - obj.SetKind(fernTestValueKind) + obj.SetObject(fernTestValueObject) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -86505,14 +97786,45 @@ func TestSettersMarkExplicitSchedulingBookingWindowDays(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetDays_MarksExplicit", func(t *testing.T) { + t.Run("SetData_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingBookingWindowDays{} - var fernTestValueDays int + obj := &SchedulingHostList{} + var fernTestValueData []*SchedulingHost // Act - obj.SetDays(fernTestValueDays) + obj.SetData(fernTestValueData) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetHasMore_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingHostList{} + var fernTestValueHasMore bool + + // Act + obj.SetHasMore(fernTestValueHasMore) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -86538,114 +97850,177 @@ func TestSettersMarkExplicitSchedulingBookingWindowDays(t *testing.T) { } -func TestSettersSchedulingBookingWindowFrom(t *testing.T) { - t.Run("SetKind", func(t *testing.T) { - obj := &SchedulingBookingWindowFrom{} - var fernTestValueKind SchedulingBookingWindowFromKind - obj.SetKind(fernTestValueKind) - assert.Equal(t, fernTestValueKind, obj.Kind) - assert.NotNil(t, obj.explicitFields) +func TestGettersSchedulingHostLocation(t *testing.T) { + t.Run("GetType", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingHostLocation{} + var expected string + obj.Type = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetType(), "getter should return the property value") }) - t.Run("SetFrom", func(t *testing.T) { - obj := &SchedulingBookingWindowFrom{} - var fernTestValueFrom string - obj.SetFrom(fernTestValueFrom) - assert.Equal(t, fernTestValueFrom, obj.From) - assert.NotNil(t, obj.explicitFields) + t.Run("GetType_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingHostLocation + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetType() // Should return zero value }) - t.Run("SetTo", func(t *testing.T) { - obj := &SchedulingBookingWindowFrom{} - var fernTestValueTo string - obj.SetTo(fernTestValueTo) - assert.Equal(t, fernTestValueTo, obj.To) - assert.NotNil(t, obj.explicitFields) + t.Run("GetLink", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingHostLocation{} + var expected *SchedulingHostLocationLink + obj.Link = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetLink(), "getter should return the property value") }) -} + t.Run("GetLink_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingHostLocation{} + obj.Link = nil -func TestGettersSchedulingBookingWindowFrom(t *testing.T) { - t.Run("GetKind", func(t *testing.T) { + // Act & Assert + assert.Nil(t, obj.GetLink(), "getter should return nil when property is nil") + }) + + t.Run("GetLink_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingHostLocation + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetLink() // Should return zero value + }) + + t.Run("GetPhone", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingBookingWindowFrom{} - var expected SchedulingBookingWindowFromKind - obj.Kind = expected + obj := &SchedulingHostLocation{} + var expected *SchedulingHostLocationPhone + obj.Phone = expected // Act & Assert - assert.Equal(t, expected, obj.GetKind(), "getter should return the property value") + assert.Equal(t, expected, obj.GetPhone(), "getter should return the property value") }) - t.Run("GetKind_NilReceiver", func(t *testing.T) { + t.Run("GetPhone_NilValue", func(t *testing.T) { t.Parallel() - var obj *SchedulingBookingWindowFrom + // Arrange + obj := &SchedulingHostLocation{} + obj.Phone = nil + + // Act & Assert + assert.Nil(t, obj.GetPhone(), "getter should return nil when property is nil") + }) + + t.Run("GetPhone_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingHostLocation // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetKind() // Should return zero value + _ = obj.GetPhone() // Should return zero value }) - t.Run("GetFrom", func(t *testing.T) { + t.Run("GetInPerson", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingBookingWindowFrom{} - var expected string - obj.From = expected + obj := &SchedulingHostLocation{} + var expected *SchedulingHostLocationInPerson + obj.InPerson = expected // Act & Assert - assert.Equal(t, expected, obj.GetFrom(), "getter should return the property value") + assert.Equal(t, expected, obj.GetInPerson(), "getter should return the property value") }) - t.Run("GetFrom_NilReceiver", func(t *testing.T) { + t.Run("GetInPerson_NilValue", func(t *testing.T) { t.Parallel() - var obj *SchedulingBookingWindowFrom + // Arrange + obj := &SchedulingHostLocation{} + obj.InPerson = nil + + // Act & Assert + assert.Nil(t, obj.GetInPerson(), "getter should return nil when property is nil") + }) + + t.Run("GetInPerson_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingHostLocation // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetFrom() // Should return zero value + _ = obj.GetInPerson() // Should return zero value }) - t.Run("GetTo", func(t *testing.T) { +} + +func TestSettersSchedulingHostLocationInPerson(t *testing.T) { + t.Run("SetAddress", func(t *testing.T) { + obj := &SchedulingHostLocationInPerson{} + var fernTestValueAddress string + obj.SetAddress(fernTestValueAddress) + assert.Equal(t, fernTestValueAddress, obj.Address) + assert.NotNil(t, obj.explicitFields) + }) + +} + +func TestGettersSchedulingHostLocationInPerson(t *testing.T) { + t.Run("GetAddress", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingBookingWindowFrom{} + obj := &SchedulingHostLocationInPerson{} var expected string - obj.To = expected + obj.Address = expected // Act & Assert - assert.Equal(t, expected, obj.GetTo(), "getter should return the property value") + assert.Equal(t, expected, obj.GetAddress(), "getter should return the property value") }) - t.Run("GetTo_NilReceiver", func(t *testing.T) { + t.Run("GetAddress_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *SchedulingBookingWindowFrom + var obj *SchedulingHostLocationInPerson // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetTo() // Should return zero value + _ = obj.GetAddress() // Should return zero value }) } -func TestSettersMarkExplicitSchedulingBookingWindowFrom(t *testing.T) { - t.Run("SetKind_MarksExplicit", func(t *testing.T) { +func TestSettersMarkExplicitSchedulingHostLocationInPerson(t *testing.T) { + t.Run("SetAddress_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingBookingWindowFrom{} - var fernTestValueKind SchedulingBookingWindowFromKind + obj := &SchedulingHostLocationInPerson{} + var fernTestValueAddress string // Act - obj.SetKind(fernTestValueKind) + obj.SetAddress(fernTestValueAddress) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -86669,14 +98044,54 @@ func TestSettersMarkExplicitSchedulingBookingWindowFrom(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetFrom_MarksExplicit", func(t *testing.T) { +} + +func TestSettersSchedulingHostLocationLink(t *testing.T) { + t.Run("SetURL", func(t *testing.T) { + obj := &SchedulingHostLocationLink{} + var fernTestValueURL string + obj.SetURL(fernTestValueURL) + assert.Equal(t, fernTestValueURL, obj.URL) + assert.NotNil(t, obj.explicitFields) + }) + +} + +func TestGettersSchedulingHostLocationLink(t *testing.T) { + t.Run("GetURL", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingBookingWindowFrom{} - var fernTestValueFrom string + obj := &SchedulingHostLocationLink{} + var expected string + obj.URL = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetURL(), "getter should return the property value") + }) + + t.Run("GetURL_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingHostLocationLink + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetURL() // Should return zero value + }) + +} + +func TestSettersMarkExplicitSchedulingHostLocationLink(t *testing.T) { + t.Run("SetURL_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingHostLocationLink{} + var fernTestValueURL string // Act - obj.SetFrom(fernTestValueFrom) + obj.SetURL(fernTestValueURL) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -86700,14 +98115,54 @@ func TestSettersMarkExplicitSchedulingBookingWindowFrom(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetTo_MarksExplicit", func(t *testing.T) { +} + +func TestSettersSchedulingHostLocationPhone(t *testing.T) { + t.Run("SetNumber", func(t *testing.T) { + obj := &SchedulingHostLocationPhone{} + var fernTestValueNumber string + obj.SetNumber(fernTestValueNumber) + assert.Equal(t, fernTestValueNumber, obj.Number) + assert.NotNil(t, obj.explicitFields) + }) + +} + +func TestGettersSchedulingHostLocationPhone(t *testing.T) { + t.Run("GetNumber", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingBookingWindowFrom{} - var fernTestValueTo string + obj := &SchedulingHostLocationPhone{} + var expected string + obj.Number = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetNumber(), "getter should return the property value") + }) + + t.Run("GetNumber_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingHostLocationPhone + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetNumber() // Should return zero value + }) + +} + +func TestSettersMarkExplicitSchedulingHostLocationPhone(t *testing.T) { + t.Run("SetNumber_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingHostLocationPhone{} + var fernTestValueNumber string // Act - obj.SetTo(fernTestValueTo) + obj.SetNumber(fernTestValueNumber) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -86733,83 +98188,124 @@ func TestSettersMarkExplicitSchedulingBookingWindowFrom(t *testing.T) { } -func TestSettersSchedulingCalendarAuthorization(t *testing.T) { - t.Run("SetObject", func(t *testing.T) { - obj := &SchedulingCalendarAuthorization{} - var fernTestValueObject SchedulingCalendarAuthorizationObject - obj.SetObject(fernTestValueObject) - assert.Equal(t, fernTestValueObject, obj.Object) +func TestSettersSchedulingLimit(t *testing.T) { + t.Run("SetPeriod", func(t *testing.T) { + obj := &SchedulingLimit{} + var fernTestValuePeriod SchedulingLimitPeriod + obj.SetPeriod(fernTestValuePeriod) + assert.Equal(t, fernTestValuePeriod, obj.Period) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetURL", func(t *testing.T) { - obj := &SchedulingCalendarAuthorization{} - var fernTestValueURL string - obj.SetURL(fernTestValueURL) - assert.Equal(t, fernTestValueURL, obj.URL) + t.Run("SetMax", func(t *testing.T) { + obj := &SchedulingLimit{} + var fernTestValueMax int + obj.SetMax(fernTestValueMax) + assert.Equal(t, fernTestValueMax, obj.Max) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetScope", func(t *testing.T) { + obj := &SchedulingLimit{} + var fernTestValueScope *SchedulingLimitScope + obj.SetScope(fernTestValueScope) + assert.Equal(t, fernTestValueScope, obj.Scope) assert.NotNil(t, obj.explicitFields) }) } -func TestGettersSchedulingCalendarAuthorization(t *testing.T) { - t.Run("GetObject", func(t *testing.T) { +func TestGettersSchedulingLimit(t *testing.T) { + t.Run("GetPeriod", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingCalendarAuthorization{} - var expected SchedulingCalendarAuthorizationObject - obj.Object = expected + obj := &SchedulingLimit{} + var expected SchedulingLimitPeriod + obj.Period = expected // Act & Assert - assert.Equal(t, expected, obj.GetObject(), "getter should return the property value") + assert.Equal(t, expected, obj.GetPeriod(), "getter should return the property value") }) - t.Run("GetObject_NilReceiver", func(t *testing.T) { + t.Run("GetPeriod_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *SchedulingCalendarAuthorization + var obj *SchedulingLimit // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetObject() // Should return zero value + _ = obj.GetPeriod() // Should return zero value }) - t.Run("GetURL", func(t *testing.T) { + t.Run("GetMax", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingCalendarAuthorization{} - var expected string - obj.URL = expected + obj := &SchedulingLimit{} + var expected int + obj.Max = expected // Act & Assert - assert.Equal(t, expected, obj.GetURL(), "getter should return the property value") + assert.Equal(t, expected, obj.GetMax(), "getter should return the property value") }) - t.Run("GetURL_NilReceiver", func(t *testing.T) { + t.Run("GetMax_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *SchedulingCalendarAuthorization + var obj *SchedulingLimit // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetURL() // Should return zero value + _ = obj.GetMax() // Should return zero value + }) + + t.Run("GetScope", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingLimit{} + var expected *SchedulingLimitScope + obj.Scope = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetScope(), "getter should return the property value") + }) + + t.Run("GetScope_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingLimit{} + obj.Scope = nil + + // Act & Assert + assert.Nil(t, obj.GetScope(), "getter should return nil when property is nil") + }) + + t.Run("GetScope_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingLimit + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetScope() // Should return zero value }) } -func TestSettersMarkExplicitSchedulingCalendarAuthorization(t *testing.T) { - t.Run("SetObject_MarksExplicit", func(t *testing.T) { +func TestSettersMarkExplicitSchedulingLimit(t *testing.T) { + t.Run("SetPeriod_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingCalendarAuthorization{} - var fernTestValueObject SchedulingCalendarAuthorizationObject + obj := &SchedulingLimit{} + var fernTestValuePeriod SchedulingLimitPeriod // Act - obj.SetObject(fernTestValueObject) + obj.SetPeriod(fernTestValuePeriod) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -86833,14 +98329,14 @@ func TestSettersMarkExplicitSchedulingCalendarAuthorization(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetURL_MarksExplicit", func(t *testing.T) { + t.Run("SetMax_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingCalendarAuthorization{} - var fernTestValueURL string + obj := &SchedulingLimit{} + var fernTestValueMax int // Act - obj.SetURL(fernTestValueURL) + obj.SetMax(fernTestValueMax) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -86864,322 +98360,327 @@ func TestSettersMarkExplicitSchedulingCalendarAuthorization(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) -} - -func TestSettersSchedulingCalendarConnection(t *testing.T) { - t.Run("SetObject", func(t *testing.T) { - obj := &SchedulingCalendarConnection{} - var fernTestValueObject SchedulingCalendarConnectionObject - obj.SetObject(fernTestValueObject) - assert.Equal(t, fernTestValueObject, obj.Object) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetID", func(t *testing.T) { - obj := &SchedulingCalendarConnection{} - var fernTestValueID string - obj.SetID(fernTestValueID) - assert.Equal(t, fernTestValueID, obj.ID) - assert.NotNil(t, obj.explicitFields) - }) + t.Run("SetScope_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingLimit{} + var fernTestValueScope *SchedulingLimitScope - t.Run("SetHost", func(t *testing.T) { - obj := &SchedulingCalendarConnection{} - var fernTestValueHost string - obj.SetHost(fernTestValueHost) - assert.Equal(t, fernTestValueHost, obj.Host) - assert.NotNil(t, obj.explicitFields) - }) + // Act + obj.SetScope(fernTestValueScope) - t.Run("SetProvider", func(t *testing.T) { - obj := &SchedulingCalendarConnection{} - var fernTestValueProvider SchedulingCalendarConnectionProvider - obj.SetProvider(fernTestValueProvider) - assert.Equal(t, fernTestValueProvider, obj.Provider) - assert.NotNil(t, obj.explicitFields) - }) + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") - t.Run("SetAccount", func(t *testing.T) { - obj := &SchedulingCalendarConnection{} - var fernTestValueAccount string - obj.SetAccount(fernTestValueAccount) - assert.Equal(t, fernTestValueAccount, obj.Account) - assert.NotNil(t, obj.explicitFields) - }) + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } - t.Run("SetStatus", func(t *testing.T) { - obj := &SchedulingCalendarConnection{} - var fernTestValueStatus SchedulingCalendarConnectionStatus - obj.SetStatus(fernTestValueStatus) - assert.Equal(t, fernTestValueStatus, obj.Status) - assert.NotNil(t, obj.explicitFields) + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetDelegation", func(t *testing.T) { - obj := &SchedulingCalendarConnection{} - var fernTestValueDelegation *string - obj.SetDelegation(fernTestValueDelegation) - assert.Equal(t, fernTestValueDelegation, obj.Delegation) - assert.NotNil(t, obj.explicitFields) - }) +} - t.Run("SetCalendars", func(t *testing.T) { - obj := &SchedulingCalendarConnection{} - var fernTestValueCalendars []*SchedulingCalendarConnectionCalendarsItem - obj.SetCalendars(fernTestValueCalendars) - assert.Equal(t, fernTestValueCalendars, obj.Calendars) - assert.NotNil(t, obj.explicitFields) - }) +func TestGettersSchedulingLocation(t *testing.T) { + t.Run("GetSchedulingLocationZero", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingLocation{} + var expected *SchedulingLocationZero + obj.SchedulingLocationZero = expected - t.Run("SetCreatedAt", func(t *testing.T) { - obj := &SchedulingCalendarConnection{} - var fernTestValueCreatedAt string - obj.SetCreatedAt(fernTestValueCreatedAt) - assert.Equal(t, fernTestValueCreatedAt, obj.CreatedAt) - assert.NotNil(t, obj.explicitFields) + // Act & Assert + assert.Equal(t, expected, obj.GetSchedulingLocationZero(), "getter should return the property value") }) -} - -func TestGettersSchedulingCalendarConnection(t *testing.T) { - t.Run("GetObject", func(t *testing.T) { + t.Run("GetSchedulingLocationZero_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingCalendarConnection{} - var expected SchedulingCalendarConnectionObject - obj.Object = expected + obj := &SchedulingLocation{} + obj.SchedulingLocationZero = nil // Act & Assert - assert.Equal(t, expected, obj.GetObject(), "getter should return the property value") + assert.Nil(t, obj.GetSchedulingLocationZero(), "getter should return nil when property is nil") }) - t.Run("GetObject_NilReceiver", func(t *testing.T) { + t.Run("GetSchedulingLocationZero_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *SchedulingCalendarConnection + var obj *SchedulingLocation // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetObject() // Should return zero value + _ = obj.GetSchedulingLocationZero() // Should return zero value }) - t.Run("GetID", func(t *testing.T) { + t.Run("GetSchedulingLocationNumber", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingCalendarConnection{} - var expected string - obj.ID = expected + obj := &SchedulingLocation{} + var expected *SchedulingLocationNumber + obj.SchedulingLocationNumber = expected // Act & Assert - assert.Equal(t, expected, obj.GetID(), "getter should return the property value") - }) - - t.Run("GetID_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *SchedulingCalendarConnection - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetID() // Should return zero value + assert.Equal(t, expected, obj.GetSchedulingLocationNumber(), "getter should return the property value") }) - t.Run("GetHost", func(t *testing.T) { + t.Run("GetSchedulingLocationNumber_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingCalendarConnection{} - var expected string - obj.Host = expected + obj := &SchedulingLocation{} + obj.SchedulingLocationNumber = nil // Act & Assert - assert.Equal(t, expected, obj.GetHost(), "getter should return the property value") + assert.Nil(t, obj.GetSchedulingLocationNumber(), "getter should return nil when property is nil") }) - t.Run("GetHost_NilReceiver", func(t *testing.T) { + t.Run("GetSchedulingLocationNumber_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *SchedulingCalendarConnection + var obj *SchedulingLocation // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetHost() // Should return zero value + _ = obj.GetSchedulingLocationNumber() // Should return zero value }) - t.Run("GetProvider", func(t *testing.T) { + t.Run("GetSchedulingLocationAddress", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingCalendarConnection{} - var expected SchedulingCalendarConnectionProvider - obj.Provider = expected + obj := &SchedulingLocation{} + var expected *SchedulingLocationAddress + obj.SchedulingLocationAddress = expected // Act & Assert - assert.Equal(t, expected, obj.GetProvider(), "getter should return the property value") + assert.Equal(t, expected, obj.GetSchedulingLocationAddress(), "getter should return the property value") }) - t.Run("GetProvider_NilReceiver", func(t *testing.T) { + t.Run("GetSchedulingLocationAddress_NilValue", func(t *testing.T) { t.Parallel() - var obj *SchedulingCalendarConnection + // Arrange + obj := &SchedulingLocation{} + obj.SchedulingLocationAddress = nil + + // Act & Assert + assert.Nil(t, obj.GetSchedulingLocationAddress(), "getter should return nil when property is nil") + }) + + t.Run("GetSchedulingLocationAddress_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingLocation // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetProvider() // Should return zero value + _ = obj.GetSchedulingLocationAddress() // Should return zero value }) - t.Run("GetAccount", func(t *testing.T) { + t.Run("GetSchedulingLocationThree", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingCalendarConnection{} - var expected string - obj.Account = expected + obj := &SchedulingLocation{} + var expected *SchedulingLocationThree + obj.SchedulingLocationThree = expected // Act & Assert - assert.Equal(t, expected, obj.GetAccount(), "getter should return the property value") + assert.Equal(t, expected, obj.GetSchedulingLocationThree(), "getter should return the property value") }) - t.Run("GetAccount_NilReceiver", func(t *testing.T) { + t.Run("GetSchedulingLocationThree_NilValue", func(t *testing.T) { t.Parallel() - var obj *SchedulingCalendarConnection + // Arrange + obj := &SchedulingLocation{} + obj.SchedulingLocationThree = nil + + // Act & Assert + assert.Nil(t, obj.GetSchedulingLocationThree(), "getter should return nil when property is nil") + }) + + t.Run("GetSchedulingLocationThree_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingLocation // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetAccount() // Should return zero value + _ = obj.GetSchedulingLocationThree() // Should return zero value }) - t.Run("GetStatus", func(t *testing.T) { + t.Run("GetSchedulingLocationFour", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingCalendarConnection{} - var expected SchedulingCalendarConnectionStatus - obj.Status = expected + obj := &SchedulingLocation{} + var expected *SchedulingLocationFour + obj.SchedulingLocationFour = expected // Act & Assert - assert.Equal(t, expected, obj.GetStatus(), "getter should return the property value") + assert.Equal(t, expected, obj.GetSchedulingLocationFour(), "getter should return the property value") }) - t.Run("GetStatus_NilReceiver", func(t *testing.T) { + t.Run("GetSchedulingLocationFour_NilValue", func(t *testing.T) { t.Parallel() - var obj *SchedulingCalendarConnection + // Arrange + obj := &SchedulingLocation{} + obj.SchedulingLocationFour = nil + + // Act & Assert + assert.Nil(t, obj.GetSchedulingLocationFour(), "getter should return nil when property is nil") + }) + + t.Run("GetSchedulingLocationFour_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingLocation // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetStatus() // Should return zero value + _ = obj.GetSchedulingLocationFour() // Should return zero value }) - t.Run("GetDelegation", func(t *testing.T) { + t.Run("GetSchedulingLocationFive", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingCalendarConnection{} - var expected *string - obj.Delegation = expected + obj := &SchedulingLocation{} + var expected *SchedulingLocationFive + obj.SchedulingLocationFive = expected // Act & Assert - assert.Equal(t, expected, obj.GetDelegation(), "getter should return the property value") + assert.Equal(t, expected, obj.GetSchedulingLocationFive(), "getter should return the property value") }) - t.Run("GetDelegation_NilValue", func(t *testing.T) { + t.Run("GetSchedulingLocationFive_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingCalendarConnection{} - obj.Delegation = nil + obj := &SchedulingLocation{} + obj.SchedulingLocationFive = nil // Act & Assert - assert.Nil(t, obj.GetDelegation(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetSchedulingLocationFive(), "getter should return nil when property is nil") }) - t.Run("GetDelegation_NilReceiver", func(t *testing.T) { + t.Run("GetSchedulingLocationFive_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *SchedulingCalendarConnection + var obj *SchedulingLocation // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetDelegation() // Should return zero value + _ = obj.GetSchedulingLocationFive() // Should return zero value }) - t.Run("GetCalendars", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &SchedulingCalendarConnection{} - var expected []*SchedulingCalendarConnectionCalendarsItem - obj.Calendars = expected +} - // Act & Assert - assert.Equal(t, expected, obj.GetCalendars(), "getter should return the property value") +func TestSettersSchedulingLocationAddress(t *testing.T) { + t.Run("SetType", func(t *testing.T) { + obj := &SchedulingLocationAddress{} + var fernTestValueType SchedulingLocationAddressType + obj.SetType(fernTestValueType) + assert.Equal(t, fernTestValueType, obj.Type) + assert.NotNil(t, obj.explicitFields) }) - t.Run("GetCalendars_NilValue", func(t *testing.T) { + t.Run("SetAddress", func(t *testing.T) { + obj := &SchedulingLocationAddress{} + var fernTestValueAddress *string + obj.SetAddress(fernTestValueAddress) + assert.Equal(t, fernTestValueAddress, obj.Address) + assert.NotNil(t, obj.explicitFields) + }) + +} + +func TestGettersSchedulingLocationAddress(t *testing.T) { + t.Run("GetType", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingCalendarConnection{} - obj.Calendars = nil + obj := &SchedulingLocationAddress{} + var expected SchedulingLocationAddressType + obj.Type = expected // Act & Assert - assert.Nil(t, obj.GetCalendars(), "getter should return nil when property is nil") + assert.Equal(t, expected, obj.GetType(), "getter should return the property value") }) - t.Run("GetCalendars_NilReceiver", func(t *testing.T) { + t.Run("GetType_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *SchedulingCalendarConnection + var obj *SchedulingLocationAddress // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetCalendars() // Should return zero value + _ = obj.GetType() // Should return zero value }) - t.Run("GetCreatedAt", func(t *testing.T) { + t.Run("GetAddress", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingCalendarConnection{} - var expected string - obj.CreatedAt = expected + obj := &SchedulingLocationAddress{} + var expected *string + obj.Address = expected // Act & Assert - assert.Equal(t, expected, obj.GetCreatedAt(), "getter should return the property value") + assert.Equal(t, expected, obj.GetAddress(), "getter should return the property value") }) - t.Run("GetCreatedAt_NilReceiver", func(t *testing.T) { + t.Run("GetAddress_NilValue", func(t *testing.T) { t.Parallel() - var obj *SchedulingCalendarConnection + // Arrange + obj := &SchedulingLocationAddress{} + obj.Address = nil + + // Act & Assert + assert.Nil(t, obj.GetAddress(), "getter should return nil when property is nil") + }) + + t.Run("GetAddress_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingLocationAddress // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetCreatedAt() // Should return zero value + _ = obj.GetAddress() // Should return zero value }) } -func TestSettersMarkExplicitSchedulingCalendarConnection(t *testing.T) { - t.Run("SetObject_MarksExplicit", func(t *testing.T) { +func TestSettersMarkExplicitSchedulingLocationAddress(t *testing.T) { + t.Run("SetType_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingCalendarConnection{} - var fernTestValueObject SchedulingCalendarConnectionObject + obj := &SchedulingLocationAddress{} + var fernTestValueType SchedulingLocationAddressType // Act - obj.SetObject(fernTestValueObject) + obj.SetType(fernTestValueType) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -87203,14 +98704,14 @@ func TestSettersMarkExplicitSchedulingCalendarConnection(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetID_MarksExplicit", func(t *testing.T) { + t.Run("SetAddress_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingCalendarConnection{} - var fernTestValueID string + obj := &SchedulingLocationAddress{} + var fernTestValueAddress *string // Act - obj.SetID(fernTestValueID) + obj.SetAddress(fernTestValueAddress) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -87234,107 +98735,95 @@ func TestSettersMarkExplicitSchedulingCalendarConnection(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetHost_MarksExplicit", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &SchedulingCalendarConnection{} - var fernTestValueHost string - - // Act - obj.SetHost(fernTestValueHost) - - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") +} - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } +func TestSettersSchedulingLocationFive(t *testing.T) { + t.Run("SetType", func(t *testing.T) { + obj := &SchedulingLocationFive{} + var fernTestValueType SchedulingLocationFiveType + obj.SetType(fernTestValueType) + assert.Equal(t, fernTestValueType, obj.Type) + assert.NotNil(t, obj.explicitFields) + }) - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip + t.Run("SetURL", func(t *testing.T) { + obj := &SchedulingLocationFive{} + var fernTestValueURL *string + obj.SetURL(fernTestValueURL) + assert.Equal(t, fernTestValueURL, obj.URL) + assert.NotNil(t, obj.explicitFields) }) - t.Run("SetProvider_MarksExplicit", func(t *testing.T) { +} + +func TestGettersSchedulingLocationFive(t *testing.T) { + t.Run("GetType", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingCalendarConnection{} - var fernTestValueProvider SchedulingCalendarConnectionProvider - - // Act - obj.SetProvider(fernTestValueProvider) - - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") + obj := &SchedulingLocationFive{} + var expected SchedulingLocationFiveType + obj.Type = expected - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } + // Act & Assert + assert.Equal(t, expected, obj.GetType(), "getter should return the property value") + }) - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip + t.Run("GetType_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingLocationFive + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetType() // Should return zero value }) - t.Run("SetAccount_MarksExplicit", func(t *testing.T) { + t.Run("GetURL", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingCalendarConnection{} - var fernTestValueAccount string + obj := &SchedulingLocationFive{} + var expected *string + obj.URL = expected - // Act - obj.SetAccount(fernTestValueAccount) + // Act & Assert + assert.Equal(t, expected, obj.GetURL(), "getter should return the property value") + }) - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") + t.Run("GetURL_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingLocationFive{} + obj.URL = nil - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } + // Act & Assert + assert.Nil(t, obj.GetURL(), "getter should return nil when property is nil") + }) - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip + t.Run("GetURL_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingLocationFive + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetURL() // Should return zero value }) - t.Run("SetStatus_MarksExplicit", func(t *testing.T) { +} + +func TestSettersMarkExplicitSchedulingLocationFive(t *testing.T) { + t.Run("SetType_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingCalendarConnection{} - var fernTestValueStatus SchedulingCalendarConnectionStatus + obj := &SchedulingLocationFive{} + var fernTestValueType SchedulingLocationFiveType // Act - obj.SetStatus(fernTestValueStatus) + obj.SetType(fernTestValueType) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -87358,14 +98847,14 @@ func TestSettersMarkExplicitSchedulingCalendarConnection(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetDelegation_MarksExplicit", func(t *testing.T) { + t.Run("SetURL_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingCalendarConnection{} - var fernTestValueDelegation *string + obj := &SchedulingLocationFive{} + var fernTestValueURL *string // Act - obj.SetDelegation(fernTestValueDelegation) + obj.SetURL(fernTestValueURL) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -87389,45 +98878,54 @@ func TestSettersMarkExplicitSchedulingCalendarConnection(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetCalendars_MarksExplicit", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &SchedulingCalendarConnection{} - var fernTestValueCalendars []*SchedulingCalendarConnectionCalendarsItem +} - // Act - obj.SetCalendars(fernTestValueCalendars) +func TestSettersSchedulingLocationFour(t *testing.T) { + t.Run("SetType", func(t *testing.T) { + obj := &SchedulingLocationFour{} + var fernTestValueType SchedulingLocationFourType + obj.SetType(fernTestValueType) + assert.Equal(t, fernTestValueType, obj.Type) + assert.NotNil(t, obj.explicitFields) + }) - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") +} - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } +func TestGettersSchedulingLocationFour(t *testing.T) { + t.Run("GetType", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingLocationFour{} + var expected SchedulingLocationFourType + obj.Type = expected - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip + // Act & Assert + assert.Equal(t, expected, obj.GetType(), "getter should return the property value") }) - t.Run("SetCreatedAt_MarksExplicit", func(t *testing.T) { + t.Run("GetType_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingLocationFour + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetType() // Should return zero value + }) + +} + +func TestSettersMarkExplicitSchedulingLocationFour(t *testing.T) { + t.Run("SetType_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingCalendarConnection{} - var fernTestValueCreatedAt string + obj := &SchedulingLocationFour{} + var fernTestValueType SchedulingLocationFourType // Act - obj.SetCreatedAt(fernTestValueCreatedAt) + obj.SetType(fernTestValueType) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -87453,186 +98951,93 @@ func TestSettersMarkExplicitSchedulingCalendarConnection(t *testing.T) { } -func TestSettersSchedulingCalendarConnectionCalendarsItem(t *testing.T) { - t.Run("SetID", func(t *testing.T) { - obj := &SchedulingCalendarConnectionCalendarsItem{} - var fernTestValueID string - obj.SetID(fernTestValueID) - assert.Equal(t, fernTestValueID, obj.ID) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetExternalID", func(t *testing.T) { - obj := &SchedulingCalendarConnectionCalendarsItem{} - var fernTestValueExternalID string - obj.SetExternalID(fernTestValueExternalID) - assert.Equal(t, fernTestValueExternalID, obj.ExternalID) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetReadBusy", func(t *testing.T) { - obj := &SchedulingCalendarConnectionCalendarsItem{} - var fernTestValueReadBusy bool - obj.SetReadBusy(fernTestValueReadBusy) - assert.Equal(t, fernTestValueReadBusy, obj.ReadBusy) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetWriteTarget", func(t *testing.T) { - obj := &SchedulingCalendarConnectionCalendarsItem{} - var fernTestValueWriteTarget bool - obj.SetWriteTarget(fernTestValueWriteTarget) - assert.Equal(t, fernTestValueWriteTarget, obj.WriteTarget) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetVerifiedAt", func(t *testing.T) { - obj := &SchedulingCalendarConnectionCalendarsItem{} - var fernTestValueVerifiedAt *string - obj.SetVerifiedAt(fernTestValueVerifiedAt) - assert.Equal(t, fernTestValueVerifiedAt, obj.VerifiedAt) +func TestSettersSchedulingLocationNumber(t *testing.T) { + t.Run("SetType", func(t *testing.T) { + obj := &SchedulingLocationNumber{} + var fernTestValueType SchedulingLocationNumberType + obj.SetType(fernTestValueType) + assert.Equal(t, fernTestValueType, obj.Type) assert.NotNil(t, obj.explicitFields) }) -} - -func TestGettersSchedulingCalendarConnectionCalendarsItem(t *testing.T) { - t.Run("GetID", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &SchedulingCalendarConnectionCalendarsItem{} - var expected string - obj.ID = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetID(), "getter should return the property value") - }) - - t.Run("GetID_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *SchedulingCalendarConnectionCalendarsItem - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetID() // Should return zero value - }) - - t.Run("GetExternalID", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &SchedulingCalendarConnectionCalendarsItem{} - var expected string - obj.ExternalID = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetExternalID(), "getter should return the property value") - }) - - t.Run("GetExternalID_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *SchedulingCalendarConnectionCalendarsItem - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetExternalID() // Should return zero value - }) - - t.Run("GetReadBusy", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &SchedulingCalendarConnectionCalendarsItem{} - var expected bool - obj.ReadBusy = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetReadBusy(), "getter should return the property value") - }) - - t.Run("GetReadBusy_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *SchedulingCalendarConnectionCalendarsItem - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetReadBusy() // Should return zero value + t.Run("SetNumber", func(t *testing.T) { + obj := &SchedulingLocationNumber{} + var fernTestValueNumber *string + obj.SetNumber(fernTestValueNumber) + assert.Equal(t, fernTestValueNumber, obj.Number) + assert.NotNil(t, obj.explicitFields) }) - t.Run("GetWriteTarget", func(t *testing.T) { +} + +func TestGettersSchedulingLocationNumber(t *testing.T) { + t.Run("GetType", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingCalendarConnectionCalendarsItem{} - var expected bool - obj.WriteTarget = expected + obj := &SchedulingLocationNumber{} + var expected SchedulingLocationNumberType + obj.Type = expected // Act & Assert - assert.Equal(t, expected, obj.GetWriteTarget(), "getter should return the property value") + assert.Equal(t, expected, obj.GetType(), "getter should return the property value") }) - t.Run("GetWriteTarget_NilReceiver", func(t *testing.T) { + t.Run("GetType_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *SchedulingCalendarConnectionCalendarsItem + var obj *SchedulingLocationNumber // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetWriteTarget() // Should return zero value + _ = obj.GetType() // Should return zero value }) - t.Run("GetVerifiedAt", func(t *testing.T) { + t.Run("GetNumber", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingCalendarConnectionCalendarsItem{} + obj := &SchedulingLocationNumber{} var expected *string - obj.VerifiedAt = expected + obj.Number = expected // Act & Assert - assert.Equal(t, expected, obj.GetVerifiedAt(), "getter should return the property value") + assert.Equal(t, expected, obj.GetNumber(), "getter should return the property value") }) - t.Run("GetVerifiedAt_NilValue", func(t *testing.T) { + t.Run("GetNumber_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingCalendarConnectionCalendarsItem{} - obj.VerifiedAt = nil + obj := &SchedulingLocationNumber{} + obj.Number = nil // Act & Assert - assert.Nil(t, obj.GetVerifiedAt(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetNumber(), "getter should return nil when property is nil") }) - t.Run("GetVerifiedAt_NilReceiver", func(t *testing.T) { + t.Run("GetNumber_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *SchedulingCalendarConnectionCalendarsItem + var obj *SchedulingLocationNumber // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetVerifiedAt() // Should return zero value + _ = obj.GetNumber() // Should return zero value }) } -func TestSettersMarkExplicitSchedulingCalendarConnectionCalendarsItem(t *testing.T) { - t.Run("SetID_MarksExplicit", func(t *testing.T) { +func TestSettersMarkExplicitSchedulingLocationNumber(t *testing.T) { + t.Run("SetType_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingCalendarConnectionCalendarsItem{} - var fernTestValueID string + obj := &SchedulingLocationNumber{} + var fernTestValueType SchedulingLocationNumberType // Act - obj.SetID(fernTestValueID) + obj.SetType(fernTestValueType) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -87656,14 +99061,14 @@ func TestSettersMarkExplicitSchedulingCalendarConnectionCalendarsItem(t *testing // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetExternalID_MarksExplicit", func(t *testing.T) { + t.Run("SetNumber_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingCalendarConnectionCalendarsItem{} - var fernTestValueExternalID string + obj := &SchedulingLocationNumber{} + var fernTestValueNumber *string // Act - obj.SetExternalID(fernTestValueExternalID) + obj.SetNumber(fernTestValueNumber) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -87687,76 +99092,54 @@ func TestSettersMarkExplicitSchedulingCalendarConnectionCalendarsItem(t *testing // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetReadBusy_MarksExplicit", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &SchedulingCalendarConnectionCalendarsItem{} - var fernTestValueReadBusy bool - - // Act - obj.SetReadBusy(fernTestValueReadBusy) - - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") - - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } +} - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip +func TestSettersSchedulingLocationThree(t *testing.T) { + t.Run("SetType", func(t *testing.T) { + obj := &SchedulingLocationThree{} + var fernTestValueType SchedulingLocationThreeType + obj.SetType(fernTestValueType) + assert.Equal(t, fernTestValueType, obj.Type) + assert.NotNil(t, obj.explicitFields) }) - t.Run("SetWriteTarget_MarksExplicit", func(t *testing.T) { +} + +func TestGettersSchedulingLocationThree(t *testing.T) { + t.Run("GetType", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingCalendarConnectionCalendarsItem{} - var fernTestValueWriteTarget bool - - // Act - obj.SetWriteTarget(fernTestValueWriteTarget) - - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") + obj := &SchedulingLocationThree{} + var expected SchedulingLocationThreeType + obj.Type = expected - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } + // Act & Assert + assert.Equal(t, expected, obj.GetType(), "getter should return the property value") + }) - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip + t.Run("GetType_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingLocationThree + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetType() // Should return zero value }) - t.Run("SetVerifiedAt_MarksExplicit", func(t *testing.T) { +} + +func TestSettersMarkExplicitSchedulingLocationThree(t *testing.T) { + t.Run("SetType_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingCalendarConnectionCalendarsItem{} - var fernTestValueVerifiedAt *string + obj := &SchedulingLocationThree{} + var fernTestValueType SchedulingLocationThreeType // Act - obj.SetVerifiedAt(fernTestValueVerifiedAt) + obj.SetType(fernTestValueType) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -87782,155 +99165,93 @@ func TestSettersMarkExplicitSchedulingCalendarConnectionCalendarsItem(t *testing } -func TestSettersSchedulingCalendarConnectionList(t *testing.T) { - t.Run("SetObject", func(t *testing.T) { - obj := &SchedulingCalendarConnectionList{} - var fernTestValueObject SchedulingCalendarConnectionListObject - obj.SetObject(fernTestValueObject) - assert.Equal(t, fernTestValueObject, obj.Object) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetData", func(t *testing.T) { - obj := &SchedulingCalendarConnectionList{} - var fernTestValueData []*SchedulingCalendarConnection - obj.SetData(fernTestValueData) - assert.Equal(t, fernTestValueData, obj.Data) +func TestSettersSchedulingLocationZero(t *testing.T) { + t.Run("SetType", func(t *testing.T) { + obj := &SchedulingLocationZero{} + var fernTestValueType SchedulingLocationZeroType + obj.SetType(fernTestValueType) + assert.Equal(t, fernTestValueType, obj.Type) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetHasMore", func(t *testing.T) { - obj := &SchedulingCalendarConnectionList{} - var fernTestValueHasMore bool - obj.SetHasMore(fernTestValueHasMore) - assert.Equal(t, fernTestValueHasMore, obj.HasMore) + t.Run("SetURL", func(t *testing.T) { + obj := &SchedulingLocationZero{} + var fernTestValueURL *string + obj.SetURL(fernTestValueURL) + assert.Equal(t, fernTestValueURL, obj.URL) assert.NotNil(t, obj.explicitFields) }) } -func TestGettersSchedulingCalendarConnectionList(t *testing.T) { - t.Run("GetObject", func(t *testing.T) { +func TestGettersSchedulingLocationZero(t *testing.T) { + t.Run("GetType", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingCalendarConnectionList{} - var expected SchedulingCalendarConnectionListObject - obj.Object = expected + obj := &SchedulingLocationZero{} + var expected SchedulingLocationZeroType + obj.Type = expected // Act & Assert - assert.Equal(t, expected, obj.GetObject(), "getter should return the property value") + assert.Equal(t, expected, obj.GetType(), "getter should return the property value") }) - t.Run("GetObject_NilReceiver", func(t *testing.T) { + t.Run("GetType_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *SchedulingCalendarConnectionList + var obj *SchedulingLocationZero // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetObject() // Should return zero value - }) - - t.Run("GetData", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &SchedulingCalendarConnectionList{} - var expected []*SchedulingCalendarConnection - obj.Data = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetData(), "getter should return the property value") + _ = obj.GetType() // Should return zero value }) - t.Run("GetData_NilValue", func(t *testing.T) { + t.Run("GetURL", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingCalendarConnectionList{} - obj.Data = nil + obj := &SchedulingLocationZero{} + var expected *string + obj.URL = expected // Act & Assert - assert.Nil(t, obj.GetData(), "getter should return nil when property is nil") - }) - - t.Run("GetData_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *SchedulingCalendarConnectionList - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetData() // Should return zero value + assert.Equal(t, expected, obj.GetURL(), "getter should return the property value") }) - t.Run("GetHasMore", func(t *testing.T) { + t.Run("GetURL_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingCalendarConnectionList{} - var expected bool - obj.HasMore = expected + obj := &SchedulingLocationZero{} + obj.URL = nil // Act & Assert - assert.Equal(t, expected, obj.GetHasMore(), "getter should return the property value") + assert.Nil(t, obj.GetURL(), "getter should return nil when property is nil") }) - t.Run("GetHasMore_NilReceiver", func(t *testing.T) { + t.Run("GetURL_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *SchedulingCalendarConnectionList + var obj *SchedulingLocationZero // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetHasMore() // Should return zero value + _ = obj.GetURL() // Should return zero value }) } -func TestSettersMarkExplicitSchedulingCalendarConnectionList(t *testing.T) { - t.Run("SetObject_MarksExplicit", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &SchedulingCalendarConnectionList{} - var fernTestValueObject SchedulingCalendarConnectionListObject - - // Act - obj.SetObject(fernTestValueObject) - - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") - - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } - - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip - }) - - t.Run("SetData_MarksExplicit", func(t *testing.T) { +func TestSettersMarkExplicitSchedulingLocationZero(t *testing.T) { + t.Run("SetType_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingCalendarConnectionList{} - var fernTestValueData []*SchedulingCalendarConnection + obj := &SchedulingLocationZero{} + var fernTestValueType SchedulingLocationZeroType // Act - obj.SetData(fernTestValueData) + obj.SetType(fernTestValueType) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -87954,14 +99275,14 @@ func TestSettersMarkExplicitSchedulingCalendarConnectionList(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetHasMore_MarksExplicit", func(t *testing.T) { + t.Run("SetURL_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingCalendarConnectionList{} - var fernTestValueHasMore bool + obj := &SchedulingLocationZero{} + var fernTestValueURL *string // Act - obj.SetHasMore(fernTestValueHasMore) + obj.SetURL(fernTestValueURL) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -87987,17 +99308,17 @@ func TestSettersMarkExplicitSchedulingCalendarConnectionList(t *testing.T) { } -func TestSettersSchedulingCalendarDelegation(t *testing.T) { +func TestSettersSchedulingOauthApp(t *testing.T) { t.Run("SetObject", func(t *testing.T) { - obj := &SchedulingCalendarDelegation{} - var fernTestValueObject SchedulingCalendarDelegationObject + obj := &SchedulingOauthApp{} + var fernTestValueObject SchedulingOauthAppObject obj.SetObject(fernTestValueObject) assert.Equal(t, fernTestValueObject, obj.Object) assert.NotNil(t, obj.explicitFields) }) t.Run("SetID", func(t *testing.T) { - obj := &SchedulingCalendarDelegation{} + obj := &SchedulingOauthApp{} var fernTestValueID string obj.SetID(fernTestValueID) assert.Equal(t, fernTestValueID, obj.ID) @@ -88005,111 +99326,119 @@ func TestSettersSchedulingCalendarDelegation(t *testing.T) { }) t.Run("SetProvider", func(t *testing.T) { - obj := &SchedulingCalendarDelegation{} - var fernTestValueProvider SchedulingCalendarDelegationProvider + obj := &SchedulingOauthApp{} + var fernTestValueProvider SchedulingOauthAppProvider obj.SetProvider(fernTestValueProvider) assert.Equal(t, fernTestValueProvider, obj.Provider) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetDomain", func(t *testing.T) { - obj := &SchedulingCalendarDelegation{} - var fernTestValueDomain string - obj.SetDomain(fernTestValueDomain) - assert.Equal(t, fernTestValueDomain, obj.Domain) + t.Run("SetClientID", func(t *testing.T) { + obj := &SchedulingOauthApp{} + var fernTestValueClientID string + obj.SetClientID(fernTestValueClientID) + assert.Equal(t, fernTestValueClientID, obj.ClientID) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetStatus", func(t *testing.T) { - obj := &SchedulingCalendarDelegation{} - var fernTestValueStatus SchedulingCalendarDelegationStatus - obj.SetStatus(fernTestValueStatus) - assert.Equal(t, fernTestValueStatus, obj.Status) + t.Run("SetTenantID", func(t *testing.T) { + obj := &SchedulingOauthApp{} + var fernTestValueTenantID *string + obj.SetTenantID(fernTestValueTenantID) + assert.Equal(t, fernTestValueTenantID, obj.TenantID) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetMatchHostEmail", func(t *testing.T) { - obj := &SchedulingCalendarDelegation{} - var fernTestValueMatchHostEmail bool - obj.SetMatchHostEmail(fernTestValueMatchHostEmail) - assert.Equal(t, fernTestValueMatchHostEmail, obj.MatchHostEmail) + t.Run("SetRedirectURI", func(t *testing.T) { + obj := &SchedulingOauthApp{} + var fernTestValueRedirectURI *string + obj.SetRedirectURI(fernTestValueRedirectURI) + assert.Equal(t, fernTestValueRedirectURI, obj.RedirectURI) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetClientID", func(t *testing.T) { - obj := &SchedulingCalendarDelegation{} - var fernTestValueClientID string - obj.SetClientID(fernTestValueClientID) - assert.Equal(t, fernTestValueClientID, obj.ClientID) + t.Run("SetCossCallbackURL", func(t *testing.T) { + obj := &SchedulingOauthApp{} + var fernTestValueCossCallbackURL string + obj.SetCossCallbackURL(fernTestValueCossCallbackURL) + assert.Equal(t, fernTestValueCossCallbackURL, obj.CossCallbackURL) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetTenantID", func(t *testing.T) { - obj := &SchedulingCalendarDelegation{} - var fernTestValueTenantID *string - obj.SetTenantID(fernTestValueTenantID) - assert.Equal(t, fernTestValueTenantID, obj.TenantID) + t.Run("SetCompletionURL", func(t *testing.T) { + obj := &SchedulingOauthApp{} + var fernTestValueCompletionURL *string + obj.SetCompletionURL(fernTestValueCompletionURL) + assert.Equal(t, fernTestValueCompletionURL, obj.CompletionURL) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetZoomEventURL", func(t *testing.T) { + obj := &SchedulingOauthApp{} + var fernTestValueZoomEventURL *string + obj.SetZoomEventURL(fernTestValueZoomEventURL) + assert.Equal(t, fernTestValueZoomEventURL, obj.ZoomEventURL) assert.NotNil(t, obj.explicitFields) }) t.Run("SetScopes", func(t *testing.T) { - obj := &SchedulingCalendarDelegation{} + obj := &SchedulingOauthApp{} var fernTestValueScopes []string obj.SetScopes(fernTestValueScopes) assert.Equal(t, fernTestValueScopes, obj.Scopes) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetVerifiedAccount", func(t *testing.T) { - obj := &SchedulingCalendarDelegation{} - var fernTestValueVerifiedAccount *string - obj.SetVerifiedAccount(fernTestValueVerifiedAccount) - assert.Equal(t, fernTestValueVerifiedAccount, obj.VerifiedAccount) + t.Run("SetStatus", func(t *testing.T) { + obj := &SchedulingOauthApp{} + var fernTestValueStatus SchedulingOauthAppStatus + obj.SetStatus(fernTestValueStatus) + assert.Equal(t, fernTestValueStatus, obj.Status) assert.NotNil(t, obj.explicitFields) }) t.Run("SetLastErrorCode", func(t *testing.T) { - obj := &SchedulingCalendarDelegation{} + obj := &SchedulingOauthApp{} var fernTestValueLastErrorCode *string obj.SetLastErrorCode(fernTestValueLastErrorCode) assert.Equal(t, fernTestValueLastErrorCode, obj.LastErrorCode) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetFailingSince", func(t *testing.T) { - obj := &SchedulingCalendarDelegation{} - var fernTestValueFailingSince *string - obj.SetFailingSince(fernTestValueFailingSince) - assert.Equal(t, fernTestValueFailingSince, obj.FailingSince) + t.Run("SetLastErrorAt", func(t *testing.T) { + obj := &SchedulingOauthApp{} + var fernTestValueLastErrorAt *string + obj.SetLastErrorAt(fernTestValueLastErrorAt) + assert.Equal(t, fernTestValueLastErrorAt, obj.LastErrorAt) assert.NotNil(t, obj.explicitFields) }) t.Run("SetSecretExpiresAt", func(t *testing.T) { - obj := &SchedulingCalendarDelegation{} + obj := &SchedulingOauthApp{} var fernTestValueSecretExpiresAt *string obj.SetSecretExpiresAt(fernTestValueSecretExpiresAt) assert.Equal(t, fernTestValueSecretExpiresAt, obj.SecretExpiresAt) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetHostsConnected", func(t *testing.T) { - obj := &SchedulingCalendarDelegation{} - var fernTestValueHostsConnected int64 - obj.SetHostsConnected(fernTestValueHostsConnected) - assert.Equal(t, fernTestValueHostsConnected, obj.HostsConnected) + t.Run("SetVerifiedAt", func(t *testing.T) { + obj := &SchedulingOauthApp{} + var fernTestValueVerifiedAt *string + obj.SetVerifiedAt(fernTestValueVerifiedAt) + assert.Equal(t, fernTestValueVerifiedAt, obj.VerifiedAt) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetHostsFailed", func(t *testing.T) { - obj := &SchedulingCalendarDelegation{} - var fernTestValueHostsFailed int64 - obj.SetHostsFailed(fernTestValueHostsFailed) - assert.Equal(t, fernTestValueHostsFailed, obj.HostsFailed) + t.Run("SetConnections", func(t *testing.T) { + obj := &SchedulingOauthApp{} + var fernTestValueConnections int64 + obj.SetConnections(fernTestValueConnections) + assert.Equal(t, fernTestValueConnections, obj.Connections) assert.NotNil(t, obj.explicitFields) }) t.Run("SetCreatedAt", func(t *testing.T) { - obj := &SchedulingCalendarDelegation{} + obj := &SchedulingOauthApp{} var fernTestValueCreatedAt string obj.SetCreatedAt(fernTestValueCreatedAt) assert.Equal(t, fernTestValueCreatedAt, obj.CreatedAt) @@ -88117,7 +99446,7 @@ func TestSettersSchedulingCalendarDelegation(t *testing.T) { }) t.Run("SetUpdatedAt", func(t *testing.T) { - obj := &SchedulingCalendarDelegation{} + obj := &SchedulingOauthApp{} var fernTestValueUpdatedAt string obj.SetUpdatedAt(fernTestValueUpdatedAt) assert.Equal(t, fernTestValueUpdatedAt, obj.UpdatedAt) @@ -88126,12 +99455,12 @@ func TestSettersSchedulingCalendarDelegation(t *testing.T) { } -func TestGettersSchedulingCalendarDelegation(t *testing.T) { +func TestGettersSchedulingOauthApp(t *testing.T) { t.Run("GetObject", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingCalendarDelegation{} - var expected SchedulingCalendarDelegationObject + obj := &SchedulingOauthApp{} + var expected SchedulingOauthAppObject obj.Object = expected // Act & Assert @@ -88140,7 +99469,7 @@ func TestGettersSchedulingCalendarDelegation(t *testing.T) { t.Run("GetObject_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *SchedulingCalendarDelegation + var obj *SchedulingOauthApp // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -88153,7 +99482,7 @@ func TestGettersSchedulingCalendarDelegation(t *testing.T) { t.Run("GetID", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingCalendarDelegation{} + obj := &SchedulingOauthApp{} var expected string obj.ID = expected @@ -88163,7 +99492,7 @@ func TestGettersSchedulingCalendarDelegation(t *testing.T) { t.Run("GetID_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *SchedulingCalendarDelegation + var obj *SchedulingOauthApp // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -88176,8 +99505,8 @@ func TestGettersSchedulingCalendarDelegation(t *testing.T) { t.Run("GetProvider", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingCalendarDelegation{} - var expected SchedulingCalendarDelegationProvider + obj := &SchedulingOauthApp{} + var expected SchedulingOauthAppProvider obj.Provider = expected // Act & Assert @@ -88186,7 +99515,7 @@ func TestGettersSchedulingCalendarDelegation(t *testing.T) { t.Run("GetProvider_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *SchedulingCalendarDelegation + var obj *SchedulingOauthApp // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -88196,135 +99525,188 @@ func TestGettersSchedulingCalendarDelegation(t *testing.T) { _ = obj.GetProvider() // Should return zero value }) - t.Run("GetDomain", func(t *testing.T) { + t.Run("GetClientID", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingCalendarDelegation{} + obj := &SchedulingOauthApp{} var expected string - obj.Domain = expected + obj.ClientID = expected // Act & Assert - assert.Equal(t, expected, obj.GetDomain(), "getter should return the property value") + assert.Equal(t, expected, obj.GetClientID(), "getter should return the property value") }) - t.Run("GetDomain_NilReceiver", func(t *testing.T) { + t.Run("GetClientID_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *SchedulingCalendarDelegation + var obj *SchedulingOauthApp // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetDomain() // Should return zero value + _ = obj.GetClientID() // Should return zero value }) - t.Run("GetStatus", func(t *testing.T) { + t.Run("GetTenantID", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingCalendarDelegation{} - var expected SchedulingCalendarDelegationStatus - obj.Status = expected + obj := &SchedulingOauthApp{} + var expected *string + obj.TenantID = expected // Act & Assert - assert.Equal(t, expected, obj.GetStatus(), "getter should return the property value") + assert.Equal(t, expected, obj.GetTenantID(), "getter should return the property value") }) - t.Run("GetStatus_NilReceiver", func(t *testing.T) { + t.Run("GetTenantID_NilValue", func(t *testing.T) { t.Parallel() - var obj *SchedulingCalendarDelegation + // Arrange + obj := &SchedulingOauthApp{} + obj.TenantID = nil + + // Act & Assert + assert.Nil(t, obj.GetTenantID(), "getter should return nil when property is nil") + }) + + t.Run("GetTenantID_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingOauthApp // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetStatus() // Should return zero value + _ = obj.GetTenantID() // Should return zero value }) - t.Run("GetMatchHostEmail", func(t *testing.T) { + t.Run("GetRedirectURI", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingCalendarDelegation{} - var expected bool - obj.MatchHostEmail = expected + obj := &SchedulingOauthApp{} + var expected *string + obj.RedirectURI = expected // Act & Assert - assert.Equal(t, expected, obj.GetMatchHostEmail(), "getter should return the property value") + assert.Equal(t, expected, obj.GetRedirectURI(), "getter should return the property value") }) - t.Run("GetMatchHostEmail_NilReceiver", func(t *testing.T) { + t.Run("GetRedirectURI_NilValue", func(t *testing.T) { t.Parallel() - var obj *SchedulingCalendarDelegation + // Arrange + obj := &SchedulingOauthApp{} + obj.RedirectURI = nil + + // Act & Assert + assert.Nil(t, obj.GetRedirectURI(), "getter should return nil when property is nil") + }) + + t.Run("GetRedirectURI_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingOauthApp // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetMatchHostEmail() // Should return zero value + _ = obj.GetRedirectURI() // Should return zero value }) - t.Run("GetClientID", func(t *testing.T) { + t.Run("GetCossCallbackURL", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingCalendarDelegation{} + obj := &SchedulingOauthApp{} var expected string - obj.ClientID = expected + obj.CossCallbackURL = expected // Act & Assert - assert.Equal(t, expected, obj.GetClientID(), "getter should return the property value") + assert.Equal(t, expected, obj.GetCossCallbackURL(), "getter should return the property value") }) - t.Run("GetClientID_NilReceiver", func(t *testing.T) { + t.Run("GetCossCallbackURL_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *SchedulingCalendarDelegation + var obj *SchedulingOauthApp // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetClientID() // Should return zero value + _ = obj.GetCossCallbackURL() // Should return zero value }) - t.Run("GetTenantID", func(t *testing.T) { + t.Run("GetCompletionURL", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingCalendarDelegation{} + obj := &SchedulingOauthApp{} var expected *string - obj.TenantID = expected + obj.CompletionURL = expected // Act & Assert - assert.Equal(t, expected, obj.GetTenantID(), "getter should return the property value") + assert.Equal(t, expected, obj.GetCompletionURL(), "getter should return the property value") }) - t.Run("GetTenantID_NilValue", func(t *testing.T) { + t.Run("GetCompletionURL_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingCalendarDelegation{} - obj.TenantID = nil + obj := &SchedulingOauthApp{} + obj.CompletionURL = nil // Act & Assert - assert.Nil(t, obj.GetTenantID(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetCompletionURL(), "getter should return nil when property is nil") }) - t.Run("GetTenantID_NilReceiver", func(t *testing.T) { + t.Run("GetCompletionURL_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *SchedulingCalendarDelegation + var obj *SchedulingOauthApp // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetTenantID() // Should return zero value + _ = obj.GetCompletionURL() // Should return zero value + }) + + t.Run("GetZoomEventURL", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingOauthApp{} + var expected *string + obj.ZoomEventURL = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetZoomEventURL(), "getter should return the property value") + }) + + t.Run("GetZoomEventURL_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingOauthApp{} + obj.ZoomEventURL = nil + + // Act & Assert + assert.Nil(t, obj.GetZoomEventURL(), "getter should return nil when property is nil") + }) + + t.Run("GetZoomEventURL_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingOauthApp + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetZoomEventURL() // Should return zero value }) t.Run("GetScopes", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingCalendarDelegation{} + obj := &SchedulingOauthApp{} var expected []string obj.Scopes = expected @@ -88335,7 +99717,7 @@ func TestGettersSchedulingCalendarDelegation(t *testing.T) { t.Run("GetScopes_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingCalendarDelegation{} + obj := &SchedulingOauthApp{} obj.Scopes = nil // Act & Assert @@ -88344,7 +99726,7 @@ func TestGettersSchedulingCalendarDelegation(t *testing.T) { t.Run("GetScopes_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *SchedulingCalendarDelegation + var obj *SchedulingOauthApp // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -88354,43 +99736,33 @@ func TestGettersSchedulingCalendarDelegation(t *testing.T) { _ = obj.GetScopes() // Should return zero value }) - t.Run("GetVerifiedAccount", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &SchedulingCalendarDelegation{} - var expected *string - obj.VerifiedAccount = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetVerifiedAccount(), "getter should return the property value") - }) - - t.Run("GetVerifiedAccount_NilValue", func(t *testing.T) { + t.Run("GetStatus", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingCalendarDelegation{} - obj.VerifiedAccount = nil + obj := &SchedulingOauthApp{} + var expected SchedulingOauthAppStatus + obj.Status = expected // Act & Assert - assert.Nil(t, obj.GetVerifiedAccount(), "getter should return nil when property is nil") + assert.Equal(t, expected, obj.GetStatus(), "getter should return the property value") }) - t.Run("GetVerifiedAccount_NilReceiver", func(t *testing.T) { + t.Run("GetStatus_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *SchedulingCalendarDelegation + var obj *SchedulingOauthApp // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetVerifiedAccount() // Should return zero value + _ = obj.GetStatus() // Should return zero value }) t.Run("GetLastErrorCode", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingCalendarDelegation{} + obj := &SchedulingOauthApp{} var expected *string obj.LastErrorCode = expected @@ -88401,7 +99773,7 @@ func TestGettersSchedulingCalendarDelegation(t *testing.T) { t.Run("GetLastErrorCode_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingCalendarDelegation{} + obj := &SchedulingOauthApp{} obj.LastErrorCode = nil // Act & Assert @@ -88410,7 +99782,7 @@ func TestGettersSchedulingCalendarDelegation(t *testing.T) { t.Run("GetLastErrorCode_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *SchedulingCalendarDelegation + var obj *SchedulingOauthApp // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -88420,43 +99792,43 @@ func TestGettersSchedulingCalendarDelegation(t *testing.T) { _ = obj.GetLastErrorCode() // Should return zero value }) - t.Run("GetFailingSince", func(t *testing.T) { + t.Run("GetLastErrorAt", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingCalendarDelegation{} + obj := &SchedulingOauthApp{} var expected *string - obj.FailingSince = expected + obj.LastErrorAt = expected // Act & Assert - assert.Equal(t, expected, obj.GetFailingSince(), "getter should return the property value") + assert.Equal(t, expected, obj.GetLastErrorAt(), "getter should return the property value") }) - t.Run("GetFailingSince_NilValue", func(t *testing.T) { + t.Run("GetLastErrorAt_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingCalendarDelegation{} - obj.FailingSince = nil + obj := &SchedulingOauthApp{} + obj.LastErrorAt = nil // Act & Assert - assert.Nil(t, obj.GetFailingSince(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetLastErrorAt(), "getter should return nil when property is nil") }) - t.Run("GetFailingSince_NilReceiver", func(t *testing.T) { + t.Run("GetLastErrorAt_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *SchedulingCalendarDelegation + var obj *SchedulingOauthApp // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetFailingSince() // Should return zero value + _ = obj.GetLastErrorAt() // Should return zero value }) t.Run("GetSecretExpiresAt", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingCalendarDelegation{} + obj := &SchedulingOauthApp{} var expected *string obj.SecretExpiresAt = expected @@ -88467,7 +99839,7 @@ func TestGettersSchedulingCalendarDelegation(t *testing.T) { t.Run("GetSecretExpiresAt_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingCalendarDelegation{} + obj := &SchedulingOauthApp{} obj.SecretExpiresAt = nil // Act & Assert @@ -88476,7 +99848,7 @@ func TestGettersSchedulingCalendarDelegation(t *testing.T) { t.Run("GetSecretExpiresAt_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *SchedulingCalendarDelegation + var obj *SchedulingOauthApp // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -88486,56 +99858,66 @@ func TestGettersSchedulingCalendarDelegation(t *testing.T) { _ = obj.GetSecretExpiresAt() // Should return zero value }) - t.Run("GetHostsConnected", func(t *testing.T) { + t.Run("GetVerifiedAt", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingCalendarDelegation{} - var expected int64 - obj.HostsConnected = expected + obj := &SchedulingOauthApp{} + var expected *string + obj.VerifiedAt = expected // Act & Assert - assert.Equal(t, expected, obj.GetHostsConnected(), "getter should return the property value") + assert.Equal(t, expected, obj.GetVerifiedAt(), "getter should return the property value") }) - t.Run("GetHostsConnected_NilReceiver", func(t *testing.T) { + t.Run("GetVerifiedAt_NilValue", func(t *testing.T) { t.Parallel() - var obj *SchedulingCalendarDelegation + // Arrange + obj := &SchedulingOauthApp{} + obj.VerifiedAt = nil + + // Act & Assert + assert.Nil(t, obj.GetVerifiedAt(), "getter should return nil when property is nil") + }) + + t.Run("GetVerifiedAt_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingOauthApp // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetHostsConnected() // Should return zero value + _ = obj.GetVerifiedAt() // Should return zero value }) - t.Run("GetHostsFailed", func(t *testing.T) { + t.Run("GetConnections", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingCalendarDelegation{} + obj := &SchedulingOauthApp{} var expected int64 - obj.HostsFailed = expected + obj.Connections = expected // Act & Assert - assert.Equal(t, expected, obj.GetHostsFailed(), "getter should return the property value") + assert.Equal(t, expected, obj.GetConnections(), "getter should return the property value") }) - t.Run("GetHostsFailed_NilReceiver", func(t *testing.T) { + t.Run("GetConnections_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *SchedulingCalendarDelegation + var obj *SchedulingOauthApp // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetHostsFailed() // Should return zero value + _ = obj.GetConnections() // Should return zero value }) t.Run("GetCreatedAt", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingCalendarDelegation{} + obj := &SchedulingOauthApp{} var expected string obj.CreatedAt = expected @@ -88545,7 +99927,7 @@ func TestGettersSchedulingCalendarDelegation(t *testing.T) { t.Run("GetCreatedAt_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *SchedulingCalendarDelegation + var obj *SchedulingOauthApp // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -88558,7 +99940,7 @@ func TestGettersSchedulingCalendarDelegation(t *testing.T) { t.Run("GetUpdatedAt", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingCalendarDelegation{} + obj := &SchedulingOauthApp{} var expected string obj.UpdatedAt = expected @@ -88568,7 +99950,7 @@ func TestGettersSchedulingCalendarDelegation(t *testing.T) { t.Run("GetUpdatedAt_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *SchedulingCalendarDelegation + var obj *SchedulingOauthApp // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -88580,12 +99962,12 @@ func TestGettersSchedulingCalendarDelegation(t *testing.T) { } -func TestSettersMarkExplicitSchedulingCalendarDelegation(t *testing.T) { +func TestSettersMarkExplicitSchedulingOauthApp(t *testing.T) { t.Run("SetObject_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingCalendarDelegation{} - var fernTestValueObject SchedulingCalendarDelegationObject + obj := &SchedulingOauthApp{} + var fernTestValueObject SchedulingOauthAppObject // Act obj.SetObject(fernTestValueObject) @@ -88615,7 +99997,7 @@ func TestSettersMarkExplicitSchedulingCalendarDelegation(t *testing.T) { t.Run("SetID_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingCalendarDelegation{} + obj := &SchedulingOauthApp{} var fernTestValueID string // Act @@ -88646,8 +100028,8 @@ func TestSettersMarkExplicitSchedulingCalendarDelegation(t *testing.T) { t.Run("SetProvider_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingCalendarDelegation{} - var fernTestValueProvider SchedulingCalendarDelegationProvider + obj := &SchedulingOauthApp{} + var fernTestValueProvider SchedulingOauthAppProvider // Act obj.SetProvider(fernTestValueProvider) @@ -88674,76 +100056,14 @@ func TestSettersMarkExplicitSchedulingCalendarDelegation(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetDomain_MarksExplicit", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &SchedulingCalendarDelegation{} - var fernTestValueDomain string - - // Act - obj.SetDomain(fernTestValueDomain) - - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") - - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } - - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip - }) - - t.Run("SetStatus_MarksExplicit", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &SchedulingCalendarDelegation{} - var fernTestValueStatus SchedulingCalendarDelegationStatus - - // Act - obj.SetStatus(fernTestValueStatus) - - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") - - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } - - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip - }) - - t.Run("SetMatchHostEmail_MarksExplicit", func(t *testing.T) { + t.Run("SetClientID_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingCalendarDelegation{} - var fernTestValueMatchHostEmail bool + obj := &SchedulingOauthApp{} + var fernTestValueClientID string // Act - obj.SetMatchHostEmail(fernTestValueMatchHostEmail) + obj.SetClientID(fernTestValueClientID) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -88767,14 +100087,14 @@ func TestSettersMarkExplicitSchedulingCalendarDelegation(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetClientID_MarksExplicit", func(t *testing.T) { + t.Run("SetTenantID_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingCalendarDelegation{} - var fernTestValueClientID string + obj := &SchedulingOauthApp{} + var fernTestValueTenantID *string // Act - obj.SetClientID(fernTestValueClientID) + obj.SetTenantID(fernTestValueTenantID) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -88798,14 +100118,14 @@ func TestSettersMarkExplicitSchedulingCalendarDelegation(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetTenantID_MarksExplicit", func(t *testing.T) { + t.Run("SetRedirectURI_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingCalendarDelegation{} - var fernTestValueTenantID *string + obj := &SchedulingOauthApp{} + var fernTestValueRedirectURI *string // Act - obj.SetTenantID(fernTestValueTenantID) + obj.SetRedirectURI(fernTestValueRedirectURI) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -88829,14 +100149,14 @@ func TestSettersMarkExplicitSchedulingCalendarDelegation(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetScopes_MarksExplicit", func(t *testing.T) { + t.Run("SetCossCallbackURL_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingCalendarDelegation{} - var fernTestValueScopes []string + obj := &SchedulingOauthApp{} + var fernTestValueCossCallbackURL string // Act - obj.SetScopes(fernTestValueScopes) + obj.SetCossCallbackURL(fernTestValueCossCallbackURL) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -88860,14 +100180,14 @@ func TestSettersMarkExplicitSchedulingCalendarDelegation(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetVerifiedAccount_MarksExplicit", func(t *testing.T) { + t.Run("SetCompletionURL_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingCalendarDelegation{} - var fernTestValueVerifiedAccount *string + obj := &SchedulingOauthApp{} + var fernTestValueCompletionURL *string // Act - obj.SetVerifiedAccount(fernTestValueVerifiedAccount) + obj.SetCompletionURL(fernTestValueCompletionURL) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -88891,14 +100211,14 @@ func TestSettersMarkExplicitSchedulingCalendarDelegation(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetLastErrorCode_MarksExplicit", func(t *testing.T) { + t.Run("SetZoomEventURL_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingCalendarDelegation{} - var fernTestValueLastErrorCode *string + obj := &SchedulingOauthApp{} + var fernTestValueZoomEventURL *string // Act - obj.SetLastErrorCode(fernTestValueLastErrorCode) + obj.SetZoomEventURL(fernTestValueZoomEventURL) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -88922,14 +100242,14 @@ func TestSettersMarkExplicitSchedulingCalendarDelegation(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetFailingSince_MarksExplicit", func(t *testing.T) { + t.Run("SetScopes_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingCalendarDelegation{} - var fernTestValueFailingSince *string + obj := &SchedulingOauthApp{} + var fernTestValueScopes []string // Act - obj.SetFailingSince(fernTestValueFailingSince) + obj.SetScopes(fernTestValueScopes) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -88953,14 +100273,14 @@ func TestSettersMarkExplicitSchedulingCalendarDelegation(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetSecretExpiresAt_MarksExplicit", func(t *testing.T) { + t.Run("SetStatus_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingCalendarDelegation{} - var fernTestValueSecretExpiresAt *string + obj := &SchedulingOauthApp{} + var fernTestValueStatus SchedulingOauthAppStatus // Act - obj.SetSecretExpiresAt(fernTestValueSecretExpiresAt) + obj.SetStatus(fernTestValueStatus) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -88984,14 +100304,14 @@ func TestSettersMarkExplicitSchedulingCalendarDelegation(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetHostsConnected_MarksExplicit", func(t *testing.T) { + t.Run("SetLastErrorCode_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingCalendarDelegation{} - var fernTestValueHostsConnected int64 + obj := &SchedulingOauthApp{} + var fernTestValueLastErrorCode *string // Act - obj.SetHostsConnected(fernTestValueHostsConnected) + obj.SetLastErrorCode(fernTestValueLastErrorCode) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -89015,14 +100335,14 @@ func TestSettersMarkExplicitSchedulingCalendarDelegation(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetHostsFailed_MarksExplicit", func(t *testing.T) { + t.Run("SetLastErrorAt_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingCalendarDelegation{} - var fernTestValueHostsFailed int64 + obj := &SchedulingOauthApp{} + var fernTestValueLastErrorAt *string // Act - obj.SetHostsFailed(fernTestValueHostsFailed) + obj.SetLastErrorAt(fernTestValueLastErrorAt) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -89046,14 +100366,14 @@ func TestSettersMarkExplicitSchedulingCalendarDelegation(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetCreatedAt_MarksExplicit", func(t *testing.T) { + t.Run("SetSecretExpiresAt_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingCalendarDelegation{} - var fernTestValueCreatedAt string + obj := &SchedulingOauthApp{} + var fernTestValueSecretExpiresAt *string // Act - obj.SetCreatedAt(fernTestValueCreatedAt) + obj.SetSecretExpiresAt(fernTestValueSecretExpiresAt) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -89077,14 +100397,14 @@ func TestSettersMarkExplicitSchedulingCalendarDelegation(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetUpdatedAt_MarksExplicit", func(t *testing.T) { + t.Run("SetVerifiedAt_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingCalendarDelegation{} - var fernTestValueUpdatedAt string + obj := &SchedulingOauthApp{} + var fernTestValueVerifiedAt *string // Act - obj.SetUpdatedAt(fernTestValueUpdatedAt) + obj.SetVerifiedAt(fernTestValueVerifiedAt) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -89108,126 +100428,14 @@ func TestSettersMarkExplicitSchedulingCalendarDelegation(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) -} - -func TestSettersSchedulingCalendarDelegationList(t *testing.T) { - t.Run("SetObject", func(t *testing.T) { - obj := &SchedulingCalendarDelegationList{} - var fernTestValueObject SchedulingCalendarDelegationListObject - obj.SetObject(fernTestValueObject) - assert.Equal(t, fernTestValueObject, obj.Object) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetData", func(t *testing.T) { - obj := &SchedulingCalendarDelegationList{} - var fernTestValueData []*SchedulingCalendarDelegation - obj.SetData(fernTestValueData) - assert.Equal(t, fernTestValueData, obj.Data) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetHasMore", func(t *testing.T) { - obj := &SchedulingCalendarDelegationList{} - var fernTestValueHasMore bool - obj.SetHasMore(fernTestValueHasMore) - assert.Equal(t, fernTestValueHasMore, obj.HasMore) - assert.NotNil(t, obj.explicitFields) - }) - -} - -func TestGettersSchedulingCalendarDelegationList(t *testing.T) { - t.Run("GetObject", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &SchedulingCalendarDelegationList{} - var expected SchedulingCalendarDelegationListObject - obj.Object = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetObject(), "getter should return the property value") - }) - - t.Run("GetObject_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *SchedulingCalendarDelegationList - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetObject() // Should return zero value - }) - - t.Run("GetData", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &SchedulingCalendarDelegationList{} - var expected []*SchedulingCalendarDelegation - obj.Data = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetData(), "getter should return the property value") - }) - - t.Run("GetData_NilValue", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &SchedulingCalendarDelegationList{} - obj.Data = nil - - // Act & Assert - assert.Nil(t, obj.GetData(), "getter should return nil when property is nil") - }) - - t.Run("GetData_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *SchedulingCalendarDelegationList - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetData() // Should return zero value - }) - - t.Run("GetHasMore", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &SchedulingCalendarDelegationList{} - var expected bool - obj.HasMore = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetHasMore(), "getter should return the property value") - }) - - t.Run("GetHasMore_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *SchedulingCalendarDelegationList - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetHasMore() // Should return zero value - }) - -} - -func TestSettersMarkExplicitSchedulingCalendarDelegationList(t *testing.T) { - t.Run("SetObject_MarksExplicit", func(t *testing.T) { + t.Run("SetConnections_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingCalendarDelegationList{} - var fernTestValueObject SchedulingCalendarDelegationListObject + obj := &SchedulingOauthApp{} + var fernTestValueConnections int64 // Act - obj.SetObject(fernTestValueObject) + obj.SetConnections(fernTestValueConnections) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -89251,14 +100459,14 @@ func TestSettersMarkExplicitSchedulingCalendarDelegationList(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetData_MarksExplicit", func(t *testing.T) { + t.Run("SetCreatedAt_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingCalendarDelegationList{} - var fernTestValueData []*SchedulingCalendarDelegation + obj := &SchedulingOauthApp{} + var fernTestValueCreatedAt string // Act - obj.SetData(fernTestValueData) + obj.SetCreatedAt(fernTestValueCreatedAt) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -89282,14 +100490,14 @@ func TestSettersMarkExplicitSchedulingCalendarDelegationList(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetHasMore_MarksExplicit", func(t *testing.T) { + t.Run("SetUpdatedAt_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingCalendarDelegationList{} - var fernTestValueHasMore bool + obj := &SchedulingOauthApp{} + var fernTestValueUpdatedAt string // Act - obj.SetHasMore(fernTestValueHasMore) + obj.SetUpdatedAt(fernTestValueUpdatedAt) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -89315,25 +100523,25 @@ func TestSettersMarkExplicitSchedulingCalendarDelegationList(t *testing.T) { } -func TestSettersSchedulingCancelledSeries(t *testing.T) { +func TestSettersSchedulingOauthAppList(t *testing.T) { t.Run("SetObject", func(t *testing.T) { - obj := &SchedulingCancelledSeries{} - var fernTestValueObject SchedulingCancelledSeriesObject + obj := &SchedulingOauthAppList{} + var fernTestValueObject SchedulingOauthAppListObject obj.SetObject(fernTestValueObject) assert.Equal(t, fernTestValueObject, obj.Object) assert.NotNil(t, obj.explicitFields) }) t.Run("SetData", func(t *testing.T) { - obj := &SchedulingCancelledSeries{} - var fernTestValueData []*SchedulingBooking + obj := &SchedulingOauthAppList{} + var fernTestValueData []*SchedulingOauthApp obj.SetData(fernTestValueData) assert.Equal(t, fernTestValueData, obj.Data) assert.NotNil(t, obj.explicitFields) }) t.Run("SetHasMore", func(t *testing.T) { - obj := &SchedulingCancelledSeries{} + obj := &SchedulingOauthAppList{} var fernTestValueHasMore bool obj.SetHasMore(fernTestValueHasMore) assert.Equal(t, fernTestValueHasMore, obj.HasMore) @@ -89342,12 +100550,12 @@ func TestSettersSchedulingCancelledSeries(t *testing.T) { } -func TestGettersSchedulingCancelledSeries(t *testing.T) { +func TestGettersSchedulingOauthAppList(t *testing.T) { t.Run("GetObject", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingCancelledSeries{} - var expected SchedulingCancelledSeriesObject + obj := &SchedulingOauthAppList{} + var expected SchedulingOauthAppListObject obj.Object = expected // Act & Assert @@ -89356,7 +100564,7 @@ func TestGettersSchedulingCancelledSeries(t *testing.T) { t.Run("GetObject_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *SchedulingCancelledSeries + var obj *SchedulingOauthAppList // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -89369,8 +100577,8 @@ func TestGettersSchedulingCancelledSeries(t *testing.T) { t.Run("GetData", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingCancelledSeries{} - var expected []*SchedulingBooking + obj := &SchedulingOauthAppList{} + var expected []*SchedulingOauthApp obj.Data = expected // Act & Assert @@ -89380,7 +100588,7 @@ func TestGettersSchedulingCancelledSeries(t *testing.T) { t.Run("GetData_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingCancelledSeries{} + obj := &SchedulingOauthAppList{} obj.Data = nil // Act & Assert @@ -89389,7 +100597,7 @@ func TestGettersSchedulingCancelledSeries(t *testing.T) { t.Run("GetData_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *SchedulingCancelledSeries + var obj *SchedulingOauthAppList // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -89402,7 +100610,7 @@ func TestGettersSchedulingCancelledSeries(t *testing.T) { t.Run("GetHasMore", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingCancelledSeries{} + obj := &SchedulingOauthAppList{} var expected bool obj.HasMore = expected @@ -89412,7 +100620,7 @@ func TestGettersSchedulingCancelledSeries(t *testing.T) { t.Run("GetHasMore_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *SchedulingCancelledSeries + var obj *SchedulingOauthAppList // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -89424,12 +100632,12 @@ func TestGettersSchedulingCancelledSeries(t *testing.T) { } -func TestSettersMarkExplicitSchedulingCancelledSeries(t *testing.T) { +func TestSettersMarkExplicitSchedulingOauthAppList(t *testing.T) { t.Run("SetObject_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingCancelledSeries{} - var fernTestValueObject SchedulingCancelledSeriesObject + obj := &SchedulingOauthAppList{} + var fernTestValueObject SchedulingOauthAppListObject // Act obj.SetObject(fernTestValueObject) @@ -89459,8 +100667,8 @@ func TestSettersMarkExplicitSchedulingCancelledSeries(t *testing.T) { t.Run("SetData_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingCancelledSeries{} - var fernTestValueData []*SchedulingBooking + obj := &SchedulingOauthAppList{} + var fernTestValueData []*SchedulingOauthApp // Act obj.SetData(fernTestValueData) @@ -89490,7 +100698,7 @@ func TestSettersMarkExplicitSchedulingCancelledSeries(t *testing.T) { t.Run("SetHasMore_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingCancelledSeries{} + obj := &SchedulingOauthAppList{} var fernTestValueHasMore bool // Act @@ -89520,265 +100728,129 @@ func TestSettersMarkExplicitSchedulingCancelledSeries(t *testing.T) { } -func TestSettersSchedulingEventType(t *testing.T) { +func TestSettersSchedulingOutOfOffice(t *testing.T) { t.Run("SetObject", func(t *testing.T) { - obj := &SchedulingEventType{} - var fernTestValueObject SchedulingEventTypeObject + obj := &SchedulingOutOfOffice{} + var fernTestValueObject SchedulingOutOfOfficeObject obj.SetObject(fernTestValueObject) assert.Equal(t, fernTestValueObject, obj.Object) assert.NotNil(t, obj.explicitFields) }) t.Run("SetID", func(t *testing.T) { - obj := &SchedulingEventType{} + obj := &SchedulingOutOfOffice{} var fernTestValueID string obj.SetID(fernTestValueID) assert.Equal(t, fernTestValueID, obj.ID) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetUID", func(t *testing.T) { - obj := &SchedulingEventType{} - var fernTestValueUID *string - obj.SetUID(fernTestValueUID) - assert.Equal(t, fernTestValueUID, obj.UID) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetDescription", func(t *testing.T) { - obj := &SchedulingEventType{} - var fernTestValueDescription *string - obj.SetDescription(fernTestValueDescription) - assert.Equal(t, fernTestValueDescription, obj.Description) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetTitle", func(t *testing.T) { - obj := &SchedulingEventType{} - var fernTestValueTitle string - obj.SetTitle(fernTestValueTitle) - assert.Equal(t, fernTestValueTitle, obj.Title) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetKind", func(t *testing.T) { - obj := &SchedulingEventType{} - var fernTestValueKind SchedulingEventTypeKind - obj.SetKind(fernTestValueKind) - assert.Equal(t, fernTestValueKind, obj.Kind) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetStatus", func(t *testing.T) { - obj := &SchedulingEventType{} - var fernTestValueStatus SchedulingEventTypeStatus - obj.SetStatus(fernTestValueStatus) - assert.Equal(t, fernTestValueStatus, obj.Status) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetDurationMinutes", func(t *testing.T) { - obj := &SchedulingEventType{} - var fernTestValueDurationMinutes float64 - obj.SetDurationMinutes(fernTestValueDurationMinutes) - assert.Equal(t, fernTestValueDurationMinutes, obj.DurationMinutes) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetDurationOptions", func(t *testing.T) { - obj := &SchedulingEventType{} - var fernTestValueDurationOptions []float64 - obj.SetDurationOptions(fernTestValueDurationOptions) - assert.Equal(t, fernTestValueDurationOptions, obj.DurationOptions) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetStepMinutes", func(t *testing.T) { - obj := &SchedulingEventType{} - var fernTestValueStepMinutes float64 - obj.SetStepMinutes(fernTestValueStepMinutes) - assert.Equal(t, fernTestValueStepMinutes, obj.StepMinutes) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetGridTimeZone", func(t *testing.T) { - obj := &SchedulingEventType{} - var fernTestValueGridTimeZone *string - obj.SetGridTimeZone(fernTestValueGridTimeZone) - assert.Equal(t, fernTestValueGridTimeZone, obj.GridTimeZone) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetBufferBeforeMinutes", func(t *testing.T) { - obj := &SchedulingEventType{} - var fernTestValueBufferBeforeMinutes float64 - obj.SetBufferBeforeMinutes(fernTestValueBufferBeforeMinutes) - assert.Equal(t, fernTestValueBufferBeforeMinutes, obj.BufferBeforeMinutes) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetBufferAfterMinutes", func(t *testing.T) { - obj := &SchedulingEventType{} - var fernTestValueBufferAfterMinutes float64 - obj.SetBufferAfterMinutes(fernTestValueBufferAfterMinutes) - assert.Equal(t, fernTestValueBufferAfterMinutes, obj.BufferAfterMinutes) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetMinNoticeMinutes", func(t *testing.T) { - obj := &SchedulingEventType{} - var fernTestValueMinNoticeMinutes float64 - obj.SetMinNoticeMinutes(fernTestValueMinNoticeMinutes) - assert.Equal(t, fernTestValueMinNoticeMinutes, obj.MinNoticeMinutes) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetBookingWindow", func(t *testing.T) { - obj := &SchedulingEventType{} - var fernTestValueBookingWindow *SchedulingBookingWindow - obj.SetBookingWindow(fernTestValueBookingWindow) - assert.Equal(t, fernTestValueBookingWindow, obj.BookingWindow) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetLimits", func(t *testing.T) { - obj := &SchedulingEventType{} - var fernTestValueLimits []*SchedulingLimit - obj.SetLimits(fernTestValueLimits) - assert.Equal(t, fernTestValueLimits, obj.Limits) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetCapacity", func(t *testing.T) { - obj := &SchedulingEventType{} - var fernTestValueCapacity *float64 - obj.SetCapacity(fernTestValueCapacity) - assert.Equal(t, fernTestValueCapacity, obj.Capacity) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetRequiresApproval", func(t *testing.T) { - obj := &SchedulingEventType{} - var fernTestValueRequiresApproval bool - obj.SetRequiresApproval(fernTestValueRequiresApproval) - assert.Equal(t, fernTestValueRequiresApproval, obj.RequiresApproval) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetApprovalTTLMinutes", func(t *testing.T) { - obj := &SchedulingEventType{} - var fernTestValueApprovalTTLMinutes float64 - obj.SetApprovalTTLMinutes(fernTestValueApprovalTTLMinutes) - assert.Equal(t, fernTestValueApprovalTTLMinutes, obj.ApprovalTTLMinutes) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetHoldTTLSeconds", func(t *testing.T) { - obj := &SchedulingEventType{} - var fernTestValueHoldTTLSeconds float64 - obj.SetHoldTTLSeconds(fernTestValueHoldTTLSeconds) - assert.Equal(t, fernTestValueHoldTTLSeconds, obj.HoldTTLSeconds) + t.Run("SetHost", func(t *testing.T) { + obj := &SchedulingOutOfOffice{} + var fernTestValueHost string + obj.SetHost(fernTestValueHost) + assert.Equal(t, fernTestValueHost, obj.Host) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetCancelNoticeMinutes", func(t *testing.T) { - obj := &SchedulingEventType{} - var fernTestValueCancelNoticeMinutes float64 - obj.SetCancelNoticeMinutes(fernTestValueCancelNoticeMinutes) - assert.Equal(t, fernTestValueCancelNoticeMinutes, obj.CancelNoticeMinutes) + t.Run("SetStart", func(t *testing.T) { + obj := &SchedulingOutOfOffice{} + var fernTestValueStart string + obj.SetStart(fernTestValueStart) + assert.Equal(t, fernTestValueStart, obj.Start) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetRescheduleNoticeMinutes", func(t *testing.T) { - obj := &SchedulingEventType{} - var fernTestValueRescheduleNoticeMinutes float64 - obj.SetRescheduleNoticeMinutes(fernTestValueRescheduleNoticeMinutes) - assert.Equal(t, fernTestValueRescheduleNoticeMinutes, obj.RescheduleNoticeMinutes) + t.Run("SetEnd", func(t *testing.T) { + obj := &SchedulingOutOfOffice{} + var fernTestValueEnd string + obj.SetEnd(fernTestValueEnd) + assert.Equal(t, fernTestValueEnd, obj.End) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetMaxGuests", func(t *testing.T) { - obj := &SchedulingEventType{} - var fernTestValueMaxGuests float64 - obj.SetMaxGuests(fernTestValueMaxGuests) - assert.Equal(t, fernTestValueMaxGuests, obj.MaxGuests) + t.Run("SetAllDay", func(t *testing.T) { + obj := &SchedulingOutOfOffice{} + var fernTestValueAllDay *SchedulingOutOfOfficeAllDay + obj.SetAllDay(fernTestValueAllDay) + assert.Equal(t, fernTestValueAllDay, obj.AllDay) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetMaxActiveBookingsPerAttendee", func(t *testing.T) { - obj := &SchedulingEventType{} - var fernTestValueMaxActiveBookingsPerAttendee *float64 - obj.SetMaxActiveBookingsPerAttendee(fernTestValueMaxActiveBookingsPerAttendee) - assert.Equal(t, fernTestValueMaxActiveBookingsPerAttendee, obj.MaxActiveBookingsPerAttendee) + t.Run("SetReason", func(t *testing.T) { + obj := &SchedulingOutOfOffice{} + var fernTestValueReason string + obj.SetReason(fernTestValueReason) + assert.Equal(t, fernTestValueReason, obj.Reason) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetHostCalendarDetails", func(t *testing.T) { - obj := &SchedulingEventType{} - var fernTestValueHostCalendarDetails SchedulingEventTypeHostCalendarDetails - obj.SetHostCalendarDetails(fernTestValueHostCalendarDetails) - assert.Equal(t, fernTestValueHostCalendarDetails, obj.HostCalendarDetails) + t.Run("SetNotes", func(t *testing.T) { + obj := &SchedulingOutOfOffice{} + var fernTestValueNotes *string + obj.SetNotes(fernTestValueNotes) + assert.Equal(t, fernTestValueNotes, obj.Notes) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetQuestions", func(t *testing.T) { - obj := &SchedulingEventType{} - var fernTestValueQuestions []*SchedulingQuestion - obj.SetQuestions(fernTestValueQuestions) - assert.Equal(t, fernTestValueQuestions, obj.Questions) + t.Run("SetPublicMessage", func(t *testing.T) { + obj := &SchedulingOutOfOffice{} + var fernTestValuePublicMessage *string + obj.SetPublicMessage(fernTestValuePublicMessage) + assert.Equal(t, fernTestValuePublicMessage, obj.PublicMessage) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetLocations", func(t *testing.T) { - obj := &SchedulingEventType{} - var fernTestValueLocations []*SchedulingLocation - obj.SetLocations(fernTestValueLocations) - assert.Equal(t, fernTestValueLocations, obj.Locations) + t.Run("SetShowOnCalendar", func(t *testing.T) { + obj := &SchedulingOutOfOffice{} + var fernTestValueShowOnCalendar bool + obj.SetShowOnCalendar(fernTestValueShowOnCalendar) + assert.Equal(t, fernTestValueShowOnCalendar, obj.ShowOnCalendar) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetHostFilter", func(t *testing.T) { - obj := &SchedulingEventType{} - var fernTestValueHostFilter map[string]*SchedulingEventTypeHostFilterValue - obj.SetHostFilter(fernTestValueHostFilter) - assert.Equal(t, fernTestValueHostFilter, obj.HostFilter) + t.Run("SetDelegates", func(t *testing.T) { + obj := &SchedulingOutOfOffice{} + var fernTestValueDelegates []string + obj.SetDelegates(fernTestValueDelegates) + assert.Equal(t, fernTestValueDelegates, obj.Delegates) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetNotifications", func(t *testing.T) { - obj := &SchedulingEventType{} - var fernTestValueNotifications map[string]*SchedulingEventTypeNotificationsValue - obj.SetNotifications(fernTestValueNotifications) - assert.Equal(t, fernTestValueNotifications, obj.Notifications) + t.Run("SetExistingBookings", func(t *testing.T) { + obj := &SchedulingOutOfOffice{} + var fernTestValueExistingBookings SchedulingOutOfOfficeExistingBookings + obj.SetExistingBookings(fernTestValueExistingBookings) + assert.Equal(t, fernTestValueExistingBookings, obj.ExistingBookings) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetReminders", func(t *testing.T) { - obj := &SchedulingEventType{} - var fernTestValueReminders []*SchedulingReminder - obj.SetReminders(fernTestValueReminders) - assert.Equal(t, fernTestValueReminders, obj.Reminders) + t.Run("SetExternalID", func(t *testing.T) { + obj := &SchedulingOutOfOffice{} + var fernTestValueExternalID *string + obj.SetExternalID(fernTestValueExternalID) + assert.Equal(t, fernTestValueExternalID, obj.ExternalID) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetHosts", func(t *testing.T) { - obj := &SchedulingEventType{} - var fernTestValueHosts []*SchedulingEventTypeHostsItem - obj.SetHosts(fernTestValueHosts) - assert.Equal(t, fernTestValueHosts, obj.Hosts) + t.Run("SetGroup", func(t *testing.T) { + obj := &SchedulingOutOfOffice{} + var fernTestValueGroup *string + obj.SetGroup(fernTestValueGroup) + assert.Equal(t, fernTestValueGroup, obj.Group) assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetMetadata", func(t *testing.T) { - obj := &SchedulingEventType{} - var fernTestValueMetadata map[string]string - obj.SetMetadata(fernTestValueMetadata) - assert.Equal(t, fernTestValueMetadata, obj.Metadata) + }) + + t.Run("SetSource", func(t *testing.T) { + obj := &SchedulingOutOfOffice{} + var fernTestValueSource SchedulingOutOfOfficeSource + obj.SetSource(fernTestValueSource) + assert.Equal(t, fernTestValueSource, obj.Source) assert.NotNil(t, obj.explicitFields) }) t.Run("SetCreatedAt", func(t *testing.T) { - obj := &SchedulingEventType{} + obj := &SchedulingOutOfOffice{} var fernTestValueCreatedAt string obj.SetCreatedAt(fernTestValueCreatedAt) assert.Equal(t, fernTestValueCreatedAt, obj.CreatedAt) @@ -89786,7 +100858,7 @@ func TestSettersSchedulingEventType(t *testing.T) { }) t.Run("SetUpdatedAt", func(t *testing.T) { - obj := &SchedulingEventType{} + obj := &SchedulingOutOfOffice{} var fernTestValueUpdatedAt string obj.SetUpdatedAt(fernTestValueUpdatedAt) assert.Equal(t, fernTestValueUpdatedAt, obj.UpdatedAt) @@ -89795,12 +100867,12 @@ func TestSettersSchedulingEventType(t *testing.T) { } -func TestGettersSchedulingEventType(t *testing.T) { +func TestGettersSchedulingOutOfOffice(t *testing.T) { t.Run("GetObject", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingEventType{} - var expected SchedulingEventTypeObject + obj := &SchedulingOutOfOffice{} + var expected SchedulingOutOfOfficeObject obj.Object = expected // Act & Assert @@ -89809,7 +100881,7 @@ func TestGettersSchedulingEventType(t *testing.T) { t.Run("GetObject_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *SchedulingEventType + var obj *SchedulingOutOfOffice // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -89822,7 +100894,7 @@ func TestGettersSchedulingEventType(t *testing.T) { t.Run("GetID", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingEventType{} + obj := &SchedulingOutOfOffice{} var expected string obj.ID = expected @@ -89832,7 +100904,7 @@ func TestGettersSchedulingEventType(t *testing.T) { t.Run("GetID_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *SchedulingEventType + var obj *SchedulingOutOfOffice // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -89842,903 +100914,1545 @@ func TestGettersSchedulingEventType(t *testing.T) { _ = obj.GetID() // Should return zero value }) - t.Run("GetUID", func(t *testing.T) { + t.Run("GetHost", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingEventType{} - var expected *string - obj.UID = expected + obj := &SchedulingOutOfOffice{} + var expected string + obj.Host = expected // Act & Assert - assert.Equal(t, expected, obj.GetUID(), "getter should return the property value") + assert.Equal(t, expected, obj.GetHost(), "getter should return the property value") }) - t.Run("GetUID_NilValue", func(t *testing.T) { + t.Run("GetHost_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingOutOfOffice + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetHost() // Should return zero value + }) + + t.Run("GetStart", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingEventType{} - obj.UID = nil + obj := &SchedulingOutOfOffice{} + var expected string + obj.Start = expected // Act & Assert - assert.Nil(t, obj.GetUID(), "getter should return nil when property is nil") + assert.Equal(t, expected, obj.GetStart(), "getter should return the property value") }) - t.Run("GetUID_NilReceiver", func(t *testing.T) { + t.Run("GetStart_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *SchedulingEventType + var obj *SchedulingOutOfOffice // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetUID() // Should return zero value + _ = obj.GetStart() // Should return zero value }) - t.Run("GetDescription", func(t *testing.T) { + t.Run("GetEnd", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingEventType{} - var expected *string - obj.Description = expected + obj := &SchedulingOutOfOffice{} + var expected string + obj.End = expected // Act & Assert - assert.Equal(t, expected, obj.GetDescription(), "getter should return the property value") + assert.Equal(t, expected, obj.GetEnd(), "getter should return the property value") }) - t.Run("GetDescription_NilValue", func(t *testing.T) { + t.Run("GetEnd_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingOutOfOffice + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetEnd() // Should return zero value + }) + + t.Run("GetAllDay", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingEventType{} - obj.Description = nil + obj := &SchedulingOutOfOffice{} + var expected *SchedulingOutOfOfficeAllDay + obj.AllDay = expected // Act & Assert - assert.Nil(t, obj.GetDescription(), "getter should return nil when property is nil") + assert.Equal(t, expected, obj.GetAllDay(), "getter should return the property value") }) - t.Run("GetDescription_NilReceiver", func(t *testing.T) { + t.Run("GetAllDay_NilValue", func(t *testing.T) { t.Parallel() - var obj *SchedulingEventType + // Arrange + obj := &SchedulingOutOfOffice{} + obj.AllDay = nil + + // Act & Assert + assert.Nil(t, obj.GetAllDay(), "getter should return nil when property is nil") + }) + + t.Run("GetAllDay_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingOutOfOffice // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetDescription() // Should return zero value + _ = obj.GetAllDay() // Should return zero value }) - t.Run("GetTitle", func(t *testing.T) { + t.Run("GetReason", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingEventType{} + obj := &SchedulingOutOfOffice{} var expected string - obj.Title = expected + obj.Reason = expected // Act & Assert - assert.Equal(t, expected, obj.GetTitle(), "getter should return the property value") + assert.Equal(t, expected, obj.GetReason(), "getter should return the property value") }) - t.Run("GetTitle_NilReceiver", func(t *testing.T) { + t.Run("GetReason_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *SchedulingEventType + var obj *SchedulingOutOfOffice // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetTitle() // Should return zero value + _ = obj.GetReason() // Should return zero value }) - t.Run("GetKind", func(t *testing.T) { + t.Run("GetNotes", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingEventType{} - var expected SchedulingEventTypeKind - obj.Kind = expected + obj := &SchedulingOutOfOffice{} + var expected *string + obj.Notes = expected // Act & Assert - assert.Equal(t, expected, obj.GetKind(), "getter should return the property value") + assert.Equal(t, expected, obj.GetNotes(), "getter should return the property value") }) - t.Run("GetKind_NilReceiver", func(t *testing.T) { + t.Run("GetNotes_NilValue", func(t *testing.T) { t.Parallel() - var obj *SchedulingEventType + // Arrange + obj := &SchedulingOutOfOffice{} + obj.Notes = nil + + // Act & Assert + assert.Nil(t, obj.GetNotes(), "getter should return nil when property is nil") + }) + + t.Run("GetNotes_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingOutOfOffice // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetKind() // Should return zero value + _ = obj.GetNotes() // Should return zero value }) - t.Run("GetStatus", func(t *testing.T) { + t.Run("GetPublicMessage", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingEventType{} - var expected SchedulingEventTypeStatus - obj.Status = expected + obj := &SchedulingOutOfOffice{} + var expected *string + obj.PublicMessage = expected // Act & Assert - assert.Equal(t, expected, obj.GetStatus(), "getter should return the property value") + assert.Equal(t, expected, obj.GetPublicMessage(), "getter should return the property value") }) - t.Run("GetStatus_NilReceiver", func(t *testing.T) { + t.Run("GetPublicMessage_NilValue", func(t *testing.T) { t.Parallel() - var obj *SchedulingEventType + // Arrange + obj := &SchedulingOutOfOffice{} + obj.PublicMessage = nil + + // Act & Assert + assert.Nil(t, obj.GetPublicMessage(), "getter should return nil when property is nil") + }) + + t.Run("GetPublicMessage_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingOutOfOffice // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetStatus() // Should return zero value + _ = obj.GetPublicMessage() // Should return zero value }) - t.Run("GetDurationMinutes", func(t *testing.T) { + t.Run("GetShowOnCalendar", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingEventType{} - var expected float64 - obj.DurationMinutes = expected + obj := &SchedulingOutOfOffice{} + var expected bool + obj.ShowOnCalendar = expected // Act & Assert - assert.Equal(t, expected, obj.GetDurationMinutes(), "getter should return the property value") + assert.Equal(t, expected, obj.GetShowOnCalendar(), "getter should return the property value") }) - t.Run("GetDurationMinutes_NilReceiver", func(t *testing.T) { + t.Run("GetShowOnCalendar_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *SchedulingEventType + var obj *SchedulingOutOfOffice // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetDurationMinutes() // Should return zero value + _ = obj.GetShowOnCalendar() // Should return zero value }) - t.Run("GetDurationOptions", func(t *testing.T) { + t.Run("GetDelegates", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingEventType{} - var expected []float64 - obj.DurationOptions = expected + obj := &SchedulingOutOfOffice{} + var expected []string + obj.Delegates = expected // Act & Assert - assert.Equal(t, expected, obj.GetDurationOptions(), "getter should return the property value") + assert.Equal(t, expected, obj.GetDelegates(), "getter should return the property value") }) - t.Run("GetDurationOptions_NilValue", func(t *testing.T) { + t.Run("GetDelegates_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingEventType{} - obj.DurationOptions = nil + obj := &SchedulingOutOfOffice{} + obj.Delegates = nil // Act & Assert - assert.Nil(t, obj.GetDurationOptions(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetDelegates(), "getter should return nil when property is nil") }) - t.Run("GetDurationOptions_NilReceiver", func(t *testing.T) { + t.Run("GetDelegates_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *SchedulingEventType + var obj *SchedulingOutOfOffice // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetDurationOptions() // Should return zero value + _ = obj.GetDelegates() // Should return zero value }) - t.Run("GetStepMinutes", func(t *testing.T) { + t.Run("GetExistingBookings", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingEventType{} - var expected float64 - obj.StepMinutes = expected + obj := &SchedulingOutOfOffice{} + var expected SchedulingOutOfOfficeExistingBookings + obj.ExistingBookings = expected // Act & Assert - assert.Equal(t, expected, obj.GetStepMinutes(), "getter should return the property value") + assert.Equal(t, expected, obj.GetExistingBookings(), "getter should return the property value") }) - t.Run("GetStepMinutes_NilReceiver", func(t *testing.T) { + t.Run("GetExistingBookings_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *SchedulingEventType + var obj *SchedulingOutOfOffice // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetStepMinutes() // Should return zero value + _ = obj.GetExistingBookings() // Should return zero value }) - t.Run("GetGridTimeZone", func(t *testing.T) { + t.Run("GetExternalID", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingEventType{} + obj := &SchedulingOutOfOffice{} var expected *string - obj.GridTimeZone = expected + obj.ExternalID = expected // Act & Assert - assert.Equal(t, expected, obj.GetGridTimeZone(), "getter should return the property value") + assert.Equal(t, expected, obj.GetExternalID(), "getter should return the property value") }) - t.Run("GetGridTimeZone_NilValue", func(t *testing.T) { + t.Run("GetExternalID_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingEventType{} - obj.GridTimeZone = nil + obj := &SchedulingOutOfOffice{} + obj.ExternalID = nil // Act & Assert - assert.Nil(t, obj.GetGridTimeZone(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetExternalID(), "getter should return nil when property is nil") }) - t.Run("GetGridTimeZone_NilReceiver", func(t *testing.T) { + t.Run("GetExternalID_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *SchedulingEventType + var obj *SchedulingOutOfOffice // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetGridTimeZone() // Should return zero value + _ = obj.GetExternalID() // Should return zero value }) - t.Run("GetBufferBeforeMinutes", func(t *testing.T) { + t.Run("GetGroup", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingEventType{} - var expected float64 - obj.BufferBeforeMinutes = expected + obj := &SchedulingOutOfOffice{} + var expected *string + obj.Group = expected // Act & Assert - assert.Equal(t, expected, obj.GetBufferBeforeMinutes(), "getter should return the property value") + assert.Equal(t, expected, obj.GetGroup(), "getter should return the property value") }) - t.Run("GetBufferBeforeMinutes_NilReceiver", func(t *testing.T) { + t.Run("GetGroup_NilValue", func(t *testing.T) { t.Parallel() - var obj *SchedulingEventType + // Arrange + obj := &SchedulingOutOfOffice{} + obj.Group = nil + + // Act & Assert + assert.Nil(t, obj.GetGroup(), "getter should return nil when property is nil") + }) + + t.Run("GetGroup_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingOutOfOffice // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetBufferBeforeMinutes() // Should return zero value + _ = obj.GetGroup() // Should return zero value }) - t.Run("GetBufferAfterMinutes", func(t *testing.T) { + t.Run("GetSource", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingEventType{} - var expected float64 - obj.BufferAfterMinutes = expected + obj := &SchedulingOutOfOffice{} + var expected SchedulingOutOfOfficeSource + obj.Source = expected // Act & Assert - assert.Equal(t, expected, obj.GetBufferAfterMinutes(), "getter should return the property value") + assert.Equal(t, expected, obj.GetSource(), "getter should return the property value") }) - t.Run("GetBufferAfterMinutes_NilReceiver", func(t *testing.T) { + t.Run("GetSource_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *SchedulingEventType + var obj *SchedulingOutOfOffice // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetBufferAfterMinutes() // Should return zero value + _ = obj.GetSource() // Should return zero value }) - t.Run("GetMinNoticeMinutes", func(t *testing.T) { + t.Run("GetCreatedAt", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingEventType{} - var expected float64 - obj.MinNoticeMinutes = expected + obj := &SchedulingOutOfOffice{} + var expected string + obj.CreatedAt = expected // Act & Assert - assert.Equal(t, expected, obj.GetMinNoticeMinutes(), "getter should return the property value") + assert.Equal(t, expected, obj.GetCreatedAt(), "getter should return the property value") }) - t.Run("GetMinNoticeMinutes_NilReceiver", func(t *testing.T) { + t.Run("GetCreatedAt_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *SchedulingEventType + var obj *SchedulingOutOfOffice // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetMinNoticeMinutes() // Should return zero value - }) - - t.Run("GetBookingWindow", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &SchedulingEventType{} - var expected *SchedulingBookingWindow - obj.BookingWindow = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetBookingWindow(), "getter should return the property value") + _ = obj.GetCreatedAt() // Should return zero value }) - t.Run("GetBookingWindow_NilValue", func(t *testing.T) { + t.Run("GetUpdatedAt", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingEventType{} - obj.BookingWindow = nil + obj := &SchedulingOutOfOffice{} + var expected string + obj.UpdatedAt = expected // Act & Assert - assert.Nil(t, obj.GetBookingWindow(), "getter should return nil when property is nil") + assert.Equal(t, expected, obj.GetUpdatedAt(), "getter should return the property value") }) - t.Run("GetBookingWindow_NilReceiver", func(t *testing.T) { + t.Run("GetUpdatedAt_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *SchedulingEventType + var obj *SchedulingOutOfOffice // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetBookingWindow() // Should return zero value + _ = obj.GetUpdatedAt() // Should return zero value }) - t.Run("GetLimits", func(t *testing.T) { +} + +func TestSettersMarkExplicitSchedulingOutOfOffice(t *testing.T) { + t.Run("SetObject_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingEventType{} - var expected []*SchedulingLimit - obj.Limits = expected + obj := &SchedulingOutOfOffice{} + var fernTestValueObject SchedulingOutOfOfficeObject - // Act & Assert - assert.Equal(t, expected, obj.GetLimits(), "getter should return the property value") + // Act + obj.SetObject(fernTestValueObject) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("GetLimits_NilValue", func(t *testing.T) { + t.Run("SetID_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingEventType{} - obj.Limits = nil + obj := &SchedulingOutOfOffice{} + var fernTestValueID string - // Act & Assert - assert.Nil(t, obj.GetLimits(), "getter should return nil when property is nil") + // Act + obj.SetID(fernTestValueID) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("GetLimits_NilReceiver", func(t *testing.T) { + t.Run("SetHost_MarksExplicit", func(t *testing.T) { t.Parallel() - var obj *SchedulingEventType - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetLimits() // Should return zero value + // Arrange + obj := &SchedulingOutOfOffice{} + var fernTestValueHost string + + // Act + obj.SetHost(fernTestValueHost) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("GetCapacity", func(t *testing.T) { + t.Run("SetStart_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingEventType{} - var expected *float64 - obj.Capacity = expected + obj := &SchedulingOutOfOffice{} + var fernTestValueStart string - // Act & Assert - assert.Equal(t, expected, obj.GetCapacity(), "getter should return the property value") + // Act + obj.SetStart(fernTestValueStart) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("GetCapacity_NilValue", func(t *testing.T) { + t.Run("SetEnd_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingEventType{} - obj.Capacity = nil + obj := &SchedulingOutOfOffice{} + var fernTestValueEnd string - // Act & Assert - assert.Nil(t, obj.GetCapacity(), "getter should return nil when property is nil") + // Act + obj.SetEnd(fernTestValueEnd) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("GetCapacity_NilReceiver", func(t *testing.T) { + t.Run("SetAllDay_MarksExplicit", func(t *testing.T) { t.Parallel() - var obj *SchedulingEventType - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetCapacity() // Should return zero value + // Arrange + obj := &SchedulingOutOfOffice{} + var fernTestValueAllDay *SchedulingOutOfOfficeAllDay + + // Act + obj.SetAllDay(fernTestValueAllDay) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("GetRequiresApproval", func(t *testing.T) { + t.Run("SetReason_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingEventType{} - var expected bool - obj.RequiresApproval = expected + obj := &SchedulingOutOfOffice{} + var fernTestValueReason string - // Act & Assert - assert.Equal(t, expected, obj.GetRequiresApproval(), "getter should return the property value") + // Act + obj.SetReason(fernTestValueReason) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("GetRequiresApproval_NilReceiver", func(t *testing.T) { + t.Run("SetNotes_MarksExplicit", func(t *testing.T) { t.Parallel() - var obj *SchedulingEventType - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetRequiresApproval() // Should return zero value + // Arrange + obj := &SchedulingOutOfOffice{} + var fernTestValueNotes *string + + // Act + obj.SetNotes(fernTestValueNotes) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("GetApprovalTTLMinutes", func(t *testing.T) { + t.Run("SetPublicMessage_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingEventType{} - var expected float64 - obj.ApprovalTTLMinutes = expected + obj := &SchedulingOutOfOffice{} + var fernTestValuePublicMessage *string - // Act & Assert - assert.Equal(t, expected, obj.GetApprovalTTLMinutes(), "getter should return the property value") + // Act + obj.SetPublicMessage(fernTestValuePublicMessage) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("GetApprovalTTLMinutes_NilReceiver", func(t *testing.T) { + t.Run("SetShowOnCalendar_MarksExplicit", func(t *testing.T) { t.Parallel() - var obj *SchedulingEventType - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetApprovalTTLMinutes() // Should return zero value + // Arrange + obj := &SchedulingOutOfOffice{} + var fernTestValueShowOnCalendar bool + + // Act + obj.SetShowOnCalendar(fernTestValueShowOnCalendar) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("GetHoldTTLSeconds", func(t *testing.T) { + t.Run("SetDelegates_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingEventType{} - var expected float64 - obj.HoldTTLSeconds = expected + obj := &SchedulingOutOfOffice{} + var fernTestValueDelegates []string - // Act & Assert - assert.Equal(t, expected, obj.GetHoldTTLSeconds(), "getter should return the property value") + // Act + obj.SetDelegates(fernTestValueDelegates) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("GetHoldTTLSeconds_NilReceiver", func(t *testing.T) { + t.Run("SetExistingBookings_MarksExplicit", func(t *testing.T) { t.Parallel() - var obj *SchedulingEventType - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetHoldTTLSeconds() // Should return zero value + // Arrange + obj := &SchedulingOutOfOffice{} + var fernTestValueExistingBookings SchedulingOutOfOfficeExistingBookings + + // Act + obj.SetExistingBookings(fernTestValueExistingBookings) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("GetCancelNoticeMinutes", func(t *testing.T) { + t.Run("SetExternalID_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingEventType{} - var expected float64 - obj.CancelNoticeMinutes = expected + obj := &SchedulingOutOfOffice{} + var fernTestValueExternalID *string - // Act & Assert - assert.Equal(t, expected, obj.GetCancelNoticeMinutes(), "getter should return the property value") + // Act + obj.SetExternalID(fernTestValueExternalID) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("GetCancelNoticeMinutes_NilReceiver", func(t *testing.T) { + t.Run("SetGroup_MarksExplicit", func(t *testing.T) { t.Parallel() - var obj *SchedulingEventType - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetCancelNoticeMinutes() // Should return zero value + // Arrange + obj := &SchedulingOutOfOffice{} + var fernTestValueGroup *string + + // Act + obj.SetGroup(fernTestValueGroup) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("GetRescheduleNoticeMinutes", func(t *testing.T) { + t.Run("SetSource_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingEventType{} - var expected float64 - obj.RescheduleNoticeMinutes = expected + obj := &SchedulingOutOfOffice{} + var fernTestValueSource SchedulingOutOfOfficeSource - // Act & Assert - assert.Equal(t, expected, obj.GetRescheduleNoticeMinutes(), "getter should return the property value") + // Act + obj.SetSource(fernTestValueSource) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("GetRescheduleNoticeMinutes_NilReceiver", func(t *testing.T) { + t.Run("SetCreatedAt_MarksExplicit", func(t *testing.T) { t.Parallel() - var obj *SchedulingEventType - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetRescheduleNoticeMinutes() // Should return zero value + // Arrange + obj := &SchedulingOutOfOffice{} + var fernTestValueCreatedAt string + + // Act + obj.SetCreatedAt(fernTestValueCreatedAt) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("GetMaxGuests", func(t *testing.T) { + t.Run("SetUpdatedAt_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingEventType{} - var expected float64 - obj.MaxGuests = expected + obj := &SchedulingOutOfOffice{} + var fernTestValueUpdatedAt string + + // Act + obj.SetUpdatedAt(fernTestValueUpdatedAt) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + +} + +func TestSettersSchedulingOutOfOfficeAllDay(t *testing.T) { + t.Run("SetStartDate", func(t *testing.T) { + obj := &SchedulingOutOfOfficeAllDay{} + var fernTestValueStartDate string + obj.SetStartDate(fernTestValueStartDate) + assert.Equal(t, fernTestValueStartDate, obj.StartDate) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetEndDate", func(t *testing.T) { + obj := &SchedulingOutOfOfficeAllDay{} + var fernTestValueEndDate string + obj.SetEndDate(fernTestValueEndDate) + assert.Equal(t, fernTestValueEndDate, obj.EndDate) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetTimeZone", func(t *testing.T) { + obj := &SchedulingOutOfOfficeAllDay{} + var fernTestValueTimeZone string + obj.SetTimeZone(fernTestValueTimeZone) + assert.Equal(t, fernTestValueTimeZone, obj.TimeZone) + assert.NotNil(t, obj.explicitFields) + }) + +} + +func TestGettersSchedulingOutOfOfficeAllDay(t *testing.T) { + t.Run("GetStartDate", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingOutOfOfficeAllDay{} + var expected string + obj.StartDate = expected // Act & Assert - assert.Equal(t, expected, obj.GetMaxGuests(), "getter should return the property value") + assert.Equal(t, expected, obj.GetStartDate(), "getter should return the property value") }) - t.Run("GetMaxGuests_NilReceiver", func(t *testing.T) { + t.Run("GetStartDate_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *SchedulingEventType + var obj *SchedulingOutOfOfficeAllDay // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetMaxGuests() // Should return zero value - }) - - t.Run("GetMaxActiveBookingsPerAttendee", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &SchedulingEventType{} - var expected *float64 - obj.MaxActiveBookingsPerAttendee = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetMaxActiveBookingsPerAttendee(), "getter should return the property value") + _ = obj.GetStartDate() // Should return zero value }) - t.Run("GetMaxActiveBookingsPerAttendee_NilValue", func(t *testing.T) { + t.Run("GetEndDate", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingEventType{} - obj.MaxActiveBookingsPerAttendee = nil + obj := &SchedulingOutOfOfficeAllDay{} + var expected string + obj.EndDate = expected // Act & Assert - assert.Nil(t, obj.GetMaxActiveBookingsPerAttendee(), "getter should return nil when property is nil") + assert.Equal(t, expected, obj.GetEndDate(), "getter should return the property value") }) - t.Run("GetMaxActiveBookingsPerAttendee_NilReceiver", func(t *testing.T) { + t.Run("GetEndDate_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *SchedulingEventType + var obj *SchedulingOutOfOfficeAllDay // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetMaxActiveBookingsPerAttendee() // Should return zero value + _ = obj.GetEndDate() // Should return zero value }) - t.Run("GetHostCalendarDetails", func(t *testing.T) { + t.Run("GetTimeZone", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingEventType{} - var expected SchedulingEventTypeHostCalendarDetails - obj.HostCalendarDetails = expected + obj := &SchedulingOutOfOfficeAllDay{} + var expected string + obj.TimeZone = expected // Act & Assert - assert.Equal(t, expected, obj.GetHostCalendarDetails(), "getter should return the property value") + assert.Equal(t, expected, obj.GetTimeZone(), "getter should return the property value") }) - t.Run("GetHostCalendarDetails_NilReceiver", func(t *testing.T) { + t.Run("GetTimeZone_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *SchedulingEventType + var obj *SchedulingOutOfOfficeAllDay // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetHostCalendarDetails() // Should return zero value + _ = obj.GetTimeZone() // Should return zero value }) - t.Run("GetQuestions", func(t *testing.T) { +} + +func TestSettersMarkExplicitSchedulingOutOfOfficeAllDay(t *testing.T) { + t.Run("SetStartDate_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingEventType{} - var expected []*SchedulingQuestion - obj.Questions = expected + obj := &SchedulingOutOfOfficeAllDay{} + var fernTestValueStartDate string - // Act & Assert - assert.Equal(t, expected, obj.GetQuestions(), "getter should return the property value") + // Act + obj.SetStartDate(fernTestValueStartDate) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("GetQuestions_NilValue", func(t *testing.T) { + t.Run("SetEndDate_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingEventType{} - obj.Questions = nil + obj := &SchedulingOutOfOfficeAllDay{} + var fernTestValueEndDate string - // Act & Assert - assert.Nil(t, obj.GetQuestions(), "getter should return nil when property is nil") - }) + // Act + obj.SetEndDate(fernTestValueEndDate) - t.Run("GetQuestions_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *SchedulingEventType - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetQuestions() // Should return zero value + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("GetLocations", func(t *testing.T) { + t.Run("SetTimeZone_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingEventType{} - var expected []*SchedulingLocation - obj.Locations = expected + obj := &SchedulingOutOfOfficeAllDay{} + var fernTestValueTimeZone string - // Act & Assert - assert.Equal(t, expected, obj.GetLocations(), "getter should return the property value") + // Act + obj.SetTimeZone(fernTestValueTimeZone) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("GetLocations_NilValue", func(t *testing.T) { +} + +func TestSettersSchedulingOutOfOfficeConflict(t *testing.T) { + t.Run("SetObject", func(t *testing.T) { + obj := &SchedulingOutOfOfficeConflict{} + var fernTestValueObject SchedulingOutOfOfficeConflictObject + obj.SetObject(fernTestValueObject) + assert.Equal(t, fernTestValueObject, obj.Object) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetBooking", func(t *testing.T) { + obj := &SchedulingOutOfOfficeConflict{} + var fernTestValueBooking string + obj.SetBooking(fernTestValueBooking) + assert.Equal(t, fernTestValueBooking, obj.Booking) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetEventType", func(t *testing.T) { + obj := &SchedulingOutOfOfficeConflict{} + var fernTestValueEventType string + obj.SetEventType(fernTestValueEventType) + assert.Equal(t, fernTestValueEventType, obj.EventType) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetTitle", func(t *testing.T) { + obj := &SchedulingOutOfOfficeConflict{} + var fernTestValueTitle string + obj.SetTitle(fernTestValueTitle) + assert.Equal(t, fernTestValueTitle, obj.Title) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetStatus", func(t *testing.T) { + obj := &SchedulingOutOfOfficeConflict{} + var fernTestValueStatus SchedulingOutOfOfficeConflictStatus + obj.SetStatus(fernTestValueStatus) + assert.Equal(t, fernTestValueStatus, obj.Status) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetStart", func(t *testing.T) { + obj := &SchedulingOutOfOfficeConflict{} + var fernTestValueStart string + obj.SetStart(fernTestValueStart) + assert.Equal(t, fernTestValueStart, obj.Start) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetEnd", func(t *testing.T) { + obj := &SchedulingOutOfOfficeConflict{} + var fernTestValueEnd string + obj.SetEnd(fernTestValueEnd) + assert.Equal(t, fernTestValueEnd, obj.End) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetSeries", func(t *testing.T) { + obj := &SchedulingOutOfOfficeConflict{} + var fernTestValueSeries *string + obj.SetSeries(fernTestValueSeries) + assert.Equal(t, fernTestValueSeries, obj.Series) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetGroupSession", func(t *testing.T) { + obj := &SchedulingOutOfOfficeConflict{} + var fernTestValueGroupSession *string + obj.SetGroupSession(fernTestValueGroupSession) + assert.Equal(t, fernTestValueGroupSession, obj.GroupSession) + assert.NotNil(t, obj.explicitFields) + }) + +} + +func TestGettersSchedulingOutOfOfficeConflict(t *testing.T) { + t.Run("GetObject", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingEventType{} - obj.Locations = nil + obj := &SchedulingOutOfOfficeConflict{} + var expected SchedulingOutOfOfficeConflictObject + obj.Object = expected // Act & Assert - assert.Nil(t, obj.GetLocations(), "getter should return nil when property is nil") + assert.Equal(t, expected, obj.GetObject(), "getter should return the property value") }) - t.Run("GetLocations_NilReceiver", func(t *testing.T) { + t.Run("GetObject_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *SchedulingEventType + var obj *SchedulingOutOfOfficeConflict // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetLocations() // Should return zero value + _ = obj.GetObject() // Should return zero value }) - t.Run("GetHostFilter", func(t *testing.T) { + t.Run("GetBooking", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingEventType{} - var expected map[string]*SchedulingEventTypeHostFilterValue - obj.HostFilter = expected + obj := &SchedulingOutOfOfficeConflict{} + var expected string + obj.Booking = expected // Act & Assert - assert.Equal(t, expected, obj.GetHostFilter(), "getter should return the property value") + assert.Equal(t, expected, obj.GetBooking(), "getter should return the property value") }) - t.Run("GetHostFilter_NilValue", func(t *testing.T) { + t.Run("GetBooking_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingOutOfOfficeConflict + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetBooking() // Should return zero value + }) + + t.Run("GetEventType", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingEventType{} - obj.HostFilter = nil + obj := &SchedulingOutOfOfficeConflict{} + var expected string + obj.EventType = expected // Act & Assert - assert.Nil(t, obj.GetHostFilter(), "getter should return nil when property is nil") + assert.Equal(t, expected, obj.GetEventType(), "getter should return the property value") }) - t.Run("GetHostFilter_NilReceiver", func(t *testing.T) { + t.Run("GetEventType_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *SchedulingEventType + var obj *SchedulingOutOfOfficeConflict // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetHostFilter() // Should return zero value + _ = obj.GetEventType() // Should return zero value }) - t.Run("GetNotifications", func(t *testing.T) { + t.Run("GetTitle", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingEventType{} - var expected map[string]*SchedulingEventTypeNotificationsValue - obj.Notifications = expected + obj := &SchedulingOutOfOfficeConflict{} + var expected string + obj.Title = expected // Act & Assert - assert.Equal(t, expected, obj.GetNotifications(), "getter should return the property value") + assert.Equal(t, expected, obj.GetTitle(), "getter should return the property value") }) - t.Run("GetNotifications_NilValue", func(t *testing.T) { + t.Run("GetTitle_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingOutOfOfficeConflict + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetTitle() // Should return zero value + }) + + t.Run("GetStatus", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingEventType{} - obj.Notifications = nil + obj := &SchedulingOutOfOfficeConflict{} + var expected SchedulingOutOfOfficeConflictStatus + obj.Status = expected // Act & Assert - assert.Nil(t, obj.GetNotifications(), "getter should return nil when property is nil") + assert.Equal(t, expected, obj.GetStatus(), "getter should return the property value") }) - t.Run("GetNotifications_NilReceiver", func(t *testing.T) { + t.Run("GetStatus_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *SchedulingEventType + var obj *SchedulingOutOfOfficeConflict // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetNotifications() // Should return zero value + _ = obj.GetStatus() // Should return zero value }) - t.Run("GetReminders", func(t *testing.T) { + t.Run("GetStart", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingEventType{} - var expected []*SchedulingReminder - obj.Reminders = expected + obj := &SchedulingOutOfOfficeConflict{} + var expected string + obj.Start = expected // Act & Assert - assert.Equal(t, expected, obj.GetReminders(), "getter should return the property value") + assert.Equal(t, expected, obj.GetStart(), "getter should return the property value") }) - t.Run("GetReminders_NilValue", func(t *testing.T) { + t.Run("GetStart_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingOutOfOfficeConflict + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetStart() // Should return zero value + }) + + t.Run("GetEnd", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingEventType{} - obj.Reminders = nil + obj := &SchedulingOutOfOfficeConflict{} + var expected string + obj.End = expected // Act & Assert - assert.Nil(t, obj.GetReminders(), "getter should return nil when property is nil") + assert.Equal(t, expected, obj.GetEnd(), "getter should return the property value") }) - t.Run("GetReminders_NilReceiver", func(t *testing.T) { + t.Run("GetEnd_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *SchedulingEventType + var obj *SchedulingOutOfOfficeConflict // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetReminders() // Should return zero value + _ = obj.GetEnd() // Should return zero value }) - t.Run("GetHosts", func(t *testing.T) { + t.Run("GetSeries", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingEventType{} - var expected []*SchedulingEventTypeHostsItem - obj.Hosts = expected + obj := &SchedulingOutOfOfficeConflict{} + var expected *string + obj.Series = expected // Act & Assert - assert.Equal(t, expected, obj.GetHosts(), "getter should return the property value") + assert.Equal(t, expected, obj.GetSeries(), "getter should return the property value") }) - t.Run("GetHosts_NilValue", func(t *testing.T) { + t.Run("GetSeries_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingEventType{} - obj.Hosts = nil + obj := &SchedulingOutOfOfficeConflict{} + obj.Series = nil // Act & Assert - assert.Nil(t, obj.GetHosts(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetSeries(), "getter should return nil when property is nil") }) - t.Run("GetHosts_NilReceiver", func(t *testing.T) { + t.Run("GetSeries_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *SchedulingEventType + var obj *SchedulingOutOfOfficeConflict // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetHosts() // Should return zero value + _ = obj.GetSeries() // Should return zero value }) - t.Run("GetMetadata", func(t *testing.T) { + t.Run("GetGroupSession", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingEventType{} - var expected map[string]string - obj.Metadata = expected + obj := &SchedulingOutOfOfficeConflict{} + var expected *string + obj.GroupSession = expected // Act & Assert - assert.Equal(t, expected, obj.GetMetadata(), "getter should return the property value") + assert.Equal(t, expected, obj.GetGroupSession(), "getter should return the property value") }) - t.Run("GetMetadata_NilValue", func(t *testing.T) { + t.Run("GetGroupSession_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingEventType{} - obj.Metadata = nil + obj := &SchedulingOutOfOfficeConflict{} + obj.GroupSession = nil // Act & Assert - assert.Nil(t, obj.GetMetadata(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetGroupSession(), "getter should return nil when property is nil") }) - t.Run("GetMetadata_NilReceiver", func(t *testing.T) { + t.Run("GetGroupSession_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *SchedulingEventType + var obj *SchedulingOutOfOfficeConflict // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetMetadata() // Should return zero value + _ = obj.GetGroupSession() // Should return zero value }) - t.Run("GetCreatedAt", func(t *testing.T) { +} + +func TestSettersMarkExplicitSchedulingOutOfOfficeConflict(t *testing.T) { + t.Run("SetObject_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingEventType{} - var expected string - obj.CreatedAt = expected + obj := &SchedulingOutOfOfficeConflict{} + var fernTestValueObject SchedulingOutOfOfficeConflictObject - // Act & Assert - assert.Equal(t, expected, obj.GetCreatedAt(), "getter should return the property value") - }) + // Act + obj.SetObject(fernTestValueObject) - t.Run("GetCreatedAt_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *SchedulingEventType - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetCreatedAt() // Should return zero value + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("GetUpdatedAt", func(t *testing.T) { + t.Run("SetBooking_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingEventType{} - var expected string - obj.UpdatedAt = expected + obj := &SchedulingOutOfOfficeConflict{} + var fernTestValueBooking string - // Act & Assert - assert.Equal(t, expected, obj.GetUpdatedAt(), "getter should return the property value") + // Act + obj.SetBooking(fernTestValueBooking) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("GetUpdatedAt_NilReceiver", func(t *testing.T) { + t.Run("SetEventType_MarksExplicit", func(t *testing.T) { t.Parallel() - var obj *SchedulingEventType - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetUpdatedAt() // Should return zero value - }) + // Arrange + obj := &SchedulingOutOfOfficeConflict{} + var fernTestValueEventType string -} + // Act + obj.SetEventType(fernTestValueEventType) -func TestSettersMarkExplicitSchedulingEventType(t *testing.T) { - t.Run("SetObject_MarksExplicit", func(t *testing.T) { + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetTitle_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingEventType{} - var fernTestValueObject SchedulingEventTypeObject + obj := &SchedulingOutOfOfficeConflict{} + var fernTestValueTitle string // Act - obj.SetObject(fernTestValueObject) + obj.SetTitle(fernTestValueTitle) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -90762,14 +102476,14 @@ func TestSettersMarkExplicitSchedulingEventType(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetID_MarksExplicit", func(t *testing.T) { + t.Run("SetStatus_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingEventType{} - var fernTestValueID string + obj := &SchedulingOutOfOfficeConflict{} + var fernTestValueStatus SchedulingOutOfOfficeConflictStatus // Act - obj.SetID(fernTestValueID) + obj.SetStatus(fernTestValueStatus) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -90793,14 +102507,14 @@ func TestSettersMarkExplicitSchedulingEventType(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetUID_MarksExplicit", func(t *testing.T) { + t.Run("SetStart_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingEventType{} - var fernTestValueUID *string + obj := &SchedulingOutOfOfficeConflict{} + var fernTestValueStart string // Act - obj.SetUID(fernTestValueUID) + obj.SetStart(fernTestValueStart) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -90824,14 +102538,14 @@ func TestSettersMarkExplicitSchedulingEventType(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetDescription_MarksExplicit", func(t *testing.T) { + t.Run("SetEnd_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingEventType{} - var fernTestValueDescription *string + obj := &SchedulingOutOfOfficeConflict{} + var fernTestValueEnd string // Act - obj.SetDescription(fernTestValueDescription) + obj.SetEnd(fernTestValueEnd) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -90855,14 +102569,14 @@ func TestSettersMarkExplicitSchedulingEventType(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetTitle_MarksExplicit", func(t *testing.T) { + t.Run("SetSeries_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingEventType{} - var fernTestValueTitle string + obj := &SchedulingOutOfOfficeConflict{} + var fernTestValueSeries *string // Act - obj.SetTitle(fernTestValueTitle) + obj.SetSeries(fernTestValueSeries) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -90886,14 +102600,14 @@ func TestSettersMarkExplicitSchedulingEventType(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetKind_MarksExplicit", func(t *testing.T) { + t.Run("SetGroupSession_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingEventType{} - var fernTestValueKind SchedulingEventTypeKind + obj := &SchedulingOutOfOfficeConflict{} + var fernTestValueGroupSession *string // Act - obj.SetKind(fernTestValueKind) + obj.SetGroupSession(fernTestValueGroupSession) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -90917,14 +102631,126 @@ func TestSettersMarkExplicitSchedulingEventType(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetStatus_MarksExplicit", func(t *testing.T) { +} + +func TestSettersSchedulingOutOfOfficeConflictList(t *testing.T) { + t.Run("SetObject", func(t *testing.T) { + obj := &SchedulingOutOfOfficeConflictList{} + var fernTestValueObject SchedulingOutOfOfficeConflictListObject + obj.SetObject(fernTestValueObject) + assert.Equal(t, fernTestValueObject, obj.Object) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetData", func(t *testing.T) { + obj := &SchedulingOutOfOfficeConflictList{} + var fernTestValueData []*SchedulingOutOfOfficeConflict + obj.SetData(fernTestValueData) + assert.Equal(t, fernTestValueData, obj.Data) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetHasMore", func(t *testing.T) { + obj := &SchedulingOutOfOfficeConflictList{} + var fernTestValueHasMore bool + obj.SetHasMore(fernTestValueHasMore) + assert.Equal(t, fernTestValueHasMore, obj.HasMore) + assert.NotNil(t, obj.explicitFields) + }) + +} + +func TestGettersSchedulingOutOfOfficeConflictList(t *testing.T) { + t.Run("GetObject", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingEventType{} - var fernTestValueStatus SchedulingEventTypeStatus + obj := &SchedulingOutOfOfficeConflictList{} + var expected SchedulingOutOfOfficeConflictListObject + obj.Object = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetObject(), "getter should return the property value") + }) + + t.Run("GetObject_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingOutOfOfficeConflictList + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetObject() // Should return zero value + }) + + t.Run("GetData", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingOutOfOfficeConflictList{} + var expected []*SchedulingOutOfOfficeConflict + obj.Data = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetData(), "getter should return the property value") + }) + + t.Run("GetData_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingOutOfOfficeConflictList{} + obj.Data = nil + + // Act & Assert + assert.Nil(t, obj.GetData(), "getter should return nil when property is nil") + }) + + t.Run("GetData_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingOutOfOfficeConflictList + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetData() // Should return zero value + }) + + t.Run("GetHasMore", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingOutOfOfficeConflictList{} + var expected bool + obj.HasMore = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetHasMore(), "getter should return the property value") + }) + + t.Run("GetHasMore_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingOutOfOfficeConflictList + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetHasMore() // Should return zero value + }) + +} + +func TestSettersMarkExplicitSchedulingOutOfOfficeConflictList(t *testing.T) { + t.Run("SetObject_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingOutOfOfficeConflictList{} + var fernTestValueObject SchedulingOutOfOfficeConflictListObject // Act - obj.SetStatus(fernTestValueStatus) + obj.SetObject(fernTestValueObject) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -90948,14 +102774,14 @@ func TestSettersMarkExplicitSchedulingEventType(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetDurationMinutes_MarksExplicit", func(t *testing.T) { + t.Run("SetData_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingEventType{} - var fernTestValueDurationMinutes float64 + obj := &SchedulingOutOfOfficeConflictList{} + var fernTestValueData []*SchedulingOutOfOfficeConflict // Act - obj.SetDurationMinutes(fernTestValueDurationMinutes) + obj.SetData(fernTestValueData) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -90979,14 +102805,14 @@ func TestSettersMarkExplicitSchedulingEventType(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetDurationOptions_MarksExplicit", func(t *testing.T) { + t.Run("SetHasMore_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingEventType{} - var fernTestValueDurationOptions []float64 + obj := &SchedulingOutOfOfficeConflictList{} + var fernTestValueHasMore bool // Act - obj.SetDurationOptions(fernTestValueDurationOptions) + obj.SetHasMore(fernTestValueHasMore) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -91010,14 +102836,126 @@ func TestSettersMarkExplicitSchedulingEventType(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetStepMinutes_MarksExplicit", func(t *testing.T) { +} + +func TestSettersSchedulingOutOfOfficeList(t *testing.T) { + t.Run("SetObject", func(t *testing.T) { + obj := &SchedulingOutOfOfficeList{} + var fernTestValueObject SchedulingOutOfOfficeListObject + obj.SetObject(fernTestValueObject) + assert.Equal(t, fernTestValueObject, obj.Object) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetData", func(t *testing.T) { + obj := &SchedulingOutOfOfficeList{} + var fernTestValueData []*SchedulingOutOfOffice + obj.SetData(fernTestValueData) + assert.Equal(t, fernTestValueData, obj.Data) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetHasMore", func(t *testing.T) { + obj := &SchedulingOutOfOfficeList{} + var fernTestValueHasMore bool + obj.SetHasMore(fernTestValueHasMore) + assert.Equal(t, fernTestValueHasMore, obj.HasMore) + assert.NotNil(t, obj.explicitFields) + }) + +} + +func TestGettersSchedulingOutOfOfficeList(t *testing.T) { + t.Run("GetObject", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingEventType{} - var fernTestValueStepMinutes float64 + obj := &SchedulingOutOfOfficeList{} + var expected SchedulingOutOfOfficeListObject + obj.Object = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetObject(), "getter should return the property value") + }) + + t.Run("GetObject_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingOutOfOfficeList + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetObject() // Should return zero value + }) + + t.Run("GetData", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingOutOfOfficeList{} + var expected []*SchedulingOutOfOffice + obj.Data = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetData(), "getter should return the property value") + }) + + t.Run("GetData_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingOutOfOfficeList{} + obj.Data = nil + + // Act & Assert + assert.Nil(t, obj.GetData(), "getter should return nil when property is nil") + }) + + t.Run("GetData_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingOutOfOfficeList + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetData() // Should return zero value + }) + + t.Run("GetHasMore", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingOutOfOfficeList{} + var expected bool + obj.HasMore = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetHasMore(), "getter should return the property value") + }) + + t.Run("GetHasMore_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingOutOfOfficeList + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetHasMore() // Should return zero value + }) + +} + +func TestSettersMarkExplicitSchedulingOutOfOfficeList(t *testing.T) { + t.Run("SetObject_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingOutOfOfficeList{} + var fernTestValueObject SchedulingOutOfOfficeListObject // Act - obj.SetStepMinutes(fernTestValueStepMinutes) + obj.SetObject(fernTestValueObject) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -91041,14 +102979,14 @@ func TestSettersMarkExplicitSchedulingEventType(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetGridTimeZone_MarksExplicit", func(t *testing.T) { + t.Run("SetData_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingEventType{} - var fernTestValueGridTimeZone *string + obj := &SchedulingOutOfOfficeList{} + var fernTestValueData []*SchedulingOutOfOffice // Act - obj.SetGridTimeZone(fernTestValueGridTimeZone) + obj.SetData(fernTestValueData) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -91072,14 +103010,14 @@ func TestSettersMarkExplicitSchedulingEventType(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetBufferBeforeMinutes_MarksExplicit", func(t *testing.T) { + t.Run("SetHasMore_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingEventType{} - var fernTestValueBufferBeforeMinutes float64 + obj := &SchedulingOutOfOfficeList{} + var fernTestValueHasMore bool // Act - obj.SetBufferBeforeMinutes(fernTestValueBufferBeforeMinutes) + obj.SetHasMore(fernTestValueHasMore) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -91103,14 +103041,198 @@ func TestSettersMarkExplicitSchedulingEventType(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetBufferAfterMinutes_MarksExplicit", func(t *testing.T) { +} + +func TestSettersSchedulingQuestion(t *testing.T) { + t.Run("SetKey", func(t *testing.T) { + obj := &SchedulingQuestion{} + var fernTestValueKey string + obj.SetKey(fernTestValueKey) + assert.Equal(t, fernTestValueKey, obj.Key) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetType", func(t *testing.T) { + obj := &SchedulingQuestion{} + var fernTestValueType SchedulingQuestionType + obj.SetType(fernTestValueType) + assert.Equal(t, fernTestValueType, obj.Type) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetLabel", func(t *testing.T) { + obj := &SchedulingQuestion{} + var fernTestValueLabel string + obj.SetLabel(fernTestValueLabel) + assert.Equal(t, fernTestValueLabel, obj.Label) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetRequired", func(t *testing.T) { + obj := &SchedulingQuestion{} + var fernTestValueRequired *bool + obj.SetRequired(fernTestValueRequired) + assert.Equal(t, fernTestValueRequired, obj.Required) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetOptions", func(t *testing.T) { + obj := &SchedulingQuestion{} + var fernTestValueOptions []string + obj.SetOptions(fernTestValueOptions) + assert.Equal(t, fernTestValueOptions, obj.Options) + assert.NotNil(t, obj.explicitFields) + }) + +} + +func TestGettersSchedulingQuestion(t *testing.T) { + t.Run("GetKey", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingEventType{} - var fernTestValueBufferAfterMinutes float64 + obj := &SchedulingQuestion{} + var expected string + obj.Key = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetKey(), "getter should return the property value") + }) + + t.Run("GetKey_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingQuestion + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetKey() // Should return zero value + }) + + t.Run("GetType", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingQuestion{} + var expected SchedulingQuestionType + obj.Type = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetType(), "getter should return the property value") + }) + + t.Run("GetType_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingQuestion + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetType() // Should return zero value + }) + + t.Run("GetLabel", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingQuestion{} + var expected string + obj.Label = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetLabel(), "getter should return the property value") + }) + + t.Run("GetLabel_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingQuestion + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetLabel() // Should return zero value + }) + + t.Run("GetRequired", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingQuestion{} + var expected *bool + obj.Required = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetRequired(), "getter should return the property value") + }) + + t.Run("GetRequired_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingQuestion{} + obj.Required = nil + + // Act & Assert + assert.Nil(t, obj.GetRequired(), "getter should return nil when property is nil") + }) + + t.Run("GetRequired_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingQuestion + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetRequired() // Should return zero value + }) + + t.Run("GetOptions", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingQuestion{} + var expected []string + obj.Options = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetOptions(), "getter should return the property value") + }) + + t.Run("GetOptions_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingQuestion{} + obj.Options = nil + + // Act & Assert + assert.Nil(t, obj.GetOptions(), "getter should return nil when property is nil") + }) + + t.Run("GetOptions_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingQuestion + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetOptions() // Should return zero value + }) + +} + +func TestSettersMarkExplicitSchedulingQuestion(t *testing.T) { + t.Run("SetKey_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingQuestion{} + var fernTestValueKey string // Act - obj.SetBufferAfterMinutes(fernTestValueBufferAfterMinutes) + obj.SetKey(fernTestValueKey) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -91134,14 +103256,14 @@ func TestSettersMarkExplicitSchedulingEventType(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetMinNoticeMinutes_MarksExplicit", func(t *testing.T) { + t.Run("SetType_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingEventType{} - var fernTestValueMinNoticeMinutes float64 + obj := &SchedulingQuestion{} + var fernTestValueType SchedulingQuestionType // Act - obj.SetMinNoticeMinutes(fernTestValueMinNoticeMinutes) + obj.SetType(fernTestValueType) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -91165,14 +103287,14 @@ func TestSettersMarkExplicitSchedulingEventType(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetBookingWindow_MarksExplicit", func(t *testing.T) { + t.Run("SetLabel_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingEventType{} - var fernTestValueBookingWindow *SchedulingBookingWindow + obj := &SchedulingQuestion{} + var fernTestValueLabel string // Act - obj.SetBookingWindow(fernTestValueBookingWindow) + obj.SetLabel(fernTestValueLabel) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -91196,14 +103318,14 @@ func TestSettersMarkExplicitSchedulingEventType(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetLimits_MarksExplicit", func(t *testing.T) { + t.Run("SetRequired_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingEventType{} - var fernTestValueLimits []*SchedulingLimit + obj := &SchedulingQuestion{} + var fernTestValueRequired *bool // Act - obj.SetLimits(fernTestValueLimits) + obj.SetRequired(fernTestValueRequired) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -91227,14 +103349,14 @@ func TestSettersMarkExplicitSchedulingEventType(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetCapacity_MarksExplicit", func(t *testing.T) { + t.Run("SetOptions_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingEventType{} - var fernTestValueCapacity *float64 + obj := &SchedulingQuestion{} + var fernTestValueOptions []string // Act - obj.SetCapacity(fernTestValueCapacity) + obj.SetOptions(fernTestValueOptions) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -91258,14 +103380,404 @@ func TestSettersMarkExplicitSchedulingEventType(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetRequiresApproval_MarksExplicit", func(t *testing.T) { +} + +func TestSettersSchedulingReassignCandidate(t *testing.T) { + t.Run("SetObject", func(t *testing.T) { + obj := &SchedulingReassignCandidate{} + var fernTestValueObject SchedulingReassignCandidateObject + obj.SetObject(fernTestValueObject) + assert.Equal(t, fernTestValueObject, obj.Object) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetHost", func(t *testing.T) { + obj := &SchedulingReassignCandidate{} + var fernTestValueHost string + obj.SetHost(fernTestValueHost) + assert.Equal(t, fernTestValueHost, obj.Host) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetUID", func(t *testing.T) { + obj := &SchedulingReassignCandidate{} + var fernTestValueUID *string + obj.SetUID(fernTestValueUID) + assert.Equal(t, fernTestValueUID, obj.UID) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetName", func(t *testing.T) { + obj := &SchedulingReassignCandidate{} + var fernTestValueName string + obj.SetName(fernTestValueName) + assert.Equal(t, fernTestValueName, obj.Name) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetMember", func(t *testing.T) { + obj := &SchedulingReassignCandidate{} + var fernTestValueMember bool + obj.SetMember(fernTestValueMember) + assert.Equal(t, fernTestValueMember, obj.Member) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetAvailable", func(t *testing.T) { + obj := &SchedulingReassignCandidate{} + var fernTestValueAvailable bool + obj.SetAvailable(fernTestValueAvailable) + assert.Equal(t, fernTestValueAvailable, obj.Available) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetReason", func(t *testing.T) { + obj := &SchedulingReassignCandidate{} + var fernTestValueReason *string + obj.SetReason(fernTestValueReason) + assert.Equal(t, fernTestValueReason, obj.Reason) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetReasons", func(t *testing.T) { + obj := &SchedulingReassignCandidate{} + var fernTestValueReasons []string + obj.SetReasons(fernTestValueReasons) + assert.Equal(t, fernTestValueReasons, obj.Reasons) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetLoad", func(t *testing.T) { + obj := &SchedulingReassignCandidate{} + var fernTestValueLoad float64 + obj.SetLoad(fernTestValueLoad) + assert.Equal(t, fernTestValueLoad, obj.Load) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetRank", func(t *testing.T) { + obj := &SchedulingReassignCandidate{} + var fernTestValueRank *float64 + obj.SetRank(fernTestValueRank) + assert.Equal(t, fernTestValueRank, obj.Rank) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetMeetingProviderMissing", func(t *testing.T) { + obj := &SchedulingReassignCandidate{} + var fernTestValueMeetingProviderMissing bool + obj.SetMeetingProviderMissing(fernTestValueMeetingProviderMissing) + assert.Equal(t, fernTestValueMeetingProviderMissing, obj.MeetingProviderMissing) + assert.NotNil(t, obj.explicitFields) + }) + +} + +func TestGettersSchedulingReassignCandidate(t *testing.T) { + t.Run("GetObject", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingEventType{} - var fernTestValueRequiresApproval bool + obj := &SchedulingReassignCandidate{} + var expected SchedulingReassignCandidateObject + obj.Object = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetObject(), "getter should return the property value") + }) + + t.Run("GetObject_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingReassignCandidate + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetObject() // Should return zero value + }) + + t.Run("GetHost", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingReassignCandidate{} + var expected string + obj.Host = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetHost(), "getter should return the property value") + }) + + t.Run("GetHost_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingReassignCandidate + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetHost() // Should return zero value + }) + + t.Run("GetUID", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingReassignCandidate{} + var expected *string + obj.UID = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetUID(), "getter should return the property value") + }) + + t.Run("GetUID_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingReassignCandidate{} + obj.UID = nil + + // Act & Assert + assert.Nil(t, obj.GetUID(), "getter should return nil when property is nil") + }) + + t.Run("GetUID_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingReassignCandidate + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetUID() // Should return zero value + }) + + t.Run("GetName", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingReassignCandidate{} + var expected string + obj.Name = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetName(), "getter should return the property value") + }) + + t.Run("GetName_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingReassignCandidate + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetName() // Should return zero value + }) + + t.Run("GetMember", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingReassignCandidate{} + var expected bool + obj.Member = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetMember(), "getter should return the property value") + }) + + t.Run("GetMember_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingReassignCandidate + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetMember() // Should return zero value + }) + + t.Run("GetAvailable", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingReassignCandidate{} + var expected bool + obj.Available = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetAvailable(), "getter should return the property value") + }) + + t.Run("GetAvailable_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingReassignCandidate + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetAvailable() // Should return zero value + }) + + t.Run("GetReason", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingReassignCandidate{} + var expected *string + obj.Reason = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetReason(), "getter should return the property value") + }) + + t.Run("GetReason_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingReassignCandidate{} + obj.Reason = nil + + // Act & Assert + assert.Nil(t, obj.GetReason(), "getter should return nil when property is nil") + }) + + t.Run("GetReason_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingReassignCandidate + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetReason() // Should return zero value + }) + + t.Run("GetReasons", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingReassignCandidate{} + var expected []string + obj.Reasons = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetReasons(), "getter should return the property value") + }) + + t.Run("GetReasons_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingReassignCandidate{} + obj.Reasons = nil + + // Act & Assert + assert.Nil(t, obj.GetReasons(), "getter should return nil when property is nil") + }) + + t.Run("GetReasons_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingReassignCandidate + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetReasons() // Should return zero value + }) + + t.Run("GetLoad", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingReassignCandidate{} + var expected float64 + obj.Load = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetLoad(), "getter should return the property value") + }) + + t.Run("GetLoad_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingReassignCandidate + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetLoad() // Should return zero value + }) + + t.Run("GetRank", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingReassignCandidate{} + var expected *float64 + obj.Rank = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetRank(), "getter should return the property value") + }) + + t.Run("GetRank_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingReassignCandidate{} + obj.Rank = nil + + // Act & Assert + assert.Nil(t, obj.GetRank(), "getter should return nil when property is nil") + }) + + t.Run("GetRank_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingReassignCandidate + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetRank() // Should return zero value + }) + + t.Run("GetMeetingProviderMissing", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingReassignCandidate{} + var expected bool + obj.MeetingProviderMissing = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetMeetingProviderMissing(), "getter should return the property value") + }) + + t.Run("GetMeetingProviderMissing_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingReassignCandidate + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetMeetingProviderMissing() // Should return zero value + }) + +} + +func TestSettersMarkExplicitSchedulingReassignCandidate(t *testing.T) { + t.Run("SetObject_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingReassignCandidate{} + var fernTestValueObject SchedulingReassignCandidateObject // Act - obj.SetRequiresApproval(fernTestValueRequiresApproval) + obj.SetObject(fernTestValueObject) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -91289,14 +103801,14 @@ func TestSettersMarkExplicitSchedulingEventType(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetApprovalTTLMinutes_MarksExplicit", func(t *testing.T) { + t.Run("SetHost_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingEventType{} - var fernTestValueApprovalTTLMinutes float64 + obj := &SchedulingReassignCandidate{} + var fernTestValueHost string // Act - obj.SetApprovalTTLMinutes(fernTestValueApprovalTTLMinutes) + obj.SetHost(fernTestValueHost) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -91320,14 +103832,14 @@ func TestSettersMarkExplicitSchedulingEventType(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetHoldTTLSeconds_MarksExplicit", func(t *testing.T) { + t.Run("SetUID_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingEventType{} - var fernTestValueHoldTTLSeconds float64 + obj := &SchedulingReassignCandidate{} + var fernTestValueUID *string // Act - obj.SetHoldTTLSeconds(fernTestValueHoldTTLSeconds) + obj.SetUID(fernTestValueUID) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -91351,14 +103863,14 @@ func TestSettersMarkExplicitSchedulingEventType(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetCancelNoticeMinutes_MarksExplicit", func(t *testing.T) { + t.Run("SetName_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingEventType{} - var fernTestValueCancelNoticeMinutes float64 + obj := &SchedulingReassignCandidate{} + var fernTestValueName string // Act - obj.SetCancelNoticeMinutes(fernTestValueCancelNoticeMinutes) + obj.SetName(fernTestValueName) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -91382,14 +103894,14 @@ func TestSettersMarkExplicitSchedulingEventType(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetRescheduleNoticeMinutes_MarksExplicit", func(t *testing.T) { + t.Run("SetMember_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingEventType{} - var fernTestValueRescheduleNoticeMinutes float64 + obj := &SchedulingReassignCandidate{} + var fernTestValueMember bool // Act - obj.SetRescheduleNoticeMinutes(fernTestValueRescheduleNoticeMinutes) + obj.SetMember(fernTestValueMember) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -91413,14 +103925,14 @@ func TestSettersMarkExplicitSchedulingEventType(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetMaxGuests_MarksExplicit", func(t *testing.T) { + t.Run("SetAvailable_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingEventType{} - var fernTestValueMaxGuests float64 + obj := &SchedulingReassignCandidate{} + var fernTestValueAvailable bool // Act - obj.SetMaxGuests(fernTestValueMaxGuests) + obj.SetAvailable(fernTestValueAvailable) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -91444,14 +103956,14 @@ func TestSettersMarkExplicitSchedulingEventType(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetMaxActiveBookingsPerAttendee_MarksExplicit", func(t *testing.T) { + t.Run("SetReason_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingEventType{} - var fernTestValueMaxActiveBookingsPerAttendee *float64 + obj := &SchedulingReassignCandidate{} + var fernTestValueReason *string // Act - obj.SetMaxActiveBookingsPerAttendee(fernTestValueMaxActiveBookingsPerAttendee) + obj.SetReason(fernTestValueReason) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -91475,14 +103987,14 @@ func TestSettersMarkExplicitSchedulingEventType(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetHostCalendarDetails_MarksExplicit", func(t *testing.T) { + t.Run("SetReasons_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingEventType{} - var fernTestValueHostCalendarDetails SchedulingEventTypeHostCalendarDetails + obj := &SchedulingReassignCandidate{} + var fernTestValueReasons []string // Act - obj.SetHostCalendarDetails(fernTestValueHostCalendarDetails) + obj.SetReasons(fernTestValueReasons) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -91506,14 +104018,14 @@ func TestSettersMarkExplicitSchedulingEventType(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetQuestions_MarksExplicit", func(t *testing.T) { + t.Run("SetLoad_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingEventType{} - var fernTestValueQuestions []*SchedulingQuestion + obj := &SchedulingReassignCandidate{} + var fernTestValueLoad float64 // Act - obj.SetQuestions(fernTestValueQuestions) + obj.SetLoad(fernTestValueLoad) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -91537,14 +104049,14 @@ func TestSettersMarkExplicitSchedulingEventType(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetLocations_MarksExplicit", func(t *testing.T) { + t.Run("SetRank_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingEventType{} - var fernTestValueLocations []*SchedulingLocation + obj := &SchedulingReassignCandidate{} + var fernTestValueRank *float64 // Act - obj.SetLocations(fernTestValueLocations) + obj.SetRank(fernTestValueRank) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -91568,14 +104080,14 @@ func TestSettersMarkExplicitSchedulingEventType(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetHostFilter_MarksExplicit", func(t *testing.T) { + t.Run("SetMeetingProviderMissing_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingEventType{} - var fernTestValueHostFilter map[string]*SchedulingEventTypeHostFilterValue + obj := &SchedulingReassignCandidate{} + var fernTestValueMeetingProviderMissing bool // Act - obj.SetHostFilter(fernTestValueHostFilter) + obj.SetMeetingProviderMissing(fernTestValueMeetingProviderMissing) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -91599,76 +104111,126 @@ func TestSettersMarkExplicitSchedulingEventType(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetNotifications_MarksExplicit", func(t *testing.T) { +} + +func TestSettersSchedulingReassignCandidateList(t *testing.T) { + t.Run("SetObject", func(t *testing.T) { + obj := &SchedulingReassignCandidateList{} + var fernTestValueObject SchedulingReassignCandidateListObject + obj.SetObject(fernTestValueObject) + assert.Equal(t, fernTestValueObject, obj.Object) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetData", func(t *testing.T) { + obj := &SchedulingReassignCandidateList{} + var fernTestValueData []*SchedulingReassignCandidate + obj.SetData(fernTestValueData) + assert.Equal(t, fernTestValueData, obj.Data) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetHasMore", func(t *testing.T) { + obj := &SchedulingReassignCandidateList{} + var fernTestValueHasMore bool + obj.SetHasMore(fernTestValueHasMore) + assert.Equal(t, fernTestValueHasMore, obj.HasMore) + assert.NotNil(t, obj.explicitFields) + }) + +} + +func TestGettersSchedulingReassignCandidateList(t *testing.T) { + t.Run("GetObject", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingEventType{} - var fernTestValueNotifications map[string]*SchedulingEventTypeNotificationsValue + obj := &SchedulingReassignCandidateList{} + var expected SchedulingReassignCandidateListObject + obj.Object = expected - // Act - obj.SetNotifications(fernTestValueNotifications) + // Act & Assert + assert.Equal(t, expected, obj.GetObject(), "getter should return the property value") + }) - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") + t.Run("GetObject_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingReassignCandidateList + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetObject() // Should return zero value + }) - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } + t.Run("GetData", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingReassignCandidateList{} + var expected []*SchedulingReassignCandidate + obj.Data = expected - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip + // Act & Assert + assert.Equal(t, expected, obj.GetData(), "getter should return the property value") }) - t.Run("SetReminders_MarksExplicit", func(t *testing.T) { + t.Run("GetData_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingEventType{} - var fernTestValueReminders []*SchedulingReminder + obj := &SchedulingReassignCandidateList{} + obj.Data = nil - // Act - obj.SetReminders(fernTestValueReminders) + // Act & Assert + assert.Nil(t, obj.GetData(), "getter should return nil when property is nil") + }) - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") + t.Run("GetData_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingReassignCandidateList + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetData() // Should return zero value + }) - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } + t.Run("GetHasMore", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingReassignCandidateList{} + var expected bool + obj.HasMore = expected - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip + // Act & Assert + assert.Equal(t, expected, obj.GetHasMore(), "getter should return the property value") }) - t.Run("SetHosts_MarksExplicit", func(t *testing.T) { + t.Run("GetHasMore_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingReassignCandidateList + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetHasMore() // Should return zero value + }) + +} + +func TestSettersMarkExplicitSchedulingReassignCandidateList(t *testing.T) { + t.Run("SetObject_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingEventType{} - var fernTestValueHosts []*SchedulingEventTypeHostsItem + obj := &SchedulingReassignCandidateList{} + var fernTestValueObject SchedulingReassignCandidateListObject // Act - obj.SetHosts(fernTestValueHosts) + obj.SetObject(fernTestValueObject) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -91692,14 +104254,14 @@ func TestSettersMarkExplicitSchedulingEventType(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetMetadata_MarksExplicit", func(t *testing.T) { + t.Run("SetData_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingEventType{} - var fernTestValueMetadata map[string]string + obj := &SchedulingReassignCandidateList{} + var fernTestValueData []*SchedulingReassignCandidate // Act - obj.SetMetadata(fernTestValueMetadata) + obj.SetData(fernTestValueData) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -91723,14 +104285,14 @@ func TestSettersMarkExplicitSchedulingEventType(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetCreatedAt_MarksExplicit", func(t *testing.T) { + t.Run("SetHasMore_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingEventType{} - var fernTestValueCreatedAt string + obj := &SchedulingReassignCandidateList{} + var fernTestValueHasMore bool // Act - obj.SetCreatedAt(fernTestValueCreatedAt) + obj.SetHasMore(fernTestValueHasMore) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -91754,298 +104316,383 @@ func TestSettersMarkExplicitSchedulingEventType(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetUpdatedAt_MarksExplicit", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &SchedulingEventType{} - var fernTestValueUpdatedAt string +} - // Act - obj.SetUpdatedAt(fernTestValueUpdatedAt) +func TestSettersSchedulingReassignment(t *testing.T) { + t.Run("SetObject", func(t *testing.T) { + obj := &SchedulingReassignment{} + var fernTestValueObject SchedulingReassignmentObject + obj.SetObject(fernTestValueObject) + assert.Equal(t, fernTestValueObject, obj.Object) + assert.NotNil(t, obj.explicitFields) + }) - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") + t.Run("SetID", func(t *testing.T) { + obj := &SchedulingReassignment{} + var fernTestValueID string + obj.SetID(fernTestValueID) + assert.Equal(t, fernTestValueID, obj.ID) + assert.NotNil(t, obj.explicitFields) + }) - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } + t.Run("SetStatus", func(t *testing.T) { + obj := &SchedulingReassignment{} + var fernTestValueStatus SchedulingReassignmentStatus + obj.SetStatus(fernTestValueStatus) + assert.Equal(t, fernTestValueStatus, obj.Status) + assert.NotNil(t, obj.explicitFields) + }) - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip + t.Run("SetReasonCode", func(t *testing.T) { + obj := &SchedulingReassignment{} + var fernTestValueReasonCode SchedulingReassignmentReasonCode + obj.SetReasonCode(fernTestValueReasonCode) + assert.Equal(t, fernTestValueReasonCode, obj.ReasonCode) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetOutOfOffice", func(t *testing.T) { + obj := &SchedulingReassignment{} + var fernTestValueOutOfOffice *string + obj.SetOutOfOffice(fernTestValueOutOfOffice) + assert.Equal(t, fernTestValueOutOfOffice, obj.OutOfOffice) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetUndoOf", func(t *testing.T) { + obj := &SchedulingReassignment{} + var fernTestValueUndoOf *string + obj.SetUndoOf(fernTestValueUndoOf) + assert.Equal(t, fernTestValueUndoOf, obj.UndoOf) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetCounts", func(t *testing.T) { + obj := &SchedulingReassignment{} + var fernTestValueCounts *SchedulingReassignmentCounts + obj.SetCounts(fernTestValueCounts) + assert.Equal(t, fernTestValueCounts, obj.Counts) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetCreatedAt", func(t *testing.T) { + obj := &SchedulingReassignment{} + var fernTestValueCreatedAt string + obj.SetCreatedAt(fernTestValueCreatedAt) + assert.Equal(t, fernTestValueCreatedAt, obj.CreatedAt) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetStartedAt", func(t *testing.T) { + obj := &SchedulingReassignment{} + var fernTestValueStartedAt *string + obj.SetStartedAt(fernTestValueStartedAt) + assert.Equal(t, fernTestValueStartedAt, obj.StartedAt) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetFinishedAt", func(t *testing.T) { + obj := &SchedulingReassignment{} + var fernTestValueFinishedAt *string + obj.SetFinishedAt(fernTestValueFinishedAt) + assert.Equal(t, fernTestValueFinishedAt, obj.FinishedAt) + assert.NotNil(t, obj.explicitFields) }) } -func TestGettersSchedulingEventTypeHostFilterValue(t *testing.T) { - t.Run("GetString", func(t *testing.T) { +func TestGettersSchedulingReassignment(t *testing.T) { + t.Run("GetObject", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingEventTypeHostFilterValue{} - var expected string - obj.String = expected + obj := &SchedulingReassignment{} + var expected SchedulingReassignmentObject + obj.Object = expected // Act & Assert - assert.Equal(t, expected, obj.GetString(), "getter should return the property value") + assert.Equal(t, expected, obj.GetObject(), "getter should return the property value") }) - t.Run("GetString_NilReceiver", func(t *testing.T) { + t.Run("GetObject_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *SchedulingEventTypeHostFilterValue + var obj *SchedulingReassignment // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetString() // Should return zero value + _ = obj.GetObject() // Should return zero value }) - t.Run("GetStringList", func(t *testing.T) { + t.Run("GetID", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingEventTypeHostFilterValue{} - var expected []string - obj.StringList = expected + obj := &SchedulingReassignment{} + var expected string + obj.ID = expected // Act & Assert - assert.Equal(t, expected, obj.GetStringList(), "getter should return the property value") + assert.Equal(t, expected, obj.GetID(), "getter should return the property value") }) - t.Run("GetStringList_NilValue", func(t *testing.T) { + t.Run("GetID_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingReassignment + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetID() // Should return zero value + }) + + t.Run("GetStatus", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingEventTypeHostFilterValue{} - obj.StringList = nil + obj := &SchedulingReassignment{} + var expected SchedulingReassignmentStatus + obj.Status = expected // Act & Assert - assert.Nil(t, obj.GetStringList(), "getter should return nil when property is nil") + assert.Equal(t, expected, obj.GetStatus(), "getter should return the property value") }) - t.Run("GetStringList_NilReceiver", func(t *testing.T) { + t.Run("GetStatus_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *SchedulingEventTypeHostFilterValue + var obj *SchedulingReassignment // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetStringList() // Should return zero value + _ = obj.GetStatus() // Should return zero value }) -} + t.Run("GetReasonCode", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingReassignment{} + var expected SchedulingReassignmentReasonCode + obj.ReasonCode = expected -func TestSettersSchedulingEventTypeHostInput(t *testing.T) { - t.Run("SetHost", func(t *testing.T) { - obj := &SchedulingEventTypeHostInput{} - var fernTestValueHost string - obj.SetHost(fernTestValueHost) - assert.Equal(t, fernTestValueHost, obj.Host) - assert.NotNil(t, obj.explicitFields) + // Act & Assert + assert.Equal(t, expected, obj.GetReasonCode(), "getter should return the property value") }) - t.Run("SetRole", func(t *testing.T) { - obj := &SchedulingEventTypeHostInput{} - var fernTestValueRole *SchedulingEventTypeHostInputRole - obj.SetRole(fernTestValueRole) - assert.Equal(t, fernTestValueRole, obj.Role) - assert.NotNil(t, obj.explicitFields) + t.Run("GetReasonCode_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingReassignment + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetReasonCode() // Should return zero value }) - t.Run("SetWeight", func(t *testing.T) { - obj := &SchedulingEventTypeHostInput{} - var fernTestValueWeight *int - obj.SetWeight(fernTestValueWeight) - assert.Equal(t, fernTestValueWeight, obj.Weight) - assert.NotNil(t, obj.explicitFields) - }) + t.Run("GetOutOfOffice", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingReassignment{} + var expected *string + obj.OutOfOffice = expected - t.Run("SetSchedule", func(t *testing.T) { - obj := &SchedulingEventTypeHostInput{} - var fernTestValueSchedule *string - obj.SetSchedule(fernTestValueSchedule) - assert.Equal(t, fernTestValueSchedule, obj.Schedule) - assert.NotNil(t, obj.explicitFields) + // Act & Assert + assert.Equal(t, expected, obj.GetOutOfOffice(), "getter should return the property value") }) -} - -func TestGettersSchedulingEventTypeHostInput(t *testing.T) { - t.Run("GetHost", func(t *testing.T) { + t.Run("GetOutOfOffice_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingEventTypeHostInput{} - var expected string - obj.Host = expected + obj := &SchedulingReassignment{} + obj.OutOfOffice = nil // Act & Assert - assert.Equal(t, expected, obj.GetHost(), "getter should return the property value") + assert.Nil(t, obj.GetOutOfOffice(), "getter should return nil when property is nil") }) - t.Run("GetHost_NilReceiver", func(t *testing.T) { + t.Run("GetOutOfOffice_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *SchedulingEventTypeHostInput + var obj *SchedulingReassignment // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetHost() // Should return zero value + _ = obj.GetOutOfOffice() // Should return zero value }) - t.Run("GetRole", func(t *testing.T) { + t.Run("GetUndoOf", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingEventTypeHostInput{} - var expected *SchedulingEventTypeHostInputRole - obj.Role = expected + obj := &SchedulingReassignment{} + var expected *string + obj.UndoOf = expected // Act & Assert - assert.Equal(t, expected, obj.GetRole(), "getter should return the property value") + assert.Equal(t, expected, obj.GetUndoOf(), "getter should return the property value") }) - t.Run("GetRole_NilValue", func(t *testing.T) { + t.Run("GetUndoOf_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingEventTypeHostInput{} - obj.Role = nil + obj := &SchedulingReassignment{} + obj.UndoOf = nil // Act & Assert - assert.Nil(t, obj.GetRole(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetUndoOf(), "getter should return nil when property is nil") }) - t.Run("GetRole_NilReceiver", func(t *testing.T) { + t.Run("GetUndoOf_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *SchedulingEventTypeHostInput + var obj *SchedulingReassignment // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetRole() // Should return zero value + _ = obj.GetUndoOf() // Should return zero value }) - t.Run("GetWeight", func(t *testing.T) { + t.Run("GetCounts", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingEventTypeHostInput{} - var expected *int - obj.Weight = expected + obj := &SchedulingReassignment{} + var expected *SchedulingReassignmentCounts + obj.Counts = expected // Act & Assert - assert.Equal(t, expected, obj.GetWeight(), "getter should return the property value") + assert.Equal(t, expected, obj.GetCounts(), "getter should return the property value") }) - t.Run("GetWeight_NilValue", func(t *testing.T) { + t.Run("GetCounts_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingEventTypeHostInput{} - obj.Weight = nil + obj := &SchedulingReassignment{} + obj.Counts = nil // Act & Assert - assert.Nil(t, obj.GetWeight(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetCounts(), "getter should return nil when property is nil") }) - t.Run("GetWeight_NilReceiver", func(t *testing.T) { + t.Run("GetCounts_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *SchedulingEventTypeHostInput + var obj *SchedulingReassignment // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetWeight() // Should return zero value + _ = obj.GetCounts() // Should return zero value }) - t.Run("GetSchedule", func(t *testing.T) { + t.Run("GetCreatedAt", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingEventTypeHostInput{} + obj := &SchedulingReassignment{} + var expected string + obj.CreatedAt = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetCreatedAt(), "getter should return the property value") + }) + + t.Run("GetCreatedAt_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingReassignment + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetCreatedAt() // Should return zero value + }) + + t.Run("GetStartedAt", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingReassignment{} var expected *string - obj.Schedule = expected + obj.StartedAt = expected // Act & Assert - assert.Equal(t, expected, obj.GetSchedule(), "getter should return the property value") + assert.Equal(t, expected, obj.GetStartedAt(), "getter should return the property value") }) - t.Run("GetSchedule_NilValue", func(t *testing.T) { + t.Run("GetStartedAt_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingEventTypeHostInput{} - obj.Schedule = nil + obj := &SchedulingReassignment{} + obj.StartedAt = nil // Act & Assert - assert.Nil(t, obj.GetSchedule(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetStartedAt(), "getter should return nil when property is nil") }) - t.Run("GetSchedule_NilReceiver", func(t *testing.T) { + t.Run("GetStartedAt_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *SchedulingEventTypeHostInput + var obj *SchedulingReassignment // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetSchedule() // Should return zero value + _ = obj.GetStartedAt() // Should return zero value }) -} - -func TestSettersMarkExplicitSchedulingEventTypeHostInput(t *testing.T) { - t.Run("SetHost_MarksExplicit", func(t *testing.T) { + t.Run("GetFinishedAt", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingEventTypeHostInput{} - var fernTestValueHost string + obj := &SchedulingReassignment{} + var expected *string + obj.FinishedAt = expected - // Act - obj.SetHost(fernTestValueHost) + // Act & Assert + assert.Equal(t, expected, obj.GetFinishedAt(), "getter should return the property value") + }) - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") + t.Run("GetFinishedAt_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingReassignment{} + obj.FinishedAt = nil - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } + // Act & Assert + assert.Nil(t, obj.GetFinishedAt(), "getter should return nil when property is nil") + }) - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip + t.Run("GetFinishedAt_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingReassignment + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetFinishedAt() // Should return zero value }) - t.Run("SetRole_MarksExplicit", func(t *testing.T) { +} + +func TestSettersMarkExplicitSchedulingReassignment(t *testing.T) { + t.Run("SetObject_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingEventTypeHostInput{} - var fernTestValueRole *SchedulingEventTypeHostInputRole + obj := &SchedulingReassignment{} + var fernTestValueObject SchedulingReassignmentObject // Act - obj.SetRole(fernTestValueRole) + obj.SetObject(fernTestValueObject) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -92069,14 +104716,14 @@ func TestSettersMarkExplicitSchedulingEventTypeHostInput(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetWeight_MarksExplicit", func(t *testing.T) { + t.Run("SetID_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingEventTypeHostInput{} - var fernTestValueWeight *int + obj := &SchedulingReassignment{} + var fernTestValueID string // Act - obj.SetWeight(fernTestValueWeight) + obj.SetID(fernTestValueID) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -92100,14 +104747,14 @@ func TestSettersMarkExplicitSchedulingEventTypeHostInput(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetSchedule_MarksExplicit", func(t *testing.T) { + t.Run("SetStatus_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingEventTypeHostInput{} - var fernTestValueSchedule *string + obj := &SchedulingReassignment{} + var fernTestValueStatus SchedulingReassignmentStatus // Act - obj.SetSchedule(fernTestValueSchedule) + obj.SetStatus(fernTestValueStatus) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -92131,157 +104778,14 @@ func TestSettersMarkExplicitSchedulingEventTypeHostInput(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) -} - -func TestSettersSchedulingEventTypeHostsItem(t *testing.T) { - t.Run("SetHost", func(t *testing.T) { - obj := &SchedulingEventTypeHostsItem{} - var fernTestValueHost string - obj.SetHost(fernTestValueHost) - assert.Equal(t, fernTestValueHost, obj.Host) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetRole", func(t *testing.T) { - obj := &SchedulingEventTypeHostsItem{} - var fernTestValueRole SchedulingEventTypeHostsItemRole - obj.SetRole(fernTestValueRole) - assert.Equal(t, fernTestValueRole, obj.Role) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetWeight", func(t *testing.T) { - obj := &SchedulingEventTypeHostsItem{} - var fernTestValueWeight float64 - obj.SetWeight(fernTestValueWeight) - assert.Equal(t, fernTestValueWeight, obj.Weight) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetSchedule", func(t *testing.T) { - obj := &SchedulingEventTypeHostsItem{} - var fernTestValueSchedule *string - obj.SetSchedule(fernTestValueSchedule) - assert.Equal(t, fernTestValueSchedule, obj.Schedule) - assert.NotNil(t, obj.explicitFields) - }) - -} - -func TestGettersSchedulingEventTypeHostsItem(t *testing.T) { - t.Run("GetHost", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &SchedulingEventTypeHostsItem{} - var expected string - obj.Host = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetHost(), "getter should return the property value") - }) - - t.Run("GetHost_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *SchedulingEventTypeHostsItem - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetHost() // Should return zero value - }) - - t.Run("GetRole", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &SchedulingEventTypeHostsItem{} - var expected SchedulingEventTypeHostsItemRole - obj.Role = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetRole(), "getter should return the property value") - }) - - t.Run("GetRole_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *SchedulingEventTypeHostsItem - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetRole() // Should return zero value - }) - - t.Run("GetWeight", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &SchedulingEventTypeHostsItem{} - var expected float64 - obj.Weight = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetWeight(), "getter should return the property value") - }) - - t.Run("GetWeight_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *SchedulingEventTypeHostsItem - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetWeight() // Should return zero value - }) - - t.Run("GetSchedule", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &SchedulingEventTypeHostsItem{} - var expected *string - obj.Schedule = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetSchedule(), "getter should return the property value") - }) - - t.Run("GetSchedule_NilValue", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &SchedulingEventTypeHostsItem{} - obj.Schedule = nil - - // Act & Assert - assert.Nil(t, obj.GetSchedule(), "getter should return nil when property is nil") - }) - - t.Run("GetSchedule_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *SchedulingEventTypeHostsItem - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetSchedule() // Should return zero value - }) - -} - -func TestSettersMarkExplicitSchedulingEventTypeHostsItem(t *testing.T) { - t.Run("SetHost_MarksExplicit", func(t *testing.T) { + t.Run("SetReasonCode_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingEventTypeHostsItem{} - var fernTestValueHost string + obj := &SchedulingReassignment{} + var fernTestValueReasonCode SchedulingReassignmentReasonCode // Act - obj.SetHost(fernTestValueHost) + obj.SetReasonCode(fernTestValueReasonCode) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -92305,14 +104809,14 @@ func TestSettersMarkExplicitSchedulingEventTypeHostsItem(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetRole_MarksExplicit", func(t *testing.T) { + t.Run("SetOutOfOffice_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingEventTypeHostsItem{} - var fernTestValueRole SchedulingEventTypeHostsItemRole + obj := &SchedulingReassignment{} + var fernTestValueOutOfOffice *string // Act - obj.SetRole(fernTestValueRole) + obj.SetOutOfOffice(fernTestValueOutOfOffice) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -92336,14 +104840,14 @@ func TestSettersMarkExplicitSchedulingEventTypeHostsItem(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetWeight_MarksExplicit", func(t *testing.T) { + t.Run("SetUndoOf_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingEventTypeHostsItem{} - var fernTestValueWeight float64 + obj := &SchedulingReassignment{} + var fernTestValueUndoOf *string // Act - obj.SetWeight(fernTestValueWeight) + obj.SetUndoOf(fernTestValueUndoOf) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -92367,14 +104871,14 @@ func TestSettersMarkExplicitSchedulingEventTypeHostsItem(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetSchedule_MarksExplicit", func(t *testing.T) { + t.Run("SetCounts_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingEventTypeHostsItem{} - var fernTestValueSchedule *string + obj := &SchedulingReassignment{} + var fernTestValueCounts *SchedulingReassignmentCounts // Act - obj.SetSchedule(fernTestValueSchedule) + obj.SetCounts(fernTestValueCounts) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -92398,126 +104902,14 @@ func TestSettersMarkExplicitSchedulingEventTypeHostsItem(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) -} - -func TestSettersSchedulingEventTypeList(t *testing.T) { - t.Run("SetObject", func(t *testing.T) { - obj := &SchedulingEventTypeList{} - var fernTestValueObject SchedulingEventTypeListObject - obj.SetObject(fernTestValueObject) - assert.Equal(t, fernTestValueObject, obj.Object) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetData", func(t *testing.T) { - obj := &SchedulingEventTypeList{} - var fernTestValueData []*SchedulingEventType - obj.SetData(fernTestValueData) - assert.Equal(t, fernTestValueData, obj.Data) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetHasMore", func(t *testing.T) { - obj := &SchedulingEventTypeList{} - var fernTestValueHasMore bool - obj.SetHasMore(fernTestValueHasMore) - assert.Equal(t, fernTestValueHasMore, obj.HasMore) - assert.NotNil(t, obj.explicitFields) - }) - -} - -func TestGettersSchedulingEventTypeList(t *testing.T) { - t.Run("GetObject", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &SchedulingEventTypeList{} - var expected SchedulingEventTypeListObject - obj.Object = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetObject(), "getter should return the property value") - }) - - t.Run("GetObject_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *SchedulingEventTypeList - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetObject() // Should return zero value - }) - - t.Run("GetData", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &SchedulingEventTypeList{} - var expected []*SchedulingEventType - obj.Data = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetData(), "getter should return the property value") - }) - - t.Run("GetData_NilValue", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &SchedulingEventTypeList{} - obj.Data = nil - - // Act & Assert - assert.Nil(t, obj.GetData(), "getter should return nil when property is nil") - }) - - t.Run("GetData_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *SchedulingEventTypeList - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetData() // Should return zero value - }) - - t.Run("GetHasMore", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &SchedulingEventTypeList{} - var expected bool - obj.HasMore = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetHasMore(), "getter should return the property value") - }) - - t.Run("GetHasMore_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *SchedulingEventTypeList - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetHasMore() // Should return zero value - }) - -} - -func TestSettersMarkExplicitSchedulingEventTypeList(t *testing.T) { - t.Run("SetObject_MarksExplicit", func(t *testing.T) { + t.Run("SetCreatedAt_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingEventTypeList{} - var fernTestValueObject SchedulingEventTypeListObject + obj := &SchedulingReassignment{} + var fernTestValueCreatedAt string // Act - obj.SetObject(fernTestValueObject) + obj.SetCreatedAt(fernTestValueCreatedAt) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -92541,14 +104933,14 @@ func TestSettersMarkExplicitSchedulingEventTypeList(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetData_MarksExplicit", func(t *testing.T) { + t.Run("SetStartedAt_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingEventTypeList{} - var fernTestValueData []*SchedulingEventType + obj := &SchedulingReassignment{} + var fernTestValueStartedAt *string // Act - obj.SetData(fernTestValueData) + obj.SetStartedAt(fernTestValueStartedAt) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -92572,14 +104964,14 @@ func TestSettersMarkExplicitSchedulingEventTypeList(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetHasMore_MarksExplicit", func(t *testing.T) { + t.Run("SetFinishedAt_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingEventTypeList{} - var fernTestValueHasMore bool + obj := &SchedulingReassignment{} + var fernTestValueFinishedAt *string // Act - obj.SetHasMore(fernTestValueHasMore) + obj.SetFinishedAt(fernTestValueFinishedAt) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -92605,144 +104997,238 @@ func TestSettersMarkExplicitSchedulingEventTypeList(t *testing.T) { } -func TestSettersSchedulingEventTypeNotificationsValue(t *testing.T) { - t.Run("SetEmailAttendee", func(t *testing.T) { - obj := &SchedulingEventTypeNotificationsValue{} - var fernTestValueEmailAttendee *bool - obj.SetEmailAttendee(fernTestValueEmailAttendee) - assert.Equal(t, fernTestValueEmailAttendee, obj.EmailAttendee) +func TestSettersSchedulingReassignmentCounts(t *testing.T) { + t.Run("SetTotal", func(t *testing.T) { + obj := &SchedulingReassignmentCounts{} + var fernTestValueTotal float64 + obj.SetTotal(fernTestValueTotal) + assert.Equal(t, fernTestValueTotal, obj.Total) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetEmailHost", func(t *testing.T) { - obj := &SchedulingEventTypeNotificationsValue{} - var fernTestValueEmailHost *bool - obj.SetEmailHost(fernTestValueEmailHost) - assert.Equal(t, fernTestValueEmailHost, obj.EmailHost) + t.Run("SetPending", func(t *testing.T) { + obj := &SchedulingReassignmentCounts{} + var fernTestValuePending float64 + obj.SetPending(fernTestValuePending) + assert.Equal(t, fernTestValuePending, obj.Pending) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetSmsAttendee", func(t *testing.T) { - obj := &SchedulingEventTypeNotificationsValue{} - var fernTestValueSmsAttendee *bool - obj.SetSmsAttendee(fernTestValueSmsAttendee) - assert.Equal(t, fernTestValueSmsAttendee, obj.SmsAttendee) + t.Run("SetReassigned", func(t *testing.T) { + obj := &SchedulingReassignmentCounts{} + var fernTestValueReassigned float64 + obj.SetReassigned(fernTestValueReassigned) + assert.Equal(t, fernTestValueReassigned, obj.Reassigned) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetSkipped", func(t *testing.T) { + obj := &SchedulingReassignmentCounts{} + var fernTestValueSkipped float64 + obj.SetSkipped(fernTestValueSkipped) + assert.Equal(t, fernTestValueSkipped, obj.Skipped) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetNoCandidate", func(t *testing.T) { + obj := &SchedulingReassignmentCounts{} + var fernTestValueNoCandidate float64 + obj.SetNoCandidate(fernTestValueNoCandidate) + assert.Equal(t, fernTestValueNoCandidate, obj.NoCandidate) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetFailed", func(t *testing.T) { + obj := &SchedulingReassignmentCounts{} + var fernTestValueFailed float64 + obj.SetFailed(fernTestValueFailed) + assert.Equal(t, fernTestValueFailed, obj.Failed) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetCancelled", func(t *testing.T) { + obj := &SchedulingReassignmentCounts{} + var fernTestValueCancelled float64 + obj.SetCancelled(fernTestValueCancelled) + assert.Equal(t, fernTestValueCancelled, obj.Cancelled) assert.NotNil(t, obj.explicitFields) }) } -func TestGettersSchedulingEventTypeNotificationsValue(t *testing.T) { - t.Run("GetEmailAttendee", func(t *testing.T) { +func TestGettersSchedulingReassignmentCounts(t *testing.T) { + t.Run("GetTotal", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingEventTypeNotificationsValue{} - var expected *bool - obj.EmailAttendee = expected + obj := &SchedulingReassignmentCounts{} + var expected float64 + obj.Total = expected // Act & Assert - assert.Equal(t, expected, obj.GetEmailAttendee(), "getter should return the property value") + assert.Equal(t, expected, obj.GetTotal(), "getter should return the property value") }) - t.Run("GetEmailAttendee_NilValue", func(t *testing.T) { + t.Run("GetTotal_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingReassignmentCounts + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetTotal() // Should return zero value + }) + + t.Run("GetPending", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingEventTypeNotificationsValue{} - obj.EmailAttendee = nil + obj := &SchedulingReassignmentCounts{} + var expected float64 + obj.Pending = expected // Act & Assert - assert.Nil(t, obj.GetEmailAttendee(), "getter should return nil when property is nil") + assert.Equal(t, expected, obj.GetPending(), "getter should return the property value") }) - t.Run("GetEmailAttendee_NilReceiver", func(t *testing.T) { + t.Run("GetPending_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *SchedulingEventTypeNotificationsValue + var obj *SchedulingReassignmentCounts // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetEmailAttendee() // Should return zero value + _ = obj.GetPending() // Should return zero value }) - t.Run("GetEmailHost", func(t *testing.T) { + t.Run("GetReassigned", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingEventTypeNotificationsValue{} - var expected *bool - obj.EmailHost = expected + obj := &SchedulingReassignmentCounts{} + var expected float64 + obj.Reassigned = expected // Act & Assert - assert.Equal(t, expected, obj.GetEmailHost(), "getter should return the property value") + assert.Equal(t, expected, obj.GetReassigned(), "getter should return the property value") }) - t.Run("GetEmailHost_NilValue", func(t *testing.T) { + t.Run("GetReassigned_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingReassignmentCounts + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetReassigned() // Should return zero value + }) + + t.Run("GetSkipped", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingEventTypeNotificationsValue{} - obj.EmailHost = nil + obj := &SchedulingReassignmentCounts{} + var expected float64 + obj.Skipped = expected // Act & Assert - assert.Nil(t, obj.GetEmailHost(), "getter should return nil when property is nil") + assert.Equal(t, expected, obj.GetSkipped(), "getter should return the property value") }) - t.Run("GetEmailHost_NilReceiver", func(t *testing.T) { + t.Run("GetSkipped_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *SchedulingEventTypeNotificationsValue + var obj *SchedulingReassignmentCounts // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetEmailHost() // Should return zero value + _ = obj.GetSkipped() // Should return zero value }) - t.Run("GetSmsAttendee", func(t *testing.T) { + t.Run("GetNoCandidate", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingEventTypeNotificationsValue{} - var expected *bool - obj.SmsAttendee = expected + obj := &SchedulingReassignmentCounts{} + var expected float64 + obj.NoCandidate = expected // Act & Assert - assert.Equal(t, expected, obj.GetSmsAttendee(), "getter should return the property value") + assert.Equal(t, expected, obj.GetNoCandidate(), "getter should return the property value") }) - t.Run("GetSmsAttendee_NilValue", func(t *testing.T) { + t.Run("GetNoCandidate_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingReassignmentCounts + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetNoCandidate() // Should return zero value + }) + + t.Run("GetFailed", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingEventTypeNotificationsValue{} - obj.SmsAttendee = nil + obj := &SchedulingReassignmentCounts{} + var expected float64 + obj.Failed = expected // Act & Assert - assert.Nil(t, obj.GetSmsAttendee(), "getter should return nil when property is nil") + assert.Equal(t, expected, obj.GetFailed(), "getter should return the property value") }) - t.Run("GetSmsAttendee_NilReceiver", func(t *testing.T) { + t.Run("GetFailed_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *SchedulingEventTypeNotificationsValue + var obj *SchedulingReassignmentCounts // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetSmsAttendee() // Should return zero value + _ = obj.GetFailed() // Should return zero value + }) + + t.Run("GetCancelled", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingReassignmentCounts{} + var expected float64 + obj.Cancelled = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetCancelled(), "getter should return the property value") + }) + + t.Run("GetCancelled_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingReassignmentCounts + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetCancelled() // Should return zero value }) } -func TestSettersMarkExplicitSchedulingEventTypeNotificationsValue(t *testing.T) { - t.Run("SetEmailAttendee_MarksExplicit", func(t *testing.T) { +func TestSettersMarkExplicitSchedulingReassignmentCounts(t *testing.T) { + t.Run("SetTotal_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingEventTypeNotificationsValue{} - var fernTestValueEmailAttendee *bool + obj := &SchedulingReassignmentCounts{} + var fernTestValueTotal float64 // Act - obj.SetEmailAttendee(fernTestValueEmailAttendee) + obj.SetTotal(fernTestValueTotal) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -92766,14 +105252,14 @@ func TestSettersMarkExplicitSchedulingEventTypeNotificationsValue(t *testing.T) // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetEmailHost_MarksExplicit", func(t *testing.T) { + t.Run("SetPending_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingEventTypeNotificationsValue{} - var fernTestValueEmailHost *bool + obj := &SchedulingReassignmentCounts{} + var fernTestValuePending float64 // Act - obj.SetEmailHost(fernTestValueEmailHost) + obj.SetPending(fernTestValuePending) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -92797,14 +105283,14 @@ func TestSettersMarkExplicitSchedulingEventTypeNotificationsValue(t *testing.T) // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetSmsAttendee_MarksExplicit", func(t *testing.T) { + t.Run("SetReassigned_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingEventTypeNotificationsValue{} - var fernTestValueSmsAttendee *bool + obj := &SchedulingReassignmentCounts{} + var fernTestValueReassigned float64 // Act - obj.SetSmsAttendee(fernTestValueSmsAttendee) + obj.SetReassigned(fernTestValueReassigned) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -92828,95 +105314,76 @@ func TestSettersMarkExplicitSchedulingEventTypeNotificationsValue(t *testing.T) // It verifies that setting a field via setter allows successful JSON round-trip }) -} - -func TestSettersSchedulingGuestInput(t *testing.T) { - t.Run("SetEmail", func(t *testing.T) { - obj := &SchedulingGuestInput{} - var fernTestValueEmail string - obj.SetEmail(fernTestValueEmail) - assert.Equal(t, fernTestValueEmail, obj.Email) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetName", func(t *testing.T) { - obj := &SchedulingGuestInput{} - var fernTestValueName *string - obj.SetName(fernTestValueName) - assert.Equal(t, fernTestValueName, obj.Name) - assert.NotNil(t, obj.explicitFields) - }) - -} - -func TestGettersSchedulingGuestInput(t *testing.T) { - t.Run("GetEmail", func(t *testing.T) { + t.Run("SetSkipped_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingGuestInput{} - var expected string - obj.Email = expected + obj := &SchedulingReassignmentCounts{} + var fernTestValueSkipped float64 - // Act & Assert - assert.Equal(t, expected, obj.GetEmail(), "getter should return the property value") - }) + // Act + obj.SetSkipped(fernTestValueSkipped) - t.Run("GetEmail_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *SchedulingGuestInput - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetEmail() // Should return zero value - }) + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") - t.Run("GetName", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &SchedulingGuestInput{} - var expected *string - obj.Name = expected + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } - // Act & Assert - assert.Equal(t, expected, obj.GetName(), "getter should return the property value") + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("GetName_NilValue", func(t *testing.T) { + t.Run("SetNoCandidate_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingGuestInput{} - obj.Name = nil + obj := &SchedulingReassignmentCounts{} + var fernTestValueNoCandidate float64 - // Act & Assert - assert.Nil(t, obj.GetName(), "getter should return nil when property is nil") - }) + // Act + obj.SetNoCandidate(fernTestValueNoCandidate) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } - t.Run("GetName_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *SchedulingGuestInput - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetName() // Should return zero value + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip }) -} - -func TestSettersMarkExplicitSchedulingGuestInput(t *testing.T) { - t.Run("SetEmail_MarksExplicit", func(t *testing.T) { + t.Run("SetFailed_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingGuestInput{} - var fernTestValueEmail string + obj := &SchedulingReassignmentCounts{} + var fernTestValueFailed float64 // Act - obj.SetEmail(fernTestValueEmail) + obj.SetFailed(fernTestValueFailed) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -92940,14 +105407,14 @@ func TestSettersMarkExplicitSchedulingGuestInput(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetName_MarksExplicit", func(t *testing.T) { + t.Run("SetCancelled_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingGuestInput{} - var fernTestValueName *string + obj := &SchedulingReassignmentCounts{} + var fernTestValueCancelled float64 // Act - obj.SetName(fernTestValueName) + obj.SetCancelled(fernTestValueCancelled) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -92973,135 +105440,71 @@ func TestSettersMarkExplicitSchedulingGuestInput(t *testing.T) { } -func TestSettersSchedulingHost(t *testing.T) { +func TestSettersSchedulingReassignmentItem(t *testing.T) { t.Run("SetObject", func(t *testing.T) { - obj := &SchedulingHost{} - var fernTestValueObject SchedulingHostObject + obj := &SchedulingReassignmentItem{} + var fernTestValueObject SchedulingReassignmentItemObject obj.SetObject(fernTestValueObject) assert.Equal(t, fernTestValueObject, obj.Object) assert.NotNil(t, obj.explicitFields) }) t.Run("SetID", func(t *testing.T) { - obj := &SchedulingHost{} + obj := &SchedulingReassignmentItem{} var fernTestValueID string obj.SetID(fernTestValueID) assert.Equal(t, fernTestValueID, obj.ID) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetUID", func(t *testing.T) { - obj := &SchedulingHost{} - var fernTestValueUID *string - obj.SetUID(fernTestValueUID) - assert.Equal(t, fernTestValueUID, obj.UID) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetName", func(t *testing.T) { - obj := &SchedulingHost{} - var fernTestValueName string - obj.SetName(fernTestValueName) - assert.Equal(t, fernTestValueName, obj.Name) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetEmail", func(t *testing.T) { - obj := &SchedulingHost{} - var fernTestValueEmail *string - obj.SetEmail(fernTestValueEmail) - assert.Equal(t, fernTestValueEmail, obj.Email) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetPhone", func(t *testing.T) { - obj := &SchedulingHost{} - var fernTestValuePhone *string - obj.SetPhone(fernTestValuePhone) - assert.Equal(t, fernTestValuePhone, obj.Phone) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetCalendarAccount", func(t *testing.T) { - obj := &SchedulingHost{} - var fernTestValueCalendarAccount *string - obj.SetCalendarAccount(fernTestValueCalendarAccount) - assert.Equal(t, fernTestValueCalendarAccount, obj.CalendarAccount) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetTimeZone", func(t *testing.T) { - obj := &SchedulingHost{} - var fernTestValueTimeZone string - obj.SetTimeZone(fernTestValueTimeZone) - assert.Equal(t, fernTestValueTimeZone, obj.TimeZone) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetLocale", func(t *testing.T) { - obj := &SchedulingHost{} - var fernTestValueLocale *string - obj.SetLocale(fernTestValueLocale) - assert.Equal(t, fernTestValueLocale, obj.Locale) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetAttributes", func(t *testing.T) { - obj := &SchedulingHost{} - var fernTestValueAttributes map[string]*SchedulingHostAttributesValue - obj.SetAttributes(fernTestValueAttributes) - assert.Equal(t, fernTestValueAttributes, obj.Attributes) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetLocations", func(t *testing.T) { - obj := &SchedulingHost{} - var fernTestValueLocations []*SchedulingHostLocation - obj.SetLocations(fernTestValueLocations) - assert.Equal(t, fernTestValueLocations, obj.Locations) + t.Run("SetBooking", func(t *testing.T) { + obj := &SchedulingReassignmentItem{} + var fernTestValueBooking string + obj.SetBooking(fernTestValueBooking) + assert.Equal(t, fernTestValueBooking, obj.Booking) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetMetadata", func(t *testing.T) { - obj := &SchedulingHost{} - var fernTestValueMetadata map[string]string - obj.SetMetadata(fernTestValueMetadata) - assert.Equal(t, fernTestValueMetadata, obj.Metadata) + t.Run("SetFromHost", func(t *testing.T) { + obj := &SchedulingReassignmentItem{} + var fernTestValueFromHost *string + obj.SetFromHost(fernTestValueFromHost) + assert.Equal(t, fernTestValueFromHost, obj.FromHost) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetStatus", func(t *testing.T) { - obj := &SchedulingHost{} - var fernTestValueStatus SchedulingHostStatus - obj.SetStatus(fernTestValueStatus) - assert.Equal(t, fernTestValueStatus, obj.Status) + t.Run("SetToHost", func(t *testing.T) { + obj := &SchedulingReassignmentItem{} + var fernTestValueToHost *string + obj.SetToHost(fernTestValueToHost) + assert.Equal(t, fernTestValueToHost, obj.ToHost) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetCreatedAt", func(t *testing.T) { - obj := &SchedulingHost{} - var fernTestValueCreatedAt string - obj.SetCreatedAt(fernTestValueCreatedAt) - assert.Equal(t, fernTestValueCreatedAt, obj.CreatedAt) + t.Run("SetOutcome", func(t *testing.T) { + obj := &SchedulingReassignmentItem{} + var fernTestValueOutcome SchedulingReassignmentItemOutcome + obj.SetOutcome(fernTestValueOutcome) + assert.Equal(t, fernTestValueOutcome, obj.Outcome) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetUpdatedAt", func(t *testing.T) { - obj := &SchedulingHost{} - var fernTestValueUpdatedAt string - obj.SetUpdatedAt(fernTestValueUpdatedAt) - assert.Equal(t, fernTestValueUpdatedAt, obj.UpdatedAt) + t.Run("SetErrorCode", func(t *testing.T) { + obj := &SchedulingReassignmentItem{} + var fernTestValueErrorCode *string + obj.SetErrorCode(fernTestValueErrorCode) + assert.Equal(t, fernTestValueErrorCode, obj.ErrorCode) assert.NotNil(t, obj.explicitFields) }) } -func TestGettersSchedulingHost(t *testing.T) { +func TestGettersSchedulingReassignmentItem(t *testing.T) { t.Run("GetObject", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingHost{} - var expected SchedulingHostObject + obj := &SchedulingReassignmentItem{} + var expected SchedulingReassignmentItemObject obj.Object = expected // Act & Assert @@ -93110,7 +105513,7 @@ func TestGettersSchedulingHost(t *testing.T) { t.Run("GetObject_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *SchedulingHost + var obj *SchedulingReassignmentItem // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -93123,7 +105526,7 @@ func TestGettersSchedulingHost(t *testing.T) { t.Run("GetID", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingHost{} + obj := &SchedulingReassignmentItem{} var expected string obj.ID = expected @@ -93133,7 +105536,7 @@ func TestGettersSchedulingHost(t *testing.T) { t.Run("GetID_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *SchedulingHost + var obj *SchedulingReassignmentItem // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -93143,396 +105546,193 @@ func TestGettersSchedulingHost(t *testing.T) { _ = obj.GetID() // Should return zero value }) - t.Run("GetUID", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &SchedulingHost{} - var expected *string - obj.UID = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetUID(), "getter should return the property value") - }) - - t.Run("GetUID_NilValue", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &SchedulingHost{} - obj.UID = nil - - // Act & Assert - assert.Nil(t, obj.GetUID(), "getter should return nil when property is nil") - }) - - t.Run("GetUID_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *SchedulingHost - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetUID() // Should return zero value - }) - - t.Run("GetName", func(t *testing.T) { + t.Run("GetBooking", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingHost{} + obj := &SchedulingReassignmentItem{} var expected string - obj.Name = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetName(), "getter should return the property value") - }) - - t.Run("GetName_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *SchedulingHost - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetName() // Should return zero value - }) - - t.Run("GetEmail", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &SchedulingHost{} - var expected *string - obj.Email = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetEmail(), "getter should return the property value") - }) - - t.Run("GetEmail_NilValue", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &SchedulingHost{} - obj.Email = nil + obj.Booking = expected // Act & Assert - assert.Nil(t, obj.GetEmail(), "getter should return nil when property is nil") + assert.Equal(t, expected, obj.GetBooking(), "getter should return the property value") }) - t.Run("GetEmail_NilReceiver", func(t *testing.T) { + t.Run("GetBooking_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *SchedulingHost + var obj *SchedulingReassignmentItem // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetEmail() // Should return zero value + _ = obj.GetBooking() // Should return zero value }) - t.Run("GetPhone", func(t *testing.T) { + t.Run("GetFromHost", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingHost{} + obj := &SchedulingReassignmentItem{} var expected *string - obj.Phone = expected + obj.FromHost = expected // Act & Assert - assert.Equal(t, expected, obj.GetPhone(), "getter should return the property value") + assert.Equal(t, expected, obj.GetFromHost(), "getter should return the property value") }) - t.Run("GetPhone_NilValue", func(t *testing.T) { + t.Run("GetFromHost_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingHost{} - obj.Phone = nil + obj := &SchedulingReassignmentItem{} + obj.FromHost = nil // Act & Assert - assert.Nil(t, obj.GetPhone(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetFromHost(), "getter should return nil when property is nil") }) - t.Run("GetPhone_NilReceiver", func(t *testing.T) { + t.Run("GetFromHost_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *SchedulingHost + var obj *SchedulingReassignmentItem // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetPhone() // Should return zero value + _ = obj.GetFromHost() // Should return zero value }) - t.Run("GetCalendarAccount", func(t *testing.T) { + t.Run("GetToHost", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingHost{} + obj := &SchedulingReassignmentItem{} var expected *string - obj.CalendarAccount = expected + obj.ToHost = expected // Act & Assert - assert.Equal(t, expected, obj.GetCalendarAccount(), "getter should return the property value") + assert.Equal(t, expected, obj.GetToHost(), "getter should return the property value") }) - t.Run("GetCalendarAccount_NilValue", func(t *testing.T) { + t.Run("GetToHost_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingHost{} - obj.CalendarAccount = nil + obj := &SchedulingReassignmentItem{} + obj.ToHost = nil // Act & Assert - assert.Nil(t, obj.GetCalendarAccount(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetToHost(), "getter should return nil when property is nil") }) - t.Run("GetCalendarAccount_NilReceiver", func(t *testing.T) { + t.Run("GetToHost_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *SchedulingHost + var obj *SchedulingReassignmentItem // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetCalendarAccount() // Should return zero value + _ = obj.GetToHost() // Should return zero value }) - t.Run("GetTimeZone", func(t *testing.T) { + t.Run("GetOutcome", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingHost{} - var expected string - obj.TimeZone = expected + obj := &SchedulingReassignmentItem{} + var expected SchedulingReassignmentItemOutcome + obj.Outcome = expected // Act & Assert - assert.Equal(t, expected, obj.GetTimeZone(), "getter should return the property value") + assert.Equal(t, expected, obj.GetOutcome(), "getter should return the property value") }) - t.Run("GetTimeZone_NilReceiver", func(t *testing.T) { + t.Run("GetOutcome_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *SchedulingHost + var obj *SchedulingReassignmentItem // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetTimeZone() // Should return zero value + _ = obj.GetOutcome() // Should return zero value }) - t.Run("GetLocale", func(t *testing.T) { + t.Run("GetErrorCode", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingHost{} + obj := &SchedulingReassignmentItem{} var expected *string - obj.Locale = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetLocale(), "getter should return the property value") - }) - - t.Run("GetLocale_NilValue", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &SchedulingHost{} - obj.Locale = nil - - // Act & Assert - assert.Nil(t, obj.GetLocale(), "getter should return nil when property is nil") - }) - - t.Run("GetLocale_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *SchedulingHost - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetLocale() // Should return zero value - }) - - t.Run("GetAttributes", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &SchedulingHost{} - var expected map[string]*SchedulingHostAttributesValue - obj.Attributes = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetAttributes(), "getter should return the property value") - }) - - t.Run("GetAttributes_NilValue", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &SchedulingHost{} - obj.Attributes = nil - - // Act & Assert - assert.Nil(t, obj.GetAttributes(), "getter should return nil when property is nil") - }) - - t.Run("GetAttributes_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *SchedulingHost - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetAttributes() // Should return zero value - }) - - t.Run("GetLocations", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &SchedulingHost{} - var expected []*SchedulingHostLocation - obj.Locations = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetLocations(), "getter should return the property value") - }) - - t.Run("GetLocations_NilValue", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &SchedulingHost{} - obj.Locations = nil - - // Act & Assert - assert.Nil(t, obj.GetLocations(), "getter should return nil when property is nil") - }) - - t.Run("GetLocations_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *SchedulingHost - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetLocations() // Should return zero value - }) - - t.Run("GetMetadata", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &SchedulingHost{} - var expected map[string]string - obj.Metadata = expected + obj.ErrorCode = expected // Act & Assert - assert.Equal(t, expected, obj.GetMetadata(), "getter should return the property value") + assert.Equal(t, expected, obj.GetErrorCode(), "getter should return the property value") }) - t.Run("GetMetadata_NilValue", func(t *testing.T) { + t.Run("GetErrorCode_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingHost{} - obj.Metadata = nil + obj := &SchedulingReassignmentItem{} + obj.ErrorCode = nil // Act & Assert - assert.Nil(t, obj.GetMetadata(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetErrorCode(), "getter should return nil when property is nil") }) - t.Run("GetMetadata_NilReceiver", func(t *testing.T) { + t.Run("GetErrorCode_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *SchedulingHost + var obj *SchedulingReassignmentItem // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetMetadata() // Should return zero value - }) - - t.Run("GetStatus", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &SchedulingHost{} - var expected SchedulingHostStatus - obj.Status = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetStatus(), "getter should return the property value") + _ = obj.GetErrorCode() // Should return zero value }) - t.Run("GetStatus_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *SchedulingHost - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetStatus() // Should return zero value - }) +} - t.Run("GetCreatedAt", func(t *testing.T) { +func TestSettersMarkExplicitSchedulingReassignmentItem(t *testing.T) { + t.Run("SetObject_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingHost{} - var expected string - obj.CreatedAt = expected + obj := &SchedulingReassignmentItem{} + var fernTestValueObject SchedulingReassignmentItemObject - // Act & Assert - assert.Equal(t, expected, obj.GetCreatedAt(), "getter should return the property value") - }) - - t.Run("GetCreatedAt_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *SchedulingHost - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetCreatedAt() // Should return zero value - }) + // Act + obj.SetObject(fernTestValueObject) - t.Run("GetUpdatedAt", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &SchedulingHost{} - var expected string - obj.UpdatedAt = expected + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") - // Act & Assert - assert.Equal(t, expected, obj.GetUpdatedAt(), "getter should return the property value") - }) + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } - t.Run("GetUpdatedAt_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *SchedulingHost - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetUpdatedAt() // Should return zero value + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip }) -} - -func TestSettersMarkExplicitSchedulingHost(t *testing.T) { - t.Run("SetObject_MarksExplicit", func(t *testing.T) { + t.Run("SetID_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingHost{} - var fernTestValueObject SchedulingHostObject + obj := &SchedulingReassignmentItem{} + var fernTestValueID string // Act - obj.SetObject(fernTestValueObject) + obj.SetID(fernTestValueID) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -93556,14 +105756,14 @@ func TestSettersMarkExplicitSchedulingHost(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetID_MarksExplicit", func(t *testing.T) { + t.Run("SetBooking_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingHost{} - var fernTestValueID string + obj := &SchedulingReassignmentItem{} + var fernTestValueBooking string // Act - obj.SetID(fernTestValueID) + obj.SetBooking(fernTestValueBooking) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -93587,14 +105787,14 @@ func TestSettersMarkExplicitSchedulingHost(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetUID_MarksExplicit", func(t *testing.T) { + t.Run("SetFromHost_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingHost{} - var fernTestValueUID *string + obj := &SchedulingReassignmentItem{} + var fernTestValueFromHost *string // Act - obj.SetUID(fernTestValueUID) + obj.SetFromHost(fernTestValueFromHost) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -93618,14 +105818,14 @@ func TestSettersMarkExplicitSchedulingHost(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetName_MarksExplicit", func(t *testing.T) { + t.Run("SetToHost_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingHost{} - var fernTestValueName string + obj := &SchedulingReassignmentItem{} + var fernTestValueToHost *string // Act - obj.SetName(fernTestValueName) + obj.SetToHost(fernTestValueToHost) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -93649,14 +105849,14 @@ func TestSettersMarkExplicitSchedulingHost(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetEmail_MarksExplicit", func(t *testing.T) { + t.Run("SetOutcome_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingHost{} - var fernTestValueEmail *string + obj := &SchedulingReassignmentItem{} + var fernTestValueOutcome SchedulingReassignmentItemOutcome // Act - obj.SetEmail(fernTestValueEmail) + obj.SetOutcome(fernTestValueOutcome) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -93680,14 +105880,14 @@ func TestSettersMarkExplicitSchedulingHost(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetPhone_MarksExplicit", func(t *testing.T) { + t.Run("SetErrorCode_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingHost{} - var fernTestValuePhone *string + obj := &SchedulingReassignmentItem{} + var fernTestValueErrorCode *string // Act - obj.SetPhone(fernTestValuePhone) + obj.SetErrorCode(fernTestValueErrorCode) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -93711,14 +105911,126 @@ func TestSettersMarkExplicitSchedulingHost(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetCalendarAccount_MarksExplicit", func(t *testing.T) { +} + +func TestSettersSchedulingReassignmentItemList(t *testing.T) { + t.Run("SetObject", func(t *testing.T) { + obj := &SchedulingReassignmentItemList{} + var fernTestValueObject SchedulingReassignmentItemListObject + obj.SetObject(fernTestValueObject) + assert.Equal(t, fernTestValueObject, obj.Object) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetData", func(t *testing.T) { + obj := &SchedulingReassignmentItemList{} + var fernTestValueData []*SchedulingReassignmentItem + obj.SetData(fernTestValueData) + assert.Equal(t, fernTestValueData, obj.Data) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetHasMore", func(t *testing.T) { + obj := &SchedulingReassignmentItemList{} + var fernTestValueHasMore bool + obj.SetHasMore(fernTestValueHasMore) + assert.Equal(t, fernTestValueHasMore, obj.HasMore) + assert.NotNil(t, obj.explicitFields) + }) + +} + +func TestGettersSchedulingReassignmentItemList(t *testing.T) { + t.Run("GetObject", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingHost{} - var fernTestValueCalendarAccount *string + obj := &SchedulingReassignmentItemList{} + var expected SchedulingReassignmentItemListObject + obj.Object = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetObject(), "getter should return the property value") + }) + + t.Run("GetObject_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingReassignmentItemList + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetObject() // Should return zero value + }) + + t.Run("GetData", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingReassignmentItemList{} + var expected []*SchedulingReassignmentItem + obj.Data = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetData(), "getter should return the property value") + }) + + t.Run("GetData_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingReassignmentItemList{} + obj.Data = nil + + // Act & Assert + assert.Nil(t, obj.GetData(), "getter should return nil when property is nil") + }) + + t.Run("GetData_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingReassignmentItemList + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetData() // Should return zero value + }) + + t.Run("GetHasMore", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingReassignmentItemList{} + var expected bool + obj.HasMore = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetHasMore(), "getter should return the property value") + }) + + t.Run("GetHasMore_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingReassignmentItemList + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetHasMore() // Should return zero value + }) + +} + +func TestSettersMarkExplicitSchedulingReassignmentItemList(t *testing.T) { + t.Run("SetObject_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingReassignmentItemList{} + var fernTestValueObject SchedulingReassignmentItemListObject // Act - obj.SetCalendarAccount(fernTestValueCalendarAccount) + obj.SetObject(fernTestValueObject) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -93742,14 +106054,14 @@ func TestSettersMarkExplicitSchedulingHost(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetTimeZone_MarksExplicit", func(t *testing.T) { + t.Run("SetData_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingHost{} - var fernTestValueTimeZone string + obj := &SchedulingReassignmentItemList{} + var fernTestValueData []*SchedulingReassignmentItem // Act - obj.SetTimeZone(fernTestValueTimeZone) + obj.SetData(fernTestValueData) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -93773,14 +106085,14 @@ func TestSettersMarkExplicitSchedulingHost(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetLocale_MarksExplicit", func(t *testing.T) { + t.Run("SetHasMore_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingHost{} - var fernTestValueLocale *string + obj := &SchedulingReassignmentItemList{} + var fernTestValueHasMore bool // Act - obj.SetLocale(fernTestValueLocale) + obj.SetHasMore(fernTestValueHasMore) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -93804,14 +106116,126 @@ func TestSettersMarkExplicitSchedulingHost(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetAttributes_MarksExplicit", func(t *testing.T) { +} + +func TestSettersSchedulingReassignmentList(t *testing.T) { + t.Run("SetObject", func(t *testing.T) { + obj := &SchedulingReassignmentList{} + var fernTestValueObject SchedulingReassignmentListObject + obj.SetObject(fernTestValueObject) + assert.Equal(t, fernTestValueObject, obj.Object) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetData", func(t *testing.T) { + obj := &SchedulingReassignmentList{} + var fernTestValueData []*SchedulingReassignment + obj.SetData(fernTestValueData) + assert.Equal(t, fernTestValueData, obj.Data) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetHasMore", func(t *testing.T) { + obj := &SchedulingReassignmentList{} + var fernTestValueHasMore bool + obj.SetHasMore(fernTestValueHasMore) + assert.Equal(t, fernTestValueHasMore, obj.HasMore) + assert.NotNil(t, obj.explicitFields) + }) + +} + +func TestGettersSchedulingReassignmentList(t *testing.T) { + t.Run("GetObject", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingHost{} - var fernTestValueAttributes map[string]*SchedulingHostAttributesValue + obj := &SchedulingReassignmentList{} + var expected SchedulingReassignmentListObject + obj.Object = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetObject(), "getter should return the property value") + }) + + t.Run("GetObject_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingReassignmentList + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetObject() // Should return zero value + }) + + t.Run("GetData", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingReassignmentList{} + var expected []*SchedulingReassignment + obj.Data = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetData(), "getter should return the property value") + }) + + t.Run("GetData_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingReassignmentList{} + obj.Data = nil + + // Act & Assert + assert.Nil(t, obj.GetData(), "getter should return nil when property is nil") + }) + + t.Run("GetData_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingReassignmentList + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetData() // Should return zero value + }) + + t.Run("GetHasMore", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingReassignmentList{} + var expected bool + obj.HasMore = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetHasMore(), "getter should return the property value") + }) + + t.Run("GetHasMore_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingReassignmentList + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetHasMore() // Should return zero value + }) + +} + +func TestSettersMarkExplicitSchedulingReassignmentList(t *testing.T) { + t.Run("SetObject_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingReassignmentList{} + var fernTestValueObject SchedulingReassignmentListObject // Act - obj.SetAttributes(fernTestValueAttributes) + obj.SetObject(fernTestValueObject) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -93835,14 +106259,14 @@ func TestSettersMarkExplicitSchedulingHost(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetLocations_MarksExplicit", func(t *testing.T) { + t.Run("SetData_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingHost{} - var fernTestValueLocations []*SchedulingHostLocation + obj := &SchedulingReassignmentList{} + var fernTestValueData []*SchedulingReassignment // Act - obj.SetLocations(fernTestValueLocations) + obj.SetData(fernTestValueData) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -93866,14 +106290,14 @@ func TestSettersMarkExplicitSchedulingHost(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetMetadata_MarksExplicit", func(t *testing.T) { + t.Run("SetHasMore_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingHost{} - var fernTestValueMetadata map[string]string + obj := &SchedulingReassignmentList{} + var fernTestValueHasMore bool // Act - obj.SetMetadata(fernTestValueMetadata) + obj.SetHasMore(fernTestValueHasMore) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -93897,14 +106321,126 @@ func TestSettersMarkExplicitSchedulingHost(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetStatus_MarksExplicit", func(t *testing.T) { +} + +func TestSettersSchedulingReassignmentPreview(t *testing.T) { + t.Run("SetObject", func(t *testing.T) { + obj := &SchedulingReassignmentPreview{} + var fernTestValueObject SchedulingReassignmentPreviewObject + obj.SetObject(fernTestValueObject) + assert.Equal(t, fernTestValueObject, obj.Object) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetItems", func(t *testing.T) { + obj := &SchedulingReassignmentPreview{} + var fernTestValueItems []*SchedulingReassignmentPreviewItemsItem + obj.SetItems(fernTestValueItems) + assert.Equal(t, fernTestValueItems, obj.Items) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetTruncated", func(t *testing.T) { + obj := &SchedulingReassignmentPreview{} + var fernTestValueTruncated bool + obj.SetTruncated(fernTestValueTruncated) + assert.Equal(t, fernTestValueTruncated, obj.Truncated) + assert.NotNil(t, obj.explicitFields) + }) + +} + +func TestGettersSchedulingReassignmentPreview(t *testing.T) { + t.Run("GetObject", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingHost{} - var fernTestValueStatus SchedulingHostStatus + obj := &SchedulingReassignmentPreview{} + var expected SchedulingReassignmentPreviewObject + obj.Object = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetObject(), "getter should return the property value") + }) + + t.Run("GetObject_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingReassignmentPreview + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetObject() // Should return zero value + }) + + t.Run("GetItems", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingReassignmentPreview{} + var expected []*SchedulingReassignmentPreviewItemsItem + obj.Items = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetItems(), "getter should return the property value") + }) + + t.Run("GetItems_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingReassignmentPreview{} + obj.Items = nil + + // Act & Assert + assert.Nil(t, obj.GetItems(), "getter should return nil when property is nil") + }) + + t.Run("GetItems_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingReassignmentPreview + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetItems() // Should return zero value + }) + + t.Run("GetTruncated", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingReassignmentPreview{} + var expected bool + obj.Truncated = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetTruncated(), "getter should return the property value") + }) + + t.Run("GetTruncated_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingReassignmentPreview + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetTruncated() // Should return zero value + }) + +} + +func TestSettersMarkExplicitSchedulingReassignmentPreview(t *testing.T) { + t.Run("SetObject_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingReassignmentPreview{} + var fernTestValueObject SchedulingReassignmentPreviewObject // Act - obj.SetStatus(fernTestValueStatus) + obj.SetObject(fernTestValueObject) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -93928,14 +106464,14 @@ func TestSettersMarkExplicitSchedulingHost(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetCreatedAt_MarksExplicit", func(t *testing.T) { + t.Run("SetItems_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingHost{} - var fernTestValueCreatedAt string + obj := &SchedulingReassignmentPreview{} + var fernTestValueItems []*SchedulingReassignmentPreviewItemsItem // Act - obj.SetCreatedAt(fernTestValueCreatedAt) + obj.SetItems(fernTestValueItems) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -93959,14 +106495,14 @@ func TestSettersMarkExplicitSchedulingHost(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetUpdatedAt_MarksExplicit", func(t *testing.T) { + t.Run("SetTruncated_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingHost{} - var fernTestValueUpdatedAt string + obj := &SchedulingReassignmentPreview{} + var fernTestValueTruncated bool // Act - obj.SetUpdatedAt(fernTestValueUpdatedAt) + obj.SetTruncated(fernTestValueTruncated) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -93992,183 +106528,412 @@ func TestSettersMarkExplicitSchedulingHost(t *testing.T) { } -func TestGettersSchedulingHostAttributesValue(t *testing.T) { - t.Run("GetString", func(t *testing.T) { +func TestSettersSchedulingReassignmentPreviewItemsItem(t *testing.T) { + t.Run("SetBooking", func(t *testing.T) { + obj := &SchedulingReassignmentPreviewItemsItem{} + var fernTestValueBooking string + obj.SetBooking(fernTestValueBooking) + assert.Equal(t, fernTestValueBooking, obj.Booking) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetEventType", func(t *testing.T) { + obj := &SchedulingReassignmentPreviewItemsItem{} + var fernTestValueEventType string + obj.SetEventType(fernTestValueEventType) + assert.Equal(t, fernTestValueEventType, obj.EventType) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetTitle", func(t *testing.T) { + obj := &SchedulingReassignmentPreviewItemsItem{} + var fernTestValueTitle string + obj.SetTitle(fernTestValueTitle) + assert.Equal(t, fernTestValueTitle, obj.Title) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetStatus", func(t *testing.T) { + obj := &SchedulingReassignmentPreviewItemsItem{} + var fernTestValueStatus SchedulingReassignmentPreviewItemsItemStatus + obj.SetStatus(fernTestValueStatus) + assert.Equal(t, fernTestValueStatus, obj.Status) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetStart", func(t *testing.T) { + obj := &SchedulingReassignmentPreviewItemsItem{} + var fernTestValueStart string + obj.SetStart(fernTestValueStart) + assert.Equal(t, fernTestValueStart, obj.Start) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetEnd", func(t *testing.T) { + obj := &SchedulingReassignmentPreviewItemsItem{} + var fernTestValueEnd string + obj.SetEnd(fernTestValueEnd) + assert.Equal(t, fernTestValueEnd, obj.End) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetSeries", func(t *testing.T) { + obj := &SchedulingReassignmentPreviewItemsItem{} + var fernTestValueSeries *string + obj.SetSeries(fernTestValueSeries) + assert.Equal(t, fernTestValueSeries, obj.Series) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetGroupSession", func(t *testing.T) { + obj := &SchedulingReassignmentPreviewItemsItem{} + var fernTestValueGroupSession *string + obj.SetGroupSession(fernTestValueGroupSession) + assert.Equal(t, fernTestValueGroupSession, obj.GroupSession) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetFromHost", func(t *testing.T) { + obj := &SchedulingReassignmentPreviewItemsItem{} + var fernTestValueFromHost *string + obj.SetFromHost(fernTestValueFromHost) + assert.Equal(t, fernTestValueFromHost, obj.FromHost) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetToHost", func(t *testing.T) { + obj := &SchedulingReassignmentPreviewItemsItem{} + var fernTestValueToHost *string + obj.SetToHost(fernTestValueToHost) + assert.Equal(t, fernTestValueToHost, obj.ToHost) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetReason", func(t *testing.T) { + obj := &SchedulingReassignmentPreviewItemsItem{} + var fernTestValueReason *string + obj.SetReason(fernTestValueReason) + assert.Equal(t, fernTestValueReason, obj.Reason) + assert.NotNil(t, obj.explicitFields) + }) + +} + +func TestGettersSchedulingReassignmentPreviewItemsItem(t *testing.T) { + t.Run("GetBooking", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingHostAttributesValue{} + obj := &SchedulingReassignmentPreviewItemsItem{} var expected string - obj.String = expected + obj.Booking = expected // Act & Assert - assert.Equal(t, expected, obj.GetString(), "getter should return the property value") + assert.Equal(t, expected, obj.GetBooking(), "getter should return the property value") }) - t.Run("GetString_NilReceiver", func(t *testing.T) { + t.Run("GetBooking_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *SchedulingHostAttributesValue + var obj *SchedulingReassignmentPreviewItemsItem // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetString() // Should return zero value + _ = obj.GetBooking() // Should return zero value }) - t.Run("GetStringList", func(t *testing.T) { + t.Run("GetEventType", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingHostAttributesValue{} - var expected []string - obj.StringList = expected + obj := &SchedulingReassignmentPreviewItemsItem{} + var expected string + obj.EventType = expected // Act & Assert - assert.Equal(t, expected, obj.GetStringList(), "getter should return the property value") + assert.Equal(t, expected, obj.GetEventType(), "getter should return the property value") }) - t.Run("GetStringList_NilValue", func(t *testing.T) { + t.Run("GetEventType_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingReassignmentPreviewItemsItem + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetEventType() // Should return zero value + }) + + t.Run("GetTitle", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingHostAttributesValue{} - obj.StringList = nil + obj := &SchedulingReassignmentPreviewItemsItem{} + var expected string + obj.Title = expected // Act & Assert - assert.Nil(t, obj.GetStringList(), "getter should return nil when property is nil") + assert.Equal(t, expected, obj.GetTitle(), "getter should return the property value") }) - t.Run("GetStringList_NilReceiver", func(t *testing.T) { + t.Run("GetTitle_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *SchedulingHostAttributesValue + var obj *SchedulingReassignmentPreviewItemsItem // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetStringList() // Should return zero value + _ = obj.GetTitle() // Should return zero value }) -} + t.Run("GetStatus", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingReassignmentPreviewItemsItem{} + var expected SchedulingReassignmentPreviewItemsItemStatus + obj.Status = expected -func TestSettersSchedulingHostList(t *testing.T) { - t.Run("SetObject", func(t *testing.T) { - obj := &SchedulingHostList{} - var fernTestValueObject SchedulingHostListObject - obj.SetObject(fernTestValueObject) - assert.Equal(t, fernTestValueObject, obj.Object) - assert.NotNil(t, obj.explicitFields) + // Act & Assert + assert.Equal(t, expected, obj.GetStatus(), "getter should return the property value") }) - t.Run("SetData", func(t *testing.T) { - obj := &SchedulingHostList{} - var fernTestValueData []*SchedulingHost - obj.SetData(fernTestValueData) - assert.Equal(t, fernTestValueData, obj.Data) - assert.NotNil(t, obj.explicitFields) + t.Run("GetStatus_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingReassignmentPreviewItemsItem + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetStatus() // Should return zero value + }) + + t.Run("GetStart", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingReassignmentPreviewItemsItem{} + var expected string + obj.Start = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetStart(), "getter should return the property value") + }) + + t.Run("GetStart_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingReassignmentPreviewItemsItem + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetStart() // Should return zero value + }) + + t.Run("GetEnd", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingReassignmentPreviewItemsItem{} + var expected string + obj.End = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetEnd(), "getter should return the property value") + }) + + t.Run("GetEnd_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingReassignmentPreviewItemsItem + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetEnd() // Should return zero value + }) + + t.Run("GetSeries", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingReassignmentPreviewItemsItem{} + var expected *string + obj.Series = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetSeries(), "getter should return the property value") + }) + + t.Run("GetSeries_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingReassignmentPreviewItemsItem{} + obj.Series = nil + + // Act & Assert + assert.Nil(t, obj.GetSeries(), "getter should return nil when property is nil") + }) + + t.Run("GetSeries_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingReassignmentPreviewItemsItem + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetSeries() // Should return zero value + }) + + t.Run("GetGroupSession", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingReassignmentPreviewItemsItem{} + var expected *string + obj.GroupSession = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetGroupSession(), "getter should return the property value") + }) + + t.Run("GetGroupSession_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingReassignmentPreviewItemsItem{} + obj.GroupSession = nil + + // Act & Assert + assert.Nil(t, obj.GetGroupSession(), "getter should return nil when property is nil") }) - t.Run("SetHasMore", func(t *testing.T) { - obj := &SchedulingHostList{} - var fernTestValueHasMore bool - obj.SetHasMore(fernTestValueHasMore) - assert.Equal(t, fernTestValueHasMore, obj.HasMore) - assert.NotNil(t, obj.explicitFields) + t.Run("GetGroupSession_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingReassignmentPreviewItemsItem + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetGroupSession() // Should return zero value }) -} + t.Run("GetFromHost", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingReassignmentPreviewItemsItem{} + var expected *string + obj.FromHost = expected -func TestGettersSchedulingHostList(t *testing.T) { - t.Run("GetObject", func(t *testing.T) { + // Act & Assert + assert.Equal(t, expected, obj.GetFromHost(), "getter should return the property value") + }) + + t.Run("GetFromHost_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingHostList{} - var expected SchedulingHostListObject - obj.Object = expected + obj := &SchedulingReassignmentPreviewItemsItem{} + obj.FromHost = nil // Act & Assert - assert.Equal(t, expected, obj.GetObject(), "getter should return the property value") + assert.Nil(t, obj.GetFromHost(), "getter should return nil when property is nil") }) - t.Run("GetObject_NilReceiver", func(t *testing.T) { + t.Run("GetFromHost_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *SchedulingHostList + var obj *SchedulingReassignmentPreviewItemsItem // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetObject() // Should return zero value + _ = obj.GetFromHost() // Should return zero value }) - t.Run("GetData", func(t *testing.T) { + t.Run("GetToHost", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingHostList{} - var expected []*SchedulingHost - obj.Data = expected + obj := &SchedulingReassignmentPreviewItemsItem{} + var expected *string + obj.ToHost = expected // Act & Assert - assert.Equal(t, expected, obj.GetData(), "getter should return the property value") + assert.Equal(t, expected, obj.GetToHost(), "getter should return the property value") }) - t.Run("GetData_NilValue", func(t *testing.T) { + t.Run("GetToHost_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingHostList{} - obj.Data = nil + obj := &SchedulingReassignmentPreviewItemsItem{} + obj.ToHost = nil // Act & Assert - assert.Nil(t, obj.GetData(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetToHost(), "getter should return nil when property is nil") }) - t.Run("GetData_NilReceiver", func(t *testing.T) { + t.Run("GetToHost_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *SchedulingHostList + var obj *SchedulingReassignmentPreviewItemsItem // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetData() // Should return zero value + _ = obj.GetToHost() // Should return zero value }) - t.Run("GetHasMore", func(t *testing.T) { + t.Run("GetReason", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingHostList{} - var expected bool - obj.HasMore = expected + obj := &SchedulingReassignmentPreviewItemsItem{} + var expected *string + obj.Reason = expected // Act & Assert - assert.Equal(t, expected, obj.GetHasMore(), "getter should return the property value") + assert.Equal(t, expected, obj.GetReason(), "getter should return the property value") }) - t.Run("GetHasMore_NilReceiver", func(t *testing.T) { + t.Run("GetReason_NilValue", func(t *testing.T) { t.Parallel() - var obj *SchedulingHostList + // Arrange + obj := &SchedulingReassignmentPreviewItemsItem{} + obj.Reason = nil + + // Act & Assert + assert.Nil(t, obj.GetReason(), "getter should return nil when property is nil") + }) + + t.Run("GetReason_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingReassignmentPreviewItemsItem // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetHasMore() // Should return zero value + _ = obj.GetReason() // Should return zero value }) } -func TestSettersMarkExplicitSchedulingHostList(t *testing.T) { - t.Run("SetObject_MarksExplicit", func(t *testing.T) { +func TestSettersMarkExplicitSchedulingReassignmentPreviewItemsItem(t *testing.T) { + t.Run("SetBooking_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingHostList{} - var fernTestValueObject SchedulingHostListObject + obj := &SchedulingReassignmentPreviewItemsItem{} + var fernTestValueBooking string // Act - obj.SetObject(fernTestValueObject) + obj.SetBooking(fernTestValueBooking) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -94192,14 +106957,14 @@ func TestSettersMarkExplicitSchedulingHostList(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetData_MarksExplicit", func(t *testing.T) { + t.Run("SetEventType_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingHostList{} - var fernTestValueData []*SchedulingHost + obj := &SchedulingReassignmentPreviewItemsItem{} + var fernTestValueEventType string // Act - obj.SetData(fernTestValueData) + obj.SetEventType(fernTestValueEventType) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -94223,14 +106988,14 @@ func TestSettersMarkExplicitSchedulingHostList(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetHasMore_MarksExplicit", func(t *testing.T) { + t.Run("SetTitle_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingHostList{} - var fernTestValueHasMore bool + obj := &SchedulingReassignmentPreviewItemsItem{} + var fernTestValueTitle string // Act - obj.SetHasMore(fernTestValueHasMore) + obj.SetTitle(fernTestValueTitle) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -94254,179 +107019,14 @@ func TestSettersMarkExplicitSchedulingHostList(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) -} - -func TestGettersSchedulingHostLocation(t *testing.T) { - t.Run("GetType", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &SchedulingHostLocation{} - var expected string - obj.Type = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetType(), "getter should return the property value") - }) - - t.Run("GetType_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *SchedulingHostLocation - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetType() // Should return zero value - }) - - t.Run("GetLink", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &SchedulingHostLocation{} - var expected *SchedulingHostLocationLink - obj.Link = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetLink(), "getter should return the property value") - }) - - t.Run("GetLink_NilValue", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &SchedulingHostLocation{} - obj.Link = nil - - // Act & Assert - assert.Nil(t, obj.GetLink(), "getter should return nil when property is nil") - }) - - t.Run("GetLink_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *SchedulingHostLocation - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetLink() // Should return zero value - }) - - t.Run("GetPhone", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &SchedulingHostLocation{} - var expected *SchedulingHostLocationPhone - obj.Phone = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetPhone(), "getter should return the property value") - }) - - t.Run("GetPhone_NilValue", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &SchedulingHostLocation{} - obj.Phone = nil - - // Act & Assert - assert.Nil(t, obj.GetPhone(), "getter should return nil when property is nil") - }) - - t.Run("GetPhone_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *SchedulingHostLocation - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetPhone() // Should return zero value - }) - - t.Run("GetInPerson", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &SchedulingHostLocation{} - var expected *SchedulingHostLocationInPerson - obj.InPerson = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetInPerson(), "getter should return the property value") - }) - - t.Run("GetInPerson_NilValue", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &SchedulingHostLocation{} - obj.InPerson = nil - - // Act & Assert - assert.Nil(t, obj.GetInPerson(), "getter should return nil when property is nil") - }) - - t.Run("GetInPerson_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *SchedulingHostLocation - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetInPerson() // Should return zero value - }) - -} - -func TestSettersSchedulingHostLocationInPerson(t *testing.T) { - t.Run("SetAddress", func(t *testing.T) { - obj := &SchedulingHostLocationInPerson{} - var fernTestValueAddress string - obj.SetAddress(fernTestValueAddress) - assert.Equal(t, fernTestValueAddress, obj.Address) - assert.NotNil(t, obj.explicitFields) - }) - -} - -func TestGettersSchedulingHostLocationInPerson(t *testing.T) { - t.Run("GetAddress", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &SchedulingHostLocationInPerson{} - var expected string - obj.Address = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetAddress(), "getter should return the property value") - }) - - t.Run("GetAddress_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *SchedulingHostLocationInPerson - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetAddress() // Should return zero value - }) - -} - -func TestSettersMarkExplicitSchedulingHostLocationInPerson(t *testing.T) { - t.Run("SetAddress_MarksExplicit", func(t *testing.T) { + t.Run("SetStatus_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingHostLocationInPerson{} - var fernTestValueAddress string + obj := &SchedulingReassignmentPreviewItemsItem{} + var fernTestValueStatus SchedulingReassignmentPreviewItemsItemStatus // Act - obj.SetAddress(fernTestValueAddress) + obj.SetStatus(fernTestValueStatus) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -94450,54 +107050,14 @@ func TestSettersMarkExplicitSchedulingHostLocationInPerson(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) -} - -func TestSettersSchedulingHostLocationLink(t *testing.T) { - t.Run("SetURL", func(t *testing.T) { - obj := &SchedulingHostLocationLink{} - var fernTestValueURL string - obj.SetURL(fernTestValueURL) - assert.Equal(t, fernTestValueURL, obj.URL) - assert.NotNil(t, obj.explicitFields) - }) - -} - -func TestGettersSchedulingHostLocationLink(t *testing.T) { - t.Run("GetURL", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &SchedulingHostLocationLink{} - var expected string - obj.URL = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetURL(), "getter should return the property value") - }) - - t.Run("GetURL_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *SchedulingHostLocationLink - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetURL() // Should return zero value - }) - -} - -func TestSettersMarkExplicitSchedulingHostLocationLink(t *testing.T) { - t.Run("SetURL_MarksExplicit", func(t *testing.T) { + t.Run("SetStart_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingHostLocationLink{} - var fernTestValueURL string + obj := &SchedulingReassignmentPreviewItemsItem{} + var fernTestValueStart string // Act - obj.SetURL(fernTestValueURL) + obj.SetStart(fernTestValueStart) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -94521,54 +107081,14 @@ func TestSettersMarkExplicitSchedulingHostLocationLink(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) -} - -func TestSettersSchedulingHostLocationPhone(t *testing.T) { - t.Run("SetNumber", func(t *testing.T) { - obj := &SchedulingHostLocationPhone{} - var fernTestValueNumber string - obj.SetNumber(fernTestValueNumber) - assert.Equal(t, fernTestValueNumber, obj.Number) - assert.NotNil(t, obj.explicitFields) - }) - -} - -func TestGettersSchedulingHostLocationPhone(t *testing.T) { - t.Run("GetNumber", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &SchedulingHostLocationPhone{} - var expected string - obj.Number = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetNumber(), "getter should return the property value") - }) - - t.Run("GetNumber_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *SchedulingHostLocationPhone - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetNumber() // Should return zero value - }) - -} - -func TestSettersMarkExplicitSchedulingHostLocationPhone(t *testing.T) { - t.Run("SetNumber_MarksExplicit", func(t *testing.T) { + t.Run("SetEnd_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingHostLocationPhone{} - var fernTestValueNumber string + obj := &SchedulingReassignmentPreviewItemsItem{} + var fernTestValueEnd string // Act - obj.SetNumber(fernTestValueNumber) + obj.SetEnd(fernTestValueEnd) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -94592,126 +107112,76 @@ func TestSettersMarkExplicitSchedulingHostLocationPhone(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) -} - -func TestSettersSchedulingLimit(t *testing.T) { - t.Run("SetPeriod", func(t *testing.T) { - obj := &SchedulingLimit{} - var fernTestValuePeriod SchedulingLimitPeriod - obj.SetPeriod(fernTestValuePeriod) - assert.Equal(t, fernTestValuePeriod, obj.Period) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetMax", func(t *testing.T) { - obj := &SchedulingLimit{} - var fernTestValueMax int - obj.SetMax(fernTestValueMax) - assert.Equal(t, fernTestValueMax, obj.Max) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetScope", func(t *testing.T) { - obj := &SchedulingLimit{} - var fernTestValueScope *SchedulingLimitScope - obj.SetScope(fernTestValueScope) - assert.Equal(t, fernTestValueScope, obj.Scope) - assert.NotNil(t, obj.explicitFields) - }) - -} - -func TestGettersSchedulingLimit(t *testing.T) { - t.Run("GetPeriod", func(t *testing.T) { + t.Run("SetSeries_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingLimit{} - var expected SchedulingLimitPeriod - obj.Period = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetPeriod(), "getter should return the property value") - }) + obj := &SchedulingReassignmentPreviewItemsItem{} + var fernTestValueSeries *string - t.Run("GetPeriod_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *SchedulingLimit - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetPeriod() // Should return zero value - }) + // Act + obj.SetSeries(fernTestValueSeries) - t.Run("GetMax", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &SchedulingLimit{} - var expected int - obj.Max = expected + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") - // Act & Assert - assert.Equal(t, expected, obj.GetMax(), "getter should return the property value") - }) + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } - t.Run("GetMax_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *SchedulingLimit - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetMax() // Should return zero value + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("GetScope", func(t *testing.T) { + t.Run("SetGroupSession_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingLimit{} - var expected *SchedulingLimitScope - obj.Scope = expected + obj := &SchedulingReassignmentPreviewItemsItem{} + var fernTestValueGroupSession *string - // Act & Assert - assert.Equal(t, expected, obj.GetScope(), "getter should return the property value") - }) + // Act + obj.SetGroupSession(fernTestValueGroupSession) - t.Run("GetScope_NilValue", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &SchedulingLimit{} - obj.Scope = nil + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") - // Act & Assert - assert.Nil(t, obj.GetScope(), "getter should return nil when property is nil") - }) + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } - t.Run("GetScope_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *SchedulingLimit - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetScope() // Should return zero value + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip }) -} - -func TestSettersMarkExplicitSchedulingLimit(t *testing.T) { - t.Run("SetPeriod_MarksExplicit", func(t *testing.T) { + t.Run("SetFromHost_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingLimit{} - var fernTestValuePeriod SchedulingLimitPeriod + obj := &SchedulingReassignmentPreviewItemsItem{} + var fernTestValueFromHost *string // Act - obj.SetPeriod(fernTestValuePeriod) + obj.SetFromHost(fernTestValueFromHost) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -94735,14 +107205,14 @@ func TestSettersMarkExplicitSchedulingLimit(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetMax_MarksExplicit", func(t *testing.T) { + t.Run("SetToHost_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingLimit{} - var fernTestValueMax int + obj := &SchedulingReassignmentPreviewItemsItem{} + var fernTestValueToHost *string // Act - obj.SetMax(fernTestValueMax) + obj.SetToHost(fernTestValueToHost) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -94766,14 +107236,14 @@ func TestSettersMarkExplicitSchedulingLimit(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetScope_MarksExplicit", func(t *testing.T) { + t.Run("SetReason_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingLimit{} - var fernTestValueScope *SchedulingLimitScope + obj := &SchedulingReassignmentPreviewItemsItem{} + var fernTestValueReason *string // Act - obj.SetScope(fernTestValueScope) + obj.SetReason(fernTestValueReason) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -94799,286 +107269,349 @@ func TestSettersMarkExplicitSchedulingLimit(t *testing.T) { } -func TestGettersSchedulingLocation(t *testing.T) { - t.Run("GetType", func(t *testing.T) { +func TestSettersSchedulingReassignmentSelection(t *testing.T) { + t.Run("SetHost", func(t *testing.T) { + obj := &SchedulingReassignmentSelection{} + var fernTestValueHost *string + obj.SetHost(fernTestValueHost) + assert.Equal(t, fernTestValueHost, obj.Host) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetOutOfOffice", func(t *testing.T) { + obj := &SchedulingReassignmentSelection{} + var fernTestValueOutOfOffice *string + obj.SetOutOfOffice(fernTestValueOutOfOffice) + assert.Equal(t, fernTestValueOutOfOffice, obj.OutOfOffice) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetBookingIDs", func(t *testing.T) { + obj := &SchedulingReassignmentSelection{} + var fernTestValueBookingIDs []string + obj.SetBookingIDs(fernTestValueBookingIDs) + assert.Equal(t, fernTestValueBookingIDs, obj.BookingIDs) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetSeries", func(t *testing.T) { + obj := &SchedulingReassignmentSelection{} + var fernTestValueSeries *string + obj.SetSeries(fernTestValueSeries) + assert.Equal(t, fernTestValueSeries, obj.Series) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetStartAfter", func(t *testing.T) { + obj := &SchedulingReassignmentSelection{} + var fernTestValueStartAfter *string + obj.SetStartAfter(fernTestValueStartAfter) + assert.Equal(t, fernTestValueStartAfter, obj.StartAfter) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetStartBefore", func(t *testing.T) { + obj := &SchedulingReassignmentSelection{} + var fernTestValueStartBefore *string + obj.SetStartBefore(fernTestValueStartBefore) + assert.Equal(t, fernTestValueStartBefore, obj.StartBefore) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetEventTypes", func(t *testing.T) { + obj := &SchedulingReassignmentSelection{} + var fernTestValueEventTypes []string + obj.SetEventTypes(fernTestValueEventTypes) + assert.Equal(t, fernTestValueEventTypes, obj.EventTypes) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetExternalConflict", func(t *testing.T) { + obj := &SchedulingReassignmentSelection{} + var fernTestValueExternalConflict *bool + obj.SetExternalConflict(fernTestValueExternalConflict) + assert.Equal(t, fernTestValueExternalConflict, obj.ExternalConflict) + assert.NotNil(t, obj.explicitFields) + }) + +} + +func TestGettersSchedulingReassignmentSelection(t *testing.T) { + t.Run("GetHost", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingLocation{} - var expected string - obj.Type = expected + obj := &SchedulingReassignmentSelection{} + var expected *string + obj.Host = expected // Act & Assert - assert.Equal(t, expected, obj.GetType(), "getter should return the property value") + assert.Equal(t, expected, obj.GetHost(), "getter should return the property value") }) - t.Run("GetType_NilReceiver", func(t *testing.T) { + t.Run("GetHost_NilValue", func(t *testing.T) { t.Parallel() - var obj *SchedulingLocation + // Arrange + obj := &SchedulingReassignmentSelection{} + obj.Host = nil + + // Act & Assert + assert.Nil(t, obj.GetHost(), "getter should return nil when property is nil") + }) + + t.Run("GetHost_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingReassignmentSelection // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetType() // Should return zero value + _ = obj.GetHost() // Should return zero value }) - t.Run("GetLink", func(t *testing.T) { + t.Run("GetOutOfOffice", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingLocation{} - var expected *SchedulingLocationLink - obj.Link = expected + obj := &SchedulingReassignmentSelection{} + var expected *string + obj.OutOfOffice = expected // Act & Assert - assert.Equal(t, expected, obj.GetLink(), "getter should return the property value") + assert.Equal(t, expected, obj.GetOutOfOffice(), "getter should return the property value") }) - t.Run("GetLink_NilValue", func(t *testing.T) { + t.Run("GetOutOfOffice_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingLocation{} - obj.Link = nil + obj := &SchedulingReassignmentSelection{} + obj.OutOfOffice = nil // Act & Assert - assert.Nil(t, obj.GetLink(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetOutOfOffice(), "getter should return nil when property is nil") }) - t.Run("GetLink_NilReceiver", func(t *testing.T) { + t.Run("GetOutOfOffice_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *SchedulingLocation + var obj *SchedulingReassignmentSelection // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetLink() // Should return zero value + _ = obj.GetOutOfOffice() // Should return zero value }) - t.Run("GetPhone", func(t *testing.T) { + t.Run("GetBookingIDs", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingLocation{} - var expected *SchedulingLocationPhone - obj.Phone = expected + obj := &SchedulingReassignmentSelection{} + var expected []string + obj.BookingIDs = expected // Act & Assert - assert.Equal(t, expected, obj.GetPhone(), "getter should return the property value") + assert.Equal(t, expected, obj.GetBookingIDs(), "getter should return the property value") }) - t.Run("GetPhone_NilValue", func(t *testing.T) { + t.Run("GetBookingIDs_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingLocation{} - obj.Phone = nil + obj := &SchedulingReassignmentSelection{} + obj.BookingIDs = nil // Act & Assert - assert.Nil(t, obj.GetPhone(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetBookingIDs(), "getter should return nil when property is nil") }) - t.Run("GetPhone_NilReceiver", func(t *testing.T) { + t.Run("GetBookingIDs_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *SchedulingLocation + var obj *SchedulingReassignmentSelection // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetPhone() // Should return zero value + _ = obj.GetBookingIDs() // Should return zero value }) - t.Run("GetInPerson", func(t *testing.T) { + t.Run("GetSeries", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingLocation{} - var expected *SchedulingLocationInPerson - obj.InPerson = expected + obj := &SchedulingReassignmentSelection{} + var expected *string + obj.Series = expected // Act & Assert - assert.Equal(t, expected, obj.GetInPerson(), "getter should return the property value") + assert.Equal(t, expected, obj.GetSeries(), "getter should return the property value") }) - t.Run("GetInPerson_NilValue", func(t *testing.T) { + t.Run("GetSeries_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingLocation{} - obj.InPerson = nil + obj := &SchedulingReassignmentSelection{} + obj.Series = nil // Act & Assert - assert.Nil(t, obj.GetInPerson(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetSeries(), "getter should return nil when property is nil") }) - t.Run("GetInPerson_NilReceiver", func(t *testing.T) { + t.Run("GetSeries_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *SchedulingLocation + var obj *SchedulingReassignmentSelection // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetInPerson() // Should return zero value + _ = obj.GetSeries() // Should return zero value }) - t.Run("GetGoogleMeet", func(t *testing.T) { + t.Run("GetStartAfter", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingLocation{} - var expected *SchedulingLocationGoogleMeet - obj.GoogleMeet = expected + obj := &SchedulingReassignmentSelection{} + var expected *string + obj.StartAfter = expected // Act & Assert - assert.Equal(t, expected, obj.GetGoogleMeet(), "getter should return the property value") + assert.Equal(t, expected, obj.GetStartAfter(), "getter should return the property value") }) - t.Run("GetGoogleMeet_NilValue", func(t *testing.T) { + t.Run("GetStartAfter_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingLocation{} - obj.GoogleMeet = nil + obj := &SchedulingReassignmentSelection{} + obj.StartAfter = nil // Act & Assert - assert.Nil(t, obj.GetGoogleMeet(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetStartAfter(), "getter should return nil when property is nil") }) - t.Run("GetGoogleMeet_NilReceiver", func(t *testing.T) { + t.Run("GetStartAfter_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *SchedulingLocation + var obj *SchedulingReassignmentSelection // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetGoogleMeet() // Should return zero value + _ = obj.GetStartAfter() // Should return zero value }) - t.Run("GetMicrosoftTeams", func(t *testing.T) { + t.Run("GetStartBefore", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingLocation{} - var expected *SchedulingLocationMicrosoftTeams - obj.MicrosoftTeams = expected + obj := &SchedulingReassignmentSelection{} + var expected *string + obj.StartBefore = expected // Act & Assert - assert.Equal(t, expected, obj.GetMicrosoftTeams(), "getter should return the property value") + assert.Equal(t, expected, obj.GetStartBefore(), "getter should return the property value") }) - t.Run("GetMicrosoftTeams_NilValue", func(t *testing.T) { + t.Run("GetStartBefore_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingLocation{} - obj.MicrosoftTeams = nil + obj := &SchedulingReassignmentSelection{} + obj.StartBefore = nil // Act & Assert - assert.Nil(t, obj.GetMicrosoftTeams(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetStartBefore(), "getter should return nil when property is nil") }) - t.Run("GetMicrosoftTeams_NilReceiver", func(t *testing.T) { + t.Run("GetStartBefore_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *SchedulingLocation + var obj *SchedulingReassignmentSelection // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetMicrosoftTeams() // Should return zero value + _ = obj.GetStartBefore() // Should return zero value }) - t.Run("GetZoom", func(t *testing.T) { + t.Run("GetEventTypes", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingLocation{} - var expected *SchedulingLocationZoom - obj.Zoom = expected + obj := &SchedulingReassignmentSelection{} + var expected []string + obj.EventTypes = expected // Act & Assert - assert.Equal(t, expected, obj.GetZoom(), "getter should return the property value") + assert.Equal(t, expected, obj.GetEventTypes(), "getter should return the property value") }) - t.Run("GetZoom_NilValue", func(t *testing.T) { + t.Run("GetEventTypes_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingLocation{} - obj.Zoom = nil + obj := &SchedulingReassignmentSelection{} + obj.EventTypes = nil // Act & Assert - assert.Nil(t, obj.GetZoom(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetEventTypes(), "getter should return nil when property is nil") }) - t.Run("GetZoom_NilReceiver", func(t *testing.T) { + t.Run("GetEventTypes_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *SchedulingLocation + var obj *SchedulingReassignmentSelection // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetZoom() // Should return zero value - }) - -} - -func TestSettersSchedulingLocationInPerson(t *testing.T) { - t.Run("SetAddress", func(t *testing.T) { - obj := &SchedulingLocationInPerson{} - var fernTestValueAddress *string - obj.SetAddress(fernTestValueAddress) - assert.Equal(t, fernTestValueAddress, obj.Address) - assert.NotNil(t, obj.explicitFields) + _ = obj.GetEventTypes() // Should return zero value }) -} - -func TestGettersSchedulingLocationInPerson(t *testing.T) { - t.Run("GetAddress", func(t *testing.T) { + t.Run("GetExternalConflict", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingLocationInPerson{} - var expected *string - obj.Address = expected + obj := &SchedulingReassignmentSelection{} + var expected *bool + obj.ExternalConflict = expected // Act & Assert - assert.Equal(t, expected, obj.GetAddress(), "getter should return the property value") + assert.Equal(t, expected, obj.GetExternalConflict(), "getter should return the property value") }) - t.Run("GetAddress_NilValue", func(t *testing.T) { + t.Run("GetExternalConflict_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingLocationInPerson{} - obj.Address = nil + obj := &SchedulingReassignmentSelection{} + obj.ExternalConflict = nil // Act & Assert - assert.Nil(t, obj.GetAddress(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetExternalConflict(), "getter should return nil when property is nil") }) - t.Run("GetAddress_NilReceiver", func(t *testing.T) { + t.Run("GetExternalConflict_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *SchedulingLocationInPerson + var obj *SchedulingReassignmentSelection // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetAddress() // Should return zero value + _ = obj.GetExternalConflict() // Should return zero value }) } -func TestSettersMarkExplicitSchedulingLocationInPerson(t *testing.T) { - t.Run("SetAddress_MarksExplicit", func(t *testing.T) { +func TestSettersMarkExplicitSchedulingReassignmentSelection(t *testing.T) { + t.Run("SetHost_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingLocationInPerson{} - var fernTestValueAddress *string + obj := &SchedulingReassignmentSelection{} + var fernTestValueHost *string // Act - obj.SetAddress(fernTestValueAddress) + obj.SetHost(fernTestValueHost) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -95102,64 +107635,45 @@ func TestSettersMarkExplicitSchedulingLocationInPerson(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) -} - -func TestSettersSchedulingLocationLink(t *testing.T) { - t.Run("SetURL", func(t *testing.T) { - obj := &SchedulingLocationLink{} - var fernTestValueURL *string - obj.SetURL(fernTestValueURL) - assert.Equal(t, fernTestValueURL, obj.URL) - assert.NotNil(t, obj.explicitFields) - }) - -} - -func TestGettersSchedulingLocationLink(t *testing.T) { - t.Run("GetURL", func(t *testing.T) { + t.Run("SetOutOfOffice_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingLocationLink{} - var expected *string - obj.URL = expected + obj := &SchedulingReassignmentSelection{} + var fernTestValueOutOfOffice *string - // Act & Assert - assert.Equal(t, expected, obj.GetURL(), "getter should return the property value") - }) + // Act + obj.SetOutOfOffice(fernTestValueOutOfOffice) - t.Run("GetURL_NilValue", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &SchedulingLocationLink{} - obj.URL = nil + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") - // Act & Assert - assert.Nil(t, obj.GetURL(), "getter should return nil when property is nil") - }) + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } - t.Run("GetURL_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *SchedulingLocationLink - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetURL() // Should return zero value + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip }) -} - -func TestSettersMarkExplicitSchedulingLocationLink(t *testing.T) { - t.Run("SetURL_MarksExplicit", func(t *testing.T) { + t.Run("SetBookingIDs_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingLocationLink{} - var fernTestValueURL *string + obj := &SchedulingReassignmentSelection{} + var fernTestValueBookingIDs []string // Act - obj.SetURL(fernTestValueURL) + obj.SetBookingIDs(fernTestValueBookingIDs) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -95183,64 +107697,45 @@ func TestSettersMarkExplicitSchedulingLocationLink(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) -} - -func TestSettersSchedulingLocationPhone(t *testing.T) { - t.Run("SetNumber", func(t *testing.T) { - obj := &SchedulingLocationPhone{} - var fernTestValueNumber *string - obj.SetNumber(fernTestValueNumber) - assert.Equal(t, fernTestValueNumber, obj.Number) - assert.NotNil(t, obj.explicitFields) - }) - -} - -func TestGettersSchedulingLocationPhone(t *testing.T) { - t.Run("GetNumber", func(t *testing.T) { + t.Run("SetSeries_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingLocationPhone{} - var expected *string - obj.Number = expected + obj := &SchedulingReassignmentSelection{} + var fernTestValueSeries *string - // Act & Assert - assert.Equal(t, expected, obj.GetNumber(), "getter should return the property value") - }) + // Act + obj.SetSeries(fernTestValueSeries) - t.Run("GetNumber_NilValue", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &SchedulingLocationPhone{} - obj.Number = nil + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") - // Act & Assert - assert.Nil(t, obj.GetNumber(), "getter should return nil when property is nil") - }) + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } - t.Run("GetNumber_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *SchedulingLocationPhone - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetNumber() // Should return zero value + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip }) -} - -func TestSettersMarkExplicitSchedulingLocationPhone(t *testing.T) { - t.Run("SetNumber_MarksExplicit", func(t *testing.T) { + t.Run("SetStartAfter_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingLocationPhone{} - var fernTestValueNumber *string + obj := &SchedulingReassignmentSelection{} + var fernTestValueStartAfter *string // Act - obj.SetNumber(fernTestValueNumber) + obj.SetStartAfter(fernTestValueStartAfter) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -95264,64 +107759,76 @@ func TestSettersMarkExplicitSchedulingLocationPhone(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) -} + t.Run("SetStartBefore_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingReassignmentSelection{} + var fernTestValueStartBefore *string -func TestSettersSchedulingLocationZoom(t *testing.T) { - t.Run("SetURL", func(t *testing.T) { - obj := &SchedulingLocationZoom{} - var fernTestValueURL *string - obj.SetURL(fernTestValueURL) - assert.Equal(t, fernTestValueURL, obj.URL) - assert.NotNil(t, obj.explicitFields) - }) + // Act + obj.SetStartBefore(fernTestValueStartBefore) -} + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") -func TestGettersSchedulingLocationZoom(t *testing.T) { - t.Run("GetURL", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &SchedulingLocationZoom{} - var expected *string - obj.URL = expected + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } - // Act & Assert - assert.Equal(t, expected, obj.GetURL(), "getter should return the property value") + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("GetURL_NilValue", func(t *testing.T) { + t.Run("SetEventTypes_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingLocationZoom{} - obj.URL = nil + obj := &SchedulingReassignmentSelection{} + var fernTestValueEventTypes []string - // Act & Assert - assert.Nil(t, obj.GetURL(), "getter should return nil when property is nil") - }) + // Act + obj.SetEventTypes(fernTestValueEventTypes) - t.Run("GetURL_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *SchedulingLocationZoom - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetURL() // Should return zero value - }) + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") -} + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } -func TestSettersMarkExplicitSchedulingLocationZoom(t *testing.T) { - t.Run("SetURL_MarksExplicit", func(t *testing.T) { + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetExternalConflict_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingLocationZoom{} - var fernTestValueURL *string + obj := &SchedulingReassignmentSelection{} + var fernTestValueExternalConflict *bool // Act - obj.SetURL(fernTestValueURL) + obj.SetExternalConflict(fernTestValueExternalConflict) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -95347,196 +107854,185 @@ func TestSettersMarkExplicitSchedulingLocationZoom(t *testing.T) { } -func TestSettersSchedulingQuestion(t *testing.T) { - t.Run("SetKey", func(t *testing.T) { - obj := &SchedulingQuestion{} - var fernTestValueKey string - obj.SetKey(fernTestValueKey) - assert.Equal(t, fernTestValueKey, obj.Key) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetType", func(t *testing.T) { - obj := &SchedulingQuestion{} - var fernTestValueType SchedulingQuestionType - obj.SetType(fernTestValueType) - assert.Equal(t, fernTestValueType, obj.Type) +func TestSettersSchedulingReassignmentStrategy(t *testing.T) { + t.Run("SetToHost", func(t *testing.T) { + obj := &SchedulingReassignmentStrategy{} + var fernTestValueToHost *string + obj.SetToHost(fernTestValueToHost) + assert.Equal(t, fernTestValueToHost, obj.ToHost) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetLabel", func(t *testing.T) { - obj := &SchedulingQuestion{} - var fernTestValueLabel string - obj.SetLabel(fernTestValueLabel) - assert.Equal(t, fernTestValueLabel, obj.Label) + t.Run("SetPreferredHosts", func(t *testing.T) { + obj := &SchedulingReassignmentStrategy{} + var fernTestValuePreferredHosts []string + obj.SetPreferredHosts(fernTestValuePreferredHosts) + assert.Equal(t, fernTestValuePreferredHosts, obj.PreferredHosts) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetRequired", func(t *testing.T) { - obj := &SchedulingQuestion{} - var fernTestValueRequired *bool - obj.SetRequired(fernTestValueRequired) - assert.Equal(t, fernTestValueRequired, obj.Required) + t.Run("SetOtherwise", func(t *testing.T) { + obj := &SchedulingReassignmentStrategy{} + var fernTestValueOtherwise *SchedulingReassignmentStrategyOtherwise + obj.SetOtherwise(fernTestValueOtherwise) + assert.Equal(t, fernTestValueOtherwise, obj.Otherwise) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetOptions", func(t *testing.T) { - obj := &SchedulingQuestion{} - var fernTestValueOptions []string - obj.SetOptions(fernTestValueOptions) - assert.Equal(t, fernTestValueOptions, obj.Options) + t.Run("SetAssignments", func(t *testing.T) { + obj := &SchedulingReassignmentStrategy{} + var fernTestValueAssignments []*SchedulingReassignmentStrategyAssignmentsItem + obj.SetAssignments(fernTestValueAssignments) + assert.Equal(t, fernTestValueAssignments, obj.Assignments) assert.NotNil(t, obj.explicitFields) }) } -func TestGettersSchedulingQuestion(t *testing.T) { - t.Run("GetKey", func(t *testing.T) { +func TestGettersSchedulingReassignmentStrategy(t *testing.T) { + t.Run("GetToHost", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingQuestion{} - var expected string - obj.Key = expected + obj := &SchedulingReassignmentStrategy{} + var expected *string + obj.ToHost = expected // Act & Assert - assert.Equal(t, expected, obj.GetKey(), "getter should return the property value") - }) - - t.Run("GetKey_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *SchedulingQuestion - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetKey() // Should return zero value + assert.Equal(t, expected, obj.GetToHost(), "getter should return the property value") }) - t.Run("GetType", func(t *testing.T) { + t.Run("GetToHost_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingQuestion{} - var expected SchedulingQuestionType - obj.Type = expected + obj := &SchedulingReassignmentStrategy{} + obj.ToHost = nil // Act & Assert - assert.Equal(t, expected, obj.GetType(), "getter should return the property value") + assert.Nil(t, obj.GetToHost(), "getter should return nil when property is nil") }) - t.Run("GetType_NilReceiver", func(t *testing.T) { + t.Run("GetToHost_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *SchedulingQuestion + var obj *SchedulingReassignmentStrategy // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetType() // Should return zero value + _ = obj.GetToHost() // Should return zero value }) - t.Run("GetLabel", func(t *testing.T) { + t.Run("GetPreferredHosts", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingQuestion{} - var expected string - obj.Label = expected + obj := &SchedulingReassignmentStrategy{} + var expected []string + obj.PreferredHosts = expected // Act & Assert - assert.Equal(t, expected, obj.GetLabel(), "getter should return the property value") + assert.Equal(t, expected, obj.GetPreferredHosts(), "getter should return the property value") }) - t.Run("GetLabel_NilReceiver", func(t *testing.T) { + t.Run("GetPreferredHosts_NilValue", func(t *testing.T) { t.Parallel() - var obj *SchedulingQuestion + // Arrange + obj := &SchedulingReassignmentStrategy{} + obj.PreferredHosts = nil + + // Act & Assert + assert.Nil(t, obj.GetPreferredHosts(), "getter should return nil when property is nil") + }) + + t.Run("GetPreferredHosts_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingReassignmentStrategy // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetLabel() // Should return zero value + _ = obj.GetPreferredHosts() // Should return zero value }) - t.Run("GetRequired", func(t *testing.T) { + t.Run("GetOtherwise", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingQuestion{} - var expected *bool - obj.Required = expected + obj := &SchedulingReassignmentStrategy{} + var expected *SchedulingReassignmentStrategyOtherwise + obj.Otherwise = expected // Act & Assert - assert.Equal(t, expected, obj.GetRequired(), "getter should return the property value") + assert.Equal(t, expected, obj.GetOtherwise(), "getter should return the property value") }) - t.Run("GetRequired_NilValue", func(t *testing.T) { + t.Run("GetOtherwise_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingQuestion{} - obj.Required = nil + obj := &SchedulingReassignmentStrategy{} + obj.Otherwise = nil // Act & Assert - assert.Nil(t, obj.GetRequired(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetOtherwise(), "getter should return nil when property is nil") }) - t.Run("GetRequired_NilReceiver", func(t *testing.T) { + t.Run("GetOtherwise_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *SchedulingQuestion + var obj *SchedulingReassignmentStrategy // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetRequired() // Should return zero value + _ = obj.GetOtherwise() // Should return zero value }) - t.Run("GetOptions", func(t *testing.T) { + t.Run("GetAssignments", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingQuestion{} - var expected []string - obj.Options = expected + obj := &SchedulingReassignmentStrategy{} + var expected []*SchedulingReassignmentStrategyAssignmentsItem + obj.Assignments = expected // Act & Assert - assert.Equal(t, expected, obj.GetOptions(), "getter should return the property value") + assert.Equal(t, expected, obj.GetAssignments(), "getter should return the property value") }) - t.Run("GetOptions_NilValue", func(t *testing.T) { + t.Run("GetAssignments_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingQuestion{} - obj.Options = nil + obj := &SchedulingReassignmentStrategy{} + obj.Assignments = nil // Act & Assert - assert.Nil(t, obj.GetOptions(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetAssignments(), "getter should return nil when property is nil") }) - t.Run("GetOptions_NilReceiver", func(t *testing.T) { + t.Run("GetAssignments_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *SchedulingQuestion + var obj *SchedulingReassignmentStrategy // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetOptions() // Should return zero value + _ = obj.GetAssignments() // Should return zero value }) } -func TestSettersMarkExplicitSchedulingQuestion(t *testing.T) { - t.Run("SetKey_MarksExplicit", func(t *testing.T) { +func TestSettersMarkExplicitSchedulingReassignmentStrategy(t *testing.T) { + t.Run("SetToHost_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingQuestion{} - var fernTestValueKey string + obj := &SchedulingReassignmentStrategy{} + var fernTestValueToHost *string // Act - obj.SetKey(fernTestValueKey) + obj.SetToHost(fernTestValueToHost) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -95560,14 +108056,76 @@ func TestSettersMarkExplicitSchedulingQuestion(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetType_MarksExplicit", func(t *testing.T) { + t.Run("SetPreferredHosts_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingQuestion{} - var fernTestValueType SchedulingQuestionType + obj := &SchedulingReassignmentStrategy{} + var fernTestValuePreferredHosts []string // Act - obj.SetType(fernTestValueType) + obj.SetPreferredHosts(fernTestValuePreferredHosts) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetOtherwise_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingReassignmentStrategy{} + var fernTestValueOtherwise *SchedulingReassignmentStrategyOtherwise + + // Act + obj.SetOtherwise(fernTestValueOtherwise) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetAssignments_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingReassignmentStrategy{} + var fernTestValueAssignments []*SchedulingReassignmentStrategyAssignmentsItem + + // Act + obj.SetAssignments(fernTestValueAssignments) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -95591,14 +108149,126 @@ func TestSettersMarkExplicitSchedulingQuestion(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetLabel_MarksExplicit", func(t *testing.T) { +} + +func TestSettersSchedulingReassignmentStrategyAssignmentsItem(t *testing.T) { + t.Run("SetBooking", func(t *testing.T) { + obj := &SchedulingReassignmentStrategyAssignmentsItem{} + var fernTestValueBooking string + obj.SetBooking(fernTestValueBooking) + assert.Equal(t, fernTestValueBooking, obj.Booking) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetToHost", func(t *testing.T) { + obj := &SchedulingReassignmentStrategyAssignmentsItem{} + var fernTestValueToHost string + obj.SetToHost(fernTestValueToHost) + assert.Equal(t, fernTestValueToHost, obj.ToHost) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetFromHost", func(t *testing.T) { + obj := &SchedulingReassignmentStrategyAssignmentsItem{} + var fernTestValueFromHost *string + obj.SetFromHost(fernTestValueFromHost) + assert.Equal(t, fernTestValueFromHost, obj.FromHost) + assert.NotNil(t, obj.explicitFields) + }) + +} + +func TestGettersSchedulingReassignmentStrategyAssignmentsItem(t *testing.T) { + t.Run("GetBooking", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingQuestion{} - var fernTestValueLabel string + obj := &SchedulingReassignmentStrategyAssignmentsItem{} + var expected string + obj.Booking = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetBooking(), "getter should return the property value") + }) + + t.Run("GetBooking_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingReassignmentStrategyAssignmentsItem + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetBooking() // Should return zero value + }) + + t.Run("GetToHost", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingReassignmentStrategyAssignmentsItem{} + var expected string + obj.ToHost = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetToHost(), "getter should return the property value") + }) + + t.Run("GetToHost_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingReassignmentStrategyAssignmentsItem + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetToHost() // Should return zero value + }) + + t.Run("GetFromHost", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingReassignmentStrategyAssignmentsItem{} + var expected *string + obj.FromHost = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetFromHost(), "getter should return the property value") + }) + + t.Run("GetFromHost_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingReassignmentStrategyAssignmentsItem{} + obj.FromHost = nil + + // Act & Assert + assert.Nil(t, obj.GetFromHost(), "getter should return nil when property is nil") + }) + + t.Run("GetFromHost_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingReassignmentStrategyAssignmentsItem + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetFromHost() // Should return zero value + }) + +} + +func TestSettersMarkExplicitSchedulingReassignmentStrategyAssignmentsItem(t *testing.T) { + t.Run("SetBooking_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingReassignmentStrategyAssignmentsItem{} + var fernTestValueBooking string // Act - obj.SetLabel(fernTestValueLabel) + obj.SetBooking(fernTestValueBooking) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -95622,14 +108292,14 @@ func TestSettersMarkExplicitSchedulingQuestion(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetRequired_MarksExplicit", func(t *testing.T) { + t.Run("SetToHost_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingQuestion{} - var fernTestValueRequired *bool + obj := &SchedulingReassignmentStrategyAssignmentsItem{} + var fernTestValueToHost string // Act - obj.SetRequired(fernTestValueRequired) + obj.SetToHost(fernTestValueToHost) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -95653,14 +108323,14 @@ func TestSettersMarkExplicitSchedulingQuestion(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetOptions_MarksExplicit", func(t *testing.T) { + t.Run("SetFromHost_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingQuestion{} - var fernTestValueOptions []string + obj := &SchedulingReassignmentStrategyAssignmentsItem{} + var fernTestValueFromHost *string // Act - obj.SetOptions(fernTestValueOptions) + obj.SetFromHost(fernTestValueFromHost) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -101105,6 +113775,14 @@ func TestSettersSchedulingSettings(t *testing.T) { assert.NotNil(t, obj.explicitFields) }) + t.Run("SetPrivacyURL", func(t *testing.T) { + obj := &SchedulingSettings{} + var fernTestValuePrivacyURL *string + obj.SetPrivacyURL(fernTestValuePrivacyURL) + assert.Equal(t, fernTestValuePrivacyURL, obj.PrivacyURL) + assert.NotNil(t, obj.explicitFields) + }) + t.Run("SetEmailFrom", func(t *testing.T) { obj := &SchedulingSettings{} var fernTestValueEmailFrom *string @@ -101121,6 +113799,30 @@ func TestSettersSchedulingSettings(t *testing.T) { assert.NotNil(t, obj.explicitFields) }) + t.Run("SetNameHostInAttendeeEmails", func(t *testing.T) { + obj := &SchedulingSettings{} + var fernTestValueNameHostInAttendeeEmails bool + obj.SetNameHostInAttendeeEmails(fernTestValueNameHostInAttendeeEmails) + assert.Equal(t, fernTestValueNameHostInAttendeeEmails, obj.NameHostInAttendeeEmails) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetHostReassignment", func(t *testing.T) { + obj := &SchedulingSettings{} + var fernTestValueHostReassignment SchedulingSettingsHostReassignment + obj.SetHostReassignment(fernTestValueHostReassignment) + assert.Equal(t, fernTestValueHostReassignment, obj.HostReassignment) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetOutOfOfficeReasons", func(t *testing.T) { + obj := &SchedulingSettings{} + var fernTestValueOutOfOfficeReasons []*SchedulingSettingsOutOfOfficeReasonsItem + obj.SetOutOfOfficeReasons(fernTestValueOutOfOfficeReasons) + assert.Equal(t, fernTestValueOutOfOfficeReasons, obj.OutOfOfficeReasons) + assert.NotNil(t, obj.explicitFields) + }) + t.Run("SetCalendarFailureMode", func(t *testing.T) { obj := &SchedulingSettings{} var fernTestValueCalendarFailureMode SchedulingSettingsCalendarFailureMode @@ -101311,6 +114013,39 @@ func TestGettersSchedulingSettings(t *testing.T) { _ = obj.GetLogo() // Should return zero value }) + t.Run("GetPrivacyURL", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingSettings{} + var expected *string + obj.PrivacyURL = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetPrivacyURL(), "getter should return the property value") + }) + + t.Run("GetPrivacyURL_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingSettings{} + obj.PrivacyURL = nil + + // Act & Assert + assert.Nil(t, obj.GetPrivacyURL(), "getter should return nil when property is nil") + }) + + t.Run("GetPrivacyURL_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingSettings + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetPrivacyURL() // Should return zero value + }) + t.Run("GetEmailFrom", func(t *testing.T) { t.Parallel() // Arrange @@ -101377,6 +114112,85 @@ func TestGettersSchedulingSettings(t *testing.T) { _ = obj.GetSmsFrom() // Should return zero value }) + t.Run("GetNameHostInAttendeeEmails", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingSettings{} + var expected bool + obj.NameHostInAttendeeEmails = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetNameHostInAttendeeEmails(), "getter should return the property value") + }) + + t.Run("GetNameHostInAttendeeEmails_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingSettings + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetNameHostInAttendeeEmails() // Should return zero value + }) + + t.Run("GetHostReassignment", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingSettings{} + var expected SchedulingSettingsHostReassignment + obj.HostReassignment = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetHostReassignment(), "getter should return the property value") + }) + + t.Run("GetHostReassignment_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingSettings + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetHostReassignment() // Should return zero value + }) + + t.Run("GetOutOfOfficeReasons", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingSettings{} + var expected []*SchedulingSettingsOutOfOfficeReasonsItem + obj.OutOfOfficeReasons = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetOutOfOfficeReasons(), "getter should return the property value") + }) + + t.Run("GetOutOfOfficeReasons_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingSettings{} + obj.OutOfOfficeReasons = nil + + // Act & Assert + assert.Nil(t, obj.GetOutOfOfficeReasons(), "getter should return nil when property is nil") + }) + + t.Run("GetOutOfOfficeReasons_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingSettings + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetOutOfOfficeReasons() // Should return zero value + }) + t.Run("GetCalendarFailureMode", func(t *testing.T) { t.Parallel() // Arrange @@ -101657,6 +114471,37 @@ func TestSettersMarkExplicitSchedulingSettings(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) + t.Run("SetPrivacyURL_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingSettings{} + var fernTestValuePrivacyURL *string + + // Act + obj.SetPrivacyURL(fernTestValuePrivacyURL) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + t.Run("SetEmailFrom_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange @@ -101719,6 +114564,99 @@ func TestSettersMarkExplicitSchedulingSettings(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) + t.Run("SetNameHostInAttendeeEmails_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingSettings{} + var fernTestValueNameHostInAttendeeEmails bool + + // Act + obj.SetNameHostInAttendeeEmails(fernTestValueNameHostInAttendeeEmails) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetHostReassignment_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingSettings{} + var fernTestValueHostReassignment SchedulingSettingsHostReassignment + + // Act + obj.SetHostReassignment(fernTestValueHostReassignment) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetOutOfOfficeReasons_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingSettings{} + var fernTestValueOutOfOfficeReasons []*SchedulingSettingsOutOfOfficeReasonsItem + + // Act + obj.SetOutOfOfficeReasons(fernTestValueOutOfOfficeReasons) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + t.Run("SetCalendarFailureMode_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange @@ -102263,14 +115201,45 @@ func TestSettersMarkExplicitSchedulingSettingsNotificationsValue(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetEmailHost_MarksExplicit", func(t *testing.T) { + t.Run("SetEmailHost_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingSettingsNotificationsValue{} + var fernTestValueEmailHost *bool + + // Act + obj.SetEmailHost(fernTestValueEmailHost) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetSmsAttendee_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange obj := &SchedulingSettingsNotificationsValue{} - var fernTestValueEmailHost *bool + var fernTestValueSmsAttendee *bool // Act - obj.SetEmailHost(fernTestValueEmailHost) + obj.SetSmsAttendee(fernTestValueSmsAttendee) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -102294,14 +115263,116 @@ func TestSettersMarkExplicitSchedulingSettingsNotificationsValue(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetSmsAttendee_MarksExplicit", func(t *testing.T) { +} + +func TestSettersSchedulingSettingsOutOfOfficeReasonsItem(t *testing.T) { + t.Run("SetKey", func(t *testing.T) { + obj := &SchedulingSettingsOutOfOfficeReasonsItem{} + var fernTestValueKey string + obj.SetKey(fernTestValueKey) + assert.Equal(t, fernTestValueKey, obj.Key) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetLabel", func(t *testing.T) { + obj := &SchedulingSettingsOutOfOfficeReasonsItem{} + var fernTestValueLabel string + obj.SetLabel(fernTestValueLabel) + assert.Equal(t, fernTestValueLabel, obj.Label) + assert.NotNil(t, obj.explicitFields) + }) + +} + +func TestGettersSchedulingSettingsOutOfOfficeReasonsItem(t *testing.T) { + t.Run("GetKey", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingSettingsNotificationsValue{} - var fernTestValueSmsAttendee *bool + obj := &SchedulingSettingsOutOfOfficeReasonsItem{} + var expected string + obj.Key = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetKey(), "getter should return the property value") + }) + + t.Run("GetKey_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingSettingsOutOfOfficeReasonsItem + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetKey() // Should return zero value + }) + + t.Run("GetLabel", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingSettingsOutOfOfficeReasonsItem{} + var expected string + obj.Label = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetLabel(), "getter should return the property value") + }) + + t.Run("GetLabel_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingSettingsOutOfOfficeReasonsItem + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetLabel() // Should return zero value + }) + +} + +func TestSettersMarkExplicitSchedulingSettingsOutOfOfficeReasonsItem(t *testing.T) { + t.Run("SetKey_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingSettingsOutOfOfficeReasonsItem{} + var fernTestValueKey string // Act - obj.SetSmsAttendee(fernTestValueSmsAttendee) + obj.SetKey(fernTestValueKey) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetLabel_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingSettingsOutOfOfficeReasonsItem{} + var fernTestValueLabel string + + // Act + obj.SetLabel(fernTestValueLabel) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -135117,6 +148188,105 @@ func TestJSONMarshalingCreateCalendarDelegationRequestMicrosoft(t *testing.T) { }) } +func TestJSONMarshalingCreateOauthAppRequestGoogle(t *testing.T) { + t.Run("MarshalUnmarshal", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &CreateOauthAppRequestGoogle{} + + // Act - Marshal to JSON + data, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed") + assert.NotNil(t, data, "marshaled data should not be nil") + assert.NotEmpty(t, data, "marshaled data should not be empty") + + // Unmarshal back and verify round-trip + var unmarshaled CreateOauthAppRequestGoogle + err = json.Unmarshal(data, &unmarshaled) + assert.NoError(t, err, "round-trip unmarshal should succeed") + }) + + t.Run("UnmarshalInvalidJSON", func(t *testing.T) { + t.Parallel() + var obj CreateOauthAppRequestGoogle + err := json.Unmarshal([]byte(`{invalid json}`), &obj) + assert.Error(t, err, "unmarshaling invalid JSON should return an error") + }) + + t.Run("UnmarshalEmptyObject", func(t *testing.T) { + t.Parallel() + var obj CreateOauthAppRequestGoogle + err := json.Unmarshal([]byte(`{}`), &obj) + assert.NoError(t, err, "unmarshaling empty object should succeed") + }) +} + +func TestJSONMarshalingCreateOauthAppRequestMicrosoft(t *testing.T) { + t.Run("MarshalUnmarshal", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &CreateOauthAppRequestMicrosoft{} + + // Act - Marshal to JSON + data, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed") + assert.NotNil(t, data, "marshaled data should not be nil") + assert.NotEmpty(t, data, "marshaled data should not be empty") + + // Unmarshal back and verify round-trip + var unmarshaled CreateOauthAppRequestMicrosoft + err = json.Unmarshal(data, &unmarshaled) + assert.NoError(t, err, "round-trip unmarshal should succeed") + }) + + t.Run("UnmarshalInvalidJSON", func(t *testing.T) { + t.Parallel() + var obj CreateOauthAppRequestMicrosoft + err := json.Unmarshal([]byte(`{invalid json}`), &obj) + assert.Error(t, err, "unmarshaling invalid JSON should return an error") + }) + + t.Run("UnmarshalEmptyObject", func(t *testing.T) { + t.Parallel() + var obj CreateOauthAppRequestMicrosoft + err := json.Unmarshal([]byte(`{}`), &obj) + assert.NoError(t, err, "unmarshaling empty object should succeed") + }) +} + +func TestJSONMarshalingCreateOauthAppRequestZoom(t *testing.T) { + t.Run("MarshalUnmarshal", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &CreateOauthAppRequestZoom{} + + // Act - Marshal to JSON + data, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed") + assert.NotNil(t, data, "marshaled data should not be nil") + assert.NotEmpty(t, data, "marshaled data should not be empty") + + // Unmarshal back and verify round-trip + var unmarshaled CreateOauthAppRequestZoom + err = json.Unmarshal(data, &unmarshaled) + assert.NoError(t, err, "round-trip unmarshal should succeed") + }) + + t.Run("UnmarshalInvalidJSON", func(t *testing.T) { + t.Parallel() + var obj CreateOauthAppRequestZoom + err := json.Unmarshal([]byte(`{invalid json}`), &obj) + assert.Error(t, err, "unmarshaling invalid JSON should return an error") + }) + + t.Run("UnmarshalEmptyObject", func(t *testing.T) { + t.Parallel() + var obj CreateOauthAppRequestZoom + err := json.Unmarshal([]byte(`{}`), &obj) + assert.NoError(t, err, "unmarshaling empty object should succeed") + }) +} + func TestJSONMarshalingCreateSeriesRequest(t *testing.T) { t.Run("MarshalUnmarshal", func(t *testing.T) { t.Parallel() @@ -136008,6 +149178,39 @@ func TestJSONMarshalingDeletedSchedulingCalendarDelegation(t *testing.T) { }) } +func TestJSONMarshalingDeletedSchedulingHolidayCalendar(t *testing.T) { + t.Run("MarshalUnmarshal", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DeletedSchedulingHolidayCalendar{} + + // Act - Marshal to JSON + data, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed") + assert.NotNil(t, data, "marshaled data should not be nil") + assert.NotEmpty(t, data, "marshaled data should not be empty") + + // Unmarshal back and verify round-trip + var unmarshaled DeletedSchedulingHolidayCalendar + err = json.Unmarshal(data, &unmarshaled) + assert.NoError(t, err, "round-trip unmarshal should succeed") + }) + + t.Run("UnmarshalInvalidJSON", func(t *testing.T) { + t.Parallel() + var obj DeletedSchedulingHolidayCalendar + err := json.Unmarshal([]byte(`{invalid json}`), &obj) + assert.Error(t, err, "unmarshaling invalid JSON should return an error") + }) + + t.Run("UnmarshalEmptyObject", func(t *testing.T) { + t.Parallel() + var obj DeletedSchedulingHolidayCalendar + err := json.Unmarshal([]byte(`{}`), &obj) + assert.NoError(t, err, "unmarshaling empty object should succeed") + }) +} + func TestJSONMarshalingDeletedSchedulingHost(t *testing.T) { t.Run("MarshalUnmarshal", func(t *testing.T) { t.Parallel() @@ -136041,6 +149244,72 @@ func TestJSONMarshalingDeletedSchedulingHost(t *testing.T) { }) } +func TestJSONMarshalingDeletedSchedulingOauthApp(t *testing.T) { + t.Run("MarshalUnmarshal", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DeletedSchedulingOauthApp{} + + // Act - Marshal to JSON + data, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed") + assert.NotNil(t, data, "marshaled data should not be nil") + assert.NotEmpty(t, data, "marshaled data should not be empty") + + // Unmarshal back and verify round-trip + var unmarshaled DeletedSchedulingOauthApp + err = json.Unmarshal(data, &unmarshaled) + assert.NoError(t, err, "round-trip unmarshal should succeed") + }) + + t.Run("UnmarshalInvalidJSON", func(t *testing.T) { + t.Parallel() + var obj DeletedSchedulingOauthApp + err := json.Unmarshal([]byte(`{invalid json}`), &obj) + assert.Error(t, err, "unmarshaling invalid JSON should return an error") + }) + + t.Run("UnmarshalEmptyObject", func(t *testing.T) { + t.Parallel() + var obj DeletedSchedulingOauthApp + err := json.Unmarshal([]byte(`{}`), &obj) + assert.NoError(t, err, "unmarshaling empty object should succeed") + }) +} + +func TestJSONMarshalingDeletedSchedulingOutOfOffice(t *testing.T) { + t.Run("MarshalUnmarshal", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DeletedSchedulingOutOfOffice{} + + // Act - Marshal to JSON + data, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed") + assert.NotNil(t, data, "marshaled data should not be nil") + assert.NotEmpty(t, data, "marshaled data should not be empty") + + // Unmarshal back and verify round-trip + var unmarshaled DeletedSchedulingOutOfOffice + err = json.Unmarshal(data, &unmarshaled) + assert.NoError(t, err, "round-trip unmarshal should succeed") + }) + + t.Run("UnmarshalInvalidJSON", func(t *testing.T) { + t.Parallel() + var obj DeletedSchedulingOutOfOffice + err := json.Unmarshal([]byte(`{invalid json}`), &obj) + assert.Error(t, err, "unmarshaling invalid JSON should return an error") + }) + + t.Run("UnmarshalEmptyObject", func(t *testing.T) { + t.Parallel() + var obj DeletedSchedulingOutOfOffice + err := json.Unmarshal([]byte(`{}`), &obj) + assert.NoError(t, err, "unmarshaling empty object should succeed") + }) +} + func TestJSONMarshalingDeletedSchedulingSchedule(t *testing.T) { t.Run("MarshalUnmarshal", func(t *testing.T) { t.Parallel() @@ -141057,6 +154326,138 @@ func TestJSONMarshalingSchedulingGuestInput(t *testing.T) { }) } +func TestJSONMarshalingSchedulingHolidayCalendar(t *testing.T) { + t.Run("MarshalUnmarshal", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingHolidayCalendar{} + + // Act - Marshal to JSON + data, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed") + assert.NotNil(t, data, "marshaled data should not be nil") + assert.NotEmpty(t, data, "marshaled data should not be empty") + + // Unmarshal back and verify round-trip + var unmarshaled SchedulingHolidayCalendar + err = json.Unmarshal(data, &unmarshaled) + assert.NoError(t, err, "round-trip unmarshal should succeed") + }) + + t.Run("UnmarshalInvalidJSON", func(t *testing.T) { + t.Parallel() + var obj SchedulingHolidayCalendar + err := json.Unmarshal([]byte(`{invalid json}`), &obj) + assert.Error(t, err, "unmarshaling invalid JSON should return an error") + }) + + t.Run("UnmarshalEmptyObject", func(t *testing.T) { + t.Parallel() + var obj SchedulingHolidayCalendar + err := json.Unmarshal([]byte(`{}`), &obj) + assert.NoError(t, err, "unmarshaling empty object should succeed") + }) +} + +func TestJSONMarshalingSchedulingHolidayCalendarList(t *testing.T) { + t.Run("MarshalUnmarshal", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingHolidayCalendarList{} + + // Act - Marshal to JSON + data, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed") + assert.NotNil(t, data, "marshaled data should not be nil") + assert.NotEmpty(t, data, "marshaled data should not be empty") + + // Unmarshal back and verify round-trip + var unmarshaled SchedulingHolidayCalendarList + err = json.Unmarshal(data, &unmarshaled) + assert.NoError(t, err, "round-trip unmarshal should succeed") + }) + + t.Run("UnmarshalInvalidJSON", func(t *testing.T) { + t.Parallel() + var obj SchedulingHolidayCalendarList + err := json.Unmarshal([]byte(`{invalid json}`), &obj) + assert.Error(t, err, "unmarshaling invalid JSON should return an error") + }) + + t.Run("UnmarshalEmptyObject", func(t *testing.T) { + t.Parallel() + var obj SchedulingHolidayCalendarList + err := json.Unmarshal([]byte(`{}`), &obj) + assert.NoError(t, err, "unmarshaling empty object should succeed") + }) +} + +func TestJSONMarshalingSchedulingHolidayList(t *testing.T) { + t.Run("MarshalUnmarshal", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingHolidayList{} + + // Act - Marshal to JSON + data, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed") + assert.NotNil(t, data, "marshaled data should not be nil") + assert.NotEmpty(t, data, "marshaled data should not be empty") + + // Unmarshal back and verify round-trip + var unmarshaled SchedulingHolidayList + err = json.Unmarshal(data, &unmarshaled) + assert.NoError(t, err, "round-trip unmarshal should succeed") + }) + + t.Run("UnmarshalInvalidJSON", func(t *testing.T) { + t.Parallel() + var obj SchedulingHolidayList + err := json.Unmarshal([]byte(`{invalid json}`), &obj) + assert.Error(t, err, "unmarshaling invalid JSON should return an error") + }) + + t.Run("UnmarshalEmptyObject", func(t *testing.T) { + t.Parallel() + var obj SchedulingHolidayList + err := json.Unmarshal([]byte(`{}`), &obj) + assert.NoError(t, err, "unmarshaling empty object should succeed") + }) +} + +func TestJSONMarshalingSchedulingHolidayListDataItem(t *testing.T) { + t.Run("MarshalUnmarshal", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingHolidayListDataItem{} + + // Act - Marshal to JSON + data, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed") + assert.NotNil(t, data, "marshaled data should not be nil") + assert.NotEmpty(t, data, "marshaled data should not be empty") + + // Unmarshal back and verify round-trip + var unmarshaled SchedulingHolidayListDataItem + err = json.Unmarshal(data, &unmarshaled) + assert.NoError(t, err, "round-trip unmarshal should succeed") + }) + + t.Run("UnmarshalInvalidJSON", func(t *testing.T) { + t.Parallel() + var obj SchedulingHolidayListDataItem + err := json.Unmarshal([]byte(`{invalid json}`), &obj) + assert.Error(t, err, "unmarshaling invalid JSON should return an error") + }) + + t.Run("UnmarshalEmptyObject", func(t *testing.T) { + t.Parallel() + var obj SchedulingHolidayListDataItem + err := json.Unmarshal([]byte(`{}`), &obj) + assert.NoError(t, err, "unmarshaling empty object should succeed") + }) +} + func TestJSONMarshalingSchedulingHost(t *testing.T) { t.Run("MarshalUnmarshal", func(t *testing.T) { t.Parallel() @@ -141255,11 +154656,242 @@ func TestJSONMarshalingSchedulingLimit(t *testing.T) { }) } -func TestJSONMarshalingSchedulingLocationGoogleMeet(t *testing.T) { +func TestJSONMarshalingSchedulingLocationAddress(t *testing.T) { + t.Run("MarshalUnmarshal", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingLocationAddress{} + + // Act - Marshal to JSON + data, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed") + assert.NotNil(t, data, "marshaled data should not be nil") + assert.NotEmpty(t, data, "marshaled data should not be empty") + + // Unmarshal back and verify round-trip + var unmarshaled SchedulingLocationAddress + err = json.Unmarshal(data, &unmarshaled) + assert.NoError(t, err, "round-trip unmarshal should succeed") + }) + + t.Run("UnmarshalInvalidJSON", func(t *testing.T) { + t.Parallel() + var obj SchedulingLocationAddress + err := json.Unmarshal([]byte(`{invalid json}`), &obj) + assert.Error(t, err, "unmarshaling invalid JSON should return an error") + }) + + t.Run("UnmarshalEmptyObject", func(t *testing.T) { + t.Parallel() + var obj SchedulingLocationAddress + err := json.Unmarshal([]byte(`{}`), &obj) + assert.NoError(t, err, "unmarshaling empty object should succeed") + }) +} + +func TestJSONMarshalingSchedulingLocationFive(t *testing.T) { + t.Run("MarshalUnmarshal", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingLocationFive{} + + // Act - Marshal to JSON + data, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed") + assert.NotNil(t, data, "marshaled data should not be nil") + assert.NotEmpty(t, data, "marshaled data should not be empty") + + // Unmarshal back and verify round-trip + var unmarshaled SchedulingLocationFive + err = json.Unmarshal(data, &unmarshaled) + assert.NoError(t, err, "round-trip unmarshal should succeed") + }) + + t.Run("UnmarshalInvalidJSON", func(t *testing.T) { + t.Parallel() + var obj SchedulingLocationFive + err := json.Unmarshal([]byte(`{invalid json}`), &obj) + assert.Error(t, err, "unmarshaling invalid JSON should return an error") + }) + + t.Run("UnmarshalEmptyObject", func(t *testing.T) { + t.Parallel() + var obj SchedulingLocationFive + err := json.Unmarshal([]byte(`{}`), &obj) + assert.NoError(t, err, "unmarshaling empty object should succeed") + }) +} + +func TestJSONMarshalingSchedulingLocationFour(t *testing.T) { + t.Run("MarshalUnmarshal", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingLocationFour{} + + // Act - Marshal to JSON + data, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed") + assert.NotNil(t, data, "marshaled data should not be nil") + assert.NotEmpty(t, data, "marshaled data should not be empty") + + // Unmarshal back and verify round-trip + var unmarshaled SchedulingLocationFour + err = json.Unmarshal(data, &unmarshaled) + assert.NoError(t, err, "round-trip unmarshal should succeed") + }) + + t.Run("UnmarshalInvalidJSON", func(t *testing.T) { + t.Parallel() + var obj SchedulingLocationFour + err := json.Unmarshal([]byte(`{invalid json}`), &obj) + assert.Error(t, err, "unmarshaling invalid JSON should return an error") + }) + + t.Run("UnmarshalEmptyObject", func(t *testing.T) { + t.Parallel() + var obj SchedulingLocationFour + err := json.Unmarshal([]byte(`{}`), &obj) + assert.NoError(t, err, "unmarshaling empty object should succeed") + }) +} + +func TestJSONMarshalingSchedulingLocationNumber(t *testing.T) { + t.Run("MarshalUnmarshal", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingLocationNumber{} + + // Act - Marshal to JSON + data, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed") + assert.NotNil(t, data, "marshaled data should not be nil") + assert.NotEmpty(t, data, "marshaled data should not be empty") + + // Unmarshal back and verify round-trip + var unmarshaled SchedulingLocationNumber + err = json.Unmarshal(data, &unmarshaled) + assert.NoError(t, err, "round-trip unmarshal should succeed") + }) + + t.Run("UnmarshalInvalidJSON", func(t *testing.T) { + t.Parallel() + var obj SchedulingLocationNumber + err := json.Unmarshal([]byte(`{invalid json}`), &obj) + assert.Error(t, err, "unmarshaling invalid JSON should return an error") + }) + + t.Run("UnmarshalEmptyObject", func(t *testing.T) { + t.Parallel() + var obj SchedulingLocationNumber + err := json.Unmarshal([]byte(`{}`), &obj) + assert.NoError(t, err, "unmarshaling empty object should succeed") + }) +} + +func TestJSONMarshalingSchedulingLocationThree(t *testing.T) { + t.Run("MarshalUnmarshal", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingLocationThree{} + + // Act - Marshal to JSON + data, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed") + assert.NotNil(t, data, "marshaled data should not be nil") + assert.NotEmpty(t, data, "marshaled data should not be empty") + + // Unmarshal back and verify round-trip + var unmarshaled SchedulingLocationThree + err = json.Unmarshal(data, &unmarshaled) + assert.NoError(t, err, "round-trip unmarshal should succeed") + }) + + t.Run("UnmarshalInvalidJSON", func(t *testing.T) { + t.Parallel() + var obj SchedulingLocationThree + err := json.Unmarshal([]byte(`{invalid json}`), &obj) + assert.Error(t, err, "unmarshaling invalid JSON should return an error") + }) + + t.Run("UnmarshalEmptyObject", func(t *testing.T) { + t.Parallel() + var obj SchedulingLocationThree + err := json.Unmarshal([]byte(`{}`), &obj) + assert.NoError(t, err, "unmarshaling empty object should succeed") + }) +} + +func TestJSONMarshalingSchedulingLocationZero(t *testing.T) { + t.Run("MarshalUnmarshal", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingLocationZero{} + + // Act - Marshal to JSON + data, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed") + assert.NotNil(t, data, "marshaled data should not be nil") + assert.NotEmpty(t, data, "marshaled data should not be empty") + + // Unmarshal back and verify round-trip + var unmarshaled SchedulingLocationZero + err = json.Unmarshal(data, &unmarshaled) + assert.NoError(t, err, "round-trip unmarshal should succeed") + }) + + t.Run("UnmarshalInvalidJSON", func(t *testing.T) { + t.Parallel() + var obj SchedulingLocationZero + err := json.Unmarshal([]byte(`{invalid json}`), &obj) + assert.Error(t, err, "unmarshaling invalid JSON should return an error") + }) + + t.Run("UnmarshalEmptyObject", func(t *testing.T) { + t.Parallel() + var obj SchedulingLocationZero + err := json.Unmarshal([]byte(`{}`), &obj) + assert.NoError(t, err, "unmarshaling empty object should succeed") + }) +} + +func TestJSONMarshalingSchedulingOauthApp(t *testing.T) { + t.Run("MarshalUnmarshal", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingOauthApp{} + + // Act - Marshal to JSON + data, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed") + assert.NotNil(t, data, "marshaled data should not be nil") + assert.NotEmpty(t, data, "marshaled data should not be empty") + + // Unmarshal back and verify round-trip + var unmarshaled SchedulingOauthApp + err = json.Unmarshal(data, &unmarshaled) + assert.NoError(t, err, "round-trip unmarshal should succeed") + }) + + t.Run("UnmarshalInvalidJSON", func(t *testing.T) { + t.Parallel() + var obj SchedulingOauthApp + err := json.Unmarshal([]byte(`{invalid json}`), &obj) + assert.Error(t, err, "unmarshaling invalid JSON should return an error") + }) + + t.Run("UnmarshalEmptyObject", func(t *testing.T) { + t.Parallel() + var obj SchedulingOauthApp + err := json.Unmarshal([]byte(`{}`), &obj) + assert.NoError(t, err, "unmarshaling empty object should succeed") + }) +} + +func TestJSONMarshalingSchedulingOauthAppList(t *testing.T) { t.Run("MarshalUnmarshal", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingLocationGoogleMeet{} + obj := &SchedulingOauthAppList{} // Act - Marshal to JSON data, err := json.Marshal(obj) @@ -141268,31 +154900,31 @@ func TestJSONMarshalingSchedulingLocationGoogleMeet(t *testing.T) { assert.NotEmpty(t, data, "marshaled data should not be empty") // Unmarshal back and verify round-trip - var unmarshaled SchedulingLocationGoogleMeet + var unmarshaled SchedulingOauthAppList err = json.Unmarshal(data, &unmarshaled) assert.NoError(t, err, "round-trip unmarshal should succeed") }) t.Run("UnmarshalInvalidJSON", func(t *testing.T) { t.Parallel() - var obj SchedulingLocationGoogleMeet + var obj SchedulingOauthAppList err := json.Unmarshal([]byte(`{invalid json}`), &obj) assert.Error(t, err, "unmarshaling invalid JSON should return an error") }) t.Run("UnmarshalEmptyObject", func(t *testing.T) { t.Parallel() - var obj SchedulingLocationGoogleMeet + var obj SchedulingOauthAppList err := json.Unmarshal([]byte(`{}`), &obj) assert.NoError(t, err, "unmarshaling empty object should succeed") }) } -func TestJSONMarshalingSchedulingLocationInPerson(t *testing.T) { +func TestJSONMarshalingSchedulingOutOfOffice(t *testing.T) { t.Run("MarshalUnmarshal", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingLocationInPerson{} + obj := &SchedulingOutOfOffice{} // Act - Marshal to JSON data, err := json.Marshal(obj) @@ -141301,31 +154933,31 @@ func TestJSONMarshalingSchedulingLocationInPerson(t *testing.T) { assert.NotEmpty(t, data, "marshaled data should not be empty") // Unmarshal back and verify round-trip - var unmarshaled SchedulingLocationInPerson + var unmarshaled SchedulingOutOfOffice err = json.Unmarshal(data, &unmarshaled) assert.NoError(t, err, "round-trip unmarshal should succeed") }) t.Run("UnmarshalInvalidJSON", func(t *testing.T) { t.Parallel() - var obj SchedulingLocationInPerson + var obj SchedulingOutOfOffice err := json.Unmarshal([]byte(`{invalid json}`), &obj) assert.Error(t, err, "unmarshaling invalid JSON should return an error") }) t.Run("UnmarshalEmptyObject", func(t *testing.T) { t.Parallel() - var obj SchedulingLocationInPerson + var obj SchedulingOutOfOffice err := json.Unmarshal([]byte(`{}`), &obj) assert.NoError(t, err, "unmarshaling empty object should succeed") }) } -func TestJSONMarshalingSchedulingLocationLink(t *testing.T) { +func TestJSONMarshalingSchedulingOutOfOfficeAllDay(t *testing.T) { t.Run("MarshalUnmarshal", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingLocationLink{} + obj := &SchedulingOutOfOfficeAllDay{} // Act - Marshal to JSON data, err := json.Marshal(obj) @@ -141334,31 +154966,31 @@ func TestJSONMarshalingSchedulingLocationLink(t *testing.T) { assert.NotEmpty(t, data, "marshaled data should not be empty") // Unmarshal back and verify round-trip - var unmarshaled SchedulingLocationLink + var unmarshaled SchedulingOutOfOfficeAllDay err = json.Unmarshal(data, &unmarshaled) assert.NoError(t, err, "round-trip unmarshal should succeed") }) t.Run("UnmarshalInvalidJSON", func(t *testing.T) { t.Parallel() - var obj SchedulingLocationLink + var obj SchedulingOutOfOfficeAllDay err := json.Unmarshal([]byte(`{invalid json}`), &obj) assert.Error(t, err, "unmarshaling invalid JSON should return an error") }) t.Run("UnmarshalEmptyObject", func(t *testing.T) { t.Parallel() - var obj SchedulingLocationLink + var obj SchedulingOutOfOfficeAllDay err := json.Unmarshal([]byte(`{}`), &obj) assert.NoError(t, err, "unmarshaling empty object should succeed") }) } -func TestJSONMarshalingSchedulingLocationMicrosoftTeams(t *testing.T) { +func TestJSONMarshalingSchedulingOutOfOfficeConflict(t *testing.T) { t.Run("MarshalUnmarshal", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingLocationMicrosoftTeams{} + obj := &SchedulingOutOfOfficeConflict{} // Act - Marshal to JSON data, err := json.Marshal(obj) @@ -141367,31 +154999,31 @@ func TestJSONMarshalingSchedulingLocationMicrosoftTeams(t *testing.T) { assert.NotEmpty(t, data, "marshaled data should not be empty") // Unmarshal back and verify round-trip - var unmarshaled SchedulingLocationMicrosoftTeams + var unmarshaled SchedulingOutOfOfficeConflict err = json.Unmarshal(data, &unmarshaled) assert.NoError(t, err, "round-trip unmarshal should succeed") }) t.Run("UnmarshalInvalidJSON", func(t *testing.T) { t.Parallel() - var obj SchedulingLocationMicrosoftTeams + var obj SchedulingOutOfOfficeConflict err := json.Unmarshal([]byte(`{invalid json}`), &obj) assert.Error(t, err, "unmarshaling invalid JSON should return an error") }) t.Run("UnmarshalEmptyObject", func(t *testing.T) { t.Parallel() - var obj SchedulingLocationMicrosoftTeams + var obj SchedulingOutOfOfficeConflict err := json.Unmarshal([]byte(`{}`), &obj) assert.NoError(t, err, "unmarshaling empty object should succeed") }) } -func TestJSONMarshalingSchedulingLocationPhone(t *testing.T) { +func TestJSONMarshalingSchedulingOutOfOfficeConflictList(t *testing.T) { t.Run("MarshalUnmarshal", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingLocationPhone{} + obj := &SchedulingOutOfOfficeConflictList{} // Act - Marshal to JSON data, err := json.Marshal(obj) @@ -141400,31 +155032,31 @@ func TestJSONMarshalingSchedulingLocationPhone(t *testing.T) { assert.NotEmpty(t, data, "marshaled data should not be empty") // Unmarshal back and verify round-trip - var unmarshaled SchedulingLocationPhone + var unmarshaled SchedulingOutOfOfficeConflictList err = json.Unmarshal(data, &unmarshaled) assert.NoError(t, err, "round-trip unmarshal should succeed") }) t.Run("UnmarshalInvalidJSON", func(t *testing.T) { t.Parallel() - var obj SchedulingLocationPhone + var obj SchedulingOutOfOfficeConflictList err := json.Unmarshal([]byte(`{invalid json}`), &obj) assert.Error(t, err, "unmarshaling invalid JSON should return an error") }) t.Run("UnmarshalEmptyObject", func(t *testing.T) { t.Parallel() - var obj SchedulingLocationPhone + var obj SchedulingOutOfOfficeConflictList err := json.Unmarshal([]byte(`{}`), &obj) assert.NoError(t, err, "unmarshaling empty object should succeed") }) } -func TestJSONMarshalingSchedulingLocationZoom(t *testing.T) { +func TestJSONMarshalingSchedulingOutOfOfficeList(t *testing.T) { t.Run("MarshalUnmarshal", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingLocationZoom{} + obj := &SchedulingOutOfOfficeList{} // Act - Marshal to JSON data, err := json.Marshal(obj) @@ -141433,21 +155065,21 @@ func TestJSONMarshalingSchedulingLocationZoom(t *testing.T) { assert.NotEmpty(t, data, "marshaled data should not be empty") // Unmarshal back and verify round-trip - var unmarshaled SchedulingLocationZoom + var unmarshaled SchedulingOutOfOfficeList err = json.Unmarshal(data, &unmarshaled) assert.NoError(t, err, "round-trip unmarshal should succeed") }) t.Run("UnmarshalInvalidJSON", func(t *testing.T) { t.Parallel() - var obj SchedulingLocationZoom + var obj SchedulingOutOfOfficeList err := json.Unmarshal([]byte(`{invalid json}`), &obj) assert.Error(t, err, "unmarshaling invalid JSON should return an error") }) t.Run("UnmarshalEmptyObject", func(t *testing.T) { t.Parallel() - var obj SchedulingLocationZoom + var obj SchedulingOutOfOfficeList err := json.Unmarshal([]byte(`{}`), &obj) assert.NoError(t, err, "unmarshaling empty object should succeed") }) @@ -141486,6 +155118,402 @@ func TestJSONMarshalingSchedulingQuestion(t *testing.T) { }) } +func TestJSONMarshalingSchedulingReassignCandidate(t *testing.T) { + t.Run("MarshalUnmarshal", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingReassignCandidate{} + + // Act - Marshal to JSON + data, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed") + assert.NotNil(t, data, "marshaled data should not be nil") + assert.NotEmpty(t, data, "marshaled data should not be empty") + + // Unmarshal back and verify round-trip + var unmarshaled SchedulingReassignCandidate + err = json.Unmarshal(data, &unmarshaled) + assert.NoError(t, err, "round-trip unmarshal should succeed") + }) + + t.Run("UnmarshalInvalidJSON", func(t *testing.T) { + t.Parallel() + var obj SchedulingReassignCandidate + err := json.Unmarshal([]byte(`{invalid json}`), &obj) + assert.Error(t, err, "unmarshaling invalid JSON should return an error") + }) + + t.Run("UnmarshalEmptyObject", func(t *testing.T) { + t.Parallel() + var obj SchedulingReassignCandidate + err := json.Unmarshal([]byte(`{}`), &obj) + assert.NoError(t, err, "unmarshaling empty object should succeed") + }) +} + +func TestJSONMarshalingSchedulingReassignCandidateList(t *testing.T) { + t.Run("MarshalUnmarshal", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingReassignCandidateList{} + + // Act - Marshal to JSON + data, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed") + assert.NotNil(t, data, "marshaled data should not be nil") + assert.NotEmpty(t, data, "marshaled data should not be empty") + + // Unmarshal back and verify round-trip + var unmarshaled SchedulingReassignCandidateList + err = json.Unmarshal(data, &unmarshaled) + assert.NoError(t, err, "round-trip unmarshal should succeed") + }) + + t.Run("UnmarshalInvalidJSON", func(t *testing.T) { + t.Parallel() + var obj SchedulingReassignCandidateList + err := json.Unmarshal([]byte(`{invalid json}`), &obj) + assert.Error(t, err, "unmarshaling invalid JSON should return an error") + }) + + t.Run("UnmarshalEmptyObject", func(t *testing.T) { + t.Parallel() + var obj SchedulingReassignCandidateList + err := json.Unmarshal([]byte(`{}`), &obj) + assert.NoError(t, err, "unmarshaling empty object should succeed") + }) +} + +func TestJSONMarshalingSchedulingReassignment(t *testing.T) { + t.Run("MarshalUnmarshal", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingReassignment{} + + // Act - Marshal to JSON + data, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed") + assert.NotNil(t, data, "marshaled data should not be nil") + assert.NotEmpty(t, data, "marshaled data should not be empty") + + // Unmarshal back and verify round-trip + var unmarshaled SchedulingReassignment + err = json.Unmarshal(data, &unmarshaled) + assert.NoError(t, err, "round-trip unmarshal should succeed") + }) + + t.Run("UnmarshalInvalidJSON", func(t *testing.T) { + t.Parallel() + var obj SchedulingReassignment + err := json.Unmarshal([]byte(`{invalid json}`), &obj) + assert.Error(t, err, "unmarshaling invalid JSON should return an error") + }) + + t.Run("UnmarshalEmptyObject", func(t *testing.T) { + t.Parallel() + var obj SchedulingReassignment + err := json.Unmarshal([]byte(`{}`), &obj) + assert.NoError(t, err, "unmarshaling empty object should succeed") + }) +} + +func TestJSONMarshalingSchedulingReassignmentCounts(t *testing.T) { + t.Run("MarshalUnmarshal", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingReassignmentCounts{} + + // Act - Marshal to JSON + data, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed") + assert.NotNil(t, data, "marshaled data should not be nil") + assert.NotEmpty(t, data, "marshaled data should not be empty") + + // Unmarshal back and verify round-trip + var unmarshaled SchedulingReassignmentCounts + err = json.Unmarshal(data, &unmarshaled) + assert.NoError(t, err, "round-trip unmarshal should succeed") + }) + + t.Run("UnmarshalInvalidJSON", func(t *testing.T) { + t.Parallel() + var obj SchedulingReassignmentCounts + err := json.Unmarshal([]byte(`{invalid json}`), &obj) + assert.Error(t, err, "unmarshaling invalid JSON should return an error") + }) + + t.Run("UnmarshalEmptyObject", func(t *testing.T) { + t.Parallel() + var obj SchedulingReassignmentCounts + err := json.Unmarshal([]byte(`{}`), &obj) + assert.NoError(t, err, "unmarshaling empty object should succeed") + }) +} + +func TestJSONMarshalingSchedulingReassignmentItem(t *testing.T) { + t.Run("MarshalUnmarshal", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingReassignmentItem{} + + // Act - Marshal to JSON + data, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed") + assert.NotNil(t, data, "marshaled data should not be nil") + assert.NotEmpty(t, data, "marshaled data should not be empty") + + // Unmarshal back and verify round-trip + var unmarshaled SchedulingReassignmentItem + err = json.Unmarshal(data, &unmarshaled) + assert.NoError(t, err, "round-trip unmarshal should succeed") + }) + + t.Run("UnmarshalInvalidJSON", func(t *testing.T) { + t.Parallel() + var obj SchedulingReassignmentItem + err := json.Unmarshal([]byte(`{invalid json}`), &obj) + assert.Error(t, err, "unmarshaling invalid JSON should return an error") + }) + + t.Run("UnmarshalEmptyObject", func(t *testing.T) { + t.Parallel() + var obj SchedulingReassignmentItem + err := json.Unmarshal([]byte(`{}`), &obj) + assert.NoError(t, err, "unmarshaling empty object should succeed") + }) +} + +func TestJSONMarshalingSchedulingReassignmentItemList(t *testing.T) { + t.Run("MarshalUnmarshal", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingReassignmentItemList{} + + // Act - Marshal to JSON + data, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed") + assert.NotNil(t, data, "marshaled data should not be nil") + assert.NotEmpty(t, data, "marshaled data should not be empty") + + // Unmarshal back and verify round-trip + var unmarshaled SchedulingReassignmentItemList + err = json.Unmarshal(data, &unmarshaled) + assert.NoError(t, err, "round-trip unmarshal should succeed") + }) + + t.Run("UnmarshalInvalidJSON", func(t *testing.T) { + t.Parallel() + var obj SchedulingReassignmentItemList + err := json.Unmarshal([]byte(`{invalid json}`), &obj) + assert.Error(t, err, "unmarshaling invalid JSON should return an error") + }) + + t.Run("UnmarshalEmptyObject", func(t *testing.T) { + t.Parallel() + var obj SchedulingReassignmentItemList + err := json.Unmarshal([]byte(`{}`), &obj) + assert.NoError(t, err, "unmarshaling empty object should succeed") + }) +} + +func TestJSONMarshalingSchedulingReassignmentList(t *testing.T) { + t.Run("MarshalUnmarshal", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingReassignmentList{} + + // Act - Marshal to JSON + data, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed") + assert.NotNil(t, data, "marshaled data should not be nil") + assert.NotEmpty(t, data, "marshaled data should not be empty") + + // Unmarshal back and verify round-trip + var unmarshaled SchedulingReassignmentList + err = json.Unmarshal(data, &unmarshaled) + assert.NoError(t, err, "round-trip unmarshal should succeed") + }) + + t.Run("UnmarshalInvalidJSON", func(t *testing.T) { + t.Parallel() + var obj SchedulingReassignmentList + err := json.Unmarshal([]byte(`{invalid json}`), &obj) + assert.Error(t, err, "unmarshaling invalid JSON should return an error") + }) + + t.Run("UnmarshalEmptyObject", func(t *testing.T) { + t.Parallel() + var obj SchedulingReassignmentList + err := json.Unmarshal([]byte(`{}`), &obj) + assert.NoError(t, err, "unmarshaling empty object should succeed") + }) +} + +func TestJSONMarshalingSchedulingReassignmentPreview(t *testing.T) { + t.Run("MarshalUnmarshal", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingReassignmentPreview{} + + // Act - Marshal to JSON + data, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed") + assert.NotNil(t, data, "marshaled data should not be nil") + assert.NotEmpty(t, data, "marshaled data should not be empty") + + // Unmarshal back and verify round-trip + var unmarshaled SchedulingReassignmentPreview + err = json.Unmarshal(data, &unmarshaled) + assert.NoError(t, err, "round-trip unmarshal should succeed") + }) + + t.Run("UnmarshalInvalidJSON", func(t *testing.T) { + t.Parallel() + var obj SchedulingReassignmentPreview + err := json.Unmarshal([]byte(`{invalid json}`), &obj) + assert.Error(t, err, "unmarshaling invalid JSON should return an error") + }) + + t.Run("UnmarshalEmptyObject", func(t *testing.T) { + t.Parallel() + var obj SchedulingReassignmentPreview + err := json.Unmarshal([]byte(`{}`), &obj) + assert.NoError(t, err, "unmarshaling empty object should succeed") + }) +} + +func TestJSONMarshalingSchedulingReassignmentPreviewItemsItem(t *testing.T) { + t.Run("MarshalUnmarshal", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingReassignmentPreviewItemsItem{} + + // Act - Marshal to JSON + data, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed") + assert.NotNil(t, data, "marshaled data should not be nil") + assert.NotEmpty(t, data, "marshaled data should not be empty") + + // Unmarshal back and verify round-trip + var unmarshaled SchedulingReassignmentPreviewItemsItem + err = json.Unmarshal(data, &unmarshaled) + assert.NoError(t, err, "round-trip unmarshal should succeed") + }) + + t.Run("UnmarshalInvalidJSON", func(t *testing.T) { + t.Parallel() + var obj SchedulingReassignmentPreviewItemsItem + err := json.Unmarshal([]byte(`{invalid json}`), &obj) + assert.Error(t, err, "unmarshaling invalid JSON should return an error") + }) + + t.Run("UnmarshalEmptyObject", func(t *testing.T) { + t.Parallel() + var obj SchedulingReassignmentPreviewItemsItem + err := json.Unmarshal([]byte(`{}`), &obj) + assert.NoError(t, err, "unmarshaling empty object should succeed") + }) +} + +func TestJSONMarshalingSchedulingReassignmentSelection(t *testing.T) { + t.Run("MarshalUnmarshal", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingReassignmentSelection{} + + // Act - Marshal to JSON + data, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed") + assert.NotNil(t, data, "marshaled data should not be nil") + assert.NotEmpty(t, data, "marshaled data should not be empty") + + // Unmarshal back and verify round-trip + var unmarshaled SchedulingReassignmentSelection + err = json.Unmarshal(data, &unmarshaled) + assert.NoError(t, err, "round-trip unmarshal should succeed") + }) + + t.Run("UnmarshalInvalidJSON", func(t *testing.T) { + t.Parallel() + var obj SchedulingReassignmentSelection + err := json.Unmarshal([]byte(`{invalid json}`), &obj) + assert.Error(t, err, "unmarshaling invalid JSON should return an error") + }) + + t.Run("UnmarshalEmptyObject", func(t *testing.T) { + t.Parallel() + var obj SchedulingReassignmentSelection + err := json.Unmarshal([]byte(`{}`), &obj) + assert.NoError(t, err, "unmarshaling empty object should succeed") + }) +} + +func TestJSONMarshalingSchedulingReassignmentStrategy(t *testing.T) { + t.Run("MarshalUnmarshal", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingReassignmentStrategy{} + + // Act - Marshal to JSON + data, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed") + assert.NotNil(t, data, "marshaled data should not be nil") + assert.NotEmpty(t, data, "marshaled data should not be empty") + + // Unmarshal back and verify round-trip + var unmarshaled SchedulingReassignmentStrategy + err = json.Unmarshal(data, &unmarshaled) + assert.NoError(t, err, "round-trip unmarshal should succeed") + }) + + t.Run("UnmarshalInvalidJSON", func(t *testing.T) { + t.Parallel() + var obj SchedulingReassignmentStrategy + err := json.Unmarshal([]byte(`{invalid json}`), &obj) + assert.Error(t, err, "unmarshaling invalid JSON should return an error") + }) + + t.Run("UnmarshalEmptyObject", func(t *testing.T) { + t.Parallel() + var obj SchedulingReassignmentStrategy + err := json.Unmarshal([]byte(`{}`), &obj) + assert.NoError(t, err, "unmarshaling empty object should succeed") + }) +} + +func TestJSONMarshalingSchedulingReassignmentStrategyAssignmentsItem(t *testing.T) { + t.Run("MarshalUnmarshal", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingReassignmentStrategyAssignmentsItem{} + + // Act - Marshal to JSON + data, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed") + assert.NotNil(t, data, "marshaled data should not be nil") + assert.NotEmpty(t, data, "marshaled data should not be empty") + + // Unmarshal back and verify round-trip + var unmarshaled SchedulingReassignmentStrategyAssignmentsItem + err = json.Unmarshal(data, &unmarshaled) + assert.NoError(t, err, "round-trip unmarshal should succeed") + }) + + t.Run("UnmarshalInvalidJSON", func(t *testing.T) { + t.Parallel() + var obj SchedulingReassignmentStrategyAssignmentsItem + err := json.Unmarshal([]byte(`{invalid json}`), &obj) + assert.Error(t, err, "unmarshaling invalid JSON should return an error") + }) + + t.Run("UnmarshalEmptyObject", func(t *testing.T) { + t.Parallel() + var obj SchedulingReassignmentStrategyAssignmentsItem + err := json.Unmarshal([]byte(`{}`), &obj) + assert.NoError(t, err, "unmarshaling empty object should succeed") + }) +} + func TestJSONMarshalingSchedulingReminder(t *testing.T) { t.Run("MarshalUnmarshal", func(t *testing.T) { t.Parallel() @@ -142179,6 +156207,39 @@ func TestJSONMarshalingSchedulingSettingsNotificationsValue(t *testing.T) { }) } +func TestJSONMarshalingSchedulingSettingsOutOfOfficeReasonsItem(t *testing.T) { + t.Run("MarshalUnmarshal", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingSettingsOutOfOfficeReasonsItem{} + + // Act - Marshal to JSON + data, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed") + assert.NotNil(t, data, "marshaled data should not be nil") + assert.NotEmpty(t, data, "marshaled data should not be empty") + + // Unmarshal back and verify round-trip + var unmarshaled SchedulingSettingsOutOfOfficeReasonsItem + err = json.Unmarshal(data, &unmarshaled) + assert.NoError(t, err, "round-trip unmarshal should succeed") + }) + + t.Run("UnmarshalInvalidJSON", func(t *testing.T) { + t.Parallel() + var obj SchedulingSettingsOutOfOfficeReasonsItem + err := json.Unmarshal([]byte(`{invalid json}`), &obj) + assert.Error(t, err, "unmarshaling invalid JSON should return an error") + }) + + t.Run("UnmarshalEmptyObject", func(t *testing.T) { + t.Parallel() + var obj SchedulingSettingsOutOfOfficeReasonsItem + err := json.Unmarshal([]byte(`{}`), &obj) + assert.NoError(t, err, "unmarshaling empty object should succeed") + }) +} + func TestJSONMarshalingSchedulingSlot(t *testing.T) { t.Run("MarshalUnmarshal", func(t *testing.T) { t.Parallel() @@ -148120,6 +162181,7 @@ func TestRequiredNullableRoundTripSchedulingAvailabilitySearchResultDataItem(t * func TestRequiredNullableRoundTripSchedulingBooking(t *testing.T) { requiredNullableKeys := []string{ + "location", "hold_expires_at", "approval_expires_at", "series", @@ -148141,7 +162203,7 @@ func TestRequiredNullableRoundTripSchedulingBooking(t *testing.T) { t.Run("NullPreserved", func(t *testing.T) { t.Parallel() var obj SchedulingBooking - require.NoError(t, json.Unmarshal([]byte(`{"hold_expires_at":null,"approval_expires_at":null,"series":null,"series_index":null,"group_session":null,"external_conflict_at":null,"no_show_at":null,"cancelled_at":null,"cancelled_by":null}`), &obj)) + require.NoError(t, json.Unmarshal([]byte(`{"location":null,"hold_expires_at":null,"approval_expires_at":null,"series":null,"series_index":null,"group_session":null,"external_conflict_at":null,"no_show_at":null,"cancelled_at":null,"cancelled_by":null}`), &obj)) result := marshalToMap(t, &obj) for _, key := range requiredNullableKeys { value, ok := result[key] @@ -148306,6 +162368,7 @@ func TestRequiredNullableRoundTripSchedulingBookingNotification(t *testing.T) { func TestRequiredNullableRoundTripSchedulingCalendarConnection(t *testing.T) { requiredNullableKeys := []string{ + "oauth_app", "delegation", } marshalToMap := func(t *testing.T, obj *SchedulingCalendarConnection) map[string]json.RawMessage { @@ -148319,7 +162382,7 @@ func TestRequiredNullableRoundTripSchedulingCalendarConnection(t *testing.T) { t.Run("NullPreserved", func(t *testing.T) { t.Parallel() var obj SchedulingCalendarConnection - require.NoError(t, json.Unmarshal([]byte(`{"delegation":null}`), &obj)) + require.NoError(t, json.Unmarshal([]byte(`{"oauth_app":null,"delegation":null}`), &obj)) result := marshalToMap(t, &obj) for _, key := range requiredNullableKeys { value, ok := result[key] @@ -148531,6 +162594,97 @@ func TestRequiredNullableRoundTripSchedulingEventTypeHostsItem(t *testing.T) { }) } +func TestRequiredNullableRoundTripSchedulingHolidayCalendar(t *testing.T) { + requiredNullableKeys := []string{ + "country", + "hosts", + "host_filter", + "regions", + "last_read_at", + "last_error", + } + marshalToMap := func(t *testing.T, obj *SchedulingHolidayCalendar) map[string]json.RawMessage { + data, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed") + var result map[string]json.RawMessage + require.NoError(t, json.Unmarshal(data, &result), "marshaled data should be a JSON object") + return result + } + + t.Run("NullPreserved", func(t *testing.T) { + t.Parallel() + var obj SchedulingHolidayCalendar + require.NoError(t, json.Unmarshal([]byte(`{"country":null,"hosts":null,"host_filter":null,"regions":null,"last_read_at":null,"last_error":null}`), &obj)) + result := marshalToMap(t, &obj) + for _, key := range requiredNullableKeys { + value, ok := result[key] + require.True(t, ok, "required nullable field %q received as null should be present in the output", key) + assert.Equal(t, "null", string(value), "required nullable field %q received as null should be null in the output", key) + } + }) + + t.Run("AbsentStaysAbsent", func(t *testing.T) { + t.Parallel() + var obj SchedulingHolidayCalendar + require.NoError(t, json.Unmarshal([]byte(`{}`), &obj)) + result := marshalToMap(t, &obj) + for _, key := range requiredNullableKeys { + assert.NotContains(t, result, key, "required nullable field %q absent from the input should be absent from the output", key) + } + }) + + t.Run("FreshValueOmits", func(t *testing.T) { + t.Parallel() + result := marshalToMap(t, &SchedulingHolidayCalendar{}) + for _, key := range requiredNullableKeys { + assert.NotContains(t, result, key, "required nullable field %q should be omitted from a freshly constructed value", key) + } + }) +} + +func TestRequiredNullableRoundTripSchedulingHolidayListDataItem(t *testing.T) { + requiredNullableKeys := []string{ + "region", + } + marshalToMap := func(t *testing.T, obj *SchedulingHolidayListDataItem) map[string]json.RawMessage { + data, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed") + var result map[string]json.RawMessage + require.NoError(t, json.Unmarshal(data, &result), "marshaled data should be a JSON object") + return result + } + + t.Run("NullPreserved", func(t *testing.T) { + t.Parallel() + var obj SchedulingHolidayListDataItem + require.NoError(t, json.Unmarshal([]byte(`{"region":null}`), &obj)) + result := marshalToMap(t, &obj) + for _, key := range requiredNullableKeys { + value, ok := result[key] + require.True(t, ok, "required nullable field %q received as null should be present in the output", key) + assert.Equal(t, "null", string(value), "required nullable field %q received as null should be null in the output", key) + } + }) + + t.Run("AbsentStaysAbsent", func(t *testing.T) { + t.Parallel() + var obj SchedulingHolidayListDataItem + require.NoError(t, json.Unmarshal([]byte(`{}`), &obj)) + result := marshalToMap(t, &obj) + for _, key := range requiredNullableKeys { + assert.NotContains(t, result, key, "required nullable field %q absent from the input should be absent from the output", key) + } + }) + + t.Run("FreshValueOmits", func(t *testing.T) { + t.Parallel() + result := marshalToMap(t, &SchedulingHolidayListDataItem{}) + for _, key := range requiredNullableKeys { + assert.NotContains(t, result, key, "required nullable field %q should be omitted from a freshly constructed value", key) + } + }) +} + func TestRequiredNullableRoundTripSchedulingHost(t *testing.T) { requiredNullableKeys := []string{ "uid", @@ -148578,6 +162732,330 @@ func TestRequiredNullableRoundTripSchedulingHost(t *testing.T) { }) } +func TestRequiredNullableRoundTripSchedulingOauthApp(t *testing.T) { + requiredNullableKeys := []string{ + "tenant_id", + "redirect_uri", + "completion_url", + "zoom_event_url", + "last_error_code", + "last_error_at", + "secret_expires_at", + "verified_at", + } + marshalToMap := func(t *testing.T, obj *SchedulingOauthApp) map[string]json.RawMessage { + data, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed") + var result map[string]json.RawMessage + require.NoError(t, json.Unmarshal(data, &result), "marshaled data should be a JSON object") + return result + } + + t.Run("NullPreserved", func(t *testing.T) { + t.Parallel() + var obj SchedulingOauthApp + require.NoError(t, json.Unmarshal([]byte(`{"tenant_id":null,"redirect_uri":null,"completion_url":null,"zoom_event_url":null,"last_error_code":null,"last_error_at":null,"secret_expires_at":null,"verified_at":null}`), &obj)) + result := marshalToMap(t, &obj) + for _, key := range requiredNullableKeys { + value, ok := result[key] + require.True(t, ok, "required nullable field %q received as null should be present in the output", key) + assert.Equal(t, "null", string(value), "required nullable field %q received as null should be null in the output", key) + } + }) + + t.Run("AbsentStaysAbsent", func(t *testing.T) { + t.Parallel() + var obj SchedulingOauthApp + require.NoError(t, json.Unmarshal([]byte(`{}`), &obj)) + result := marshalToMap(t, &obj) + for _, key := range requiredNullableKeys { + assert.NotContains(t, result, key, "required nullable field %q absent from the input should be absent from the output", key) + } + }) + + t.Run("FreshValueOmits", func(t *testing.T) { + t.Parallel() + result := marshalToMap(t, &SchedulingOauthApp{}) + for _, key := range requiredNullableKeys { + assert.NotContains(t, result, key, "required nullable field %q should be omitted from a freshly constructed value", key) + } + }) +} + +func TestRequiredNullableRoundTripSchedulingOutOfOffice(t *testing.T) { + requiredNullableKeys := []string{ + "all_day", + "notes", + "public_message", + "external_id", + "group", + } + marshalToMap := func(t *testing.T, obj *SchedulingOutOfOffice) map[string]json.RawMessage { + data, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed") + var result map[string]json.RawMessage + require.NoError(t, json.Unmarshal(data, &result), "marshaled data should be a JSON object") + return result + } + + t.Run("NullPreserved", func(t *testing.T) { + t.Parallel() + var obj SchedulingOutOfOffice + require.NoError(t, json.Unmarshal([]byte(`{"all_day":null,"notes":null,"public_message":null,"external_id":null,"group":null}`), &obj)) + result := marshalToMap(t, &obj) + for _, key := range requiredNullableKeys { + value, ok := result[key] + require.True(t, ok, "required nullable field %q received as null should be present in the output", key) + assert.Equal(t, "null", string(value), "required nullable field %q received as null should be null in the output", key) + } + }) + + t.Run("AbsentStaysAbsent", func(t *testing.T) { + t.Parallel() + var obj SchedulingOutOfOffice + require.NoError(t, json.Unmarshal([]byte(`{}`), &obj)) + result := marshalToMap(t, &obj) + for _, key := range requiredNullableKeys { + assert.NotContains(t, result, key, "required nullable field %q absent from the input should be absent from the output", key) + } + }) + + t.Run("FreshValueOmits", func(t *testing.T) { + t.Parallel() + result := marshalToMap(t, &SchedulingOutOfOffice{}) + for _, key := range requiredNullableKeys { + assert.NotContains(t, result, key, "required nullable field %q should be omitted from a freshly constructed value", key) + } + }) +} + +func TestRequiredNullableRoundTripSchedulingOutOfOfficeConflict(t *testing.T) { + requiredNullableKeys := []string{ + "series", + "group_session", + } + marshalToMap := func(t *testing.T, obj *SchedulingOutOfOfficeConflict) map[string]json.RawMessage { + data, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed") + var result map[string]json.RawMessage + require.NoError(t, json.Unmarshal(data, &result), "marshaled data should be a JSON object") + return result + } + + t.Run("NullPreserved", func(t *testing.T) { + t.Parallel() + var obj SchedulingOutOfOfficeConflict + require.NoError(t, json.Unmarshal([]byte(`{"series":null,"group_session":null}`), &obj)) + result := marshalToMap(t, &obj) + for _, key := range requiredNullableKeys { + value, ok := result[key] + require.True(t, ok, "required nullable field %q received as null should be present in the output", key) + assert.Equal(t, "null", string(value), "required nullable field %q received as null should be null in the output", key) + } + }) + + t.Run("AbsentStaysAbsent", func(t *testing.T) { + t.Parallel() + var obj SchedulingOutOfOfficeConflict + require.NoError(t, json.Unmarshal([]byte(`{}`), &obj)) + result := marshalToMap(t, &obj) + for _, key := range requiredNullableKeys { + assert.NotContains(t, result, key, "required nullable field %q absent from the input should be absent from the output", key) + } + }) + + t.Run("FreshValueOmits", func(t *testing.T) { + t.Parallel() + result := marshalToMap(t, &SchedulingOutOfOfficeConflict{}) + for _, key := range requiredNullableKeys { + assert.NotContains(t, result, key, "required nullable field %q should be omitted from a freshly constructed value", key) + } + }) +} + +func TestRequiredNullableRoundTripSchedulingReassignCandidate(t *testing.T) { + requiredNullableKeys := []string{ + "uid", + "reason", + "rank", + } + marshalToMap := func(t *testing.T, obj *SchedulingReassignCandidate) map[string]json.RawMessage { + data, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed") + var result map[string]json.RawMessage + require.NoError(t, json.Unmarshal(data, &result), "marshaled data should be a JSON object") + return result + } + + t.Run("NullPreserved", func(t *testing.T) { + t.Parallel() + var obj SchedulingReassignCandidate + require.NoError(t, json.Unmarshal([]byte(`{"uid":null,"reason":null,"rank":null}`), &obj)) + result := marshalToMap(t, &obj) + for _, key := range requiredNullableKeys { + value, ok := result[key] + require.True(t, ok, "required nullable field %q received as null should be present in the output", key) + assert.Equal(t, "null", string(value), "required nullable field %q received as null should be null in the output", key) + } + }) + + t.Run("AbsentStaysAbsent", func(t *testing.T) { + t.Parallel() + var obj SchedulingReassignCandidate + require.NoError(t, json.Unmarshal([]byte(`{}`), &obj)) + result := marshalToMap(t, &obj) + for _, key := range requiredNullableKeys { + assert.NotContains(t, result, key, "required nullable field %q absent from the input should be absent from the output", key) + } + }) + + t.Run("FreshValueOmits", func(t *testing.T) { + t.Parallel() + result := marshalToMap(t, &SchedulingReassignCandidate{}) + for _, key := range requiredNullableKeys { + assert.NotContains(t, result, key, "required nullable field %q should be omitted from a freshly constructed value", key) + } + }) +} + +func TestRequiredNullableRoundTripSchedulingReassignment(t *testing.T) { + requiredNullableKeys := []string{ + "out_of_office", + "undo_of", + "started_at", + "finished_at", + } + marshalToMap := func(t *testing.T, obj *SchedulingReassignment) map[string]json.RawMessage { + data, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed") + var result map[string]json.RawMessage + require.NoError(t, json.Unmarshal(data, &result), "marshaled data should be a JSON object") + return result + } + + t.Run("NullPreserved", func(t *testing.T) { + t.Parallel() + var obj SchedulingReassignment + require.NoError(t, json.Unmarshal([]byte(`{"out_of_office":null,"undo_of":null,"started_at":null,"finished_at":null}`), &obj)) + result := marshalToMap(t, &obj) + for _, key := range requiredNullableKeys { + value, ok := result[key] + require.True(t, ok, "required nullable field %q received as null should be present in the output", key) + assert.Equal(t, "null", string(value), "required nullable field %q received as null should be null in the output", key) + } + }) + + t.Run("AbsentStaysAbsent", func(t *testing.T) { + t.Parallel() + var obj SchedulingReassignment + require.NoError(t, json.Unmarshal([]byte(`{}`), &obj)) + result := marshalToMap(t, &obj) + for _, key := range requiredNullableKeys { + assert.NotContains(t, result, key, "required nullable field %q absent from the input should be absent from the output", key) + } + }) + + t.Run("FreshValueOmits", func(t *testing.T) { + t.Parallel() + result := marshalToMap(t, &SchedulingReassignment{}) + for _, key := range requiredNullableKeys { + assert.NotContains(t, result, key, "required nullable field %q should be omitted from a freshly constructed value", key) + } + }) +} + +func TestRequiredNullableRoundTripSchedulingReassignmentItem(t *testing.T) { + requiredNullableKeys := []string{ + "from_host", + "to_host", + "error_code", + } + marshalToMap := func(t *testing.T, obj *SchedulingReassignmentItem) map[string]json.RawMessage { + data, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed") + var result map[string]json.RawMessage + require.NoError(t, json.Unmarshal(data, &result), "marshaled data should be a JSON object") + return result + } + + t.Run("NullPreserved", func(t *testing.T) { + t.Parallel() + var obj SchedulingReassignmentItem + require.NoError(t, json.Unmarshal([]byte(`{"from_host":null,"to_host":null,"error_code":null}`), &obj)) + result := marshalToMap(t, &obj) + for _, key := range requiredNullableKeys { + value, ok := result[key] + require.True(t, ok, "required nullable field %q received as null should be present in the output", key) + assert.Equal(t, "null", string(value), "required nullable field %q received as null should be null in the output", key) + } + }) + + t.Run("AbsentStaysAbsent", func(t *testing.T) { + t.Parallel() + var obj SchedulingReassignmentItem + require.NoError(t, json.Unmarshal([]byte(`{}`), &obj)) + result := marshalToMap(t, &obj) + for _, key := range requiredNullableKeys { + assert.NotContains(t, result, key, "required nullable field %q absent from the input should be absent from the output", key) + } + }) + + t.Run("FreshValueOmits", func(t *testing.T) { + t.Parallel() + result := marshalToMap(t, &SchedulingReassignmentItem{}) + for _, key := range requiredNullableKeys { + assert.NotContains(t, result, key, "required nullable field %q should be omitted from a freshly constructed value", key) + } + }) +} + +func TestRequiredNullableRoundTripSchedulingReassignmentPreviewItemsItem(t *testing.T) { + requiredNullableKeys := []string{ + "series", + "group_session", + "from_host", + "to_host", + "reason", + } + marshalToMap := func(t *testing.T, obj *SchedulingReassignmentPreviewItemsItem) map[string]json.RawMessage { + data, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed") + var result map[string]json.RawMessage + require.NoError(t, json.Unmarshal(data, &result), "marshaled data should be a JSON object") + return result + } + + t.Run("NullPreserved", func(t *testing.T) { + t.Parallel() + var obj SchedulingReassignmentPreviewItemsItem + require.NoError(t, json.Unmarshal([]byte(`{"series":null,"group_session":null,"from_host":null,"to_host":null,"reason":null}`), &obj)) + result := marshalToMap(t, &obj) + for _, key := range requiredNullableKeys { + value, ok := result[key] + require.True(t, ok, "required nullable field %q received as null should be present in the output", key) + assert.Equal(t, "null", string(value), "required nullable field %q received as null should be null in the output", key) + } + }) + + t.Run("AbsentStaysAbsent", func(t *testing.T) { + t.Parallel() + var obj SchedulingReassignmentPreviewItemsItem + require.NoError(t, json.Unmarshal([]byte(`{}`), &obj)) + result := marshalToMap(t, &obj) + for _, key := range requiredNullableKeys { + assert.NotContains(t, result, key, "required nullable field %q absent from the input should be absent from the output", key) + } + }) + + t.Run("FreshValueOmits", func(t *testing.T) { + t.Parallel() + result := marshalToMap(t, &SchedulingReassignmentPreviewItemsItem{}) + for _, key := range requiredNullableKeys { + assert.NotContains(t, result, key, "required nullable field %q should be omitted from a freshly constructed value", key) + } + }) +} + func TestRequiredNullableRoundTripSchedulingReminder(t *testing.T) { requiredNullableKeys := []string{ "before_minutes", @@ -148762,6 +163240,7 @@ func TestRequiredNullableRoundTripSchedulingSettings(t *testing.T) { "brand_name", "accent_color", "logo", + "privacy_url", "email_from", "sms_from", "notifications", @@ -148779,7 +163258,7 @@ func TestRequiredNullableRoundTripSchedulingSettings(t *testing.T) { t.Run("NullPreserved", func(t *testing.T) { t.Parallel() var obj SchedulingSettings - require.NoError(t, json.Unmarshal([]byte(`{"brand_name":null,"accent_color":null,"logo":null,"email_from":null,"sms_from":null,"notifications":null,"email_reply_to":null,"reminders":null}`), &obj)) + require.NoError(t, json.Unmarshal([]byte(`{"brand_name":null,"accent_color":null,"logo":null,"privacy_url":null,"email_from":null,"sms_from":null,"notifications":null,"email_reply_to":null,"reminders":null}`), &obj)) result := marshalToMap(t, &obj) for _, key := range requiredNullableKeys { value, ok := result[key] @@ -150350,11 +164829,11 @@ func TestOptionalNullableRoundTripSchedulingEventTypeHostInput(t *testing.T) { }) } -func TestOptionalNullableRoundTripSchedulingLocationInPerson(t *testing.T) { +func TestOptionalNullableRoundTripSchedulingLocationAddress(t *testing.T) { optionalNullableKeys := []string{ "address", } - marshalToMap := func(t *testing.T, obj *SchedulingLocationInPerson) map[string]json.RawMessage { + marshalToMap := func(t *testing.T, obj *SchedulingLocationAddress) map[string]json.RawMessage { data, err := json.Marshal(obj) require.NoError(t, err, "marshaling should succeed") var result map[string]json.RawMessage @@ -150364,7 +164843,7 @@ func TestOptionalNullableRoundTripSchedulingLocationInPerson(t *testing.T) { t.Run("NullPreserved", func(t *testing.T) { t.Parallel() - var obj SchedulingLocationInPerson + var obj SchedulingLocationAddress require.NoError(t, json.Unmarshal([]byte(`{"address":null}`), &obj)) result := marshalToMap(t, &obj) for _, key := range optionalNullableKeys { @@ -150376,7 +164855,7 @@ func TestOptionalNullableRoundTripSchedulingLocationInPerson(t *testing.T) { t.Run("AbsentStaysAbsent", func(t *testing.T) { t.Parallel() - var obj SchedulingLocationInPerson + var obj SchedulingLocationAddress require.NoError(t, json.Unmarshal([]byte(`{}`), &obj)) result := marshalToMap(t, &obj) for _, key := range optionalNullableKeys { @@ -150386,18 +164865,18 @@ func TestOptionalNullableRoundTripSchedulingLocationInPerson(t *testing.T) { t.Run("FreshValueOmits", func(t *testing.T) { t.Parallel() - result := marshalToMap(t, &SchedulingLocationInPerson{}) + result := marshalToMap(t, &SchedulingLocationAddress{}) for _, key := range optionalNullableKeys { assert.NotContains(t, result, key, "optional nullable field %q should be omitted from a freshly constructed value", key) } }) } -func TestOptionalNullableRoundTripSchedulingLocationLink(t *testing.T) { +func TestOptionalNullableRoundTripSchedulingLocationFive(t *testing.T) { optionalNullableKeys := []string{ "url", } - marshalToMap := func(t *testing.T, obj *SchedulingLocationLink) map[string]json.RawMessage { + marshalToMap := func(t *testing.T, obj *SchedulingLocationFive) map[string]json.RawMessage { data, err := json.Marshal(obj) require.NoError(t, err, "marshaling should succeed") var result map[string]json.RawMessage @@ -150407,7 +164886,7 @@ func TestOptionalNullableRoundTripSchedulingLocationLink(t *testing.T) { t.Run("NullPreserved", func(t *testing.T) { t.Parallel() - var obj SchedulingLocationLink + var obj SchedulingLocationFive require.NoError(t, json.Unmarshal([]byte(`{"url":null}`), &obj)) result := marshalToMap(t, &obj) for _, key := range optionalNullableKeys { @@ -150419,7 +164898,7 @@ func TestOptionalNullableRoundTripSchedulingLocationLink(t *testing.T) { t.Run("AbsentStaysAbsent", func(t *testing.T) { t.Parallel() - var obj SchedulingLocationLink + var obj SchedulingLocationFive require.NoError(t, json.Unmarshal([]byte(`{}`), &obj)) result := marshalToMap(t, &obj) for _, key := range optionalNullableKeys { @@ -150429,18 +164908,18 @@ func TestOptionalNullableRoundTripSchedulingLocationLink(t *testing.T) { t.Run("FreshValueOmits", func(t *testing.T) { t.Parallel() - result := marshalToMap(t, &SchedulingLocationLink{}) + result := marshalToMap(t, &SchedulingLocationFive{}) for _, key := range optionalNullableKeys { assert.NotContains(t, result, key, "optional nullable field %q should be omitted from a freshly constructed value", key) } }) } -func TestOptionalNullableRoundTripSchedulingLocationPhone(t *testing.T) { +func TestOptionalNullableRoundTripSchedulingLocationNumber(t *testing.T) { optionalNullableKeys := []string{ "number", } - marshalToMap := func(t *testing.T, obj *SchedulingLocationPhone) map[string]json.RawMessage { + marshalToMap := func(t *testing.T, obj *SchedulingLocationNumber) map[string]json.RawMessage { data, err := json.Marshal(obj) require.NoError(t, err, "marshaling should succeed") var result map[string]json.RawMessage @@ -150450,7 +164929,7 @@ func TestOptionalNullableRoundTripSchedulingLocationPhone(t *testing.T) { t.Run("NullPreserved", func(t *testing.T) { t.Parallel() - var obj SchedulingLocationPhone + var obj SchedulingLocationNumber require.NoError(t, json.Unmarshal([]byte(`{"number":null}`), &obj)) result := marshalToMap(t, &obj) for _, key := range optionalNullableKeys { @@ -150462,7 +164941,7 @@ func TestOptionalNullableRoundTripSchedulingLocationPhone(t *testing.T) { t.Run("AbsentStaysAbsent", func(t *testing.T) { t.Parallel() - var obj SchedulingLocationPhone + var obj SchedulingLocationNumber require.NoError(t, json.Unmarshal([]byte(`{}`), &obj)) result := marshalToMap(t, &obj) for _, key := range optionalNullableKeys { @@ -150472,18 +164951,18 @@ func TestOptionalNullableRoundTripSchedulingLocationPhone(t *testing.T) { t.Run("FreshValueOmits", func(t *testing.T) { t.Parallel() - result := marshalToMap(t, &SchedulingLocationPhone{}) + result := marshalToMap(t, &SchedulingLocationNumber{}) for _, key := range optionalNullableKeys { assert.NotContains(t, result, key, "optional nullable field %q should be omitted from a freshly constructed value", key) } }) } -func TestOptionalNullableRoundTripSchedulingLocationZoom(t *testing.T) { +func TestOptionalNullableRoundTripSchedulingLocationZero(t *testing.T) { optionalNullableKeys := []string{ "url", } - marshalToMap := func(t *testing.T, obj *SchedulingLocationZoom) map[string]json.RawMessage { + marshalToMap := func(t *testing.T, obj *SchedulingLocationZero) map[string]json.RawMessage { data, err := json.Marshal(obj) require.NoError(t, err, "marshaling should succeed") var result map[string]json.RawMessage @@ -150493,7 +164972,7 @@ func TestOptionalNullableRoundTripSchedulingLocationZoom(t *testing.T) { t.Run("NullPreserved", func(t *testing.T) { t.Parallel() - var obj SchedulingLocationZoom + var obj SchedulingLocationZero require.NoError(t, json.Unmarshal([]byte(`{"url":null}`), &obj)) result := marshalToMap(t, &obj) for _, key := range optionalNullableKeys { @@ -150505,7 +164984,7 @@ func TestOptionalNullableRoundTripSchedulingLocationZoom(t *testing.T) { t.Run("AbsentStaysAbsent", func(t *testing.T) { t.Parallel() - var obj SchedulingLocationZoom + var obj SchedulingLocationZero require.NoError(t, json.Unmarshal([]byte(`{}`), &obj)) result := marshalToMap(t, &obj) for _, key := range optionalNullableKeys { @@ -150515,7 +164994,7 @@ func TestOptionalNullableRoundTripSchedulingLocationZoom(t *testing.T) { t.Run("FreshValueOmits", func(t *testing.T) { t.Parallel() - result := marshalToMap(t, &SchedulingLocationZoom{}) + result := marshalToMap(t, &SchedulingLocationZero{}) for _, key := range optionalNullableKeys { assert.NotContains(t, result, key, "optional nullable field %q should be omitted from a freshly constructed value", key) } @@ -151363,6 +165842,54 @@ func TestStringCreateCalendarDelegationRequestMicrosoft(t *testing.T) { }) } +func TestStringCreateOauthAppRequestGoogle(t *testing.T) { + t.Run("StringMethod", func(t *testing.T) { + t.Parallel() + obj := &CreateOauthAppRequestGoogle{} + result := obj.String() + assert.NotEmpty(t, result, "String() should return a non-empty representation") + }) + + t.Run("StringMethod_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *CreateOauthAppRequestGoogle + result := obj.String() + assert.Equal(t, "", result, "String() should return for nil receiver") + }) +} + +func TestStringCreateOauthAppRequestMicrosoft(t *testing.T) { + t.Run("StringMethod", func(t *testing.T) { + t.Parallel() + obj := &CreateOauthAppRequestMicrosoft{} + result := obj.String() + assert.NotEmpty(t, result, "String() should return a non-empty representation") + }) + + t.Run("StringMethod_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *CreateOauthAppRequestMicrosoft + result := obj.String() + assert.Equal(t, "", result, "String() should return for nil receiver") + }) +} + +func TestStringCreateOauthAppRequestZoom(t *testing.T) { + t.Run("StringMethod", func(t *testing.T) { + t.Parallel() + obj := &CreateOauthAppRequestZoom{} + result := obj.String() + assert.NotEmpty(t, result, "String() should return a non-empty representation") + }) + + t.Run("StringMethod_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *CreateOauthAppRequestZoom + result := obj.String() + assert.Equal(t, "", result, "String() should return for nil receiver") + }) +} + func TestStringCreateSeriesRequest(t *testing.T) { t.Run("StringMethod", func(t *testing.T) { t.Parallel() @@ -151795,6 +166322,22 @@ func TestStringDeletedSchedulingCalendarDelegation(t *testing.T) { }) } +func TestStringDeletedSchedulingHolidayCalendar(t *testing.T) { + t.Run("StringMethod", func(t *testing.T) { + t.Parallel() + obj := &DeletedSchedulingHolidayCalendar{} + result := obj.String() + assert.NotEmpty(t, result, "String() should return a non-empty representation") + }) + + t.Run("StringMethod_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *DeletedSchedulingHolidayCalendar + result := obj.String() + assert.Equal(t, "", result, "String() should return for nil receiver") + }) +} + func TestStringDeletedSchedulingHost(t *testing.T) { t.Run("StringMethod", func(t *testing.T) { t.Parallel() @@ -151811,6 +166354,38 @@ func TestStringDeletedSchedulingHost(t *testing.T) { }) } +func TestStringDeletedSchedulingOauthApp(t *testing.T) { + t.Run("StringMethod", func(t *testing.T) { + t.Parallel() + obj := &DeletedSchedulingOauthApp{} + result := obj.String() + assert.NotEmpty(t, result, "String() should return a non-empty representation") + }) + + t.Run("StringMethod_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *DeletedSchedulingOauthApp + result := obj.String() + assert.Equal(t, "", result, "String() should return for nil receiver") + }) +} + +func TestStringDeletedSchedulingOutOfOffice(t *testing.T) { + t.Run("StringMethod", func(t *testing.T) { + t.Parallel() + obj := &DeletedSchedulingOutOfOffice{} + result := obj.String() + assert.NotEmpty(t, result, "String() should return a non-empty representation") + }) + + t.Run("StringMethod_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *DeletedSchedulingOutOfOffice + result := obj.String() + assert.Equal(t, "", result, "String() should return for nil receiver") + }) +} + func TestStringDeletedSchedulingSchedule(t *testing.T) { t.Run("StringMethod", func(t *testing.T) { t.Parallel() @@ -154243,6 +168818,70 @@ func TestStringSchedulingGuestInput(t *testing.T) { }) } +func TestStringSchedulingHolidayCalendar(t *testing.T) { + t.Run("StringMethod", func(t *testing.T) { + t.Parallel() + obj := &SchedulingHolidayCalendar{} + result := obj.String() + assert.NotEmpty(t, result, "String() should return a non-empty representation") + }) + + t.Run("StringMethod_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingHolidayCalendar + result := obj.String() + assert.Equal(t, "", result, "String() should return for nil receiver") + }) +} + +func TestStringSchedulingHolidayCalendarList(t *testing.T) { + t.Run("StringMethod", func(t *testing.T) { + t.Parallel() + obj := &SchedulingHolidayCalendarList{} + result := obj.String() + assert.NotEmpty(t, result, "String() should return a non-empty representation") + }) + + t.Run("StringMethod_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingHolidayCalendarList + result := obj.String() + assert.Equal(t, "", result, "String() should return for nil receiver") + }) +} + +func TestStringSchedulingHolidayList(t *testing.T) { + t.Run("StringMethod", func(t *testing.T) { + t.Parallel() + obj := &SchedulingHolidayList{} + result := obj.String() + assert.NotEmpty(t, result, "String() should return a non-empty representation") + }) + + t.Run("StringMethod_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingHolidayList + result := obj.String() + assert.Equal(t, "", result, "String() should return for nil receiver") + }) +} + +func TestStringSchedulingHolidayListDataItem(t *testing.T) { + t.Run("StringMethod", func(t *testing.T) { + t.Parallel() + obj := &SchedulingHolidayListDataItem{} + result := obj.String() + assert.NotEmpty(t, result, "String() should return a non-empty representation") + }) + + t.Run("StringMethod_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingHolidayListDataItem + result := obj.String() + assert.Equal(t, "", result, "String() should return for nil receiver") + }) +} + func TestStringSchedulingHost(t *testing.T) { t.Run("StringMethod", func(t *testing.T) { t.Parallel() @@ -154339,97 +168978,209 @@ func TestStringSchedulingLimit(t *testing.T) { }) } -func TestStringSchedulingLocationGoogleMeet(t *testing.T) { +func TestStringSchedulingLocationAddress(t *testing.T) { t.Run("StringMethod", func(t *testing.T) { t.Parallel() - obj := &SchedulingLocationGoogleMeet{} + obj := &SchedulingLocationAddress{} result := obj.String() assert.NotEmpty(t, result, "String() should return a non-empty representation") }) t.Run("StringMethod_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *SchedulingLocationGoogleMeet + var obj *SchedulingLocationAddress result := obj.String() assert.Equal(t, "", result, "String() should return for nil receiver") }) } -func TestStringSchedulingLocationInPerson(t *testing.T) { +func TestStringSchedulingLocationFive(t *testing.T) { t.Run("StringMethod", func(t *testing.T) { t.Parallel() - obj := &SchedulingLocationInPerson{} + obj := &SchedulingLocationFive{} result := obj.String() assert.NotEmpty(t, result, "String() should return a non-empty representation") }) t.Run("StringMethod_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *SchedulingLocationInPerson + var obj *SchedulingLocationFive result := obj.String() assert.Equal(t, "", result, "String() should return for nil receiver") }) } -func TestStringSchedulingLocationLink(t *testing.T) { +func TestStringSchedulingLocationFour(t *testing.T) { t.Run("StringMethod", func(t *testing.T) { t.Parallel() - obj := &SchedulingLocationLink{} + obj := &SchedulingLocationFour{} result := obj.String() assert.NotEmpty(t, result, "String() should return a non-empty representation") }) t.Run("StringMethod_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *SchedulingLocationLink + var obj *SchedulingLocationFour result := obj.String() assert.Equal(t, "", result, "String() should return for nil receiver") }) } -func TestStringSchedulingLocationMicrosoftTeams(t *testing.T) { +func TestStringSchedulingLocationNumber(t *testing.T) { t.Run("StringMethod", func(t *testing.T) { t.Parallel() - obj := &SchedulingLocationMicrosoftTeams{} + obj := &SchedulingLocationNumber{} result := obj.String() assert.NotEmpty(t, result, "String() should return a non-empty representation") }) t.Run("StringMethod_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *SchedulingLocationMicrosoftTeams + var obj *SchedulingLocationNumber result := obj.String() assert.Equal(t, "", result, "String() should return for nil receiver") }) } -func TestStringSchedulingLocationPhone(t *testing.T) { +func TestStringSchedulingLocationThree(t *testing.T) { t.Run("StringMethod", func(t *testing.T) { t.Parallel() - obj := &SchedulingLocationPhone{} + obj := &SchedulingLocationThree{} result := obj.String() assert.NotEmpty(t, result, "String() should return a non-empty representation") }) t.Run("StringMethod_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *SchedulingLocationPhone + var obj *SchedulingLocationThree result := obj.String() assert.Equal(t, "", result, "String() should return for nil receiver") }) } -func TestStringSchedulingLocationZoom(t *testing.T) { +func TestStringSchedulingLocationZero(t *testing.T) { t.Run("StringMethod", func(t *testing.T) { t.Parallel() - obj := &SchedulingLocationZoom{} + obj := &SchedulingLocationZero{} result := obj.String() assert.NotEmpty(t, result, "String() should return a non-empty representation") }) t.Run("StringMethod_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *SchedulingLocationZoom + var obj *SchedulingLocationZero + result := obj.String() + assert.Equal(t, "", result, "String() should return for nil receiver") + }) +} + +func TestStringSchedulingOauthApp(t *testing.T) { + t.Run("StringMethod", func(t *testing.T) { + t.Parallel() + obj := &SchedulingOauthApp{} + result := obj.String() + assert.NotEmpty(t, result, "String() should return a non-empty representation") + }) + + t.Run("StringMethod_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingOauthApp + result := obj.String() + assert.Equal(t, "", result, "String() should return for nil receiver") + }) +} + +func TestStringSchedulingOauthAppList(t *testing.T) { + t.Run("StringMethod", func(t *testing.T) { + t.Parallel() + obj := &SchedulingOauthAppList{} + result := obj.String() + assert.NotEmpty(t, result, "String() should return a non-empty representation") + }) + + t.Run("StringMethod_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingOauthAppList + result := obj.String() + assert.Equal(t, "", result, "String() should return for nil receiver") + }) +} + +func TestStringSchedulingOutOfOffice(t *testing.T) { + t.Run("StringMethod", func(t *testing.T) { + t.Parallel() + obj := &SchedulingOutOfOffice{} + result := obj.String() + assert.NotEmpty(t, result, "String() should return a non-empty representation") + }) + + t.Run("StringMethod_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingOutOfOffice + result := obj.String() + assert.Equal(t, "", result, "String() should return for nil receiver") + }) +} + +func TestStringSchedulingOutOfOfficeAllDay(t *testing.T) { + t.Run("StringMethod", func(t *testing.T) { + t.Parallel() + obj := &SchedulingOutOfOfficeAllDay{} + result := obj.String() + assert.NotEmpty(t, result, "String() should return a non-empty representation") + }) + + t.Run("StringMethod_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingOutOfOfficeAllDay + result := obj.String() + assert.Equal(t, "", result, "String() should return for nil receiver") + }) +} + +func TestStringSchedulingOutOfOfficeConflict(t *testing.T) { + t.Run("StringMethod", func(t *testing.T) { + t.Parallel() + obj := &SchedulingOutOfOfficeConflict{} + result := obj.String() + assert.NotEmpty(t, result, "String() should return a non-empty representation") + }) + + t.Run("StringMethod_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingOutOfOfficeConflict + result := obj.String() + assert.Equal(t, "", result, "String() should return for nil receiver") + }) +} + +func TestStringSchedulingOutOfOfficeConflictList(t *testing.T) { + t.Run("StringMethod", func(t *testing.T) { + t.Parallel() + obj := &SchedulingOutOfOfficeConflictList{} + result := obj.String() + assert.NotEmpty(t, result, "String() should return a non-empty representation") + }) + + t.Run("StringMethod_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingOutOfOfficeConflictList + result := obj.String() + assert.Equal(t, "", result, "String() should return for nil receiver") + }) +} + +func TestStringSchedulingOutOfOfficeList(t *testing.T) { + t.Run("StringMethod", func(t *testing.T) { + t.Parallel() + obj := &SchedulingOutOfOfficeList{} + result := obj.String() + assert.NotEmpty(t, result, "String() should return a non-empty representation") + }) + + t.Run("StringMethod_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingOutOfOfficeList result := obj.String() assert.Equal(t, "", result, "String() should return for nil receiver") }) @@ -154451,6 +169202,198 @@ func TestStringSchedulingQuestion(t *testing.T) { }) } +func TestStringSchedulingReassignCandidate(t *testing.T) { + t.Run("StringMethod", func(t *testing.T) { + t.Parallel() + obj := &SchedulingReassignCandidate{} + result := obj.String() + assert.NotEmpty(t, result, "String() should return a non-empty representation") + }) + + t.Run("StringMethod_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingReassignCandidate + result := obj.String() + assert.Equal(t, "", result, "String() should return for nil receiver") + }) +} + +func TestStringSchedulingReassignCandidateList(t *testing.T) { + t.Run("StringMethod", func(t *testing.T) { + t.Parallel() + obj := &SchedulingReassignCandidateList{} + result := obj.String() + assert.NotEmpty(t, result, "String() should return a non-empty representation") + }) + + t.Run("StringMethod_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingReassignCandidateList + result := obj.String() + assert.Equal(t, "", result, "String() should return for nil receiver") + }) +} + +func TestStringSchedulingReassignment(t *testing.T) { + t.Run("StringMethod", func(t *testing.T) { + t.Parallel() + obj := &SchedulingReassignment{} + result := obj.String() + assert.NotEmpty(t, result, "String() should return a non-empty representation") + }) + + t.Run("StringMethod_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingReassignment + result := obj.String() + assert.Equal(t, "", result, "String() should return for nil receiver") + }) +} + +func TestStringSchedulingReassignmentCounts(t *testing.T) { + t.Run("StringMethod", func(t *testing.T) { + t.Parallel() + obj := &SchedulingReassignmentCounts{} + result := obj.String() + assert.NotEmpty(t, result, "String() should return a non-empty representation") + }) + + t.Run("StringMethod_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingReassignmentCounts + result := obj.String() + assert.Equal(t, "", result, "String() should return for nil receiver") + }) +} + +func TestStringSchedulingReassignmentItem(t *testing.T) { + t.Run("StringMethod", func(t *testing.T) { + t.Parallel() + obj := &SchedulingReassignmentItem{} + result := obj.String() + assert.NotEmpty(t, result, "String() should return a non-empty representation") + }) + + t.Run("StringMethod_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingReassignmentItem + result := obj.String() + assert.Equal(t, "", result, "String() should return for nil receiver") + }) +} + +func TestStringSchedulingReassignmentItemList(t *testing.T) { + t.Run("StringMethod", func(t *testing.T) { + t.Parallel() + obj := &SchedulingReassignmentItemList{} + result := obj.String() + assert.NotEmpty(t, result, "String() should return a non-empty representation") + }) + + t.Run("StringMethod_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingReassignmentItemList + result := obj.String() + assert.Equal(t, "", result, "String() should return for nil receiver") + }) +} + +func TestStringSchedulingReassignmentList(t *testing.T) { + t.Run("StringMethod", func(t *testing.T) { + t.Parallel() + obj := &SchedulingReassignmentList{} + result := obj.String() + assert.NotEmpty(t, result, "String() should return a non-empty representation") + }) + + t.Run("StringMethod_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingReassignmentList + result := obj.String() + assert.Equal(t, "", result, "String() should return for nil receiver") + }) +} + +func TestStringSchedulingReassignmentPreview(t *testing.T) { + t.Run("StringMethod", func(t *testing.T) { + t.Parallel() + obj := &SchedulingReassignmentPreview{} + result := obj.String() + assert.NotEmpty(t, result, "String() should return a non-empty representation") + }) + + t.Run("StringMethod_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingReassignmentPreview + result := obj.String() + assert.Equal(t, "", result, "String() should return for nil receiver") + }) +} + +func TestStringSchedulingReassignmentPreviewItemsItem(t *testing.T) { + t.Run("StringMethod", func(t *testing.T) { + t.Parallel() + obj := &SchedulingReassignmentPreviewItemsItem{} + result := obj.String() + assert.NotEmpty(t, result, "String() should return a non-empty representation") + }) + + t.Run("StringMethod_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingReassignmentPreviewItemsItem + result := obj.String() + assert.Equal(t, "", result, "String() should return for nil receiver") + }) +} + +func TestStringSchedulingReassignmentSelection(t *testing.T) { + t.Run("StringMethod", func(t *testing.T) { + t.Parallel() + obj := &SchedulingReassignmentSelection{} + result := obj.String() + assert.NotEmpty(t, result, "String() should return a non-empty representation") + }) + + t.Run("StringMethod_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingReassignmentSelection + result := obj.String() + assert.Equal(t, "", result, "String() should return for nil receiver") + }) +} + +func TestStringSchedulingReassignmentStrategy(t *testing.T) { + t.Run("StringMethod", func(t *testing.T) { + t.Parallel() + obj := &SchedulingReassignmentStrategy{} + result := obj.String() + assert.NotEmpty(t, result, "String() should return a non-empty representation") + }) + + t.Run("StringMethod_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingReassignmentStrategy + result := obj.String() + assert.Equal(t, "", result, "String() should return for nil receiver") + }) +} + +func TestStringSchedulingReassignmentStrategyAssignmentsItem(t *testing.T) { + t.Run("StringMethod", func(t *testing.T) { + t.Parallel() + obj := &SchedulingReassignmentStrategyAssignmentsItem{} + result := obj.String() + assert.NotEmpty(t, result, "String() should return a non-empty representation") + }) + + t.Run("StringMethod_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingReassignmentStrategyAssignmentsItem + result := obj.String() + assert.Equal(t, "", result, "String() should return for nil receiver") + }) +} + func TestStringSchedulingReminder(t *testing.T) { t.Run("StringMethod", func(t *testing.T) { t.Parallel() @@ -154787,6 +169730,22 @@ func TestStringSchedulingSettingsNotificationsValue(t *testing.T) { }) } +func TestStringSchedulingSettingsOutOfOfficeReasonsItem(t *testing.T) { + t.Run("StringMethod", func(t *testing.T) { + t.Parallel() + obj := &SchedulingSettingsOutOfOfficeReasonsItem{} + result := obj.String() + assert.NotEmpty(t, result, "String() should return a non-empty representation") + }) + + t.Run("StringMethod_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingSettingsOutOfOfficeReasonsItem + result := obj.String() + assert.Equal(t, "", result, "String() should return for nil receiver") + }) +} + func TestStringSchedulingSlot(t *testing.T) { t.Run("StringMethod", func(t *testing.T) { t.Parallel() @@ -158640,6 +173599,50 @@ func TestEnumDeletedSchedulingHostObject(t *testing.T) { }) } +func TestEnumDeletedSchedulingOauthAppObject(t *testing.T) { + t.Run("NewFromString_scheduling_oauth_app", func(t *testing.T) { + t.Parallel() + val, err := NewDeletedSchedulingOauthAppObjectFromString("scheduling.oauth_app") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, DeletedSchedulingOauthAppObject("scheduling.oauth_app"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_Invalid", func(t *testing.T) { + _, err := NewDeletedSchedulingOauthAppObjectFromString("invalid_value_that_does_not_exist") + assert.Error(t, err) + }) + + t.Run("Ptr", func(t *testing.T) { + val, err := NewDeletedSchedulingOauthAppObjectFromString("scheduling.oauth_app") + assert.NoError(t, err) + ptr := val.Ptr() + assert.NotNil(t, ptr) + assert.Equal(t, val, *ptr) + }) +} + +func TestEnumDeletedSchedulingOutOfOfficeObject(t *testing.T) { + t.Run("NewFromString_scheduling_out_of_office", func(t *testing.T) { + t.Parallel() + val, err := NewDeletedSchedulingOutOfOfficeObjectFromString("scheduling.out_of_office") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, DeletedSchedulingOutOfOfficeObject("scheduling.out_of_office"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_Invalid", func(t *testing.T) { + _, err := NewDeletedSchedulingOutOfOfficeObjectFromString("invalid_value_that_does_not_exist") + assert.Error(t, err) + }) + + t.Run("Ptr", func(t *testing.T) { + val, err := NewDeletedSchedulingOutOfOfficeObjectFromString("scheduling.out_of_office") + assert.NoError(t, err) + ptr := val.Ptr() + assert.NotNil(t, ptr) + assert.Equal(t, val, *ptr) + }) +} + func TestEnumDeletedSchedulingScheduleObject(t *testing.T) { t.Run("NewFromString_scheduling_schedule", func(t *testing.T) { t.Parallel() @@ -164773,6 +179776,13 @@ func TestEnumSchedulingBookingCancelledBy(t *testing.T) { assert.Equal(t, SchedulingBookingCancelledBy("manage_session"), val, "enum value should match expected wire value") }) + t.Run("NewFromString_manager_session", func(t *testing.T) { + t.Parallel() + val, err := NewSchedulingBookingCancelledByFromString("manager_session") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, SchedulingBookingCancelledBy("manager_session"), val, "enum value should match expected wire value") + }) + t.Run("NewFromString_system", func(t *testing.T) { t.Parallel() val, err := NewSchedulingBookingCancelledByFromString("system") @@ -164830,6 +179840,13 @@ func TestEnumSchedulingBookingEventActorKind(t *testing.T) { assert.Equal(t, SchedulingBookingEventActorKind("manage_session"), val, "enum value should match expected wire value") }) + t.Run("NewFromString_manager_session", func(t *testing.T) { + t.Parallel() + val, err := NewSchedulingBookingEventActorKindFromString("manager_session") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, SchedulingBookingEventActorKind("manager_session"), val, "enum value should match expected wire value") + }) + t.Run("NewFromString_system", func(t *testing.T) { t.Parallel() val, err := NewSchedulingBookingEventActorKindFromString("system") @@ -165642,6 +180659,130 @@ func TestEnumSchedulingEventTypeStatus(t *testing.T) { }) } +func TestEnumSchedulingHolidayCalendarExistingBookings(t *testing.T) { + t.Run("NewFromString_leave", func(t *testing.T) { + t.Parallel() + val, err := NewSchedulingHolidayCalendarExistingBookingsFromString("leave") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, SchedulingHolidayCalendarExistingBookings("leave"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_reassign", func(t *testing.T) { + t.Parallel() + val, err := NewSchedulingHolidayCalendarExistingBookingsFromString("reassign") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, SchedulingHolidayCalendarExistingBookings("reassign"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_Invalid", func(t *testing.T) { + _, err := NewSchedulingHolidayCalendarExistingBookingsFromString("invalid_value_that_does_not_exist") + assert.Error(t, err) + }) + + t.Run("Ptr", func(t *testing.T) { + val, err := NewSchedulingHolidayCalendarExistingBookingsFromString("leave") + assert.NoError(t, err) + ptr := val.Ptr() + assert.NotNil(t, ptr) + assert.Equal(t, val, *ptr) + }) +} + +func TestEnumSchedulingHolidayCalendarListObject(t *testing.T) { + t.Run("NewFromString_list", func(t *testing.T) { + t.Parallel() + val, err := NewSchedulingHolidayCalendarListObjectFromString("list") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, SchedulingHolidayCalendarListObject("list"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_Invalid", func(t *testing.T) { + _, err := NewSchedulingHolidayCalendarListObjectFromString("invalid_value_that_does_not_exist") + assert.Error(t, err) + }) + + t.Run("Ptr", func(t *testing.T) { + val, err := NewSchedulingHolidayCalendarListObjectFromString("list") + assert.NoError(t, err) + ptr := val.Ptr() + assert.NotNil(t, ptr) + assert.Equal(t, val, *ptr) + }) +} + +func TestEnumSchedulingHolidayCalendarObject(t *testing.T) { + t.Run("NewFromString_scheduling_holiday_calendar", func(t *testing.T) { + t.Parallel() + val, err := NewSchedulingHolidayCalendarObjectFromString("scheduling.holiday_calendar") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, SchedulingHolidayCalendarObject("scheduling.holiday_calendar"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_Invalid", func(t *testing.T) { + _, err := NewSchedulingHolidayCalendarObjectFromString("invalid_value_that_does_not_exist") + assert.Error(t, err) + }) + + t.Run("Ptr", func(t *testing.T) { + val, err := NewSchedulingHolidayCalendarObjectFromString("scheduling.holiday_calendar") + assert.NoError(t, err) + ptr := val.Ptr() + assert.NotNil(t, ptr) + assert.Equal(t, val, *ptr) + }) +} + +func TestEnumSchedulingHolidayCalendarSource(t *testing.T) { + t.Run("NewFromString_country", func(t *testing.T) { + t.Parallel() + val, err := NewSchedulingHolidayCalendarSourceFromString("country") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, SchedulingHolidayCalendarSource("country"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_ics", func(t *testing.T) { + t.Parallel() + val, err := NewSchedulingHolidayCalendarSourceFromString("ics") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, SchedulingHolidayCalendarSource("ics"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_Invalid", func(t *testing.T) { + _, err := NewSchedulingHolidayCalendarSourceFromString("invalid_value_that_does_not_exist") + assert.Error(t, err) + }) + + t.Run("Ptr", func(t *testing.T) { + val, err := NewSchedulingHolidayCalendarSourceFromString("country") + assert.NoError(t, err) + ptr := val.Ptr() + assert.NotNil(t, ptr) + assert.Equal(t, val, *ptr) + }) +} + +func TestEnumSchedulingHolidayListObject(t *testing.T) { + t.Run("NewFromString_list", func(t *testing.T) { + t.Parallel() + val, err := NewSchedulingHolidayListObjectFromString("list") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, SchedulingHolidayListObject("list"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_Invalid", func(t *testing.T) { + _, err := NewSchedulingHolidayListObjectFromString("invalid_value_that_does_not_exist") + assert.Error(t, err) + }) + + t.Run("Ptr", func(t *testing.T) { + val, err := NewSchedulingHolidayListObjectFromString("list") + assert.NoError(t, err) + ptr := val.Ptr() + assert.NotNil(t, ptr) + assert.Equal(t, val, *ptr) + }) +} + func TestEnumSchedulingHostListObject(t *testing.T) { t.Run("NewFromString_list", func(t *testing.T) { t.Parallel() @@ -165773,6 +180914,464 @@ func TestEnumSchedulingLimitScope(t *testing.T) { }) } +func TestEnumSchedulingLocationAddressType(t *testing.T) { + t.Run("NewFromString_in_person", func(t *testing.T) { + t.Parallel() + val, err := NewSchedulingLocationAddressTypeFromString("in_person") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, SchedulingLocationAddressType("in_person"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_Invalid", func(t *testing.T) { + _, err := NewSchedulingLocationAddressTypeFromString("invalid_value_that_does_not_exist") + assert.Error(t, err) + }) + + t.Run("Ptr", func(t *testing.T) { + val, err := NewSchedulingLocationAddressTypeFromString("in_person") + assert.NoError(t, err) + ptr := val.Ptr() + assert.NotNil(t, ptr) + assert.Equal(t, val, *ptr) + }) +} + +func TestEnumSchedulingLocationFiveType(t *testing.T) { + t.Run("NewFromString_zoom", func(t *testing.T) { + t.Parallel() + val, err := NewSchedulingLocationFiveTypeFromString("zoom") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, SchedulingLocationFiveType("zoom"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_Invalid", func(t *testing.T) { + _, err := NewSchedulingLocationFiveTypeFromString("invalid_value_that_does_not_exist") + assert.Error(t, err) + }) + + t.Run("Ptr", func(t *testing.T) { + val, err := NewSchedulingLocationFiveTypeFromString("zoom") + assert.NoError(t, err) + ptr := val.Ptr() + assert.NotNil(t, ptr) + assert.Equal(t, val, *ptr) + }) +} + +func TestEnumSchedulingLocationFourType(t *testing.T) { + t.Run("NewFromString_microsoft_teams", func(t *testing.T) { + t.Parallel() + val, err := NewSchedulingLocationFourTypeFromString("microsoft_teams") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, SchedulingLocationFourType("microsoft_teams"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_Invalid", func(t *testing.T) { + _, err := NewSchedulingLocationFourTypeFromString("invalid_value_that_does_not_exist") + assert.Error(t, err) + }) + + t.Run("Ptr", func(t *testing.T) { + val, err := NewSchedulingLocationFourTypeFromString("microsoft_teams") + assert.NoError(t, err) + ptr := val.Ptr() + assert.NotNil(t, ptr) + assert.Equal(t, val, *ptr) + }) +} + +func TestEnumSchedulingLocationNumberType(t *testing.T) { + t.Run("NewFromString_phone", func(t *testing.T) { + t.Parallel() + val, err := NewSchedulingLocationNumberTypeFromString("phone") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, SchedulingLocationNumberType("phone"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_Invalid", func(t *testing.T) { + _, err := NewSchedulingLocationNumberTypeFromString("invalid_value_that_does_not_exist") + assert.Error(t, err) + }) + + t.Run("Ptr", func(t *testing.T) { + val, err := NewSchedulingLocationNumberTypeFromString("phone") + assert.NoError(t, err) + ptr := val.Ptr() + assert.NotNil(t, ptr) + assert.Equal(t, val, *ptr) + }) +} + +func TestEnumSchedulingLocationThreeType(t *testing.T) { + t.Run("NewFromString_google_meet", func(t *testing.T) { + t.Parallel() + val, err := NewSchedulingLocationThreeTypeFromString("google_meet") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, SchedulingLocationThreeType("google_meet"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_Invalid", func(t *testing.T) { + _, err := NewSchedulingLocationThreeTypeFromString("invalid_value_that_does_not_exist") + assert.Error(t, err) + }) + + t.Run("Ptr", func(t *testing.T) { + val, err := NewSchedulingLocationThreeTypeFromString("google_meet") + assert.NoError(t, err) + ptr := val.Ptr() + assert.NotNil(t, ptr) + assert.Equal(t, val, *ptr) + }) +} + +func TestEnumSchedulingLocationZeroType(t *testing.T) { + t.Run("NewFromString_link", func(t *testing.T) { + t.Parallel() + val, err := NewSchedulingLocationZeroTypeFromString("link") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, SchedulingLocationZeroType("link"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_Invalid", func(t *testing.T) { + _, err := NewSchedulingLocationZeroTypeFromString("invalid_value_that_does_not_exist") + assert.Error(t, err) + }) + + t.Run("Ptr", func(t *testing.T) { + val, err := NewSchedulingLocationZeroTypeFromString("link") + assert.NoError(t, err) + ptr := val.Ptr() + assert.NotNil(t, ptr) + assert.Equal(t, val, *ptr) + }) +} + +func TestEnumSchedulingOauthAppListObject(t *testing.T) { + t.Run("NewFromString_list", func(t *testing.T) { + t.Parallel() + val, err := NewSchedulingOauthAppListObjectFromString("list") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, SchedulingOauthAppListObject("list"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_Invalid", func(t *testing.T) { + _, err := NewSchedulingOauthAppListObjectFromString("invalid_value_that_does_not_exist") + assert.Error(t, err) + }) + + t.Run("Ptr", func(t *testing.T) { + val, err := NewSchedulingOauthAppListObjectFromString("list") + assert.NoError(t, err) + ptr := val.Ptr() + assert.NotNil(t, ptr) + assert.Equal(t, val, *ptr) + }) +} + +func TestEnumSchedulingOauthAppObject(t *testing.T) { + t.Run("NewFromString_scheduling_oauth_app", func(t *testing.T) { + t.Parallel() + val, err := NewSchedulingOauthAppObjectFromString("scheduling.oauth_app") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, SchedulingOauthAppObject("scheduling.oauth_app"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_Invalid", func(t *testing.T) { + _, err := NewSchedulingOauthAppObjectFromString("invalid_value_that_does_not_exist") + assert.Error(t, err) + }) + + t.Run("Ptr", func(t *testing.T) { + val, err := NewSchedulingOauthAppObjectFromString("scheduling.oauth_app") + assert.NoError(t, err) + ptr := val.Ptr() + assert.NotNil(t, ptr) + assert.Equal(t, val, *ptr) + }) +} + +func TestEnumSchedulingOauthAppProvider(t *testing.T) { + t.Run("NewFromString_google", func(t *testing.T) { + t.Parallel() + val, err := NewSchedulingOauthAppProviderFromString("google") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, SchedulingOauthAppProvider("google"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_microsoft", func(t *testing.T) { + t.Parallel() + val, err := NewSchedulingOauthAppProviderFromString("microsoft") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, SchedulingOauthAppProvider("microsoft"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_zoom", func(t *testing.T) { + t.Parallel() + val, err := NewSchedulingOauthAppProviderFromString("zoom") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, SchedulingOauthAppProvider("zoom"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_Invalid", func(t *testing.T) { + _, err := NewSchedulingOauthAppProviderFromString("invalid_value_that_does_not_exist") + assert.Error(t, err) + }) + + t.Run("Ptr", func(t *testing.T) { + val, err := NewSchedulingOauthAppProviderFromString("google") + assert.NoError(t, err) + ptr := val.Ptr() + assert.NotNil(t, ptr) + assert.Equal(t, val, *ptr) + }) +} + +func TestEnumSchedulingOauthAppStatus(t *testing.T) { + t.Run("NewFromString_active", func(t *testing.T) { + t.Parallel() + val, err := NewSchedulingOauthAppStatusFromString("active") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, SchedulingOauthAppStatus("active"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_failing", func(t *testing.T) { + t.Parallel() + val, err := NewSchedulingOauthAppStatusFromString("failing") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, SchedulingOauthAppStatus("failing"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_Invalid", func(t *testing.T) { + _, err := NewSchedulingOauthAppStatusFromString("invalid_value_that_does_not_exist") + assert.Error(t, err) + }) + + t.Run("Ptr", func(t *testing.T) { + val, err := NewSchedulingOauthAppStatusFromString("active") + assert.NoError(t, err) + ptr := val.Ptr() + assert.NotNil(t, ptr) + assert.Equal(t, val, *ptr) + }) +} + +func TestEnumSchedulingOutOfOfficeConflictListObject(t *testing.T) { + t.Run("NewFromString_list", func(t *testing.T) { + t.Parallel() + val, err := NewSchedulingOutOfOfficeConflictListObjectFromString("list") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, SchedulingOutOfOfficeConflictListObject("list"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_Invalid", func(t *testing.T) { + _, err := NewSchedulingOutOfOfficeConflictListObjectFromString("invalid_value_that_does_not_exist") + assert.Error(t, err) + }) + + t.Run("Ptr", func(t *testing.T) { + val, err := NewSchedulingOutOfOfficeConflictListObjectFromString("list") + assert.NoError(t, err) + ptr := val.Ptr() + assert.NotNil(t, ptr) + assert.Equal(t, val, *ptr) + }) +} + +func TestEnumSchedulingOutOfOfficeConflictObject(t *testing.T) { + t.Run("NewFromString_scheduling_out_of_office_conflict", func(t *testing.T) { + t.Parallel() + val, err := NewSchedulingOutOfOfficeConflictObjectFromString("scheduling.out_of_office_conflict") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, SchedulingOutOfOfficeConflictObject("scheduling.out_of_office_conflict"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_Invalid", func(t *testing.T) { + _, err := NewSchedulingOutOfOfficeConflictObjectFromString("invalid_value_that_does_not_exist") + assert.Error(t, err) + }) + + t.Run("Ptr", func(t *testing.T) { + val, err := NewSchedulingOutOfOfficeConflictObjectFromString("scheduling.out_of_office_conflict") + assert.NoError(t, err) + ptr := val.Ptr() + assert.NotNil(t, ptr) + assert.Equal(t, val, *ptr) + }) +} + +func TestEnumSchedulingOutOfOfficeConflictStatus(t *testing.T) { + t.Run("NewFromString_held", func(t *testing.T) { + t.Parallel() + val, err := NewSchedulingOutOfOfficeConflictStatusFromString("held") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, SchedulingOutOfOfficeConflictStatus("held"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_pending_approval", func(t *testing.T) { + t.Parallel() + val, err := NewSchedulingOutOfOfficeConflictStatusFromString("pending_approval") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, SchedulingOutOfOfficeConflictStatus("pending_approval"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_confirmed", func(t *testing.T) { + t.Parallel() + val, err := NewSchedulingOutOfOfficeConflictStatusFromString("confirmed") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, SchedulingOutOfOfficeConflictStatus("confirmed"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_cancelled", func(t *testing.T) { + t.Parallel() + val, err := NewSchedulingOutOfOfficeConflictStatusFromString("cancelled") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, SchedulingOutOfOfficeConflictStatus("cancelled"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_declined", func(t *testing.T) { + t.Parallel() + val, err := NewSchedulingOutOfOfficeConflictStatusFromString("declined") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, SchedulingOutOfOfficeConflictStatus("declined"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_Invalid", func(t *testing.T) { + _, err := NewSchedulingOutOfOfficeConflictStatusFromString("invalid_value_that_does_not_exist") + assert.Error(t, err) + }) + + t.Run("Ptr", func(t *testing.T) { + val, err := NewSchedulingOutOfOfficeConflictStatusFromString("held") + assert.NoError(t, err) + ptr := val.Ptr() + assert.NotNil(t, ptr) + assert.Equal(t, val, *ptr) + }) +} + +func TestEnumSchedulingOutOfOfficeExistingBookings(t *testing.T) { + t.Run("NewFromString_leave", func(t *testing.T) { + t.Parallel() + val, err := NewSchedulingOutOfOfficeExistingBookingsFromString("leave") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, SchedulingOutOfOfficeExistingBookings("leave"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_reassign", func(t *testing.T) { + t.Parallel() + val, err := NewSchedulingOutOfOfficeExistingBookingsFromString("reassign") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, SchedulingOutOfOfficeExistingBookings("reassign"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_Invalid", func(t *testing.T) { + _, err := NewSchedulingOutOfOfficeExistingBookingsFromString("invalid_value_that_does_not_exist") + assert.Error(t, err) + }) + + t.Run("Ptr", func(t *testing.T) { + val, err := NewSchedulingOutOfOfficeExistingBookingsFromString("leave") + assert.NoError(t, err) + ptr := val.Ptr() + assert.NotNil(t, ptr) + assert.Equal(t, val, *ptr) + }) +} + +func TestEnumSchedulingOutOfOfficeListObject(t *testing.T) { + t.Run("NewFromString_list", func(t *testing.T) { + t.Parallel() + val, err := NewSchedulingOutOfOfficeListObjectFromString("list") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, SchedulingOutOfOfficeListObject("list"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_Invalid", func(t *testing.T) { + _, err := NewSchedulingOutOfOfficeListObjectFromString("invalid_value_that_does_not_exist") + assert.Error(t, err) + }) + + t.Run("Ptr", func(t *testing.T) { + val, err := NewSchedulingOutOfOfficeListObjectFromString("list") + assert.NoError(t, err) + ptr := val.Ptr() + assert.NotNil(t, ptr) + assert.Equal(t, val, *ptr) + }) +} + +func TestEnumSchedulingOutOfOfficeObject(t *testing.T) { + t.Run("NewFromString_scheduling_out_of_office", func(t *testing.T) { + t.Parallel() + val, err := NewSchedulingOutOfOfficeObjectFromString("scheduling.out_of_office") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, SchedulingOutOfOfficeObject("scheduling.out_of_office"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_Invalid", func(t *testing.T) { + _, err := NewSchedulingOutOfOfficeObjectFromString("invalid_value_that_does_not_exist") + assert.Error(t, err) + }) + + t.Run("Ptr", func(t *testing.T) { + val, err := NewSchedulingOutOfOfficeObjectFromString("scheduling.out_of_office") + assert.NoError(t, err) + ptr := val.Ptr() + assert.NotNil(t, ptr) + assert.Equal(t, val, *ptr) + }) +} + +func TestEnumSchedulingOutOfOfficeSource(t *testing.T) { + t.Run("NewFromString_api", func(t *testing.T) { + t.Parallel() + val, err := NewSchedulingOutOfOfficeSourceFromString("api") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, SchedulingOutOfOfficeSource("api"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_host", func(t *testing.T) { + t.Parallel() + val, err := NewSchedulingOutOfOfficeSourceFromString("host") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, SchedulingOutOfOfficeSource("host"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_manager", func(t *testing.T) { + t.Parallel() + val, err := NewSchedulingOutOfOfficeSourceFromString("manager") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, SchedulingOutOfOfficeSource("manager"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_dashboard", func(t *testing.T) { + t.Parallel() + val, err := NewSchedulingOutOfOfficeSourceFromString("dashboard") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, SchedulingOutOfOfficeSource("dashboard"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_holiday", func(t *testing.T) { + t.Parallel() + val, err := NewSchedulingOutOfOfficeSourceFromString("holiday") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, SchedulingOutOfOfficeSource("holiday"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_Invalid", func(t *testing.T) { + _, err := NewSchedulingOutOfOfficeSourceFromString("invalid_value_that_does_not_exist") + assert.Error(t, err) + }) + + t.Run("Ptr", func(t *testing.T) { + val, err := NewSchedulingOutOfOfficeSourceFromString("api") + assert.NoError(t, err) + ptr := val.Ptr() + assert.NotNil(t, ptr) + assert.Equal(t, val, *ptr) + }) +} + func TestEnumSchedulingQuestionType(t *testing.T) { t.Run("NewFromString_text", func(t *testing.T) { t.Parallel() @@ -165844,6 +181443,396 @@ func TestEnumSchedulingQuestionType(t *testing.T) { }) } +func TestEnumSchedulingReassignCandidateListObject(t *testing.T) { + t.Run("NewFromString_list", func(t *testing.T) { + t.Parallel() + val, err := NewSchedulingReassignCandidateListObjectFromString("list") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, SchedulingReassignCandidateListObject("list"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_Invalid", func(t *testing.T) { + _, err := NewSchedulingReassignCandidateListObjectFromString("invalid_value_that_does_not_exist") + assert.Error(t, err) + }) + + t.Run("Ptr", func(t *testing.T) { + val, err := NewSchedulingReassignCandidateListObjectFromString("list") + assert.NoError(t, err) + ptr := val.Ptr() + assert.NotNil(t, ptr) + assert.Equal(t, val, *ptr) + }) +} + +func TestEnumSchedulingReassignCandidateObject(t *testing.T) { + t.Run("NewFromString_scheduling_reassign_candidate", func(t *testing.T) { + t.Parallel() + val, err := NewSchedulingReassignCandidateObjectFromString("scheduling.reassign_candidate") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, SchedulingReassignCandidateObject("scheduling.reassign_candidate"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_Invalid", func(t *testing.T) { + _, err := NewSchedulingReassignCandidateObjectFromString("invalid_value_that_does_not_exist") + assert.Error(t, err) + }) + + t.Run("Ptr", func(t *testing.T) { + val, err := NewSchedulingReassignCandidateObjectFromString("scheduling.reassign_candidate") + assert.NoError(t, err) + ptr := val.Ptr() + assert.NotNil(t, ptr) + assert.Equal(t, val, *ptr) + }) +} + +func TestEnumSchedulingReassignmentItemListObject(t *testing.T) { + t.Run("NewFromString_list", func(t *testing.T) { + t.Parallel() + val, err := NewSchedulingReassignmentItemListObjectFromString("list") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, SchedulingReassignmentItemListObject("list"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_Invalid", func(t *testing.T) { + _, err := NewSchedulingReassignmentItemListObjectFromString("invalid_value_that_does_not_exist") + assert.Error(t, err) + }) + + t.Run("Ptr", func(t *testing.T) { + val, err := NewSchedulingReassignmentItemListObjectFromString("list") + assert.NoError(t, err) + ptr := val.Ptr() + assert.NotNil(t, ptr) + assert.Equal(t, val, *ptr) + }) +} + +func TestEnumSchedulingReassignmentItemObject(t *testing.T) { + t.Run("NewFromString_scheduling_reassignment_item", func(t *testing.T) { + t.Parallel() + val, err := NewSchedulingReassignmentItemObjectFromString("scheduling.reassignment_item") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, SchedulingReassignmentItemObject("scheduling.reassignment_item"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_Invalid", func(t *testing.T) { + _, err := NewSchedulingReassignmentItemObjectFromString("invalid_value_that_does_not_exist") + assert.Error(t, err) + }) + + t.Run("Ptr", func(t *testing.T) { + val, err := NewSchedulingReassignmentItemObjectFromString("scheduling.reassignment_item") + assert.NoError(t, err) + ptr := val.Ptr() + assert.NotNil(t, ptr) + assert.Equal(t, val, *ptr) + }) +} + +func TestEnumSchedulingReassignmentItemOutcome(t *testing.T) { + t.Run("NewFromString_pending", func(t *testing.T) { + t.Parallel() + val, err := NewSchedulingReassignmentItemOutcomeFromString("pending") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, SchedulingReassignmentItemOutcome("pending"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_reassigned", func(t *testing.T) { + t.Parallel() + val, err := NewSchedulingReassignmentItemOutcomeFromString("reassigned") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, SchedulingReassignmentItemOutcome("reassigned"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_skipped_changed", func(t *testing.T) { + t.Parallel() + val, err := NewSchedulingReassignmentItemOutcomeFromString("skipped_changed") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, SchedulingReassignmentItemOutcome("skipped_changed"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_no_candidate", func(t *testing.T) { + t.Parallel() + val, err := NewSchedulingReassignmentItemOutcomeFromString("no_candidate") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, SchedulingReassignmentItemOutcome("no_candidate"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_failed", func(t *testing.T) { + t.Parallel() + val, err := NewSchedulingReassignmentItemOutcomeFromString("failed") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, SchedulingReassignmentItemOutcome("failed"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_cancelled", func(t *testing.T) { + t.Parallel() + val, err := NewSchedulingReassignmentItemOutcomeFromString("cancelled") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, SchedulingReassignmentItemOutcome("cancelled"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_Invalid", func(t *testing.T) { + _, err := NewSchedulingReassignmentItemOutcomeFromString("invalid_value_that_does_not_exist") + assert.Error(t, err) + }) + + t.Run("Ptr", func(t *testing.T) { + val, err := NewSchedulingReassignmentItemOutcomeFromString("pending") + assert.NoError(t, err) + ptr := val.Ptr() + assert.NotNil(t, ptr) + assert.Equal(t, val, *ptr) + }) +} + +func TestEnumSchedulingReassignmentListObject(t *testing.T) { + t.Run("NewFromString_list", func(t *testing.T) { + t.Parallel() + val, err := NewSchedulingReassignmentListObjectFromString("list") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, SchedulingReassignmentListObject("list"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_Invalid", func(t *testing.T) { + _, err := NewSchedulingReassignmentListObjectFromString("invalid_value_that_does_not_exist") + assert.Error(t, err) + }) + + t.Run("Ptr", func(t *testing.T) { + val, err := NewSchedulingReassignmentListObjectFromString("list") + assert.NoError(t, err) + ptr := val.Ptr() + assert.NotNil(t, ptr) + assert.Equal(t, val, *ptr) + }) +} + +func TestEnumSchedulingReassignmentObject(t *testing.T) { + t.Run("NewFromString_scheduling_reassignment", func(t *testing.T) { + t.Parallel() + val, err := NewSchedulingReassignmentObjectFromString("scheduling.reassignment") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, SchedulingReassignmentObject("scheduling.reassignment"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_Invalid", func(t *testing.T) { + _, err := NewSchedulingReassignmentObjectFromString("invalid_value_that_does_not_exist") + assert.Error(t, err) + }) + + t.Run("Ptr", func(t *testing.T) { + val, err := NewSchedulingReassignmentObjectFromString("scheduling.reassignment") + assert.NoError(t, err) + ptr := val.Ptr() + assert.NotNil(t, ptr) + assert.Equal(t, val, *ptr) + }) +} + +func TestEnumSchedulingReassignmentPreviewItemsItemStatus(t *testing.T) { + t.Run("NewFromString_held", func(t *testing.T) { + t.Parallel() + val, err := NewSchedulingReassignmentPreviewItemsItemStatusFromString("held") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, SchedulingReassignmentPreviewItemsItemStatus("held"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_pending_approval", func(t *testing.T) { + t.Parallel() + val, err := NewSchedulingReassignmentPreviewItemsItemStatusFromString("pending_approval") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, SchedulingReassignmentPreviewItemsItemStatus("pending_approval"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_confirmed", func(t *testing.T) { + t.Parallel() + val, err := NewSchedulingReassignmentPreviewItemsItemStatusFromString("confirmed") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, SchedulingReassignmentPreviewItemsItemStatus("confirmed"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_cancelled", func(t *testing.T) { + t.Parallel() + val, err := NewSchedulingReassignmentPreviewItemsItemStatusFromString("cancelled") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, SchedulingReassignmentPreviewItemsItemStatus("cancelled"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_declined", func(t *testing.T) { + t.Parallel() + val, err := NewSchedulingReassignmentPreviewItemsItemStatusFromString("declined") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, SchedulingReassignmentPreviewItemsItemStatus("declined"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_Invalid", func(t *testing.T) { + _, err := NewSchedulingReassignmentPreviewItemsItemStatusFromString("invalid_value_that_does_not_exist") + assert.Error(t, err) + }) + + t.Run("Ptr", func(t *testing.T) { + val, err := NewSchedulingReassignmentPreviewItemsItemStatusFromString("held") + assert.NoError(t, err) + ptr := val.Ptr() + assert.NotNil(t, ptr) + assert.Equal(t, val, *ptr) + }) +} + +func TestEnumSchedulingReassignmentPreviewObject(t *testing.T) { + t.Run("NewFromString_scheduling_reassignment_preview", func(t *testing.T) { + t.Parallel() + val, err := NewSchedulingReassignmentPreviewObjectFromString("scheduling.reassignment_preview") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, SchedulingReassignmentPreviewObject("scheduling.reassignment_preview"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_Invalid", func(t *testing.T) { + _, err := NewSchedulingReassignmentPreviewObjectFromString("invalid_value_that_does_not_exist") + assert.Error(t, err) + }) + + t.Run("Ptr", func(t *testing.T) { + val, err := NewSchedulingReassignmentPreviewObjectFromString("scheduling.reassignment_preview") + assert.NoError(t, err) + ptr := val.Ptr() + assert.NotNil(t, ptr) + assert.Equal(t, val, *ptr) + }) +} + +func TestEnumSchedulingReassignmentReasonCode(t *testing.T) { + t.Run("NewFromString_host_unavailable", func(t *testing.T) { + t.Parallel() + val, err := NewSchedulingReassignmentReasonCodeFromString("host_unavailable") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, SchedulingReassignmentReasonCode("host_unavailable"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_out_of_office", func(t *testing.T) { + t.Parallel() + val, err := NewSchedulingReassignmentReasonCodeFromString("out_of_office") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, SchedulingReassignmentReasonCode("out_of_office"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_workload", func(t *testing.T) { + t.Parallel() + val, err := NewSchedulingReassignmentReasonCodeFromString("workload") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, SchedulingReassignmentReasonCode("workload"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_customer_request", func(t *testing.T) { + t.Parallel() + val, err := NewSchedulingReassignmentReasonCodeFromString("customer_request") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, SchedulingReassignmentReasonCode("customer_request"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_offboarding", func(t *testing.T) { + t.Parallel() + val, err := NewSchedulingReassignmentReasonCodeFromString("offboarding") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, SchedulingReassignmentReasonCode("offboarding"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_other", func(t *testing.T) { + t.Parallel() + val, err := NewSchedulingReassignmentReasonCodeFromString("other") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, SchedulingReassignmentReasonCode("other"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_Invalid", func(t *testing.T) { + _, err := NewSchedulingReassignmentReasonCodeFromString("invalid_value_that_does_not_exist") + assert.Error(t, err) + }) + + t.Run("Ptr", func(t *testing.T) { + val, err := NewSchedulingReassignmentReasonCodeFromString("host_unavailable") + assert.NoError(t, err) + ptr := val.Ptr() + assert.NotNil(t, ptr) + assert.Equal(t, val, *ptr) + }) +} + +func TestEnumSchedulingReassignmentStatus(t *testing.T) { + t.Run("NewFromString_pending", func(t *testing.T) { + t.Parallel() + val, err := NewSchedulingReassignmentStatusFromString("pending") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, SchedulingReassignmentStatus("pending"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_running", func(t *testing.T) { + t.Parallel() + val, err := NewSchedulingReassignmentStatusFromString("running") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, SchedulingReassignmentStatus("running"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_completed", func(t *testing.T) { + t.Parallel() + val, err := NewSchedulingReassignmentStatusFromString("completed") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, SchedulingReassignmentStatus("completed"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_cancelled", func(t *testing.T) { + t.Parallel() + val, err := NewSchedulingReassignmentStatusFromString("cancelled") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, SchedulingReassignmentStatus("cancelled"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_Invalid", func(t *testing.T) { + _, err := NewSchedulingReassignmentStatusFromString("invalid_value_that_does_not_exist") + assert.Error(t, err) + }) + + t.Run("Ptr", func(t *testing.T) { + val, err := NewSchedulingReassignmentStatusFromString("pending") + assert.NoError(t, err) + ptr := val.Ptr() + assert.NotNil(t, ptr) + assert.Equal(t, val, *ptr) + }) +} + +func TestEnumSchedulingReassignmentStrategyOtherwise(t *testing.T) { + t.Run("NewFromString_auto", func(t *testing.T) { + t.Parallel() + val, err := NewSchedulingReassignmentStrategyOtherwiseFromString("auto") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, SchedulingReassignmentStrategyOtherwise("auto"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_leave", func(t *testing.T) { + t.Parallel() + val, err := NewSchedulingReassignmentStrategyOtherwiseFromString("leave") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, SchedulingReassignmentStrategyOtherwise("leave"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_Invalid", func(t *testing.T) { + _, err := NewSchedulingReassignmentStrategyOtherwiseFromString("invalid_value_that_does_not_exist") + assert.Error(t, err) + }) + + t.Run("Ptr", func(t *testing.T) { + val, err := NewSchedulingReassignmentStrategyOtherwiseFromString("auto") + assert.NoError(t, err) + ptr := val.Ptr() + assert.NotNil(t, ptr) + assert.Equal(t, val, *ptr) + }) +} + func TestEnumSchedulingReminderAnchor(t *testing.T) { t.Run("NewFromString_start", func(t *testing.T) { t.Parallel() @@ -166282,6 +182271,35 @@ func TestEnumSchedulingSettingsCalendarFailureMode(t *testing.T) { }) } +func TestEnumSchedulingSettingsHostReassignment(t *testing.T) { + t.Run("NewFromString_off", func(t *testing.T) { + t.Parallel() + val, err := NewSchedulingSettingsHostReassignmentFromString("off") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, SchedulingSettingsHostReassignment("off"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_eligible", func(t *testing.T) { + t.Parallel() + val, err := NewSchedulingSettingsHostReassignmentFromString("eligible") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, SchedulingSettingsHostReassignment("eligible"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_Invalid", func(t *testing.T) { + _, err := NewSchedulingSettingsHostReassignmentFromString("invalid_value_that_does_not_exist") + assert.Error(t, err) + }) + + t.Run("Ptr", func(t *testing.T) { + val, err := NewSchedulingSettingsHostReassignmentFromString("off") + assert.NoError(t, err) + ptr := val.Ptr() + assert.NotNil(t, ptr) + assert.Equal(t, val, *ptr) + }) +} + func TestEnumSchedulingSettingsLogoContentType(t *testing.T) { t.Run("NewFromString_image_png", func(t *testing.T) { t.Parallel() @@ -170400,6 +186418,75 @@ func TestExtraPropertiesCreateCalendarDelegationRequestMicrosoft(t *testing.T) { }) } +func TestExtraPropertiesCreateOauthAppRequestGoogle(t *testing.T) { + t.Run("GetExtraProperties", func(t *testing.T) { + t.Parallel() + obj := &CreateOauthAppRequestGoogle{} + // Should not panic when calling GetExtraProperties() + defer func() { + if r := recover(); r != nil { + t.Errorf("GetExtraProperties() panicked: %v", r) + } + }() + extraProps := obj.GetExtraProperties() + // Result can be nil or an empty/non-empty map + _ = extraProps + }) + + t.Run("GetExtraProperties_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *CreateOauthAppRequestGoogle + extraProps := obj.GetExtraProperties() + assert.Nil(t, extraProps, "nil receiver should return nil without panicking") + }) +} + +func TestExtraPropertiesCreateOauthAppRequestMicrosoft(t *testing.T) { + t.Run("GetExtraProperties", func(t *testing.T) { + t.Parallel() + obj := &CreateOauthAppRequestMicrosoft{} + // Should not panic when calling GetExtraProperties() + defer func() { + if r := recover(); r != nil { + t.Errorf("GetExtraProperties() panicked: %v", r) + } + }() + extraProps := obj.GetExtraProperties() + // Result can be nil or an empty/non-empty map + _ = extraProps + }) + + t.Run("GetExtraProperties_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *CreateOauthAppRequestMicrosoft + extraProps := obj.GetExtraProperties() + assert.Nil(t, extraProps, "nil receiver should return nil without panicking") + }) +} + +func TestExtraPropertiesCreateOauthAppRequestZoom(t *testing.T) { + t.Run("GetExtraProperties", func(t *testing.T) { + t.Parallel() + obj := &CreateOauthAppRequestZoom{} + // Should not panic when calling GetExtraProperties() + defer func() { + if r := recover(); r != nil { + t.Errorf("GetExtraProperties() panicked: %v", r) + } + }() + extraProps := obj.GetExtraProperties() + // Result can be nil or an empty/non-empty map + _ = extraProps + }) + + t.Run("GetExtraProperties_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *CreateOauthAppRequestZoom + extraProps := obj.GetExtraProperties() + assert.Nil(t, extraProps, "nil receiver should return nil without panicking") + }) +} + func TestExtraPropertiesCreateSeriesRequest(t *testing.T) { t.Run("GetExtraProperties", func(t *testing.T) { t.Parallel() @@ -171021,6 +187108,29 @@ func TestExtraPropertiesDeletedSchedulingCalendarDelegation(t *testing.T) { }) } +func TestExtraPropertiesDeletedSchedulingHolidayCalendar(t *testing.T) { + t.Run("GetExtraProperties", func(t *testing.T) { + t.Parallel() + obj := &DeletedSchedulingHolidayCalendar{} + // Should not panic when calling GetExtraProperties() + defer func() { + if r := recover(); r != nil { + t.Errorf("GetExtraProperties() panicked: %v", r) + } + }() + extraProps := obj.GetExtraProperties() + // Result can be nil or an empty/non-empty map + _ = extraProps + }) + + t.Run("GetExtraProperties_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *DeletedSchedulingHolidayCalendar + extraProps := obj.GetExtraProperties() + assert.Nil(t, extraProps, "nil receiver should return nil without panicking") + }) +} + func TestExtraPropertiesDeletedSchedulingHost(t *testing.T) { t.Run("GetExtraProperties", func(t *testing.T) { t.Parallel() @@ -171044,6 +187154,52 @@ func TestExtraPropertiesDeletedSchedulingHost(t *testing.T) { }) } +func TestExtraPropertiesDeletedSchedulingOauthApp(t *testing.T) { + t.Run("GetExtraProperties", func(t *testing.T) { + t.Parallel() + obj := &DeletedSchedulingOauthApp{} + // Should not panic when calling GetExtraProperties() + defer func() { + if r := recover(); r != nil { + t.Errorf("GetExtraProperties() panicked: %v", r) + } + }() + extraProps := obj.GetExtraProperties() + // Result can be nil or an empty/non-empty map + _ = extraProps + }) + + t.Run("GetExtraProperties_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *DeletedSchedulingOauthApp + extraProps := obj.GetExtraProperties() + assert.Nil(t, extraProps, "nil receiver should return nil without panicking") + }) +} + +func TestExtraPropertiesDeletedSchedulingOutOfOffice(t *testing.T) { + t.Run("GetExtraProperties", func(t *testing.T) { + t.Parallel() + obj := &DeletedSchedulingOutOfOffice{} + // Should not panic when calling GetExtraProperties() + defer func() { + if r := recover(); r != nil { + t.Errorf("GetExtraProperties() panicked: %v", r) + } + }() + extraProps := obj.GetExtraProperties() + // Result can be nil or an empty/non-empty map + _ = extraProps + }) + + t.Run("GetExtraProperties_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *DeletedSchedulingOutOfOffice + extraProps := obj.GetExtraProperties() + assert.Nil(t, extraProps, "nil receiver should return nil without panicking") + }) +} + func TestExtraPropertiesDeletedSchedulingSchedule(t *testing.T) { t.Run("GetExtraProperties", func(t *testing.T) { t.Parallel() @@ -174540,6 +190696,98 @@ func TestExtraPropertiesSchedulingGuestInput(t *testing.T) { }) } +func TestExtraPropertiesSchedulingHolidayCalendar(t *testing.T) { + t.Run("GetExtraProperties", func(t *testing.T) { + t.Parallel() + obj := &SchedulingHolidayCalendar{} + // Should not panic when calling GetExtraProperties() + defer func() { + if r := recover(); r != nil { + t.Errorf("GetExtraProperties() panicked: %v", r) + } + }() + extraProps := obj.GetExtraProperties() + // Result can be nil or an empty/non-empty map + _ = extraProps + }) + + t.Run("GetExtraProperties_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingHolidayCalendar + extraProps := obj.GetExtraProperties() + assert.Nil(t, extraProps, "nil receiver should return nil without panicking") + }) +} + +func TestExtraPropertiesSchedulingHolidayCalendarList(t *testing.T) { + t.Run("GetExtraProperties", func(t *testing.T) { + t.Parallel() + obj := &SchedulingHolidayCalendarList{} + // Should not panic when calling GetExtraProperties() + defer func() { + if r := recover(); r != nil { + t.Errorf("GetExtraProperties() panicked: %v", r) + } + }() + extraProps := obj.GetExtraProperties() + // Result can be nil or an empty/non-empty map + _ = extraProps + }) + + t.Run("GetExtraProperties_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingHolidayCalendarList + extraProps := obj.GetExtraProperties() + assert.Nil(t, extraProps, "nil receiver should return nil without panicking") + }) +} + +func TestExtraPropertiesSchedulingHolidayList(t *testing.T) { + t.Run("GetExtraProperties", func(t *testing.T) { + t.Parallel() + obj := &SchedulingHolidayList{} + // Should not panic when calling GetExtraProperties() + defer func() { + if r := recover(); r != nil { + t.Errorf("GetExtraProperties() panicked: %v", r) + } + }() + extraProps := obj.GetExtraProperties() + // Result can be nil or an empty/non-empty map + _ = extraProps + }) + + t.Run("GetExtraProperties_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingHolidayList + extraProps := obj.GetExtraProperties() + assert.Nil(t, extraProps, "nil receiver should return nil without panicking") + }) +} + +func TestExtraPropertiesSchedulingHolidayListDataItem(t *testing.T) { + t.Run("GetExtraProperties", func(t *testing.T) { + t.Parallel() + obj := &SchedulingHolidayListDataItem{} + // Should not panic when calling GetExtraProperties() + defer func() { + if r := recover(); r != nil { + t.Errorf("GetExtraProperties() panicked: %v", r) + } + }() + extraProps := obj.GetExtraProperties() + // Result can be nil or an empty/non-empty map + _ = extraProps + }) + + t.Run("GetExtraProperties_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingHolidayListDataItem + extraProps := obj.GetExtraProperties() + assert.Nil(t, extraProps, "nil receiver should return nil without panicking") + }) +} + func TestExtraPropertiesSchedulingHost(t *testing.T) { t.Run("GetExtraProperties", func(t *testing.T) { t.Parallel() @@ -174678,10 +190926,171 @@ func TestExtraPropertiesSchedulingLimit(t *testing.T) { }) } -func TestExtraPropertiesSchedulingLocationGoogleMeet(t *testing.T) { +func TestExtraPropertiesSchedulingLocationAddress(t *testing.T) { + t.Run("GetExtraProperties", func(t *testing.T) { + t.Parallel() + obj := &SchedulingLocationAddress{} + // Should not panic when calling GetExtraProperties() + defer func() { + if r := recover(); r != nil { + t.Errorf("GetExtraProperties() panicked: %v", r) + } + }() + extraProps := obj.GetExtraProperties() + // Result can be nil or an empty/non-empty map + _ = extraProps + }) + + t.Run("GetExtraProperties_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingLocationAddress + extraProps := obj.GetExtraProperties() + assert.Nil(t, extraProps, "nil receiver should return nil without panicking") + }) +} + +func TestExtraPropertiesSchedulingLocationFive(t *testing.T) { + t.Run("GetExtraProperties", func(t *testing.T) { + t.Parallel() + obj := &SchedulingLocationFive{} + // Should not panic when calling GetExtraProperties() + defer func() { + if r := recover(); r != nil { + t.Errorf("GetExtraProperties() panicked: %v", r) + } + }() + extraProps := obj.GetExtraProperties() + // Result can be nil or an empty/non-empty map + _ = extraProps + }) + + t.Run("GetExtraProperties_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingLocationFive + extraProps := obj.GetExtraProperties() + assert.Nil(t, extraProps, "nil receiver should return nil without panicking") + }) +} + +func TestExtraPropertiesSchedulingLocationFour(t *testing.T) { + t.Run("GetExtraProperties", func(t *testing.T) { + t.Parallel() + obj := &SchedulingLocationFour{} + // Should not panic when calling GetExtraProperties() + defer func() { + if r := recover(); r != nil { + t.Errorf("GetExtraProperties() panicked: %v", r) + } + }() + extraProps := obj.GetExtraProperties() + // Result can be nil or an empty/non-empty map + _ = extraProps + }) + + t.Run("GetExtraProperties_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingLocationFour + extraProps := obj.GetExtraProperties() + assert.Nil(t, extraProps, "nil receiver should return nil without panicking") + }) +} + +func TestExtraPropertiesSchedulingLocationNumber(t *testing.T) { + t.Run("GetExtraProperties", func(t *testing.T) { + t.Parallel() + obj := &SchedulingLocationNumber{} + // Should not panic when calling GetExtraProperties() + defer func() { + if r := recover(); r != nil { + t.Errorf("GetExtraProperties() panicked: %v", r) + } + }() + extraProps := obj.GetExtraProperties() + // Result can be nil or an empty/non-empty map + _ = extraProps + }) + + t.Run("GetExtraProperties_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingLocationNumber + extraProps := obj.GetExtraProperties() + assert.Nil(t, extraProps, "nil receiver should return nil without panicking") + }) +} + +func TestExtraPropertiesSchedulingLocationThree(t *testing.T) { + t.Run("GetExtraProperties", func(t *testing.T) { + t.Parallel() + obj := &SchedulingLocationThree{} + // Should not panic when calling GetExtraProperties() + defer func() { + if r := recover(); r != nil { + t.Errorf("GetExtraProperties() panicked: %v", r) + } + }() + extraProps := obj.GetExtraProperties() + // Result can be nil or an empty/non-empty map + _ = extraProps + }) + + t.Run("GetExtraProperties_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingLocationThree + extraProps := obj.GetExtraProperties() + assert.Nil(t, extraProps, "nil receiver should return nil without panicking") + }) +} + +func TestExtraPropertiesSchedulingLocationZero(t *testing.T) { + t.Run("GetExtraProperties", func(t *testing.T) { + t.Parallel() + obj := &SchedulingLocationZero{} + // Should not panic when calling GetExtraProperties() + defer func() { + if r := recover(); r != nil { + t.Errorf("GetExtraProperties() panicked: %v", r) + } + }() + extraProps := obj.GetExtraProperties() + // Result can be nil or an empty/non-empty map + _ = extraProps + }) + + t.Run("GetExtraProperties_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingLocationZero + extraProps := obj.GetExtraProperties() + assert.Nil(t, extraProps, "nil receiver should return nil without panicking") + }) +} + +func TestExtraPropertiesSchedulingOauthApp(t *testing.T) { + t.Run("GetExtraProperties", func(t *testing.T) { + t.Parallel() + obj := &SchedulingOauthApp{} + // Should not panic when calling GetExtraProperties() + defer func() { + if r := recover(); r != nil { + t.Errorf("GetExtraProperties() panicked: %v", r) + } + }() + extraProps := obj.GetExtraProperties() + // Result can be nil or an empty/non-empty map + _ = extraProps + }) + + t.Run("GetExtraProperties_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingOauthApp + extraProps := obj.GetExtraProperties() + assert.Nil(t, extraProps, "nil receiver should return nil without panicking") + }) +} + +func TestExtraPropertiesSchedulingOauthAppList(t *testing.T) { t.Run("GetExtraProperties", func(t *testing.T) { t.Parallel() - obj := &SchedulingLocationGoogleMeet{} + obj := &SchedulingOauthAppList{} // Should not panic when calling GetExtraProperties() defer func() { if r := recover(); r != nil { @@ -174695,16 +191104,16 @@ func TestExtraPropertiesSchedulingLocationGoogleMeet(t *testing.T) { t.Run("GetExtraProperties_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *SchedulingLocationGoogleMeet + var obj *SchedulingOauthAppList extraProps := obj.GetExtraProperties() assert.Nil(t, extraProps, "nil receiver should return nil without panicking") }) } -func TestExtraPropertiesSchedulingLocationInPerson(t *testing.T) { +func TestExtraPropertiesSchedulingOutOfOffice(t *testing.T) { t.Run("GetExtraProperties", func(t *testing.T) { t.Parallel() - obj := &SchedulingLocationInPerson{} + obj := &SchedulingOutOfOffice{} // Should not panic when calling GetExtraProperties() defer func() { if r := recover(); r != nil { @@ -174718,16 +191127,16 @@ func TestExtraPropertiesSchedulingLocationInPerson(t *testing.T) { t.Run("GetExtraProperties_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *SchedulingLocationInPerson + var obj *SchedulingOutOfOffice extraProps := obj.GetExtraProperties() assert.Nil(t, extraProps, "nil receiver should return nil without panicking") }) } -func TestExtraPropertiesSchedulingLocationLink(t *testing.T) { +func TestExtraPropertiesSchedulingOutOfOfficeAllDay(t *testing.T) { t.Run("GetExtraProperties", func(t *testing.T) { t.Parallel() - obj := &SchedulingLocationLink{} + obj := &SchedulingOutOfOfficeAllDay{} // Should not panic when calling GetExtraProperties() defer func() { if r := recover(); r != nil { @@ -174741,16 +191150,16 @@ func TestExtraPropertiesSchedulingLocationLink(t *testing.T) { t.Run("GetExtraProperties_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *SchedulingLocationLink + var obj *SchedulingOutOfOfficeAllDay extraProps := obj.GetExtraProperties() assert.Nil(t, extraProps, "nil receiver should return nil without panicking") }) } -func TestExtraPropertiesSchedulingLocationMicrosoftTeams(t *testing.T) { +func TestExtraPropertiesSchedulingOutOfOfficeConflict(t *testing.T) { t.Run("GetExtraProperties", func(t *testing.T) { t.Parallel() - obj := &SchedulingLocationMicrosoftTeams{} + obj := &SchedulingOutOfOfficeConflict{} // Should not panic when calling GetExtraProperties() defer func() { if r := recover(); r != nil { @@ -174764,16 +191173,16 @@ func TestExtraPropertiesSchedulingLocationMicrosoftTeams(t *testing.T) { t.Run("GetExtraProperties_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *SchedulingLocationMicrosoftTeams + var obj *SchedulingOutOfOfficeConflict extraProps := obj.GetExtraProperties() assert.Nil(t, extraProps, "nil receiver should return nil without panicking") }) } -func TestExtraPropertiesSchedulingLocationPhone(t *testing.T) { +func TestExtraPropertiesSchedulingOutOfOfficeConflictList(t *testing.T) { t.Run("GetExtraProperties", func(t *testing.T) { t.Parallel() - obj := &SchedulingLocationPhone{} + obj := &SchedulingOutOfOfficeConflictList{} // Should not panic when calling GetExtraProperties() defer func() { if r := recover(); r != nil { @@ -174787,16 +191196,16 @@ func TestExtraPropertiesSchedulingLocationPhone(t *testing.T) { t.Run("GetExtraProperties_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *SchedulingLocationPhone + var obj *SchedulingOutOfOfficeConflictList extraProps := obj.GetExtraProperties() assert.Nil(t, extraProps, "nil receiver should return nil without panicking") }) } -func TestExtraPropertiesSchedulingLocationZoom(t *testing.T) { +func TestExtraPropertiesSchedulingOutOfOfficeList(t *testing.T) { t.Run("GetExtraProperties", func(t *testing.T) { t.Parallel() - obj := &SchedulingLocationZoom{} + obj := &SchedulingOutOfOfficeList{} // Should not panic when calling GetExtraProperties() defer func() { if r := recover(); r != nil { @@ -174810,7 +191219,7 @@ func TestExtraPropertiesSchedulingLocationZoom(t *testing.T) { t.Run("GetExtraProperties_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *SchedulingLocationZoom + var obj *SchedulingOutOfOfficeList extraProps := obj.GetExtraProperties() assert.Nil(t, extraProps, "nil receiver should return nil without panicking") }) @@ -174839,6 +191248,282 @@ func TestExtraPropertiesSchedulingQuestion(t *testing.T) { }) } +func TestExtraPropertiesSchedulingReassignCandidate(t *testing.T) { + t.Run("GetExtraProperties", func(t *testing.T) { + t.Parallel() + obj := &SchedulingReassignCandidate{} + // Should not panic when calling GetExtraProperties() + defer func() { + if r := recover(); r != nil { + t.Errorf("GetExtraProperties() panicked: %v", r) + } + }() + extraProps := obj.GetExtraProperties() + // Result can be nil or an empty/non-empty map + _ = extraProps + }) + + t.Run("GetExtraProperties_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingReassignCandidate + extraProps := obj.GetExtraProperties() + assert.Nil(t, extraProps, "nil receiver should return nil without panicking") + }) +} + +func TestExtraPropertiesSchedulingReassignCandidateList(t *testing.T) { + t.Run("GetExtraProperties", func(t *testing.T) { + t.Parallel() + obj := &SchedulingReassignCandidateList{} + // Should not panic when calling GetExtraProperties() + defer func() { + if r := recover(); r != nil { + t.Errorf("GetExtraProperties() panicked: %v", r) + } + }() + extraProps := obj.GetExtraProperties() + // Result can be nil or an empty/non-empty map + _ = extraProps + }) + + t.Run("GetExtraProperties_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingReassignCandidateList + extraProps := obj.GetExtraProperties() + assert.Nil(t, extraProps, "nil receiver should return nil without panicking") + }) +} + +func TestExtraPropertiesSchedulingReassignment(t *testing.T) { + t.Run("GetExtraProperties", func(t *testing.T) { + t.Parallel() + obj := &SchedulingReassignment{} + // Should not panic when calling GetExtraProperties() + defer func() { + if r := recover(); r != nil { + t.Errorf("GetExtraProperties() panicked: %v", r) + } + }() + extraProps := obj.GetExtraProperties() + // Result can be nil or an empty/non-empty map + _ = extraProps + }) + + t.Run("GetExtraProperties_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingReassignment + extraProps := obj.GetExtraProperties() + assert.Nil(t, extraProps, "nil receiver should return nil without panicking") + }) +} + +func TestExtraPropertiesSchedulingReassignmentCounts(t *testing.T) { + t.Run("GetExtraProperties", func(t *testing.T) { + t.Parallel() + obj := &SchedulingReassignmentCounts{} + // Should not panic when calling GetExtraProperties() + defer func() { + if r := recover(); r != nil { + t.Errorf("GetExtraProperties() panicked: %v", r) + } + }() + extraProps := obj.GetExtraProperties() + // Result can be nil or an empty/non-empty map + _ = extraProps + }) + + t.Run("GetExtraProperties_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingReassignmentCounts + extraProps := obj.GetExtraProperties() + assert.Nil(t, extraProps, "nil receiver should return nil without panicking") + }) +} + +func TestExtraPropertiesSchedulingReassignmentItem(t *testing.T) { + t.Run("GetExtraProperties", func(t *testing.T) { + t.Parallel() + obj := &SchedulingReassignmentItem{} + // Should not panic when calling GetExtraProperties() + defer func() { + if r := recover(); r != nil { + t.Errorf("GetExtraProperties() panicked: %v", r) + } + }() + extraProps := obj.GetExtraProperties() + // Result can be nil or an empty/non-empty map + _ = extraProps + }) + + t.Run("GetExtraProperties_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingReassignmentItem + extraProps := obj.GetExtraProperties() + assert.Nil(t, extraProps, "nil receiver should return nil without panicking") + }) +} + +func TestExtraPropertiesSchedulingReassignmentItemList(t *testing.T) { + t.Run("GetExtraProperties", func(t *testing.T) { + t.Parallel() + obj := &SchedulingReassignmentItemList{} + // Should not panic when calling GetExtraProperties() + defer func() { + if r := recover(); r != nil { + t.Errorf("GetExtraProperties() panicked: %v", r) + } + }() + extraProps := obj.GetExtraProperties() + // Result can be nil or an empty/non-empty map + _ = extraProps + }) + + t.Run("GetExtraProperties_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingReassignmentItemList + extraProps := obj.GetExtraProperties() + assert.Nil(t, extraProps, "nil receiver should return nil without panicking") + }) +} + +func TestExtraPropertiesSchedulingReassignmentList(t *testing.T) { + t.Run("GetExtraProperties", func(t *testing.T) { + t.Parallel() + obj := &SchedulingReassignmentList{} + // Should not panic when calling GetExtraProperties() + defer func() { + if r := recover(); r != nil { + t.Errorf("GetExtraProperties() panicked: %v", r) + } + }() + extraProps := obj.GetExtraProperties() + // Result can be nil or an empty/non-empty map + _ = extraProps + }) + + t.Run("GetExtraProperties_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingReassignmentList + extraProps := obj.GetExtraProperties() + assert.Nil(t, extraProps, "nil receiver should return nil without panicking") + }) +} + +func TestExtraPropertiesSchedulingReassignmentPreview(t *testing.T) { + t.Run("GetExtraProperties", func(t *testing.T) { + t.Parallel() + obj := &SchedulingReassignmentPreview{} + // Should not panic when calling GetExtraProperties() + defer func() { + if r := recover(); r != nil { + t.Errorf("GetExtraProperties() panicked: %v", r) + } + }() + extraProps := obj.GetExtraProperties() + // Result can be nil or an empty/non-empty map + _ = extraProps + }) + + t.Run("GetExtraProperties_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingReassignmentPreview + extraProps := obj.GetExtraProperties() + assert.Nil(t, extraProps, "nil receiver should return nil without panicking") + }) +} + +func TestExtraPropertiesSchedulingReassignmentPreviewItemsItem(t *testing.T) { + t.Run("GetExtraProperties", func(t *testing.T) { + t.Parallel() + obj := &SchedulingReassignmentPreviewItemsItem{} + // Should not panic when calling GetExtraProperties() + defer func() { + if r := recover(); r != nil { + t.Errorf("GetExtraProperties() panicked: %v", r) + } + }() + extraProps := obj.GetExtraProperties() + // Result can be nil or an empty/non-empty map + _ = extraProps + }) + + t.Run("GetExtraProperties_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingReassignmentPreviewItemsItem + extraProps := obj.GetExtraProperties() + assert.Nil(t, extraProps, "nil receiver should return nil without panicking") + }) +} + +func TestExtraPropertiesSchedulingReassignmentSelection(t *testing.T) { + t.Run("GetExtraProperties", func(t *testing.T) { + t.Parallel() + obj := &SchedulingReassignmentSelection{} + // Should not panic when calling GetExtraProperties() + defer func() { + if r := recover(); r != nil { + t.Errorf("GetExtraProperties() panicked: %v", r) + } + }() + extraProps := obj.GetExtraProperties() + // Result can be nil or an empty/non-empty map + _ = extraProps + }) + + t.Run("GetExtraProperties_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingReassignmentSelection + extraProps := obj.GetExtraProperties() + assert.Nil(t, extraProps, "nil receiver should return nil without panicking") + }) +} + +func TestExtraPropertiesSchedulingReassignmentStrategy(t *testing.T) { + t.Run("GetExtraProperties", func(t *testing.T) { + t.Parallel() + obj := &SchedulingReassignmentStrategy{} + // Should not panic when calling GetExtraProperties() + defer func() { + if r := recover(); r != nil { + t.Errorf("GetExtraProperties() panicked: %v", r) + } + }() + extraProps := obj.GetExtraProperties() + // Result can be nil or an empty/non-empty map + _ = extraProps + }) + + t.Run("GetExtraProperties_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingReassignmentStrategy + extraProps := obj.GetExtraProperties() + assert.Nil(t, extraProps, "nil receiver should return nil without panicking") + }) +} + +func TestExtraPropertiesSchedulingReassignmentStrategyAssignmentsItem(t *testing.T) { + t.Run("GetExtraProperties", func(t *testing.T) { + t.Parallel() + obj := &SchedulingReassignmentStrategyAssignmentsItem{} + // Should not panic when calling GetExtraProperties() + defer func() { + if r := recover(); r != nil { + t.Errorf("GetExtraProperties() panicked: %v", r) + } + }() + extraProps := obj.GetExtraProperties() + // Result can be nil or an empty/non-empty map + _ = extraProps + }) + + t.Run("GetExtraProperties_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingReassignmentStrategyAssignmentsItem + extraProps := obj.GetExtraProperties() + assert.Nil(t, extraProps, "nil receiver should return nil without panicking") + }) +} + func TestExtraPropertiesSchedulingReminder(t *testing.T) { t.Run("GetExtraProperties", func(t *testing.T) { t.Parallel() @@ -175322,6 +192007,29 @@ func TestExtraPropertiesSchedulingSettingsNotificationsValue(t *testing.T) { }) } +func TestExtraPropertiesSchedulingSettingsOutOfOfficeReasonsItem(t *testing.T) { + t.Run("GetExtraProperties", func(t *testing.T) { + t.Parallel() + obj := &SchedulingSettingsOutOfOfficeReasonsItem{} + // Should not panic when calling GetExtraProperties() + defer func() { + if r := recover(); r != nil { + t.Errorf("GetExtraProperties() panicked: %v", r) + } + }() + extraProps := obj.GetExtraProperties() + // Result can be nil or an empty/non-empty map + _ = extraProps + }) + + t.Run("GetExtraProperties_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingSettingsOutOfOfficeReasonsItem + extraProps := obj.GetExtraProperties() + assert.Nil(t, extraProps, "nil receiver should return nil without panicking") + }) +} + func TestExtraPropertiesSchedulingSlot(t *testing.T) { t.Run("GetExtraProperties", func(t *testing.T) { t.Parallel() diff --git a/sdks/go/webhook_endpoints.go b/sdks/go/webhook_endpoints.go index c43f9e5a4..9d3514cf4 100644 --- a/sdks/go/webhook_endpoints.go +++ b/sdks/go/webhook_endpoints.go @@ -1561,6 +1561,7 @@ const ( CreateWebhookEndpointRequestEventTypesItemSchedulingBookingExternalConflict CreateWebhookEndpointRequestEventTypesItem = "scheduling.booking.external_conflict" CreateWebhookEndpointRequestEventTypesItemSchedulingBookingCalendarWriteFailed CreateWebhookEndpointRequestEventTypesItem = "scheduling.booking.calendar_write_failed" CreateWebhookEndpointRequestEventTypesItemSchedulingBookingLocationReady CreateWebhookEndpointRequestEventTypesItem = "scheduling.booking.location_ready" + CreateWebhookEndpointRequestEventTypesItemSchedulingBookingReassigned CreateWebhookEndpointRequestEventTypesItem = "scheduling.booking.reassigned" CreateWebhookEndpointRequestEventTypesItemSchedulingBookingStarted CreateWebhookEndpointRequestEventTypesItem = "scheduling.booking.started" CreateWebhookEndpointRequestEventTypesItemSchedulingBookingEnded CreateWebhookEndpointRequestEventTypesItem = "scheduling.booking.ended" CreateWebhookEndpointRequestEventTypesItemSchedulingBookingReminder CreateWebhookEndpointRequestEventTypesItem = "scheduling.booking.reminder" @@ -1569,6 +1570,14 @@ const ( CreateWebhookEndpointRequestEventTypesItemSchedulingCalendarDisconnected CreateWebhookEndpointRequestEventTypesItem = "scheduling.calendar.disconnected" CreateWebhookEndpointRequestEventTypesItemSchedulingCalendarDelegationFailing CreateWebhookEndpointRequestEventTypesItem = "scheduling.calendar_delegation.failing" CreateWebhookEndpointRequestEventTypesItemSchedulingCalendarDelegationRestored CreateWebhookEndpointRequestEventTypesItem = "scheduling.calendar_delegation.restored" + CreateWebhookEndpointRequestEventTypesItemSchedulingOutOfOfficeCreated CreateWebhookEndpointRequestEventTypesItem = "scheduling.out_of_office.created" + CreateWebhookEndpointRequestEventTypesItemSchedulingOutOfOfficeUpdated CreateWebhookEndpointRequestEventTypesItem = "scheduling.out_of_office.updated" + CreateWebhookEndpointRequestEventTypesItemSchedulingOutOfOfficeDeleted CreateWebhookEndpointRequestEventTypesItem = "scheduling.out_of_office.deleted" + CreateWebhookEndpointRequestEventTypesItemSchedulingOutOfOfficeStarted CreateWebhookEndpointRequestEventTypesItem = "scheduling.out_of_office.started" + CreateWebhookEndpointRequestEventTypesItemSchedulingOutOfOfficeEnded CreateWebhookEndpointRequestEventTypesItem = "scheduling.out_of_office.ended" + CreateWebhookEndpointRequestEventTypesItemSchedulingReassignmentCompleted CreateWebhookEndpointRequestEventTypesItem = "scheduling.reassignment.completed" + CreateWebhookEndpointRequestEventTypesItemSchedulingOauthAppFailing CreateWebhookEndpointRequestEventTypesItem = "scheduling.oauth_app.failing" + CreateWebhookEndpointRequestEventTypesItemSchedulingOauthAppRestored CreateWebhookEndpointRequestEventTypesItem = "scheduling.oauth_app.restored" ) func NewCreateWebhookEndpointRequestEventTypesItemFromString(s string) (CreateWebhookEndpointRequestEventTypesItem, error) { @@ -1739,6 +1748,8 @@ func NewCreateWebhookEndpointRequestEventTypesItemFromString(s string) (CreateWe return CreateWebhookEndpointRequestEventTypesItemSchedulingBookingCalendarWriteFailed, nil case "scheduling.booking.location_ready": return CreateWebhookEndpointRequestEventTypesItemSchedulingBookingLocationReady, nil + case "scheduling.booking.reassigned": + return CreateWebhookEndpointRequestEventTypesItemSchedulingBookingReassigned, nil case "scheduling.booking.started": return CreateWebhookEndpointRequestEventTypesItemSchedulingBookingStarted, nil case "scheduling.booking.ended": @@ -1755,6 +1766,22 @@ func NewCreateWebhookEndpointRequestEventTypesItemFromString(s string) (CreateWe return CreateWebhookEndpointRequestEventTypesItemSchedulingCalendarDelegationFailing, nil case "scheduling.calendar_delegation.restored": return CreateWebhookEndpointRequestEventTypesItemSchedulingCalendarDelegationRestored, nil + case "scheduling.out_of_office.created": + return CreateWebhookEndpointRequestEventTypesItemSchedulingOutOfOfficeCreated, nil + case "scheduling.out_of_office.updated": + return CreateWebhookEndpointRequestEventTypesItemSchedulingOutOfOfficeUpdated, nil + case "scheduling.out_of_office.deleted": + return CreateWebhookEndpointRequestEventTypesItemSchedulingOutOfOfficeDeleted, nil + case "scheduling.out_of_office.started": + return CreateWebhookEndpointRequestEventTypesItemSchedulingOutOfOfficeStarted, nil + case "scheduling.out_of_office.ended": + return CreateWebhookEndpointRequestEventTypesItemSchedulingOutOfOfficeEnded, nil + case "scheduling.reassignment.completed": + return CreateWebhookEndpointRequestEventTypesItemSchedulingReassignmentCompleted, nil + case "scheduling.oauth_app.failing": + return CreateWebhookEndpointRequestEventTypesItemSchedulingOauthAppFailing, nil + case "scheduling.oauth_app.restored": + return CreateWebhookEndpointRequestEventTypesItemSchedulingOauthAppRestored, nil } var t CreateWebhookEndpointRequestEventTypesItem return "", fmt.Errorf("%s is not a valid %T", s, t) @@ -1870,6 +1897,7 @@ const ( UpdateWebhookEndpointRequestEventTypesItemSchedulingBookingExternalConflict UpdateWebhookEndpointRequestEventTypesItem = "scheduling.booking.external_conflict" UpdateWebhookEndpointRequestEventTypesItemSchedulingBookingCalendarWriteFailed UpdateWebhookEndpointRequestEventTypesItem = "scheduling.booking.calendar_write_failed" UpdateWebhookEndpointRequestEventTypesItemSchedulingBookingLocationReady UpdateWebhookEndpointRequestEventTypesItem = "scheduling.booking.location_ready" + UpdateWebhookEndpointRequestEventTypesItemSchedulingBookingReassigned UpdateWebhookEndpointRequestEventTypesItem = "scheduling.booking.reassigned" UpdateWebhookEndpointRequestEventTypesItemSchedulingBookingStarted UpdateWebhookEndpointRequestEventTypesItem = "scheduling.booking.started" UpdateWebhookEndpointRequestEventTypesItemSchedulingBookingEnded UpdateWebhookEndpointRequestEventTypesItem = "scheduling.booking.ended" UpdateWebhookEndpointRequestEventTypesItemSchedulingBookingReminder UpdateWebhookEndpointRequestEventTypesItem = "scheduling.booking.reminder" @@ -1878,6 +1906,14 @@ const ( UpdateWebhookEndpointRequestEventTypesItemSchedulingCalendarDisconnected UpdateWebhookEndpointRequestEventTypesItem = "scheduling.calendar.disconnected" UpdateWebhookEndpointRequestEventTypesItemSchedulingCalendarDelegationFailing UpdateWebhookEndpointRequestEventTypesItem = "scheduling.calendar_delegation.failing" UpdateWebhookEndpointRequestEventTypesItemSchedulingCalendarDelegationRestored UpdateWebhookEndpointRequestEventTypesItem = "scheduling.calendar_delegation.restored" + UpdateWebhookEndpointRequestEventTypesItemSchedulingOutOfOfficeCreated UpdateWebhookEndpointRequestEventTypesItem = "scheduling.out_of_office.created" + UpdateWebhookEndpointRequestEventTypesItemSchedulingOutOfOfficeUpdated UpdateWebhookEndpointRequestEventTypesItem = "scheduling.out_of_office.updated" + UpdateWebhookEndpointRequestEventTypesItemSchedulingOutOfOfficeDeleted UpdateWebhookEndpointRequestEventTypesItem = "scheduling.out_of_office.deleted" + UpdateWebhookEndpointRequestEventTypesItemSchedulingOutOfOfficeStarted UpdateWebhookEndpointRequestEventTypesItem = "scheduling.out_of_office.started" + UpdateWebhookEndpointRequestEventTypesItemSchedulingOutOfOfficeEnded UpdateWebhookEndpointRequestEventTypesItem = "scheduling.out_of_office.ended" + UpdateWebhookEndpointRequestEventTypesItemSchedulingReassignmentCompleted UpdateWebhookEndpointRequestEventTypesItem = "scheduling.reassignment.completed" + UpdateWebhookEndpointRequestEventTypesItemSchedulingOauthAppFailing UpdateWebhookEndpointRequestEventTypesItem = "scheduling.oauth_app.failing" + UpdateWebhookEndpointRequestEventTypesItemSchedulingOauthAppRestored UpdateWebhookEndpointRequestEventTypesItem = "scheduling.oauth_app.restored" ) func NewUpdateWebhookEndpointRequestEventTypesItemFromString(s string) (UpdateWebhookEndpointRequestEventTypesItem, error) { @@ -2048,6 +2084,8 @@ func NewUpdateWebhookEndpointRequestEventTypesItemFromString(s string) (UpdateWe return UpdateWebhookEndpointRequestEventTypesItemSchedulingBookingCalendarWriteFailed, nil case "scheduling.booking.location_ready": return UpdateWebhookEndpointRequestEventTypesItemSchedulingBookingLocationReady, nil + case "scheduling.booking.reassigned": + return UpdateWebhookEndpointRequestEventTypesItemSchedulingBookingReassigned, nil case "scheduling.booking.started": return UpdateWebhookEndpointRequestEventTypesItemSchedulingBookingStarted, nil case "scheduling.booking.ended": @@ -2064,6 +2102,22 @@ func NewUpdateWebhookEndpointRequestEventTypesItemFromString(s string) (UpdateWe return UpdateWebhookEndpointRequestEventTypesItemSchedulingCalendarDelegationFailing, nil case "scheduling.calendar_delegation.restored": return UpdateWebhookEndpointRequestEventTypesItemSchedulingCalendarDelegationRestored, nil + case "scheduling.out_of_office.created": + return UpdateWebhookEndpointRequestEventTypesItemSchedulingOutOfOfficeCreated, nil + case "scheduling.out_of_office.updated": + return UpdateWebhookEndpointRequestEventTypesItemSchedulingOutOfOfficeUpdated, nil + case "scheduling.out_of_office.deleted": + return UpdateWebhookEndpointRequestEventTypesItemSchedulingOutOfOfficeDeleted, nil + case "scheduling.out_of_office.started": + return UpdateWebhookEndpointRequestEventTypesItemSchedulingOutOfOfficeStarted, nil + case "scheduling.out_of_office.ended": + return UpdateWebhookEndpointRequestEventTypesItemSchedulingOutOfOfficeEnded, nil + case "scheduling.reassignment.completed": + return UpdateWebhookEndpointRequestEventTypesItemSchedulingReassignmentCompleted, nil + case "scheduling.oauth_app.failing": + return UpdateWebhookEndpointRequestEventTypesItemSchedulingOauthAppFailing, nil + case "scheduling.oauth_app.restored": + return UpdateWebhookEndpointRequestEventTypesItemSchedulingOauthAppRestored, nil } var t UpdateWebhookEndpointRequestEventTypesItem return "", fmt.Errorf("%s is not a valid %T", s, t) diff --git a/sdks/go/webhook_endpoints_test.go b/sdks/go/webhook_endpoints_test.go index 91de78120..572446f9c 100644 --- a/sdks/go/webhook_endpoints_test.go +++ b/sdks/go/webhook_endpoints_test.go @@ -4082,6 +4082,13 @@ func TestEnumCreateWebhookEndpointRequestEventTypesItem(t *testing.T) { assert.Equal(t, CreateWebhookEndpointRequestEventTypesItem("scheduling.booking.location_ready"), val, "enum value should match expected wire value") }) + t.Run("NewFromString_scheduling_booking_reassigned", func(t *testing.T) { + t.Parallel() + val, err := NewCreateWebhookEndpointRequestEventTypesItemFromString("scheduling.booking.reassigned") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, CreateWebhookEndpointRequestEventTypesItem("scheduling.booking.reassigned"), val, "enum value should match expected wire value") + }) + t.Run("NewFromString_scheduling_booking_started", func(t *testing.T) { t.Parallel() val, err := NewCreateWebhookEndpointRequestEventTypesItemFromString("scheduling.booking.started") @@ -4138,6 +4145,62 @@ func TestEnumCreateWebhookEndpointRequestEventTypesItem(t *testing.T) { assert.Equal(t, CreateWebhookEndpointRequestEventTypesItem("scheduling.calendar_delegation.restored"), val, "enum value should match expected wire value") }) + t.Run("NewFromString_scheduling_out_of_office_created", func(t *testing.T) { + t.Parallel() + val, err := NewCreateWebhookEndpointRequestEventTypesItemFromString("scheduling.out_of_office.created") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, CreateWebhookEndpointRequestEventTypesItem("scheduling.out_of_office.created"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_scheduling_out_of_office_updated", func(t *testing.T) { + t.Parallel() + val, err := NewCreateWebhookEndpointRequestEventTypesItemFromString("scheduling.out_of_office.updated") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, CreateWebhookEndpointRequestEventTypesItem("scheduling.out_of_office.updated"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_scheduling_out_of_office_deleted", func(t *testing.T) { + t.Parallel() + val, err := NewCreateWebhookEndpointRequestEventTypesItemFromString("scheduling.out_of_office.deleted") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, CreateWebhookEndpointRequestEventTypesItem("scheduling.out_of_office.deleted"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_scheduling_out_of_office_started", func(t *testing.T) { + t.Parallel() + val, err := NewCreateWebhookEndpointRequestEventTypesItemFromString("scheduling.out_of_office.started") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, CreateWebhookEndpointRequestEventTypesItem("scheduling.out_of_office.started"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_scheduling_out_of_office_ended", func(t *testing.T) { + t.Parallel() + val, err := NewCreateWebhookEndpointRequestEventTypesItemFromString("scheduling.out_of_office.ended") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, CreateWebhookEndpointRequestEventTypesItem("scheduling.out_of_office.ended"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_scheduling_reassignment_completed", func(t *testing.T) { + t.Parallel() + val, err := NewCreateWebhookEndpointRequestEventTypesItemFromString("scheduling.reassignment.completed") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, CreateWebhookEndpointRequestEventTypesItem("scheduling.reassignment.completed"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_scheduling_oauth_app_failing", func(t *testing.T) { + t.Parallel() + val, err := NewCreateWebhookEndpointRequestEventTypesItemFromString("scheduling.oauth_app.failing") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, CreateWebhookEndpointRequestEventTypesItem("scheduling.oauth_app.failing"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_scheduling_oauth_app_restored", func(t *testing.T) { + t.Parallel() + val, err := NewCreateWebhookEndpointRequestEventTypesItemFromString("scheduling.oauth_app.restored") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, CreateWebhookEndpointRequestEventTypesItem("scheduling.oauth_app.restored"), val, "enum value should match expected wire value") + }) + t.Run("NewFromString_Invalid", func(t *testing.T) { _, err := NewCreateWebhookEndpointRequestEventTypesItemFromString("invalid_value_that_does_not_exist") assert.Error(t, err) @@ -4778,6 +4841,13 @@ func TestEnumUpdateWebhookEndpointRequestEventTypesItem(t *testing.T) { assert.Equal(t, UpdateWebhookEndpointRequestEventTypesItem("scheduling.booking.location_ready"), val, "enum value should match expected wire value") }) + t.Run("NewFromString_scheduling_booking_reassigned", func(t *testing.T) { + t.Parallel() + val, err := NewUpdateWebhookEndpointRequestEventTypesItemFromString("scheduling.booking.reassigned") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, UpdateWebhookEndpointRequestEventTypesItem("scheduling.booking.reassigned"), val, "enum value should match expected wire value") + }) + t.Run("NewFromString_scheduling_booking_started", func(t *testing.T) { t.Parallel() val, err := NewUpdateWebhookEndpointRequestEventTypesItemFromString("scheduling.booking.started") @@ -4834,6 +4904,62 @@ func TestEnumUpdateWebhookEndpointRequestEventTypesItem(t *testing.T) { assert.Equal(t, UpdateWebhookEndpointRequestEventTypesItem("scheduling.calendar_delegation.restored"), val, "enum value should match expected wire value") }) + t.Run("NewFromString_scheduling_out_of_office_created", func(t *testing.T) { + t.Parallel() + val, err := NewUpdateWebhookEndpointRequestEventTypesItemFromString("scheduling.out_of_office.created") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, UpdateWebhookEndpointRequestEventTypesItem("scheduling.out_of_office.created"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_scheduling_out_of_office_updated", func(t *testing.T) { + t.Parallel() + val, err := NewUpdateWebhookEndpointRequestEventTypesItemFromString("scheduling.out_of_office.updated") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, UpdateWebhookEndpointRequestEventTypesItem("scheduling.out_of_office.updated"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_scheduling_out_of_office_deleted", func(t *testing.T) { + t.Parallel() + val, err := NewUpdateWebhookEndpointRequestEventTypesItemFromString("scheduling.out_of_office.deleted") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, UpdateWebhookEndpointRequestEventTypesItem("scheduling.out_of_office.deleted"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_scheduling_out_of_office_started", func(t *testing.T) { + t.Parallel() + val, err := NewUpdateWebhookEndpointRequestEventTypesItemFromString("scheduling.out_of_office.started") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, UpdateWebhookEndpointRequestEventTypesItem("scheduling.out_of_office.started"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_scheduling_out_of_office_ended", func(t *testing.T) { + t.Parallel() + val, err := NewUpdateWebhookEndpointRequestEventTypesItemFromString("scheduling.out_of_office.ended") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, UpdateWebhookEndpointRequestEventTypesItem("scheduling.out_of_office.ended"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_scheduling_reassignment_completed", func(t *testing.T) { + t.Parallel() + val, err := NewUpdateWebhookEndpointRequestEventTypesItemFromString("scheduling.reassignment.completed") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, UpdateWebhookEndpointRequestEventTypesItem("scheduling.reassignment.completed"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_scheduling_oauth_app_failing", func(t *testing.T) { + t.Parallel() + val, err := NewUpdateWebhookEndpointRequestEventTypesItemFromString("scheduling.oauth_app.failing") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, UpdateWebhookEndpointRequestEventTypesItem("scheduling.oauth_app.failing"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_scheduling_oauth_app_restored", func(t *testing.T) { + t.Parallel() + val, err := NewUpdateWebhookEndpointRequestEventTypesItemFromString("scheduling.oauth_app.restored") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, UpdateWebhookEndpointRequestEventTypesItem("scheduling.oauth_app.restored"), val, "enum value should match expected wire value") + }) + t.Run("NewFromString_Invalid", func(t *testing.T) { _, err := NewUpdateWebhookEndpointRequestEventTypesItemFromString("invalid_value_that_does_not_exist") assert.Error(t, err) diff --git a/sdks/go/webhook_events.go b/sdks/go/webhook_events.go index ee85edca2..82708d2b1 100644 --- a/sdks/go/webhook_events.go +++ b/sdks/go/webhook_events.go @@ -6261,17 +6261,19 @@ func (r RiskWebhookEventType) Ptr() *RiskWebhookEventType { } var ( - schedulingBookingWebhookDataFieldBookingID = big.NewInt(1 << 0) - schedulingBookingWebhookDataFieldEventTypeID = big.NewInt(1 << 1) - schedulingBookingWebhookDataFieldStatus = big.NewInt(1 << 2) - schedulingBookingWebhookDataFieldStart = big.NewInt(1 << 3) - schedulingBookingWebhookDataFieldEnd = big.NewInt(1 << 4) - schedulingBookingWebhookDataFieldHostIDs = big.NewInt(1 << 5) - schedulingBookingWebhookDataFieldAttendeeUIDs = big.NewInt(1 << 6) - schedulingBookingWebhookDataFieldSeriesID = big.NewInt(1 << 7) - schedulingBookingWebhookDataFieldPreviousStart = big.NewInt(1 << 8) - schedulingBookingWebhookDataFieldReminder = big.NewInt(1 << 9) - schedulingBookingWebhookDataFieldOccurredAt = big.NewInt(1 << 10) + schedulingBookingWebhookDataFieldBookingID = big.NewInt(1 << 0) + schedulingBookingWebhookDataFieldEventTypeID = big.NewInt(1 << 1) + schedulingBookingWebhookDataFieldStatus = big.NewInt(1 << 2) + schedulingBookingWebhookDataFieldStart = big.NewInt(1 << 3) + schedulingBookingWebhookDataFieldEnd = big.NewInt(1 << 4) + schedulingBookingWebhookDataFieldHostIDs = big.NewInt(1 << 5) + schedulingBookingWebhookDataFieldAttendeeUIDs = big.NewInt(1 << 6) + schedulingBookingWebhookDataFieldSeriesID = big.NewInt(1 << 7) + schedulingBookingWebhookDataFieldPreviousStart = big.NewInt(1 << 8) + schedulingBookingWebhookDataFieldPreviousHostIDs = big.NewInt(1 << 9) + schedulingBookingWebhookDataFieldReassignmentID = big.NewInt(1 << 10) + schedulingBookingWebhookDataFieldReminder = big.NewInt(1 << 11) + schedulingBookingWebhookDataFieldOccurredAt = big.NewInt(1 << 12) ) // schedulingBookingWebhookDataNullableFields maps the wire names of SchedulingBookingWebhookData's nullable fields (required or optional) to their field bits. @@ -6299,6 +6301,10 @@ type SchedulingBookingWebhookData struct { SeriesID *string `json:"series_id,omitempty" url:"series_id,omitempty"` // `scheduling.booking.rescheduled`: when it used to start. PreviousStart *string `json:"previous_start,omitempty" url:"previous_start,omitempty"` + // On `scheduling.booking.reassigned`: who had it before. + PreviousHostIDs []string `json:"previous_host_ids,omitempty" url:"previous_host_ids,omitempty"` + // On `scheduling.booking.reassigned`: the bulk reassignment it was part of. + ReassignmentID *string `json:"reassignment_id,omitempty" url:"reassignment_id,omitempty"` // `scheduling.booking.reminder`: which reminder this is. Reminder *SchedulingBookingWebhookDataReminder `json:"reminder,omitempty" url:"reminder,omitempty"` // When this happened. @@ -6374,6 +6380,20 @@ func (s *SchedulingBookingWebhookData) GetPreviousStart() *string { return s.PreviousStart } +func (s *SchedulingBookingWebhookData) GetPreviousHostIDs() []string { + if s == nil { + return nil + } + return s.PreviousHostIDs +} + +func (s *SchedulingBookingWebhookData) GetReassignmentID() *string { + if s == nil { + return nil + } + return s.ReassignmentID +} + func (s *SchedulingBookingWebhookData) GetReminder() *SchedulingBookingWebhookDataReminder { if s == nil { return nil @@ -6467,6 +6487,20 @@ func (s *SchedulingBookingWebhookData) SetPreviousStart(previousStart *string) { s.require(schedulingBookingWebhookDataFieldPreviousStart) } +// SetPreviousHostIDs sets the PreviousHostIDs field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingBookingWebhookData) SetPreviousHostIDs(previousHostIDs []string) { + s.PreviousHostIDs = previousHostIDs + s.require(schedulingBookingWebhookDataFieldPreviousHostIDs) +} + +// SetReassignmentID sets the ReassignmentID field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingBookingWebhookData) SetReassignmentID(reassignmentID *string) { + s.ReassignmentID = reassignmentID + s.require(schedulingBookingWebhookDataFieldReassignmentID) +} + // SetReminder sets the Reminder field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. func (s *SchedulingBookingWebhookData) SetReminder(reminder *SchedulingBookingWebhookDataReminder) { @@ -6983,6 +7017,7 @@ const ( SchedulingBookingWebhookEventTypeSchedulingBookingExternalConflict SchedulingBookingWebhookEventType = "scheduling.booking.external_conflict" SchedulingBookingWebhookEventTypeSchedulingBookingCalendarWriteFailed SchedulingBookingWebhookEventType = "scheduling.booking.calendar_write_failed" SchedulingBookingWebhookEventTypeSchedulingBookingLocationReady SchedulingBookingWebhookEventType = "scheduling.booking.location_ready" + SchedulingBookingWebhookEventTypeSchedulingBookingReassigned SchedulingBookingWebhookEventType = "scheduling.booking.reassigned" SchedulingBookingWebhookEventTypeSchedulingBookingStarted SchedulingBookingWebhookEventType = "scheduling.booking.started" SchedulingBookingWebhookEventTypeSchedulingBookingEnded SchedulingBookingWebhookEventType = "scheduling.booking.ended" SchedulingBookingWebhookEventTypeSchedulingBookingReminder SchedulingBookingWebhookEventType = "scheduling.booking.reminder" @@ -7010,6 +7045,8 @@ func NewSchedulingBookingWebhookEventTypeFromString(s string) (SchedulingBooking return SchedulingBookingWebhookEventTypeSchedulingBookingCalendarWriteFailed, nil case "scheduling.booking.location_ready": return SchedulingBookingWebhookEventTypeSchedulingBookingLocationReady, nil + case "scheduling.booking.reassigned": + return SchedulingBookingWebhookEventTypeSchedulingBookingReassigned, nil case "scheduling.booking.started": return SchedulingBookingWebhookEventTypeSchedulingBookingStarted, nil case "scheduling.booking.ended": @@ -7435,56 +7472,1357 @@ type SchedulingCalendarWebhookEvent struct { rawJSON json.RawMessage } -func (s *SchedulingCalendarWebhookEvent) GetID() string { +func (s *SchedulingCalendarWebhookEvent) GetID() string { + if s == nil { + return "" + } + return s.ID +} + +func (s *SchedulingCalendarWebhookEvent) GetObject() SchedulingCalendarWebhookEventObject { + if s == nil { + return "" + } + return s.Object +} + +func (s *SchedulingCalendarWebhookEvent) GetAPIVersion() string { + if s == nil { + return "" + } + return s.APIVersion +} + +func (s *SchedulingCalendarWebhookEvent) GetCreatedAt() time.Time { + if s == nil { + return time.Time{} + } + return s.CreatedAt +} + +func (s *SchedulingCalendarWebhookEvent) GetType() SchedulingCalendarWebhookEventType { + if s == nil { + return "" + } + return s.Type +} + +func (s *SchedulingCalendarWebhookEvent) GetData() *SchedulingCalendarWebhookEventData { + if s == nil { + return nil + } + return s.Data +} + +func (s *SchedulingCalendarWebhookEvent) GetExtraProperties() map[string]interface{} { + if s == nil { + return nil + } + return s.extraProperties +} + +func (s *SchedulingCalendarWebhookEvent) require(field *big.Int) { + next := new(big.Int) + if s.explicitFields != nil { + next.Set(s.explicitFields) + } + next.Or(next, field) + s.explicitFields = next +} + +// SetID sets the ID field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingCalendarWebhookEvent) SetID(id string) { + s.ID = id + s.require(schedulingCalendarWebhookEventFieldID) +} + +// SetObject sets the Object field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingCalendarWebhookEvent) SetObject(object SchedulingCalendarWebhookEventObject) { + s.Object = object + s.require(schedulingCalendarWebhookEventFieldObject) +} + +// SetAPIVersion sets the APIVersion field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingCalendarWebhookEvent) SetAPIVersion(apiVersion string) { + s.APIVersion = apiVersion + s.require(schedulingCalendarWebhookEventFieldAPIVersion) +} + +// SetCreatedAt sets the CreatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingCalendarWebhookEvent) SetCreatedAt(createdAt time.Time) { + s.CreatedAt = createdAt + s.require(schedulingCalendarWebhookEventFieldCreatedAt) +} + +// SetType sets the Type field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingCalendarWebhookEvent) SetType(type_ SchedulingCalendarWebhookEventType) { + s.Type = type_ + s.require(schedulingCalendarWebhookEventFieldType) +} + +// SetData sets the Data field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingCalendarWebhookEvent) SetData(data *SchedulingCalendarWebhookEventData) { + s.Data = data + s.require(schedulingCalendarWebhookEventFieldData) +} + +func (s *SchedulingCalendarWebhookEvent) UnmarshalJSON(data []byte) error { + type embed SchedulingCalendarWebhookEvent + var unmarshaler = struct { + embed + CreatedAt *internal.DateTime `json:"created_at"` + }{ + embed: embed(*s), + } + if err := json.Unmarshal(data, &unmarshaler); err != nil { + return err + } + *s = SchedulingCalendarWebhookEvent(unmarshaler.embed) + s.CreatedAt = unmarshaler.CreatedAt.Time() + extraProperties, err := internal.ExtractExtraProperties(data, *s) + if err != nil { + return err + } + s.extraProperties = extraProperties + s.rawJSON = json.RawMessage(data) + return nil +} + +func (s *SchedulingCalendarWebhookEvent) MarshalJSON() ([]byte, error) { + type embed SchedulingCalendarWebhookEvent + var marshaler = struct { + embed + CreatedAt *internal.DateTime `json:"created_at"` + }{ + embed: embed(*s), + CreatedAt: internal.NewDateTime(s.CreatedAt), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, s.explicitFields) + return json.Marshal(explicitMarshaler) +} + +func (s *SchedulingCalendarWebhookEvent) String() string { + if s == nil { + return "" + } + if len(s.rawJSON) > 0 { + if value, err := internal.StringifyJSON(s.rawJSON); err == nil { + return value + } + } + if value, err := internal.StringifyJSON(s); err == nil { + return value + } + return fmt.Sprintf("%#v", s) +} + +var ( + schedulingCalendarWebhookEventDataFieldHostID = big.NewInt(1 << 0) + schedulingCalendarWebhookEventDataFieldConnectionID = big.NewInt(1 << 1) + schedulingCalendarWebhookEventDataFieldProvider = big.NewInt(1 << 2) + schedulingCalendarWebhookEventDataFieldOccurredAt = big.NewInt(1 << 3) +) + +// The host and calendar connection this is about. +type SchedulingCalendarWebhookEventData struct { + // The host's id. + HostID string `json:"host_id" url:"host_id"` + // The calendar connection's id. + ConnectionID string `json:"connection_id" url:"connection_id"` + // The calendar provider, such as `google`. + Provider string `json:"provider" url:"provider"` + // When this happened. + OccurredAt string `json:"occurred_at" url:"occurred_at"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + + extraProperties map[string]interface{} + rawJSON json.RawMessage +} + +func (s *SchedulingCalendarWebhookEventData) GetHostID() string { + if s == nil { + return "" + } + return s.HostID +} + +func (s *SchedulingCalendarWebhookEventData) GetConnectionID() string { + if s == nil { + return "" + } + return s.ConnectionID +} + +func (s *SchedulingCalendarWebhookEventData) GetProvider() string { + if s == nil { + return "" + } + return s.Provider +} + +func (s *SchedulingCalendarWebhookEventData) GetOccurredAt() string { + if s == nil { + return "" + } + return s.OccurredAt +} + +func (s *SchedulingCalendarWebhookEventData) GetExtraProperties() map[string]interface{} { + if s == nil { + return nil + } + return s.extraProperties +} + +func (s *SchedulingCalendarWebhookEventData) require(field *big.Int) { + next := new(big.Int) + if s.explicitFields != nil { + next.Set(s.explicitFields) + } + next.Or(next, field) + s.explicitFields = next +} + +// SetHostID sets the HostID field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingCalendarWebhookEventData) SetHostID(hostID string) { + s.HostID = hostID + s.require(schedulingCalendarWebhookEventDataFieldHostID) +} + +// SetConnectionID sets the ConnectionID field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingCalendarWebhookEventData) SetConnectionID(connectionID string) { + s.ConnectionID = connectionID + s.require(schedulingCalendarWebhookEventDataFieldConnectionID) +} + +// SetProvider sets the Provider field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingCalendarWebhookEventData) SetProvider(provider string) { + s.Provider = provider + s.require(schedulingCalendarWebhookEventDataFieldProvider) +} + +// SetOccurredAt sets the OccurredAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingCalendarWebhookEventData) SetOccurredAt(occurredAt string) { + s.OccurredAt = occurredAt + s.require(schedulingCalendarWebhookEventDataFieldOccurredAt) +} + +func (s *SchedulingCalendarWebhookEventData) UnmarshalJSON(data []byte) error { + type unmarshaler SchedulingCalendarWebhookEventData + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *s = SchedulingCalendarWebhookEventData(value) + extraProperties, err := internal.ExtractExtraProperties(data, *s) + if err != nil { + return err + } + s.extraProperties = extraProperties + s.rawJSON = json.RawMessage(data) + return nil +} + +func (s *SchedulingCalendarWebhookEventData) MarshalJSON() ([]byte, error) { + type embed SchedulingCalendarWebhookEventData + var marshaler = struct { + embed + }{ + embed: embed(*s), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, s.explicitFields) + return json.Marshal(explicitMarshaler) +} + +func (s *SchedulingCalendarWebhookEventData) String() string { + if s == nil { + return "" + } + if len(s.rawJSON) > 0 { + if value, err := internal.StringifyJSON(s.rawJSON); err == nil { + return value + } + } + if value, err := internal.StringifyJSON(s); err == nil { + return value + } + return fmt.Sprintf("%#v", s) +} + +type SchedulingCalendarWebhookEventObject string + +const ( + SchedulingCalendarWebhookEventObjectEvent SchedulingCalendarWebhookEventObject = "event" +) + +func NewSchedulingCalendarWebhookEventObjectFromString(s string) (SchedulingCalendarWebhookEventObject, error) { + switch s { + case "event": + return SchedulingCalendarWebhookEventObjectEvent, nil + } + var t SchedulingCalendarWebhookEventObject + return "", fmt.Errorf("%s is not a valid %T", s, t) +} + +func (s SchedulingCalendarWebhookEventObject) Ptr() *SchedulingCalendarWebhookEventObject { + return &s +} + +// `connected`: a calendar account was connected. `needs_reauth`: access was lost, and the host isn't offered until it's back. `disconnected`: the connection was removed. +type SchedulingCalendarWebhookEventType string + +const ( + SchedulingCalendarWebhookEventTypeSchedulingCalendarConnected SchedulingCalendarWebhookEventType = "scheduling.calendar.connected" + SchedulingCalendarWebhookEventTypeSchedulingCalendarNeedsReauth SchedulingCalendarWebhookEventType = "scheduling.calendar.needs_reauth" + SchedulingCalendarWebhookEventTypeSchedulingCalendarDisconnected SchedulingCalendarWebhookEventType = "scheduling.calendar.disconnected" +) + +func NewSchedulingCalendarWebhookEventTypeFromString(s string) (SchedulingCalendarWebhookEventType, error) { + switch s { + case "scheduling.calendar.connected": + return SchedulingCalendarWebhookEventTypeSchedulingCalendarConnected, nil + case "scheduling.calendar.needs_reauth": + return SchedulingCalendarWebhookEventTypeSchedulingCalendarNeedsReauth, nil + case "scheduling.calendar.disconnected": + return SchedulingCalendarWebhookEventTypeSchedulingCalendarDisconnected, nil + } + var t SchedulingCalendarWebhookEventType + return "", fmt.Errorf("%s is not a valid %T", s, t) +} + +func (s SchedulingCalendarWebhookEventType) Ptr() *SchedulingCalendarWebhookEventType { + return &s +} + +var ( + schedulingOauthAppWebhookEventFieldID = big.NewInt(1 << 0) + schedulingOauthAppWebhookEventFieldObject = big.NewInt(1 << 1) + schedulingOauthAppWebhookEventFieldAPIVersion = big.NewInt(1 << 2) + schedulingOauthAppWebhookEventFieldCreatedAt = big.NewInt(1 << 3) + schedulingOauthAppWebhookEventFieldType = big.NewInt(1 << 4) + schedulingOauthAppWebhookEventFieldData = big.NewInt(1 << 5) +) + +type SchedulingOauthAppWebhookEvent struct { + // The event id. + ID string `json:"id" url:"id"` + Object SchedulingOauthAppWebhookEventObject `json:"object" url:"object"` + // The API version this payload is rendered in: the endpoint's. + APIVersion string `json:"api_version" url:"api_version"` + // When the event was created. + CreatedAt time.Time `json:"created_at" url:"created_at"` + Type SchedulingOauthAppWebhookEventType `json:"type" url:"type"` + Data *SchedulingOauthAppWebhookEventData `json:"data" url:"data"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + + extraProperties map[string]interface{} + rawJSON json.RawMessage +} + +func (s *SchedulingOauthAppWebhookEvent) GetID() string { + if s == nil { + return "" + } + return s.ID +} + +func (s *SchedulingOauthAppWebhookEvent) GetObject() SchedulingOauthAppWebhookEventObject { + if s == nil { + return "" + } + return s.Object +} + +func (s *SchedulingOauthAppWebhookEvent) GetAPIVersion() string { + if s == nil { + return "" + } + return s.APIVersion +} + +func (s *SchedulingOauthAppWebhookEvent) GetCreatedAt() time.Time { + if s == nil { + return time.Time{} + } + return s.CreatedAt +} + +func (s *SchedulingOauthAppWebhookEvent) GetType() SchedulingOauthAppWebhookEventType { + if s == nil { + return "" + } + return s.Type +} + +func (s *SchedulingOauthAppWebhookEvent) GetData() *SchedulingOauthAppWebhookEventData { + if s == nil { + return nil + } + return s.Data +} + +func (s *SchedulingOauthAppWebhookEvent) GetExtraProperties() map[string]interface{} { + if s == nil { + return nil + } + return s.extraProperties +} + +func (s *SchedulingOauthAppWebhookEvent) require(field *big.Int) { + next := new(big.Int) + if s.explicitFields != nil { + next.Set(s.explicitFields) + } + next.Or(next, field) + s.explicitFields = next +} + +// SetID sets the ID field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingOauthAppWebhookEvent) SetID(id string) { + s.ID = id + s.require(schedulingOauthAppWebhookEventFieldID) +} + +// SetObject sets the Object field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingOauthAppWebhookEvent) SetObject(object SchedulingOauthAppWebhookEventObject) { + s.Object = object + s.require(schedulingOauthAppWebhookEventFieldObject) +} + +// SetAPIVersion sets the APIVersion field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingOauthAppWebhookEvent) SetAPIVersion(apiVersion string) { + s.APIVersion = apiVersion + s.require(schedulingOauthAppWebhookEventFieldAPIVersion) +} + +// SetCreatedAt sets the CreatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingOauthAppWebhookEvent) SetCreatedAt(createdAt time.Time) { + s.CreatedAt = createdAt + s.require(schedulingOauthAppWebhookEventFieldCreatedAt) +} + +// SetType sets the Type field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingOauthAppWebhookEvent) SetType(type_ SchedulingOauthAppWebhookEventType) { + s.Type = type_ + s.require(schedulingOauthAppWebhookEventFieldType) +} + +// SetData sets the Data field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingOauthAppWebhookEvent) SetData(data *SchedulingOauthAppWebhookEventData) { + s.Data = data + s.require(schedulingOauthAppWebhookEventFieldData) +} + +func (s *SchedulingOauthAppWebhookEvent) UnmarshalJSON(data []byte) error { + type embed SchedulingOauthAppWebhookEvent + var unmarshaler = struct { + embed + CreatedAt *internal.DateTime `json:"created_at"` + }{ + embed: embed(*s), + } + if err := json.Unmarshal(data, &unmarshaler); err != nil { + return err + } + *s = SchedulingOauthAppWebhookEvent(unmarshaler.embed) + s.CreatedAt = unmarshaler.CreatedAt.Time() + extraProperties, err := internal.ExtractExtraProperties(data, *s) + if err != nil { + return err + } + s.extraProperties = extraProperties + s.rawJSON = json.RawMessage(data) + return nil +} + +func (s *SchedulingOauthAppWebhookEvent) MarshalJSON() ([]byte, error) { + type embed SchedulingOauthAppWebhookEvent + var marshaler = struct { + embed + CreatedAt *internal.DateTime `json:"created_at"` + }{ + embed: embed(*s), + CreatedAt: internal.NewDateTime(s.CreatedAt), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, s.explicitFields) + return json.Marshal(explicitMarshaler) +} + +func (s *SchedulingOauthAppWebhookEvent) String() string { + if s == nil { + return "" + } + if len(s.rawJSON) > 0 { + if value, err := internal.StringifyJSON(s.rawJSON); err == nil { + return value + } + } + if value, err := internal.StringifyJSON(s); err == nil { + return value + } + return fmt.Sprintf("%#v", s) +} + +var ( + schedulingOauthAppWebhookEventDataFieldOauthAppID = big.NewInt(1 << 0) + schedulingOauthAppWebhookEventDataFieldProvider = big.NewInt(1 << 1) + schedulingOauthAppWebhookEventDataFieldCode = big.NewInt(1 << 2) + schedulingOauthAppWebhookEventDataFieldOccurredAt = big.NewInt(1 << 3) +) + +// schedulingOauthAppWebhookEventDataNullableFields maps the wire names of SchedulingOauthAppWebhookEventData's nullable fields (required or optional) to their field bits. +var schedulingOauthAppWebhookEventDataNullableFields = map[string]*big.Int{ + "code": schedulingOauthAppWebhookEventDataFieldCode, +} + +type SchedulingOauthAppWebhookEventData struct { + OauthAppID string `json:"oauth_app_id" url:"oauth_app_id"` + Provider string `json:"provider" url:"provider"` + // What the provider said, when it refused. + Code *string `json:"code,omitempty" url:"code,omitempty"` + OccurredAt string `json:"occurred_at" url:"occurred_at"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + + extraProperties map[string]interface{} + rawJSON json.RawMessage +} + +func (s *SchedulingOauthAppWebhookEventData) GetOauthAppID() string { + if s == nil { + return "" + } + return s.OauthAppID +} + +func (s *SchedulingOauthAppWebhookEventData) GetProvider() string { + if s == nil { + return "" + } + return s.Provider +} + +func (s *SchedulingOauthAppWebhookEventData) GetCode() *string { + if s == nil { + return nil + } + return s.Code +} + +func (s *SchedulingOauthAppWebhookEventData) GetOccurredAt() string { + if s == nil { + return "" + } + return s.OccurredAt +} + +func (s *SchedulingOauthAppWebhookEventData) GetExtraProperties() map[string]interface{} { + if s == nil { + return nil + } + return s.extraProperties +} + +func (s *SchedulingOauthAppWebhookEventData) require(field *big.Int) { + next := new(big.Int) + if s.explicitFields != nil { + next.Set(s.explicitFields) + } + next.Or(next, field) + s.explicitFields = next +} + +// SetOauthAppID sets the OauthAppID field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingOauthAppWebhookEventData) SetOauthAppID(oauthAppID string) { + s.OauthAppID = oauthAppID + s.require(schedulingOauthAppWebhookEventDataFieldOauthAppID) +} + +// SetProvider sets the Provider field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingOauthAppWebhookEventData) SetProvider(provider string) { + s.Provider = provider + s.require(schedulingOauthAppWebhookEventDataFieldProvider) +} + +// SetCode sets the Code field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingOauthAppWebhookEventData) SetCode(code *string) { + s.Code = code + s.require(schedulingOauthAppWebhookEventDataFieldCode) +} + +// SetOccurredAt sets the OccurredAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingOauthAppWebhookEventData) SetOccurredAt(occurredAt string) { + s.OccurredAt = occurredAt + s.require(schedulingOauthAppWebhookEventDataFieldOccurredAt) +} + +func (s *SchedulingOauthAppWebhookEventData) UnmarshalJSON(data []byte) error { + type unmarshaler SchedulingOauthAppWebhookEventData + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *s = SchedulingOauthAppWebhookEventData(value) + extraProperties, err := internal.ExtractExtraProperties(data, *s) + if err != nil { + return err + } + s.extraProperties = extraProperties + presentFields, err := internal.ExplicitFieldsFromJSON(data, schedulingOauthAppWebhookEventDataNullableFields) + if err != nil { + return err + } + if presentFields != nil { + s.require(presentFields) + } + s.rawJSON = json.RawMessage(data) + return nil +} + +func (s *SchedulingOauthAppWebhookEventData) MarshalJSON() ([]byte, error) { + type embed SchedulingOauthAppWebhookEventData + var marshaler = struct { + embed + }{ + embed: embed(*s), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, s.explicitFields) + return json.Marshal(explicitMarshaler) +} + +func (s *SchedulingOauthAppWebhookEventData) String() string { + if s == nil { + return "" + } + if len(s.rawJSON) > 0 { + if value, err := internal.StringifyJSON(s.rawJSON); err == nil { + return value + } + } + if value, err := internal.StringifyJSON(s); err == nil { + return value + } + return fmt.Sprintf("%#v", s) +} + +type SchedulingOauthAppWebhookEventObject string + +const ( + SchedulingOauthAppWebhookEventObjectEvent SchedulingOauthAppWebhookEventObject = "event" +) + +func NewSchedulingOauthAppWebhookEventObjectFromString(s string) (SchedulingOauthAppWebhookEventObject, error) { + switch s { + case "event": + return SchedulingOauthAppWebhookEventObjectEvent, nil + } + var t SchedulingOauthAppWebhookEventObject + return "", fmt.Errorf("%s is not a valid %T", s, t) +} + +func (s SchedulingOauthAppWebhookEventObject) Ptr() *SchedulingOauthAppWebhookEventObject { + return &s +} + +type SchedulingOauthAppWebhookEventType string + +const ( + SchedulingOauthAppWebhookEventTypeSchedulingOauthAppFailing SchedulingOauthAppWebhookEventType = "scheduling.oauth_app.failing" + SchedulingOauthAppWebhookEventTypeSchedulingOauthAppRestored SchedulingOauthAppWebhookEventType = "scheduling.oauth_app.restored" +) + +func NewSchedulingOauthAppWebhookEventTypeFromString(s string) (SchedulingOauthAppWebhookEventType, error) { + switch s { + case "scheduling.oauth_app.failing": + return SchedulingOauthAppWebhookEventTypeSchedulingOauthAppFailing, nil + case "scheduling.oauth_app.restored": + return SchedulingOauthAppWebhookEventTypeSchedulingOauthAppRestored, nil + } + var t SchedulingOauthAppWebhookEventType + return "", fmt.Errorf("%s is not a valid %T", s, t) +} + +func (s SchedulingOauthAppWebhookEventType) Ptr() *SchedulingOauthAppWebhookEventType { + return &s +} + +var ( + schedulingOutOfOfficeWebhookEventFieldID = big.NewInt(1 << 0) + schedulingOutOfOfficeWebhookEventFieldObject = big.NewInt(1 << 1) + schedulingOutOfOfficeWebhookEventFieldAPIVersion = big.NewInt(1 << 2) + schedulingOutOfOfficeWebhookEventFieldCreatedAt = big.NewInt(1 << 3) + schedulingOutOfOfficeWebhookEventFieldType = big.NewInt(1 << 4) + schedulingOutOfOfficeWebhookEventFieldData = big.NewInt(1 << 5) +) + +type SchedulingOutOfOfficeWebhookEvent struct { + // The event id. + ID string `json:"id" url:"id"` + Object SchedulingOutOfOfficeWebhookEventObject `json:"object" url:"object"` + // The API version this payload is rendered in: the endpoint's. + APIVersion string `json:"api_version" url:"api_version"` + // When the event was created. + CreatedAt time.Time `json:"created_at" url:"created_at"` + Type SchedulingOutOfOfficeWebhookEventType `json:"type" url:"type"` + Data *SchedulingOutOfOfficeWebhookEventData `json:"data" url:"data"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + + extraProperties map[string]interface{} + rawJSON json.RawMessage +} + +func (s *SchedulingOutOfOfficeWebhookEvent) GetID() string { + if s == nil { + return "" + } + return s.ID +} + +func (s *SchedulingOutOfOfficeWebhookEvent) GetObject() SchedulingOutOfOfficeWebhookEventObject { + if s == nil { + return "" + } + return s.Object +} + +func (s *SchedulingOutOfOfficeWebhookEvent) GetAPIVersion() string { + if s == nil { + return "" + } + return s.APIVersion +} + +func (s *SchedulingOutOfOfficeWebhookEvent) GetCreatedAt() time.Time { + if s == nil { + return time.Time{} + } + return s.CreatedAt +} + +func (s *SchedulingOutOfOfficeWebhookEvent) GetType() SchedulingOutOfOfficeWebhookEventType { + if s == nil { + return "" + } + return s.Type +} + +func (s *SchedulingOutOfOfficeWebhookEvent) GetData() *SchedulingOutOfOfficeWebhookEventData { + if s == nil { + return nil + } + return s.Data +} + +func (s *SchedulingOutOfOfficeWebhookEvent) GetExtraProperties() map[string]interface{} { + if s == nil { + return nil + } + return s.extraProperties +} + +func (s *SchedulingOutOfOfficeWebhookEvent) require(field *big.Int) { + next := new(big.Int) + if s.explicitFields != nil { + next.Set(s.explicitFields) + } + next.Or(next, field) + s.explicitFields = next +} + +// SetID sets the ID field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingOutOfOfficeWebhookEvent) SetID(id string) { + s.ID = id + s.require(schedulingOutOfOfficeWebhookEventFieldID) +} + +// SetObject sets the Object field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingOutOfOfficeWebhookEvent) SetObject(object SchedulingOutOfOfficeWebhookEventObject) { + s.Object = object + s.require(schedulingOutOfOfficeWebhookEventFieldObject) +} + +// SetAPIVersion sets the APIVersion field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingOutOfOfficeWebhookEvent) SetAPIVersion(apiVersion string) { + s.APIVersion = apiVersion + s.require(schedulingOutOfOfficeWebhookEventFieldAPIVersion) +} + +// SetCreatedAt sets the CreatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingOutOfOfficeWebhookEvent) SetCreatedAt(createdAt time.Time) { + s.CreatedAt = createdAt + s.require(schedulingOutOfOfficeWebhookEventFieldCreatedAt) +} + +// SetType sets the Type field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingOutOfOfficeWebhookEvent) SetType(type_ SchedulingOutOfOfficeWebhookEventType) { + s.Type = type_ + s.require(schedulingOutOfOfficeWebhookEventFieldType) +} + +// SetData sets the Data field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingOutOfOfficeWebhookEvent) SetData(data *SchedulingOutOfOfficeWebhookEventData) { + s.Data = data + s.require(schedulingOutOfOfficeWebhookEventFieldData) +} + +func (s *SchedulingOutOfOfficeWebhookEvent) UnmarshalJSON(data []byte) error { + type embed SchedulingOutOfOfficeWebhookEvent + var unmarshaler = struct { + embed + CreatedAt *internal.DateTime `json:"created_at"` + }{ + embed: embed(*s), + } + if err := json.Unmarshal(data, &unmarshaler); err != nil { + return err + } + *s = SchedulingOutOfOfficeWebhookEvent(unmarshaler.embed) + s.CreatedAt = unmarshaler.CreatedAt.Time() + extraProperties, err := internal.ExtractExtraProperties(data, *s) + if err != nil { + return err + } + s.extraProperties = extraProperties + s.rawJSON = json.RawMessage(data) + return nil +} + +func (s *SchedulingOutOfOfficeWebhookEvent) MarshalJSON() ([]byte, error) { + type embed SchedulingOutOfOfficeWebhookEvent + var marshaler = struct { + embed + CreatedAt *internal.DateTime `json:"created_at"` + }{ + embed: embed(*s), + CreatedAt: internal.NewDateTime(s.CreatedAt), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, s.explicitFields) + return json.Marshal(explicitMarshaler) +} + +func (s *SchedulingOutOfOfficeWebhookEvent) String() string { + if s == nil { + return "" + } + if len(s.rawJSON) > 0 { + if value, err := internal.StringifyJSON(s.rawJSON); err == nil { + return value + } + } + if value, err := internal.StringifyJSON(s); err == nil { + return value + } + return fmt.Sprintf("%#v", s) +} + +var ( + schedulingOutOfOfficeWebhookEventDataFieldOutOfOfficeID = big.NewInt(1 << 0) + schedulingOutOfOfficeWebhookEventDataFieldHostID = big.NewInt(1 << 1) + schedulingOutOfOfficeWebhookEventDataFieldStart = big.NewInt(1 << 2) + schedulingOutOfOfficeWebhookEventDataFieldEnd = big.NewInt(1 << 3) + schedulingOutOfOfficeWebhookEventDataFieldGroup = big.NewInt(1 << 4) + schedulingOutOfOfficeWebhookEventDataFieldOccurredAt = big.NewInt(1 << 5) +) + +// schedulingOutOfOfficeWebhookEventDataNullableFields maps the wire names of SchedulingOutOfOfficeWebhookEventData's nullable fields (required or optional) to their field bits. +var schedulingOutOfOfficeWebhookEventDataNullableFields = map[string]*big.Int{ + "group": schedulingOutOfOfficeWebhookEventDataFieldGroup, +} + +type SchedulingOutOfOfficeWebhookEventData struct { + OutOfOfficeID string `json:"out_of_office_id" url:"out_of_office_id"` + HostID string `json:"host_id" url:"host_id"` + Start string `json:"start" url:"start"` + End string `json:"end" url:"end"` + Group *string `json:"group,omitempty" url:"group,omitempty"` + OccurredAt string `json:"occurred_at" url:"occurred_at"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + + extraProperties map[string]interface{} + rawJSON json.RawMessage +} + +func (s *SchedulingOutOfOfficeWebhookEventData) GetOutOfOfficeID() string { + if s == nil { + return "" + } + return s.OutOfOfficeID +} + +func (s *SchedulingOutOfOfficeWebhookEventData) GetHostID() string { + if s == nil { + return "" + } + return s.HostID +} + +func (s *SchedulingOutOfOfficeWebhookEventData) GetStart() string { + if s == nil { + return "" + } + return s.Start +} + +func (s *SchedulingOutOfOfficeWebhookEventData) GetEnd() string { + if s == nil { + return "" + } + return s.End +} + +func (s *SchedulingOutOfOfficeWebhookEventData) GetGroup() *string { + if s == nil { + return nil + } + return s.Group +} + +func (s *SchedulingOutOfOfficeWebhookEventData) GetOccurredAt() string { + if s == nil { + return "" + } + return s.OccurredAt +} + +func (s *SchedulingOutOfOfficeWebhookEventData) GetExtraProperties() map[string]interface{} { + if s == nil { + return nil + } + return s.extraProperties +} + +func (s *SchedulingOutOfOfficeWebhookEventData) require(field *big.Int) { + next := new(big.Int) + if s.explicitFields != nil { + next.Set(s.explicitFields) + } + next.Or(next, field) + s.explicitFields = next +} + +// SetOutOfOfficeID sets the OutOfOfficeID field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingOutOfOfficeWebhookEventData) SetOutOfOfficeID(outOfOfficeID string) { + s.OutOfOfficeID = outOfOfficeID + s.require(schedulingOutOfOfficeWebhookEventDataFieldOutOfOfficeID) +} + +// SetHostID sets the HostID field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingOutOfOfficeWebhookEventData) SetHostID(hostID string) { + s.HostID = hostID + s.require(schedulingOutOfOfficeWebhookEventDataFieldHostID) +} + +// SetStart sets the Start field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingOutOfOfficeWebhookEventData) SetStart(start string) { + s.Start = start + s.require(schedulingOutOfOfficeWebhookEventDataFieldStart) +} + +// SetEnd sets the End field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingOutOfOfficeWebhookEventData) SetEnd(end string) { + s.End = end + s.require(schedulingOutOfOfficeWebhookEventDataFieldEnd) +} + +// SetGroup sets the Group field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingOutOfOfficeWebhookEventData) SetGroup(group *string) { + s.Group = group + s.require(schedulingOutOfOfficeWebhookEventDataFieldGroup) +} + +// SetOccurredAt sets the OccurredAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingOutOfOfficeWebhookEventData) SetOccurredAt(occurredAt string) { + s.OccurredAt = occurredAt + s.require(schedulingOutOfOfficeWebhookEventDataFieldOccurredAt) +} + +func (s *SchedulingOutOfOfficeWebhookEventData) UnmarshalJSON(data []byte) error { + type unmarshaler SchedulingOutOfOfficeWebhookEventData + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *s = SchedulingOutOfOfficeWebhookEventData(value) + extraProperties, err := internal.ExtractExtraProperties(data, *s) + if err != nil { + return err + } + s.extraProperties = extraProperties + presentFields, err := internal.ExplicitFieldsFromJSON(data, schedulingOutOfOfficeWebhookEventDataNullableFields) + if err != nil { + return err + } + if presentFields != nil { + s.require(presentFields) + } + s.rawJSON = json.RawMessage(data) + return nil +} + +func (s *SchedulingOutOfOfficeWebhookEventData) MarshalJSON() ([]byte, error) { + type embed SchedulingOutOfOfficeWebhookEventData + var marshaler = struct { + embed + }{ + embed: embed(*s), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, s.explicitFields) + return json.Marshal(explicitMarshaler) +} + +func (s *SchedulingOutOfOfficeWebhookEventData) String() string { + if s == nil { + return "" + } + if len(s.rawJSON) > 0 { + if value, err := internal.StringifyJSON(s.rawJSON); err == nil { + return value + } + } + if value, err := internal.StringifyJSON(s); err == nil { + return value + } + return fmt.Sprintf("%#v", s) +} + +type SchedulingOutOfOfficeWebhookEventObject string + +const ( + SchedulingOutOfOfficeWebhookEventObjectEvent SchedulingOutOfOfficeWebhookEventObject = "event" +) + +func NewSchedulingOutOfOfficeWebhookEventObjectFromString(s string) (SchedulingOutOfOfficeWebhookEventObject, error) { + switch s { + case "event": + return SchedulingOutOfOfficeWebhookEventObjectEvent, nil + } + var t SchedulingOutOfOfficeWebhookEventObject + return "", fmt.Errorf("%s is not a valid %T", s, t) +} + +func (s SchedulingOutOfOfficeWebhookEventObject) Ptr() *SchedulingOutOfOfficeWebhookEventObject { + return &s +} + +type SchedulingOutOfOfficeWebhookEventType string + +const ( + SchedulingOutOfOfficeWebhookEventTypeSchedulingOutOfOfficeCreated SchedulingOutOfOfficeWebhookEventType = "scheduling.out_of_office.created" + SchedulingOutOfOfficeWebhookEventTypeSchedulingOutOfOfficeUpdated SchedulingOutOfOfficeWebhookEventType = "scheduling.out_of_office.updated" + SchedulingOutOfOfficeWebhookEventTypeSchedulingOutOfOfficeDeleted SchedulingOutOfOfficeWebhookEventType = "scheduling.out_of_office.deleted" + SchedulingOutOfOfficeWebhookEventTypeSchedulingOutOfOfficeStarted SchedulingOutOfOfficeWebhookEventType = "scheduling.out_of_office.started" + SchedulingOutOfOfficeWebhookEventTypeSchedulingOutOfOfficeEnded SchedulingOutOfOfficeWebhookEventType = "scheduling.out_of_office.ended" +) + +func NewSchedulingOutOfOfficeWebhookEventTypeFromString(s string) (SchedulingOutOfOfficeWebhookEventType, error) { + switch s { + case "scheduling.out_of_office.created": + return SchedulingOutOfOfficeWebhookEventTypeSchedulingOutOfOfficeCreated, nil + case "scheduling.out_of_office.updated": + return SchedulingOutOfOfficeWebhookEventTypeSchedulingOutOfOfficeUpdated, nil + case "scheduling.out_of_office.deleted": + return SchedulingOutOfOfficeWebhookEventTypeSchedulingOutOfOfficeDeleted, nil + case "scheduling.out_of_office.started": + return SchedulingOutOfOfficeWebhookEventTypeSchedulingOutOfOfficeStarted, nil + case "scheduling.out_of_office.ended": + return SchedulingOutOfOfficeWebhookEventTypeSchedulingOutOfOfficeEnded, nil + } + var t SchedulingOutOfOfficeWebhookEventType + return "", fmt.Errorf("%s is not a valid %T", s, t) +} + +func (s SchedulingOutOfOfficeWebhookEventType) Ptr() *SchedulingOutOfOfficeWebhookEventType { + return &s +} + +var ( + schedulingReassignmentWebhookEventFieldID = big.NewInt(1 << 0) + schedulingReassignmentWebhookEventFieldObject = big.NewInt(1 << 1) + schedulingReassignmentWebhookEventFieldAPIVersion = big.NewInt(1 << 2) + schedulingReassignmentWebhookEventFieldCreatedAt = big.NewInt(1 << 3) + schedulingReassignmentWebhookEventFieldType = big.NewInt(1 << 4) + schedulingReassignmentWebhookEventFieldData = big.NewInt(1 << 5) +) + +type SchedulingReassignmentWebhookEvent struct { + // The event id. + ID string `json:"id" url:"id"` + Object SchedulingReassignmentWebhookEventObject `json:"object" url:"object"` + // The API version this payload is rendered in: the endpoint's. + APIVersion string `json:"api_version" url:"api_version"` + // When the event was created. + CreatedAt time.Time `json:"created_at" url:"created_at"` + Type SchedulingReassignmentWebhookEventType `json:"type" url:"type"` + Data *SchedulingReassignmentWebhookEventData `json:"data" url:"data"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + + extraProperties map[string]interface{} + rawJSON json.RawMessage +} + +func (s *SchedulingReassignmentWebhookEvent) GetID() string { + if s == nil { + return "" + } + return s.ID +} + +func (s *SchedulingReassignmentWebhookEvent) GetObject() SchedulingReassignmentWebhookEventObject { + if s == nil { + return "" + } + return s.Object +} + +func (s *SchedulingReassignmentWebhookEvent) GetAPIVersion() string { + if s == nil { + return "" + } + return s.APIVersion +} + +func (s *SchedulingReassignmentWebhookEvent) GetCreatedAt() time.Time { + if s == nil { + return time.Time{} + } + return s.CreatedAt +} + +func (s *SchedulingReassignmentWebhookEvent) GetType() SchedulingReassignmentWebhookEventType { + if s == nil { + return "" + } + return s.Type +} + +func (s *SchedulingReassignmentWebhookEvent) GetData() *SchedulingReassignmentWebhookEventData { + if s == nil { + return nil + } + return s.Data +} + +func (s *SchedulingReassignmentWebhookEvent) GetExtraProperties() map[string]interface{} { + if s == nil { + return nil + } + return s.extraProperties +} + +func (s *SchedulingReassignmentWebhookEvent) require(field *big.Int) { + next := new(big.Int) + if s.explicitFields != nil { + next.Set(s.explicitFields) + } + next.Or(next, field) + s.explicitFields = next +} + +// SetID sets the ID field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingReassignmentWebhookEvent) SetID(id string) { + s.ID = id + s.require(schedulingReassignmentWebhookEventFieldID) +} + +// SetObject sets the Object field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingReassignmentWebhookEvent) SetObject(object SchedulingReassignmentWebhookEventObject) { + s.Object = object + s.require(schedulingReassignmentWebhookEventFieldObject) +} + +// SetAPIVersion sets the APIVersion field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingReassignmentWebhookEvent) SetAPIVersion(apiVersion string) { + s.APIVersion = apiVersion + s.require(schedulingReassignmentWebhookEventFieldAPIVersion) +} + +// SetCreatedAt sets the CreatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingReassignmentWebhookEvent) SetCreatedAt(createdAt time.Time) { + s.CreatedAt = createdAt + s.require(schedulingReassignmentWebhookEventFieldCreatedAt) +} + +// SetType sets the Type field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingReassignmentWebhookEvent) SetType(type_ SchedulingReassignmentWebhookEventType) { + s.Type = type_ + s.require(schedulingReassignmentWebhookEventFieldType) +} + +// SetData sets the Data field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingReassignmentWebhookEvent) SetData(data *SchedulingReassignmentWebhookEventData) { + s.Data = data + s.require(schedulingReassignmentWebhookEventFieldData) +} + +func (s *SchedulingReassignmentWebhookEvent) UnmarshalJSON(data []byte) error { + type embed SchedulingReassignmentWebhookEvent + var unmarshaler = struct { + embed + CreatedAt *internal.DateTime `json:"created_at"` + }{ + embed: embed(*s), + } + if err := json.Unmarshal(data, &unmarshaler); err != nil { + return err + } + *s = SchedulingReassignmentWebhookEvent(unmarshaler.embed) + s.CreatedAt = unmarshaler.CreatedAt.Time() + extraProperties, err := internal.ExtractExtraProperties(data, *s) + if err != nil { + return err + } + s.extraProperties = extraProperties + s.rawJSON = json.RawMessage(data) + return nil +} + +func (s *SchedulingReassignmentWebhookEvent) MarshalJSON() ([]byte, error) { + type embed SchedulingReassignmentWebhookEvent + var marshaler = struct { + embed + CreatedAt *internal.DateTime `json:"created_at"` + }{ + embed: embed(*s), + CreatedAt: internal.NewDateTime(s.CreatedAt), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, s.explicitFields) + return json.Marshal(explicitMarshaler) +} + +func (s *SchedulingReassignmentWebhookEvent) String() string { + if s == nil { + return "" + } + if len(s.rawJSON) > 0 { + if value, err := internal.StringifyJSON(s.rawJSON); err == nil { + return value + } + } + if value, err := internal.StringifyJSON(s); err == nil { + return value + } + return fmt.Sprintf("%#v", s) +} + +var ( + schedulingReassignmentWebhookEventDataFieldReassignmentID = big.NewInt(1 << 0) + schedulingReassignmentWebhookEventDataFieldStatus = big.NewInt(1 << 1) + schedulingReassignmentWebhookEventDataFieldOutOfOfficeID = big.NewInt(1 << 2) + schedulingReassignmentWebhookEventDataFieldCounts = big.NewInt(1 << 3) + schedulingReassignmentWebhookEventDataFieldOccurredAt = big.NewInt(1 << 4) +) + +// schedulingReassignmentWebhookEventDataNullableFields maps the wire names of SchedulingReassignmentWebhookEventData's nullable fields (required or optional) to their field bits. +var schedulingReassignmentWebhookEventDataNullableFields = map[string]*big.Int{ + "out_of_office_id": schedulingReassignmentWebhookEventDataFieldOutOfOfficeID, +} + +type SchedulingReassignmentWebhookEventData struct { + ReassignmentID string `json:"reassignment_id" url:"reassignment_id"` + Status SchedulingReassignmentWebhookEventDataStatus `json:"status" url:"status"` + OutOfOfficeID *string `json:"out_of_office_id,omitempty" url:"out_of_office_id,omitempty"` + Counts *SchedulingReassignmentWebhookEventDataCounts `json:"counts" url:"counts"` + OccurredAt string `json:"occurred_at" url:"occurred_at"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + + extraProperties map[string]interface{} + rawJSON json.RawMessage +} + +func (s *SchedulingReassignmentWebhookEventData) GetReassignmentID() string { if s == nil { return "" } - return s.ID + return s.ReassignmentID } -func (s *SchedulingCalendarWebhookEvent) GetObject() SchedulingCalendarWebhookEventObject { +func (s *SchedulingReassignmentWebhookEventData) GetStatus() SchedulingReassignmentWebhookEventDataStatus { if s == nil { return "" } - return s.Object + return s.Status } -func (s *SchedulingCalendarWebhookEvent) GetAPIVersion() string { +func (s *SchedulingReassignmentWebhookEventData) GetOutOfOfficeID() *string { if s == nil { - return "" + return nil } - return s.APIVersion + return s.OutOfOfficeID } -func (s *SchedulingCalendarWebhookEvent) GetCreatedAt() time.Time { +func (s *SchedulingReassignmentWebhookEventData) GetCounts() *SchedulingReassignmentWebhookEventDataCounts { if s == nil { - return time.Time{} + return nil } - return s.CreatedAt + return s.Counts } -func (s *SchedulingCalendarWebhookEvent) GetType() SchedulingCalendarWebhookEventType { +func (s *SchedulingReassignmentWebhookEventData) GetOccurredAt() string { if s == nil { return "" } - return s.Type -} - -func (s *SchedulingCalendarWebhookEvent) GetData() *SchedulingCalendarWebhookEventData { - if s == nil { - return nil - } - return s.Data + return s.OccurredAt } -func (s *SchedulingCalendarWebhookEvent) GetExtraProperties() map[string]interface{} { +func (s *SchedulingReassignmentWebhookEventData) GetExtraProperties() map[string]interface{} { if s == nil { return nil } return s.extraProperties } -func (s *SchedulingCalendarWebhookEvent) require(field *big.Int) { +func (s *SchedulingReassignmentWebhookEventData) require(field *big.Int) { next := new(big.Int) if s.explicitFields != nil { next.Set(s.explicitFields) @@ -7493,84 +8831,76 @@ func (s *SchedulingCalendarWebhookEvent) require(field *big.Int) { s.explicitFields = next } -// SetID sets the ID field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (s *SchedulingCalendarWebhookEvent) SetID(id string) { - s.ID = id - s.require(schedulingCalendarWebhookEventFieldID) -} - -// SetObject sets the Object field and marks it as non-optional; +// SetReassignmentID sets the ReassignmentID field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (s *SchedulingCalendarWebhookEvent) SetObject(object SchedulingCalendarWebhookEventObject) { - s.Object = object - s.require(schedulingCalendarWebhookEventFieldObject) +func (s *SchedulingReassignmentWebhookEventData) SetReassignmentID(reassignmentID string) { + s.ReassignmentID = reassignmentID + s.require(schedulingReassignmentWebhookEventDataFieldReassignmentID) } -// SetAPIVersion sets the APIVersion field and marks it as non-optional; +// SetStatus sets the Status field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (s *SchedulingCalendarWebhookEvent) SetAPIVersion(apiVersion string) { - s.APIVersion = apiVersion - s.require(schedulingCalendarWebhookEventFieldAPIVersion) +func (s *SchedulingReassignmentWebhookEventData) SetStatus(status SchedulingReassignmentWebhookEventDataStatus) { + s.Status = status + s.require(schedulingReassignmentWebhookEventDataFieldStatus) } -// SetCreatedAt sets the CreatedAt field and marks it as non-optional; +// SetOutOfOfficeID sets the OutOfOfficeID field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (s *SchedulingCalendarWebhookEvent) SetCreatedAt(createdAt time.Time) { - s.CreatedAt = createdAt - s.require(schedulingCalendarWebhookEventFieldCreatedAt) +func (s *SchedulingReassignmentWebhookEventData) SetOutOfOfficeID(outOfOfficeID *string) { + s.OutOfOfficeID = outOfOfficeID + s.require(schedulingReassignmentWebhookEventDataFieldOutOfOfficeID) } -// SetType sets the Type field and marks it as non-optional; +// SetCounts sets the Counts field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (s *SchedulingCalendarWebhookEvent) SetType(type_ SchedulingCalendarWebhookEventType) { - s.Type = type_ - s.require(schedulingCalendarWebhookEventFieldType) +func (s *SchedulingReassignmentWebhookEventData) SetCounts(counts *SchedulingReassignmentWebhookEventDataCounts) { + s.Counts = counts + s.require(schedulingReassignmentWebhookEventDataFieldCounts) } -// SetData sets the Data field and marks it as non-optional; +// SetOccurredAt sets the OccurredAt field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (s *SchedulingCalendarWebhookEvent) SetData(data *SchedulingCalendarWebhookEventData) { - s.Data = data - s.require(schedulingCalendarWebhookEventFieldData) +func (s *SchedulingReassignmentWebhookEventData) SetOccurredAt(occurredAt string) { + s.OccurredAt = occurredAt + s.require(schedulingReassignmentWebhookEventDataFieldOccurredAt) } -func (s *SchedulingCalendarWebhookEvent) UnmarshalJSON(data []byte) error { - type embed SchedulingCalendarWebhookEvent - var unmarshaler = struct { - embed - CreatedAt *internal.DateTime `json:"created_at"` - }{ - embed: embed(*s), - } - if err := json.Unmarshal(data, &unmarshaler); err != nil { +func (s *SchedulingReassignmentWebhookEventData) UnmarshalJSON(data []byte) error { + type unmarshaler SchedulingReassignmentWebhookEventData + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { return err } - *s = SchedulingCalendarWebhookEvent(unmarshaler.embed) - s.CreatedAt = unmarshaler.CreatedAt.Time() + *s = SchedulingReassignmentWebhookEventData(value) extraProperties, err := internal.ExtractExtraProperties(data, *s) if err != nil { return err } s.extraProperties = extraProperties + presentFields, err := internal.ExplicitFieldsFromJSON(data, schedulingReassignmentWebhookEventDataNullableFields) + if err != nil { + return err + } + if presentFields != nil { + s.require(presentFields) + } s.rawJSON = json.RawMessage(data) return nil } -func (s *SchedulingCalendarWebhookEvent) MarshalJSON() ([]byte, error) { - type embed SchedulingCalendarWebhookEvent +func (s *SchedulingReassignmentWebhookEventData) MarshalJSON() ([]byte, error) { + type embed SchedulingReassignmentWebhookEventData var marshaler = struct { embed - CreatedAt *internal.DateTime `json:"created_at"` }{ - embed: embed(*s), - CreatedAt: internal.NewDateTime(s.CreatedAt), + embed: embed(*s), } explicitMarshaler := internal.HandleExplicitFields(marshaler, s.explicitFields) return json.Marshal(explicitMarshaler) } -func (s *SchedulingCalendarWebhookEvent) String() string { +func (s *SchedulingReassignmentWebhookEventData) String() string { if s == nil { return "" } @@ -7586,22 +8916,25 @@ func (s *SchedulingCalendarWebhookEvent) String() string { } var ( - schedulingCalendarWebhookEventDataFieldHostID = big.NewInt(1 << 0) - schedulingCalendarWebhookEventDataFieldConnectionID = big.NewInt(1 << 1) - schedulingCalendarWebhookEventDataFieldProvider = big.NewInt(1 << 2) - schedulingCalendarWebhookEventDataFieldOccurredAt = big.NewInt(1 << 3) + schedulingReassignmentWebhookEventDataCountsFieldTotal = big.NewInt(1 << 0) + schedulingReassignmentWebhookEventDataCountsFieldPending = big.NewInt(1 << 1) + schedulingReassignmentWebhookEventDataCountsFieldReassigned = big.NewInt(1 << 2) + schedulingReassignmentWebhookEventDataCountsFieldSkipped = big.NewInt(1 << 3) + schedulingReassignmentWebhookEventDataCountsFieldNoCandidate = big.NewInt(1 << 4) + schedulingReassignmentWebhookEventDataCountsFieldFailed = big.NewInt(1 << 5) + schedulingReassignmentWebhookEventDataCountsFieldCancelled = big.NewInt(1 << 6) ) -// The host and calendar connection this is about. -type SchedulingCalendarWebhookEventData struct { - // The host's id. - HostID string `json:"host_id" url:"host_id"` - // The calendar connection's id. - ConnectionID string `json:"connection_id" url:"connection_id"` - // The calendar provider, such as `google`. - Provider string `json:"provider" url:"provider"` - // When this happened. - OccurredAt string `json:"occurred_at" url:"occurred_at"` +type SchedulingReassignmentWebhookEventDataCounts struct { + Total float64 `json:"total" url:"total"` + Pending float64 `json:"pending" url:"pending"` + Reassigned float64 `json:"reassigned" url:"reassigned"` + // They'd moved on since it was selected. + Skipped float64 `json:"skipped" url:"skipped"` + // Nobody could take them: they stayed. + NoCandidate float64 `json:"no_candidate" url:"no_candidate"` + Failed float64 `json:"failed" url:"failed"` + Cancelled float64 `json:"cancelled" url:"cancelled"` // Private bitmask of fields set to an explicit value and therefore not to be omitted explicitFields *big.Int `json:"-" url:"-"` @@ -7610,42 +8943,63 @@ type SchedulingCalendarWebhookEventData struct { rawJSON json.RawMessage } -func (s *SchedulingCalendarWebhookEventData) GetHostID() string { +func (s *SchedulingReassignmentWebhookEventDataCounts) GetTotal() float64 { if s == nil { - return "" + return 0 } - return s.HostID + return s.Total } -func (s *SchedulingCalendarWebhookEventData) GetConnectionID() string { +func (s *SchedulingReassignmentWebhookEventDataCounts) GetPending() float64 { if s == nil { - return "" + return 0 } - return s.ConnectionID + return s.Pending } -func (s *SchedulingCalendarWebhookEventData) GetProvider() string { +func (s *SchedulingReassignmentWebhookEventDataCounts) GetReassigned() float64 { if s == nil { - return "" + return 0 } - return s.Provider + return s.Reassigned } -func (s *SchedulingCalendarWebhookEventData) GetOccurredAt() string { +func (s *SchedulingReassignmentWebhookEventDataCounts) GetSkipped() float64 { if s == nil { - return "" + return 0 } - return s.OccurredAt + return s.Skipped } -func (s *SchedulingCalendarWebhookEventData) GetExtraProperties() map[string]interface{} { +func (s *SchedulingReassignmentWebhookEventDataCounts) GetNoCandidate() float64 { + if s == nil { + return 0 + } + return s.NoCandidate +} + +func (s *SchedulingReassignmentWebhookEventDataCounts) GetFailed() float64 { + if s == nil { + return 0 + } + return s.Failed +} + +func (s *SchedulingReassignmentWebhookEventDataCounts) GetCancelled() float64 { + if s == nil { + return 0 + } + return s.Cancelled +} + +func (s *SchedulingReassignmentWebhookEventDataCounts) GetExtraProperties() map[string]interface{} { if s == nil { return nil } return s.extraProperties } -func (s *SchedulingCalendarWebhookEventData) require(field *big.Int) { +func (s *SchedulingReassignmentWebhookEventDataCounts) require(field *big.Int) { next := new(big.Int) if s.explicitFields != nil { next.Set(s.explicitFields) @@ -7654,41 +9008,62 @@ func (s *SchedulingCalendarWebhookEventData) require(field *big.Int) { s.explicitFields = next } -// SetHostID sets the HostID field and marks it as non-optional; +// SetTotal sets the Total field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (s *SchedulingCalendarWebhookEventData) SetHostID(hostID string) { - s.HostID = hostID - s.require(schedulingCalendarWebhookEventDataFieldHostID) +func (s *SchedulingReassignmentWebhookEventDataCounts) SetTotal(total float64) { + s.Total = total + s.require(schedulingReassignmentWebhookEventDataCountsFieldTotal) } -// SetConnectionID sets the ConnectionID field and marks it as non-optional; +// SetPending sets the Pending field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (s *SchedulingCalendarWebhookEventData) SetConnectionID(connectionID string) { - s.ConnectionID = connectionID - s.require(schedulingCalendarWebhookEventDataFieldConnectionID) +func (s *SchedulingReassignmentWebhookEventDataCounts) SetPending(pending float64) { + s.Pending = pending + s.require(schedulingReassignmentWebhookEventDataCountsFieldPending) } -// SetProvider sets the Provider field and marks it as non-optional; +// SetReassigned sets the Reassigned field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (s *SchedulingCalendarWebhookEventData) SetProvider(provider string) { - s.Provider = provider - s.require(schedulingCalendarWebhookEventDataFieldProvider) +func (s *SchedulingReassignmentWebhookEventDataCounts) SetReassigned(reassigned float64) { + s.Reassigned = reassigned + s.require(schedulingReassignmentWebhookEventDataCountsFieldReassigned) } -// SetOccurredAt sets the OccurredAt field and marks it as non-optional; +// SetSkipped sets the Skipped field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (s *SchedulingCalendarWebhookEventData) SetOccurredAt(occurredAt string) { - s.OccurredAt = occurredAt - s.require(schedulingCalendarWebhookEventDataFieldOccurredAt) +func (s *SchedulingReassignmentWebhookEventDataCounts) SetSkipped(skipped float64) { + s.Skipped = skipped + s.require(schedulingReassignmentWebhookEventDataCountsFieldSkipped) } -func (s *SchedulingCalendarWebhookEventData) UnmarshalJSON(data []byte) error { - type unmarshaler SchedulingCalendarWebhookEventData +// SetNoCandidate sets the NoCandidate field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingReassignmentWebhookEventDataCounts) SetNoCandidate(noCandidate float64) { + s.NoCandidate = noCandidate + s.require(schedulingReassignmentWebhookEventDataCountsFieldNoCandidate) +} + +// SetFailed sets the Failed field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingReassignmentWebhookEventDataCounts) SetFailed(failed float64) { + s.Failed = failed + s.require(schedulingReassignmentWebhookEventDataCountsFieldFailed) +} + +// SetCancelled sets the Cancelled field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SchedulingReassignmentWebhookEventDataCounts) SetCancelled(cancelled float64) { + s.Cancelled = cancelled + s.require(schedulingReassignmentWebhookEventDataCountsFieldCancelled) +} + +func (s *SchedulingReassignmentWebhookEventDataCounts) UnmarshalJSON(data []byte) error { + type unmarshaler SchedulingReassignmentWebhookEventDataCounts var value unmarshaler if err := json.Unmarshal(data, &value); err != nil { return err } - *s = SchedulingCalendarWebhookEventData(value) + *s = SchedulingReassignmentWebhookEventDataCounts(value) extraProperties, err := internal.ExtractExtraProperties(data, *s) if err != nil { return err @@ -7698,8 +9073,8 @@ func (s *SchedulingCalendarWebhookEventData) UnmarshalJSON(data []byte) error { return nil } -func (s *SchedulingCalendarWebhookEventData) MarshalJSON() ([]byte, error) { - type embed SchedulingCalendarWebhookEventData +func (s *SchedulingReassignmentWebhookEventDataCounts) MarshalJSON() ([]byte, error) { + type embed SchedulingReassignmentWebhookEventDataCounts var marshaler = struct { embed }{ @@ -7709,7 +9084,7 @@ func (s *SchedulingCalendarWebhookEventData) MarshalJSON() ([]byte, error) { return json.Marshal(explicitMarshaler) } -func (s *SchedulingCalendarWebhookEventData) String() string { +func (s *SchedulingReassignmentWebhookEventDataCounts) String() string { if s == nil { return "" } @@ -7724,48 +9099,63 @@ func (s *SchedulingCalendarWebhookEventData) String() string { return fmt.Sprintf("%#v", s) } -type SchedulingCalendarWebhookEventObject string +type SchedulingReassignmentWebhookEventDataStatus string const ( - SchedulingCalendarWebhookEventObjectEvent SchedulingCalendarWebhookEventObject = "event" + SchedulingReassignmentWebhookEventDataStatusCompleted SchedulingReassignmentWebhookEventDataStatus = "completed" + SchedulingReassignmentWebhookEventDataStatusCancelled SchedulingReassignmentWebhookEventDataStatus = "cancelled" ) -func NewSchedulingCalendarWebhookEventObjectFromString(s string) (SchedulingCalendarWebhookEventObject, error) { +func NewSchedulingReassignmentWebhookEventDataStatusFromString(s string) (SchedulingReassignmentWebhookEventDataStatus, error) { + switch s { + case "completed": + return SchedulingReassignmentWebhookEventDataStatusCompleted, nil + case "cancelled": + return SchedulingReassignmentWebhookEventDataStatusCancelled, nil + } + var t SchedulingReassignmentWebhookEventDataStatus + return "", fmt.Errorf("%s is not a valid %T", s, t) +} + +func (s SchedulingReassignmentWebhookEventDataStatus) Ptr() *SchedulingReassignmentWebhookEventDataStatus { + return &s +} + +type SchedulingReassignmentWebhookEventObject string + +const ( + SchedulingReassignmentWebhookEventObjectEvent SchedulingReassignmentWebhookEventObject = "event" +) + +func NewSchedulingReassignmentWebhookEventObjectFromString(s string) (SchedulingReassignmentWebhookEventObject, error) { switch s { case "event": - return SchedulingCalendarWebhookEventObjectEvent, nil + return SchedulingReassignmentWebhookEventObjectEvent, nil } - var t SchedulingCalendarWebhookEventObject + var t SchedulingReassignmentWebhookEventObject return "", fmt.Errorf("%s is not a valid %T", s, t) } -func (s SchedulingCalendarWebhookEventObject) Ptr() *SchedulingCalendarWebhookEventObject { +func (s SchedulingReassignmentWebhookEventObject) Ptr() *SchedulingReassignmentWebhookEventObject { return &s } -// `connected`: a calendar account was connected. `needs_reauth`: access was lost, and the host isn't offered until it's back. `disconnected`: the connection was removed. -type SchedulingCalendarWebhookEventType string +type SchedulingReassignmentWebhookEventType string const ( - SchedulingCalendarWebhookEventTypeSchedulingCalendarConnected SchedulingCalendarWebhookEventType = "scheduling.calendar.connected" - SchedulingCalendarWebhookEventTypeSchedulingCalendarNeedsReauth SchedulingCalendarWebhookEventType = "scheduling.calendar.needs_reauth" - SchedulingCalendarWebhookEventTypeSchedulingCalendarDisconnected SchedulingCalendarWebhookEventType = "scheduling.calendar.disconnected" + SchedulingReassignmentWebhookEventTypeSchedulingReassignmentCompleted SchedulingReassignmentWebhookEventType = "scheduling.reassignment.completed" ) -func NewSchedulingCalendarWebhookEventTypeFromString(s string) (SchedulingCalendarWebhookEventType, error) { +func NewSchedulingReassignmentWebhookEventTypeFromString(s string) (SchedulingReassignmentWebhookEventType, error) { switch s { - case "scheduling.calendar.connected": - return SchedulingCalendarWebhookEventTypeSchedulingCalendarConnected, nil - case "scheduling.calendar.needs_reauth": - return SchedulingCalendarWebhookEventTypeSchedulingCalendarNeedsReauth, nil - case "scheduling.calendar.disconnected": - return SchedulingCalendarWebhookEventTypeSchedulingCalendarDisconnected, nil + case "scheduling.reassignment.completed": + return SchedulingReassignmentWebhookEventTypeSchedulingReassignmentCompleted, nil } - var t SchedulingCalendarWebhookEventType + var t SchedulingReassignmentWebhookEventType return "", fmt.Errorf("%s is not a valid %T", s, t) } -func (s SchedulingCalendarWebhookEventType) Ptr() *SchedulingCalendarWebhookEventType { +func (s SchedulingReassignmentWebhookEventType) Ptr() *SchedulingReassignmentWebhookEventType { return &s } @@ -10327,7 +11717,10 @@ type WebhookTestEventEvent struct { FormSubmissionWebhookEvent *FormSubmissionWebhookEvent SchedulingBookingWebhookEvent *SchedulingBookingWebhookEvent SchedulingCalendarWebhookEvent *SchedulingCalendarWebhookEvent + SchedulingOutOfOfficeWebhookEvent *SchedulingOutOfOfficeWebhookEvent + SchedulingReassignmentWebhookEvent *SchedulingReassignmentWebhookEvent SchedulingCalendarDelegationWebhookEvent *SchedulingCalendarDelegationWebhookEvent + SchedulingOauthAppWebhookEvent *SchedulingOauthAppWebhookEvent typ string } @@ -10430,6 +11823,20 @@ func (w *WebhookTestEventEvent) GetSchedulingCalendarWebhookEvent() *SchedulingC return w.SchedulingCalendarWebhookEvent } +func (w *WebhookTestEventEvent) GetSchedulingOutOfOfficeWebhookEvent() *SchedulingOutOfOfficeWebhookEvent { + if w == nil { + return nil + } + return w.SchedulingOutOfOfficeWebhookEvent +} + +func (w *WebhookTestEventEvent) GetSchedulingReassignmentWebhookEvent() *SchedulingReassignmentWebhookEvent { + if w == nil { + return nil + } + return w.SchedulingReassignmentWebhookEvent +} + func (w *WebhookTestEventEvent) GetSchedulingCalendarDelegationWebhookEvent() *SchedulingCalendarDelegationWebhookEvent { if w == nil { return nil @@ -10437,6 +11844,13 @@ func (w *WebhookTestEventEvent) GetSchedulingCalendarDelegationWebhookEvent() *S return w.SchedulingCalendarDelegationWebhookEvent } +func (w *WebhookTestEventEvent) GetSchedulingOauthAppWebhookEvent() *SchedulingOauthAppWebhookEvent { + if w == nil { + return nil + } + return w.SchedulingOauthAppWebhookEvent +} + func (w *WebhookTestEventEvent) UnmarshalJSON(data []byte) error { if internal.MatchesObjectKeys(data, []string{"id", "object", "type", "api_version", "created_at", "data"}, []string{"id", "object", "type", "api_version", "created_at", "data"}) { valueEmailWebhookEvent := new(EmailWebhookEvent) @@ -10550,6 +11964,22 @@ func (w *WebhookTestEventEvent) UnmarshalJSON(data []byte) error { return nil } } + if internal.MatchesObjectKeys(data, []string{"id", "object", "api_version", "created_at", "type", "data"}, []string{"id", "object", "api_version", "created_at", "type", "data"}) { + valueSchedulingOutOfOfficeWebhookEvent := new(SchedulingOutOfOfficeWebhookEvent) + if err := json.Unmarshal(data, &valueSchedulingOutOfOfficeWebhookEvent); err == nil { + w.typ = "SchedulingOutOfOfficeWebhookEvent" + w.SchedulingOutOfOfficeWebhookEvent = valueSchedulingOutOfOfficeWebhookEvent + return nil + } + } + if internal.MatchesObjectKeys(data, []string{"id", "object", "api_version", "created_at", "type", "data"}, []string{"id", "object", "api_version", "created_at", "type", "data"}) { + valueSchedulingReassignmentWebhookEvent := new(SchedulingReassignmentWebhookEvent) + if err := json.Unmarshal(data, &valueSchedulingReassignmentWebhookEvent); err == nil { + w.typ = "SchedulingReassignmentWebhookEvent" + w.SchedulingReassignmentWebhookEvent = valueSchedulingReassignmentWebhookEvent + return nil + } + } if internal.MatchesObjectKeys(data, []string{"id", "object", "api_version", "created_at", "type", "data"}, []string{"id", "object", "api_version", "created_at", "type", "data"}) { valueSchedulingCalendarDelegationWebhookEvent := new(SchedulingCalendarDelegationWebhookEvent) if err := json.Unmarshal(data, &valueSchedulingCalendarDelegationWebhookEvent); err == nil { @@ -10558,6 +11988,14 @@ func (w *WebhookTestEventEvent) UnmarshalJSON(data []byte) error { return nil } } + if internal.MatchesObjectKeys(data, []string{"id", "object", "api_version", "created_at", "type", "data"}, []string{"id", "object", "api_version", "created_at", "type", "data"}) { + valueSchedulingOauthAppWebhookEvent := new(SchedulingOauthAppWebhookEvent) + if err := json.Unmarshal(data, &valueSchedulingOauthAppWebhookEvent); err == nil { + w.typ = "SchedulingOauthAppWebhookEvent" + w.SchedulingOauthAppWebhookEvent = valueSchedulingOauthAppWebhookEvent + return nil + } + } if internal.HasObjectKeys(data, []string{"id", "object", "type", "api_version", "created_at", "data"}) { valueEmailWebhookEvent := new(EmailWebhookEvent) if err := json.Unmarshal(data, &valueEmailWebhookEvent); err == nil { @@ -10670,6 +12108,22 @@ func (w *WebhookTestEventEvent) UnmarshalJSON(data []byte) error { return nil } } + if internal.HasObjectKeys(data, []string{"id", "object", "api_version", "created_at", "type", "data"}) { + valueSchedulingOutOfOfficeWebhookEvent := new(SchedulingOutOfOfficeWebhookEvent) + if err := json.Unmarshal(data, &valueSchedulingOutOfOfficeWebhookEvent); err == nil { + w.typ = "SchedulingOutOfOfficeWebhookEvent" + w.SchedulingOutOfOfficeWebhookEvent = valueSchedulingOutOfOfficeWebhookEvent + return nil + } + } + if internal.HasObjectKeys(data, []string{"id", "object", "api_version", "created_at", "type", "data"}) { + valueSchedulingReassignmentWebhookEvent := new(SchedulingReassignmentWebhookEvent) + if err := json.Unmarshal(data, &valueSchedulingReassignmentWebhookEvent); err == nil { + w.typ = "SchedulingReassignmentWebhookEvent" + w.SchedulingReassignmentWebhookEvent = valueSchedulingReassignmentWebhookEvent + return nil + } + } if internal.HasObjectKeys(data, []string{"id", "object", "api_version", "created_at", "type", "data"}) { valueSchedulingCalendarDelegationWebhookEvent := new(SchedulingCalendarDelegationWebhookEvent) if err := json.Unmarshal(data, &valueSchedulingCalendarDelegationWebhookEvent); err == nil { @@ -10678,6 +12132,14 @@ func (w *WebhookTestEventEvent) UnmarshalJSON(data []byte) error { return nil } } + if internal.HasObjectKeys(data, []string{"id", "object", "api_version", "created_at", "type", "data"}) { + valueSchedulingOauthAppWebhookEvent := new(SchedulingOauthAppWebhookEvent) + if err := json.Unmarshal(data, &valueSchedulingOauthAppWebhookEvent); err == nil { + w.typ = "SchedulingOauthAppWebhookEvent" + w.SchedulingOauthAppWebhookEvent = valueSchedulingOauthAppWebhookEvent + return nil + } + } valueEmailWebhookEvent := new(EmailWebhookEvent) if err := json.Unmarshal(data, &valueEmailWebhookEvent); err == nil { w.typ = "EmailWebhookEvent" @@ -10762,12 +12224,30 @@ func (w *WebhookTestEventEvent) UnmarshalJSON(data []byte) error { w.SchedulingCalendarWebhookEvent = valueSchedulingCalendarWebhookEvent return nil } + valueSchedulingOutOfOfficeWebhookEvent := new(SchedulingOutOfOfficeWebhookEvent) + if err := json.Unmarshal(data, &valueSchedulingOutOfOfficeWebhookEvent); err == nil { + w.typ = "SchedulingOutOfOfficeWebhookEvent" + w.SchedulingOutOfOfficeWebhookEvent = valueSchedulingOutOfOfficeWebhookEvent + return nil + } + valueSchedulingReassignmentWebhookEvent := new(SchedulingReassignmentWebhookEvent) + if err := json.Unmarshal(data, &valueSchedulingReassignmentWebhookEvent); err == nil { + w.typ = "SchedulingReassignmentWebhookEvent" + w.SchedulingReassignmentWebhookEvent = valueSchedulingReassignmentWebhookEvent + return nil + } valueSchedulingCalendarDelegationWebhookEvent := new(SchedulingCalendarDelegationWebhookEvent) if err := json.Unmarshal(data, &valueSchedulingCalendarDelegationWebhookEvent); err == nil { w.typ = "SchedulingCalendarDelegationWebhookEvent" w.SchedulingCalendarDelegationWebhookEvent = valueSchedulingCalendarDelegationWebhookEvent return nil } + valueSchedulingOauthAppWebhookEvent := new(SchedulingOauthAppWebhookEvent) + if err := json.Unmarshal(data, &valueSchedulingOauthAppWebhookEvent); err == nil { + w.typ = "SchedulingOauthAppWebhookEvent" + w.SchedulingOauthAppWebhookEvent = valueSchedulingOauthAppWebhookEvent + return nil + } return fmt.Errorf("%s cannot be deserialized as a %T", data, w) } @@ -10814,9 +12294,18 @@ func (w WebhookTestEventEvent) MarshalJSON() ([]byte, error) { if w.typ == "SchedulingCalendarWebhookEvent" || w.SchedulingCalendarWebhookEvent != nil { return json.Marshal(w.SchedulingCalendarWebhookEvent) } + if w.typ == "SchedulingOutOfOfficeWebhookEvent" || w.SchedulingOutOfOfficeWebhookEvent != nil { + return json.Marshal(w.SchedulingOutOfOfficeWebhookEvent) + } + if w.typ == "SchedulingReassignmentWebhookEvent" || w.SchedulingReassignmentWebhookEvent != nil { + return json.Marshal(w.SchedulingReassignmentWebhookEvent) + } if w.typ == "SchedulingCalendarDelegationWebhookEvent" || w.SchedulingCalendarDelegationWebhookEvent != nil { return json.Marshal(w.SchedulingCalendarDelegationWebhookEvent) } + if w.typ == "SchedulingOauthAppWebhookEvent" || w.SchedulingOauthAppWebhookEvent != nil { + return json.Marshal(w.SchedulingOauthAppWebhookEvent) + } return nil, fmt.Errorf("type %T does not include a non-empty union type", w) } @@ -10835,7 +12324,10 @@ type WebhookTestEventEventVisitor interface { VisitFormSubmissionWebhookEvent(*FormSubmissionWebhookEvent) error VisitSchedulingBookingWebhookEvent(*SchedulingBookingWebhookEvent) error VisitSchedulingCalendarWebhookEvent(*SchedulingCalendarWebhookEvent) error + VisitSchedulingOutOfOfficeWebhookEvent(*SchedulingOutOfOfficeWebhookEvent) error + VisitSchedulingReassignmentWebhookEvent(*SchedulingReassignmentWebhookEvent) error VisitSchedulingCalendarDelegationWebhookEvent(*SchedulingCalendarDelegationWebhookEvent) error + VisitSchedulingOauthAppWebhookEvent(*SchedulingOauthAppWebhookEvent) error } func (w *WebhookTestEventEvent) Accept(visitor WebhookTestEventEventVisitor) error { @@ -10881,9 +12373,18 @@ func (w *WebhookTestEventEvent) Accept(visitor WebhookTestEventEventVisitor) err if w.typ == "SchedulingCalendarWebhookEvent" || w.SchedulingCalendarWebhookEvent != nil { return visitor.VisitSchedulingCalendarWebhookEvent(w.SchedulingCalendarWebhookEvent) } + if w.typ == "SchedulingOutOfOfficeWebhookEvent" || w.SchedulingOutOfOfficeWebhookEvent != nil { + return visitor.VisitSchedulingOutOfOfficeWebhookEvent(w.SchedulingOutOfOfficeWebhookEvent) + } + if w.typ == "SchedulingReassignmentWebhookEvent" || w.SchedulingReassignmentWebhookEvent != nil { + return visitor.VisitSchedulingReassignmentWebhookEvent(w.SchedulingReassignmentWebhookEvent) + } if w.typ == "SchedulingCalendarDelegationWebhookEvent" || w.SchedulingCalendarDelegationWebhookEvent != nil { return visitor.VisitSchedulingCalendarDelegationWebhookEvent(w.SchedulingCalendarDelegationWebhookEvent) } + if w.typ == "SchedulingOauthAppWebhookEvent" || w.SchedulingOauthAppWebhookEvent != nil { + return visitor.VisitSchedulingOauthAppWebhookEvent(w.SchedulingOauthAppWebhookEvent) + } return fmt.Errorf("type %T does not include a non-empty union type", w) } @@ -10993,6 +12494,7 @@ const ( CreateTestWebhookEventRequestTypeSchedulingBookingExternalConflict CreateTestWebhookEventRequestType = "scheduling.booking.external_conflict" CreateTestWebhookEventRequestTypeSchedulingBookingCalendarWriteFailed CreateTestWebhookEventRequestType = "scheduling.booking.calendar_write_failed" CreateTestWebhookEventRequestTypeSchedulingBookingLocationReady CreateTestWebhookEventRequestType = "scheduling.booking.location_ready" + CreateTestWebhookEventRequestTypeSchedulingBookingReassigned CreateTestWebhookEventRequestType = "scheduling.booking.reassigned" CreateTestWebhookEventRequestTypeSchedulingBookingStarted CreateTestWebhookEventRequestType = "scheduling.booking.started" CreateTestWebhookEventRequestTypeSchedulingBookingEnded CreateTestWebhookEventRequestType = "scheduling.booking.ended" CreateTestWebhookEventRequestTypeSchedulingBookingReminder CreateTestWebhookEventRequestType = "scheduling.booking.reminder" @@ -11001,6 +12503,14 @@ const ( CreateTestWebhookEventRequestTypeSchedulingCalendarDisconnected CreateTestWebhookEventRequestType = "scheduling.calendar.disconnected" CreateTestWebhookEventRequestTypeSchedulingCalendarDelegationFailing CreateTestWebhookEventRequestType = "scheduling.calendar_delegation.failing" CreateTestWebhookEventRequestTypeSchedulingCalendarDelegationRestored CreateTestWebhookEventRequestType = "scheduling.calendar_delegation.restored" + CreateTestWebhookEventRequestTypeSchedulingOutOfOfficeCreated CreateTestWebhookEventRequestType = "scheduling.out_of_office.created" + CreateTestWebhookEventRequestTypeSchedulingOutOfOfficeUpdated CreateTestWebhookEventRequestType = "scheduling.out_of_office.updated" + CreateTestWebhookEventRequestTypeSchedulingOutOfOfficeDeleted CreateTestWebhookEventRequestType = "scheduling.out_of_office.deleted" + CreateTestWebhookEventRequestTypeSchedulingOutOfOfficeStarted CreateTestWebhookEventRequestType = "scheduling.out_of_office.started" + CreateTestWebhookEventRequestTypeSchedulingOutOfOfficeEnded CreateTestWebhookEventRequestType = "scheduling.out_of_office.ended" + CreateTestWebhookEventRequestTypeSchedulingReassignmentCompleted CreateTestWebhookEventRequestType = "scheduling.reassignment.completed" + CreateTestWebhookEventRequestTypeSchedulingOauthAppFailing CreateTestWebhookEventRequestType = "scheduling.oauth_app.failing" + CreateTestWebhookEventRequestTypeSchedulingOauthAppRestored CreateTestWebhookEventRequestType = "scheduling.oauth_app.restored" ) func NewCreateTestWebhookEventRequestTypeFromString(s string) (CreateTestWebhookEventRequestType, error) { @@ -11171,6 +12681,8 @@ func NewCreateTestWebhookEventRequestTypeFromString(s string) (CreateTestWebhook return CreateTestWebhookEventRequestTypeSchedulingBookingCalendarWriteFailed, nil case "scheduling.booking.location_ready": return CreateTestWebhookEventRequestTypeSchedulingBookingLocationReady, nil + case "scheduling.booking.reassigned": + return CreateTestWebhookEventRequestTypeSchedulingBookingReassigned, nil case "scheduling.booking.started": return CreateTestWebhookEventRequestTypeSchedulingBookingStarted, nil case "scheduling.booking.ended": @@ -11187,6 +12699,22 @@ func NewCreateTestWebhookEventRequestTypeFromString(s string) (CreateTestWebhook return CreateTestWebhookEventRequestTypeSchedulingCalendarDelegationFailing, nil case "scheduling.calendar_delegation.restored": return CreateTestWebhookEventRequestTypeSchedulingCalendarDelegationRestored, nil + case "scheduling.out_of_office.created": + return CreateTestWebhookEventRequestTypeSchedulingOutOfOfficeCreated, nil + case "scheduling.out_of_office.updated": + return CreateTestWebhookEventRequestTypeSchedulingOutOfOfficeUpdated, nil + case "scheduling.out_of_office.deleted": + return CreateTestWebhookEventRequestTypeSchedulingOutOfOfficeDeleted, nil + case "scheduling.out_of_office.started": + return CreateTestWebhookEventRequestTypeSchedulingOutOfOfficeStarted, nil + case "scheduling.out_of_office.ended": + return CreateTestWebhookEventRequestTypeSchedulingOutOfOfficeEnded, nil + case "scheduling.reassignment.completed": + return CreateTestWebhookEventRequestTypeSchedulingReassignmentCompleted, nil + case "scheduling.oauth_app.failing": + return CreateTestWebhookEventRequestTypeSchedulingOauthAppFailing, nil + case "scheduling.oauth_app.restored": + return CreateTestWebhookEventRequestTypeSchedulingOauthAppRestored, nil } var t CreateTestWebhookEventRequestType return "", fmt.Errorf("%s is not a valid %T", s, t) diff --git a/sdks/go/webhook_events_test.go b/sdks/go/webhook_events_test.go index b7f645737..505cd5454 100644 --- a/sdks/go/webhook_events_test.go +++ b/sdks/go/webhook_events_test.go @@ -11788,6 +11788,22 @@ func TestSettersSchedulingBookingWebhookData(t *testing.T) { assert.NotNil(t, obj.explicitFields) }) + t.Run("SetPreviousHostIDs", func(t *testing.T) { + obj := &SchedulingBookingWebhookData{} + var fernTestValuePreviousHostIDs []string + obj.SetPreviousHostIDs(fernTestValuePreviousHostIDs) + assert.Equal(t, fernTestValuePreviousHostIDs, obj.PreviousHostIDs) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetReassignmentID", func(t *testing.T) { + obj := &SchedulingBookingWebhookData{} + var fernTestValueReassignmentID *string + obj.SetReassignmentID(fernTestValueReassignmentID) + assert.Equal(t, fernTestValueReassignmentID, obj.ReassignmentID) + assert.NotNil(t, obj.explicitFields) + }) + t.Run("SetReminder", func(t *testing.T) { obj := &SchedulingBookingWebhookData{} var fernTestValueReminder *SchedulingBookingWebhookDataReminder @@ -12054,6 +12070,72 @@ func TestGettersSchedulingBookingWebhookData(t *testing.T) { _ = obj.GetPreviousStart() // Should return zero value }) + t.Run("GetPreviousHostIDs", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingBookingWebhookData{} + var expected []string + obj.PreviousHostIDs = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetPreviousHostIDs(), "getter should return the property value") + }) + + t.Run("GetPreviousHostIDs_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingBookingWebhookData{} + obj.PreviousHostIDs = nil + + // Act & Assert + assert.Nil(t, obj.GetPreviousHostIDs(), "getter should return nil when property is nil") + }) + + t.Run("GetPreviousHostIDs_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingBookingWebhookData + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetPreviousHostIDs() // Should return zero value + }) + + t.Run("GetReassignmentID", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingBookingWebhookData{} + var expected *string + obj.ReassignmentID = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetReassignmentID(), "getter should return the property value") + }) + + t.Run("GetReassignmentID_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingBookingWebhookData{} + obj.ReassignmentID = nil + + // Act & Assert + assert.Nil(t, obj.GetReassignmentID(), "getter should return nil when property is nil") + }) + + t.Run("GetReassignmentID_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingBookingWebhookData + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetReassignmentID() // Should return zero value + }) + t.Run("GetReminder", func(t *testing.T) { t.Parallel() // Arrange @@ -12392,6 +12474,68 @@ func TestSettersMarkExplicitSchedulingBookingWebhookData(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) + t.Run("SetPreviousHostIDs_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingBookingWebhookData{} + var fernTestValuePreviousHostIDs []string + + // Act + obj.SetPreviousHostIDs(fernTestValuePreviousHostIDs) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetReassignmentID_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingBookingWebhookData{} + var fernTestValueReassignmentID *string + + // Act + obj.SetReassignmentID(fernTestValueReassignmentID) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + t.Run("SetReminder_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange @@ -14554,9 +14698,9 @@ func TestSettersMarkExplicitSchedulingCalendarWebhookEventData(t *testing.T) { } -func TestSettersSignRequestWebhookEvent(t *testing.T) { +func TestSettersSchedulingOauthAppWebhookEvent(t *testing.T) { t.Run("SetID", func(t *testing.T) { - obj := &SignRequestWebhookEvent{} + obj := &SchedulingOauthAppWebhookEvent{} var fernTestValueID string obj.SetID(fernTestValueID) assert.Equal(t, fernTestValueID, obj.ID) @@ -14564,23 +14708,15 @@ func TestSettersSignRequestWebhookEvent(t *testing.T) { }) t.Run("SetObject", func(t *testing.T) { - obj := &SignRequestWebhookEvent{} - var fernTestValueObject SignRequestWebhookEventObject + obj := &SchedulingOauthAppWebhookEvent{} + var fernTestValueObject SchedulingOauthAppWebhookEventObject obj.SetObject(fernTestValueObject) assert.Equal(t, fernTestValueObject, obj.Object) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetType", func(t *testing.T) { - obj := &SignRequestWebhookEvent{} - var fernTestValueType SignRequestWebhookEventType - obj.SetType(fernTestValueType) - assert.Equal(t, fernTestValueType, obj.Type) - assert.NotNil(t, obj.explicitFields) - }) - t.Run("SetAPIVersion", func(t *testing.T) { - obj := &SignRequestWebhookEvent{} + obj := &SchedulingOauthAppWebhookEvent{} var fernTestValueAPIVersion string obj.SetAPIVersion(fernTestValueAPIVersion) assert.Equal(t, fernTestValueAPIVersion, obj.APIVersion) @@ -14588,16 +14724,24 @@ func TestSettersSignRequestWebhookEvent(t *testing.T) { }) t.Run("SetCreatedAt", func(t *testing.T) { - obj := &SignRequestWebhookEvent{} + obj := &SchedulingOauthAppWebhookEvent{} var fernTestValueCreatedAt time.Time obj.SetCreatedAt(fernTestValueCreatedAt) assert.Equal(t, fernTestValueCreatedAt, obj.CreatedAt) assert.NotNil(t, obj.explicitFields) }) + t.Run("SetType", func(t *testing.T) { + obj := &SchedulingOauthAppWebhookEvent{} + var fernTestValueType SchedulingOauthAppWebhookEventType + obj.SetType(fernTestValueType) + assert.Equal(t, fernTestValueType, obj.Type) + assert.NotNil(t, obj.explicitFields) + }) + t.Run("SetData", func(t *testing.T) { - obj := &SignRequestWebhookEvent{} - var fernTestValueData *SignRequestWebhookEventData + obj := &SchedulingOauthAppWebhookEvent{} + var fernTestValueData *SchedulingOauthAppWebhookEventData obj.SetData(fernTestValueData) assert.Equal(t, fernTestValueData, obj.Data) assert.NotNil(t, obj.explicitFields) @@ -14605,11 +14749,11 @@ func TestSettersSignRequestWebhookEvent(t *testing.T) { } -func TestGettersSignRequestWebhookEvent(t *testing.T) { +func TestGettersSchedulingOauthAppWebhookEvent(t *testing.T) { t.Run("GetID", func(t *testing.T) { t.Parallel() // Arrange - obj := &SignRequestWebhookEvent{} + obj := &SchedulingOauthAppWebhookEvent{} var expected string obj.ID = expected @@ -14619,7 +14763,7 @@ func TestGettersSignRequestWebhookEvent(t *testing.T) { t.Run("GetID_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *SignRequestWebhookEvent + var obj *SchedulingOauthAppWebhookEvent // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -14632,8 +14776,8 @@ func TestGettersSignRequestWebhookEvent(t *testing.T) { t.Run("GetObject", func(t *testing.T) { t.Parallel() // Arrange - obj := &SignRequestWebhookEvent{} - var expected SignRequestWebhookEventObject + obj := &SchedulingOauthAppWebhookEvent{} + var expected SchedulingOauthAppWebhookEventObject obj.Object = expected // Act & Assert @@ -14642,7 +14786,7 @@ func TestGettersSignRequestWebhookEvent(t *testing.T) { t.Run("GetObject_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *SignRequestWebhookEvent + var obj *SchedulingOauthAppWebhookEvent // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -14652,80 +14796,80 @@ func TestGettersSignRequestWebhookEvent(t *testing.T) { _ = obj.GetObject() // Should return zero value }) - t.Run("GetType", func(t *testing.T) { + t.Run("GetAPIVersion", func(t *testing.T) { t.Parallel() // Arrange - obj := &SignRequestWebhookEvent{} - var expected SignRequestWebhookEventType - obj.Type = expected + obj := &SchedulingOauthAppWebhookEvent{} + var expected string + obj.APIVersion = expected // Act & Assert - assert.Equal(t, expected, obj.GetType(), "getter should return the property value") + assert.Equal(t, expected, obj.GetAPIVersion(), "getter should return the property value") }) - t.Run("GetType_NilReceiver", func(t *testing.T) { + t.Run("GetAPIVersion_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *SignRequestWebhookEvent + var obj *SchedulingOauthAppWebhookEvent // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetType() // Should return zero value + _ = obj.GetAPIVersion() // Should return zero value }) - t.Run("GetAPIVersion", func(t *testing.T) { + t.Run("GetCreatedAt", func(t *testing.T) { t.Parallel() // Arrange - obj := &SignRequestWebhookEvent{} - var expected string - obj.APIVersion = expected + obj := &SchedulingOauthAppWebhookEvent{} + var expected time.Time + obj.CreatedAt = expected // Act & Assert - assert.Equal(t, expected, obj.GetAPIVersion(), "getter should return the property value") + assert.Equal(t, expected, obj.GetCreatedAt(), "getter should return the property value") }) - t.Run("GetAPIVersion_NilReceiver", func(t *testing.T) { + t.Run("GetCreatedAt_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *SignRequestWebhookEvent + var obj *SchedulingOauthAppWebhookEvent // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetAPIVersion() // Should return zero value + _ = obj.GetCreatedAt() // Should return zero value }) - t.Run("GetCreatedAt", func(t *testing.T) { + t.Run("GetType", func(t *testing.T) { t.Parallel() // Arrange - obj := &SignRequestWebhookEvent{} - var expected time.Time - obj.CreatedAt = expected + obj := &SchedulingOauthAppWebhookEvent{} + var expected SchedulingOauthAppWebhookEventType + obj.Type = expected // Act & Assert - assert.Equal(t, expected, obj.GetCreatedAt(), "getter should return the property value") + assert.Equal(t, expected, obj.GetType(), "getter should return the property value") }) - t.Run("GetCreatedAt_NilReceiver", func(t *testing.T) { + t.Run("GetType_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *SignRequestWebhookEvent + var obj *SchedulingOauthAppWebhookEvent // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetCreatedAt() // Should return zero value + _ = obj.GetType() // Should return zero value }) t.Run("GetData", func(t *testing.T) { t.Parallel() // Arrange - obj := &SignRequestWebhookEvent{} - var expected *SignRequestWebhookEventData + obj := &SchedulingOauthAppWebhookEvent{} + var expected *SchedulingOauthAppWebhookEventData obj.Data = expected // Act & Assert @@ -14735,7 +14879,7 @@ func TestGettersSignRequestWebhookEvent(t *testing.T) { t.Run("GetData_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &SignRequestWebhookEvent{} + obj := &SchedulingOauthAppWebhookEvent{} obj.Data = nil // Act & Assert @@ -14744,7 +14888,7 @@ func TestGettersSignRequestWebhookEvent(t *testing.T) { t.Run("GetData_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *SignRequestWebhookEvent + var obj *SchedulingOauthAppWebhookEvent // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -14756,11 +14900,11 @@ func TestGettersSignRequestWebhookEvent(t *testing.T) { } -func TestSettersMarkExplicitSignRequestWebhookEvent(t *testing.T) { +func TestSettersMarkExplicitSchedulingOauthAppWebhookEvent(t *testing.T) { t.Run("SetID_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SignRequestWebhookEvent{} + obj := &SchedulingOauthAppWebhookEvent{} var fernTestValueID string // Act @@ -14791,8 +14935,8 @@ func TestSettersMarkExplicitSignRequestWebhookEvent(t *testing.T) { t.Run("SetObject_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SignRequestWebhookEvent{} - var fernTestValueObject SignRequestWebhookEventObject + obj := &SchedulingOauthAppWebhookEvent{} + var fernTestValueObject SchedulingOauthAppWebhookEventObject // Act obj.SetObject(fernTestValueObject) @@ -14819,14 +14963,14 @@ func TestSettersMarkExplicitSignRequestWebhookEvent(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetType_MarksExplicit", func(t *testing.T) { + t.Run("SetAPIVersion_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SignRequestWebhookEvent{} - var fernTestValueType SignRequestWebhookEventType + obj := &SchedulingOauthAppWebhookEvent{} + var fernTestValueAPIVersion string // Act - obj.SetType(fernTestValueType) + obj.SetAPIVersion(fernTestValueAPIVersion) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -14850,14 +14994,14 @@ func TestSettersMarkExplicitSignRequestWebhookEvent(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetAPIVersion_MarksExplicit", func(t *testing.T) { + t.Run("SetCreatedAt_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SignRequestWebhookEvent{} - var fernTestValueAPIVersion string + obj := &SchedulingOauthAppWebhookEvent{} + var fernTestValueCreatedAt time.Time // Act - obj.SetAPIVersion(fernTestValueAPIVersion) + obj.SetCreatedAt(fernTestValueCreatedAt) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -14881,14 +15025,14 @@ func TestSettersMarkExplicitSignRequestWebhookEvent(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetCreatedAt_MarksExplicit", func(t *testing.T) { + t.Run("SetType_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SignRequestWebhookEvent{} - var fernTestValueCreatedAt time.Time + obj := &SchedulingOauthAppWebhookEvent{} + var fernTestValueType SchedulingOauthAppWebhookEventType // Act - obj.SetCreatedAt(fernTestValueCreatedAt) + obj.SetType(fernTestValueType) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -14915,8 +15059,8 @@ func TestSettersMarkExplicitSignRequestWebhookEvent(t *testing.T) { t.Run("SetData_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &SignRequestWebhookEvent{} - var fernTestValueData *SignRequestWebhookEventData + obj := &SchedulingOauthAppWebhookEvent{} + var fernTestValueData *SchedulingOauthAppWebhookEventData // Act obj.SetData(fernTestValueData) @@ -14945,49 +15089,2662 @@ func TestSettersMarkExplicitSignRequestWebhookEvent(t *testing.T) { } -func TestSettersSignRequestWebhookEventData(t *testing.T) { - t.Run("SetSignRequestID", func(t *testing.T) { - obj := &SignRequestWebhookEventData{} - var fernTestValueSignRequestID string - obj.SetSignRequestID(fernTestValueSignRequestID) - assert.Equal(t, fernTestValueSignRequestID, obj.SignRequestID) +func TestSettersSchedulingOauthAppWebhookEventData(t *testing.T) { + t.Run("SetOauthAppID", func(t *testing.T) { + obj := &SchedulingOauthAppWebhookEventData{} + var fernTestValueOauthAppID string + obj.SetOauthAppID(fernTestValueOauthAppID) + assert.Equal(t, fernTestValueOauthAppID, obj.OauthAppID) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetStatus", func(t *testing.T) { - obj := &SignRequestWebhookEventData{} - var fernTestValueStatus SignRequestWebhookEventDataStatus - obj.SetStatus(fernTestValueStatus) - assert.Equal(t, fernTestValueStatus, obj.Status) + t.Run("SetProvider", func(t *testing.T) { + obj := &SchedulingOauthAppWebhookEventData{} + var fernTestValueProvider string + obj.SetProvider(fernTestValueProvider) + assert.Equal(t, fernTestValueProvider, obj.Provider) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetTitle", func(t *testing.T) { - obj := &SignRequestWebhookEventData{} - var fernTestValueTitle string - obj.SetTitle(fernTestValueTitle) - assert.Equal(t, fernTestValueTitle, obj.Title) + t.Run("SetCode", func(t *testing.T) { + obj := &SchedulingOauthAppWebhookEventData{} + var fernTestValueCode *string + obj.SetCode(fernTestValueCode) + assert.Equal(t, fernTestValueCode, obj.Code) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetMetadata", func(t *testing.T) { - obj := &SignRequestWebhookEventData{} - var fernTestValueMetadata map[string]string - obj.SetMetadata(fernTestValueMetadata) - assert.Equal(t, fernTestValueMetadata, obj.Metadata) + t.Run("SetOccurredAt", func(t *testing.T) { + obj := &SchedulingOauthAppWebhookEventData{} + var fernTestValueOccurredAt string + obj.SetOccurredAt(fernTestValueOccurredAt) + assert.Equal(t, fernTestValueOccurredAt, obj.OccurredAt) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetSigner", func(t *testing.T) { - obj := &SignRequestWebhookEventData{} - var fernTestValueSigner *SignRequestWebhookEventDataSigner - obj.SetSigner(fernTestValueSigner) - assert.Equal(t, fernTestValueSigner, obj.Signer) - assert.NotNil(t, obj.explicitFields) - }) +} - t.Run("SetReason", func(t *testing.T) { - obj := &SignRequestWebhookEventData{} +func TestGettersSchedulingOauthAppWebhookEventData(t *testing.T) { + t.Run("GetOauthAppID", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingOauthAppWebhookEventData{} + var expected string + obj.OauthAppID = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetOauthAppID(), "getter should return the property value") + }) + + t.Run("GetOauthAppID_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingOauthAppWebhookEventData + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetOauthAppID() // Should return zero value + }) + + t.Run("GetProvider", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingOauthAppWebhookEventData{} + var expected string + obj.Provider = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetProvider(), "getter should return the property value") + }) + + t.Run("GetProvider_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingOauthAppWebhookEventData + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetProvider() // Should return zero value + }) + + t.Run("GetCode", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingOauthAppWebhookEventData{} + var expected *string + obj.Code = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetCode(), "getter should return the property value") + }) + + t.Run("GetCode_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingOauthAppWebhookEventData{} + obj.Code = nil + + // Act & Assert + assert.Nil(t, obj.GetCode(), "getter should return nil when property is nil") + }) + + t.Run("GetCode_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingOauthAppWebhookEventData + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetCode() // Should return zero value + }) + + t.Run("GetOccurredAt", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingOauthAppWebhookEventData{} + var expected string + obj.OccurredAt = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetOccurredAt(), "getter should return the property value") + }) + + t.Run("GetOccurredAt_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingOauthAppWebhookEventData + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetOccurredAt() // Should return zero value + }) + +} + +func TestSettersMarkExplicitSchedulingOauthAppWebhookEventData(t *testing.T) { + t.Run("SetOauthAppID_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingOauthAppWebhookEventData{} + var fernTestValueOauthAppID string + + // Act + obj.SetOauthAppID(fernTestValueOauthAppID) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetProvider_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingOauthAppWebhookEventData{} + var fernTestValueProvider string + + // Act + obj.SetProvider(fernTestValueProvider) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetCode_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingOauthAppWebhookEventData{} + var fernTestValueCode *string + + // Act + obj.SetCode(fernTestValueCode) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetOccurredAt_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingOauthAppWebhookEventData{} + var fernTestValueOccurredAt string + + // Act + obj.SetOccurredAt(fernTestValueOccurredAt) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + +} + +func TestSettersSchedulingOutOfOfficeWebhookEvent(t *testing.T) { + t.Run("SetID", func(t *testing.T) { + obj := &SchedulingOutOfOfficeWebhookEvent{} + var fernTestValueID string + obj.SetID(fernTestValueID) + assert.Equal(t, fernTestValueID, obj.ID) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetObject", func(t *testing.T) { + obj := &SchedulingOutOfOfficeWebhookEvent{} + var fernTestValueObject SchedulingOutOfOfficeWebhookEventObject + obj.SetObject(fernTestValueObject) + assert.Equal(t, fernTestValueObject, obj.Object) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetAPIVersion", func(t *testing.T) { + obj := &SchedulingOutOfOfficeWebhookEvent{} + var fernTestValueAPIVersion string + obj.SetAPIVersion(fernTestValueAPIVersion) + assert.Equal(t, fernTestValueAPIVersion, obj.APIVersion) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetCreatedAt", func(t *testing.T) { + obj := &SchedulingOutOfOfficeWebhookEvent{} + var fernTestValueCreatedAt time.Time + obj.SetCreatedAt(fernTestValueCreatedAt) + assert.Equal(t, fernTestValueCreatedAt, obj.CreatedAt) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetType", func(t *testing.T) { + obj := &SchedulingOutOfOfficeWebhookEvent{} + var fernTestValueType SchedulingOutOfOfficeWebhookEventType + obj.SetType(fernTestValueType) + assert.Equal(t, fernTestValueType, obj.Type) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetData", func(t *testing.T) { + obj := &SchedulingOutOfOfficeWebhookEvent{} + var fernTestValueData *SchedulingOutOfOfficeWebhookEventData + obj.SetData(fernTestValueData) + assert.Equal(t, fernTestValueData, obj.Data) + assert.NotNil(t, obj.explicitFields) + }) + +} + +func TestGettersSchedulingOutOfOfficeWebhookEvent(t *testing.T) { + t.Run("GetID", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingOutOfOfficeWebhookEvent{} + var expected string + obj.ID = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetID(), "getter should return the property value") + }) + + t.Run("GetID_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingOutOfOfficeWebhookEvent + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetID() // Should return zero value + }) + + t.Run("GetObject", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingOutOfOfficeWebhookEvent{} + var expected SchedulingOutOfOfficeWebhookEventObject + obj.Object = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetObject(), "getter should return the property value") + }) + + t.Run("GetObject_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingOutOfOfficeWebhookEvent + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetObject() // Should return zero value + }) + + t.Run("GetAPIVersion", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingOutOfOfficeWebhookEvent{} + var expected string + obj.APIVersion = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetAPIVersion(), "getter should return the property value") + }) + + t.Run("GetAPIVersion_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingOutOfOfficeWebhookEvent + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetAPIVersion() // Should return zero value + }) + + t.Run("GetCreatedAt", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingOutOfOfficeWebhookEvent{} + var expected time.Time + obj.CreatedAt = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetCreatedAt(), "getter should return the property value") + }) + + t.Run("GetCreatedAt_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingOutOfOfficeWebhookEvent + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetCreatedAt() // Should return zero value + }) + + t.Run("GetType", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingOutOfOfficeWebhookEvent{} + var expected SchedulingOutOfOfficeWebhookEventType + obj.Type = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetType(), "getter should return the property value") + }) + + t.Run("GetType_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingOutOfOfficeWebhookEvent + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetType() // Should return zero value + }) + + t.Run("GetData", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingOutOfOfficeWebhookEvent{} + var expected *SchedulingOutOfOfficeWebhookEventData + obj.Data = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetData(), "getter should return the property value") + }) + + t.Run("GetData_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingOutOfOfficeWebhookEvent{} + obj.Data = nil + + // Act & Assert + assert.Nil(t, obj.GetData(), "getter should return nil when property is nil") + }) + + t.Run("GetData_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingOutOfOfficeWebhookEvent + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetData() // Should return zero value + }) + +} + +func TestSettersMarkExplicitSchedulingOutOfOfficeWebhookEvent(t *testing.T) { + t.Run("SetID_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingOutOfOfficeWebhookEvent{} + var fernTestValueID string + + // Act + obj.SetID(fernTestValueID) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetObject_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingOutOfOfficeWebhookEvent{} + var fernTestValueObject SchedulingOutOfOfficeWebhookEventObject + + // Act + obj.SetObject(fernTestValueObject) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetAPIVersion_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingOutOfOfficeWebhookEvent{} + var fernTestValueAPIVersion string + + // Act + obj.SetAPIVersion(fernTestValueAPIVersion) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetCreatedAt_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingOutOfOfficeWebhookEvent{} + var fernTestValueCreatedAt time.Time + + // Act + obj.SetCreatedAt(fernTestValueCreatedAt) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetType_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingOutOfOfficeWebhookEvent{} + var fernTestValueType SchedulingOutOfOfficeWebhookEventType + + // Act + obj.SetType(fernTestValueType) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetData_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingOutOfOfficeWebhookEvent{} + var fernTestValueData *SchedulingOutOfOfficeWebhookEventData + + // Act + obj.SetData(fernTestValueData) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + +} + +func TestSettersSchedulingOutOfOfficeWebhookEventData(t *testing.T) { + t.Run("SetOutOfOfficeID", func(t *testing.T) { + obj := &SchedulingOutOfOfficeWebhookEventData{} + var fernTestValueOutOfOfficeID string + obj.SetOutOfOfficeID(fernTestValueOutOfOfficeID) + assert.Equal(t, fernTestValueOutOfOfficeID, obj.OutOfOfficeID) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetHostID", func(t *testing.T) { + obj := &SchedulingOutOfOfficeWebhookEventData{} + var fernTestValueHostID string + obj.SetHostID(fernTestValueHostID) + assert.Equal(t, fernTestValueHostID, obj.HostID) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetStart", func(t *testing.T) { + obj := &SchedulingOutOfOfficeWebhookEventData{} + var fernTestValueStart string + obj.SetStart(fernTestValueStart) + assert.Equal(t, fernTestValueStart, obj.Start) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetEnd", func(t *testing.T) { + obj := &SchedulingOutOfOfficeWebhookEventData{} + var fernTestValueEnd string + obj.SetEnd(fernTestValueEnd) + assert.Equal(t, fernTestValueEnd, obj.End) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetGroup", func(t *testing.T) { + obj := &SchedulingOutOfOfficeWebhookEventData{} + var fernTestValueGroup *string + obj.SetGroup(fernTestValueGroup) + assert.Equal(t, fernTestValueGroup, obj.Group) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetOccurredAt", func(t *testing.T) { + obj := &SchedulingOutOfOfficeWebhookEventData{} + var fernTestValueOccurredAt string + obj.SetOccurredAt(fernTestValueOccurredAt) + assert.Equal(t, fernTestValueOccurredAt, obj.OccurredAt) + assert.NotNil(t, obj.explicitFields) + }) + +} + +func TestGettersSchedulingOutOfOfficeWebhookEventData(t *testing.T) { + t.Run("GetOutOfOfficeID", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingOutOfOfficeWebhookEventData{} + var expected string + obj.OutOfOfficeID = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetOutOfOfficeID(), "getter should return the property value") + }) + + t.Run("GetOutOfOfficeID_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingOutOfOfficeWebhookEventData + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetOutOfOfficeID() // Should return zero value + }) + + t.Run("GetHostID", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingOutOfOfficeWebhookEventData{} + var expected string + obj.HostID = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetHostID(), "getter should return the property value") + }) + + t.Run("GetHostID_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingOutOfOfficeWebhookEventData + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetHostID() // Should return zero value + }) + + t.Run("GetStart", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingOutOfOfficeWebhookEventData{} + var expected string + obj.Start = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetStart(), "getter should return the property value") + }) + + t.Run("GetStart_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingOutOfOfficeWebhookEventData + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetStart() // Should return zero value + }) + + t.Run("GetEnd", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingOutOfOfficeWebhookEventData{} + var expected string + obj.End = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetEnd(), "getter should return the property value") + }) + + t.Run("GetEnd_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingOutOfOfficeWebhookEventData + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetEnd() // Should return zero value + }) + + t.Run("GetGroup", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingOutOfOfficeWebhookEventData{} + var expected *string + obj.Group = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetGroup(), "getter should return the property value") + }) + + t.Run("GetGroup_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingOutOfOfficeWebhookEventData{} + obj.Group = nil + + // Act & Assert + assert.Nil(t, obj.GetGroup(), "getter should return nil when property is nil") + }) + + t.Run("GetGroup_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingOutOfOfficeWebhookEventData + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetGroup() // Should return zero value + }) + + t.Run("GetOccurredAt", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingOutOfOfficeWebhookEventData{} + var expected string + obj.OccurredAt = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetOccurredAt(), "getter should return the property value") + }) + + t.Run("GetOccurredAt_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingOutOfOfficeWebhookEventData + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetOccurredAt() // Should return zero value + }) + +} + +func TestSettersMarkExplicitSchedulingOutOfOfficeWebhookEventData(t *testing.T) { + t.Run("SetOutOfOfficeID_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingOutOfOfficeWebhookEventData{} + var fernTestValueOutOfOfficeID string + + // Act + obj.SetOutOfOfficeID(fernTestValueOutOfOfficeID) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetHostID_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingOutOfOfficeWebhookEventData{} + var fernTestValueHostID string + + // Act + obj.SetHostID(fernTestValueHostID) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetStart_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingOutOfOfficeWebhookEventData{} + var fernTestValueStart string + + // Act + obj.SetStart(fernTestValueStart) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetEnd_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingOutOfOfficeWebhookEventData{} + var fernTestValueEnd string + + // Act + obj.SetEnd(fernTestValueEnd) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetGroup_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingOutOfOfficeWebhookEventData{} + var fernTestValueGroup *string + + // Act + obj.SetGroup(fernTestValueGroup) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetOccurredAt_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingOutOfOfficeWebhookEventData{} + var fernTestValueOccurredAt string + + // Act + obj.SetOccurredAt(fernTestValueOccurredAt) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + +} + +func TestSettersSchedulingReassignmentWebhookEvent(t *testing.T) { + t.Run("SetID", func(t *testing.T) { + obj := &SchedulingReassignmentWebhookEvent{} + var fernTestValueID string + obj.SetID(fernTestValueID) + assert.Equal(t, fernTestValueID, obj.ID) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetObject", func(t *testing.T) { + obj := &SchedulingReassignmentWebhookEvent{} + var fernTestValueObject SchedulingReassignmentWebhookEventObject + obj.SetObject(fernTestValueObject) + assert.Equal(t, fernTestValueObject, obj.Object) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetAPIVersion", func(t *testing.T) { + obj := &SchedulingReassignmentWebhookEvent{} + var fernTestValueAPIVersion string + obj.SetAPIVersion(fernTestValueAPIVersion) + assert.Equal(t, fernTestValueAPIVersion, obj.APIVersion) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetCreatedAt", func(t *testing.T) { + obj := &SchedulingReassignmentWebhookEvent{} + var fernTestValueCreatedAt time.Time + obj.SetCreatedAt(fernTestValueCreatedAt) + assert.Equal(t, fernTestValueCreatedAt, obj.CreatedAt) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetType", func(t *testing.T) { + obj := &SchedulingReassignmentWebhookEvent{} + var fernTestValueType SchedulingReassignmentWebhookEventType + obj.SetType(fernTestValueType) + assert.Equal(t, fernTestValueType, obj.Type) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetData", func(t *testing.T) { + obj := &SchedulingReassignmentWebhookEvent{} + var fernTestValueData *SchedulingReassignmentWebhookEventData + obj.SetData(fernTestValueData) + assert.Equal(t, fernTestValueData, obj.Data) + assert.NotNil(t, obj.explicitFields) + }) + +} + +func TestGettersSchedulingReassignmentWebhookEvent(t *testing.T) { + t.Run("GetID", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingReassignmentWebhookEvent{} + var expected string + obj.ID = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetID(), "getter should return the property value") + }) + + t.Run("GetID_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingReassignmentWebhookEvent + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetID() // Should return zero value + }) + + t.Run("GetObject", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingReassignmentWebhookEvent{} + var expected SchedulingReassignmentWebhookEventObject + obj.Object = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetObject(), "getter should return the property value") + }) + + t.Run("GetObject_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingReassignmentWebhookEvent + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetObject() // Should return zero value + }) + + t.Run("GetAPIVersion", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingReassignmentWebhookEvent{} + var expected string + obj.APIVersion = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetAPIVersion(), "getter should return the property value") + }) + + t.Run("GetAPIVersion_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingReassignmentWebhookEvent + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetAPIVersion() // Should return zero value + }) + + t.Run("GetCreatedAt", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingReassignmentWebhookEvent{} + var expected time.Time + obj.CreatedAt = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetCreatedAt(), "getter should return the property value") + }) + + t.Run("GetCreatedAt_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingReassignmentWebhookEvent + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetCreatedAt() // Should return zero value + }) + + t.Run("GetType", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingReassignmentWebhookEvent{} + var expected SchedulingReassignmentWebhookEventType + obj.Type = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetType(), "getter should return the property value") + }) + + t.Run("GetType_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingReassignmentWebhookEvent + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetType() // Should return zero value + }) + + t.Run("GetData", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingReassignmentWebhookEvent{} + var expected *SchedulingReassignmentWebhookEventData + obj.Data = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetData(), "getter should return the property value") + }) + + t.Run("GetData_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingReassignmentWebhookEvent{} + obj.Data = nil + + // Act & Assert + assert.Nil(t, obj.GetData(), "getter should return nil when property is nil") + }) + + t.Run("GetData_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingReassignmentWebhookEvent + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetData() // Should return zero value + }) + +} + +func TestSettersMarkExplicitSchedulingReassignmentWebhookEvent(t *testing.T) { + t.Run("SetID_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingReassignmentWebhookEvent{} + var fernTestValueID string + + // Act + obj.SetID(fernTestValueID) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetObject_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingReassignmentWebhookEvent{} + var fernTestValueObject SchedulingReassignmentWebhookEventObject + + // Act + obj.SetObject(fernTestValueObject) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetAPIVersion_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingReassignmentWebhookEvent{} + var fernTestValueAPIVersion string + + // Act + obj.SetAPIVersion(fernTestValueAPIVersion) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetCreatedAt_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingReassignmentWebhookEvent{} + var fernTestValueCreatedAt time.Time + + // Act + obj.SetCreatedAt(fernTestValueCreatedAt) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetType_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingReassignmentWebhookEvent{} + var fernTestValueType SchedulingReassignmentWebhookEventType + + // Act + obj.SetType(fernTestValueType) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetData_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingReassignmentWebhookEvent{} + var fernTestValueData *SchedulingReassignmentWebhookEventData + + // Act + obj.SetData(fernTestValueData) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + +} + +func TestSettersSchedulingReassignmentWebhookEventData(t *testing.T) { + t.Run("SetReassignmentID", func(t *testing.T) { + obj := &SchedulingReassignmentWebhookEventData{} + var fernTestValueReassignmentID string + obj.SetReassignmentID(fernTestValueReassignmentID) + assert.Equal(t, fernTestValueReassignmentID, obj.ReassignmentID) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetStatus", func(t *testing.T) { + obj := &SchedulingReassignmentWebhookEventData{} + var fernTestValueStatus SchedulingReassignmentWebhookEventDataStatus + obj.SetStatus(fernTestValueStatus) + assert.Equal(t, fernTestValueStatus, obj.Status) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetOutOfOfficeID", func(t *testing.T) { + obj := &SchedulingReassignmentWebhookEventData{} + var fernTestValueOutOfOfficeID *string + obj.SetOutOfOfficeID(fernTestValueOutOfOfficeID) + assert.Equal(t, fernTestValueOutOfOfficeID, obj.OutOfOfficeID) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetCounts", func(t *testing.T) { + obj := &SchedulingReassignmentWebhookEventData{} + var fernTestValueCounts *SchedulingReassignmentWebhookEventDataCounts + obj.SetCounts(fernTestValueCounts) + assert.Equal(t, fernTestValueCounts, obj.Counts) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetOccurredAt", func(t *testing.T) { + obj := &SchedulingReassignmentWebhookEventData{} + var fernTestValueOccurredAt string + obj.SetOccurredAt(fernTestValueOccurredAt) + assert.Equal(t, fernTestValueOccurredAt, obj.OccurredAt) + assert.NotNil(t, obj.explicitFields) + }) + +} + +func TestGettersSchedulingReassignmentWebhookEventData(t *testing.T) { + t.Run("GetReassignmentID", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingReassignmentWebhookEventData{} + var expected string + obj.ReassignmentID = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetReassignmentID(), "getter should return the property value") + }) + + t.Run("GetReassignmentID_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingReassignmentWebhookEventData + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetReassignmentID() // Should return zero value + }) + + t.Run("GetStatus", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingReassignmentWebhookEventData{} + var expected SchedulingReassignmentWebhookEventDataStatus + obj.Status = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetStatus(), "getter should return the property value") + }) + + t.Run("GetStatus_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingReassignmentWebhookEventData + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetStatus() // Should return zero value + }) + + t.Run("GetOutOfOfficeID", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingReassignmentWebhookEventData{} + var expected *string + obj.OutOfOfficeID = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetOutOfOfficeID(), "getter should return the property value") + }) + + t.Run("GetOutOfOfficeID_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingReassignmentWebhookEventData{} + obj.OutOfOfficeID = nil + + // Act & Assert + assert.Nil(t, obj.GetOutOfOfficeID(), "getter should return nil when property is nil") + }) + + t.Run("GetOutOfOfficeID_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingReassignmentWebhookEventData + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetOutOfOfficeID() // Should return zero value + }) + + t.Run("GetCounts", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingReassignmentWebhookEventData{} + var expected *SchedulingReassignmentWebhookEventDataCounts + obj.Counts = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetCounts(), "getter should return the property value") + }) + + t.Run("GetCounts_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingReassignmentWebhookEventData{} + obj.Counts = nil + + // Act & Assert + assert.Nil(t, obj.GetCounts(), "getter should return nil when property is nil") + }) + + t.Run("GetCounts_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingReassignmentWebhookEventData + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetCounts() // Should return zero value + }) + + t.Run("GetOccurredAt", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingReassignmentWebhookEventData{} + var expected string + obj.OccurredAt = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetOccurredAt(), "getter should return the property value") + }) + + t.Run("GetOccurredAt_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingReassignmentWebhookEventData + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetOccurredAt() // Should return zero value + }) + +} + +func TestSettersMarkExplicitSchedulingReassignmentWebhookEventData(t *testing.T) { + t.Run("SetReassignmentID_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingReassignmentWebhookEventData{} + var fernTestValueReassignmentID string + + // Act + obj.SetReassignmentID(fernTestValueReassignmentID) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetStatus_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingReassignmentWebhookEventData{} + var fernTestValueStatus SchedulingReassignmentWebhookEventDataStatus + + // Act + obj.SetStatus(fernTestValueStatus) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetOutOfOfficeID_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingReassignmentWebhookEventData{} + var fernTestValueOutOfOfficeID *string + + // Act + obj.SetOutOfOfficeID(fernTestValueOutOfOfficeID) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetCounts_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingReassignmentWebhookEventData{} + var fernTestValueCounts *SchedulingReassignmentWebhookEventDataCounts + + // Act + obj.SetCounts(fernTestValueCounts) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetOccurredAt_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingReassignmentWebhookEventData{} + var fernTestValueOccurredAt string + + // Act + obj.SetOccurredAt(fernTestValueOccurredAt) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + +} + +func TestSettersSchedulingReassignmentWebhookEventDataCounts(t *testing.T) { + t.Run("SetTotal", func(t *testing.T) { + obj := &SchedulingReassignmentWebhookEventDataCounts{} + var fernTestValueTotal float64 + obj.SetTotal(fernTestValueTotal) + assert.Equal(t, fernTestValueTotal, obj.Total) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetPending", func(t *testing.T) { + obj := &SchedulingReassignmentWebhookEventDataCounts{} + var fernTestValuePending float64 + obj.SetPending(fernTestValuePending) + assert.Equal(t, fernTestValuePending, obj.Pending) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetReassigned", func(t *testing.T) { + obj := &SchedulingReassignmentWebhookEventDataCounts{} + var fernTestValueReassigned float64 + obj.SetReassigned(fernTestValueReassigned) + assert.Equal(t, fernTestValueReassigned, obj.Reassigned) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetSkipped", func(t *testing.T) { + obj := &SchedulingReassignmentWebhookEventDataCounts{} + var fernTestValueSkipped float64 + obj.SetSkipped(fernTestValueSkipped) + assert.Equal(t, fernTestValueSkipped, obj.Skipped) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetNoCandidate", func(t *testing.T) { + obj := &SchedulingReassignmentWebhookEventDataCounts{} + var fernTestValueNoCandidate float64 + obj.SetNoCandidate(fernTestValueNoCandidate) + assert.Equal(t, fernTestValueNoCandidate, obj.NoCandidate) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetFailed", func(t *testing.T) { + obj := &SchedulingReassignmentWebhookEventDataCounts{} + var fernTestValueFailed float64 + obj.SetFailed(fernTestValueFailed) + assert.Equal(t, fernTestValueFailed, obj.Failed) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetCancelled", func(t *testing.T) { + obj := &SchedulingReassignmentWebhookEventDataCounts{} + var fernTestValueCancelled float64 + obj.SetCancelled(fernTestValueCancelled) + assert.Equal(t, fernTestValueCancelled, obj.Cancelled) + assert.NotNil(t, obj.explicitFields) + }) + +} + +func TestGettersSchedulingReassignmentWebhookEventDataCounts(t *testing.T) { + t.Run("GetTotal", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingReassignmentWebhookEventDataCounts{} + var expected float64 + obj.Total = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetTotal(), "getter should return the property value") + }) + + t.Run("GetTotal_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingReassignmentWebhookEventDataCounts + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetTotal() // Should return zero value + }) + + t.Run("GetPending", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingReassignmentWebhookEventDataCounts{} + var expected float64 + obj.Pending = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetPending(), "getter should return the property value") + }) + + t.Run("GetPending_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingReassignmentWebhookEventDataCounts + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetPending() // Should return zero value + }) + + t.Run("GetReassigned", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingReassignmentWebhookEventDataCounts{} + var expected float64 + obj.Reassigned = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetReassigned(), "getter should return the property value") + }) + + t.Run("GetReassigned_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingReassignmentWebhookEventDataCounts + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetReassigned() // Should return zero value + }) + + t.Run("GetSkipped", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingReassignmentWebhookEventDataCounts{} + var expected float64 + obj.Skipped = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetSkipped(), "getter should return the property value") + }) + + t.Run("GetSkipped_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingReassignmentWebhookEventDataCounts + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetSkipped() // Should return zero value + }) + + t.Run("GetNoCandidate", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingReassignmentWebhookEventDataCounts{} + var expected float64 + obj.NoCandidate = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetNoCandidate(), "getter should return the property value") + }) + + t.Run("GetNoCandidate_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingReassignmentWebhookEventDataCounts + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetNoCandidate() // Should return zero value + }) + + t.Run("GetFailed", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingReassignmentWebhookEventDataCounts{} + var expected float64 + obj.Failed = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetFailed(), "getter should return the property value") + }) + + t.Run("GetFailed_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingReassignmentWebhookEventDataCounts + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetFailed() // Should return zero value + }) + + t.Run("GetCancelled", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingReassignmentWebhookEventDataCounts{} + var expected float64 + obj.Cancelled = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetCancelled(), "getter should return the property value") + }) + + t.Run("GetCancelled_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingReassignmentWebhookEventDataCounts + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetCancelled() // Should return zero value + }) + +} + +func TestSettersMarkExplicitSchedulingReassignmentWebhookEventDataCounts(t *testing.T) { + t.Run("SetTotal_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingReassignmentWebhookEventDataCounts{} + var fernTestValueTotal float64 + + // Act + obj.SetTotal(fernTestValueTotal) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetPending_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingReassignmentWebhookEventDataCounts{} + var fernTestValuePending float64 + + // Act + obj.SetPending(fernTestValuePending) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetReassigned_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingReassignmentWebhookEventDataCounts{} + var fernTestValueReassigned float64 + + // Act + obj.SetReassigned(fernTestValueReassigned) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetSkipped_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingReassignmentWebhookEventDataCounts{} + var fernTestValueSkipped float64 + + // Act + obj.SetSkipped(fernTestValueSkipped) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetNoCandidate_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingReassignmentWebhookEventDataCounts{} + var fernTestValueNoCandidate float64 + + // Act + obj.SetNoCandidate(fernTestValueNoCandidate) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetFailed_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingReassignmentWebhookEventDataCounts{} + var fernTestValueFailed float64 + + // Act + obj.SetFailed(fernTestValueFailed) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetCancelled_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingReassignmentWebhookEventDataCounts{} + var fernTestValueCancelled float64 + + // Act + obj.SetCancelled(fernTestValueCancelled) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + +} + +func TestSettersSignRequestWebhookEvent(t *testing.T) { + t.Run("SetID", func(t *testing.T) { + obj := &SignRequestWebhookEvent{} + var fernTestValueID string + obj.SetID(fernTestValueID) + assert.Equal(t, fernTestValueID, obj.ID) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetObject", func(t *testing.T) { + obj := &SignRequestWebhookEvent{} + var fernTestValueObject SignRequestWebhookEventObject + obj.SetObject(fernTestValueObject) + assert.Equal(t, fernTestValueObject, obj.Object) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetType", func(t *testing.T) { + obj := &SignRequestWebhookEvent{} + var fernTestValueType SignRequestWebhookEventType + obj.SetType(fernTestValueType) + assert.Equal(t, fernTestValueType, obj.Type) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetAPIVersion", func(t *testing.T) { + obj := &SignRequestWebhookEvent{} + var fernTestValueAPIVersion string + obj.SetAPIVersion(fernTestValueAPIVersion) + assert.Equal(t, fernTestValueAPIVersion, obj.APIVersion) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetCreatedAt", func(t *testing.T) { + obj := &SignRequestWebhookEvent{} + var fernTestValueCreatedAt time.Time + obj.SetCreatedAt(fernTestValueCreatedAt) + assert.Equal(t, fernTestValueCreatedAt, obj.CreatedAt) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetData", func(t *testing.T) { + obj := &SignRequestWebhookEvent{} + var fernTestValueData *SignRequestWebhookEventData + obj.SetData(fernTestValueData) + assert.Equal(t, fernTestValueData, obj.Data) + assert.NotNil(t, obj.explicitFields) + }) + +} + +func TestGettersSignRequestWebhookEvent(t *testing.T) { + t.Run("GetID", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SignRequestWebhookEvent{} + var expected string + obj.ID = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetID(), "getter should return the property value") + }) + + t.Run("GetID_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SignRequestWebhookEvent + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetID() // Should return zero value + }) + + t.Run("GetObject", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SignRequestWebhookEvent{} + var expected SignRequestWebhookEventObject + obj.Object = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetObject(), "getter should return the property value") + }) + + t.Run("GetObject_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SignRequestWebhookEvent + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetObject() // Should return zero value + }) + + t.Run("GetType", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SignRequestWebhookEvent{} + var expected SignRequestWebhookEventType + obj.Type = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetType(), "getter should return the property value") + }) + + t.Run("GetType_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SignRequestWebhookEvent + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetType() // Should return zero value + }) + + t.Run("GetAPIVersion", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SignRequestWebhookEvent{} + var expected string + obj.APIVersion = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetAPIVersion(), "getter should return the property value") + }) + + t.Run("GetAPIVersion_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SignRequestWebhookEvent + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetAPIVersion() // Should return zero value + }) + + t.Run("GetCreatedAt", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SignRequestWebhookEvent{} + var expected time.Time + obj.CreatedAt = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetCreatedAt(), "getter should return the property value") + }) + + t.Run("GetCreatedAt_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SignRequestWebhookEvent + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetCreatedAt() // Should return zero value + }) + + t.Run("GetData", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SignRequestWebhookEvent{} + var expected *SignRequestWebhookEventData + obj.Data = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetData(), "getter should return the property value") + }) + + t.Run("GetData_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SignRequestWebhookEvent{} + obj.Data = nil + + // Act & Assert + assert.Nil(t, obj.GetData(), "getter should return nil when property is nil") + }) + + t.Run("GetData_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SignRequestWebhookEvent + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetData() // Should return zero value + }) + +} + +func TestSettersMarkExplicitSignRequestWebhookEvent(t *testing.T) { + t.Run("SetID_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SignRequestWebhookEvent{} + var fernTestValueID string + + // Act + obj.SetID(fernTestValueID) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetObject_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SignRequestWebhookEvent{} + var fernTestValueObject SignRequestWebhookEventObject + + // Act + obj.SetObject(fernTestValueObject) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetType_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SignRequestWebhookEvent{} + var fernTestValueType SignRequestWebhookEventType + + // Act + obj.SetType(fernTestValueType) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetAPIVersion_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SignRequestWebhookEvent{} + var fernTestValueAPIVersion string + + // Act + obj.SetAPIVersion(fernTestValueAPIVersion) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetCreatedAt_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SignRequestWebhookEvent{} + var fernTestValueCreatedAt time.Time + + // Act + obj.SetCreatedAt(fernTestValueCreatedAt) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetData_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SignRequestWebhookEvent{} + var fernTestValueData *SignRequestWebhookEventData + + // Act + obj.SetData(fernTestValueData) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + +} + +func TestSettersSignRequestWebhookEventData(t *testing.T) { + t.Run("SetSignRequestID", func(t *testing.T) { + obj := &SignRequestWebhookEventData{} + var fernTestValueSignRequestID string + obj.SetSignRequestID(fernTestValueSignRequestID) + assert.Equal(t, fernTestValueSignRequestID, obj.SignRequestID) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetStatus", func(t *testing.T) { + obj := &SignRequestWebhookEventData{} + var fernTestValueStatus SignRequestWebhookEventDataStatus + obj.SetStatus(fernTestValueStatus) + assert.Equal(t, fernTestValueStatus, obj.Status) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetTitle", func(t *testing.T) { + obj := &SignRequestWebhookEventData{} + var fernTestValueTitle string + obj.SetTitle(fernTestValueTitle) + assert.Equal(t, fernTestValueTitle, obj.Title) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetMetadata", func(t *testing.T) { + obj := &SignRequestWebhookEventData{} + var fernTestValueMetadata map[string]string + obj.SetMetadata(fernTestValueMetadata) + assert.Equal(t, fernTestValueMetadata, obj.Metadata) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetSigner", func(t *testing.T) { + obj := &SignRequestWebhookEventData{} + var fernTestValueSigner *SignRequestWebhookEventDataSigner + obj.SetSigner(fernTestValueSigner) + assert.Equal(t, fernTestValueSigner, obj.Signer) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetReason", func(t *testing.T) { + obj := &SignRequestWebhookEventData{} var fernTestValueReason *string obj.SetReason(fernTestValueReason) assert.Equal(t, fernTestValueReason, obj.Reason) @@ -19500,24 +22257,123 @@ func TestGettersWebhookTestEventEvent(t *testing.T) { t.Parallel() // Arrange obj := &WebhookTestEventEvent{} - var expected *SchedulingCalendarWebhookEvent - obj.SchedulingCalendarWebhookEvent = expected + var expected *SchedulingCalendarWebhookEvent + obj.SchedulingCalendarWebhookEvent = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetSchedulingCalendarWebhookEvent(), "getter should return the property value") + }) + + t.Run("GetSchedulingCalendarWebhookEvent_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &WebhookTestEventEvent{} + obj.SchedulingCalendarWebhookEvent = nil + + // Act & Assert + assert.Nil(t, obj.GetSchedulingCalendarWebhookEvent(), "getter should return nil when property is nil") + }) + + t.Run("GetSchedulingCalendarWebhookEvent_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *WebhookTestEventEvent + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetSchedulingCalendarWebhookEvent() // Should return zero value + }) + + t.Run("GetSchedulingOutOfOfficeWebhookEvent", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &WebhookTestEventEvent{} + var expected *SchedulingOutOfOfficeWebhookEvent + obj.SchedulingOutOfOfficeWebhookEvent = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetSchedulingOutOfOfficeWebhookEvent(), "getter should return the property value") + }) + + t.Run("GetSchedulingOutOfOfficeWebhookEvent_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &WebhookTestEventEvent{} + obj.SchedulingOutOfOfficeWebhookEvent = nil + + // Act & Assert + assert.Nil(t, obj.GetSchedulingOutOfOfficeWebhookEvent(), "getter should return nil when property is nil") + }) + + t.Run("GetSchedulingOutOfOfficeWebhookEvent_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *WebhookTestEventEvent + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetSchedulingOutOfOfficeWebhookEvent() // Should return zero value + }) + + t.Run("GetSchedulingReassignmentWebhookEvent", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &WebhookTestEventEvent{} + var expected *SchedulingReassignmentWebhookEvent + obj.SchedulingReassignmentWebhookEvent = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetSchedulingReassignmentWebhookEvent(), "getter should return the property value") + }) + + t.Run("GetSchedulingReassignmentWebhookEvent_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &WebhookTestEventEvent{} + obj.SchedulingReassignmentWebhookEvent = nil + + // Act & Assert + assert.Nil(t, obj.GetSchedulingReassignmentWebhookEvent(), "getter should return nil when property is nil") + }) + + t.Run("GetSchedulingReassignmentWebhookEvent_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *WebhookTestEventEvent + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetSchedulingReassignmentWebhookEvent() // Should return zero value + }) + + t.Run("GetSchedulingCalendarDelegationWebhookEvent", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &WebhookTestEventEvent{} + var expected *SchedulingCalendarDelegationWebhookEvent + obj.SchedulingCalendarDelegationWebhookEvent = expected // Act & Assert - assert.Equal(t, expected, obj.GetSchedulingCalendarWebhookEvent(), "getter should return the property value") + assert.Equal(t, expected, obj.GetSchedulingCalendarDelegationWebhookEvent(), "getter should return the property value") }) - t.Run("GetSchedulingCalendarWebhookEvent_NilValue", func(t *testing.T) { + t.Run("GetSchedulingCalendarDelegationWebhookEvent_NilValue", func(t *testing.T) { t.Parallel() // Arrange obj := &WebhookTestEventEvent{} - obj.SchedulingCalendarWebhookEvent = nil + obj.SchedulingCalendarDelegationWebhookEvent = nil // Act & Assert - assert.Nil(t, obj.GetSchedulingCalendarWebhookEvent(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetSchedulingCalendarDelegationWebhookEvent(), "getter should return nil when property is nil") }) - t.Run("GetSchedulingCalendarWebhookEvent_NilReceiver", func(t *testing.T) { + t.Run("GetSchedulingCalendarDelegationWebhookEvent_NilReceiver", func(t *testing.T) { t.Parallel() var obj *WebhookTestEventEvent // Should not panic - getters should handle nil receiver gracefully @@ -19526,31 +22382,31 @@ func TestGettersWebhookTestEventEvent(t *testing.T) { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetSchedulingCalendarWebhookEvent() // Should return zero value + _ = obj.GetSchedulingCalendarDelegationWebhookEvent() // Should return zero value }) - t.Run("GetSchedulingCalendarDelegationWebhookEvent", func(t *testing.T) { + t.Run("GetSchedulingOauthAppWebhookEvent", func(t *testing.T) { t.Parallel() // Arrange obj := &WebhookTestEventEvent{} - var expected *SchedulingCalendarDelegationWebhookEvent - obj.SchedulingCalendarDelegationWebhookEvent = expected + var expected *SchedulingOauthAppWebhookEvent + obj.SchedulingOauthAppWebhookEvent = expected // Act & Assert - assert.Equal(t, expected, obj.GetSchedulingCalendarDelegationWebhookEvent(), "getter should return the property value") + assert.Equal(t, expected, obj.GetSchedulingOauthAppWebhookEvent(), "getter should return the property value") }) - t.Run("GetSchedulingCalendarDelegationWebhookEvent_NilValue", func(t *testing.T) { + t.Run("GetSchedulingOauthAppWebhookEvent_NilValue", func(t *testing.T) { t.Parallel() // Arrange obj := &WebhookTestEventEvent{} - obj.SchedulingCalendarDelegationWebhookEvent = nil + obj.SchedulingOauthAppWebhookEvent = nil // Act & Assert - assert.Nil(t, obj.GetSchedulingCalendarDelegationWebhookEvent(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetSchedulingOauthAppWebhookEvent(), "getter should return nil when property is nil") }) - t.Run("GetSchedulingCalendarDelegationWebhookEvent_NilReceiver", func(t *testing.T) { + t.Run("GetSchedulingOauthAppWebhookEvent_NilReceiver", func(t *testing.T) { t.Parallel() var obj *WebhookTestEventEvent // Should not panic - getters should handle nil receiver gracefully @@ -19559,7 +22415,7 @@ func TestGettersWebhookTestEventEvent(t *testing.T) { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetSchedulingCalendarDelegationWebhookEvent() // Should return zero value + _ = obj.GetSchedulingOauthAppWebhookEvent() // Should return zero value }) } @@ -20624,7 +23480,238 @@ func TestJSONMarshalingSchedulingBookingWebhookData(t *testing.T) { t.Run("MarshalUnmarshal", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingBookingWebhookData{} + obj := &SchedulingBookingWebhookData{} + + // Act - Marshal to JSON + data, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed") + assert.NotNil(t, data, "marshaled data should not be nil") + assert.NotEmpty(t, data, "marshaled data should not be empty") + + // Unmarshal back and verify round-trip + var unmarshaled SchedulingBookingWebhookData + err = json.Unmarshal(data, &unmarshaled) + assert.NoError(t, err, "round-trip unmarshal should succeed") + }) + + t.Run("UnmarshalInvalidJSON", func(t *testing.T) { + t.Parallel() + var obj SchedulingBookingWebhookData + err := json.Unmarshal([]byte(`{invalid json}`), &obj) + assert.Error(t, err, "unmarshaling invalid JSON should return an error") + }) + + t.Run("UnmarshalEmptyObject", func(t *testing.T) { + t.Parallel() + var obj SchedulingBookingWebhookData + err := json.Unmarshal([]byte(`{}`), &obj) + assert.NoError(t, err, "unmarshaling empty object should succeed") + }) +} + +func TestJSONMarshalingSchedulingBookingWebhookDataReminder(t *testing.T) { + t.Run("MarshalUnmarshal", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingBookingWebhookDataReminder{} + + // Act - Marshal to JSON + data, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed") + assert.NotNil(t, data, "marshaled data should not be nil") + assert.NotEmpty(t, data, "marshaled data should not be empty") + + // Unmarshal back and verify round-trip + var unmarshaled SchedulingBookingWebhookDataReminder + err = json.Unmarshal(data, &unmarshaled) + assert.NoError(t, err, "round-trip unmarshal should succeed") + }) + + t.Run("UnmarshalInvalidJSON", func(t *testing.T) { + t.Parallel() + var obj SchedulingBookingWebhookDataReminder + err := json.Unmarshal([]byte(`{invalid json}`), &obj) + assert.Error(t, err, "unmarshaling invalid JSON should return an error") + }) + + t.Run("UnmarshalEmptyObject", func(t *testing.T) { + t.Parallel() + var obj SchedulingBookingWebhookDataReminder + err := json.Unmarshal([]byte(`{}`), &obj) + assert.NoError(t, err, "unmarshaling empty object should succeed") + }) +} + +func TestJSONMarshalingSchedulingBookingWebhookEvent(t *testing.T) { + t.Run("MarshalUnmarshal", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingBookingWebhookEvent{} + + // Act - Marshal to JSON + data, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed") + assert.NotNil(t, data, "marshaled data should not be nil") + assert.NotEmpty(t, data, "marshaled data should not be empty") + + // Unmarshal back and verify round-trip + var unmarshaled SchedulingBookingWebhookEvent + err = json.Unmarshal(data, &unmarshaled) + assert.NoError(t, err, "round-trip unmarshal should succeed") + }) + + t.Run("UnmarshalInvalidJSON", func(t *testing.T) { + t.Parallel() + var obj SchedulingBookingWebhookEvent + err := json.Unmarshal([]byte(`{invalid json}`), &obj) + assert.Error(t, err, "unmarshaling invalid JSON should return an error") + }) + + t.Run("UnmarshalEmptyObject", func(t *testing.T) { + t.Parallel() + var obj SchedulingBookingWebhookEvent + err := json.Unmarshal([]byte(`{}`), &obj) + assert.NoError(t, err, "unmarshaling empty object should succeed") + }) +} + +func TestJSONMarshalingSchedulingCalendarDelegationWebhookEvent(t *testing.T) { + t.Run("MarshalUnmarshal", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingCalendarDelegationWebhookEvent{} + + // Act - Marshal to JSON + data, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed") + assert.NotNil(t, data, "marshaled data should not be nil") + assert.NotEmpty(t, data, "marshaled data should not be empty") + + // Unmarshal back and verify round-trip + var unmarshaled SchedulingCalendarDelegationWebhookEvent + err = json.Unmarshal(data, &unmarshaled) + assert.NoError(t, err, "round-trip unmarshal should succeed") + }) + + t.Run("UnmarshalInvalidJSON", func(t *testing.T) { + t.Parallel() + var obj SchedulingCalendarDelegationWebhookEvent + err := json.Unmarshal([]byte(`{invalid json}`), &obj) + assert.Error(t, err, "unmarshaling invalid JSON should return an error") + }) + + t.Run("UnmarshalEmptyObject", func(t *testing.T) { + t.Parallel() + var obj SchedulingCalendarDelegationWebhookEvent + err := json.Unmarshal([]byte(`{}`), &obj) + assert.NoError(t, err, "unmarshaling empty object should succeed") + }) +} + +func TestJSONMarshalingSchedulingCalendarDelegationWebhookEventData(t *testing.T) { + t.Run("MarshalUnmarshal", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingCalendarDelegationWebhookEventData{} + + // Act - Marshal to JSON + data, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed") + assert.NotNil(t, data, "marshaled data should not be nil") + assert.NotEmpty(t, data, "marshaled data should not be empty") + + // Unmarshal back and verify round-trip + var unmarshaled SchedulingCalendarDelegationWebhookEventData + err = json.Unmarshal(data, &unmarshaled) + assert.NoError(t, err, "round-trip unmarshal should succeed") + }) + + t.Run("UnmarshalInvalidJSON", func(t *testing.T) { + t.Parallel() + var obj SchedulingCalendarDelegationWebhookEventData + err := json.Unmarshal([]byte(`{invalid json}`), &obj) + assert.Error(t, err, "unmarshaling invalid JSON should return an error") + }) + + t.Run("UnmarshalEmptyObject", func(t *testing.T) { + t.Parallel() + var obj SchedulingCalendarDelegationWebhookEventData + err := json.Unmarshal([]byte(`{}`), &obj) + assert.NoError(t, err, "unmarshaling empty object should succeed") + }) +} + +func TestJSONMarshalingSchedulingCalendarWebhookEvent(t *testing.T) { + t.Run("MarshalUnmarshal", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingCalendarWebhookEvent{} + + // Act - Marshal to JSON + data, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed") + assert.NotNil(t, data, "marshaled data should not be nil") + assert.NotEmpty(t, data, "marshaled data should not be empty") + + // Unmarshal back and verify round-trip + var unmarshaled SchedulingCalendarWebhookEvent + err = json.Unmarshal(data, &unmarshaled) + assert.NoError(t, err, "round-trip unmarshal should succeed") + }) + + t.Run("UnmarshalInvalidJSON", func(t *testing.T) { + t.Parallel() + var obj SchedulingCalendarWebhookEvent + err := json.Unmarshal([]byte(`{invalid json}`), &obj) + assert.Error(t, err, "unmarshaling invalid JSON should return an error") + }) + + t.Run("UnmarshalEmptyObject", func(t *testing.T) { + t.Parallel() + var obj SchedulingCalendarWebhookEvent + err := json.Unmarshal([]byte(`{}`), &obj) + assert.NoError(t, err, "unmarshaling empty object should succeed") + }) +} + +func TestJSONMarshalingSchedulingCalendarWebhookEventData(t *testing.T) { + t.Run("MarshalUnmarshal", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingCalendarWebhookEventData{} + + // Act - Marshal to JSON + data, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed") + assert.NotNil(t, data, "marshaled data should not be nil") + assert.NotEmpty(t, data, "marshaled data should not be empty") + + // Unmarshal back and verify round-trip + var unmarshaled SchedulingCalendarWebhookEventData + err = json.Unmarshal(data, &unmarshaled) + assert.NoError(t, err, "round-trip unmarshal should succeed") + }) + + t.Run("UnmarshalInvalidJSON", func(t *testing.T) { + t.Parallel() + var obj SchedulingCalendarWebhookEventData + err := json.Unmarshal([]byte(`{invalid json}`), &obj) + assert.Error(t, err, "unmarshaling invalid JSON should return an error") + }) + + t.Run("UnmarshalEmptyObject", func(t *testing.T) { + t.Parallel() + var obj SchedulingCalendarWebhookEventData + err := json.Unmarshal([]byte(`{}`), &obj) + assert.NoError(t, err, "unmarshaling empty object should succeed") + }) +} + +func TestJSONMarshalingSchedulingOauthAppWebhookEvent(t *testing.T) { + t.Run("MarshalUnmarshal", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &SchedulingOauthAppWebhookEvent{} // Act - Marshal to JSON data, err := json.Marshal(obj) @@ -20633,31 +23720,31 @@ func TestJSONMarshalingSchedulingBookingWebhookData(t *testing.T) { assert.NotEmpty(t, data, "marshaled data should not be empty") // Unmarshal back and verify round-trip - var unmarshaled SchedulingBookingWebhookData + var unmarshaled SchedulingOauthAppWebhookEvent err = json.Unmarshal(data, &unmarshaled) assert.NoError(t, err, "round-trip unmarshal should succeed") }) t.Run("UnmarshalInvalidJSON", func(t *testing.T) { t.Parallel() - var obj SchedulingBookingWebhookData + var obj SchedulingOauthAppWebhookEvent err := json.Unmarshal([]byte(`{invalid json}`), &obj) assert.Error(t, err, "unmarshaling invalid JSON should return an error") }) t.Run("UnmarshalEmptyObject", func(t *testing.T) { t.Parallel() - var obj SchedulingBookingWebhookData + var obj SchedulingOauthAppWebhookEvent err := json.Unmarshal([]byte(`{}`), &obj) assert.NoError(t, err, "unmarshaling empty object should succeed") }) } -func TestJSONMarshalingSchedulingBookingWebhookDataReminder(t *testing.T) { +func TestJSONMarshalingSchedulingOauthAppWebhookEventData(t *testing.T) { t.Run("MarshalUnmarshal", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingBookingWebhookDataReminder{} + obj := &SchedulingOauthAppWebhookEventData{} // Act - Marshal to JSON data, err := json.Marshal(obj) @@ -20666,31 +23753,31 @@ func TestJSONMarshalingSchedulingBookingWebhookDataReminder(t *testing.T) { assert.NotEmpty(t, data, "marshaled data should not be empty") // Unmarshal back and verify round-trip - var unmarshaled SchedulingBookingWebhookDataReminder + var unmarshaled SchedulingOauthAppWebhookEventData err = json.Unmarshal(data, &unmarshaled) assert.NoError(t, err, "round-trip unmarshal should succeed") }) t.Run("UnmarshalInvalidJSON", func(t *testing.T) { t.Parallel() - var obj SchedulingBookingWebhookDataReminder + var obj SchedulingOauthAppWebhookEventData err := json.Unmarshal([]byte(`{invalid json}`), &obj) assert.Error(t, err, "unmarshaling invalid JSON should return an error") }) t.Run("UnmarshalEmptyObject", func(t *testing.T) { t.Parallel() - var obj SchedulingBookingWebhookDataReminder + var obj SchedulingOauthAppWebhookEventData err := json.Unmarshal([]byte(`{}`), &obj) assert.NoError(t, err, "unmarshaling empty object should succeed") }) } -func TestJSONMarshalingSchedulingBookingWebhookEvent(t *testing.T) { +func TestJSONMarshalingSchedulingOutOfOfficeWebhookEvent(t *testing.T) { t.Run("MarshalUnmarshal", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingBookingWebhookEvent{} + obj := &SchedulingOutOfOfficeWebhookEvent{} // Act - Marshal to JSON data, err := json.Marshal(obj) @@ -20699,31 +23786,31 @@ func TestJSONMarshalingSchedulingBookingWebhookEvent(t *testing.T) { assert.NotEmpty(t, data, "marshaled data should not be empty") // Unmarshal back and verify round-trip - var unmarshaled SchedulingBookingWebhookEvent + var unmarshaled SchedulingOutOfOfficeWebhookEvent err = json.Unmarshal(data, &unmarshaled) assert.NoError(t, err, "round-trip unmarshal should succeed") }) t.Run("UnmarshalInvalidJSON", func(t *testing.T) { t.Parallel() - var obj SchedulingBookingWebhookEvent + var obj SchedulingOutOfOfficeWebhookEvent err := json.Unmarshal([]byte(`{invalid json}`), &obj) assert.Error(t, err, "unmarshaling invalid JSON should return an error") }) t.Run("UnmarshalEmptyObject", func(t *testing.T) { t.Parallel() - var obj SchedulingBookingWebhookEvent + var obj SchedulingOutOfOfficeWebhookEvent err := json.Unmarshal([]byte(`{}`), &obj) assert.NoError(t, err, "unmarshaling empty object should succeed") }) } -func TestJSONMarshalingSchedulingCalendarDelegationWebhookEvent(t *testing.T) { +func TestJSONMarshalingSchedulingOutOfOfficeWebhookEventData(t *testing.T) { t.Run("MarshalUnmarshal", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingCalendarDelegationWebhookEvent{} + obj := &SchedulingOutOfOfficeWebhookEventData{} // Act - Marshal to JSON data, err := json.Marshal(obj) @@ -20732,31 +23819,31 @@ func TestJSONMarshalingSchedulingCalendarDelegationWebhookEvent(t *testing.T) { assert.NotEmpty(t, data, "marshaled data should not be empty") // Unmarshal back and verify round-trip - var unmarshaled SchedulingCalendarDelegationWebhookEvent + var unmarshaled SchedulingOutOfOfficeWebhookEventData err = json.Unmarshal(data, &unmarshaled) assert.NoError(t, err, "round-trip unmarshal should succeed") }) t.Run("UnmarshalInvalidJSON", func(t *testing.T) { t.Parallel() - var obj SchedulingCalendarDelegationWebhookEvent + var obj SchedulingOutOfOfficeWebhookEventData err := json.Unmarshal([]byte(`{invalid json}`), &obj) assert.Error(t, err, "unmarshaling invalid JSON should return an error") }) t.Run("UnmarshalEmptyObject", func(t *testing.T) { t.Parallel() - var obj SchedulingCalendarDelegationWebhookEvent + var obj SchedulingOutOfOfficeWebhookEventData err := json.Unmarshal([]byte(`{}`), &obj) assert.NoError(t, err, "unmarshaling empty object should succeed") }) } -func TestJSONMarshalingSchedulingCalendarDelegationWebhookEventData(t *testing.T) { +func TestJSONMarshalingSchedulingReassignmentWebhookEvent(t *testing.T) { t.Run("MarshalUnmarshal", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingCalendarDelegationWebhookEventData{} + obj := &SchedulingReassignmentWebhookEvent{} // Act - Marshal to JSON data, err := json.Marshal(obj) @@ -20765,31 +23852,31 @@ func TestJSONMarshalingSchedulingCalendarDelegationWebhookEventData(t *testing.T assert.NotEmpty(t, data, "marshaled data should not be empty") // Unmarshal back and verify round-trip - var unmarshaled SchedulingCalendarDelegationWebhookEventData + var unmarshaled SchedulingReassignmentWebhookEvent err = json.Unmarshal(data, &unmarshaled) assert.NoError(t, err, "round-trip unmarshal should succeed") }) t.Run("UnmarshalInvalidJSON", func(t *testing.T) { t.Parallel() - var obj SchedulingCalendarDelegationWebhookEventData + var obj SchedulingReassignmentWebhookEvent err := json.Unmarshal([]byte(`{invalid json}`), &obj) assert.Error(t, err, "unmarshaling invalid JSON should return an error") }) t.Run("UnmarshalEmptyObject", func(t *testing.T) { t.Parallel() - var obj SchedulingCalendarDelegationWebhookEventData + var obj SchedulingReassignmentWebhookEvent err := json.Unmarshal([]byte(`{}`), &obj) assert.NoError(t, err, "unmarshaling empty object should succeed") }) } -func TestJSONMarshalingSchedulingCalendarWebhookEvent(t *testing.T) { +func TestJSONMarshalingSchedulingReassignmentWebhookEventData(t *testing.T) { t.Run("MarshalUnmarshal", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingCalendarWebhookEvent{} + obj := &SchedulingReassignmentWebhookEventData{} // Act - Marshal to JSON data, err := json.Marshal(obj) @@ -20798,31 +23885,31 @@ func TestJSONMarshalingSchedulingCalendarWebhookEvent(t *testing.T) { assert.NotEmpty(t, data, "marshaled data should not be empty") // Unmarshal back and verify round-trip - var unmarshaled SchedulingCalendarWebhookEvent + var unmarshaled SchedulingReassignmentWebhookEventData err = json.Unmarshal(data, &unmarshaled) assert.NoError(t, err, "round-trip unmarshal should succeed") }) t.Run("UnmarshalInvalidJSON", func(t *testing.T) { t.Parallel() - var obj SchedulingCalendarWebhookEvent + var obj SchedulingReassignmentWebhookEventData err := json.Unmarshal([]byte(`{invalid json}`), &obj) assert.Error(t, err, "unmarshaling invalid JSON should return an error") }) t.Run("UnmarshalEmptyObject", func(t *testing.T) { t.Parallel() - var obj SchedulingCalendarWebhookEvent + var obj SchedulingReassignmentWebhookEventData err := json.Unmarshal([]byte(`{}`), &obj) assert.NoError(t, err, "unmarshaling empty object should succeed") }) } -func TestJSONMarshalingSchedulingCalendarWebhookEventData(t *testing.T) { +func TestJSONMarshalingSchedulingReassignmentWebhookEventDataCounts(t *testing.T) { t.Run("MarshalUnmarshal", func(t *testing.T) { t.Parallel() // Arrange - obj := &SchedulingCalendarWebhookEventData{} + obj := &SchedulingReassignmentWebhookEventDataCounts{} // Act - Marshal to JSON data, err := json.Marshal(obj) @@ -20831,21 +23918,21 @@ func TestJSONMarshalingSchedulingCalendarWebhookEventData(t *testing.T) { assert.NotEmpty(t, data, "marshaled data should not be empty") // Unmarshal back and verify round-trip - var unmarshaled SchedulingCalendarWebhookEventData + var unmarshaled SchedulingReassignmentWebhookEventDataCounts err = json.Unmarshal(data, &unmarshaled) assert.NoError(t, err, "round-trip unmarshal should succeed") }) t.Run("UnmarshalInvalidJSON", func(t *testing.T) { t.Parallel() - var obj SchedulingCalendarWebhookEventData + var obj SchedulingReassignmentWebhookEventDataCounts err := json.Unmarshal([]byte(`{invalid json}`), &obj) assert.Error(t, err, "unmarshaling invalid JSON should return an error") }) t.Run("UnmarshalEmptyObject", func(t *testing.T) { t.Parallel() - var obj SchedulingCalendarWebhookEventData + var obj SchedulingReassignmentWebhookEventDataCounts err := json.Unmarshal([]byte(`{}`), &obj) assert.NoError(t, err, "unmarshaling empty object should succeed") }) @@ -22143,6 +25230,135 @@ func TestRequiredNullableRoundTripSchedulingCalendarDelegationWebhookEventData(t }) } +func TestRequiredNullableRoundTripSchedulingOauthAppWebhookEventData(t *testing.T) { + requiredNullableKeys := []string{ + "code", + } + marshalToMap := func(t *testing.T, obj *SchedulingOauthAppWebhookEventData) map[string]json.RawMessage { + data, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed") + var result map[string]json.RawMessage + require.NoError(t, json.Unmarshal(data, &result), "marshaled data should be a JSON object") + return result + } + + t.Run("NullPreserved", func(t *testing.T) { + t.Parallel() + var obj SchedulingOauthAppWebhookEventData + require.NoError(t, json.Unmarshal([]byte(`{"code":null}`), &obj)) + result := marshalToMap(t, &obj) + for _, key := range requiredNullableKeys { + value, ok := result[key] + require.True(t, ok, "required nullable field %q received as null should be present in the output", key) + assert.Equal(t, "null", string(value), "required nullable field %q received as null should be null in the output", key) + } + }) + + t.Run("AbsentStaysAbsent", func(t *testing.T) { + t.Parallel() + var obj SchedulingOauthAppWebhookEventData + require.NoError(t, json.Unmarshal([]byte(`{}`), &obj)) + result := marshalToMap(t, &obj) + for _, key := range requiredNullableKeys { + assert.NotContains(t, result, key, "required nullable field %q absent from the input should be absent from the output", key) + } + }) + + t.Run("FreshValueOmits", func(t *testing.T) { + t.Parallel() + result := marshalToMap(t, &SchedulingOauthAppWebhookEventData{}) + for _, key := range requiredNullableKeys { + assert.NotContains(t, result, key, "required nullable field %q should be omitted from a freshly constructed value", key) + } + }) +} + +func TestRequiredNullableRoundTripSchedulingOutOfOfficeWebhookEventData(t *testing.T) { + requiredNullableKeys := []string{ + "group", + } + marshalToMap := func(t *testing.T, obj *SchedulingOutOfOfficeWebhookEventData) map[string]json.RawMessage { + data, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed") + var result map[string]json.RawMessage + require.NoError(t, json.Unmarshal(data, &result), "marshaled data should be a JSON object") + return result + } + + t.Run("NullPreserved", func(t *testing.T) { + t.Parallel() + var obj SchedulingOutOfOfficeWebhookEventData + require.NoError(t, json.Unmarshal([]byte(`{"group":null}`), &obj)) + result := marshalToMap(t, &obj) + for _, key := range requiredNullableKeys { + value, ok := result[key] + require.True(t, ok, "required nullable field %q received as null should be present in the output", key) + assert.Equal(t, "null", string(value), "required nullable field %q received as null should be null in the output", key) + } + }) + + t.Run("AbsentStaysAbsent", func(t *testing.T) { + t.Parallel() + var obj SchedulingOutOfOfficeWebhookEventData + require.NoError(t, json.Unmarshal([]byte(`{}`), &obj)) + result := marshalToMap(t, &obj) + for _, key := range requiredNullableKeys { + assert.NotContains(t, result, key, "required nullable field %q absent from the input should be absent from the output", key) + } + }) + + t.Run("FreshValueOmits", func(t *testing.T) { + t.Parallel() + result := marshalToMap(t, &SchedulingOutOfOfficeWebhookEventData{}) + for _, key := range requiredNullableKeys { + assert.NotContains(t, result, key, "required nullable field %q should be omitted from a freshly constructed value", key) + } + }) +} + +func TestRequiredNullableRoundTripSchedulingReassignmentWebhookEventData(t *testing.T) { + requiredNullableKeys := []string{ + "out_of_office_id", + } + marshalToMap := func(t *testing.T, obj *SchedulingReassignmentWebhookEventData) map[string]json.RawMessage { + data, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed") + var result map[string]json.RawMessage + require.NoError(t, json.Unmarshal(data, &result), "marshaled data should be a JSON object") + return result + } + + t.Run("NullPreserved", func(t *testing.T) { + t.Parallel() + var obj SchedulingReassignmentWebhookEventData + require.NoError(t, json.Unmarshal([]byte(`{"out_of_office_id":null}`), &obj)) + result := marshalToMap(t, &obj) + for _, key := range requiredNullableKeys { + value, ok := result[key] + require.True(t, ok, "required nullable field %q received as null should be present in the output", key) + assert.Equal(t, "null", string(value), "required nullable field %q received as null should be null in the output", key) + } + }) + + t.Run("AbsentStaysAbsent", func(t *testing.T) { + t.Parallel() + var obj SchedulingReassignmentWebhookEventData + require.NoError(t, json.Unmarshal([]byte(`{}`), &obj)) + result := marshalToMap(t, &obj) + for _, key := range requiredNullableKeys { + assert.NotContains(t, result, key, "required nullable field %q absent from the input should be absent from the output", key) + } + }) + + t.Run("FreshValueOmits", func(t *testing.T) { + t.Parallel() + result := marshalToMap(t, &SchedulingReassignmentWebhookEventData{}) + for _, key := range requiredNullableKeys { + assert.NotContains(t, result, key, "required nullable field %q should be omitted from a freshly constructed value", key) + } + }) +} + func TestRequiredNullableRoundTripSignRequestWebhookEventData(t *testing.T) { requiredNullableKeys := []string{ "signer", @@ -22671,270 +25887,382 @@ func TestStringFormSubmissionWebhookEventData(t *testing.T) { func TestStringHookEndpointWebhookEvent(t *testing.T) { t.Run("StringMethod", func(t *testing.T) { t.Parallel() - obj := &HookEndpointWebhookEvent{} + obj := &HookEndpointWebhookEvent{} + result := obj.String() + assert.NotEmpty(t, result, "String() should return a non-empty representation") + }) + + t.Run("StringMethod_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *HookEndpointWebhookEvent + result := obj.String() + assert.Equal(t, "", result, "String() should return for nil receiver") + }) +} + +func TestStringHookEndpointWebhookEventData(t *testing.T) { + t.Run("StringMethod", func(t *testing.T) { + t.Parallel() + obj := &HookEndpointWebhookEventData{} + result := obj.String() + assert.NotEmpty(t, result, "String() should return a non-empty representation") + }) + + t.Run("StringMethod_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *HookEndpointWebhookEventData + result := obj.String() + assert.Equal(t, "", result, "String() should return for nil receiver") + }) +} + +func TestStringInboxMessageReceivedWebhookEvent(t *testing.T) { + t.Run("StringMethod", func(t *testing.T) { + t.Parallel() + obj := &InboxMessageReceivedWebhookEvent{} + result := obj.String() + assert.NotEmpty(t, result, "String() should return a non-empty representation") + }) + + t.Run("StringMethod_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *InboxMessageReceivedWebhookEvent + result := obj.String() + assert.Equal(t, "", result, "String() should return for nil receiver") + }) +} + +func TestStringInboxMessageReceivedWebhookEventData(t *testing.T) { + t.Run("StringMethod", func(t *testing.T) { + t.Parallel() + obj := &InboxMessageReceivedWebhookEventData{} + result := obj.String() + assert.NotEmpty(t, result, "String() should return a non-empty representation") + }) + + t.Run("StringMethod_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *InboxMessageReceivedWebhookEventData + result := obj.String() + assert.Equal(t, "", result, "String() should return for nil receiver") + }) +} + +func TestStringReceivedEmailWebhookEvent(t *testing.T) { + t.Run("StringMethod", func(t *testing.T) { + t.Parallel() + obj := &ReceivedEmailWebhookEvent{} + result := obj.String() + assert.NotEmpty(t, result, "String() should return a non-empty representation") + }) + + t.Run("StringMethod_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *ReceivedEmailWebhookEvent + result := obj.String() + assert.Equal(t, "", result, "String() should return for nil receiver") + }) +} + +func TestStringReceivedEmailWebhookEventData(t *testing.T) { + t.Run("StringMethod", func(t *testing.T) { + t.Parallel() + obj := &ReceivedEmailWebhookEventData{} + result := obj.String() + assert.NotEmpty(t, result, "String() should return a non-empty representation") + }) + + t.Run("StringMethod_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *ReceivedEmailWebhookEventData + result := obj.String() + assert.Equal(t, "", result, "String() should return for nil receiver") + }) +} + +func TestStringReceivedSmsWebhookEvent(t *testing.T) { + t.Run("StringMethod", func(t *testing.T) { + t.Parallel() + obj := &ReceivedSmsWebhookEvent{} + result := obj.String() + assert.NotEmpty(t, result, "String() should return a non-empty representation") + }) + + t.Run("StringMethod_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *ReceivedSmsWebhookEvent + result := obj.String() + assert.Equal(t, "", result, "String() should return for nil receiver") + }) +} + +func TestStringReceivedSmsWebhookEventData(t *testing.T) { + t.Run("StringMethod", func(t *testing.T) { + t.Parallel() + obj := &ReceivedSmsWebhookEventData{} result := obj.String() assert.NotEmpty(t, result, "String() should return a non-empty representation") }) t.Run("StringMethod_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *HookEndpointWebhookEvent + var obj *ReceivedSmsWebhookEventData result := obj.String() assert.Equal(t, "", result, "String() should return for nil receiver") }) } -func TestStringHookEndpointWebhookEventData(t *testing.T) { +func TestStringRiskWebhookEvent(t *testing.T) { t.Run("StringMethod", func(t *testing.T) { t.Parallel() - obj := &HookEndpointWebhookEventData{} + obj := &RiskWebhookEvent{} result := obj.String() assert.NotEmpty(t, result, "String() should return a non-empty representation") }) t.Run("StringMethod_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *HookEndpointWebhookEventData + var obj *RiskWebhookEvent result := obj.String() assert.Equal(t, "", result, "String() should return for nil receiver") }) } -func TestStringInboxMessageReceivedWebhookEvent(t *testing.T) { +func TestStringRiskWebhookEventData(t *testing.T) { t.Run("StringMethod", func(t *testing.T) { t.Parallel() - obj := &InboxMessageReceivedWebhookEvent{} + obj := &RiskWebhookEventData{} result := obj.String() assert.NotEmpty(t, result, "String() should return a non-empty representation") }) t.Run("StringMethod_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *InboxMessageReceivedWebhookEvent + var obj *RiskWebhookEventData result := obj.String() assert.Equal(t, "", result, "String() should return for nil receiver") }) } -func TestStringInboxMessageReceivedWebhookEventData(t *testing.T) { +func TestStringSchedulingBookingWebhookData(t *testing.T) { t.Run("StringMethod", func(t *testing.T) { t.Parallel() - obj := &InboxMessageReceivedWebhookEventData{} + obj := &SchedulingBookingWebhookData{} result := obj.String() assert.NotEmpty(t, result, "String() should return a non-empty representation") }) t.Run("StringMethod_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *InboxMessageReceivedWebhookEventData + var obj *SchedulingBookingWebhookData result := obj.String() assert.Equal(t, "", result, "String() should return for nil receiver") }) } -func TestStringReceivedEmailWebhookEvent(t *testing.T) { +func TestStringSchedulingBookingWebhookDataReminder(t *testing.T) { t.Run("StringMethod", func(t *testing.T) { t.Parallel() - obj := &ReceivedEmailWebhookEvent{} + obj := &SchedulingBookingWebhookDataReminder{} result := obj.String() assert.NotEmpty(t, result, "String() should return a non-empty representation") }) t.Run("StringMethod_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *ReceivedEmailWebhookEvent + var obj *SchedulingBookingWebhookDataReminder result := obj.String() assert.Equal(t, "", result, "String() should return for nil receiver") }) } -func TestStringReceivedEmailWebhookEventData(t *testing.T) { +func TestStringSchedulingBookingWebhookEvent(t *testing.T) { t.Run("StringMethod", func(t *testing.T) { t.Parallel() - obj := &ReceivedEmailWebhookEventData{} + obj := &SchedulingBookingWebhookEvent{} result := obj.String() assert.NotEmpty(t, result, "String() should return a non-empty representation") }) t.Run("StringMethod_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *ReceivedEmailWebhookEventData + var obj *SchedulingBookingWebhookEvent result := obj.String() assert.Equal(t, "", result, "String() should return for nil receiver") }) } -func TestStringReceivedSmsWebhookEvent(t *testing.T) { +func TestStringSchedulingCalendarDelegationWebhookEvent(t *testing.T) { t.Run("StringMethod", func(t *testing.T) { t.Parallel() - obj := &ReceivedSmsWebhookEvent{} + obj := &SchedulingCalendarDelegationWebhookEvent{} result := obj.String() assert.NotEmpty(t, result, "String() should return a non-empty representation") }) t.Run("StringMethod_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *ReceivedSmsWebhookEvent + var obj *SchedulingCalendarDelegationWebhookEvent result := obj.String() assert.Equal(t, "", result, "String() should return for nil receiver") }) } -func TestStringReceivedSmsWebhookEventData(t *testing.T) { +func TestStringSchedulingCalendarDelegationWebhookEventData(t *testing.T) { t.Run("StringMethod", func(t *testing.T) { t.Parallel() - obj := &ReceivedSmsWebhookEventData{} + obj := &SchedulingCalendarDelegationWebhookEventData{} result := obj.String() assert.NotEmpty(t, result, "String() should return a non-empty representation") }) t.Run("StringMethod_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *ReceivedSmsWebhookEventData + var obj *SchedulingCalendarDelegationWebhookEventData result := obj.String() assert.Equal(t, "", result, "String() should return for nil receiver") }) } -func TestStringRiskWebhookEvent(t *testing.T) { +func TestStringSchedulingCalendarWebhookEvent(t *testing.T) { t.Run("StringMethod", func(t *testing.T) { t.Parallel() - obj := &RiskWebhookEvent{} + obj := &SchedulingCalendarWebhookEvent{} result := obj.String() assert.NotEmpty(t, result, "String() should return a non-empty representation") }) t.Run("StringMethod_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *RiskWebhookEvent + var obj *SchedulingCalendarWebhookEvent result := obj.String() assert.Equal(t, "", result, "String() should return for nil receiver") }) } -func TestStringRiskWebhookEventData(t *testing.T) { +func TestStringSchedulingCalendarWebhookEventData(t *testing.T) { t.Run("StringMethod", func(t *testing.T) { t.Parallel() - obj := &RiskWebhookEventData{} + obj := &SchedulingCalendarWebhookEventData{} result := obj.String() assert.NotEmpty(t, result, "String() should return a non-empty representation") }) t.Run("StringMethod_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *RiskWebhookEventData + var obj *SchedulingCalendarWebhookEventData result := obj.String() assert.Equal(t, "", result, "String() should return for nil receiver") }) } -func TestStringSchedulingBookingWebhookData(t *testing.T) { +func TestStringSchedulingOauthAppWebhookEvent(t *testing.T) { t.Run("StringMethod", func(t *testing.T) { t.Parallel() - obj := &SchedulingBookingWebhookData{} + obj := &SchedulingOauthAppWebhookEvent{} result := obj.String() assert.NotEmpty(t, result, "String() should return a non-empty representation") }) t.Run("StringMethod_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *SchedulingBookingWebhookData + var obj *SchedulingOauthAppWebhookEvent result := obj.String() assert.Equal(t, "", result, "String() should return for nil receiver") }) } -func TestStringSchedulingBookingWebhookDataReminder(t *testing.T) { +func TestStringSchedulingOauthAppWebhookEventData(t *testing.T) { t.Run("StringMethod", func(t *testing.T) { t.Parallel() - obj := &SchedulingBookingWebhookDataReminder{} + obj := &SchedulingOauthAppWebhookEventData{} result := obj.String() assert.NotEmpty(t, result, "String() should return a non-empty representation") }) t.Run("StringMethod_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *SchedulingBookingWebhookDataReminder + var obj *SchedulingOauthAppWebhookEventData result := obj.String() assert.Equal(t, "", result, "String() should return for nil receiver") }) } -func TestStringSchedulingBookingWebhookEvent(t *testing.T) { +func TestStringSchedulingOutOfOfficeWebhookEvent(t *testing.T) { t.Run("StringMethod", func(t *testing.T) { t.Parallel() - obj := &SchedulingBookingWebhookEvent{} + obj := &SchedulingOutOfOfficeWebhookEvent{} result := obj.String() assert.NotEmpty(t, result, "String() should return a non-empty representation") }) t.Run("StringMethod_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *SchedulingBookingWebhookEvent + var obj *SchedulingOutOfOfficeWebhookEvent result := obj.String() assert.Equal(t, "", result, "String() should return for nil receiver") }) } -func TestStringSchedulingCalendarDelegationWebhookEvent(t *testing.T) { +func TestStringSchedulingOutOfOfficeWebhookEventData(t *testing.T) { t.Run("StringMethod", func(t *testing.T) { t.Parallel() - obj := &SchedulingCalendarDelegationWebhookEvent{} + obj := &SchedulingOutOfOfficeWebhookEventData{} result := obj.String() assert.NotEmpty(t, result, "String() should return a non-empty representation") }) t.Run("StringMethod_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *SchedulingCalendarDelegationWebhookEvent + var obj *SchedulingOutOfOfficeWebhookEventData result := obj.String() assert.Equal(t, "", result, "String() should return for nil receiver") }) } -func TestStringSchedulingCalendarDelegationWebhookEventData(t *testing.T) { +func TestStringSchedulingReassignmentWebhookEvent(t *testing.T) { t.Run("StringMethod", func(t *testing.T) { t.Parallel() - obj := &SchedulingCalendarDelegationWebhookEventData{} + obj := &SchedulingReassignmentWebhookEvent{} result := obj.String() assert.NotEmpty(t, result, "String() should return a non-empty representation") }) t.Run("StringMethod_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *SchedulingCalendarDelegationWebhookEventData + var obj *SchedulingReassignmentWebhookEvent result := obj.String() assert.Equal(t, "", result, "String() should return for nil receiver") }) } -func TestStringSchedulingCalendarWebhookEvent(t *testing.T) { +func TestStringSchedulingReassignmentWebhookEventData(t *testing.T) { t.Run("StringMethod", func(t *testing.T) { t.Parallel() - obj := &SchedulingCalendarWebhookEvent{} + obj := &SchedulingReassignmentWebhookEventData{} result := obj.String() assert.NotEmpty(t, result, "String() should return a non-empty representation") }) t.Run("StringMethod_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *SchedulingCalendarWebhookEvent + var obj *SchedulingReassignmentWebhookEventData result := obj.String() assert.Equal(t, "", result, "String() should return for nil receiver") }) } -func TestStringSchedulingCalendarWebhookEventData(t *testing.T) { +func TestStringSchedulingReassignmentWebhookEventDataCounts(t *testing.T) { t.Run("StringMethod", func(t *testing.T) { t.Parallel() - obj := &SchedulingCalendarWebhookEventData{} + obj := &SchedulingReassignmentWebhookEventDataCounts{} result := obj.String() assert.NotEmpty(t, result, "String() should return a non-empty representation") }) t.Run("StringMethod_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *SchedulingCalendarWebhookEventData + var obj *SchedulingReassignmentWebhookEventDataCounts result := obj.String() assert.Equal(t, "", result, "String() should return for nil receiver") }) @@ -24040,6 +27368,13 @@ func TestEnumCreateTestWebhookEventRequestType(t *testing.T) { assert.Equal(t, CreateTestWebhookEventRequestType("scheduling.booking.location_ready"), val, "enum value should match expected wire value") }) + t.Run("NewFromString_scheduling_booking_reassigned", func(t *testing.T) { + t.Parallel() + val, err := NewCreateTestWebhookEventRequestTypeFromString("scheduling.booking.reassigned") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, CreateTestWebhookEventRequestType("scheduling.booking.reassigned"), val, "enum value should match expected wire value") + }) + t.Run("NewFromString_scheduling_booking_started", func(t *testing.T) { t.Parallel() val, err := NewCreateTestWebhookEventRequestTypeFromString("scheduling.booking.started") @@ -24096,6 +27431,62 @@ func TestEnumCreateTestWebhookEventRequestType(t *testing.T) { assert.Equal(t, CreateTestWebhookEventRequestType("scheduling.calendar_delegation.restored"), val, "enum value should match expected wire value") }) + t.Run("NewFromString_scheduling_out_of_office_created", func(t *testing.T) { + t.Parallel() + val, err := NewCreateTestWebhookEventRequestTypeFromString("scheduling.out_of_office.created") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, CreateTestWebhookEventRequestType("scheduling.out_of_office.created"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_scheduling_out_of_office_updated", func(t *testing.T) { + t.Parallel() + val, err := NewCreateTestWebhookEventRequestTypeFromString("scheduling.out_of_office.updated") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, CreateTestWebhookEventRequestType("scheduling.out_of_office.updated"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_scheduling_out_of_office_deleted", func(t *testing.T) { + t.Parallel() + val, err := NewCreateTestWebhookEventRequestTypeFromString("scheduling.out_of_office.deleted") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, CreateTestWebhookEventRequestType("scheduling.out_of_office.deleted"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_scheduling_out_of_office_started", func(t *testing.T) { + t.Parallel() + val, err := NewCreateTestWebhookEventRequestTypeFromString("scheduling.out_of_office.started") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, CreateTestWebhookEventRequestType("scheduling.out_of_office.started"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_scheduling_out_of_office_ended", func(t *testing.T) { + t.Parallel() + val, err := NewCreateTestWebhookEventRequestTypeFromString("scheduling.out_of_office.ended") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, CreateTestWebhookEventRequestType("scheduling.out_of_office.ended"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_scheduling_reassignment_completed", func(t *testing.T) { + t.Parallel() + val, err := NewCreateTestWebhookEventRequestTypeFromString("scheduling.reassignment.completed") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, CreateTestWebhookEventRequestType("scheduling.reassignment.completed"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_scheduling_oauth_app_failing", func(t *testing.T) { + t.Parallel() + val, err := NewCreateTestWebhookEventRequestTypeFromString("scheduling.oauth_app.failing") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, CreateTestWebhookEventRequestType("scheduling.oauth_app.failing"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_scheduling_oauth_app_restored", func(t *testing.T) { + t.Parallel() + val, err := NewCreateTestWebhookEventRequestTypeFromString("scheduling.oauth_app.restored") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, CreateTestWebhookEventRequestType("scheduling.oauth_app.restored"), val, "enum value should match expected wire value") + }) + t.Run("NewFromString_Invalid", func(t *testing.T) { _, err := NewCreateTestWebhookEventRequestTypeFromString("invalid_value_that_does_not_exist") assert.Error(t, err) @@ -24931,55 +28322,222 @@ func TestEnumSchedulingBookingWebhookEventType(t *testing.T) { assert.Equal(t, SchedulingBookingWebhookEventType("scheduling.booking.no_show"), val, "enum value should match expected wire value") }) - t.Run("NewFromString_scheduling_booking_external_conflict", func(t *testing.T) { + t.Run("NewFromString_scheduling_booking_external_conflict", func(t *testing.T) { + t.Parallel() + val, err := NewSchedulingBookingWebhookEventTypeFromString("scheduling.booking.external_conflict") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, SchedulingBookingWebhookEventType("scheduling.booking.external_conflict"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_scheduling_booking_calendar_write_failed", func(t *testing.T) { + t.Parallel() + val, err := NewSchedulingBookingWebhookEventTypeFromString("scheduling.booking.calendar_write_failed") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, SchedulingBookingWebhookEventType("scheduling.booking.calendar_write_failed"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_scheduling_booking_location_ready", func(t *testing.T) { + t.Parallel() + val, err := NewSchedulingBookingWebhookEventTypeFromString("scheduling.booking.location_ready") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, SchedulingBookingWebhookEventType("scheduling.booking.location_ready"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_scheduling_booking_reassigned", func(t *testing.T) { + t.Parallel() + val, err := NewSchedulingBookingWebhookEventTypeFromString("scheduling.booking.reassigned") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, SchedulingBookingWebhookEventType("scheduling.booking.reassigned"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_scheduling_booking_started", func(t *testing.T) { + t.Parallel() + val, err := NewSchedulingBookingWebhookEventTypeFromString("scheduling.booking.started") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, SchedulingBookingWebhookEventType("scheduling.booking.started"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_scheduling_booking_ended", func(t *testing.T) { + t.Parallel() + val, err := NewSchedulingBookingWebhookEventTypeFromString("scheduling.booking.ended") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, SchedulingBookingWebhookEventType("scheduling.booking.ended"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_scheduling_booking_reminder", func(t *testing.T) { + t.Parallel() + val, err := NewSchedulingBookingWebhookEventTypeFromString("scheduling.booking.reminder") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, SchedulingBookingWebhookEventType("scheduling.booking.reminder"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_Invalid", func(t *testing.T) { + _, err := NewSchedulingBookingWebhookEventTypeFromString("invalid_value_that_does_not_exist") + assert.Error(t, err) + }) + + t.Run("Ptr", func(t *testing.T) { + val, err := NewSchedulingBookingWebhookEventTypeFromString("scheduling.booking.created") + assert.NoError(t, err) + ptr := val.Ptr() + assert.NotNil(t, ptr) + assert.Equal(t, val, *ptr) + }) +} + +func TestEnumSchedulingCalendarDelegationWebhookEventObject(t *testing.T) { + t.Run("NewFromString_event", func(t *testing.T) { + t.Parallel() + val, err := NewSchedulingCalendarDelegationWebhookEventObjectFromString("event") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, SchedulingCalendarDelegationWebhookEventObject("event"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_Invalid", func(t *testing.T) { + _, err := NewSchedulingCalendarDelegationWebhookEventObjectFromString("invalid_value_that_does_not_exist") + assert.Error(t, err) + }) + + t.Run("Ptr", func(t *testing.T) { + val, err := NewSchedulingCalendarDelegationWebhookEventObjectFromString("event") + assert.NoError(t, err) + ptr := val.Ptr() + assert.NotNil(t, ptr) + assert.Equal(t, val, *ptr) + }) +} + +func TestEnumSchedulingCalendarDelegationWebhookEventType(t *testing.T) { + t.Run("NewFromString_scheduling_calendar_delegation_failing", func(t *testing.T) { + t.Parallel() + val, err := NewSchedulingCalendarDelegationWebhookEventTypeFromString("scheduling.calendar_delegation.failing") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, SchedulingCalendarDelegationWebhookEventType("scheduling.calendar_delegation.failing"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_scheduling_calendar_delegation_restored", func(t *testing.T) { + t.Parallel() + val, err := NewSchedulingCalendarDelegationWebhookEventTypeFromString("scheduling.calendar_delegation.restored") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, SchedulingCalendarDelegationWebhookEventType("scheduling.calendar_delegation.restored"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_Invalid", func(t *testing.T) { + _, err := NewSchedulingCalendarDelegationWebhookEventTypeFromString("invalid_value_that_does_not_exist") + assert.Error(t, err) + }) + + t.Run("Ptr", func(t *testing.T) { + val, err := NewSchedulingCalendarDelegationWebhookEventTypeFromString("scheduling.calendar_delegation.failing") + assert.NoError(t, err) + ptr := val.Ptr() + assert.NotNil(t, ptr) + assert.Equal(t, val, *ptr) + }) +} + +func TestEnumSchedulingCalendarWebhookEventObject(t *testing.T) { + t.Run("NewFromString_event", func(t *testing.T) { + t.Parallel() + val, err := NewSchedulingCalendarWebhookEventObjectFromString("event") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, SchedulingCalendarWebhookEventObject("event"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_Invalid", func(t *testing.T) { + _, err := NewSchedulingCalendarWebhookEventObjectFromString("invalid_value_that_does_not_exist") + assert.Error(t, err) + }) + + t.Run("Ptr", func(t *testing.T) { + val, err := NewSchedulingCalendarWebhookEventObjectFromString("event") + assert.NoError(t, err) + ptr := val.Ptr() + assert.NotNil(t, ptr) + assert.Equal(t, val, *ptr) + }) +} + +func TestEnumSchedulingCalendarWebhookEventType(t *testing.T) { + t.Run("NewFromString_scheduling_calendar_connected", func(t *testing.T) { + t.Parallel() + val, err := NewSchedulingCalendarWebhookEventTypeFromString("scheduling.calendar.connected") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, SchedulingCalendarWebhookEventType("scheduling.calendar.connected"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_scheduling_calendar_needs_reauth", func(t *testing.T) { t.Parallel() - val, err := NewSchedulingBookingWebhookEventTypeFromString("scheduling.booking.external_conflict") + val, err := NewSchedulingCalendarWebhookEventTypeFromString("scheduling.calendar.needs_reauth") assert.NoError(t, err, "valid enum value should not return error") - assert.Equal(t, SchedulingBookingWebhookEventType("scheduling.booking.external_conflict"), val, "enum value should match expected wire value") + assert.Equal(t, SchedulingCalendarWebhookEventType("scheduling.calendar.needs_reauth"), val, "enum value should match expected wire value") }) - t.Run("NewFromString_scheduling_booking_calendar_write_failed", func(t *testing.T) { + t.Run("NewFromString_scheduling_calendar_disconnected", func(t *testing.T) { t.Parallel() - val, err := NewSchedulingBookingWebhookEventTypeFromString("scheduling.booking.calendar_write_failed") + val, err := NewSchedulingCalendarWebhookEventTypeFromString("scheduling.calendar.disconnected") assert.NoError(t, err, "valid enum value should not return error") - assert.Equal(t, SchedulingBookingWebhookEventType("scheduling.booking.calendar_write_failed"), val, "enum value should match expected wire value") + assert.Equal(t, SchedulingCalendarWebhookEventType("scheduling.calendar.disconnected"), val, "enum value should match expected wire value") }) - t.Run("NewFromString_scheduling_booking_location_ready", func(t *testing.T) { - t.Parallel() - val, err := NewSchedulingBookingWebhookEventTypeFromString("scheduling.booking.location_ready") - assert.NoError(t, err, "valid enum value should not return error") - assert.Equal(t, SchedulingBookingWebhookEventType("scheduling.booking.location_ready"), val, "enum value should match expected wire value") + t.Run("NewFromString_Invalid", func(t *testing.T) { + _, err := NewSchedulingCalendarWebhookEventTypeFromString("invalid_value_that_does_not_exist") + assert.Error(t, err) }) - t.Run("NewFromString_scheduling_booking_started", func(t *testing.T) { + t.Run("Ptr", func(t *testing.T) { + val, err := NewSchedulingCalendarWebhookEventTypeFromString("scheduling.calendar.connected") + assert.NoError(t, err) + ptr := val.Ptr() + assert.NotNil(t, ptr) + assert.Equal(t, val, *ptr) + }) +} + +func TestEnumSchedulingOauthAppWebhookEventObject(t *testing.T) { + t.Run("NewFromString_event", func(t *testing.T) { t.Parallel() - val, err := NewSchedulingBookingWebhookEventTypeFromString("scheduling.booking.started") + val, err := NewSchedulingOauthAppWebhookEventObjectFromString("event") assert.NoError(t, err, "valid enum value should not return error") - assert.Equal(t, SchedulingBookingWebhookEventType("scheduling.booking.started"), val, "enum value should match expected wire value") + assert.Equal(t, SchedulingOauthAppWebhookEventObject("event"), val, "enum value should match expected wire value") }) - t.Run("NewFromString_scheduling_booking_ended", func(t *testing.T) { + t.Run("NewFromString_Invalid", func(t *testing.T) { + _, err := NewSchedulingOauthAppWebhookEventObjectFromString("invalid_value_that_does_not_exist") + assert.Error(t, err) + }) + + t.Run("Ptr", func(t *testing.T) { + val, err := NewSchedulingOauthAppWebhookEventObjectFromString("event") + assert.NoError(t, err) + ptr := val.Ptr() + assert.NotNil(t, ptr) + assert.Equal(t, val, *ptr) + }) +} + +func TestEnumSchedulingOauthAppWebhookEventType(t *testing.T) { + t.Run("NewFromString_scheduling_oauth_app_failing", func(t *testing.T) { t.Parallel() - val, err := NewSchedulingBookingWebhookEventTypeFromString("scheduling.booking.ended") + val, err := NewSchedulingOauthAppWebhookEventTypeFromString("scheduling.oauth_app.failing") assert.NoError(t, err, "valid enum value should not return error") - assert.Equal(t, SchedulingBookingWebhookEventType("scheduling.booking.ended"), val, "enum value should match expected wire value") + assert.Equal(t, SchedulingOauthAppWebhookEventType("scheduling.oauth_app.failing"), val, "enum value should match expected wire value") }) - t.Run("NewFromString_scheduling_booking_reminder", func(t *testing.T) { + t.Run("NewFromString_scheduling_oauth_app_restored", func(t *testing.T) { t.Parallel() - val, err := NewSchedulingBookingWebhookEventTypeFromString("scheduling.booking.reminder") + val, err := NewSchedulingOauthAppWebhookEventTypeFromString("scheduling.oauth_app.restored") assert.NoError(t, err, "valid enum value should not return error") - assert.Equal(t, SchedulingBookingWebhookEventType("scheduling.booking.reminder"), val, "enum value should match expected wire value") + assert.Equal(t, SchedulingOauthAppWebhookEventType("scheduling.oauth_app.restored"), val, "enum value should match expected wire value") }) t.Run("NewFromString_Invalid", func(t *testing.T) { - _, err := NewSchedulingBookingWebhookEventTypeFromString("invalid_value_that_does_not_exist") + _, err := NewSchedulingOauthAppWebhookEventTypeFromString("invalid_value_that_does_not_exist") assert.Error(t, err) }) t.Run("Ptr", func(t *testing.T) { - val, err := NewSchedulingBookingWebhookEventTypeFromString("scheduling.booking.created") + val, err := NewSchedulingOauthAppWebhookEventTypeFromString("scheduling.oauth_app.failing") assert.NoError(t, err) ptr := val.Ptr() assert.NotNil(t, ptr) @@ -24987,21 +28545,21 @@ func TestEnumSchedulingBookingWebhookEventType(t *testing.T) { }) } -func TestEnumSchedulingCalendarDelegationWebhookEventObject(t *testing.T) { +func TestEnumSchedulingOutOfOfficeWebhookEventObject(t *testing.T) { t.Run("NewFromString_event", func(t *testing.T) { t.Parallel() - val, err := NewSchedulingCalendarDelegationWebhookEventObjectFromString("event") + val, err := NewSchedulingOutOfOfficeWebhookEventObjectFromString("event") assert.NoError(t, err, "valid enum value should not return error") - assert.Equal(t, SchedulingCalendarDelegationWebhookEventObject("event"), val, "enum value should match expected wire value") + assert.Equal(t, SchedulingOutOfOfficeWebhookEventObject("event"), val, "enum value should match expected wire value") }) t.Run("NewFromString_Invalid", func(t *testing.T) { - _, err := NewSchedulingCalendarDelegationWebhookEventObjectFromString("invalid_value_that_does_not_exist") + _, err := NewSchedulingOutOfOfficeWebhookEventObjectFromString("invalid_value_that_does_not_exist") assert.Error(t, err) }) t.Run("Ptr", func(t *testing.T) { - val, err := NewSchedulingCalendarDelegationWebhookEventObjectFromString("event") + val, err := NewSchedulingOutOfOfficeWebhookEventObjectFromString("event") assert.NoError(t, err) ptr := val.Ptr() assert.NotNil(t, ptr) @@ -25009,28 +28567,49 @@ func TestEnumSchedulingCalendarDelegationWebhookEventObject(t *testing.T) { }) } -func TestEnumSchedulingCalendarDelegationWebhookEventType(t *testing.T) { - t.Run("NewFromString_scheduling_calendar_delegation_failing", func(t *testing.T) { +func TestEnumSchedulingOutOfOfficeWebhookEventType(t *testing.T) { + t.Run("NewFromString_scheduling_out_of_office_created", func(t *testing.T) { t.Parallel() - val, err := NewSchedulingCalendarDelegationWebhookEventTypeFromString("scheduling.calendar_delegation.failing") + val, err := NewSchedulingOutOfOfficeWebhookEventTypeFromString("scheduling.out_of_office.created") assert.NoError(t, err, "valid enum value should not return error") - assert.Equal(t, SchedulingCalendarDelegationWebhookEventType("scheduling.calendar_delegation.failing"), val, "enum value should match expected wire value") + assert.Equal(t, SchedulingOutOfOfficeWebhookEventType("scheduling.out_of_office.created"), val, "enum value should match expected wire value") }) - t.Run("NewFromString_scheduling_calendar_delegation_restored", func(t *testing.T) { + t.Run("NewFromString_scheduling_out_of_office_updated", func(t *testing.T) { t.Parallel() - val, err := NewSchedulingCalendarDelegationWebhookEventTypeFromString("scheduling.calendar_delegation.restored") + val, err := NewSchedulingOutOfOfficeWebhookEventTypeFromString("scheduling.out_of_office.updated") assert.NoError(t, err, "valid enum value should not return error") - assert.Equal(t, SchedulingCalendarDelegationWebhookEventType("scheduling.calendar_delegation.restored"), val, "enum value should match expected wire value") + assert.Equal(t, SchedulingOutOfOfficeWebhookEventType("scheduling.out_of_office.updated"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_scheduling_out_of_office_deleted", func(t *testing.T) { + t.Parallel() + val, err := NewSchedulingOutOfOfficeWebhookEventTypeFromString("scheduling.out_of_office.deleted") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, SchedulingOutOfOfficeWebhookEventType("scheduling.out_of_office.deleted"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_scheduling_out_of_office_started", func(t *testing.T) { + t.Parallel() + val, err := NewSchedulingOutOfOfficeWebhookEventTypeFromString("scheduling.out_of_office.started") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, SchedulingOutOfOfficeWebhookEventType("scheduling.out_of_office.started"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_scheduling_out_of_office_ended", func(t *testing.T) { + t.Parallel() + val, err := NewSchedulingOutOfOfficeWebhookEventTypeFromString("scheduling.out_of_office.ended") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, SchedulingOutOfOfficeWebhookEventType("scheduling.out_of_office.ended"), val, "enum value should match expected wire value") }) t.Run("NewFromString_Invalid", func(t *testing.T) { - _, err := NewSchedulingCalendarDelegationWebhookEventTypeFromString("invalid_value_that_does_not_exist") + _, err := NewSchedulingOutOfOfficeWebhookEventTypeFromString("invalid_value_that_does_not_exist") assert.Error(t, err) }) t.Run("Ptr", func(t *testing.T) { - val, err := NewSchedulingCalendarDelegationWebhookEventTypeFromString("scheduling.calendar_delegation.failing") + val, err := NewSchedulingOutOfOfficeWebhookEventTypeFromString("scheduling.out_of_office.created") assert.NoError(t, err) ptr := val.Ptr() assert.NotNil(t, ptr) @@ -25038,21 +28617,28 @@ func TestEnumSchedulingCalendarDelegationWebhookEventType(t *testing.T) { }) } -func TestEnumSchedulingCalendarWebhookEventObject(t *testing.T) { - t.Run("NewFromString_event", func(t *testing.T) { +func TestEnumSchedulingReassignmentWebhookEventDataStatus(t *testing.T) { + t.Run("NewFromString_completed", func(t *testing.T) { t.Parallel() - val, err := NewSchedulingCalendarWebhookEventObjectFromString("event") + val, err := NewSchedulingReassignmentWebhookEventDataStatusFromString("completed") assert.NoError(t, err, "valid enum value should not return error") - assert.Equal(t, SchedulingCalendarWebhookEventObject("event"), val, "enum value should match expected wire value") + assert.Equal(t, SchedulingReassignmentWebhookEventDataStatus("completed"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_cancelled", func(t *testing.T) { + t.Parallel() + val, err := NewSchedulingReassignmentWebhookEventDataStatusFromString("cancelled") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, SchedulingReassignmentWebhookEventDataStatus("cancelled"), val, "enum value should match expected wire value") }) t.Run("NewFromString_Invalid", func(t *testing.T) { - _, err := NewSchedulingCalendarWebhookEventObjectFromString("invalid_value_that_does_not_exist") + _, err := NewSchedulingReassignmentWebhookEventDataStatusFromString("invalid_value_that_does_not_exist") assert.Error(t, err) }) t.Run("Ptr", func(t *testing.T) { - val, err := NewSchedulingCalendarWebhookEventObjectFromString("event") + val, err := NewSchedulingReassignmentWebhookEventDataStatusFromString("completed") assert.NoError(t, err) ptr := val.Ptr() assert.NotNil(t, ptr) @@ -25060,35 +28646,43 @@ func TestEnumSchedulingCalendarWebhookEventObject(t *testing.T) { }) } -func TestEnumSchedulingCalendarWebhookEventType(t *testing.T) { - t.Run("NewFromString_scheduling_calendar_connected", func(t *testing.T) { +func TestEnumSchedulingReassignmentWebhookEventObject(t *testing.T) { + t.Run("NewFromString_event", func(t *testing.T) { t.Parallel() - val, err := NewSchedulingCalendarWebhookEventTypeFromString("scheduling.calendar.connected") + val, err := NewSchedulingReassignmentWebhookEventObjectFromString("event") assert.NoError(t, err, "valid enum value should not return error") - assert.Equal(t, SchedulingCalendarWebhookEventType("scheduling.calendar.connected"), val, "enum value should match expected wire value") + assert.Equal(t, SchedulingReassignmentWebhookEventObject("event"), val, "enum value should match expected wire value") }) - t.Run("NewFromString_scheduling_calendar_needs_reauth", func(t *testing.T) { - t.Parallel() - val, err := NewSchedulingCalendarWebhookEventTypeFromString("scheduling.calendar.needs_reauth") - assert.NoError(t, err, "valid enum value should not return error") - assert.Equal(t, SchedulingCalendarWebhookEventType("scheduling.calendar.needs_reauth"), val, "enum value should match expected wire value") + t.Run("NewFromString_Invalid", func(t *testing.T) { + _, err := NewSchedulingReassignmentWebhookEventObjectFromString("invalid_value_that_does_not_exist") + assert.Error(t, err) }) - t.Run("NewFromString_scheduling_calendar_disconnected", func(t *testing.T) { + t.Run("Ptr", func(t *testing.T) { + val, err := NewSchedulingReassignmentWebhookEventObjectFromString("event") + assert.NoError(t, err) + ptr := val.Ptr() + assert.NotNil(t, ptr) + assert.Equal(t, val, *ptr) + }) +} + +func TestEnumSchedulingReassignmentWebhookEventType(t *testing.T) { + t.Run("NewFromString_scheduling_reassignment_completed", func(t *testing.T) { t.Parallel() - val, err := NewSchedulingCalendarWebhookEventTypeFromString("scheduling.calendar.disconnected") + val, err := NewSchedulingReassignmentWebhookEventTypeFromString("scheduling.reassignment.completed") assert.NoError(t, err, "valid enum value should not return error") - assert.Equal(t, SchedulingCalendarWebhookEventType("scheduling.calendar.disconnected"), val, "enum value should match expected wire value") + assert.Equal(t, SchedulingReassignmentWebhookEventType("scheduling.reassignment.completed"), val, "enum value should match expected wire value") }) t.Run("NewFromString_Invalid", func(t *testing.T) { - _, err := NewSchedulingCalendarWebhookEventTypeFromString("invalid_value_that_does_not_exist") + _, err := NewSchedulingReassignmentWebhookEventTypeFromString("invalid_value_that_does_not_exist") assert.Error(t, err) }) t.Run("Ptr", func(t *testing.T) { - val, err := NewSchedulingCalendarWebhookEventTypeFromString("scheduling.calendar.connected") + val, err := NewSchedulingReassignmentWebhookEventTypeFromString("scheduling.reassignment.completed") assert.NoError(t, err) ptr := val.Ptr() assert.NotNil(t, ptr) @@ -26474,6 +30068,167 @@ func TestExtraPropertiesSchedulingCalendarWebhookEventData(t *testing.T) { }) } +func TestExtraPropertiesSchedulingOauthAppWebhookEvent(t *testing.T) { + t.Run("GetExtraProperties", func(t *testing.T) { + t.Parallel() + obj := &SchedulingOauthAppWebhookEvent{} + // Should not panic when calling GetExtraProperties() + defer func() { + if r := recover(); r != nil { + t.Errorf("GetExtraProperties() panicked: %v", r) + } + }() + extraProps := obj.GetExtraProperties() + // Result can be nil or an empty/non-empty map + _ = extraProps + }) + + t.Run("GetExtraProperties_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingOauthAppWebhookEvent + extraProps := obj.GetExtraProperties() + assert.Nil(t, extraProps, "nil receiver should return nil without panicking") + }) +} + +func TestExtraPropertiesSchedulingOauthAppWebhookEventData(t *testing.T) { + t.Run("GetExtraProperties", func(t *testing.T) { + t.Parallel() + obj := &SchedulingOauthAppWebhookEventData{} + // Should not panic when calling GetExtraProperties() + defer func() { + if r := recover(); r != nil { + t.Errorf("GetExtraProperties() panicked: %v", r) + } + }() + extraProps := obj.GetExtraProperties() + // Result can be nil or an empty/non-empty map + _ = extraProps + }) + + t.Run("GetExtraProperties_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingOauthAppWebhookEventData + extraProps := obj.GetExtraProperties() + assert.Nil(t, extraProps, "nil receiver should return nil without panicking") + }) +} + +func TestExtraPropertiesSchedulingOutOfOfficeWebhookEvent(t *testing.T) { + t.Run("GetExtraProperties", func(t *testing.T) { + t.Parallel() + obj := &SchedulingOutOfOfficeWebhookEvent{} + // Should not panic when calling GetExtraProperties() + defer func() { + if r := recover(); r != nil { + t.Errorf("GetExtraProperties() panicked: %v", r) + } + }() + extraProps := obj.GetExtraProperties() + // Result can be nil or an empty/non-empty map + _ = extraProps + }) + + t.Run("GetExtraProperties_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingOutOfOfficeWebhookEvent + extraProps := obj.GetExtraProperties() + assert.Nil(t, extraProps, "nil receiver should return nil without panicking") + }) +} + +func TestExtraPropertiesSchedulingOutOfOfficeWebhookEventData(t *testing.T) { + t.Run("GetExtraProperties", func(t *testing.T) { + t.Parallel() + obj := &SchedulingOutOfOfficeWebhookEventData{} + // Should not panic when calling GetExtraProperties() + defer func() { + if r := recover(); r != nil { + t.Errorf("GetExtraProperties() panicked: %v", r) + } + }() + extraProps := obj.GetExtraProperties() + // Result can be nil or an empty/non-empty map + _ = extraProps + }) + + t.Run("GetExtraProperties_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingOutOfOfficeWebhookEventData + extraProps := obj.GetExtraProperties() + assert.Nil(t, extraProps, "nil receiver should return nil without panicking") + }) +} + +func TestExtraPropertiesSchedulingReassignmentWebhookEvent(t *testing.T) { + t.Run("GetExtraProperties", func(t *testing.T) { + t.Parallel() + obj := &SchedulingReassignmentWebhookEvent{} + // Should not panic when calling GetExtraProperties() + defer func() { + if r := recover(); r != nil { + t.Errorf("GetExtraProperties() panicked: %v", r) + } + }() + extraProps := obj.GetExtraProperties() + // Result can be nil or an empty/non-empty map + _ = extraProps + }) + + t.Run("GetExtraProperties_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingReassignmentWebhookEvent + extraProps := obj.GetExtraProperties() + assert.Nil(t, extraProps, "nil receiver should return nil without panicking") + }) +} + +func TestExtraPropertiesSchedulingReassignmentWebhookEventData(t *testing.T) { + t.Run("GetExtraProperties", func(t *testing.T) { + t.Parallel() + obj := &SchedulingReassignmentWebhookEventData{} + // Should not panic when calling GetExtraProperties() + defer func() { + if r := recover(); r != nil { + t.Errorf("GetExtraProperties() panicked: %v", r) + } + }() + extraProps := obj.GetExtraProperties() + // Result can be nil or an empty/non-empty map + _ = extraProps + }) + + t.Run("GetExtraProperties_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingReassignmentWebhookEventData + extraProps := obj.GetExtraProperties() + assert.Nil(t, extraProps, "nil receiver should return nil without panicking") + }) +} + +func TestExtraPropertiesSchedulingReassignmentWebhookEventDataCounts(t *testing.T) { + t.Run("GetExtraProperties", func(t *testing.T) { + t.Parallel() + obj := &SchedulingReassignmentWebhookEventDataCounts{} + // Should not panic when calling GetExtraProperties() + defer func() { + if r := recover(); r != nil { + t.Errorf("GetExtraProperties() panicked: %v", r) + } + }() + extraProps := obj.GetExtraProperties() + // Result can be nil or an empty/non-empty map + _ = extraProps + }) + + t.Run("GetExtraProperties_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *SchedulingReassignmentWebhookEventDataCounts + extraProps := obj.GetExtraProperties() + assert.Nil(t, extraProps, "nil receiver should return nil without panicking") + }) +} + func TestExtraPropertiesSignRequestWebhookEvent(t *testing.T) { t.Run("GetExtraProperties", func(t *testing.T) { t.Parallel() diff --git a/sdks/go/webhook_listeners.go b/sdks/go/webhook_listeners.go index da9b70b3c..967c2e09c 100644 --- a/sdks/go/webhook_listeners.go +++ b/sdks/go/webhook_listeners.go @@ -1208,6 +1208,7 @@ const ( CreateWebhookListenerRequestEventTypesItemSchedulingBookingExternalConflict CreateWebhookListenerRequestEventTypesItem = "scheduling.booking.external_conflict" CreateWebhookListenerRequestEventTypesItemSchedulingBookingCalendarWriteFailed CreateWebhookListenerRequestEventTypesItem = "scheduling.booking.calendar_write_failed" CreateWebhookListenerRequestEventTypesItemSchedulingBookingLocationReady CreateWebhookListenerRequestEventTypesItem = "scheduling.booking.location_ready" + CreateWebhookListenerRequestEventTypesItemSchedulingBookingReassigned CreateWebhookListenerRequestEventTypesItem = "scheduling.booking.reassigned" CreateWebhookListenerRequestEventTypesItemSchedulingBookingStarted CreateWebhookListenerRequestEventTypesItem = "scheduling.booking.started" CreateWebhookListenerRequestEventTypesItemSchedulingBookingEnded CreateWebhookListenerRequestEventTypesItem = "scheduling.booking.ended" CreateWebhookListenerRequestEventTypesItemSchedulingBookingReminder CreateWebhookListenerRequestEventTypesItem = "scheduling.booking.reminder" @@ -1216,6 +1217,14 @@ const ( CreateWebhookListenerRequestEventTypesItemSchedulingCalendarDisconnected CreateWebhookListenerRequestEventTypesItem = "scheduling.calendar.disconnected" CreateWebhookListenerRequestEventTypesItemSchedulingCalendarDelegationFailing CreateWebhookListenerRequestEventTypesItem = "scheduling.calendar_delegation.failing" CreateWebhookListenerRequestEventTypesItemSchedulingCalendarDelegationRestored CreateWebhookListenerRequestEventTypesItem = "scheduling.calendar_delegation.restored" + CreateWebhookListenerRequestEventTypesItemSchedulingOutOfOfficeCreated CreateWebhookListenerRequestEventTypesItem = "scheduling.out_of_office.created" + CreateWebhookListenerRequestEventTypesItemSchedulingOutOfOfficeUpdated CreateWebhookListenerRequestEventTypesItem = "scheduling.out_of_office.updated" + CreateWebhookListenerRequestEventTypesItemSchedulingOutOfOfficeDeleted CreateWebhookListenerRequestEventTypesItem = "scheduling.out_of_office.deleted" + CreateWebhookListenerRequestEventTypesItemSchedulingOutOfOfficeStarted CreateWebhookListenerRequestEventTypesItem = "scheduling.out_of_office.started" + CreateWebhookListenerRequestEventTypesItemSchedulingOutOfOfficeEnded CreateWebhookListenerRequestEventTypesItem = "scheduling.out_of_office.ended" + CreateWebhookListenerRequestEventTypesItemSchedulingReassignmentCompleted CreateWebhookListenerRequestEventTypesItem = "scheduling.reassignment.completed" + CreateWebhookListenerRequestEventTypesItemSchedulingOauthAppFailing CreateWebhookListenerRequestEventTypesItem = "scheduling.oauth_app.failing" + CreateWebhookListenerRequestEventTypesItemSchedulingOauthAppRestored CreateWebhookListenerRequestEventTypesItem = "scheduling.oauth_app.restored" ) func NewCreateWebhookListenerRequestEventTypesItemFromString(s string) (CreateWebhookListenerRequestEventTypesItem, error) { @@ -1386,6 +1395,8 @@ func NewCreateWebhookListenerRequestEventTypesItemFromString(s string) (CreateWe return CreateWebhookListenerRequestEventTypesItemSchedulingBookingCalendarWriteFailed, nil case "scheduling.booking.location_ready": return CreateWebhookListenerRequestEventTypesItemSchedulingBookingLocationReady, nil + case "scheduling.booking.reassigned": + return CreateWebhookListenerRequestEventTypesItemSchedulingBookingReassigned, nil case "scheduling.booking.started": return CreateWebhookListenerRequestEventTypesItemSchedulingBookingStarted, nil case "scheduling.booking.ended": @@ -1402,6 +1413,22 @@ func NewCreateWebhookListenerRequestEventTypesItemFromString(s string) (CreateWe return CreateWebhookListenerRequestEventTypesItemSchedulingCalendarDelegationFailing, nil case "scheduling.calendar_delegation.restored": return CreateWebhookListenerRequestEventTypesItemSchedulingCalendarDelegationRestored, nil + case "scheduling.out_of_office.created": + return CreateWebhookListenerRequestEventTypesItemSchedulingOutOfOfficeCreated, nil + case "scheduling.out_of_office.updated": + return CreateWebhookListenerRequestEventTypesItemSchedulingOutOfOfficeUpdated, nil + case "scheduling.out_of_office.deleted": + return CreateWebhookListenerRequestEventTypesItemSchedulingOutOfOfficeDeleted, nil + case "scheduling.out_of_office.started": + return CreateWebhookListenerRequestEventTypesItemSchedulingOutOfOfficeStarted, nil + case "scheduling.out_of_office.ended": + return CreateWebhookListenerRequestEventTypesItemSchedulingOutOfOfficeEnded, nil + case "scheduling.reassignment.completed": + return CreateWebhookListenerRequestEventTypesItemSchedulingReassignmentCompleted, nil + case "scheduling.oauth_app.failing": + return CreateWebhookListenerRequestEventTypesItemSchedulingOauthAppFailing, nil + case "scheduling.oauth_app.restored": + return CreateWebhookListenerRequestEventTypesItemSchedulingOauthAppRestored, nil } var t CreateWebhookListenerRequestEventTypesItem return "", fmt.Errorf("%s is not a valid %T", s, t) diff --git a/sdks/go/webhook_listeners_test.go b/sdks/go/webhook_listeners_test.go index bfe130508..2f3438272 100644 --- a/sdks/go/webhook_listeners_test.go +++ b/sdks/go/webhook_listeners_test.go @@ -3055,6 +3055,13 @@ func TestEnumCreateWebhookListenerRequestEventTypesItem(t *testing.T) { assert.Equal(t, CreateWebhookListenerRequestEventTypesItem("scheduling.booking.location_ready"), val, "enum value should match expected wire value") }) + t.Run("NewFromString_scheduling_booking_reassigned", func(t *testing.T) { + t.Parallel() + val, err := NewCreateWebhookListenerRequestEventTypesItemFromString("scheduling.booking.reassigned") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, CreateWebhookListenerRequestEventTypesItem("scheduling.booking.reassigned"), val, "enum value should match expected wire value") + }) + t.Run("NewFromString_scheduling_booking_started", func(t *testing.T) { t.Parallel() val, err := NewCreateWebhookListenerRequestEventTypesItemFromString("scheduling.booking.started") @@ -3111,6 +3118,62 @@ func TestEnumCreateWebhookListenerRequestEventTypesItem(t *testing.T) { assert.Equal(t, CreateWebhookListenerRequestEventTypesItem("scheduling.calendar_delegation.restored"), val, "enum value should match expected wire value") }) + t.Run("NewFromString_scheduling_out_of_office_created", func(t *testing.T) { + t.Parallel() + val, err := NewCreateWebhookListenerRequestEventTypesItemFromString("scheduling.out_of_office.created") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, CreateWebhookListenerRequestEventTypesItem("scheduling.out_of_office.created"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_scheduling_out_of_office_updated", func(t *testing.T) { + t.Parallel() + val, err := NewCreateWebhookListenerRequestEventTypesItemFromString("scheduling.out_of_office.updated") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, CreateWebhookListenerRequestEventTypesItem("scheduling.out_of_office.updated"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_scheduling_out_of_office_deleted", func(t *testing.T) { + t.Parallel() + val, err := NewCreateWebhookListenerRequestEventTypesItemFromString("scheduling.out_of_office.deleted") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, CreateWebhookListenerRequestEventTypesItem("scheduling.out_of_office.deleted"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_scheduling_out_of_office_started", func(t *testing.T) { + t.Parallel() + val, err := NewCreateWebhookListenerRequestEventTypesItemFromString("scheduling.out_of_office.started") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, CreateWebhookListenerRequestEventTypesItem("scheduling.out_of_office.started"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_scheduling_out_of_office_ended", func(t *testing.T) { + t.Parallel() + val, err := NewCreateWebhookListenerRequestEventTypesItemFromString("scheduling.out_of_office.ended") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, CreateWebhookListenerRequestEventTypesItem("scheduling.out_of_office.ended"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_scheduling_reassignment_completed", func(t *testing.T) { + t.Parallel() + val, err := NewCreateWebhookListenerRequestEventTypesItemFromString("scheduling.reassignment.completed") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, CreateWebhookListenerRequestEventTypesItem("scheduling.reassignment.completed"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_scheduling_oauth_app_failing", func(t *testing.T) { + t.Parallel() + val, err := NewCreateWebhookListenerRequestEventTypesItemFromString("scheduling.oauth_app.failing") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, CreateWebhookListenerRequestEventTypesItem("scheduling.oauth_app.failing"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_scheduling_oauth_app_restored", func(t *testing.T) { + t.Parallel() + val, err := NewCreateWebhookListenerRequestEventTypesItemFromString("scheduling.oauth_app.restored") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, CreateWebhookListenerRequestEventTypesItem("scheduling.oauth_app.restored"), val, "enum value should match expected wire value") + }) + t.Run("NewFromString_Invalid", func(t *testing.T) { _, err := NewCreateWebhookListenerRequestEventTypesItemFromString("invalid_value_that_does_not_exist") assert.Error(t, err) diff --git a/sdks/java/CHANGELOG.md b/sdks/java/CHANGELOG.md index 8ba8118a4..4152bfb5e 100644 --- a/sdks/java/CHANGELOG.md +++ b/sdks/java/CHANGELOG.md @@ -1,5 +1,10 @@ # Changelog +## 0.4.0 + +- Regenerated from the API's OpenAPI document at 2eb77126153a. What changed in the API: the + [API changelog](https://coss.com/docs/api-reference/changelog). + ## 0.3.0 - Regenerated from the API's OpenAPI document at 820256d03a44. What changed in the API: the diff --git a/sdks/java/reference.md b/sdks/java/reference.md index 6418d532f..470965fa8 100644 --- a/sdks/java/reference.md +++ b/sdks/java/reference.md @@ -17523,8 +17523,8 @@ client.scheduling().hosts().update(
-## Scheduling Schedules -
client.scheduling.schedules.list(host) -> SchedulingScheduleList +## Scheduling Bookings +
client.scheduling.bookings.reassign(id, request) -> SchedulingBooking
@@ -17536,7 +17536,7 @@ client.scheduling().hosts().update(
-All of the host's schedules, oldest first. +Gives a booking to another host, keeping its id and time. Works for every kind: a group session moves as a whole, from any of its seats, and one that's already started changes for the record, with nobody told. Whoever leaves and joins is told, and the attendee unless you say not to.
@@ -17551,10 +17551,19 @@ All of the host's schedules, oldest first.
```java -client.scheduling().schedules().list( - "host_01kd2m9a0b1c2d3e4f5g6h7j8m", - ListSchedulesRequest +client.scheduling().bookings().reassign( + "book_01kd2m9a0b1c2d3e4f5g6h7j8m", + ReassignSchedulingBookingRequest .builder() + .reasonCode(ReassignSchedulingBookingRequestReasonCode.OUT_OF_OFFICE) + .changes( + Arrays.asList( + ReassignSchedulingBookingRequestChangesItem + .builder() + .toHost("doctor_518") + .build() + ) + ) .build() ); ``` @@ -17571,103 +17580,39 @@ client.scheduling().schedules().list(
-**host:** `String` — The host's id or uid. +**id:** `String` — The booking's id.
-
-
- - - - -
-
client.scheduling.schedules.create(host, request) -> SchedulingSchedule
-#### 📝 Description - -
-
+**changes:** `List` — A session or a one-on-one has one. A collective can change several. + +
+
-A host's weekly hours and date overrides, in local time. The first one is the host's default. -
-
+**reasonCode:** `ReassignSchedulingBookingRequestReasonCode` +
-#### 🔌 Usage -
-
-
- -```java -client.scheduling().schedules().create( - "host_01kd2m9a0b1c2d3e4f5g6h7j8m", - CreateSchedulesRequest - .builder() - .body( - UpsertScheduleRequest - .builder() - .rules( - Arrays.asList( - SchedulingWeeklyRule - .builder() - .start("09:00") - .end("17:00") - .days( - Arrays.asList(1, 2, 3, 4, 5) - ) - .build() - ) - ) - .name("Clinic hours") - .overrides( - Optional.of( - Arrays.asList( - SchedulingScheduleOverride - .builder() - .date("2027-12-24") - .ranges( - Arrays.asList( - SchedulingScheduleOverrideRangesItem - .builder() - .start("start") - .end("end") - .build() - ) - ) - .build() - ) - ) - ) - .build() - ) - .build() -); -``` -
-
+**note:** `Optional` — Why, in your words: required with an override of someone's availability. Encrypted, and only in the booking's history. +
-#### ⚙️ Parameters - -
-
-
-**host:** `String` — The host's id or uid. +**overrides:** `Optional>` — Go ahead anyway: `any_host` for someone who doesn't take this event type, and the rest for what a candidate's `reason` said. A host who already has something at this time can never be overridden.
@@ -17675,7 +17620,7 @@ client.scheduling().schedules().create(
-**request:** `UpsertScheduleRequest` +**notify:** `Optional`
@@ -17687,7 +17632,7 @@ client.scheduling().schedules().create(
-
client.scheduling.schedules.get(host, scheduleId) -> SchedulingSchedule +
client.scheduling.bookings.reassignCandidates(id) -> SchedulingReassignCandidateList
@@ -17699,7 +17644,7 @@ client.scheduling().schedules().create(
-One of the host's schedules. +The environment's other active hosts: members of the event type first, in the order a pool would pick them, each saying whether they're free and why not. Things can change before you ask: reassigning decides again.
@@ -17714,10 +17659,9 @@ One of the host's schedules.
```java -client.scheduling().schedules().get( - "host_01kd2m9a0b1c2d3e4f5g6h7j8m", - "sched_01kd2m9a0b1c2d3e4f5g6h7j8m", - GetSchedulesRequest +client.scheduling().bookings().reassignCandidates( + "book_01kd2m9a0b1c2d3e4f5g6h7j8m", + ReassignCandidatesBookingsRequest .builder() .build() ); @@ -17735,7 +17679,7 @@ client.scheduling().schedules().get(
-**host:** `String` — The host's id or uid. +**id:** `String` — The booking's id.
@@ -17743,7 +17687,7 @@ client.scheduling().schedules().get(
-**scheduleId:** `String` — The schedule's id. +**fromHost:** `Optional` — The host who'd leave, when it could be several.
@@ -17755,7 +17699,7 @@ client.scheduling().schedules().get(
-
client.scheduling.schedules.update(host, scheduleId, request) -> SchedulingSchedule +
client.scheduling.bookings.list() -> SchedulingBookingList
@@ -17767,7 +17711,7 @@ client.scheduling().schedules().get(
-Replaces its weekly rules, and its overrides when given. Existing bookings stay: a schedule only decides what's offered next. +The environment's bookings, newest first. Answers aren't included.
@@ -17782,48 +17726,11 @@ Replaces its weekly rules, and its overrides when given. Existing bookings stay:
```java -client.scheduling().schedules().update( - "host_01kd2m9a0b1c2d3e4f5g6h7j8m", - "sched_01kd2m9a0b1c2d3e4f5g6h7j8m", - UpdateSchedulesRequest +client.scheduling().bookings().list( + ListBookingsRequest .builder() - .body( - UpsertScheduleRequest - .builder() - .rules( - Arrays.asList( - SchedulingWeeklyRule - .builder() - .start("09:00") - .end("17:00") - .days( - Arrays.asList(1, 2, 3, 4, 5) - ) - .build() - ) - ) - .name("Clinic hours") - .overrides( - Optional.of( - Arrays.asList( - SchedulingScheduleOverride - .builder() - .date("2027-12-24") - .ranges( - Arrays.asList( - SchedulingScheduleOverrideRangesItem - .builder() - .start("start") - .end("end") - .build() - ) - ) - .build() - ) - ) - ) - .build() - ) + .startAfter("2027-01-04T15:00:00.000Z") + .startBefore("2027-01-04T15:00:00.000Z") .build() ); ``` @@ -17840,7 +17747,7 @@ client.scheduling().schedules().update(
-**host:** `String` — The host's id or uid. +**limit:** `Optional`
@@ -17848,7 +17755,7 @@ client.scheduling().schedules().update(
-**scheduleId:** `String` — The schedule's id. +**after:** `Optional` — The last id of the previous page.
@@ -17856,67 +17763,39 @@ client.scheduling().schedules().update(
-**request:** `UpsertScheduleRequest` +**host:** `Optional`
-
-
- - - - -
-
client.scheduling.schedules.remove(host, scheduleId) -> DeletedSchedulingSchedule
-#### 📝 Description - -
-
+**eventType:** `Optional` + +
+
-Refused for the host's default schedule. -
-
+**status:** `Optional` +
-#### 🔌 Usage - -
-
-
-```java -client.scheduling().schedules().remove( - "host_01kd2m9a0b1c2d3e4f5g6h7j8m", - "sched_01kd2m9a0b1c2d3e4f5g6h7j8m", - RemoveSchedulesRequest - .builder() - .build() -); -``` -
-
+**attendeeUid:** `Optional` +
-#### ⚙️ Parameters -
-
-
- -**host:** `String` — The host's id or uid. +**startAfter:** `Optional` — An ISO 8601 instant with an offset.
@@ -17924,7 +17803,7 @@ client.scheduling().schedules().remove(
-**scheduleId:** `String` — The schedule's id. +**startBefore:** `Optional` — An ISO 8601 instant with an offset.
@@ -17936,8 +17815,7 @@ client.scheduling().schedules().remove(
-## Scheduling EventTypes -
client.scheduling.eventTypes.list() -> SchedulingEventTypeList +
client.scheduling.bookings.create(request) -> SchedulingBooking
@@ -17949,7 +17827,7 @@ client.scheduling().schedules().remove(
-The environment's event types, newest first. +Books a slot, or joins a group session. Without a `host`, a pool chooses fairly among those free. An event type that requires approval answers with a `pending_approval` booking.
@@ -17964,9 +17842,21 @@ The environment's event types, newest first.
```java -client.scheduling().eventTypes().list( - ListEventTypesRequest +client.scheduling().bookings().create( + CreateBookingRequest .builder() + .eventType("evtype_01kd2m9a0b1c2d3e4f5g6h7j8m") + .start("2027-01-04T15:00:00.000Z") + .attendee( + SchedulingAttendeeInput + .builder() + .timeZone("UTC") + .uid("patient_77") + .name("Sam Lee") + .email("sam@example.com") + .build() + ) + .idempotencyKey("welcome-user-123") .build() ); ``` @@ -17983,7 +17873,7 @@ client.scheduling().eventTypes().list(
-**limit:** `Optional` +**idempotencyKey:** `Optional` — Makes retries safe: a repeated request with the same key and body returns the original booking instead of creating another, for 24 hours. A refused request keeps no key. 1-256 characters.
@@ -17991,80 +17881,47 @@ client.scheduling().eventTypes().list(
-**after:** `Optional` — The last id of the previous page. +**eventType:** `String` — The event type's id or uid.
-
-
+
+
+**start:** `String` — An ISO 8601 instant with an offset. +
-
-
client.scheduling.eventTypes.create(request) -> SchedulingEventType
-#### 📝 Description - -
-
+**host:** `Optional` — A specific host (id or uid). Default: chosen fairly from those free. + +
+
-What can be booked: `one_on_one` with one host, `pool` for any free host, `collective` when every required host must be free, or `group` for a session with seats. -
-
+**attributes:** `Optional>` — Only choose among pool hosts matching all of these. +
-#### 🔌 Usage -
-
-
- -```java -client.scheduling().eventTypes().create( - CreateEventTypeRequest - .builder() - .title("Initial consultation") - .durationMinutes(30) - .kind(CreateEventTypeRequestKind.ONE_ON_ONE) - .bufferAfterMinutes(10) - .minNoticeMinutes(120) - .hosts( - Optional.of( - Arrays.asList( - SchedulingEventTypeHostInput - .builder() - .host("doctor_482") - .build() - ) - ) - ) - .build() -); -``` -
-
+**durationMinutes:** `Optional` — One of the event type's `duration_options`. +
-#### ⚙️ Parameters - -
-
-
-**uid:** `Optional` — Your own id for this event type, unique in the environment, accepted wherever its id is. +**attendee:** `SchedulingAttendeeInput`
@@ -18072,7 +17929,7 @@ client.scheduling().eventTypes().create(
-**kind:** `Optional` — Who a booking needs. `one_on_one`: one host. `pool`: any one of its hosts. `collective`: every `required` host, plus at most one `member`. `group`: one host, with attendees taking seats up to `capacity`. Fixed once created. +**guests:** `Optional>` — Up to the event type's `max_guests`.
@@ -18080,7 +17937,7 @@ client.scheduling().eventTypes().create(
-**description:** `Optional` — Plain text about the event type, shown on hosted booking pages and never in emails. Links, and anything shaped like a domain, must be on your organization's verified domains or their subdomains, and use `https`. `null` removes it. +**answers:** `Optional>` — Answers to the event type's questions. Stored encrypted, and returned only by retrieving the booking.
@@ -18088,7 +17945,7 @@ client.scheduling().eventTypes().create(
-**title:** `String` — Shown to attendees and in emails. Host calendars show it only with `host_calendar_details: full`. +**location:** `Optional` — One of the event type's `locations`, with your link filled in if it has none.
@@ -18096,183 +17953,126 @@ client.scheduling().eventTypes().create(
-**durationMinutes:** `Integer` — How long a booking lasts by default, in minutes. +**metadata:** `Optional>` — Your own key-value pairs. Don't put sensitive data here.
- -
-
- -**durationOptions:** `Optional>` — Other lengths an attendee may choose, in minutes. Empty: only `duration_minutes`. -
-
-
-**stepMinutes:** `Optional` — How far apart slots start. Default: the duration. -
+
+
client.scheduling.bookings.get(id) -> SchedulingBooking
-**gridTimeZone:** `Optional` — The zone slots align in. Default: each host's own. - -
-
+#### 📝 Description
-**bufferBeforeMinutes:** `Optional` — Minutes kept free before each booking. Default: 0. - -
-
-
-**bufferAfterMinutes:** `Optional` — Minutes kept free after each booking. Default: 0. - +A booking with its attendees and their answers.
- -
-
- -**minNoticeMinutes:** `Optional` — Slots starting sooner than this many minutes from now aren't offered. Default: 0. -
+#### 🔌 Usage +
-**bookingWindow:** `Optional` - -
-
-
-**limits:** `Optional>` — Caps on bookings per day or week. Default: none. - +```java +client.scheduling().bookings().get( + "book_01kd2m9a0b1c2d3e4f5g6h7j8m", + GetBookingsRequest + .builder() + .build() +); +```
- -
-
- -**capacity:** `Optional` — Attendees per session. Required for, and only allowed on, `group`. -
+#### ⚙️ Parameters +
-**requiresApproval:** `Optional` — Bookings start as `pending_approval`, holding the time until approved or declined. Default: `false`. - -
-
-
-**approvalTtlMinutes:** `Optional` — How long a booking can wait for approval before it's declined, in minutes. Default: 1440. +**id:** `String` — The booking's id.
- -
-
- -**holdTtlSeconds:** `Optional` — How long a hold keeps its slot, in seconds. Default: 600. -
-
-
-**cancelNoticeMinutes:** `Optional` — Attendees can't cancel closer to the start than this. API keys can. -
+
+
client.scheduling.bookings.reschedule(id, request) -> SchedulingBooking
-**rescheduleNoticeMinutes:** `Optional` — Attendees can't reschedule closer to the start than this. API keys can. Default: 0. - -
-
+#### 📝 Description
-**maxGuests:** `Optional` — How many people an attendee can add to a booking. Default: 0. Guests are emailed about it. Not on `group`. - -
-
-
-**maxActiveBookingsPerAttendee:** `Optional` — How many upcoming bookings of this event type one person can have at a time, known by `uid` or email. Default: `null`, no limit. Past this, booking answers `attendee_limit_reached`. Guests don't count, and each occurrence of a series does. - +Moves it to a new time, keeping its id. The old time stays booked if the new one isn't free.
- -
-
- -**hostCalendarDetails:** `Optional` — What hosts' calendars say about a booking. `neutral` (the default): a private event titled "Appointment". `full`: a private event with this title and the attendee's name, plus names, emails and phone numbers in its description, which go to the host's calendar provider. Never answers. Refused in HIPAA mode. -
+#### 🔌 Usage +
-**questions:** `Optional>` — What attendees are asked when booking. Keys must be unique. - -
-
-
-**locations:** `Optional>` — Where bookings can meet. A browser only chooses among these. A `group` event type can't use `zoom`. - +```java +client.scheduling().bookings().reschedule( + "book_01kd2m9a0b1c2d3e4f5g6h7j8m", + RescheduleBookingRequest + .builder() + .start("2027-01-05T15:00:00.000Z") + .build() +); +```
- -
-
- -**hostFilter:** `Optional>>` — Pool members also include active hosts matching all of these attributes. -
+#### ⚙️ Parameters +
-**notifications:** `Optional>>` — Per event, overriding your settings for this event type. - -
-
-
-**reminders:** `Optional>` — Replaces your settings' `reminders` for this event type. `null` inherits them; an empty list means none. +**id:** `String` — The booking's id.
@@ -18280,7 +18080,7 @@ client.scheduling().eventTypes().create(
-**metadata:** `Optional>` — Your own key-value pairs. +**start:** `String` — The new start. The old time stays booked unless this one's free.
@@ -18288,7 +18088,7 @@ client.scheduling().eventTypes().create(
-**hosts:** `Optional>` — Who can be booked. `one_on_one` and `group` take one; `collective` needs at least one `required` host. +**host:** `Optional` — Move a pool booking to this host. Default: its current hosts.
@@ -18300,7 +18100,7 @@ client.scheduling().eventTypes().create(
-
client.scheduling.eventTypes.get(eventType) -> SchedulingEventType +
client.scheduling.bookings.cancel(id, request) -> SchedulingBooking
@@ -18312,7 +18112,7 @@ client.scheduling().eventTypes().create(
-An event type by its id or your uid. +Frees the time and removes the calendar event. A cancelled booking stays charged.
@@ -18327,10 +18127,11 @@ An event type by its id or your uid.
```java -client.scheduling().eventTypes().get( - "evtype_01kd2m9a0b1c2d3e4f5g6h7j8m", - GetEventTypesRequest +client.scheduling().bookings().cancel( + "book_01kd2m9a0b1c2d3e4f5g6h7j8m", + CancelSchedulingBookingRequest .builder() + .reason("Feeling better") .build() ); ``` @@ -18347,7 +18148,15 @@ client.scheduling().eventTypes().get(
-**eventType:** `String` — The event type's id or uid. +**id:** `String` — The booking's id. + +
+
+ +
+
+ +**reason:** `Optional` — Why it's being cancelled. Only retrieving this booking returns it: it's never in webhooks, logs or emails.
@@ -18359,7 +18168,7 @@ client.scheduling().eventTypes().get(
-
client.scheduling.eventTypes.update(eventType, request) -> SchedulingEventType +
client.scheduling.bookings.events(id) -> SchedulingBookingEventList
@@ -18371,7 +18180,7 @@ client.scheduling().eventTypes().get(
-Changes what's given. Existing bookings keep what they were booked with. Set `status` to `archived` to stop new bookings. +What's happened to a booking, oldest first, and who did it. There's no personal data in here.
@@ -18386,11 +18195,10 @@ Changes what's given. Existing bookings keep what they were booked with. Set `st
```java -client.scheduling().eventTypes().update( - "evtype_01kd2m9a0b1c2d3e4f5g6h7j8m", - UpdateEventTypeRequest +client.scheduling().bookings().events( + "book_01kd2m9a0b1c2d3e4f5g6h7j8m", + EventsBookingsRequest .builder() - .minNoticeMinutes(240) .build() ); ``` @@ -18407,7 +18215,7 @@ client.scheduling().eventTypes().update(
-**eventType:** `String` — The event type's id or uid. +**id:** `String` — The booking's id.
@@ -18415,7 +18223,7 @@ client.scheduling().eventTypes().update(
-**uid:** `Optional` — Your own id for this event type. `null` removes it. +**limit:** `Optional`
@@ -18423,63 +18231,2477 @@ client.scheduling().eventTypes().update(
-**description:** `Optional` — Plain text about the event type, shown on hosted booking pages and never in emails. Links, and anything shaped like a domain, must be on your organization's verified domains or their subdomains, and use `https`. `null` removes it. +**after:** `Optional` — The last id of the previous page.
+
+
-
-
-**title:** `Optional` — Shown to attendees and in emails. Host calendars show it only with `host_calendar_details: full`. -
+
+
client.scheduling.bookings.approve(id) -> SchedulingBooking
-**durationMinutes:** `Optional` — How long a booking lasts by default, in minutes. - -
-
+#### 📝 Description
-**durationOptions:** `Optional>` — Other lengths an attendee may choose, in minutes. Empty: only `duration_minutes`. - -
-
-
-**stepMinutes:** `Optional` — How far apart slots start. Default: the duration. - +Confirms a `pending_approval` booking.
+ + + +#### 🔌 Usage
-**gridTimeZone:** `Optional` — The zone slots align in. Default: each host's own. - -
-
-
-**bufferBeforeMinutes:** `Optional` — Minutes kept free before each booking. Default: 0. - +```java +client.scheduling().bookings().approve( + "book_01kd2m9a0b1c2d3e4f5g6h7j8m", + ApproveBookingsRequest + .builder() + .build() +); +``` +
+
+#### ⚙️ Parameters +
-**bufferAfterMinutes:** `Optional` — Minutes kept free after each booking. Default: 0. +
+
+ +**id:** `String` — The booking's id. + +
+
+
+
+ + + + +
+ +
client.scheduling.bookings.decline(id) -> SchedulingBooking +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Refuses a `pending_approval` booking and frees the time. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.scheduling().bookings().decline( + "book_01kd2m9a0b1c2d3e4f5g6h7j8m", + DeclineBookingsRequest + .builder() + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — The booking's id. + +
+
+
+
+ + +
+
+
+ +
client.scheduling.bookings.notifications(id) -> SchedulingBookingNotificationList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +What's been queued for this booking and what became of it, newest first, including why something wasn't sent. It never says who it went to. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.scheduling().bookings().notifications( + "book_01kd2m9a0b1c2d3e4f5g6h7j8m", + NotificationsBookingsRequest + .builder() + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — The booking's id. + +
+
+ +
+
+ +**limit:** `Optional` + +
+
+ +
+
+ +**after:** `Optional` — The last id of the previous page. + +
+
+
+
+ + +
+
+
+ +
client.scheduling.bookings.markNoShow(id) -> SchedulingBooking +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Records that the attendee didn't come, once the booking has started. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.scheduling().bookings().markNoShow( + "book_01kd2m9a0b1c2d3e4f5g6h7j8m", + MarkNoShowBookingsRequest + .builder() + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — The booking's id. + +
+
+
+
+ + +
+
+
+ +
client.scheduling.bookings.updateLocation(id, request) -> SchedulingBooking +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Where it happens, such as the meeting link you made after the `scheduling.booking.confirmed` webhook. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.scheduling().bookings().updateLocation( + "book_01kd2m9a0b1c2d3e4f5g6h7j8m", + UpdateBookingLocationRequest + .builder() + .location( + OptionalNullable.of( + SchedulingLocation.of( + SchedulingLocationZero + .builder() + .type(SchedulingLocationZeroType.LINK) + .url( + OptionalNullable.of("https://meet.example.com/abc") + ) + .build() + ) + ) + ) + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — The booking's id. + +
+
+ +
+
+ +**location:** `Optional` + +
+
+
+
+ + +
+
+
+ +## Scheduling Reassignments +
client.scheduling.reassignments.preview(request) -> SchedulingReassignmentPreview +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Who each booking would go to, and why not when nobody can take it, without moving anything. It works down them in order, so two can't both be promised the same free hour. Change any of it and start the run with `assignments`. Covers the first 500. Things can change before you start it: the run decides again. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.scheduling().reassignments().preview( + PreviewSchedulingReassignmentRequest + .builder() + .selection( + SchedulingReassignmentSelection + .builder() + .host("doctor_482") + .startBefore("2027-08-14T00:00:00.000Z") + .build() + ) + .strategy( + SchedulingReassignmentStrategy + .builder() + .preferredHosts( + Optional.of( + Arrays.asList("doctor_518") + ) + ) + .build() + ) + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**selection:** `SchedulingReassignmentSelection` + +
+
+ +
+
+ +**strategy:** `Optional` + +
+
+ +
+
+ +**overrides:** `Optional>` + +
+
+
+
+ + +
+
+
+ +
client.scheduling.reassignments.list() -> SchedulingReassignmentList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Newest first, with how each is going. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.scheduling().reassignments().list( + ListReassignmentsRequest + .builder() + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**limit:** `Optional` + +
+
+ +
+
+ +**after:** `Optional` — The last id of the previous page. + +
+
+
+
+ + +
+
+
+ +
client.scheduling.reassignments.create(request) -> SchedulingReassignment +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Moves up to 5,000 bookings in the background, each on its own, so one that can't move never holds up the rest. Nothing's ever cancelled: a booking nobody can take stays where it is, and its item says so. It answers at once: follow the run by its id, or wait for `scheduling.reassignment.completed`. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.scheduling().reassignments().create( + CreateSchedulingReassignmentRequest + .builder() + .selection( + SchedulingReassignmentSelection + .builder() + .outOfOffice("ooo_01kd2m9a0b1c2d3e4f5g6h7j8m") + .build() + ) + .reasonCode(CreateSchedulingReassignmentRequestReasonCode.OUT_OF_OFFICE) + .idempotencyKey("welcome-user-123") + .strategy( + SchedulingReassignmentStrategy + .builder() + .preferredHosts( + Optional.of( + Arrays.asList("doctor_518") + ) + ) + .build() + ) + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**idempotencyKey:** `Optional` — Makes retries safe: a repeated request with the same key and body returns the original run instead of starting another, for 24 hours. 1-256 characters. + +
+
+ +
+
+ +**selection:** `SchedulingReassignmentSelection` + +
+
+ +
+
+ +**strategy:** `Optional` + +
+
+ +
+
+ +**reasonCode:** `CreateSchedulingReassignmentRequestReasonCode` + +
+
+ +
+
+ +**note:** `Optional` — Why, in your words: required with an override of someone's availability. + +
+
+ +
+
+ +**overrides:** `Optional>` + +
+
+ +
+
+ +**notify:** `Optional` + +
+
+
+
+ + +
+
+
+ +
client.scheduling.reassignments.get(id) -> SchedulingReassignment +
+
+ +#### 📝 Description + +
+
+ +
+
+ +How it's going. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.scheduling().reassignments().get( + "id", + GetReassignmentsRequest + .builder() + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — The reassignment's id. + +
+
+
+
+ + +
+
+
+ +
client.scheduling.reassignments.items(id) -> SchedulingReassignmentItemList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Each booking it covers and what happened to it. A group session has one, for one of its seats. Empty until the worker's started on it. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.scheduling().reassignments().items( + "id", + ItemsReassignmentsRequest + .builder() + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — The reassignment's id. + +
+
+ +
+
+ +**limit:** `Optional` + +
+
+ +
+
+ +**after:** `Optional` — The last id of the previous page. + +
+
+
+
+ + +
+
+
+ +
client.scheduling.reassignments.cancel(id) -> SchedulingReassignment +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Stops what hasn't happened yet. What's moved stays moved: undo it for that. Cancelling one that's finished changes nothing. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.scheduling().reassignments().cancel( + "id", + CancelReassignmentsRequest + .builder() + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — The reassignment's id. + +
+
+
+
+ + +
+
+
+ +
client.scheduling.reassignments.undo(id, request) -> SchedulingReassignment +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Gives back what a finished run moved, as a new run. A booking that's moved on since stays where it went, and a former host who's no longer free keeps it from going back, unless you pass `overrides`. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.scheduling().reassignments().undo( + "id", + UndoSchedulingReassignmentRequest + .builder() + .reasonCode(UndoSchedulingReassignmentRequestReasonCode.OTHER) + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — The reassignment's id. + +
+
+ +
+
+ +**reasonCode:** `Optional` + +
+
+ +
+
+ +**note:** `Optional` + +
+
+ +
+
+ +**overrides:** `Optional>` + +
+
+ +
+
+ +**notify:** `Optional` + +
+
+
+
+ + +
+
+
+ +## Scheduling HolidayCalendars +
client.scheduling.holidayCalendars.list() -> SchedulingHolidayCalendarList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +By name. A feed's URL is never shown again. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.scheduling().holidayCalendars().list(); +``` +
+
+
+
+ + +
+
+
+ +
client.scheduling.holidayCalendars.create(request) -> SchedulingHolidayCalendar +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Applies a country's public holidays, or your own feed, to some hosts as ordinary out of office entries, kept up to date by coss.com. A host who removes one keeps it removed. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.scheduling().holidayCalendars().create( + CreateSchedulingHolidayCalendarRequest + .builder() + .name("UK team") + .country("GB") + .hostFilter( + new HashMap() {{ + put("team", CreateSchedulingHolidayCalendarRequestHostFilterValue.of("london")); + }} + ) + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**name:** `String` + +
+
+ +
+
+ +**country:** `Optional` — A code from the list of holiday calendars, such as `GB`. + +
+
+ +
+
+ +**icsUrl:** `Optional` — Your own feed, https or webcal, read in live environments. Stored encrypted. + +
+
+ +
+
+ +**hosts:** `Optional>` — These hosts, by id or uid. + +
+
+ +
+
+ +**hostFilter:** `Optional>` — Everyone matching these attributes, asked again at every sync. + +
+
+ +
+
+ +**regions:** `Optional>` — Which regional holidays apply, matched against how the calendar names them, such as `England`. Without this, all of them do; empty, only nationwide ones. + +
+
+ +
+
+ +**delegates:** `Optional>` — Who can be booked in their place on those days, by id or uid, in order. + +
+
+ +
+
+ +**existingBookings:** `Optional` — What happens to bookings already on a holiday. `leave` (the default) only reports them. `reassign` moves them. + +
+
+
+
+ + +
+
+
+ +
client.scheduling.holidayCalendars.get(id) -> SchedulingHolidayCalendar +
+
+ +#### 📝 Description + +
+
+ +
+
+ +With when it was last read, and why not if it couldn't be. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.scheduling().holidayCalendars().get( + "id", + GetHolidayCalendarsRequest + .builder() + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — The holiday calendar's id. + +
+
+
+
+ + +
+
+
+ +
client.scheduling.holidayCalendars.remove(id) -> DeletedSchedulingHolidayCalendar +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Hosts can be booked on its days again, shortly: past entries stay. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.scheduling().holidayCalendars().remove( + "id", + RemoveHolidayCalendarsRequest + .builder() + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — The holiday calendar's id. + +
+
+
+
+ + +
+
+
+ +
client.scheduling.holidayCalendars.update(id, request) -> SchedulingHolidayCalendar +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Who it applies to, who covers and what happens to bookings. Takes effect shortly. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.scheduling().holidayCalendars().update( + "id", + UpdateSchedulingHolidayCalendarRequest + .builder() + .hostFilter( + new HashMap() {{ + put("team", UpdateSchedulingHolidayCalendarRequestHostFilterValue.of("london")); + }} + ) + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — The holiday calendar's id. + +
+
+ +
+
+ +**name:** `Optional` + +
+
+ +
+
+ +**hosts:** `Optional>` — These hosts, by id or uid. + +
+
+ +
+
+ +**hostFilter:** `Optional>` — Everyone matching these attributes, asked again at every sync. + +
+
+ +
+
+ +**regions:** `Optional>` — Which regional holidays apply, matched against how the calendar names them, such as `England`. Without this, all of them do; empty, only nationwide ones. + +
+
+ +
+
+ +**delegates:** `Optional>` — Who can be booked in their place on those days, by id or uid, in order. + +
+
+ +
+
+ +**existingBookings:** `Optional` — What happens to bookings already on a holiday. `leave` (the default) only reports them. `reassign` moves them. + +
+
+
+
+ + +
+
+
+ +
client.scheduling.holidayCalendars.holidays(id) -> SchedulingHolidayList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +What's coming, with names, as last read. Empty until its first read. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.scheduling().holidayCalendars().holidays( + "id", + HolidaysHolidayCalendarsRequest + .builder() + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — The holiday calendar's id. + +
+
+
+
+ + +
+
+
+ +## Scheduling OutOfOffice +
client.scheduling.outOfOffice.list() -> SchedulingOutOfOfficeList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +The environment's entries, newest first. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.scheduling().outOfOffice().list( + ListOutOfOfficeRequest + .builder() + .startAfter("2027-01-04T15:00:00.000Z") + .startBefore("2027-01-04T15:00:00.000Z") + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**limit:** `Optional` + +
+
+ +
+
+ +**after:** `Optional` — The last id of the previous page. + +
+
+ +
+
+ +**host:** `Optional` — One host's entries, by id or uid. + +
+
+ +
+
+ +**startAfter:** `Optional` — Entries ending after this. + +
+
+ +
+
+ +**startBefore:** `Optional` — Entries starting before this. + +
+
+ +
+
+ +**group:** `Optional` — The entries one request made. + +
+
+
+
+ + +
+
+
+ +
client.scheduling.outOfOffice.create(request) -> SchedulingOutOfOfficeList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Marks one host, a list of hosts or everyone matching some attributes as away, for part of a day or for whole dates. They aren't offered during it. Existing bookings stay as they are: list them with the entry's conflicts. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.scheduling().outOfOffice().create( + CreateSchedulingOutOfOfficeRequest + .builder() + .host("doctor_482") + .startDate("2027-08-02") + .endDate("2027-08-13") + .reason("vacation") + .publicMessage("Back on the 16th.") + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**host:** `Optional` — One host, by id or uid. + +
+
+ +
+
+ +**hosts:** `Optional>` — Several hosts, by id or uid. Each gets an entry of their own. + +
+
+ +
+
+ +**hostFilter:** `Optional>` — Every active host matching these attributes right now. A host added later isn't covered. + +
+
+ +
+
+ +**start:** `Optional` — An ISO 8601 instant with an offset. + +
+
+ +
+
+ +**end:** `Optional` — An ISO 8601 instant with an offset. + +
+
+ +
+
+ +**startDate:** `Optional` — The first whole day away. Use instead of `start` and `end`. + +
+
+ +
+
+ +**endDate:** `Optional` — The last whole day away, which is included. + +
+
+ +
+
+ +**timeZone:** `Optional` — What the dates mean in. Default: the host's zone when this is made. + +
+
+ +
+
+ +**delegates:** `Optional>` — Who can be booked in this host's place during it, by id or uid, in the order to try them. They still have to fit how a booking's routed. + +
+
+ +
+
+ +**reason:** `Optional` — One of `unspecified`, `vacation`, `travel`, `sick`, `public_holiday`, `parental_leave`, `training` and `other`, or a key from the settings' `out_of_office_reasons`. Only people who manage this host see it: never bookers, webhooks or calendars. + +
+
+ +
+
+ +**notes:** `Optional` — For people who manage this host. Encrypted, and never shown to a booker. + +
+
+ +
+
+ +**publicMessage:** `Optional` — Shown to bookers while this host is away. Can't contain a link. + +
+
+ +
+
+ +**showOnCalendar:** `Optional` — Put a private "Out of office" event on the host's calendar. Default: true. + +
+
+ +
+
+ +**existingBookings:** `Optional` — What happens to bookings already in the way. `leave` (the default) only reports them. `reassign` moves them, and any nobody can take stay where they are. + +
+
+ +
+
+ +**reassign:** `Optional` — With `existing_bookings: reassign`: who they go to. Default: the fairest who's free. + +
+
+ +
+
+ +**externalId:** `Optional` — Your own id for this entry, unique in the environment. Needs one host. + +
+
+
+
+ + +
+
+
+ +
client.scheduling.outOfOffice.get(id) -> SchedulingOutOfOffice +
+
+ +#### 📝 Description + +
+
+ +
+
+ +One entry. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.scheduling().outOfOffice().get( + "ooo_01kd2m9a0b1c2d3e4f5g6h7j8m", + GetOutOfOfficeRequest + .builder() + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — The entry's id. + +
+
+
+
+ + +
+
+
+ +
client.scheduling.outOfOffice.remove(id) -> DeletedSchedulingOutOfOffice +
+
+ +#### 📝 Description + +
+
+ +
+
+ +The host can be booked in that time again, and any calendar event for it goes. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.scheduling().outOfOffice().remove( + "ooo_01kd2m9a0b1c2d3e4f5g6h7j8m", + RemoveOutOfOfficeRequest + .builder() + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — The entry's id. + +
+
+
+
+ + +
+
+
+ +
client.scheduling.outOfOffice.update(id, request) -> SchedulingOutOfOffice +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Changes what's given. An entry stays with its host. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.scheduling().outOfOffice().update( + "ooo_01kd2m9a0b1c2d3e4f5g6h7j8m", + UpdateSchedulingOutOfOfficeRequest + .builder() + .endDate("2027-08-20") + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — The entry's id. + +
+
+ +
+
+ +**start:** `Optional` — An ISO 8601 instant with an offset. + +
+
+ +
+
+ +**end:** `Optional` — An ISO 8601 instant with an offset. + +
+
+ +
+
+ +**startDate:** `Optional` — The first whole day away. Use instead of `start` and `end`. + +
+
+ +
+
+ +**endDate:** `Optional` — The last whole day away, which is included. + +
+
+ +
+
+ +**timeZone:** `Optional` — What the dates mean in. Default: the host's zone when this is made. + +
+
+ +
+
+ +**reason:** `Optional` — One of `unspecified`, `vacation`, `travel`, `sick`, `public_holiday`, `parental_leave`, `training` and `other`, or a key from the settings' `out_of_office_reasons`. Only people who manage this host see it: never bookers, webhooks or calendars. + +
+
+ +
+
+ +**notes:** `Optional` + +
+
+ +
+
+ +**publicMessage:** `Optional` + +
+
+ +
+
+ +**showOnCalendar:** `Optional` + +
+
+ +
+
+ +**delegates:** `Optional>` — Who can be booked in this host's place during it, by id or uid, in the order to try them. They still have to fit how a booking's routed. + +
+
+ +
+
+ +**existingBookings:** `Optional` — What happens to bookings already in the way. `leave` (the default) only reports them. `reassign` moves them, and any nobody can take stay where they are. + +
+
+ +
+
+ +**reassign:** `Optional` — With `existing_bookings: reassign`: who they go to. Default: the fairest who's free. + +
+
+
+
+ + +
+
+
+ +
client.scheduling.outOfOffice.put(externalId, request) -> SchedulingOutOfOffice +
+
+ +#### 📝 Description + +
+
+ +
+
+ +For syncing from a system of record such as an HR tool: send what it says, as often as you like, and there's one entry for it. Give every field you want to keep. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.scheduling().outOfOffice().put( + "hr_leave_4471", + PutSchedulingOutOfOfficeRequest + .builder() + .host("doctor_482") + .startDate("2027-08-02") + .endDate("2027-08-13") + .reason("vacation") + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**externalId:** `String` — Your own id for the entry. + +
+
+ +
+
+ +**host:** `String` — The host, by id or uid. + +
+
+ +
+
+ +**start:** `Optional` — An ISO 8601 instant with an offset. + +
+
+ +
+
+ +**end:** `Optional` — An ISO 8601 instant with an offset. + +
+
+ +
+
+ +**startDate:** `Optional` — The first whole day away. Use instead of `start` and `end`. + +
+
+ +
+
+ +**endDate:** `Optional` — The last whole day away, which is included. + +
+
+ +
+
+ +**timeZone:** `Optional` — What the dates mean in. Default: the host's zone when this is made. + +
+
+ +
+
+ +**delegates:** `Optional>` — Who can be booked in this host's place during it, by id or uid, in the order to try them. They still have to fit how a booking's routed. + +
+
+ +
+
+ +**reason:** `Optional` — One of `unspecified`, `vacation`, `travel`, `sick`, `public_holiday`, `parental_leave`, `training` and `other`, or a key from the settings' `out_of_office_reasons`. Only people who manage this host see it: never bookers, webhooks or calendars. + +
+
+ +
+
+ +**notes:** `Optional` — For people who manage this host. Encrypted, and never shown to a booker. + +
+
+ +
+
+ +**publicMessage:** `Optional` — Shown to bookers while this host is away. Can't contain a link. + +
+
+ +
+
+ +**showOnCalendar:** `Optional` — Put a private "Out of office" event on the host's calendar. Default: true. + +
+
+ +
+
+ +**existingBookings:** `Optional` — What happens to bookings already in the way. `leave` (the default) only reports them. `reassign` moves them, and any nobody can take stay where they are. + +
+
+ +
+
+ +**reassign:** `Optional` — With `existing_bookings: reassign`: who they go to. Default: the fairest who's free. + +
+
+
+
+ + +
+
+
+ +
client.scheduling.outOfOffice.conflicts(id) -> SchedulingOutOfOfficeConflictList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Live bookings of the host that fall in the entry, soonest first. Entries never change them. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.scheduling().outOfOffice().conflicts( + "ooo_01kd2m9a0b1c2d3e4f5g6h7j8m", + ConflictsOutOfOfficeRequest + .builder() + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — The entry's id. + +
+
+ +
+
+ +**limit:** `Optional` + +
+
+
+
+ + +
+
+
+ +## Scheduling Schedules +
client.scheduling.schedules.list(host) -> SchedulingScheduleList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +All of the host's schedules, oldest first. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.scheduling().schedules().list( + "host_01kd2m9a0b1c2d3e4f5g6h7j8m", + ListSchedulesRequest + .builder() + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**host:** `String` — The host's id or uid. + +
+
+
+
+ + +
+
+
+ +
client.scheduling.schedules.create(host, request) -> SchedulingSchedule +
+
+ +#### 📝 Description + +
+
+ +
+
+ +A host's weekly hours and date overrides, in local time. The first one is the host's default. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.scheduling().schedules().create( + "host_01kd2m9a0b1c2d3e4f5g6h7j8m", + CreateSchedulesRequest + .builder() + .body( + UpsertScheduleRequest + .builder() + .rules( + Arrays.asList( + SchedulingWeeklyRule + .builder() + .start("09:00") + .end("17:00") + .days( + Arrays.asList(1, 2, 3, 4, 5) + ) + .build() + ) + ) + .name("Clinic hours") + .overrides( + Optional.of( + Arrays.asList( + SchedulingScheduleOverride + .builder() + .date("2027-12-24") + .ranges( + Arrays.asList( + SchedulingScheduleOverrideRangesItem + .builder() + .start("start") + .end("end") + .build() + ) + ) + .build() + ) + ) + ) + .build() + ) + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**host:** `String` — The host's id or uid. + +
+
+ +
+
+ +**request:** `UpsertScheduleRequest` + +
+
+
+
+ + +
+
+
+ +
client.scheduling.schedules.get(host, scheduleId) -> SchedulingSchedule +
+
+ +#### 📝 Description + +
+
+ +
+
+ +One of the host's schedules. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.scheduling().schedules().get( + "host_01kd2m9a0b1c2d3e4f5g6h7j8m", + "sched_01kd2m9a0b1c2d3e4f5g6h7j8m", + GetSchedulesRequest + .builder() + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**host:** `String` — The host's id or uid. + +
+
+ +
+
+ +**scheduleId:** `String` — The schedule's id. + +
+
+
+
+ + +
+
+
+ +
client.scheduling.schedules.update(host, scheduleId, request) -> SchedulingSchedule +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Replaces its weekly rules, and its overrides when given. Existing bookings stay: a schedule only decides what's offered next. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.scheduling().schedules().update( + "host_01kd2m9a0b1c2d3e4f5g6h7j8m", + "sched_01kd2m9a0b1c2d3e4f5g6h7j8m", + UpdateSchedulesRequest + .builder() + .body( + UpsertScheduleRequest + .builder() + .rules( + Arrays.asList( + SchedulingWeeklyRule + .builder() + .start("09:00") + .end("17:00") + .days( + Arrays.asList(1, 2, 3, 4, 5) + ) + .build() + ) + ) + .name("Clinic hours") + .overrides( + Optional.of( + Arrays.asList( + SchedulingScheduleOverride + .builder() + .date("2027-12-24") + .ranges( + Arrays.asList( + SchedulingScheduleOverrideRangesItem + .builder() + .start("start") + .end("end") + .build() + ) + ) + .build() + ) + ) + ) + .build() + ) + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**host:** `String` — The host's id or uid.
@@ -18487,7 +20709,7 @@ client.scheduling().eventTypes().update(
-**minNoticeMinutes:** `Optional` — Slots starting sooner than this many minutes from now aren't offered. Default: 0. +**scheduleId:** `String` — The schedule's id.
@@ -18495,39 +20717,215 @@ client.scheduling().eventTypes().update(
-**bookingWindow:** `Optional` +**request:** `UpsertScheduleRequest` + +
+
+
+
+ + +
+
+
+ +
client.scheduling.schedules.remove(host, scheduleId) -> DeletedSchedulingSchedule +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Refused for the host's default schedule. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.scheduling().schedules().remove( + "host_01kd2m9a0b1c2d3e4f5g6h7j8m", + "sched_01kd2m9a0b1c2d3e4f5g6h7j8m", + RemoveSchedulesRequest + .builder() + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**host:** `String` — The host's id or uid. + +
+
+ +
+
+ +**scheduleId:** `String` — The schedule's id. + +
+
+
+
+ + +
+
+
+ +## Scheduling EventTypes +
client.scheduling.eventTypes.list() -> SchedulingEventTypeList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +The environment's event types, newest first. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.scheduling().eventTypes().list( + ListEventTypesRequest + .builder() + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**limit:** `Optional` + +
+
+ +
+
+ +**after:** `Optional` — The last id of the previous page.
+
+
+ + +
+
+
+ +
client.scheduling.eventTypes.create(request) -> SchedulingEventType +
+
+ +#### 📝 Description + +
+
+ +
+
+ +What can be booked: `one_on_one` with one host, `pool` for any free host, `collective` when every required host must be free, or `group` for a session with seats. +
+
+
+
+ +#### 🔌 Usage
-**limits:** `Optional>` — Caps on bookings per day or week. Default: none. - -
-
-
-**capacity:** `Optional` — Attendees per session. Required for, and only allowed on, `group`. - +```java +client.scheduling().eventTypes().create( + CreateEventTypeRequest + .builder() + .title("Initial consultation") + .durationMinutes(30) + .kind(CreateEventTypeRequestKind.ONE_ON_ONE) + .bufferAfterMinutes(10) + .minNoticeMinutes(120) + .hosts( + Optional.of( + Arrays.asList( + SchedulingEventTypeHostInput + .builder() + .host("doctor_482") + .build() + ) + ) + ) + .build() +); +``` +
+
+#### ⚙️ Parameters +
-**requiresApproval:** `Optional` — Bookings start as `pending_approval`, holding the time until approved or declined. Default: `false`. - -
-
-
-**approvalTtlMinutes:** `Optional` — How long a booking can wait for approval before it's declined, in minutes. Default: 1440. +**uid:** `Optional` — Your own id for this event type, unique in the environment, accepted wherever its id is.
@@ -18535,7 +20933,7 @@ client.scheduling().eventTypes().update(
-**holdTtlSeconds:** `Optional` — How long a hold keeps its slot, in seconds. Default: 600. +**kind:** `Optional` — Who a booking needs. `one_on_one`: one host. `pool`: any one of its hosts. `collective`: every `required` host, plus at most one `member`. `group`: one host, with attendees taking seats up to `capacity`. Fixed once created.
@@ -18543,7 +20941,7 @@ client.scheduling().eventTypes().update(
-**cancelNoticeMinutes:** `Optional` — Attendees can't cancel closer to the start than this. API keys can. +**description:** `Optional` — Plain text about the event type, shown on hosted booking pages and never in emails. Links, and anything shaped like a domain, must be on your organization's verified domains or their subdomains, and use `https`. `null` removes it.
@@ -18551,7 +20949,7 @@ client.scheduling().eventTypes().update(
-**rescheduleNoticeMinutes:** `Optional` — Attendees can't reschedule closer to the start than this. API keys can. Default: 0. +**title:** `String` — Shown to attendees and in emails. Host calendars show it only with `host_calendar_details: full`.
@@ -18559,7 +20957,7 @@ client.scheduling().eventTypes().update(
-**maxGuests:** `Optional` — How many people an attendee can add to a booking. Default: 0. Guests are emailed about it. Not on `group`. +**durationMinutes:** `Integer` — How long a booking lasts by default, in minutes.
@@ -18567,7 +20965,7 @@ client.scheduling().eventTypes().update(
-**maxActiveBookingsPerAttendee:** `Optional` — How many upcoming bookings of this event type one person can have at a time, known by `uid` or email. Default: `null`, no limit. Past this, booking answers `attendee_limit_reached`. Guests don't count, and each occurrence of a series does. +**durationOptions:** `Optional>` — Other lengths an attendee may choose, in minutes. Empty: only `duration_minutes`.
@@ -18575,7 +20973,7 @@ client.scheduling().eventTypes().update(
-**hostCalendarDetails:** `Optional` — What hosts' calendars say about a booking. `neutral` (the default): a private event titled "Appointment". `full`: a private event with this title and the attendee's name, plus names, emails and phone numbers in its description, which go to the host's calendar provider. Never answers. Refused in HIPAA mode. +**stepMinutes:** `Optional` — How far apart slots start. Default: the duration.
@@ -18583,7 +20981,7 @@ client.scheduling().eventTypes().update(
-**questions:** `Optional>` — What attendees are asked when booking. Keys must be unique. +**gridTimeZone:** `Optional` — The zone slots align in. Default: each host's own.
@@ -18591,7 +20989,7 @@ client.scheduling().eventTypes().update(
-**locations:** `Optional>` — Where bookings can meet. A browser only chooses among these. A `group` event type can't use `zoom`. +**bufferBeforeMinutes:** `Optional` — Minutes kept free before each booking. Default: 0.
@@ -18599,7 +20997,7 @@ client.scheduling().eventTypes().update(
-**hostFilter:** `Optional>>` — Pool members also include active hosts matching all of these attributes. +**bufferAfterMinutes:** `Optional` — Minutes kept free after each booking. Default: 0.
@@ -18607,7 +21005,7 @@ client.scheduling().eventTypes().update(
-**notifications:** `Optional>>` — Per event, overriding your settings for this event type. +**minNoticeMinutes:** `Optional` — Slots starting sooner than this many minutes from now aren't offered. Default: 0.
@@ -18615,7 +21013,7 @@ client.scheduling().eventTypes().update(
-**reminders:** `Optional>` — Replaces your settings' `reminders` for this event type. `null` inherits them; an empty list means none. +**bookingWindow:** `Optional`
@@ -18623,7 +21021,7 @@ client.scheduling().eventTypes().update(
-**metadata:** `Optional>` — Your own key-value pairs. +**limits:** `Optional>` — Caps on bookings per day or week. Default: none.
@@ -18631,7 +21029,7 @@ client.scheduling().eventTypes().update(
-**status:** `Optional` — `archived` stops new bookings, and keeps existing ones. +**capacity:** `Optional` — Attendees per session. Required for, and only allowed on, `group`.
@@ -18639,69 +21037,31 @@ client.scheduling().eventTypes().update(
-**hosts:** `Optional>` — Replaces the assigned hosts. Removed hosts keep their existing bookings. +**requiresApproval:** `Optional` — Bookings start as `pending_approval`, holding the time until approved or declined. Default: `false`.
- - - - - - -
- -## Scheduling Slots -
client.scheduling.slots.list(eventType) -> SchedulingSlotList -
-
- -#### 📝 Description - -
-
-Starts an attendee can book between `start` and `end` (at most 62 days), as UTC instants to show in their own time zone. A host whose calendar can't be read isn't offered. -
-
+**reassignmentEnabled:** `Optional` — Whether bookings of this event type can go to another host. Default: true. +
-#### 🔌 Usage - -
-
-
-```java -client.scheduling().slots().list( - "evtype_01kd2m9a0b1c2d3e4f5g6h7j8m", - ListSlotsRequest - .builder() - .start("2027-01-04T15:00:00.000Z") - .end("2027-01-04T15:00:00.000Z") - .build() -); -``` -
-
+**approvalTtlMinutes:** `Optional` — How long a booking can wait for approval before it's declined, in minutes. Default: 1440. +
-#### ⚙️ Parameters - -
-
-
-**eventType:** `String` — The event type's id or uid. +**holdTtlSeconds:** `Optional` — How long a hold keeps its slot, in seconds. Default: 600.
@@ -18709,7 +21069,7 @@ client.scheduling().slots().list(
-**start:** `String` — An ISO 8601 instant with an offset. +**cancelNoticeMinutes:** `Optional` — Attendees can't cancel closer to the start than this. API keys can.
@@ -18717,7 +21077,7 @@ client.scheduling().slots().list(
-**end:** `String` — An ISO 8601 instant with an offset. +**rescheduleNoticeMinutes:** `Optional` — Attendees can't reschedule closer to the start than this. API keys can. Default: 0.
@@ -18725,7 +21085,7 @@ client.scheduling().slots().list(
-**host:** `Optional` — Only this host's slots (id or uid). +**maxGuests:** `Optional` — How many people an attendee can add to a booking. Default: 0. Guests are emailed about it. Not on `group`.
@@ -18733,7 +21093,7 @@ client.scheduling().slots().list(
-**durationMinutes:** `Optional` +**maxActiveBookingsPerAttendee:** `Optional` — How many upcoming bookings of this event type one person can have at a time, known by `uid` or email. Default: `null`, no limit. Past this, booking answers `attendee_limit_reached`. Guests don't count, and each occurrence of a series does.
@@ -18741,67 +21101,31 @@ client.scheduling().slots().list(
-**attributes:** `Optional` — A JSON object narrowing a pool, such as `{"licensed_in":"CA"}`. +**hostCalendarDetails:** `Optional` — What hosts' calendars say about a booking. `neutral` (the default): a private event titled "Appointment". `full`: a private event with this title and the attendee's name, plus names, emails and phone numbers in its description, which go to the host's calendar provider. Never answers. Refused in HIPAA mode.
-
-
- - -
-
-
- -
client.scheduling.slots.explain(eventType) -> SchedulingSlotExplanation -
-
- -#### 📝 Description - -
-
-Why one start can or can't be booked right now, host by host, decided the same way a booking is. For support and debugging: it says when a host is busy, so don't show it to attendees. -
-
+**questions:** `Optional>` — What attendees are asked when booking. Keys must be unique. +
-#### 🔌 Usage - -
-
-
-```java -client.scheduling().slots().explain( - "evtype_01kd2m9a0b1c2d3e4f5g6h7j8m", - ExplainSlotsRequest - .builder() - .start("2027-01-04T15:00:00.000Z") - .build() -); -``` -
-
+**locations:** `Optional>>` — Where bookings can meet. A browser only chooses among these. A `group` event type can't use `zoom`. +
-#### ⚙️ Parameters -
-
-
- -**eventType:** `String` — The event type's id or uid. +**hostFilter:** `Optional>>` — Pool members also include active hosts matching all of these attributes.
@@ -18809,7 +21133,7 @@ client.scheduling().slots().explain(
-**start:** `String` — An ISO 8601 instant with an offset. +**notifications:** `Optional>>` — Per event, overriding your settings for this event type.
@@ -18817,7 +21141,7 @@ client.scheduling().slots().explain(
-**host:** `Optional` — Only this host (id or uid). +**reminders:** `Optional>` — Replaces your settings' `reminders` for this event type. `null` inherits them; an empty list means none.
@@ -18825,7 +21149,7 @@ client.scheduling().slots().explain(
-**durationMinutes:** `Optional` +**metadata:** `Optional>` — Your own key-value pairs.
@@ -18833,7 +21157,7 @@ client.scheduling().slots().explain(
-**attributes:** `Optional` — A JSON object narrowing a pool, such as `{"licensed_in":"CA"}`. +**hosts:** `Optional>` — Who can be booked. `one_on_one` and `group` take one; `collective` needs at least one `required` host.
@@ -18845,8 +21169,7 @@ client.scheduling().slots().explain(
-## Scheduling Availability -
client.scheduling.availability.search(request) -> SchedulingAvailabilitySearchResult +
client.scheduling.eventTypes.get(eventType) -> SchedulingEventType
@@ -18858,7 +21181,7 @@ client.scheduling().slots().explain(
-For "who's free" pages: each matching host's soonest slots, soonest first, across up to 500 hosts. +An event type by its id or your uid.
@@ -18873,17 +21196,10 @@ For "who's free" pages: each matching host's soonest slots, soonest first, acros
```java -client.scheduling().availability().search( - AvailabilitySearchRequest +client.scheduling().eventTypes().get( + "evtype_01kd2m9a0b1c2d3e4f5g6h7j8m", + GetEventTypesRequest .builder() - .eventType("evtype_01kd2m9a0b1c2d3e4f5g6h7j8m") - .start("2027-01-04T00:00:00.000Z") - .end("2027-01-18T00:00:00.000Z") - .attributes( - new HashMap() {{ - put("licensed_in", AvailabilitySearchRequestAttributesValue.of("CA")); - }} - ) .build() ); ``` @@ -18902,54 +21218,6 @@ client.scheduling().availability().search( **eventType:** `String` — The event type's id or uid. -
-
- -
-
- -**start:** `String` — An ISO 8601 instant with an offset. - -
-
- -
-
- -**end:** `String` — An ISO 8601 instant with an offset. - -
-
- -
-
- -**attributes:** `Optional>` — Only hosts matching all of these. - -
-
- -
-
- -**hosts:** `Optional>` — Only these hosts (ids or uids). Default: everyone the event type could offer. - -
-
- -
-
- -**slotsPerHost:** `Optional` — How many of each host's soonest slots to return. - -
-
- -
-
- -**limit:** `Optional` — Hosts to return, soonest availability first. -
@@ -18960,8 +21228,7 @@ client.scheduling().availability().search(
-## Scheduling Bookings -
client.scheduling.bookings.list() -> SchedulingBookingList +
client.scheduling.eventTypes.update(eventType, request) -> SchedulingEventType
@@ -18973,7 +21240,7 @@ client.scheduling().availability().search(
-The environment's bookings, newest first. Answers aren't included. +Changes what's given. Existing bookings keep what they were booked with. Set `status` to `archived` to stop new bookings.
@@ -18988,11 +21255,11 @@ The environment's bookings, newest first. Answers aren't included.
```java -client.scheduling().bookings().list( - ListBookingsRequest - .builder() - .startAfter("2027-01-04T15:00:00.000Z") - .startBefore("2027-01-04T15:00:00.000Z") +client.scheduling().eventTypes().update( + "evtype_01kd2m9a0b1c2d3e4f5g6h7j8m", + UpdateEventTypeRequest + .builder() + .minNoticeMinutes(240) .build() ); ``` @@ -19009,7 +21276,7 @@ client.scheduling().bookings().list(
-**limit:** `Optional` +**eventType:** `String` — The event type's id or uid.
@@ -19017,7 +21284,7 @@ client.scheduling().bookings().list(
-**after:** `Optional` — The last id of the previous page. +**uid:** `Optional` — Your own id for this event type. `null` removes it.
@@ -19025,7 +21292,7 @@ client.scheduling().bookings().list(
-**host:** `Optional` +**description:** `Optional` — Plain text about the event type, shown on hosted booking pages and never in emails. Links, and anything shaped like a domain, must be on your organization's verified domains or their subdomains, and use `https`. `null` removes it.
@@ -19033,7 +21300,7 @@ client.scheduling().bookings().list(
-**eventType:** `Optional` +**title:** `Optional` — Shown to attendees and in emails. Host calendars show it only with `host_calendar_details: full`.
@@ -19041,7 +21308,7 @@ client.scheduling().bookings().list(
-**status:** `Optional` +**durationMinutes:** `Optional` — How long a booking lasts by default, in minutes.
@@ -19049,7 +21316,7 @@ client.scheduling().bookings().list(
-**attendeeUid:** `Optional` +**durationOptions:** `Optional>` — Other lengths an attendee may choose, in minutes. Empty: only `duration_minutes`.
@@ -19057,7 +21324,7 @@ client.scheduling().bookings().list(
-**startAfter:** `Optional` — An ISO 8601 instant with an offset. +**stepMinutes:** `Optional` — How far apart slots start. Default: the duration.
@@ -19065,77 +21332,111 @@ client.scheduling().bookings().list(
-**startBefore:** `Optional` — An ISO 8601 instant with an offset. +**gridTimeZone:** `Optional` — The zone slots align in. Default: each host's own.
+ +
+
+ +**bufferBeforeMinutes:** `Optional` — Minutes kept free before each booking. Default: 0. +
+
+
+**bufferAfterMinutes:** `Optional` — Minutes kept free after each booking. Default: 0. +
-
-
client.scheduling.bookings.create(request) -> SchedulingBooking
-#### 📝 Description +**minNoticeMinutes:** `Optional` — Slots starting sooner than this many minutes from now aren't offered. Default: 0. + +
+
+**bookingWindow:** `Optional` + +
+
+
-Books a slot, or joins a group session. Without a `host`, a pool chooses fairly among those free. An event type that requires approval answers with a `pending_approval` booking. +**limits:** `Optional>` — Caps on bookings per day or week. Default: none. +
+ +
+
+ +**capacity:** `Optional` — Attendees per session. Required for, and only allowed on, `group`. +
-#### 🔌 Usage +
+
+ +**requiresApproval:** `Optional` — Bookings start as `pending_approval`, holding the time until approved or declined. Default: `false`. + +
+
+**reassignmentEnabled:** `Optional` — Whether bookings of this event type can go to another host. Default: true. + +
+
+
-```java -client.scheduling().bookings().create( - CreateBookingRequest - .builder() - .eventType("evtype_01kd2m9a0b1c2d3e4f5g6h7j8m") - .start("2027-01-04T15:00:00.000Z") - .attendee( - SchedulingAttendeeInput - .builder() - .timeZone("UTC") - .uid("patient_77") - .name("Sam Lee") - .email("sam@example.com") - .build() - ) - .idempotencyKey("welcome-user-123") - .build() -); -``` +**approvalTtlMinutes:** `Optional` — How long a booking can wait for approval before it's declined, in minutes. Default: 1440. +
+ +
+
+ +**holdTtlSeconds:** `Optional` — How long a hold keeps its slot, in seconds. Default: 600. +
-#### ⚙️ Parameters +
+
+ +**cancelNoticeMinutes:** `Optional` — Attendees can't cancel closer to the start than this. API keys can. + +
+
+**rescheduleNoticeMinutes:** `Optional` — Attendees can't reschedule closer to the start than this. API keys can. Default: 0. + +
+
+
-**idempotencyKey:** `Optional` — Makes retries safe: a repeated request with the same key and body returns the original booking instead of creating another, for 24 hours. A refused request keeps no key. 1-256 characters. +**maxGuests:** `Optional` — How many people an attendee can add to a booking. Default: 0. Guests are emailed about it. Not on `group`.
@@ -19143,7 +21444,7 @@ client.scheduling().bookings().create(
-**eventType:** `String` — The event type's id or uid. +**maxActiveBookingsPerAttendee:** `Optional` — How many upcoming bookings of this event type one person can have at a time, known by `uid` or email. Default: `null`, no limit. Past this, booking answers `attendee_limit_reached`. Guests don't count, and each occurrence of a series does.
@@ -19151,7 +21452,7 @@ client.scheduling().bookings().create(
-**start:** `String` — An ISO 8601 instant with an offset. +**hostCalendarDetails:** `Optional` — What hosts' calendars say about a booking. `neutral` (the default): a private event titled "Appointment". `full`: a private event with this title and the attendee's name, plus names, emails and phone numbers in its description, which go to the host's calendar provider. Never answers. Refused in HIPAA mode.
@@ -19159,7 +21460,7 @@ client.scheduling().bookings().create(
-**host:** `Optional` — A specific host (id or uid). Default: chosen fairly from those free. +**questions:** `Optional>` — What attendees are asked when booking. Keys must be unique.
@@ -19167,7 +21468,7 @@ client.scheduling().bookings().create(
-**attributes:** `Optional>` — Only choose among pool hosts matching all of these. +**locations:** `Optional>>` — Where bookings can meet. A browser only chooses among these. A `group` event type can't use `zoom`.
@@ -19175,7 +21476,7 @@ client.scheduling().bookings().create(
-**durationMinutes:** `Optional` — One of the event type's `duration_options`. +**hostFilter:** `Optional>>` — Pool members also include active hosts matching all of these attributes.
@@ -19183,7 +21484,7 @@ client.scheduling().bookings().create(
-**attendee:** `SchedulingAttendeeInput` +**notifications:** `Optional>>` — Per event, overriding your settings for this event type.
@@ -19191,7 +21492,7 @@ client.scheduling().bookings().create(
-**guests:** `Optional>` — Up to the event type's `max_guests`. +**reminders:** `Optional>` — Replaces your settings' `reminders` for this event type. `null` inherits them; an empty list means none.
@@ -19199,7 +21500,7 @@ client.scheduling().bookings().create(
-**answers:** `Optional>` — Answers to the event type's questions. Stored encrypted, and returned only by retrieving the booking. +**metadata:** `Optional>` — Your own key-value pairs.
@@ -19207,7 +21508,7 @@ client.scheduling().bookings().create(
-**location:** `Optional` — One of the event type's `locations`, with your link filled in if it has none. +**status:** `Optional` — `archived` stops new bookings, and keeps existing ones.
@@ -19215,7 +21516,7 @@ client.scheduling().bookings().create(
-**metadata:** `Optional>` — Your own key-value pairs. Don't put sensitive data here. +**hosts:** `Optional>` — Replaces the assigned hosts. Removed hosts keep their existing bookings.
@@ -19227,7 +21528,8 @@ client.scheduling().bookings().create(
-
client.scheduling.bookings.get(id) -> SchedulingBooking +## Scheduling Slots +
client.scheduling.slots.list(eventType) -> SchedulingSlotList
@@ -19239,7 +21541,7 @@ client.scheduling().bookings().create(
-A booking with its attendees and their answers. +Starts an attendee can book between `start` and `end` (at most 62 days), as UTC instants to show in their own time zone. A host whose calendar can't be read isn't offered.
@@ -19254,10 +21556,12 @@ A booking with its attendees and their answers.
```java -client.scheduling().bookings().get( - "book_01kd2m9a0b1c2d3e4f5g6h7j8m", - GetBookingsRequest +client.scheduling().slots().list( + "evtype_01kd2m9a0b1c2d3e4f5g6h7j8m", + ListSlotsRequest .builder() + .start("2027-01-04T15:00:00.000Z") + .end("2027-01-04T15:00:00.000Z") .build() ); ``` @@ -19274,7 +21578,47 @@ client.scheduling().bookings().get(
-**id:** `String` — The booking's id. +**eventType:** `String` — The event type's id or uid. + +
+
+ +
+
+ +**start:** `String` — An ISO 8601 instant with an offset. + +
+
+ +
+
+ +**end:** `String` — An ISO 8601 instant with an offset. + +
+
+ +
+
+ +**host:** `Optional` — Only this host's slots (id or uid). + +
+
+ +
+
+ +**durationMinutes:** `Optional` + +
+
+ +
+
+ +**attributes:** `Optional` — A JSON object narrowing a pool, such as `{"licensed_in":"CA"}`.
@@ -19286,7 +21630,7 @@ client.scheduling().bookings().get(
-
client.scheduling.bookings.reschedule(id, request) -> SchedulingBooking +
client.scheduling.slots.explain(eventType) -> SchedulingSlotExplanation
@@ -19298,7 +21642,7 @@ client.scheduling().bookings().get(
-Moves it to a new time, keeping its id. The old time stays booked if the new one isn't free. +Why one start can or can't be booked right now, host by host, decided the same way a booking is. For support and debugging: it says when a host is busy, so don't show it to attendees.
@@ -19313,11 +21657,11 @@ Moves it to a new time, keeping its id. The old time stays booked if the new one
```java -client.scheduling().bookings().reschedule( - "book_01kd2m9a0b1c2d3e4f5g6h7j8m", - RescheduleBookingRequest +client.scheduling().slots().explain( + "evtype_01kd2m9a0b1c2d3e4f5g6h7j8m", + ExplainSlotsRequest .builder() - .start("2027-01-05T15:00:00.000Z") + .start("2027-01-04T15:00:00.000Z") .build() ); ``` @@ -19334,7 +21678,7 @@ client.scheduling().bookings().reschedule(
-**id:** `String` — The booking's id. +**eventType:** `String` — The event type's id or uid.
@@ -19342,7 +21686,7 @@ client.scheduling().bookings().reschedule(
-**start:** `String` — The new start. The old time stays booked unless this one's free. +**start:** `String` — An ISO 8601 instant with an offset.
@@ -19350,7 +21694,23 @@ client.scheduling().bookings().reschedule(
-**host:** `Optional` — Move a pool booking to this host. Default: its current hosts. +**host:** `Optional` — Only this host (id or uid). + +
+
+ +
+
+ +**durationMinutes:** `Optional` + +
+
+ +
+
+ +**attributes:** `Optional` — A JSON object narrowing a pool, such as `{"licensed_in":"CA"}`.
@@ -19362,7 +21722,8 @@ client.scheduling().bookings().reschedule(
-
client.scheduling.bookings.cancel(id, request) -> SchedulingBooking +## Scheduling Availability +
client.scheduling.availability.search(request) -> SchedulingAvailabilitySearchResult
@@ -19374,7 +21735,7 @@ client.scheduling().bookings().reschedule(
-Frees the time and removes the calendar event. A cancelled booking stays charged. +For "who's free" pages: each matching host's soonest slots, soonest first, across up to 500 hosts.
@@ -19389,52 +21750,26 @@ Frees the time and removes the calendar event. A cancelled booking stays charged
```java -client.scheduling().bookings().cancel( - "book_01kd2m9a0b1c2d3e4f5g6h7j8m", - CancelSchedulingBookingRequest +client.scheduling().availability().search( + AvailabilitySearchRequest .builder() - .reason("Feeling better") + .eventType("evtype_01kd2m9a0b1c2d3e4f5g6h7j8m") + .start("2027-01-04T00:00:00.000Z") + .end("2027-01-18T00:00:00.000Z") + .attributes( + new HashMap() {{ + put("licensed_in", AvailabilitySearchRequestAttributesValue.of("CA")); + }} + ) .build() ); -``` -
-
- - - -#### ⚙️ Parameters - -
-
- -
-
- -**id:** `String` — The booking's id. - -
-
- -
-
- -**reason:** `Optional` — Why it's being cancelled. Only retrieving this booking returns it: it's never in webhooks, logs or emails. - -
-
+```
- - -
- -
client.scheduling.bookings.events(id) -> SchedulingBookingEventList -
-
-#### 📝 Description +#### ⚙️ Parameters
@@ -19442,42 +21777,39 @@ client.scheduling().bookings().cancel(
-What's happened to a booking, oldest first, and who did it. There's no personal data in here. -
-
+**eventType:** `String` — The event type's id or uid. +
-#### 🔌 Usage -
+**start:** `String` — An ISO 8601 instant with an offset. + +
+
+
-```java -client.scheduling().bookings().events( - "book_01kd2m9a0b1c2d3e4f5g6h7j8m", - EventsBookingsRequest - .builder() - .build() -); -``` -
-
+**end:** `String` — An ISO 8601 instant with an offset. +
-#### ⚙️ Parameters -
+**attributes:** `Optional>` — Only hosts matching all of these. + +
+
+
-**id:** `String` — The booking's id. +**hosts:** `Optional>` — Only these hosts (ids or uids). Default: everyone the event type could offer.
@@ -19485,7 +21817,7 @@ client.scheduling().bookings().events(
-**limit:** `Optional` +**slotsPerHost:** `Optional` — How many of each host's soonest slots to return.
@@ -19493,7 +21825,7 @@ client.scheduling().bookings().events(
-**after:** `Optional` — The last id of the previous page. +**limit:** `Optional` — Hosts to return, soonest availability first.
@@ -19505,7 +21837,8 @@ client.scheduling().bookings().events(
-
client.scheduling.bookings.approve(id) -> SchedulingBooking +## Scheduling Holds +
client.scheduling.holds.create(request) -> SchedulingBooking
@@ -19517,7 +21850,7 @@ client.scheduling().bookings().events(
-Confirms a `pending_approval` booking. +Keeps a slot for a while (the event type's `hold_ttl_seconds`) so you can take payment, then confirm it. Answers with a `held` booking, which isn't charged and sends nothing.
@@ -19532,10 +21865,19 @@ Confirms a `pending_approval` booking.
```java -client.scheduling().bookings().approve( - "book_01kd2m9a0b1c2d3e4f5g6h7j8m", - ApproveBookingsRequest +client.scheduling().holds().create( + CreateHoldRequest .builder() + .eventType("evtype_01kd2m9a0b1c2d3e4f5g6h7j8m") + .start("2027-01-04T15:00:00.000Z") + .attendee( + SchedulingAttendeeInput + .builder() + .timeZone("UTC") + .uid("patient_77") + .build() + ) + .idempotencyKey("welcome-user-123") .build() ); ``` @@ -19552,66 +21894,87 @@ client.scheduling().bookings().approve(
-**id:** `String` — The booking's id. +**idempotencyKey:** `Optional` — Makes retries safe: a repeated request with the same key and body returns the original booking instead of creating another, for 24 hours. A refused request keeps no key. 1-256 characters.
-
-
+
+
+**eventType:** `String` — The event type's id or uid. +
-
-
client.scheduling.bookings.decline(id) -> SchedulingBooking
-#### 📝 Description +**start:** `String` — An ISO 8601 instant with an offset. + +
+
+**host:** `Optional` — A specific host (id or uid). Default: chosen fairly from those free. + +
+
+
-Refuses a `pending_approval` booking and frees the time. +**attributes:** `Optional>` — Only choose among pool hosts matching all of these. +
+ +
+
+ +**durationMinutes:** `Optional` — One of the event type's `duration_options`. +
-#### 🔌 Usage -
+**attendee:** `SchedulingAttendeeInput` + +
+
+
-```java -client.scheduling().bookings().decline( - "book_01kd2m9a0b1c2d3e4f5g6h7j8m", - DeclineBookingsRequest - .builder() - .build() -); -``` +**guests:** `Optional>` — Up to the event type's `max_guests`. +
+ +
+
+ +**answers:** `Optional>` — Answers to the event type's questions. Stored encrypted, and returned only by retrieving the booking. +
-#### ⚙️ Parameters -
+**location:** `Optional` — One of the event type's `locations`, with your link filled in if it has none. + +
+
+
-**id:** `String` — The booking's id. +**metadata:** `Optional>` — Your own key-value pairs. Don't put sensitive data here.
@@ -19623,7 +21986,7 @@ client.scheduling().bookings().decline(
-
client.scheduling.bookings.notifications(id) -> SchedulingBookingNotificationList +
client.scheduling.holds.confirm(id, request) -> SchedulingBooking
@@ -19635,7 +21998,7 @@ client.scheduling().bookings().decline(
-What's been queued for this booking and what became of it, newest first, including why something wasn't sent. It never says who it went to. +Turns a hold into a booking. Always succeeds before the hold expires. Repeating it is safe.
@@ -19650,10 +22013,11 @@ What's been queued for this booking and what became of it, newest first, includi
```java -client.scheduling().bookings().notifications( +client.scheduling().holds().confirm( "book_01kd2m9a0b1c2d3e4f5g6h7j8m", - NotificationsBookingsRequest + ConfirmHoldRequest .builder() + .ifStillFree(true) .build() ); ``` @@ -19678,15 +22042,7 @@ client.scheduling().bookings().notifications(
-**limit:** `Optional` - -
-
- -
-
- -**after:** `Optional` — The last id of the previous page. +**ifStillFree:** `Optional` — After the hold expired, book anyway if nobody else took the slot. Default: refuse with `hold_expired`.
@@ -19698,7 +22054,7 @@ client.scheduling().bookings().notifications(
-
client.scheduling.bookings.markNoShow(id) -> SchedulingBooking +
client.scheduling.holds.release(id) -> SchedulingBooking
@@ -19710,7 +22066,7 @@ client.scheduling().bookings().notifications(
-Records that the attendee didn't come, once the booking has started. +Gives the slot back early.
@@ -19725,9 +22081,9 @@ Records that the attendee didn't come, once the booking has started.
```java -client.scheduling().bookings().markNoShow( +client.scheduling().holds().release( "book_01kd2m9a0b1c2d3e4f5g6h7j8m", - MarkNoShowBookingsRequest + ReleaseHoldsRequest .builder() .build() ); @@ -19757,7 +22113,8 @@ client.scheduling().bookings().markNoShow(
-
client.scheduling.bookings.updateLocation(id, request) -> SchedulingBooking +## Scheduling Series +
client.scheduling.series.create(request) -> SchedulingSeries
@@ -19769,7 +22126,7 @@ client.scheduling().bookings().markNoShow(
-Where it happens, such as the meeting link you made after the `scheduling.booking.confirmed` webhook. +Books up to 52 occurrences, keeping the attendee's local time across DST changes. Each one is an ordinary booking that can move on its own, and a pool keeps one host throughout.
@@ -19784,20 +22141,32 @@ Where it happens, such as the meeting link you made after the `scheduling.bookin
```java -client.scheduling().bookings().updateLocation( - "book_01kd2m9a0b1c2d3e4f5g6h7j8m", - UpdateBookingLocationRequest +client.scheduling().series().create( + CreateSeriesBody .builder() - .location( - SchedulingLocation.link( - SchedulingLocationLink - .builder() - .url( - OptionalNullable.of("https://meet.example.com/abc") - ) - .build() - ) + .body( + CreateSeriesRequest + .builder() + .eventType("evtype_01kd2m9a0b1c2d3e4f5g6h7j8m") + .start("2027-01-04T15:00:00.000Z") + .attendee( + SchedulingAttendeeInput + .builder() + .timeZone("America/New_York") + .uid("patient_77") + .build() + ) + .recurrence( + CreateSeriesRequestRecurrence + .builder() + .frequency(CreateSeriesRequestRecurrenceFrequency.WEEKLY) + .count(12) + .interval(1) + .build() + ) + .build() ) + .idempotencyKey("welcome-user-123") .build() ); ``` @@ -19814,7 +22183,7 @@ client.scheduling().bookings().updateLocation(
-**id:** `String` — The booking's id. +**idempotencyKey:** `Optional` — Makes retries safe: a repeated request with the same key and body returns the original booking instead of creating another, for 24 hours. A refused request keeps no key. 1-256 characters.
@@ -19822,7 +22191,7 @@ client.scheduling().bookings().updateLocation(
-**location:** `SchedulingLocation` +**request:** `CreateSeriesRequest`
@@ -19834,8 +22203,7 @@ client.scheduling().bookings().updateLocation(
-## Scheduling Holds -
client.scheduling.holds.create(request) -> SchedulingBooking +
client.scheduling.series.preview(request) -> SchedulingSeriesPreview
@@ -19847,7 +22215,7 @@ client.scheduling().bookings().updateLocation(
-Keeps a slot for a while (the event type's `hold_ttl_seconds`) so you can take payment, then confirm it. Answers with a `held` booking, which isn't charged and sends nothing. +Which occurrences would be free, without booking anything.
@@ -19862,19 +22230,26 @@ Keeps a slot for a while (the event type's `hold_ttl_seconds`) so you can take p
```java -client.scheduling().holds().create( - CreateHoldRequest +client.scheduling().series().preview( + CreateSeriesRequest .builder() .eventType("evtype_01kd2m9a0b1c2d3e4f5g6h7j8m") .start("2027-01-04T15:00:00.000Z") .attendee( SchedulingAttendeeInput .builder() - .timeZone("UTC") + .timeZone("America/New_York") .uid("patient_77") .build() ) - .idempotencyKey("welcome-user-123") + .recurrence( + CreateSeriesRequestRecurrence + .builder() + .frequency(CreateSeriesRequestRecurrenceFrequency.WEEKLY) + .count(12) + .interval(1) + .build() + ) .build() ); ``` @@ -19891,79 +22266,67 @@ client.scheduling().holds().create(
-**idempotencyKey:** `Optional` — Makes retries safe: a repeated request with the same key and body returns the original booking instead of creating another, for 24 hours. A refused request keeps no key. 1-256 characters. +**request:** `CreateSeriesRequest`
+
+
-
-
-**eventType:** `String` — The event type's id or uid. -
+
+
client.scheduling.series.cancel(id, request) -> SchedulingCancelledSeries
-**start:** `String` — An ISO 8601 instant with an offset. - -
-
+#### 📝 Description
-**host:** `Optional` — A specific host (id or uid). Default: chosen fairly from those free. - -
-
-
-**attributes:** `Optional>` — Only choose among pool hosts matching all of these. - +Cancels the occurrences from `from_index` on, or all of them. +
+
+#### 🔌 Usage +
-**durationMinutes:** `Optional` — One of the event type's `duration_options`. - -
-
-
-**attendee:** `SchedulingAttendeeInput` - +```java +client.scheduling().series().cancel( + "series_01kd2m9a0b1c2d3e4f5g6h7j8m", + CancelSeriesRequest + .builder() + .fromIndex(4L) + .build() +); +```
- -
-
- -**guests:** `Optional>` — Up to the event type's `max_guests`. -
+#### ⚙️ Parameters +
-**answers:** `Optional>` — Answers to the event type's questions. Stored encrypted, and returned only by retrieving the booking. - -
-
-
-**location:** `Optional` — One of the event type's `locations`, with your link filled in if it has none. +**id:** `String` — The series' id.
@@ -19971,7 +22334,7 @@ client.scheduling().holds().create(
-**metadata:** `Optional>` — Your own key-value pairs. Don't put sensitive data here. +**fromIndex:** `Optional` — Cancel this occurrence and those after it. Default: all of them.
@@ -19983,7 +22346,8 @@ client.scheduling().holds().create(
-
client.scheduling.holds.confirm(id, request) -> SchedulingBooking +## Scheduling Attendees +
client.scheduling.attendees.erase(uid) -> SchedulingAttendeeErasure
@@ -19995,7 +22359,7 @@ client.scheduling().holds().create(
-Turns a hold into a booking. Always succeeds before the hold expires. Repeating it is safe. +Removes this person's details and answers from every booking now, and ends any booker session fixed to them. The bookings themselves stay.
@@ -20010,11 +22374,10 @@ Turns a hold into a booking. Always succeeds before the hold expires. Repeating
```java -client.scheduling().holds().confirm( - "book_01kd2m9a0b1c2d3e4f5g6h7j8m", - ConfirmHoldRequest +client.scheduling().attendees().erase( + "patient_77", + EraseAttendeesRequest .builder() - .ifStillFree(true) .build() ); ``` @@ -20031,15 +22394,7 @@ client.scheduling().holds().confirm(
-**id:** `String` — The booking's id. - -
-
- -
-
- -**ifStillFree:** `Optional` — After the hold expired, book anyway if nobody else took the slot. Default: refuse with `hold_expired`. +**uid:** `String` — Your id for the attendee.
@@ -20051,7 +22406,7 @@ client.scheduling().holds().confirm(
-
client.scheduling.holds.release(id) -> SchedulingBooking +
client.scheduling.attendees.eraseByEmail(request) -> SchedulingAttendeeErasureByEmail
@@ -20063,7 +22418,7 @@ client.scheduling().holds().confirm(
-Gives the slot back early. +Removes this address's details and answers from every booking now, for someone you have no `uid` for, such as a guest. The bookings themselves stay.
@@ -20078,10 +22433,10 @@ Gives the slot back early.
```java -client.scheduling().holds().release( - "book_01kd2m9a0b1c2d3e4f5g6h7j8m", - ReleaseHoldsRequest +client.scheduling().attendees().eraseByEmail( + EraseSchedulingAttendeeByEmailRequest .builder() + .email("sam@example.com") .build() ); ``` @@ -20098,7 +22453,7 @@ client.scheduling().holds().release(
-**id:** `String` — The booking's id. +**email:** `String` — The address to forget, an attendee's or a guest's.
@@ -20110,8 +22465,8 @@ client.scheduling().holds().release(
-## Scheduling Series -
client.scheduling.series.create(request) -> SchedulingSeries +## Scheduling Calendars +
client.scheduling.calendars.authorize(host, request) -> SchedulingCalendarAuthorization
@@ -20123,7 +22478,7 @@ client.scheduling().holds().release(
-Books up to 52 occurrences, keeping the attendee's local time across DST changes. Each one is an ordinary booking that can move on its own, and a pool keeps one host throughout. +A URL for the host to give consent at Google or Microsoft. Open it in a new window: providers refuse to be framed. Coss.com reads only busy times, and writes events with a neutral title unless the event type's `host_calendar_details` is `full`.
@@ -20138,32 +22493,11 @@ Books up to 52 occurrences, keeping the attendee's local time across DST changes
```java -client.scheduling().series().create( - CreateSeriesBody +client.scheduling().calendars().authorize( + "host_01kd2m9a0b1c2d3e4f5g6h7j8m", + AuthorizeCalendarRequest .builder() - .body( - CreateSeriesRequest - .builder() - .eventType("evtype_01kd2m9a0b1c2d3e4f5g6h7j8m") - .start("2027-01-04T15:00:00.000Z") - .attendee( - SchedulingAttendeeInput - .builder() - .timeZone("America/New_York") - .uid("patient_77") - .build() - ) - .recurrence( - CreateSeriesRequestRecurrence - .builder() - .frequency(CreateSeriesRequestRecurrenceFrequency.WEEKLY) - .count(12) - .interval(1) - .build() - ) - .build() - ) - .idempotencyKey("welcome-user-123") + .provider(AuthorizeCalendarRequestProvider.GOOGLE) .build() ); ``` @@ -20180,7 +22514,7 @@ client.scheduling().series().create(
-**idempotencyKey:** `Optional` — Makes retries safe: a repeated request with the same key and body returns the original booking instead of creating another, for 24 hours. A refused request keeps no key. 1-256 characters. +**host:** `String` — The host's id or uid.
@@ -20188,7 +22522,15 @@ client.scheduling().series().create(
-**request:** `CreateSeriesRequest` +**provider:** `AuthorizeCalendarRequestProvider` — Whose consent page to open. CalDAV connects with a password instead. + +
+
+ +
+
+ +**returnUrl:** `Optional` — Where to send the browser afterwards, on one of the environment's allowed origins. `coss_calendar` says what happened: `connected`, `denied` or `invalid`.
@@ -20200,7 +22542,7 @@ client.scheduling().series().create(
-
client.scheduling.series.preview(request) -> SchedulingSeriesPreview +
client.scheduling.calendars.list(host) -> SchedulingCalendarConnectionList
@@ -20212,7 +22554,7 @@ client.scheduling().series().create(
-Which occurrences would be free, without booking anything. +With each connection's calendars and which of them count.
@@ -20227,26 +22569,10 @@ Which occurrences would be free, without booking anything.
```java -client.scheduling().series().preview( - CreateSeriesRequest +client.scheduling().calendars().list( + "host_01kd2m9a0b1c2d3e4f5g6h7j8m", + ListCalendarsRequest .builder() - .eventType("evtype_01kd2m9a0b1c2d3e4f5g6h7j8m") - .start("2027-01-04T15:00:00.000Z") - .attendee( - SchedulingAttendeeInput - .builder() - .timeZone("America/New_York") - .uid("patient_77") - .build() - ) - .recurrence( - CreateSeriesRequestRecurrence - .builder() - .frequency(CreateSeriesRequestRecurrenceFrequency.WEEKLY) - .count(12) - .interval(1) - .build() - ) .build() ); ``` @@ -20263,7 +22589,7 @@ client.scheduling().series().preview(
-**request:** `CreateSeriesRequest` +**host:** `String` — The host's id or uid.
@@ -20275,7 +22601,7 @@ client.scheduling().series().preview(
-
client.scheduling.series.cancel(id, request) -> SchedulingCancelledSeries +
client.scheduling.calendars.connect(host, request) -> SchedulingCalendarConnection
@@ -20287,7 +22613,7 @@ client.scheduling().series().preview(
-Cancels the occurrences from `from_index` on, or all of them. +CalDAV (Apple and others) with an app password, or, in sandbox environments, a `simulated` calendar whose busy times you set yourself. Google and Microsoft use `authorize`.
@@ -20302,11 +22628,20 @@ Cancels the occurrences from `from_index` on, or all of them.
```java -client.scheduling().series().cancel( - "series_01kd2m9a0b1c2d3e4f5g6h7j8m", - CancelSeriesRequest +client.scheduling().calendars().connect( + "host_01kd2m9a0b1c2d3e4f5g6h7j8m", + ConnectCalendarsRequest .builder() - .fromIndex(4L) + .body( + CreateCalendarConnectionRequest.caldav( + CreateCalendarConnectionRequestCaldav + .builder() + .url("url") + .username("username") + .password("password") + .build() + ) + ) .build() ); ``` @@ -20323,7 +22658,7 @@ client.scheduling().series().cancel(
-**id:** `String` — The series' id. +**host:** `String` — The host's id or uid.
@@ -20331,7 +22666,7 @@ client.scheduling().series().cancel(
-**fromIndex:** `Optional` — Cancel this occurrence and those after it. Default: all of them. +**request:** `CreateCalendarConnectionRequest`
@@ -20343,8 +22678,7 @@ client.scheduling().series().cancel(
-## Scheduling Attendees -
client.scheduling.attendees.erase(uid) -> SchedulingAttendeeErasure +
client.scheduling.calendars.disconnect(host, id) -> DeletedSchedulingCalendarConnection
@@ -20356,7 +22690,7 @@ client.scheduling().series().cancel(
-Removes this person's details and answers from every booking now, and ends any booker session fixed to them. The bookings themselves stay. +Revokes coss.com's access and deletes every busy time read through it. One a calendar delegation manages is refused (`calendar_managed`).
@@ -20371,9 +22705,10 @@ Removes this person's details and answers from every booking now, and ends any b
```java -client.scheduling().attendees().erase( - "patient_77", - EraseAttendeesRequest +client.scheduling().calendars().disconnect( + "host_01kd2m9a0b1c2d3e4f5g6h7j8m", + "calconn_01kd2m9a0b1c2d3e4f5g6h7j8m", + DisconnectCalendarsRequest .builder() .build() ); @@ -20391,7 +22726,15 @@ client.scheduling().attendees().erase(
-**uid:** `String` — Your id for the attendee. +**host:** `String` — The host's id or uid. + +
+
+ +
+
+ +**id:** `String` — The connection's id.
@@ -20403,7 +22746,7 @@ client.scheduling().attendees().erase(
-
client.scheduling.attendees.eraseByEmail(request) -> SchedulingAttendeeErasureByEmail +
client.scheduling.calendars.update(host, calendarId, request) -> SchedulingCalendarConnectionList
@@ -20415,7 +22758,7 @@ client.scheduling().attendees().erase(
-Removes this address's details and answers from every booking now, for someone you have no `uid` for, such as a guest. The bookings themselves stay. +Whether its busy times block slots, and whether bookings are written to it.
@@ -20430,10 +22773,12 @@ Removes this address's details and answers from every booking now, for someone y
```java -client.scheduling().attendees().eraseByEmail( - EraseSchedulingAttendeeByEmailRequest +client.scheduling().calendars().update( + "host_01kd2m9a0b1c2d3e4f5g6h7j8m", + "cal_01kd2m9a0b1c2d3e4f5g6h7j8m", + UpdateCalendarRequest .builder() - .email("sam@example.com") + .readBusy(true) .build() ); ``` @@ -20450,7 +22795,31 @@ client.scheduling().attendees().eraseByEmail(
-**email:** `String` — The address to forget, an attendee's or a guest's. +**host:** `String` — The host's id or uid. + +
+
+ +
+
+ +**calendarId:** `String` — The calendar's id. + +
+
+ +
+
+ +**readBusy:** `Optional` — Whether this calendar's busy times block slots. + +
+
+ +
+
+ +**writeTarget:** `Optional` — Bookings are written to one calendar; setting this moves it here.
@@ -20462,8 +22831,7 @@ client.scheduling().attendees().eraseByEmail(
-## Scheduling Calendars -
client.scheduling.calendars.authorize(host, request) -> SchedulingCalendarAuthorization +
client.scheduling.calendars.setSimulatedBusy(host, request)
@@ -20475,7 +22843,7 @@ client.scheduling().attendees().eraseByEmail(
-A URL for the host to give consent at Google or Microsoft. Open it in a new window: providers refuse to be framed. Coss.com reads only busy times, and writes events with a neutral title unless the event type's `host_calendar_details` is `full`. +Sandbox environments only: test how bookings react to a busy calendar.
@@ -20490,11 +22858,19 @@ A URL for the host to give consent at Google or Microsoft. Open it in a new wind
```java -client.scheduling().calendars().authorize( +client.scheduling().calendars().setSimulatedBusy( "host_01kd2m9a0b1c2d3e4f5g6h7j8m", - AuthorizeCalendarRequest + SetSimulatedBusyRequest .builder() - .provider(AuthorizeCalendarRequestProvider.GOOGLE) + .intervals( + Arrays.asList( + SetSimulatedBusyRequestIntervalsItem + .builder() + .start("2027-01-04T15:00:00.000Z") + .end("2027-01-04T16:00:00.000Z") + .build() + ) + ) .build() ); ``` @@ -20503,7 +22879,40 @@ client.scheduling().calendars().authorize(
-#### ⚙️ Parameters +#### ⚙️ Parameters + +
+
+ +
+
+ +**host:** `String` — The host's id or uid. + +
+
+ +
+
+ +**intervals:** `List` — The simulated calendar's busy times. + +
+
+
+
+ + + + +
+ +## Scheduling CalendarDelegations +
client.scheduling.calendarDelegations.list() -> SchedulingCalendarDelegationList +
+
+ +#### 📝 Description
@@ -20511,24 +22920,23 @@ client.scheduling().calendars().authorize(
-**host:** `String` — The host's id or uid. - +With how many hosts each has connected. +
+
+#### 🔌 Usage +
-**provider:** `AuthorizeCalendarRequestProvider` — Whose consent page to open. CalDAV connects with a password instead. - -
-
-
-**returnUrl:** `Optional` — Where to send the browser afterwards, on one of the environment's allowed origins. `coss_calendar` says what happened: `connected`, `denied` or `invalid`. - +```java +client.scheduling().calendarDelegations().list(); +```
@@ -20539,7 +22947,7 @@ client.scheduling().calendars().authorize(
-
client.scheduling.calendars.list(host) -> SchedulingCalendarConnectionList +
client.scheduling.calendarDelegations.create(request) -> SchedulingCalendarDelegation
@@ -20551,7 +22959,7 @@ client.scheduling().calendars().authorize(
-With each connection's calendars and which of them count. +An admin authorizes once, and every host on the domain gets their calendar with no consent screen. It stays `pending`: authorize what it returns, then verify it. Credentials are never returned.
@@ -20566,11 +22974,14 @@ With each connection's calendars and which of them count.
```java -client.scheduling().calendars().list( - "host_01kd2m9a0b1c2d3e4f5g6h7j8m", - ListCalendarsRequest - .builder() - .build() +client.scheduling().calendarDelegations().create( + CreateCalendarDelegationRequest.google( + CreateCalendarDelegationRequestGoogle + .builder() + .domain("domain") + .serviceAccountKey("service_account_key") + .build() + ) ); ```
@@ -20586,7 +22997,7 @@ client.scheduling().calendars().list(
-**host:** `String` — The host's id or uid. +**request:** `CreateCalendarDelegationRequest`
@@ -20598,7 +23009,7 @@ client.scheduling().calendars().list(
-
client.scheduling.calendars.connect(host, request) -> SchedulingCalendarConnection +
client.scheduling.calendarDelegations.get(id) -> SchedulingCalendarDelegation
@@ -20610,7 +23021,7 @@ client.scheduling().calendars().list(
-CalDAV (Apple and others) with an app password, or, in sandbox environments, a `simulated` calendar whose busy times you set yourself. Google and Microsoft use `authorize`. +Its status, what to authorize, and how many hosts it has connected.
@@ -20625,20 +23036,10 @@ CalDAV (Apple and others) with an app password, or, in sandbox environments, a `
```java -client.scheduling().calendars().connect( - "host_01kd2m9a0b1c2d3e4f5g6h7j8m", - ConnectCalendarsRequest +client.scheduling().calendarDelegations().get( + "caldlg_01kd2m9a0b1c2d3e4f5g6h7j8m", + GetCalendarDelegationsRequest .builder() - .body( - CreateCalendarConnectionRequest.caldav( - CreateCalendarConnectionRequestCaldav - .builder() - .url("url") - .username("username") - .password("password") - .build() - ) - ) .build() ); ``` @@ -20655,15 +23056,7 @@ client.scheduling().calendars().connect(
-**host:** `String` — The host's id or uid. - -
-
- -
-
- -**request:** `CreateCalendarConnectionRequest` +**id:** `String` — The delegation's id.
@@ -20675,7 +23068,7 @@ client.scheduling().calendars().connect(
-
client.scheduling.calendars.disconnect(host, id) -> DeletedSchedulingCalendarConnection +
client.scheduling.calendarDelegations.delete(id) -> DeletedSchedulingCalendarDelegation
@@ -20687,7 +23080,7 @@ client.scheduling().calendars().connect(
-Revokes coss.com's access and deletes every busy time read through it. One a calendar delegation manages is refused (`calendar_managed`). +Its hosts lose these calendars within minutes. They stay bookable with no conflict check, and events already written stay on their calendars, out of reach of later moves or cancellations.
@@ -20702,10 +23095,9 @@ Revokes coss.com's access and deletes every busy time read through it. One a cal
```java -client.scheduling().calendars().disconnect( - "host_01kd2m9a0b1c2d3e4f5g6h7j8m", - "calconn_01kd2m9a0b1c2d3e4f5g6h7j8m", - DisconnectCalendarsRequest +client.scheduling().calendarDelegations().delete( + "caldlg_01kd2m9a0b1c2d3e4f5g6h7j8m", + DeleteCalendarDelegationsRequest .builder() .build() ); @@ -20723,15 +23115,7 @@ client.scheduling().calendars().disconnect(
-**host:** `String` — The host's id or uid. - -
-
- -
-
- -**id:** `String` — The connection's id. +**id:** `String` — The delegation's id.
@@ -20743,7 +23127,7 @@ client.scheduling().calendars().disconnect(
-
client.scheduling.calendars.update(host, calendarId, request) -> SchedulingCalendarConnectionList +
client.scheduling.calendarDelegations.update(id, request) -> SchedulingCalendarDelegation
@@ -20755,7 +23139,7 @@ client.scheduling().calendars().disconnect(
-Whether its busy times block slots, and whether bookings are written to it. +New credentials are tried on the verified mailbox before they replace the old ones, and end an outage if they work.
@@ -20770,12 +23154,11 @@ Whether its busy times block slots, and whether bookings are written to it.
```java -client.scheduling().calendars().update( - "host_01kd2m9a0b1c2d3e4f5g6h7j8m", - "cal_01kd2m9a0b1c2d3e4f5g6h7j8m", - UpdateCalendarRequest +client.scheduling().calendarDelegations().update( + "caldlg_01kd2m9a0b1c2d3e4f5g6h7j8m", + UpdateCalendarDelegationRequest .builder() - .readBusy(true) + .matchHostEmail(false) .build() ); ``` @@ -20792,7 +23175,7 @@ client.scheduling().calendars().update(
-**host:** `String` — The host's id or uid. +**id:** `String` — The delegation's id.
@@ -20800,7 +23183,7 @@ client.scheduling().calendars().update(
-**calendarId:** `String` — The calendar's id. +**matchHostEmail:** `Optional` — Whether a host's `email` picks their mailbox when `calendar_account` isn't set. Turn it off if end users can type their own email into your app: otherwise one could name a colleague's address and reach that calendar.
@@ -20808,7 +23191,7 @@ client.scheduling().calendars().update(
-**readBusy:** `Optional` — Whether this calendar's busy times block slots. +**serviceAccountKey:** `Optional` — A new key. It's tried on the verified mailbox before it replaces the old one.
@@ -20816,7 +23199,15 @@ client.scheduling().calendars().update(
-**writeTarget:** `Optional` — Bookings are written to one calendar; setting this moves it here. +**clientSecret:** `Optional` — A new client secret. It's tried on the verified mailbox before it replaces the old one. + +
+
+ +
+
+ +**secretExpiresAt:** `Optional` — When the Entra client secret expires. Owners and admins are warned 14 days before.
@@ -20828,7 +23219,7 @@ client.scheduling().calendars().update(
-
client.scheduling.calendars.setSimulatedBusy(host, request) +
client.scheduling.calendarDelegations.verify(id, request) -> SchedulingCalendarDelegation
@@ -20840,7 +23231,7 @@ client.scheduling().calendars().update(
-Sandbox environments only: test how bookings react to a busy calendar. +Tries one real mailbox. Passing makes it `active`, and its hosts start connecting. Google can take up to 24 hours to apply a new authorization, so a refusal may just need time.
@@ -20855,19 +23246,11 @@ Sandbox environments only: test how bookings react to a busy calendar.
```java -client.scheduling().calendars().setSimulatedBusy( - "host_01kd2m9a0b1c2d3e4f5g6h7j8m", - SetSimulatedBusyRequest +client.scheduling().calendarDelegations().verify( + "caldlg_01kd2m9a0b1c2d3e4f5g6h7j8m", + VerifyCalendarDelegationRequest .builder() - .intervals( - Arrays.asList( - SetSimulatedBusyRequestIntervalsItem - .builder() - .start("2027-01-04T15:00:00.000Z") - .end("2027-01-04T16:00:00.000Z") - .build() - ) - ) + .account("ana@example.com") .build() ); ``` @@ -20884,7 +23267,7 @@ client.scheduling().calendars().setSimulatedBusy(
-**host:** `String` — The host's id or uid. +**id:** `String` — The delegation's id.
@@ -20892,7 +23275,7 @@ client.scheduling().calendars().setSimulatedBusy(
-**intervals:** `List` — The simulated calendar's busy times. +**account:** `String` — A real mailbox on the domain to try. In Microsoft 365, a user principal name.
@@ -20904,8 +23287,8 @@ client.scheduling().calendars().setSimulatedBusy(
-## Scheduling CalendarDelegations -
client.scheduling.calendarDelegations.list() -> SchedulingCalendarDelegationList +## Scheduling OauthApps +
client.scheduling.oauthApps.list() -> SchedulingOauthAppList
@@ -20917,7 +23300,7 @@ client.scheduling().calendars().setSimulatedBusy(
-With how many hosts each has connected. +At most one per provider, with how many connections use each.
@@ -20932,7 +23315,7 @@ With how many hosts each has connected.
```java -client.scheduling().calendarDelegations().list(); +client.scheduling().oauthApps().list(); ```
@@ -20944,7 +23327,7 @@ client.scheduling().calendarDelegations().list();
-
client.scheduling.calendarDelegations.create(request) -> SchedulingCalendarDelegation +
client.scheduling.oauthApps.create(request) -> SchedulingOauthApp
@@ -20956,7 +23339,7 @@ client.scheduling().calendarDelegations().list();
-An admin authorizes once, and every host on the domain gets their calendar with no consent screen. It stays `pending`: authorize what it returns, then verify it. Credentials are never returned. +New consents in this environment use it, so the consent screen shows your brand. Connections made before it stay on coss.com's app until their host consents again. On the Scale plan and above. Secrets are never returned.
@@ -20971,12 +23354,12 @@ An admin authorizes once, and every host on the domain gets their calendar with
```java -client.scheduling().calendarDelegations().create( - CreateCalendarDelegationRequest.google( - CreateCalendarDelegationRequestGoogle +client.scheduling().oauthApps().create( + CreateOauthAppRequest.google( + CreateOauthAppRequestGoogle .builder() - .domain("domain") - .serviceAccountKey("service_account_key") + .clientId("client_id") + .clientSecret("client_secret") .build() ) ); @@ -20994,7 +23377,7 @@ client.scheduling().calendarDelegations().create(
-**request:** `CreateCalendarDelegationRequest` +**request:** `CreateOauthAppRequest`
@@ -21006,7 +23389,7 @@ client.scheduling().calendarDelegations().create(
-
client.scheduling.calendarDelegations.get(id) -> SchedulingCalendarDelegation +
client.scheduling.oauthApps.get(id) -> SchedulingOauthApp
@@ -21018,7 +23401,7 @@ client.scheduling().calendarDelegations().create(
-Its status, what to authorize, and how many hosts it has connected. +Its status, what to register at the provider, and how many connections use it.
@@ -21033,9 +23416,9 @@ Its status, what to authorize, and how many hosts it has connected.
```java -client.scheduling().calendarDelegations().get( - "caldlg_01kd2m9a0b1c2d3e4f5g6h7j8m", - GetCalendarDelegationsRequest +client.scheduling().oauthApps().get( + "calapp_01kd2m9a0b1c2d3e4f5g6h7j8m", + GetOauthAppsRequest .builder() .build() ); @@ -21053,7 +23436,7 @@ client.scheduling().calendarDelegations().get(
-**id:** `String` — The delegation's id. +**id:** `String` — The OAuth app's id.
@@ -21065,7 +23448,7 @@ client.scheduling().calendarDelegations().get(
-
client.scheduling.calendarDelegations.delete(id) -> DeletedSchedulingCalendarDelegation +
client.scheduling.oauthApps.delete(id) -> DeletedSchedulingOauthApp
@@ -21077,7 +23460,7 @@ client.scheduling().calendarDelegations().get(
-Its hosts lose these calendars within minutes. They stay bookable with no conflict check, and events already written stay on their calendars, out of reach of later moves or cancellations. +Refused while connections use it (`oauth_app_in_use`), since only it can refresh their access: disconnect them first. New consents go back to coss.com's app.
@@ -21092,9 +23475,9 @@ Its hosts lose these calendars within minutes. They stay bookable with no confli
```java -client.scheduling().calendarDelegations().delete( - "caldlg_01kd2m9a0b1c2d3e4f5g6h7j8m", - DeleteCalendarDelegationsRequest +client.scheduling().oauthApps().delete( + "calapp_01kd2m9a0b1c2d3e4f5g6h7j8m", + DeleteOauthAppsRequest .builder() .build() ); @@ -21112,7 +23495,7 @@ client.scheduling().calendarDelegations().delete(
-**id:** `String` — The delegation's id. +**id:** `String` — The OAuth app's id.
@@ -21124,7 +23507,7 @@ client.scheduling().calendarDelegations().delete(
-
client.scheduling.calendarDelegations.update(id, request) -> SchedulingCalendarDelegation +
client.scheduling.oauthApps.update(id, request) -> SchedulingOauthApp
@@ -21136,7 +23519,7 @@ client.scheduling().calendarDelegations().delete(
-New credentials are tried on the verified mailbox before they replace the old ones, and end an outage if they work. +A new client secret is tried on a connection before it replaces the old one, and ends an outage if it works. Its client ID can't change: a different app needs its hosts to consent again.
@@ -21151,11 +23534,11 @@ New credentials are tried on the verified mailbox before they replace the old on
```java -client.scheduling().calendarDelegations().update( - "caldlg_01kd2m9a0b1c2d3e4f5g6h7j8m", - UpdateCalendarDelegationRequest +client.scheduling().oauthApps().update( + "calapp_01kd2m9a0b1c2d3e4f5g6h7j8m", + UpdateOauthAppRequest .builder() - .matchHostEmail(false) + .clientSecret("GOCSPX-abcdefghijklmnopqrstuvwxyz") .build() ); ``` @@ -21172,7 +23555,7 @@ client.scheduling().calendarDelegations().update(
-**id:** `String` — The delegation's id. +**id:** `String` — The OAuth app's id.
@@ -21180,7 +23563,7 @@ client.scheduling().calendarDelegations().update(
-**matchHostEmail:** `Optional` — Whether a host's `email` picks their mailbox when `calendar_account` isn't set. Turn it off if end users can type their own email into your app: otherwise one could name a colleague's address and reach that calendar. +**clientSecret:** `Optional` — A new client secret. It's tried on a connection before it replaces the old one.
@@ -21188,7 +23571,7 @@ client.scheduling().calendarDelegations().update(
-**serviceAccountKey:** `Optional` — A new key. It's tried on the verified mailbox before it replaces the old one. +**tenantId:** `Optional` — The Directory (tenant) ID, for an app that's only for your own tenant. Leave it out for a multi-tenant app.
@@ -21196,7 +23579,7 @@ client.scheduling().calendarDelegations().update(
-**clientSecret:** `Optional` — A new client secret. It's tried on the verified mailbox before it replaces the old one. +**webhookSecret:** `Optional` — The Secret Token of your Zoom app, which signs its events at `zoom_event_url`. Never returned.
@@ -21204,7 +23587,23 @@ client.scheduling().calendarDelegations().update(
-**secretExpiresAt:** `Optional` — When the Entra client secret expires. Owners and admins are warned 14 days before. +**redirectUri:** `Optional` — A page on your own domain, registered with the provider, that forwards `code` and `state` to `coss_callback_url`. Google requires this for an external app, since it has to verify the redirect's domain as yours. Leave it out to use `coss_callback_url` directly. + +
+
+ +
+
+ +**completionUrl:** `Optional` — Where the browser lands after a consent that didn't name a `return_url`, with `coss_calendar` set to `connected`, `denied` or `invalid`. Leave it out for a plain page saying what happened. + +
+
+ +
+
+ +**secretExpiresAt:** `Optional` — When the client secret expires. Owners and admins are warned 14 days before.
@@ -21216,7 +23615,8 @@ client.scheduling().calendarDelegations().update(
-
client.scheduling.calendarDelegations.verify(id, request) -> SchedulingCalendarDelegation +## Scheduling Sessions +
client.scheduling.sessions.createForManager(request) -> SchedulingSession
@@ -21228,7 +23628,7 @@ client.scheduling().calendarDelegations().update(
-Tries one real mailbox. Passing makes it `active`, and its hosts start connecting. Google can take up to 24 hours to apply a new authorization, so a refusal may just need time. +Lets a team lead manage cover for the hosts you name, or those matching an attribute filter whenever it's asked: time off, bookings that need someone else, and moving them. It never sees attendees' details. Send the `url` to their browser, or embed it with `coss/scheduling`.
@@ -21243,11 +23643,15 @@ Tries one real mailbox. Passing makes it `active`, and its hosts start connectin
```java -client.scheduling().calendarDelegations().verify( - "caldlg_01kd2m9a0b1c2d3e4f5g6h7j8m", - VerifyCalendarDelegationRequest +client.scheduling().sessions().createForManager( + CreateSchedulingManagerSessionRequest .builder() - .account("ana@example.com") + .hostFilter( + new HashMap() {{ + put("team", CreateSchedulingManagerSessionRequestHostFilterValue.of("cardiology")); + }} + ) + .expiresIn(3600) .build() ); ``` @@ -21264,7 +23668,7 @@ client.scheduling().calendarDelegations().verify(
-**id:** `String` — The delegation's id. +**hosts:** `Optional>` — The hosts this page can reach, by id or uid.
@@ -21272,7 +23676,23 @@ client.scheduling().calendarDelegations().verify(
-**account:** `String` — A real mailbox on the domain to try. In Microsoft 365, a user principal name. +**hostFilter:** `Optional>` — Everyone matching these attributes, asked again on every request. + +
+
+ +
+
+ +**expiresIn:** `Optional` — Seconds until it stops working. At most a day. + +
+
+ +
+
+ +**readOnly:** `Optional`
@@ -21284,7 +23704,6 @@ client.scheduling().calendarDelegations().verify(
-## Scheduling Sessions
client.scheduling.sessions.createForHost(host, request) -> SchedulingSession
@@ -21640,6 +24059,14 @@ client.scheduling().settings().update(
+**privacyUrl:** `Optional` — Your privacy policy, as an https URL, for hosts connecting a calendar through your own OAuth app. `null` removes it. + +
+
+ +
+
+ **emailFrom:** `Optional` — Sender of booking emails, on a verified domain. `null`: coss.com's own address.
@@ -21664,6 +24091,30 @@ client.scheduling().settings().update(
+**nameHostInAttendeeEmails:** `Optional` — Name the new host when telling an attendee their booking has one. + +
+
+ +
+
+ +**hostReassignment:** `Optional` — Whether hosts can give their own bookings to someone else from their page. `eligible` lets them, to anyone free who takes that event type. + +
+
+ +
+
+ +**outOfOfficeReasons:** `Optional>` — Reasons of your own, on top of the preset ones. Hosts and managers see them. + +
+
+ +
+
+ **notifications:** `Optional>>` — Per event (`confirmed`, `pending_approval`, `rescheduled`, `cancelled`, `declined`, `reminder`), overriding the defaults. `null` restores them.
diff --git a/sdks/java/src/main/java/com/coss/core/ClientOptions.java b/sdks/java/src/main/java/com/coss/core/ClientOptions.java index 0836af68b..1c2137d22 100644 --- a/sdks/java/src/main/java/com/coss/core/ClientOptions.java +++ b/sdks/java/src/main/java/com/coss/core/ClientOptions.java @@ -60,7 +60,7 @@ private ClientOptions( this.headers.putAll(headers); this.headers.putAll(new HashMap() { { - put("User-Agent", "coss-java/0.3.0"); + put("User-Agent", "coss-java/0.4.0"); put("X-Fern-Language", "JAVA"); put("X-Fern-SDK-Name", "com.cosscom.fern:api-sdk"); } diff --git a/sdks/java/src/main/java/com/coss/resources/scheduling/AsyncSchedulingClient.java b/sdks/java/src/main/java/com/coss/resources/scheduling/AsyncSchedulingClient.java index 6ba57dda9..15ece4eca 100644 --- a/sdks/java/src/main/java/com/coss/resources/scheduling/AsyncSchedulingClient.java +++ b/sdks/java/src/main/java/com/coss/resources/scheduling/AsyncSchedulingClient.java @@ -12,7 +12,11 @@ import com.coss.resources.scheduling.calendars.AsyncCalendarsClient; import com.coss.resources.scheduling.eventtypes.AsyncEventTypesClient; import com.coss.resources.scheduling.holds.AsyncHoldsClient; +import com.coss.resources.scheduling.holidaycalendars.AsyncHolidayCalendarsClient; import com.coss.resources.scheduling.hosts.AsyncHostsClient; +import com.coss.resources.scheduling.oauthapps.AsyncOauthAppsClient; +import com.coss.resources.scheduling.outofoffice.AsyncOutOfOfficeClient; +import com.coss.resources.scheduling.reassignments.AsyncReassignmentsClient; import com.coss.resources.scheduling.schedules.AsyncSchedulesClient; import com.coss.resources.scheduling.series.AsyncSeriesClient; import com.coss.resources.scheduling.sessions.AsyncSessionsClient; @@ -25,6 +29,14 @@ public class AsyncSchedulingClient { protected final Supplier hostsClient; + protected final Supplier bookingsClient; + + protected final Supplier reassignmentsClient; + + protected final Supplier holidayCalendarsClient; + + protected final Supplier outOfOfficeClient; + protected final Supplier schedulesClient; protected final Supplier eventTypesClient; @@ -33,8 +45,6 @@ public class AsyncSchedulingClient { protected final Supplier availabilityClient; - protected final Supplier bookingsClient; - protected final Supplier holdsClient; protected final Supplier seriesClient; @@ -45,6 +55,8 @@ public class AsyncSchedulingClient { protected final Supplier calendarDelegationsClient; + protected final Supplier oauthAppsClient; + protected final Supplier sessionsClient; protected final Supplier settingsClient; @@ -52,16 +64,20 @@ public class AsyncSchedulingClient { public AsyncSchedulingClient(ClientOptions clientOptions) { this.clientOptions = clientOptions; this.hostsClient = Suppliers.memoize(() -> new AsyncHostsClient(clientOptions)); + this.bookingsClient = Suppliers.memoize(() -> new AsyncBookingsClient(clientOptions)); + this.reassignmentsClient = Suppliers.memoize(() -> new AsyncReassignmentsClient(clientOptions)); + this.holidayCalendarsClient = Suppliers.memoize(() -> new AsyncHolidayCalendarsClient(clientOptions)); + this.outOfOfficeClient = Suppliers.memoize(() -> new AsyncOutOfOfficeClient(clientOptions)); this.schedulesClient = Suppliers.memoize(() -> new AsyncSchedulesClient(clientOptions)); this.eventTypesClient = Suppliers.memoize(() -> new AsyncEventTypesClient(clientOptions)); this.slotsClient = Suppliers.memoize(() -> new AsyncSlotsClient(clientOptions)); this.availabilityClient = Suppliers.memoize(() -> new AsyncAvailabilityClient(clientOptions)); - this.bookingsClient = Suppliers.memoize(() -> new AsyncBookingsClient(clientOptions)); this.holdsClient = Suppliers.memoize(() -> new AsyncHoldsClient(clientOptions)); this.seriesClient = Suppliers.memoize(() -> new AsyncSeriesClient(clientOptions)); this.attendeesClient = Suppliers.memoize(() -> new AsyncAttendeesClient(clientOptions)); this.calendarsClient = Suppliers.memoize(() -> new AsyncCalendarsClient(clientOptions)); this.calendarDelegationsClient = Suppliers.memoize(() -> new AsyncCalendarDelegationsClient(clientOptions)); + this.oauthAppsClient = Suppliers.memoize(() -> new AsyncOauthAppsClient(clientOptions)); this.sessionsClient = Suppliers.memoize(() -> new AsyncSessionsClient(clientOptions)); this.settingsClient = Suppliers.memoize(() -> new AsyncSettingsClient(clientOptions)); } @@ -70,6 +86,22 @@ public AsyncHostsClient hosts() { return this.hostsClient.get(); } + public AsyncBookingsClient bookings() { + return this.bookingsClient.get(); + } + + public AsyncReassignmentsClient reassignments() { + return this.reassignmentsClient.get(); + } + + public AsyncHolidayCalendarsClient holidayCalendars() { + return this.holidayCalendarsClient.get(); + } + + public AsyncOutOfOfficeClient outOfOffice() { + return this.outOfOfficeClient.get(); + } + public AsyncSchedulesClient schedules() { return this.schedulesClient.get(); } @@ -86,10 +118,6 @@ public AsyncAvailabilityClient availability() { return this.availabilityClient.get(); } - public AsyncBookingsClient bookings() { - return this.bookingsClient.get(); - } - public AsyncHoldsClient holds() { return this.holdsClient.get(); } @@ -110,6 +138,10 @@ public AsyncCalendarDelegationsClient calendarDelegations() { return this.calendarDelegationsClient.get(); } + public AsyncOauthAppsClient oauthApps() { + return this.oauthAppsClient.get(); + } + public AsyncSessionsClient sessions() { return this.sessionsClient.get(); } diff --git a/sdks/java/src/main/java/com/coss/resources/scheduling/SchedulingClient.java b/sdks/java/src/main/java/com/coss/resources/scheduling/SchedulingClient.java index 8eccf447f..4ee25e636 100644 --- a/sdks/java/src/main/java/com/coss/resources/scheduling/SchedulingClient.java +++ b/sdks/java/src/main/java/com/coss/resources/scheduling/SchedulingClient.java @@ -12,7 +12,11 @@ import com.coss.resources.scheduling.calendars.CalendarsClient; import com.coss.resources.scheduling.eventtypes.EventTypesClient; import com.coss.resources.scheduling.holds.HoldsClient; +import com.coss.resources.scheduling.holidaycalendars.HolidayCalendarsClient; import com.coss.resources.scheduling.hosts.HostsClient; +import com.coss.resources.scheduling.oauthapps.OauthAppsClient; +import com.coss.resources.scheduling.outofoffice.OutOfOfficeClient; +import com.coss.resources.scheduling.reassignments.ReassignmentsClient; import com.coss.resources.scheduling.schedules.SchedulesClient; import com.coss.resources.scheduling.series.SeriesClient; import com.coss.resources.scheduling.sessions.SessionsClient; @@ -25,6 +29,14 @@ public class SchedulingClient { protected final Supplier hostsClient; + protected final Supplier bookingsClient; + + protected final Supplier reassignmentsClient; + + protected final Supplier holidayCalendarsClient; + + protected final Supplier outOfOfficeClient; + protected final Supplier schedulesClient; protected final Supplier eventTypesClient; @@ -33,8 +45,6 @@ public class SchedulingClient { protected final Supplier availabilityClient; - protected final Supplier bookingsClient; - protected final Supplier holdsClient; protected final Supplier seriesClient; @@ -45,6 +55,8 @@ public class SchedulingClient { protected final Supplier calendarDelegationsClient; + protected final Supplier oauthAppsClient; + protected final Supplier sessionsClient; protected final Supplier settingsClient; @@ -52,16 +64,20 @@ public class SchedulingClient { public SchedulingClient(ClientOptions clientOptions) { this.clientOptions = clientOptions; this.hostsClient = Suppliers.memoize(() -> new HostsClient(clientOptions)); + this.bookingsClient = Suppliers.memoize(() -> new BookingsClient(clientOptions)); + this.reassignmentsClient = Suppliers.memoize(() -> new ReassignmentsClient(clientOptions)); + this.holidayCalendarsClient = Suppliers.memoize(() -> new HolidayCalendarsClient(clientOptions)); + this.outOfOfficeClient = Suppliers.memoize(() -> new OutOfOfficeClient(clientOptions)); this.schedulesClient = Suppliers.memoize(() -> new SchedulesClient(clientOptions)); this.eventTypesClient = Suppliers.memoize(() -> new EventTypesClient(clientOptions)); this.slotsClient = Suppliers.memoize(() -> new SlotsClient(clientOptions)); this.availabilityClient = Suppliers.memoize(() -> new AvailabilityClient(clientOptions)); - this.bookingsClient = Suppliers.memoize(() -> new BookingsClient(clientOptions)); this.holdsClient = Suppliers.memoize(() -> new HoldsClient(clientOptions)); this.seriesClient = Suppliers.memoize(() -> new SeriesClient(clientOptions)); this.attendeesClient = Suppliers.memoize(() -> new AttendeesClient(clientOptions)); this.calendarsClient = Suppliers.memoize(() -> new CalendarsClient(clientOptions)); this.calendarDelegationsClient = Suppliers.memoize(() -> new CalendarDelegationsClient(clientOptions)); + this.oauthAppsClient = Suppliers.memoize(() -> new OauthAppsClient(clientOptions)); this.sessionsClient = Suppliers.memoize(() -> new SessionsClient(clientOptions)); this.settingsClient = Suppliers.memoize(() -> new SettingsClient(clientOptions)); } @@ -70,6 +86,22 @@ public HostsClient hosts() { return this.hostsClient.get(); } + public BookingsClient bookings() { + return this.bookingsClient.get(); + } + + public ReassignmentsClient reassignments() { + return this.reassignmentsClient.get(); + } + + public HolidayCalendarsClient holidayCalendars() { + return this.holidayCalendarsClient.get(); + } + + public OutOfOfficeClient outOfOffice() { + return this.outOfOfficeClient.get(); + } + public SchedulesClient schedules() { return this.schedulesClient.get(); } @@ -86,10 +118,6 @@ public AvailabilityClient availability() { return this.availabilityClient.get(); } - public BookingsClient bookings() { - return this.bookingsClient.get(); - } - public HoldsClient holds() { return this.holdsClient.get(); } @@ -110,6 +138,10 @@ public CalendarDelegationsClient calendarDelegations() { return this.calendarDelegationsClient.get(); } + public OauthAppsClient oauthApps() { + return this.oauthAppsClient.get(); + } + public SessionsClient sessions() { return this.sessionsClient.get(); } diff --git a/sdks/java/src/main/java/com/coss/resources/scheduling/bookings/AsyncBookingsClient.java b/sdks/java/src/main/java/com/coss/resources/scheduling/bookings/AsyncBookingsClient.java index b335dd934..a485dde1d 100644 --- a/sdks/java/src/main/java/com/coss/resources/scheduling/bookings/AsyncBookingsClient.java +++ b/sdks/java/src/main/java/com/coss/resources/scheduling/bookings/AsyncBookingsClient.java @@ -14,12 +14,15 @@ import com.coss.resources.scheduling.bookings.requests.ListBookingsRequest; import com.coss.resources.scheduling.bookings.requests.MarkNoShowBookingsRequest; import com.coss.resources.scheduling.bookings.requests.NotificationsBookingsRequest; +import com.coss.resources.scheduling.bookings.requests.ReassignCandidatesBookingsRequest; +import com.coss.resources.scheduling.bookings.requests.ReassignSchedulingBookingRequest; import com.coss.resources.scheduling.bookings.requests.RescheduleBookingRequest; import com.coss.resources.scheduling.bookings.requests.UpdateBookingLocationRequest; import com.coss.types.SchedulingBooking; import com.coss.types.SchedulingBookingEventList; import com.coss.types.SchedulingBookingList; import com.coss.types.SchedulingBookingNotificationList; +import com.coss.types.SchedulingReassignCandidateList; import java.util.concurrent.CompletableFuture; public class AsyncBookingsClient { @@ -39,6 +42,52 @@ public AsyncRawBookingsClient withRawResponse() { return this.rawClient; } + /** + * Gives a booking to another host, keeping its id and time. Works for every kind: a group session moves as a whole, from any of its seats, and one that's already started changes for the record, with nobody told. Whoever leaves and joins is told, and the attendee unless you say not to. + */ + public CompletableFuture reassign(String id, ReassignSchedulingBookingRequest request) { + return this.rawClient.reassign(id, request).thenApply(response -> response.body()); + } + + /** + * Gives a booking to another host, keeping its id and time. Works for every kind: a group session moves as a whole, from any of its seats, and one that's already started changes for the record, with nobody told. Whoever leaves and joins is told, and the attendee unless you say not to. + */ + public CompletableFuture reassign( + String id, ReassignSchedulingBookingRequest request, RequestOptions requestOptions) { + return this.rawClient.reassign(id, request, requestOptions).thenApply(response -> response.body()); + } + + /** + * The environment's other active hosts: members of the event type first, in the order a pool would pick them, each saying whether they're free and why not. Things can change before you ask: reassigning decides again. + */ + public CompletableFuture reassignCandidates(String id) { + return this.rawClient.reassignCandidates(id).thenApply(response -> response.body()); + } + + /** + * The environment's other active hosts: members of the event type first, in the order a pool would pick them, each saying whether they're free and why not. Things can change before you ask: reassigning decides again. + */ + public CompletableFuture reassignCandidates( + String id, RequestOptions requestOptions) { + return this.rawClient.reassignCandidates(id, requestOptions).thenApply(response -> response.body()); + } + + /** + * The environment's other active hosts: members of the event type first, in the order a pool would pick them, each saying whether they're free and why not. Things can change before you ask: reassigning decides again. + */ + public CompletableFuture reassignCandidates( + String id, ReassignCandidatesBookingsRequest request) { + return this.rawClient.reassignCandidates(id, request).thenApply(response -> response.body()); + } + + /** + * The environment's other active hosts: members of the event type first, in the order a pool would pick them, each saying whether they're free and why not. Things can change before you ask: reassigning decides again. + */ + public CompletableFuture reassignCandidates( + String id, ReassignCandidatesBookingsRequest request, RequestOptions requestOptions) { + return this.rawClient.reassignCandidates(id, request, requestOptions).thenApply(response -> response.body()); + } + /** * The environment's bookings, newest first. Answers aren't included. */ diff --git a/sdks/java/src/main/java/com/coss/resources/scheduling/bookings/AsyncRawBookingsClient.java b/sdks/java/src/main/java/com/coss/resources/scheduling/bookings/AsyncRawBookingsClient.java index c03ac710a..c42639fa3 100644 --- a/sdks/java/src/main/java/com/coss/resources/scheduling/bookings/AsyncRawBookingsClient.java +++ b/sdks/java/src/main/java/com/coss/resources/scheduling/bookings/AsyncRawBookingsClient.java @@ -33,6 +33,8 @@ import com.coss.resources.scheduling.bookings.requests.ListBookingsRequest; import com.coss.resources.scheduling.bookings.requests.MarkNoShowBookingsRequest; import com.coss.resources.scheduling.bookings.requests.NotificationsBookingsRequest; +import com.coss.resources.scheduling.bookings.requests.ReassignCandidatesBookingsRequest; +import com.coss.resources.scheduling.bookings.requests.ReassignSchedulingBookingRequest; import com.coss.resources.scheduling.bookings.requests.RescheduleBookingRequest; import com.coss.resources.scheduling.bookings.requests.UpdateBookingLocationRequest; import com.coss.types.Error; @@ -40,6 +42,7 @@ import com.coss.types.SchedulingBookingEventList; import com.coss.types.SchedulingBookingList; import com.coss.types.SchedulingBookingNotificationList; +import com.coss.types.SchedulingReassignCandidateList; import com.fasterxml.jackson.core.JsonProcessingException; import java.io.IOException; import java.util.concurrent.CompletableFuture; @@ -61,6 +64,277 @@ public AsyncRawBookingsClient(ClientOptions clientOptions) { this.clientOptions = clientOptions; } + /** + * Gives a booking to another host, keeping its id and time. Works for every kind: a group session moves as a whole, from any of its seats, and one that's already started changes for the record, with nobody told. Whoever leaves and joins is told, and the attendee unless you say not to. + */ + public CompletableFuture> reassign( + String id, ReassignSchedulingBookingRequest request) { + return reassign(id, request, null); + } + + /** + * Gives a booking to another host, keeping its id and time. Works for every kind: a group session moves as a whole, from any of its seats, and one that's already started changes for the record, with nobody told. Whoever leaves and joins is told, and the attendee unless you say not to. + */ + public CompletableFuture> reassign( + String id, ReassignSchedulingBookingRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("v1/scheduling/bookings") + .addPathSegment(id) + .addPathSegments("reassign"); + if (requestOptions != null) { + requestOptions.getQueryParameters().forEach((_key, _value) -> { + httpUrl.addQueryParameter(_key, _value); + }); + } + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new CossException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl.build()) + .method("POST", body) + .headers(Headers.of(IdempotencyUtils.withGeneratedIdempotencyKey( + clientOptions.headers(requestOptions), "Idempotency-Key"))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + okhttpRequest = okhttpRequest + .newBuilder() + .tag(RetryInterceptor.MaxRetriesOverride.class, new RetryInterceptor.MaxRetriesOverride(0)) + .build(); + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new CossHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, SchedulingBooking.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 415: + future.completeExceptionally(new UnsupportedMediaTypeError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 422: + future.completeExceptionally(new UnprocessableEntityError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 500: + future.completeExceptionally(new InternalServerError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 503: + future.completeExceptionally(new ServiceUnavailableError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new CossApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (JsonProcessingException e) { + future.completeExceptionally( + new CossException("Failed to deserialize response: " + e.getMessage(), e)); + } catch (IOException e) { + future.completeExceptionally(new CossException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new CossException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * The environment's other active hosts: members of the event type first, in the order a pool would pick them, each saying whether they're free and why not. Things can change before you ask: reassigning decides again. + */ + public CompletableFuture> reassignCandidates(String id) { + return reassignCandidates( + id, ReassignCandidatesBookingsRequest.builder().build()); + } + + /** + * The environment's other active hosts: members of the event type first, in the order a pool would pick them, each saying whether they're free and why not. Things can change before you ask: reassigning decides again. + */ + public CompletableFuture> reassignCandidates( + String id, RequestOptions requestOptions) { + return reassignCandidates( + id, ReassignCandidatesBookingsRequest.builder().build(), requestOptions); + } + + /** + * The environment's other active hosts: members of the event type first, in the order a pool would pick them, each saying whether they're free and why not. Things can change before you ask: reassigning decides again. + */ + public CompletableFuture> reassignCandidates( + String id, ReassignCandidatesBookingsRequest request) { + return reassignCandidates(id, request, null); + } + + /** + * The environment's other active hosts: members of the event type first, in the order a pool would pick them, each saying whether they're free and why not. Things can change before you ask: reassigning decides again. + */ + public CompletableFuture> reassignCandidates( + String id, ReassignCandidatesBookingsRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("v1/scheduling/bookings") + .addPathSegment(id) + .addPathSegments("reassign_candidates"); + if (request.getFromHost().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "from_host", request.getFromHost().get(), false); + } + if (requestOptions != null) { + requestOptions.getQueryParameters().forEach((_key, _value) -> { + httpUrl.addQueryParameter(_key, _value); + }); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + if (requestOptions != null && requestOptions.getMaxRetries().isPresent()) { + okhttpRequest = okhttpRequest + .newBuilder() + .tag( + RetryInterceptor.MaxRetriesOverride.class, + new RetryInterceptor.MaxRetriesOverride( + requestOptions.getMaxRetries().get())) + .build(); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new CossHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, SchedulingReassignCandidateList.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 422: + future.completeExceptionally(new UnprocessableEntityError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 500: + future.completeExceptionally(new InternalServerError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 503: + future.completeExceptionally(new ServiceUnavailableError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new CossApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (JsonProcessingException e) { + future.completeExceptionally( + new CossException("Failed to deserialize response: " + e.getMessage(), e)); + } catch (IOException e) { + future.completeExceptionally(new CossException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new CossException("Network error executing HTTP request", e)); + } + }); + return future; + } + /** * The environment's bookings, newest first. Answers aren't included. */ diff --git a/sdks/java/src/main/java/com/coss/resources/scheduling/bookings/BookingsClient.java b/sdks/java/src/main/java/com/coss/resources/scheduling/bookings/BookingsClient.java index e9964f597..e6a868593 100644 --- a/sdks/java/src/main/java/com/coss/resources/scheduling/bookings/BookingsClient.java +++ b/sdks/java/src/main/java/com/coss/resources/scheduling/bookings/BookingsClient.java @@ -14,12 +14,15 @@ import com.coss.resources.scheduling.bookings.requests.ListBookingsRequest; import com.coss.resources.scheduling.bookings.requests.MarkNoShowBookingsRequest; import com.coss.resources.scheduling.bookings.requests.NotificationsBookingsRequest; +import com.coss.resources.scheduling.bookings.requests.ReassignCandidatesBookingsRequest; +import com.coss.resources.scheduling.bookings.requests.ReassignSchedulingBookingRequest; import com.coss.resources.scheduling.bookings.requests.RescheduleBookingRequest; import com.coss.resources.scheduling.bookings.requests.UpdateBookingLocationRequest; import com.coss.types.SchedulingBooking; import com.coss.types.SchedulingBookingEventList; import com.coss.types.SchedulingBookingList; import com.coss.types.SchedulingBookingNotificationList; +import com.coss.types.SchedulingReassignCandidateList; public class BookingsClient { protected final ClientOptions clientOptions; @@ -38,6 +41,50 @@ public RawBookingsClient withRawResponse() { return this.rawClient; } + /** + * Gives a booking to another host, keeping its id and time. Works for every kind: a group session moves as a whole, from any of its seats, and one that's already started changes for the record, with nobody told. Whoever leaves and joins is told, and the attendee unless you say not to. + */ + public SchedulingBooking reassign(String id, ReassignSchedulingBookingRequest request) { + return this.rawClient.reassign(id, request).body(); + } + + /** + * Gives a booking to another host, keeping its id and time. Works for every kind: a group session moves as a whole, from any of its seats, and one that's already started changes for the record, with nobody told. Whoever leaves and joins is told, and the attendee unless you say not to. + */ + public SchedulingBooking reassign( + String id, ReassignSchedulingBookingRequest request, RequestOptions requestOptions) { + return this.rawClient.reassign(id, request, requestOptions).body(); + } + + /** + * The environment's other active hosts: members of the event type first, in the order a pool would pick them, each saying whether they're free and why not. Things can change before you ask: reassigning decides again. + */ + public SchedulingReassignCandidateList reassignCandidates(String id) { + return this.rawClient.reassignCandidates(id).body(); + } + + /** + * The environment's other active hosts: members of the event type first, in the order a pool would pick them, each saying whether they're free and why not. Things can change before you ask: reassigning decides again. + */ + public SchedulingReassignCandidateList reassignCandidates(String id, RequestOptions requestOptions) { + return this.rawClient.reassignCandidates(id, requestOptions).body(); + } + + /** + * The environment's other active hosts: members of the event type first, in the order a pool would pick them, each saying whether they're free and why not. Things can change before you ask: reassigning decides again. + */ + public SchedulingReassignCandidateList reassignCandidates(String id, ReassignCandidatesBookingsRequest request) { + return this.rawClient.reassignCandidates(id, request).body(); + } + + /** + * The environment's other active hosts: members of the event type first, in the order a pool would pick them, each saying whether they're free and why not. Things can change before you ask: reassigning decides again. + */ + public SchedulingReassignCandidateList reassignCandidates( + String id, ReassignCandidatesBookingsRequest request, RequestOptions requestOptions) { + return this.rawClient.reassignCandidates(id, request, requestOptions).body(); + } + /** * The environment's bookings, newest first. Answers aren't included. */ diff --git a/sdks/java/src/main/java/com/coss/resources/scheduling/bookings/RawBookingsClient.java b/sdks/java/src/main/java/com/coss/resources/scheduling/bookings/RawBookingsClient.java index df7b0815f..0b9304565 100644 --- a/sdks/java/src/main/java/com/coss/resources/scheduling/bookings/RawBookingsClient.java +++ b/sdks/java/src/main/java/com/coss/resources/scheduling/bookings/RawBookingsClient.java @@ -33,6 +33,8 @@ import com.coss.resources.scheduling.bookings.requests.ListBookingsRequest; import com.coss.resources.scheduling.bookings.requests.MarkNoShowBookingsRequest; import com.coss.resources.scheduling.bookings.requests.NotificationsBookingsRequest; +import com.coss.resources.scheduling.bookings.requests.ReassignCandidatesBookingsRequest; +import com.coss.resources.scheduling.bookings.requests.ReassignSchedulingBookingRequest; import com.coss.resources.scheduling.bookings.requests.RescheduleBookingRequest; import com.coss.resources.scheduling.bookings.requests.UpdateBookingLocationRequest; import com.coss.types.Error; @@ -40,6 +42,7 @@ import com.coss.types.SchedulingBookingEventList; import com.coss.types.SchedulingBookingList; import com.coss.types.SchedulingBookingNotificationList; +import com.coss.types.SchedulingReassignCandidateList; import com.fasterxml.jackson.core.JsonProcessingException; import java.io.IOException; import okhttp3.Headers; @@ -57,6 +60,212 @@ public RawBookingsClient(ClientOptions clientOptions) { this.clientOptions = clientOptions; } + /** + * Gives a booking to another host, keeping its id and time. Works for every kind: a group session moves as a whole, from any of its seats, and one that's already started changes for the record, with nobody told. Whoever leaves and joins is told, and the attendee unless you say not to. + */ + public CossHttpResponse reassign(String id, ReassignSchedulingBookingRequest request) { + return reassign(id, request, null); + } + + /** + * Gives a booking to another host, keeping its id and time. Works for every kind: a group session moves as a whole, from any of its seats, and one that's already started changes for the record, with nobody told. Whoever leaves and joins is told, and the attendee unless you say not to. + */ + public CossHttpResponse reassign( + String id, ReassignSchedulingBookingRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("v1/scheduling/bookings") + .addPathSegment(id) + .addPathSegments("reassign"); + if (requestOptions != null) { + requestOptions.getQueryParameters().forEach((_key, _value) -> { + httpUrl.addQueryParameter(_key, _value); + }); + } + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new CossException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl.build()) + .method("POST", body) + .headers(Headers.of(IdempotencyUtils.withGeneratedIdempotencyKey( + clientOptions.headers(requestOptions), "Idempotency-Key"))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + okhttpRequest = okhttpRequest + .newBuilder() + .tag(RetryInterceptor.MaxRetriesOverride.class, new RetryInterceptor.MaxRetriesOverride(0)) + .build(); + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new CossHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, SchedulingBooking.class), response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 415: + throw new UnsupportedMediaTypeError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 422: + throw new UnprocessableEntityError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 500: + throw new InternalServerError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 503: + throw new ServiceUnavailableError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new CossApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (JsonProcessingException e) { + throw new CossException("Failed to deserialize response: " + e.getMessage(), e); + } catch (IOException e) { + throw new CossException("Network error executing HTTP request", e); + } + } + + /** + * The environment's other active hosts: members of the event type first, in the order a pool would pick them, each saying whether they're free and why not. Things can change before you ask: reassigning decides again. + */ + public CossHttpResponse reassignCandidates(String id) { + return reassignCandidates( + id, ReassignCandidatesBookingsRequest.builder().build()); + } + + /** + * The environment's other active hosts: members of the event type first, in the order a pool would pick them, each saying whether they're free and why not. Things can change before you ask: reassigning decides again. + */ + public CossHttpResponse reassignCandidates( + String id, RequestOptions requestOptions) { + return reassignCandidates( + id, ReassignCandidatesBookingsRequest.builder().build(), requestOptions); + } + + /** + * The environment's other active hosts: members of the event type first, in the order a pool would pick them, each saying whether they're free and why not. Things can change before you ask: reassigning decides again. + */ + public CossHttpResponse reassignCandidates( + String id, ReassignCandidatesBookingsRequest request) { + return reassignCandidates(id, request, null); + } + + /** + * The environment's other active hosts: members of the event type first, in the order a pool would pick them, each saying whether they're free and why not. Things can change before you ask: reassigning decides again. + */ + public CossHttpResponse reassignCandidates( + String id, ReassignCandidatesBookingsRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("v1/scheduling/bookings") + .addPathSegment(id) + .addPathSegments("reassign_candidates"); + if (request.getFromHost().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "from_host", request.getFromHost().get(), false); + } + if (requestOptions != null) { + requestOptions.getQueryParameters().forEach((_key, _value) -> { + httpUrl.addQueryParameter(_key, _value); + }); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + if (requestOptions != null && requestOptions.getMaxRetries().isPresent()) { + okhttpRequest = okhttpRequest + .newBuilder() + .tag( + RetryInterceptor.MaxRetriesOverride.class, + new RetryInterceptor.MaxRetriesOverride( + requestOptions.getMaxRetries().get())) + .build(); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new CossHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, SchedulingReassignCandidateList.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 422: + throw new UnprocessableEntityError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 500: + throw new InternalServerError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 503: + throw new ServiceUnavailableError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new CossApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (JsonProcessingException e) { + throw new CossException("Failed to deserialize response: " + e.getMessage(), e); + } catch (IOException e) { + throw new CossException("Network error executing HTTP request", e); + } + } + /** * The environment's bookings, newest first. Answers aren't included. */ diff --git a/sdks/java/src/main/java/com/coss/resources/scheduling/bookings/requests/ReassignCandidatesBookingsRequest.java b/sdks/java/src/main/java/com/coss/resources/scheduling/bookings/requests/ReassignCandidatesBookingsRequest.java new file mode 100644 index 000000000..71dd67d08 --- /dev/null +++ b/sdks/java/src/main/java/com/coss/resources/scheduling/bookings/requests/ReassignCandidatesBookingsRequest.java @@ -0,0 +1,111 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.coss.resources.scheduling.bookings.requests; + +import com.coss.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ReassignCandidatesBookingsRequest.Builder.class) +public final class ReassignCandidatesBookingsRequest { + private final Optional fromHost; + + private final Map additionalProperties; + + private ReassignCandidatesBookingsRequest(Optional fromHost, Map additionalProperties) { + this.fromHost = fromHost; + this.additionalProperties = additionalProperties; + } + + /** + * @return The host who'd leave, when it could be several. + */ + @JsonProperty("from_host") + public Optional getFromHost() { + return fromHost; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ReassignCandidatesBookingsRequest && equalTo((ReassignCandidatesBookingsRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ReassignCandidatesBookingsRequest other) { + return fromHost.equals(other.fromHost); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.fromHost); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional fromHost = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ReassignCandidatesBookingsRequest other) { + fromHost(other.getFromHost()); + return this; + } + + /** + *

The host who'd leave, when it could be several.

+ */ + @JsonSetter(value = "from_host", nulls = Nulls.SKIP) + public Builder fromHost(Optional fromHost) { + this.fromHost = fromHost; + return this; + } + + public Builder fromHost(String fromHost) { + this.fromHost = Optional.ofNullable(fromHost); + return this; + } + + public ReassignCandidatesBookingsRequest build() { + return new ReassignCandidatesBookingsRequest(fromHost, additionalProperties); + } + + public Builder additionalProperty(String key, Object value) { + this.additionalProperties.put(key, value); + return this; + } + + public Builder additionalProperties(Map additionalProperties) { + this.additionalProperties.putAll(additionalProperties); + return this; + } + } +} diff --git a/sdks/java/src/main/java/com/coss/resources/scheduling/bookings/requests/ReassignSchedulingBookingRequest.java b/sdks/java/src/main/java/com/coss/resources/scheduling/bookings/requests/ReassignSchedulingBookingRequest.java new file mode 100644 index 000000000..020641843 --- /dev/null +++ b/sdks/java/src/main/java/com/coss/resources/scheduling/bookings/requests/ReassignSchedulingBookingRequest.java @@ -0,0 +1,305 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.coss.resources.scheduling.bookings.requests; + +import com.coss.core.ObjectMappers; +import com.coss.resources.scheduling.bookings.types.ReassignSchedulingBookingRequestChangesItem; +import com.coss.resources.scheduling.bookings.types.ReassignSchedulingBookingRequestNotify; +import com.coss.resources.scheduling.bookings.types.ReassignSchedulingBookingRequestOverridesItem; +import com.coss.resources.scheduling.bookings.types.ReassignSchedulingBookingRequestReasonCode; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ReassignSchedulingBookingRequest.Builder.class) +public final class ReassignSchedulingBookingRequest { + private final List changes; + + private final ReassignSchedulingBookingRequestReasonCode reasonCode; + + private final Optional note; + + private final Optional> overrides; + + private final Optional notify; + + private final Map additionalProperties; + + private ReassignSchedulingBookingRequest( + List changes, + ReassignSchedulingBookingRequestReasonCode reasonCode, + Optional note, + Optional> overrides, + Optional notify, + Map additionalProperties) { + this.changes = changes; + this.reasonCode = reasonCode; + this.note = note; + this.overrides = overrides; + this.notify = notify; + this.additionalProperties = additionalProperties; + } + + /** + * @return A session or a one-on-one has one. A collective can change several. + */ + @JsonProperty("changes") + public List getChanges() { + return changes; + } + + @JsonProperty("reason_code") + public ReassignSchedulingBookingRequestReasonCode getReasonCode() { + return reasonCode; + } + + /** + * @return Why, in your words: required with an override of someone's availability. Encrypted, and only in the booking's history. + */ + @JsonProperty("note") + public Optional getNote() { + return note; + } + + /** + * @return Go ahead anyway: any_host for someone who doesn't take this event type, and the rest for what a candidate's reason said. A host who already has something at this time can never be overridden. + */ + @JsonProperty("overrides") + public Optional> getOverrides() { + return overrides; + } + + @JsonProperty("notify") + public Optional getNotify() { + return notify; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ReassignSchedulingBookingRequest && equalTo((ReassignSchedulingBookingRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ReassignSchedulingBookingRequest other) { + return changes.equals(other.changes) + && reasonCode.equals(other.reasonCode) + && note.equals(other.note) + && overrides.equals(other.overrides) + && notify.equals(other.notify); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.changes, this.reasonCode, this.note, this.overrides, this.notify); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ReasonCodeStage builder() { + return new Builder(); + } + + public interface ReasonCodeStage { + _FinalStage reasonCode(@NotNull ReassignSchedulingBookingRequestReasonCode reasonCode); + + Builder from(ReassignSchedulingBookingRequest other); + } + + public interface _FinalStage { + ReassignSchedulingBookingRequest build(); + + _FinalStage additionalProperty(String key, Object value); + + _FinalStage additionalProperties(Map additionalProperties); + + /** + *

A session or a one-on-one has one. A collective can change several.

+ */ + _FinalStage changes(List changes); + + _FinalStage addChanges(ReassignSchedulingBookingRequestChangesItem changes); + + _FinalStage addAllChanges(List changes); + + /** + *

Why, in your words: required with an override of someone's availability. Encrypted, and only in the booking's history.

+ */ + _FinalStage note(Optional note); + + _FinalStage note(String note); + + /** + *

Go ahead anyway: any_host for someone who doesn't take this event type, and the rest for what a candidate's reason said. A host who already has something at this time can never be overridden.

+ */ + _FinalStage overrides(Optional> overrides); + + _FinalStage overrides(List overrides); + + _FinalStage notify(Optional notify); + + _FinalStage notify(ReassignSchedulingBookingRequestNotify notify); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ReasonCodeStage, _FinalStage { + private ReassignSchedulingBookingRequestReasonCode reasonCode; + + private Optional notify = Optional.empty(); + + private Optional> overrides = Optional.empty(); + + private Optional note = Optional.empty(); + + private List changes = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(ReassignSchedulingBookingRequest other) { + changes(other.getChanges()); + reasonCode(other.getReasonCode()); + note(other.getNote()); + overrides(other.getOverrides()); + notify(other.getNotify()); + return this; + } + + @java.lang.Override + @JsonSetter("reason_code") + public _FinalStage reasonCode(@NotNull ReassignSchedulingBookingRequestReasonCode reasonCode) { + this.reasonCode = Objects.requireNonNull(reasonCode, "reasonCode must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage notify(ReassignSchedulingBookingRequestNotify notify) { + this.notify = Optional.ofNullable(notify); + return this; + } + + @java.lang.Override + @JsonSetter(value = "notify", nulls = Nulls.SKIP) + public _FinalStage notify(Optional notify) { + this.notify = notify; + return this; + } + + /** + *

Go ahead anyway: any_host for someone who doesn't take this event type, and the rest for what a candidate's reason said. A host who already has something at this time can never be overridden.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage overrides(List overrides) { + this.overrides = Optional.ofNullable(overrides); + return this; + } + + /** + *

Go ahead anyway: any_host for someone who doesn't take this event type, and the rest for what a candidate's reason said. A host who already has something at this time can never be overridden.

+ */ + @java.lang.Override + @JsonSetter(value = "overrides", nulls = Nulls.SKIP) + public _FinalStage overrides(Optional> overrides) { + this.overrides = overrides; + return this; + } + + /** + *

Why, in your words: required with an override of someone's availability. Encrypted, and only in the booking's history.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage note(String note) { + this.note = Optional.ofNullable(note); + return this; + } + + /** + *

Why, in your words: required with an override of someone's availability. Encrypted, and only in the booking's history.

+ */ + @java.lang.Override + @JsonSetter(value = "note", nulls = Nulls.SKIP) + public _FinalStage note(Optional note) { + this.note = note; + return this; + } + + /** + *

A session or a one-on-one has one. A collective can change several.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage addAllChanges(List changes) { + if (changes != null) { + this.changes.addAll(changes); + } + return this; + } + + /** + *

A session or a one-on-one has one. A collective can change several.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage addChanges(ReassignSchedulingBookingRequestChangesItem changes) { + this.changes.add(changes); + return this; + } + + /** + *

A session or a one-on-one has one. A collective can change several.

+ */ + @java.lang.Override + @JsonSetter(value = "changes", nulls = Nulls.SKIP) + public _FinalStage changes(List changes) { + this.changes.clear(); + if (changes != null) { + this.changes.addAll(changes); + } + return this; + } + + @java.lang.Override + public ReassignSchedulingBookingRequest build() { + return new ReassignSchedulingBookingRequest( + changes, reasonCode, note, overrides, notify, additionalProperties); + } + + @java.lang.Override + public Builder additionalProperty(String key, Object value) { + this.additionalProperties.put(key, value); + return this; + } + + @java.lang.Override + public Builder additionalProperties(Map additionalProperties) { + this.additionalProperties.putAll(additionalProperties); + return this; + } + } +} diff --git a/sdks/java/src/main/java/com/coss/resources/scheduling/bookings/requests/UpdateBookingLocationRequest.java b/sdks/java/src/main/java/com/coss/resources/scheduling/bookings/requests/UpdateBookingLocationRequest.java index ce8cd8674..c1056242b 100644 --- a/sdks/java/src/main/java/com/coss/resources/scheduling/bookings/requests/UpdateBookingLocationRequest.java +++ b/sdks/java/src/main/java/com/coss/resources/scheduling/bookings/requests/UpdateBookingLocationRequest.java @@ -3,7 +3,10 @@ */ package com.coss.resources.scheduling.bookings.requests; +import com.coss.core.Nullable; +import com.coss.core.NullableNonemptyFilter; import com.coss.core.ObjectMappers; +import com.coss.core.OptionalNullable; import com.coss.types.SchedulingLocation; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -11,26 +14,38 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import java.util.HashMap; import java.util.Map; import java.util.Objects; -import org.jetbrains.annotations.NotNull; +import java.util.Optional; @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = UpdateBookingLocationRequest.Builder.class) public final class UpdateBookingLocationRequest { - private final SchedulingLocation location; + private final OptionalNullable location; private final Map additionalProperties; - private UpdateBookingLocationRequest(SchedulingLocation location, Map additionalProperties) { + private UpdateBookingLocationRequest( + OptionalNullable location, Map additionalProperties) { this.location = location; this.additionalProperties = additionalProperties; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) @JsonProperty("location") - public SchedulingLocation getLocation() { + public OptionalNullable getLocation() { + if (location == null) { + return OptionalNullable.absent(); + } + return location; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("location") + private OptionalNullable _getLocation() { return location; } @@ -59,58 +74,64 @@ public String toString() { return ObjectMappers.stringify(this); } - public static LocationStage builder() { + public static Builder builder() { return new Builder(); } - public interface LocationStage { - _FinalStage location(@NotNull SchedulingLocation location); - - Builder from(UpdateBookingLocationRequest other); - } - - public interface _FinalStage { - UpdateBookingLocationRequest build(); - - _FinalStage additionalProperty(String key, Object value); - - _FinalStage additionalProperties(Map additionalProperties); - } - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements LocationStage, _FinalStage { - private SchedulingLocation location; + public static final class Builder { + private OptionalNullable location = OptionalNullable.absent(); @JsonAnySetter private Map additionalProperties = new HashMap<>(); private Builder() {} - @java.lang.Override public Builder from(UpdateBookingLocationRequest other) { location(other.getLocation()); return this; } - @java.lang.Override - @JsonSetter("location") - public _FinalStage location(@NotNull SchedulingLocation location) { - this.location = Objects.requireNonNull(location, "location must not be null"); + @JsonSetter(value = "location", nulls = Nulls.SKIP) + public Builder location(OptionalNullable location) { + this.location = location; + return this; + } + + public Builder location(SchedulingLocation location) { + this.location = OptionalNullable.of(location); + return this; + } + + public Builder location(Optional location) { + if (location.isPresent()) { + this.location = OptionalNullable.of(location.get()); + } else { + this.location = OptionalNullable.absent(); + } + return this; + } + + public Builder location(Nullable location) { + if (location.isNull()) { + this.location = OptionalNullable.ofNull(); + } else if (location.isEmpty()) { + this.location = OptionalNullable.absent(); + } else { + this.location = OptionalNullable.of(location.get()); + } return this; } - @java.lang.Override public UpdateBookingLocationRequest build() { return new UpdateBookingLocationRequest(location, additionalProperties); } - @java.lang.Override public Builder additionalProperty(String key, Object value) { this.additionalProperties.put(key, value); return this; } - @java.lang.Override public Builder additionalProperties(Map additionalProperties) { this.additionalProperties.putAll(additionalProperties); return this; diff --git a/sdks/java/src/main/java/com/coss/resources/scheduling/bookings/types/ReassignSchedulingBookingRequestChangesItem.java b/sdks/java/src/main/java/com/coss/resources/scheduling/bookings/types/ReassignSchedulingBookingRequestChangesItem.java new file mode 100644 index 000000000..c4358e322 --- /dev/null +++ b/sdks/java/src/main/java/com/coss/resources/scheduling/bookings/types/ReassignSchedulingBookingRequestChangesItem.java @@ -0,0 +1,206 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.coss.resources.scheduling.bookings.types; + +import com.coss.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ReassignSchedulingBookingRequestChangesItem.Builder.class) +public final class ReassignSchedulingBookingRequestChangesItem { + private final Optional fromHost; + + private final Optional toHost; + + private final Optional auto; + + private final Optional> preferredHosts; + + private final Map additionalProperties; + + private ReassignSchedulingBookingRequestChangesItem( + Optional fromHost, + Optional toHost, + Optional auto, + Optional> preferredHosts, + Map additionalProperties) { + this.fromHost = fromHost; + this.toHost = toHost; + this.auto = auto; + this.preferredHosts = preferredHosts; + this.additionalProperties = additionalProperties; + } + + /** + * @return The host leaving, by id or uid. Needed when it could be several. + */ + @JsonProperty("from_host") + public Optional getFromHost() { + return fromHost; + } + + /** + * @return The host taking over, by id or uid. Or set auto. + */ + @JsonProperty("to_host") + public Optional getToHost() { + return toHost; + } + + /** + * @return Let coss.com pick, as a pool would: the fairest who's free and fits what the booking was routed with. + */ + @JsonProperty("auto") + public Optional getAuto() { + return auto; + } + + /** + * @return With auto: try these first, in order. + */ + @JsonProperty("preferred_hosts") + public Optional> getPreferredHosts() { + return preferredHosts; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ReassignSchedulingBookingRequestChangesItem + && equalTo((ReassignSchedulingBookingRequestChangesItem) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ReassignSchedulingBookingRequestChangesItem other) { + return fromHost.equals(other.fromHost) + && toHost.equals(other.toHost) + && auto.equals(other.auto) + && preferredHosts.equals(other.preferredHosts); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.fromHost, this.toHost, this.auto, this.preferredHosts); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional fromHost = Optional.empty(); + + private Optional toHost = Optional.empty(); + + private Optional auto = Optional.empty(); + + private Optional> preferredHosts = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ReassignSchedulingBookingRequestChangesItem other) { + fromHost(other.getFromHost()); + toHost(other.getToHost()); + auto(other.getAuto()); + preferredHosts(other.getPreferredHosts()); + return this; + } + + /** + *

The host leaving, by id or uid. Needed when it could be several.

+ */ + @JsonSetter(value = "from_host", nulls = Nulls.SKIP) + public Builder fromHost(Optional fromHost) { + this.fromHost = fromHost; + return this; + } + + public Builder fromHost(String fromHost) { + this.fromHost = Optional.ofNullable(fromHost); + return this; + } + + /** + *

The host taking over, by id or uid. Or set auto.

+ */ + @JsonSetter(value = "to_host", nulls = Nulls.SKIP) + public Builder toHost(Optional toHost) { + this.toHost = toHost; + return this; + } + + public Builder toHost(String toHost) { + this.toHost = Optional.ofNullable(toHost); + return this; + } + + /** + *

Let coss.com pick, as a pool would: the fairest who's free and fits what the booking was routed with.

+ */ + @JsonSetter(value = "auto", nulls = Nulls.SKIP) + public Builder auto(Optional auto) { + this.auto = auto; + return this; + } + + public Builder auto(Boolean auto) { + this.auto = Optional.ofNullable(auto); + return this; + } + + /** + *

With auto: try these first, in order.

+ */ + @JsonSetter(value = "preferred_hosts", nulls = Nulls.SKIP) + public Builder preferredHosts(Optional> preferredHosts) { + this.preferredHosts = preferredHosts; + return this; + } + + public Builder preferredHosts(List preferredHosts) { + this.preferredHosts = Optional.ofNullable(preferredHosts); + return this; + } + + public ReassignSchedulingBookingRequestChangesItem build() { + return new ReassignSchedulingBookingRequestChangesItem( + fromHost, toHost, auto, preferredHosts, additionalProperties); + } + + public Builder additionalProperty(String key, Object value) { + this.additionalProperties.put(key, value); + return this; + } + + public Builder additionalProperties(Map additionalProperties) { + this.additionalProperties.putAll(additionalProperties); + return this; + } + } +} diff --git a/sdks/java/src/main/java/com/coss/resources/scheduling/bookings/types/ReassignSchedulingBookingRequestNotify.java b/sdks/java/src/main/java/com/coss/resources/scheduling/bookings/types/ReassignSchedulingBookingRequestNotify.java new file mode 100644 index 000000000..5ccdf6d58 --- /dev/null +++ b/sdks/java/src/main/java/com/coss/resources/scheduling/bookings/types/ReassignSchedulingBookingRequestNotify.java @@ -0,0 +1,113 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.coss.resources.scheduling.bookings.types; + +import com.coss.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ReassignSchedulingBookingRequestNotify.Builder.class) +public final class ReassignSchedulingBookingRequestNotify { + private final Optional attendee; + + private final Map additionalProperties; + + private ReassignSchedulingBookingRequestNotify( + Optional attendee, Map additionalProperties) { + this.attendee = attendee; + this.additionalProperties = additionalProperties; + } + + /** + * @return Tell the attendee. Default: true. + */ + @JsonProperty("attendee") + public Optional getAttendee() { + return attendee; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ReassignSchedulingBookingRequestNotify + && equalTo((ReassignSchedulingBookingRequestNotify) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ReassignSchedulingBookingRequestNotify other) { + return attendee.equals(other.attendee); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.attendee); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional attendee = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ReassignSchedulingBookingRequestNotify other) { + attendee(other.getAttendee()); + return this; + } + + /** + *

Tell the attendee. Default: true.

+ */ + @JsonSetter(value = "attendee", nulls = Nulls.SKIP) + public Builder attendee(Optional attendee) { + this.attendee = attendee; + return this; + } + + public Builder attendee(Boolean attendee) { + this.attendee = Optional.ofNullable(attendee); + return this; + } + + public ReassignSchedulingBookingRequestNotify build() { + return new ReassignSchedulingBookingRequestNotify(attendee, additionalProperties); + } + + public Builder additionalProperty(String key, Object value) { + this.additionalProperties.put(key, value); + return this; + } + + public Builder additionalProperties(Map additionalProperties) { + this.additionalProperties.putAll(additionalProperties); + return this; + } + } +} diff --git a/sdks/java/src/main/java/com/coss/resources/scheduling/bookings/types/ReassignSchedulingBookingRequestOverridesItem.java b/sdks/java/src/main/java/com/coss/resources/scheduling/bookings/types/ReassignSchedulingBookingRequestOverridesItem.java new file mode 100644 index 000000000..1ab6298f4 --- /dev/null +++ b/sdks/java/src/main/java/com/coss/resources/scheduling/bookings/types/ReassignSchedulingBookingRequestOverridesItem.java @@ -0,0 +1,130 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.coss.resources.scheduling.bookings.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class ReassignSchedulingBookingRequestOverridesItem { + public static final ReassignSchedulingBookingRequestOverridesItem LIMIT_REACHED = + new ReassignSchedulingBookingRequestOverridesItem(Value.LIMIT_REACHED, "limit_reached"); + + public static final ReassignSchedulingBookingRequestOverridesItem HOST_BUSY = + new ReassignSchedulingBookingRequestOverridesItem(Value.HOST_BUSY, "host_busy"); + + public static final ReassignSchedulingBookingRequestOverridesItem OUT_OF_OFFICE = + new ReassignSchedulingBookingRequestOverridesItem(Value.OUT_OF_OFFICE, "out_of_office"); + + public static final ReassignSchedulingBookingRequestOverridesItem OUTSIDE_AVAILABILITY = + new ReassignSchedulingBookingRequestOverridesItem(Value.OUTSIDE_AVAILABILITY, "outside_availability"); + + public static final ReassignSchedulingBookingRequestOverridesItem ANY_HOST = + new ReassignSchedulingBookingRequestOverridesItem(Value.ANY_HOST, "any_host"); + + public static final ReassignSchedulingBookingRequestOverridesItem CALENDAR_UNVERIFIED = + new ReassignSchedulingBookingRequestOverridesItem(Value.CALENDAR_UNVERIFIED, "calendar_unverified"); + + private final Value value; + + private final String string; + + ReassignSchedulingBookingRequestOverridesItem(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof ReassignSchedulingBookingRequestOverridesItem + && this.string.equals(((ReassignSchedulingBookingRequestOverridesItem) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case LIMIT_REACHED: + return visitor.visitLimitReached(); + case HOST_BUSY: + return visitor.visitHostBusy(); + case OUT_OF_OFFICE: + return visitor.visitOutOfOffice(); + case OUTSIDE_AVAILABILITY: + return visitor.visitOutsideAvailability(); + case ANY_HOST: + return visitor.visitAnyHost(); + case CALENDAR_UNVERIFIED: + return visitor.visitCalendarUnverified(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static ReassignSchedulingBookingRequestOverridesItem valueOf(String value) { + switch (value) { + case "limit_reached": + return LIMIT_REACHED; + case "host_busy": + return HOST_BUSY; + case "out_of_office": + return OUT_OF_OFFICE; + case "outside_availability": + return OUTSIDE_AVAILABILITY; + case "any_host": + return ANY_HOST; + case "calendar_unverified": + return CALENDAR_UNVERIFIED; + default: + return new ReassignSchedulingBookingRequestOverridesItem(Value.UNKNOWN, value); + } + } + + public enum Value { + ANY_HOST, + + OUT_OF_OFFICE, + + OUTSIDE_AVAILABILITY, + + HOST_BUSY, + + LIMIT_REACHED, + + CALENDAR_UNVERIFIED, + + UNKNOWN + } + + public interface Visitor { + T visitAnyHost(); + + T visitOutOfOffice(); + + T visitOutsideAvailability(); + + T visitHostBusy(); + + T visitLimitReached(); + + T visitCalendarUnverified(); + + T visitUnknown(String unknownType); + } +} diff --git a/sdks/java/src/main/java/com/coss/resources/scheduling/bookings/types/ReassignSchedulingBookingRequestReasonCode.java b/sdks/java/src/main/java/com/coss/resources/scheduling/bookings/types/ReassignSchedulingBookingRequestReasonCode.java new file mode 100644 index 000000000..d39acc85f --- /dev/null +++ b/sdks/java/src/main/java/com/coss/resources/scheduling/bookings/types/ReassignSchedulingBookingRequestReasonCode.java @@ -0,0 +1,130 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.coss.resources.scheduling.bookings.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class ReassignSchedulingBookingRequestReasonCode { + public static final ReassignSchedulingBookingRequestReasonCode CUSTOMER_REQUEST = + new ReassignSchedulingBookingRequestReasonCode(Value.CUSTOMER_REQUEST, "customer_request"); + + public static final ReassignSchedulingBookingRequestReasonCode OTHER = + new ReassignSchedulingBookingRequestReasonCode(Value.OTHER, "other"); + + public static final ReassignSchedulingBookingRequestReasonCode OUT_OF_OFFICE = + new ReassignSchedulingBookingRequestReasonCode(Value.OUT_OF_OFFICE, "out_of_office"); + + public static final ReassignSchedulingBookingRequestReasonCode OFFBOARDING = + new ReassignSchedulingBookingRequestReasonCode(Value.OFFBOARDING, "offboarding"); + + public static final ReassignSchedulingBookingRequestReasonCode HOST_UNAVAILABLE = + new ReassignSchedulingBookingRequestReasonCode(Value.HOST_UNAVAILABLE, "host_unavailable"); + + public static final ReassignSchedulingBookingRequestReasonCode WORKLOAD = + new ReassignSchedulingBookingRequestReasonCode(Value.WORKLOAD, "workload"); + + private final Value value; + + private final String string; + + ReassignSchedulingBookingRequestReasonCode(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof ReassignSchedulingBookingRequestReasonCode + && this.string.equals(((ReassignSchedulingBookingRequestReasonCode) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case CUSTOMER_REQUEST: + return visitor.visitCustomerRequest(); + case OTHER: + return visitor.visitOther(); + case OUT_OF_OFFICE: + return visitor.visitOutOfOffice(); + case OFFBOARDING: + return visitor.visitOffboarding(); + case HOST_UNAVAILABLE: + return visitor.visitHostUnavailable(); + case WORKLOAD: + return visitor.visitWorkload(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static ReassignSchedulingBookingRequestReasonCode valueOf(String value) { + switch (value) { + case "customer_request": + return CUSTOMER_REQUEST; + case "other": + return OTHER; + case "out_of_office": + return OUT_OF_OFFICE; + case "offboarding": + return OFFBOARDING; + case "host_unavailable": + return HOST_UNAVAILABLE; + case "workload": + return WORKLOAD; + default: + return new ReassignSchedulingBookingRequestReasonCode(Value.UNKNOWN, value); + } + } + + public enum Value { + HOST_UNAVAILABLE, + + OUT_OF_OFFICE, + + WORKLOAD, + + CUSTOMER_REQUEST, + + OFFBOARDING, + + OTHER, + + UNKNOWN + } + + public interface Visitor { + T visitHostUnavailable(); + + T visitOutOfOffice(); + + T visitWorkload(); + + T visitCustomerRequest(); + + T visitOffboarding(); + + T visitOther(); + + T visitUnknown(String unknownType); + } +} diff --git a/sdks/java/src/main/java/com/coss/resources/scheduling/eventtypes/requests/CreateEventTypeRequest.java b/sdks/java/src/main/java/com/coss/resources/scheduling/eventtypes/requests/CreateEventTypeRequest.java index fbdf8f1fa..6d333ae6e 100644 --- a/sdks/java/src/main/java/com/coss/resources/scheduling/eventtypes/requests/CreateEventTypeRequest.java +++ b/sdks/java/src/main/java/com/coss/resources/scheduling/eventtypes/requests/CreateEventTypeRequest.java @@ -65,6 +65,8 @@ public final class CreateEventTypeRequest { private final Optional requiresApproval; + private final Optional reassignmentEnabled; + private final Optional approvalTtlMinutes; private final Optional holdTtlSeconds; @@ -81,7 +83,7 @@ public final class CreateEventTypeRequest { private final Optional> questions; - private final Optional> locations; + private final Optional>> locations; private final OptionalNullable>> hostFilter; @@ -112,6 +114,7 @@ private CreateEventTypeRequest( Optional> limits, OptionalNullable capacity, Optional requiresApproval, + Optional reassignmentEnabled, Optional approvalTtlMinutes, Optional holdTtlSeconds, Optional cancelNoticeMinutes, @@ -120,7 +123,7 @@ private CreateEventTypeRequest( OptionalNullable maxActiveBookingsPerAttendee, Optional hostCalendarDetails, Optional> questions, - Optional> locations, + Optional>> locations, OptionalNullable>> hostFilter, OptionalNullable>> notifications, OptionalNullable> reminders, @@ -142,6 +145,7 @@ private CreateEventTypeRequest( this.limits = limits; this.capacity = capacity; this.requiresApproval = requiresApproval; + this.reassignmentEnabled = reassignmentEnabled; this.approvalTtlMinutes = approvalTtlMinutes; this.holdTtlSeconds = holdTtlSeconds; this.cancelNoticeMinutes = cancelNoticeMinutes; @@ -292,6 +296,14 @@ public Optional getRequiresApproval() { return requiresApproval; } + /** + * @return Whether bookings of this event type can go to another host. Default: true. + */ + @JsonProperty("reassignment_enabled") + public Optional getReassignmentEnabled() { + return reassignmentEnabled; + } + /** * @return How long a booking can wait for approval before it's declined, in minutes. Default: 1440. */ @@ -364,7 +376,7 @@ public Optional> getQuestions() { * @return Where bookings can meet. A browser only chooses among these. A group event type can't use zoom. */ @JsonProperty("locations") - public Optional> getLocations() { + public Optional>> getLocations() { return locations; } @@ -497,6 +509,7 @@ private boolean equalTo(CreateEventTypeRequest other) { && limits.equals(other.limits) && capacity.equals(other.capacity) && requiresApproval.equals(other.requiresApproval) + && reassignmentEnabled.equals(other.reassignmentEnabled) && approvalTtlMinutes.equals(other.approvalTtlMinutes) && holdTtlSeconds.equals(other.holdTtlSeconds) && cancelNoticeMinutes.equals(other.cancelNoticeMinutes) @@ -531,6 +544,7 @@ public int hashCode() { this.limits, this.capacity, this.requiresApproval, + this.reassignmentEnabled, this.approvalTtlMinutes, this.holdTtlSeconds, this.cancelNoticeMinutes, @@ -683,6 +697,13 @@ public interface _FinalStage { _FinalStage requiresApproval(Boolean requiresApproval); + /** + *

Whether bookings of this event type can go to another host. Default: true.

+ */ + _FinalStage reassignmentEnabled(Optional reassignmentEnabled); + + _FinalStage reassignmentEnabled(Boolean reassignmentEnabled); + /** *

How long a booking can wait for approval before it's declined, in minutes. Default: 1440.

*/ @@ -746,9 +767,9 @@ public interface _FinalStage { /** *

Where bookings can meet. A browser only chooses among these. A group event type can't use zoom.

*/ - _FinalStage locations(Optional> locations); + _FinalStage locations(Optional>> locations); - _FinalStage locations(List locations); + _FinalStage locations(List> locations); /** *

Pool members also include active hosts matching all of these attributes.

@@ -824,7 +845,7 @@ public static final class Builder implements TitleStage, DurationMinutesStage, _ private OptionalNullable>> hostFilter = OptionalNullable.absent(); - private Optional> locations = Optional.empty(); + private Optional>> locations = Optional.empty(); private Optional> questions = Optional.empty(); @@ -842,6 +863,8 @@ public static final class Builder implements TitleStage, DurationMinutesStage, _ private Optional approvalTtlMinutes = Optional.empty(); + private Optional reassignmentEnabled = Optional.empty(); + private Optional requiresApproval = Optional.empty(); private OptionalNullable capacity = OptionalNullable.absent(); @@ -890,6 +913,7 @@ public Builder from(CreateEventTypeRequest other) { limits(other.getLimits()); capacity(other.getCapacity()); requiresApproval(other.getRequiresApproval()); + reassignmentEnabled(other.getReassignmentEnabled()); approvalTtlMinutes(other.getApprovalTtlMinutes()); holdTtlSeconds(other.getHoldTtlSeconds()); cancelNoticeMinutes(other.getCancelNoticeMinutes()); @@ -1132,7 +1156,7 @@ public _FinalStage hostFilter( * @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override - public _FinalStage locations(List locations) { + public _FinalStage locations(List> locations) { this.locations = Optional.ofNullable(locations); return this; } @@ -1142,7 +1166,7 @@ public _FinalStage locations(List locations) { */ @java.lang.Override @JsonSetter(value = "locations", nulls = Nulls.SKIP) - public _FinalStage locations(Optional> locations) { + public _FinalStage locations(Optional>> locations) { this.locations = locations; return this; } @@ -1338,6 +1362,26 @@ public _FinalStage approvalTtlMinutes(Optional approvalTtlMinutes) { return this; } + /** + *

Whether bookings of this event type can go to another host. Default: true.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage reassignmentEnabled(Boolean reassignmentEnabled) { + this.reassignmentEnabled = Optional.ofNullable(reassignmentEnabled); + return this; + } + + /** + *

Whether bookings of this event type can go to another host. Default: true.

+ */ + @java.lang.Override + @JsonSetter(value = "reassignment_enabled", nulls = Nulls.SKIP) + public _FinalStage reassignmentEnabled(Optional reassignmentEnabled) { + this.reassignmentEnabled = reassignmentEnabled; + return this; + } + /** *

Bookings start as pending_approval, holding the time until approved or declined. Default: false.

* @return Reference to {@code this} so that method calls can be chained together. @@ -1721,6 +1765,7 @@ public CreateEventTypeRequest build() { limits, capacity, requiresApproval, + reassignmentEnabled, approvalTtlMinutes, holdTtlSeconds, cancelNoticeMinutes, diff --git a/sdks/java/src/main/java/com/coss/resources/scheduling/eventtypes/requests/UpdateEventTypeRequest.java b/sdks/java/src/main/java/com/coss/resources/scheduling/eventtypes/requests/UpdateEventTypeRequest.java index 3d04704dd..02eb13381 100644 --- a/sdks/java/src/main/java/com/coss/resources/scheduling/eventtypes/requests/UpdateEventTypeRequest.java +++ b/sdks/java/src/main/java/com/coss/resources/scheduling/eventtypes/requests/UpdateEventTypeRequest.java @@ -62,6 +62,8 @@ public final class UpdateEventTypeRequest { private final Optional requiresApproval; + private final Optional reassignmentEnabled; + private final Optional approvalTtlMinutes; private final Optional holdTtlSeconds; @@ -78,7 +80,7 @@ public final class UpdateEventTypeRequest { private final Optional> questions; - private final Optional> locations; + private final Optional>> locations; private final OptionalNullable>> hostFilter; @@ -110,6 +112,7 @@ private UpdateEventTypeRequest( Optional> limits, OptionalNullable capacity, Optional requiresApproval, + Optional reassignmentEnabled, Optional approvalTtlMinutes, Optional holdTtlSeconds, Optional cancelNoticeMinutes, @@ -118,7 +121,7 @@ private UpdateEventTypeRequest( OptionalNullable maxActiveBookingsPerAttendee, Optional hostCalendarDetails, Optional> questions, - Optional> locations, + Optional>> locations, OptionalNullable>> hostFilter, OptionalNullable>> notifications, OptionalNullable> reminders, @@ -140,6 +143,7 @@ private UpdateEventTypeRequest( this.limits = limits; this.capacity = capacity; this.requiresApproval = requiresApproval; + this.reassignmentEnabled = reassignmentEnabled; this.approvalTtlMinutes = approvalTtlMinutes; this.holdTtlSeconds = holdTtlSeconds; this.cancelNoticeMinutes = cancelNoticeMinutes; @@ -287,6 +291,14 @@ public Optional getRequiresApproval() { return requiresApproval; } + /** + * @return Whether bookings of this event type can go to another host. Default: true. + */ + @JsonProperty("reassignment_enabled") + public Optional getReassignmentEnabled() { + return reassignmentEnabled; + } + /** * @return How long a booking can wait for approval before it's declined, in minutes. Default: 1440. */ @@ -359,7 +371,7 @@ public Optional> getQuestions() { * @return Where bookings can meet. A browser only chooses among these. A group event type can't use zoom. */ @JsonProperty("locations") - public Optional> getLocations() { + public Optional>> getLocations() { return locations; } @@ -505,6 +517,7 @@ private boolean equalTo(UpdateEventTypeRequest other) { && limits.equals(other.limits) && capacity.equals(other.capacity) && requiresApproval.equals(other.requiresApproval) + && reassignmentEnabled.equals(other.reassignmentEnabled) && approvalTtlMinutes.equals(other.approvalTtlMinutes) && holdTtlSeconds.equals(other.holdTtlSeconds) && cancelNoticeMinutes.equals(other.cancelNoticeMinutes) @@ -539,6 +552,7 @@ public int hashCode() { this.limits, this.capacity, this.requiresApproval, + this.reassignmentEnabled, this.approvalTtlMinutes, this.holdTtlSeconds, this.cancelNoticeMinutes, @@ -595,6 +609,8 @@ public static final class Builder { private Optional requiresApproval = Optional.empty(); + private Optional reassignmentEnabled = Optional.empty(); + private Optional approvalTtlMinutes = Optional.empty(); private Optional holdTtlSeconds = Optional.empty(); @@ -611,7 +627,7 @@ public static final class Builder { private Optional> questions = Optional.empty(); - private Optional> locations = Optional.empty(); + private Optional>> locations = Optional.empty(); private OptionalNullable>> hostFilter = OptionalNullable.absent(); @@ -647,6 +663,7 @@ public Builder from(UpdateEventTypeRequest other) { limits(other.getLimits()); capacity(other.getCapacity()); requiresApproval(other.getRequiresApproval()); + reassignmentEnabled(other.getReassignmentEnabled()); approvalTtlMinutes(other.getApprovalTtlMinutes()); holdTtlSeconds(other.getHoldTtlSeconds()); cancelNoticeMinutes(other.getCancelNoticeMinutes()); @@ -958,6 +975,20 @@ public Builder requiresApproval(Boolean requiresApproval) { return this; } + /** + *

Whether bookings of this event type can go to another host. Default: true.

+ */ + @JsonSetter(value = "reassignment_enabled", nulls = Nulls.SKIP) + public Builder reassignmentEnabled(Optional reassignmentEnabled) { + this.reassignmentEnabled = reassignmentEnabled; + return this; + } + + public Builder reassignmentEnabled(Boolean reassignmentEnabled) { + this.reassignmentEnabled = Optional.ofNullable(reassignmentEnabled); + return this; + } + /** *

How long a booking can wait for approval before it's declined, in minutes. Default: 1440.

*/ @@ -1094,12 +1125,12 @@ public Builder questions(List questions) { *

Where bookings can meet. A browser only chooses among these. A group event type can't use zoom.

*/ @JsonSetter(value = "locations", nulls = Nulls.SKIP) - public Builder locations(Optional> locations) { + public Builder locations(Optional>> locations) { this.locations = locations; return this; } - public Builder locations(List locations) { + public Builder locations(List> locations) { this.locations = Optional.ofNullable(locations); return this; } @@ -1272,6 +1303,7 @@ public UpdateEventTypeRequest build() { limits, capacity, requiresApproval, + reassignmentEnabled, approvalTtlMinutes, holdTtlSeconds, cancelNoticeMinutes, diff --git a/sdks/java/src/main/java/com/coss/resources/scheduling/holidaycalendars/AsyncHolidayCalendarsClient.java b/sdks/java/src/main/java/com/coss/resources/scheduling/holidaycalendars/AsyncHolidayCalendarsClient.java new file mode 100644 index 000000000..aa937ffdf --- /dev/null +++ b/sdks/java/src/main/java/com/coss/resources/scheduling/holidaycalendars/AsyncHolidayCalendarsClient.java @@ -0,0 +1,182 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.coss.resources.scheduling.holidaycalendars; + +import com.coss.core.ClientOptions; +import com.coss.core.RequestOptions; +import com.coss.resources.scheduling.holidaycalendars.requests.CreateSchedulingHolidayCalendarRequest; +import com.coss.resources.scheduling.holidaycalendars.requests.GetHolidayCalendarsRequest; +import com.coss.resources.scheduling.holidaycalendars.requests.HolidaysHolidayCalendarsRequest; +import com.coss.resources.scheduling.holidaycalendars.requests.RemoveHolidayCalendarsRequest; +import com.coss.resources.scheduling.holidaycalendars.requests.UpdateSchedulingHolidayCalendarRequest; +import com.coss.types.DeletedSchedulingHolidayCalendar; +import com.coss.types.SchedulingHolidayCalendar; +import com.coss.types.SchedulingHolidayCalendarList; +import com.coss.types.SchedulingHolidayList; +import java.util.concurrent.CompletableFuture; + +public class AsyncHolidayCalendarsClient { + protected final ClientOptions clientOptions; + + private final AsyncRawHolidayCalendarsClient rawClient; + + public AsyncHolidayCalendarsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawHolidayCalendarsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawHolidayCalendarsClient withRawResponse() { + return this.rawClient; + } + + /** + * By name. A feed's URL is never shown again. + */ + public CompletableFuture list() { + return this.rawClient.list().thenApply(response -> response.body()); + } + + /** + * By name. A feed's URL is never shown again. + */ + public CompletableFuture list(RequestOptions requestOptions) { + return this.rawClient.list(requestOptions).thenApply(response -> response.body()); + } + + /** + * Applies a country's public holidays, or your own feed, to some hosts as ordinary out of office entries, kept up to date by coss.com. A host who removes one keeps it removed. + */ + public CompletableFuture create(CreateSchedulingHolidayCalendarRequest request) { + return this.rawClient.create(request).thenApply(response -> response.body()); + } + + /** + * Applies a country's public holidays, or your own feed, to some hosts as ordinary out of office entries, kept up to date by coss.com. A host who removes one keeps it removed. + */ + public CompletableFuture create( + CreateSchedulingHolidayCalendarRequest request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * With when it was last read, and why not if it couldn't be. + */ + public CompletableFuture get(String id) { + return this.rawClient.get(id).thenApply(response -> response.body()); + } + + /** + * With when it was last read, and why not if it couldn't be. + */ + public CompletableFuture get(String id, RequestOptions requestOptions) { + return this.rawClient.get(id, requestOptions).thenApply(response -> response.body()); + } + + /** + * With when it was last read, and why not if it couldn't be. + */ + public CompletableFuture get(String id, GetHolidayCalendarsRequest request) { + return this.rawClient.get(id, request).thenApply(response -> response.body()); + } + + /** + * With when it was last read, and why not if it couldn't be. + */ + public CompletableFuture get( + String id, GetHolidayCalendarsRequest request, RequestOptions requestOptions) { + return this.rawClient.get(id, request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Hosts can be booked on its days again, shortly: past entries stay. + */ + public CompletableFuture remove(String id) { + return this.rawClient.remove(id).thenApply(response -> response.body()); + } + + /** + * Hosts can be booked on its days again, shortly: past entries stay. + */ + public CompletableFuture remove(String id, RequestOptions requestOptions) { + return this.rawClient.remove(id, requestOptions).thenApply(response -> response.body()); + } + + /** + * Hosts can be booked on its days again, shortly: past entries stay. + */ + public CompletableFuture remove( + String id, RemoveHolidayCalendarsRequest request) { + return this.rawClient.remove(id, request).thenApply(response -> response.body()); + } + + /** + * Hosts can be booked on its days again, shortly: past entries stay. + */ + public CompletableFuture remove( + String id, RemoveHolidayCalendarsRequest request, RequestOptions requestOptions) { + return this.rawClient.remove(id, request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Who it applies to, who covers and what happens to bookings. Takes effect shortly. + */ + public CompletableFuture update(String id) { + return this.rawClient.update(id).thenApply(response -> response.body()); + } + + /** + * Who it applies to, who covers and what happens to bookings. Takes effect shortly. + */ + public CompletableFuture update(String id, RequestOptions requestOptions) { + return this.rawClient.update(id, requestOptions).thenApply(response -> response.body()); + } + + /** + * Who it applies to, who covers and what happens to bookings. Takes effect shortly. + */ + public CompletableFuture update( + String id, UpdateSchedulingHolidayCalendarRequest request) { + return this.rawClient.update(id, request).thenApply(response -> response.body()); + } + + /** + * Who it applies to, who covers and what happens to bookings. Takes effect shortly. + */ + public CompletableFuture update( + String id, UpdateSchedulingHolidayCalendarRequest request, RequestOptions requestOptions) { + return this.rawClient.update(id, request, requestOptions).thenApply(response -> response.body()); + } + + /** + * What's coming, with names, as last read. Empty until its first read. + */ + public CompletableFuture holidays(String id) { + return this.rawClient.holidays(id).thenApply(response -> response.body()); + } + + /** + * What's coming, with names, as last read. Empty until its first read. + */ + public CompletableFuture holidays(String id, RequestOptions requestOptions) { + return this.rawClient.holidays(id, requestOptions).thenApply(response -> response.body()); + } + + /** + * What's coming, with names, as last read. Empty until its first read. + */ + public CompletableFuture holidays(String id, HolidaysHolidayCalendarsRequest request) { + return this.rawClient.holidays(id, request).thenApply(response -> response.body()); + } + + /** + * What's coming, with names, as last read. Empty until its first read. + */ + public CompletableFuture holidays( + String id, HolidaysHolidayCalendarsRequest request, RequestOptions requestOptions) { + return this.rawClient.holidays(id, request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/sdks/java/src/main/java/com/coss/resources/scheduling/holidaycalendars/AsyncRawHolidayCalendarsClient.java b/sdks/java/src/main/java/com/coss/resources/scheduling/holidaycalendars/AsyncRawHolidayCalendarsClient.java new file mode 100644 index 000000000..6a744edec --- /dev/null +++ b/sdks/java/src/main/java/com/coss/resources/scheduling/holidaycalendars/AsyncRawHolidayCalendarsClient.java @@ -0,0 +1,827 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.coss.resources.scheduling.holidaycalendars; + +import com.coss.core.ClientOptions; +import com.coss.core.CossApiException; +import com.coss.core.CossException; +import com.coss.core.CossHttpResponse; +import com.coss.core.IdempotencyUtils; +import com.coss.core.MediaTypes; +import com.coss.core.ObjectMappers; +import com.coss.core.RequestOptions; +import com.coss.core.RetryInterceptor; +import com.coss.errors.BadRequestError; +import com.coss.errors.ForbiddenError; +import com.coss.errors.InternalServerError; +import com.coss.errors.NotFoundError; +import com.coss.errors.ServiceUnavailableError; +import com.coss.errors.TooManyRequestsError; +import com.coss.errors.UnauthorizedError; +import com.coss.errors.UnprocessableEntityError; +import com.coss.errors.UnsupportedMediaTypeError; +import com.coss.resources.scheduling.holidaycalendars.requests.CreateSchedulingHolidayCalendarRequest; +import com.coss.resources.scheduling.holidaycalendars.requests.GetHolidayCalendarsRequest; +import com.coss.resources.scheduling.holidaycalendars.requests.HolidaysHolidayCalendarsRequest; +import com.coss.resources.scheduling.holidaycalendars.requests.RemoveHolidayCalendarsRequest; +import com.coss.resources.scheduling.holidaycalendars.requests.UpdateSchedulingHolidayCalendarRequest; +import com.coss.types.DeletedSchedulingHolidayCalendar; +import com.coss.types.Error; +import com.coss.types.SchedulingHolidayCalendar; +import com.coss.types.SchedulingHolidayCalendarList; +import com.coss.types.SchedulingHolidayList; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.io.IOException; +import java.util.concurrent.CompletableFuture; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawHolidayCalendarsClient { + protected final ClientOptions clientOptions; + + public AsyncRawHolidayCalendarsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * By name. A feed's URL is never shown again. + */ + public CompletableFuture> list() { + return list(null); + } + + /** + * By name. A feed's URL is never shown again. + */ + public CompletableFuture> list(RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("v1/scheduling/holiday_calendars"); + if (requestOptions != null) { + requestOptions.getQueryParameters().forEach((_key, _value) -> { + httpUrl.addQueryParameter(_key, _value); + }); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + if (requestOptions != null && requestOptions.getMaxRetries().isPresent()) { + okhttpRequest = okhttpRequest + .newBuilder() + .tag( + RetryInterceptor.MaxRetriesOverride.class, + new RetryInterceptor.MaxRetriesOverride( + requestOptions.getMaxRetries().get())) + .build(); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new CossHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, SchedulingHolidayCalendarList.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 500: + future.completeExceptionally(new InternalServerError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 503: + future.completeExceptionally(new ServiceUnavailableError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new CossApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (JsonProcessingException e) { + future.completeExceptionally( + new CossException("Failed to deserialize response: " + e.getMessage(), e)); + } catch (IOException e) { + future.completeExceptionally(new CossException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new CossException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Applies a country's public holidays, or your own feed, to some hosts as ordinary out of office entries, kept up to date by coss.com. A host who removes one keeps it removed. + */ + public CompletableFuture> create( + CreateSchedulingHolidayCalendarRequest request) { + return create(request, null); + } + + /** + * Applies a country's public holidays, or your own feed, to some hosts as ordinary out of office entries, kept up to date by coss.com. A host who removes one keeps it removed. + */ + public CompletableFuture> create( + CreateSchedulingHolidayCalendarRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("v1/scheduling/holiday_calendars"); + if (requestOptions != null) { + requestOptions.getQueryParameters().forEach((_key, _value) -> { + httpUrl.addQueryParameter(_key, _value); + }); + } + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new CossException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl.build()) + .method("POST", body) + .headers(Headers.of(IdempotencyUtils.withGeneratedIdempotencyKey( + clientOptions.headers(requestOptions), "Idempotency-Key"))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + okhttpRequest = okhttpRequest + .newBuilder() + .tag(RetryInterceptor.MaxRetriesOverride.class, new RetryInterceptor.MaxRetriesOverride(0)) + .build(); + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new CossHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, SchedulingHolidayCalendar.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 415: + future.completeExceptionally(new UnsupportedMediaTypeError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 422: + future.completeExceptionally(new UnprocessableEntityError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 500: + future.completeExceptionally(new InternalServerError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 503: + future.completeExceptionally(new ServiceUnavailableError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new CossApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (JsonProcessingException e) { + future.completeExceptionally( + new CossException("Failed to deserialize response: " + e.getMessage(), e)); + } catch (IOException e) { + future.completeExceptionally(new CossException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new CossException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * With when it was last read, and why not if it couldn't be. + */ + public CompletableFuture> get(String id) { + return get(id, GetHolidayCalendarsRequest.builder().build()); + } + + /** + * With when it was last read, and why not if it couldn't be. + */ + public CompletableFuture> get( + String id, RequestOptions requestOptions) { + return get(id, GetHolidayCalendarsRequest.builder().build(), requestOptions); + } + + /** + * With when it was last read, and why not if it couldn't be. + */ + public CompletableFuture> get( + String id, GetHolidayCalendarsRequest request) { + return get(id, request, null); + } + + /** + * With when it was last read, and why not if it couldn't be. + */ + public CompletableFuture> get( + String id, GetHolidayCalendarsRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("v1/scheduling/holiday_calendars") + .addPathSegment(id); + if (requestOptions != null) { + requestOptions.getQueryParameters().forEach((_key, _value) -> { + httpUrl.addQueryParameter(_key, _value); + }); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + if (requestOptions != null && requestOptions.getMaxRetries().isPresent()) { + okhttpRequest = okhttpRequest + .newBuilder() + .tag( + RetryInterceptor.MaxRetriesOverride.class, + new RetryInterceptor.MaxRetriesOverride( + requestOptions.getMaxRetries().get())) + .build(); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new CossHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, SchedulingHolidayCalendar.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 500: + future.completeExceptionally(new InternalServerError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 503: + future.completeExceptionally(new ServiceUnavailableError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new CossApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (JsonProcessingException e) { + future.completeExceptionally( + new CossException("Failed to deserialize response: " + e.getMessage(), e)); + } catch (IOException e) { + future.completeExceptionally(new CossException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new CossException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Hosts can be booked on its days again, shortly: past entries stay. + */ + public CompletableFuture> remove(String id) { + return remove(id, RemoveHolidayCalendarsRequest.builder().build()); + } + + /** + * Hosts can be booked on its days again, shortly: past entries stay. + */ + public CompletableFuture> remove( + String id, RequestOptions requestOptions) { + return remove(id, RemoveHolidayCalendarsRequest.builder().build(), requestOptions); + } + + /** + * Hosts can be booked on its days again, shortly: past entries stay. + */ + public CompletableFuture> remove( + String id, RemoveHolidayCalendarsRequest request) { + return remove(id, request, null); + } + + /** + * Hosts can be booked on its days again, shortly: past entries stay. + */ + public CompletableFuture> remove( + String id, RemoveHolidayCalendarsRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("v1/scheduling/holiday_calendars") + .addPathSegment(id); + if (requestOptions != null) { + requestOptions.getQueryParameters().forEach((_key, _value) -> { + httpUrl.addQueryParameter(_key, _value); + }); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("DELETE", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + if (requestOptions != null && requestOptions.getMaxRetries().isPresent()) { + okhttpRequest = okhttpRequest + .newBuilder() + .tag( + RetryInterceptor.MaxRetriesOverride.class, + new RetryInterceptor.MaxRetriesOverride( + requestOptions.getMaxRetries().get())) + .build(); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new CossHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, DeletedSchedulingHolidayCalendar.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 500: + future.completeExceptionally(new InternalServerError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 503: + future.completeExceptionally(new ServiceUnavailableError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new CossApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (JsonProcessingException e) { + future.completeExceptionally( + new CossException("Failed to deserialize response: " + e.getMessage(), e)); + } catch (IOException e) { + future.completeExceptionally(new CossException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new CossException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Who it applies to, who covers and what happens to bookings. Takes effect shortly. + */ + public CompletableFuture> update(String id) { + return update(id, UpdateSchedulingHolidayCalendarRequest.builder().build()); + } + + /** + * Who it applies to, who covers and what happens to bookings. Takes effect shortly. + */ + public CompletableFuture> update( + String id, RequestOptions requestOptions) { + return update(id, UpdateSchedulingHolidayCalendarRequest.builder().build(), requestOptions); + } + + /** + * Who it applies to, who covers and what happens to bookings. Takes effect shortly. + */ + public CompletableFuture> update( + String id, UpdateSchedulingHolidayCalendarRequest request) { + return update(id, request, null); + } + + /** + * Who it applies to, who covers and what happens to bookings. Takes effect shortly. + */ + public CompletableFuture> update( + String id, UpdateSchedulingHolidayCalendarRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("v1/scheduling/holiday_calendars") + .addPathSegment(id); + if (requestOptions != null) { + requestOptions.getQueryParameters().forEach((_key, _value) -> { + httpUrl.addQueryParameter(_key, _value); + }); + } + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new CossException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl.build()) + .method("PATCH", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + if (requestOptions != null && requestOptions.getMaxRetries().isPresent()) { + okhttpRequest = okhttpRequest + .newBuilder() + .tag( + RetryInterceptor.MaxRetriesOverride.class, + new RetryInterceptor.MaxRetriesOverride( + requestOptions.getMaxRetries().get())) + .build(); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new CossHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, SchedulingHolidayCalendar.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 415: + future.completeExceptionally(new UnsupportedMediaTypeError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 422: + future.completeExceptionally(new UnprocessableEntityError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 500: + future.completeExceptionally(new InternalServerError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 503: + future.completeExceptionally(new ServiceUnavailableError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new CossApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (JsonProcessingException e) { + future.completeExceptionally( + new CossException("Failed to deserialize response: " + e.getMessage(), e)); + } catch (IOException e) { + future.completeExceptionally(new CossException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new CossException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * What's coming, with names, as last read. Empty until its first read. + */ + public CompletableFuture> holidays(String id) { + return holidays(id, HolidaysHolidayCalendarsRequest.builder().build()); + } + + /** + * What's coming, with names, as last read. Empty until its first read. + */ + public CompletableFuture> holidays( + String id, RequestOptions requestOptions) { + return holidays(id, HolidaysHolidayCalendarsRequest.builder().build(), requestOptions); + } + + /** + * What's coming, with names, as last read. Empty until its first read. + */ + public CompletableFuture> holidays( + String id, HolidaysHolidayCalendarsRequest request) { + return holidays(id, request, null); + } + + /** + * What's coming, with names, as last read. Empty until its first read. + */ + public CompletableFuture> holidays( + String id, HolidaysHolidayCalendarsRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("v1/scheduling/holiday_calendars") + .addPathSegment(id) + .addPathSegments("holidays"); + if (requestOptions != null) { + requestOptions.getQueryParameters().forEach((_key, _value) -> { + httpUrl.addQueryParameter(_key, _value); + }); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + if (requestOptions != null && requestOptions.getMaxRetries().isPresent()) { + okhttpRequest = okhttpRequest + .newBuilder() + .tag( + RetryInterceptor.MaxRetriesOverride.class, + new RetryInterceptor.MaxRetriesOverride( + requestOptions.getMaxRetries().get())) + .build(); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new CossHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, SchedulingHolidayList.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 500: + future.completeExceptionally(new InternalServerError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 503: + future.completeExceptionally(new ServiceUnavailableError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new CossApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (JsonProcessingException e) { + future.completeExceptionally( + new CossException("Failed to deserialize response: " + e.getMessage(), e)); + } catch (IOException e) { + future.completeExceptionally(new CossException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new CossException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/sdks/java/src/main/java/com/coss/resources/scheduling/holidaycalendars/HolidayCalendarsClient.java b/sdks/java/src/main/java/com/coss/resources/scheduling/holidaycalendars/HolidayCalendarsClient.java new file mode 100644 index 000000000..d4e78fbde --- /dev/null +++ b/sdks/java/src/main/java/com/coss/resources/scheduling/holidaycalendars/HolidayCalendarsClient.java @@ -0,0 +1,178 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.coss.resources.scheduling.holidaycalendars; + +import com.coss.core.ClientOptions; +import com.coss.core.RequestOptions; +import com.coss.resources.scheduling.holidaycalendars.requests.CreateSchedulingHolidayCalendarRequest; +import com.coss.resources.scheduling.holidaycalendars.requests.GetHolidayCalendarsRequest; +import com.coss.resources.scheduling.holidaycalendars.requests.HolidaysHolidayCalendarsRequest; +import com.coss.resources.scheduling.holidaycalendars.requests.RemoveHolidayCalendarsRequest; +import com.coss.resources.scheduling.holidaycalendars.requests.UpdateSchedulingHolidayCalendarRequest; +import com.coss.types.DeletedSchedulingHolidayCalendar; +import com.coss.types.SchedulingHolidayCalendar; +import com.coss.types.SchedulingHolidayCalendarList; +import com.coss.types.SchedulingHolidayList; + +public class HolidayCalendarsClient { + protected final ClientOptions clientOptions; + + private final RawHolidayCalendarsClient rawClient; + + public HolidayCalendarsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawHolidayCalendarsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawHolidayCalendarsClient withRawResponse() { + return this.rawClient; + } + + /** + * By name. A feed's URL is never shown again. + */ + public SchedulingHolidayCalendarList list() { + return this.rawClient.list().body(); + } + + /** + * By name. A feed's URL is never shown again. + */ + public SchedulingHolidayCalendarList list(RequestOptions requestOptions) { + return this.rawClient.list(requestOptions).body(); + } + + /** + * Applies a country's public holidays, or your own feed, to some hosts as ordinary out of office entries, kept up to date by coss.com. A host who removes one keeps it removed. + */ + public SchedulingHolidayCalendar create(CreateSchedulingHolidayCalendarRequest request) { + return this.rawClient.create(request).body(); + } + + /** + * Applies a country's public holidays, or your own feed, to some hosts as ordinary out of office entries, kept up to date by coss.com. A host who removes one keeps it removed. + */ + public SchedulingHolidayCalendar create( + CreateSchedulingHolidayCalendarRequest request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).body(); + } + + /** + * With when it was last read, and why not if it couldn't be. + */ + public SchedulingHolidayCalendar get(String id) { + return this.rawClient.get(id).body(); + } + + /** + * With when it was last read, and why not if it couldn't be. + */ + public SchedulingHolidayCalendar get(String id, RequestOptions requestOptions) { + return this.rawClient.get(id, requestOptions).body(); + } + + /** + * With when it was last read, and why not if it couldn't be. + */ + public SchedulingHolidayCalendar get(String id, GetHolidayCalendarsRequest request) { + return this.rawClient.get(id, request).body(); + } + + /** + * With when it was last read, and why not if it couldn't be. + */ + public SchedulingHolidayCalendar get(String id, GetHolidayCalendarsRequest request, RequestOptions requestOptions) { + return this.rawClient.get(id, request, requestOptions).body(); + } + + /** + * Hosts can be booked on its days again, shortly: past entries stay. + */ + public DeletedSchedulingHolidayCalendar remove(String id) { + return this.rawClient.remove(id).body(); + } + + /** + * Hosts can be booked on its days again, shortly: past entries stay. + */ + public DeletedSchedulingHolidayCalendar remove(String id, RequestOptions requestOptions) { + return this.rawClient.remove(id, requestOptions).body(); + } + + /** + * Hosts can be booked on its days again, shortly: past entries stay. + */ + public DeletedSchedulingHolidayCalendar remove(String id, RemoveHolidayCalendarsRequest request) { + return this.rawClient.remove(id, request).body(); + } + + /** + * Hosts can be booked on its days again, shortly: past entries stay. + */ + public DeletedSchedulingHolidayCalendar remove( + String id, RemoveHolidayCalendarsRequest request, RequestOptions requestOptions) { + return this.rawClient.remove(id, request, requestOptions).body(); + } + + /** + * Who it applies to, who covers and what happens to bookings. Takes effect shortly. + */ + public SchedulingHolidayCalendar update(String id) { + return this.rawClient.update(id).body(); + } + + /** + * Who it applies to, who covers and what happens to bookings. Takes effect shortly. + */ + public SchedulingHolidayCalendar update(String id, RequestOptions requestOptions) { + return this.rawClient.update(id, requestOptions).body(); + } + + /** + * Who it applies to, who covers and what happens to bookings. Takes effect shortly. + */ + public SchedulingHolidayCalendar update(String id, UpdateSchedulingHolidayCalendarRequest request) { + return this.rawClient.update(id, request).body(); + } + + /** + * Who it applies to, who covers and what happens to bookings. Takes effect shortly. + */ + public SchedulingHolidayCalendar update( + String id, UpdateSchedulingHolidayCalendarRequest request, RequestOptions requestOptions) { + return this.rawClient.update(id, request, requestOptions).body(); + } + + /** + * What's coming, with names, as last read. Empty until its first read. + */ + public SchedulingHolidayList holidays(String id) { + return this.rawClient.holidays(id).body(); + } + + /** + * What's coming, with names, as last read. Empty until its first read. + */ + public SchedulingHolidayList holidays(String id, RequestOptions requestOptions) { + return this.rawClient.holidays(id, requestOptions).body(); + } + + /** + * What's coming, with names, as last read. Empty until its first read. + */ + public SchedulingHolidayList holidays(String id, HolidaysHolidayCalendarsRequest request) { + return this.rawClient.holidays(id, request).body(); + } + + /** + * What's coming, with names, as last read. Empty until its first read. + */ + public SchedulingHolidayList holidays( + String id, HolidaysHolidayCalendarsRequest request, RequestOptions requestOptions) { + return this.rawClient.holidays(id, request, requestOptions).body(); + } +} diff --git a/sdks/java/src/main/java/com/coss/resources/scheduling/holidaycalendars/RawHolidayCalendarsClient.java b/sdks/java/src/main/java/com/coss/resources/scheduling/holidaycalendars/RawHolidayCalendarsClient.java new file mode 100644 index 000000000..669ae3f0e --- /dev/null +++ b/sdks/java/src/main/java/com/coss/resources/scheduling/holidaycalendars/RawHolidayCalendarsClient.java @@ -0,0 +1,635 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.coss.resources.scheduling.holidaycalendars; + +import com.coss.core.ClientOptions; +import com.coss.core.CossApiException; +import com.coss.core.CossException; +import com.coss.core.CossHttpResponse; +import com.coss.core.IdempotencyUtils; +import com.coss.core.MediaTypes; +import com.coss.core.ObjectMappers; +import com.coss.core.RequestOptions; +import com.coss.core.RetryInterceptor; +import com.coss.errors.BadRequestError; +import com.coss.errors.ForbiddenError; +import com.coss.errors.InternalServerError; +import com.coss.errors.NotFoundError; +import com.coss.errors.ServiceUnavailableError; +import com.coss.errors.TooManyRequestsError; +import com.coss.errors.UnauthorizedError; +import com.coss.errors.UnprocessableEntityError; +import com.coss.errors.UnsupportedMediaTypeError; +import com.coss.resources.scheduling.holidaycalendars.requests.CreateSchedulingHolidayCalendarRequest; +import com.coss.resources.scheduling.holidaycalendars.requests.GetHolidayCalendarsRequest; +import com.coss.resources.scheduling.holidaycalendars.requests.HolidaysHolidayCalendarsRequest; +import com.coss.resources.scheduling.holidaycalendars.requests.RemoveHolidayCalendarsRequest; +import com.coss.resources.scheduling.holidaycalendars.requests.UpdateSchedulingHolidayCalendarRequest; +import com.coss.types.DeletedSchedulingHolidayCalendar; +import com.coss.types.Error; +import com.coss.types.SchedulingHolidayCalendar; +import com.coss.types.SchedulingHolidayCalendarList; +import com.coss.types.SchedulingHolidayList; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.io.IOException; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawHolidayCalendarsClient { + protected final ClientOptions clientOptions; + + public RawHolidayCalendarsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * By name. A feed's URL is never shown again. + */ + public CossHttpResponse list() { + return list(null); + } + + /** + * By name. A feed's URL is never shown again. + */ + public CossHttpResponse list(RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("v1/scheduling/holiday_calendars"); + if (requestOptions != null) { + requestOptions.getQueryParameters().forEach((_key, _value) -> { + httpUrl.addQueryParameter(_key, _value); + }); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + if (requestOptions != null && requestOptions.getMaxRetries().isPresent()) { + okhttpRequest = okhttpRequest + .newBuilder() + .tag( + RetryInterceptor.MaxRetriesOverride.class, + new RetryInterceptor.MaxRetriesOverride( + requestOptions.getMaxRetries().get())) + .build(); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new CossHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, SchedulingHolidayCalendarList.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 500: + throw new InternalServerError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 503: + throw new ServiceUnavailableError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new CossApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (JsonProcessingException e) { + throw new CossException("Failed to deserialize response: " + e.getMessage(), e); + } catch (IOException e) { + throw new CossException("Network error executing HTTP request", e); + } + } + + /** + * Applies a country's public holidays, or your own feed, to some hosts as ordinary out of office entries, kept up to date by coss.com. A host who removes one keeps it removed. + */ + public CossHttpResponse create(CreateSchedulingHolidayCalendarRequest request) { + return create(request, null); + } + + /** + * Applies a country's public holidays, or your own feed, to some hosts as ordinary out of office entries, kept up to date by coss.com. A host who removes one keeps it removed. + */ + public CossHttpResponse create( + CreateSchedulingHolidayCalendarRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("v1/scheduling/holiday_calendars"); + if (requestOptions != null) { + requestOptions.getQueryParameters().forEach((_key, _value) -> { + httpUrl.addQueryParameter(_key, _value); + }); + } + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new CossException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl.build()) + .method("POST", body) + .headers(Headers.of(IdempotencyUtils.withGeneratedIdempotencyKey( + clientOptions.headers(requestOptions), "Idempotency-Key"))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + okhttpRequest = okhttpRequest + .newBuilder() + .tag(RetryInterceptor.MaxRetriesOverride.class, new RetryInterceptor.MaxRetriesOverride(0)) + .build(); + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new CossHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, SchedulingHolidayCalendar.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 415: + throw new UnsupportedMediaTypeError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 422: + throw new UnprocessableEntityError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 500: + throw new InternalServerError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 503: + throw new ServiceUnavailableError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new CossApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (JsonProcessingException e) { + throw new CossException("Failed to deserialize response: " + e.getMessage(), e); + } catch (IOException e) { + throw new CossException("Network error executing HTTP request", e); + } + } + + /** + * With when it was last read, and why not if it couldn't be. + */ + public CossHttpResponse get(String id) { + return get(id, GetHolidayCalendarsRequest.builder().build()); + } + + /** + * With when it was last read, and why not if it couldn't be. + */ + public CossHttpResponse get(String id, RequestOptions requestOptions) { + return get(id, GetHolidayCalendarsRequest.builder().build(), requestOptions); + } + + /** + * With when it was last read, and why not if it couldn't be. + */ + public CossHttpResponse get(String id, GetHolidayCalendarsRequest request) { + return get(id, request, null); + } + + /** + * With when it was last read, and why not if it couldn't be. + */ + public CossHttpResponse get( + String id, GetHolidayCalendarsRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("v1/scheduling/holiday_calendars") + .addPathSegment(id); + if (requestOptions != null) { + requestOptions.getQueryParameters().forEach((_key, _value) -> { + httpUrl.addQueryParameter(_key, _value); + }); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + if (requestOptions != null && requestOptions.getMaxRetries().isPresent()) { + okhttpRequest = okhttpRequest + .newBuilder() + .tag( + RetryInterceptor.MaxRetriesOverride.class, + new RetryInterceptor.MaxRetriesOverride( + requestOptions.getMaxRetries().get())) + .build(); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new CossHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, SchedulingHolidayCalendar.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 500: + throw new InternalServerError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 503: + throw new ServiceUnavailableError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new CossApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (JsonProcessingException e) { + throw new CossException("Failed to deserialize response: " + e.getMessage(), e); + } catch (IOException e) { + throw new CossException("Network error executing HTTP request", e); + } + } + + /** + * Hosts can be booked on its days again, shortly: past entries stay. + */ + public CossHttpResponse remove(String id) { + return remove(id, RemoveHolidayCalendarsRequest.builder().build()); + } + + /** + * Hosts can be booked on its days again, shortly: past entries stay. + */ + public CossHttpResponse remove(String id, RequestOptions requestOptions) { + return remove(id, RemoveHolidayCalendarsRequest.builder().build(), requestOptions); + } + + /** + * Hosts can be booked on its days again, shortly: past entries stay. + */ + public CossHttpResponse remove(String id, RemoveHolidayCalendarsRequest request) { + return remove(id, request, null); + } + + /** + * Hosts can be booked on its days again, shortly: past entries stay. + */ + public CossHttpResponse remove( + String id, RemoveHolidayCalendarsRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("v1/scheduling/holiday_calendars") + .addPathSegment(id); + if (requestOptions != null) { + requestOptions.getQueryParameters().forEach((_key, _value) -> { + httpUrl.addQueryParameter(_key, _value); + }); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("DELETE", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + if (requestOptions != null && requestOptions.getMaxRetries().isPresent()) { + okhttpRequest = okhttpRequest + .newBuilder() + .tag( + RetryInterceptor.MaxRetriesOverride.class, + new RetryInterceptor.MaxRetriesOverride( + requestOptions.getMaxRetries().get())) + .build(); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new CossHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, DeletedSchedulingHolidayCalendar.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 500: + throw new InternalServerError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 503: + throw new ServiceUnavailableError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new CossApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (JsonProcessingException e) { + throw new CossException("Failed to deserialize response: " + e.getMessage(), e); + } catch (IOException e) { + throw new CossException("Network error executing HTTP request", e); + } + } + + /** + * Who it applies to, who covers and what happens to bookings. Takes effect shortly. + */ + public CossHttpResponse update(String id) { + return update(id, UpdateSchedulingHolidayCalendarRequest.builder().build()); + } + + /** + * Who it applies to, who covers and what happens to bookings. Takes effect shortly. + */ + public CossHttpResponse update(String id, RequestOptions requestOptions) { + return update(id, UpdateSchedulingHolidayCalendarRequest.builder().build(), requestOptions); + } + + /** + * Who it applies to, who covers and what happens to bookings. Takes effect shortly. + */ + public CossHttpResponse update( + String id, UpdateSchedulingHolidayCalendarRequest request) { + return update(id, request, null); + } + + /** + * Who it applies to, who covers and what happens to bookings. Takes effect shortly. + */ + public CossHttpResponse update( + String id, UpdateSchedulingHolidayCalendarRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("v1/scheduling/holiday_calendars") + .addPathSegment(id); + if (requestOptions != null) { + requestOptions.getQueryParameters().forEach((_key, _value) -> { + httpUrl.addQueryParameter(_key, _value); + }); + } + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new CossException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl.build()) + .method("PATCH", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + if (requestOptions != null && requestOptions.getMaxRetries().isPresent()) { + okhttpRequest = okhttpRequest + .newBuilder() + .tag( + RetryInterceptor.MaxRetriesOverride.class, + new RetryInterceptor.MaxRetriesOverride( + requestOptions.getMaxRetries().get())) + .build(); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new CossHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, SchedulingHolidayCalendar.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 415: + throw new UnsupportedMediaTypeError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 422: + throw new UnprocessableEntityError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 500: + throw new InternalServerError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 503: + throw new ServiceUnavailableError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new CossApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (JsonProcessingException e) { + throw new CossException("Failed to deserialize response: " + e.getMessage(), e); + } catch (IOException e) { + throw new CossException("Network error executing HTTP request", e); + } + } + + /** + * What's coming, with names, as last read. Empty until its first read. + */ + public CossHttpResponse holidays(String id) { + return holidays(id, HolidaysHolidayCalendarsRequest.builder().build()); + } + + /** + * What's coming, with names, as last read. Empty until its first read. + */ + public CossHttpResponse holidays(String id, RequestOptions requestOptions) { + return holidays(id, HolidaysHolidayCalendarsRequest.builder().build(), requestOptions); + } + + /** + * What's coming, with names, as last read. Empty until its first read. + */ + public CossHttpResponse holidays(String id, HolidaysHolidayCalendarsRequest request) { + return holidays(id, request, null); + } + + /** + * What's coming, with names, as last read. Empty until its first read. + */ + public CossHttpResponse holidays( + String id, HolidaysHolidayCalendarsRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("v1/scheduling/holiday_calendars") + .addPathSegment(id) + .addPathSegments("holidays"); + if (requestOptions != null) { + requestOptions.getQueryParameters().forEach((_key, _value) -> { + httpUrl.addQueryParameter(_key, _value); + }); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + if (requestOptions != null && requestOptions.getMaxRetries().isPresent()) { + okhttpRequest = okhttpRequest + .newBuilder() + .tag( + RetryInterceptor.MaxRetriesOverride.class, + new RetryInterceptor.MaxRetriesOverride( + requestOptions.getMaxRetries().get())) + .build(); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new CossHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, SchedulingHolidayList.class), response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 500: + throw new InternalServerError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 503: + throw new ServiceUnavailableError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new CossApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (JsonProcessingException e) { + throw new CossException("Failed to deserialize response: " + e.getMessage(), e); + } catch (IOException e) { + throw new CossException("Network error executing HTTP request", e); + } + } +} diff --git a/sdks/java/src/main/java/com/coss/resources/scheduling/holidaycalendars/requests/CreateSchedulingHolidayCalendarRequest.java b/sdks/java/src/main/java/com/coss/resources/scheduling/holidaycalendars/requests/CreateSchedulingHolidayCalendarRequest.java new file mode 100644 index 000000000..518bbd845 --- /dev/null +++ b/sdks/java/src/main/java/com/coss/resources/scheduling/holidaycalendars/requests/CreateSchedulingHolidayCalendarRequest.java @@ -0,0 +1,447 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.coss.resources.scheduling.holidaycalendars.requests; + +import com.coss.core.ObjectMappers; +import com.coss.resources.scheduling.holidaycalendars.types.CreateSchedulingHolidayCalendarRequestExistingBookings; +import com.coss.resources.scheduling.holidaycalendars.types.CreateSchedulingHolidayCalendarRequestHostFilterValue; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateSchedulingHolidayCalendarRequest.Builder.class) +public final class CreateSchedulingHolidayCalendarRequest { + private final String name; + + private final Optional country; + + private final Optional icsUrl; + + private final Optional> hosts; + + private final Optional> hostFilter; + + private final Optional> regions; + + private final Optional> delegates; + + private final Optional existingBookings; + + private final Map additionalProperties; + + private CreateSchedulingHolidayCalendarRequest( + String name, + Optional country, + Optional icsUrl, + Optional> hosts, + Optional> hostFilter, + Optional> regions, + Optional> delegates, + Optional existingBookings, + Map additionalProperties) { + this.name = name; + this.country = country; + this.icsUrl = icsUrl; + this.hosts = hosts; + this.hostFilter = hostFilter; + this.regions = regions; + this.delegates = delegates; + this.existingBookings = existingBookings; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("name") + public String getName() { + return name; + } + + /** + * @return A code from the list of holiday calendars, such as GB. + */ + @JsonProperty("country") + public Optional getCountry() { + return country; + } + + /** + * @return Your own feed, https or webcal, read in live environments. Stored encrypted. + */ + @JsonProperty("ics_url") + public Optional getIcsUrl() { + return icsUrl; + } + + /** + * @return These hosts, by id or uid. + */ + @JsonProperty("hosts") + public Optional> getHosts() { + return hosts; + } + + /** + * @return Everyone matching these attributes, asked again at every sync. + */ + @JsonProperty("host_filter") + public Optional> getHostFilter() { + return hostFilter; + } + + /** + * @return Which regional holidays apply, matched against how the calendar names them, such as England. Without this, all of them do; empty, only nationwide ones. + */ + @JsonProperty("regions") + public Optional> getRegions() { + return regions; + } + + /** + * @return Who can be booked in their place on those days, by id or uid, in order. + */ + @JsonProperty("delegates") + public Optional> getDelegates() { + return delegates; + } + + /** + * @return What happens to bookings already on a holiday. leave (the default) only reports them. reassign moves them. + */ + @JsonProperty("existing_bookings") + public Optional getExistingBookings() { + return existingBookings; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateSchedulingHolidayCalendarRequest + && equalTo((CreateSchedulingHolidayCalendarRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateSchedulingHolidayCalendarRequest other) { + return name.equals(other.name) + && country.equals(other.country) + && icsUrl.equals(other.icsUrl) + && hosts.equals(other.hosts) + && hostFilter.equals(other.hostFilter) + && regions.equals(other.regions) + && delegates.equals(other.delegates) + && existingBookings.equals(other.existingBookings); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.name, + this.country, + this.icsUrl, + this.hosts, + this.hostFilter, + this.regions, + this.delegates, + this.existingBookings); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static NameStage builder() { + return new Builder(); + } + + public interface NameStage { + _FinalStage name(@NotNull String name); + + Builder from(CreateSchedulingHolidayCalendarRequest other); + } + + public interface _FinalStage { + CreateSchedulingHolidayCalendarRequest build(); + + _FinalStage additionalProperty(String key, Object value); + + _FinalStage additionalProperties(Map additionalProperties); + + /** + *

A code from the list of holiday calendars, such as GB.

+ */ + _FinalStage country(Optional country); + + _FinalStage country(String country); + + /** + *

Your own feed, https or webcal, read in live environments. Stored encrypted.

+ */ + _FinalStage icsUrl(Optional icsUrl); + + _FinalStage icsUrl(String icsUrl); + + /** + *

These hosts, by id or uid.

+ */ + _FinalStage hosts(Optional> hosts); + + _FinalStage hosts(List hosts); + + /** + *

Everyone matching these attributes, asked again at every sync.

+ */ + _FinalStage hostFilter(Optional> hostFilter); + + _FinalStage hostFilter(Map hostFilter); + + /** + *

Which regional holidays apply, matched against how the calendar names them, such as England. Without this, all of them do; empty, only nationwide ones.

+ */ + _FinalStage regions(Optional> regions); + + _FinalStage regions(List regions); + + /** + *

Who can be booked in their place on those days, by id or uid, in order.

+ */ + _FinalStage delegates(Optional> delegates); + + _FinalStage delegates(List delegates); + + /** + *

What happens to bookings already on a holiday. leave (the default) only reports them. reassign moves them.

+ */ + _FinalStage existingBookings(Optional existingBookings); + + _FinalStage existingBookings(CreateSchedulingHolidayCalendarRequestExistingBookings existingBookings); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements NameStage, _FinalStage { + private String name; + + private Optional existingBookings = Optional.empty(); + + private Optional> delegates = Optional.empty(); + + private Optional> regions = Optional.empty(); + + private Optional> hostFilter = + Optional.empty(); + + private Optional> hosts = Optional.empty(); + + private Optional icsUrl = Optional.empty(); + + private Optional country = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(CreateSchedulingHolidayCalendarRequest other) { + name(other.getName()); + country(other.getCountry()); + icsUrl(other.getIcsUrl()); + hosts(other.getHosts()); + hostFilter(other.getHostFilter()); + regions(other.getRegions()); + delegates(other.getDelegates()); + existingBookings(other.getExistingBookings()); + return this; + } + + @java.lang.Override + @JsonSetter("name") + public _FinalStage name(@NotNull String name) { + this.name = Objects.requireNonNull(name, "name must not be null"); + return this; + } + + /** + *

What happens to bookings already on a holiday. leave (the default) only reports them. reassign moves them.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage existingBookings(CreateSchedulingHolidayCalendarRequestExistingBookings existingBookings) { + this.existingBookings = Optional.ofNullable(existingBookings); + return this; + } + + /** + *

What happens to bookings already on a holiday. leave (the default) only reports them. reassign moves them.

+ */ + @java.lang.Override + @JsonSetter(value = "existing_bookings", nulls = Nulls.SKIP) + public _FinalStage existingBookings( + Optional existingBookings) { + this.existingBookings = existingBookings; + return this; + } + + /** + *

Who can be booked in their place on those days, by id or uid, in order.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage delegates(List delegates) { + this.delegates = Optional.ofNullable(delegates); + return this; + } + + /** + *

Who can be booked in their place on those days, by id or uid, in order.

+ */ + @java.lang.Override + @JsonSetter(value = "delegates", nulls = Nulls.SKIP) + public _FinalStage delegates(Optional> delegates) { + this.delegates = delegates; + return this; + } + + /** + *

Which regional holidays apply, matched against how the calendar names them, such as England. Without this, all of them do; empty, only nationwide ones.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage regions(List regions) { + this.regions = Optional.ofNullable(regions); + return this; + } + + /** + *

Which regional holidays apply, matched against how the calendar names them, such as England. Without this, all of them do; empty, only nationwide ones.

+ */ + @java.lang.Override + @JsonSetter(value = "regions", nulls = Nulls.SKIP) + public _FinalStage regions(Optional> regions) { + this.regions = regions; + return this; + } + + /** + *

Everyone matching these attributes, asked again at every sync.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage hostFilter(Map hostFilter) { + this.hostFilter = Optional.ofNullable(hostFilter); + return this; + } + + /** + *

Everyone matching these attributes, asked again at every sync.

+ */ + @java.lang.Override + @JsonSetter(value = "host_filter", nulls = Nulls.SKIP) + public _FinalStage hostFilter( + Optional> hostFilter) { + this.hostFilter = hostFilter; + return this; + } + + /** + *

These hosts, by id or uid.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage hosts(List hosts) { + this.hosts = Optional.ofNullable(hosts); + return this; + } + + /** + *

These hosts, by id or uid.

+ */ + @java.lang.Override + @JsonSetter(value = "hosts", nulls = Nulls.SKIP) + public _FinalStage hosts(Optional> hosts) { + this.hosts = hosts; + return this; + } + + /** + *

Your own feed, https or webcal, read in live environments. Stored encrypted.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage icsUrl(String icsUrl) { + this.icsUrl = Optional.ofNullable(icsUrl); + return this; + } + + /** + *

Your own feed, https or webcal, read in live environments. Stored encrypted.

+ */ + @java.lang.Override + @JsonSetter(value = "ics_url", nulls = Nulls.SKIP) + public _FinalStage icsUrl(Optional icsUrl) { + this.icsUrl = icsUrl; + return this; + } + + /** + *

A code from the list of holiday calendars, such as GB.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage country(String country) { + this.country = Optional.ofNullable(country); + return this; + } + + /** + *

A code from the list of holiday calendars, such as GB.

+ */ + @java.lang.Override + @JsonSetter(value = "country", nulls = Nulls.SKIP) + public _FinalStage country(Optional country) { + this.country = country; + return this; + } + + @java.lang.Override + public CreateSchedulingHolidayCalendarRequest build() { + return new CreateSchedulingHolidayCalendarRequest( + name, + country, + icsUrl, + hosts, + hostFilter, + regions, + delegates, + existingBookings, + additionalProperties); + } + + @java.lang.Override + public Builder additionalProperty(String key, Object value) { + this.additionalProperties.put(key, value); + return this; + } + + @java.lang.Override + public Builder additionalProperties(Map additionalProperties) { + this.additionalProperties.putAll(additionalProperties); + return this; + } + } +} diff --git a/sdks/java/src/main/java/com/coss/resources/scheduling/holidaycalendars/requests/GetHolidayCalendarsRequest.java b/sdks/java/src/main/java/com/coss/resources/scheduling/holidaycalendars/requests/GetHolidayCalendarsRequest.java new file mode 100644 index 000000000..a4500229d --- /dev/null +++ b/sdks/java/src/main/java/com/coss/resources/scheduling/holidaycalendars/requests/GetHolidayCalendarsRequest.java @@ -0,0 +1,69 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.coss.resources.scheduling.holidaycalendars.requests; + +import com.coss.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = GetHolidayCalendarsRequest.Builder.class) +public final class GetHolidayCalendarsRequest { + private final Map additionalProperties; + + private GetHolidayCalendarsRequest(Map additionalProperties) { + this.additionalProperties = additionalProperties; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof GetHolidayCalendarsRequest; + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(GetHolidayCalendarsRequest other) { + return this; + } + + public GetHolidayCalendarsRequest build() { + return new GetHolidayCalendarsRequest(additionalProperties); + } + + public Builder additionalProperty(String key, Object value) { + this.additionalProperties.put(key, value); + return this; + } + + public Builder additionalProperties(Map additionalProperties) { + this.additionalProperties.putAll(additionalProperties); + return this; + } + } +} diff --git a/sdks/java/src/main/java/com/coss/resources/scheduling/holidaycalendars/requests/HolidaysHolidayCalendarsRequest.java b/sdks/java/src/main/java/com/coss/resources/scheduling/holidaycalendars/requests/HolidaysHolidayCalendarsRequest.java new file mode 100644 index 000000000..1fb26ecc1 --- /dev/null +++ b/sdks/java/src/main/java/com/coss/resources/scheduling/holidaycalendars/requests/HolidaysHolidayCalendarsRequest.java @@ -0,0 +1,69 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.coss.resources.scheduling.holidaycalendars.requests; + +import com.coss.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = HolidaysHolidayCalendarsRequest.Builder.class) +public final class HolidaysHolidayCalendarsRequest { + private final Map additionalProperties; + + private HolidaysHolidayCalendarsRequest(Map additionalProperties) { + this.additionalProperties = additionalProperties; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof HolidaysHolidayCalendarsRequest; + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(HolidaysHolidayCalendarsRequest other) { + return this; + } + + public HolidaysHolidayCalendarsRequest build() { + return new HolidaysHolidayCalendarsRequest(additionalProperties); + } + + public Builder additionalProperty(String key, Object value) { + this.additionalProperties.put(key, value); + return this; + } + + public Builder additionalProperties(Map additionalProperties) { + this.additionalProperties.putAll(additionalProperties); + return this; + } + } +} diff --git a/sdks/java/src/main/java/com/coss/resources/scheduling/holidaycalendars/requests/RemoveHolidayCalendarsRequest.java b/sdks/java/src/main/java/com/coss/resources/scheduling/holidaycalendars/requests/RemoveHolidayCalendarsRequest.java new file mode 100644 index 000000000..66488b5f3 --- /dev/null +++ b/sdks/java/src/main/java/com/coss/resources/scheduling/holidaycalendars/requests/RemoveHolidayCalendarsRequest.java @@ -0,0 +1,69 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.coss.resources.scheduling.holidaycalendars.requests; + +import com.coss.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = RemoveHolidayCalendarsRequest.Builder.class) +public final class RemoveHolidayCalendarsRequest { + private final Map additionalProperties; + + private RemoveHolidayCalendarsRequest(Map additionalProperties) { + this.additionalProperties = additionalProperties; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof RemoveHolidayCalendarsRequest; + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(RemoveHolidayCalendarsRequest other) { + return this; + } + + public RemoveHolidayCalendarsRequest build() { + return new RemoveHolidayCalendarsRequest(additionalProperties); + } + + public Builder additionalProperty(String key, Object value) { + this.additionalProperties.put(key, value); + return this; + } + + public Builder additionalProperties(Map additionalProperties) { + this.additionalProperties.putAll(additionalProperties); + return this; + } + } +} diff --git a/sdks/java/src/main/java/com/coss/resources/scheduling/holidaycalendars/requests/UpdateSchedulingHolidayCalendarRequest.java b/sdks/java/src/main/java/com/coss/resources/scheduling/holidaycalendars/requests/UpdateSchedulingHolidayCalendarRequest.java new file mode 100644 index 000000000..01404269c --- /dev/null +++ b/sdks/java/src/main/java/com/coss/resources/scheduling/holidaycalendars/requests/UpdateSchedulingHolidayCalendarRequest.java @@ -0,0 +1,266 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.coss.resources.scheduling.holidaycalendars.requests; + +import com.coss.core.ObjectMappers; +import com.coss.resources.scheduling.holidaycalendars.types.UpdateSchedulingHolidayCalendarRequestExistingBookings; +import com.coss.resources.scheduling.holidaycalendars.types.UpdateSchedulingHolidayCalendarRequestHostFilterValue; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = UpdateSchedulingHolidayCalendarRequest.Builder.class) +public final class UpdateSchedulingHolidayCalendarRequest { + private final Optional name; + + private final Optional> hosts; + + private final Optional> hostFilter; + + private final Optional> regions; + + private final Optional> delegates; + + private final Optional existingBookings; + + private final Map additionalProperties; + + private UpdateSchedulingHolidayCalendarRequest( + Optional name, + Optional> hosts, + Optional> hostFilter, + Optional> regions, + Optional> delegates, + Optional existingBookings, + Map additionalProperties) { + this.name = name; + this.hosts = hosts; + this.hostFilter = hostFilter; + this.regions = regions; + this.delegates = delegates; + this.existingBookings = existingBookings; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("name") + public Optional getName() { + return name; + } + + /** + * @return These hosts, by id or uid. + */ + @JsonProperty("hosts") + public Optional> getHosts() { + return hosts; + } + + /** + * @return Everyone matching these attributes, asked again at every sync. + */ + @JsonProperty("host_filter") + public Optional> getHostFilter() { + return hostFilter; + } + + /** + * @return Which regional holidays apply, matched against how the calendar names them, such as England. Without this, all of them do; empty, only nationwide ones. + */ + @JsonProperty("regions") + public Optional> getRegions() { + return regions; + } + + /** + * @return Who can be booked in their place on those days, by id or uid, in order. + */ + @JsonProperty("delegates") + public Optional> getDelegates() { + return delegates; + } + + /** + * @return What happens to bookings already on a holiday. leave (the default) only reports them. reassign moves them. + */ + @JsonProperty("existing_bookings") + public Optional getExistingBookings() { + return existingBookings; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UpdateSchedulingHolidayCalendarRequest + && equalTo((UpdateSchedulingHolidayCalendarRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UpdateSchedulingHolidayCalendarRequest other) { + return name.equals(other.name) + && hosts.equals(other.hosts) + && hostFilter.equals(other.hostFilter) + && regions.equals(other.regions) + && delegates.equals(other.delegates) + && existingBookings.equals(other.existingBookings); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.name, this.hosts, this.hostFilter, this.regions, this.delegates, this.existingBookings); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional name = Optional.empty(); + + private Optional> hosts = Optional.empty(); + + private Optional> hostFilter = + Optional.empty(); + + private Optional> regions = Optional.empty(); + + private Optional> delegates = Optional.empty(); + + private Optional existingBookings = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(UpdateSchedulingHolidayCalendarRequest other) { + name(other.getName()); + hosts(other.getHosts()); + hostFilter(other.getHostFilter()); + regions(other.getRegions()); + delegates(other.getDelegates()); + existingBookings(other.getExistingBookings()); + return this; + } + + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + /** + *

These hosts, by id or uid.

+ */ + @JsonSetter(value = "hosts", nulls = Nulls.SKIP) + public Builder hosts(Optional> hosts) { + this.hosts = hosts; + return this; + } + + public Builder hosts(List hosts) { + this.hosts = Optional.ofNullable(hosts); + return this; + } + + /** + *

Everyone matching these attributes, asked again at every sync.

+ */ + @JsonSetter(value = "host_filter", nulls = Nulls.SKIP) + public Builder hostFilter( + Optional> hostFilter) { + this.hostFilter = hostFilter; + return this; + } + + public Builder hostFilter(Map hostFilter) { + this.hostFilter = Optional.ofNullable(hostFilter); + return this; + } + + /** + *

Which regional holidays apply, matched against how the calendar names them, such as England. Without this, all of them do; empty, only nationwide ones.

+ */ + @JsonSetter(value = "regions", nulls = Nulls.SKIP) + public Builder regions(Optional> regions) { + this.regions = regions; + return this; + } + + public Builder regions(List regions) { + this.regions = Optional.ofNullable(regions); + return this; + } + + /** + *

Who can be booked in their place on those days, by id or uid, in order.

+ */ + @JsonSetter(value = "delegates", nulls = Nulls.SKIP) + public Builder delegates(Optional> delegates) { + this.delegates = delegates; + return this; + } + + public Builder delegates(List delegates) { + this.delegates = Optional.ofNullable(delegates); + return this; + } + + /** + *

What happens to bookings already on a holiday. leave (the default) only reports them. reassign moves them.

+ */ + @JsonSetter(value = "existing_bookings", nulls = Nulls.SKIP) + public Builder existingBookings( + Optional existingBookings) { + this.existingBookings = existingBookings; + return this; + } + + public Builder existingBookings(UpdateSchedulingHolidayCalendarRequestExistingBookings existingBookings) { + this.existingBookings = Optional.ofNullable(existingBookings); + return this; + } + + public UpdateSchedulingHolidayCalendarRequest build() { + return new UpdateSchedulingHolidayCalendarRequest( + name, hosts, hostFilter, regions, delegates, existingBookings, additionalProperties); + } + + public Builder additionalProperty(String key, Object value) { + this.additionalProperties.put(key, value); + return this; + } + + public Builder additionalProperties(Map additionalProperties) { + this.additionalProperties.putAll(additionalProperties); + return this; + } + } +} diff --git a/sdks/java/src/main/java/com/coss/resources/scheduling/holidaycalendars/types/CreateSchedulingHolidayCalendarRequestExistingBookings.java b/sdks/java/src/main/java/com/coss/resources/scheduling/holidaycalendars/types/CreateSchedulingHolidayCalendarRequestExistingBookings.java new file mode 100644 index 000000000..14b48de59 --- /dev/null +++ b/sdks/java/src/main/java/com/coss/resources/scheduling/holidaycalendars/types/CreateSchedulingHolidayCalendarRequestExistingBookings.java @@ -0,0 +1,86 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.coss.resources.scheduling.holidaycalendars.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class CreateSchedulingHolidayCalendarRequestExistingBookings { + public static final CreateSchedulingHolidayCalendarRequestExistingBookings REASSIGN = + new CreateSchedulingHolidayCalendarRequestExistingBookings(Value.REASSIGN, "reassign"); + + public static final CreateSchedulingHolidayCalendarRequestExistingBookings LEAVE = + new CreateSchedulingHolidayCalendarRequestExistingBookings(Value.LEAVE, "leave"); + + private final Value value; + + private final String string; + + CreateSchedulingHolidayCalendarRequestExistingBookings(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof CreateSchedulingHolidayCalendarRequestExistingBookings + && this.string.equals(((CreateSchedulingHolidayCalendarRequestExistingBookings) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case REASSIGN: + return visitor.visitReassign(); + case LEAVE: + return visitor.visitLeave(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static CreateSchedulingHolidayCalendarRequestExistingBookings valueOf(String value) { + switch (value) { + case "reassign": + return REASSIGN; + case "leave": + return LEAVE; + default: + return new CreateSchedulingHolidayCalendarRequestExistingBookings(Value.UNKNOWN, value); + } + } + + public enum Value { + LEAVE, + + REASSIGN, + + UNKNOWN + } + + public interface Visitor { + T visitLeave(); + + T visitReassign(); + + T visitUnknown(String unknownType); + } +} diff --git a/sdks/java/src/main/java/com/coss/resources/scheduling/holidaycalendars/types/CreateSchedulingHolidayCalendarRequestHostFilterValue.java b/sdks/java/src/main/java/com/coss/resources/scheduling/holidaycalendars/types/CreateSchedulingHolidayCalendarRequestHostFilterValue.java new file mode 100644 index 000000000..86fef8818 --- /dev/null +++ b/sdks/java/src/main/java/com/coss/resources/scheduling/holidaycalendars/types/CreateSchedulingHolidayCalendarRequestHostFilterValue.java @@ -0,0 +1,99 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.coss.resources.scheduling.holidaycalendars.types; + +import com.coss.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import java.io.IOException; +import java.util.List; +import java.util.Objects; + +@JsonDeserialize(using = CreateSchedulingHolidayCalendarRequestHostFilterValue.Deserializer.class) +public final class CreateSchedulingHolidayCalendarRequestHostFilterValue { + private final Object value; + + private final int type; + + private CreateSchedulingHolidayCalendarRequestHostFilterValue(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((String) this.value); + } else if (this.type == 1) { + return visitor.visit((List) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateSchedulingHolidayCalendarRequestHostFilterValue + && equalTo((CreateSchedulingHolidayCalendarRequestHostFilterValue) other); + } + + private boolean equalTo(CreateSchedulingHolidayCalendarRequestHostFilterValue other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static CreateSchedulingHolidayCalendarRequestHostFilterValue of(String value) { + return new CreateSchedulingHolidayCalendarRequestHostFilterValue(value, 0); + } + + public static CreateSchedulingHolidayCalendarRequestHostFilterValue of(List value) { + return new CreateSchedulingHolidayCalendarRequestHostFilterValue(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(List value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(CreateSchedulingHolidayCalendarRequestHostFilterValue.class); + } + + @java.lang.Override + public CreateSchedulingHolidayCalendarRequestHostFilterValue deserialize( + JsonParser p, DeserializationContext context) throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, new TypeReference>() {})); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/sdks/java/src/main/java/com/coss/resources/scheduling/holidaycalendars/types/UpdateSchedulingHolidayCalendarRequestExistingBookings.java b/sdks/java/src/main/java/com/coss/resources/scheduling/holidaycalendars/types/UpdateSchedulingHolidayCalendarRequestExistingBookings.java new file mode 100644 index 000000000..d52bcdf1e --- /dev/null +++ b/sdks/java/src/main/java/com/coss/resources/scheduling/holidaycalendars/types/UpdateSchedulingHolidayCalendarRequestExistingBookings.java @@ -0,0 +1,86 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.coss.resources.scheduling.holidaycalendars.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class UpdateSchedulingHolidayCalendarRequestExistingBookings { + public static final UpdateSchedulingHolidayCalendarRequestExistingBookings REASSIGN = + new UpdateSchedulingHolidayCalendarRequestExistingBookings(Value.REASSIGN, "reassign"); + + public static final UpdateSchedulingHolidayCalendarRequestExistingBookings LEAVE = + new UpdateSchedulingHolidayCalendarRequestExistingBookings(Value.LEAVE, "leave"); + + private final Value value; + + private final String string; + + UpdateSchedulingHolidayCalendarRequestExistingBookings(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof UpdateSchedulingHolidayCalendarRequestExistingBookings + && this.string.equals(((UpdateSchedulingHolidayCalendarRequestExistingBookings) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case REASSIGN: + return visitor.visitReassign(); + case LEAVE: + return visitor.visitLeave(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static UpdateSchedulingHolidayCalendarRequestExistingBookings valueOf(String value) { + switch (value) { + case "reassign": + return REASSIGN; + case "leave": + return LEAVE; + default: + return new UpdateSchedulingHolidayCalendarRequestExistingBookings(Value.UNKNOWN, value); + } + } + + public enum Value { + LEAVE, + + REASSIGN, + + UNKNOWN + } + + public interface Visitor { + T visitLeave(); + + T visitReassign(); + + T visitUnknown(String unknownType); + } +} diff --git a/sdks/java/src/main/java/com/coss/resources/scheduling/holidaycalendars/types/UpdateSchedulingHolidayCalendarRequestHostFilterValue.java b/sdks/java/src/main/java/com/coss/resources/scheduling/holidaycalendars/types/UpdateSchedulingHolidayCalendarRequestHostFilterValue.java new file mode 100644 index 000000000..c8d3a020e --- /dev/null +++ b/sdks/java/src/main/java/com/coss/resources/scheduling/holidaycalendars/types/UpdateSchedulingHolidayCalendarRequestHostFilterValue.java @@ -0,0 +1,99 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.coss.resources.scheduling.holidaycalendars.types; + +import com.coss.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import java.io.IOException; +import java.util.List; +import java.util.Objects; + +@JsonDeserialize(using = UpdateSchedulingHolidayCalendarRequestHostFilterValue.Deserializer.class) +public final class UpdateSchedulingHolidayCalendarRequestHostFilterValue { + private final Object value; + + private final int type; + + private UpdateSchedulingHolidayCalendarRequestHostFilterValue(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((String) this.value); + } else if (this.type == 1) { + return visitor.visit((List) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UpdateSchedulingHolidayCalendarRequestHostFilterValue + && equalTo((UpdateSchedulingHolidayCalendarRequestHostFilterValue) other); + } + + private boolean equalTo(UpdateSchedulingHolidayCalendarRequestHostFilterValue other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static UpdateSchedulingHolidayCalendarRequestHostFilterValue of(String value) { + return new UpdateSchedulingHolidayCalendarRequestHostFilterValue(value, 0); + } + + public static UpdateSchedulingHolidayCalendarRequestHostFilterValue of(List value) { + return new UpdateSchedulingHolidayCalendarRequestHostFilterValue(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(List value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(UpdateSchedulingHolidayCalendarRequestHostFilterValue.class); + } + + @java.lang.Override + public UpdateSchedulingHolidayCalendarRequestHostFilterValue deserialize( + JsonParser p, DeserializationContext context) throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, new TypeReference>() {})); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/sdks/java/src/main/java/com/coss/resources/scheduling/oauthapps/AsyncOauthAppsClient.java b/sdks/java/src/main/java/com/coss/resources/scheduling/oauthapps/AsyncOauthAppsClient.java new file mode 100644 index 000000000..aef9aa2fa --- /dev/null +++ b/sdks/java/src/main/java/com/coss/resources/scheduling/oauthapps/AsyncOauthAppsClient.java @@ -0,0 +1,148 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.coss.resources.scheduling.oauthapps; + +import com.coss.core.ClientOptions; +import com.coss.core.RequestOptions; +import com.coss.resources.scheduling.oauthapps.requests.DeleteOauthAppsRequest; +import com.coss.resources.scheduling.oauthapps.requests.GetOauthAppsRequest; +import com.coss.resources.scheduling.oauthapps.requests.UpdateOauthAppRequest; +import com.coss.types.CreateOauthAppRequest; +import com.coss.types.DeletedSchedulingOauthApp; +import com.coss.types.SchedulingOauthApp; +import com.coss.types.SchedulingOauthAppList; +import java.util.concurrent.CompletableFuture; + +public class AsyncOauthAppsClient { + protected final ClientOptions clientOptions; + + private final AsyncRawOauthAppsClient rawClient; + + public AsyncOauthAppsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawOauthAppsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawOauthAppsClient withRawResponse() { + return this.rawClient; + } + + /** + * At most one per provider, with how many connections use each. + */ + public CompletableFuture list() { + return this.rawClient.list().thenApply(response -> response.body()); + } + + /** + * At most one per provider, with how many connections use each. + */ + public CompletableFuture list(RequestOptions requestOptions) { + return this.rawClient.list(requestOptions).thenApply(response -> response.body()); + } + + /** + * New consents in this environment use it, so the consent screen shows your brand. Connections made before it stay on coss.com's app until their host consents again. On the Scale plan and above. Secrets are never returned. + */ + public CompletableFuture create(CreateOauthAppRequest request) { + return this.rawClient.create(request).thenApply(response -> response.body()); + } + + /** + * New consents in this environment use it, so the consent screen shows your brand. Connections made before it stay on coss.com's app until their host consents again. On the Scale plan and above. Secrets are never returned. + */ + public CompletableFuture create(CreateOauthAppRequest request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Its status, what to register at the provider, and how many connections use it. + */ + public CompletableFuture get(String id) { + return this.rawClient.get(id).thenApply(response -> response.body()); + } + + /** + * Its status, what to register at the provider, and how many connections use it. + */ + public CompletableFuture get(String id, RequestOptions requestOptions) { + return this.rawClient.get(id, requestOptions).thenApply(response -> response.body()); + } + + /** + * Its status, what to register at the provider, and how many connections use it. + */ + public CompletableFuture get(String id, GetOauthAppsRequest request) { + return this.rawClient.get(id, request).thenApply(response -> response.body()); + } + + /** + * Its status, what to register at the provider, and how many connections use it. + */ + public CompletableFuture get( + String id, GetOauthAppsRequest request, RequestOptions requestOptions) { + return this.rawClient.get(id, request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Refused while connections use it (oauth_app_in_use), since only it can refresh their access: disconnect them first. New consents go back to coss.com's app. + */ + public CompletableFuture delete(String id) { + return this.rawClient.delete(id).thenApply(response -> response.body()); + } + + /** + * Refused while connections use it (oauth_app_in_use), since only it can refresh their access: disconnect them first. New consents go back to coss.com's app. + */ + public CompletableFuture delete(String id, RequestOptions requestOptions) { + return this.rawClient.delete(id, requestOptions).thenApply(response -> response.body()); + } + + /** + * Refused while connections use it (oauth_app_in_use), since only it can refresh their access: disconnect them first. New consents go back to coss.com's app. + */ + public CompletableFuture delete(String id, DeleteOauthAppsRequest request) { + return this.rawClient.delete(id, request).thenApply(response -> response.body()); + } + + /** + * Refused while connections use it (oauth_app_in_use), since only it can refresh their access: disconnect them first. New consents go back to coss.com's app. + */ + public CompletableFuture delete( + String id, DeleteOauthAppsRequest request, RequestOptions requestOptions) { + return this.rawClient.delete(id, request, requestOptions).thenApply(response -> response.body()); + } + + /** + * A new client secret is tried on a connection before it replaces the old one, and ends an outage if it works. Its client ID can't change: a different app needs its hosts to consent again. + */ + public CompletableFuture update(String id) { + return this.rawClient.update(id).thenApply(response -> response.body()); + } + + /** + * A new client secret is tried on a connection before it replaces the old one, and ends an outage if it works. Its client ID can't change: a different app needs its hosts to consent again. + */ + public CompletableFuture update(String id, RequestOptions requestOptions) { + return this.rawClient.update(id, requestOptions).thenApply(response -> response.body()); + } + + /** + * A new client secret is tried on a connection before it replaces the old one, and ends an outage if it works. Its client ID can't change: a different app needs its hosts to consent again. + */ + public CompletableFuture update(String id, UpdateOauthAppRequest request) { + return this.rawClient.update(id, request).thenApply(response -> response.body()); + } + + /** + * A new client secret is tried on a connection before it replaces the old one, and ends an outage if it works. Its client ID can't change: a different app needs its hosts to consent again. + */ + public CompletableFuture update( + String id, UpdateOauthAppRequest request, RequestOptions requestOptions) { + return this.rawClient.update(id, request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/sdks/java/src/main/java/com/coss/resources/scheduling/oauthapps/AsyncRawOauthAppsClient.java b/sdks/java/src/main/java/com/coss/resources/scheduling/oauthapps/AsyncRawOauthAppsClient.java new file mode 100644 index 000000000..f7fb5fceb --- /dev/null +++ b/sdks/java/src/main/java/com/coss/resources/scheduling/oauthapps/AsyncRawOauthAppsClient.java @@ -0,0 +1,692 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.coss.resources.scheduling.oauthapps; + +import com.coss.core.ClientOptions; +import com.coss.core.CossApiException; +import com.coss.core.CossException; +import com.coss.core.CossHttpResponse; +import com.coss.core.IdempotencyUtils; +import com.coss.core.MediaTypes; +import com.coss.core.ObjectMappers; +import com.coss.core.RequestOptions; +import com.coss.core.RetryInterceptor; +import com.coss.errors.BadRequestError; +import com.coss.errors.ForbiddenError; +import com.coss.errors.InternalServerError; +import com.coss.errors.NotFoundError; +import com.coss.errors.PaymentRequiredError; +import com.coss.errors.ServiceUnavailableError; +import com.coss.errors.TooManyRequestsError; +import com.coss.errors.UnauthorizedError; +import com.coss.errors.UnprocessableEntityError; +import com.coss.errors.UnsupportedMediaTypeError; +import com.coss.resources.scheduling.oauthapps.requests.DeleteOauthAppsRequest; +import com.coss.resources.scheduling.oauthapps.requests.GetOauthAppsRequest; +import com.coss.resources.scheduling.oauthapps.requests.UpdateOauthAppRequest; +import com.coss.types.CreateOauthAppRequest; +import com.coss.types.DeletedSchedulingOauthApp; +import com.coss.types.Error; +import com.coss.types.SchedulingOauthApp; +import com.coss.types.SchedulingOauthAppList; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.io.IOException; +import java.util.concurrent.CompletableFuture; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawOauthAppsClient { + protected final ClientOptions clientOptions; + + public AsyncRawOauthAppsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * At most one per provider, with how many connections use each. + */ + public CompletableFuture> list() { + return list(null); + } + + /** + * At most one per provider, with how many connections use each. + */ + public CompletableFuture> list(RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("v1/scheduling/oauth_apps"); + if (requestOptions != null) { + requestOptions.getQueryParameters().forEach((_key, _value) -> { + httpUrl.addQueryParameter(_key, _value); + }); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + if (requestOptions != null && requestOptions.getMaxRetries().isPresent()) { + okhttpRequest = okhttpRequest + .newBuilder() + .tag( + RetryInterceptor.MaxRetriesOverride.class, + new RetryInterceptor.MaxRetriesOverride( + requestOptions.getMaxRetries().get())) + .build(); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new CossHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, SchedulingOauthAppList.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 500: + future.completeExceptionally(new InternalServerError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 503: + future.completeExceptionally(new ServiceUnavailableError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new CossApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (JsonProcessingException e) { + future.completeExceptionally( + new CossException("Failed to deserialize response: " + e.getMessage(), e)); + } catch (IOException e) { + future.completeExceptionally(new CossException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new CossException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * New consents in this environment use it, so the consent screen shows your brand. Connections made before it stay on coss.com's app until their host consents again. On the Scale plan and above. Secrets are never returned. + */ + public CompletableFuture> create(CreateOauthAppRequest request) { + return create(request, null); + } + + /** + * New consents in this environment use it, so the consent screen shows your brand. Connections made before it stay on coss.com's app until their host consents again. On the Scale plan and above. Secrets are never returned. + */ + public CompletableFuture> create( + CreateOauthAppRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("v1/scheduling/oauth_apps"); + if (requestOptions != null) { + requestOptions.getQueryParameters().forEach((_key, _value) -> { + httpUrl.addQueryParameter(_key, _value); + }); + } + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new CossException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl.build()) + .method("POST", body) + .headers(Headers.of(IdempotencyUtils.withGeneratedIdempotencyKey( + clientOptions.headers(requestOptions), "Idempotency-Key"))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + okhttpRequest = okhttpRequest + .newBuilder() + .tag(RetryInterceptor.MaxRetriesOverride.class, new RetryInterceptor.MaxRetriesOverride(0)) + .build(); + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new CossHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, SchedulingOauthApp.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 402: + future.completeExceptionally(new PaymentRequiredError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 415: + future.completeExceptionally(new UnsupportedMediaTypeError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 422: + future.completeExceptionally(new UnprocessableEntityError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 500: + future.completeExceptionally(new InternalServerError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 503: + future.completeExceptionally(new ServiceUnavailableError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new CossApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (JsonProcessingException e) { + future.completeExceptionally( + new CossException("Failed to deserialize response: " + e.getMessage(), e)); + } catch (IOException e) { + future.completeExceptionally(new CossException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new CossException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Its status, what to register at the provider, and how many connections use it. + */ + public CompletableFuture> get(String id) { + return get(id, GetOauthAppsRequest.builder().build()); + } + + /** + * Its status, what to register at the provider, and how many connections use it. + */ + public CompletableFuture> get(String id, RequestOptions requestOptions) { + return get(id, GetOauthAppsRequest.builder().build(), requestOptions); + } + + /** + * Its status, what to register at the provider, and how many connections use it. + */ + public CompletableFuture> get(String id, GetOauthAppsRequest request) { + return get(id, request, null); + } + + /** + * Its status, what to register at the provider, and how many connections use it. + */ + public CompletableFuture> get( + String id, GetOauthAppsRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("v1/scheduling/oauth_apps") + .addPathSegment(id); + if (requestOptions != null) { + requestOptions.getQueryParameters().forEach((_key, _value) -> { + httpUrl.addQueryParameter(_key, _value); + }); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + if (requestOptions != null && requestOptions.getMaxRetries().isPresent()) { + okhttpRequest = okhttpRequest + .newBuilder() + .tag( + RetryInterceptor.MaxRetriesOverride.class, + new RetryInterceptor.MaxRetriesOverride( + requestOptions.getMaxRetries().get())) + .build(); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new CossHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, SchedulingOauthApp.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 500: + future.completeExceptionally(new InternalServerError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 503: + future.completeExceptionally(new ServiceUnavailableError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new CossApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (JsonProcessingException e) { + future.completeExceptionally( + new CossException("Failed to deserialize response: " + e.getMessage(), e)); + } catch (IOException e) { + future.completeExceptionally(new CossException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new CossException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Refused while connections use it (oauth_app_in_use), since only it can refresh their access: disconnect them first. New consents go back to coss.com's app. + */ + public CompletableFuture> delete(String id) { + return delete(id, DeleteOauthAppsRequest.builder().build()); + } + + /** + * Refused while connections use it (oauth_app_in_use), since only it can refresh their access: disconnect them first. New consents go back to coss.com's app. + */ + public CompletableFuture> delete( + String id, RequestOptions requestOptions) { + return delete(id, DeleteOauthAppsRequest.builder().build(), requestOptions); + } + + /** + * Refused while connections use it (oauth_app_in_use), since only it can refresh their access: disconnect them first. New consents go back to coss.com's app. + */ + public CompletableFuture> delete( + String id, DeleteOauthAppsRequest request) { + return delete(id, request, null); + } + + /** + * Refused while connections use it (oauth_app_in_use), since only it can refresh their access: disconnect them first. New consents go back to coss.com's app. + */ + public CompletableFuture> delete( + String id, DeleteOauthAppsRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("v1/scheduling/oauth_apps") + .addPathSegment(id); + if (requestOptions != null) { + requestOptions.getQueryParameters().forEach((_key, _value) -> { + httpUrl.addQueryParameter(_key, _value); + }); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("DELETE", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + if (requestOptions != null && requestOptions.getMaxRetries().isPresent()) { + okhttpRequest = okhttpRequest + .newBuilder() + .tag( + RetryInterceptor.MaxRetriesOverride.class, + new RetryInterceptor.MaxRetriesOverride( + requestOptions.getMaxRetries().get())) + .build(); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new CossHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, DeletedSchedulingOauthApp.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 422: + future.completeExceptionally(new UnprocessableEntityError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 500: + future.completeExceptionally(new InternalServerError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 503: + future.completeExceptionally(new ServiceUnavailableError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new CossApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (JsonProcessingException e) { + future.completeExceptionally( + new CossException("Failed to deserialize response: " + e.getMessage(), e)); + } catch (IOException e) { + future.completeExceptionally(new CossException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new CossException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * A new client secret is tried on a connection before it replaces the old one, and ends an outage if it works. Its client ID can't change: a different app needs its hosts to consent again. + */ + public CompletableFuture> update(String id) { + return update(id, UpdateOauthAppRequest.builder().build()); + } + + /** + * A new client secret is tried on a connection before it replaces the old one, and ends an outage if it works. Its client ID can't change: a different app needs its hosts to consent again. + */ + public CompletableFuture> update(String id, RequestOptions requestOptions) { + return update(id, UpdateOauthAppRequest.builder().build(), requestOptions); + } + + /** + * A new client secret is tried on a connection before it replaces the old one, and ends an outage if it works. Its client ID can't change: a different app needs its hosts to consent again. + */ + public CompletableFuture> update(String id, UpdateOauthAppRequest request) { + return update(id, request, null); + } + + /** + * A new client secret is tried on a connection before it replaces the old one, and ends an outage if it works. Its client ID can't change: a different app needs its hosts to consent again. + */ + public CompletableFuture> update( + String id, UpdateOauthAppRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("v1/scheduling/oauth_apps") + .addPathSegment(id); + if (requestOptions != null) { + requestOptions.getQueryParameters().forEach((_key, _value) -> { + httpUrl.addQueryParameter(_key, _value); + }); + } + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new CossException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl.build()) + .method("PATCH", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + if (requestOptions != null && requestOptions.getMaxRetries().isPresent()) { + okhttpRequest = okhttpRequest + .newBuilder() + .tag( + RetryInterceptor.MaxRetriesOverride.class, + new RetryInterceptor.MaxRetriesOverride( + requestOptions.getMaxRetries().get())) + .build(); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new CossHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, SchedulingOauthApp.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 415: + future.completeExceptionally(new UnsupportedMediaTypeError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 422: + future.completeExceptionally(new UnprocessableEntityError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 500: + future.completeExceptionally(new InternalServerError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 503: + future.completeExceptionally(new ServiceUnavailableError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new CossApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (JsonProcessingException e) { + future.completeExceptionally( + new CossException("Failed to deserialize response: " + e.getMessage(), e)); + } catch (IOException e) { + future.completeExceptionally(new CossException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new CossException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/sdks/java/src/main/java/com/coss/resources/scheduling/oauthapps/OauthAppsClient.java b/sdks/java/src/main/java/com/coss/resources/scheduling/oauthapps/OauthAppsClient.java new file mode 100644 index 000000000..17cd4937c --- /dev/null +++ b/sdks/java/src/main/java/com/coss/resources/scheduling/oauthapps/OauthAppsClient.java @@ -0,0 +1,144 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.coss.resources.scheduling.oauthapps; + +import com.coss.core.ClientOptions; +import com.coss.core.RequestOptions; +import com.coss.resources.scheduling.oauthapps.requests.DeleteOauthAppsRequest; +import com.coss.resources.scheduling.oauthapps.requests.GetOauthAppsRequest; +import com.coss.resources.scheduling.oauthapps.requests.UpdateOauthAppRequest; +import com.coss.types.CreateOauthAppRequest; +import com.coss.types.DeletedSchedulingOauthApp; +import com.coss.types.SchedulingOauthApp; +import com.coss.types.SchedulingOauthAppList; + +public class OauthAppsClient { + protected final ClientOptions clientOptions; + + private final RawOauthAppsClient rawClient; + + public OauthAppsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawOauthAppsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawOauthAppsClient withRawResponse() { + return this.rawClient; + } + + /** + * At most one per provider, with how many connections use each. + */ + public SchedulingOauthAppList list() { + return this.rawClient.list().body(); + } + + /** + * At most one per provider, with how many connections use each. + */ + public SchedulingOauthAppList list(RequestOptions requestOptions) { + return this.rawClient.list(requestOptions).body(); + } + + /** + * New consents in this environment use it, so the consent screen shows your brand. Connections made before it stay on coss.com's app until their host consents again. On the Scale plan and above. Secrets are never returned. + */ + public SchedulingOauthApp create(CreateOauthAppRequest request) { + return this.rawClient.create(request).body(); + } + + /** + * New consents in this environment use it, so the consent screen shows your brand. Connections made before it stay on coss.com's app until their host consents again. On the Scale plan and above. Secrets are never returned. + */ + public SchedulingOauthApp create(CreateOauthAppRequest request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).body(); + } + + /** + * Its status, what to register at the provider, and how many connections use it. + */ + public SchedulingOauthApp get(String id) { + return this.rawClient.get(id).body(); + } + + /** + * Its status, what to register at the provider, and how many connections use it. + */ + public SchedulingOauthApp get(String id, RequestOptions requestOptions) { + return this.rawClient.get(id, requestOptions).body(); + } + + /** + * Its status, what to register at the provider, and how many connections use it. + */ + public SchedulingOauthApp get(String id, GetOauthAppsRequest request) { + return this.rawClient.get(id, request).body(); + } + + /** + * Its status, what to register at the provider, and how many connections use it. + */ + public SchedulingOauthApp get(String id, GetOauthAppsRequest request, RequestOptions requestOptions) { + return this.rawClient.get(id, request, requestOptions).body(); + } + + /** + * Refused while connections use it (oauth_app_in_use), since only it can refresh their access: disconnect them first. New consents go back to coss.com's app. + */ + public DeletedSchedulingOauthApp delete(String id) { + return this.rawClient.delete(id).body(); + } + + /** + * Refused while connections use it (oauth_app_in_use), since only it can refresh their access: disconnect them first. New consents go back to coss.com's app. + */ + public DeletedSchedulingOauthApp delete(String id, RequestOptions requestOptions) { + return this.rawClient.delete(id, requestOptions).body(); + } + + /** + * Refused while connections use it (oauth_app_in_use), since only it can refresh their access: disconnect them first. New consents go back to coss.com's app. + */ + public DeletedSchedulingOauthApp delete(String id, DeleteOauthAppsRequest request) { + return this.rawClient.delete(id, request).body(); + } + + /** + * Refused while connections use it (oauth_app_in_use), since only it can refresh their access: disconnect them first. New consents go back to coss.com's app. + */ + public DeletedSchedulingOauthApp delete(String id, DeleteOauthAppsRequest request, RequestOptions requestOptions) { + return this.rawClient.delete(id, request, requestOptions).body(); + } + + /** + * A new client secret is tried on a connection before it replaces the old one, and ends an outage if it works. Its client ID can't change: a different app needs its hosts to consent again. + */ + public SchedulingOauthApp update(String id) { + return this.rawClient.update(id).body(); + } + + /** + * A new client secret is tried on a connection before it replaces the old one, and ends an outage if it works. Its client ID can't change: a different app needs its hosts to consent again. + */ + public SchedulingOauthApp update(String id, RequestOptions requestOptions) { + return this.rawClient.update(id, requestOptions).body(); + } + + /** + * A new client secret is tried on a connection before it replaces the old one, and ends an outage if it works. Its client ID can't change: a different app needs its hosts to consent again. + */ + public SchedulingOauthApp update(String id, UpdateOauthAppRequest request) { + return this.rawClient.update(id, request).body(); + } + + /** + * A new client secret is tried on a connection before it replaces the old one, and ends an outage if it works. Its client ID can't change: a different app needs its hosts to consent again. + */ + public SchedulingOauthApp update(String id, UpdateOauthAppRequest request, RequestOptions requestOptions) { + return this.rawClient.update(id, request, requestOptions).body(); + } +} diff --git a/sdks/java/src/main/java/com/coss/resources/scheduling/oauthapps/RawOauthAppsClient.java b/sdks/java/src/main/java/com/coss/resources/scheduling/oauthapps/RawOauthAppsClient.java new file mode 100644 index 000000000..f0335925b --- /dev/null +++ b/sdks/java/src/main/java/com/coss/resources/scheduling/oauthapps/RawOauthAppsClient.java @@ -0,0 +1,533 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.coss.resources.scheduling.oauthapps; + +import com.coss.core.ClientOptions; +import com.coss.core.CossApiException; +import com.coss.core.CossException; +import com.coss.core.CossHttpResponse; +import com.coss.core.IdempotencyUtils; +import com.coss.core.MediaTypes; +import com.coss.core.ObjectMappers; +import com.coss.core.RequestOptions; +import com.coss.core.RetryInterceptor; +import com.coss.errors.BadRequestError; +import com.coss.errors.ForbiddenError; +import com.coss.errors.InternalServerError; +import com.coss.errors.NotFoundError; +import com.coss.errors.PaymentRequiredError; +import com.coss.errors.ServiceUnavailableError; +import com.coss.errors.TooManyRequestsError; +import com.coss.errors.UnauthorizedError; +import com.coss.errors.UnprocessableEntityError; +import com.coss.errors.UnsupportedMediaTypeError; +import com.coss.resources.scheduling.oauthapps.requests.DeleteOauthAppsRequest; +import com.coss.resources.scheduling.oauthapps.requests.GetOauthAppsRequest; +import com.coss.resources.scheduling.oauthapps.requests.UpdateOauthAppRequest; +import com.coss.types.CreateOauthAppRequest; +import com.coss.types.DeletedSchedulingOauthApp; +import com.coss.types.Error; +import com.coss.types.SchedulingOauthApp; +import com.coss.types.SchedulingOauthAppList; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.io.IOException; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawOauthAppsClient { + protected final ClientOptions clientOptions; + + public RawOauthAppsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * At most one per provider, with how many connections use each. + */ + public CossHttpResponse list() { + return list(null); + } + + /** + * At most one per provider, with how many connections use each. + */ + public CossHttpResponse list(RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("v1/scheduling/oauth_apps"); + if (requestOptions != null) { + requestOptions.getQueryParameters().forEach((_key, _value) -> { + httpUrl.addQueryParameter(_key, _value); + }); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + if (requestOptions != null && requestOptions.getMaxRetries().isPresent()) { + okhttpRequest = okhttpRequest + .newBuilder() + .tag( + RetryInterceptor.MaxRetriesOverride.class, + new RetryInterceptor.MaxRetriesOverride( + requestOptions.getMaxRetries().get())) + .build(); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new CossHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, SchedulingOauthAppList.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 500: + throw new InternalServerError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 503: + throw new ServiceUnavailableError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new CossApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (JsonProcessingException e) { + throw new CossException("Failed to deserialize response: " + e.getMessage(), e); + } catch (IOException e) { + throw new CossException("Network error executing HTTP request", e); + } + } + + /** + * New consents in this environment use it, so the consent screen shows your brand. Connections made before it stay on coss.com's app until their host consents again. On the Scale plan and above. Secrets are never returned. + */ + public CossHttpResponse create(CreateOauthAppRequest request) { + return create(request, null); + } + + /** + * New consents in this environment use it, so the consent screen shows your brand. Connections made before it stay on coss.com's app until their host consents again. On the Scale plan and above. Secrets are never returned. + */ + public CossHttpResponse create(CreateOauthAppRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("v1/scheduling/oauth_apps"); + if (requestOptions != null) { + requestOptions.getQueryParameters().forEach((_key, _value) -> { + httpUrl.addQueryParameter(_key, _value); + }); + } + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new CossException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl.build()) + .method("POST", body) + .headers(Headers.of(IdempotencyUtils.withGeneratedIdempotencyKey( + clientOptions.headers(requestOptions), "Idempotency-Key"))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + okhttpRequest = okhttpRequest + .newBuilder() + .tag(RetryInterceptor.MaxRetriesOverride.class, new RetryInterceptor.MaxRetriesOverride(0)) + .build(); + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new CossHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, SchedulingOauthApp.class), response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 402: + throw new PaymentRequiredError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 415: + throw new UnsupportedMediaTypeError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 422: + throw new UnprocessableEntityError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 500: + throw new InternalServerError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 503: + throw new ServiceUnavailableError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new CossApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (JsonProcessingException e) { + throw new CossException("Failed to deserialize response: " + e.getMessage(), e); + } catch (IOException e) { + throw new CossException("Network error executing HTTP request", e); + } + } + + /** + * Its status, what to register at the provider, and how many connections use it. + */ + public CossHttpResponse get(String id) { + return get(id, GetOauthAppsRequest.builder().build()); + } + + /** + * Its status, what to register at the provider, and how many connections use it. + */ + public CossHttpResponse get(String id, RequestOptions requestOptions) { + return get(id, GetOauthAppsRequest.builder().build(), requestOptions); + } + + /** + * Its status, what to register at the provider, and how many connections use it. + */ + public CossHttpResponse get(String id, GetOauthAppsRequest request) { + return get(id, request, null); + } + + /** + * Its status, what to register at the provider, and how many connections use it. + */ + public CossHttpResponse get( + String id, GetOauthAppsRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("v1/scheduling/oauth_apps") + .addPathSegment(id); + if (requestOptions != null) { + requestOptions.getQueryParameters().forEach((_key, _value) -> { + httpUrl.addQueryParameter(_key, _value); + }); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + if (requestOptions != null && requestOptions.getMaxRetries().isPresent()) { + okhttpRequest = okhttpRequest + .newBuilder() + .tag( + RetryInterceptor.MaxRetriesOverride.class, + new RetryInterceptor.MaxRetriesOverride( + requestOptions.getMaxRetries().get())) + .build(); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new CossHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, SchedulingOauthApp.class), response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 500: + throw new InternalServerError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 503: + throw new ServiceUnavailableError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new CossApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (JsonProcessingException e) { + throw new CossException("Failed to deserialize response: " + e.getMessage(), e); + } catch (IOException e) { + throw new CossException("Network error executing HTTP request", e); + } + } + + /** + * Refused while connections use it (oauth_app_in_use), since only it can refresh their access: disconnect them first. New consents go back to coss.com's app. + */ + public CossHttpResponse delete(String id) { + return delete(id, DeleteOauthAppsRequest.builder().build()); + } + + /** + * Refused while connections use it (oauth_app_in_use), since only it can refresh their access: disconnect them first. New consents go back to coss.com's app. + */ + public CossHttpResponse delete(String id, RequestOptions requestOptions) { + return delete(id, DeleteOauthAppsRequest.builder().build(), requestOptions); + } + + /** + * Refused while connections use it (oauth_app_in_use), since only it can refresh their access: disconnect them first. New consents go back to coss.com's app. + */ + public CossHttpResponse delete(String id, DeleteOauthAppsRequest request) { + return delete(id, request, null); + } + + /** + * Refused while connections use it (oauth_app_in_use), since only it can refresh their access: disconnect them first. New consents go back to coss.com's app. + */ + public CossHttpResponse delete( + String id, DeleteOauthAppsRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("v1/scheduling/oauth_apps") + .addPathSegment(id); + if (requestOptions != null) { + requestOptions.getQueryParameters().forEach((_key, _value) -> { + httpUrl.addQueryParameter(_key, _value); + }); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("DELETE", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + if (requestOptions != null && requestOptions.getMaxRetries().isPresent()) { + okhttpRequest = okhttpRequest + .newBuilder() + .tag( + RetryInterceptor.MaxRetriesOverride.class, + new RetryInterceptor.MaxRetriesOverride( + requestOptions.getMaxRetries().get())) + .build(); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new CossHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, DeletedSchedulingOauthApp.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 422: + throw new UnprocessableEntityError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 500: + throw new InternalServerError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 503: + throw new ServiceUnavailableError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new CossApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (JsonProcessingException e) { + throw new CossException("Failed to deserialize response: " + e.getMessage(), e); + } catch (IOException e) { + throw new CossException("Network error executing HTTP request", e); + } + } + + /** + * A new client secret is tried on a connection before it replaces the old one, and ends an outage if it works. Its client ID can't change: a different app needs its hosts to consent again. + */ + public CossHttpResponse update(String id) { + return update(id, UpdateOauthAppRequest.builder().build()); + } + + /** + * A new client secret is tried on a connection before it replaces the old one, and ends an outage if it works. Its client ID can't change: a different app needs its hosts to consent again. + */ + public CossHttpResponse update(String id, RequestOptions requestOptions) { + return update(id, UpdateOauthAppRequest.builder().build(), requestOptions); + } + + /** + * A new client secret is tried on a connection before it replaces the old one, and ends an outage if it works. Its client ID can't change: a different app needs its hosts to consent again. + */ + public CossHttpResponse update(String id, UpdateOauthAppRequest request) { + return update(id, request, null); + } + + /** + * A new client secret is tried on a connection before it replaces the old one, and ends an outage if it works. Its client ID can't change: a different app needs its hosts to consent again. + */ + public CossHttpResponse update( + String id, UpdateOauthAppRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("v1/scheduling/oauth_apps") + .addPathSegment(id); + if (requestOptions != null) { + requestOptions.getQueryParameters().forEach((_key, _value) -> { + httpUrl.addQueryParameter(_key, _value); + }); + } + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new CossException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl.build()) + .method("PATCH", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + if (requestOptions != null && requestOptions.getMaxRetries().isPresent()) { + okhttpRequest = okhttpRequest + .newBuilder() + .tag( + RetryInterceptor.MaxRetriesOverride.class, + new RetryInterceptor.MaxRetriesOverride( + requestOptions.getMaxRetries().get())) + .build(); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new CossHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, SchedulingOauthApp.class), response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 415: + throw new UnsupportedMediaTypeError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 422: + throw new UnprocessableEntityError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 500: + throw new InternalServerError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 503: + throw new ServiceUnavailableError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new CossApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (JsonProcessingException e) { + throw new CossException("Failed to deserialize response: " + e.getMessage(), e); + } catch (IOException e) { + throw new CossException("Network error executing HTTP request", e); + } + } +} diff --git a/sdks/java/src/main/java/com/coss/types/SchedulingLocationGoogleMeet.java b/sdks/java/src/main/java/com/coss/resources/scheduling/oauthapps/requests/DeleteOauthAppsRequest.java similarity index 77% rename from sdks/java/src/main/java/com/coss/types/SchedulingLocationGoogleMeet.java rename to sdks/java/src/main/java/com/coss/resources/scheduling/oauthapps/requests/DeleteOauthAppsRequest.java index d36942244..7752b7ae2 100644 --- a/sdks/java/src/main/java/com/coss/types/SchedulingLocationGoogleMeet.java +++ b/sdks/java/src/main/java/com/coss/resources/scheduling/oauthapps/requests/DeleteOauthAppsRequest.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.coss.types; +package com.coss.resources.scheduling.oauthapps.requests; import com.coss.core.ObjectMappers; import com.fasterxml.jackson.annotation.JsonAnyGetter; @@ -13,18 +13,18 @@ import java.util.Map; @JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = SchedulingLocationGoogleMeet.Builder.class) -public final class SchedulingLocationGoogleMeet { +@JsonDeserialize(builder = DeleteOauthAppsRequest.Builder.class) +public final class DeleteOauthAppsRequest { private final Map additionalProperties; - private SchedulingLocationGoogleMeet(Map additionalProperties) { + private DeleteOauthAppsRequest(Map additionalProperties) { this.additionalProperties = additionalProperties; } @java.lang.Override public boolean equals(Object other) { if (this == other) return true; - return other instanceof SchedulingLocationGoogleMeet; + return other instanceof DeleteOauthAppsRequest; } @JsonAnyGetter @@ -48,12 +48,12 @@ public static final class Builder { private Builder() {} - public Builder from(SchedulingLocationGoogleMeet other) { + public Builder from(DeleteOauthAppsRequest other) { return this; } - public SchedulingLocationGoogleMeet build() { - return new SchedulingLocationGoogleMeet(additionalProperties); + public DeleteOauthAppsRequest build() { + return new DeleteOauthAppsRequest(additionalProperties); } public Builder additionalProperty(String key, Object value) { diff --git a/sdks/java/src/main/java/com/coss/types/SchedulingLocationMicrosoftTeams.java b/sdks/java/src/main/java/com/coss/resources/scheduling/oauthapps/requests/GetOauthAppsRequest.java similarity index 76% rename from sdks/java/src/main/java/com/coss/types/SchedulingLocationMicrosoftTeams.java rename to sdks/java/src/main/java/com/coss/resources/scheduling/oauthapps/requests/GetOauthAppsRequest.java index 7341248d1..a3af53777 100644 --- a/sdks/java/src/main/java/com/coss/types/SchedulingLocationMicrosoftTeams.java +++ b/sdks/java/src/main/java/com/coss/resources/scheduling/oauthapps/requests/GetOauthAppsRequest.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.coss.types; +package com.coss.resources.scheduling.oauthapps.requests; import com.coss.core.ObjectMappers; import com.fasterxml.jackson.annotation.JsonAnyGetter; @@ -13,18 +13,18 @@ import java.util.Map; @JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = SchedulingLocationMicrosoftTeams.Builder.class) -public final class SchedulingLocationMicrosoftTeams { +@JsonDeserialize(builder = GetOauthAppsRequest.Builder.class) +public final class GetOauthAppsRequest { private final Map additionalProperties; - private SchedulingLocationMicrosoftTeams(Map additionalProperties) { + private GetOauthAppsRequest(Map additionalProperties) { this.additionalProperties = additionalProperties; } @java.lang.Override public boolean equals(Object other) { if (this == other) return true; - return other instanceof SchedulingLocationMicrosoftTeams; + return other instanceof GetOauthAppsRequest; } @JsonAnyGetter @@ -48,12 +48,12 @@ public static final class Builder { private Builder() {} - public Builder from(SchedulingLocationMicrosoftTeams other) { + public Builder from(GetOauthAppsRequest other) { return this; } - public SchedulingLocationMicrosoftTeams build() { - return new SchedulingLocationMicrosoftTeams(additionalProperties); + public GetOauthAppsRequest build() { + return new GetOauthAppsRequest(additionalProperties); } public Builder additionalProperty(String key, Object value) { diff --git a/sdks/java/src/main/java/com/coss/resources/scheduling/oauthapps/requests/UpdateOauthAppRequest.java b/sdks/java/src/main/java/com/coss/resources/scheduling/oauthapps/requests/UpdateOauthAppRequest.java new file mode 100644 index 000000000..7110cb887 --- /dev/null +++ b/sdks/java/src/main/java/com/coss/resources/scheduling/oauthapps/requests/UpdateOauthAppRequest.java @@ -0,0 +1,430 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.coss.resources.scheduling.oauthapps.requests; + +import com.coss.core.Nullable; +import com.coss.core.NullableNonemptyFilter; +import com.coss.core.ObjectMappers; +import com.coss.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = UpdateOauthAppRequest.Builder.class) +public final class UpdateOauthAppRequest { + private final Optional clientSecret; + + private final OptionalNullable tenantId; + + private final OptionalNullable webhookSecret; + + private final OptionalNullable redirectUri; + + private final OptionalNullable completionUrl; + + private final OptionalNullable secretExpiresAt; + + private final Map additionalProperties; + + private UpdateOauthAppRequest( + Optional clientSecret, + OptionalNullable tenantId, + OptionalNullable webhookSecret, + OptionalNullable redirectUri, + OptionalNullable completionUrl, + OptionalNullable secretExpiresAt, + Map additionalProperties) { + this.clientSecret = clientSecret; + this.tenantId = tenantId; + this.webhookSecret = webhookSecret; + this.redirectUri = redirectUri; + this.completionUrl = completionUrl; + this.secretExpiresAt = secretExpiresAt; + this.additionalProperties = additionalProperties; + } + + /** + * @return A new client secret. It's tried on a connection before it replaces the old one. + */ + @JsonProperty("client_secret") + public Optional getClientSecret() { + return clientSecret; + } + + /** + * @return The Directory (tenant) ID, for an app that's only for your own tenant. Leave it out for a multi-tenant app. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("tenant_id") + public OptionalNullable getTenantId() { + if (tenantId == null) { + return OptionalNullable.absent(); + } + return tenantId; + } + + /** + * @return The Secret Token of your Zoom app, which signs its events at zoom_event_url. Never returned. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("webhook_secret") + public OptionalNullable getWebhookSecret() { + if (webhookSecret == null) { + return OptionalNullable.absent(); + } + return webhookSecret; + } + + /** + * @return A page on your own domain, registered with the provider, that forwards code and state to coss_callback_url. Google requires this for an external app, since it has to verify the redirect's domain as yours. Leave it out to use coss_callback_url directly. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("redirect_uri") + public OptionalNullable getRedirectUri() { + if (redirectUri == null) { + return OptionalNullable.absent(); + } + return redirectUri; + } + + /** + * @return Where the browser lands after a consent that didn't name a return_url, with coss_calendar set to connected, denied or invalid. Leave it out for a plain page saying what happened. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("completion_url") + public OptionalNullable getCompletionUrl() { + if (completionUrl == null) { + return OptionalNullable.absent(); + } + return completionUrl; + } + + /** + * @return When the client secret expires. Owners and admins are warned 14 days before. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("secret_expires_at") + public OptionalNullable getSecretExpiresAt() { + if (secretExpiresAt == null) { + return OptionalNullable.absent(); + } + return secretExpiresAt; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("tenant_id") + private OptionalNullable _getTenantId() { + return tenantId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("webhook_secret") + private OptionalNullable _getWebhookSecret() { + return webhookSecret; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("redirect_uri") + private OptionalNullable _getRedirectUri() { + return redirectUri; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("completion_url") + private OptionalNullable _getCompletionUrl() { + return completionUrl; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("secret_expires_at") + private OptionalNullable _getSecretExpiresAt() { + return secretExpiresAt; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UpdateOauthAppRequest && equalTo((UpdateOauthAppRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UpdateOauthAppRequest other) { + return clientSecret.equals(other.clientSecret) + && tenantId.equals(other.tenantId) + && webhookSecret.equals(other.webhookSecret) + && redirectUri.equals(other.redirectUri) + && completionUrl.equals(other.completionUrl) + && secretExpiresAt.equals(other.secretExpiresAt); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.clientSecret, + this.tenantId, + this.webhookSecret, + this.redirectUri, + this.completionUrl, + this.secretExpiresAt); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional clientSecret = Optional.empty(); + + private OptionalNullable tenantId = OptionalNullable.absent(); + + private OptionalNullable webhookSecret = OptionalNullable.absent(); + + private OptionalNullable redirectUri = OptionalNullable.absent(); + + private OptionalNullable completionUrl = OptionalNullable.absent(); + + private OptionalNullable secretExpiresAt = OptionalNullable.absent(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(UpdateOauthAppRequest other) { + clientSecret(other.getClientSecret()); + tenantId(other.getTenantId()); + webhookSecret(other.getWebhookSecret()); + redirectUri(other.getRedirectUri()); + completionUrl(other.getCompletionUrl()); + secretExpiresAt(other.getSecretExpiresAt()); + return this; + } + + /** + *

A new client secret. It's tried on a connection before it replaces the old one.

+ */ + @JsonSetter(value = "client_secret", nulls = Nulls.SKIP) + public Builder clientSecret(Optional clientSecret) { + this.clientSecret = clientSecret; + return this; + } + + public Builder clientSecret(String clientSecret) { + this.clientSecret = Optional.ofNullable(clientSecret); + return this; + } + + /** + *

The Directory (tenant) ID, for an app that's only for your own tenant. Leave it out for a multi-tenant app.

+ */ + @JsonSetter(value = "tenant_id", nulls = Nulls.SKIP) + public Builder tenantId(OptionalNullable tenantId) { + this.tenantId = tenantId; + return this; + } + + public Builder tenantId(String tenantId) { + this.tenantId = OptionalNullable.of(tenantId); + return this; + } + + public Builder tenantId(Optional tenantId) { + if (tenantId.isPresent()) { + this.tenantId = OptionalNullable.of(tenantId.get()); + } else { + this.tenantId = OptionalNullable.absent(); + } + return this; + } + + public Builder tenantId(Nullable tenantId) { + if (tenantId.isNull()) { + this.tenantId = OptionalNullable.ofNull(); + } else if (tenantId.isEmpty()) { + this.tenantId = OptionalNullable.absent(); + } else { + this.tenantId = OptionalNullable.of(tenantId.get()); + } + return this; + } + + /** + *

The Secret Token of your Zoom app, which signs its events at zoom_event_url. Never returned.

+ */ + @JsonSetter(value = "webhook_secret", nulls = Nulls.SKIP) + public Builder webhookSecret(OptionalNullable webhookSecret) { + this.webhookSecret = webhookSecret; + return this; + } + + public Builder webhookSecret(String webhookSecret) { + this.webhookSecret = OptionalNullable.of(webhookSecret); + return this; + } + + public Builder webhookSecret(Optional webhookSecret) { + if (webhookSecret.isPresent()) { + this.webhookSecret = OptionalNullable.of(webhookSecret.get()); + } else { + this.webhookSecret = OptionalNullable.absent(); + } + return this; + } + + public Builder webhookSecret(Nullable webhookSecret) { + if (webhookSecret.isNull()) { + this.webhookSecret = OptionalNullable.ofNull(); + } else if (webhookSecret.isEmpty()) { + this.webhookSecret = OptionalNullable.absent(); + } else { + this.webhookSecret = OptionalNullable.of(webhookSecret.get()); + } + return this; + } + + /** + *

A page on your own domain, registered with the provider, that forwards code and state to coss_callback_url. Google requires this for an external app, since it has to verify the redirect's domain as yours. Leave it out to use coss_callback_url directly.

+ */ + @JsonSetter(value = "redirect_uri", nulls = Nulls.SKIP) + public Builder redirectUri(OptionalNullable redirectUri) { + this.redirectUri = redirectUri; + return this; + } + + public Builder redirectUri(String redirectUri) { + this.redirectUri = OptionalNullable.of(redirectUri); + return this; + } + + public Builder redirectUri(Optional redirectUri) { + if (redirectUri.isPresent()) { + this.redirectUri = OptionalNullable.of(redirectUri.get()); + } else { + this.redirectUri = OptionalNullable.absent(); + } + return this; + } + + public Builder redirectUri(Nullable redirectUri) { + if (redirectUri.isNull()) { + this.redirectUri = OptionalNullable.ofNull(); + } else if (redirectUri.isEmpty()) { + this.redirectUri = OptionalNullable.absent(); + } else { + this.redirectUri = OptionalNullable.of(redirectUri.get()); + } + return this; + } + + /** + *

Where the browser lands after a consent that didn't name a return_url, with coss_calendar set to connected, denied or invalid. Leave it out for a plain page saying what happened.

+ */ + @JsonSetter(value = "completion_url", nulls = Nulls.SKIP) + public Builder completionUrl(OptionalNullable completionUrl) { + this.completionUrl = completionUrl; + return this; + } + + public Builder completionUrl(String completionUrl) { + this.completionUrl = OptionalNullable.of(completionUrl); + return this; + } + + public Builder completionUrl(Optional completionUrl) { + if (completionUrl.isPresent()) { + this.completionUrl = OptionalNullable.of(completionUrl.get()); + } else { + this.completionUrl = OptionalNullable.absent(); + } + return this; + } + + public Builder completionUrl(Nullable completionUrl) { + if (completionUrl.isNull()) { + this.completionUrl = OptionalNullable.ofNull(); + } else if (completionUrl.isEmpty()) { + this.completionUrl = OptionalNullable.absent(); + } else { + this.completionUrl = OptionalNullable.of(completionUrl.get()); + } + return this; + } + + /** + *

When the client secret expires. Owners and admins are warned 14 days before.

+ */ + @JsonSetter(value = "secret_expires_at", nulls = Nulls.SKIP) + public Builder secretExpiresAt(OptionalNullable secretExpiresAt) { + this.secretExpiresAt = secretExpiresAt; + return this; + } + + public Builder secretExpiresAt(OffsetDateTime secretExpiresAt) { + this.secretExpiresAt = OptionalNullable.of(secretExpiresAt); + return this; + } + + public Builder secretExpiresAt(Optional secretExpiresAt) { + if (secretExpiresAt.isPresent()) { + this.secretExpiresAt = OptionalNullable.of(secretExpiresAt.get()); + } else { + this.secretExpiresAt = OptionalNullable.absent(); + } + return this; + } + + public Builder secretExpiresAt(Nullable secretExpiresAt) { + if (secretExpiresAt.isNull()) { + this.secretExpiresAt = OptionalNullable.ofNull(); + } else if (secretExpiresAt.isEmpty()) { + this.secretExpiresAt = OptionalNullable.absent(); + } else { + this.secretExpiresAt = OptionalNullable.of(secretExpiresAt.get()); + } + return this; + } + + public UpdateOauthAppRequest build() { + return new UpdateOauthAppRequest( + clientSecret, + tenantId, + webhookSecret, + redirectUri, + completionUrl, + secretExpiresAt, + additionalProperties); + } + + public Builder additionalProperty(String key, Object value) { + this.additionalProperties.put(key, value); + return this; + } + + public Builder additionalProperties(Map additionalProperties) { + this.additionalProperties.putAll(additionalProperties); + return this; + } + } +} diff --git a/sdks/java/src/main/java/com/coss/resources/scheduling/outofoffice/AsyncOutOfOfficeClient.java b/sdks/java/src/main/java/com/coss/resources/scheduling/outofoffice/AsyncOutOfOfficeClient.java new file mode 100644 index 000000000..7d2533a1a --- /dev/null +++ b/sdks/java/src/main/java/com/coss/resources/scheduling/outofoffice/AsyncOutOfOfficeClient.java @@ -0,0 +1,227 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.coss.resources.scheduling.outofoffice; + +import com.coss.core.ClientOptions; +import com.coss.core.RequestOptions; +import com.coss.resources.scheduling.outofoffice.requests.ConflictsOutOfOfficeRequest; +import com.coss.resources.scheduling.outofoffice.requests.CreateSchedulingOutOfOfficeRequest; +import com.coss.resources.scheduling.outofoffice.requests.GetOutOfOfficeRequest; +import com.coss.resources.scheduling.outofoffice.requests.ListOutOfOfficeRequest; +import com.coss.resources.scheduling.outofoffice.requests.PutSchedulingOutOfOfficeRequest; +import com.coss.resources.scheduling.outofoffice.requests.RemoveOutOfOfficeRequest; +import com.coss.resources.scheduling.outofoffice.requests.UpdateSchedulingOutOfOfficeRequest; +import com.coss.types.DeletedSchedulingOutOfOffice; +import com.coss.types.SchedulingOutOfOffice; +import com.coss.types.SchedulingOutOfOfficeConflictList; +import com.coss.types.SchedulingOutOfOfficeList; +import java.util.concurrent.CompletableFuture; + +public class AsyncOutOfOfficeClient { + protected final ClientOptions clientOptions; + + private final AsyncRawOutOfOfficeClient rawClient; + + public AsyncOutOfOfficeClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawOutOfOfficeClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawOutOfOfficeClient withRawResponse() { + return this.rawClient; + } + + /** + * The environment's entries, newest first. + */ + public CompletableFuture list() { + return this.rawClient.list().thenApply(response -> response.body()); + } + + /** + * The environment's entries, newest first. + */ + public CompletableFuture list(RequestOptions requestOptions) { + return this.rawClient.list(requestOptions).thenApply(response -> response.body()); + } + + /** + * The environment's entries, newest first. + */ + public CompletableFuture list(ListOutOfOfficeRequest request) { + return this.rawClient.list(request).thenApply(response -> response.body()); + } + + /** + * The environment's entries, newest first. + */ + public CompletableFuture list( + ListOutOfOfficeRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Marks one host, a list of hosts or everyone matching some attributes as away, for part of a day or for whole dates. They aren't offered during it. Existing bookings stay as they are: list them with the entry's conflicts. + */ + public CompletableFuture create() { + return this.rawClient.create().thenApply(response -> response.body()); + } + + /** + * Marks one host, a list of hosts or everyone matching some attributes as away, for part of a day or for whole dates. They aren't offered during it. Existing bookings stay as they are: list them with the entry's conflicts. + */ + public CompletableFuture create(RequestOptions requestOptions) { + return this.rawClient.create(requestOptions).thenApply(response -> response.body()); + } + + /** + * Marks one host, a list of hosts or everyone matching some attributes as away, for part of a day or for whole dates. They aren't offered during it. Existing bookings stay as they are: list them with the entry's conflicts. + */ + public CompletableFuture create(CreateSchedulingOutOfOfficeRequest request) { + return this.rawClient.create(request).thenApply(response -> response.body()); + } + + /** + * Marks one host, a list of hosts or everyone matching some attributes as away, for part of a day or for whole dates. They aren't offered during it. Existing bookings stay as they are: list them with the entry's conflicts. + */ + public CompletableFuture create( + CreateSchedulingOutOfOfficeRequest request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * One entry. + */ + public CompletableFuture get(String id) { + return this.rawClient.get(id).thenApply(response -> response.body()); + } + + /** + * One entry. + */ + public CompletableFuture get(String id, RequestOptions requestOptions) { + return this.rawClient.get(id, requestOptions).thenApply(response -> response.body()); + } + + /** + * One entry. + */ + public CompletableFuture get(String id, GetOutOfOfficeRequest request) { + return this.rawClient.get(id, request).thenApply(response -> response.body()); + } + + /** + * One entry. + */ + public CompletableFuture get( + String id, GetOutOfOfficeRequest request, RequestOptions requestOptions) { + return this.rawClient.get(id, request, requestOptions).thenApply(response -> response.body()); + } + + /** + * The host can be booked in that time again, and any calendar event for it goes. + */ + public CompletableFuture remove(String id) { + return this.rawClient.remove(id).thenApply(response -> response.body()); + } + + /** + * The host can be booked in that time again, and any calendar event for it goes. + */ + public CompletableFuture remove(String id, RequestOptions requestOptions) { + return this.rawClient.remove(id, requestOptions).thenApply(response -> response.body()); + } + + /** + * The host can be booked in that time again, and any calendar event for it goes. + */ + public CompletableFuture remove(String id, RemoveOutOfOfficeRequest request) { + return this.rawClient.remove(id, request).thenApply(response -> response.body()); + } + + /** + * The host can be booked in that time again, and any calendar event for it goes. + */ + public CompletableFuture remove( + String id, RemoveOutOfOfficeRequest request, RequestOptions requestOptions) { + return this.rawClient.remove(id, request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Changes what's given. An entry stays with its host. + */ + public CompletableFuture update(String id) { + return this.rawClient.update(id).thenApply(response -> response.body()); + } + + /** + * Changes what's given. An entry stays with its host. + */ + public CompletableFuture update(String id, RequestOptions requestOptions) { + return this.rawClient.update(id, requestOptions).thenApply(response -> response.body()); + } + + /** + * Changes what's given. An entry stays with its host. + */ + public CompletableFuture update(String id, UpdateSchedulingOutOfOfficeRequest request) { + return this.rawClient.update(id, request).thenApply(response -> response.body()); + } + + /** + * Changes what's given. An entry stays with its host. + */ + public CompletableFuture update( + String id, UpdateSchedulingOutOfOfficeRequest request, RequestOptions requestOptions) { + return this.rawClient.update(id, request, requestOptions).thenApply(response -> response.body()); + } + + /** + * For syncing from a system of record such as an HR tool: send what it says, as often as you like, and there's one entry for it. Give every field you want to keep. + */ + public CompletableFuture put(String externalId, PutSchedulingOutOfOfficeRequest request) { + return this.rawClient.put(externalId, request).thenApply(response -> response.body()); + } + + /** + * For syncing from a system of record such as an HR tool: send what it says, as often as you like, and there's one entry for it. Give every field you want to keep. + */ + public CompletableFuture put( + String externalId, PutSchedulingOutOfOfficeRequest request, RequestOptions requestOptions) { + return this.rawClient.put(externalId, request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Live bookings of the host that fall in the entry, soonest first. Entries never change them. + */ + public CompletableFuture conflicts(String id) { + return this.rawClient.conflicts(id).thenApply(response -> response.body()); + } + + /** + * Live bookings of the host that fall in the entry, soonest first. Entries never change them. + */ + public CompletableFuture conflicts(String id, RequestOptions requestOptions) { + return this.rawClient.conflicts(id, requestOptions).thenApply(response -> response.body()); + } + + /** + * Live bookings of the host that fall in the entry, soonest first. Entries never change them. + */ + public CompletableFuture conflicts( + String id, ConflictsOutOfOfficeRequest request) { + return this.rawClient.conflicts(id, request).thenApply(response -> response.body()); + } + + /** + * Live bookings of the host that fall in the entry, soonest first. Entries never change them. + */ + public CompletableFuture conflicts( + String id, ConflictsOutOfOfficeRequest request, RequestOptions requestOptions) { + return this.rawClient.conflicts(id, request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/sdks/java/src/main/java/com/coss/resources/scheduling/outofoffice/AsyncRawOutOfOfficeClient.java b/sdks/java/src/main/java/com/coss/resources/scheduling/outofoffice/AsyncRawOutOfOfficeClient.java new file mode 100644 index 000000000..3c971a593 --- /dev/null +++ b/sdks/java/src/main/java/com/coss/resources/scheduling/outofoffice/AsyncRawOutOfOfficeClient.java @@ -0,0 +1,1030 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.coss.resources.scheduling.outofoffice; + +import com.coss.core.ClientOptions; +import com.coss.core.CossApiException; +import com.coss.core.CossException; +import com.coss.core.CossHttpResponse; +import com.coss.core.IdempotencyUtils; +import com.coss.core.MediaTypes; +import com.coss.core.ObjectMappers; +import com.coss.core.QueryStringMapper; +import com.coss.core.RequestOptions; +import com.coss.core.RetryInterceptor; +import com.coss.errors.BadRequestError; +import com.coss.errors.ForbiddenError; +import com.coss.errors.InternalServerError; +import com.coss.errors.NotFoundError; +import com.coss.errors.ServiceUnavailableError; +import com.coss.errors.TooManyRequestsError; +import com.coss.errors.UnauthorizedError; +import com.coss.errors.UnprocessableEntityError; +import com.coss.errors.UnsupportedMediaTypeError; +import com.coss.resources.scheduling.outofoffice.requests.ConflictsOutOfOfficeRequest; +import com.coss.resources.scheduling.outofoffice.requests.CreateSchedulingOutOfOfficeRequest; +import com.coss.resources.scheduling.outofoffice.requests.GetOutOfOfficeRequest; +import com.coss.resources.scheduling.outofoffice.requests.ListOutOfOfficeRequest; +import com.coss.resources.scheduling.outofoffice.requests.PutSchedulingOutOfOfficeRequest; +import com.coss.resources.scheduling.outofoffice.requests.RemoveOutOfOfficeRequest; +import com.coss.resources.scheduling.outofoffice.requests.UpdateSchedulingOutOfOfficeRequest; +import com.coss.types.DeletedSchedulingOutOfOffice; +import com.coss.types.Error; +import com.coss.types.SchedulingOutOfOffice; +import com.coss.types.SchedulingOutOfOfficeConflictList; +import com.coss.types.SchedulingOutOfOfficeList; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.io.IOException; +import java.util.concurrent.CompletableFuture; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawOutOfOfficeClient { + protected final ClientOptions clientOptions; + + public AsyncRawOutOfOfficeClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * The environment's entries, newest first. + */ + public CompletableFuture> list() { + return list(ListOutOfOfficeRequest.builder().build()); + } + + /** + * The environment's entries, newest first. + */ + public CompletableFuture> list(RequestOptions requestOptions) { + return list(ListOutOfOfficeRequest.builder().build(), requestOptions); + } + + /** + * The environment's entries, newest first. + */ + public CompletableFuture> list(ListOutOfOfficeRequest request) { + return list(request, null); + } + + /** + * The environment's entries, newest first. + */ + public CompletableFuture> list( + ListOutOfOfficeRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("v1/scheduling/out_of_office"); + if (request.getLimit().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "limit", request.getLimit().get(), false); + } + if (request.getAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "after", request.getAfter().get(), false); + } + if (request.getHost().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "host", request.getHost().get(), false); + } + if (request.getStartAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "start_after", request.getStartAfter().get(), false); + } + if (request.getStartBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "start_before", request.getStartBefore().get(), false); + } + if (request.getGroup().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "group", request.getGroup().get(), false); + } + if (requestOptions != null) { + requestOptions.getQueryParameters().forEach((_key, _value) -> { + httpUrl.addQueryParameter(_key, _value); + }); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + if (requestOptions != null && requestOptions.getMaxRetries().isPresent()) { + okhttpRequest = okhttpRequest + .newBuilder() + .tag( + RetryInterceptor.MaxRetriesOverride.class, + new RetryInterceptor.MaxRetriesOverride( + requestOptions.getMaxRetries().get())) + .build(); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new CossHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, SchedulingOutOfOfficeList.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 422: + future.completeExceptionally(new UnprocessableEntityError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 500: + future.completeExceptionally(new InternalServerError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 503: + future.completeExceptionally(new ServiceUnavailableError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new CossApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (JsonProcessingException e) { + future.completeExceptionally( + new CossException("Failed to deserialize response: " + e.getMessage(), e)); + } catch (IOException e) { + future.completeExceptionally(new CossException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new CossException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Marks one host, a list of hosts or everyone matching some attributes as away, for part of a day or for whole dates. They aren't offered during it. Existing bookings stay as they are: list them with the entry's conflicts. + */ + public CompletableFuture> create() { + return create(CreateSchedulingOutOfOfficeRequest.builder().build()); + } + + /** + * Marks one host, a list of hosts or everyone matching some attributes as away, for part of a day or for whole dates. They aren't offered during it. Existing bookings stay as they are: list them with the entry's conflicts. + */ + public CompletableFuture> create(RequestOptions requestOptions) { + return create(CreateSchedulingOutOfOfficeRequest.builder().build(), requestOptions); + } + + /** + * Marks one host, a list of hosts or everyone matching some attributes as away, for part of a day or for whole dates. They aren't offered during it. Existing bookings stay as they are: list them with the entry's conflicts. + */ + public CompletableFuture> create( + CreateSchedulingOutOfOfficeRequest request) { + return create(request, null); + } + + /** + * Marks one host, a list of hosts or everyone matching some attributes as away, for part of a day or for whole dates. They aren't offered during it. Existing bookings stay as they are: list them with the entry's conflicts. + */ + public CompletableFuture> create( + CreateSchedulingOutOfOfficeRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("v1/scheduling/out_of_office"); + if (requestOptions != null) { + requestOptions.getQueryParameters().forEach((_key, _value) -> { + httpUrl.addQueryParameter(_key, _value); + }); + } + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new CossException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl.build()) + .method("POST", body) + .headers(Headers.of(IdempotencyUtils.withGeneratedIdempotencyKey( + clientOptions.headers(requestOptions), "Idempotency-Key"))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + okhttpRequest = okhttpRequest + .newBuilder() + .tag(RetryInterceptor.MaxRetriesOverride.class, new RetryInterceptor.MaxRetriesOverride(0)) + .build(); + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new CossHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, SchedulingOutOfOfficeList.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 415: + future.completeExceptionally(new UnsupportedMediaTypeError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 422: + future.completeExceptionally(new UnprocessableEntityError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 500: + future.completeExceptionally(new InternalServerError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 503: + future.completeExceptionally(new ServiceUnavailableError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new CossApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (JsonProcessingException e) { + future.completeExceptionally( + new CossException("Failed to deserialize response: " + e.getMessage(), e)); + } catch (IOException e) { + future.completeExceptionally(new CossException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new CossException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * One entry. + */ + public CompletableFuture> get(String id) { + return get(id, GetOutOfOfficeRequest.builder().build()); + } + + /** + * One entry. + */ + public CompletableFuture> get(String id, RequestOptions requestOptions) { + return get(id, GetOutOfOfficeRequest.builder().build(), requestOptions); + } + + /** + * One entry. + */ + public CompletableFuture> get(String id, GetOutOfOfficeRequest request) { + return get(id, request, null); + } + + /** + * One entry. + */ + public CompletableFuture> get( + String id, GetOutOfOfficeRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("v1/scheduling/out_of_office") + .addPathSegment(id); + if (requestOptions != null) { + requestOptions.getQueryParameters().forEach((_key, _value) -> { + httpUrl.addQueryParameter(_key, _value); + }); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + if (requestOptions != null && requestOptions.getMaxRetries().isPresent()) { + okhttpRequest = okhttpRequest + .newBuilder() + .tag( + RetryInterceptor.MaxRetriesOverride.class, + new RetryInterceptor.MaxRetriesOverride( + requestOptions.getMaxRetries().get())) + .build(); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new CossHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, SchedulingOutOfOffice.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 500: + future.completeExceptionally(new InternalServerError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 503: + future.completeExceptionally(new ServiceUnavailableError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new CossApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (JsonProcessingException e) { + future.completeExceptionally( + new CossException("Failed to deserialize response: " + e.getMessage(), e)); + } catch (IOException e) { + future.completeExceptionally(new CossException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new CossException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * The host can be booked in that time again, and any calendar event for it goes. + */ + public CompletableFuture> remove(String id) { + return remove(id, RemoveOutOfOfficeRequest.builder().build()); + } + + /** + * The host can be booked in that time again, and any calendar event for it goes. + */ + public CompletableFuture> remove( + String id, RequestOptions requestOptions) { + return remove(id, RemoveOutOfOfficeRequest.builder().build(), requestOptions); + } + + /** + * The host can be booked in that time again, and any calendar event for it goes. + */ + public CompletableFuture> remove( + String id, RemoveOutOfOfficeRequest request) { + return remove(id, request, null); + } + + /** + * The host can be booked in that time again, and any calendar event for it goes. + */ + public CompletableFuture> remove( + String id, RemoveOutOfOfficeRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("v1/scheduling/out_of_office") + .addPathSegment(id); + if (requestOptions != null) { + requestOptions.getQueryParameters().forEach((_key, _value) -> { + httpUrl.addQueryParameter(_key, _value); + }); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("DELETE", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + if (requestOptions != null && requestOptions.getMaxRetries().isPresent()) { + okhttpRequest = okhttpRequest + .newBuilder() + .tag( + RetryInterceptor.MaxRetriesOverride.class, + new RetryInterceptor.MaxRetriesOverride( + requestOptions.getMaxRetries().get())) + .build(); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new CossHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, DeletedSchedulingOutOfOffice.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 500: + future.completeExceptionally(new InternalServerError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 503: + future.completeExceptionally(new ServiceUnavailableError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new CossApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (JsonProcessingException e) { + future.completeExceptionally( + new CossException("Failed to deserialize response: " + e.getMessage(), e)); + } catch (IOException e) { + future.completeExceptionally(new CossException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new CossException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Changes what's given. An entry stays with its host. + */ + public CompletableFuture> update(String id) { + return update(id, UpdateSchedulingOutOfOfficeRequest.builder().build()); + } + + /** + * Changes what's given. An entry stays with its host. + */ + public CompletableFuture> update(String id, RequestOptions requestOptions) { + return update(id, UpdateSchedulingOutOfOfficeRequest.builder().build(), requestOptions); + } + + /** + * Changes what's given. An entry stays with its host. + */ + public CompletableFuture> update( + String id, UpdateSchedulingOutOfOfficeRequest request) { + return update(id, request, null); + } + + /** + * Changes what's given. An entry stays with its host. + */ + public CompletableFuture> update( + String id, UpdateSchedulingOutOfOfficeRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("v1/scheduling/out_of_office") + .addPathSegment(id); + if (requestOptions != null) { + requestOptions.getQueryParameters().forEach((_key, _value) -> { + httpUrl.addQueryParameter(_key, _value); + }); + } + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new CossException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl.build()) + .method("PATCH", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + if (requestOptions != null && requestOptions.getMaxRetries().isPresent()) { + okhttpRequest = okhttpRequest + .newBuilder() + .tag( + RetryInterceptor.MaxRetriesOverride.class, + new RetryInterceptor.MaxRetriesOverride( + requestOptions.getMaxRetries().get())) + .build(); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new CossHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, SchedulingOutOfOffice.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 415: + future.completeExceptionally(new UnsupportedMediaTypeError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 422: + future.completeExceptionally(new UnprocessableEntityError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 500: + future.completeExceptionally(new InternalServerError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 503: + future.completeExceptionally(new ServiceUnavailableError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new CossApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (JsonProcessingException e) { + future.completeExceptionally( + new CossException("Failed to deserialize response: " + e.getMessage(), e)); + } catch (IOException e) { + future.completeExceptionally(new CossException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new CossException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * For syncing from a system of record such as an HR tool: send what it says, as often as you like, and there's one entry for it. Give every field you want to keep. + */ + public CompletableFuture> put( + String externalId, PutSchedulingOutOfOfficeRequest request) { + return put(externalId, request, null); + } + + /** + * For syncing from a system of record such as an HR tool: send what it says, as often as you like, and there's one entry for it. Give every field you want to keep. + */ + public CompletableFuture> put( + String externalId, PutSchedulingOutOfOfficeRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("v1/scheduling/out_of_office/by_external_id") + .addPathSegment(externalId); + if (requestOptions != null) { + requestOptions.getQueryParameters().forEach((_key, _value) -> { + httpUrl.addQueryParameter(_key, _value); + }); + } + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new CossException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl.build()) + .method("PUT", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + if (requestOptions != null && requestOptions.getMaxRetries().isPresent()) { + okhttpRequest = okhttpRequest + .newBuilder() + .tag( + RetryInterceptor.MaxRetriesOverride.class, + new RetryInterceptor.MaxRetriesOverride( + requestOptions.getMaxRetries().get())) + .build(); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new CossHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, SchedulingOutOfOffice.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 415: + future.completeExceptionally(new UnsupportedMediaTypeError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 422: + future.completeExceptionally(new UnprocessableEntityError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 500: + future.completeExceptionally(new InternalServerError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 503: + future.completeExceptionally(new ServiceUnavailableError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new CossApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (JsonProcessingException e) { + future.completeExceptionally( + new CossException("Failed to deserialize response: " + e.getMessage(), e)); + } catch (IOException e) { + future.completeExceptionally(new CossException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new CossException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Live bookings of the host that fall in the entry, soonest first. Entries never change them. + */ + public CompletableFuture> conflicts(String id) { + return conflicts(id, ConflictsOutOfOfficeRequest.builder().build()); + } + + /** + * Live bookings of the host that fall in the entry, soonest first. Entries never change them. + */ + public CompletableFuture> conflicts( + String id, RequestOptions requestOptions) { + return conflicts(id, ConflictsOutOfOfficeRequest.builder().build(), requestOptions); + } + + /** + * Live bookings of the host that fall in the entry, soonest first. Entries never change them. + */ + public CompletableFuture> conflicts( + String id, ConflictsOutOfOfficeRequest request) { + return conflicts(id, request, null); + } + + /** + * Live bookings of the host that fall in the entry, soonest first. Entries never change them. + */ + public CompletableFuture> conflicts( + String id, ConflictsOutOfOfficeRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("v1/scheduling/out_of_office") + .addPathSegment(id) + .addPathSegments("conflicts"); + if (request.getLimit().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "limit", request.getLimit().get(), false); + } + if (requestOptions != null) { + requestOptions.getQueryParameters().forEach((_key, _value) -> { + httpUrl.addQueryParameter(_key, _value); + }); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + if (requestOptions != null && requestOptions.getMaxRetries().isPresent()) { + okhttpRequest = okhttpRequest + .newBuilder() + .tag( + RetryInterceptor.MaxRetriesOverride.class, + new RetryInterceptor.MaxRetriesOverride( + requestOptions.getMaxRetries().get())) + .build(); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new CossHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, SchedulingOutOfOfficeConflictList.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 422: + future.completeExceptionally(new UnprocessableEntityError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 500: + future.completeExceptionally(new InternalServerError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 503: + future.completeExceptionally(new ServiceUnavailableError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new CossApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (JsonProcessingException e) { + future.completeExceptionally( + new CossException("Failed to deserialize response: " + e.getMessage(), e)); + } catch (IOException e) { + future.completeExceptionally(new CossException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new CossException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/sdks/java/src/main/java/com/coss/resources/scheduling/outofoffice/OutOfOfficeClient.java b/sdks/java/src/main/java/com/coss/resources/scheduling/outofoffice/OutOfOfficeClient.java new file mode 100644 index 000000000..39bb41aff --- /dev/null +++ b/sdks/java/src/main/java/com/coss/resources/scheduling/outofoffice/OutOfOfficeClient.java @@ -0,0 +1,222 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.coss.resources.scheduling.outofoffice; + +import com.coss.core.ClientOptions; +import com.coss.core.RequestOptions; +import com.coss.resources.scheduling.outofoffice.requests.ConflictsOutOfOfficeRequest; +import com.coss.resources.scheduling.outofoffice.requests.CreateSchedulingOutOfOfficeRequest; +import com.coss.resources.scheduling.outofoffice.requests.GetOutOfOfficeRequest; +import com.coss.resources.scheduling.outofoffice.requests.ListOutOfOfficeRequest; +import com.coss.resources.scheduling.outofoffice.requests.PutSchedulingOutOfOfficeRequest; +import com.coss.resources.scheduling.outofoffice.requests.RemoveOutOfOfficeRequest; +import com.coss.resources.scheduling.outofoffice.requests.UpdateSchedulingOutOfOfficeRequest; +import com.coss.types.DeletedSchedulingOutOfOffice; +import com.coss.types.SchedulingOutOfOffice; +import com.coss.types.SchedulingOutOfOfficeConflictList; +import com.coss.types.SchedulingOutOfOfficeList; + +public class OutOfOfficeClient { + protected final ClientOptions clientOptions; + + private final RawOutOfOfficeClient rawClient; + + public OutOfOfficeClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawOutOfOfficeClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawOutOfOfficeClient withRawResponse() { + return this.rawClient; + } + + /** + * The environment's entries, newest first. + */ + public SchedulingOutOfOfficeList list() { + return this.rawClient.list().body(); + } + + /** + * The environment's entries, newest first. + */ + public SchedulingOutOfOfficeList list(RequestOptions requestOptions) { + return this.rawClient.list(requestOptions).body(); + } + + /** + * The environment's entries, newest first. + */ + public SchedulingOutOfOfficeList list(ListOutOfOfficeRequest request) { + return this.rawClient.list(request).body(); + } + + /** + * The environment's entries, newest first. + */ + public SchedulingOutOfOfficeList list(ListOutOfOfficeRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).body(); + } + + /** + * Marks one host, a list of hosts or everyone matching some attributes as away, for part of a day or for whole dates. They aren't offered during it. Existing bookings stay as they are: list them with the entry's conflicts. + */ + public SchedulingOutOfOfficeList create() { + return this.rawClient.create().body(); + } + + /** + * Marks one host, a list of hosts or everyone matching some attributes as away, for part of a day or for whole dates. They aren't offered during it. Existing bookings stay as they are: list them with the entry's conflicts. + */ + public SchedulingOutOfOfficeList create(RequestOptions requestOptions) { + return this.rawClient.create(requestOptions).body(); + } + + /** + * Marks one host, a list of hosts or everyone matching some attributes as away, for part of a day or for whole dates. They aren't offered during it. Existing bookings stay as they are: list them with the entry's conflicts. + */ + public SchedulingOutOfOfficeList create(CreateSchedulingOutOfOfficeRequest request) { + return this.rawClient.create(request).body(); + } + + /** + * Marks one host, a list of hosts or everyone matching some attributes as away, for part of a day or for whole dates. They aren't offered during it. Existing bookings stay as they are: list them with the entry's conflicts. + */ + public SchedulingOutOfOfficeList create(CreateSchedulingOutOfOfficeRequest request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).body(); + } + + /** + * One entry. + */ + public SchedulingOutOfOffice get(String id) { + return this.rawClient.get(id).body(); + } + + /** + * One entry. + */ + public SchedulingOutOfOffice get(String id, RequestOptions requestOptions) { + return this.rawClient.get(id, requestOptions).body(); + } + + /** + * One entry. + */ + public SchedulingOutOfOffice get(String id, GetOutOfOfficeRequest request) { + return this.rawClient.get(id, request).body(); + } + + /** + * One entry. + */ + public SchedulingOutOfOffice get(String id, GetOutOfOfficeRequest request, RequestOptions requestOptions) { + return this.rawClient.get(id, request, requestOptions).body(); + } + + /** + * The host can be booked in that time again, and any calendar event for it goes. + */ + public DeletedSchedulingOutOfOffice remove(String id) { + return this.rawClient.remove(id).body(); + } + + /** + * The host can be booked in that time again, and any calendar event for it goes. + */ + public DeletedSchedulingOutOfOffice remove(String id, RequestOptions requestOptions) { + return this.rawClient.remove(id, requestOptions).body(); + } + + /** + * The host can be booked in that time again, and any calendar event for it goes. + */ + public DeletedSchedulingOutOfOffice remove(String id, RemoveOutOfOfficeRequest request) { + return this.rawClient.remove(id, request).body(); + } + + /** + * The host can be booked in that time again, and any calendar event for it goes. + */ + public DeletedSchedulingOutOfOffice remove( + String id, RemoveOutOfOfficeRequest request, RequestOptions requestOptions) { + return this.rawClient.remove(id, request, requestOptions).body(); + } + + /** + * Changes what's given. An entry stays with its host. + */ + public SchedulingOutOfOffice update(String id) { + return this.rawClient.update(id).body(); + } + + /** + * Changes what's given. An entry stays with its host. + */ + public SchedulingOutOfOffice update(String id, RequestOptions requestOptions) { + return this.rawClient.update(id, requestOptions).body(); + } + + /** + * Changes what's given. An entry stays with its host. + */ + public SchedulingOutOfOffice update(String id, UpdateSchedulingOutOfOfficeRequest request) { + return this.rawClient.update(id, request).body(); + } + + /** + * Changes what's given. An entry stays with its host. + */ + public SchedulingOutOfOffice update( + String id, UpdateSchedulingOutOfOfficeRequest request, RequestOptions requestOptions) { + return this.rawClient.update(id, request, requestOptions).body(); + } + + /** + * For syncing from a system of record such as an HR tool: send what it says, as often as you like, and there's one entry for it. Give every field you want to keep. + */ + public SchedulingOutOfOffice put(String externalId, PutSchedulingOutOfOfficeRequest request) { + return this.rawClient.put(externalId, request).body(); + } + + /** + * For syncing from a system of record such as an HR tool: send what it says, as often as you like, and there's one entry for it. Give every field you want to keep. + */ + public SchedulingOutOfOffice put( + String externalId, PutSchedulingOutOfOfficeRequest request, RequestOptions requestOptions) { + return this.rawClient.put(externalId, request, requestOptions).body(); + } + + /** + * Live bookings of the host that fall in the entry, soonest first. Entries never change them. + */ + public SchedulingOutOfOfficeConflictList conflicts(String id) { + return this.rawClient.conflicts(id).body(); + } + + /** + * Live bookings of the host that fall in the entry, soonest first. Entries never change them. + */ + public SchedulingOutOfOfficeConflictList conflicts(String id, RequestOptions requestOptions) { + return this.rawClient.conflicts(id, requestOptions).body(); + } + + /** + * Live bookings of the host that fall in the entry, soonest first. Entries never change them. + */ + public SchedulingOutOfOfficeConflictList conflicts(String id, ConflictsOutOfOfficeRequest request) { + return this.rawClient.conflicts(id, request).body(); + } + + /** + * Live bookings of the host that fall in the entry, soonest first. Entries never change them. + */ + public SchedulingOutOfOfficeConflictList conflicts( + String id, ConflictsOutOfOfficeRequest request, RequestOptions requestOptions) { + return this.rawClient.conflicts(id, request, requestOptions).body(); + } +} diff --git a/sdks/java/src/main/java/com/coss/resources/scheduling/outofoffice/RawOutOfOfficeClient.java b/sdks/java/src/main/java/com/coss/resources/scheduling/outofoffice/RawOutOfOfficeClient.java new file mode 100644 index 000000000..0cdbab60b --- /dev/null +++ b/sdks/java/src/main/java/com/coss/resources/scheduling/outofoffice/RawOutOfOfficeClient.java @@ -0,0 +1,802 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.coss.resources.scheduling.outofoffice; + +import com.coss.core.ClientOptions; +import com.coss.core.CossApiException; +import com.coss.core.CossException; +import com.coss.core.CossHttpResponse; +import com.coss.core.IdempotencyUtils; +import com.coss.core.MediaTypes; +import com.coss.core.ObjectMappers; +import com.coss.core.QueryStringMapper; +import com.coss.core.RequestOptions; +import com.coss.core.RetryInterceptor; +import com.coss.errors.BadRequestError; +import com.coss.errors.ForbiddenError; +import com.coss.errors.InternalServerError; +import com.coss.errors.NotFoundError; +import com.coss.errors.ServiceUnavailableError; +import com.coss.errors.TooManyRequestsError; +import com.coss.errors.UnauthorizedError; +import com.coss.errors.UnprocessableEntityError; +import com.coss.errors.UnsupportedMediaTypeError; +import com.coss.resources.scheduling.outofoffice.requests.ConflictsOutOfOfficeRequest; +import com.coss.resources.scheduling.outofoffice.requests.CreateSchedulingOutOfOfficeRequest; +import com.coss.resources.scheduling.outofoffice.requests.GetOutOfOfficeRequest; +import com.coss.resources.scheduling.outofoffice.requests.ListOutOfOfficeRequest; +import com.coss.resources.scheduling.outofoffice.requests.PutSchedulingOutOfOfficeRequest; +import com.coss.resources.scheduling.outofoffice.requests.RemoveOutOfOfficeRequest; +import com.coss.resources.scheduling.outofoffice.requests.UpdateSchedulingOutOfOfficeRequest; +import com.coss.types.DeletedSchedulingOutOfOffice; +import com.coss.types.Error; +import com.coss.types.SchedulingOutOfOffice; +import com.coss.types.SchedulingOutOfOfficeConflictList; +import com.coss.types.SchedulingOutOfOfficeList; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.io.IOException; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawOutOfOfficeClient { + protected final ClientOptions clientOptions; + + public RawOutOfOfficeClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * The environment's entries, newest first. + */ + public CossHttpResponse list() { + return list(ListOutOfOfficeRequest.builder().build()); + } + + /** + * The environment's entries, newest first. + */ + public CossHttpResponse list(RequestOptions requestOptions) { + return list(ListOutOfOfficeRequest.builder().build(), requestOptions); + } + + /** + * The environment's entries, newest first. + */ + public CossHttpResponse list(ListOutOfOfficeRequest request) { + return list(request, null); + } + + /** + * The environment's entries, newest first. + */ + public CossHttpResponse list( + ListOutOfOfficeRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("v1/scheduling/out_of_office"); + if (request.getLimit().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "limit", request.getLimit().get(), false); + } + if (request.getAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "after", request.getAfter().get(), false); + } + if (request.getHost().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "host", request.getHost().get(), false); + } + if (request.getStartAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "start_after", request.getStartAfter().get(), false); + } + if (request.getStartBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "start_before", request.getStartBefore().get(), false); + } + if (request.getGroup().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "group", request.getGroup().get(), false); + } + if (requestOptions != null) { + requestOptions.getQueryParameters().forEach((_key, _value) -> { + httpUrl.addQueryParameter(_key, _value); + }); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + if (requestOptions != null && requestOptions.getMaxRetries().isPresent()) { + okhttpRequest = okhttpRequest + .newBuilder() + .tag( + RetryInterceptor.MaxRetriesOverride.class, + new RetryInterceptor.MaxRetriesOverride( + requestOptions.getMaxRetries().get())) + .build(); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new CossHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, SchedulingOutOfOfficeList.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 422: + throw new UnprocessableEntityError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 500: + throw new InternalServerError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 503: + throw new ServiceUnavailableError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new CossApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (JsonProcessingException e) { + throw new CossException("Failed to deserialize response: " + e.getMessage(), e); + } catch (IOException e) { + throw new CossException("Network error executing HTTP request", e); + } + } + + /** + * Marks one host, a list of hosts or everyone matching some attributes as away, for part of a day or for whole dates. They aren't offered during it. Existing bookings stay as they are: list them with the entry's conflicts. + */ + public CossHttpResponse create() { + return create(CreateSchedulingOutOfOfficeRequest.builder().build()); + } + + /** + * Marks one host, a list of hosts or everyone matching some attributes as away, for part of a day or for whole dates. They aren't offered during it. Existing bookings stay as they are: list them with the entry's conflicts. + */ + public CossHttpResponse create(RequestOptions requestOptions) { + return create(CreateSchedulingOutOfOfficeRequest.builder().build(), requestOptions); + } + + /** + * Marks one host, a list of hosts or everyone matching some attributes as away, for part of a day or for whole dates. They aren't offered during it. Existing bookings stay as they are: list them with the entry's conflicts. + */ + public CossHttpResponse create(CreateSchedulingOutOfOfficeRequest request) { + return create(request, null); + } + + /** + * Marks one host, a list of hosts or everyone matching some attributes as away, for part of a day or for whole dates. They aren't offered during it. Existing bookings stay as they are: list them with the entry's conflicts. + */ + public CossHttpResponse create( + CreateSchedulingOutOfOfficeRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("v1/scheduling/out_of_office"); + if (requestOptions != null) { + requestOptions.getQueryParameters().forEach((_key, _value) -> { + httpUrl.addQueryParameter(_key, _value); + }); + } + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new CossException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl.build()) + .method("POST", body) + .headers(Headers.of(IdempotencyUtils.withGeneratedIdempotencyKey( + clientOptions.headers(requestOptions), "Idempotency-Key"))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + okhttpRequest = okhttpRequest + .newBuilder() + .tag(RetryInterceptor.MaxRetriesOverride.class, new RetryInterceptor.MaxRetriesOverride(0)) + .build(); + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new CossHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, SchedulingOutOfOfficeList.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 415: + throw new UnsupportedMediaTypeError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 422: + throw new UnprocessableEntityError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 500: + throw new InternalServerError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 503: + throw new ServiceUnavailableError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new CossApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (JsonProcessingException e) { + throw new CossException("Failed to deserialize response: " + e.getMessage(), e); + } catch (IOException e) { + throw new CossException("Network error executing HTTP request", e); + } + } + + /** + * One entry. + */ + public CossHttpResponse get(String id) { + return get(id, GetOutOfOfficeRequest.builder().build()); + } + + /** + * One entry. + */ + public CossHttpResponse get(String id, RequestOptions requestOptions) { + return get(id, GetOutOfOfficeRequest.builder().build(), requestOptions); + } + + /** + * One entry. + */ + public CossHttpResponse get(String id, GetOutOfOfficeRequest request) { + return get(id, request, null); + } + + /** + * One entry. + */ + public CossHttpResponse get( + String id, GetOutOfOfficeRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("v1/scheduling/out_of_office") + .addPathSegment(id); + if (requestOptions != null) { + requestOptions.getQueryParameters().forEach((_key, _value) -> { + httpUrl.addQueryParameter(_key, _value); + }); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + if (requestOptions != null && requestOptions.getMaxRetries().isPresent()) { + okhttpRequest = okhttpRequest + .newBuilder() + .tag( + RetryInterceptor.MaxRetriesOverride.class, + new RetryInterceptor.MaxRetriesOverride( + requestOptions.getMaxRetries().get())) + .build(); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new CossHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, SchedulingOutOfOffice.class), response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 500: + throw new InternalServerError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 503: + throw new ServiceUnavailableError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new CossApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (JsonProcessingException e) { + throw new CossException("Failed to deserialize response: " + e.getMessage(), e); + } catch (IOException e) { + throw new CossException("Network error executing HTTP request", e); + } + } + + /** + * The host can be booked in that time again, and any calendar event for it goes. + */ + public CossHttpResponse remove(String id) { + return remove(id, RemoveOutOfOfficeRequest.builder().build()); + } + + /** + * The host can be booked in that time again, and any calendar event for it goes. + */ + public CossHttpResponse remove(String id, RequestOptions requestOptions) { + return remove(id, RemoveOutOfOfficeRequest.builder().build(), requestOptions); + } + + /** + * The host can be booked in that time again, and any calendar event for it goes. + */ + public CossHttpResponse remove(String id, RemoveOutOfOfficeRequest request) { + return remove(id, request, null); + } + + /** + * The host can be booked in that time again, and any calendar event for it goes. + */ + public CossHttpResponse remove( + String id, RemoveOutOfOfficeRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("v1/scheduling/out_of_office") + .addPathSegment(id); + if (requestOptions != null) { + requestOptions.getQueryParameters().forEach((_key, _value) -> { + httpUrl.addQueryParameter(_key, _value); + }); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("DELETE", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + if (requestOptions != null && requestOptions.getMaxRetries().isPresent()) { + okhttpRequest = okhttpRequest + .newBuilder() + .tag( + RetryInterceptor.MaxRetriesOverride.class, + new RetryInterceptor.MaxRetriesOverride( + requestOptions.getMaxRetries().get())) + .build(); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new CossHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, DeletedSchedulingOutOfOffice.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 500: + throw new InternalServerError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 503: + throw new ServiceUnavailableError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new CossApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (JsonProcessingException e) { + throw new CossException("Failed to deserialize response: " + e.getMessage(), e); + } catch (IOException e) { + throw new CossException("Network error executing HTTP request", e); + } + } + + /** + * Changes what's given. An entry stays with its host. + */ + public CossHttpResponse update(String id) { + return update(id, UpdateSchedulingOutOfOfficeRequest.builder().build()); + } + + /** + * Changes what's given. An entry stays with its host. + */ + public CossHttpResponse update(String id, RequestOptions requestOptions) { + return update(id, UpdateSchedulingOutOfOfficeRequest.builder().build(), requestOptions); + } + + /** + * Changes what's given. An entry stays with its host. + */ + public CossHttpResponse update(String id, UpdateSchedulingOutOfOfficeRequest request) { + return update(id, request, null); + } + + /** + * Changes what's given. An entry stays with its host. + */ + public CossHttpResponse update( + String id, UpdateSchedulingOutOfOfficeRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("v1/scheduling/out_of_office") + .addPathSegment(id); + if (requestOptions != null) { + requestOptions.getQueryParameters().forEach((_key, _value) -> { + httpUrl.addQueryParameter(_key, _value); + }); + } + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new CossException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl.build()) + .method("PATCH", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + if (requestOptions != null && requestOptions.getMaxRetries().isPresent()) { + okhttpRequest = okhttpRequest + .newBuilder() + .tag( + RetryInterceptor.MaxRetriesOverride.class, + new RetryInterceptor.MaxRetriesOverride( + requestOptions.getMaxRetries().get())) + .build(); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new CossHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, SchedulingOutOfOffice.class), response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 415: + throw new UnsupportedMediaTypeError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 422: + throw new UnprocessableEntityError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 500: + throw new InternalServerError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 503: + throw new ServiceUnavailableError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new CossApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (JsonProcessingException e) { + throw new CossException("Failed to deserialize response: " + e.getMessage(), e); + } catch (IOException e) { + throw new CossException("Network error executing HTTP request", e); + } + } + + /** + * For syncing from a system of record such as an HR tool: send what it says, as often as you like, and there's one entry for it. Give every field you want to keep. + */ + public CossHttpResponse put(String externalId, PutSchedulingOutOfOfficeRequest request) { + return put(externalId, request, null); + } + + /** + * For syncing from a system of record such as an HR tool: send what it says, as often as you like, and there's one entry for it. Give every field you want to keep. + */ + public CossHttpResponse put( + String externalId, PutSchedulingOutOfOfficeRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("v1/scheduling/out_of_office/by_external_id") + .addPathSegment(externalId); + if (requestOptions != null) { + requestOptions.getQueryParameters().forEach((_key, _value) -> { + httpUrl.addQueryParameter(_key, _value); + }); + } + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new CossException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl.build()) + .method("PUT", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + if (requestOptions != null && requestOptions.getMaxRetries().isPresent()) { + okhttpRequest = okhttpRequest + .newBuilder() + .tag( + RetryInterceptor.MaxRetriesOverride.class, + new RetryInterceptor.MaxRetriesOverride( + requestOptions.getMaxRetries().get())) + .build(); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new CossHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, SchedulingOutOfOffice.class), response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 415: + throw new UnsupportedMediaTypeError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 422: + throw new UnprocessableEntityError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 500: + throw new InternalServerError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 503: + throw new ServiceUnavailableError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new CossApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (JsonProcessingException e) { + throw new CossException("Failed to deserialize response: " + e.getMessage(), e); + } catch (IOException e) { + throw new CossException("Network error executing HTTP request", e); + } + } + + /** + * Live bookings of the host that fall in the entry, soonest first. Entries never change them. + */ + public CossHttpResponse conflicts(String id) { + return conflicts(id, ConflictsOutOfOfficeRequest.builder().build()); + } + + /** + * Live bookings of the host that fall in the entry, soonest first. Entries never change them. + */ + public CossHttpResponse conflicts(String id, RequestOptions requestOptions) { + return conflicts(id, ConflictsOutOfOfficeRequest.builder().build(), requestOptions); + } + + /** + * Live bookings of the host that fall in the entry, soonest first. Entries never change them. + */ + public CossHttpResponse conflicts( + String id, ConflictsOutOfOfficeRequest request) { + return conflicts(id, request, null); + } + + /** + * Live bookings of the host that fall in the entry, soonest first. Entries never change them. + */ + public CossHttpResponse conflicts( + String id, ConflictsOutOfOfficeRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("v1/scheduling/out_of_office") + .addPathSegment(id) + .addPathSegments("conflicts"); + if (request.getLimit().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "limit", request.getLimit().get(), false); + } + if (requestOptions != null) { + requestOptions.getQueryParameters().forEach((_key, _value) -> { + httpUrl.addQueryParameter(_key, _value); + }); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + if (requestOptions != null && requestOptions.getMaxRetries().isPresent()) { + okhttpRequest = okhttpRequest + .newBuilder() + .tag( + RetryInterceptor.MaxRetriesOverride.class, + new RetryInterceptor.MaxRetriesOverride( + requestOptions.getMaxRetries().get())) + .build(); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new CossHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, SchedulingOutOfOfficeConflictList.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 422: + throw new UnprocessableEntityError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 500: + throw new InternalServerError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 503: + throw new ServiceUnavailableError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new CossApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (JsonProcessingException e) { + throw new CossException("Failed to deserialize response: " + e.getMessage(), e); + } catch (IOException e) { + throw new CossException("Network error executing HTTP request", e); + } + } +} diff --git a/sdks/java/src/main/java/com/coss/resources/scheduling/outofoffice/requests/ConflictsOutOfOfficeRequest.java b/sdks/java/src/main/java/com/coss/resources/scheduling/outofoffice/requests/ConflictsOutOfOfficeRequest.java new file mode 100644 index 000000000..c24401616 --- /dev/null +++ b/sdks/java/src/main/java/com/coss/resources/scheduling/outofoffice/requests/ConflictsOutOfOfficeRequest.java @@ -0,0 +1,105 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.coss.resources.scheduling.outofoffice.requests; + +import com.coss.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ConflictsOutOfOfficeRequest.Builder.class) +public final class ConflictsOutOfOfficeRequest { + private final Optional limit; + + private final Map additionalProperties; + + private ConflictsOutOfOfficeRequest(Optional limit, Map additionalProperties) { + this.limit = limit; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("limit") + public Optional getLimit() { + return limit; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ConflictsOutOfOfficeRequest && equalTo((ConflictsOutOfOfficeRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ConflictsOutOfOfficeRequest other) { + return limit.equals(other.limit); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.limit); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional limit = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ConflictsOutOfOfficeRequest other) { + limit(other.getLimit()); + return this; + } + + @JsonSetter(value = "limit", nulls = Nulls.SKIP) + public Builder limit(Optional limit) { + this.limit = limit; + return this; + } + + public Builder limit(Integer limit) { + this.limit = Optional.ofNullable(limit); + return this; + } + + public ConflictsOutOfOfficeRequest build() { + return new ConflictsOutOfOfficeRequest(limit, additionalProperties); + } + + public Builder additionalProperty(String key, Object value) { + this.additionalProperties.put(key, value); + return this; + } + + public Builder additionalProperties(Map additionalProperties) { + this.additionalProperties.putAll(additionalProperties); + return this; + } + } +} diff --git a/sdks/java/src/main/java/com/coss/resources/scheduling/outofoffice/requests/CreateSchedulingOutOfOfficeRequest.java b/sdks/java/src/main/java/com/coss/resources/scheduling/outofoffice/requests/CreateSchedulingOutOfOfficeRequest.java new file mode 100644 index 000000000..9401f8193 --- /dev/null +++ b/sdks/java/src/main/java/com/coss/resources/scheduling/outofoffice/requests/CreateSchedulingOutOfOfficeRequest.java @@ -0,0 +1,601 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.coss.resources.scheduling.outofoffice.requests; + +import com.coss.core.ObjectMappers; +import com.coss.resources.scheduling.outofoffice.types.CreateSchedulingOutOfOfficeRequestExistingBookings; +import com.coss.resources.scheduling.outofoffice.types.CreateSchedulingOutOfOfficeRequestHostFilterValue; +import com.coss.resources.scheduling.outofoffice.types.CreateSchedulingOutOfOfficeRequestReassign; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateSchedulingOutOfOfficeRequest.Builder.class) +public final class CreateSchedulingOutOfOfficeRequest { + private final Optional host; + + private final Optional> hosts; + + private final Optional> hostFilter; + + private final Optional start; + + private final Optional end; + + private final Optional startDate; + + private final Optional endDate; + + private final Optional timeZone; + + private final Optional> delegates; + + private final Optional reason; + + private final Optional notes; + + private final Optional publicMessage; + + private final Optional showOnCalendar; + + private final Optional existingBookings; + + private final Optional reassign; + + private final Optional externalId; + + private final Map additionalProperties; + + private CreateSchedulingOutOfOfficeRequest( + Optional host, + Optional> hosts, + Optional> hostFilter, + Optional start, + Optional end, + Optional startDate, + Optional endDate, + Optional timeZone, + Optional> delegates, + Optional reason, + Optional notes, + Optional publicMessage, + Optional showOnCalendar, + Optional existingBookings, + Optional reassign, + Optional externalId, + Map additionalProperties) { + this.host = host; + this.hosts = hosts; + this.hostFilter = hostFilter; + this.start = start; + this.end = end; + this.startDate = startDate; + this.endDate = endDate; + this.timeZone = timeZone; + this.delegates = delegates; + this.reason = reason; + this.notes = notes; + this.publicMessage = publicMessage; + this.showOnCalendar = showOnCalendar; + this.existingBookings = existingBookings; + this.reassign = reassign; + this.externalId = externalId; + this.additionalProperties = additionalProperties; + } + + /** + * @return One host, by id or uid. + */ + @JsonProperty("host") + public Optional getHost() { + return host; + } + + /** + * @return Several hosts, by id or uid. Each gets an entry of their own. + */ + @JsonProperty("hosts") + public Optional> getHosts() { + return hosts; + } + + /** + * @return Every active host matching these attributes right now. A host added later isn't covered. + */ + @JsonProperty("host_filter") + public Optional> getHostFilter() { + return hostFilter; + } + + /** + * @return An ISO 8601 instant with an offset. + */ + @JsonProperty("start") + public Optional getStart() { + return start; + } + + /** + * @return An ISO 8601 instant with an offset. + */ + @JsonProperty("end") + public Optional getEnd() { + return end; + } + + /** + * @return The first whole day away. Use instead of start and end. + */ + @JsonProperty("start_date") + public Optional getStartDate() { + return startDate; + } + + /** + * @return The last whole day away, which is included. + */ + @JsonProperty("end_date") + public Optional getEndDate() { + return endDate; + } + + /** + * @return What the dates mean in. Default: the host's zone when this is made. + */ + @JsonProperty("time_zone") + public Optional getTimeZone() { + return timeZone; + } + + /** + * @return Who can be booked in this host's place during it, by id or uid, in the order to try them. They still have to fit how a booking's routed. + */ + @JsonProperty("delegates") + public Optional> getDelegates() { + return delegates; + } + + /** + * @return One of unspecified, vacation, travel, sick, public_holiday, parental_leave, training and other, or a key from the settings' out_of_office_reasons. Only people who manage this host see it: never bookers, webhooks or calendars. + */ + @JsonProperty("reason") + public Optional getReason() { + return reason; + } + + /** + * @return For people who manage this host. Encrypted, and never shown to a booker. + */ + @JsonProperty("notes") + public Optional getNotes() { + return notes; + } + + /** + * @return Shown to bookers while this host is away. Can't contain a link. + */ + @JsonProperty("public_message") + public Optional getPublicMessage() { + return publicMessage; + } + + /** + * @return Put a private "Out of office" event on the host's calendar. Default: true. + */ + @JsonProperty("show_on_calendar") + public Optional getShowOnCalendar() { + return showOnCalendar; + } + + /** + * @return What happens to bookings already in the way. leave (the default) only reports them. reassign moves them, and any nobody can take stay where they are. + */ + @JsonProperty("existing_bookings") + public Optional getExistingBookings() { + return existingBookings; + } + + /** + * @return With existing_bookings: reassign: who they go to. Default: the fairest who's free. + */ + @JsonProperty("reassign") + public Optional getReassign() { + return reassign; + } + + /** + * @return Your own id for this entry, unique in the environment. Needs one host. + */ + @JsonProperty("external_id") + public Optional getExternalId() { + return externalId; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateSchedulingOutOfOfficeRequest + && equalTo((CreateSchedulingOutOfOfficeRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateSchedulingOutOfOfficeRequest other) { + return host.equals(other.host) + && hosts.equals(other.hosts) + && hostFilter.equals(other.hostFilter) + && start.equals(other.start) + && end.equals(other.end) + && startDate.equals(other.startDate) + && endDate.equals(other.endDate) + && timeZone.equals(other.timeZone) + && delegates.equals(other.delegates) + && reason.equals(other.reason) + && notes.equals(other.notes) + && publicMessage.equals(other.publicMessage) + && showOnCalendar.equals(other.showOnCalendar) + && existingBookings.equals(other.existingBookings) + && reassign.equals(other.reassign) + && externalId.equals(other.externalId); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.host, + this.hosts, + this.hostFilter, + this.start, + this.end, + this.startDate, + this.endDate, + this.timeZone, + this.delegates, + this.reason, + this.notes, + this.publicMessage, + this.showOnCalendar, + this.existingBookings, + this.reassign, + this.externalId); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional host = Optional.empty(); + + private Optional> hosts = Optional.empty(); + + private Optional> hostFilter = Optional.empty(); + + private Optional start = Optional.empty(); + + private Optional end = Optional.empty(); + + private Optional startDate = Optional.empty(); + + private Optional endDate = Optional.empty(); + + private Optional timeZone = Optional.empty(); + + private Optional> delegates = Optional.empty(); + + private Optional reason = Optional.empty(); + + private Optional notes = Optional.empty(); + + private Optional publicMessage = Optional.empty(); + + private Optional showOnCalendar = Optional.empty(); + + private Optional existingBookings = Optional.empty(); + + private Optional reassign = Optional.empty(); + + private Optional externalId = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(CreateSchedulingOutOfOfficeRequest other) { + host(other.getHost()); + hosts(other.getHosts()); + hostFilter(other.getHostFilter()); + start(other.getStart()); + end(other.getEnd()); + startDate(other.getStartDate()); + endDate(other.getEndDate()); + timeZone(other.getTimeZone()); + delegates(other.getDelegates()); + reason(other.getReason()); + notes(other.getNotes()); + publicMessage(other.getPublicMessage()); + showOnCalendar(other.getShowOnCalendar()); + existingBookings(other.getExistingBookings()); + reassign(other.getReassign()); + externalId(other.getExternalId()); + return this; + } + + /** + *

One host, by id or uid.

+ */ + @JsonSetter(value = "host", nulls = Nulls.SKIP) + public Builder host(Optional host) { + this.host = host; + return this; + } + + public Builder host(String host) { + this.host = Optional.ofNullable(host); + return this; + } + + /** + *

Several hosts, by id or uid. Each gets an entry of their own.

+ */ + @JsonSetter(value = "hosts", nulls = Nulls.SKIP) + public Builder hosts(Optional> hosts) { + this.hosts = hosts; + return this; + } + + public Builder hosts(List hosts) { + this.hosts = Optional.ofNullable(hosts); + return this; + } + + /** + *

Every active host matching these attributes right now. A host added later isn't covered.

+ */ + @JsonSetter(value = "host_filter", nulls = Nulls.SKIP) + public Builder hostFilter(Optional> hostFilter) { + this.hostFilter = hostFilter; + return this; + } + + public Builder hostFilter(Map hostFilter) { + this.hostFilter = Optional.ofNullable(hostFilter); + return this; + } + + /** + *

An ISO 8601 instant with an offset.

+ */ + @JsonSetter(value = "start", nulls = Nulls.SKIP) + public Builder start(Optional start) { + this.start = start; + return this; + } + + public Builder start(String start) { + this.start = Optional.ofNullable(start); + return this; + } + + /** + *

An ISO 8601 instant with an offset.

+ */ + @JsonSetter(value = "end", nulls = Nulls.SKIP) + public Builder end(Optional end) { + this.end = end; + return this; + } + + public Builder end(String end) { + this.end = Optional.ofNullable(end); + return this; + } + + /** + *

The first whole day away. Use instead of start and end.

+ */ + @JsonSetter(value = "start_date", nulls = Nulls.SKIP) + public Builder startDate(Optional startDate) { + this.startDate = startDate; + return this; + } + + public Builder startDate(String startDate) { + this.startDate = Optional.ofNullable(startDate); + return this; + } + + /** + *

The last whole day away, which is included.

+ */ + @JsonSetter(value = "end_date", nulls = Nulls.SKIP) + public Builder endDate(Optional endDate) { + this.endDate = endDate; + return this; + } + + public Builder endDate(String endDate) { + this.endDate = Optional.ofNullable(endDate); + return this; + } + + /** + *

What the dates mean in. Default: the host's zone when this is made.

+ */ + @JsonSetter(value = "time_zone", nulls = Nulls.SKIP) + public Builder timeZone(Optional timeZone) { + this.timeZone = timeZone; + return this; + } + + public Builder timeZone(String timeZone) { + this.timeZone = Optional.ofNullable(timeZone); + return this; + } + + /** + *

Who can be booked in this host's place during it, by id or uid, in the order to try them. They still have to fit how a booking's routed.

+ */ + @JsonSetter(value = "delegates", nulls = Nulls.SKIP) + public Builder delegates(Optional> delegates) { + this.delegates = delegates; + return this; + } + + public Builder delegates(List delegates) { + this.delegates = Optional.ofNullable(delegates); + return this; + } + + /** + *

One of unspecified, vacation, travel, sick, public_holiday, parental_leave, training and other, or a key from the settings' out_of_office_reasons. Only people who manage this host see it: never bookers, webhooks or calendars.

+ */ + @JsonSetter(value = "reason", nulls = Nulls.SKIP) + public Builder reason(Optional reason) { + this.reason = reason; + return this; + } + + public Builder reason(String reason) { + this.reason = Optional.ofNullable(reason); + return this; + } + + /** + *

For people who manage this host. Encrypted, and never shown to a booker.

+ */ + @JsonSetter(value = "notes", nulls = Nulls.SKIP) + public Builder notes(Optional notes) { + this.notes = notes; + return this; + } + + public Builder notes(String notes) { + this.notes = Optional.ofNullable(notes); + return this; + } + + /** + *

Shown to bookers while this host is away. Can't contain a link.

+ */ + @JsonSetter(value = "public_message", nulls = Nulls.SKIP) + public Builder publicMessage(Optional publicMessage) { + this.publicMessage = publicMessage; + return this; + } + + public Builder publicMessage(String publicMessage) { + this.publicMessage = Optional.ofNullable(publicMessage); + return this; + } + + /** + *

Put a private "Out of office" event on the host's calendar. Default: true.

+ */ + @JsonSetter(value = "show_on_calendar", nulls = Nulls.SKIP) + public Builder showOnCalendar(Optional showOnCalendar) { + this.showOnCalendar = showOnCalendar; + return this; + } + + public Builder showOnCalendar(Boolean showOnCalendar) { + this.showOnCalendar = Optional.ofNullable(showOnCalendar); + return this; + } + + /** + *

What happens to bookings already in the way. leave (the default) only reports them. reassign moves them, and any nobody can take stay where they are.

+ */ + @JsonSetter(value = "existing_bookings", nulls = Nulls.SKIP) + public Builder existingBookings(Optional existingBookings) { + this.existingBookings = existingBookings; + return this; + } + + public Builder existingBookings(CreateSchedulingOutOfOfficeRequestExistingBookings existingBookings) { + this.existingBookings = Optional.ofNullable(existingBookings); + return this; + } + + /** + *

With existing_bookings: reassign: who they go to. Default: the fairest who's free.

+ */ + @JsonSetter(value = "reassign", nulls = Nulls.SKIP) + public Builder reassign(Optional reassign) { + this.reassign = reassign; + return this; + } + + public Builder reassign(CreateSchedulingOutOfOfficeRequestReassign reassign) { + this.reassign = Optional.ofNullable(reassign); + return this; + } + + /** + *

Your own id for this entry, unique in the environment. Needs one host.

+ */ + @JsonSetter(value = "external_id", nulls = Nulls.SKIP) + public Builder externalId(Optional externalId) { + this.externalId = externalId; + return this; + } + + public Builder externalId(String externalId) { + this.externalId = Optional.ofNullable(externalId); + return this; + } + + public CreateSchedulingOutOfOfficeRequest build() { + return new CreateSchedulingOutOfOfficeRequest( + host, + hosts, + hostFilter, + start, + end, + startDate, + endDate, + timeZone, + delegates, + reason, + notes, + publicMessage, + showOnCalendar, + existingBookings, + reassign, + externalId, + additionalProperties); + } + + public Builder additionalProperty(String key, Object value) { + this.additionalProperties.put(key, value); + return this; + } + + public Builder additionalProperties(Map additionalProperties) { + this.additionalProperties.putAll(additionalProperties); + return this; + } + } +} diff --git a/sdks/java/src/main/java/com/coss/resources/scheduling/outofoffice/requests/GetOutOfOfficeRequest.java b/sdks/java/src/main/java/com/coss/resources/scheduling/outofoffice/requests/GetOutOfOfficeRequest.java new file mode 100644 index 000000000..554ce381b --- /dev/null +++ b/sdks/java/src/main/java/com/coss/resources/scheduling/outofoffice/requests/GetOutOfOfficeRequest.java @@ -0,0 +1,69 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.coss.resources.scheduling.outofoffice.requests; + +import com.coss.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = GetOutOfOfficeRequest.Builder.class) +public final class GetOutOfOfficeRequest { + private final Map additionalProperties; + + private GetOutOfOfficeRequest(Map additionalProperties) { + this.additionalProperties = additionalProperties; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof GetOutOfOfficeRequest; + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(GetOutOfOfficeRequest other) { + return this; + } + + public GetOutOfOfficeRequest build() { + return new GetOutOfOfficeRequest(additionalProperties); + } + + public Builder additionalProperty(String key, Object value) { + this.additionalProperties.put(key, value); + return this; + } + + public Builder additionalProperties(Map additionalProperties) { + this.additionalProperties.putAll(additionalProperties); + return this; + } + } +} diff --git a/sdks/java/src/main/java/com/coss/resources/scheduling/outofoffice/requests/ListOutOfOfficeRequest.java b/sdks/java/src/main/java/com/coss/resources/scheduling/outofoffice/requests/ListOutOfOfficeRequest.java new file mode 100644 index 000000000..b31d81510 --- /dev/null +++ b/sdks/java/src/main/java/com/coss/resources/scheduling/outofoffice/requests/ListOutOfOfficeRequest.java @@ -0,0 +1,257 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.coss.resources.scheduling.outofoffice.requests; + +import com.coss.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ListOutOfOfficeRequest.Builder.class) +public final class ListOutOfOfficeRequest { + private final Optional limit; + + private final Optional after; + + private final Optional host; + + private final Optional startAfter; + + private final Optional startBefore; + + private final Optional group; + + private final Map additionalProperties; + + private ListOutOfOfficeRequest( + Optional limit, + Optional after, + Optional host, + Optional startAfter, + Optional startBefore, + Optional group, + Map additionalProperties) { + this.limit = limit; + this.after = after; + this.host = host; + this.startAfter = startAfter; + this.startBefore = startBefore; + this.group = group; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("limit") + public Optional getLimit() { + return limit; + } + + /** + * @return The last id of the previous page. + */ + @JsonProperty("after") + public Optional getAfter() { + return after; + } + + /** + * @return One host's entries, by id or uid. + */ + @JsonProperty("host") + public Optional getHost() { + return host; + } + + /** + * @return Entries ending after this. + */ + @JsonProperty("start_after") + public Optional getStartAfter() { + return startAfter; + } + + /** + * @return Entries starting before this. + */ + @JsonProperty("start_before") + public Optional getStartBefore() { + return startBefore; + } + + /** + * @return The entries one request made. + */ + @JsonProperty("group") + public Optional getGroup() { + return group; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ListOutOfOfficeRequest && equalTo((ListOutOfOfficeRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ListOutOfOfficeRequest other) { + return limit.equals(other.limit) + && after.equals(other.after) + && host.equals(other.host) + && startAfter.equals(other.startAfter) + && startBefore.equals(other.startBefore) + && group.equals(other.group); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.limit, this.after, this.host, this.startAfter, this.startBefore, this.group); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional limit = Optional.empty(); + + private Optional after = Optional.empty(); + + private Optional host = Optional.empty(); + + private Optional startAfter = Optional.empty(); + + private Optional startBefore = Optional.empty(); + + private Optional group = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ListOutOfOfficeRequest other) { + limit(other.getLimit()); + after(other.getAfter()); + host(other.getHost()); + startAfter(other.getStartAfter()); + startBefore(other.getStartBefore()); + group(other.getGroup()); + return this; + } + + @JsonSetter(value = "limit", nulls = Nulls.SKIP) + public Builder limit(Optional limit) { + this.limit = limit; + return this; + } + + public Builder limit(Integer limit) { + this.limit = Optional.ofNullable(limit); + return this; + } + + /** + *

The last id of the previous page.

+ */ + @JsonSetter(value = "after", nulls = Nulls.SKIP) + public Builder after(Optional after) { + this.after = after; + return this; + } + + public Builder after(String after) { + this.after = Optional.ofNullable(after); + return this; + } + + /** + *

One host's entries, by id or uid.

+ */ + @JsonSetter(value = "host", nulls = Nulls.SKIP) + public Builder host(Optional host) { + this.host = host; + return this; + } + + public Builder host(String host) { + this.host = Optional.ofNullable(host); + return this; + } + + /** + *

Entries ending after this.

+ */ + @JsonSetter(value = "start_after", nulls = Nulls.SKIP) + public Builder startAfter(Optional startAfter) { + this.startAfter = startAfter; + return this; + } + + public Builder startAfter(String startAfter) { + this.startAfter = Optional.ofNullable(startAfter); + return this; + } + + /** + *

Entries starting before this.

+ */ + @JsonSetter(value = "start_before", nulls = Nulls.SKIP) + public Builder startBefore(Optional startBefore) { + this.startBefore = startBefore; + return this; + } + + public Builder startBefore(String startBefore) { + this.startBefore = Optional.ofNullable(startBefore); + return this; + } + + /** + *

The entries one request made.

+ */ + @JsonSetter(value = "group", nulls = Nulls.SKIP) + public Builder group(Optional group) { + this.group = group; + return this; + } + + public Builder group(String group) { + this.group = Optional.ofNullable(group); + return this; + } + + public ListOutOfOfficeRequest build() { + return new ListOutOfOfficeRequest(limit, after, host, startAfter, startBefore, group, additionalProperties); + } + + public Builder additionalProperty(String key, Object value) { + this.additionalProperties.put(key, value); + return this; + } + + public Builder additionalProperties(Map additionalProperties) { + this.additionalProperties.putAll(additionalProperties); + return this; + } + } +} diff --git a/sdks/java/src/main/java/com/coss/resources/scheduling/outofoffice/requests/PutSchedulingOutOfOfficeRequest.java b/sdks/java/src/main/java/com/coss/resources/scheduling/outofoffice/requests/PutSchedulingOutOfOfficeRequest.java new file mode 100644 index 000000000..4d9f2a291 --- /dev/null +++ b/sdks/java/src/main/java/com/coss/resources/scheduling/outofoffice/requests/PutSchedulingOutOfOfficeRequest.java @@ -0,0 +1,679 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.coss.resources.scheduling.outofoffice.requests; + +import com.coss.core.ObjectMappers; +import com.coss.resources.scheduling.outofoffice.types.PutSchedulingOutOfOfficeRequestExistingBookings; +import com.coss.resources.scheduling.outofoffice.types.PutSchedulingOutOfOfficeRequestReassign; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PutSchedulingOutOfOfficeRequest.Builder.class) +public final class PutSchedulingOutOfOfficeRequest { + private final String host; + + private final Optional start; + + private final Optional end; + + private final Optional startDate; + + private final Optional endDate; + + private final Optional timeZone; + + private final Optional> delegates; + + private final Optional reason; + + private final Optional notes; + + private final Optional publicMessage; + + private final Optional showOnCalendar; + + private final Optional existingBookings; + + private final Optional reassign; + + private final Map additionalProperties; + + private PutSchedulingOutOfOfficeRequest( + String host, + Optional start, + Optional end, + Optional startDate, + Optional endDate, + Optional timeZone, + Optional> delegates, + Optional reason, + Optional notes, + Optional publicMessage, + Optional showOnCalendar, + Optional existingBookings, + Optional reassign, + Map additionalProperties) { + this.host = host; + this.start = start; + this.end = end; + this.startDate = startDate; + this.endDate = endDate; + this.timeZone = timeZone; + this.delegates = delegates; + this.reason = reason; + this.notes = notes; + this.publicMessage = publicMessage; + this.showOnCalendar = showOnCalendar; + this.existingBookings = existingBookings; + this.reassign = reassign; + this.additionalProperties = additionalProperties; + } + + /** + * @return The host, by id or uid. + */ + @JsonProperty("host") + public String getHost() { + return host; + } + + /** + * @return An ISO 8601 instant with an offset. + */ + @JsonProperty("start") + public Optional getStart() { + return start; + } + + /** + * @return An ISO 8601 instant with an offset. + */ + @JsonProperty("end") + public Optional getEnd() { + return end; + } + + /** + * @return The first whole day away. Use instead of start and end. + */ + @JsonProperty("start_date") + public Optional getStartDate() { + return startDate; + } + + /** + * @return The last whole day away, which is included. + */ + @JsonProperty("end_date") + public Optional getEndDate() { + return endDate; + } + + /** + * @return What the dates mean in. Default: the host's zone when this is made. + */ + @JsonProperty("time_zone") + public Optional getTimeZone() { + return timeZone; + } + + /** + * @return Who can be booked in this host's place during it, by id or uid, in the order to try them. They still have to fit how a booking's routed. + */ + @JsonProperty("delegates") + public Optional> getDelegates() { + return delegates; + } + + /** + * @return One of unspecified, vacation, travel, sick, public_holiday, parental_leave, training and other, or a key from the settings' out_of_office_reasons. Only people who manage this host see it: never bookers, webhooks or calendars. + */ + @JsonProperty("reason") + public Optional getReason() { + return reason; + } + + /** + * @return For people who manage this host. Encrypted, and never shown to a booker. + */ + @JsonProperty("notes") + public Optional getNotes() { + return notes; + } + + /** + * @return Shown to bookers while this host is away. Can't contain a link. + */ + @JsonProperty("public_message") + public Optional getPublicMessage() { + return publicMessage; + } + + /** + * @return Put a private "Out of office" event on the host's calendar. Default: true. + */ + @JsonProperty("show_on_calendar") + public Optional getShowOnCalendar() { + return showOnCalendar; + } + + /** + * @return What happens to bookings already in the way. leave (the default) only reports them. reassign moves them, and any nobody can take stay where they are. + */ + @JsonProperty("existing_bookings") + public Optional getExistingBookings() { + return existingBookings; + } + + /** + * @return With existing_bookings: reassign: who they go to. Default: the fairest who's free. + */ + @JsonProperty("reassign") + public Optional getReassign() { + return reassign; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PutSchedulingOutOfOfficeRequest && equalTo((PutSchedulingOutOfOfficeRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PutSchedulingOutOfOfficeRequest other) { + return host.equals(other.host) + && start.equals(other.start) + && end.equals(other.end) + && startDate.equals(other.startDate) + && endDate.equals(other.endDate) + && timeZone.equals(other.timeZone) + && delegates.equals(other.delegates) + && reason.equals(other.reason) + && notes.equals(other.notes) + && publicMessage.equals(other.publicMessage) + && showOnCalendar.equals(other.showOnCalendar) + && existingBookings.equals(other.existingBookings) + && reassign.equals(other.reassign); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.host, + this.start, + this.end, + this.startDate, + this.endDate, + this.timeZone, + this.delegates, + this.reason, + this.notes, + this.publicMessage, + this.showOnCalendar, + this.existingBookings, + this.reassign); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static HostStage builder() { + return new Builder(); + } + + public interface HostStage { + /** + *

The host, by id or uid.

+ */ + _FinalStage host(@NotNull String host); + + Builder from(PutSchedulingOutOfOfficeRequest other); + } + + public interface _FinalStage { + PutSchedulingOutOfOfficeRequest build(); + + _FinalStage additionalProperty(String key, Object value); + + _FinalStage additionalProperties(Map additionalProperties); + + /** + *

An ISO 8601 instant with an offset.

+ */ + _FinalStage start(Optional start); + + _FinalStage start(String start); + + /** + *

An ISO 8601 instant with an offset.

+ */ + _FinalStage end(Optional end); + + _FinalStage end(String end); + + /** + *

The first whole day away. Use instead of start and end.

+ */ + _FinalStage startDate(Optional startDate); + + _FinalStage startDate(String startDate); + + /** + *

The last whole day away, which is included.

+ */ + _FinalStage endDate(Optional endDate); + + _FinalStage endDate(String endDate); + + /** + *

What the dates mean in. Default: the host's zone when this is made.

+ */ + _FinalStage timeZone(Optional timeZone); + + _FinalStage timeZone(String timeZone); + + /** + *

Who can be booked in this host's place during it, by id or uid, in the order to try them. They still have to fit how a booking's routed.

+ */ + _FinalStage delegates(Optional> delegates); + + _FinalStage delegates(List delegates); + + /** + *

One of unspecified, vacation, travel, sick, public_holiday, parental_leave, training and other, or a key from the settings' out_of_office_reasons. Only people who manage this host see it: never bookers, webhooks or calendars.

+ */ + _FinalStage reason(Optional reason); + + _FinalStage reason(String reason); + + /** + *

For people who manage this host. Encrypted, and never shown to a booker.

+ */ + _FinalStage notes(Optional notes); + + _FinalStage notes(String notes); + + /** + *

Shown to bookers while this host is away. Can't contain a link.

+ */ + _FinalStage publicMessage(Optional publicMessage); + + _FinalStage publicMessage(String publicMessage); + + /** + *

Put a private "Out of office" event on the host's calendar. Default: true.

+ */ + _FinalStage showOnCalendar(Optional showOnCalendar); + + _FinalStage showOnCalendar(Boolean showOnCalendar); + + /** + *

What happens to bookings already in the way. leave (the default) only reports them. reassign moves them, and any nobody can take stay where they are.

+ */ + _FinalStage existingBookings(Optional existingBookings); + + _FinalStage existingBookings(PutSchedulingOutOfOfficeRequestExistingBookings existingBookings); + + /** + *

With existing_bookings: reassign: who they go to. Default: the fairest who's free.

+ */ + _FinalStage reassign(Optional reassign); + + _FinalStage reassign(PutSchedulingOutOfOfficeRequestReassign reassign); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements HostStage, _FinalStage { + private String host; + + private Optional reassign = Optional.empty(); + + private Optional existingBookings = Optional.empty(); + + private Optional showOnCalendar = Optional.empty(); + + private Optional publicMessage = Optional.empty(); + + private Optional notes = Optional.empty(); + + private Optional reason = Optional.empty(); + + private Optional> delegates = Optional.empty(); + + private Optional timeZone = Optional.empty(); + + private Optional endDate = Optional.empty(); + + private Optional startDate = Optional.empty(); + + private Optional end = Optional.empty(); + + private Optional start = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(PutSchedulingOutOfOfficeRequest other) { + host(other.getHost()); + start(other.getStart()); + end(other.getEnd()); + startDate(other.getStartDate()); + endDate(other.getEndDate()); + timeZone(other.getTimeZone()); + delegates(other.getDelegates()); + reason(other.getReason()); + notes(other.getNotes()); + publicMessage(other.getPublicMessage()); + showOnCalendar(other.getShowOnCalendar()); + existingBookings(other.getExistingBookings()); + reassign(other.getReassign()); + return this; + } + + /** + *

The host, by id or uid.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("host") + public _FinalStage host(@NotNull String host) { + this.host = Objects.requireNonNull(host, "host must not be null"); + return this; + } + + /** + *

With existing_bookings: reassign: who they go to. Default: the fairest who's free.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage reassign(PutSchedulingOutOfOfficeRequestReassign reassign) { + this.reassign = Optional.ofNullable(reassign); + return this; + } + + /** + *

With existing_bookings: reassign: who they go to. Default: the fairest who's free.

+ */ + @java.lang.Override + @JsonSetter(value = "reassign", nulls = Nulls.SKIP) + public _FinalStage reassign(Optional reassign) { + this.reassign = reassign; + return this; + } + + /** + *

What happens to bookings already in the way. leave (the default) only reports them. reassign moves them, and any nobody can take stay where they are.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage existingBookings(PutSchedulingOutOfOfficeRequestExistingBookings existingBookings) { + this.existingBookings = Optional.ofNullable(existingBookings); + return this; + } + + /** + *

What happens to bookings already in the way. leave (the default) only reports them. reassign moves them, and any nobody can take stay where they are.

+ */ + @java.lang.Override + @JsonSetter(value = "existing_bookings", nulls = Nulls.SKIP) + public _FinalStage existingBookings( + Optional existingBookings) { + this.existingBookings = existingBookings; + return this; + } + + /** + *

Put a private "Out of office" event on the host's calendar. Default: true.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage showOnCalendar(Boolean showOnCalendar) { + this.showOnCalendar = Optional.ofNullable(showOnCalendar); + return this; + } + + /** + *

Put a private "Out of office" event on the host's calendar. Default: true.

+ */ + @java.lang.Override + @JsonSetter(value = "show_on_calendar", nulls = Nulls.SKIP) + public _FinalStage showOnCalendar(Optional showOnCalendar) { + this.showOnCalendar = showOnCalendar; + return this; + } + + /** + *

Shown to bookers while this host is away. Can't contain a link.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage publicMessage(String publicMessage) { + this.publicMessage = Optional.ofNullable(publicMessage); + return this; + } + + /** + *

Shown to bookers while this host is away. Can't contain a link.

+ */ + @java.lang.Override + @JsonSetter(value = "public_message", nulls = Nulls.SKIP) + public _FinalStage publicMessage(Optional publicMessage) { + this.publicMessage = publicMessage; + return this; + } + + /** + *

For people who manage this host. Encrypted, and never shown to a booker.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage notes(String notes) { + this.notes = Optional.ofNullable(notes); + return this; + } + + /** + *

For people who manage this host. Encrypted, and never shown to a booker.

+ */ + @java.lang.Override + @JsonSetter(value = "notes", nulls = Nulls.SKIP) + public _FinalStage notes(Optional notes) { + this.notes = notes; + return this; + } + + /** + *

One of unspecified, vacation, travel, sick, public_holiday, parental_leave, training and other, or a key from the settings' out_of_office_reasons. Only people who manage this host see it: never bookers, webhooks or calendars.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage reason(String reason) { + this.reason = Optional.ofNullable(reason); + return this; + } + + /** + *

One of unspecified, vacation, travel, sick, public_holiday, parental_leave, training and other, or a key from the settings' out_of_office_reasons. Only people who manage this host see it: never bookers, webhooks or calendars.

+ */ + @java.lang.Override + @JsonSetter(value = "reason", nulls = Nulls.SKIP) + public _FinalStage reason(Optional reason) { + this.reason = reason; + return this; + } + + /** + *

Who can be booked in this host's place during it, by id or uid, in the order to try them. They still have to fit how a booking's routed.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage delegates(List delegates) { + this.delegates = Optional.ofNullable(delegates); + return this; + } + + /** + *

Who can be booked in this host's place during it, by id or uid, in the order to try them. They still have to fit how a booking's routed.

+ */ + @java.lang.Override + @JsonSetter(value = "delegates", nulls = Nulls.SKIP) + public _FinalStage delegates(Optional> delegates) { + this.delegates = delegates; + return this; + } + + /** + *

What the dates mean in. Default: the host's zone when this is made.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage timeZone(String timeZone) { + this.timeZone = Optional.ofNullable(timeZone); + return this; + } + + /** + *

What the dates mean in. Default: the host's zone when this is made.

+ */ + @java.lang.Override + @JsonSetter(value = "time_zone", nulls = Nulls.SKIP) + public _FinalStage timeZone(Optional timeZone) { + this.timeZone = timeZone; + return this; + } + + /** + *

The last whole day away, which is included.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage endDate(String endDate) { + this.endDate = Optional.ofNullable(endDate); + return this; + } + + /** + *

The last whole day away, which is included.

+ */ + @java.lang.Override + @JsonSetter(value = "end_date", nulls = Nulls.SKIP) + public _FinalStage endDate(Optional endDate) { + this.endDate = endDate; + return this; + } + + /** + *

The first whole day away. Use instead of start and end.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage startDate(String startDate) { + this.startDate = Optional.ofNullable(startDate); + return this; + } + + /** + *

The first whole day away. Use instead of start and end.

+ */ + @java.lang.Override + @JsonSetter(value = "start_date", nulls = Nulls.SKIP) + public _FinalStage startDate(Optional startDate) { + this.startDate = startDate; + return this; + } + + /** + *

An ISO 8601 instant with an offset.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage end(String end) { + this.end = Optional.ofNullable(end); + return this; + } + + /** + *

An ISO 8601 instant with an offset.

+ */ + @java.lang.Override + @JsonSetter(value = "end", nulls = Nulls.SKIP) + public _FinalStage end(Optional end) { + this.end = end; + return this; + } + + /** + *

An ISO 8601 instant with an offset.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage start(String start) { + this.start = Optional.ofNullable(start); + return this; + } + + /** + *

An ISO 8601 instant with an offset.

+ */ + @java.lang.Override + @JsonSetter(value = "start", nulls = Nulls.SKIP) + public _FinalStage start(Optional start) { + this.start = start; + return this; + } + + @java.lang.Override + public PutSchedulingOutOfOfficeRequest build() { + return new PutSchedulingOutOfOfficeRequest( + host, + start, + end, + startDate, + endDate, + timeZone, + delegates, + reason, + notes, + publicMessage, + showOnCalendar, + existingBookings, + reassign, + additionalProperties); + } + + @java.lang.Override + public Builder additionalProperty(String key, Object value) { + this.additionalProperties.put(key, value); + return this; + } + + @java.lang.Override + public Builder additionalProperties(Map additionalProperties) { + this.additionalProperties.putAll(additionalProperties); + return this; + } + } +} diff --git a/sdks/java/src/main/java/com/coss/resources/scheduling/outofoffice/requests/RemoveOutOfOfficeRequest.java b/sdks/java/src/main/java/com/coss/resources/scheduling/outofoffice/requests/RemoveOutOfOfficeRequest.java new file mode 100644 index 000000000..754d4ba4e --- /dev/null +++ b/sdks/java/src/main/java/com/coss/resources/scheduling/outofoffice/requests/RemoveOutOfOfficeRequest.java @@ -0,0 +1,69 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.coss.resources.scheduling.outofoffice.requests; + +import com.coss.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = RemoveOutOfOfficeRequest.Builder.class) +public final class RemoveOutOfOfficeRequest { + private final Map additionalProperties; + + private RemoveOutOfOfficeRequest(Map additionalProperties) { + this.additionalProperties = additionalProperties; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof RemoveOutOfOfficeRequest; + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(RemoveOutOfOfficeRequest other) { + return this; + } + + public RemoveOutOfOfficeRequest build() { + return new RemoveOutOfOfficeRequest(additionalProperties); + } + + public Builder additionalProperty(String key, Object value) { + this.additionalProperties.put(key, value); + return this; + } + + public Builder additionalProperties(Map additionalProperties) { + this.additionalProperties.putAll(additionalProperties); + return this; + } + } +} diff --git a/sdks/java/src/main/java/com/coss/resources/scheduling/outofoffice/requests/UpdateSchedulingOutOfOfficeRequest.java b/sdks/java/src/main/java/com/coss/resources/scheduling/outofoffice/requests/UpdateSchedulingOutOfOfficeRequest.java new file mode 100644 index 000000000..0de51b7e5 --- /dev/null +++ b/sdks/java/src/main/java/com/coss/resources/scheduling/outofoffice/requests/UpdateSchedulingOutOfOfficeRequest.java @@ -0,0 +1,517 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.coss.resources.scheduling.outofoffice.requests; + +import com.coss.core.Nullable; +import com.coss.core.NullableNonemptyFilter; +import com.coss.core.ObjectMappers; +import com.coss.core.OptionalNullable; +import com.coss.resources.scheduling.outofoffice.types.UpdateSchedulingOutOfOfficeRequestExistingBookings; +import com.coss.resources.scheduling.outofoffice.types.UpdateSchedulingOutOfOfficeRequestReassign; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = UpdateSchedulingOutOfOfficeRequest.Builder.class) +public final class UpdateSchedulingOutOfOfficeRequest { + private final Optional start; + + private final Optional end; + + private final Optional startDate; + + private final Optional endDate; + + private final Optional timeZone; + + private final Optional reason; + + private final OptionalNullable notes; + + private final OptionalNullable publicMessage; + + private final Optional showOnCalendar; + + private final Optional> delegates; + + private final Optional existingBookings; + + private final Optional reassign; + + private final Map additionalProperties; + + private UpdateSchedulingOutOfOfficeRequest( + Optional start, + Optional end, + Optional startDate, + Optional endDate, + Optional timeZone, + Optional reason, + OptionalNullable notes, + OptionalNullable publicMessage, + Optional showOnCalendar, + Optional> delegates, + Optional existingBookings, + Optional reassign, + Map additionalProperties) { + this.start = start; + this.end = end; + this.startDate = startDate; + this.endDate = endDate; + this.timeZone = timeZone; + this.reason = reason; + this.notes = notes; + this.publicMessage = publicMessage; + this.showOnCalendar = showOnCalendar; + this.delegates = delegates; + this.existingBookings = existingBookings; + this.reassign = reassign; + this.additionalProperties = additionalProperties; + } + + /** + * @return An ISO 8601 instant with an offset. + */ + @JsonProperty("start") + public Optional getStart() { + return start; + } + + /** + * @return An ISO 8601 instant with an offset. + */ + @JsonProperty("end") + public Optional getEnd() { + return end; + } + + /** + * @return The first whole day away. Use instead of start and end. + */ + @JsonProperty("start_date") + public Optional getStartDate() { + return startDate; + } + + /** + * @return The last whole day away, which is included. + */ + @JsonProperty("end_date") + public Optional getEndDate() { + return endDate; + } + + /** + * @return What the dates mean in. Default: the host's zone when this is made. + */ + @JsonProperty("time_zone") + public Optional getTimeZone() { + return timeZone; + } + + /** + * @return One of unspecified, vacation, travel, sick, public_holiday, parental_leave, training and other, or a key from the settings' out_of_office_reasons. Only people who manage this host see it: never bookers, webhooks or calendars. + */ + @JsonProperty("reason") + public Optional getReason() { + return reason; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("notes") + public OptionalNullable getNotes() { + if (notes == null) { + return OptionalNullable.absent(); + } + return notes; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("public_message") + public OptionalNullable getPublicMessage() { + if (publicMessage == null) { + return OptionalNullable.absent(); + } + return publicMessage; + } + + @JsonProperty("show_on_calendar") + public Optional getShowOnCalendar() { + return showOnCalendar; + } + + /** + * @return Who can be booked in this host's place during it, by id or uid, in the order to try them. They still have to fit how a booking's routed. + */ + @JsonProperty("delegates") + public Optional> getDelegates() { + return delegates; + } + + /** + * @return What happens to bookings already in the way. leave (the default) only reports them. reassign moves them, and any nobody can take stay where they are. + */ + @JsonProperty("existing_bookings") + public Optional getExistingBookings() { + return existingBookings; + } + + /** + * @return With existing_bookings: reassign: who they go to. Default: the fairest who's free. + */ + @JsonProperty("reassign") + public Optional getReassign() { + return reassign; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("notes") + private OptionalNullable _getNotes() { + return notes; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("public_message") + private OptionalNullable _getPublicMessage() { + return publicMessage; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UpdateSchedulingOutOfOfficeRequest + && equalTo((UpdateSchedulingOutOfOfficeRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UpdateSchedulingOutOfOfficeRequest other) { + return start.equals(other.start) + && end.equals(other.end) + && startDate.equals(other.startDate) + && endDate.equals(other.endDate) + && timeZone.equals(other.timeZone) + && reason.equals(other.reason) + && notes.equals(other.notes) + && publicMessage.equals(other.publicMessage) + && showOnCalendar.equals(other.showOnCalendar) + && delegates.equals(other.delegates) + && existingBookings.equals(other.existingBookings) + && reassign.equals(other.reassign); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.start, + this.end, + this.startDate, + this.endDate, + this.timeZone, + this.reason, + this.notes, + this.publicMessage, + this.showOnCalendar, + this.delegates, + this.existingBookings, + this.reassign); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional start = Optional.empty(); + + private Optional end = Optional.empty(); + + private Optional startDate = Optional.empty(); + + private Optional endDate = Optional.empty(); + + private Optional timeZone = Optional.empty(); + + private Optional reason = Optional.empty(); + + private OptionalNullable notes = OptionalNullable.absent(); + + private OptionalNullable publicMessage = OptionalNullable.absent(); + + private Optional showOnCalendar = Optional.empty(); + + private Optional> delegates = Optional.empty(); + + private Optional existingBookings = Optional.empty(); + + private Optional reassign = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(UpdateSchedulingOutOfOfficeRequest other) { + start(other.getStart()); + end(other.getEnd()); + startDate(other.getStartDate()); + endDate(other.getEndDate()); + timeZone(other.getTimeZone()); + reason(other.getReason()); + notes(other.getNotes()); + publicMessage(other.getPublicMessage()); + showOnCalendar(other.getShowOnCalendar()); + delegates(other.getDelegates()); + existingBookings(other.getExistingBookings()); + reassign(other.getReassign()); + return this; + } + + /** + *

An ISO 8601 instant with an offset.

+ */ + @JsonSetter(value = "start", nulls = Nulls.SKIP) + public Builder start(Optional start) { + this.start = start; + return this; + } + + public Builder start(String start) { + this.start = Optional.ofNullable(start); + return this; + } + + /** + *

An ISO 8601 instant with an offset.

+ */ + @JsonSetter(value = "end", nulls = Nulls.SKIP) + public Builder end(Optional end) { + this.end = end; + return this; + } + + public Builder end(String end) { + this.end = Optional.ofNullable(end); + return this; + } + + /** + *

The first whole day away. Use instead of start and end.

+ */ + @JsonSetter(value = "start_date", nulls = Nulls.SKIP) + public Builder startDate(Optional startDate) { + this.startDate = startDate; + return this; + } + + public Builder startDate(String startDate) { + this.startDate = Optional.ofNullable(startDate); + return this; + } + + /** + *

The last whole day away, which is included.

+ */ + @JsonSetter(value = "end_date", nulls = Nulls.SKIP) + public Builder endDate(Optional endDate) { + this.endDate = endDate; + return this; + } + + public Builder endDate(String endDate) { + this.endDate = Optional.ofNullable(endDate); + return this; + } + + /** + *

What the dates mean in. Default: the host's zone when this is made.

+ */ + @JsonSetter(value = "time_zone", nulls = Nulls.SKIP) + public Builder timeZone(Optional timeZone) { + this.timeZone = timeZone; + return this; + } + + public Builder timeZone(String timeZone) { + this.timeZone = Optional.ofNullable(timeZone); + return this; + } + + /** + *

One of unspecified, vacation, travel, sick, public_holiday, parental_leave, training and other, or a key from the settings' out_of_office_reasons. Only people who manage this host see it: never bookers, webhooks or calendars.

+ */ + @JsonSetter(value = "reason", nulls = Nulls.SKIP) + public Builder reason(Optional reason) { + this.reason = reason; + return this; + } + + public Builder reason(String reason) { + this.reason = Optional.ofNullable(reason); + return this; + } + + @JsonSetter(value = "notes", nulls = Nulls.SKIP) + public Builder notes(OptionalNullable notes) { + this.notes = notes; + return this; + } + + public Builder notes(String notes) { + this.notes = OptionalNullable.of(notes); + return this; + } + + public Builder notes(Optional notes) { + if (notes.isPresent()) { + this.notes = OptionalNullable.of(notes.get()); + } else { + this.notes = OptionalNullable.absent(); + } + return this; + } + + public Builder notes(Nullable notes) { + if (notes.isNull()) { + this.notes = OptionalNullable.ofNull(); + } else if (notes.isEmpty()) { + this.notes = OptionalNullable.absent(); + } else { + this.notes = OptionalNullable.of(notes.get()); + } + return this; + } + + @JsonSetter(value = "public_message", nulls = Nulls.SKIP) + public Builder publicMessage(OptionalNullable publicMessage) { + this.publicMessage = publicMessage; + return this; + } + + public Builder publicMessage(String publicMessage) { + this.publicMessage = OptionalNullable.of(publicMessage); + return this; + } + + public Builder publicMessage(Optional publicMessage) { + if (publicMessage.isPresent()) { + this.publicMessage = OptionalNullable.of(publicMessage.get()); + } else { + this.publicMessage = OptionalNullable.absent(); + } + return this; + } + + public Builder publicMessage(Nullable publicMessage) { + if (publicMessage.isNull()) { + this.publicMessage = OptionalNullable.ofNull(); + } else if (publicMessage.isEmpty()) { + this.publicMessage = OptionalNullable.absent(); + } else { + this.publicMessage = OptionalNullable.of(publicMessage.get()); + } + return this; + } + + @JsonSetter(value = "show_on_calendar", nulls = Nulls.SKIP) + public Builder showOnCalendar(Optional showOnCalendar) { + this.showOnCalendar = showOnCalendar; + return this; + } + + public Builder showOnCalendar(Boolean showOnCalendar) { + this.showOnCalendar = Optional.ofNullable(showOnCalendar); + return this; + } + + /** + *

Who can be booked in this host's place during it, by id or uid, in the order to try them. They still have to fit how a booking's routed.

+ */ + @JsonSetter(value = "delegates", nulls = Nulls.SKIP) + public Builder delegates(Optional> delegates) { + this.delegates = delegates; + return this; + } + + public Builder delegates(List delegates) { + this.delegates = Optional.ofNullable(delegates); + return this; + } + + /** + *

What happens to bookings already in the way. leave (the default) only reports them. reassign moves them, and any nobody can take stay where they are.

+ */ + @JsonSetter(value = "existing_bookings", nulls = Nulls.SKIP) + public Builder existingBookings(Optional existingBookings) { + this.existingBookings = existingBookings; + return this; + } + + public Builder existingBookings(UpdateSchedulingOutOfOfficeRequestExistingBookings existingBookings) { + this.existingBookings = Optional.ofNullable(existingBookings); + return this; + } + + /** + *

With existing_bookings: reassign: who they go to. Default: the fairest who's free.

+ */ + @JsonSetter(value = "reassign", nulls = Nulls.SKIP) + public Builder reassign(Optional reassign) { + this.reassign = reassign; + return this; + } + + public Builder reassign(UpdateSchedulingOutOfOfficeRequestReassign reassign) { + this.reassign = Optional.ofNullable(reassign); + return this; + } + + public UpdateSchedulingOutOfOfficeRequest build() { + return new UpdateSchedulingOutOfOfficeRequest( + start, + end, + startDate, + endDate, + timeZone, + reason, + notes, + publicMessage, + showOnCalendar, + delegates, + existingBookings, + reassign, + additionalProperties); + } + + public Builder additionalProperty(String key, Object value) { + this.additionalProperties.put(key, value); + return this; + } + + public Builder additionalProperties(Map additionalProperties) { + this.additionalProperties.putAll(additionalProperties); + return this; + } + } +} diff --git a/sdks/java/src/main/java/com/coss/resources/scheduling/outofoffice/types/CreateSchedulingOutOfOfficeRequestExistingBookings.java b/sdks/java/src/main/java/com/coss/resources/scheduling/outofoffice/types/CreateSchedulingOutOfOfficeRequestExistingBookings.java new file mode 100644 index 000000000..a8c78bfcd --- /dev/null +++ b/sdks/java/src/main/java/com/coss/resources/scheduling/outofoffice/types/CreateSchedulingOutOfOfficeRequestExistingBookings.java @@ -0,0 +1,86 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.coss.resources.scheduling.outofoffice.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class CreateSchedulingOutOfOfficeRequestExistingBookings { + public static final CreateSchedulingOutOfOfficeRequestExistingBookings REASSIGN = + new CreateSchedulingOutOfOfficeRequestExistingBookings(Value.REASSIGN, "reassign"); + + public static final CreateSchedulingOutOfOfficeRequestExistingBookings LEAVE = + new CreateSchedulingOutOfOfficeRequestExistingBookings(Value.LEAVE, "leave"); + + private final Value value; + + private final String string; + + CreateSchedulingOutOfOfficeRequestExistingBookings(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof CreateSchedulingOutOfOfficeRequestExistingBookings + && this.string.equals(((CreateSchedulingOutOfOfficeRequestExistingBookings) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case REASSIGN: + return visitor.visitReassign(); + case LEAVE: + return visitor.visitLeave(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static CreateSchedulingOutOfOfficeRequestExistingBookings valueOf(String value) { + switch (value) { + case "reassign": + return REASSIGN; + case "leave": + return LEAVE; + default: + return new CreateSchedulingOutOfOfficeRequestExistingBookings(Value.UNKNOWN, value); + } + } + + public enum Value { + LEAVE, + + REASSIGN, + + UNKNOWN + } + + public interface Visitor { + T visitLeave(); + + T visitReassign(); + + T visitUnknown(String unknownType); + } +} diff --git a/sdks/java/src/main/java/com/coss/resources/scheduling/outofoffice/types/CreateSchedulingOutOfOfficeRequestHostFilterValue.java b/sdks/java/src/main/java/com/coss/resources/scheduling/outofoffice/types/CreateSchedulingOutOfOfficeRequestHostFilterValue.java new file mode 100644 index 000000000..6a81d4edf --- /dev/null +++ b/sdks/java/src/main/java/com/coss/resources/scheduling/outofoffice/types/CreateSchedulingOutOfOfficeRequestHostFilterValue.java @@ -0,0 +1,99 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.coss.resources.scheduling.outofoffice.types; + +import com.coss.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import java.io.IOException; +import java.util.List; +import java.util.Objects; + +@JsonDeserialize(using = CreateSchedulingOutOfOfficeRequestHostFilterValue.Deserializer.class) +public final class CreateSchedulingOutOfOfficeRequestHostFilterValue { + private final Object value; + + private final int type; + + private CreateSchedulingOutOfOfficeRequestHostFilterValue(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((String) this.value); + } else if (this.type == 1) { + return visitor.visit((List) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateSchedulingOutOfOfficeRequestHostFilterValue + && equalTo((CreateSchedulingOutOfOfficeRequestHostFilterValue) other); + } + + private boolean equalTo(CreateSchedulingOutOfOfficeRequestHostFilterValue other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static CreateSchedulingOutOfOfficeRequestHostFilterValue of(String value) { + return new CreateSchedulingOutOfOfficeRequestHostFilterValue(value, 0); + } + + public static CreateSchedulingOutOfOfficeRequestHostFilterValue of(List value) { + return new CreateSchedulingOutOfOfficeRequestHostFilterValue(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(List value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(CreateSchedulingOutOfOfficeRequestHostFilterValue.class); + } + + @java.lang.Override + public CreateSchedulingOutOfOfficeRequestHostFilterValue deserialize( + JsonParser p, DeserializationContext context) throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, new TypeReference>() {})); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/sdks/java/src/main/java/com/coss/resources/scheduling/outofoffice/types/CreateSchedulingOutOfOfficeRequestReassign.java b/sdks/java/src/main/java/com/coss/resources/scheduling/outofoffice/types/CreateSchedulingOutOfOfficeRequestReassign.java new file mode 100644 index 000000000..fe57448bc --- /dev/null +++ b/sdks/java/src/main/java/com/coss/resources/scheduling/outofoffice/types/CreateSchedulingOutOfOfficeRequestReassign.java @@ -0,0 +1,176 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.coss.resources.scheduling.outofoffice.types; + +import com.coss.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateSchedulingOutOfOfficeRequestReassign.Builder.class) +public final class CreateSchedulingOutOfOfficeRequestReassign { + private final Optional toHost; + + private final Optional> preferredHosts; + + private final Optional otherwise; + + private final Map additionalProperties; + + private CreateSchedulingOutOfOfficeRequestReassign( + Optional toHost, + Optional> preferredHosts, + Optional otherwise, + Map additionalProperties) { + this.toHost = toHost; + this.preferredHosts = preferredHosts; + this.otherwise = otherwise; + this.additionalProperties = additionalProperties; + } + + /** + * @return Give them all to this host. + */ + @JsonProperty("to_host") + public Optional getToHost() { + return toHost; + } + + /** + * @return Try these first, in order. + */ + @JsonProperty("preferred_hosts") + public Optional> getPreferredHosts() { + return preferredHosts; + } + + /** + * @return After preferred_hosts: auto picks the fairest who's free (the default), leave keeps it where it is. + */ + @JsonProperty("otherwise") + public Optional getOtherwise() { + return otherwise; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateSchedulingOutOfOfficeRequestReassign + && equalTo((CreateSchedulingOutOfOfficeRequestReassign) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateSchedulingOutOfOfficeRequestReassign other) { + return toHost.equals(other.toHost) + && preferredHosts.equals(other.preferredHosts) + && otherwise.equals(other.otherwise); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.toHost, this.preferredHosts, this.otherwise); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional toHost = Optional.empty(); + + private Optional> preferredHosts = Optional.empty(); + + private Optional otherwise = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(CreateSchedulingOutOfOfficeRequestReassign other) { + toHost(other.getToHost()); + preferredHosts(other.getPreferredHosts()); + otherwise(other.getOtherwise()); + return this; + } + + /** + *

Give them all to this host.

+ */ + @JsonSetter(value = "to_host", nulls = Nulls.SKIP) + public Builder toHost(Optional toHost) { + this.toHost = toHost; + return this; + } + + public Builder toHost(String toHost) { + this.toHost = Optional.ofNullable(toHost); + return this; + } + + /** + *

Try these first, in order.

+ */ + @JsonSetter(value = "preferred_hosts", nulls = Nulls.SKIP) + public Builder preferredHosts(Optional> preferredHosts) { + this.preferredHosts = preferredHosts; + return this; + } + + public Builder preferredHosts(List preferredHosts) { + this.preferredHosts = Optional.ofNullable(preferredHosts); + return this; + } + + /** + *

After preferred_hosts: auto picks the fairest who's free (the default), leave keeps it where it is.

+ */ + @JsonSetter(value = "otherwise", nulls = Nulls.SKIP) + public Builder otherwise(Optional otherwise) { + this.otherwise = otherwise; + return this; + } + + public Builder otherwise(CreateSchedulingOutOfOfficeRequestReassignOtherwise otherwise) { + this.otherwise = Optional.ofNullable(otherwise); + return this; + } + + public CreateSchedulingOutOfOfficeRequestReassign build() { + return new CreateSchedulingOutOfOfficeRequestReassign( + toHost, preferredHosts, otherwise, additionalProperties); + } + + public Builder additionalProperty(String key, Object value) { + this.additionalProperties.put(key, value); + return this; + } + + public Builder additionalProperties(Map additionalProperties) { + this.additionalProperties.putAll(additionalProperties); + return this; + } + } +} diff --git a/sdks/java/src/main/java/com/coss/resources/scheduling/outofoffice/types/CreateSchedulingOutOfOfficeRequestReassignOtherwise.java b/sdks/java/src/main/java/com/coss/resources/scheduling/outofoffice/types/CreateSchedulingOutOfOfficeRequestReassignOtherwise.java new file mode 100644 index 000000000..b8ac722ec --- /dev/null +++ b/sdks/java/src/main/java/com/coss/resources/scheduling/outofoffice/types/CreateSchedulingOutOfOfficeRequestReassignOtherwise.java @@ -0,0 +1,86 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.coss.resources.scheduling.outofoffice.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class CreateSchedulingOutOfOfficeRequestReassignOtherwise { + public static final CreateSchedulingOutOfOfficeRequestReassignOtherwise AUTO = + new CreateSchedulingOutOfOfficeRequestReassignOtherwise(Value.AUTO, "auto"); + + public static final CreateSchedulingOutOfOfficeRequestReassignOtherwise LEAVE = + new CreateSchedulingOutOfOfficeRequestReassignOtherwise(Value.LEAVE, "leave"); + + private final Value value; + + private final String string; + + CreateSchedulingOutOfOfficeRequestReassignOtherwise(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof CreateSchedulingOutOfOfficeRequestReassignOtherwise + && this.string.equals(((CreateSchedulingOutOfOfficeRequestReassignOtherwise) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case AUTO: + return visitor.visitAuto(); + case LEAVE: + return visitor.visitLeave(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static CreateSchedulingOutOfOfficeRequestReassignOtherwise valueOf(String value) { + switch (value) { + case "auto": + return AUTO; + case "leave": + return LEAVE; + default: + return new CreateSchedulingOutOfOfficeRequestReassignOtherwise(Value.UNKNOWN, value); + } + } + + public enum Value { + AUTO, + + LEAVE, + + UNKNOWN + } + + public interface Visitor { + T visitAuto(); + + T visitLeave(); + + T visitUnknown(String unknownType); + } +} diff --git a/sdks/java/src/main/java/com/coss/resources/scheduling/outofoffice/types/PutSchedulingOutOfOfficeRequestExistingBookings.java b/sdks/java/src/main/java/com/coss/resources/scheduling/outofoffice/types/PutSchedulingOutOfOfficeRequestExistingBookings.java new file mode 100644 index 000000000..828ecb480 --- /dev/null +++ b/sdks/java/src/main/java/com/coss/resources/scheduling/outofoffice/types/PutSchedulingOutOfOfficeRequestExistingBookings.java @@ -0,0 +1,86 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.coss.resources.scheduling.outofoffice.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class PutSchedulingOutOfOfficeRequestExistingBookings { + public static final PutSchedulingOutOfOfficeRequestExistingBookings REASSIGN = + new PutSchedulingOutOfOfficeRequestExistingBookings(Value.REASSIGN, "reassign"); + + public static final PutSchedulingOutOfOfficeRequestExistingBookings LEAVE = + new PutSchedulingOutOfOfficeRequestExistingBookings(Value.LEAVE, "leave"); + + private final Value value; + + private final String string; + + PutSchedulingOutOfOfficeRequestExistingBookings(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof PutSchedulingOutOfOfficeRequestExistingBookings + && this.string.equals(((PutSchedulingOutOfOfficeRequestExistingBookings) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case REASSIGN: + return visitor.visitReassign(); + case LEAVE: + return visitor.visitLeave(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static PutSchedulingOutOfOfficeRequestExistingBookings valueOf(String value) { + switch (value) { + case "reassign": + return REASSIGN; + case "leave": + return LEAVE; + default: + return new PutSchedulingOutOfOfficeRequestExistingBookings(Value.UNKNOWN, value); + } + } + + public enum Value { + LEAVE, + + REASSIGN, + + UNKNOWN + } + + public interface Visitor { + T visitLeave(); + + T visitReassign(); + + T visitUnknown(String unknownType); + } +} diff --git a/sdks/java/src/main/java/com/coss/resources/scheduling/outofoffice/types/PutSchedulingOutOfOfficeRequestReassign.java b/sdks/java/src/main/java/com/coss/resources/scheduling/outofoffice/types/PutSchedulingOutOfOfficeRequestReassign.java new file mode 100644 index 000000000..9719fe8b2 --- /dev/null +++ b/sdks/java/src/main/java/com/coss/resources/scheduling/outofoffice/types/PutSchedulingOutOfOfficeRequestReassign.java @@ -0,0 +1,175 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.coss.resources.scheduling.outofoffice.types; + +import com.coss.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PutSchedulingOutOfOfficeRequestReassign.Builder.class) +public final class PutSchedulingOutOfOfficeRequestReassign { + private final Optional toHost; + + private final Optional> preferredHosts; + + private final Optional otherwise; + + private final Map additionalProperties; + + private PutSchedulingOutOfOfficeRequestReassign( + Optional toHost, + Optional> preferredHosts, + Optional otherwise, + Map additionalProperties) { + this.toHost = toHost; + this.preferredHosts = preferredHosts; + this.otherwise = otherwise; + this.additionalProperties = additionalProperties; + } + + /** + * @return Give them all to this host. + */ + @JsonProperty("to_host") + public Optional getToHost() { + return toHost; + } + + /** + * @return Try these first, in order. + */ + @JsonProperty("preferred_hosts") + public Optional> getPreferredHosts() { + return preferredHosts; + } + + /** + * @return After preferred_hosts: auto picks the fairest who's free (the default), leave keeps it where it is. + */ + @JsonProperty("otherwise") + public Optional getOtherwise() { + return otherwise; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PutSchedulingOutOfOfficeRequestReassign + && equalTo((PutSchedulingOutOfOfficeRequestReassign) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PutSchedulingOutOfOfficeRequestReassign other) { + return toHost.equals(other.toHost) + && preferredHosts.equals(other.preferredHosts) + && otherwise.equals(other.otherwise); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.toHost, this.preferredHosts, this.otherwise); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional toHost = Optional.empty(); + + private Optional> preferredHosts = Optional.empty(); + + private Optional otherwise = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(PutSchedulingOutOfOfficeRequestReassign other) { + toHost(other.getToHost()); + preferredHosts(other.getPreferredHosts()); + otherwise(other.getOtherwise()); + return this; + } + + /** + *

Give them all to this host.

+ */ + @JsonSetter(value = "to_host", nulls = Nulls.SKIP) + public Builder toHost(Optional toHost) { + this.toHost = toHost; + return this; + } + + public Builder toHost(String toHost) { + this.toHost = Optional.ofNullable(toHost); + return this; + } + + /** + *

Try these first, in order.

+ */ + @JsonSetter(value = "preferred_hosts", nulls = Nulls.SKIP) + public Builder preferredHosts(Optional> preferredHosts) { + this.preferredHosts = preferredHosts; + return this; + } + + public Builder preferredHosts(List preferredHosts) { + this.preferredHosts = Optional.ofNullable(preferredHosts); + return this; + } + + /** + *

After preferred_hosts: auto picks the fairest who's free (the default), leave keeps it where it is.

+ */ + @JsonSetter(value = "otherwise", nulls = Nulls.SKIP) + public Builder otherwise(Optional otherwise) { + this.otherwise = otherwise; + return this; + } + + public Builder otherwise(PutSchedulingOutOfOfficeRequestReassignOtherwise otherwise) { + this.otherwise = Optional.ofNullable(otherwise); + return this; + } + + public PutSchedulingOutOfOfficeRequestReassign build() { + return new PutSchedulingOutOfOfficeRequestReassign(toHost, preferredHosts, otherwise, additionalProperties); + } + + public Builder additionalProperty(String key, Object value) { + this.additionalProperties.put(key, value); + return this; + } + + public Builder additionalProperties(Map additionalProperties) { + this.additionalProperties.putAll(additionalProperties); + return this; + } + } +} diff --git a/sdks/java/src/main/java/com/coss/resources/scheduling/outofoffice/types/PutSchedulingOutOfOfficeRequestReassignOtherwise.java b/sdks/java/src/main/java/com/coss/resources/scheduling/outofoffice/types/PutSchedulingOutOfOfficeRequestReassignOtherwise.java new file mode 100644 index 000000000..c61cd251e --- /dev/null +++ b/sdks/java/src/main/java/com/coss/resources/scheduling/outofoffice/types/PutSchedulingOutOfOfficeRequestReassignOtherwise.java @@ -0,0 +1,86 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.coss.resources.scheduling.outofoffice.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class PutSchedulingOutOfOfficeRequestReassignOtherwise { + public static final PutSchedulingOutOfOfficeRequestReassignOtherwise AUTO = + new PutSchedulingOutOfOfficeRequestReassignOtherwise(Value.AUTO, "auto"); + + public static final PutSchedulingOutOfOfficeRequestReassignOtherwise LEAVE = + new PutSchedulingOutOfOfficeRequestReassignOtherwise(Value.LEAVE, "leave"); + + private final Value value; + + private final String string; + + PutSchedulingOutOfOfficeRequestReassignOtherwise(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof PutSchedulingOutOfOfficeRequestReassignOtherwise + && this.string.equals(((PutSchedulingOutOfOfficeRequestReassignOtherwise) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case AUTO: + return visitor.visitAuto(); + case LEAVE: + return visitor.visitLeave(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static PutSchedulingOutOfOfficeRequestReassignOtherwise valueOf(String value) { + switch (value) { + case "auto": + return AUTO; + case "leave": + return LEAVE; + default: + return new PutSchedulingOutOfOfficeRequestReassignOtherwise(Value.UNKNOWN, value); + } + } + + public enum Value { + AUTO, + + LEAVE, + + UNKNOWN + } + + public interface Visitor { + T visitAuto(); + + T visitLeave(); + + T visitUnknown(String unknownType); + } +} diff --git a/sdks/java/src/main/java/com/coss/resources/scheduling/outofoffice/types/UpdateSchedulingOutOfOfficeRequestExistingBookings.java b/sdks/java/src/main/java/com/coss/resources/scheduling/outofoffice/types/UpdateSchedulingOutOfOfficeRequestExistingBookings.java new file mode 100644 index 000000000..4db00bab9 --- /dev/null +++ b/sdks/java/src/main/java/com/coss/resources/scheduling/outofoffice/types/UpdateSchedulingOutOfOfficeRequestExistingBookings.java @@ -0,0 +1,86 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.coss.resources.scheduling.outofoffice.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class UpdateSchedulingOutOfOfficeRequestExistingBookings { + public static final UpdateSchedulingOutOfOfficeRequestExistingBookings REASSIGN = + new UpdateSchedulingOutOfOfficeRequestExistingBookings(Value.REASSIGN, "reassign"); + + public static final UpdateSchedulingOutOfOfficeRequestExistingBookings LEAVE = + new UpdateSchedulingOutOfOfficeRequestExistingBookings(Value.LEAVE, "leave"); + + private final Value value; + + private final String string; + + UpdateSchedulingOutOfOfficeRequestExistingBookings(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof UpdateSchedulingOutOfOfficeRequestExistingBookings + && this.string.equals(((UpdateSchedulingOutOfOfficeRequestExistingBookings) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case REASSIGN: + return visitor.visitReassign(); + case LEAVE: + return visitor.visitLeave(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static UpdateSchedulingOutOfOfficeRequestExistingBookings valueOf(String value) { + switch (value) { + case "reassign": + return REASSIGN; + case "leave": + return LEAVE; + default: + return new UpdateSchedulingOutOfOfficeRequestExistingBookings(Value.UNKNOWN, value); + } + } + + public enum Value { + LEAVE, + + REASSIGN, + + UNKNOWN + } + + public interface Visitor { + T visitLeave(); + + T visitReassign(); + + T visitUnknown(String unknownType); + } +} diff --git a/sdks/java/src/main/java/com/coss/resources/scheduling/outofoffice/types/UpdateSchedulingOutOfOfficeRequestReassign.java b/sdks/java/src/main/java/com/coss/resources/scheduling/outofoffice/types/UpdateSchedulingOutOfOfficeRequestReassign.java new file mode 100644 index 000000000..a02b4f511 --- /dev/null +++ b/sdks/java/src/main/java/com/coss/resources/scheduling/outofoffice/types/UpdateSchedulingOutOfOfficeRequestReassign.java @@ -0,0 +1,176 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.coss.resources.scheduling.outofoffice.types; + +import com.coss.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = UpdateSchedulingOutOfOfficeRequestReassign.Builder.class) +public final class UpdateSchedulingOutOfOfficeRequestReassign { + private final Optional toHost; + + private final Optional> preferredHosts; + + private final Optional otherwise; + + private final Map additionalProperties; + + private UpdateSchedulingOutOfOfficeRequestReassign( + Optional toHost, + Optional> preferredHosts, + Optional otherwise, + Map additionalProperties) { + this.toHost = toHost; + this.preferredHosts = preferredHosts; + this.otherwise = otherwise; + this.additionalProperties = additionalProperties; + } + + /** + * @return Give them all to this host. + */ + @JsonProperty("to_host") + public Optional getToHost() { + return toHost; + } + + /** + * @return Try these first, in order. + */ + @JsonProperty("preferred_hosts") + public Optional> getPreferredHosts() { + return preferredHosts; + } + + /** + * @return After preferred_hosts: auto picks the fairest who's free (the default), leave keeps it where it is. + */ + @JsonProperty("otherwise") + public Optional getOtherwise() { + return otherwise; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UpdateSchedulingOutOfOfficeRequestReassign + && equalTo((UpdateSchedulingOutOfOfficeRequestReassign) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UpdateSchedulingOutOfOfficeRequestReassign other) { + return toHost.equals(other.toHost) + && preferredHosts.equals(other.preferredHosts) + && otherwise.equals(other.otherwise); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.toHost, this.preferredHosts, this.otherwise); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional toHost = Optional.empty(); + + private Optional> preferredHosts = Optional.empty(); + + private Optional otherwise = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(UpdateSchedulingOutOfOfficeRequestReassign other) { + toHost(other.getToHost()); + preferredHosts(other.getPreferredHosts()); + otherwise(other.getOtherwise()); + return this; + } + + /** + *

Give them all to this host.

+ */ + @JsonSetter(value = "to_host", nulls = Nulls.SKIP) + public Builder toHost(Optional toHost) { + this.toHost = toHost; + return this; + } + + public Builder toHost(String toHost) { + this.toHost = Optional.ofNullable(toHost); + return this; + } + + /** + *

Try these first, in order.

+ */ + @JsonSetter(value = "preferred_hosts", nulls = Nulls.SKIP) + public Builder preferredHosts(Optional> preferredHosts) { + this.preferredHosts = preferredHosts; + return this; + } + + public Builder preferredHosts(List preferredHosts) { + this.preferredHosts = Optional.ofNullable(preferredHosts); + return this; + } + + /** + *

After preferred_hosts: auto picks the fairest who's free (the default), leave keeps it where it is.

+ */ + @JsonSetter(value = "otherwise", nulls = Nulls.SKIP) + public Builder otherwise(Optional otherwise) { + this.otherwise = otherwise; + return this; + } + + public Builder otherwise(UpdateSchedulingOutOfOfficeRequestReassignOtherwise otherwise) { + this.otherwise = Optional.ofNullable(otherwise); + return this; + } + + public UpdateSchedulingOutOfOfficeRequestReassign build() { + return new UpdateSchedulingOutOfOfficeRequestReassign( + toHost, preferredHosts, otherwise, additionalProperties); + } + + public Builder additionalProperty(String key, Object value) { + this.additionalProperties.put(key, value); + return this; + } + + public Builder additionalProperties(Map additionalProperties) { + this.additionalProperties.putAll(additionalProperties); + return this; + } + } +} diff --git a/sdks/java/src/main/java/com/coss/resources/scheduling/outofoffice/types/UpdateSchedulingOutOfOfficeRequestReassignOtherwise.java b/sdks/java/src/main/java/com/coss/resources/scheduling/outofoffice/types/UpdateSchedulingOutOfOfficeRequestReassignOtherwise.java new file mode 100644 index 000000000..307841a28 --- /dev/null +++ b/sdks/java/src/main/java/com/coss/resources/scheduling/outofoffice/types/UpdateSchedulingOutOfOfficeRequestReassignOtherwise.java @@ -0,0 +1,86 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.coss.resources.scheduling.outofoffice.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class UpdateSchedulingOutOfOfficeRequestReassignOtherwise { + public static final UpdateSchedulingOutOfOfficeRequestReassignOtherwise AUTO = + new UpdateSchedulingOutOfOfficeRequestReassignOtherwise(Value.AUTO, "auto"); + + public static final UpdateSchedulingOutOfOfficeRequestReassignOtherwise LEAVE = + new UpdateSchedulingOutOfOfficeRequestReassignOtherwise(Value.LEAVE, "leave"); + + private final Value value; + + private final String string; + + UpdateSchedulingOutOfOfficeRequestReassignOtherwise(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof UpdateSchedulingOutOfOfficeRequestReassignOtherwise + && this.string.equals(((UpdateSchedulingOutOfOfficeRequestReassignOtherwise) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case AUTO: + return visitor.visitAuto(); + case LEAVE: + return visitor.visitLeave(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static UpdateSchedulingOutOfOfficeRequestReassignOtherwise valueOf(String value) { + switch (value) { + case "auto": + return AUTO; + case "leave": + return LEAVE; + default: + return new UpdateSchedulingOutOfOfficeRequestReassignOtherwise(Value.UNKNOWN, value); + } + } + + public enum Value { + AUTO, + + LEAVE, + + UNKNOWN + } + + public interface Visitor { + T visitAuto(); + + T visitLeave(); + + T visitUnknown(String unknownType); + } +} diff --git a/sdks/java/src/main/java/com/coss/resources/scheduling/reassignments/AsyncRawReassignmentsClient.java b/sdks/java/src/main/java/com/coss/resources/scheduling/reassignments/AsyncRawReassignmentsClient.java new file mode 100644 index 000000000..7d9d3fd1a --- /dev/null +++ b/sdks/java/src/main/java/com/coss/resources/scheduling/reassignments/AsyncRawReassignmentsClient.java @@ -0,0 +1,1012 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.coss.resources.scheduling.reassignments; + +import com.coss.core.ClientOptions; +import com.coss.core.CossApiException; +import com.coss.core.CossException; +import com.coss.core.CossHttpResponse; +import com.coss.core.IdempotencyUtils; +import com.coss.core.MediaTypes; +import com.coss.core.ObjectMappers; +import com.coss.core.QueryStringMapper; +import com.coss.core.RequestOptions; +import com.coss.core.RetryInterceptor; +import com.coss.errors.BadRequestError; +import com.coss.errors.ConflictError; +import com.coss.errors.ForbiddenError; +import com.coss.errors.InternalServerError; +import com.coss.errors.NotFoundError; +import com.coss.errors.ServiceUnavailableError; +import com.coss.errors.TooManyRequestsError; +import com.coss.errors.UnauthorizedError; +import com.coss.errors.UnprocessableEntityError; +import com.coss.errors.UnsupportedMediaTypeError; +import com.coss.resources.scheduling.reassignments.requests.CancelReassignmentsRequest; +import com.coss.resources.scheduling.reassignments.requests.CreateSchedulingReassignmentRequest; +import com.coss.resources.scheduling.reassignments.requests.GetReassignmentsRequest; +import com.coss.resources.scheduling.reassignments.requests.ItemsReassignmentsRequest; +import com.coss.resources.scheduling.reassignments.requests.ListReassignmentsRequest; +import com.coss.resources.scheduling.reassignments.requests.PreviewSchedulingReassignmentRequest; +import com.coss.resources.scheduling.reassignments.requests.UndoSchedulingReassignmentRequest; +import com.coss.types.Error; +import com.coss.types.SchedulingReassignment; +import com.coss.types.SchedulingReassignmentItemList; +import com.coss.types.SchedulingReassignmentList; +import com.coss.types.SchedulingReassignmentPreview; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.io.IOException; +import java.util.concurrent.CompletableFuture; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawReassignmentsClient { + protected final ClientOptions clientOptions; + + public AsyncRawReassignmentsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Who each booking would go to, and why not when nobody can take it, without moving anything. It works down them in order, so two can't both be promised the same free hour. Change any of it and start the run with assignments. Covers the first 500. Things can change before you start it: the run decides again. + */ + public CompletableFuture> preview( + PreviewSchedulingReassignmentRequest request) { + return preview(request, null); + } + + /** + * Who each booking would go to, and why not when nobody can take it, without moving anything. It works down them in order, so two can't both be promised the same free hour. Change any of it and start the run with assignments. Covers the first 500. Things can change before you start it: the run decides again. + */ + public CompletableFuture> preview( + PreviewSchedulingReassignmentRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("v1/scheduling/reassignments/preview"); + if (requestOptions != null) { + requestOptions.getQueryParameters().forEach((_key, _value) -> { + httpUrl.addQueryParameter(_key, _value); + }); + } + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new CossException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl.build()) + .method("POST", body) + .headers(Headers.of(IdempotencyUtils.withGeneratedIdempotencyKey( + clientOptions.headers(requestOptions), "Idempotency-Key"))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + if (requestOptions != null && requestOptions.getMaxRetries().isPresent()) { + okhttpRequest = okhttpRequest + .newBuilder() + .tag( + RetryInterceptor.MaxRetriesOverride.class, + new RetryInterceptor.MaxRetriesOverride( + requestOptions.getMaxRetries().get())) + .build(); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new CossHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, SchedulingReassignmentPreview.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 415: + future.completeExceptionally(new UnsupportedMediaTypeError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 422: + future.completeExceptionally(new UnprocessableEntityError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 500: + future.completeExceptionally(new InternalServerError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 503: + future.completeExceptionally(new ServiceUnavailableError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new CossApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (JsonProcessingException e) { + future.completeExceptionally( + new CossException("Failed to deserialize response: " + e.getMessage(), e)); + } catch (IOException e) { + future.completeExceptionally(new CossException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new CossException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Newest first, with how each is going. + */ + public CompletableFuture> list() { + return list(ListReassignmentsRequest.builder().build()); + } + + /** + * Newest first, with how each is going. + */ + public CompletableFuture> list(RequestOptions requestOptions) { + return list(ListReassignmentsRequest.builder().build(), requestOptions); + } + + /** + * Newest first, with how each is going. + */ + public CompletableFuture> list(ListReassignmentsRequest request) { + return list(request, null); + } + + /** + * Newest first, with how each is going. + */ + public CompletableFuture> list( + ListReassignmentsRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("v1/scheduling/reassignments"); + if (request.getLimit().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "limit", request.getLimit().get(), false); + } + if (request.getAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "after", request.getAfter().get(), false); + } + if (requestOptions != null) { + requestOptions.getQueryParameters().forEach((_key, _value) -> { + httpUrl.addQueryParameter(_key, _value); + }); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + if (requestOptions != null && requestOptions.getMaxRetries().isPresent()) { + okhttpRequest = okhttpRequest + .newBuilder() + .tag( + RetryInterceptor.MaxRetriesOverride.class, + new RetryInterceptor.MaxRetriesOverride( + requestOptions.getMaxRetries().get())) + .build(); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new CossHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, SchedulingReassignmentList.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 422: + future.completeExceptionally(new UnprocessableEntityError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 500: + future.completeExceptionally(new InternalServerError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 503: + future.completeExceptionally(new ServiceUnavailableError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new CossApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (JsonProcessingException e) { + future.completeExceptionally( + new CossException("Failed to deserialize response: " + e.getMessage(), e)); + } catch (IOException e) { + future.completeExceptionally(new CossException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new CossException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Moves up to 5,000 bookings in the background, each on its own, so one that can't move never holds up the rest. Nothing's ever cancelled: a booking nobody can take stays where it is, and its item says so. It answers at once: follow the run by its id, or wait for scheduling.reassignment.completed. + */ + public CompletableFuture> create( + CreateSchedulingReassignmentRequest request) { + return create(request, null); + } + + /** + * Moves up to 5,000 bookings in the background, each on its own, so one that can't move never holds up the rest. Nothing's ever cancelled: a booking nobody can take stays where it is, and its item says so. It answers at once: follow the run by its id, or wait for scheduling.reassignment.completed. + */ + public CompletableFuture> create( + CreateSchedulingReassignmentRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("v1/scheduling/reassignments"); + if (requestOptions != null) { + requestOptions.getQueryParameters().forEach((_key, _value) -> { + httpUrl.addQueryParameter(_key, _value); + }); + } + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (Exception e) { + throw new RuntimeException(e); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("POST", body) + .headers(Headers.of(IdempotencyUtils.withGeneratedIdempotencyKey( + clientOptions.headers(requestOptions), "Idempotency-Key"))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + if (request.getIdempotencyKey().isPresent()) { + _requestBuilder.addHeader( + "Idempotency-Key", request.getIdempotencyKey().get()); + } + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + if (requestOptions != null && requestOptions.getMaxRetries().isPresent()) { + okhttpRequest = okhttpRequest + .newBuilder() + .tag( + RetryInterceptor.MaxRetriesOverride.class, + new RetryInterceptor.MaxRetriesOverride( + requestOptions.getMaxRetries().get())) + .build(); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new CossHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, SchedulingReassignment.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 409: + future.completeExceptionally(new ConflictError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 415: + future.completeExceptionally(new UnsupportedMediaTypeError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 422: + future.completeExceptionally(new UnprocessableEntityError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 500: + future.completeExceptionally(new InternalServerError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 503: + future.completeExceptionally(new ServiceUnavailableError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new CossApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (JsonProcessingException e) { + future.completeExceptionally( + new CossException("Failed to deserialize response: " + e.getMessage(), e)); + } catch (IOException e) { + future.completeExceptionally(new CossException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new CossException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * How it's going. + */ + public CompletableFuture> get(String id) { + return get(id, GetReassignmentsRequest.builder().build()); + } + + /** + * How it's going. + */ + public CompletableFuture> get(String id, RequestOptions requestOptions) { + return get(id, GetReassignmentsRequest.builder().build(), requestOptions); + } + + /** + * How it's going. + */ + public CompletableFuture> get(String id, GetReassignmentsRequest request) { + return get(id, request, null); + } + + /** + * How it's going. + */ + public CompletableFuture> get( + String id, GetReassignmentsRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("v1/scheduling/reassignments") + .addPathSegment(id); + if (requestOptions != null) { + requestOptions.getQueryParameters().forEach((_key, _value) -> { + httpUrl.addQueryParameter(_key, _value); + }); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + if (requestOptions != null && requestOptions.getMaxRetries().isPresent()) { + okhttpRequest = okhttpRequest + .newBuilder() + .tag( + RetryInterceptor.MaxRetriesOverride.class, + new RetryInterceptor.MaxRetriesOverride( + requestOptions.getMaxRetries().get())) + .build(); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new CossHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, SchedulingReassignment.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 500: + future.completeExceptionally(new InternalServerError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 503: + future.completeExceptionally(new ServiceUnavailableError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new CossApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (JsonProcessingException e) { + future.completeExceptionally( + new CossException("Failed to deserialize response: " + e.getMessage(), e)); + } catch (IOException e) { + future.completeExceptionally(new CossException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new CossException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Each booking it covers and what happened to it. A group session has one, for one of its seats. Empty until the worker's started on it. + */ + public CompletableFuture> items(String id) { + return items(id, ItemsReassignmentsRequest.builder().build()); + } + + /** + * Each booking it covers and what happened to it. A group session has one, for one of its seats. Empty until the worker's started on it. + */ + public CompletableFuture> items( + String id, RequestOptions requestOptions) { + return items(id, ItemsReassignmentsRequest.builder().build(), requestOptions); + } + + /** + * Each booking it covers and what happened to it. A group session has one, for one of its seats. Empty until the worker's started on it. + */ + public CompletableFuture> items( + String id, ItemsReassignmentsRequest request) { + return items(id, request, null); + } + + /** + * Each booking it covers and what happened to it. A group session has one, for one of its seats. Empty until the worker's started on it. + */ + public CompletableFuture> items( + String id, ItemsReassignmentsRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("v1/scheduling/reassignments") + .addPathSegment(id) + .addPathSegments("items"); + if (request.getLimit().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "limit", request.getLimit().get(), false); + } + if (request.getAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "after", request.getAfter().get(), false); + } + if (requestOptions != null) { + requestOptions.getQueryParameters().forEach((_key, _value) -> { + httpUrl.addQueryParameter(_key, _value); + }); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + if (requestOptions != null && requestOptions.getMaxRetries().isPresent()) { + okhttpRequest = okhttpRequest + .newBuilder() + .tag( + RetryInterceptor.MaxRetriesOverride.class, + new RetryInterceptor.MaxRetriesOverride( + requestOptions.getMaxRetries().get())) + .build(); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new CossHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, SchedulingReassignmentItemList.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 422: + future.completeExceptionally(new UnprocessableEntityError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 500: + future.completeExceptionally(new InternalServerError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 503: + future.completeExceptionally(new ServiceUnavailableError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new CossApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (JsonProcessingException e) { + future.completeExceptionally( + new CossException("Failed to deserialize response: " + e.getMessage(), e)); + } catch (IOException e) { + future.completeExceptionally(new CossException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new CossException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Stops what hasn't happened yet. What's moved stays moved: undo it for that. Cancelling one that's finished changes nothing. + */ + public CompletableFuture> cancel(String id) { + return cancel(id, CancelReassignmentsRequest.builder().build()); + } + + /** + * Stops what hasn't happened yet. What's moved stays moved: undo it for that. Cancelling one that's finished changes nothing. + */ + public CompletableFuture> cancel( + String id, RequestOptions requestOptions) { + return cancel(id, CancelReassignmentsRequest.builder().build(), requestOptions); + } + + /** + * Stops what hasn't happened yet. What's moved stays moved: undo it for that. Cancelling one that's finished changes nothing. + */ + public CompletableFuture> cancel( + String id, CancelReassignmentsRequest request) { + return cancel(id, request, null); + } + + /** + * Stops what hasn't happened yet. What's moved stays moved: undo it for that. Cancelling one that's finished changes nothing. + */ + public CompletableFuture> cancel( + String id, CancelReassignmentsRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("v1/scheduling/reassignments") + .addPathSegment(id) + .addPathSegments("cancel"); + if (requestOptions != null) { + requestOptions.getQueryParameters().forEach((_key, _value) -> { + httpUrl.addQueryParameter(_key, _value); + }); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("POST", RequestBody.create("", null)) + .headers(Headers.of(IdempotencyUtils.withGeneratedIdempotencyKey( + clientOptions.headers(requestOptions), "Idempotency-Key"))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + if (requestOptions != null && requestOptions.getMaxRetries().isPresent()) { + okhttpRequest = okhttpRequest + .newBuilder() + .tag( + RetryInterceptor.MaxRetriesOverride.class, + new RetryInterceptor.MaxRetriesOverride( + requestOptions.getMaxRetries().get())) + .build(); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new CossHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, SchedulingReassignment.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 500: + future.completeExceptionally(new InternalServerError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 503: + future.completeExceptionally(new ServiceUnavailableError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new CossApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (JsonProcessingException e) { + future.completeExceptionally( + new CossException("Failed to deserialize response: " + e.getMessage(), e)); + } catch (IOException e) { + future.completeExceptionally(new CossException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new CossException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Gives back what a finished run moved, as a new run. A booking that's moved on since stays where it went, and a former host who's no longer free keeps it from going back, unless you pass overrides. + */ + public CompletableFuture> undo(String id) { + return undo(id, UndoSchedulingReassignmentRequest.builder().build()); + } + + /** + * Gives back what a finished run moved, as a new run. A booking that's moved on since stays where it went, and a former host who's no longer free keeps it from going back, unless you pass overrides. + */ + public CompletableFuture> undo(String id, RequestOptions requestOptions) { + return undo(id, UndoSchedulingReassignmentRequest.builder().build(), requestOptions); + } + + /** + * Gives back what a finished run moved, as a new run. A booking that's moved on since stays where it went, and a former host who's no longer free keeps it from going back, unless you pass overrides. + */ + public CompletableFuture> undo( + String id, UndoSchedulingReassignmentRequest request) { + return undo(id, request, null); + } + + /** + * Gives back what a finished run moved, as a new run. A booking that's moved on since stays where it went, and a former host who's no longer free keeps it from going back, unless you pass overrides. + */ + public CompletableFuture> undo( + String id, UndoSchedulingReassignmentRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("v1/scheduling/reassignments") + .addPathSegment(id) + .addPathSegments("undo"); + if (requestOptions != null) { + requestOptions.getQueryParameters().forEach((_key, _value) -> { + httpUrl.addQueryParameter(_key, _value); + }); + } + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new CossException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl.build()) + .method("POST", body) + .headers(Headers.of(IdempotencyUtils.withGeneratedIdempotencyKey( + clientOptions.headers(requestOptions), "Idempotency-Key"))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + okhttpRequest = okhttpRequest + .newBuilder() + .tag(RetryInterceptor.MaxRetriesOverride.class, new RetryInterceptor.MaxRetriesOverride(0)) + .build(); + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new CossHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, SchedulingReassignment.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 415: + future.completeExceptionally(new UnsupportedMediaTypeError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 422: + future.completeExceptionally(new UnprocessableEntityError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 500: + future.completeExceptionally(new InternalServerError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 503: + future.completeExceptionally(new ServiceUnavailableError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new CossApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (JsonProcessingException e) { + future.completeExceptionally( + new CossException("Failed to deserialize response: " + e.getMessage(), e)); + } catch (IOException e) { + future.completeExceptionally(new CossException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new CossException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/sdks/java/src/main/java/com/coss/resources/scheduling/reassignments/AsyncReassignmentsClient.java b/sdks/java/src/main/java/com/coss/resources/scheduling/reassignments/AsyncReassignmentsClient.java new file mode 100644 index 000000000..eb591f029 --- /dev/null +++ b/sdks/java/src/main/java/com/coss/resources/scheduling/reassignments/AsyncReassignmentsClient.java @@ -0,0 +1,212 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.coss.resources.scheduling.reassignments; + +import com.coss.core.ClientOptions; +import com.coss.core.RequestOptions; +import com.coss.resources.scheduling.reassignments.requests.CancelReassignmentsRequest; +import com.coss.resources.scheduling.reassignments.requests.CreateSchedulingReassignmentRequest; +import com.coss.resources.scheduling.reassignments.requests.GetReassignmentsRequest; +import com.coss.resources.scheduling.reassignments.requests.ItemsReassignmentsRequest; +import com.coss.resources.scheduling.reassignments.requests.ListReassignmentsRequest; +import com.coss.resources.scheduling.reassignments.requests.PreviewSchedulingReassignmentRequest; +import com.coss.resources.scheduling.reassignments.requests.UndoSchedulingReassignmentRequest; +import com.coss.types.SchedulingReassignment; +import com.coss.types.SchedulingReassignmentItemList; +import com.coss.types.SchedulingReassignmentList; +import com.coss.types.SchedulingReassignmentPreview; +import java.util.concurrent.CompletableFuture; + +public class AsyncReassignmentsClient { + protected final ClientOptions clientOptions; + + private final AsyncRawReassignmentsClient rawClient; + + public AsyncReassignmentsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawReassignmentsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawReassignmentsClient withRawResponse() { + return this.rawClient; + } + + /** + * Who each booking would go to, and why not when nobody can take it, without moving anything. It works down them in order, so two can't both be promised the same free hour. Change any of it and start the run with assignments. Covers the first 500. Things can change before you start it: the run decides again. + */ + public CompletableFuture preview(PreviewSchedulingReassignmentRequest request) { + return this.rawClient.preview(request).thenApply(response -> response.body()); + } + + /** + * Who each booking would go to, and why not when nobody can take it, without moving anything. It works down them in order, so two can't both be promised the same free hour. Change any of it and start the run with assignments. Covers the first 500. Things can change before you start it: the run decides again. + */ + public CompletableFuture preview( + PreviewSchedulingReassignmentRequest request, RequestOptions requestOptions) { + return this.rawClient.preview(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Newest first, with how each is going. + */ + public CompletableFuture list() { + return this.rawClient.list().thenApply(response -> response.body()); + } + + /** + * Newest first, with how each is going. + */ + public CompletableFuture list(RequestOptions requestOptions) { + return this.rawClient.list(requestOptions).thenApply(response -> response.body()); + } + + /** + * Newest first, with how each is going. + */ + public CompletableFuture list(ListReassignmentsRequest request) { + return this.rawClient.list(request).thenApply(response -> response.body()); + } + + /** + * Newest first, with how each is going. + */ + public CompletableFuture list( + ListReassignmentsRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Moves up to 5,000 bookings in the background, each on its own, so one that can't move never holds up the rest. Nothing's ever cancelled: a booking nobody can take stays where it is, and its item says so. It answers at once: follow the run by its id, or wait for scheduling.reassignment.completed. + */ + public CompletableFuture create(CreateSchedulingReassignmentRequest request) { + return this.rawClient.create(request).thenApply(response -> response.body()); + } + + /** + * Moves up to 5,000 bookings in the background, each on its own, so one that can't move never holds up the rest. Nothing's ever cancelled: a booking nobody can take stays where it is, and its item says so. It answers at once: follow the run by its id, or wait for scheduling.reassignment.completed. + */ + public CompletableFuture create( + CreateSchedulingReassignmentRequest request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * How it's going. + */ + public CompletableFuture get(String id) { + return this.rawClient.get(id).thenApply(response -> response.body()); + } + + /** + * How it's going. + */ + public CompletableFuture get(String id, RequestOptions requestOptions) { + return this.rawClient.get(id, requestOptions).thenApply(response -> response.body()); + } + + /** + * How it's going. + */ + public CompletableFuture get(String id, GetReassignmentsRequest request) { + return this.rawClient.get(id, request).thenApply(response -> response.body()); + } + + /** + * How it's going. + */ + public CompletableFuture get( + String id, GetReassignmentsRequest request, RequestOptions requestOptions) { + return this.rawClient.get(id, request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Each booking it covers and what happened to it. A group session has one, for one of its seats. Empty until the worker's started on it. + */ + public CompletableFuture items(String id) { + return this.rawClient.items(id).thenApply(response -> response.body()); + } + + /** + * Each booking it covers and what happened to it. A group session has one, for one of its seats. Empty until the worker's started on it. + */ + public CompletableFuture items(String id, RequestOptions requestOptions) { + return this.rawClient.items(id, requestOptions).thenApply(response -> response.body()); + } + + /** + * Each booking it covers and what happened to it. A group session has one, for one of its seats. Empty until the worker's started on it. + */ + public CompletableFuture items(String id, ItemsReassignmentsRequest request) { + return this.rawClient.items(id, request).thenApply(response -> response.body()); + } + + /** + * Each booking it covers and what happened to it. A group session has one, for one of its seats. Empty until the worker's started on it. + */ + public CompletableFuture items( + String id, ItemsReassignmentsRequest request, RequestOptions requestOptions) { + return this.rawClient.items(id, request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Stops what hasn't happened yet. What's moved stays moved: undo it for that. Cancelling one that's finished changes nothing. + */ + public CompletableFuture cancel(String id) { + return this.rawClient.cancel(id).thenApply(response -> response.body()); + } + + /** + * Stops what hasn't happened yet. What's moved stays moved: undo it for that. Cancelling one that's finished changes nothing. + */ + public CompletableFuture cancel(String id, RequestOptions requestOptions) { + return this.rawClient.cancel(id, requestOptions).thenApply(response -> response.body()); + } + + /** + * Stops what hasn't happened yet. What's moved stays moved: undo it for that. Cancelling one that's finished changes nothing. + */ + public CompletableFuture cancel(String id, CancelReassignmentsRequest request) { + return this.rawClient.cancel(id, request).thenApply(response -> response.body()); + } + + /** + * Stops what hasn't happened yet. What's moved stays moved: undo it for that. Cancelling one that's finished changes nothing. + */ + public CompletableFuture cancel( + String id, CancelReassignmentsRequest request, RequestOptions requestOptions) { + return this.rawClient.cancel(id, request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Gives back what a finished run moved, as a new run. A booking that's moved on since stays where it went, and a former host who's no longer free keeps it from going back, unless you pass overrides. + */ + public CompletableFuture undo(String id) { + return this.rawClient.undo(id).thenApply(response -> response.body()); + } + + /** + * Gives back what a finished run moved, as a new run. A booking that's moved on since stays where it went, and a former host who's no longer free keeps it from going back, unless you pass overrides. + */ + public CompletableFuture undo(String id, RequestOptions requestOptions) { + return this.rawClient.undo(id, requestOptions).thenApply(response -> response.body()); + } + + /** + * Gives back what a finished run moved, as a new run. A booking that's moved on since stays where it went, and a former host who's no longer free keeps it from going back, unless you pass overrides. + */ + public CompletableFuture undo(String id, UndoSchedulingReassignmentRequest request) { + return this.rawClient.undo(id, request).thenApply(response -> response.body()); + } + + /** + * Gives back what a finished run moved, as a new run. A booking that's moved on since stays where it went, and a former host who's no longer free keeps it from going back, unless you pass overrides. + */ + public CompletableFuture undo( + String id, UndoSchedulingReassignmentRequest request, RequestOptions requestOptions) { + return this.rawClient.undo(id, request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/sdks/java/src/main/java/com/coss/resources/scheduling/reassignments/RawReassignmentsClient.java b/sdks/java/src/main/java/com/coss/resources/scheduling/reassignments/RawReassignmentsClient.java new file mode 100644 index 000000000..76a64cd4a --- /dev/null +++ b/sdks/java/src/main/java/com/coss/resources/scheduling/reassignments/RawReassignmentsClient.java @@ -0,0 +1,786 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.coss.resources.scheduling.reassignments; + +import com.coss.core.ClientOptions; +import com.coss.core.CossApiException; +import com.coss.core.CossException; +import com.coss.core.CossHttpResponse; +import com.coss.core.IdempotencyUtils; +import com.coss.core.MediaTypes; +import com.coss.core.ObjectMappers; +import com.coss.core.QueryStringMapper; +import com.coss.core.RequestOptions; +import com.coss.core.RetryInterceptor; +import com.coss.errors.BadRequestError; +import com.coss.errors.ConflictError; +import com.coss.errors.ForbiddenError; +import com.coss.errors.InternalServerError; +import com.coss.errors.NotFoundError; +import com.coss.errors.ServiceUnavailableError; +import com.coss.errors.TooManyRequestsError; +import com.coss.errors.UnauthorizedError; +import com.coss.errors.UnprocessableEntityError; +import com.coss.errors.UnsupportedMediaTypeError; +import com.coss.resources.scheduling.reassignments.requests.CancelReassignmentsRequest; +import com.coss.resources.scheduling.reassignments.requests.CreateSchedulingReassignmentRequest; +import com.coss.resources.scheduling.reassignments.requests.GetReassignmentsRequest; +import com.coss.resources.scheduling.reassignments.requests.ItemsReassignmentsRequest; +import com.coss.resources.scheduling.reassignments.requests.ListReassignmentsRequest; +import com.coss.resources.scheduling.reassignments.requests.PreviewSchedulingReassignmentRequest; +import com.coss.resources.scheduling.reassignments.requests.UndoSchedulingReassignmentRequest; +import com.coss.types.Error; +import com.coss.types.SchedulingReassignment; +import com.coss.types.SchedulingReassignmentItemList; +import com.coss.types.SchedulingReassignmentList; +import com.coss.types.SchedulingReassignmentPreview; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.io.IOException; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawReassignmentsClient { + protected final ClientOptions clientOptions; + + public RawReassignmentsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Who each booking would go to, and why not when nobody can take it, without moving anything. It works down them in order, so two can't both be promised the same free hour. Change any of it and start the run with assignments. Covers the first 500. Things can change before you start it: the run decides again. + */ + public CossHttpResponse preview(PreviewSchedulingReassignmentRequest request) { + return preview(request, null); + } + + /** + * Who each booking would go to, and why not when nobody can take it, without moving anything. It works down them in order, so two can't both be promised the same free hour. Change any of it and start the run with assignments. Covers the first 500. Things can change before you start it: the run decides again. + */ + public CossHttpResponse preview( + PreviewSchedulingReassignmentRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("v1/scheduling/reassignments/preview"); + if (requestOptions != null) { + requestOptions.getQueryParameters().forEach((_key, _value) -> { + httpUrl.addQueryParameter(_key, _value); + }); + } + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new CossException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl.build()) + .method("POST", body) + .headers(Headers.of(IdempotencyUtils.withGeneratedIdempotencyKey( + clientOptions.headers(requestOptions), "Idempotency-Key"))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + if (requestOptions != null && requestOptions.getMaxRetries().isPresent()) { + okhttpRequest = okhttpRequest + .newBuilder() + .tag( + RetryInterceptor.MaxRetriesOverride.class, + new RetryInterceptor.MaxRetriesOverride( + requestOptions.getMaxRetries().get())) + .build(); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new CossHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, SchedulingReassignmentPreview.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 415: + throw new UnsupportedMediaTypeError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 422: + throw new UnprocessableEntityError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 500: + throw new InternalServerError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 503: + throw new ServiceUnavailableError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new CossApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (JsonProcessingException e) { + throw new CossException("Failed to deserialize response: " + e.getMessage(), e); + } catch (IOException e) { + throw new CossException("Network error executing HTTP request", e); + } + } + + /** + * Newest first, with how each is going. + */ + public CossHttpResponse list() { + return list(ListReassignmentsRequest.builder().build()); + } + + /** + * Newest first, with how each is going. + */ + public CossHttpResponse list(RequestOptions requestOptions) { + return list(ListReassignmentsRequest.builder().build(), requestOptions); + } + + /** + * Newest first, with how each is going. + */ + public CossHttpResponse list(ListReassignmentsRequest request) { + return list(request, null); + } + + /** + * Newest first, with how each is going. + */ + public CossHttpResponse list( + ListReassignmentsRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("v1/scheduling/reassignments"); + if (request.getLimit().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "limit", request.getLimit().get(), false); + } + if (request.getAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "after", request.getAfter().get(), false); + } + if (requestOptions != null) { + requestOptions.getQueryParameters().forEach((_key, _value) -> { + httpUrl.addQueryParameter(_key, _value); + }); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + if (requestOptions != null && requestOptions.getMaxRetries().isPresent()) { + okhttpRequest = okhttpRequest + .newBuilder() + .tag( + RetryInterceptor.MaxRetriesOverride.class, + new RetryInterceptor.MaxRetriesOverride( + requestOptions.getMaxRetries().get())) + .build(); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new CossHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, SchedulingReassignmentList.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 422: + throw new UnprocessableEntityError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 500: + throw new InternalServerError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 503: + throw new ServiceUnavailableError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new CossApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (JsonProcessingException e) { + throw new CossException("Failed to deserialize response: " + e.getMessage(), e); + } catch (IOException e) { + throw new CossException("Network error executing HTTP request", e); + } + } + + /** + * Moves up to 5,000 bookings in the background, each on its own, so one that can't move never holds up the rest. Nothing's ever cancelled: a booking nobody can take stays where it is, and its item says so. It answers at once: follow the run by its id, or wait for scheduling.reassignment.completed. + */ + public CossHttpResponse create(CreateSchedulingReassignmentRequest request) { + return create(request, null); + } + + /** + * Moves up to 5,000 bookings in the background, each on its own, so one that can't move never holds up the rest. Nothing's ever cancelled: a booking nobody can take stays where it is, and its item says so. It answers at once: follow the run by its id, or wait for scheduling.reassignment.completed. + */ + public CossHttpResponse create( + CreateSchedulingReassignmentRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("v1/scheduling/reassignments"); + if (requestOptions != null) { + requestOptions.getQueryParameters().forEach((_key, _value) -> { + httpUrl.addQueryParameter(_key, _value); + }); + } + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (Exception e) { + throw new RuntimeException(e); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("POST", body) + .headers(Headers.of(IdempotencyUtils.withGeneratedIdempotencyKey( + clientOptions.headers(requestOptions), "Idempotency-Key"))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + if (request.getIdempotencyKey().isPresent()) { + _requestBuilder.addHeader( + "Idempotency-Key", request.getIdempotencyKey().get()); + } + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + if (requestOptions != null && requestOptions.getMaxRetries().isPresent()) { + okhttpRequest = okhttpRequest + .newBuilder() + .tag( + RetryInterceptor.MaxRetriesOverride.class, + new RetryInterceptor.MaxRetriesOverride( + requestOptions.getMaxRetries().get())) + .build(); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new CossHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, SchedulingReassignment.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 409: + throw new ConflictError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 415: + throw new UnsupportedMediaTypeError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 422: + throw new UnprocessableEntityError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 500: + throw new InternalServerError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 503: + throw new ServiceUnavailableError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new CossApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (JsonProcessingException e) { + throw new CossException("Failed to deserialize response: " + e.getMessage(), e); + } catch (IOException e) { + throw new CossException("Network error executing HTTP request", e); + } + } + + /** + * How it's going. + */ + public CossHttpResponse get(String id) { + return get(id, GetReassignmentsRequest.builder().build()); + } + + /** + * How it's going. + */ + public CossHttpResponse get(String id, RequestOptions requestOptions) { + return get(id, GetReassignmentsRequest.builder().build(), requestOptions); + } + + /** + * How it's going. + */ + public CossHttpResponse get(String id, GetReassignmentsRequest request) { + return get(id, request, null); + } + + /** + * How it's going. + */ + public CossHttpResponse get( + String id, GetReassignmentsRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("v1/scheduling/reassignments") + .addPathSegment(id); + if (requestOptions != null) { + requestOptions.getQueryParameters().forEach((_key, _value) -> { + httpUrl.addQueryParameter(_key, _value); + }); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + if (requestOptions != null && requestOptions.getMaxRetries().isPresent()) { + okhttpRequest = okhttpRequest + .newBuilder() + .tag( + RetryInterceptor.MaxRetriesOverride.class, + new RetryInterceptor.MaxRetriesOverride( + requestOptions.getMaxRetries().get())) + .build(); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new CossHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, SchedulingReassignment.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 500: + throw new InternalServerError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 503: + throw new ServiceUnavailableError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new CossApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (JsonProcessingException e) { + throw new CossException("Failed to deserialize response: " + e.getMessage(), e); + } catch (IOException e) { + throw new CossException("Network error executing HTTP request", e); + } + } + + /** + * Each booking it covers and what happened to it. A group session has one, for one of its seats. Empty until the worker's started on it. + */ + public CossHttpResponse items(String id) { + return items(id, ItemsReassignmentsRequest.builder().build()); + } + + /** + * Each booking it covers and what happened to it. A group session has one, for one of its seats. Empty until the worker's started on it. + */ + public CossHttpResponse items(String id, RequestOptions requestOptions) { + return items(id, ItemsReassignmentsRequest.builder().build(), requestOptions); + } + + /** + * Each booking it covers and what happened to it. A group session has one, for one of its seats. Empty until the worker's started on it. + */ + public CossHttpResponse items(String id, ItemsReassignmentsRequest request) { + return items(id, request, null); + } + + /** + * Each booking it covers and what happened to it. A group session has one, for one of its seats. Empty until the worker's started on it. + */ + public CossHttpResponse items( + String id, ItemsReassignmentsRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("v1/scheduling/reassignments") + .addPathSegment(id) + .addPathSegments("items"); + if (request.getLimit().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "limit", request.getLimit().get(), false); + } + if (request.getAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "after", request.getAfter().get(), false); + } + if (requestOptions != null) { + requestOptions.getQueryParameters().forEach((_key, _value) -> { + httpUrl.addQueryParameter(_key, _value); + }); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + if (requestOptions != null && requestOptions.getMaxRetries().isPresent()) { + okhttpRequest = okhttpRequest + .newBuilder() + .tag( + RetryInterceptor.MaxRetriesOverride.class, + new RetryInterceptor.MaxRetriesOverride( + requestOptions.getMaxRetries().get())) + .build(); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new CossHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, SchedulingReassignmentItemList.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 422: + throw new UnprocessableEntityError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 500: + throw new InternalServerError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 503: + throw new ServiceUnavailableError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new CossApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (JsonProcessingException e) { + throw new CossException("Failed to deserialize response: " + e.getMessage(), e); + } catch (IOException e) { + throw new CossException("Network error executing HTTP request", e); + } + } + + /** + * Stops what hasn't happened yet. What's moved stays moved: undo it for that. Cancelling one that's finished changes nothing. + */ + public CossHttpResponse cancel(String id) { + return cancel(id, CancelReassignmentsRequest.builder().build()); + } + + /** + * Stops what hasn't happened yet. What's moved stays moved: undo it for that. Cancelling one that's finished changes nothing. + */ + public CossHttpResponse cancel(String id, RequestOptions requestOptions) { + return cancel(id, CancelReassignmentsRequest.builder().build(), requestOptions); + } + + /** + * Stops what hasn't happened yet. What's moved stays moved: undo it for that. Cancelling one that's finished changes nothing. + */ + public CossHttpResponse cancel(String id, CancelReassignmentsRequest request) { + return cancel(id, request, null); + } + + /** + * Stops what hasn't happened yet. What's moved stays moved: undo it for that. Cancelling one that's finished changes nothing. + */ + public CossHttpResponse cancel( + String id, CancelReassignmentsRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("v1/scheduling/reassignments") + .addPathSegment(id) + .addPathSegments("cancel"); + if (requestOptions != null) { + requestOptions.getQueryParameters().forEach((_key, _value) -> { + httpUrl.addQueryParameter(_key, _value); + }); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("POST", RequestBody.create("", null)) + .headers(Headers.of(IdempotencyUtils.withGeneratedIdempotencyKey( + clientOptions.headers(requestOptions), "Idempotency-Key"))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + if (requestOptions != null && requestOptions.getMaxRetries().isPresent()) { + okhttpRequest = okhttpRequest + .newBuilder() + .tag( + RetryInterceptor.MaxRetriesOverride.class, + new RetryInterceptor.MaxRetriesOverride( + requestOptions.getMaxRetries().get())) + .build(); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new CossHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, SchedulingReassignment.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 500: + throw new InternalServerError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 503: + throw new ServiceUnavailableError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new CossApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (JsonProcessingException e) { + throw new CossException("Failed to deserialize response: " + e.getMessage(), e); + } catch (IOException e) { + throw new CossException("Network error executing HTTP request", e); + } + } + + /** + * Gives back what a finished run moved, as a new run. A booking that's moved on since stays where it went, and a former host who's no longer free keeps it from going back, unless you pass overrides. + */ + public CossHttpResponse undo(String id) { + return undo(id, UndoSchedulingReassignmentRequest.builder().build()); + } + + /** + * Gives back what a finished run moved, as a new run. A booking that's moved on since stays where it went, and a former host who's no longer free keeps it from going back, unless you pass overrides. + */ + public CossHttpResponse undo(String id, RequestOptions requestOptions) { + return undo(id, UndoSchedulingReassignmentRequest.builder().build(), requestOptions); + } + + /** + * Gives back what a finished run moved, as a new run. A booking that's moved on since stays where it went, and a former host who's no longer free keeps it from going back, unless you pass overrides. + */ + public CossHttpResponse undo(String id, UndoSchedulingReassignmentRequest request) { + return undo(id, request, null); + } + + /** + * Gives back what a finished run moved, as a new run. A booking that's moved on since stays where it went, and a former host who's no longer free keeps it from going back, unless you pass overrides. + */ + public CossHttpResponse undo( + String id, UndoSchedulingReassignmentRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("v1/scheduling/reassignments") + .addPathSegment(id) + .addPathSegments("undo"); + if (requestOptions != null) { + requestOptions.getQueryParameters().forEach((_key, _value) -> { + httpUrl.addQueryParameter(_key, _value); + }); + } + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new CossException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl.build()) + .method("POST", body) + .headers(Headers.of(IdempotencyUtils.withGeneratedIdempotencyKey( + clientOptions.headers(requestOptions), "Idempotency-Key"))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + okhttpRequest = okhttpRequest + .newBuilder() + .tag(RetryInterceptor.MaxRetriesOverride.class, new RetryInterceptor.MaxRetriesOverride(0)) + .build(); + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new CossHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, SchedulingReassignment.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 415: + throw new UnsupportedMediaTypeError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 422: + throw new UnprocessableEntityError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 500: + throw new InternalServerError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 503: + throw new ServiceUnavailableError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new CossApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (JsonProcessingException e) { + throw new CossException("Failed to deserialize response: " + e.getMessage(), e); + } catch (IOException e) { + throw new CossException("Network error executing HTTP request", e); + } + } +} diff --git a/sdks/java/src/main/java/com/coss/resources/scheduling/reassignments/ReassignmentsClient.java b/sdks/java/src/main/java/com/coss/resources/scheduling/reassignments/ReassignmentsClient.java new file mode 100644 index 000000000..67cfe1afe --- /dev/null +++ b/sdks/java/src/main/java/com/coss/resources/scheduling/reassignments/ReassignmentsClient.java @@ -0,0 +1,207 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.coss.resources.scheduling.reassignments; + +import com.coss.core.ClientOptions; +import com.coss.core.RequestOptions; +import com.coss.resources.scheduling.reassignments.requests.CancelReassignmentsRequest; +import com.coss.resources.scheduling.reassignments.requests.CreateSchedulingReassignmentRequest; +import com.coss.resources.scheduling.reassignments.requests.GetReassignmentsRequest; +import com.coss.resources.scheduling.reassignments.requests.ItemsReassignmentsRequest; +import com.coss.resources.scheduling.reassignments.requests.ListReassignmentsRequest; +import com.coss.resources.scheduling.reassignments.requests.PreviewSchedulingReassignmentRequest; +import com.coss.resources.scheduling.reassignments.requests.UndoSchedulingReassignmentRequest; +import com.coss.types.SchedulingReassignment; +import com.coss.types.SchedulingReassignmentItemList; +import com.coss.types.SchedulingReassignmentList; +import com.coss.types.SchedulingReassignmentPreview; + +public class ReassignmentsClient { + protected final ClientOptions clientOptions; + + private final RawReassignmentsClient rawClient; + + public ReassignmentsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawReassignmentsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawReassignmentsClient withRawResponse() { + return this.rawClient; + } + + /** + * Who each booking would go to, and why not when nobody can take it, without moving anything. It works down them in order, so two can't both be promised the same free hour. Change any of it and start the run with assignments. Covers the first 500. Things can change before you start it: the run decides again. + */ + public SchedulingReassignmentPreview preview(PreviewSchedulingReassignmentRequest request) { + return this.rawClient.preview(request).body(); + } + + /** + * Who each booking would go to, and why not when nobody can take it, without moving anything. It works down them in order, so two can't both be promised the same free hour. Change any of it and start the run with assignments. Covers the first 500. Things can change before you start it: the run decides again. + */ + public SchedulingReassignmentPreview preview( + PreviewSchedulingReassignmentRequest request, RequestOptions requestOptions) { + return this.rawClient.preview(request, requestOptions).body(); + } + + /** + * Newest first, with how each is going. + */ + public SchedulingReassignmentList list() { + return this.rawClient.list().body(); + } + + /** + * Newest first, with how each is going. + */ + public SchedulingReassignmentList list(RequestOptions requestOptions) { + return this.rawClient.list(requestOptions).body(); + } + + /** + * Newest first, with how each is going. + */ + public SchedulingReassignmentList list(ListReassignmentsRequest request) { + return this.rawClient.list(request).body(); + } + + /** + * Newest first, with how each is going. + */ + public SchedulingReassignmentList list(ListReassignmentsRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).body(); + } + + /** + * Moves up to 5,000 bookings in the background, each on its own, so one that can't move never holds up the rest. Nothing's ever cancelled: a booking nobody can take stays where it is, and its item says so. It answers at once: follow the run by its id, or wait for scheduling.reassignment.completed. + */ + public SchedulingReassignment create(CreateSchedulingReassignmentRequest request) { + return this.rawClient.create(request).body(); + } + + /** + * Moves up to 5,000 bookings in the background, each on its own, so one that can't move never holds up the rest. Nothing's ever cancelled: a booking nobody can take stays where it is, and its item says so. It answers at once: follow the run by its id, or wait for scheduling.reassignment.completed. + */ + public SchedulingReassignment create(CreateSchedulingReassignmentRequest request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).body(); + } + + /** + * How it's going. + */ + public SchedulingReassignment get(String id) { + return this.rawClient.get(id).body(); + } + + /** + * How it's going. + */ + public SchedulingReassignment get(String id, RequestOptions requestOptions) { + return this.rawClient.get(id, requestOptions).body(); + } + + /** + * How it's going. + */ + public SchedulingReassignment get(String id, GetReassignmentsRequest request) { + return this.rawClient.get(id, request).body(); + } + + /** + * How it's going. + */ + public SchedulingReassignment get(String id, GetReassignmentsRequest request, RequestOptions requestOptions) { + return this.rawClient.get(id, request, requestOptions).body(); + } + + /** + * Each booking it covers and what happened to it. A group session has one, for one of its seats. Empty until the worker's started on it. + */ + public SchedulingReassignmentItemList items(String id) { + return this.rawClient.items(id).body(); + } + + /** + * Each booking it covers and what happened to it. A group session has one, for one of its seats. Empty until the worker's started on it. + */ + public SchedulingReassignmentItemList items(String id, RequestOptions requestOptions) { + return this.rawClient.items(id, requestOptions).body(); + } + + /** + * Each booking it covers and what happened to it. A group session has one, for one of its seats. Empty until the worker's started on it. + */ + public SchedulingReassignmentItemList items(String id, ItemsReassignmentsRequest request) { + return this.rawClient.items(id, request).body(); + } + + /** + * Each booking it covers and what happened to it. A group session has one, for one of its seats. Empty until the worker's started on it. + */ + public SchedulingReassignmentItemList items( + String id, ItemsReassignmentsRequest request, RequestOptions requestOptions) { + return this.rawClient.items(id, request, requestOptions).body(); + } + + /** + * Stops what hasn't happened yet. What's moved stays moved: undo it for that. Cancelling one that's finished changes nothing. + */ + public SchedulingReassignment cancel(String id) { + return this.rawClient.cancel(id).body(); + } + + /** + * Stops what hasn't happened yet. What's moved stays moved: undo it for that. Cancelling one that's finished changes nothing. + */ + public SchedulingReassignment cancel(String id, RequestOptions requestOptions) { + return this.rawClient.cancel(id, requestOptions).body(); + } + + /** + * Stops what hasn't happened yet. What's moved stays moved: undo it for that. Cancelling one that's finished changes nothing. + */ + public SchedulingReassignment cancel(String id, CancelReassignmentsRequest request) { + return this.rawClient.cancel(id, request).body(); + } + + /** + * Stops what hasn't happened yet. What's moved stays moved: undo it for that. Cancelling one that's finished changes nothing. + */ + public SchedulingReassignment cancel(String id, CancelReassignmentsRequest request, RequestOptions requestOptions) { + return this.rawClient.cancel(id, request, requestOptions).body(); + } + + /** + * Gives back what a finished run moved, as a new run. A booking that's moved on since stays where it went, and a former host who's no longer free keeps it from going back, unless you pass overrides. + */ + public SchedulingReassignment undo(String id) { + return this.rawClient.undo(id).body(); + } + + /** + * Gives back what a finished run moved, as a new run. A booking that's moved on since stays where it went, and a former host who's no longer free keeps it from going back, unless you pass overrides. + */ + public SchedulingReassignment undo(String id, RequestOptions requestOptions) { + return this.rawClient.undo(id, requestOptions).body(); + } + + /** + * Gives back what a finished run moved, as a new run. A booking that's moved on since stays where it went, and a former host who's no longer free keeps it from going back, unless you pass overrides. + */ + public SchedulingReassignment undo(String id, UndoSchedulingReassignmentRequest request) { + return this.rawClient.undo(id, request).body(); + } + + /** + * Gives back what a finished run moved, as a new run. A booking that's moved on since stays where it went, and a former host who's no longer free keeps it from going back, unless you pass overrides. + */ + public SchedulingReassignment undo( + String id, UndoSchedulingReassignmentRequest request, RequestOptions requestOptions) { + return this.rawClient.undo(id, request, requestOptions).body(); + } +} diff --git a/sdks/java/src/main/java/com/coss/resources/scheduling/reassignments/requests/CancelReassignmentsRequest.java b/sdks/java/src/main/java/com/coss/resources/scheduling/reassignments/requests/CancelReassignmentsRequest.java new file mode 100644 index 000000000..bdec2f557 --- /dev/null +++ b/sdks/java/src/main/java/com/coss/resources/scheduling/reassignments/requests/CancelReassignmentsRequest.java @@ -0,0 +1,69 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.coss.resources.scheduling.reassignments.requests; + +import com.coss.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CancelReassignmentsRequest.Builder.class) +public final class CancelReassignmentsRequest { + private final Map additionalProperties; + + private CancelReassignmentsRequest(Map additionalProperties) { + this.additionalProperties = additionalProperties; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CancelReassignmentsRequest; + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(CancelReassignmentsRequest other) { + return this; + } + + public CancelReassignmentsRequest build() { + return new CancelReassignmentsRequest(additionalProperties); + } + + public Builder additionalProperty(String key, Object value) { + this.additionalProperties.put(key, value); + return this; + } + + public Builder additionalProperties(Map additionalProperties) { + this.additionalProperties.putAll(additionalProperties); + return this; + } + } +} diff --git a/sdks/java/src/main/java/com/coss/resources/scheduling/reassignments/requests/CreateSchedulingReassignmentRequest.java b/sdks/java/src/main/java/com/coss/resources/scheduling/reassignments/requests/CreateSchedulingReassignmentRequest.java new file mode 100644 index 000000000..fa2564e40 --- /dev/null +++ b/sdks/java/src/main/java/com/coss/resources/scheduling/reassignments/requests/CreateSchedulingReassignmentRequest.java @@ -0,0 +1,337 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.coss.resources.scheduling.reassignments.requests; + +import com.coss.core.ObjectMappers; +import com.coss.resources.scheduling.reassignments.types.CreateSchedulingReassignmentRequestNotify; +import com.coss.resources.scheduling.reassignments.types.CreateSchedulingReassignmentRequestOverridesItem; +import com.coss.resources.scheduling.reassignments.types.CreateSchedulingReassignmentRequestReasonCode; +import com.coss.types.SchedulingReassignmentSelection; +import com.coss.types.SchedulingReassignmentStrategy; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateSchedulingReassignmentRequest.Builder.class) +public final class CreateSchedulingReassignmentRequest { + private final Optional idempotencyKey; + + private final SchedulingReassignmentSelection selection; + + private final Optional strategy; + + private final CreateSchedulingReassignmentRequestReasonCode reasonCode; + + private final Optional note; + + private final Optional> overrides; + + private final Optional notify; + + private final Map additionalProperties; + + private CreateSchedulingReassignmentRequest( + Optional idempotencyKey, + SchedulingReassignmentSelection selection, + Optional strategy, + CreateSchedulingReassignmentRequestReasonCode reasonCode, + Optional note, + Optional> overrides, + Optional notify, + Map additionalProperties) { + this.idempotencyKey = idempotencyKey; + this.selection = selection; + this.strategy = strategy; + this.reasonCode = reasonCode; + this.note = note; + this.overrides = overrides; + this.notify = notify; + this.additionalProperties = additionalProperties; + } + + /** + * @return Makes retries safe: a repeated request with the same key and body returns the original run instead of starting another, for 24 hours. 1-256 characters. + */ + @JsonIgnore + public Optional getIdempotencyKey() { + return idempotencyKey; + } + + @JsonProperty("selection") + public SchedulingReassignmentSelection getSelection() { + return selection; + } + + @JsonProperty("strategy") + public Optional getStrategy() { + return strategy; + } + + @JsonProperty("reason_code") + public CreateSchedulingReassignmentRequestReasonCode getReasonCode() { + return reasonCode; + } + + /** + * @return Why, in your words: required with an override of someone's availability. + */ + @JsonProperty("note") + public Optional getNote() { + return note; + } + + @JsonProperty("overrides") + public Optional> getOverrides() { + return overrides; + } + + @JsonProperty("notify") + public Optional getNotify() { + return notify; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateSchedulingReassignmentRequest + && equalTo((CreateSchedulingReassignmentRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateSchedulingReassignmentRequest other) { + return idempotencyKey.equals(other.idempotencyKey) + && selection.equals(other.selection) + && strategy.equals(other.strategy) + && reasonCode.equals(other.reasonCode) + && note.equals(other.note) + && overrides.equals(other.overrides) + && notify.equals(other.notify); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.idempotencyKey, + this.selection, + this.strategy, + this.reasonCode, + this.note, + this.overrides, + this.notify); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static SelectionStage builder() { + return new Builder(); + } + + public interface SelectionStage { + ReasonCodeStage selection(@NotNull SchedulingReassignmentSelection selection); + + Builder from(CreateSchedulingReassignmentRequest other); + } + + public interface ReasonCodeStage { + _FinalStage reasonCode(@NotNull CreateSchedulingReassignmentRequestReasonCode reasonCode); + } + + public interface _FinalStage { + CreateSchedulingReassignmentRequest build(); + + _FinalStage additionalProperty(String key, Object value); + + _FinalStage additionalProperties(Map additionalProperties); + + /** + *

Makes retries safe: a repeated request with the same key and body returns the original run instead of starting another, for 24 hours. 1-256 characters.

+ */ + _FinalStage idempotencyKey(Optional idempotencyKey); + + _FinalStage idempotencyKey(String idempotencyKey); + + _FinalStage strategy(Optional strategy); + + _FinalStage strategy(SchedulingReassignmentStrategy strategy); + + /** + *

Why, in your words: required with an override of someone's availability.

+ */ + _FinalStage note(Optional note); + + _FinalStage note(String note); + + _FinalStage overrides(Optional> overrides); + + _FinalStage overrides(List overrides); + + _FinalStage notify(Optional notify); + + _FinalStage notify(CreateSchedulingReassignmentRequestNotify notify); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements SelectionStage, ReasonCodeStage, _FinalStage { + private SchedulingReassignmentSelection selection; + + private CreateSchedulingReassignmentRequestReasonCode reasonCode; + + private Optional notify = Optional.empty(); + + private Optional> overrides = Optional.empty(); + + private Optional note = Optional.empty(); + + private Optional strategy = Optional.empty(); + + private Optional idempotencyKey = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(CreateSchedulingReassignmentRequest other) { + idempotencyKey(other.getIdempotencyKey()); + selection(other.getSelection()); + strategy(other.getStrategy()); + reasonCode(other.getReasonCode()); + note(other.getNote()); + overrides(other.getOverrides()); + notify(other.getNotify()); + return this; + } + + @java.lang.Override + @JsonSetter("selection") + public ReasonCodeStage selection(@NotNull SchedulingReassignmentSelection selection) { + this.selection = Objects.requireNonNull(selection, "selection must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("reason_code") + public _FinalStage reasonCode(@NotNull CreateSchedulingReassignmentRequestReasonCode reasonCode) { + this.reasonCode = Objects.requireNonNull(reasonCode, "reasonCode must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage notify(CreateSchedulingReassignmentRequestNotify notify) { + this.notify = Optional.ofNullable(notify); + return this; + } + + @java.lang.Override + @JsonSetter(value = "notify", nulls = Nulls.SKIP) + public _FinalStage notify(Optional notify) { + this.notify = notify; + return this; + } + + @java.lang.Override + public _FinalStage overrides(List overrides) { + this.overrides = Optional.ofNullable(overrides); + return this; + } + + @java.lang.Override + @JsonSetter(value = "overrides", nulls = Nulls.SKIP) + public _FinalStage overrides(Optional> overrides) { + this.overrides = overrides; + return this; + } + + /** + *

Why, in your words: required with an override of someone's availability.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage note(String note) { + this.note = Optional.ofNullable(note); + return this; + } + + /** + *

Why, in your words: required with an override of someone's availability.

+ */ + @java.lang.Override + @JsonSetter(value = "note", nulls = Nulls.SKIP) + public _FinalStage note(Optional note) { + this.note = note; + return this; + } + + @java.lang.Override + public _FinalStage strategy(SchedulingReassignmentStrategy strategy) { + this.strategy = Optional.ofNullable(strategy); + return this; + } + + @java.lang.Override + @JsonSetter(value = "strategy", nulls = Nulls.SKIP) + public _FinalStage strategy(Optional strategy) { + this.strategy = strategy; + return this; + } + + /** + *

Makes retries safe: a repeated request with the same key and body returns the original run instead of starting another, for 24 hours. 1-256 characters.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage idempotencyKey(String idempotencyKey) { + this.idempotencyKey = Optional.ofNullable(idempotencyKey); + return this; + } + + /** + *

Makes retries safe: a repeated request with the same key and body returns the original run instead of starting another, for 24 hours. 1-256 characters.

+ */ + @java.lang.Override + public _FinalStage idempotencyKey(Optional idempotencyKey) { + this.idempotencyKey = idempotencyKey; + return this; + } + + @java.lang.Override + public CreateSchedulingReassignmentRequest build() { + return new CreateSchedulingReassignmentRequest( + idempotencyKey, selection, strategy, reasonCode, note, overrides, notify, additionalProperties); + } + + @java.lang.Override + public Builder additionalProperty(String key, Object value) { + this.additionalProperties.put(key, value); + return this; + } + + @java.lang.Override + public Builder additionalProperties(Map additionalProperties) { + this.additionalProperties.putAll(additionalProperties); + return this; + } + } +} diff --git a/sdks/java/src/main/java/com/coss/resources/scheduling/reassignments/requests/GetReassignmentsRequest.java b/sdks/java/src/main/java/com/coss/resources/scheduling/reassignments/requests/GetReassignmentsRequest.java new file mode 100644 index 000000000..efa3a0904 --- /dev/null +++ b/sdks/java/src/main/java/com/coss/resources/scheduling/reassignments/requests/GetReassignmentsRequest.java @@ -0,0 +1,69 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.coss.resources.scheduling.reassignments.requests; + +import com.coss.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = GetReassignmentsRequest.Builder.class) +public final class GetReassignmentsRequest { + private final Map additionalProperties; + + private GetReassignmentsRequest(Map additionalProperties) { + this.additionalProperties = additionalProperties; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof GetReassignmentsRequest; + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(GetReassignmentsRequest other) { + return this; + } + + public GetReassignmentsRequest build() { + return new GetReassignmentsRequest(additionalProperties); + } + + public Builder additionalProperty(String key, Object value) { + this.additionalProperties.put(key, value); + return this; + } + + public Builder additionalProperties(Map additionalProperties) { + this.additionalProperties.putAll(additionalProperties); + return this; + } + } +} diff --git a/sdks/java/src/main/java/com/coss/resources/scheduling/reassignments/requests/ItemsReassignmentsRequest.java b/sdks/java/src/main/java/com/coss/resources/scheduling/reassignments/requests/ItemsReassignmentsRequest.java new file mode 100644 index 000000000..e5fb2378d --- /dev/null +++ b/sdks/java/src/main/java/com/coss/resources/scheduling/reassignments/requests/ItemsReassignmentsRequest.java @@ -0,0 +1,134 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.coss.resources.scheduling.reassignments.requests; + +import com.coss.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ItemsReassignmentsRequest.Builder.class) +public final class ItemsReassignmentsRequest { + private final Optional limit; + + private final Optional after; + + private final Map additionalProperties; + + private ItemsReassignmentsRequest( + Optional limit, Optional after, Map additionalProperties) { + this.limit = limit; + this.after = after; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("limit") + public Optional getLimit() { + return limit; + } + + /** + * @return The last id of the previous page. + */ + @JsonProperty("after") + public Optional getAfter() { + return after; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ItemsReassignmentsRequest && equalTo((ItemsReassignmentsRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ItemsReassignmentsRequest other) { + return limit.equals(other.limit) && after.equals(other.after); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.limit, this.after); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional limit = Optional.empty(); + + private Optional after = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ItemsReassignmentsRequest other) { + limit(other.getLimit()); + after(other.getAfter()); + return this; + } + + @JsonSetter(value = "limit", nulls = Nulls.SKIP) + public Builder limit(Optional limit) { + this.limit = limit; + return this; + } + + public Builder limit(Integer limit) { + this.limit = Optional.ofNullable(limit); + return this; + } + + /** + *

The last id of the previous page.

+ */ + @JsonSetter(value = "after", nulls = Nulls.SKIP) + public Builder after(Optional after) { + this.after = after; + return this; + } + + public Builder after(String after) { + this.after = Optional.ofNullable(after); + return this; + } + + public ItemsReassignmentsRequest build() { + return new ItemsReassignmentsRequest(limit, after, additionalProperties); + } + + public Builder additionalProperty(String key, Object value) { + this.additionalProperties.put(key, value); + return this; + } + + public Builder additionalProperties(Map additionalProperties) { + this.additionalProperties.putAll(additionalProperties); + return this; + } + } +} diff --git a/sdks/java/src/main/java/com/coss/resources/scheduling/reassignments/requests/ListReassignmentsRequest.java b/sdks/java/src/main/java/com/coss/resources/scheduling/reassignments/requests/ListReassignmentsRequest.java new file mode 100644 index 000000000..bb0bc9376 --- /dev/null +++ b/sdks/java/src/main/java/com/coss/resources/scheduling/reassignments/requests/ListReassignmentsRequest.java @@ -0,0 +1,134 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.coss.resources.scheduling.reassignments.requests; + +import com.coss.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ListReassignmentsRequest.Builder.class) +public final class ListReassignmentsRequest { + private final Optional limit; + + private final Optional after; + + private final Map additionalProperties; + + private ListReassignmentsRequest( + Optional limit, Optional after, Map additionalProperties) { + this.limit = limit; + this.after = after; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("limit") + public Optional getLimit() { + return limit; + } + + /** + * @return The last id of the previous page. + */ + @JsonProperty("after") + public Optional getAfter() { + return after; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ListReassignmentsRequest && equalTo((ListReassignmentsRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ListReassignmentsRequest other) { + return limit.equals(other.limit) && after.equals(other.after); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.limit, this.after); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional limit = Optional.empty(); + + private Optional after = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ListReassignmentsRequest other) { + limit(other.getLimit()); + after(other.getAfter()); + return this; + } + + @JsonSetter(value = "limit", nulls = Nulls.SKIP) + public Builder limit(Optional limit) { + this.limit = limit; + return this; + } + + public Builder limit(Integer limit) { + this.limit = Optional.ofNullable(limit); + return this; + } + + /** + *

The last id of the previous page.

+ */ + @JsonSetter(value = "after", nulls = Nulls.SKIP) + public Builder after(Optional after) { + this.after = after; + return this; + } + + public Builder after(String after) { + this.after = Optional.ofNullable(after); + return this; + } + + public ListReassignmentsRequest build() { + return new ListReassignmentsRequest(limit, after, additionalProperties); + } + + public Builder additionalProperty(String key, Object value) { + this.additionalProperties.put(key, value); + return this; + } + + public Builder additionalProperties(Map additionalProperties) { + this.additionalProperties.putAll(additionalProperties); + return this; + } + } +} diff --git a/sdks/java/src/main/java/com/coss/resources/scheduling/reassignments/requests/PreviewSchedulingReassignmentRequest.java b/sdks/java/src/main/java/com/coss/resources/scheduling/reassignments/requests/PreviewSchedulingReassignmentRequest.java new file mode 100644 index 000000000..39806282e --- /dev/null +++ b/sdks/java/src/main/java/com/coss/resources/scheduling/reassignments/requests/PreviewSchedulingReassignmentRequest.java @@ -0,0 +1,187 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.coss.resources.scheduling.reassignments.requests; + +import com.coss.core.ObjectMappers; +import com.coss.resources.scheduling.reassignments.types.PreviewSchedulingReassignmentRequestOverridesItem; +import com.coss.types.SchedulingReassignmentSelection; +import com.coss.types.SchedulingReassignmentStrategy; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PreviewSchedulingReassignmentRequest.Builder.class) +public final class PreviewSchedulingReassignmentRequest { + private final SchedulingReassignmentSelection selection; + + private final Optional strategy; + + private final Optional> overrides; + + private final Map additionalProperties; + + private PreviewSchedulingReassignmentRequest( + SchedulingReassignmentSelection selection, + Optional strategy, + Optional> overrides, + Map additionalProperties) { + this.selection = selection; + this.strategy = strategy; + this.overrides = overrides; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("selection") + public SchedulingReassignmentSelection getSelection() { + return selection; + } + + @JsonProperty("strategy") + public Optional getStrategy() { + return strategy; + } + + @JsonProperty("overrides") + public Optional> getOverrides() { + return overrides; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PreviewSchedulingReassignmentRequest + && equalTo((PreviewSchedulingReassignmentRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PreviewSchedulingReassignmentRequest other) { + return selection.equals(other.selection) + && strategy.equals(other.strategy) + && overrides.equals(other.overrides); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.selection, this.strategy, this.overrides); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static SelectionStage builder() { + return new Builder(); + } + + public interface SelectionStage { + _FinalStage selection(@NotNull SchedulingReassignmentSelection selection); + + Builder from(PreviewSchedulingReassignmentRequest other); + } + + public interface _FinalStage { + PreviewSchedulingReassignmentRequest build(); + + _FinalStage additionalProperty(String key, Object value); + + _FinalStage additionalProperties(Map additionalProperties); + + _FinalStage strategy(Optional strategy); + + _FinalStage strategy(SchedulingReassignmentStrategy strategy); + + _FinalStage overrides(Optional> overrides); + + _FinalStage overrides(List overrides); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements SelectionStage, _FinalStage { + private SchedulingReassignmentSelection selection; + + private Optional> overrides = Optional.empty(); + + private Optional strategy = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(PreviewSchedulingReassignmentRequest other) { + selection(other.getSelection()); + strategy(other.getStrategy()); + overrides(other.getOverrides()); + return this; + } + + @java.lang.Override + @JsonSetter("selection") + public _FinalStage selection(@NotNull SchedulingReassignmentSelection selection) { + this.selection = Objects.requireNonNull(selection, "selection must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage overrides(List overrides) { + this.overrides = Optional.ofNullable(overrides); + return this; + } + + @java.lang.Override + @JsonSetter(value = "overrides", nulls = Nulls.SKIP) + public _FinalStage overrides(Optional> overrides) { + this.overrides = overrides; + return this; + } + + @java.lang.Override + public _FinalStage strategy(SchedulingReassignmentStrategy strategy) { + this.strategy = Optional.ofNullable(strategy); + return this; + } + + @java.lang.Override + @JsonSetter(value = "strategy", nulls = Nulls.SKIP) + public _FinalStage strategy(Optional strategy) { + this.strategy = strategy; + return this; + } + + @java.lang.Override + public PreviewSchedulingReassignmentRequest build() { + return new PreviewSchedulingReassignmentRequest(selection, strategy, overrides, additionalProperties); + } + + @java.lang.Override + public Builder additionalProperty(String key, Object value) { + this.additionalProperties.put(key, value); + return this; + } + + @java.lang.Override + public Builder additionalProperties(Map additionalProperties) { + this.additionalProperties.putAll(additionalProperties); + return this; + } + } +} diff --git a/sdks/java/src/main/java/com/coss/resources/scheduling/reassignments/requests/UndoSchedulingReassignmentRequest.java b/sdks/java/src/main/java/com/coss/resources/scheduling/reassignments/requests/UndoSchedulingReassignmentRequest.java new file mode 100644 index 000000000..750c524b3 --- /dev/null +++ b/sdks/java/src/main/java/com/coss/resources/scheduling/reassignments/requests/UndoSchedulingReassignmentRequest.java @@ -0,0 +1,183 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.coss.resources.scheduling.reassignments.requests; + +import com.coss.core.ObjectMappers; +import com.coss.resources.scheduling.reassignments.types.UndoSchedulingReassignmentRequestNotify; +import com.coss.resources.scheduling.reassignments.types.UndoSchedulingReassignmentRequestOverridesItem; +import com.coss.resources.scheduling.reassignments.types.UndoSchedulingReassignmentRequestReasonCode; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = UndoSchedulingReassignmentRequest.Builder.class) +public final class UndoSchedulingReassignmentRequest { + private final Optional reasonCode; + + private final Optional note; + + private final Optional> overrides; + + private final Optional notify; + + private final Map additionalProperties; + + private UndoSchedulingReassignmentRequest( + Optional reasonCode, + Optional note, + Optional> overrides, + Optional notify, + Map additionalProperties) { + this.reasonCode = reasonCode; + this.note = note; + this.overrides = overrides; + this.notify = notify; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("reason_code") + public Optional getReasonCode() { + return reasonCode; + } + + @JsonProperty("note") + public Optional getNote() { + return note; + } + + @JsonProperty("overrides") + public Optional> getOverrides() { + return overrides; + } + + @JsonProperty("notify") + public Optional getNotify() { + return notify; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UndoSchedulingReassignmentRequest && equalTo((UndoSchedulingReassignmentRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UndoSchedulingReassignmentRequest other) { + return reasonCode.equals(other.reasonCode) + && note.equals(other.note) + && overrides.equals(other.overrides) + && notify.equals(other.notify); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.reasonCode, this.note, this.overrides, this.notify); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional reasonCode = Optional.empty(); + + private Optional note = Optional.empty(); + + private Optional> overrides = Optional.empty(); + + private Optional notify = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(UndoSchedulingReassignmentRequest other) { + reasonCode(other.getReasonCode()); + note(other.getNote()); + overrides(other.getOverrides()); + notify(other.getNotify()); + return this; + } + + @JsonSetter(value = "reason_code", nulls = Nulls.SKIP) + public Builder reasonCode(Optional reasonCode) { + this.reasonCode = reasonCode; + return this; + } + + public Builder reasonCode(UndoSchedulingReassignmentRequestReasonCode reasonCode) { + this.reasonCode = Optional.ofNullable(reasonCode); + return this; + } + + @JsonSetter(value = "note", nulls = Nulls.SKIP) + public Builder note(Optional note) { + this.note = note; + return this; + } + + public Builder note(String note) { + this.note = Optional.ofNullable(note); + return this; + } + + @JsonSetter(value = "overrides", nulls = Nulls.SKIP) + public Builder overrides(Optional> overrides) { + this.overrides = overrides; + return this; + } + + public Builder overrides(List overrides) { + this.overrides = Optional.ofNullable(overrides); + return this; + } + + @JsonSetter(value = "notify", nulls = Nulls.SKIP) + public Builder notify(Optional notify) { + this.notify = notify; + return this; + } + + public Builder notify(UndoSchedulingReassignmentRequestNotify notify) { + this.notify = Optional.ofNullable(notify); + return this; + } + + public UndoSchedulingReassignmentRequest build() { + return new UndoSchedulingReassignmentRequest(reasonCode, note, overrides, notify, additionalProperties); + } + + public Builder additionalProperty(String key, Object value) { + this.additionalProperties.put(key, value); + return this; + } + + public Builder additionalProperties(Map additionalProperties) { + this.additionalProperties.putAll(additionalProperties); + return this; + } + } +} diff --git a/sdks/java/src/main/java/com/coss/resources/scheduling/reassignments/types/CreateSchedulingReassignmentRequestNotify.java b/sdks/java/src/main/java/com/coss/resources/scheduling/reassignments/types/CreateSchedulingReassignmentRequestNotify.java new file mode 100644 index 000000000..9e0dddfb7 --- /dev/null +++ b/sdks/java/src/main/java/com/coss/resources/scheduling/reassignments/types/CreateSchedulingReassignmentRequestNotify.java @@ -0,0 +1,143 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.coss.resources.scheduling.reassignments.types; + +import com.coss.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateSchedulingReassignmentRequestNotify.Builder.class) +public final class CreateSchedulingReassignmentRequestNotify { + private final Optional attendees; + + private final Optional hosts; + + private final Map additionalProperties; + + private CreateSchedulingReassignmentRequestNotify( + Optional attendees, + Optional hosts, + Map additionalProperties) { + this.attendees = attendees; + this.hosts = hosts; + this.additionalProperties = additionalProperties; + } + + /** + * @return Tell attendees. Default: true. + */ + @JsonProperty("attendees") + public Optional getAttendees() { + return attendees; + } + + /** + * @return digest (the default) sends each host one email for the run. + */ + @JsonProperty("hosts") + public Optional getHosts() { + return hosts; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateSchedulingReassignmentRequestNotify + && equalTo((CreateSchedulingReassignmentRequestNotify) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateSchedulingReassignmentRequestNotify other) { + return attendees.equals(other.attendees) && hosts.equals(other.hosts); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.attendees, this.hosts); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional attendees = Optional.empty(); + + private Optional hosts = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(CreateSchedulingReassignmentRequestNotify other) { + attendees(other.getAttendees()); + hosts(other.getHosts()); + return this; + } + + /** + *

Tell attendees. Default: true.

+ */ + @JsonSetter(value = "attendees", nulls = Nulls.SKIP) + public Builder attendees(Optional attendees) { + this.attendees = attendees; + return this; + } + + public Builder attendees(Boolean attendees) { + this.attendees = Optional.ofNullable(attendees); + return this; + } + + /** + *

digest (the default) sends each host one email for the run.

+ */ + @JsonSetter(value = "hosts", nulls = Nulls.SKIP) + public Builder hosts(Optional hosts) { + this.hosts = hosts; + return this; + } + + public Builder hosts(CreateSchedulingReassignmentRequestNotifyHosts hosts) { + this.hosts = Optional.ofNullable(hosts); + return this; + } + + public CreateSchedulingReassignmentRequestNotify build() { + return new CreateSchedulingReassignmentRequestNotify(attendees, hosts, additionalProperties); + } + + public Builder additionalProperty(String key, Object value) { + this.additionalProperties.put(key, value); + return this; + } + + public Builder additionalProperties(Map additionalProperties) { + this.additionalProperties.putAll(additionalProperties); + return this; + } + } +} diff --git a/sdks/java/src/main/java/com/coss/resources/scheduling/reassignments/types/CreateSchedulingReassignmentRequestNotifyHosts.java b/sdks/java/src/main/java/com/coss/resources/scheduling/reassignments/types/CreateSchedulingReassignmentRequestNotifyHosts.java new file mode 100644 index 000000000..4bc363498 --- /dev/null +++ b/sdks/java/src/main/java/com/coss/resources/scheduling/reassignments/types/CreateSchedulingReassignmentRequestNotifyHosts.java @@ -0,0 +1,97 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.coss.resources.scheduling.reassignments.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class CreateSchedulingReassignmentRequestNotifyHosts { + public static final CreateSchedulingReassignmentRequestNotifyHosts EACH = + new CreateSchedulingReassignmentRequestNotifyHosts(Value.EACH, "each"); + + public static final CreateSchedulingReassignmentRequestNotifyHosts DIGEST = + new CreateSchedulingReassignmentRequestNotifyHosts(Value.DIGEST, "digest"); + + public static final CreateSchedulingReassignmentRequestNotifyHosts NONE = + new CreateSchedulingReassignmentRequestNotifyHosts(Value.NONE, "none"); + + private final Value value; + + private final String string; + + CreateSchedulingReassignmentRequestNotifyHosts(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof CreateSchedulingReassignmentRequestNotifyHosts + && this.string.equals(((CreateSchedulingReassignmentRequestNotifyHosts) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case EACH: + return visitor.visitEach(); + case DIGEST: + return visitor.visitDigest(); + case NONE: + return visitor.visitNone(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static CreateSchedulingReassignmentRequestNotifyHosts valueOf(String value) { + switch (value) { + case "each": + return EACH; + case "digest": + return DIGEST; + case "none": + return NONE; + default: + return new CreateSchedulingReassignmentRequestNotifyHosts(Value.UNKNOWN, value); + } + } + + public enum Value { + DIGEST, + + EACH, + + NONE, + + UNKNOWN + } + + public interface Visitor { + T visitDigest(); + + T visitEach(); + + T visitNone(); + + T visitUnknown(String unknownType); + } +} diff --git a/sdks/java/src/main/java/com/coss/resources/scheduling/reassignments/types/CreateSchedulingReassignmentRequestOverridesItem.java b/sdks/java/src/main/java/com/coss/resources/scheduling/reassignments/types/CreateSchedulingReassignmentRequestOverridesItem.java new file mode 100644 index 000000000..b33ca0a6e --- /dev/null +++ b/sdks/java/src/main/java/com/coss/resources/scheduling/reassignments/types/CreateSchedulingReassignmentRequestOverridesItem.java @@ -0,0 +1,130 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.coss.resources.scheduling.reassignments.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class CreateSchedulingReassignmentRequestOverridesItem { + public static final CreateSchedulingReassignmentRequestOverridesItem LIMIT_REACHED = + new CreateSchedulingReassignmentRequestOverridesItem(Value.LIMIT_REACHED, "limit_reached"); + + public static final CreateSchedulingReassignmentRequestOverridesItem HOST_BUSY = + new CreateSchedulingReassignmentRequestOverridesItem(Value.HOST_BUSY, "host_busy"); + + public static final CreateSchedulingReassignmentRequestOverridesItem OUT_OF_OFFICE = + new CreateSchedulingReassignmentRequestOverridesItem(Value.OUT_OF_OFFICE, "out_of_office"); + + public static final CreateSchedulingReassignmentRequestOverridesItem OUTSIDE_AVAILABILITY = + new CreateSchedulingReassignmentRequestOverridesItem(Value.OUTSIDE_AVAILABILITY, "outside_availability"); + + public static final CreateSchedulingReassignmentRequestOverridesItem ANY_HOST = + new CreateSchedulingReassignmentRequestOverridesItem(Value.ANY_HOST, "any_host"); + + public static final CreateSchedulingReassignmentRequestOverridesItem CALENDAR_UNVERIFIED = + new CreateSchedulingReassignmentRequestOverridesItem(Value.CALENDAR_UNVERIFIED, "calendar_unverified"); + + private final Value value; + + private final String string; + + CreateSchedulingReassignmentRequestOverridesItem(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof CreateSchedulingReassignmentRequestOverridesItem + && this.string.equals(((CreateSchedulingReassignmentRequestOverridesItem) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case LIMIT_REACHED: + return visitor.visitLimitReached(); + case HOST_BUSY: + return visitor.visitHostBusy(); + case OUT_OF_OFFICE: + return visitor.visitOutOfOffice(); + case OUTSIDE_AVAILABILITY: + return visitor.visitOutsideAvailability(); + case ANY_HOST: + return visitor.visitAnyHost(); + case CALENDAR_UNVERIFIED: + return visitor.visitCalendarUnverified(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static CreateSchedulingReassignmentRequestOverridesItem valueOf(String value) { + switch (value) { + case "limit_reached": + return LIMIT_REACHED; + case "host_busy": + return HOST_BUSY; + case "out_of_office": + return OUT_OF_OFFICE; + case "outside_availability": + return OUTSIDE_AVAILABILITY; + case "any_host": + return ANY_HOST; + case "calendar_unverified": + return CALENDAR_UNVERIFIED; + default: + return new CreateSchedulingReassignmentRequestOverridesItem(Value.UNKNOWN, value); + } + } + + public enum Value { + ANY_HOST, + + OUT_OF_OFFICE, + + OUTSIDE_AVAILABILITY, + + HOST_BUSY, + + LIMIT_REACHED, + + CALENDAR_UNVERIFIED, + + UNKNOWN + } + + public interface Visitor { + T visitAnyHost(); + + T visitOutOfOffice(); + + T visitOutsideAvailability(); + + T visitHostBusy(); + + T visitLimitReached(); + + T visitCalendarUnverified(); + + T visitUnknown(String unknownType); + } +} diff --git a/sdks/java/src/main/java/com/coss/resources/scheduling/reassignments/types/CreateSchedulingReassignmentRequestReasonCode.java b/sdks/java/src/main/java/com/coss/resources/scheduling/reassignments/types/CreateSchedulingReassignmentRequestReasonCode.java new file mode 100644 index 000000000..d46ce0924 --- /dev/null +++ b/sdks/java/src/main/java/com/coss/resources/scheduling/reassignments/types/CreateSchedulingReassignmentRequestReasonCode.java @@ -0,0 +1,130 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.coss.resources.scheduling.reassignments.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class CreateSchedulingReassignmentRequestReasonCode { + public static final CreateSchedulingReassignmentRequestReasonCode CUSTOMER_REQUEST = + new CreateSchedulingReassignmentRequestReasonCode(Value.CUSTOMER_REQUEST, "customer_request"); + + public static final CreateSchedulingReassignmentRequestReasonCode OTHER = + new CreateSchedulingReassignmentRequestReasonCode(Value.OTHER, "other"); + + public static final CreateSchedulingReassignmentRequestReasonCode OUT_OF_OFFICE = + new CreateSchedulingReassignmentRequestReasonCode(Value.OUT_OF_OFFICE, "out_of_office"); + + public static final CreateSchedulingReassignmentRequestReasonCode OFFBOARDING = + new CreateSchedulingReassignmentRequestReasonCode(Value.OFFBOARDING, "offboarding"); + + public static final CreateSchedulingReassignmentRequestReasonCode HOST_UNAVAILABLE = + new CreateSchedulingReassignmentRequestReasonCode(Value.HOST_UNAVAILABLE, "host_unavailable"); + + public static final CreateSchedulingReassignmentRequestReasonCode WORKLOAD = + new CreateSchedulingReassignmentRequestReasonCode(Value.WORKLOAD, "workload"); + + private final Value value; + + private final String string; + + CreateSchedulingReassignmentRequestReasonCode(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof CreateSchedulingReassignmentRequestReasonCode + && this.string.equals(((CreateSchedulingReassignmentRequestReasonCode) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case CUSTOMER_REQUEST: + return visitor.visitCustomerRequest(); + case OTHER: + return visitor.visitOther(); + case OUT_OF_OFFICE: + return visitor.visitOutOfOffice(); + case OFFBOARDING: + return visitor.visitOffboarding(); + case HOST_UNAVAILABLE: + return visitor.visitHostUnavailable(); + case WORKLOAD: + return visitor.visitWorkload(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static CreateSchedulingReassignmentRequestReasonCode valueOf(String value) { + switch (value) { + case "customer_request": + return CUSTOMER_REQUEST; + case "other": + return OTHER; + case "out_of_office": + return OUT_OF_OFFICE; + case "offboarding": + return OFFBOARDING; + case "host_unavailable": + return HOST_UNAVAILABLE; + case "workload": + return WORKLOAD; + default: + return new CreateSchedulingReassignmentRequestReasonCode(Value.UNKNOWN, value); + } + } + + public enum Value { + HOST_UNAVAILABLE, + + OUT_OF_OFFICE, + + WORKLOAD, + + CUSTOMER_REQUEST, + + OFFBOARDING, + + OTHER, + + UNKNOWN + } + + public interface Visitor { + T visitHostUnavailable(); + + T visitOutOfOffice(); + + T visitWorkload(); + + T visitCustomerRequest(); + + T visitOffboarding(); + + T visitOther(); + + T visitUnknown(String unknownType); + } +} diff --git a/sdks/java/src/main/java/com/coss/resources/scheduling/reassignments/types/PreviewSchedulingReassignmentRequestOverridesItem.java b/sdks/java/src/main/java/com/coss/resources/scheduling/reassignments/types/PreviewSchedulingReassignmentRequestOverridesItem.java new file mode 100644 index 000000000..1350f9b50 --- /dev/null +++ b/sdks/java/src/main/java/com/coss/resources/scheduling/reassignments/types/PreviewSchedulingReassignmentRequestOverridesItem.java @@ -0,0 +1,130 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.coss.resources.scheduling.reassignments.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class PreviewSchedulingReassignmentRequestOverridesItem { + public static final PreviewSchedulingReassignmentRequestOverridesItem LIMIT_REACHED = + new PreviewSchedulingReassignmentRequestOverridesItem(Value.LIMIT_REACHED, "limit_reached"); + + public static final PreviewSchedulingReassignmentRequestOverridesItem HOST_BUSY = + new PreviewSchedulingReassignmentRequestOverridesItem(Value.HOST_BUSY, "host_busy"); + + public static final PreviewSchedulingReassignmentRequestOverridesItem OUT_OF_OFFICE = + new PreviewSchedulingReassignmentRequestOverridesItem(Value.OUT_OF_OFFICE, "out_of_office"); + + public static final PreviewSchedulingReassignmentRequestOverridesItem OUTSIDE_AVAILABILITY = + new PreviewSchedulingReassignmentRequestOverridesItem(Value.OUTSIDE_AVAILABILITY, "outside_availability"); + + public static final PreviewSchedulingReassignmentRequestOverridesItem ANY_HOST = + new PreviewSchedulingReassignmentRequestOverridesItem(Value.ANY_HOST, "any_host"); + + public static final PreviewSchedulingReassignmentRequestOverridesItem CALENDAR_UNVERIFIED = + new PreviewSchedulingReassignmentRequestOverridesItem(Value.CALENDAR_UNVERIFIED, "calendar_unverified"); + + private final Value value; + + private final String string; + + PreviewSchedulingReassignmentRequestOverridesItem(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof PreviewSchedulingReassignmentRequestOverridesItem + && this.string.equals(((PreviewSchedulingReassignmentRequestOverridesItem) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case LIMIT_REACHED: + return visitor.visitLimitReached(); + case HOST_BUSY: + return visitor.visitHostBusy(); + case OUT_OF_OFFICE: + return visitor.visitOutOfOffice(); + case OUTSIDE_AVAILABILITY: + return visitor.visitOutsideAvailability(); + case ANY_HOST: + return visitor.visitAnyHost(); + case CALENDAR_UNVERIFIED: + return visitor.visitCalendarUnverified(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static PreviewSchedulingReassignmentRequestOverridesItem valueOf(String value) { + switch (value) { + case "limit_reached": + return LIMIT_REACHED; + case "host_busy": + return HOST_BUSY; + case "out_of_office": + return OUT_OF_OFFICE; + case "outside_availability": + return OUTSIDE_AVAILABILITY; + case "any_host": + return ANY_HOST; + case "calendar_unverified": + return CALENDAR_UNVERIFIED; + default: + return new PreviewSchedulingReassignmentRequestOverridesItem(Value.UNKNOWN, value); + } + } + + public enum Value { + ANY_HOST, + + OUT_OF_OFFICE, + + OUTSIDE_AVAILABILITY, + + HOST_BUSY, + + LIMIT_REACHED, + + CALENDAR_UNVERIFIED, + + UNKNOWN + } + + public interface Visitor { + T visitAnyHost(); + + T visitOutOfOffice(); + + T visitOutsideAvailability(); + + T visitHostBusy(); + + T visitLimitReached(); + + T visitCalendarUnverified(); + + T visitUnknown(String unknownType); + } +} diff --git a/sdks/java/src/main/java/com/coss/resources/scheduling/reassignments/types/UndoSchedulingReassignmentRequestNotify.java b/sdks/java/src/main/java/com/coss/resources/scheduling/reassignments/types/UndoSchedulingReassignmentRequestNotify.java new file mode 100644 index 000000000..46a06e645 --- /dev/null +++ b/sdks/java/src/main/java/com/coss/resources/scheduling/reassignments/types/UndoSchedulingReassignmentRequestNotify.java @@ -0,0 +1,143 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.coss.resources.scheduling.reassignments.types; + +import com.coss.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = UndoSchedulingReassignmentRequestNotify.Builder.class) +public final class UndoSchedulingReassignmentRequestNotify { + private final Optional attendees; + + private final Optional hosts; + + private final Map additionalProperties; + + private UndoSchedulingReassignmentRequestNotify( + Optional attendees, + Optional hosts, + Map additionalProperties) { + this.attendees = attendees; + this.hosts = hosts; + this.additionalProperties = additionalProperties; + } + + /** + * @return Tell attendees. Default: true. + */ + @JsonProperty("attendees") + public Optional getAttendees() { + return attendees; + } + + /** + * @return digest (the default) sends each host one email for the run. + */ + @JsonProperty("hosts") + public Optional getHosts() { + return hosts; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UndoSchedulingReassignmentRequestNotify + && equalTo((UndoSchedulingReassignmentRequestNotify) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UndoSchedulingReassignmentRequestNotify other) { + return attendees.equals(other.attendees) && hosts.equals(other.hosts); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.attendees, this.hosts); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional attendees = Optional.empty(); + + private Optional hosts = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(UndoSchedulingReassignmentRequestNotify other) { + attendees(other.getAttendees()); + hosts(other.getHosts()); + return this; + } + + /** + *

Tell attendees. Default: true.

+ */ + @JsonSetter(value = "attendees", nulls = Nulls.SKIP) + public Builder attendees(Optional attendees) { + this.attendees = attendees; + return this; + } + + public Builder attendees(Boolean attendees) { + this.attendees = Optional.ofNullable(attendees); + return this; + } + + /** + *

digest (the default) sends each host one email for the run.

+ */ + @JsonSetter(value = "hosts", nulls = Nulls.SKIP) + public Builder hosts(Optional hosts) { + this.hosts = hosts; + return this; + } + + public Builder hosts(UndoSchedulingReassignmentRequestNotifyHosts hosts) { + this.hosts = Optional.ofNullable(hosts); + return this; + } + + public UndoSchedulingReassignmentRequestNotify build() { + return new UndoSchedulingReassignmentRequestNotify(attendees, hosts, additionalProperties); + } + + public Builder additionalProperty(String key, Object value) { + this.additionalProperties.put(key, value); + return this; + } + + public Builder additionalProperties(Map additionalProperties) { + this.additionalProperties.putAll(additionalProperties); + return this; + } + } +} diff --git a/sdks/java/src/main/java/com/coss/resources/scheduling/reassignments/types/UndoSchedulingReassignmentRequestNotifyHosts.java b/sdks/java/src/main/java/com/coss/resources/scheduling/reassignments/types/UndoSchedulingReassignmentRequestNotifyHosts.java new file mode 100644 index 000000000..4a30da86f --- /dev/null +++ b/sdks/java/src/main/java/com/coss/resources/scheduling/reassignments/types/UndoSchedulingReassignmentRequestNotifyHosts.java @@ -0,0 +1,97 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.coss.resources.scheduling.reassignments.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class UndoSchedulingReassignmentRequestNotifyHosts { + public static final UndoSchedulingReassignmentRequestNotifyHosts EACH = + new UndoSchedulingReassignmentRequestNotifyHosts(Value.EACH, "each"); + + public static final UndoSchedulingReassignmentRequestNotifyHosts DIGEST = + new UndoSchedulingReassignmentRequestNotifyHosts(Value.DIGEST, "digest"); + + public static final UndoSchedulingReassignmentRequestNotifyHosts NONE = + new UndoSchedulingReassignmentRequestNotifyHosts(Value.NONE, "none"); + + private final Value value; + + private final String string; + + UndoSchedulingReassignmentRequestNotifyHosts(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof UndoSchedulingReassignmentRequestNotifyHosts + && this.string.equals(((UndoSchedulingReassignmentRequestNotifyHosts) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case EACH: + return visitor.visitEach(); + case DIGEST: + return visitor.visitDigest(); + case NONE: + return visitor.visitNone(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static UndoSchedulingReassignmentRequestNotifyHosts valueOf(String value) { + switch (value) { + case "each": + return EACH; + case "digest": + return DIGEST; + case "none": + return NONE; + default: + return new UndoSchedulingReassignmentRequestNotifyHosts(Value.UNKNOWN, value); + } + } + + public enum Value { + DIGEST, + + EACH, + + NONE, + + UNKNOWN + } + + public interface Visitor { + T visitDigest(); + + T visitEach(); + + T visitNone(); + + T visitUnknown(String unknownType); + } +} diff --git a/sdks/java/src/main/java/com/coss/resources/scheduling/reassignments/types/UndoSchedulingReassignmentRequestOverridesItem.java b/sdks/java/src/main/java/com/coss/resources/scheduling/reassignments/types/UndoSchedulingReassignmentRequestOverridesItem.java new file mode 100644 index 000000000..36d46c59b --- /dev/null +++ b/sdks/java/src/main/java/com/coss/resources/scheduling/reassignments/types/UndoSchedulingReassignmentRequestOverridesItem.java @@ -0,0 +1,130 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.coss.resources.scheduling.reassignments.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class UndoSchedulingReassignmentRequestOverridesItem { + public static final UndoSchedulingReassignmentRequestOverridesItem LIMIT_REACHED = + new UndoSchedulingReassignmentRequestOverridesItem(Value.LIMIT_REACHED, "limit_reached"); + + public static final UndoSchedulingReassignmentRequestOverridesItem HOST_BUSY = + new UndoSchedulingReassignmentRequestOverridesItem(Value.HOST_BUSY, "host_busy"); + + public static final UndoSchedulingReassignmentRequestOverridesItem OUT_OF_OFFICE = + new UndoSchedulingReassignmentRequestOverridesItem(Value.OUT_OF_OFFICE, "out_of_office"); + + public static final UndoSchedulingReassignmentRequestOverridesItem OUTSIDE_AVAILABILITY = + new UndoSchedulingReassignmentRequestOverridesItem(Value.OUTSIDE_AVAILABILITY, "outside_availability"); + + public static final UndoSchedulingReassignmentRequestOverridesItem ANY_HOST = + new UndoSchedulingReassignmentRequestOverridesItem(Value.ANY_HOST, "any_host"); + + public static final UndoSchedulingReassignmentRequestOverridesItem CALENDAR_UNVERIFIED = + new UndoSchedulingReassignmentRequestOverridesItem(Value.CALENDAR_UNVERIFIED, "calendar_unverified"); + + private final Value value; + + private final String string; + + UndoSchedulingReassignmentRequestOverridesItem(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof UndoSchedulingReassignmentRequestOverridesItem + && this.string.equals(((UndoSchedulingReassignmentRequestOverridesItem) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case LIMIT_REACHED: + return visitor.visitLimitReached(); + case HOST_BUSY: + return visitor.visitHostBusy(); + case OUT_OF_OFFICE: + return visitor.visitOutOfOffice(); + case OUTSIDE_AVAILABILITY: + return visitor.visitOutsideAvailability(); + case ANY_HOST: + return visitor.visitAnyHost(); + case CALENDAR_UNVERIFIED: + return visitor.visitCalendarUnverified(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static UndoSchedulingReassignmentRequestOverridesItem valueOf(String value) { + switch (value) { + case "limit_reached": + return LIMIT_REACHED; + case "host_busy": + return HOST_BUSY; + case "out_of_office": + return OUT_OF_OFFICE; + case "outside_availability": + return OUTSIDE_AVAILABILITY; + case "any_host": + return ANY_HOST; + case "calendar_unverified": + return CALENDAR_UNVERIFIED; + default: + return new UndoSchedulingReassignmentRequestOverridesItem(Value.UNKNOWN, value); + } + } + + public enum Value { + ANY_HOST, + + OUT_OF_OFFICE, + + OUTSIDE_AVAILABILITY, + + HOST_BUSY, + + LIMIT_REACHED, + + CALENDAR_UNVERIFIED, + + UNKNOWN + } + + public interface Visitor { + T visitAnyHost(); + + T visitOutOfOffice(); + + T visitOutsideAvailability(); + + T visitHostBusy(); + + T visitLimitReached(); + + T visitCalendarUnverified(); + + T visitUnknown(String unknownType); + } +} diff --git a/sdks/java/src/main/java/com/coss/resources/scheduling/reassignments/types/UndoSchedulingReassignmentRequestReasonCode.java b/sdks/java/src/main/java/com/coss/resources/scheduling/reassignments/types/UndoSchedulingReassignmentRequestReasonCode.java new file mode 100644 index 000000000..34b6e3057 --- /dev/null +++ b/sdks/java/src/main/java/com/coss/resources/scheduling/reassignments/types/UndoSchedulingReassignmentRequestReasonCode.java @@ -0,0 +1,130 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.coss.resources.scheduling.reassignments.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class UndoSchedulingReassignmentRequestReasonCode { + public static final UndoSchedulingReassignmentRequestReasonCode CUSTOMER_REQUEST = + new UndoSchedulingReassignmentRequestReasonCode(Value.CUSTOMER_REQUEST, "customer_request"); + + public static final UndoSchedulingReassignmentRequestReasonCode OTHER = + new UndoSchedulingReassignmentRequestReasonCode(Value.OTHER, "other"); + + public static final UndoSchedulingReassignmentRequestReasonCode OUT_OF_OFFICE = + new UndoSchedulingReassignmentRequestReasonCode(Value.OUT_OF_OFFICE, "out_of_office"); + + public static final UndoSchedulingReassignmentRequestReasonCode OFFBOARDING = + new UndoSchedulingReassignmentRequestReasonCode(Value.OFFBOARDING, "offboarding"); + + public static final UndoSchedulingReassignmentRequestReasonCode HOST_UNAVAILABLE = + new UndoSchedulingReassignmentRequestReasonCode(Value.HOST_UNAVAILABLE, "host_unavailable"); + + public static final UndoSchedulingReassignmentRequestReasonCode WORKLOAD = + new UndoSchedulingReassignmentRequestReasonCode(Value.WORKLOAD, "workload"); + + private final Value value; + + private final String string; + + UndoSchedulingReassignmentRequestReasonCode(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof UndoSchedulingReassignmentRequestReasonCode + && this.string.equals(((UndoSchedulingReassignmentRequestReasonCode) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case CUSTOMER_REQUEST: + return visitor.visitCustomerRequest(); + case OTHER: + return visitor.visitOther(); + case OUT_OF_OFFICE: + return visitor.visitOutOfOffice(); + case OFFBOARDING: + return visitor.visitOffboarding(); + case HOST_UNAVAILABLE: + return visitor.visitHostUnavailable(); + case WORKLOAD: + return visitor.visitWorkload(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static UndoSchedulingReassignmentRequestReasonCode valueOf(String value) { + switch (value) { + case "customer_request": + return CUSTOMER_REQUEST; + case "other": + return OTHER; + case "out_of_office": + return OUT_OF_OFFICE; + case "offboarding": + return OFFBOARDING; + case "host_unavailable": + return HOST_UNAVAILABLE; + case "workload": + return WORKLOAD; + default: + return new UndoSchedulingReassignmentRequestReasonCode(Value.UNKNOWN, value); + } + } + + public enum Value { + HOST_UNAVAILABLE, + + OUT_OF_OFFICE, + + WORKLOAD, + + CUSTOMER_REQUEST, + + OFFBOARDING, + + OTHER, + + UNKNOWN + } + + public interface Visitor { + T visitHostUnavailable(); + + T visitOutOfOffice(); + + T visitWorkload(); + + T visitCustomerRequest(); + + T visitOffboarding(); + + T visitOther(); + + T visitUnknown(String unknownType); + } +} diff --git a/sdks/java/src/main/java/com/coss/resources/scheduling/sessions/AsyncRawSessionsClient.java b/sdks/java/src/main/java/com/coss/resources/scheduling/sessions/AsyncRawSessionsClient.java index 01228a7a1..7ff8209e1 100644 --- a/sdks/java/src/main/java/com/coss/resources/scheduling/sessions/AsyncRawSessionsClient.java +++ b/sdks/java/src/main/java/com/coss/resources/scheduling/sessions/AsyncRawSessionsClient.java @@ -25,6 +25,7 @@ import com.coss.resources.scheduling.sessions.requests.CreateForBookingSessionsRequest; import com.coss.resources.scheduling.sessions.requests.CreateSchedulingBookerSessionRequest; import com.coss.resources.scheduling.sessions.requests.CreateSchedulingHostSessionRequest; +import com.coss.resources.scheduling.sessions.requests.CreateSchedulingManagerSessionRequest; import com.coss.types.Error; import com.coss.types.SchedulingSession; import com.fasterxml.jackson.core.JsonProcessingException; @@ -48,6 +49,147 @@ public AsyncRawSessionsClient(ClientOptions clientOptions) { this.clientOptions = clientOptions; } + /** + * Lets a team lead manage cover for the hosts you name, or those matching an attribute filter whenever it's asked: time off, bookings that need someone else, and moving them. It never sees attendees' details. Send the url to their browser, or embed it with coss/scheduling. + */ + public CompletableFuture> createForManager() { + return createForManager(CreateSchedulingManagerSessionRequest.builder().build()); + } + + /** + * Lets a team lead manage cover for the hosts you name, or those matching an attribute filter whenever it's asked: time off, bookings that need someone else, and moving them. It never sees attendees' details. Send the url to their browser, or embed it with coss/scheduling. + */ + public CompletableFuture> createForManager(RequestOptions requestOptions) { + return createForManager(CreateSchedulingManagerSessionRequest.builder().build(), requestOptions); + } + + /** + * Lets a team lead manage cover for the hosts you name, or those matching an attribute filter whenever it's asked: time off, bookings that need someone else, and moving them. It never sees attendees' details. Send the url to their browser, or embed it with coss/scheduling. + */ + public CompletableFuture> createForManager( + CreateSchedulingManagerSessionRequest request) { + return createForManager(request, null); + } + + /** + * Lets a team lead manage cover for the hosts you name, or those matching an attribute filter whenever it's asked: time off, bookings that need someone else, and moving them. It never sees attendees' details. Send the url to their browser, or embed it with coss/scheduling. + */ + public CompletableFuture> createForManager( + CreateSchedulingManagerSessionRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("v1/scheduling/manager_sessions"); + if (requestOptions != null) { + requestOptions.getQueryParameters().forEach((_key, _value) -> { + httpUrl.addQueryParameter(_key, _value); + }); + } + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new CossException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl.build()) + .method("POST", body) + .headers(Headers.of(IdempotencyUtils.withGeneratedIdempotencyKey( + clientOptions.headers(requestOptions), "Idempotency-Key"))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + okhttpRequest = okhttpRequest + .newBuilder() + .tag(RetryInterceptor.MaxRetriesOverride.class, new RetryInterceptor.MaxRetriesOverride(0)) + .build(); + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new CossHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, SchedulingSession.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 415: + future.completeExceptionally(new UnsupportedMediaTypeError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 422: + future.completeExceptionally(new UnprocessableEntityError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 429: + future.completeExceptionally(new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 500: + future.completeExceptionally(new InternalServerError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + case 503: + future.completeExceptionally(new ServiceUnavailableError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new CossApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (JsonProcessingException e) { + future.completeExceptionally( + new CossException("Failed to deserialize response: " + e.getMessage(), e)); + } catch (IOException e) { + future.completeExceptionally(new CossException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new CossException("Network error executing HTTP request", e)); + } + }); + return future; + } + /** * Lets one host manage their own hours, calendars and locations, on coss.com's hosted page or your own UI. Send the url to their browser, or embed it with coss/scheduling. */ diff --git a/sdks/java/src/main/java/com/coss/resources/scheduling/sessions/AsyncSessionsClient.java b/sdks/java/src/main/java/com/coss/resources/scheduling/sessions/AsyncSessionsClient.java index 9efbbefee..4cb59933c 100644 --- a/sdks/java/src/main/java/com/coss/resources/scheduling/sessions/AsyncSessionsClient.java +++ b/sdks/java/src/main/java/com/coss/resources/scheduling/sessions/AsyncSessionsClient.java @@ -8,6 +8,7 @@ import com.coss.resources.scheduling.sessions.requests.CreateForBookingSessionsRequest; import com.coss.resources.scheduling.sessions.requests.CreateSchedulingBookerSessionRequest; import com.coss.resources.scheduling.sessions.requests.CreateSchedulingHostSessionRequest; +import com.coss.resources.scheduling.sessions.requests.CreateSchedulingManagerSessionRequest; import com.coss.types.SchedulingSession; import java.util.concurrent.CompletableFuture; @@ -28,6 +29,35 @@ public AsyncRawSessionsClient withRawResponse() { return this.rawClient; } + /** + * Lets a team lead manage cover for the hosts you name, or those matching an attribute filter whenever it's asked: time off, bookings that need someone else, and moving them. It never sees attendees' details. Send the url to their browser, or embed it with coss/scheduling. + */ + public CompletableFuture createForManager() { + return this.rawClient.createForManager().thenApply(response -> response.body()); + } + + /** + * Lets a team lead manage cover for the hosts you name, or those matching an attribute filter whenever it's asked: time off, bookings that need someone else, and moving them. It never sees attendees' details. Send the url to their browser, or embed it with coss/scheduling. + */ + public CompletableFuture createForManager(RequestOptions requestOptions) { + return this.rawClient.createForManager(requestOptions).thenApply(response -> response.body()); + } + + /** + * Lets a team lead manage cover for the hosts you name, or those matching an attribute filter whenever it's asked: time off, bookings that need someone else, and moving them. It never sees attendees' details. Send the url to their browser, or embed it with coss/scheduling. + */ + public CompletableFuture createForManager(CreateSchedulingManagerSessionRequest request) { + return this.rawClient.createForManager(request).thenApply(response -> response.body()); + } + + /** + * Lets a team lead manage cover for the hosts you name, or those matching an attribute filter whenever it's asked: time off, bookings that need someone else, and moving them. It never sees attendees' details. Send the url to their browser, or embed it with coss/scheduling. + */ + public CompletableFuture createForManager( + CreateSchedulingManagerSessionRequest request, RequestOptions requestOptions) { + return this.rawClient.createForManager(request, requestOptions).thenApply(response -> response.body()); + } + /** * Lets one host manage their own hours, calendars and locations, on coss.com's hosted page or your own UI. Send the url to their browser, or embed it with coss/scheduling. */ diff --git a/sdks/java/src/main/java/com/coss/resources/scheduling/sessions/RawSessionsClient.java b/sdks/java/src/main/java/com/coss/resources/scheduling/sessions/RawSessionsClient.java index e7ad646d2..d8020129b 100644 --- a/sdks/java/src/main/java/com/coss/resources/scheduling/sessions/RawSessionsClient.java +++ b/sdks/java/src/main/java/com/coss/resources/scheduling/sessions/RawSessionsClient.java @@ -25,6 +25,7 @@ import com.coss.resources.scheduling.sessions.requests.CreateForBookingSessionsRequest; import com.coss.resources.scheduling.sessions.requests.CreateSchedulingBookerSessionRequest; import com.coss.resources.scheduling.sessions.requests.CreateSchedulingHostSessionRequest; +import com.coss.resources.scheduling.sessions.requests.CreateSchedulingManagerSessionRequest; import com.coss.types.Error; import com.coss.types.SchedulingSession; import com.fasterxml.jackson.core.JsonProcessingException; @@ -44,6 +45,113 @@ public RawSessionsClient(ClientOptions clientOptions) { this.clientOptions = clientOptions; } + /** + * Lets a team lead manage cover for the hosts you name, or those matching an attribute filter whenever it's asked: time off, bookings that need someone else, and moving them. It never sees attendees' details. Send the url to their browser, or embed it with coss/scheduling. + */ + public CossHttpResponse createForManager() { + return createForManager(CreateSchedulingManagerSessionRequest.builder().build()); + } + + /** + * Lets a team lead manage cover for the hosts you name, or those matching an attribute filter whenever it's asked: time off, bookings that need someone else, and moving them. It never sees attendees' details. Send the url to their browser, or embed it with coss/scheduling. + */ + public CossHttpResponse createForManager(RequestOptions requestOptions) { + return createForManager(CreateSchedulingManagerSessionRequest.builder().build(), requestOptions); + } + + /** + * Lets a team lead manage cover for the hosts you name, or those matching an attribute filter whenever it's asked: time off, bookings that need someone else, and moving them. It never sees attendees' details. Send the url to their browser, or embed it with coss/scheduling. + */ + public CossHttpResponse createForManager(CreateSchedulingManagerSessionRequest request) { + return createForManager(request, null); + } + + /** + * Lets a team lead manage cover for the hosts you name, or those matching an attribute filter whenever it's asked: time off, bookings that need someone else, and moving them. It never sees attendees' details. Send the url to their browser, or embed it with coss/scheduling. + */ + public CossHttpResponse createForManager( + CreateSchedulingManagerSessionRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("v1/scheduling/manager_sessions"); + if (requestOptions != null) { + requestOptions.getQueryParameters().forEach((_key, _value) -> { + httpUrl.addQueryParameter(_key, _value); + }); + } + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new CossException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl.build()) + .method("POST", body) + .headers(Headers.of(IdempotencyUtils.withGeneratedIdempotencyKey( + clientOptions.headers(requestOptions), "Idempotency-Key"))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + okhttpRequest = okhttpRequest + .newBuilder() + .tag(RetryInterceptor.MaxRetriesOverride.class, new RetryInterceptor.MaxRetriesOverride(0)) + .build(); + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new CossHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, SchedulingSession.class), response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 415: + throw new UnsupportedMediaTypeError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 422: + throw new UnprocessableEntityError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 429: + throw new TooManyRequestsError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 500: + throw new InternalServerError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + case 503: + throw new ServiceUnavailableError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Error.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new CossApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (JsonProcessingException e) { + throw new CossException("Failed to deserialize response: " + e.getMessage(), e); + } catch (IOException e) { + throw new CossException("Network error executing HTTP request", e); + } + } + /** * Lets one host manage their own hours, calendars and locations, on coss.com's hosted page or your own UI. Send the url to their browser, or embed it with coss/scheduling. */ diff --git a/sdks/java/src/main/java/com/coss/resources/scheduling/sessions/SessionsClient.java b/sdks/java/src/main/java/com/coss/resources/scheduling/sessions/SessionsClient.java index d805f334b..ee17455b5 100644 --- a/sdks/java/src/main/java/com/coss/resources/scheduling/sessions/SessionsClient.java +++ b/sdks/java/src/main/java/com/coss/resources/scheduling/sessions/SessionsClient.java @@ -8,6 +8,7 @@ import com.coss.resources.scheduling.sessions.requests.CreateForBookingSessionsRequest; import com.coss.resources.scheduling.sessions.requests.CreateSchedulingBookerSessionRequest; import com.coss.resources.scheduling.sessions.requests.CreateSchedulingHostSessionRequest; +import com.coss.resources.scheduling.sessions.requests.CreateSchedulingManagerSessionRequest; import com.coss.types.SchedulingSession; public class SessionsClient { @@ -27,6 +28,35 @@ public RawSessionsClient withRawResponse() { return this.rawClient; } + /** + * Lets a team lead manage cover for the hosts you name, or those matching an attribute filter whenever it's asked: time off, bookings that need someone else, and moving them. It never sees attendees' details. Send the url to their browser, or embed it with coss/scheduling. + */ + public SchedulingSession createForManager() { + return this.rawClient.createForManager().body(); + } + + /** + * Lets a team lead manage cover for the hosts you name, or those matching an attribute filter whenever it's asked: time off, bookings that need someone else, and moving them. It never sees attendees' details. Send the url to their browser, or embed it with coss/scheduling. + */ + public SchedulingSession createForManager(RequestOptions requestOptions) { + return this.rawClient.createForManager(requestOptions).body(); + } + + /** + * Lets a team lead manage cover for the hosts you name, or those matching an attribute filter whenever it's asked: time off, bookings that need someone else, and moving them. It never sees attendees' details. Send the url to their browser, or embed it with coss/scheduling. + */ + public SchedulingSession createForManager(CreateSchedulingManagerSessionRequest request) { + return this.rawClient.createForManager(request).body(); + } + + /** + * Lets a team lead manage cover for the hosts you name, or those matching an attribute filter whenever it's asked: time off, bookings that need someone else, and moving them. It never sees attendees' details. Send the url to their browser, or embed it with coss/scheduling. + */ + public SchedulingSession createForManager( + CreateSchedulingManagerSessionRequest request, RequestOptions requestOptions) { + return this.rawClient.createForManager(request, requestOptions).body(); + } + /** * Lets one host manage their own hours, calendars and locations, on coss.com's hosted page or your own UI. Send the url to their browser, or embed it with coss/scheduling. */ diff --git a/sdks/java/src/main/java/com/coss/resources/scheduling/sessions/requests/CreateSchedulingManagerSessionRequest.java b/sdks/java/src/main/java/com/coss/resources/scheduling/sessions/requests/CreateSchedulingManagerSessionRequest.java new file mode 100644 index 000000000..fcf1999fe --- /dev/null +++ b/sdks/java/src/main/java/com/coss/resources/scheduling/sessions/requests/CreateSchedulingManagerSessionRequest.java @@ -0,0 +1,203 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.coss.resources.scheduling.sessions.requests; + +import com.coss.core.ObjectMappers; +import com.coss.resources.scheduling.sessions.types.CreateSchedulingManagerSessionRequestHostFilterValue; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateSchedulingManagerSessionRequest.Builder.class) +public final class CreateSchedulingManagerSessionRequest { + private final Optional> hosts; + + private final Optional> hostFilter; + + private final Optional expiresIn; + + private final Optional readOnly; + + private final Map additionalProperties; + + private CreateSchedulingManagerSessionRequest( + Optional> hosts, + Optional> hostFilter, + Optional expiresIn, + Optional readOnly, + Map additionalProperties) { + this.hosts = hosts; + this.hostFilter = hostFilter; + this.expiresIn = expiresIn; + this.readOnly = readOnly; + this.additionalProperties = additionalProperties; + } + + /** + * @return The hosts this page can reach, by id or uid. + */ + @JsonProperty("hosts") + public Optional> getHosts() { + return hosts; + } + + /** + * @return Everyone matching these attributes, asked again on every request. + */ + @JsonProperty("host_filter") + public Optional> getHostFilter() { + return hostFilter; + } + + /** + * @return Seconds until it stops working. At most a day. + */ + @JsonProperty("expires_in") + public Optional getExpiresIn() { + return expiresIn; + } + + @JsonProperty("read_only") + public Optional getReadOnly() { + return readOnly; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateSchedulingManagerSessionRequest + && equalTo((CreateSchedulingManagerSessionRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateSchedulingManagerSessionRequest other) { + return hosts.equals(other.hosts) + && hostFilter.equals(other.hostFilter) + && expiresIn.equals(other.expiresIn) + && readOnly.equals(other.readOnly); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.hosts, this.hostFilter, this.expiresIn, this.readOnly); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> hosts = Optional.empty(); + + private Optional> hostFilter = + Optional.empty(); + + private Optional expiresIn = Optional.empty(); + + private Optional readOnly = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(CreateSchedulingManagerSessionRequest other) { + hosts(other.getHosts()); + hostFilter(other.getHostFilter()); + expiresIn(other.getExpiresIn()); + readOnly(other.getReadOnly()); + return this; + } + + /** + *

The hosts this page can reach, by id or uid.

+ */ + @JsonSetter(value = "hosts", nulls = Nulls.SKIP) + public Builder hosts(Optional> hosts) { + this.hosts = hosts; + return this; + } + + public Builder hosts(List hosts) { + this.hosts = Optional.ofNullable(hosts); + return this; + } + + /** + *

Everyone matching these attributes, asked again on every request.

+ */ + @JsonSetter(value = "host_filter", nulls = Nulls.SKIP) + public Builder hostFilter( + Optional> hostFilter) { + this.hostFilter = hostFilter; + return this; + } + + public Builder hostFilter(Map hostFilter) { + this.hostFilter = Optional.ofNullable(hostFilter); + return this; + } + + /** + *

Seconds until it stops working. At most a day.

+ */ + @JsonSetter(value = "expires_in", nulls = Nulls.SKIP) + public Builder expiresIn(Optional expiresIn) { + this.expiresIn = expiresIn; + return this; + } + + public Builder expiresIn(Integer expiresIn) { + this.expiresIn = Optional.ofNullable(expiresIn); + return this; + } + + @JsonSetter(value = "read_only", nulls = Nulls.SKIP) + public Builder readOnly(Optional readOnly) { + this.readOnly = readOnly; + return this; + } + + public Builder readOnly(Boolean readOnly) { + this.readOnly = Optional.ofNullable(readOnly); + return this; + } + + public CreateSchedulingManagerSessionRequest build() { + return new CreateSchedulingManagerSessionRequest( + hosts, hostFilter, expiresIn, readOnly, additionalProperties); + } + + public Builder additionalProperty(String key, Object value) { + this.additionalProperties.put(key, value); + return this; + } + + public Builder additionalProperties(Map additionalProperties) { + this.additionalProperties.putAll(additionalProperties); + return this; + } + } +} diff --git a/sdks/java/src/main/java/com/coss/resources/scheduling/sessions/types/CreateSchedulingManagerSessionRequestHostFilterValue.java b/sdks/java/src/main/java/com/coss/resources/scheduling/sessions/types/CreateSchedulingManagerSessionRequestHostFilterValue.java new file mode 100644 index 000000000..752f3085f --- /dev/null +++ b/sdks/java/src/main/java/com/coss/resources/scheduling/sessions/types/CreateSchedulingManagerSessionRequestHostFilterValue.java @@ -0,0 +1,99 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.coss.resources.scheduling.sessions.types; + +import com.coss.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import java.io.IOException; +import java.util.List; +import java.util.Objects; + +@JsonDeserialize(using = CreateSchedulingManagerSessionRequestHostFilterValue.Deserializer.class) +public final class CreateSchedulingManagerSessionRequestHostFilterValue { + private final Object value; + + private final int type; + + private CreateSchedulingManagerSessionRequestHostFilterValue(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((String) this.value); + } else if (this.type == 1) { + return visitor.visit((List) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateSchedulingManagerSessionRequestHostFilterValue + && equalTo((CreateSchedulingManagerSessionRequestHostFilterValue) other); + } + + private boolean equalTo(CreateSchedulingManagerSessionRequestHostFilterValue other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static CreateSchedulingManagerSessionRequestHostFilterValue of(String value) { + return new CreateSchedulingManagerSessionRequestHostFilterValue(value, 0); + } + + public static CreateSchedulingManagerSessionRequestHostFilterValue of(List value) { + return new CreateSchedulingManagerSessionRequestHostFilterValue(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(List value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(CreateSchedulingManagerSessionRequestHostFilterValue.class); + } + + @java.lang.Override + public CreateSchedulingManagerSessionRequestHostFilterValue deserialize( + JsonParser p, DeserializationContext context) throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, new TypeReference>() {})); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/sdks/java/src/main/java/com/coss/resources/scheduling/settings/requests/UpdateSchedulingSettingsRequest.java b/sdks/java/src/main/java/com/coss/resources/scheduling/settings/requests/UpdateSchedulingSettingsRequest.java index a6563408b..a4cc51bdd 100644 --- a/sdks/java/src/main/java/com/coss/resources/scheduling/settings/requests/UpdateSchedulingSettingsRequest.java +++ b/sdks/java/src/main/java/com/coss/resources/scheduling/settings/requests/UpdateSchedulingSettingsRequest.java @@ -8,8 +8,10 @@ import com.coss.core.ObjectMappers; import com.coss.core.OptionalNullable; import com.coss.resources.scheduling.settings.types.UpdateSchedulingSettingsRequestCalendarFailureMode; +import com.coss.resources.scheduling.settings.types.UpdateSchedulingSettingsRequestHostReassignment; import com.coss.resources.scheduling.settings.types.UpdateSchedulingSettingsRequestLogo; import com.coss.resources.scheduling.settings.types.UpdateSchedulingSettingsRequestNotificationsValue; +import com.coss.resources.scheduling.settings.types.UpdateSchedulingSettingsRequestOutOfOfficeReasonsItem; import com.coss.types.SchedulingReminderInput; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -36,12 +38,20 @@ public final class UpdateSchedulingSettingsRequest { private final OptionalNullable logo; + private final OptionalNullable privacyUrl; + private final OptionalNullable emailFrom; private final OptionalNullable smsFrom; private final Optional calendarFailureMode; + private final Optional nameHostInAttendeeEmails; + + private final Optional hostReassignment; + + private final OptionalNullable> outOfOfficeReasons; + private final OptionalNullable>> notifications; @@ -56,9 +66,13 @@ private UpdateSchedulingSettingsRequest( OptionalNullable brandName, OptionalNullable accentColor, OptionalNullable logo, + OptionalNullable privacyUrl, OptionalNullable emailFrom, OptionalNullable smsFrom, Optional calendarFailureMode, + Optional nameHostInAttendeeEmails, + Optional hostReassignment, + OptionalNullable> outOfOfficeReasons, OptionalNullable>> notifications, OptionalNullable emailReplyTo, @@ -68,9 +82,13 @@ private UpdateSchedulingSettingsRequest( this.brandName = brandName; this.accentColor = accentColor; this.logo = logo; + this.privacyUrl = privacyUrl; this.emailFrom = emailFrom; this.smsFrom = smsFrom; this.calendarFailureMode = calendarFailureMode; + this.nameHostInAttendeeEmails = nameHostInAttendeeEmails; + this.hostReassignment = hostReassignment; + this.outOfOfficeReasons = outOfOfficeReasons; this.notifications = notifications; this.emailReplyTo = emailReplyTo; this.reminders = reminders; @@ -121,6 +139,18 @@ public OptionalNullable getLogo() { return logo; } + /** + * @return Your privacy policy, as an https URL, for hosts connecting a calendar through your own OAuth app. null removes it. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("privacy_url") + public OptionalNullable getPrivacyUrl() { + if (privacyUrl == null) { + return OptionalNullable.absent(); + } + return privacyUrl; + } + /** * @return Sender of booking emails, on a verified domain. null: coss.com's own address. */ @@ -153,6 +183,34 @@ public Optional getCalendarF return calendarFailureMode; } + /** + * @return Name the new host when telling an attendee their booking has one. + */ + @JsonProperty("name_host_in_attendee_emails") + public Optional getNameHostInAttendeeEmails() { + return nameHostInAttendeeEmails; + } + + /** + * @return Whether hosts can give their own bookings to someone else from their page. eligible lets them, to anyone free who takes that event type. + */ + @JsonProperty("host_reassignment") + public Optional getHostReassignment() { + return hostReassignment; + } + + /** + * @return Reasons of your own, on top of the preset ones. Hosts and managers see them. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("out_of_office_reasons") + public OptionalNullable> getOutOfOfficeReasons() { + if (outOfOfficeReasons == null) { + return OptionalNullable.absent(); + } + return outOfOfficeReasons; + } + /** * @return Per event (confirmed, pending_approval, rescheduled, cancelled, declined, reminder), overriding the defaults. null restores them. */ @@ -208,6 +266,12 @@ private OptionalNullable _getLogo() { return logo; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("privacy_url") + private OptionalNullable _getPrivacyUrl() { + return privacyUrl; + } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) @JsonProperty("email_from") private OptionalNullable _getEmailFrom() { @@ -220,6 +284,12 @@ private OptionalNullable _getSmsFrom() { return smsFrom; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("out_of_office_reasons") + private OptionalNullable> _getOutOfOfficeReasons() { + return outOfOfficeReasons; + } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) @JsonProperty("notifications") private OptionalNullable>> @@ -255,9 +325,13 @@ private boolean equalTo(UpdateSchedulingSettingsRequest other) { && brandName.equals(other.brandName) && accentColor.equals(other.accentColor) && logo.equals(other.logo) + && privacyUrl.equals(other.privacyUrl) && emailFrom.equals(other.emailFrom) && smsFrom.equals(other.smsFrom) && calendarFailureMode.equals(other.calendarFailureMode) + && nameHostInAttendeeEmails.equals(other.nameHostInAttendeeEmails) + && hostReassignment.equals(other.hostReassignment) + && outOfOfficeReasons.equals(other.outOfOfficeReasons) && notifications.equals(other.notifications) && emailReplyTo.equals(other.emailReplyTo) && reminders.equals(other.reminders); @@ -270,9 +344,13 @@ public int hashCode() { this.brandName, this.accentColor, this.logo, + this.privacyUrl, this.emailFrom, this.smsFrom, this.calendarFailureMode, + this.nameHostInAttendeeEmails, + this.hostReassignment, + this.outOfOfficeReasons, this.notifications, this.emailReplyTo, this.reminders); @@ -297,12 +375,21 @@ public static final class Builder { private OptionalNullable logo = OptionalNullable.absent(); + private OptionalNullable privacyUrl = OptionalNullable.absent(); + private OptionalNullable emailFrom = OptionalNullable.absent(); private OptionalNullable smsFrom = OptionalNullable.absent(); private Optional calendarFailureMode = Optional.empty(); + private Optional nameHostInAttendeeEmails = Optional.empty(); + + private Optional hostReassignment = Optional.empty(); + + private OptionalNullable> outOfOfficeReasons = + OptionalNullable.absent(); + private OptionalNullable>> notifications = OptionalNullable.absent(); @@ -320,9 +407,13 @@ public Builder from(UpdateSchedulingSettingsRequest other) { brandName(other.getBrandName()); accentColor(other.getAccentColor()); logo(other.getLogo()); + privacyUrl(other.getPrivacyUrl()); emailFrom(other.getEmailFrom()); smsFrom(other.getSmsFrom()); calendarFailureMode(other.getCalendarFailureMode()); + nameHostInAttendeeEmails(other.getNameHostInAttendeeEmails()); + hostReassignment(other.getHostReassignment()); + outOfOfficeReasons(other.getOutOfOfficeReasons()); notifications(other.getNotifications()); emailReplyTo(other.getEmailReplyTo()); reminders(other.getReminders()); @@ -445,6 +536,40 @@ public Builder logo(Nullable logo) { return this; } + /** + *

Your privacy policy, as an https URL, for hosts connecting a calendar through your own OAuth app. null removes it.

+ */ + @JsonSetter(value = "privacy_url", nulls = Nulls.SKIP) + public Builder privacyUrl(OptionalNullable privacyUrl) { + this.privacyUrl = privacyUrl; + return this; + } + + public Builder privacyUrl(String privacyUrl) { + this.privacyUrl = OptionalNullable.of(privacyUrl); + return this; + } + + public Builder privacyUrl(Optional privacyUrl) { + if (privacyUrl.isPresent()) { + this.privacyUrl = OptionalNullable.of(privacyUrl.get()); + } else { + this.privacyUrl = OptionalNullable.absent(); + } + return this; + } + + public Builder privacyUrl(Nullable privacyUrl) { + if (privacyUrl.isNull()) { + this.privacyUrl = OptionalNullable.ofNull(); + } else if (privacyUrl.isEmpty()) { + this.privacyUrl = OptionalNullable.absent(); + } else { + this.privacyUrl = OptionalNullable.of(privacyUrl.get()); + } + return this; + } + /** *

Sender of booking emails, on a verified domain. null: coss.com's own address.

*/ @@ -528,6 +653,72 @@ public Builder calendarFailureMode(UpdateSchedulingSettingsRequestCalendarFailur return this; } + /** + *

Name the new host when telling an attendee their booking has one.

+ */ + @JsonSetter(value = "name_host_in_attendee_emails", nulls = Nulls.SKIP) + public Builder nameHostInAttendeeEmails(Optional nameHostInAttendeeEmails) { + this.nameHostInAttendeeEmails = nameHostInAttendeeEmails; + return this; + } + + public Builder nameHostInAttendeeEmails(Boolean nameHostInAttendeeEmails) { + this.nameHostInAttendeeEmails = Optional.ofNullable(nameHostInAttendeeEmails); + return this; + } + + /** + *

Whether hosts can give their own bookings to someone else from their page. eligible lets them, to anyone free who takes that event type.

+ */ + @JsonSetter(value = "host_reassignment", nulls = Nulls.SKIP) + public Builder hostReassignment(Optional hostReassignment) { + this.hostReassignment = hostReassignment; + return this; + } + + public Builder hostReassignment(UpdateSchedulingSettingsRequestHostReassignment hostReassignment) { + this.hostReassignment = Optional.ofNullable(hostReassignment); + return this; + } + + /** + *

Reasons of your own, on top of the preset ones. Hosts and managers see them.

+ */ + @JsonSetter(value = "out_of_office_reasons", nulls = Nulls.SKIP) + public Builder outOfOfficeReasons( + OptionalNullable> outOfOfficeReasons) { + this.outOfOfficeReasons = outOfOfficeReasons; + return this; + } + + public Builder outOfOfficeReasons( + List outOfOfficeReasons) { + this.outOfOfficeReasons = OptionalNullable.of(outOfOfficeReasons); + return this; + } + + public Builder outOfOfficeReasons( + Optional> outOfOfficeReasons) { + if (outOfOfficeReasons.isPresent()) { + this.outOfOfficeReasons = OptionalNullable.of(outOfOfficeReasons.get()); + } else { + this.outOfOfficeReasons = OptionalNullable.absent(); + } + return this; + } + + public Builder outOfOfficeReasons( + Nullable> outOfOfficeReasons) { + if (outOfOfficeReasons.isNull()) { + this.outOfOfficeReasons = OptionalNullable.ofNull(); + } else if (outOfOfficeReasons.isEmpty()) { + this.outOfOfficeReasons = OptionalNullable.absent(); + } else { + this.outOfOfficeReasons = OptionalNullable.of(outOfOfficeReasons.get()); + } + return this; + } + /** *

Per event (confirmed, pending_approval, rescheduled, cancelled, declined, reminder), overriding the defaults. null restores them.

*/ @@ -643,9 +834,13 @@ public UpdateSchedulingSettingsRequest build() { brandName, accentColor, logo, + privacyUrl, emailFrom, smsFrom, calendarFailureMode, + nameHostInAttendeeEmails, + hostReassignment, + outOfOfficeReasons, notifications, emailReplyTo, reminders, diff --git a/sdks/java/src/main/java/com/coss/resources/scheduling/settings/types/UpdateSchedulingSettingsRequestHostReassignment.java b/sdks/java/src/main/java/com/coss/resources/scheduling/settings/types/UpdateSchedulingSettingsRequestHostReassignment.java new file mode 100644 index 000000000..88d79fa5a --- /dev/null +++ b/sdks/java/src/main/java/com/coss/resources/scheduling/settings/types/UpdateSchedulingSettingsRequestHostReassignment.java @@ -0,0 +1,86 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.coss.resources.scheduling.settings.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class UpdateSchedulingSettingsRequestHostReassignment { + public static final UpdateSchedulingSettingsRequestHostReassignment OFF = + new UpdateSchedulingSettingsRequestHostReassignment(Value.OFF, "off"); + + public static final UpdateSchedulingSettingsRequestHostReassignment ELIGIBLE = + new UpdateSchedulingSettingsRequestHostReassignment(Value.ELIGIBLE, "eligible"); + + private final Value value; + + private final String string; + + UpdateSchedulingSettingsRequestHostReassignment(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof UpdateSchedulingSettingsRequestHostReassignment + && this.string.equals(((UpdateSchedulingSettingsRequestHostReassignment) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case OFF: + return visitor.visitOff(); + case ELIGIBLE: + return visitor.visitEligible(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static UpdateSchedulingSettingsRequestHostReassignment valueOf(String value) { + switch (value) { + case "off": + return OFF; + case "eligible": + return ELIGIBLE; + default: + return new UpdateSchedulingSettingsRequestHostReassignment(Value.UNKNOWN, value); + } + } + + public enum Value { + OFF, + + ELIGIBLE, + + UNKNOWN + } + + public interface Visitor { + T visitOff(); + + T visitEligible(); + + T visitUnknown(String unknownType); + } +} diff --git a/sdks/java/src/main/java/com/coss/resources/scheduling/settings/types/UpdateSchedulingSettingsRequestOutOfOfficeReasonsItem.java b/sdks/java/src/main/java/com/coss/resources/scheduling/settings/types/UpdateSchedulingSettingsRequestOutOfOfficeReasonsItem.java new file mode 100644 index 000000000..68c2654d0 --- /dev/null +++ b/sdks/java/src/main/java/com/coss/resources/scheduling/settings/types/UpdateSchedulingSettingsRequestOutOfOfficeReasonsItem.java @@ -0,0 +1,152 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.coss.resources.scheduling.settings.types; + +import com.coss.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = UpdateSchedulingSettingsRequestOutOfOfficeReasonsItem.Builder.class) +public final class UpdateSchedulingSettingsRequestOutOfOfficeReasonsItem { + private final String key; + + private final String label; + + private final Map additionalProperties; + + private UpdateSchedulingSettingsRequestOutOfOfficeReasonsItem( + String key, String label, Map additionalProperties) { + this.key = key; + this.label = label; + this.additionalProperties = additionalProperties; + } + + /** + * @return One of unspecified, vacation, travel, sick, public_holiday, parental_leave, training and other, or a key from the settings' out_of_office_reasons. Only people who manage this host see it: never bookers, webhooks or calendars. + */ + @JsonProperty("key") + public String getKey() { + return key; + } + + @JsonProperty("label") + public String getLabel() { + return label; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UpdateSchedulingSettingsRequestOutOfOfficeReasonsItem + && equalTo((UpdateSchedulingSettingsRequestOutOfOfficeReasonsItem) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UpdateSchedulingSettingsRequestOutOfOfficeReasonsItem other) { + return key.equals(other.key) && label.equals(other.label); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.key, this.label); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static KeyStage builder() { + return new Builder(); + } + + public interface KeyStage { + /** + *

One of unspecified, vacation, travel, sick, public_holiday, parental_leave, training and other, or a key from the settings' out_of_office_reasons. Only people who manage this host see it: never bookers, webhooks or calendars.

+ */ + LabelStage key(@NotNull String key); + + Builder from(UpdateSchedulingSettingsRequestOutOfOfficeReasonsItem other); + } + + public interface LabelStage { + _FinalStage label(@NotNull String label); + } + + public interface _FinalStage { + UpdateSchedulingSettingsRequestOutOfOfficeReasonsItem build(); + + _FinalStage additionalProperty(String key, Object value); + + _FinalStage additionalProperties(Map additionalProperties); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements KeyStage, LabelStage, _FinalStage { + private String key; + + private String label; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(UpdateSchedulingSettingsRequestOutOfOfficeReasonsItem other) { + key(other.getKey()); + label(other.getLabel()); + return this; + } + + /** + *

One of unspecified, vacation, travel, sick, public_holiday, parental_leave, training and other, or a key from the settings' out_of_office_reasons. Only people who manage this host see it: never bookers, webhooks or calendars.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("key") + public LabelStage key(@NotNull String key) { + this.key = Objects.requireNonNull(key, "key must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("label") + public _FinalStage label(@NotNull String label) { + this.label = Objects.requireNonNull(label, "label must not be null"); + return this; + } + + @java.lang.Override + public UpdateSchedulingSettingsRequestOutOfOfficeReasonsItem build() { + return new UpdateSchedulingSettingsRequestOutOfOfficeReasonsItem(key, label, additionalProperties); + } + + @java.lang.Override + public Builder additionalProperty(String key, Object value) { + this.additionalProperties.put(key, value); + return this; + } + + @java.lang.Override + public Builder additionalProperties(Map additionalProperties) { + this.additionalProperties.putAll(additionalProperties); + return this; + } + } +} diff --git a/sdks/java/src/main/java/com/coss/resources/webhookendpoints/types/CreateWebhookEndpointRequestEventTypesItem.java b/sdks/java/src/main/java/com/coss/resources/webhookendpoints/types/CreateWebhookEndpointRequestEventTypesItem.java index b53aa2090..f8d99d568 100644 --- a/sdks/java/src/main/java/com/coss/resources/webhookendpoints/types/CreateWebhookEndpointRequestEventTypesItem.java +++ b/sdks/java/src/main/java/com/coss/resources/webhookendpoints/types/CreateWebhookEndpointRequestEventTypesItem.java @@ -7,17 +7,147 @@ import com.fasterxml.jackson.annotation.JsonValue; public final class CreateWebhookEndpointRequestEventTypesItem { - public static final CreateWebhookEndpointRequestEventTypesItem BILLING_PLAN_CHANGED = - new CreateWebhookEndpointRequestEventTypesItem(Value.BILLING_PLAN_CHANGED, "billing.plan_changed"); - public static final CreateWebhookEndpointRequestEventTypesItem BILLING_INVOICE_VOIDED = new CreateWebhookEndpointRequestEventTypesItem(Value.BILLING_INVOICE_VOIDED, "billing.invoice_voided"); + public static final CreateWebhookEndpointRequestEventTypesItem SIGN_REQUEST_SENT = + new CreateWebhookEndpointRequestEventTypesItem(Value.SIGN_REQUEST_SENT, "sign_request.sent"); + + public static final CreateWebhookEndpointRequestEventTypesItem SCHEDULING_OAUTH_APP_RESTORED = + new CreateWebhookEndpointRequestEventTypesItem( + Value.SCHEDULING_OAUTH_APP_RESTORED, "scheduling.oauth_app.restored"); + + public static final CreateWebhookEndpointRequestEventTypesItem SUBACCOUNT_REINSTATED = + new CreateWebhookEndpointRequestEventTypesItem(Value.SUBACCOUNT_REINSTATED, "subaccount.reinstated"); + + public static final CreateWebhookEndpointRequestEventTypesItem VERIFICATION_FAILED = + new CreateWebhookEndpointRequestEventTypesItem(Value.VERIFICATION_FAILED, "verification.failed"); + + public static final CreateWebhookEndpointRequestEventTypesItem SCHEDULING_OUT_OF_OFFICE_DELETED = + new CreateWebhookEndpointRequestEventTypesItem( + Value.SCHEDULING_OUT_OF_OFFICE_DELETED, "scheduling.out_of_office.deleted"); + + public static final CreateWebhookEndpointRequestEventTypesItem SCHEDULING_CALENDAR_DELEGATION_RESTORED = + new CreateWebhookEndpointRequestEventTypesItem( + Value.SCHEDULING_CALENDAR_DELEGATION_RESTORED, "scheduling.calendar_delegation.restored"); + + public static final CreateWebhookEndpointRequestEventTypesItem EMAIL_DELIVERY_DELAYED = + new CreateWebhookEndpointRequestEventTypesItem(Value.EMAIL_DELIVERY_DELAYED, "email.delivery_delayed"); + + public static final CreateWebhookEndpointRequestEventTypesItem BROADCAST_SENDING = + new CreateWebhookEndpointRequestEventTypesItem(Value.BROADCAST_SENDING, "broadcast.sending"); + + public static final CreateWebhookEndpointRequestEventTypesItem SMS_RECEIVED = + new CreateWebhookEndpointRequestEventTypesItem(Value.SMS_RECEIVED, "sms.received"); + + public static final CreateWebhookEndpointRequestEventTypesItem BILLING_INVOICE_FINALIZED = + new CreateWebhookEndpointRequestEventTypesItem( + Value.BILLING_INVOICE_FINALIZED, "billing.invoice_finalized"); + + public static final CreateWebhookEndpointRequestEventTypesItem SCHEDULING_BOOKING_CALENDAR_WRITE_FAILED = + new CreateWebhookEndpointRequestEventTypesItem( + Value.SCHEDULING_BOOKING_CALENDAR_WRITE_FAILED, "scheduling.booking.calendar_write_failed"); + + public static final CreateWebhookEndpointRequestEventTypesItem EMAIL_DELIVERED = + new CreateWebhookEndpointRequestEventTypesItem(Value.EMAIL_DELIVERED, "email.delivered"); + + public static final CreateWebhookEndpointRequestEventTypesItem BILLING_INVOICE_PAYMENT_FAILED = + new CreateWebhookEndpointRequestEventTypesItem( + Value.BILLING_INVOICE_PAYMENT_FAILED, "billing.invoice_payment_failed"); + + public static final CreateWebhookEndpointRequestEventTypesItem EMAIL_RESCHEDULED = + new CreateWebhookEndpointRequestEventTypesItem(Value.EMAIL_RESCHEDULED, "email.rescheduled"); + + public static final CreateWebhookEndpointRequestEventTypesItem EMAIL_CLICKED = + new CreateWebhookEndpointRequestEventTypesItem(Value.EMAIL_CLICKED, "email.clicked"); + + public static final CreateWebhookEndpointRequestEventTypesItem SUBACCOUNT_REPUTATION_RECOVERED = + new CreateWebhookEndpointRequestEventTypesItem( + Value.SUBACCOUNT_REPUTATION_RECOVERED, "subaccount.reputation_recovered"); + + public static final CreateWebhookEndpointRequestEventTypesItem BILLING_BUDGET_THRESHOLD_REACHED = + new CreateWebhookEndpointRequestEventTypesItem( + Value.BILLING_BUDGET_THRESHOLD_REACHED, "billing.budget_threshold_reached"); + + public static final CreateWebhookEndpointRequestEventTypesItem CONTACT_CONFIRMED = + new CreateWebhookEndpointRequestEventTypesItem(Value.CONTACT_CONFIRMED, "contact.confirmed"); + + public static final CreateWebhookEndpointRequestEventTypesItem CONTACT_DELETED = + new CreateWebhookEndpointRequestEventTypesItem(Value.CONTACT_DELETED, "contact.deleted"); + + public static final CreateWebhookEndpointRequestEventTypesItem SMS_OPTED_IN = + new CreateWebhookEndpointRequestEventTypesItem(Value.SMS_OPTED_IN, "sms.opted_in"); + + public static final CreateWebhookEndpointRequestEventTypesItem EMAIL_COMPLAINED = + new CreateWebhookEndpointRequestEventTypesItem(Value.EMAIL_COMPLAINED, "email.complained"); + + public static final CreateWebhookEndpointRequestEventTypesItem ACCOUNT_MARKETING_PAUSED = + new CreateWebhookEndpointRequestEventTypesItem(Value.ACCOUNT_MARKETING_PAUSED, "account.marketing_paused"); + + public static final CreateWebhookEndpointRequestEventTypesItem EMAIL_FAILED = + new CreateWebhookEndpointRequestEventTypesItem(Value.EMAIL_FAILED, "email.failed"); + + public static final CreateWebhookEndpointRequestEventTypesItem BROADCAST_CANCELED = + new CreateWebhookEndpointRequestEventTypesItem(Value.BROADCAST_CANCELED, "broadcast.canceled"); + + public static final CreateWebhookEndpointRequestEventTypesItem SCHEDULING_CALENDAR_NEEDS_REAUTH = + new CreateWebhookEndpointRequestEventTypesItem( + Value.SCHEDULING_CALENDAR_NEEDS_REAUTH, "scheduling.calendar.needs_reauth"); + + public static final CreateWebhookEndpointRequestEventTypesItem EMAIL_OPENED = + new CreateWebhookEndpointRequestEventTypesItem(Value.EMAIL_OPENED, "email.opened"); + + public static final CreateWebhookEndpointRequestEventTypesItem SCHEDULING_CALENDAR_DISCONNECTED = + new CreateWebhookEndpointRequestEventTypesItem( + Value.SCHEDULING_CALENDAR_DISCONNECTED, "scheduling.calendar.disconnected"); + + public static final CreateWebhookEndpointRequestEventTypesItem SCHEDULING_OAUTH_APP_FAILING = + new CreateWebhookEndpointRequestEventTypesItem( + Value.SCHEDULING_OAUTH_APP_FAILING, "scheduling.oauth_app.failing"); + + public static final CreateWebhookEndpointRequestEventTypesItem SUBACCOUNT_PAUSED = + new CreateWebhookEndpointRequestEventTypesItem(Value.SUBACCOUNT_PAUSED, "subaccount.paused"); + + public static final CreateWebhookEndpointRequestEventTypesItem SIGN_REQUEST_COMPLETED = + new CreateWebhookEndpointRequestEventTypesItem(Value.SIGN_REQUEST_COMPLETED, "sign_request.completed"); + + public static final CreateWebhookEndpointRequestEventTypesItem EMAIL_SCHEDULED = + new CreateWebhookEndpointRequestEventTypesItem(Value.EMAIL_SCHEDULED, "email.scheduled"); + + public static final CreateWebhookEndpointRequestEventTypesItem SCHEDULING_BOOKING_CANCELLED = + new CreateWebhookEndpointRequestEventTypesItem( + Value.SCHEDULING_BOOKING_CANCELLED, "scheduling.booking.cancelled"); + + public static final CreateWebhookEndpointRequestEventTypesItem BILLING_HOLD_LIFTED = + new CreateWebhookEndpointRequestEventTypesItem(Value.BILLING_HOLD_LIFTED, "billing.hold_lifted"); + + public static final CreateWebhookEndpointRequestEventTypesItem EMAIL_SUPPRESSED = + new CreateWebhookEndpointRequestEventTypesItem(Value.EMAIL_SUPPRESSED, "email.suppressed"); + + public static final CreateWebhookEndpointRequestEventTypesItem EMAIL_RECEIVED = + new CreateWebhookEndpointRequestEventTypesItem(Value.EMAIL_RECEIVED, "email.received"); + + public static final CreateWebhookEndpointRequestEventTypesItem SCHEDULING_OUT_OF_OFFICE_ENDED = + new CreateWebhookEndpointRequestEventTypesItem( + Value.SCHEDULING_OUT_OF_OFFICE_ENDED, "scheduling.out_of_office.ended"); + + public static final CreateWebhookEndpointRequestEventTypesItem SCHEDULING_BOOKING_REMINDER = + new CreateWebhookEndpointRequestEventTypesItem( + Value.SCHEDULING_BOOKING_REMINDER, "scheduling.booking.reminder"); + + public static final CreateWebhookEndpointRequestEventTypesItem SCHEDULING_REASSIGNMENT_COMPLETED = + new CreateWebhookEndpointRequestEventTypesItem( + Value.SCHEDULING_REASSIGNMENT_COMPLETED, "scheduling.reassignment.completed"); + + public static final CreateWebhookEndpointRequestEventTypesItem BILLING_PLAN_CHANGED = + new CreateWebhookEndpointRequestEventTypesItem(Value.BILLING_PLAN_CHANGED, "billing.plan_changed"); + public static final CreateWebhookEndpointRequestEventTypesItem SMS_SUPPRESSED = new CreateWebhookEndpointRequestEventTypesItem(Value.SMS_SUPPRESSED, "sms.suppressed"); - public static final CreateWebhookEndpointRequestEventTypesItem SIGN_REQUEST_SENT = - new CreateWebhookEndpointRequestEventTypesItem(Value.SIGN_REQUEST_SENT, "sign_request.sent"); + public static final CreateWebhookEndpointRequestEventTypesItem SCHEDULING_OUT_OF_OFFICE_UPDATED = + new CreateWebhookEndpointRequestEventTypesItem( + Value.SCHEDULING_OUT_OF_OFFICE_UPDATED, "scheduling.out_of_office.updated"); public static final CreateWebhookEndpointRequestEventTypesItem EMAIL_BOUNCED = new CreateWebhookEndpointRequestEventTypesItem(Value.EMAIL_BOUNCED, "email.bounced"); @@ -25,6 +155,10 @@ public final class CreateWebhookEndpointRequestEventTypesItem { public static final CreateWebhookEndpointRequestEventTypesItem SMS_OPTED_OUT = new CreateWebhookEndpointRequestEventTypesItem(Value.SMS_OPTED_OUT, "sms.opted_out"); + public static final CreateWebhookEndpointRequestEventTypesItem SCHEDULING_OUT_OF_OFFICE_STARTED = + new CreateWebhookEndpointRequestEventTypesItem( + Value.SCHEDULING_OUT_OF_OFFICE_STARTED, "scheduling.out_of_office.started"); + public static final CreateWebhookEndpointRequestEventTypesItem VERIFICATION_BLOCKED = new CreateWebhookEndpointRequestEventTypesItem(Value.VERIFICATION_BLOCKED, "verification.blocked"); @@ -34,12 +168,6 @@ public final class CreateWebhookEndpointRequestEventTypesItem { public static final CreateWebhookEndpointRequestEventTypesItem SMS_CANCELED = new CreateWebhookEndpointRequestEventTypesItem(Value.SMS_CANCELED, "sms.canceled"); - public static final CreateWebhookEndpointRequestEventTypesItem SUBACCOUNT_REINSTATED = - new CreateWebhookEndpointRequestEventTypesItem(Value.SUBACCOUNT_REINSTATED, "subaccount.reinstated"); - - public static final CreateWebhookEndpointRequestEventTypesItem VERIFICATION_FAILED = - new CreateWebhookEndpointRequestEventTypesItem(Value.VERIFICATION_FAILED, "verification.failed"); - public static final CreateWebhookEndpointRequestEventTypesItem FORM_SUBMISSION_RECEIVED = new CreateWebhookEndpointRequestEventTypesItem(Value.FORM_SUBMISSION_RECEIVED, "form.submission.received"); @@ -51,10 +179,6 @@ public final class CreateWebhookEndpointRequestEventTypesItem { new CreateWebhookEndpointRequestEventTypesItem( Value.SCHEDULING_BOOKING_LOCATION_READY, "scheduling.booking.location_ready"); - public static final CreateWebhookEndpointRequestEventTypesItem SCHEDULING_CALENDAR_DELEGATION_RESTORED = - new CreateWebhookEndpointRequestEventTypesItem( - Value.SCHEDULING_CALENDAR_DELEGATION_RESTORED, "scheduling.calendar_delegation.restored"); - public static final CreateWebhookEndpointRequestEventTypesItem DOMAIN_DMARC_REPORT_RECEIVED = new CreateWebhookEndpointRequestEventTypesItem( Value.DOMAIN_DMARC_REPORT_RECEIVED, "domain.dmarc_report_received"); @@ -62,9 +186,6 @@ public final class CreateWebhookEndpointRequestEventTypesItem { public static final CreateWebhookEndpointRequestEventTypesItem CONTACT_UPDATED = new CreateWebhookEndpointRequestEventTypesItem(Value.CONTACT_UPDATED, "contact.updated"); - public static final CreateWebhookEndpointRequestEventTypesItem EMAIL_DELIVERY_DELAYED = - new CreateWebhookEndpointRequestEventTypesItem(Value.EMAIL_DELIVERY_DELAYED, "email.delivery_delayed"); - public static final CreateWebhookEndpointRequestEventTypesItem INBOX_MESSAGE_RECEIVED = new CreateWebhookEndpointRequestEventTypesItem(Value.INBOX_MESSAGE_RECEIVED, "inbox.message.received"); @@ -72,15 +193,9 @@ public final class CreateWebhookEndpointRequestEventTypesItem { new CreateWebhookEndpointRequestEventTypesItem( Value.BILLING_BUDGET_HOLD_PLACED, "billing.budget_hold_placed"); - public static final CreateWebhookEndpointRequestEventTypesItem BROADCAST_SENDING = - new CreateWebhookEndpointRequestEventTypesItem(Value.BROADCAST_SENDING, "broadcast.sending"); - public static final CreateWebhookEndpointRequestEventTypesItem SMS_FAILED = new CreateWebhookEndpointRequestEventTypesItem(Value.SMS_FAILED, "sms.failed"); - public static final CreateWebhookEndpointRequestEventTypesItem SMS_RECEIVED = - new CreateWebhookEndpointRequestEventTypesItem(Value.SMS_RECEIVED, "sms.received"); - public static final CreateWebhookEndpointRequestEventTypesItem SCHEDULING_CALENDAR_DELEGATION_FAILING = new CreateWebhookEndpointRequestEventTypesItem( Value.SCHEDULING_CALENDAR_DELEGATION_FAILING, "scheduling.calendar_delegation.failing"); @@ -96,44 +211,23 @@ public final class CreateWebhookEndpointRequestEventTypesItem { new CreateWebhookEndpointRequestEventTypesItem( Value.SCHEDULING_BOOKING_CREATED, "scheduling.booking.created"); - public static final CreateWebhookEndpointRequestEventTypesItem BILLING_INVOICE_FINALIZED = + public static final CreateWebhookEndpointRequestEventTypesItem SCHEDULING_OUT_OF_OFFICE_CREATED = new CreateWebhookEndpointRequestEventTypesItem( - Value.BILLING_INVOICE_FINALIZED, "billing.invoice_finalized"); + Value.SCHEDULING_OUT_OF_OFFICE_CREATED, "scheduling.out_of_office.created"); - public static final CreateWebhookEndpointRequestEventTypesItem SCHEDULING_BOOKING_CALENDAR_WRITE_FAILED = + public static final CreateWebhookEndpointRequestEventTypesItem SCHEDULING_BOOKING_REASSIGNED = new CreateWebhookEndpointRequestEventTypesItem( - Value.SCHEDULING_BOOKING_CALENDAR_WRITE_FAILED, "scheduling.booking.calendar_write_failed"); - - public static final CreateWebhookEndpointRequestEventTypesItem EMAIL_DELIVERED = - new CreateWebhookEndpointRequestEventTypesItem(Value.EMAIL_DELIVERED, "email.delivered"); + Value.SCHEDULING_BOOKING_REASSIGNED, "scheduling.booking.reassigned"); public static final CreateWebhookEndpointRequestEventTypesItem SMS_SCHEDULED = new CreateWebhookEndpointRequestEventTypesItem(Value.SMS_SCHEDULED, "sms.scheduled"); - public static final CreateWebhookEndpointRequestEventTypesItem BILLING_INVOICE_PAYMENT_FAILED = - new CreateWebhookEndpointRequestEventTypesItem( - Value.BILLING_INVOICE_PAYMENT_FAILED, "billing.invoice_payment_failed"); - public static final CreateWebhookEndpointRequestEventTypesItem SIGN_REQUEST_DECLINED = new CreateWebhookEndpointRequestEventTypesItem(Value.SIGN_REQUEST_DECLINED, "sign_request.declined"); - public static final CreateWebhookEndpointRequestEventTypesItem EMAIL_RESCHEDULED = - new CreateWebhookEndpointRequestEventTypesItem(Value.EMAIL_RESCHEDULED, "email.rescheduled"); - public static final CreateWebhookEndpointRequestEventTypesItem BROADCAST_PAUSED = new CreateWebhookEndpointRequestEventTypesItem(Value.BROADCAST_PAUSED, "broadcast.paused"); - public static final CreateWebhookEndpointRequestEventTypesItem EMAIL_CLICKED = - new CreateWebhookEndpointRequestEventTypesItem(Value.EMAIL_CLICKED, "email.clicked"); - - public static final CreateWebhookEndpointRequestEventTypesItem SUBACCOUNT_REPUTATION_RECOVERED = - new CreateWebhookEndpointRequestEventTypesItem( - Value.SUBACCOUNT_REPUTATION_RECOVERED, "subaccount.reputation_recovered"); - - public static final CreateWebhookEndpointRequestEventTypesItem BILLING_BUDGET_THRESHOLD_REACHED = - new CreateWebhookEndpointRequestEventTypesItem( - Value.BILLING_BUDGET_THRESHOLD_REACHED, "billing.budget_threshold_reached"); - public static final CreateWebhookEndpointRequestEventTypesItem EMAIL_SENT = new CreateWebhookEndpointRequestEventTypesItem(Value.EMAIL_SENT, "email.sent"); @@ -153,28 +247,16 @@ public final class CreateWebhookEndpointRequestEventTypesItem { public static final CreateWebhookEndpointRequestEventTypesItem FORM_SUBMISSION_FLAGGED = new CreateWebhookEndpointRequestEventTypesItem(Value.FORM_SUBMISSION_FLAGGED, "form.submission.flagged"); - public static final CreateWebhookEndpointRequestEventTypesItem CONTACT_CONFIRMED = - new CreateWebhookEndpointRequestEventTypesItem(Value.CONTACT_CONFIRMED, "contact.confirmed"); - public static final CreateWebhookEndpointRequestEventTypesItem BILLING_INVOICE_PAID = new CreateWebhookEndpointRequestEventTypesItem(Value.BILLING_INVOICE_PAID, "billing.invoice_paid"); public static final CreateWebhookEndpointRequestEventTypesItem CONTACT_UNSUBSCRIBED = new CreateWebhookEndpointRequestEventTypesItem(Value.CONTACT_UNSUBSCRIBED, "contact.unsubscribed"); - public static final CreateWebhookEndpointRequestEventTypesItem CONTACT_DELETED = - new CreateWebhookEndpointRequestEventTypesItem(Value.CONTACT_DELETED, "contact.deleted"); - - public static final CreateWebhookEndpointRequestEventTypesItem SMS_OPTED_IN = - new CreateWebhookEndpointRequestEventTypesItem(Value.SMS_OPTED_IN, "sms.opted_in"); - public static final CreateWebhookEndpointRequestEventTypesItem SCHEDULING_BOOKING_CONFIRMED = new CreateWebhookEndpointRequestEventTypesItem( Value.SCHEDULING_BOOKING_CONFIRMED, "scheduling.booking.confirmed"); - public static final CreateWebhookEndpointRequestEventTypesItem EMAIL_COMPLAINED = - new CreateWebhookEndpointRequestEventTypesItem(Value.EMAIL_COMPLAINED, "email.complained"); - public static final CreateWebhookEndpointRequestEventTypesItem SCHEDULING_BOOKING_NO_SHOW = new CreateWebhookEndpointRequestEventTypesItem( Value.SCHEDULING_BOOKING_NO_SHOW, "scheduling.booking.no_show"); @@ -190,23 +272,14 @@ public final class CreateWebhookEndpointRequestEventTypesItem { public static final CreateWebhookEndpointRequestEventTypesItem SIGN_REQUEST_EXPIRED = new CreateWebhookEndpointRequestEventTypesItem(Value.SIGN_REQUEST_EXPIRED, "sign_request.expired"); - public static final CreateWebhookEndpointRequestEventTypesItem ACCOUNT_MARKETING_PAUSED = - new CreateWebhookEndpointRequestEventTypesItem(Value.ACCOUNT_MARKETING_PAUSED, "account.marketing_paused"); - public static final CreateWebhookEndpointRequestEventTypesItem ACCOUNT_REPUTATION_WARNING = new CreateWebhookEndpointRequestEventTypesItem( Value.ACCOUNT_REPUTATION_WARNING, "account.reputation_warning"); - public static final CreateWebhookEndpointRequestEventTypesItem EMAIL_FAILED = - new CreateWebhookEndpointRequestEventTypesItem(Value.EMAIL_FAILED, "email.failed"); - public static final CreateWebhookEndpointRequestEventTypesItem ACCOUNT_MARKETING_REINSTATED = new CreateWebhookEndpointRequestEventTypesItem( Value.ACCOUNT_MARKETING_REINSTATED, "account.marketing_reinstated"); - public static final CreateWebhookEndpointRequestEventTypesItem BROADCAST_CANCELED = - new CreateWebhookEndpointRequestEventTypesItem(Value.BROADCAST_CANCELED, "broadcast.canceled"); - public static final CreateWebhookEndpointRequestEventTypesItem BILLING_CREDIT_GRANTED = new CreateWebhookEndpointRequestEventTypesItem(Value.BILLING_CREDIT_GRANTED, "billing.credit_granted"); @@ -214,10 +287,6 @@ public final class CreateWebhookEndpointRequestEventTypesItem { new CreateWebhookEndpointRequestEventTypesItem( Value.BILLING_BUDGET_HOLD_LIFTED, "billing.budget_hold_lifted"); - public static final CreateWebhookEndpointRequestEventTypesItem SCHEDULING_CALENDAR_NEEDS_REAUTH = - new CreateWebhookEndpointRequestEventTypesItem( - Value.SCHEDULING_CALENDAR_NEEDS_REAUTH, "scheduling.calendar.needs_reauth"); - public static final CreateWebhookEndpointRequestEventTypesItem RISK_ASSESSMENT_REVIEWED = new CreateWebhookEndpointRequestEventTypesItem(Value.RISK_ASSESSMENT_REVIEWED, "risk.assessment.reviewed"); @@ -231,9 +300,6 @@ public final class CreateWebhookEndpointRequestEventTypesItem { public static final CreateWebhookEndpointRequestEventTypesItem ACCOUNT_REINSTATED = new CreateWebhookEndpointRequestEventTypesItem(Value.ACCOUNT_REINSTATED, "account.reinstated"); - public static final CreateWebhookEndpointRequestEventTypesItem EMAIL_OPENED = - new CreateWebhookEndpointRequestEventTypesItem(Value.EMAIL_OPENED, "email.opened"); - public static final CreateWebhookEndpointRequestEventTypesItem SIGN_REQUEST_SIGNER_SIGNED = new CreateWebhookEndpointRequestEventTypesItem( Value.SIGN_REQUEST_SIGNER_SIGNED, "sign_request.signer_signed"); @@ -241,10 +307,6 @@ public final class CreateWebhookEndpointRequestEventTypesItem { public static final CreateWebhookEndpointRequestEventTypesItem EMAIL_CANCELED = new CreateWebhookEndpointRequestEventTypesItem(Value.EMAIL_CANCELED, "email.canceled"); - public static final CreateWebhookEndpointRequestEventTypesItem SCHEDULING_CALENDAR_DISCONNECTED = - new CreateWebhookEndpointRequestEventTypesItem( - Value.SCHEDULING_CALENDAR_DISCONNECTED, "scheduling.calendar.disconnected"); - public static final CreateWebhookEndpointRequestEventTypesItem SMS_DELIVERED = new CreateWebhookEndpointRequestEventTypesItem(Value.SMS_DELIVERED, "sms.delivered"); @@ -258,18 +320,9 @@ public final class CreateWebhookEndpointRequestEventTypesItem { new CreateWebhookEndpointRequestEventTypesItem( Value.SCHEDULING_BOOKING_DECLINED, "scheduling.booking.declined"); - public static final CreateWebhookEndpointRequestEventTypesItem SUBACCOUNT_PAUSED = - new CreateWebhookEndpointRequestEventTypesItem(Value.SUBACCOUNT_PAUSED, "subaccount.paused"); - - public static final CreateWebhookEndpointRequestEventTypesItem SIGN_REQUEST_COMPLETED = - new CreateWebhookEndpointRequestEventTypesItem(Value.SIGN_REQUEST_COMPLETED, "sign_request.completed"); - public static final CreateWebhookEndpointRequestEventTypesItem RISK_ASSESSMENT_REVIEW = new CreateWebhookEndpointRequestEventTypesItem(Value.RISK_ASSESSMENT_REVIEW, "risk.assessment.review"); - public static final CreateWebhookEndpointRequestEventTypesItem EMAIL_SCHEDULED = - new CreateWebhookEndpointRequestEventTypesItem(Value.EMAIL_SCHEDULED, "email.scheduled"); - public static final CreateWebhookEndpointRequestEventTypesItem SCHEDULING_BOOKING_RESCHEDULED = new CreateWebhookEndpointRequestEventTypesItem( Value.SCHEDULING_BOOKING_RESCHEDULED, "scheduling.booking.rescheduled"); @@ -280,26 +333,9 @@ public final class CreateWebhookEndpointRequestEventTypesItem { public static final CreateWebhookEndpointRequestEventTypesItem HOOK_ENDPOINT_DISABLED = new CreateWebhookEndpointRequestEventTypesItem(Value.HOOK_ENDPOINT_DISABLED, "hook_endpoint.disabled"); - public static final CreateWebhookEndpointRequestEventTypesItem SCHEDULING_BOOKING_CANCELLED = - new CreateWebhookEndpointRequestEventTypesItem( - Value.SCHEDULING_BOOKING_CANCELLED, "scheduling.booking.cancelled"); - - public static final CreateWebhookEndpointRequestEventTypesItem BILLING_HOLD_LIFTED = - new CreateWebhookEndpointRequestEventTypesItem(Value.BILLING_HOLD_LIFTED, "billing.hold_lifted"); - - public static final CreateWebhookEndpointRequestEventTypesItem EMAIL_SUPPRESSED = - new CreateWebhookEndpointRequestEventTypesItem(Value.EMAIL_SUPPRESSED, "email.suppressed"); - public static final CreateWebhookEndpointRequestEventTypesItem BILLING_HOLD_PLACED = new CreateWebhookEndpointRequestEventTypesItem(Value.BILLING_HOLD_PLACED, "billing.hold_placed"); - public static final CreateWebhookEndpointRequestEventTypesItem EMAIL_RECEIVED = - new CreateWebhookEndpointRequestEventTypesItem(Value.EMAIL_RECEIVED, "email.received"); - - public static final CreateWebhookEndpointRequestEventTypesItem SCHEDULING_BOOKING_REMINDER = - new CreateWebhookEndpointRequestEventTypesItem( - Value.SCHEDULING_BOOKING_REMINDER, "scheduling.booking.reminder"); - public static final CreateWebhookEndpointRequestEventTypesItem SCHEDULING_CALENDAR_CONNECTED = new CreateWebhookEndpointRequestEventTypesItem( Value.SCHEDULING_CALENDAR_CONNECTED, "scheduling.calendar.connected"); @@ -343,52 +379,118 @@ public int hashCode() { public T visit(Visitor visitor) { switch (value) { + case BILLING_INVOICE_VOIDED: + return visitor.visitBillingInvoiceVoided(); + case SIGN_REQUEST_SENT: + return visitor.visitSignRequestSent(); + case SCHEDULING_OAUTH_APP_RESTORED: + return visitor.visitSchedulingOauthAppRestored(); + case SUBACCOUNT_REINSTATED: + return visitor.visitSubaccountReinstated(); + case VERIFICATION_FAILED: + return visitor.visitVerificationFailed(); + case SCHEDULING_OUT_OF_OFFICE_DELETED: + return visitor.visitSchedulingOutOfOfficeDeleted(); + case SCHEDULING_CALENDAR_DELEGATION_RESTORED: + return visitor.visitSchedulingCalendarDelegationRestored(); + case EMAIL_DELIVERY_DELAYED: + return visitor.visitEmailDeliveryDelayed(); + case BROADCAST_SENDING: + return visitor.visitBroadcastSending(); + case SMS_RECEIVED: + return visitor.visitSmsReceived(); + case BILLING_INVOICE_FINALIZED: + return visitor.visitBillingInvoiceFinalized(); + case SCHEDULING_BOOKING_CALENDAR_WRITE_FAILED: + return visitor.visitSchedulingBookingCalendarWriteFailed(); + case EMAIL_DELIVERED: + return visitor.visitEmailDelivered(); + case BILLING_INVOICE_PAYMENT_FAILED: + return visitor.visitBillingInvoicePaymentFailed(); + case EMAIL_RESCHEDULED: + return visitor.visitEmailRescheduled(); + case EMAIL_CLICKED: + return visitor.visitEmailClicked(); + case SUBACCOUNT_REPUTATION_RECOVERED: + return visitor.visitSubaccountReputationRecovered(); + case BILLING_BUDGET_THRESHOLD_REACHED: + return visitor.visitBillingBudgetThresholdReached(); + case CONTACT_CONFIRMED: + return visitor.visitContactConfirmed(); + case CONTACT_DELETED: + return visitor.visitContactDeleted(); + case SMS_OPTED_IN: + return visitor.visitSmsOptedIn(); + case EMAIL_COMPLAINED: + return visitor.visitEmailComplained(); + case ACCOUNT_MARKETING_PAUSED: + return visitor.visitAccountMarketingPaused(); + case EMAIL_FAILED: + return visitor.visitEmailFailed(); + case BROADCAST_CANCELED: + return visitor.visitBroadcastCanceled(); + case SCHEDULING_CALENDAR_NEEDS_REAUTH: + return visitor.visitSchedulingCalendarNeedsReauth(); + case EMAIL_OPENED: + return visitor.visitEmailOpened(); + case SCHEDULING_CALENDAR_DISCONNECTED: + return visitor.visitSchedulingCalendarDisconnected(); + case SCHEDULING_OAUTH_APP_FAILING: + return visitor.visitSchedulingOauthAppFailing(); + case SUBACCOUNT_PAUSED: + return visitor.visitSubaccountPaused(); + case SIGN_REQUEST_COMPLETED: + return visitor.visitSignRequestCompleted(); + case EMAIL_SCHEDULED: + return visitor.visitEmailScheduled(); + case SCHEDULING_BOOKING_CANCELLED: + return visitor.visitSchedulingBookingCancelled(); + case BILLING_HOLD_LIFTED: + return visitor.visitBillingHoldLifted(); + case EMAIL_SUPPRESSED: + return visitor.visitEmailSuppressed(); + case EMAIL_RECEIVED: + return visitor.visitEmailReceived(); + case SCHEDULING_OUT_OF_OFFICE_ENDED: + return visitor.visitSchedulingOutOfOfficeEnded(); + case SCHEDULING_BOOKING_REMINDER: + return visitor.visitSchedulingBookingReminder(); + case SCHEDULING_REASSIGNMENT_COMPLETED: + return visitor.visitSchedulingReassignmentCompleted(); case BILLING_PLAN_CHANGED: return visitor.visitBillingPlanChanged(); - case BILLING_INVOICE_VOIDED: - return visitor.visitBillingInvoiceVoided(); case SMS_SUPPRESSED: return visitor.visitSmsSuppressed(); - case SIGN_REQUEST_SENT: - return visitor.visitSignRequestSent(); + case SCHEDULING_OUT_OF_OFFICE_UPDATED: + return visitor.visitSchedulingOutOfOfficeUpdated(); case EMAIL_BOUNCED: return visitor.visitEmailBounced(); case SMS_OPTED_OUT: return visitor.visitSmsOptedOut(); + case SCHEDULING_OUT_OF_OFFICE_STARTED: + return visitor.visitSchedulingOutOfOfficeStarted(); case VERIFICATION_BLOCKED: return visitor.visitVerificationBlocked(); case CONTACT_CREATED: return visitor.visitContactCreated(); case SMS_CANCELED: return visitor.visitSmsCanceled(); - case SUBACCOUNT_REINSTATED: - return visitor.visitSubaccountReinstated(); - case VERIFICATION_FAILED: - return visitor.visitVerificationFailed(); case FORM_SUBMISSION_RECEIVED: return visitor.visitFormSubmissionReceived(); case ACCOUNT_REPUTATION_RECOVERED: return visitor.visitAccountReputationRecovered(); case SCHEDULING_BOOKING_LOCATION_READY: return visitor.visitSchedulingBookingLocationReady(); - case SCHEDULING_CALENDAR_DELEGATION_RESTORED: - return visitor.visitSchedulingCalendarDelegationRestored(); case DOMAIN_DMARC_REPORT_RECEIVED: return visitor.visitDomainDmarcReportReceived(); case CONTACT_UPDATED: return visitor.visitContactUpdated(); - case EMAIL_DELIVERY_DELAYED: - return visitor.visitEmailDeliveryDelayed(); case INBOX_MESSAGE_RECEIVED: return visitor.visitInboxMessageReceived(); case BILLING_BUDGET_HOLD_PLACED: return visitor.visitBillingBudgetHoldPlaced(); - case BROADCAST_SENDING: - return visitor.visitBroadcastSending(); case SMS_FAILED: return visitor.visitSmsFailed(); - case SMS_RECEIVED: - return visitor.visitSmsReceived(); case SCHEDULING_CALENDAR_DELEGATION_FAILING: return visitor.visitSchedulingCalendarDelegationFailing(); case SUBACCOUNT_REPUTATION_WARNING: @@ -397,28 +499,16 @@ public T visit(Visitor visitor) { return visitor.visitSmsUndelivered(); case SCHEDULING_BOOKING_CREATED: return visitor.visitSchedulingBookingCreated(); - case BILLING_INVOICE_FINALIZED: - return visitor.visitBillingInvoiceFinalized(); - case SCHEDULING_BOOKING_CALENDAR_WRITE_FAILED: - return visitor.visitSchedulingBookingCalendarWriteFailed(); - case EMAIL_DELIVERED: - return visitor.visitEmailDelivered(); + case SCHEDULING_OUT_OF_OFFICE_CREATED: + return visitor.visitSchedulingOutOfOfficeCreated(); + case SCHEDULING_BOOKING_REASSIGNED: + return visitor.visitSchedulingBookingReassigned(); case SMS_SCHEDULED: return visitor.visitSmsScheduled(); - case BILLING_INVOICE_PAYMENT_FAILED: - return visitor.visitBillingInvoicePaymentFailed(); case SIGN_REQUEST_DECLINED: return visitor.visitSignRequestDeclined(); - case EMAIL_RESCHEDULED: - return visitor.visitEmailRescheduled(); case BROADCAST_PAUSED: return visitor.visitBroadcastPaused(); - case EMAIL_CLICKED: - return visitor.visitEmailClicked(); - case SUBACCOUNT_REPUTATION_RECOVERED: - return visitor.visitSubaccountReputationRecovered(); - case BILLING_BUDGET_THRESHOLD_REACHED: - return visitor.visitBillingBudgetThresholdReached(); case EMAIL_SENT: return visitor.visitEmailSent(); case SCHEDULING_BOOKING_EXTERNAL_CONFLICT: @@ -431,20 +521,12 @@ public T visit(Visitor visitor) { return visitor.visitVerificationApproved(); case FORM_SUBMISSION_FLAGGED: return visitor.visitFormSubmissionFlagged(); - case CONTACT_CONFIRMED: - return visitor.visitContactConfirmed(); case BILLING_INVOICE_PAID: return visitor.visitBillingInvoicePaid(); case CONTACT_UNSUBSCRIBED: return visitor.visitContactUnsubscribed(); - case CONTACT_DELETED: - return visitor.visitContactDeleted(); - case SMS_OPTED_IN: - return visitor.visitSmsOptedIn(); case SCHEDULING_BOOKING_CONFIRMED: return visitor.visitSchedulingBookingConfirmed(); - case EMAIL_COMPLAINED: - return visitor.visitEmailComplained(); case SCHEDULING_BOOKING_NO_SHOW: return visitor.visitSchedulingBookingNoShow(); case SCHEDULING_BOOKING_STARTED: @@ -453,22 +535,14 @@ public T visit(Visitor visitor) { return visitor.visitBillingUsageThresholdReached(); case SIGN_REQUEST_EXPIRED: return visitor.visitSignRequestExpired(); - case ACCOUNT_MARKETING_PAUSED: - return visitor.visitAccountMarketingPaused(); case ACCOUNT_REPUTATION_WARNING: return visitor.visitAccountReputationWarning(); - case EMAIL_FAILED: - return visitor.visitEmailFailed(); case ACCOUNT_MARKETING_REINSTATED: return visitor.visitAccountMarketingReinstated(); - case BROADCAST_CANCELED: - return visitor.visitBroadcastCanceled(); case BILLING_CREDIT_GRANTED: return visitor.visitBillingCreditGranted(); case BILLING_BUDGET_HOLD_LIFTED: return visitor.visitBillingBudgetHoldLifted(); - case SCHEDULING_CALENDAR_NEEDS_REAUTH: - return visitor.visitSchedulingCalendarNeedsReauth(); case RISK_ASSESSMENT_REVIEWED: return visitor.visitRiskAssessmentReviewed(); case SMS_SENT: @@ -477,14 +551,10 @@ public T visit(Visitor visitor) { return visitor.visitSchedulingBookingPendingApproval(); case ACCOUNT_REINSTATED: return visitor.visitAccountReinstated(); - case EMAIL_OPENED: - return visitor.visitEmailOpened(); case SIGN_REQUEST_SIGNER_SIGNED: return visitor.visitSignRequestSignerSigned(); case EMAIL_CANCELED: return visitor.visitEmailCanceled(); - case SCHEDULING_CALENDAR_DISCONNECTED: - return visitor.visitSchedulingCalendarDisconnected(); case SMS_DELIVERED: return visitor.visitSmsDelivered(); case SIGN_REQUEST_VIEWED: @@ -493,32 +563,16 @@ public T visit(Visitor visitor) { return visitor.visitEmailUnsubscribed(); case SCHEDULING_BOOKING_DECLINED: return visitor.visitSchedulingBookingDeclined(); - case SUBACCOUNT_PAUSED: - return visitor.visitSubaccountPaused(); - case SIGN_REQUEST_COMPLETED: - return visitor.visitSignRequestCompleted(); case RISK_ASSESSMENT_REVIEW: return visitor.visitRiskAssessmentReview(); - case EMAIL_SCHEDULED: - return visitor.visitEmailScheduled(); case SCHEDULING_BOOKING_RESCHEDULED: return visitor.visitSchedulingBookingRescheduled(); case SCHEDULING_BOOKING_ENDED: return visitor.visitSchedulingBookingEnded(); case HOOK_ENDPOINT_DISABLED: return visitor.visitHookEndpointDisabled(); - case SCHEDULING_BOOKING_CANCELLED: - return visitor.visitSchedulingBookingCancelled(); - case BILLING_HOLD_LIFTED: - return visitor.visitBillingHoldLifted(); - case EMAIL_SUPPRESSED: - return visitor.visitEmailSuppressed(); case BILLING_HOLD_PLACED: return visitor.visitBillingHoldPlaced(); - case EMAIL_RECEIVED: - return visitor.visitEmailReceived(); - case SCHEDULING_BOOKING_REMINDER: - return visitor.visitSchedulingBookingReminder(); case SCHEDULING_CALENDAR_CONNECTED: return visitor.visitSchedulingCalendarConnected(); case ACCOUNT_SUSPENDED: @@ -534,52 +588,118 @@ public T visit(Visitor visitor) { @JsonCreator(mode = JsonCreator.Mode.DELEGATING) public static CreateWebhookEndpointRequestEventTypesItem valueOf(String value) { switch (value) { - case "billing.plan_changed": - return BILLING_PLAN_CHANGED; case "billing.invoice_voided": return BILLING_INVOICE_VOIDED; - case "sms.suppressed": - return SMS_SUPPRESSED; case "sign_request.sent": return SIGN_REQUEST_SENT; + case "scheduling.oauth_app.restored": + return SCHEDULING_OAUTH_APP_RESTORED; + case "subaccount.reinstated": + return SUBACCOUNT_REINSTATED; + case "verification.failed": + return VERIFICATION_FAILED; + case "scheduling.out_of_office.deleted": + return SCHEDULING_OUT_OF_OFFICE_DELETED; + case "scheduling.calendar_delegation.restored": + return SCHEDULING_CALENDAR_DELEGATION_RESTORED; + case "email.delivery_delayed": + return EMAIL_DELIVERY_DELAYED; + case "broadcast.sending": + return BROADCAST_SENDING; + case "sms.received": + return SMS_RECEIVED; + case "billing.invoice_finalized": + return BILLING_INVOICE_FINALIZED; + case "scheduling.booking.calendar_write_failed": + return SCHEDULING_BOOKING_CALENDAR_WRITE_FAILED; + case "email.delivered": + return EMAIL_DELIVERED; + case "billing.invoice_payment_failed": + return BILLING_INVOICE_PAYMENT_FAILED; + case "email.rescheduled": + return EMAIL_RESCHEDULED; + case "email.clicked": + return EMAIL_CLICKED; + case "subaccount.reputation_recovered": + return SUBACCOUNT_REPUTATION_RECOVERED; + case "billing.budget_threshold_reached": + return BILLING_BUDGET_THRESHOLD_REACHED; + case "contact.confirmed": + return CONTACT_CONFIRMED; + case "contact.deleted": + return CONTACT_DELETED; + case "sms.opted_in": + return SMS_OPTED_IN; + case "email.complained": + return EMAIL_COMPLAINED; + case "account.marketing_paused": + return ACCOUNT_MARKETING_PAUSED; + case "email.failed": + return EMAIL_FAILED; + case "broadcast.canceled": + return BROADCAST_CANCELED; + case "scheduling.calendar.needs_reauth": + return SCHEDULING_CALENDAR_NEEDS_REAUTH; + case "email.opened": + return EMAIL_OPENED; + case "scheduling.calendar.disconnected": + return SCHEDULING_CALENDAR_DISCONNECTED; + case "scheduling.oauth_app.failing": + return SCHEDULING_OAUTH_APP_FAILING; + case "subaccount.paused": + return SUBACCOUNT_PAUSED; + case "sign_request.completed": + return SIGN_REQUEST_COMPLETED; + case "email.scheduled": + return EMAIL_SCHEDULED; + case "scheduling.booking.cancelled": + return SCHEDULING_BOOKING_CANCELLED; + case "billing.hold_lifted": + return BILLING_HOLD_LIFTED; + case "email.suppressed": + return EMAIL_SUPPRESSED; + case "email.received": + return EMAIL_RECEIVED; + case "scheduling.out_of_office.ended": + return SCHEDULING_OUT_OF_OFFICE_ENDED; + case "scheduling.booking.reminder": + return SCHEDULING_BOOKING_REMINDER; + case "scheduling.reassignment.completed": + return SCHEDULING_REASSIGNMENT_COMPLETED; + case "billing.plan_changed": + return BILLING_PLAN_CHANGED; + case "sms.suppressed": + return SMS_SUPPRESSED; + case "scheduling.out_of_office.updated": + return SCHEDULING_OUT_OF_OFFICE_UPDATED; case "email.bounced": return EMAIL_BOUNCED; case "sms.opted_out": return SMS_OPTED_OUT; + case "scheduling.out_of_office.started": + return SCHEDULING_OUT_OF_OFFICE_STARTED; case "verification.blocked": return VERIFICATION_BLOCKED; case "contact.created": return CONTACT_CREATED; case "sms.canceled": return SMS_CANCELED; - case "subaccount.reinstated": - return SUBACCOUNT_REINSTATED; - case "verification.failed": - return VERIFICATION_FAILED; case "form.submission.received": return FORM_SUBMISSION_RECEIVED; case "account.reputation_recovered": return ACCOUNT_REPUTATION_RECOVERED; case "scheduling.booking.location_ready": return SCHEDULING_BOOKING_LOCATION_READY; - case "scheduling.calendar_delegation.restored": - return SCHEDULING_CALENDAR_DELEGATION_RESTORED; case "domain.dmarc_report_received": return DOMAIN_DMARC_REPORT_RECEIVED; case "contact.updated": return CONTACT_UPDATED; - case "email.delivery_delayed": - return EMAIL_DELIVERY_DELAYED; case "inbox.message.received": return INBOX_MESSAGE_RECEIVED; case "billing.budget_hold_placed": return BILLING_BUDGET_HOLD_PLACED; - case "broadcast.sending": - return BROADCAST_SENDING; case "sms.failed": return SMS_FAILED; - case "sms.received": - return SMS_RECEIVED; case "scheduling.calendar_delegation.failing": return SCHEDULING_CALENDAR_DELEGATION_FAILING; case "subaccount.reputation_warning": @@ -588,28 +708,16 @@ public static CreateWebhookEndpointRequestEventTypesItem valueOf(String value) { return SMS_UNDELIVERED; case "scheduling.booking.created": return SCHEDULING_BOOKING_CREATED; - case "billing.invoice_finalized": - return BILLING_INVOICE_FINALIZED; - case "scheduling.booking.calendar_write_failed": - return SCHEDULING_BOOKING_CALENDAR_WRITE_FAILED; - case "email.delivered": - return EMAIL_DELIVERED; + case "scheduling.out_of_office.created": + return SCHEDULING_OUT_OF_OFFICE_CREATED; + case "scheduling.booking.reassigned": + return SCHEDULING_BOOKING_REASSIGNED; case "sms.scheduled": return SMS_SCHEDULED; - case "billing.invoice_payment_failed": - return BILLING_INVOICE_PAYMENT_FAILED; case "sign_request.declined": return SIGN_REQUEST_DECLINED; - case "email.rescheduled": - return EMAIL_RESCHEDULED; case "broadcast.paused": return BROADCAST_PAUSED; - case "email.clicked": - return EMAIL_CLICKED; - case "subaccount.reputation_recovered": - return SUBACCOUNT_REPUTATION_RECOVERED; - case "billing.budget_threshold_reached": - return BILLING_BUDGET_THRESHOLD_REACHED; case "email.sent": return EMAIL_SENT; case "scheduling.booking.external_conflict": @@ -622,20 +730,12 @@ public static CreateWebhookEndpointRequestEventTypesItem valueOf(String value) { return VERIFICATION_APPROVED; case "form.submission.flagged": return FORM_SUBMISSION_FLAGGED; - case "contact.confirmed": - return CONTACT_CONFIRMED; case "billing.invoice_paid": return BILLING_INVOICE_PAID; case "contact.unsubscribed": return CONTACT_UNSUBSCRIBED; - case "contact.deleted": - return CONTACT_DELETED; - case "sms.opted_in": - return SMS_OPTED_IN; case "scheduling.booking.confirmed": return SCHEDULING_BOOKING_CONFIRMED; - case "email.complained": - return EMAIL_COMPLAINED; case "scheduling.booking.no_show": return SCHEDULING_BOOKING_NO_SHOW; case "scheduling.booking.started": @@ -644,22 +744,14 @@ public static CreateWebhookEndpointRequestEventTypesItem valueOf(String value) { return BILLING_USAGE_THRESHOLD_REACHED; case "sign_request.expired": return SIGN_REQUEST_EXPIRED; - case "account.marketing_paused": - return ACCOUNT_MARKETING_PAUSED; case "account.reputation_warning": return ACCOUNT_REPUTATION_WARNING; - case "email.failed": - return EMAIL_FAILED; case "account.marketing_reinstated": return ACCOUNT_MARKETING_REINSTATED; - case "broadcast.canceled": - return BROADCAST_CANCELED; case "billing.credit_granted": return BILLING_CREDIT_GRANTED; case "billing.budget_hold_lifted": return BILLING_BUDGET_HOLD_LIFTED; - case "scheduling.calendar.needs_reauth": - return SCHEDULING_CALENDAR_NEEDS_REAUTH; case "risk.assessment.reviewed": return RISK_ASSESSMENT_REVIEWED; case "sms.sent": @@ -668,14 +760,10 @@ public static CreateWebhookEndpointRequestEventTypesItem valueOf(String value) { return SCHEDULING_BOOKING_PENDING_APPROVAL; case "account.reinstated": return ACCOUNT_REINSTATED; - case "email.opened": - return EMAIL_OPENED; case "sign_request.signer_signed": return SIGN_REQUEST_SIGNER_SIGNED; case "email.canceled": return EMAIL_CANCELED; - case "scheduling.calendar.disconnected": - return SCHEDULING_CALENDAR_DISCONNECTED; case "sms.delivered": return SMS_DELIVERED; case "sign_request.viewed": @@ -684,32 +772,16 @@ public static CreateWebhookEndpointRequestEventTypesItem valueOf(String value) { return EMAIL_UNSUBSCRIBED; case "scheduling.booking.declined": return SCHEDULING_BOOKING_DECLINED; - case "subaccount.paused": - return SUBACCOUNT_PAUSED; - case "sign_request.completed": - return SIGN_REQUEST_COMPLETED; case "risk.assessment.review": return RISK_ASSESSMENT_REVIEW; - case "email.scheduled": - return EMAIL_SCHEDULED; case "scheduling.booking.rescheduled": return SCHEDULING_BOOKING_RESCHEDULED; case "scheduling.booking.ended": return SCHEDULING_BOOKING_ENDED; case "hook_endpoint.disabled": return HOOK_ENDPOINT_DISABLED; - case "scheduling.booking.cancelled": - return SCHEDULING_BOOKING_CANCELLED; - case "billing.hold_lifted": - return BILLING_HOLD_LIFTED; - case "email.suppressed": - return EMAIL_SUPPRESSED; case "billing.hold_placed": return BILLING_HOLD_PLACED; - case "email.received": - return EMAIL_RECEIVED; - case "scheduling.booking.reminder": - return SCHEDULING_BOOKING_REMINDER; case "scheduling.calendar.connected": return SCHEDULING_CALENDAR_CONNECTED; case "account.suspended": @@ -888,6 +960,8 @@ public enum Value { SCHEDULING_BOOKING_LOCATION_READY, + SCHEDULING_BOOKING_REASSIGNED, + SCHEDULING_BOOKING_STARTED, SCHEDULING_BOOKING_ENDED, @@ -904,6 +978,22 @@ public enum Value { SCHEDULING_CALENDAR_DELEGATION_RESTORED, + SCHEDULING_OUT_OF_OFFICE_CREATED, + + SCHEDULING_OUT_OF_OFFICE_UPDATED, + + SCHEDULING_OUT_OF_OFFICE_DELETED, + + SCHEDULING_OUT_OF_OFFICE_STARTED, + + SCHEDULING_OUT_OF_OFFICE_ENDED, + + SCHEDULING_REASSIGNMENT_COMPLETED, + + SCHEDULING_OAUTH_APP_FAILING, + + SCHEDULING_OAUTH_APP_RESTORED, + UNKNOWN } @@ -1074,6 +1164,8 @@ public interface Visitor { T visitSchedulingBookingLocationReady(); + T visitSchedulingBookingReassigned(); + T visitSchedulingBookingStarted(); T visitSchedulingBookingEnded(); @@ -1090,6 +1182,22 @@ public interface Visitor { T visitSchedulingCalendarDelegationRestored(); + T visitSchedulingOutOfOfficeCreated(); + + T visitSchedulingOutOfOfficeUpdated(); + + T visitSchedulingOutOfOfficeDeleted(); + + T visitSchedulingOutOfOfficeStarted(); + + T visitSchedulingOutOfOfficeEnded(); + + T visitSchedulingReassignmentCompleted(); + + T visitSchedulingOauthAppFailing(); + + T visitSchedulingOauthAppRestored(); + T visitUnknown(String unknownType); } } diff --git a/sdks/java/src/main/java/com/coss/resources/webhookendpoints/types/UpdateWebhookEndpointRequestEventTypesItem.java b/sdks/java/src/main/java/com/coss/resources/webhookendpoints/types/UpdateWebhookEndpointRequestEventTypesItem.java index 115398b54..8f8726306 100644 --- a/sdks/java/src/main/java/com/coss/resources/webhookendpoints/types/UpdateWebhookEndpointRequestEventTypesItem.java +++ b/sdks/java/src/main/java/com/coss/resources/webhookendpoints/types/UpdateWebhookEndpointRequestEventTypesItem.java @@ -7,17 +7,147 @@ import com.fasterxml.jackson.annotation.JsonValue; public final class UpdateWebhookEndpointRequestEventTypesItem { - public static final UpdateWebhookEndpointRequestEventTypesItem BILLING_PLAN_CHANGED = - new UpdateWebhookEndpointRequestEventTypesItem(Value.BILLING_PLAN_CHANGED, "billing.plan_changed"); - public static final UpdateWebhookEndpointRequestEventTypesItem BILLING_INVOICE_VOIDED = new UpdateWebhookEndpointRequestEventTypesItem(Value.BILLING_INVOICE_VOIDED, "billing.invoice_voided"); + public static final UpdateWebhookEndpointRequestEventTypesItem SIGN_REQUEST_SENT = + new UpdateWebhookEndpointRequestEventTypesItem(Value.SIGN_REQUEST_SENT, "sign_request.sent"); + + public static final UpdateWebhookEndpointRequestEventTypesItem SCHEDULING_OAUTH_APP_RESTORED = + new UpdateWebhookEndpointRequestEventTypesItem( + Value.SCHEDULING_OAUTH_APP_RESTORED, "scheduling.oauth_app.restored"); + + public static final UpdateWebhookEndpointRequestEventTypesItem SUBACCOUNT_REINSTATED = + new UpdateWebhookEndpointRequestEventTypesItem(Value.SUBACCOUNT_REINSTATED, "subaccount.reinstated"); + + public static final UpdateWebhookEndpointRequestEventTypesItem VERIFICATION_FAILED = + new UpdateWebhookEndpointRequestEventTypesItem(Value.VERIFICATION_FAILED, "verification.failed"); + + public static final UpdateWebhookEndpointRequestEventTypesItem SCHEDULING_OUT_OF_OFFICE_DELETED = + new UpdateWebhookEndpointRequestEventTypesItem( + Value.SCHEDULING_OUT_OF_OFFICE_DELETED, "scheduling.out_of_office.deleted"); + + public static final UpdateWebhookEndpointRequestEventTypesItem SCHEDULING_CALENDAR_DELEGATION_RESTORED = + new UpdateWebhookEndpointRequestEventTypesItem( + Value.SCHEDULING_CALENDAR_DELEGATION_RESTORED, "scheduling.calendar_delegation.restored"); + + public static final UpdateWebhookEndpointRequestEventTypesItem EMAIL_DELIVERY_DELAYED = + new UpdateWebhookEndpointRequestEventTypesItem(Value.EMAIL_DELIVERY_DELAYED, "email.delivery_delayed"); + + public static final UpdateWebhookEndpointRequestEventTypesItem BROADCAST_SENDING = + new UpdateWebhookEndpointRequestEventTypesItem(Value.BROADCAST_SENDING, "broadcast.sending"); + + public static final UpdateWebhookEndpointRequestEventTypesItem SMS_RECEIVED = + new UpdateWebhookEndpointRequestEventTypesItem(Value.SMS_RECEIVED, "sms.received"); + + public static final UpdateWebhookEndpointRequestEventTypesItem BILLING_INVOICE_FINALIZED = + new UpdateWebhookEndpointRequestEventTypesItem( + Value.BILLING_INVOICE_FINALIZED, "billing.invoice_finalized"); + + public static final UpdateWebhookEndpointRequestEventTypesItem SCHEDULING_BOOKING_CALENDAR_WRITE_FAILED = + new UpdateWebhookEndpointRequestEventTypesItem( + Value.SCHEDULING_BOOKING_CALENDAR_WRITE_FAILED, "scheduling.booking.calendar_write_failed"); + + public static final UpdateWebhookEndpointRequestEventTypesItem EMAIL_DELIVERED = + new UpdateWebhookEndpointRequestEventTypesItem(Value.EMAIL_DELIVERED, "email.delivered"); + + public static final UpdateWebhookEndpointRequestEventTypesItem BILLING_INVOICE_PAYMENT_FAILED = + new UpdateWebhookEndpointRequestEventTypesItem( + Value.BILLING_INVOICE_PAYMENT_FAILED, "billing.invoice_payment_failed"); + + public static final UpdateWebhookEndpointRequestEventTypesItem EMAIL_RESCHEDULED = + new UpdateWebhookEndpointRequestEventTypesItem(Value.EMAIL_RESCHEDULED, "email.rescheduled"); + + public static final UpdateWebhookEndpointRequestEventTypesItem EMAIL_CLICKED = + new UpdateWebhookEndpointRequestEventTypesItem(Value.EMAIL_CLICKED, "email.clicked"); + + public static final UpdateWebhookEndpointRequestEventTypesItem SUBACCOUNT_REPUTATION_RECOVERED = + new UpdateWebhookEndpointRequestEventTypesItem( + Value.SUBACCOUNT_REPUTATION_RECOVERED, "subaccount.reputation_recovered"); + + public static final UpdateWebhookEndpointRequestEventTypesItem BILLING_BUDGET_THRESHOLD_REACHED = + new UpdateWebhookEndpointRequestEventTypesItem( + Value.BILLING_BUDGET_THRESHOLD_REACHED, "billing.budget_threshold_reached"); + + public static final UpdateWebhookEndpointRequestEventTypesItem CONTACT_CONFIRMED = + new UpdateWebhookEndpointRequestEventTypesItem(Value.CONTACT_CONFIRMED, "contact.confirmed"); + + public static final UpdateWebhookEndpointRequestEventTypesItem CONTACT_DELETED = + new UpdateWebhookEndpointRequestEventTypesItem(Value.CONTACT_DELETED, "contact.deleted"); + + public static final UpdateWebhookEndpointRequestEventTypesItem SMS_OPTED_IN = + new UpdateWebhookEndpointRequestEventTypesItem(Value.SMS_OPTED_IN, "sms.opted_in"); + + public static final UpdateWebhookEndpointRequestEventTypesItem EMAIL_COMPLAINED = + new UpdateWebhookEndpointRequestEventTypesItem(Value.EMAIL_COMPLAINED, "email.complained"); + + public static final UpdateWebhookEndpointRequestEventTypesItem ACCOUNT_MARKETING_PAUSED = + new UpdateWebhookEndpointRequestEventTypesItem(Value.ACCOUNT_MARKETING_PAUSED, "account.marketing_paused"); + + public static final UpdateWebhookEndpointRequestEventTypesItem EMAIL_FAILED = + new UpdateWebhookEndpointRequestEventTypesItem(Value.EMAIL_FAILED, "email.failed"); + + public static final UpdateWebhookEndpointRequestEventTypesItem BROADCAST_CANCELED = + new UpdateWebhookEndpointRequestEventTypesItem(Value.BROADCAST_CANCELED, "broadcast.canceled"); + + public static final UpdateWebhookEndpointRequestEventTypesItem SCHEDULING_CALENDAR_NEEDS_REAUTH = + new UpdateWebhookEndpointRequestEventTypesItem( + Value.SCHEDULING_CALENDAR_NEEDS_REAUTH, "scheduling.calendar.needs_reauth"); + + public static final UpdateWebhookEndpointRequestEventTypesItem EMAIL_OPENED = + new UpdateWebhookEndpointRequestEventTypesItem(Value.EMAIL_OPENED, "email.opened"); + + public static final UpdateWebhookEndpointRequestEventTypesItem SCHEDULING_CALENDAR_DISCONNECTED = + new UpdateWebhookEndpointRequestEventTypesItem( + Value.SCHEDULING_CALENDAR_DISCONNECTED, "scheduling.calendar.disconnected"); + + public static final UpdateWebhookEndpointRequestEventTypesItem SCHEDULING_OAUTH_APP_FAILING = + new UpdateWebhookEndpointRequestEventTypesItem( + Value.SCHEDULING_OAUTH_APP_FAILING, "scheduling.oauth_app.failing"); + + public static final UpdateWebhookEndpointRequestEventTypesItem SUBACCOUNT_PAUSED = + new UpdateWebhookEndpointRequestEventTypesItem(Value.SUBACCOUNT_PAUSED, "subaccount.paused"); + + public static final UpdateWebhookEndpointRequestEventTypesItem SIGN_REQUEST_COMPLETED = + new UpdateWebhookEndpointRequestEventTypesItem(Value.SIGN_REQUEST_COMPLETED, "sign_request.completed"); + + public static final UpdateWebhookEndpointRequestEventTypesItem EMAIL_SCHEDULED = + new UpdateWebhookEndpointRequestEventTypesItem(Value.EMAIL_SCHEDULED, "email.scheduled"); + + public static final UpdateWebhookEndpointRequestEventTypesItem SCHEDULING_BOOKING_CANCELLED = + new UpdateWebhookEndpointRequestEventTypesItem( + Value.SCHEDULING_BOOKING_CANCELLED, "scheduling.booking.cancelled"); + + public static final UpdateWebhookEndpointRequestEventTypesItem BILLING_HOLD_LIFTED = + new UpdateWebhookEndpointRequestEventTypesItem(Value.BILLING_HOLD_LIFTED, "billing.hold_lifted"); + + public static final UpdateWebhookEndpointRequestEventTypesItem EMAIL_SUPPRESSED = + new UpdateWebhookEndpointRequestEventTypesItem(Value.EMAIL_SUPPRESSED, "email.suppressed"); + + public static final UpdateWebhookEndpointRequestEventTypesItem EMAIL_RECEIVED = + new UpdateWebhookEndpointRequestEventTypesItem(Value.EMAIL_RECEIVED, "email.received"); + + public static final UpdateWebhookEndpointRequestEventTypesItem SCHEDULING_OUT_OF_OFFICE_ENDED = + new UpdateWebhookEndpointRequestEventTypesItem( + Value.SCHEDULING_OUT_OF_OFFICE_ENDED, "scheduling.out_of_office.ended"); + + public static final UpdateWebhookEndpointRequestEventTypesItem SCHEDULING_BOOKING_REMINDER = + new UpdateWebhookEndpointRequestEventTypesItem( + Value.SCHEDULING_BOOKING_REMINDER, "scheduling.booking.reminder"); + + public static final UpdateWebhookEndpointRequestEventTypesItem SCHEDULING_REASSIGNMENT_COMPLETED = + new UpdateWebhookEndpointRequestEventTypesItem( + Value.SCHEDULING_REASSIGNMENT_COMPLETED, "scheduling.reassignment.completed"); + + public static final UpdateWebhookEndpointRequestEventTypesItem BILLING_PLAN_CHANGED = + new UpdateWebhookEndpointRequestEventTypesItem(Value.BILLING_PLAN_CHANGED, "billing.plan_changed"); + public static final UpdateWebhookEndpointRequestEventTypesItem SMS_SUPPRESSED = new UpdateWebhookEndpointRequestEventTypesItem(Value.SMS_SUPPRESSED, "sms.suppressed"); - public static final UpdateWebhookEndpointRequestEventTypesItem SIGN_REQUEST_SENT = - new UpdateWebhookEndpointRequestEventTypesItem(Value.SIGN_REQUEST_SENT, "sign_request.sent"); + public static final UpdateWebhookEndpointRequestEventTypesItem SCHEDULING_OUT_OF_OFFICE_UPDATED = + new UpdateWebhookEndpointRequestEventTypesItem( + Value.SCHEDULING_OUT_OF_OFFICE_UPDATED, "scheduling.out_of_office.updated"); public static final UpdateWebhookEndpointRequestEventTypesItem EMAIL_BOUNCED = new UpdateWebhookEndpointRequestEventTypesItem(Value.EMAIL_BOUNCED, "email.bounced"); @@ -25,6 +155,10 @@ public final class UpdateWebhookEndpointRequestEventTypesItem { public static final UpdateWebhookEndpointRequestEventTypesItem SMS_OPTED_OUT = new UpdateWebhookEndpointRequestEventTypesItem(Value.SMS_OPTED_OUT, "sms.opted_out"); + public static final UpdateWebhookEndpointRequestEventTypesItem SCHEDULING_OUT_OF_OFFICE_STARTED = + new UpdateWebhookEndpointRequestEventTypesItem( + Value.SCHEDULING_OUT_OF_OFFICE_STARTED, "scheduling.out_of_office.started"); + public static final UpdateWebhookEndpointRequestEventTypesItem VERIFICATION_BLOCKED = new UpdateWebhookEndpointRequestEventTypesItem(Value.VERIFICATION_BLOCKED, "verification.blocked"); @@ -34,12 +168,6 @@ public final class UpdateWebhookEndpointRequestEventTypesItem { public static final UpdateWebhookEndpointRequestEventTypesItem SMS_CANCELED = new UpdateWebhookEndpointRequestEventTypesItem(Value.SMS_CANCELED, "sms.canceled"); - public static final UpdateWebhookEndpointRequestEventTypesItem SUBACCOUNT_REINSTATED = - new UpdateWebhookEndpointRequestEventTypesItem(Value.SUBACCOUNT_REINSTATED, "subaccount.reinstated"); - - public static final UpdateWebhookEndpointRequestEventTypesItem VERIFICATION_FAILED = - new UpdateWebhookEndpointRequestEventTypesItem(Value.VERIFICATION_FAILED, "verification.failed"); - public static final UpdateWebhookEndpointRequestEventTypesItem FORM_SUBMISSION_RECEIVED = new UpdateWebhookEndpointRequestEventTypesItem(Value.FORM_SUBMISSION_RECEIVED, "form.submission.received"); @@ -51,10 +179,6 @@ public final class UpdateWebhookEndpointRequestEventTypesItem { new UpdateWebhookEndpointRequestEventTypesItem( Value.SCHEDULING_BOOKING_LOCATION_READY, "scheduling.booking.location_ready"); - public static final UpdateWebhookEndpointRequestEventTypesItem SCHEDULING_CALENDAR_DELEGATION_RESTORED = - new UpdateWebhookEndpointRequestEventTypesItem( - Value.SCHEDULING_CALENDAR_DELEGATION_RESTORED, "scheduling.calendar_delegation.restored"); - public static final UpdateWebhookEndpointRequestEventTypesItem DOMAIN_DMARC_REPORT_RECEIVED = new UpdateWebhookEndpointRequestEventTypesItem( Value.DOMAIN_DMARC_REPORT_RECEIVED, "domain.dmarc_report_received"); @@ -62,9 +186,6 @@ public final class UpdateWebhookEndpointRequestEventTypesItem { public static final UpdateWebhookEndpointRequestEventTypesItem CONTACT_UPDATED = new UpdateWebhookEndpointRequestEventTypesItem(Value.CONTACT_UPDATED, "contact.updated"); - public static final UpdateWebhookEndpointRequestEventTypesItem EMAIL_DELIVERY_DELAYED = - new UpdateWebhookEndpointRequestEventTypesItem(Value.EMAIL_DELIVERY_DELAYED, "email.delivery_delayed"); - public static final UpdateWebhookEndpointRequestEventTypesItem INBOX_MESSAGE_RECEIVED = new UpdateWebhookEndpointRequestEventTypesItem(Value.INBOX_MESSAGE_RECEIVED, "inbox.message.received"); @@ -72,15 +193,9 @@ public final class UpdateWebhookEndpointRequestEventTypesItem { new UpdateWebhookEndpointRequestEventTypesItem( Value.BILLING_BUDGET_HOLD_PLACED, "billing.budget_hold_placed"); - public static final UpdateWebhookEndpointRequestEventTypesItem BROADCAST_SENDING = - new UpdateWebhookEndpointRequestEventTypesItem(Value.BROADCAST_SENDING, "broadcast.sending"); - public static final UpdateWebhookEndpointRequestEventTypesItem SMS_FAILED = new UpdateWebhookEndpointRequestEventTypesItem(Value.SMS_FAILED, "sms.failed"); - public static final UpdateWebhookEndpointRequestEventTypesItem SMS_RECEIVED = - new UpdateWebhookEndpointRequestEventTypesItem(Value.SMS_RECEIVED, "sms.received"); - public static final UpdateWebhookEndpointRequestEventTypesItem SCHEDULING_CALENDAR_DELEGATION_FAILING = new UpdateWebhookEndpointRequestEventTypesItem( Value.SCHEDULING_CALENDAR_DELEGATION_FAILING, "scheduling.calendar_delegation.failing"); @@ -96,44 +211,23 @@ public final class UpdateWebhookEndpointRequestEventTypesItem { new UpdateWebhookEndpointRequestEventTypesItem( Value.SCHEDULING_BOOKING_CREATED, "scheduling.booking.created"); - public static final UpdateWebhookEndpointRequestEventTypesItem BILLING_INVOICE_FINALIZED = + public static final UpdateWebhookEndpointRequestEventTypesItem SCHEDULING_OUT_OF_OFFICE_CREATED = new UpdateWebhookEndpointRequestEventTypesItem( - Value.BILLING_INVOICE_FINALIZED, "billing.invoice_finalized"); + Value.SCHEDULING_OUT_OF_OFFICE_CREATED, "scheduling.out_of_office.created"); - public static final UpdateWebhookEndpointRequestEventTypesItem SCHEDULING_BOOKING_CALENDAR_WRITE_FAILED = + public static final UpdateWebhookEndpointRequestEventTypesItem SCHEDULING_BOOKING_REASSIGNED = new UpdateWebhookEndpointRequestEventTypesItem( - Value.SCHEDULING_BOOKING_CALENDAR_WRITE_FAILED, "scheduling.booking.calendar_write_failed"); - - public static final UpdateWebhookEndpointRequestEventTypesItem EMAIL_DELIVERED = - new UpdateWebhookEndpointRequestEventTypesItem(Value.EMAIL_DELIVERED, "email.delivered"); + Value.SCHEDULING_BOOKING_REASSIGNED, "scheduling.booking.reassigned"); public static final UpdateWebhookEndpointRequestEventTypesItem SMS_SCHEDULED = new UpdateWebhookEndpointRequestEventTypesItem(Value.SMS_SCHEDULED, "sms.scheduled"); - public static final UpdateWebhookEndpointRequestEventTypesItem BILLING_INVOICE_PAYMENT_FAILED = - new UpdateWebhookEndpointRequestEventTypesItem( - Value.BILLING_INVOICE_PAYMENT_FAILED, "billing.invoice_payment_failed"); - public static final UpdateWebhookEndpointRequestEventTypesItem SIGN_REQUEST_DECLINED = new UpdateWebhookEndpointRequestEventTypesItem(Value.SIGN_REQUEST_DECLINED, "sign_request.declined"); - public static final UpdateWebhookEndpointRequestEventTypesItem EMAIL_RESCHEDULED = - new UpdateWebhookEndpointRequestEventTypesItem(Value.EMAIL_RESCHEDULED, "email.rescheduled"); - public static final UpdateWebhookEndpointRequestEventTypesItem BROADCAST_PAUSED = new UpdateWebhookEndpointRequestEventTypesItem(Value.BROADCAST_PAUSED, "broadcast.paused"); - public static final UpdateWebhookEndpointRequestEventTypesItem EMAIL_CLICKED = - new UpdateWebhookEndpointRequestEventTypesItem(Value.EMAIL_CLICKED, "email.clicked"); - - public static final UpdateWebhookEndpointRequestEventTypesItem SUBACCOUNT_REPUTATION_RECOVERED = - new UpdateWebhookEndpointRequestEventTypesItem( - Value.SUBACCOUNT_REPUTATION_RECOVERED, "subaccount.reputation_recovered"); - - public static final UpdateWebhookEndpointRequestEventTypesItem BILLING_BUDGET_THRESHOLD_REACHED = - new UpdateWebhookEndpointRequestEventTypesItem( - Value.BILLING_BUDGET_THRESHOLD_REACHED, "billing.budget_threshold_reached"); - public static final UpdateWebhookEndpointRequestEventTypesItem EMAIL_SENT = new UpdateWebhookEndpointRequestEventTypesItem(Value.EMAIL_SENT, "email.sent"); @@ -153,28 +247,16 @@ public final class UpdateWebhookEndpointRequestEventTypesItem { public static final UpdateWebhookEndpointRequestEventTypesItem FORM_SUBMISSION_FLAGGED = new UpdateWebhookEndpointRequestEventTypesItem(Value.FORM_SUBMISSION_FLAGGED, "form.submission.flagged"); - public static final UpdateWebhookEndpointRequestEventTypesItem CONTACT_CONFIRMED = - new UpdateWebhookEndpointRequestEventTypesItem(Value.CONTACT_CONFIRMED, "contact.confirmed"); - public static final UpdateWebhookEndpointRequestEventTypesItem BILLING_INVOICE_PAID = new UpdateWebhookEndpointRequestEventTypesItem(Value.BILLING_INVOICE_PAID, "billing.invoice_paid"); public static final UpdateWebhookEndpointRequestEventTypesItem CONTACT_UNSUBSCRIBED = new UpdateWebhookEndpointRequestEventTypesItem(Value.CONTACT_UNSUBSCRIBED, "contact.unsubscribed"); - public static final UpdateWebhookEndpointRequestEventTypesItem CONTACT_DELETED = - new UpdateWebhookEndpointRequestEventTypesItem(Value.CONTACT_DELETED, "contact.deleted"); - - public static final UpdateWebhookEndpointRequestEventTypesItem SMS_OPTED_IN = - new UpdateWebhookEndpointRequestEventTypesItem(Value.SMS_OPTED_IN, "sms.opted_in"); - public static final UpdateWebhookEndpointRequestEventTypesItem SCHEDULING_BOOKING_CONFIRMED = new UpdateWebhookEndpointRequestEventTypesItem( Value.SCHEDULING_BOOKING_CONFIRMED, "scheduling.booking.confirmed"); - public static final UpdateWebhookEndpointRequestEventTypesItem EMAIL_COMPLAINED = - new UpdateWebhookEndpointRequestEventTypesItem(Value.EMAIL_COMPLAINED, "email.complained"); - public static final UpdateWebhookEndpointRequestEventTypesItem SCHEDULING_BOOKING_NO_SHOW = new UpdateWebhookEndpointRequestEventTypesItem( Value.SCHEDULING_BOOKING_NO_SHOW, "scheduling.booking.no_show"); @@ -190,23 +272,14 @@ public final class UpdateWebhookEndpointRequestEventTypesItem { public static final UpdateWebhookEndpointRequestEventTypesItem SIGN_REQUEST_EXPIRED = new UpdateWebhookEndpointRequestEventTypesItem(Value.SIGN_REQUEST_EXPIRED, "sign_request.expired"); - public static final UpdateWebhookEndpointRequestEventTypesItem ACCOUNT_MARKETING_PAUSED = - new UpdateWebhookEndpointRequestEventTypesItem(Value.ACCOUNT_MARKETING_PAUSED, "account.marketing_paused"); - public static final UpdateWebhookEndpointRequestEventTypesItem ACCOUNT_REPUTATION_WARNING = new UpdateWebhookEndpointRequestEventTypesItem( Value.ACCOUNT_REPUTATION_WARNING, "account.reputation_warning"); - public static final UpdateWebhookEndpointRequestEventTypesItem EMAIL_FAILED = - new UpdateWebhookEndpointRequestEventTypesItem(Value.EMAIL_FAILED, "email.failed"); - public static final UpdateWebhookEndpointRequestEventTypesItem ACCOUNT_MARKETING_REINSTATED = new UpdateWebhookEndpointRequestEventTypesItem( Value.ACCOUNT_MARKETING_REINSTATED, "account.marketing_reinstated"); - public static final UpdateWebhookEndpointRequestEventTypesItem BROADCAST_CANCELED = - new UpdateWebhookEndpointRequestEventTypesItem(Value.BROADCAST_CANCELED, "broadcast.canceled"); - public static final UpdateWebhookEndpointRequestEventTypesItem BILLING_CREDIT_GRANTED = new UpdateWebhookEndpointRequestEventTypesItem(Value.BILLING_CREDIT_GRANTED, "billing.credit_granted"); @@ -214,10 +287,6 @@ public final class UpdateWebhookEndpointRequestEventTypesItem { new UpdateWebhookEndpointRequestEventTypesItem( Value.BILLING_BUDGET_HOLD_LIFTED, "billing.budget_hold_lifted"); - public static final UpdateWebhookEndpointRequestEventTypesItem SCHEDULING_CALENDAR_NEEDS_REAUTH = - new UpdateWebhookEndpointRequestEventTypesItem( - Value.SCHEDULING_CALENDAR_NEEDS_REAUTH, "scheduling.calendar.needs_reauth"); - public static final UpdateWebhookEndpointRequestEventTypesItem RISK_ASSESSMENT_REVIEWED = new UpdateWebhookEndpointRequestEventTypesItem(Value.RISK_ASSESSMENT_REVIEWED, "risk.assessment.reviewed"); @@ -231,9 +300,6 @@ public final class UpdateWebhookEndpointRequestEventTypesItem { public static final UpdateWebhookEndpointRequestEventTypesItem ACCOUNT_REINSTATED = new UpdateWebhookEndpointRequestEventTypesItem(Value.ACCOUNT_REINSTATED, "account.reinstated"); - public static final UpdateWebhookEndpointRequestEventTypesItem EMAIL_OPENED = - new UpdateWebhookEndpointRequestEventTypesItem(Value.EMAIL_OPENED, "email.opened"); - public static final UpdateWebhookEndpointRequestEventTypesItem SIGN_REQUEST_SIGNER_SIGNED = new UpdateWebhookEndpointRequestEventTypesItem( Value.SIGN_REQUEST_SIGNER_SIGNED, "sign_request.signer_signed"); @@ -241,10 +307,6 @@ public final class UpdateWebhookEndpointRequestEventTypesItem { public static final UpdateWebhookEndpointRequestEventTypesItem EMAIL_CANCELED = new UpdateWebhookEndpointRequestEventTypesItem(Value.EMAIL_CANCELED, "email.canceled"); - public static final UpdateWebhookEndpointRequestEventTypesItem SCHEDULING_CALENDAR_DISCONNECTED = - new UpdateWebhookEndpointRequestEventTypesItem( - Value.SCHEDULING_CALENDAR_DISCONNECTED, "scheduling.calendar.disconnected"); - public static final UpdateWebhookEndpointRequestEventTypesItem SMS_DELIVERED = new UpdateWebhookEndpointRequestEventTypesItem(Value.SMS_DELIVERED, "sms.delivered"); @@ -258,18 +320,9 @@ public final class UpdateWebhookEndpointRequestEventTypesItem { new UpdateWebhookEndpointRequestEventTypesItem( Value.SCHEDULING_BOOKING_DECLINED, "scheduling.booking.declined"); - public static final UpdateWebhookEndpointRequestEventTypesItem SUBACCOUNT_PAUSED = - new UpdateWebhookEndpointRequestEventTypesItem(Value.SUBACCOUNT_PAUSED, "subaccount.paused"); - - public static final UpdateWebhookEndpointRequestEventTypesItem SIGN_REQUEST_COMPLETED = - new UpdateWebhookEndpointRequestEventTypesItem(Value.SIGN_REQUEST_COMPLETED, "sign_request.completed"); - public static final UpdateWebhookEndpointRequestEventTypesItem RISK_ASSESSMENT_REVIEW = new UpdateWebhookEndpointRequestEventTypesItem(Value.RISK_ASSESSMENT_REVIEW, "risk.assessment.review"); - public static final UpdateWebhookEndpointRequestEventTypesItem EMAIL_SCHEDULED = - new UpdateWebhookEndpointRequestEventTypesItem(Value.EMAIL_SCHEDULED, "email.scheduled"); - public static final UpdateWebhookEndpointRequestEventTypesItem SCHEDULING_BOOKING_RESCHEDULED = new UpdateWebhookEndpointRequestEventTypesItem( Value.SCHEDULING_BOOKING_RESCHEDULED, "scheduling.booking.rescheduled"); @@ -280,26 +333,9 @@ public final class UpdateWebhookEndpointRequestEventTypesItem { public static final UpdateWebhookEndpointRequestEventTypesItem HOOK_ENDPOINT_DISABLED = new UpdateWebhookEndpointRequestEventTypesItem(Value.HOOK_ENDPOINT_DISABLED, "hook_endpoint.disabled"); - public static final UpdateWebhookEndpointRequestEventTypesItem SCHEDULING_BOOKING_CANCELLED = - new UpdateWebhookEndpointRequestEventTypesItem( - Value.SCHEDULING_BOOKING_CANCELLED, "scheduling.booking.cancelled"); - - public static final UpdateWebhookEndpointRequestEventTypesItem BILLING_HOLD_LIFTED = - new UpdateWebhookEndpointRequestEventTypesItem(Value.BILLING_HOLD_LIFTED, "billing.hold_lifted"); - - public static final UpdateWebhookEndpointRequestEventTypesItem EMAIL_SUPPRESSED = - new UpdateWebhookEndpointRequestEventTypesItem(Value.EMAIL_SUPPRESSED, "email.suppressed"); - public static final UpdateWebhookEndpointRequestEventTypesItem BILLING_HOLD_PLACED = new UpdateWebhookEndpointRequestEventTypesItem(Value.BILLING_HOLD_PLACED, "billing.hold_placed"); - public static final UpdateWebhookEndpointRequestEventTypesItem EMAIL_RECEIVED = - new UpdateWebhookEndpointRequestEventTypesItem(Value.EMAIL_RECEIVED, "email.received"); - - public static final UpdateWebhookEndpointRequestEventTypesItem SCHEDULING_BOOKING_REMINDER = - new UpdateWebhookEndpointRequestEventTypesItem( - Value.SCHEDULING_BOOKING_REMINDER, "scheduling.booking.reminder"); - public static final UpdateWebhookEndpointRequestEventTypesItem SCHEDULING_CALENDAR_CONNECTED = new UpdateWebhookEndpointRequestEventTypesItem( Value.SCHEDULING_CALENDAR_CONNECTED, "scheduling.calendar.connected"); @@ -343,52 +379,118 @@ public int hashCode() { public T visit(Visitor visitor) { switch (value) { + case BILLING_INVOICE_VOIDED: + return visitor.visitBillingInvoiceVoided(); + case SIGN_REQUEST_SENT: + return visitor.visitSignRequestSent(); + case SCHEDULING_OAUTH_APP_RESTORED: + return visitor.visitSchedulingOauthAppRestored(); + case SUBACCOUNT_REINSTATED: + return visitor.visitSubaccountReinstated(); + case VERIFICATION_FAILED: + return visitor.visitVerificationFailed(); + case SCHEDULING_OUT_OF_OFFICE_DELETED: + return visitor.visitSchedulingOutOfOfficeDeleted(); + case SCHEDULING_CALENDAR_DELEGATION_RESTORED: + return visitor.visitSchedulingCalendarDelegationRestored(); + case EMAIL_DELIVERY_DELAYED: + return visitor.visitEmailDeliveryDelayed(); + case BROADCAST_SENDING: + return visitor.visitBroadcastSending(); + case SMS_RECEIVED: + return visitor.visitSmsReceived(); + case BILLING_INVOICE_FINALIZED: + return visitor.visitBillingInvoiceFinalized(); + case SCHEDULING_BOOKING_CALENDAR_WRITE_FAILED: + return visitor.visitSchedulingBookingCalendarWriteFailed(); + case EMAIL_DELIVERED: + return visitor.visitEmailDelivered(); + case BILLING_INVOICE_PAYMENT_FAILED: + return visitor.visitBillingInvoicePaymentFailed(); + case EMAIL_RESCHEDULED: + return visitor.visitEmailRescheduled(); + case EMAIL_CLICKED: + return visitor.visitEmailClicked(); + case SUBACCOUNT_REPUTATION_RECOVERED: + return visitor.visitSubaccountReputationRecovered(); + case BILLING_BUDGET_THRESHOLD_REACHED: + return visitor.visitBillingBudgetThresholdReached(); + case CONTACT_CONFIRMED: + return visitor.visitContactConfirmed(); + case CONTACT_DELETED: + return visitor.visitContactDeleted(); + case SMS_OPTED_IN: + return visitor.visitSmsOptedIn(); + case EMAIL_COMPLAINED: + return visitor.visitEmailComplained(); + case ACCOUNT_MARKETING_PAUSED: + return visitor.visitAccountMarketingPaused(); + case EMAIL_FAILED: + return visitor.visitEmailFailed(); + case BROADCAST_CANCELED: + return visitor.visitBroadcastCanceled(); + case SCHEDULING_CALENDAR_NEEDS_REAUTH: + return visitor.visitSchedulingCalendarNeedsReauth(); + case EMAIL_OPENED: + return visitor.visitEmailOpened(); + case SCHEDULING_CALENDAR_DISCONNECTED: + return visitor.visitSchedulingCalendarDisconnected(); + case SCHEDULING_OAUTH_APP_FAILING: + return visitor.visitSchedulingOauthAppFailing(); + case SUBACCOUNT_PAUSED: + return visitor.visitSubaccountPaused(); + case SIGN_REQUEST_COMPLETED: + return visitor.visitSignRequestCompleted(); + case EMAIL_SCHEDULED: + return visitor.visitEmailScheduled(); + case SCHEDULING_BOOKING_CANCELLED: + return visitor.visitSchedulingBookingCancelled(); + case BILLING_HOLD_LIFTED: + return visitor.visitBillingHoldLifted(); + case EMAIL_SUPPRESSED: + return visitor.visitEmailSuppressed(); + case EMAIL_RECEIVED: + return visitor.visitEmailReceived(); + case SCHEDULING_OUT_OF_OFFICE_ENDED: + return visitor.visitSchedulingOutOfOfficeEnded(); + case SCHEDULING_BOOKING_REMINDER: + return visitor.visitSchedulingBookingReminder(); + case SCHEDULING_REASSIGNMENT_COMPLETED: + return visitor.visitSchedulingReassignmentCompleted(); case BILLING_PLAN_CHANGED: return visitor.visitBillingPlanChanged(); - case BILLING_INVOICE_VOIDED: - return visitor.visitBillingInvoiceVoided(); case SMS_SUPPRESSED: return visitor.visitSmsSuppressed(); - case SIGN_REQUEST_SENT: - return visitor.visitSignRequestSent(); + case SCHEDULING_OUT_OF_OFFICE_UPDATED: + return visitor.visitSchedulingOutOfOfficeUpdated(); case EMAIL_BOUNCED: return visitor.visitEmailBounced(); case SMS_OPTED_OUT: return visitor.visitSmsOptedOut(); + case SCHEDULING_OUT_OF_OFFICE_STARTED: + return visitor.visitSchedulingOutOfOfficeStarted(); case VERIFICATION_BLOCKED: return visitor.visitVerificationBlocked(); case CONTACT_CREATED: return visitor.visitContactCreated(); case SMS_CANCELED: return visitor.visitSmsCanceled(); - case SUBACCOUNT_REINSTATED: - return visitor.visitSubaccountReinstated(); - case VERIFICATION_FAILED: - return visitor.visitVerificationFailed(); case FORM_SUBMISSION_RECEIVED: return visitor.visitFormSubmissionReceived(); case ACCOUNT_REPUTATION_RECOVERED: return visitor.visitAccountReputationRecovered(); case SCHEDULING_BOOKING_LOCATION_READY: return visitor.visitSchedulingBookingLocationReady(); - case SCHEDULING_CALENDAR_DELEGATION_RESTORED: - return visitor.visitSchedulingCalendarDelegationRestored(); case DOMAIN_DMARC_REPORT_RECEIVED: return visitor.visitDomainDmarcReportReceived(); case CONTACT_UPDATED: return visitor.visitContactUpdated(); - case EMAIL_DELIVERY_DELAYED: - return visitor.visitEmailDeliveryDelayed(); case INBOX_MESSAGE_RECEIVED: return visitor.visitInboxMessageReceived(); case BILLING_BUDGET_HOLD_PLACED: return visitor.visitBillingBudgetHoldPlaced(); - case BROADCAST_SENDING: - return visitor.visitBroadcastSending(); case SMS_FAILED: return visitor.visitSmsFailed(); - case SMS_RECEIVED: - return visitor.visitSmsReceived(); case SCHEDULING_CALENDAR_DELEGATION_FAILING: return visitor.visitSchedulingCalendarDelegationFailing(); case SUBACCOUNT_REPUTATION_WARNING: @@ -397,28 +499,16 @@ public T visit(Visitor visitor) { return visitor.visitSmsUndelivered(); case SCHEDULING_BOOKING_CREATED: return visitor.visitSchedulingBookingCreated(); - case BILLING_INVOICE_FINALIZED: - return visitor.visitBillingInvoiceFinalized(); - case SCHEDULING_BOOKING_CALENDAR_WRITE_FAILED: - return visitor.visitSchedulingBookingCalendarWriteFailed(); - case EMAIL_DELIVERED: - return visitor.visitEmailDelivered(); + case SCHEDULING_OUT_OF_OFFICE_CREATED: + return visitor.visitSchedulingOutOfOfficeCreated(); + case SCHEDULING_BOOKING_REASSIGNED: + return visitor.visitSchedulingBookingReassigned(); case SMS_SCHEDULED: return visitor.visitSmsScheduled(); - case BILLING_INVOICE_PAYMENT_FAILED: - return visitor.visitBillingInvoicePaymentFailed(); case SIGN_REQUEST_DECLINED: return visitor.visitSignRequestDeclined(); - case EMAIL_RESCHEDULED: - return visitor.visitEmailRescheduled(); case BROADCAST_PAUSED: return visitor.visitBroadcastPaused(); - case EMAIL_CLICKED: - return visitor.visitEmailClicked(); - case SUBACCOUNT_REPUTATION_RECOVERED: - return visitor.visitSubaccountReputationRecovered(); - case BILLING_BUDGET_THRESHOLD_REACHED: - return visitor.visitBillingBudgetThresholdReached(); case EMAIL_SENT: return visitor.visitEmailSent(); case SCHEDULING_BOOKING_EXTERNAL_CONFLICT: @@ -431,20 +521,12 @@ public T visit(Visitor visitor) { return visitor.visitVerificationApproved(); case FORM_SUBMISSION_FLAGGED: return visitor.visitFormSubmissionFlagged(); - case CONTACT_CONFIRMED: - return visitor.visitContactConfirmed(); case BILLING_INVOICE_PAID: return visitor.visitBillingInvoicePaid(); case CONTACT_UNSUBSCRIBED: return visitor.visitContactUnsubscribed(); - case CONTACT_DELETED: - return visitor.visitContactDeleted(); - case SMS_OPTED_IN: - return visitor.visitSmsOptedIn(); case SCHEDULING_BOOKING_CONFIRMED: return visitor.visitSchedulingBookingConfirmed(); - case EMAIL_COMPLAINED: - return visitor.visitEmailComplained(); case SCHEDULING_BOOKING_NO_SHOW: return visitor.visitSchedulingBookingNoShow(); case SCHEDULING_BOOKING_STARTED: @@ -453,22 +535,14 @@ public T visit(Visitor visitor) { return visitor.visitBillingUsageThresholdReached(); case SIGN_REQUEST_EXPIRED: return visitor.visitSignRequestExpired(); - case ACCOUNT_MARKETING_PAUSED: - return visitor.visitAccountMarketingPaused(); case ACCOUNT_REPUTATION_WARNING: return visitor.visitAccountReputationWarning(); - case EMAIL_FAILED: - return visitor.visitEmailFailed(); case ACCOUNT_MARKETING_REINSTATED: return visitor.visitAccountMarketingReinstated(); - case BROADCAST_CANCELED: - return visitor.visitBroadcastCanceled(); case BILLING_CREDIT_GRANTED: return visitor.visitBillingCreditGranted(); case BILLING_BUDGET_HOLD_LIFTED: return visitor.visitBillingBudgetHoldLifted(); - case SCHEDULING_CALENDAR_NEEDS_REAUTH: - return visitor.visitSchedulingCalendarNeedsReauth(); case RISK_ASSESSMENT_REVIEWED: return visitor.visitRiskAssessmentReviewed(); case SMS_SENT: @@ -477,14 +551,10 @@ public T visit(Visitor visitor) { return visitor.visitSchedulingBookingPendingApproval(); case ACCOUNT_REINSTATED: return visitor.visitAccountReinstated(); - case EMAIL_OPENED: - return visitor.visitEmailOpened(); case SIGN_REQUEST_SIGNER_SIGNED: return visitor.visitSignRequestSignerSigned(); case EMAIL_CANCELED: return visitor.visitEmailCanceled(); - case SCHEDULING_CALENDAR_DISCONNECTED: - return visitor.visitSchedulingCalendarDisconnected(); case SMS_DELIVERED: return visitor.visitSmsDelivered(); case SIGN_REQUEST_VIEWED: @@ -493,32 +563,16 @@ public T visit(Visitor visitor) { return visitor.visitEmailUnsubscribed(); case SCHEDULING_BOOKING_DECLINED: return visitor.visitSchedulingBookingDeclined(); - case SUBACCOUNT_PAUSED: - return visitor.visitSubaccountPaused(); - case SIGN_REQUEST_COMPLETED: - return visitor.visitSignRequestCompleted(); case RISK_ASSESSMENT_REVIEW: return visitor.visitRiskAssessmentReview(); - case EMAIL_SCHEDULED: - return visitor.visitEmailScheduled(); case SCHEDULING_BOOKING_RESCHEDULED: return visitor.visitSchedulingBookingRescheduled(); case SCHEDULING_BOOKING_ENDED: return visitor.visitSchedulingBookingEnded(); case HOOK_ENDPOINT_DISABLED: return visitor.visitHookEndpointDisabled(); - case SCHEDULING_BOOKING_CANCELLED: - return visitor.visitSchedulingBookingCancelled(); - case BILLING_HOLD_LIFTED: - return visitor.visitBillingHoldLifted(); - case EMAIL_SUPPRESSED: - return visitor.visitEmailSuppressed(); case BILLING_HOLD_PLACED: return visitor.visitBillingHoldPlaced(); - case EMAIL_RECEIVED: - return visitor.visitEmailReceived(); - case SCHEDULING_BOOKING_REMINDER: - return visitor.visitSchedulingBookingReminder(); case SCHEDULING_CALENDAR_CONNECTED: return visitor.visitSchedulingCalendarConnected(); case ACCOUNT_SUSPENDED: @@ -534,52 +588,118 @@ public T visit(Visitor visitor) { @JsonCreator(mode = JsonCreator.Mode.DELEGATING) public static UpdateWebhookEndpointRequestEventTypesItem valueOf(String value) { switch (value) { - case "billing.plan_changed": - return BILLING_PLAN_CHANGED; case "billing.invoice_voided": return BILLING_INVOICE_VOIDED; - case "sms.suppressed": - return SMS_SUPPRESSED; case "sign_request.sent": return SIGN_REQUEST_SENT; + case "scheduling.oauth_app.restored": + return SCHEDULING_OAUTH_APP_RESTORED; + case "subaccount.reinstated": + return SUBACCOUNT_REINSTATED; + case "verification.failed": + return VERIFICATION_FAILED; + case "scheduling.out_of_office.deleted": + return SCHEDULING_OUT_OF_OFFICE_DELETED; + case "scheduling.calendar_delegation.restored": + return SCHEDULING_CALENDAR_DELEGATION_RESTORED; + case "email.delivery_delayed": + return EMAIL_DELIVERY_DELAYED; + case "broadcast.sending": + return BROADCAST_SENDING; + case "sms.received": + return SMS_RECEIVED; + case "billing.invoice_finalized": + return BILLING_INVOICE_FINALIZED; + case "scheduling.booking.calendar_write_failed": + return SCHEDULING_BOOKING_CALENDAR_WRITE_FAILED; + case "email.delivered": + return EMAIL_DELIVERED; + case "billing.invoice_payment_failed": + return BILLING_INVOICE_PAYMENT_FAILED; + case "email.rescheduled": + return EMAIL_RESCHEDULED; + case "email.clicked": + return EMAIL_CLICKED; + case "subaccount.reputation_recovered": + return SUBACCOUNT_REPUTATION_RECOVERED; + case "billing.budget_threshold_reached": + return BILLING_BUDGET_THRESHOLD_REACHED; + case "contact.confirmed": + return CONTACT_CONFIRMED; + case "contact.deleted": + return CONTACT_DELETED; + case "sms.opted_in": + return SMS_OPTED_IN; + case "email.complained": + return EMAIL_COMPLAINED; + case "account.marketing_paused": + return ACCOUNT_MARKETING_PAUSED; + case "email.failed": + return EMAIL_FAILED; + case "broadcast.canceled": + return BROADCAST_CANCELED; + case "scheduling.calendar.needs_reauth": + return SCHEDULING_CALENDAR_NEEDS_REAUTH; + case "email.opened": + return EMAIL_OPENED; + case "scheduling.calendar.disconnected": + return SCHEDULING_CALENDAR_DISCONNECTED; + case "scheduling.oauth_app.failing": + return SCHEDULING_OAUTH_APP_FAILING; + case "subaccount.paused": + return SUBACCOUNT_PAUSED; + case "sign_request.completed": + return SIGN_REQUEST_COMPLETED; + case "email.scheduled": + return EMAIL_SCHEDULED; + case "scheduling.booking.cancelled": + return SCHEDULING_BOOKING_CANCELLED; + case "billing.hold_lifted": + return BILLING_HOLD_LIFTED; + case "email.suppressed": + return EMAIL_SUPPRESSED; + case "email.received": + return EMAIL_RECEIVED; + case "scheduling.out_of_office.ended": + return SCHEDULING_OUT_OF_OFFICE_ENDED; + case "scheduling.booking.reminder": + return SCHEDULING_BOOKING_REMINDER; + case "scheduling.reassignment.completed": + return SCHEDULING_REASSIGNMENT_COMPLETED; + case "billing.plan_changed": + return BILLING_PLAN_CHANGED; + case "sms.suppressed": + return SMS_SUPPRESSED; + case "scheduling.out_of_office.updated": + return SCHEDULING_OUT_OF_OFFICE_UPDATED; case "email.bounced": return EMAIL_BOUNCED; case "sms.opted_out": return SMS_OPTED_OUT; + case "scheduling.out_of_office.started": + return SCHEDULING_OUT_OF_OFFICE_STARTED; case "verification.blocked": return VERIFICATION_BLOCKED; case "contact.created": return CONTACT_CREATED; case "sms.canceled": return SMS_CANCELED; - case "subaccount.reinstated": - return SUBACCOUNT_REINSTATED; - case "verification.failed": - return VERIFICATION_FAILED; case "form.submission.received": return FORM_SUBMISSION_RECEIVED; case "account.reputation_recovered": return ACCOUNT_REPUTATION_RECOVERED; case "scheduling.booking.location_ready": return SCHEDULING_BOOKING_LOCATION_READY; - case "scheduling.calendar_delegation.restored": - return SCHEDULING_CALENDAR_DELEGATION_RESTORED; case "domain.dmarc_report_received": return DOMAIN_DMARC_REPORT_RECEIVED; case "contact.updated": return CONTACT_UPDATED; - case "email.delivery_delayed": - return EMAIL_DELIVERY_DELAYED; case "inbox.message.received": return INBOX_MESSAGE_RECEIVED; case "billing.budget_hold_placed": return BILLING_BUDGET_HOLD_PLACED; - case "broadcast.sending": - return BROADCAST_SENDING; case "sms.failed": return SMS_FAILED; - case "sms.received": - return SMS_RECEIVED; case "scheduling.calendar_delegation.failing": return SCHEDULING_CALENDAR_DELEGATION_FAILING; case "subaccount.reputation_warning": @@ -588,28 +708,16 @@ public static UpdateWebhookEndpointRequestEventTypesItem valueOf(String value) { return SMS_UNDELIVERED; case "scheduling.booking.created": return SCHEDULING_BOOKING_CREATED; - case "billing.invoice_finalized": - return BILLING_INVOICE_FINALIZED; - case "scheduling.booking.calendar_write_failed": - return SCHEDULING_BOOKING_CALENDAR_WRITE_FAILED; - case "email.delivered": - return EMAIL_DELIVERED; + case "scheduling.out_of_office.created": + return SCHEDULING_OUT_OF_OFFICE_CREATED; + case "scheduling.booking.reassigned": + return SCHEDULING_BOOKING_REASSIGNED; case "sms.scheduled": return SMS_SCHEDULED; - case "billing.invoice_payment_failed": - return BILLING_INVOICE_PAYMENT_FAILED; case "sign_request.declined": return SIGN_REQUEST_DECLINED; - case "email.rescheduled": - return EMAIL_RESCHEDULED; case "broadcast.paused": return BROADCAST_PAUSED; - case "email.clicked": - return EMAIL_CLICKED; - case "subaccount.reputation_recovered": - return SUBACCOUNT_REPUTATION_RECOVERED; - case "billing.budget_threshold_reached": - return BILLING_BUDGET_THRESHOLD_REACHED; case "email.sent": return EMAIL_SENT; case "scheduling.booking.external_conflict": @@ -622,20 +730,12 @@ public static UpdateWebhookEndpointRequestEventTypesItem valueOf(String value) { return VERIFICATION_APPROVED; case "form.submission.flagged": return FORM_SUBMISSION_FLAGGED; - case "contact.confirmed": - return CONTACT_CONFIRMED; case "billing.invoice_paid": return BILLING_INVOICE_PAID; case "contact.unsubscribed": return CONTACT_UNSUBSCRIBED; - case "contact.deleted": - return CONTACT_DELETED; - case "sms.opted_in": - return SMS_OPTED_IN; case "scheduling.booking.confirmed": return SCHEDULING_BOOKING_CONFIRMED; - case "email.complained": - return EMAIL_COMPLAINED; case "scheduling.booking.no_show": return SCHEDULING_BOOKING_NO_SHOW; case "scheduling.booking.started": @@ -644,22 +744,14 @@ public static UpdateWebhookEndpointRequestEventTypesItem valueOf(String value) { return BILLING_USAGE_THRESHOLD_REACHED; case "sign_request.expired": return SIGN_REQUEST_EXPIRED; - case "account.marketing_paused": - return ACCOUNT_MARKETING_PAUSED; case "account.reputation_warning": return ACCOUNT_REPUTATION_WARNING; - case "email.failed": - return EMAIL_FAILED; case "account.marketing_reinstated": return ACCOUNT_MARKETING_REINSTATED; - case "broadcast.canceled": - return BROADCAST_CANCELED; case "billing.credit_granted": return BILLING_CREDIT_GRANTED; case "billing.budget_hold_lifted": return BILLING_BUDGET_HOLD_LIFTED; - case "scheduling.calendar.needs_reauth": - return SCHEDULING_CALENDAR_NEEDS_REAUTH; case "risk.assessment.reviewed": return RISK_ASSESSMENT_REVIEWED; case "sms.sent": @@ -668,14 +760,10 @@ public static UpdateWebhookEndpointRequestEventTypesItem valueOf(String value) { return SCHEDULING_BOOKING_PENDING_APPROVAL; case "account.reinstated": return ACCOUNT_REINSTATED; - case "email.opened": - return EMAIL_OPENED; case "sign_request.signer_signed": return SIGN_REQUEST_SIGNER_SIGNED; case "email.canceled": return EMAIL_CANCELED; - case "scheduling.calendar.disconnected": - return SCHEDULING_CALENDAR_DISCONNECTED; case "sms.delivered": return SMS_DELIVERED; case "sign_request.viewed": @@ -684,32 +772,16 @@ public static UpdateWebhookEndpointRequestEventTypesItem valueOf(String value) { return EMAIL_UNSUBSCRIBED; case "scheduling.booking.declined": return SCHEDULING_BOOKING_DECLINED; - case "subaccount.paused": - return SUBACCOUNT_PAUSED; - case "sign_request.completed": - return SIGN_REQUEST_COMPLETED; case "risk.assessment.review": return RISK_ASSESSMENT_REVIEW; - case "email.scheduled": - return EMAIL_SCHEDULED; case "scheduling.booking.rescheduled": return SCHEDULING_BOOKING_RESCHEDULED; case "scheduling.booking.ended": return SCHEDULING_BOOKING_ENDED; case "hook_endpoint.disabled": return HOOK_ENDPOINT_DISABLED; - case "scheduling.booking.cancelled": - return SCHEDULING_BOOKING_CANCELLED; - case "billing.hold_lifted": - return BILLING_HOLD_LIFTED; - case "email.suppressed": - return EMAIL_SUPPRESSED; case "billing.hold_placed": return BILLING_HOLD_PLACED; - case "email.received": - return EMAIL_RECEIVED; - case "scheduling.booking.reminder": - return SCHEDULING_BOOKING_REMINDER; case "scheduling.calendar.connected": return SCHEDULING_CALENDAR_CONNECTED; case "account.suspended": @@ -888,6 +960,8 @@ public enum Value { SCHEDULING_BOOKING_LOCATION_READY, + SCHEDULING_BOOKING_REASSIGNED, + SCHEDULING_BOOKING_STARTED, SCHEDULING_BOOKING_ENDED, @@ -904,6 +978,22 @@ public enum Value { SCHEDULING_CALENDAR_DELEGATION_RESTORED, + SCHEDULING_OUT_OF_OFFICE_CREATED, + + SCHEDULING_OUT_OF_OFFICE_UPDATED, + + SCHEDULING_OUT_OF_OFFICE_DELETED, + + SCHEDULING_OUT_OF_OFFICE_STARTED, + + SCHEDULING_OUT_OF_OFFICE_ENDED, + + SCHEDULING_REASSIGNMENT_COMPLETED, + + SCHEDULING_OAUTH_APP_FAILING, + + SCHEDULING_OAUTH_APP_RESTORED, + UNKNOWN } @@ -1074,6 +1164,8 @@ public interface Visitor { T visitSchedulingBookingLocationReady(); + T visitSchedulingBookingReassigned(); + T visitSchedulingBookingStarted(); T visitSchedulingBookingEnded(); @@ -1090,6 +1182,22 @@ public interface Visitor { T visitSchedulingCalendarDelegationRestored(); + T visitSchedulingOutOfOfficeCreated(); + + T visitSchedulingOutOfOfficeUpdated(); + + T visitSchedulingOutOfOfficeDeleted(); + + T visitSchedulingOutOfOfficeStarted(); + + T visitSchedulingOutOfOfficeEnded(); + + T visitSchedulingReassignmentCompleted(); + + T visitSchedulingOauthAppFailing(); + + T visitSchedulingOauthAppRestored(); + T visitUnknown(String unknownType); } } diff --git a/sdks/java/src/main/java/com/coss/resources/webhookevents/types/CreateTestWebhookEventRequestType.java b/sdks/java/src/main/java/com/coss/resources/webhookevents/types/CreateTestWebhookEventRequestType.java index f82349206..f743d953f 100644 --- a/sdks/java/src/main/java/com/coss/resources/webhookevents/types/CreateTestWebhookEventRequestType.java +++ b/sdks/java/src/main/java/com/coss/resources/webhookevents/types/CreateTestWebhookEventRequestType.java @@ -7,17 +7,142 @@ import com.fasterxml.jackson.annotation.JsonValue; public final class CreateTestWebhookEventRequestType { - public static final CreateTestWebhookEventRequestType BILLING_PLAN_CHANGED = - new CreateTestWebhookEventRequestType(Value.BILLING_PLAN_CHANGED, "billing.plan_changed"); - public static final CreateTestWebhookEventRequestType BILLING_INVOICE_VOIDED = new CreateTestWebhookEventRequestType(Value.BILLING_INVOICE_VOIDED, "billing.invoice_voided"); + public static final CreateTestWebhookEventRequestType SIGN_REQUEST_SENT = + new CreateTestWebhookEventRequestType(Value.SIGN_REQUEST_SENT, "sign_request.sent"); + + public static final CreateTestWebhookEventRequestType SCHEDULING_OAUTH_APP_RESTORED = + new CreateTestWebhookEventRequestType(Value.SCHEDULING_OAUTH_APP_RESTORED, "scheduling.oauth_app.restored"); + + public static final CreateTestWebhookEventRequestType SUBACCOUNT_REINSTATED = + new CreateTestWebhookEventRequestType(Value.SUBACCOUNT_REINSTATED, "subaccount.reinstated"); + + public static final CreateTestWebhookEventRequestType VERIFICATION_FAILED = + new CreateTestWebhookEventRequestType(Value.VERIFICATION_FAILED, "verification.failed"); + + public static final CreateTestWebhookEventRequestType SCHEDULING_OUT_OF_OFFICE_DELETED = + new CreateTestWebhookEventRequestType( + Value.SCHEDULING_OUT_OF_OFFICE_DELETED, "scheduling.out_of_office.deleted"); + + public static final CreateTestWebhookEventRequestType SCHEDULING_CALENDAR_DELEGATION_RESTORED = + new CreateTestWebhookEventRequestType( + Value.SCHEDULING_CALENDAR_DELEGATION_RESTORED, "scheduling.calendar_delegation.restored"); + + public static final CreateTestWebhookEventRequestType EMAIL_DELIVERY_DELAYED = + new CreateTestWebhookEventRequestType(Value.EMAIL_DELIVERY_DELAYED, "email.delivery_delayed"); + + public static final CreateTestWebhookEventRequestType BROADCAST_SENDING = + new CreateTestWebhookEventRequestType(Value.BROADCAST_SENDING, "broadcast.sending"); + + public static final CreateTestWebhookEventRequestType SMS_RECEIVED = + new CreateTestWebhookEventRequestType(Value.SMS_RECEIVED, "sms.received"); + + public static final CreateTestWebhookEventRequestType BILLING_INVOICE_FINALIZED = + new CreateTestWebhookEventRequestType(Value.BILLING_INVOICE_FINALIZED, "billing.invoice_finalized"); + + public static final CreateTestWebhookEventRequestType SCHEDULING_BOOKING_CALENDAR_WRITE_FAILED = + new CreateTestWebhookEventRequestType( + Value.SCHEDULING_BOOKING_CALENDAR_WRITE_FAILED, "scheduling.booking.calendar_write_failed"); + + public static final CreateTestWebhookEventRequestType EMAIL_DELIVERED = + new CreateTestWebhookEventRequestType(Value.EMAIL_DELIVERED, "email.delivered"); + + public static final CreateTestWebhookEventRequestType BILLING_INVOICE_PAYMENT_FAILED = + new CreateTestWebhookEventRequestType( + Value.BILLING_INVOICE_PAYMENT_FAILED, "billing.invoice_payment_failed"); + + public static final CreateTestWebhookEventRequestType EMAIL_RESCHEDULED = + new CreateTestWebhookEventRequestType(Value.EMAIL_RESCHEDULED, "email.rescheduled"); + + public static final CreateTestWebhookEventRequestType EMAIL_CLICKED = + new CreateTestWebhookEventRequestType(Value.EMAIL_CLICKED, "email.clicked"); + + public static final CreateTestWebhookEventRequestType SUBACCOUNT_REPUTATION_RECOVERED = + new CreateTestWebhookEventRequestType( + Value.SUBACCOUNT_REPUTATION_RECOVERED, "subaccount.reputation_recovered"); + + public static final CreateTestWebhookEventRequestType BILLING_BUDGET_THRESHOLD_REACHED = + new CreateTestWebhookEventRequestType( + Value.BILLING_BUDGET_THRESHOLD_REACHED, "billing.budget_threshold_reached"); + + public static final CreateTestWebhookEventRequestType CONTACT_CONFIRMED = + new CreateTestWebhookEventRequestType(Value.CONTACT_CONFIRMED, "contact.confirmed"); + + public static final CreateTestWebhookEventRequestType CONTACT_DELETED = + new CreateTestWebhookEventRequestType(Value.CONTACT_DELETED, "contact.deleted"); + + public static final CreateTestWebhookEventRequestType SMS_OPTED_IN = + new CreateTestWebhookEventRequestType(Value.SMS_OPTED_IN, "sms.opted_in"); + + public static final CreateTestWebhookEventRequestType EMAIL_COMPLAINED = + new CreateTestWebhookEventRequestType(Value.EMAIL_COMPLAINED, "email.complained"); + + public static final CreateTestWebhookEventRequestType ACCOUNT_MARKETING_PAUSED = + new CreateTestWebhookEventRequestType(Value.ACCOUNT_MARKETING_PAUSED, "account.marketing_paused"); + + public static final CreateTestWebhookEventRequestType EMAIL_FAILED = + new CreateTestWebhookEventRequestType(Value.EMAIL_FAILED, "email.failed"); + + public static final CreateTestWebhookEventRequestType BROADCAST_CANCELED = + new CreateTestWebhookEventRequestType(Value.BROADCAST_CANCELED, "broadcast.canceled"); + + public static final CreateTestWebhookEventRequestType SCHEDULING_CALENDAR_NEEDS_REAUTH = + new CreateTestWebhookEventRequestType( + Value.SCHEDULING_CALENDAR_NEEDS_REAUTH, "scheduling.calendar.needs_reauth"); + + public static final CreateTestWebhookEventRequestType EMAIL_OPENED = + new CreateTestWebhookEventRequestType(Value.EMAIL_OPENED, "email.opened"); + + public static final CreateTestWebhookEventRequestType SCHEDULING_CALENDAR_DISCONNECTED = + new CreateTestWebhookEventRequestType( + Value.SCHEDULING_CALENDAR_DISCONNECTED, "scheduling.calendar.disconnected"); + + public static final CreateTestWebhookEventRequestType SCHEDULING_OAUTH_APP_FAILING = + new CreateTestWebhookEventRequestType(Value.SCHEDULING_OAUTH_APP_FAILING, "scheduling.oauth_app.failing"); + + public static final CreateTestWebhookEventRequestType SUBACCOUNT_PAUSED = + new CreateTestWebhookEventRequestType(Value.SUBACCOUNT_PAUSED, "subaccount.paused"); + + public static final CreateTestWebhookEventRequestType SIGN_REQUEST_COMPLETED = + new CreateTestWebhookEventRequestType(Value.SIGN_REQUEST_COMPLETED, "sign_request.completed"); + + public static final CreateTestWebhookEventRequestType EMAIL_SCHEDULED = + new CreateTestWebhookEventRequestType(Value.EMAIL_SCHEDULED, "email.scheduled"); + + public static final CreateTestWebhookEventRequestType SCHEDULING_BOOKING_CANCELLED = + new CreateTestWebhookEventRequestType(Value.SCHEDULING_BOOKING_CANCELLED, "scheduling.booking.cancelled"); + + public static final CreateTestWebhookEventRequestType BILLING_HOLD_LIFTED = + new CreateTestWebhookEventRequestType(Value.BILLING_HOLD_LIFTED, "billing.hold_lifted"); + + public static final CreateTestWebhookEventRequestType EMAIL_SUPPRESSED = + new CreateTestWebhookEventRequestType(Value.EMAIL_SUPPRESSED, "email.suppressed"); + + public static final CreateTestWebhookEventRequestType EMAIL_RECEIVED = + new CreateTestWebhookEventRequestType(Value.EMAIL_RECEIVED, "email.received"); + + public static final CreateTestWebhookEventRequestType SCHEDULING_OUT_OF_OFFICE_ENDED = + new CreateTestWebhookEventRequestType( + Value.SCHEDULING_OUT_OF_OFFICE_ENDED, "scheduling.out_of_office.ended"); + + public static final CreateTestWebhookEventRequestType SCHEDULING_BOOKING_REMINDER = + new CreateTestWebhookEventRequestType(Value.SCHEDULING_BOOKING_REMINDER, "scheduling.booking.reminder"); + + public static final CreateTestWebhookEventRequestType SCHEDULING_REASSIGNMENT_COMPLETED = + new CreateTestWebhookEventRequestType( + Value.SCHEDULING_REASSIGNMENT_COMPLETED, "scheduling.reassignment.completed"); + + public static final CreateTestWebhookEventRequestType BILLING_PLAN_CHANGED = + new CreateTestWebhookEventRequestType(Value.BILLING_PLAN_CHANGED, "billing.plan_changed"); + public static final CreateTestWebhookEventRequestType SMS_SUPPRESSED = new CreateTestWebhookEventRequestType(Value.SMS_SUPPRESSED, "sms.suppressed"); - public static final CreateTestWebhookEventRequestType SIGN_REQUEST_SENT = - new CreateTestWebhookEventRequestType(Value.SIGN_REQUEST_SENT, "sign_request.sent"); + public static final CreateTestWebhookEventRequestType SCHEDULING_OUT_OF_OFFICE_UPDATED = + new CreateTestWebhookEventRequestType( + Value.SCHEDULING_OUT_OF_OFFICE_UPDATED, "scheduling.out_of_office.updated"); public static final CreateTestWebhookEventRequestType EMAIL_BOUNCED = new CreateTestWebhookEventRequestType(Value.EMAIL_BOUNCED, "email.bounced"); @@ -25,6 +150,10 @@ public final class CreateTestWebhookEventRequestType { public static final CreateTestWebhookEventRequestType SMS_OPTED_OUT = new CreateTestWebhookEventRequestType(Value.SMS_OPTED_OUT, "sms.opted_out"); + public static final CreateTestWebhookEventRequestType SCHEDULING_OUT_OF_OFFICE_STARTED = + new CreateTestWebhookEventRequestType( + Value.SCHEDULING_OUT_OF_OFFICE_STARTED, "scheduling.out_of_office.started"); + public static final CreateTestWebhookEventRequestType VERIFICATION_BLOCKED = new CreateTestWebhookEventRequestType(Value.VERIFICATION_BLOCKED, "verification.blocked"); @@ -34,12 +163,6 @@ public final class CreateTestWebhookEventRequestType { public static final CreateTestWebhookEventRequestType SMS_CANCELED = new CreateTestWebhookEventRequestType(Value.SMS_CANCELED, "sms.canceled"); - public static final CreateTestWebhookEventRequestType SUBACCOUNT_REINSTATED = - new CreateTestWebhookEventRequestType(Value.SUBACCOUNT_REINSTATED, "subaccount.reinstated"); - - public static final CreateTestWebhookEventRequestType VERIFICATION_FAILED = - new CreateTestWebhookEventRequestType(Value.VERIFICATION_FAILED, "verification.failed"); - public static final CreateTestWebhookEventRequestType FORM_SUBMISSION_RECEIVED = new CreateTestWebhookEventRequestType(Value.FORM_SUBMISSION_RECEIVED, "form.submission.received"); @@ -50,34 +173,21 @@ public final class CreateTestWebhookEventRequestType { new CreateTestWebhookEventRequestType( Value.SCHEDULING_BOOKING_LOCATION_READY, "scheduling.booking.location_ready"); - public static final CreateTestWebhookEventRequestType SCHEDULING_CALENDAR_DELEGATION_RESTORED = - new CreateTestWebhookEventRequestType( - Value.SCHEDULING_CALENDAR_DELEGATION_RESTORED, "scheduling.calendar_delegation.restored"); - public static final CreateTestWebhookEventRequestType DOMAIN_DMARC_REPORT_RECEIVED = new CreateTestWebhookEventRequestType(Value.DOMAIN_DMARC_REPORT_RECEIVED, "domain.dmarc_report_received"); public static final CreateTestWebhookEventRequestType CONTACT_UPDATED = new CreateTestWebhookEventRequestType(Value.CONTACT_UPDATED, "contact.updated"); - public static final CreateTestWebhookEventRequestType EMAIL_DELIVERY_DELAYED = - new CreateTestWebhookEventRequestType(Value.EMAIL_DELIVERY_DELAYED, "email.delivery_delayed"); - public static final CreateTestWebhookEventRequestType INBOX_MESSAGE_RECEIVED = new CreateTestWebhookEventRequestType(Value.INBOX_MESSAGE_RECEIVED, "inbox.message.received"); public static final CreateTestWebhookEventRequestType BILLING_BUDGET_HOLD_PLACED = new CreateTestWebhookEventRequestType(Value.BILLING_BUDGET_HOLD_PLACED, "billing.budget_hold_placed"); - public static final CreateTestWebhookEventRequestType BROADCAST_SENDING = - new CreateTestWebhookEventRequestType(Value.BROADCAST_SENDING, "broadcast.sending"); - public static final CreateTestWebhookEventRequestType SMS_FAILED = new CreateTestWebhookEventRequestType(Value.SMS_FAILED, "sms.failed"); - public static final CreateTestWebhookEventRequestType SMS_RECEIVED = - new CreateTestWebhookEventRequestType(Value.SMS_RECEIVED, "sms.received"); - public static final CreateTestWebhookEventRequestType SCHEDULING_CALENDAR_DELEGATION_FAILING = new CreateTestWebhookEventRequestType( Value.SCHEDULING_CALENDAR_DELEGATION_FAILING, "scheduling.calendar_delegation.failing"); @@ -91,43 +201,22 @@ public final class CreateTestWebhookEventRequestType { public static final CreateTestWebhookEventRequestType SCHEDULING_BOOKING_CREATED = new CreateTestWebhookEventRequestType(Value.SCHEDULING_BOOKING_CREATED, "scheduling.booking.created"); - public static final CreateTestWebhookEventRequestType BILLING_INVOICE_FINALIZED = - new CreateTestWebhookEventRequestType(Value.BILLING_INVOICE_FINALIZED, "billing.invoice_finalized"); - - public static final CreateTestWebhookEventRequestType SCHEDULING_BOOKING_CALENDAR_WRITE_FAILED = + public static final CreateTestWebhookEventRequestType SCHEDULING_OUT_OF_OFFICE_CREATED = new CreateTestWebhookEventRequestType( - Value.SCHEDULING_BOOKING_CALENDAR_WRITE_FAILED, "scheduling.booking.calendar_write_failed"); + Value.SCHEDULING_OUT_OF_OFFICE_CREATED, "scheduling.out_of_office.created"); - public static final CreateTestWebhookEventRequestType EMAIL_DELIVERED = - new CreateTestWebhookEventRequestType(Value.EMAIL_DELIVERED, "email.delivered"); + public static final CreateTestWebhookEventRequestType SCHEDULING_BOOKING_REASSIGNED = + new CreateTestWebhookEventRequestType(Value.SCHEDULING_BOOKING_REASSIGNED, "scheduling.booking.reassigned"); public static final CreateTestWebhookEventRequestType SMS_SCHEDULED = new CreateTestWebhookEventRequestType(Value.SMS_SCHEDULED, "sms.scheduled"); - public static final CreateTestWebhookEventRequestType BILLING_INVOICE_PAYMENT_FAILED = - new CreateTestWebhookEventRequestType( - Value.BILLING_INVOICE_PAYMENT_FAILED, "billing.invoice_payment_failed"); - public static final CreateTestWebhookEventRequestType SIGN_REQUEST_DECLINED = new CreateTestWebhookEventRequestType(Value.SIGN_REQUEST_DECLINED, "sign_request.declined"); - public static final CreateTestWebhookEventRequestType EMAIL_RESCHEDULED = - new CreateTestWebhookEventRequestType(Value.EMAIL_RESCHEDULED, "email.rescheduled"); - public static final CreateTestWebhookEventRequestType BROADCAST_PAUSED = new CreateTestWebhookEventRequestType(Value.BROADCAST_PAUSED, "broadcast.paused"); - public static final CreateTestWebhookEventRequestType EMAIL_CLICKED = - new CreateTestWebhookEventRequestType(Value.EMAIL_CLICKED, "email.clicked"); - - public static final CreateTestWebhookEventRequestType SUBACCOUNT_REPUTATION_RECOVERED = - new CreateTestWebhookEventRequestType( - Value.SUBACCOUNT_REPUTATION_RECOVERED, "subaccount.reputation_recovered"); - - public static final CreateTestWebhookEventRequestType BILLING_BUDGET_THRESHOLD_REACHED = - new CreateTestWebhookEventRequestType( - Value.BILLING_BUDGET_THRESHOLD_REACHED, "billing.budget_threshold_reached"); - public static final CreateTestWebhookEventRequestType EMAIL_SENT = new CreateTestWebhookEventRequestType(Value.EMAIL_SENT, "email.sent"); @@ -147,27 +236,15 @@ public final class CreateTestWebhookEventRequestType { public static final CreateTestWebhookEventRequestType FORM_SUBMISSION_FLAGGED = new CreateTestWebhookEventRequestType(Value.FORM_SUBMISSION_FLAGGED, "form.submission.flagged"); - public static final CreateTestWebhookEventRequestType CONTACT_CONFIRMED = - new CreateTestWebhookEventRequestType(Value.CONTACT_CONFIRMED, "contact.confirmed"); - public static final CreateTestWebhookEventRequestType BILLING_INVOICE_PAID = new CreateTestWebhookEventRequestType(Value.BILLING_INVOICE_PAID, "billing.invoice_paid"); public static final CreateTestWebhookEventRequestType CONTACT_UNSUBSCRIBED = new CreateTestWebhookEventRequestType(Value.CONTACT_UNSUBSCRIBED, "contact.unsubscribed"); - public static final CreateTestWebhookEventRequestType CONTACT_DELETED = - new CreateTestWebhookEventRequestType(Value.CONTACT_DELETED, "contact.deleted"); - - public static final CreateTestWebhookEventRequestType SMS_OPTED_IN = - new CreateTestWebhookEventRequestType(Value.SMS_OPTED_IN, "sms.opted_in"); - public static final CreateTestWebhookEventRequestType SCHEDULING_BOOKING_CONFIRMED = new CreateTestWebhookEventRequestType(Value.SCHEDULING_BOOKING_CONFIRMED, "scheduling.booking.confirmed"); - public static final CreateTestWebhookEventRequestType EMAIL_COMPLAINED = - new CreateTestWebhookEventRequestType(Value.EMAIL_COMPLAINED, "email.complained"); - public static final CreateTestWebhookEventRequestType SCHEDULING_BOOKING_NO_SHOW = new CreateTestWebhookEventRequestType(Value.SCHEDULING_BOOKING_NO_SHOW, "scheduling.booking.no_show"); @@ -181,31 +258,18 @@ public final class CreateTestWebhookEventRequestType { public static final CreateTestWebhookEventRequestType SIGN_REQUEST_EXPIRED = new CreateTestWebhookEventRequestType(Value.SIGN_REQUEST_EXPIRED, "sign_request.expired"); - public static final CreateTestWebhookEventRequestType ACCOUNT_MARKETING_PAUSED = - new CreateTestWebhookEventRequestType(Value.ACCOUNT_MARKETING_PAUSED, "account.marketing_paused"); - public static final CreateTestWebhookEventRequestType ACCOUNT_REPUTATION_WARNING = new CreateTestWebhookEventRequestType(Value.ACCOUNT_REPUTATION_WARNING, "account.reputation_warning"); - public static final CreateTestWebhookEventRequestType EMAIL_FAILED = - new CreateTestWebhookEventRequestType(Value.EMAIL_FAILED, "email.failed"); - public static final CreateTestWebhookEventRequestType ACCOUNT_MARKETING_REINSTATED = new CreateTestWebhookEventRequestType(Value.ACCOUNT_MARKETING_REINSTATED, "account.marketing_reinstated"); - public static final CreateTestWebhookEventRequestType BROADCAST_CANCELED = - new CreateTestWebhookEventRequestType(Value.BROADCAST_CANCELED, "broadcast.canceled"); - public static final CreateTestWebhookEventRequestType BILLING_CREDIT_GRANTED = new CreateTestWebhookEventRequestType(Value.BILLING_CREDIT_GRANTED, "billing.credit_granted"); public static final CreateTestWebhookEventRequestType BILLING_BUDGET_HOLD_LIFTED = new CreateTestWebhookEventRequestType(Value.BILLING_BUDGET_HOLD_LIFTED, "billing.budget_hold_lifted"); - public static final CreateTestWebhookEventRequestType SCHEDULING_CALENDAR_NEEDS_REAUTH = - new CreateTestWebhookEventRequestType( - Value.SCHEDULING_CALENDAR_NEEDS_REAUTH, "scheduling.calendar.needs_reauth"); - public static final CreateTestWebhookEventRequestType RISK_ASSESSMENT_REVIEWED = new CreateTestWebhookEventRequestType(Value.RISK_ASSESSMENT_REVIEWED, "risk.assessment.reviewed"); @@ -219,19 +283,12 @@ public final class CreateTestWebhookEventRequestType { public static final CreateTestWebhookEventRequestType ACCOUNT_REINSTATED = new CreateTestWebhookEventRequestType(Value.ACCOUNT_REINSTATED, "account.reinstated"); - public static final CreateTestWebhookEventRequestType EMAIL_OPENED = - new CreateTestWebhookEventRequestType(Value.EMAIL_OPENED, "email.opened"); - public static final CreateTestWebhookEventRequestType SIGN_REQUEST_SIGNER_SIGNED = new CreateTestWebhookEventRequestType(Value.SIGN_REQUEST_SIGNER_SIGNED, "sign_request.signer_signed"); public static final CreateTestWebhookEventRequestType EMAIL_CANCELED = new CreateTestWebhookEventRequestType(Value.EMAIL_CANCELED, "email.canceled"); - public static final CreateTestWebhookEventRequestType SCHEDULING_CALENDAR_DISCONNECTED = - new CreateTestWebhookEventRequestType( - Value.SCHEDULING_CALENDAR_DISCONNECTED, "scheduling.calendar.disconnected"); - public static final CreateTestWebhookEventRequestType SMS_DELIVERED = new CreateTestWebhookEventRequestType(Value.SMS_DELIVERED, "sms.delivered"); @@ -244,18 +301,9 @@ public final class CreateTestWebhookEventRequestType { public static final CreateTestWebhookEventRequestType SCHEDULING_BOOKING_DECLINED = new CreateTestWebhookEventRequestType(Value.SCHEDULING_BOOKING_DECLINED, "scheduling.booking.declined"); - public static final CreateTestWebhookEventRequestType SUBACCOUNT_PAUSED = - new CreateTestWebhookEventRequestType(Value.SUBACCOUNT_PAUSED, "subaccount.paused"); - - public static final CreateTestWebhookEventRequestType SIGN_REQUEST_COMPLETED = - new CreateTestWebhookEventRequestType(Value.SIGN_REQUEST_COMPLETED, "sign_request.completed"); - public static final CreateTestWebhookEventRequestType RISK_ASSESSMENT_REVIEW = new CreateTestWebhookEventRequestType(Value.RISK_ASSESSMENT_REVIEW, "risk.assessment.review"); - public static final CreateTestWebhookEventRequestType EMAIL_SCHEDULED = - new CreateTestWebhookEventRequestType(Value.EMAIL_SCHEDULED, "email.scheduled"); - public static final CreateTestWebhookEventRequestType SCHEDULING_BOOKING_RESCHEDULED = new CreateTestWebhookEventRequestType( Value.SCHEDULING_BOOKING_RESCHEDULED, "scheduling.booking.rescheduled"); @@ -266,24 +314,9 @@ public final class CreateTestWebhookEventRequestType { public static final CreateTestWebhookEventRequestType HOOK_ENDPOINT_DISABLED = new CreateTestWebhookEventRequestType(Value.HOOK_ENDPOINT_DISABLED, "hook_endpoint.disabled"); - public static final CreateTestWebhookEventRequestType SCHEDULING_BOOKING_CANCELLED = - new CreateTestWebhookEventRequestType(Value.SCHEDULING_BOOKING_CANCELLED, "scheduling.booking.cancelled"); - - public static final CreateTestWebhookEventRequestType BILLING_HOLD_LIFTED = - new CreateTestWebhookEventRequestType(Value.BILLING_HOLD_LIFTED, "billing.hold_lifted"); - - public static final CreateTestWebhookEventRequestType EMAIL_SUPPRESSED = - new CreateTestWebhookEventRequestType(Value.EMAIL_SUPPRESSED, "email.suppressed"); - public static final CreateTestWebhookEventRequestType BILLING_HOLD_PLACED = new CreateTestWebhookEventRequestType(Value.BILLING_HOLD_PLACED, "billing.hold_placed"); - public static final CreateTestWebhookEventRequestType EMAIL_RECEIVED = - new CreateTestWebhookEventRequestType(Value.EMAIL_RECEIVED, "email.received"); - - public static final CreateTestWebhookEventRequestType SCHEDULING_BOOKING_REMINDER = - new CreateTestWebhookEventRequestType(Value.SCHEDULING_BOOKING_REMINDER, "scheduling.booking.reminder"); - public static final CreateTestWebhookEventRequestType SCHEDULING_CALENDAR_CONNECTED = new CreateTestWebhookEventRequestType(Value.SCHEDULING_CALENDAR_CONNECTED, "scheduling.calendar.connected"); @@ -326,52 +359,118 @@ public int hashCode() { public T visit(Visitor visitor) { switch (value) { + case BILLING_INVOICE_VOIDED: + return visitor.visitBillingInvoiceVoided(); + case SIGN_REQUEST_SENT: + return visitor.visitSignRequestSent(); + case SCHEDULING_OAUTH_APP_RESTORED: + return visitor.visitSchedulingOauthAppRestored(); + case SUBACCOUNT_REINSTATED: + return visitor.visitSubaccountReinstated(); + case VERIFICATION_FAILED: + return visitor.visitVerificationFailed(); + case SCHEDULING_OUT_OF_OFFICE_DELETED: + return visitor.visitSchedulingOutOfOfficeDeleted(); + case SCHEDULING_CALENDAR_DELEGATION_RESTORED: + return visitor.visitSchedulingCalendarDelegationRestored(); + case EMAIL_DELIVERY_DELAYED: + return visitor.visitEmailDeliveryDelayed(); + case BROADCAST_SENDING: + return visitor.visitBroadcastSending(); + case SMS_RECEIVED: + return visitor.visitSmsReceived(); + case BILLING_INVOICE_FINALIZED: + return visitor.visitBillingInvoiceFinalized(); + case SCHEDULING_BOOKING_CALENDAR_WRITE_FAILED: + return visitor.visitSchedulingBookingCalendarWriteFailed(); + case EMAIL_DELIVERED: + return visitor.visitEmailDelivered(); + case BILLING_INVOICE_PAYMENT_FAILED: + return visitor.visitBillingInvoicePaymentFailed(); + case EMAIL_RESCHEDULED: + return visitor.visitEmailRescheduled(); + case EMAIL_CLICKED: + return visitor.visitEmailClicked(); + case SUBACCOUNT_REPUTATION_RECOVERED: + return visitor.visitSubaccountReputationRecovered(); + case BILLING_BUDGET_THRESHOLD_REACHED: + return visitor.visitBillingBudgetThresholdReached(); + case CONTACT_CONFIRMED: + return visitor.visitContactConfirmed(); + case CONTACT_DELETED: + return visitor.visitContactDeleted(); + case SMS_OPTED_IN: + return visitor.visitSmsOptedIn(); + case EMAIL_COMPLAINED: + return visitor.visitEmailComplained(); + case ACCOUNT_MARKETING_PAUSED: + return visitor.visitAccountMarketingPaused(); + case EMAIL_FAILED: + return visitor.visitEmailFailed(); + case BROADCAST_CANCELED: + return visitor.visitBroadcastCanceled(); + case SCHEDULING_CALENDAR_NEEDS_REAUTH: + return visitor.visitSchedulingCalendarNeedsReauth(); + case EMAIL_OPENED: + return visitor.visitEmailOpened(); + case SCHEDULING_CALENDAR_DISCONNECTED: + return visitor.visitSchedulingCalendarDisconnected(); + case SCHEDULING_OAUTH_APP_FAILING: + return visitor.visitSchedulingOauthAppFailing(); + case SUBACCOUNT_PAUSED: + return visitor.visitSubaccountPaused(); + case SIGN_REQUEST_COMPLETED: + return visitor.visitSignRequestCompleted(); + case EMAIL_SCHEDULED: + return visitor.visitEmailScheduled(); + case SCHEDULING_BOOKING_CANCELLED: + return visitor.visitSchedulingBookingCancelled(); + case BILLING_HOLD_LIFTED: + return visitor.visitBillingHoldLifted(); + case EMAIL_SUPPRESSED: + return visitor.visitEmailSuppressed(); + case EMAIL_RECEIVED: + return visitor.visitEmailReceived(); + case SCHEDULING_OUT_OF_OFFICE_ENDED: + return visitor.visitSchedulingOutOfOfficeEnded(); + case SCHEDULING_BOOKING_REMINDER: + return visitor.visitSchedulingBookingReminder(); + case SCHEDULING_REASSIGNMENT_COMPLETED: + return visitor.visitSchedulingReassignmentCompleted(); case BILLING_PLAN_CHANGED: return visitor.visitBillingPlanChanged(); - case BILLING_INVOICE_VOIDED: - return visitor.visitBillingInvoiceVoided(); case SMS_SUPPRESSED: return visitor.visitSmsSuppressed(); - case SIGN_REQUEST_SENT: - return visitor.visitSignRequestSent(); + case SCHEDULING_OUT_OF_OFFICE_UPDATED: + return visitor.visitSchedulingOutOfOfficeUpdated(); case EMAIL_BOUNCED: return visitor.visitEmailBounced(); case SMS_OPTED_OUT: return visitor.visitSmsOptedOut(); + case SCHEDULING_OUT_OF_OFFICE_STARTED: + return visitor.visitSchedulingOutOfOfficeStarted(); case VERIFICATION_BLOCKED: return visitor.visitVerificationBlocked(); case CONTACT_CREATED: return visitor.visitContactCreated(); case SMS_CANCELED: return visitor.visitSmsCanceled(); - case SUBACCOUNT_REINSTATED: - return visitor.visitSubaccountReinstated(); - case VERIFICATION_FAILED: - return visitor.visitVerificationFailed(); case FORM_SUBMISSION_RECEIVED: return visitor.visitFormSubmissionReceived(); case ACCOUNT_REPUTATION_RECOVERED: return visitor.visitAccountReputationRecovered(); case SCHEDULING_BOOKING_LOCATION_READY: return visitor.visitSchedulingBookingLocationReady(); - case SCHEDULING_CALENDAR_DELEGATION_RESTORED: - return visitor.visitSchedulingCalendarDelegationRestored(); case DOMAIN_DMARC_REPORT_RECEIVED: return visitor.visitDomainDmarcReportReceived(); case CONTACT_UPDATED: return visitor.visitContactUpdated(); - case EMAIL_DELIVERY_DELAYED: - return visitor.visitEmailDeliveryDelayed(); case INBOX_MESSAGE_RECEIVED: return visitor.visitInboxMessageReceived(); case BILLING_BUDGET_HOLD_PLACED: return visitor.visitBillingBudgetHoldPlaced(); - case BROADCAST_SENDING: - return visitor.visitBroadcastSending(); case SMS_FAILED: return visitor.visitSmsFailed(); - case SMS_RECEIVED: - return visitor.visitSmsReceived(); case SCHEDULING_CALENDAR_DELEGATION_FAILING: return visitor.visitSchedulingCalendarDelegationFailing(); case SUBACCOUNT_REPUTATION_WARNING: @@ -380,28 +479,16 @@ public T visit(Visitor visitor) { return visitor.visitSmsUndelivered(); case SCHEDULING_BOOKING_CREATED: return visitor.visitSchedulingBookingCreated(); - case BILLING_INVOICE_FINALIZED: - return visitor.visitBillingInvoiceFinalized(); - case SCHEDULING_BOOKING_CALENDAR_WRITE_FAILED: - return visitor.visitSchedulingBookingCalendarWriteFailed(); - case EMAIL_DELIVERED: - return visitor.visitEmailDelivered(); + case SCHEDULING_OUT_OF_OFFICE_CREATED: + return visitor.visitSchedulingOutOfOfficeCreated(); + case SCHEDULING_BOOKING_REASSIGNED: + return visitor.visitSchedulingBookingReassigned(); case SMS_SCHEDULED: return visitor.visitSmsScheduled(); - case BILLING_INVOICE_PAYMENT_FAILED: - return visitor.visitBillingInvoicePaymentFailed(); case SIGN_REQUEST_DECLINED: return visitor.visitSignRequestDeclined(); - case EMAIL_RESCHEDULED: - return visitor.visitEmailRescheduled(); case BROADCAST_PAUSED: return visitor.visitBroadcastPaused(); - case EMAIL_CLICKED: - return visitor.visitEmailClicked(); - case SUBACCOUNT_REPUTATION_RECOVERED: - return visitor.visitSubaccountReputationRecovered(); - case BILLING_BUDGET_THRESHOLD_REACHED: - return visitor.visitBillingBudgetThresholdReached(); case EMAIL_SENT: return visitor.visitEmailSent(); case SCHEDULING_BOOKING_EXTERNAL_CONFLICT: @@ -414,20 +501,12 @@ public T visit(Visitor visitor) { return visitor.visitVerificationApproved(); case FORM_SUBMISSION_FLAGGED: return visitor.visitFormSubmissionFlagged(); - case CONTACT_CONFIRMED: - return visitor.visitContactConfirmed(); case BILLING_INVOICE_PAID: return visitor.visitBillingInvoicePaid(); case CONTACT_UNSUBSCRIBED: return visitor.visitContactUnsubscribed(); - case CONTACT_DELETED: - return visitor.visitContactDeleted(); - case SMS_OPTED_IN: - return visitor.visitSmsOptedIn(); case SCHEDULING_BOOKING_CONFIRMED: return visitor.visitSchedulingBookingConfirmed(); - case EMAIL_COMPLAINED: - return visitor.visitEmailComplained(); case SCHEDULING_BOOKING_NO_SHOW: return visitor.visitSchedulingBookingNoShow(); case SCHEDULING_BOOKING_STARTED: @@ -436,22 +515,14 @@ public T visit(Visitor visitor) { return visitor.visitBillingUsageThresholdReached(); case SIGN_REQUEST_EXPIRED: return visitor.visitSignRequestExpired(); - case ACCOUNT_MARKETING_PAUSED: - return visitor.visitAccountMarketingPaused(); case ACCOUNT_REPUTATION_WARNING: return visitor.visitAccountReputationWarning(); - case EMAIL_FAILED: - return visitor.visitEmailFailed(); case ACCOUNT_MARKETING_REINSTATED: return visitor.visitAccountMarketingReinstated(); - case BROADCAST_CANCELED: - return visitor.visitBroadcastCanceled(); case BILLING_CREDIT_GRANTED: return visitor.visitBillingCreditGranted(); case BILLING_BUDGET_HOLD_LIFTED: return visitor.visitBillingBudgetHoldLifted(); - case SCHEDULING_CALENDAR_NEEDS_REAUTH: - return visitor.visitSchedulingCalendarNeedsReauth(); case RISK_ASSESSMENT_REVIEWED: return visitor.visitRiskAssessmentReviewed(); case SMS_SENT: @@ -460,14 +531,10 @@ public T visit(Visitor visitor) { return visitor.visitSchedulingBookingPendingApproval(); case ACCOUNT_REINSTATED: return visitor.visitAccountReinstated(); - case EMAIL_OPENED: - return visitor.visitEmailOpened(); case SIGN_REQUEST_SIGNER_SIGNED: return visitor.visitSignRequestSignerSigned(); case EMAIL_CANCELED: return visitor.visitEmailCanceled(); - case SCHEDULING_CALENDAR_DISCONNECTED: - return visitor.visitSchedulingCalendarDisconnected(); case SMS_DELIVERED: return visitor.visitSmsDelivered(); case SIGN_REQUEST_VIEWED: @@ -476,32 +543,16 @@ public T visit(Visitor visitor) { return visitor.visitEmailUnsubscribed(); case SCHEDULING_BOOKING_DECLINED: return visitor.visitSchedulingBookingDeclined(); - case SUBACCOUNT_PAUSED: - return visitor.visitSubaccountPaused(); - case SIGN_REQUEST_COMPLETED: - return visitor.visitSignRequestCompleted(); case RISK_ASSESSMENT_REVIEW: return visitor.visitRiskAssessmentReview(); - case EMAIL_SCHEDULED: - return visitor.visitEmailScheduled(); case SCHEDULING_BOOKING_RESCHEDULED: return visitor.visitSchedulingBookingRescheduled(); case SCHEDULING_BOOKING_ENDED: return visitor.visitSchedulingBookingEnded(); case HOOK_ENDPOINT_DISABLED: return visitor.visitHookEndpointDisabled(); - case SCHEDULING_BOOKING_CANCELLED: - return visitor.visitSchedulingBookingCancelled(); - case BILLING_HOLD_LIFTED: - return visitor.visitBillingHoldLifted(); - case EMAIL_SUPPRESSED: - return visitor.visitEmailSuppressed(); case BILLING_HOLD_PLACED: return visitor.visitBillingHoldPlaced(); - case EMAIL_RECEIVED: - return visitor.visitEmailReceived(); - case SCHEDULING_BOOKING_REMINDER: - return visitor.visitSchedulingBookingReminder(); case SCHEDULING_CALENDAR_CONNECTED: return visitor.visitSchedulingCalendarConnected(); case ACCOUNT_SUSPENDED: @@ -517,52 +568,118 @@ public T visit(Visitor visitor) { @JsonCreator(mode = JsonCreator.Mode.DELEGATING) public static CreateTestWebhookEventRequestType valueOf(String value) { switch (value) { - case "billing.plan_changed": - return BILLING_PLAN_CHANGED; case "billing.invoice_voided": return BILLING_INVOICE_VOIDED; - case "sms.suppressed": - return SMS_SUPPRESSED; case "sign_request.sent": return SIGN_REQUEST_SENT; + case "scheduling.oauth_app.restored": + return SCHEDULING_OAUTH_APP_RESTORED; + case "subaccount.reinstated": + return SUBACCOUNT_REINSTATED; + case "verification.failed": + return VERIFICATION_FAILED; + case "scheduling.out_of_office.deleted": + return SCHEDULING_OUT_OF_OFFICE_DELETED; + case "scheduling.calendar_delegation.restored": + return SCHEDULING_CALENDAR_DELEGATION_RESTORED; + case "email.delivery_delayed": + return EMAIL_DELIVERY_DELAYED; + case "broadcast.sending": + return BROADCAST_SENDING; + case "sms.received": + return SMS_RECEIVED; + case "billing.invoice_finalized": + return BILLING_INVOICE_FINALIZED; + case "scheduling.booking.calendar_write_failed": + return SCHEDULING_BOOKING_CALENDAR_WRITE_FAILED; + case "email.delivered": + return EMAIL_DELIVERED; + case "billing.invoice_payment_failed": + return BILLING_INVOICE_PAYMENT_FAILED; + case "email.rescheduled": + return EMAIL_RESCHEDULED; + case "email.clicked": + return EMAIL_CLICKED; + case "subaccount.reputation_recovered": + return SUBACCOUNT_REPUTATION_RECOVERED; + case "billing.budget_threshold_reached": + return BILLING_BUDGET_THRESHOLD_REACHED; + case "contact.confirmed": + return CONTACT_CONFIRMED; + case "contact.deleted": + return CONTACT_DELETED; + case "sms.opted_in": + return SMS_OPTED_IN; + case "email.complained": + return EMAIL_COMPLAINED; + case "account.marketing_paused": + return ACCOUNT_MARKETING_PAUSED; + case "email.failed": + return EMAIL_FAILED; + case "broadcast.canceled": + return BROADCAST_CANCELED; + case "scheduling.calendar.needs_reauth": + return SCHEDULING_CALENDAR_NEEDS_REAUTH; + case "email.opened": + return EMAIL_OPENED; + case "scheduling.calendar.disconnected": + return SCHEDULING_CALENDAR_DISCONNECTED; + case "scheduling.oauth_app.failing": + return SCHEDULING_OAUTH_APP_FAILING; + case "subaccount.paused": + return SUBACCOUNT_PAUSED; + case "sign_request.completed": + return SIGN_REQUEST_COMPLETED; + case "email.scheduled": + return EMAIL_SCHEDULED; + case "scheduling.booking.cancelled": + return SCHEDULING_BOOKING_CANCELLED; + case "billing.hold_lifted": + return BILLING_HOLD_LIFTED; + case "email.suppressed": + return EMAIL_SUPPRESSED; + case "email.received": + return EMAIL_RECEIVED; + case "scheduling.out_of_office.ended": + return SCHEDULING_OUT_OF_OFFICE_ENDED; + case "scheduling.booking.reminder": + return SCHEDULING_BOOKING_REMINDER; + case "scheduling.reassignment.completed": + return SCHEDULING_REASSIGNMENT_COMPLETED; + case "billing.plan_changed": + return BILLING_PLAN_CHANGED; + case "sms.suppressed": + return SMS_SUPPRESSED; + case "scheduling.out_of_office.updated": + return SCHEDULING_OUT_OF_OFFICE_UPDATED; case "email.bounced": return EMAIL_BOUNCED; case "sms.opted_out": return SMS_OPTED_OUT; + case "scheduling.out_of_office.started": + return SCHEDULING_OUT_OF_OFFICE_STARTED; case "verification.blocked": return VERIFICATION_BLOCKED; case "contact.created": return CONTACT_CREATED; case "sms.canceled": return SMS_CANCELED; - case "subaccount.reinstated": - return SUBACCOUNT_REINSTATED; - case "verification.failed": - return VERIFICATION_FAILED; case "form.submission.received": return FORM_SUBMISSION_RECEIVED; case "account.reputation_recovered": return ACCOUNT_REPUTATION_RECOVERED; case "scheduling.booking.location_ready": return SCHEDULING_BOOKING_LOCATION_READY; - case "scheduling.calendar_delegation.restored": - return SCHEDULING_CALENDAR_DELEGATION_RESTORED; case "domain.dmarc_report_received": return DOMAIN_DMARC_REPORT_RECEIVED; case "contact.updated": return CONTACT_UPDATED; - case "email.delivery_delayed": - return EMAIL_DELIVERY_DELAYED; case "inbox.message.received": return INBOX_MESSAGE_RECEIVED; case "billing.budget_hold_placed": return BILLING_BUDGET_HOLD_PLACED; - case "broadcast.sending": - return BROADCAST_SENDING; case "sms.failed": return SMS_FAILED; - case "sms.received": - return SMS_RECEIVED; case "scheduling.calendar_delegation.failing": return SCHEDULING_CALENDAR_DELEGATION_FAILING; case "subaccount.reputation_warning": @@ -571,28 +688,16 @@ public static CreateTestWebhookEventRequestType valueOf(String value) { return SMS_UNDELIVERED; case "scheduling.booking.created": return SCHEDULING_BOOKING_CREATED; - case "billing.invoice_finalized": - return BILLING_INVOICE_FINALIZED; - case "scheduling.booking.calendar_write_failed": - return SCHEDULING_BOOKING_CALENDAR_WRITE_FAILED; - case "email.delivered": - return EMAIL_DELIVERED; + case "scheduling.out_of_office.created": + return SCHEDULING_OUT_OF_OFFICE_CREATED; + case "scheduling.booking.reassigned": + return SCHEDULING_BOOKING_REASSIGNED; case "sms.scheduled": return SMS_SCHEDULED; - case "billing.invoice_payment_failed": - return BILLING_INVOICE_PAYMENT_FAILED; case "sign_request.declined": return SIGN_REQUEST_DECLINED; - case "email.rescheduled": - return EMAIL_RESCHEDULED; case "broadcast.paused": return BROADCAST_PAUSED; - case "email.clicked": - return EMAIL_CLICKED; - case "subaccount.reputation_recovered": - return SUBACCOUNT_REPUTATION_RECOVERED; - case "billing.budget_threshold_reached": - return BILLING_BUDGET_THRESHOLD_REACHED; case "email.sent": return EMAIL_SENT; case "scheduling.booking.external_conflict": @@ -605,20 +710,12 @@ public static CreateTestWebhookEventRequestType valueOf(String value) { return VERIFICATION_APPROVED; case "form.submission.flagged": return FORM_SUBMISSION_FLAGGED; - case "contact.confirmed": - return CONTACT_CONFIRMED; case "billing.invoice_paid": return BILLING_INVOICE_PAID; case "contact.unsubscribed": return CONTACT_UNSUBSCRIBED; - case "contact.deleted": - return CONTACT_DELETED; - case "sms.opted_in": - return SMS_OPTED_IN; case "scheduling.booking.confirmed": return SCHEDULING_BOOKING_CONFIRMED; - case "email.complained": - return EMAIL_COMPLAINED; case "scheduling.booking.no_show": return SCHEDULING_BOOKING_NO_SHOW; case "scheduling.booking.started": @@ -627,22 +724,14 @@ public static CreateTestWebhookEventRequestType valueOf(String value) { return BILLING_USAGE_THRESHOLD_REACHED; case "sign_request.expired": return SIGN_REQUEST_EXPIRED; - case "account.marketing_paused": - return ACCOUNT_MARKETING_PAUSED; case "account.reputation_warning": return ACCOUNT_REPUTATION_WARNING; - case "email.failed": - return EMAIL_FAILED; case "account.marketing_reinstated": return ACCOUNT_MARKETING_REINSTATED; - case "broadcast.canceled": - return BROADCAST_CANCELED; case "billing.credit_granted": return BILLING_CREDIT_GRANTED; case "billing.budget_hold_lifted": return BILLING_BUDGET_HOLD_LIFTED; - case "scheduling.calendar.needs_reauth": - return SCHEDULING_CALENDAR_NEEDS_REAUTH; case "risk.assessment.reviewed": return RISK_ASSESSMENT_REVIEWED; case "sms.sent": @@ -651,14 +740,10 @@ public static CreateTestWebhookEventRequestType valueOf(String value) { return SCHEDULING_BOOKING_PENDING_APPROVAL; case "account.reinstated": return ACCOUNT_REINSTATED; - case "email.opened": - return EMAIL_OPENED; case "sign_request.signer_signed": return SIGN_REQUEST_SIGNER_SIGNED; case "email.canceled": return EMAIL_CANCELED; - case "scheduling.calendar.disconnected": - return SCHEDULING_CALENDAR_DISCONNECTED; case "sms.delivered": return SMS_DELIVERED; case "sign_request.viewed": @@ -667,32 +752,16 @@ public static CreateTestWebhookEventRequestType valueOf(String value) { return EMAIL_UNSUBSCRIBED; case "scheduling.booking.declined": return SCHEDULING_BOOKING_DECLINED; - case "subaccount.paused": - return SUBACCOUNT_PAUSED; - case "sign_request.completed": - return SIGN_REQUEST_COMPLETED; case "risk.assessment.review": return RISK_ASSESSMENT_REVIEW; - case "email.scheduled": - return EMAIL_SCHEDULED; case "scheduling.booking.rescheduled": return SCHEDULING_BOOKING_RESCHEDULED; case "scheduling.booking.ended": return SCHEDULING_BOOKING_ENDED; case "hook_endpoint.disabled": return HOOK_ENDPOINT_DISABLED; - case "scheduling.booking.cancelled": - return SCHEDULING_BOOKING_CANCELLED; - case "billing.hold_lifted": - return BILLING_HOLD_LIFTED; - case "email.suppressed": - return EMAIL_SUPPRESSED; case "billing.hold_placed": return BILLING_HOLD_PLACED; - case "email.received": - return EMAIL_RECEIVED; - case "scheduling.booking.reminder": - return SCHEDULING_BOOKING_REMINDER; case "scheduling.calendar.connected": return SCHEDULING_CALENDAR_CONNECTED; case "account.suspended": @@ -871,6 +940,8 @@ public enum Value { SCHEDULING_BOOKING_LOCATION_READY, + SCHEDULING_BOOKING_REASSIGNED, + SCHEDULING_BOOKING_STARTED, SCHEDULING_BOOKING_ENDED, @@ -887,6 +958,22 @@ public enum Value { SCHEDULING_CALENDAR_DELEGATION_RESTORED, + SCHEDULING_OUT_OF_OFFICE_CREATED, + + SCHEDULING_OUT_OF_OFFICE_UPDATED, + + SCHEDULING_OUT_OF_OFFICE_DELETED, + + SCHEDULING_OUT_OF_OFFICE_STARTED, + + SCHEDULING_OUT_OF_OFFICE_ENDED, + + SCHEDULING_REASSIGNMENT_COMPLETED, + + SCHEDULING_OAUTH_APP_FAILING, + + SCHEDULING_OAUTH_APP_RESTORED, + UNKNOWN } @@ -1057,6 +1144,8 @@ public interface Visitor { T visitSchedulingBookingLocationReady(); + T visitSchedulingBookingReassigned(); + T visitSchedulingBookingStarted(); T visitSchedulingBookingEnded(); @@ -1073,6 +1162,22 @@ public interface Visitor { T visitSchedulingCalendarDelegationRestored(); + T visitSchedulingOutOfOfficeCreated(); + + T visitSchedulingOutOfOfficeUpdated(); + + T visitSchedulingOutOfOfficeDeleted(); + + T visitSchedulingOutOfOfficeStarted(); + + T visitSchedulingOutOfOfficeEnded(); + + T visitSchedulingReassignmentCompleted(); + + T visitSchedulingOauthAppFailing(); + + T visitSchedulingOauthAppRestored(); + T visitUnknown(String unknownType); } } diff --git a/sdks/java/src/main/java/com/coss/resources/webhooklisteners/types/CreateWebhookListenerRequestEventTypesItem.java b/sdks/java/src/main/java/com/coss/resources/webhooklisteners/types/CreateWebhookListenerRequestEventTypesItem.java index 3be5411cb..cf360f24e 100644 --- a/sdks/java/src/main/java/com/coss/resources/webhooklisteners/types/CreateWebhookListenerRequestEventTypesItem.java +++ b/sdks/java/src/main/java/com/coss/resources/webhooklisteners/types/CreateWebhookListenerRequestEventTypesItem.java @@ -7,17 +7,147 @@ import com.fasterxml.jackson.annotation.JsonValue; public final class CreateWebhookListenerRequestEventTypesItem { - public static final CreateWebhookListenerRequestEventTypesItem BILLING_PLAN_CHANGED = - new CreateWebhookListenerRequestEventTypesItem(Value.BILLING_PLAN_CHANGED, "billing.plan_changed"); - public static final CreateWebhookListenerRequestEventTypesItem BILLING_INVOICE_VOIDED = new CreateWebhookListenerRequestEventTypesItem(Value.BILLING_INVOICE_VOIDED, "billing.invoice_voided"); + public static final CreateWebhookListenerRequestEventTypesItem SIGN_REQUEST_SENT = + new CreateWebhookListenerRequestEventTypesItem(Value.SIGN_REQUEST_SENT, "sign_request.sent"); + + public static final CreateWebhookListenerRequestEventTypesItem SCHEDULING_OAUTH_APP_RESTORED = + new CreateWebhookListenerRequestEventTypesItem( + Value.SCHEDULING_OAUTH_APP_RESTORED, "scheduling.oauth_app.restored"); + + public static final CreateWebhookListenerRequestEventTypesItem SUBACCOUNT_REINSTATED = + new CreateWebhookListenerRequestEventTypesItem(Value.SUBACCOUNT_REINSTATED, "subaccount.reinstated"); + + public static final CreateWebhookListenerRequestEventTypesItem VERIFICATION_FAILED = + new CreateWebhookListenerRequestEventTypesItem(Value.VERIFICATION_FAILED, "verification.failed"); + + public static final CreateWebhookListenerRequestEventTypesItem SCHEDULING_OUT_OF_OFFICE_DELETED = + new CreateWebhookListenerRequestEventTypesItem( + Value.SCHEDULING_OUT_OF_OFFICE_DELETED, "scheduling.out_of_office.deleted"); + + public static final CreateWebhookListenerRequestEventTypesItem SCHEDULING_CALENDAR_DELEGATION_RESTORED = + new CreateWebhookListenerRequestEventTypesItem( + Value.SCHEDULING_CALENDAR_DELEGATION_RESTORED, "scheduling.calendar_delegation.restored"); + + public static final CreateWebhookListenerRequestEventTypesItem EMAIL_DELIVERY_DELAYED = + new CreateWebhookListenerRequestEventTypesItem(Value.EMAIL_DELIVERY_DELAYED, "email.delivery_delayed"); + + public static final CreateWebhookListenerRequestEventTypesItem BROADCAST_SENDING = + new CreateWebhookListenerRequestEventTypesItem(Value.BROADCAST_SENDING, "broadcast.sending"); + + public static final CreateWebhookListenerRequestEventTypesItem SMS_RECEIVED = + new CreateWebhookListenerRequestEventTypesItem(Value.SMS_RECEIVED, "sms.received"); + + public static final CreateWebhookListenerRequestEventTypesItem BILLING_INVOICE_FINALIZED = + new CreateWebhookListenerRequestEventTypesItem( + Value.BILLING_INVOICE_FINALIZED, "billing.invoice_finalized"); + + public static final CreateWebhookListenerRequestEventTypesItem SCHEDULING_BOOKING_CALENDAR_WRITE_FAILED = + new CreateWebhookListenerRequestEventTypesItem( + Value.SCHEDULING_BOOKING_CALENDAR_WRITE_FAILED, "scheduling.booking.calendar_write_failed"); + + public static final CreateWebhookListenerRequestEventTypesItem EMAIL_DELIVERED = + new CreateWebhookListenerRequestEventTypesItem(Value.EMAIL_DELIVERED, "email.delivered"); + + public static final CreateWebhookListenerRequestEventTypesItem BILLING_INVOICE_PAYMENT_FAILED = + new CreateWebhookListenerRequestEventTypesItem( + Value.BILLING_INVOICE_PAYMENT_FAILED, "billing.invoice_payment_failed"); + + public static final CreateWebhookListenerRequestEventTypesItem EMAIL_RESCHEDULED = + new CreateWebhookListenerRequestEventTypesItem(Value.EMAIL_RESCHEDULED, "email.rescheduled"); + + public static final CreateWebhookListenerRequestEventTypesItem EMAIL_CLICKED = + new CreateWebhookListenerRequestEventTypesItem(Value.EMAIL_CLICKED, "email.clicked"); + + public static final CreateWebhookListenerRequestEventTypesItem SUBACCOUNT_REPUTATION_RECOVERED = + new CreateWebhookListenerRequestEventTypesItem( + Value.SUBACCOUNT_REPUTATION_RECOVERED, "subaccount.reputation_recovered"); + + public static final CreateWebhookListenerRequestEventTypesItem BILLING_BUDGET_THRESHOLD_REACHED = + new CreateWebhookListenerRequestEventTypesItem( + Value.BILLING_BUDGET_THRESHOLD_REACHED, "billing.budget_threshold_reached"); + + public static final CreateWebhookListenerRequestEventTypesItem CONTACT_CONFIRMED = + new CreateWebhookListenerRequestEventTypesItem(Value.CONTACT_CONFIRMED, "contact.confirmed"); + + public static final CreateWebhookListenerRequestEventTypesItem CONTACT_DELETED = + new CreateWebhookListenerRequestEventTypesItem(Value.CONTACT_DELETED, "contact.deleted"); + + public static final CreateWebhookListenerRequestEventTypesItem SMS_OPTED_IN = + new CreateWebhookListenerRequestEventTypesItem(Value.SMS_OPTED_IN, "sms.opted_in"); + + public static final CreateWebhookListenerRequestEventTypesItem EMAIL_COMPLAINED = + new CreateWebhookListenerRequestEventTypesItem(Value.EMAIL_COMPLAINED, "email.complained"); + + public static final CreateWebhookListenerRequestEventTypesItem ACCOUNT_MARKETING_PAUSED = + new CreateWebhookListenerRequestEventTypesItem(Value.ACCOUNT_MARKETING_PAUSED, "account.marketing_paused"); + + public static final CreateWebhookListenerRequestEventTypesItem EMAIL_FAILED = + new CreateWebhookListenerRequestEventTypesItem(Value.EMAIL_FAILED, "email.failed"); + + public static final CreateWebhookListenerRequestEventTypesItem BROADCAST_CANCELED = + new CreateWebhookListenerRequestEventTypesItem(Value.BROADCAST_CANCELED, "broadcast.canceled"); + + public static final CreateWebhookListenerRequestEventTypesItem SCHEDULING_CALENDAR_NEEDS_REAUTH = + new CreateWebhookListenerRequestEventTypesItem( + Value.SCHEDULING_CALENDAR_NEEDS_REAUTH, "scheduling.calendar.needs_reauth"); + + public static final CreateWebhookListenerRequestEventTypesItem EMAIL_OPENED = + new CreateWebhookListenerRequestEventTypesItem(Value.EMAIL_OPENED, "email.opened"); + + public static final CreateWebhookListenerRequestEventTypesItem SCHEDULING_CALENDAR_DISCONNECTED = + new CreateWebhookListenerRequestEventTypesItem( + Value.SCHEDULING_CALENDAR_DISCONNECTED, "scheduling.calendar.disconnected"); + + public static final CreateWebhookListenerRequestEventTypesItem SCHEDULING_OAUTH_APP_FAILING = + new CreateWebhookListenerRequestEventTypesItem( + Value.SCHEDULING_OAUTH_APP_FAILING, "scheduling.oauth_app.failing"); + + public static final CreateWebhookListenerRequestEventTypesItem SUBACCOUNT_PAUSED = + new CreateWebhookListenerRequestEventTypesItem(Value.SUBACCOUNT_PAUSED, "subaccount.paused"); + + public static final CreateWebhookListenerRequestEventTypesItem SIGN_REQUEST_COMPLETED = + new CreateWebhookListenerRequestEventTypesItem(Value.SIGN_REQUEST_COMPLETED, "sign_request.completed"); + + public static final CreateWebhookListenerRequestEventTypesItem EMAIL_SCHEDULED = + new CreateWebhookListenerRequestEventTypesItem(Value.EMAIL_SCHEDULED, "email.scheduled"); + + public static final CreateWebhookListenerRequestEventTypesItem SCHEDULING_BOOKING_CANCELLED = + new CreateWebhookListenerRequestEventTypesItem( + Value.SCHEDULING_BOOKING_CANCELLED, "scheduling.booking.cancelled"); + + public static final CreateWebhookListenerRequestEventTypesItem BILLING_HOLD_LIFTED = + new CreateWebhookListenerRequestEventTypesItem(Value.BILLING_HOLD_LIFTED, "billing.hold_lifted"); + + public static final CreateWebhookListenerRequestEventTypesItem EMAIL_SUPPRESSED = + new CreateWebhookListenerRequestEventTypesItem(Value.EMAIL_SUPPRESSED, "email.suppressed"); + + public static final CreateWebhookListenerRequestEventTypesItem EMAIL_RECEIVED = + new CreateWebhookListenerRequestEventTypesItem(Value.EMAIL_RECEIVED, "email.received"); + + public static final CreateWebhookListenerRequestEventTypesItem SCHEDULING_OUT_OF_OFFICE_ENDED = + new CreateWebhookListenerRequestEventTypesItem( + Value.SCHEDULING_OUT_OF_OFFICE_ENDED, "scheduling.out_of_office.ended"); + + public static final CreateWebhookListenerRequestEventTypesItem SCHEDULING_BOOKING_REMINDER = + new CreateWebhookListenerRequestEventTypesItem( + Value.SCHEDULING_BOOKING_REMINDER, "scheduling.booking.reminder"); + + public static final CreateWebhookListenerRequestEventTypesItem SCHEDULING_REASSIGNMENT_COMPLETED = + new CreateWebhookListenerRequestEventTypesItem( + Value.SCHEDULING_REASSIGNMENT_COMPLETED, "scheduling.reassignment.completed"); + + public static final CreateWebhookListenerRequestEventTypesItem BILLING_PLAN_CHANGED = + new CreateWebhookListenerRequestEventTypesItem(Value.BILLING_PLAN_CHANGED, "billing.plan_changed"); + public static final CreateWebhookListenerRequestEventTypesItem SMS_SUPPRESSED = new CreateWebhookListenerRequestEventTypesItem(Value.SMS_SUPPRESSED, "sms.suppressed"); - public static final CreateWebhookListenerRequestEventTypesItem SIGN_REQUEST_SENT = - new CreateWebhookListenerRequestEventTypesItem(Value.SIGN_REQUEST_SENT, "sign_request.sent"); + public static final CreateWebhookListenerRequestEventTypesItem SCHEDULING_OUT_OF_OFFICE_UPDATED = + new CreateWebhookListenerRequestEventTypesItem( + Value.SCHEDULING_OUT_OF_OFFICE_UPDATED, "scheduling.out_of_office.updated"); public static final CreateWebhookListenerRequestEventTypesItem EMAIL_BOUNCED = new CreateWebhookListenerRequestEventTypesItem(Value.EMAIL_BOUNCED, "email.bounced"); @@ -25,6 +155,10 @@ public final class CreateWebhookListenerRequestEventTypesItem { public static final CreateWebhookListenerRequestEventTypesItem SMS_OPTED_OUT = new CreateWebhookListenerRequestEventTypesItem(Value.SMS_OPTED_OUT, "sms.opted_out"); + public static final CreateWebhookListenerRequestEventTypesItem SCHEDULING_OUT_OF_OFFICE_STARTED = + new CreateWebhookListenerRequestEventTypesItem( + Value.SCHEDULING_OUT_OF_OFFICE_STARTED, "scheduling.out_of_office.started"); + public static final CreateWebhookListenerRequestEventTypesItem VERIFICATION_BLOCKED = new CreateWebhookListenerRequestEventTypesItem(Value.VERIFICATION_BLOCKED, "verification.blocked"); @@ -34,12 +168,6 @@ public final class CreateWebhookListenerRequestEventTypesItem { public static final CreateWebhookListenerRequestEventTypesItem SMS_CANCELED = new CreateWebhookListenerRequestEventTypesItem(Value.SMS_CANCELED, "sms.canceled"); - public static final CreateWebhookListenerRequestEventTypesItem SUBACCOUNT_REINSTATED = - new CreateWebhookListenerRequestEventTypesItem(Value.SUBACCOUNT_REINSTATED, "subaccount.reinstated"); - - public static final CreateWebhookListenerRequestEventTypesItem VERIFICATION_FAILED = - new CreateWebhookListenerRequestEventTypesItem(Value.VERIFICATION_FAILED, "verification.failed"); - public static final CreateWebhookListenerRequestEventTypesItem FORM_SUBMISSION_RECEIVED = new CreateWebhookListenerRequestEventTypesItem(Value.FORM_SUBMISSION_RECEIVED, "form.submission.received"); @@ -51,10 +179,6 @@ public final class CreateWebhookListenerRequestEventTypesItem { new CreateWebhookListenerRequestEventTypesItem( Value.SCHEDULING_BOOKING_LOCATION_READY, "scheduling.booking.location_ready"); - public static final CreateWebhookListenerRequestEventTypesItem SCHEDULING_CALENDAR_DELEGATION_RESTORED = - new CreateWebhookListenerRequestEventTypesItem( - Value.SCHEDULING_CALENDAR_DELEGATION_RESTORED, "scheduling.calendar_delegation.restored"); - public static final CreateWebhookListenerRequestEventTypesItem DOMAIN_DMARC_REPORT_RECEIVED = new CreateWebhookListenerRequestEventTypesItem( Value.DOMAIN_DMARC_REPORT_RECEIVED, "domain.dmarc_report_received"); @@ -62,9 +186,6 @@ public final class CreateWebhookListenerRequestEventTypesItem { public static final CreateWebhookListenerRequestEventTypesItem CONTACT_UPDATED = new CreateWebhookListenerRequestEventTypesItem(Value.CONTACT_UPDATED, "contact.updated"); - public static final CreateWebhookListenerRequestEventTypesItem EMAIL_DELIVERY_DELAYED = - new CreateWebhookListenerRequestEventTypesItem(Value.EMAIL_DELIVERY_DELAYED, "email.delivery_delayed"); - public static final CreateWebhookListenerRequestEventTypesItem INBOX_MESSAGE_RECEIVED = new CreateWebhookListenerRequestEventTypesItem(Value.INBOX_MESSAGE_RECEIVED, "inbox.message.received"); @@ -72,15 +193,9 @@ public final class CreateWebhookListenerRequestEventTypesItem { new CreateWebhookListenerRequestEventTypesItem( Value.BILLING_BUDGET_HOLD_PLACED, "billing.budget_hold_placed"); - public static final CreateWebhookListenerRequestEventTypesItem BROADCAST_SENDING = - new CreateWebhookListenerRequestEventTypesItem(Value.BROADCAST_SENDING, "broadcast.sending"); - public static final CreateWebhookListenerRequestEventTypesItem SMS_FAILED = new CreateWebhookListenerRequestEventTypesItem(Value.SMS_FAILED, "sms.failed"); - public static final CreateWebhookListenerRequestEventTypesItem SMS_RECEIVED = - new CreateWebhookListenerRequestEventTypesItem(Value.SMS_RECEIVED, "sms.received"); - public static final CreateWebhookListenerRequestEventTypesItem SCHEDULING_CALENDAR_DELEGATION_FAILING = new CreateWebhookListenerRequestEventTypesItem( Value.SCHEDULING_CALENDAR_DELEGATION_FAILING, "scheduling.calendar_delegation.failing"); @@ -96,44 +211,23 @@ public final class CreateWebhookListenerRequestEventTypesItem { new CreateWebhookListenerRequestEventTypesItem( Value.SCHEDULING_BOOKING_CREATED, "scheduling.booking.created"); - public static final CreateWebhookListenerRequestEventTypesItem BILLING_INVOICE_FINALIZED = + public static final CreateWebhookListenerRequestEventTypesItem SCHEDULING_OUT_OF_OFFICE_CREATED = new CreateWebhookListenerRequestEventTypesItem( - Value.BILLING_INVOICE_FINALIZED, "billing.invoice_finalized"); + Value.SCHEDULING_OUT_OF_OFFICE_CREATED, "scheduling.out_of_office.created"); - public static final CreateWebhookListenerRequestEventTypesItem SCHEDULING_BOOKING_CALENDAR_WRITE_FAILED = + public static final CreateWebhookListenerRequestEventTypesItem SCHEDULING_BOOKING_REASSIGNED = new CreateWebhookListenerRequestEventTypesItem( - Value.SCHEDULING_BOOKING_CALENDAR_WRITE_FAILED, "scheduling.booking.calendar_write_failed"); - - public static final CreateWebhookListenerRequestEventTypesItem EMAIL_DELIVERED = - new CreateWebhookListenerRequestEventTypesItem(Value.EMAIL_DELIVERED, "email.delivered"); + Value.SCHEDULING_BOOKING_REASSIGNED, "scheduling.booking.reassigned"); public static final CreateWebhookListenerRequestEventTypesItem SMS_SCHEDULED = new CreateWebhookListenerRequestEventTypesItem(Value.SMS_SCHEDULED, "sms.scheduled"); - public static final CreateWebhookListenerRequestEventTypesItem BILLING_INVOICE_PAYMENT_FAILED = - new CreateWebhookListenerRequestEventTypesItem( - Value.BILLING_INVOICE_PAYMENT_FAILED, "billing.invoice_payment_failed"); - public static final CreateWebhookListenerRequestEventTypesItem SIGN_REQUEST_DECLINED = new CreateWebhookListenerRequestEventTypesItem(Value.SIGN_REQUEST_DECLINED, "sign_request.declined"); - public static final CreateWebhookListenerRequestEventTypesItem EMAIL_RESCHEDULED = - new CreateWebhookListenerRequestEventTypesItem(Value.EMAIL_RESCHEDULED, "email.rescheduled"); - public static final CreateWebhookListenerRequestEventTypesItem BROADCAST_PAUSED = new CreateWebhookListenerRequestEventTypesItem(Value.BROADCAST_PAUSED, "broadcast.paused"); - public static final CreateWebhookListenerRequestEventTypesItem EMAIL_CLICKED = - new CreateWebhookListenerRequestEventTypesItem(Value.EMAIL_CLICKED, "email.clicked"); - - public static final CreateWebhookListenerRequestEventTypesItem SUBACCOUNT_REPUTATION_RECOVERED = - new CreateWebhookListenerRequestEventTypesItem( - Value.SUBACCOUNT_REPUTATION_RECOVERED, "subaccount.reputation_recovered"); - - public static final CreateWebhookListenerRequestEventTypesItem BILLING_BUDGET_THRESHOLD_REACHED = - new CreateWebhookListenerRequestEventTypesItem( - Value.BILLING_BUDGET_THRESHOLD_REACHED, "billing.budget_threshold_reached"); - public static final CreateWebhookListenerRequestEventTypesItem EMAIL_SENT = new CreateWebhookListenerRequestEventTypesItem(Value.EMAIL_SENT, "email.sent"); @@ -153,28 +247,16 @@ public final class CreateWebhookListenerRequestEventTypesItem { public static final CreateWebhookListenerRequestEventTypesItem FORM_SUBMISSION_FLAGGED = new CreateWebhookListenerRequestEventTypesItem(Value.FORM_SUBMISSION_FLAGGED, "form.submission.flagged"); - public static final CreateWebhookListenerRequestEventTypesItem CONTACT_CONFIRMED = - new CreateWebhookListenerRequestEventTypesItem(Value.CONTACT_CONFIRMED, "contact.confirmed"); - public static final CreateWebhookListenerRequestEventTypesItem BILLING_INVOICE_PAID = new CreateWebhookListenerRequestEventTypesItem(Value.BILLING_INVOICE_PAID, "billing.invoice_paid"); public static final CreateWebhookListenerRequestEventTypesItem CONTACT_UNSUBSCRIBED = new CreateWebhookListenerRequestEventTypesItem(Value.CONTACT_UNSUBSCRIBED, "contact.unsubscribed"); - public static final CreateWebhookListenerRequestEventTypesItem CONTACT_DELETED = - new CreateWebhookListenerRequestEventTypesItem(Value.CONTACT_DELETED, "contact.deleted"); - - public static final CreateWebhookListenerRequestEventTypesItem SMS_OPTED_IN = - new CreateWebhookListenerRequestEventTypesItem(Value.SMS_OPTED_IN, "sms.opted_in"); - public static final CreateWebhookListenerRequestEventTypesItem SCHEDULING_BOOKING_CONFIRMED = new CreateWebhookListenerRequestEventTypesItem( Value.SCHEDULING_BOOKING_CONFIRMED, "scheduling.booking.confirmed"); - public static final CreateWebhookListenerRequestEventTypesItem EMAIL_COMPLAINED = - new CreateWebhookListenerRequestEventTypesItem(Value.EMAIL_COMPLAINED, "email.complained"); - public static final CreateWebhookListenerRequestEventTypesItem SCHEDULING_BOOKING_NO_SHOW = new CreateWebhookListenerRequestEventTypesItem( Value.SCHEDULING_BOOKING_NO_SHOW, "scheduling.booking.no_show"); @@ -190,23 +272,14 @@ public final class CreateWebhookListenerRequestEventTypesItem { public static final CreateWebhookListenerRequestEventTypesItem SIGN_REQUEST_EXPIRED = new CreateWebhookListenerRequestEventTypesItem(Value.SIGN_REQUEST_EXPIRED, "sign_request.expired"); - public static final CreateWebhookListenerRequestEventTypesItem ACCOUNT_MARKETING_PAUSED = - new CreateWebhookListenerRequestEventTypesItem(Value.ACCOUNT_MARKETING_PAUSED, "account.marketing_paused"); - public static final CreateWebhookListenerRequestEventTypesItem ACCOUNT_REPUTATION_WARNING = new CreateWebhookListenerRequestEventTypesItem( Value.ACCOUNT_REPUTATION_WARNING, "account.reputation_warning"); - public static final CreateWebhookListenerRequestEventTypesItem EMAIL_FAILED = - new CreateWebhookListenerRequestEventTypesItem(Value.EMAIL_FAILED, "email.failed"); - public static final CreateWebhookListenerRequestEventTypesItem ACCOUNT_MARKETING_REINSTATED = new CreateWebhookListenerRequestEventTypesItem( Value.ACCOUNT_MARKETING_REINSTATED, "account.marketing_reinstated"); - public static final CreateWebhookListenerRequestEventTypesItem BROADCAST_CANCELED = - new CreateWebhookListenerRequestEventTypesItem(Value.BROADCAST_CANCELED, "broadcast.canceled"); - public static final CreateWebhookListenerRequestEventTypesItem BILLING_CREDIT_GRANTED = new CreateWebhookListenerRequestEventTypesItem(Value.BILLING_CREDIT_GRANTED, "billing.credit_granted"); @@ -214,10 +287,6 @@ public final class CreateWebhookListenerRequestEventTypesItem { new CreateWebhookListenerRequestEventTypesItem( Value.BILLING_BUDGET_HOLD_LIFTED, "billing.budget_hold_lifted"); - public static final CreateWebhookListenerRequestEventTypesItem SCHEDULING_CALENDAR_NEEDS_REAUTH = - new CreateWebhookListenerRequestEventTypesItem( - Value.SCHEDULING_CALENDAR_NEEDS_REAUTH, "scheduling.calendar.needs_reauth"); - public static final CreateWebhookListenerRequestEventTypesItem RISK_ASSESSMENT_REVIEWED = new CreateWebhookListenerRequestEventTypesItem(Value.RISK_ASSESSMENT_REVIEWED, "risk.assessment.reviewed"); @@ -231,9 +300,6 @@ public final class CreateWebhookListenerRequestEventTypesItem { public static final CreateWebhookListenerRequestEventTypesItem ACCOUNT_REINSTATED = new CreateWebhookListenerRequestEventTypesItem(Value.ACCOUNT_REINSTATED, "account.reinstated"); - public static final CreateWebhookListenerRequestEventTypesItem EMAIL_OPENED = - new CreateWebhookListenerRequestEventTypesItem(Value.EMAIL_OPENED, "email.opened"); - public static final CreateWebhookListenerRequestEventTypesItem SIGN_REQUEST_SIGNER_SIGNED = new CreateWebhookListenerRequestEventTypesItem( Value.SIGN_REQUEST_SIGNER_SIGNED, "sign_request.signer_signed"); @@ -241,10 +307,6 @@ public final class CreateWebhookListenerRequestEventTypesItem { public static final CreateWebhookListenerRequestEventTypesItem EMAIL_CANCELED = new CreateWebhookListenerRequestEventTypesItem(Value.EMAIL_CANCELED, "email.canceled"); - public static final CreateWebhookListenerRequestEventTypesItem SCHEDULING_CALENDAR_DISCONNECTED = - new CreateWebhookListenerRequestEventTypesItem( - Value.SCHEDULING_CALENDAR_DISCONNECTED, "scheduling.calendar.disconnected"); - public static final CreateWebhookListenerRequestEventTypesItem SMS_DELIVERED = new CreateWebhookListenerRequestEventTypesItem(Value.SMS_DELIVERED, "sms.delivered"); @@ -258,18 +320,9 @@ public final class CreateWebhookListenerRequestEventTypesItem { new CreateWebhookListenerRequestEventTypesItem( Value.SCHEDULING_BOOKING_DECLINED, "scheduling.booking.declined"); - public static final CreateWebhookListenerRequestEventTypesItem SUBACCOUNT_PAUSED = - new CreateWebhookListenerRequestEventTypesItem(Value.SUBACCOUNT_PAUSED, "subaccount.paused"); - - public static final CreateWebhookListenerRequestEventTypesItem SIGN_REQUEST_COMPLETED = - new CreateWebhookListenerRequestEventTypesItem(Value.SIGN_REQUEST_COMPLETED, "sign_request.completed"); - public static final CreateWebhookListenerRequestEventTypesItem RISK_ASSESSMENT_REVIEW = new CreateWebhookListenerRequestEventTypesItem(Value.RISK_ASSESSMENT_REVIEW, "risk.assessment.review"); - public static final CreateWebhookListenerRequestEventTypesItem EMAIL_SCHEDULED = - new CreateWebhookListenerRequestEventTypesItem(Value.EMAIL_SCHEDULED, "email.scheduled"); - public static final CreateWebhookListenerRequestEventTypesItem SCHEDULING_BOOKING_RESCHEDULED = new CreateWebhookListenerRequestEventTypesItem( Value.SCHEDULING_BOOKING_RESCHEDULED, "scheduling.booking.rescheduled"); @@ -280,26 +333,9 @@ public final class CreateWebhookListenerRequestEventTypesItem { public static final CreateWebhookListenerRequestEventTypesItem HOOK_ENDPOINT_DISABLED = new CreateWebhookListenerRequestEventTypesItem(Value.HOOK_ENDPOINT_DISABLED, "hook_endpoint.disabled"); - public static final CreateWebhookListenerRequestEventTypesItem SCHEDULING_BOOKING_CANCELLED = - new CreateWebhookListenerRequestEventTypesItem( - Value.SCHEDULING_BOOKING_CANCELLED, "scheduling.booking.cancelled"); - - public static final CreateWebhookListenerRequestEventTypesItem BILLING_HOLD_LIFTED = - new CreateWebhookListenerRequestEventTypesItem(Value.BILLING_HOLD_LIFTED, "billing.hold_lifted"); - - public static final CreateWebhookListenerRequestEventTypesItem EMAIL_SUPPRESSED = - new CreateWebhookListenerRequestEventTypesItem(Value.EMAIL_SUPPRESSED, "email.suppressed"); - public static final CreateWebhookListenerRequestEventTypesItem BILLING_HOLD_PLACED = new CreateWebhookListenerRequestEventTypesItem(Value.BILLING_HOLD_PLACED, "billing.hold_placed"); - public static final CreateWebhookListenerRequestEventTypesItem EMAIL_RECEIVED = - new CreateWebhookListenerRequestEventTypesItem(Value.EMAIL_RECEIVED, "email.received"); - - public static final CreateWebhookListenerRequestEventTypesItem SCHEDULING_BOOKING_REMINDER = - new CreateWebhookListenerRequestEventTypesItem( - Value.SCHEDULING_BOOKING_REMINDER, "scheduling.booking.reminder"); - public static final CreateWebhookListenerRequestEventTypesItem SCHEDULING_CALENDAR_CONNECTED = new CreateWebhookListenerRequestEventTypesItem( Value.SCHEDULING_CALENDAR_CONNECTED, "scheduling.calendar.connected"); @@ -343,52 +379,118 @@ public int hashCode() { public T visit(Visitor visitor) { switch (value) { + case BILLING_INVOICE_VOIDED: + return visitor.visitBillingInvoiceVoided(); + case SIGN_REQUEST_SENT: + return visitor.visitSignRequestSent(); + case SCHEDULING_OAUTH_APP_RESTORED: + return visitor.visitSchedulingOauthAppRestored(); + case SUBACCOUNT_REINSTATED: + return visitor.visitSubaccountReinstated(); + case VERIFICATION_FAILED: + return visitor.visitVerificationFailed(); + case SCHEDULING_OUT_OF_OFFICE_DELETED: + return visitor.visitSchedulingOutOfOfficeDeleted(); + case SCHEDULING_CALENDAR_DELEGATION_RESTORED: + return visitor.visitSchedulingCalendarDelegationRestored(); + case EMAIL_DELIVERY_DELAYED: + return visitor.visitEmailDeliveryDelayed(); + case BROADCAST_SENDING: + return visitor.visitBroadcastSending(); + case SMS_RECEIVED: + return visitor.visitSmsReceived(); + case BILLING_INVOICE_FINALIZED: + return visitor.visitBillingInvoiceFinalized(); + case SCHEDULING_BOOKING_CALENDAR_WRITE_FAILED: + return visitor.visitSchedulingBookingCalendarWriteFailed(); + case EMAIL_DELIVERED: + return visitor.visitEmailDelivered(); + case BILLING_INVOICE_PAYMENT_FAILED: + return visitor.visitBillingInvoicePaymentFailed(); + case EMAIL_RESCHEDULED: + return visitor.visitEmailRescheduled(); + case EMAIL_CLICKED: + return visitor.visitEmailClicked(); + case SUBACCOUNT_REPUTATION_RECOVERED: + return visitor.visitSubaccountReputationRecovered(); + case BILLING_BUDGET_THRESHOLD_REACHED: + return visitor.visitBillingBudgetThresholdReached(); + case CONTACT_CONFIRMED: + return visitor.visitContactConfirmed(); + case CONTACT_DELETED: + return visitor.visitContactDeleted(); + case SMS_OPTED_IN: + return visitor.visitSmsOptedIn(); + case EMAIL_COMPLAINED: + return visitor.visitEmailComplained(); + case ACCOUNT_MARKETING_PAUSED: + return visitor.visitAccountMarketingPaused(); + case EMAIL_FAILED: + return visitor.visitEmailFailed(); + case BROADCAST_CANCELED: + return visitor.visitBroadcastCanceled(); + case SCHEDULING_CALENDAR_NEEDS_REAUTH: + return visitor.visitSchedulingCalendarNeedsReauth(); + case EMAIL_OPENED: + return visitor.visitEmailOpened(); + case SCHEDULING_CALENDAR_DISCONNECTED: + return visitor.visitSchedulingCalendarDisconnected(); + case SCHEDULING_OAUTH_APP_FAILING: + return visitor.visitSchedulingOauthAppFailing(); + case SUBACCOUNT_PAUSED: + return visitor.visitSubaccountPaused(); + case SIGN_REQUEST_COMPLETED: + return visitor.visitSignRequestCompleted(); + case EMAIL_SCHEDULED: + return visitor.visitEmailScheduled(); + case SCHEDULING_BOOKING_CANCELLED: + return visitor.visitSchedulingBookingCancelled(); + case BILLING_HOLD_LIFTED: + return visitor.visitBillingHoldLifted(); + case EMAIL_SUPPRESSED: + return visitor.visitEmailSuppressed(); + case EMAIL_RECEIVED: + return visitor.visitEmailReceived(); + case SCHEDULING_OUT_OF_OFFICE_ENDED: + return visitor.visitSchedulingOutOfOfficeEnded(); + case SCHEDULING_BOOKING_REMINDER: + return visitor.visitSchedulingBookingReminder(); + case SCHEDULING_REASSIGNMENT_COMPLETED: + return visitor.visitSchedulingReassignmentCompleted(); case BILLING_PLAN_CHANGED: return visitor.visitBillingPlanChanged(); - case BILLING_INVOICE_VOIDED: - return visitor.visitBillingInvoiceVoided(); case SMS_SUPPRESSED: return visitor.visitSmsSuppressed(); - case SIGN_REQUEST_SENT: - return visitor.visitSignRequestSent(); + case SCHEDULING_OUT_OF_OFFICE_UPDATED: + return visitor.visitSchedulingOutOfOfficeUpdated(); case EMAIL_BOUNCED: return visitor.visitEmailBounced(); case SMS_OPTED_OUT: return visitor.visitSmsOptedOut(); + case SCHEDULING_OUT_OF_OFFICE_STARTED: + return visitor.visitSchedulingOutOfOfficeStarted(); case VERIFICATION_BLOCKED: return visitor.visitVerificationBlocked(); case CONTACT_CREATED: return visitor.visitContactCreated(); case SMS_CANCELED: return visitor.visitSmsCanceled(); - case SUBACCOUNT_REINSTATED: - return visitor.visitSubaccountReinstated(); - case VERIFICATION_FAILED: - return visitor.visitVerificationFailed(); case FORM_SUBMISSION_RECEIVED: return visitor.visitFormSubmissionReceived(); case ACCOUNT_REPUTATION_RECOVERED: return visitor.visitAccountReputationRecovered(); case SCHEDULING_BOOKING_LOCATION_READY: return visitor.visitSchedulingBookingLocationReady(); - case SCHEDULING_CALENDAR_DELEGATION_RESTORED: - return visitor.visitSchedulingCalendarDelegationRestored(); case DOMAIN_DMARC_REPORT_RECEIVED: return visitor.visitDomainDmarcReportReceived(); case CONTACT_UPDATED: return visitor.visitContactUpdated(); - case EMAIL_DELIVERY_DELAYED: - return visitor.visitEmailDeliveryDelayed(); case INBOX_MESSAGE_RECEIVED: return visitor.visitInboxMessageReceived(); case BILLING_BUDGET_HOLD_PLACED: return visitor.visitBillingBudgetHoldPlaced(); - case BROADCAST_SENDING: - return visitor.visitBroadcastSending(); case SMS_FAILED: return visitor.visitSmsFailed(); - case SMS_RECEIVED: - return visitor.visitSmsReceived(); case SCHEDULING_CALENDAR_DELEGATION_FAILING: return visitor.visitSchedulingCalendarDelegationFailing(); case SUBACCOUNT_REPUTATION_WARNING: @@ -397,28 +499,16 @@ public T visit(Visitor visitor) { return visitor.visitSmsUndelivered(); case SCHEDULING_BOOKING_CREATED: return visitor.visitSchedulingBookingCreated(); - case BILLING_INVOICE_FINALIZED: - return visitor.visitBillingInvoiceFinalized(); - case SCHEDULING_BOOKING_CALENDAR_WRITE_FAILED: - return visitor.visitSchedulingBookingCalendarWriteFailed(); - case EMAIL_DELIVERED: - return visitor.visitEmailDelivered(); + case SCHEDULING_OUT_OF_OFFICE_CREATED: + return visitor.visitSchedulingOutOfOfficeCreated(); + case SCHEDULING_BOOKING_REASSIGNED: + return visitor.visitSchedulingBookingReassigned(); case SMS_SCHEDULED: return visitor.visitSmsScheduled(); - case BILLING_INVOICE_PAYMENT_FAILED: - return visitor.visitBillingInvoicePaymentFailed(); case SIGN_REQUEST_DECLINED: return visitor.visitSignRequestDeclined(); - case EMAIL_RESCHEDULED: - return visitor.visitEmailRescheduled(); case BROADCAST_PAUSED: return visitor.visitBroadcastPaused(); - case EMAIL_CLICKED: - return visitor.visitEmailClicked(); - case SUBACCOUNT_REPUTATION_RECOVERED: - return visitor.visitSubaccountReputationRecovered(); - case BILLING_BUDGET_THRESHOLD_REACHED: - return visitor.visitBillingBudgetThresholdReached(); case EMAIL_SENT: return visitor.visitEmailSent(); case SCHEDULING_BOOKING_EXTERNAL_CONFLICT: @@ -431,20 +521,12 @@ public T visit(Visitor visitor) { return visitor.visitVerificationApproved(); case FORM_SUBMISSION_FLAGGED: return visitor.visitFormSubmissionFlagged(); - case CONTACT_CONFIRMED: - return visitor.visitContactConfirmed(); case BILLING_INVOICE_PAID: return visitor.visitBillingInvoicePaid(); case CONTACT_UNSUBSCRIBED: return visitor.visitContactUnsubscribed(); - case CONTACT_DELETED: - return visitor.visitContactDeleted(); - case SMS_OPTED_IN: - return visitor.visitSmsOptedIn(); case SCHEDULING_BOOKING_CONFIRMED: return visitor.visitSchedulingBookingConfirmed(); - case EMAIL_COMPLAINED: - return visitor.visitEmailComplained(); case SCHEDULING_BOOKING_NO_SHOW: return visitor.visitSchedulingBookingNoShow(); case SCHEDULING_BOOKING_STARTED: @@ -453,22 +535,14 @@ public T visit(Visitor visitor) { return visitor.visitBillingUsageThresholdReached(); case SIGN_REQUEST_EXPIRED: return visitor.visitSignRequestExpired(); - case ACCOUNT_MARKETING_PAUSED: - return visitor.visitAccountMarketingPaused(); case ACCOUNT_REPUTATION_WARNING: return visitor.visitAccountReputationWarning(); - case EMAIL_FAILED: - return visitor.visitEmailFailed(); case ACCOUNT_MARKETING_REINSTATED: return visitor.visitAccountMarketingReinstated(); - case BROADCAST_CANCELED: - return visitor.visitBroadcastCanceled(); case BILLING_CREDIT_GRANTED: return visitor.visitBillingCreditGranted(); case BILLING_BUDGET_HOLD_LIFTED: return visitor.visitBillingBudgetHoldLifted(); - case SCHEDULING_CALENDAR_NEEDS_REAUTH: - return visitor.visitSchedulingCalendarNeedsReauth(); case RISK_ASSESSMENT_REVIEWED: return visitor.visitRiskAssessmentReviewed(); case SMS_SENT: @@ -477,14 +551,10 @@ public T visit(Visitor visitor) { return visitor.visitSchedulingBookingPendingApproval(); case ACCOUNT_REINSTATED: return visitor.visitAccountReinstated(); - case EMAIL_OPENED: - return visitor.visitEmailOpened(); case SIGN_REQUEST_SIGNER_SIGNED: return visitor.visitSignRequestSignerSigned(); case EMAIL_CANCELED: return visitor.visitEmailCanceled(); - case SCHEDULING_CALENDAR_DISCONNECTED: - return visitor.visitSchedulingCalendarDisconnected(); case SMS_DELIVERED: return visitor.visitSmsDelivered(); case SIGN_REQUEST_VIEWED: @@ -493,32 +563,16 @@ public T visit(Visitor visitor) { return visitor.visitEmailUnsubscribed(); case SCHEDULING_BOOKING_DECLINED: return visitor.visitSchedulingBookingDeclined(); - case SUBACCOUNT_PAUSED: - return visitor.visitSubaccountPaused(); - case SIGN_REQUEST_COMPLETED: - return visitor.visitSignRequestCompleted(); case RISK_ASSESSMENT_REVIEW: return visitor.visitRiskAssessmentReview(); - case EMAIL_SCHEDULED: - return visitor.visitEmailScheduled(); case SCHEDULING_BOOKING_RESCHEDULED: return visitor.visitSchedulingBookingRescheduled(); case SCHEDULING_BOOKING_ENDED: return visitor.visitSchedulingBookingEnded(); case HOOK_ENDPOINT_DISABLED: return visitor.visitHookEndpointDisabled(); - case SCHEDULING_BOOKING_CANCELLED: - return visitor.visitSchedulingBookingCancelled(); - case BILLING_HOLD_LIFTED: - return visitor.visitBillingHoldLifted(); - case EMAIL_SUPPRESSED: - return visitor.visitEmailSuppressed(); case BILLING_HOLD_PLACED: return visitor.visitBillingHoldPlaced(); - case EMAIL_RECEIVED: - return visitor.visitEmailReceived(); - case SCHEDULING_BOOKING_REMINDER: - return visitor.visitSchedulingBookingReminder(); case SCHEDULING_CALENDAR_CONNECTED: return visitor.visitSchedulingCalendarConnected(); case ACCOUNT_SUSPENDED: @@ -534,52 +588,118 @@ public T visit(Visitor visitor) { @JsonCreator(mode = JsonCreator.Mode.DELEGATING) public static CreateWebhookListenerRequestEventTypesItem valueOf(String value) { switch (value) { - case "billing.plan_changed": - return BILLING_PLAN_CHANGED; case "billing.invoice_voided": return BILLING_INVOICE_VOIDED; - case "sms.suppressed": - return SMS_SUPPRESSED; case "sign_request.sent": return SIGN_REQUEST_SENT; + case "scheduling.oauth_app.restored": + return SCHEDULING_OAUTH_APP_RESTORED; + case "subaccount.reinstated": + return SUBACCOUNT_REINSTATED; + case "verification.failed": + return VERIFICATION_FAILED; + case "scheduling.out_of_office.deleted": + return SCHEDULING_OUT_OF_OFFICE_DELETED; + case "scheduling.calendar_delegation.restored": + return SCHEDULING_CALENDAR_DELEGATION_RESTORED; + case "email.delivery_delayed": + return EMAIL_DELIVERY_DELAYED; + case "broadcast.sending": + return BROADCAST_SENDING; + case "sms.received": + return SMS_RECEIVED; + case "billing.invoice_finalized": + return BILLING_INVOICE_FINALIZED; + case "scheduling.booking.calendar_write_failed": + return SCHEDULING_BOOKING_CALENDAR_WRITE_FAILED; + case "email.delivered": + return EMAIL_DELIVERED; + case "billing.invoice_payment_failed": + return BILLING_INVOICE_PAYMENT_FAILED; + case "email.rescheduled": + return EMAIL_RESCHEDULED; + case "email.clicked": + return EMAIL_CLICKED; + case "subaccount.reputation_recovered": + return SUBACCOUNT_REPUTATION_RECOVERED; + case "billing.budget_threshold_reached": + return BILLING_BUDGET_THRESHOLD_REACHED; + case "contact.confirmed": + return CONTACT_CONFIRMED; + case "contact.deleted": + return CONTACT_DELETED; + case "sms.opted_in": + return SMS_OPTED_IN; + case "email.complained": + return EMAIL_COMPLAINED; + case "account.marketing_paused": + return ACCOUNT_MARKETING_PAUSED; + case "email.failed": + return EMAIL_FAILED; + case "broadcast.canceled": + return BROADCAST_CANCELED; + case "scheduling.calendar.needs_reauth": + return SCHEDULING_CALENDAR_NEEDS_REAUTH; + case "email.opened": + return EMAIL_OPENED; + case "scheduling.calendar.disconnected": + return SCHEDULING_CALENDAR_DISCONNECTED; + case "scheduling.oauth_app.failing": + return SCHEDULING_OAUTH_APP_FAILING; + case "subaccount.paused": + return SUBACCOUNT_PAUSED; + case "sign_request.completed": + return SIGN_REQUEST_COMPLETED; + case "email.scheduled": + return EMAIL_SCHEDULED; + case "scheduling.booking.cancelled": + return SCHEDULING_BOOKING_CANCELLED; + case "billing.hold_lifted": + return BILLING_HOLD_LIFTED; + case "email.suppressed": + return EMAIL_SUPPRESSED; + case "email.received": + return EMAIL_RECEIVED; + case "scheduling.out_of_office.ended": + return SCHEDULING_OUT_OF_OFFICE_ENDED; + case "scheduling.booking.reminder": + return SCHEDULING_BOOKING_REMINDER; + case "scheduling.reassignment.completed": + return SCHEDULING_REASSIGNMENT_COMPLETED; + case "billing.plan_changed": + return BILLING_PLAN_CHANGED; + case "sms.suppressed": + return SMS_SUPPRESSED; + case "scheduling.out_of_office.updated": + return SCHEDULING_OUT_OF_OFFICE_UPDATED; case "email.bounced": return EMAIL_BOUNCED; case "sms.opted_out": return SMS_OPTED_OUT; + case "scheduling.out_of_office.started": + return SCHEDULING_OUT_OF_OFFICE_STARTED; case "verification.blocked": return VERIFICATION_BLOCKED; case "contact.created": return CONTACT_CREATED; case "sms.canceled": return SMS_CANCELED; - case "subaccount.reinstated": - return SUBACCOUNT_REINSTATED; - case "verification.failed": - return VERIFICATION_FAILED; case "form.submission.received": return FORM_SUBMISSION_RECEIVED; case "account.reputation_recovered": return ACCOUNT_REPUTATION_RECOVERED; case "scheduling.booking.location_ready": return SCHEDULING_BOOKING_LOCATION_READY; - case "scheduling.calendar_delegation.restored": - return SCHEDULING_CALENDAR_DELEGATION_RESTORED; case "domain.dmarc_report_received": return DOMAIN_DMARC_REPORT_RECEIVED; case "contact.updated": return CONTACT_UPDATED; - case "email.delivery_delayed": - return EMAIL_DELIVERY_DELAYED; case "inbox.message.received": return INBOX_MESSAGE_RECEIVED; case "billing.budget_hold_placed": return BILLING_BUDGET_HOLD_PLACED; - case "broadcast.sending": - return BROADCAST_SENDING; case "sms.failed": return SMS_FAILED; - case "sms.received": - return SMS_RECEIVED; case "scheduling.calendar_delegation.failing": return SCHEDULING_CALENDAR_DELEGATION_FAILING; case "subaccount.reputation_warning": @@ -588,28 +708,16 @@ public static CreateWebhookListenerRequestEventTypesItem valueOf(String value) { return SMS_UNDELIVERED; case "scheduling.booking.created": return SCHEDULING_BOOKING_CREATED; - case "billing.invoice_finalized": - return BILLING_INVOICE_FINALIZED; - case "scheduling.booking.calendar_write_failed": - return SCHEDULING_BOOKING_CALENDAR_WRITE_FAILED; - case "email.delivered": - return EMAIL_DELIVERED; + case "scheduling.out_of_office.created": + return SCHEDULING_OUT_OF_OFFICE_CREATED; + case "scheduling.booking.reassigned": + return SCHEDULING_BOOKING_REASSIGNED; case "sms.scheduled": return SMS_SCHEDULED; - case "billing.invoice_payment_failed": - return BILLING_INVOICE_PAYMENT_FAILED; case "sign_request.declined": return SIGN_REQUEST_DECLINED; - case "email.rescheduled": - return EMAIL_RESCHEDULED; case "broadcast.paused": return BROADCAST_PAUSED; - case "email.clicked": - return EMAIL_CLICKED; - case "subaccount.reputation_recovered": - return SUBACCOUNT_REPUTATION_RECOVERED; - case "billing.budget_threshold_reached": - return BILLING_BUDGET_THRESHOLD_REACHED; case "email.sent": return EMAIL_SENT; case "scheduling.booking.external_conflict": @@ -622,20 +730,12 @@ public static CreateWebhookListenerRequestEventTypesItem valueOf(String value) { return VERIFICATION_APPROVED; case "form.submission.flagged": return FORM_SUBMISSION_FLAGGED; - case "contact.confirmed": - return CONTACT_CONFIRMED; case "billing.invoice_paid": return BILLING_INVOICE_PAID; case "contact.unsubscribed": return CONTACT_UNSUBSCRIBED; - case "contact.deleted": - return CONTACT_DELETED; - case "sms.opted_in": - return SMS_OPTED_IN; case "scheduling.booking.confirmed": return SCHEDULING_BOOKING_CONFIRMED; - case "email.complained": - return EMAIL_COMPLAINED; case "scheduling.booking.no_show": return SCHEDULING_BOOKING_NO_SHOW; case "scheduling.booking.started": @@ -644,22 +744,14 @@ public static CreateWebhookListenerRequestEventTypesItem valueOf(String value) { return BILLING_USAGE_THRESHOLD_REACHED; case "sign_request.expired": return SIGN_REQUEST_EXPIRED; - case "account.marketing_paused": - return ACCOUNT_MARKETING_PAUSED; case "account.reputation_warning": return ACCOUNT_REPUTATION_WARNING; - case "email.failed": - return EMAIL_FAILED; case "account.marketing_reinstated": return ACCOUNT_MARKETING_REINSTATED; - case "broadcast.canceled": - return BROADCAST_CANCELED; case "billing.credit_granted": return BILLING_CREDIT_GRANTED; case "billing.budget_hold_lifted": return BILLING_BUDGET_HOLD_LIFTED; - case "scheduling.calendar.needs_reauth": - return SCHEDULING_CALENDAR_NEEDS_REAUTH; case "risk.assessment.reviewed": return RISK_ASSESSMENT_REVIEWED; case "sms.sent": @@ -668,14 +760,10 @@ public static CreateWebhookListenerRequestEventTypesItem valueOf(String value) { return SCHEDULING_BOOKING_PENDING_APPROVAL; case "account.reinstated": return ACCOUNT_REINSTATED; - case "email.opened": - return EMAIL_OPENED; case "sign_request.signer_signed": return SIGN_REQUEST_SIGNER_SIGNED; case "email.canceled": return EMAIL_CANCELED; - case "scheduling.calendar.disconnected": - return SCHEDULING_CALENDAR_DISCONNECTED; case "sms.delivered": return SMS_DELIVERED; case "sign_request.viewed": @@ -684,32 +772,16 @@ public static CreateWebhookListenerRequestEventTypesItem valueOf(String value) { return EMAIL_UNSUBSCRIBED; case "scheduling.booking.declined": return SCHEDULING_BOOKING_DECLINED; - case "subaccount.paused": - return SUBACCOUNT_PAUSED; - case "sign_request.completed": - return SIGN_REQUEST_COMPLETED; case "risk.assessment.review": return RISK_ASSESSMENT_REVIEW; - case "email.scheduled": - return EMAIL_SCHEDULED; case "scheduling.booking.rescheduled": return SCHEDULING_BOOKING_RESCHEDULED; case "scheduling.booking.ended": return SCHEDULING_BOOKING_ENDED; case "hook_endpoint.disabled": return HOOK_ENDPOINT_DISABLED; - case "scheduling.booking.cancelled": - return SCHEDULING_BOOKING_CANCELLED; - case "billing.hold_lifted": - return BILLING_HOLD_LIFTED; - case "email.suppressed": - return EMAIL_SUPPRESSED; case "billing.hold_placed": return BILLING_HOLD_PLACED; - case "email.received": - return EMAIL_RECEIVED; - case "scheduling.booking.reminder": - return SCHEDULING_BOOKING_REMINDER; case "scheduling.calendar.connected": return SCHEDULING_CALENDAR_CONNECTED; case "account.suspended": @@ -888,6 +960,8 @@ public enum Value { SCHEDULING_BOOKING_LOCATION_READY, + SCHEDULING_BOOKING_REASSIGNED, + SCHEDULING_BOOKING_STARTED, SCHEDULING_BOOKING_ENDED, @@ -904,6 +978,22 @@ public enum Value { SCHEDULING_CALENDAR_DELEGATION_RESTORED, + SCHEDULING_OUT_OF_OFFICE_CREATED, + + SCHEDULING_OUT_OF_OFFICE_UPDATED, + + SCHEDULING_OUT_OF_OFFICE_DELETED, + + SCHEDULING_OUT_OF_OFFICE_STARTED, + + SCHEDULING_OUT_OF_OFFICE_ENDED, + + SCHEDULING_REASSIGNMENT_COMPLETED, + + SCHEDULING_OAUTH_APP_FAILING, + + SCHEDULING_OAUTH_APP_RESTORED, + UNKNOWN } @@ -1074,6 +1164,8 @@ public interface Visitor { T visitSchedulingBookingLocationReady(); + T visitSchedulingBookingReassigned(); + T visitSchedulingBookingStarted(); T visitSchedulingBookingEnded(); @@ -1090,6 +1182,22 @@ public interface Visitor { T visitSchedulingCalendarDelegationRestored(); + T visitSchedulingOutOfOfficeCreated(); + + T visitSchedulingOutOfOfficeUpdated(); + + T visitSchedulingOutOfOfficeDeleted(); + + T visitSchedulingOutOfOfficeStarted(); + + T visitSchedulingOutOfOfficeEnded(); + + T visitSchedulingReassignmentCompleted(); + + T visitSchedulingOauthAppFailing(); + + T visitSchedulingOauthAppRestored(); + T visitUnknown(String unknownType); } } diff --git a/sdks/java/src/main/java/com/coss/types/CreateOauthAppRequest.java b/sdks/java/src/main/java/com/coss/types/CreateOauthAppRequest.java new file mode 100644 index 000000000..69c95a9c5 --- /dev/null +++ b/sdks/java/src/main/java/com/coss/types/CreateOauthAppRequest.java @@ -0,0 +1,282 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.coss.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonUnwrapped; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Objects; +import java.util.Optional; + +public final class CreateOauthAppRequest { + private final Value value; + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + private CreateOauthAppRequest(Value value) { + this.value = value; + } + + public T visit(Visitor visitor) { + return value.visit(visitor); + } + + public static CreateOauthAppRequest google(CreateOauthAppRequestGoogle value) { + return new CreateOauthAppRequest(new GoogleValue(value)); + } + + public static CreateOauthAppRequest microsoft(CreateOauthAppRequestMicrosoft value) { + return new CreateOauthAppRequest(new MicrosoftValue(value)); + } + + public static CreateOauthAppRequest zoom(CreateOauthAppRequestZoom value) { + return new CreateOauthAppRequest(new ZoomValue(value)); + } + + public boolean isGoogle() { + return value instanceof GoogleValue; + } + + public boolean isMicrosoft() { + return value instanceof MicrosoftValue; + } + + public boolean isZoom() { + return value instanceof ZoomValue; + } + + public boolean _isUnknown() { + return value instanceof _UnknownValue; + } + + public Optional getGoogle() { + if (isGoogle()) { + return Optional.of(((GoogleValue) value).value); + } + return Optional.empty(); + } + + public Optional getMicrosoft() { + if (isMicrosoft()) { + return Optional.of(((MicrosoftValue) value).value); + } + return Optional.empty(); + } + + public Optional getZoom() { + if (isZoom()) { + return Optional.of(((ZoomValue) value).value); + } + return Optional.empty(); + } + + public Optional _getUnknown() { + if (_isUnknown()) { + return Optional.of(((_UnknownValue) value).value); + } + return Optional.empty(); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateOauthAppRequest && value.equals(((CreateOauthAppRequest) other).value); + } + + @Override + public int hashCode() { + return Objects.hash(value); + } + + @Override + public String toString() { + return value.toString(); + } + + @JsonValue + private Value getValue() { + return this.value; + } + + public interface Visitor { + T visitGoogle(CreateOauthAppRequestGoogle google); + + T visitMicrosoft(CreateOauthAppRequestMicrosoft microsoft); + + T visitZoom(CreateOauthAppRequestZoom zoom); + + T _visitUnknown(Object unknownType); + } + + @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "provider", visible = true, defaultImpl = _UnknownValue.class) + @JsonSubTypes({ + @JsonSubTypes.Type(GoogleValue.class), + @JsonSubTypes.Type(MicrosoftValue.class), + @JsonSubTypes.Type(ZoomValue.class) + }) + @JsonIgnoreProperties(ignoreUnknown = true) + private interface Value { + T visit(Visitor visitor); + } + + @JsonTypeName("google") + @JsonIgnoreProperties("provider") + private static final class GoogleValue implements Value { + @JsonUnwrapped + @JsonIgnoreProperties(value = "provider", allowSetters = true) + private CreateOauthAppRequestGoogle value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private GoogleValue() {} + + private GoogleValue(CreateOauthAppRequestGoogle value) { + this.value = value; + } + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor.visitGoogle(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof GoogleValue && equalTo((GoogleValue) other); + } + + private boolean equalTo(GoogleValue other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return "CreateOauthAppRequest{" + "value: " + value + "}"; + } + } + + @JsonTypeName("microsoft") + @JsonIgnoreProperties("provider") + private static final class MicrosoftValue implements Value { + @JsonUnwrapped + @JsonIgnoreProperties(value = "provider", allowSetters = true) + private CreateOauthAppRequestMicrosoft value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private MicrosoftValue() {} + + private MicrosoftValue(CreateOauthAppRequestMicrosoft value) { + this.value = value; + } + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor.visitMicrosoft(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof MicrosoftValue && equalTo((MicrosoftValue) other); + } + + private boolean equalTo(MicrosoftValue other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return "CreateOauthAppRequest{" + "value: " + value + "}"; + } + } + + @JsonTypeName("zoom") + @JsonIgnoreProperties("provider") + private static final class ZoomValue implements Value { + @JsonUnwrapped + @JsonIgnoreProperties(value = "provider", allowSetters = true) + private CreateOauthAppRequestZoom value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private ZoomValue() {} + + private ZoomValue(CreateOauthAppRequestZoom value) { + this.value = value; + } + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor.visitZoom(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ZoomValue && equalTo((ZoomValue) other); + } + + private boolean equalTo(ZoomValue other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return "CreateOauthAppRequest{" + "value: " + value + "}"; + } + } + + @JsonIgnoreProperties("provider") + private static final class _UnknownValue implements Value { + private String type; + + @JsonValue + private Object value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private _UnknownValue(@JsonProperty("value") Object value) {} + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor._visitUnknown(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof _UnknownValue && equalTo((_UnknownValue) other); + } + + private boolean equalTo(_UnknownValue other) { + return type.equals(other.type) && value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.type, this.value); + } + + @java.lang.Override + public String toString() { + return "CreateOauthAppRequest{" + "type: " + type + ", value: " + value + "}"; + } + } +} diff --git a/sdks/java/src/main/java/com/coss/types/CreateOauthAppRequestGoogle.java b/sdks/java/src/main/java/com/coss/types/CreateOauthAppRequestGoogle.java new file mode 100644 index 000000000..fed66799c --- /dev/null +++ b/sdks/java/src/main/java/com/coss/types/CreateOauthAppRequestGoogle.java @@ -0,0 +1,298 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.coss.types; + +import com.coss.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateOauthAppRequestGoogle.Builder.class) +public final class CreateOauthAppRequestGoogle { + private final String clientId; + + private final String clientSecret; + + private final Optional redirectUri; + + private final Optional completionUrl; + + private final Optional secretExpiresAt; + + private final Map additionalProperties; + + private CreateOauthAppRequestGoogle( + String clientId, + String clientSecret, + Optional redirectUri, + Optional completionUrl, + Optional secretExpiresAt, + Map additionalProperties) { + this.clientId = clientId; + this.clientSecret = clientSecret; + this.redirectUri = redirectUri; + this.completionUrl = completionUrl; + this.secretExpiresAt = secretExpiresAt; + this.additionalProperties = additionalProperties; + } + + /** + * @return The app's client ID at the provider. + */ + @JsonProperty("client_id") + public String getClientId() { + return clientId; + } + + /** + * @return The app's client secret. Never returned. + */ + @JsonProperty("client_secret") + public String getClientSecret() { + return clientSecret; + } + + /** + * @return A page on your own domain, registered with the provider, that forwards code and state to coss_callback_url. Google requires this for an external app, since it has to verify the redirect's domain as yours. Leave it out to use coss_callback_url directly. + */ + @JsonProperty("redirect_uri") + public Optional getRedirectUri() { + return redirectUri; + } + + /** + * @return Where the browser lands after a consent that didn't name a return_url, with coss_calendar set to connected, denied or invalid. Leave it out for a plain page saying what happened. + */ + @JsonProperty("completion_url") + public Optional getCompletionUrl() { + return completionUrl; + } + + /** + * @return When the client secret expires. Owners and admins are warned 14 days before. + */ + @JsonProperty("secret_expires_at") + public Optional getSecretExpiresAt() { + return secretExpiresAt; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateOauthAppRequestGoogle && equalTo((CreateOauthAppRequestGoogle) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateOauthAppRequestGoogle other) { + return clientId.equals(other.clientId) + && clientSecret.equals(other.clientSecret) + && redirectUri.equals(other.redirectUri) + && completionUrl.equals(other.completionUrl) + && secretExpiresAt.equals(other.secretExpiresAt); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.clientId, this.clientSecret, this.redirectUri, this.completionUrl, this.secretExpiresAt); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ClientIdStage builder() { + return new Builder(); + } + + public interface ClientIdStage { + /** + *

The app's client ID at the provider.

+ */ + ClientSecretStage clientId(@NotNull String clientId); + + Builder from(CreateOauthAppRequestGoogle other); + } + + public interface ClientSecretStage { + /** + *

The app's client secret. Never returned.

+ */ + _FinalStage clientSecret(@NotNull String clientSecret); + } + + public interface _FinalStage { + CreateOauthAppRequestGoogle build(); + + _FinalStage additionalProperty(String key, Object value); + + _FinalStage additionalProperties(Map additionalProperties); + + /** + *

A page on your own domain, registered with the provider, that forwards code and state to coss_callback_url. Google requires this for an external app, since it has to verify the redirect's domain as yours. Leave it out to use coss_callback_url directly.

+ */ + _FinalStage redirectUri(Optional redirectUri); + + _FinalStage redirectUri(String redirectUri); + + /** + *

Where the browser lands after a consent that didn't name a return_url, with coss_calendar set to connected, denied or invalid. Leave it out for a plain page saying what happened.

+ */ + _FinalStage completionUrl(Optional completionUrl); + + _FinalStage completionUrl(String completionUrl); + + /** + *

When the client secret expires. Owners and admins are warned 14 days before.

+ */ + _FinalStage secretExpiresAt(Optional secretExpiresAt); + + _FinalStage secretExpiresAt(OffsetDateTime secretExpiresAt); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ClientIdStage, ClientSecretStage, _FinalStage { + private String clientId; + + private String clientSecret; + + private Optional secretExpiresAt = Optional.empty(); + + private Optional completionUrl = Optional.empty(); + + private Optional redirectUri = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(CreateOauthAppRequestGoogle other) { + clientId(other.getClientId()); + clientSecret(other.getClientSecret()); + redirectUri(other.getRedirectUri()); + completionUrl(other.getCompletionUrl()); + secretExpiresAt(other.getSecretExpiresAt()); + return this; + } + + /** + *

The app's client ID at the provider.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("client_id") + public ClientSecretStage clientId(@NotNull String clientId) { + this.clientId = Objects.requireNonNull(clientId, "clientId must not be null"); + return this; + } + + /** + *

The app's client secret. Never returned.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("client_secret") + public _FinalStage clientSecret(@NotNull String clientSecret) { + this.clientSecret = Objects.requireNonNull(clientSecret, "clientSecret must not be null"); + return this; + } + + /** + *

When the client secret expires. Owners and admins are warned 14 days before.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage secretExpiresAt(OffsetDateTime secretExpiresAt) { + this.secretExpiresAt = Optional.ofNullable(secretExpiresAt); + return this; + } + + /** + *

When the client secret expires. Owners and admins are warned 14 days before.

+ */ + @java.lang.Override + @JsonSetter(value = "secret_expires_at", nulls = Nulls.SKIP) + public _FinalStage secretExpiresAt(Optional secretExpiresAt) { + this.secretExpiresAt = secretExpiresAt; + return this; + } + + /** + *

Where the browser lands after a consent that didn't name a return_url, with coss_calendar set to connected, denied or invalid. Leave it out for a plain page saying what happened.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage completionUrl(String completionUrl) { + this.completionUrl = Optional.ofNullable(completionUrl); + return this; + } + + /** + *

Where the browser lands after a consent that didn't name a return_url, with coss_calendar set to connected, denied or invalid. Leave it out for a plain page saying what happened.

+ */ + @java.lang.Override + @JsonSetter(value = "completion_url", nulls = Nulls.SKIP) + public _FinalStage completionUrl(Optional completionUrl) { + this.completionUrl = completionUrl; + return this; + } + + /** + *

A page on your own domain, registered with the provider, that forwards code and state to coss_callback_url. Google requires this for an external app, since it has to verify the redirect's domain as yours. Leave it out to use coss_callback_url directly.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage redirectUri(String redirectUri) { + this.redirectUri = Optional.ofNullable(redirectUri); + return this; + } + + /** + *

A page on your own domain, registered with the provider, that forwards code and state to coss_callback_url. Google requires this for an external app, since it has to verify the redirect's domain as yours. Leave it out to use coss_callback_url directly.

+ */ + @java.lang.Override + @JsonSetter(value = "redirect_uri", nulls = Nulls.SKIP) + public _FinalStage redirectUri(Optional redirectUri) { + this.redirectUri = redirectUri; + return this; + } + + @java.lang.Override + public CreateOauthAppRequestGoogle build() { + return new CreateOauthAppRequestGoogle( + clientId, clientSecret, redirectUri, completionUrl, secretExpiresAt, additionalProperties); + } + + @java.lang.Override + public Builder additionalProperty(String key, Object value) { + this.additionalProperties.put(key, value); + return this; + } + + @java.lang.Override + public Builder additionalProperties(Map additionalProperties) { + this.additionalProperties.putAll(additionalProperties); + return this; + } + } +} diff --git a/sdks/java/src/main/java/com/coss/types/CreateOauthAppRequestMicrosoft.java b/sdks/java/src/main/java/com/coss/types/CreateOauthAppRequestMicrosoft.java new file mode 100644 index 000000000..2539d4e29 --- /dev/null +++ b/sdks/java/src/main/java/com/coss/types/CreateOauthAppRequestMicrosoft.java @@ -0,0 +1,352 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.coss.types; + +import com.coss.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateOauthAppRequestMicrosoft.Builder.class) +public final class CreateOauthAppRequestMicrosoft { + private final String clientId; + + private final String clientSecret; + + private final Optional tenantId; + + private final Optional redirectUri; + + private final Optional completionUrl; + + private final Optional secretExpiresAt; + + private final Map additionalProperties; + + private CreateOauthAppRequestMicrosoft( + String clientId, + String clientSecret, + Optional tenantId, + Optional redirectUri, + Optional completionUrl, + Optional secretExpiresAt, + Map additionalProperties) { + this.clientId = clientId; + this.clientSecret = clientSecret; + this.tenantId = tenantId; + this.redirectUri = redirectUri; + this.completionUrl = completionUrl; + this.secretExpiresAt = secretExpiresAt; + this.additionalProperties = additionalProperties; + } + + /** + * @return The app's client ID at the provider. + */ + @JsonProperty("client_id") + public String getClientId() { + return clientId; + } + + /** + * @return The app's client secret. Never returned. + */ + @JsonProperty("client_secret") + public String getClientSecret() { + return clientSecret; + } + + /** + * @return The Directory (tenant) ID, for an app that's only for your own tenant. Leave it out for a multi-tenant app. + */ + @JsonProperty("tenant_id") + public Optional getTenantId() { + return tenantId; + } + + /** + * @return A page on your own domain, registered with the provider, that forwards code and state to coss_callback_url. Google requires this for an external app, since it has to verify the redirect's domain as yours. Leave it out to use coss_callback_url directly. + */ + @JsonProperty("redirect_uri") + public Optional getRedirectUri() { + return redirectUri; + } + + /** + * @return Where the browser lands after a consent that didn't name a return_url, with coss_calendar set to connected, denied or invalid. Leave it out for a plain page saying what happened. + */ + @JsonProperty("completion_url") + public Optional getCompletionUrl() { + return completionUrl; + } + + /** + * @return When the client secret expires. Owners and admins are warned 14 days before. + */ + @JsonProperty("secret_expires_at") + public Optional getSecretExpiresAt() { + return secretExpiresAt; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateOauthAppRequestMicrosoft && equalTo((CreateOauthAppRequestMicrosoft) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateOauthAppRequestMicrosoft other) { + return clientId.equals(other.clientId) + && clientSecret.equals(other.clientSecret) + && tenantId.equals(other.tenantId) + && redirectUri.equals(other.redirectUri) + && completionUrl.equals(other.completionUrl) + && secretExpiresAt.equals(other.secretExpiresAt); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.clientId, + this.clientSecret, + this.tenantId, + this.redirectUri, + this.completionUrl, + this.secretExpiresAt); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ClientIdStage builder() { + return new Builder(); + } + + public interface ClientIdStage { + /** + *

The app's client ID at the provider.

+ */ + ClientSecretStage clientId(@NotNull String clientId); + + Builder from(CreateOauthAppRequestMicrosoft other); + } + + public interface ClientSecretStage { + /** + *

The app's client secret. Never returned.

+ */ + _FinalStage clientSecret(@NotNull String clientSecret); + } + + public interface _FinalStage { + CreateOauthAppRequestMicrosoft build(); + + _FinalStage additionalProperty(String key, Object value); + + _FinalStage additionalProperties(Map additionalProperties); + + /** + *

The Directory (tenant) ID, for an app that's only for your own tenant. Leave it out for a multi-tenant app.

+ */ + _FinalStage tenantId(Optional tenantId); + + _FinalStage tenantId(String tenantId); + + /** + *

A page on your own domain, registered with the provider, that forwards code and state to coss_callback_url. Google requires this for an external app, since it has to verify the redirect's domain as yours. Leave it out to use coss_callback_url directly.

+ */ + _FinalStage redirectUri(Optional redirectUri); + + _FinalStage redirectUri(String redirectUri); + + /** + *

Where the browser lands after a consent that didn't name a return_url, with coss_calendar set to connected, denied or invalid. Leave it out for a plain page saying what happened.

+ */ + _FinalStage completionUrl(Optional completionUrl); + + _FinalStage completionUrl(String completionUrl); + + /** + *

When the client secret expires. Owners and admins are warned 14 days before.

+ */ + _FinalStage secretExpiresAt(Optional secretExpiresAt); + + _FinalStage secretExpiresAt(OffsetDateTime secretExpiresAt); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ClientIdStage, ClientSecretStage, _FinalStage { + private String clientId; + + private String clientSecret; + + private Optional secretExpiresAt = Optional.empty(); + + private Optional completionUrl = Optional.empty(); + + private Optional redirectUri = Optional.empty(); + + private Optional tenantId = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(CreateOauthAppRequestMicrosoft other) { + clientId(other.getClientId()); + clientSecret(other.getClientSecret()); + tenantId(other.getTenantId()); + redirectUri(other.getRedirectUri()); + completionUrl(other.getCompletionUrl()); + secretExpiresAt(other.getSecretExpiresAt()); + return this; + } + + /** + *

The app's client ID at the provider.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("client_id") + public ClientSecretStage clientId(@NotNull String clientId) { + this.clientId = Objects.requireNonNull(clientId, "clientId must not be null"); + return this; + } + + /** + *

The app's client secret. Never returned.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("client_secret") + public _FinalStage clientSecret(@NotNull String clientSecret) { + this.clientSecret = Objects.requireNonNull(clientSecret, "clientSecret must not be null"); + return this; + } + + /** + *

When the client secret expires. Owners and admins are warned 14 days before.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage secretExpiresAt(OffsetDateTime secretExpiresAt) { + this.secretExpiresAt = Optional.ofNullable(secretExpiresAt); + return this; + } + + /** + *

When the client secret expires. Owners and admins are warned 14 days before.

+ */ + @java.lang.Override + @JsonSetter(value = "secret_expires_at", nulls = Nulls.SKIP) + public _FinalStage secretExpiresAt(Optional secretExpiresAt) { + this.secretExpiresAt = secretExpiresAt; + return this; + } + + /** + *

Where the browser lands after a consent that didn't name a return_url, with coss_calendar set to connected, denied or invalid. Leave it out for a plain page saying what happened.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage completionUrl(String completionUrl) { + this.completionUrl = Optional.ofNullable(completionUrl); + return this; + } + + /** + *

Where the browser lands after a consent that didn't name a return_url, with coss_calendar set to connected, denied or invalid. Leave it out for a plain page saying what happened.

+ */ + @java.lang.Override + @JsonSetter(value = "completion_url", nulls = Nulls.SKIP) + public _FinalStage completionUrl(Optional completionUrl) { + this.completionUrl = completionUrl; + return this; + } + + /** + *

A page on your own domain, registered with the provider, that forwards code and state to coss_callback_url. Google requires this for an external app, since it has to verify the redirect's domain as yours. Leave it out to use coss_callback_url directly.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage redirectUri(String redirectUri) { + this.redirectUri = Optional.ofNullable(redirectUri); + return this; + } + + /** + *

A page on your own domain, registered with the provider, that forwards code and state to coss_callback_url. Google requires this for an external app, since it has to verify the redirect's domain as yours. Leave it out to use coss_callback_url directly.

+ */ + @java.lang.Override + @JsonSetter(value = "redirect_uri", nulls = Nulls.SKIP) + public _FinalStage redirectUri(Optional redirectUri) { + this.redirectUri = redirectUri; + return this; + } + + /** + *

The Directory (tenant) ID, for an app that's only for your own tenant. Leave it out for a multi-tenant app.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage tenantId(String tenantId) { + this.tenantId = Optional.ofNullable(tenantId); + return this; + } + + /** + *

The Directory (tenant) ID, for an app that's only for your own tenant. Leave it out for a multi-tenant app.

+ */ + @java.lang.Override + @JsonSetter(value = "tenant_id", nulls = Nulls.SKIP) + public _FinalStage tenantId(Optional tenantId) { + this.tenantId = tenantId; + return this; + } + + @java.lang.Override + public CreateOauthAppRequestMicrosoft build() { + return new CreateOauthAppRequestMicrosoft( + clientId, + clientSecret, + tenantId, + redirectUri, + completionUrl, + secretExpiresAt, + additionalProperties); + } + + @java.lang.Override + public Builder additionalProperty(String key, Object value) { + this.additionalProperties.put(key, value); + return this; + } + + @java.lang.Override + public Builder additionalProperties(Map additionalProperties) { + this.additionalProperties.putAll(additionalProperties); + return this; + } + } +} diff --git a/sdks/java/src/main/java/com/coss/types/CreateOauthAppRequestZoom.java b/sdks/java/src/main/java/com/coss/types/CreateOauthAppRequestZoom.java new file mode 100644 index 000000000..31ca580b3 --- /dev/null +++ b/sdks/java/src/main/java/com/coss/types/CreateOauthAppRequestZoom.java @@ -0,0 +1,352 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.coss.types; + +import com.coss.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateOauthAppRequestZoom.Builder.class) +public final class CreateOauthAppRequestZoom { + private final String clientId; + + private final String clientSecret; + + private final Optional webhookSecret; + + private final Optional redirectUri; + + private final Optional completionUrl; + + private final Optional secretExpiresAt; + + private final Map additionalProperties; + + private CreateOauthAppRequestZoom( + String clientId, + String clientSecret, + Optional webhookSecret, + Optional redirectUri, + Optional completionUrl, + Optional secretExpiresAt, + Map additionalProperties) { + this.clientId = clientId; + this.clientSecret = clientSecret; + this.webhookSecret = webhookSecret; + this.redirectUri = redirectUri; + this.completionUrl = completionUrl; + this.secretExpiresAt = secretExpiresAt; + this.additionalProperties = additionalProperties; + } + + /** + * @return The app's client ID at the provider. + */ + @JsonProperty("client_id") + public String getClientId() { + return clientId; + } + + /** + * @return The app's client secret. Never returned. + */ + @JsonProperty("client_secret") + public String getClientSecret() { + return clientSecret; + } + + /** + * @return The Secret Token of your Zoom app, which signs its events at zoom_event_url. Never returned. + */ + @JsonProperty("webhook_secret") + public Optional getWebhookSecret() { + return webhookSecret; + } + + /** + * @return A page on your own domain, registered with the provider, that forwards code and state to coss_callback_url. Google requires this for an external app, since it has to verify the redirect's domain as yours. Leave it out to use coss_callback_url directly. + */ + @JsonProperty("redirect_uri") + public Optional getRedirectUri() { + return redirectUri; + } + + /** + * @return Where the browser lands after a consent that didn't name a return_url, with coss_calendar set to connected, denied or invalid. Leave it out for a plain page saying what happened. + */ + @JsonProperty("completion_url") + public Optional getCompletionUrl() { + return completionUrl; + } + + /** + * @return When the client secret expires. Owners and admins are warned 14 days before. + */ + @JsonProperty("secret_expires_at") + public Optional getSecretExpiresAt() { + return secretExpiresAt; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateOauthAppRequestZoom && equalTo((CreateOauthAppRequestZoom) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateOauthAppRequestZoom other) { + return clientId.equals(other.clientId) + && clientSecret.equals(other.clientSecret) + && webhookSecret.equals(other.webhookSecret) + && redirectUri.equals(other.redirectUri) + && completionUrl.equals(other.completionUrl) + && secretExpiresAt.equals(other.secretExpiresAt); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.clientId, + this.clientSecret, + this.webhookSecret, + this.redirectUri, + this.completionUrl, + this.secretExpiresAt); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ClientIdStage builder() { + return new Builder(); + } + + public interface ClientIdStage { + /** + *

The app's client ID at the provider.

+ */ + ClientSecretStage clientId(@NotNull String clientId); + + Builder from(CreateOauthAppRequestZoom other); + } + + public interface ClientSecretStage { + /** + *

The app's client secret. Never returned.

+ */ + _FinalStage clientSecret(@NotNull String clientSecret); + } + + public interface _FinalStage { + CreateOauthAppRequestZoom build(); + + _FinalStage additionalProperty(String key, Object value); + + _FinalStage additionalProperties(Map additionalProperties); + + /** + *

The Secret Token of your Zoom app, which signs its events at zoom_event_url. Never returned.

+ */ + _FinalStage webhookSecret(Optional webhookSecret); + + _FinalStage webhookSecret(String webhookSecret); + + /** + *

A page on your own domain, registered with the provider, that forwards code and state to coss_callback_url. Google requires this for an external app, since it has to verify the redirect's domain as yours. Leave it out to use coss_callback_url directly.

+ */ + _FinalStage redirectUri(Optional redirectUri); + + _FinalStage redirectUri(String redirectUri); + + /** + *

Where the browser lands after a consent that didn't name a return_url, with coss_calendar set to connected, denied or invalid. Leave it out for a plain page saying what happened.

+ */ + _FinalStage completionUrl(Optional completionUrl); + + _FinalStage completionUrl(String completionUrl); + + /** + *

When the client secret expires. Owners and admins are warned 14 days before.

+ */ + _FinalStage secretExpiresAt(Optional secretExpiresAt); + + _FinalStage secretExpiresAt(OffsetDateTime secretExpiresAt); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ClientIdStage, ClientSecretStage, _FinalStage { + private String clientId; + + private String clientSecret; + + private Optional secretExpiresAt = Optional.empty(); + + private Optional completionUrl = Optional.empty(); + + private Optional redirectUri = Optional.empty(); + + private Optional webhookSecret = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(CreateOauthAppRequestZoom other) { + clientId(other.getClientId()); + clientSecret(other.getClientSecret()); + webhookSecret(other.getWebhookSecret()); + redirectUri(other.getRedirectUri()); + completionUrl(other.getCompletionUrl()); + secretExpiresAt(other.getSecretExpiresAt()); + return this; + } + + /** + *

The app's client ID at the provider.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("client_id") + public ClientSecretStage clientId(@NotNull String clientId) { + this.clientId = Objects.requireNonNull(clientId, "clientId must not be null"); + return this; + } + + /** + *

The app's client secret. Never returned.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("client_secret") + public _FinalStage clientSecret(@NotNull String clientSecret) { + this.clientSecret = Objects.requireNonNull(clientSecret, "clientSecret must not be null"); + return this; + } + + /** + *

When the client secret expires. Owners and admins are warned 14 days before.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage secretExpiresAt(OffsetDateTime secretExpiresAt) { + this.secretExpiresAt = Optional.ofNullable(secretExpiresAt); + return this; + } + + /** + *

When the client secret expires. Owners and admins are warned 14 days before.

+ */ + @java.lang.Override + @JsonSetter(value = "secret_expires_at", nulls = Nulls.SKIP) + public _FinalStage secretExpiresAt(Optional secretExpiresAt) { + this.secretExpiresAt = secretExpiresAt; + return this; + } + + /** + *

Where the browser lands after a consent that didn't name a return_url, with coss_calendar set to connected, denied or invalid. Leave it out for a plain page saying what happened.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage completionUrl(String completionUrl) { + this.completionUrl = Optional.ofNullable(completionUrl); + return this; + } + + /** + *

Where the browser lands after a consent that didn't name a return_url, with coss_calendar set to connected, denied or invalid. Leave it out for a plain page saying what happened.

+ */ + @java.lang.Override + @JsonSetter(value = "completion_url", nulls = Nulls.SKIP) + public _FinalStage completionUrl(Optional completionUrl) { + this.completionUrl = completionUrl; + return this; + } + + /** + *

A page on your own domain, registered with the provider, that forwards code and state to coss_callback_url. Google requires this for an external app, since it has to verify the redirect's domain as yours. Leave it out to use coss_callback_url directly.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage redirectUri(String redirectUri) { + this.redirectUri = Optional.ofNullable(redirectUri); + return this; + } + + /** + *

A page on your own domain, registered with the provider, that forwards code and state to coss_callback_url. Google requires this for an external app, since it has to verify the redirect's domain as yours. Leave it out to use coss_callback_url directly.

+ */ + @java.lang.Override + @JsonSetter(value = "redirect_uri", nulls = Nulls.SKIP) + public _FinalStage redirectUri(Optional redirectUri) { + this.redirectUri = redirectUri; + return this; + } + + /** + *

The Secret Token of your Zoom app, which signs its events at zoom_event_url. Never returned.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage webhookSecret(String webhookSecret) { + this.webhookSecret = Optional.ofNullable(webhookSecret); + return this; + } + + /** + *

The Secret Token of your Zoom app, which signs its events at zoom_event_url. Never returned.

+ */ + @java.lang.Override + @JsonSetter(value = "webhook_secret", nulls = Nulls.SKIP) + public _FinalStage webhookSecret(Optional webhookSecret) { + this.webhookSecret = webhookSecret; + return this; + } + + @java.lang.Override + public CreateOauthAppRequestZoom build() { + return new CreateOauthAppRequestZoom( + clientId, + clientSecret, + webhookSecret, + redirectUri, + completionUrl, + secretExpiresAt, + additionalProperties); + } + + @java.lang.Override + public Builder additionalProperty(String key, Object value) { + this.additionalProperties.put(key, value); + return this; + } + + @java.lang.Override + public Builder additionalProperties(Map additionalProperties) { + this.additionalProperties.putAll(additionalProperties); + return this; + } + } +} diff --git a/sdks/java/src/main/java/com/coss/types/DeletedSchedulingHolidayCalendar.java b/sdks/java/src/main/java/com/coss/types/DeletedSchedulingHolidayCalendar.java new file mode 100644 index 000000000..5266aa7f8 --- /dev/null +++ b/sdks/java/src/main/java/com/coss/types/DeletedSchedulingHolidayCalendar.java @@ -0,0 +1,140 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.coss.types; + +import com.coss.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = DeletedSchedulingHolidayCalendar.Builder.class) +public final class DeletedSchedulingHolidayCalendar { + private final String id; + + private final boolean deleted; + + private final Map additionalProperties; + + private DeletedSchedulingHolidayCalendar(String id, boolean deleted, Map additionalProperties) { + this.id = id; + this.deleted = deleted; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public String getId() { + return id; + } + + @JsonProperty("deleted") + public boolean getDeleted() { + return deleted; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof DeletedSchedulingHolidayCalendar && equalTo((DeletedSchedulingHolidayCalendar) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(DeletedSchedulingHolidayCalendar other) { + return id.equals(other.id) && deleted == other.deleted; + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.id, this.deleted); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static IdStage builder() { + return new Builder(); + } + + public interface IdStage { + DeletedStage id(@NotNull String id); + + Builder from(DeletedSchedulingHolidayCalendar other); + } + + public interface DeletedStage { + _FinalStage deleted(boolean deleted); + } + + public interface _FinalStage { + DeletedSchedulingHolidayCalendar build(); + + _FinalStage additionalProperty(String key, Object value); + + _FinalStage additionalProperties(Map additionalProperties); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements IdStage, DeletedStage, _FinalStage { + private String id; + + private boolean deleted; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(DeletedSchedulingHolidayCalendar other) { + id(other.getId()); + deleted(other.getDeleted()); + return this; + } + + @java.lang.Override + @JsonSetter("id") + public DeletedStage id(@NotNull String id) { + this.id = Objects.requireNonNull(id, "id must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("deleted") + public _FinalStage deleted(boolean deleted) { + this.deleted = deleted; + return this; + } + + @java.lang.Override + public DeletedSchedulingHolidayCalendar build() { + return new DeletedSchedulingHolidayCalendar(id, deleted, additionalProperties); + } + + @java.lang.Override + public Builder additionalProperty(String key, Object value) { + this.additionalProperties.put(key, value); + return this; + } + + @java.lang.Override + public Builder additionalProperties(Map additionalProperties) { + this.additionalProperties.putAll(additionalProperties); + return this; + } + } +} diff --git a/sdks/java/src/main/java/com/coss/types/DeletedSchedulingOauthApp.java b/sdks/java/src/main/java/com/coss/types/DeletedSchedulingOauthApp.java new file mode 100644 index 000000000..f4eb7a4a1 --- /dev/null +++ b/sdks/java/src/main/java/com/coss/types/DeletedSchedulingOauthApp.java @@ -0,0 +1,166 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.coss.types; + +import com.coss.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = DeletedSchedulingOauthApp.Builder.class) +public final class DeletedSchedulingOauthApp { + private final DeletedSchedulingOauthAppObject object; + + private final String id; + + private final boolean deleted; + + private final Map additionalProperties; + + private DeletedSchedulingOauthApp( + DeletedSchedulingOauthAppObject object, + String id, + boolean deleted, + Map additionalProperties) { + this.object = object; + this.id = id; + this.deleted = deleted; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("object") + public DeletedSchedulingOauthAppObject getObject() { + return object; + } + + @JsonProperty("id") + public String getId() { + return id; + } + + @JsonProperty("deleted") + public boolean getDeleted() { + return deleted; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof DeletedSchedulingOauthApp && equalTo((DeletedSchedulingOauthApp) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(DeletedSchedulingOauthApp other) { + return object.equals(other.object) && id.equals(other.id) && deleted == other.deleted; + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.object, this.id, this.deleted); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ObjectStage builder() { + return new Builder(); + } + + public interface ObjectStage { + IdStage object(@NotNull DeletedSchedulingOauthAppObject object); + + Builder from(DeletedSchedulingOauthApp other); + } + + public interface IdStage { + DeletedStage id(@NotNull String id); + } + + public interface DeletedStage { + _FinalStage deleted(boolean deleted); + } + + public interface _FinalStage { + DeletedSchedulingOauthApp build(); + + _FinalStage additionalProperty(String key, Object value); + + _FinalStage additionalProperties(Map additionalProperties); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ObjectStage, IdStage, DeletedStage, _FinalStage { + private DeletedSchedulingOauthAppObject object; + + private String id; + + private boolean deleted; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(DeletedSchedulingOauthApp other) { + object(other.getObject()); + id(other.getId()); + deleted(other.getDeleted()); + return this; + } + + @java.lang.Override + @JsonSetter("object") + public IdStage object(@NotNull DeletedSchedulingOauthAppObject object) { + this.object = Objects.requireNonNull(object, "object must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("id") + public DeletedStage id(@NotNull String id) { + this.id = Objects.requireNonNull(id, "id must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("deleted") + public _FinalStage deleted(boolean deleted) { + this.deleted = deleted; + return this; + } + + @java.lang.Override + public DeletedSchedulingOauthApp build() { + return new DeletedSchedulingOauthApp(object, id, deleted, additionalProperties); + } + + @java.lang.Override + public Builder additionalProperty(String key, Object value) { + this.additionalProperties.put(key, value); + return this; + } + + @java.lang.Override + public Builder additionalProperties(Map additionalProperties) { + this.additionalProperties.putAll(additionalProperties); + return this; + } + } +} diff --git a/sdks/java/src/main/java/com/coss/types/DeletedSchedulingOauthAppObject.java b/sdks/java/src/main/java/com/coss/types/DeletedSchedulingOauthAppObject.java new file mode 100644 index 000000000..f29d22532 --- /dev/null +++ b/sdks/java/src/main/java/com/coss/types/DeletedSchedulingOauthAppObject.java @@ -0,0 +1,75 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.coss.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class DeletedSchedulingOauthAppObject { + public static final DeletedSchedulingOauthAppObject SCHEDULING_OAUTH_APP = + new DeletedSchedulingOauthAppObject(Value.SCHEDULING_OAUTH_APP, "scheduling.oauth_app"); + + private final Value value; + + private final String string; + + DeletedSchedulingOauthAppObject(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof DeletedSchedulingOauthAppObject + && this.string.equals(((DeletedSchedulingOauthAppObject) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case SCHEDULING_OAUTH_APP: + return visitor.visitSchedulingOauthApp(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static DeletedSchedulingOauthAppObject valueOf(String value) { + switch (value) { + case "scheduling.oauth_app": + return SCHEDULING_OAUTH_APP; + default: + return new DeletedSchedulingOauthAppObject(Value.UNKNOWN, value); + } + } + + public enum Value { + SCHEDULING_OAUTH_APP, + + UNKNOWN + } + + public interface Visitor { + T visitSchedulingOauthApp(); + + T visitUnknown(String unknownType); + } +} diff --git a/sdks/java/src/main/java/com/coss/types/DeletedSchedulingOutOfOffice.java b/sdks/java/src/main/java/com/coss/types/DeletedSchedulingOutOfOffice.java new file mode 100644 index 000000000..3d96572d6 --- /dev/null +++ b/sdks/java/src/main/java/com/coss/types/DeletedSchedulingOutOfOffice.java @@ -0,0 +1,166 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.coss.types; + +import com.coss.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = DeletedSchedulingOutOfOffice.Builder.class) +public final class DeletedSchedulingOutOfOffice { + private final DeletedSchedulingOutOfOfficeObject object; + + private final String id; + + private final boolean deleted; + + private final Map additionalProperties; + + private DeletedSchedulingOutOfOffice( + DeletedSchedulingOutOfOfficeObject object, + String id, + boolean deleted, + Map additionalProperties) { + this.object = object; + this.id = id; + this.deleted = deleted; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("object") + public DeletedSchedulingOutOfOfficeObject getObject() { + return object; + } + + @JsonProperty("id") + public String getId() { + return id; + } + + @JsonProperty("deleted") + public boolean getDeleted() { + return deleted; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof DeletedSchedulingOutOfOffice && equalTo((DeletedSchedulingOutOfOffice) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(DeletedSchedulingOutOfOffice other) { + return object.equals(other.object) && id.equals(other.id) && deleted == other.deleted; + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.object, this.id, this.deleted); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ObjectStage builder() { + return new Builder(); + } + + public interface ObjectStage { + IdStage object(@NotNull DeletedSchedulingOutOfOfficeObject object); + + Builder from(DeletedSchedulingOutOfOffice other); + } + + public interface IdStage { + DeletedStage id(@NotNull String id); + } + + public interface DeletedStage { + _FinalStage deleted(boolean deleted); + } + + public interface _FinalStage { + DeletedSchedulingOutOfOffice build(); + + _FinalStage additionalProperty(String key, Object value); + + _FinalStage additionalProperties(Map additionalProperties); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ObjectStage, IdStage, DeletedStage, _FinalStage { + private DeletedSchedulingOutOfOfficeObject object; + + private String id; + + private boolean deleted; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(DeletedSchedulingOutOfOffice other) { + object(other.getObject()); + id(other.getId()); + deleted(other.getDeleted()); + return this; + } + + @java.lang.Override + @JsonSetter("object") + public IdStage object(@NotNull DeletedSchedulingOutOfOfficeObject object) { + this.object = Objects.requireNonNull(object, "object must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("id") + public DeletedStage id(@NotNull String id) { + this.id = Objects.requireNonNull(id, "id must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("deleted") + public _FinalStage deleted(boolean deleted) { + this.deleted = deleted; + return this; + } + + @java.lang.Override + public DeletedSchedulingOutOfOffice build() { + return new DeletedSchedulingOutOfOffice(object, id, deleted, additionalProperties); + } + + @java.lang.Override + public Builder additionalProperty(String key, Object value) { + this.additionalProperties.put(key, value); + return this; + } + + @java.lang.Override + public Builder additionalProperties(Map additionalProperties) { + this.additionalProperties.putAll(additionalProperties); + return this; + } + } +} diff --git a/sdks/java/src/main/java/com/coss/types/DeletedSchedulingOutOfOfficeObject.java b/sdks/java/src/main/java/com/coss/types/DeletedSchedulingOutOfOfficeObject.java new file mode 100644 index 000000000..736d758fd --- /dev/null +++ b/sdks/java/src/main/java/com/coss/types/DeletedSchedulingOutOfOfficeObject.java @@ -0,0 +1,75 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.coss.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class DeletedSchedulingOutOfOfficeObject { + public static final DeletedSchedulingOutOfOfficeObject SCHEDULING_OUT_OF_OFFICE = + new DeletedSchedulingOutOfOfficeObject(Value.SCHEDULING_OUT_OF_OFFICE, "scheduling.out_of_office"); + + private final Value value; + + private final String string; + + DeletedSchedulingOutOfOfficeObject(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof DeletedSchedulingOutOfOfficeObject + && this.string.equals(((DeletedSchedulingOutOfOfficeObject) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case SCHEDULING_OUT_OF_OFFICE: + return visitor.visitSchedulingOutOfOffice(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static DeletedSchedulingOutOfOfficeObject valueOf(String value) { + switch (value) { + case "scheduling.out_of_office": + return SCHEDULING_OUT_OF_OFFICE; + default: + return new DeletedSchedulingOutOfOfficeObject(Value.UNKNOWN, value); + } + } + + public enum Value { + SCHEDULING_OUT_OF_OFFICE, + + UNKNOWN + } + + public interface Visitor { + T visitSchedulingOutOfOffice(); + + T visitUnknown(String unknownType); + } +} diff --git a/sdks/java/src/main/java/com/coss/types/SchedulingBooking.java b/sdks/java/src/main/java/com/coss/types/SchedulingBooking.java index 65d45828f..24c59adc0 100644 --- a/sdks/java/src/main/java/com/coss/types/SchedulingBooking.java +++ b/sdks/java/src/main/java/com/coss/types/SchedulingBooking.java @@ -45,7 +45,7 @@ public final class SchedulingBooking { private final List attendees; - private final SchedulingLocation location; + private final OptionalNullable location; private final OptionalNullable holdExpiresAt; @@ -87,7 +87,7 @@ private SchedulingBooking( String end, List hosts, List attendees, - SchedulingLocation location, + OptionalNullable location, OptionalNullable holdExpiresAt, OptionalNullable approvalExpiresAt, OptionalNullable series, @@ -196,8 +196,12 @@ public List getAttendees() { return attendees; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) @JsonProperty("location") - public SchedulingLocation getLocation() { + public OptionalNullable getLocation() { + if (location == null) { + return OptionalNullable.absent(); + } return location; } @@ -347,6 +351,12 @@ public String getUpdatedAt() { return updatedAt; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("location") + private OptionalNullable _getLocation() { + return location; + } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) @JsonProperty("hold_expires_at") private OptionalNullable _getHoldExpiresAt() { @@ -525,11 +535,7 @@ public interface EndStage { /** *

When the booking ends, without buffers.

*/ - LocationStage end(@NotNull String end); - } - - public interface LocationStage { - CalendarUnverifiedStage location(@NotNull SchedulingLocation location); + CalendarUnverifiedStage end(@NotNull String end); } public interface CalendarUnverifiedStage { @@ -572,6 +578,14 @@ public interface _FinalStage { _FinalStage addAllAttendees(List attendees); + _FinalStage location(OptionalNullable location); + + _FinalStage location(SchedulingLocation location); + + _FinalStage location(Optional location); + + _FinalStage location(Nullable location); + /** *

When a held booking gives up its slot. null otherwise.

*/ @@ -701,7 +715,6 @@ public static final class Builder TitleStage, StartStage, EndStage, - LocationStage, CalendarUnverifiedStage, CreatedAtStage, UpdatedAtStage, @@ -720,8 +733,6 @@ public static final class Builder private String end; - private SchedulingLocation location; - private boolean calendarUnverified; private String createdAt; @@ -750,6 +761,8 @@ public static final class Builder private OptionalNullable holdExpiresAt = OptionalNullable.absent(); + private OptionalNullable location = OptionalNullable.absent(); + private List attendees = new ArrayList<>(); private List hosts = new ArrayList<>(); @@ -852,18 +865,11 @@ public EndStage start(@NotNull String start) { */ @java.lang.Override @JsonSetter("end") - public LocationStage end(@NotNull String end) { + public CalendarUnverifiedStage end(@NotNull String end) { this.end = Objects.requireNonNull(end, "end must not be null"); return this; } - @java.lang.Override - @JsonSetter("location") - public CalendarUnverifiedStage location(@NotNull SchedulingLocation location) { - this.location = Objects.requireNonNull(location, "location must not be null"); - return this; - } - /** *

Reserved for flagging a booking made on last known calendar data. Nothing sets it yet, so it's always false.

* @return Reference to {@code this} so that method calls can be chained together. @@ -1424,6 +1430,41 @@ public _FinalStage holdExpiresAt(OptionalNullable holdExpiresAt) { return this; } + @java.lang.Override + public _FinalStage location(Nullable location) { + if (location.isNull()) { + this.location = OptionalNullable.ofNull(); + } else if (location.isEmpty()) { + this.location = OptionalNullable.absent(); + } else { + this.location = OptionalNullable.of(location.get()); + } + return this; + } + + @java.lang.Override + public _FinalStage location(Optional location) { + if (location.isPresent()) { + this.location = OptionalNullable.of(location.get()); + } else { + this.location = OptionalNullable.absent(); + } + return this; + } + + @java.lang.Override + public _FinalStage location(SchedulingLocation location) { + this.location = OptionalNullable.of(location); + return this; + } + + @java.lang.Override + @JsonSetter(value = "location", nulls = Nulls.SKIP) + public _FinalStage location(OptionalNullable location) { + this.location = location; + return this; + } + /** *

Who's booked: the attendee first, then any guests they added. A group session's seat is its own booking.

* @return Reference to {@code this} so that method calls can be chained together. diff --git a/sdks/java/src/main/java/com/coss/types/SchedulingBookingCancelledBy.java b/sdks/java/src/main/java/com/coss/types/SchedulingBookingCancelledBy.java index b13083a05..6498704cf 100644 --- a/sdks/java/src/main/java/com/coss/types/SchedulingBookingCancelledBy.java +++ b/sdks/java/src/main/java/com/coss/types/SchedulingBookingCancelledBy.java @@ -13,6 +13,9 @@ public final class SchedulingBookingCancelledBy { public static final SchedulingBookingCancelledBy HOST_SESSION = new SchedulingBookingCancelledBy(Value.HOST_SESSION, "host_session"); + public static final SchedulingBookingCancelledBy MANAGER_SESSION = + new SchedulingBookingCancelledBy(Value.MANAGER_SESSION, "manager_session"); + public static final SchedulingBookingCancelledBy USER = new SchedulingBookingCancelledBy(Value.USER, "user"); public static final SchedulingBookingCancelledBy MANAGE_SESSION = @@ -60,6 +63,8 @@ public T visit(Visitor visitor) { return visitor.visitBookerSession(); case HOST_SESSION: return visitor.visitHostSession(); + case MANAGER_SESSION: + return visitor.visitManagerSession(); case USER: return visitor.visitUser(); case MANAGE_SESSION: @@ -81,6 +86,8 @@ public static SchedulingBookingCancelledBy valueOf(String value) { return BOOKER_SESSION; case "host_session": return HOST_SESSION; + case "manager_session": + return MANAGER_SESSION; case "user": return USER; case "manage_session": @@ -105,6 +112,8 @@ public enum Value { MANAGE_SESSION, + MANAGER_SESSION, + SYSTEM, UNKNOWN @@ -121,6 +130,8 @@ public interface Visitor { T visitManageSession(); + T visitManagerSession(); + T visitSystem(); T visitUnknown(String unknownType); diff --git a/sdks/java/src/main/java/com/coss/types/SchedulingBookingEventActorKind.java b/sdks/java/src/main/java/com/coss/types/SchedulingBookingEventActorKind.java index f9c1a8765..90e555727 100644 --- a/sdks/java/src/main/java/com/coss/types/SchedulingBookingEventActorKind.java +++ b/sdks/java/src/main/java/com/coss/types/SchedulingBookingEventActorKind.java @@ -13,6 +13,9 @@ public final class SchedulingBookingEventActorKind { public static final SchedulingBookingEventActorKind HOST_SESSION = new SchedulingBookingEventActorKind(Value.HOST_SESSION, "host_session"); + public static final SchedulingBookingEventActorKind MANAGER_SESSION = + new SchedulingBookingEventActorKind(Value.MANAGER_SESSION, "manager_session"); + public static final SchedulingBookingEventActorKind USER = new SchedulingBookingEventActorKind(Value.USER, "user"); public static final SchedulingBookingEventActorKind MANAGE_SESSION = @@ -61,6 +64,8 @@ public T visit(Visitor visitor) { return visitor.visitBookerSession(); case HOST_SESSION: return visitor.visitHostSession(); + case MANAGER_SESSION: + return visitor.visitManagerSession(); case USER: return visitor.visitUser(); case MANAGE_SESSION: @@ -82,6 +87,8 @@ public static SchedulingBookingEventActorKind valueOf(String value) { return BOOKER_SESSION; case "host_session": return HOST_SESSION; + case "manager_session": + return MANAGER_SESSION; case "user": return USER; case "manage_session": @@ -106,6 +113,8 @@ public enum Value { MANAGE_SESSION, + MANAGER_SESSION, + SYSTEM, UNKNOWN @@ -122,6 +131,8 @@ public interface Visitor { T visitManageSession(); + T visitManagerSession(); + T visitSystem(); T visitUnknown(String unknownType); diff --git a/sdks/java/src/main/java/com/coss/types/SchedulingBookingWebhookData.java b/sdks/java/src/main/java/com/coss/types/SchedulingBookingWebhookData.java index 7ac52c309..4899107dd 100644 --- a/sdks/java/src/main/java/com/coss/types/SchedulingBookingWebhookData.java +++ b/sdks/java/src/main/java/com/coss/types/SchedulingBookingWebhookData.java @@ -44,6 +44,10 @@ public final class SchedulingBookingWebhookData { private final Optional previousStart; + private final Optional> previousHostIds; + + private final Optional reassignmentId; + private final Optional reminder; private final String occurredAt; @@ -60,6 +64,8 @@ private SchedulingBookingWebhookData( List attendeeUids, OptionalNullable seriesId, Optional previousStart, + Optional> previousHostIds, + Optional reassignmentId, Optional reminder, String occurredAt, Map additionalProperties) { @@ -72,6 +78,8 @@ private SchedulingBookingWebhookData( this.attendeeUids = attendeeUids; this.seriesId = seriesId; this.previousStart = previousStart; + this.previousHostIds = previousHostIds; + this.reassignmentId = reassignmentId; this.reminder = reminder; this.occurredAt = occurredAt; this.additionalProperties = additionalProperties; @@ -153,6 +161,22 @@ public Optional getPreviousStart() { return previousStart; } + /** + * @return On scheduling.booking.reassigned: who had it before. + */ + @JsonProperty("previous_host_ids") + public Optional> getPreviousHostIds() { + return previousHostIds; + } + + /** + * @return On scheduling.booking.reassigned: the bulk reassignment it was part of. + */ + @JsonProperty("reassignment_id") + public Optional getReassignmentId() { + return reassignmentId; + } + /** * @return scheduling.booking.reminder: which reminder this is. */ @@ -196,6 +220,8 @@ private boolean equalTo(SchedulingBookingWebhookData other) { && attendeeUids.equals(other.attendeeUids) && seriesId.equals(other.seriesId) && previousStart.equals(other.previousStart) + && previousHostIds.equals(other.previousHostIds) + && reassignmentId.equals(other.reassignmentId) && reminder.equals(other.reminder) && occurredAt.equals(other.occurredAt); } @@ -212,6 +238,8 @@ public int hashCode() { this.attendeeUids, this.seriesId, this.previousStart, + this.previousHostIds, + this.reassignmentId, this.reminder, this.occurredAt); } @@ -312,6 +340,20 @@ public interface _FinalStage { _FinalStage previousStart(String previousStart); + /** + *

On scheduling.booking.reassigned: who had it before.

+ */ + _FinalStage previousHostIds(Optional> previousHostIds); + + _FinalStage previousHostIds(List previousHostIds); + + /** + *

On scheduling.booking.reassigned: the bulk reassignment it was part of.

+ */ + _FinalStage reassignmentId(Optional reassignmentId); + + _FinalStage reassignmentId(String reassignmentId); + /** *

scheduling.booking.reminder: which reminder this is.

*/ @@ -343,6 +385,10 @@ public static final class Builder private Optional reminder = Optional.empty(); + private Optional reassignmentId = Optional.empty(); + + private Optional> previousHostIds = Optional.empty(); + private Optional previousStart = Optional.empty(); private OptionalNullable seriesId = OptionalNullable.absent(); @@ -367,6 +413,8 @@ public Builder from(SchedulingBookingWebhookData other) { attendeeUids(other.getAttendeeUids()); seriesId(other.getSeriesId()); previousStart(other.getPreviousStart()); + previousHostIds(other.getPreviousHostIds()); + reassignmentId(other.getReassignmentId()); reminder(other.getReminder()); occurredAt(other.getOccurredAt()); return this; @@ -458,6 +506,46 @@ public _FinalStage reminder(Optional remin return this; } + /** + *

On scheduling.booking.reassigned: the bulk reassignment it was part of.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage reassignmentId(String reassignmentId) { + this.reassignmentId = Optional.ofNullable(reassignmentId); + return this; + } + + /** + *

On scheduling.booking.reassigned: the bulk reassignment it was part of.

+ */ + @java.lang.Override + @JsonSetter(value = "reassignment_id", nulls = Nulls.SKIP) + public _FinalStage reassignmentId(Optional reassignmentId) { + this.reassignmentId = reassignmentId; + return this; + } + + /** + *

On scheduling.booking.reassigned: who had it before.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage previousHostIds(List previousHostIds) { + this.previousHostIds = Optional.ofNullable(previousHostIds); + return this; + } + + /** + *

On scheduling.booking.reassigned: who had it before.

+ */ + @java.lang.Override + @JsonSetter(value = "previous_host_ids", nulls = Nulls.SKIP) + public _FinalStage previousHostIds(Optional> previousHostIds) { + this.previousHostIds = previousHostIds; + return this; + } + /** *

scheduling.booking.rescheduled: when it used to start.

* @return Reference to {@code this} so that method calls can be chained together. @@ -610,6 +698,8 @@ public SchedulingBookingWebhookData build() { attendeeUids, seriesId, previousStart, + previousHostIds, + reassignmentId, reminder, occurredAt, additionalProperties); diff --git a/sdks/java/src/main/java/com/coss/types/SchedulingBookingWebhookEventType.java b/sdks/java/src/main/java/com/coss/types/SchedulingBookingWebhookEventType.java index fed891b99..125c5d333 100644 --- a/sdks/java/src/main/java/com/coss/types/SchedulingBookingWebhookEventType.java +++ b/sdks/java/src/main/java/com/coss/types/SchedulingBookingWebhookEventType.java @@ -16,6 +16,9 @@ public final class SchedulingBookingWebhookEventType { public static final SchedulingBookingWebhookEventType SCHEDULING_BOOKING_DECLINED = new SchedulingBookingWebhookEventType(Value.SCHEDULING_BOOKING_DECLINED, "scheduling.booking.declined"); + public static final SchedulingBookingWebhookEventType SCHEDULING_BOOKING_REASSIGNED = + new SchedulingBookingWebhookEventType(Value.SCHEDULING_BOOKING_REASSIGNED, "scheduling.booking.reassigned"); + public static final SchedulingBookingWebhookEventType SCHEDULING_BOOKING_CALENDAR_WRITE_FAILED = new SchedulingBookingWebhookEventType( Value.SCHEDULING_BOOKING_CALENDAR_WRITE_FAILED, "scheduling.booking.calendar_write_failed"); @@ -90,6 +93,8 @@ public T visit(Visitor visitor) { return visitor.visitSchedulingBookingStarted(); case SCHEDULING_BOOKING_DECLINED: return visitor.visitSchedulingBookingDeclined(); + case SCHEDULING_BOOKING_REASSIGNED: + return visitor.visitSchedulingBookingReassigned(); case SCHEDULING_BOOKING_CALENDAR_WRITE_FAILED: return visitor.visitSchedulingBookingCalendarWriteFailed(); case SCHEDULING_BOOKING_RESCHEDULED: @@ -125,6 +130,8 @@ public static SchedulingBookingWebhookEventType valueOf(String value) { return SCHEDULING_BOOKING_STARTED; case "scheduling.booking.declined": return SCHEDULING_BOOKING_DECLINED; + case "scheduling.booking.reassigned": + return SCHEDULING_BOOKING_REASSIGNED; case "scheduling.booking.calendar_write_failed": return SCHEDULING_BOOKING_CALENDAR_WRITE_FAILED; case "scheduling.booking.rescheduled": @@ -171,6 +178,8 @@ public enum Value { SCHEDULING_BOOKING_LOCATION_READY, + SCHEDULING_BOOKING_REASSIGNED, + SCHEDULING_BOOKING_STARTED, SCHEDULING_BOOKING_ENDED, @@ -201,6 +210,8 @@ public interface Visitor { T visitSchedulingBookingLocationReady(); + T visitSchedulingBookingReassigned(); + T visitSchedulingBookingStarted(); T visitSchedulingBookingEnded(); diff --git a/sdks/java/src/main/java/com/coss/types/SchedulingCalendarConnection.java b/sdks/java/src/main/java/com/coss/types/SchedulingCalendarConnection.java index 471969d1c..77694ee8e 100644 --- a/sdks/java/src/main/java/com/coss/types/SchedulingCalendarConnection.java +++ b/sdks/java/src/main/java/com/coss/types/SchedulingCalendarConnection.java @@ -38,6 +38,8 @@ public final class SchedulingCalendarConnection { private final SchedulingCalendarConnectionStatus status; + private final OptionalNullable oauthApp; + private final OptionalNullable delegation; private final List calendars; @@ -53,6 +55,7 @@ private SchedulingCalendarConnection( SchedulingCalendarConnectionProvider provider, String account, SchedulingCalendarConnectionStatus status, + OptionalNullable oauthApp, OptionalNullable delegation, List calendars, String createdAt, @@ -63,6 +66,7 @@ private SchedulingCalendarConnection( this.provider = provider; this.account = account; this.status = status; + this.oauthApp = oauthApp; this.delegation = delegation; this.calendars = calendars; this.createdAt = createdAt; @@ -111,6 +115,18 @@ public SchedulingCalendarConnectionStatus getStatus() { return status; } + /** + * @return Your own OAuth app this connection's access came through. null: coss.com's, or no consent was involved. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("oauth_app") + public OptionalNullable getOauthApp() { + if (oauthApp == null) { + return OptionalNullable.absent(); + } + return oauthApp; + } + /** * @return The calendar delegation that manages this connection. It can't be disconnected or reconnected by itself. */ @@ -136,6 +152,12 @@ public String getCreatedAt() { return createdAt; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("oauth_app") + private OptionalNullable _getOauthApp() { + return oauthApp; + } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) @JsonProperty("delegation") private OptionalNullable _getDelegation() { @@ -160,6 +182,7 @@ private boolean equalTo(SchedulingCalendarConnection other) { && provider.equals(other.provider) && account.equals(other.account) && status.equals(other.status) + && oauthApp.equals(other.oauthApp) && delegation.equals(other.delegation) && calendars.equals(other.calendars) && createdAt.equals(other.createdAt); @@ -174,6 +197,7 @@ public int hashCode() { this.provider, this.account, this.status, + this.oauthApp, this.delegation, this.calendars, this.createdAt); @@ -237,6 +261,17 @@ public interface _FinalStage { _FinalStage additionalProperties(Map additionalProperties); + /** + *

Your own OAuth app this connection's access came through. null: coss.com's, or no consent was involved.

+ */ + _FinalStage oauthApp(OptionalNullable oauthApp); + + _FinalStage oauthApp(String oauthApp); + + _FinalStage oauthApp(Optional oauthApp); + + _FinalStage oauthApp(Nullable oauthApp); + /** *

The calendar delegation that manages this connection. It can't be disconnected or reconnected by itself.

*/ @@ -286,6 +321,8 @@ public static final class Builder private OptionalNullable delegation = OptionalNullable.absent(); + private OptionalNullable oauthApp = OptionalNullable.absent(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -299,6 +336,7 @@ public Builder from(SchedulingCalendarConnection other) { provider(other.getProvider()); account(other.getAccount()); status(other.getStatus()); + oauthApp(other.getOauthApp()); delegation(other.getDelegation()); calendars(other.getCalendars()); createdAt(other.getCreatedAt()); @@ -455,6 +493,56 @@ public _FinalStage delegation(OptionalNullable delegation) { return this; } + /** + *

Your own OAuth app this connection's access came through. null: coss.com's, or no consent was involved.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage oauthApp(Nullable oauthApp) { + if (oauthApp.isNull()) { + this.oauthApp = OptionalNullable.ofNull(); + } else if (oauthApp.isEmpty()) { + this.oauthApp = OptionalNullable.absent(); + } else { + this.oauthApp = OptionalNullable.of(oauthApp.get()); + } + return this; + } + + /** + *

Your own OAuth app this connection's access came through. null: coss.com's, or no consent was involved.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage oauthApp(Optional oauthApp) { + if (oauthApp.isPresent()) { + this.oauthApp = OptionalNullable.of(oauthApp.get()); + } else { + this.oauthApp = OptionalNullable.absent(); + } + return this; + } + + /** + *

Your own OAuth app this connection's access came through. null: coss.com's, or no consent was involved.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage oauthApp(String oauthApp) { + this.oauthApp = OptionalNullable.of(oauthApp); + return this; + } + + /** + *

Your own OAuth app this connection's access came through. null: coss.com's, or no consent was involved.

+ */ + @java.lang.Override + @JsonSetter(value = "oauth_app", nulls = Nulls.SKIP) + public _FinalStage oauthApp(OptionalNullable oauthApp) { + this.oauthApp = oauthApp; + return this; + } + @java.lang.Override public SchedulingCalendarConnection build() { return new SchedulingCalendarConnection( @@ -464,6 +552,7 @@ public SchedulingCalendarConnection build() { provider, account, status, + oauthApp, delegation, calendars, createdAt, diff --git a/sdks/java/src/main/java/com/coss/types/SchedulingEventType.java b/sdks/java/src/main/java/com/coss/types/SchedulingEventType.java index 2a034b3a3..d824a9e7f 100644 --- a/sdks/java/src/main/java/com/coss/types/SchedulingEventType.java +++ b/sdks/java/src/main/java/com/coss/types/SchedulingEventType.java @@ -63,6 +63,8 @@ public final class SchedulingEventType { private final boolean requiresApproval; + private final boolean reassignmentEnabled; + private final double approvalTtlMinutes; private final double holdTtlSeconds; @@ -79,7 +81,7 @@ public final class SchedulingEventType { private final List questions; - private final List locations; + private final List> locations; private final OptionalNullable>> hostFilter; @@ -116,6 +118,7 @@ private SchedulingEventType( List limits, OptionalNullable capacity, boolean requiresApproval, + boolean reassignmentEnabled, double approvalTtlMinutes, double holdTtlSeconds, double cancelNoticeMinutes, @@ -124,7 +127,7 @@ private SchedulingEventType( OptionalNullable maxActiveBookingsPerAttendee, SchedulingEventTypeHostCalendarDetails hostCalendarDetails, List questions, - List locations, + List> locations, OptionalNullable>> hostFilter, OptionalNullable>> notifications, OptionalNullable> reminders, @@ -151,6 +154,7 @@ private SchedulingEventType( this.limits = limits; this.capacity = capacity; this.requiresApproval = requiresApproval; + this.reassignmentEnabled = reassignmentEnabled; this.approvalTtlMinutes = approvalTtlMinutes; this.holdTtlSeconds = holdTtlSeconds; this.cancelNoticeMinutes = cancelNoticeMinutes; @@ -325,6 +329,14 @@ public boolean getRequiresApproval() { return requiresApproval; } + /** + * @return Whether bookings of this event type can go to another host. + */ + @JsonProperty("reassignment_enabled") + public boolean getReassignmentEnabled() { + return reassignmentEnabled; + } + /** * @return How long a booking can wait for approval before it's declined, in minutes. */ @@ -397,7 +409,7 @@ public List getQuestions() { * @return Where bookings can meet. A browser only chooses among these. */ @JsonProperty("locations") - public List getLocations() { + public List> getLocations() { return locations; } @@ -547,6 +559,7 @@ private boolean equalTo(SchedulingEventType other) { && limits.equals(other.limits) && capacity.equals(other.capacity) && requiresApproval == other.requiresApproval + && reassignmentEnabled == other.reassignmentEnabled && approvalTtlMinutes == other.approvalTtlMinutes && holdTtlSeconds == other.holdTtlSeconds && cancelNoticeMinutes == other.cancelNoticeMinutes @@ -586,6 +599,7 @@ public int hashCode() { this.limits, this.capacity, this.requiresApproval, + this.reassignmentEnabled, this.approvalTtlMinutes, this.holdTtlSeconds, this.cancelNoticeMinutes, @@ -683,7 +697,14 @@ public interface RequiresApprovalStage { /** *

Whether bookings start as pending_approval, holding the time until approved or declined.

*/ - ApprovalTtlMinutesStage requiresApproval(boolean requiresApproval); + ReassignmentEnabledStage requiresApproval(boolean requiresApproval); + } + + public interface ReassignmentEnabledStage { + /** + *

Whether bookings of this event type can go to another host.

+ */ + ApprovalTtlMinutesStage reassignmentEnabled(boolean reassignmentEnabled); } public interface ApprovalTtlMinutesStage { @@ -836,11 +857,11 @@ public interface _FinalStage { /** *

Where bookings can meet. A browser only chooses among these.

*/ - _FinalStage locations(List locations); + _FinalStage locations(List> locations); - _FinalStage addLocations(SchedulingLocation locations); + _FinalStage addLocations(OptionalNullable locations); - _FinalStage addAllLocations(List locations); + _FinalStage addAllLocations(List> locations); /** *

Pool members also include active hosts matching all of these attributes. null: only hosts.

@@ -911,6 +932,7 @@ public static final class Builder BufferAfterMinutesStage, MinNoticeMinutesStage, RequiresApprovalStage, + ReassignmentEnabledStage, ApprovalTtlMinutesStage, HoldTtlSecondsStage, CancelNoticeMinutesStage, @@ -942,6 +964,8 @@ public static final class Builder private boolean requiresApproval; + private boolean reassignmentEnabled; + private double approvalTtlMinutes; private double holdTtlSeconds; @@ -970,7 +994,7 @@ public static final class Builder private OptionalNullable>> hostFilter = OptionalNullable.absent(); - private List locations = new ArrayList<>(); + private List> locations = new ArrayList<>(); private List questions = new ArrayList<>(); @@ -1015,6 +1039,7 @@ public Builder from(SchedulingEventType other) { limits(other.getLimits()); capacity(other.getCapacity()); requiresApproval(other.getRequiresApproval()); + reassignmentEnabled(other.getReassignmentEnabled()); approvalTtlMinutes(other.getApprovalTtlMinutes()); holdTtlSeconds(other.getHoldTtlSeconds()); cancelNoticeMinutes(other.getCancelNoticeMinutes()); @@ -1142,11 +1167,22 @@ public RequiresApprovalStage minNoticeMinutes(double minNoticeMinutes) { */ @java.lang.Override @JsonSetter("requires_approval") - public ApprovalTtlMinutesStage requiresApproval(boolean requiresApproval) { + public ReassignmentEnabledStage requiresApproval(boolean requiresApproval) { this.requiresApproval = requiresApproval; return this; } + /** + *

Whether bookings of this event type can go to another host.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("reassignment_enabled") + public ApprovalTtlMinutesStage reassignmentEnabled(boolean reassignmentEnabled) { + this.reassignmentEnabled = reassignmentEnabled; + return this; + } + /** *

How long a booking can wait for approval before it's declined, in minutes.

* @return Reference to {@code this} so that method calls can be chained together. @@ -1460,7 +1496,7 @@ public _FinalStage hostFilter( * @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override - public _FinalStage addAllLocations(List locations) { + public _FinalStage addAllLocations(List> locations) { if (locations != null) { this.locations.addAll(locations); } @@ -1472,7 +1508,7 @@ public _FinalStage addAllLocations(List locations) { * @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override - public _FinalStage addLocations(SchedulingLocation locations) { + public _FinalStage addLocations(OptionalNullable locations) { this.locations.add(locations); return this; } @@ -1482,7 +1518,7 @@ public _FinalStage addLocations(SchedulingLocation locations) { */ @java.lang.Override @JsonSetter(value = "locations", nulls = Nulls.SKIP) - public _FinalStage locations(List locations) { + public _FinalStage locations(List> locations) { this.locations.clear(); if (locations != null) { this.locations.addAll(locations); @@ -1901,6 +1937,7 @@ public SchedulingEventType build() { limits, capacity, requiresApproval, + reassignmentEnabled, approvalTtlMinutes, holdTtlSeconds, cancelNoticeMinutes, diff --git a/sdks/java/src/main/java/com/coss/types/SchedulingHolidayCalendar.java b/sdks/java/src/main/java/com/coss/types/SchedulingHolidayCalendar.java new file mode 100644 index 000000000..c86b9415e --- /dev/null +++ b/sdks/java/src/main/java/com/coss/types/SchedulingHolidayCalendar.java @@ -0,0 +1,776 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.coss.types; + +import com.coss.core.Nullable; +import com.coss.core.NullableNonemptyFilter; +import com.coss.core.ObjectMappers; +import com.coss.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = SchedulingHolidayCalendar.Builder.class) +public final class SchedulingHolidayCalendar { + private final SchedulingHolidayCalendarObject object; + + private final String id; + + private final String name; + + private final SchedulingHolidayCalendarSource source; + + private final OptionalNullable country; + + private final OptionalNullable> hosts; + + private final OptionalNullable>> hostFilter; + + private final OptionalNullable> regions; + + private final List delegates; + + private final SchedulingHolidayCalendarExistingBookings existingBookings; + + private final OptionalNullable lastReadAt; + + private final OptionalNullable lastError; + + private final String createdAt; + + private final String updatedAt; + + private final Map additionalProperties; + + private SchedulingHolidayCalendar( + SchedulingHolidayCalendarObject object, + String id, + String name, + SchedulingHolidayCalendarSource source, + OptionalNullable country, + OptionalNullable> hosts, + OptionalNullable>> hostFilter, + OptionalNullable> regions, + List delegates, + SchedulingHolidayCalendarExistingBookings existingBookings, + OptionalNullable lastReadAt, + OptionalNullable lastError, + String createdAt, + String updatedAt, + Map additionalProperties) { + this.object = object; + this.id = id; + this.name = name; + this.source = source; + this.country = country; + this.hosts = hosts; + this.hostFilter = hostFilter; + this.regions = regions; + this.delegates = delegates; + this.existingBookings = existingBookings; + this.lastReadAt = lastReadAt; + this.lastError = lastError; + this.createdAt = createdAt; + this.updatedAt = updatedAt; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("object") + public SchedulingHolidayCalendarObject getObject() { + return object; + } + + @JsonProperty("id") + public String getId() { + return id; + } + + @JsonProperty("name") + public String getName() { + return name; + } + + @JsonProperty("source") + public SchedulingHolidayCalendarSource getSource() { + return source; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("country") + public OptionalNullable getCountry() { + if (country == null) { + return OptionalNullable.absent(); + } + return country; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("hosts") + public OptionalNullable> getHosts() { + if (hosts == null) { + return OptionalNullable.absent(); + } + return hosts; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("host_filter") + public OptionalNullable>> getHostFilter() { + if (hostFilter == null) { + return OptionalNullable.absent(); + } + return hostFilter; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("regions") + public OptionalNullable> getRegions() { + if (regions == null) { + return OptionalNullable.absent(); + } + return regions; + } + + @JsonProperty("delegates") + public List getDelegates() { + return delegates; + } + + @JsonProperty("existing_bookings") + public SchedulingHolidayCalendarExistingBookings getExistingBookings() { + return existingBookings; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("last_read_at") + public OptionalNullable getLastReadAt() { + if (lastReadAt == null) { + return OptionalNullable.absent(); + } + return lastReadAt; + } + + /** + * @return Why its feed couldn't be read. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("last_error") + public OptionalNullable getLastError() { + if (lastError == null) { + return OptionalNullable.absent(); + } + return lastError; + } + + @JsonProperty("created_at") + public String getCreatedAt() { + return createdAt; + } + + @JsonProperty("updated_at") + public String getUpdatedAt() { + return updatedAt; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("country") + private OptionalNullable _getCountry() { + return country; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("hosts") + private OptionalNullable> _getHosts() { + return hosts; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("host_filter") + private OptionalNullable>> _getHostFilter() { + return hostFilter; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("regions") + private OptionalNullable> _getRegions() { + return regions; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("last_read_at") + private OptionalNullable _getLastReadAt() { + return lastReadAt; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("last_error") + private OptionalNullable _getLastError() { + return lastError; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof SchedulingHolidayCalendar && equalTo((SchedulingHolidayCalendar) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(SchedulingHolidayCalendar other) { + return object.equals(other.object) + && id.equals(other.id) + && name.equals(other.name) + && source.equals(other.source) + && country.equals(other.country) + && hosts.equals(other.hosts) + && hostFilter.equals(other.hostFilter) + && regions.equals(other.regions) + && delegates.equals(other.delegates) + && existingBookings.equals(other.existingBookings) + && lastReadAt.equals(other.lastReadAt) + && lastError.equals(other.lastError) + && createdAt.equals(other.createdAt) + && updatedAt.equals(other.updatedAt); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.object, + this.id, + this.name, + this.source, + this.country, + this.hosts, + this.hostFilter, + this.regions, + this.delegates, + this.existingBookings, + this.lastReadAt, + this.lastError, + this.createdAt, + this.updatedAt); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ObjectStage builder() { + return new Builder(); + } + + public interface ObjectStage { + IdStage object(@NotNull SchedulingHolidayCalendarObject object); + + Builder from(SchedulingHolidayCalendar other); + } + + public interface IdStage { + NameStage id(@NotNull String id); + } + + public interface NameStage { + SourceStage name(@NotNull String name); + } + + public interface SourceStage { + ExistingBookingsStage source(@NotNull SchedulingHolidayCalendarSource source); + } + + public interface ExistingBookingsStage { + CreatedAtStage existingBookings(@NotNull SchedulingHolidayCalendarExistingBookings existingBookings); + } + + public interface CreatedAtStage { + UpdatedAtStage createdAt(@NotNull String createdAt); + } + + public interface UpdatedAtStage { + _FinalStage updatedAt(@NotNull String updatedAt); + } + + public interface _FinalStage { + SchedulingHolidayCalendar build(); + + _FinalStage additionalProperty(String key, Object value); + + _FinalStage additionalProperties(Map additionalProperties); + + _FinalStage country(OptionalNullable country); + + _FinalStage country(String country); + + _FinalStage country(Optional country); + + _FinalStage country(Nullable country); + + _FinalStage hosts(OptionalNullable> hosts); + + _FinalStage hosts(List hosts); + + _FinalStage hosts(Optional> hosts); + + _FinalStage hosts(Nullable> hosts); + + _FinalStage hostFilter( + OptionalNullable>> hostFilter); + + _FinalStage hostFilter(Map> hostFilter); + + _FinalStage hostFilter( + Optional>> hostFilter); + + _FinalStage hostFilter( + Nullable>> hostFilter); + + _FinalStage regions(OptionalNullable> regions); + + _FinalStage regions(List regions); + + _FinalStage regions(Optional> regions); + + _FinalStage regions(Nullable> regions); + + _FinalStage delegates(List delegates); + + _FinalStage addDelegates(String delegates); + + _FinalStage addAllDelegates(List delegates); + + _FinalStage lastReadAt(OptionalNullable lastReadAt); + + _FinalStage lastReadAt(String lastReadAt); + + _FinalStage lastReadAt(Optional lastReadAt); + + _FinalStage lastReadAt(Nullable lastReadAt); + + /** + *

Why its feed couldn't be read.

+ */ + _FinalStage lastError(OptionalNullable lastError); + + _FinalStage lastError(String lastError); + + _FinalStage lastError(Optional lastError); + + _FinalStage lastError(Nullable lastError); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder + implements ObjectStage, + IdStage, + NameStage, + SourceStage, + ExistingBookingsStage, + CreatedAtStage, + UpdatedAtStage, + _FinalStage { + private SchedulingHolidayCalendarObject object; + + private String id; + + private String name; + + private SchedulingHolidayCalendarSource source; + + private SchedulingHolidayCalendarExistingBookings existingBookings; + + private String createdAt; + + private String updatedAt; + + private OptionalNullable lastError = OptionalNullable.absent(); + + private OptionalNullable lastReadAt = OptionalNullable.absent(); + + private List delegates = new ArrayList<>(); + + private OptionalNullable> regions = OptionalNullable.absent(); + + private OptionalNullable>> hostFilter = + OptionalNullable.absent(); + + private OptionalNullable> hosts = OptionalNullable.absent(); + + private OptionalNullable country = OptionalNullable.absent(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(SchedulingHolidayCalendar other) { + object(other.getObject()); + id(other.getId()); + name(other.getName()); + source(other.getSource()); + country(other.getCountry()); + hosts(other.getHosts()); + hostFilter(other.getHostFilter()); + regions(other.getRegions()); + delegates(other.getDelegates()); + existingBookings(other.getExistingBookings()); + lastReadAt(other.getLastReadAt()); + lastError(other.getLastError()); + createdAt(other.getCreatedAt()); + updatedAt(other.getUpdatedAt()); + return this; + } + + @java.lang.Override + @JsonSetter("object") + public IdStage object(@NotNull SchedulingHolidayCalendarObject object) { + this.object = Objects.requireNonNull(object, "object must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("id") + public NameStage id(@NotNull String id) { + this.id = Objects.requireNonNull(id, "id must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("name") + public SourceStage name(@NotNull String name) { + this.name = Objects.requireNonNull(name, "name must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("source") + public ExistingBookingsStage source(@NotNull SchedulingHolidayCalendarSource source) { + this.source = Objects.requireNonNull(source, "source must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("existing_bookings") + public CreatedAtStage existingBookings(@NotNull SchedulingHolidayCalendarExistingBookings existingBookings) { + this.existingBookings = Objects.requireNonNull(existingBookings, "existingBookings must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("created_at") + public UpdatedAtStage createdAt(@NotNull String createdAt) { + this.createdAt = Objects.requireNonNull(createdAt, "createdAt must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("updated_at") + public _FinalStage updatedAt(@NotNull String updatedAt) { + this.updatedAt = Objects.requireNonNull(updatedAt, "updatedAt must not be null"); + return this; + } + + /** + *

Why its feed couldn't be read.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage lastError(Nullable lastError) { + if (lastError.isNull()) { + this.lastError = OptionalNullable.ofNull(); + } else if (lastError.isEmpty()) { + this.lastError = OptionalNullable.absent(); + } else { + this.lastError = OptionalNullable.of(lastError.get()); + } + return this; + } + + /** + *

Why its feed couldn't be read.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage lastError(Optional lastError) { + if (lastError.isPresent()) { + this.lastError = OptionalNullable.of(lastError.get()); + } else { + this.lastError = OptionalNullable.absent(); + } + return this; + } + + /** + *

Why its feed couldn't be read.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage lastError(String lastError) { + this.lastError = OptionalNullable.of(lastError); + return this; + } + + /** + *

Why its feed couldn't be read.

+ */ + @java.lang.Override + @JsonSetter(value = "last_error", nulls = Nulls.SKIP) + public _FinalStage lastError(OptionalNullable lastError) { + this.lastError = lastError; + return this; + } + + @java.lang.Override + public _FinalStage lastReadAt(Nullable lastReadAt) { + if (lastReadAt.isNull()) { + this.lastReadAt = OptionalNullable.ofNull(); + } else if (lastReadAt.isEmpty()) { + this.lastReadAt = OptionalNullable.absent(); + } else { + this.lastReadAt = OptionalNullable.of(lastReadAt.get()); + } + return this; + } + + @java.lang.Override + public _FinalStage lastReadAt(Optional lastReadAt) { + if (lastReadAt.isPresent()) { + this.lastReadAt = OptionalNullable.of(lastReadAt.get()); + } else { + this.lastReadAt = OptionalNullable.absent(); + } + return this; + } + + @java.lang.Override + public _FinalStage lastReadAt(String lastReadAt) { + this.lastReadAt = OptionalNullable.of(lastReadAt); + return this; + } + + @java.lang.Override + @JsonSetter(value = "last_read_at", nulls = Nulls.SKIP) + public _FinalStage lastReadAt(OptionalNullable lastReadAt) { + this.lastReadAt = lastReadAt; + return this; + } + + @java.lang.Override + public _FinalStage addAllDelegates(List delegates) { + if (delegates != null) { + this.delegates.addAll(delegates); + } + return this; + } + + @java.lang.Override + public _FinalStage addDelegates(String delegates) { + this.delegates.add(delegates); + return this; + } + + @java.lang.Override + @JsonSetter(value = "delegates", nulls = Nulls.SKIP) + public _FinalStage delegates(List delegates) { + this.delegates.clear(); + if (delegates != null) { + this.delegates.addAll(delegates); + } + return this; + } + + @java.lang.Override + public _FinalStage regions(Nullable> regions) { + if (regions.isNull()) { + this.regions = OptionalNullable.ofNull(); + } else if (regions.isEmpty()) { + this.regions = OptionalNullable.absent(); + } else { + this.regions = OptionalNullable.of(regions.get()); + } + return this; + } + + @java.lang.Override + public _FinalStage regions(Optional> regions) { + if (regions.isPresent()) { + this.regions = OptionalNullable.of(regions.get()); + } else { + this.regions = OptionalNullable.absent(); + } + return this; + } + + @java.lang.Override + public _FinalStage regions(List regions) { + this.regions = OptionalNullable.of(regions); + return this; + } + + @java.lang.Override + @JsonSetter(value = "regions", nulls = Nulls.SKIP) + public _FinalStage regions(OptionalNullable> regions) { + this.regions = regions; + return this; + } + + @java.lang.Override + public _FinalStage hostFilter( + Nullable>> hostFilter) { + if (hostFilter.isNull()) { + this.hostFilter = OptionalNullable.ofNull(); + } else if (hostFilter.isEmpty()) { + this.hostFilter = OptionalNullable.absent(); + } else { + this.hostFilter = OptionalNullable.of(hostFilter.get()); + } + return this; + } + + @java.lang.Override + public _FinalStage hostFilter( + Optional>> hostFilter) { + if (hostFilter.isPresent()) { + this.hostFilter = OptionalNullable.of(hostFilter.get()); + } else { + this.hostFilter = OptionalNullable.absent(); + } + return this; + } + + @java.lang.Override + public _FinalStage hostFilter( + Map> hostFilter) { + this.hostFilter = OptionalNullable.of(hostFilter); + return this; + } + + @java.lang.Override + @JsonSetter(value = "host_filter", nulls = Nulls.SKIP) + public _FinalStage hostFilter( + OptionalNullable>> hostFilter) { + this.hostFilter = hostFilter; + return this; + } + + @java.lang.Override + public _FinalStage hosts(Nullable> hosts) { + if (hosts.isNull()) { + this.hosts = OptionalNullable.ofNull(); + } else if (hosts.isEmpty()) { + this.hosts = OptionalNullable.absent(); + } else { + this.hosts = OptionalNullable.of(hosts.get()); + } + return this; + } + + @java.lang.Override + public _FinalStage hosts(Optional> hosts) { + if (hosts.isPresent()) { + this.hosts = OptionalNullable.of(hosts.get()); + } else { + this.hosts = OptionalNullable.absent(); + } + return this; + } + + @java.lang.Override + public _FinalStage hosts(List hosts) { + this.hosts = OptionalNullable.of(hosts); + return this; + } + + @java.lang.Override + @JsonSetter(value = "hosts", nulls = Nulls.SKIP) + public _FinalStage hosts(OptionalNullable> hosts) { + this.hosts = hosts; + return this; + } + + @java.lang.Override + public _FinalStage country(Nullable country) { + if (country.isNull()) { + this.country = OptionalNullable.ofNull(); + } else if (country.isEmpty()) { + this.country = OptionalNullable.absent(); + } else { + this.country = OptionalNullable.of(country.get()); + } + return this; + } + + @java.lang.Override + public _FinalStage country(Optional country) { + if (country.isPresent()) { + this.country = OptionalNullable.of(country.get()); + } else { + this.country = OptionalNullable.absent(); + } + return this; + } + + @java.lang.Override + public _FinalStage country(String country) { + this.country = OptionalNullable.of(country); + return this; + } + + @java.lang.Override + @JsonSetter(value = "country", nulls = Nulls.SKIP) + public _FinalStage country(OptionalNullable country) { + this.country = country; + return this; + } + + @java.lang.Override + public SchedulingHolidayCalendar build() { + return new SchedulingHolidayCalendar( + object, + id, + name, + source, + country, + hosts, + hostFilter, + regions, + delegates, + existingBookings, + lastReadAt, + lastError, + createdAt, + updatedAt, + additionalProperties); + } + + @java.lang.Override + public Builder additionalProperty(String key, Object value) { + this.additionalProperties.put(key, value); + return this; + } + + @java.lang.Override + public Builder additionalProperties(Map additionalProperties) { + this.additionalProperties.putAll(additionalProperties); + return this; + } + } +} diff --git a/sdks/java/src/main/java/com/coss/types/SchedulingHolidayCalendarExistingBookings.java b/sdks/java/src/main/java/com/coss/types/SchedulingHolidayCalendarExistingBookings.java new file mode 100644 index 000000000..c542c37b0 --- /dev/null +++ b/sdks/java/src/main/java/com/coss/types/SchedulingHolidayCalendarExistingBookings.java @@ -0,0 +1,86 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.coss.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class SchedulingHolidayCalendarExistingBookings { + public static final SchedulingHolidayCalendarExistingBookings REASSIGN = + new SchedulingHolidayCalendarExistingBookings(Value.REASSIGN, "reassign"); + + public static final SchedulingHolidayCalendarExistingBookings LEAVE = + new SchedulingHolidayCalendarExistingBookings(Value.LEAVE, "leave"); + + private final Value value; + + private final String string; + + SchedulingHolidayCalendarExistingBookings(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof SchedulingHolidayCalendarExistingBookings + && this.string.equals(((SchedulingHolidayCalendarExistingBookings) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case REASSIGN: + return visitor.visitReassign(); + case LEAVE: + return visitor.visitLeave(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static SchedulingHolidayCalendarExistingBookings valueOf(String value) { + switch (value) { + case "reassign": + return REASSIGN; + case "leave": + return LEAVE; + default: + return new SchedulingHolidayCalendarExistingBookings(Value.UNKNOWN, value); + } + } + + public enum Value { + LEAVE, + + REASSIGN, + + UNKNOWN + } + + public interface Visitor { + T visitLeave(); + + T visitReassign(); + + T visitUnknown(String unknownType); + } +} diff --git a/sdks/java/src/main/java/com/coss/types/SchedulingHolidayCalendarHostFilterValue.java b/sdks/java/src/main/java/com/coss/types/SchedulingHolidayCalendarHostFilterValue.java new file mode 100644 index 000000000..44c4e9ed3 --- /dev/null +++ b/sdks/java/src/main/java/com/coss/types/SchedulingHolidayCalendarHostFilterValue.java @@ -0,0 +1,99 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.coss.types; + +import com.coss.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import java.io.IOException; +import java.util.List; +import java.util.Objects; + +@JsonDeserialize(using = SchedulingHolidayCalendarHostFilterValue.Deserializer.class) +public final class SchedulingHolidayCalendarHostFilterValue { + private final Object value; + + private final int type; + + private SchedulingHolidayCalendarHostFilterValue(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((String) this.value); + } else if (this.type == 1) { + return visitor.visit((List) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof SchedulingHolidayCalendarHostFilterValue + && equalTo((SchedulingHolidayCalendarHostFilterValue) other); + } + + private boolean equalTo(SchedulingHolidayCalendarHostFilterValue other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static SchedulingHolidayCalendarHostFilterValue of(String value) { + return new SchedulingHolidayCalendarHostFilterValue(value, 0); + } + + public static SchedulingHolidayCalendarHostFilterValue of(List value) { + return new SchedulingHolidayCalendarHostFilterValue(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(List value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(SchedulingHolidayCalendarHostFilterValue.class); + } + + @java.lang.Override + public SchedulingHolidayCalendarHostFilterValue deserialize(JsonParser p, DeserializationContext context) + throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, new TypeReference>() {})); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/sdks/java/src/main/java/com/coss/types/SchedulingHolidayCalendarList.java b/sdks/java/src/main/java/com/coss/types/SchedulingHolidayCalendarList.java new file mode 100644 index 000000000..a1e2bc5b0 --- /dev/null +++ b/sdks/java/src/main/java/com/coss/types/SchedulingHolidayCalendarList.java @@ -0,0 +1,188 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.coss.types; + +import com.coss.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = SchedulingHolidayCalendarList.Builder.class) +public final class SchedulingHolidayCalendarList { + private final SchedulingHolidayCalendarListObject object; + + private final List data; + + private final boolean hasMore; + + private final Map additionalProperties; + + private SchedulingHolidayCalendarList( + SchedulingHolidayCalendarListObject object, + List data, + boolean hasMore, + Map additionalProperties) { + this.object = object; + this.data = data; + this.hasMore = hasMore; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("object") + public SchedulingHolidayCalendarListObject getObject() { + return object; + } + + @JsonProperty("data") + public List getData() { + return data; + } + + @JsonProperty("has_more") + public boolean getHasMore() { + return hasMore; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof SchedulingHolidayCalendarList && equalTo((SchedulingHolidayCalendarList) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(SchedulingHolidayCalendarList other) { + return object.equals(other.object) && data.equals(other.data) && hasMore == other.hasMore; + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.object, this.data, this.hasMore); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ObjectStage builder() { + return new Builder(); + } + + public interface ObjectStage { + HasMoreStage object(@NotNull SchedulingHolidayCalendarListObject object); + + Builder from(SchedulingHolidayCalendarList other); + } + + public interface HasMoreStage { + _FinalStage hasMore(boolean hasMore); + } + + public interface _FinalStage { + SchedulingHolidayCalendarList build(); + + _FinalStage additionalProperty(String key, Object value); + + _FinalStage additionalProperties(Map additionalProperties); + + _FinalStage data(List data); + + _FinalStage addData(SchedulingHolidayCalendar data); + + _FinalStage addAllData(List data); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ObjectStage, HasMoreStage, _FinalStage { + private SchedulingHolidayCalendarListObject object; + + private boolean hasMore; + + private List data = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(SchedulingHolidayCalendarList other) { + object(other.getObject()); + data(other.getData()); + hasMore(other.getHasMore()); + return this; + } + + @java.lang.Override + @JsonSetter("object") + public HasMoreStage object(@NotNull SchedulingHolidayCalendarListObject object) { + this.object = Objects.requireNonNull(object, "object must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("has_more") + public _FinalStage hasMore(boolean hasMore) { + this.hasMore = hasMore; + return this; + } + + @java.lang.Override + public _FinalStage addAllData(List data) { + if (data != null) { + this.data.addAll(data); + } + return this; + } + + @java.lang.Override + public _FinalStage addData(SchedulingHolidayCalendar data) { + this.data.add(data); + return this; + } + + @java.lang.Override + @JsonSetter(value = "data", nulls = Nulls.SKIP) + public _FinalStage data(List data) { + this.data.clear(); + if (data != null) { + this.data.addAll(data); + } + return this; + } + + @java.lang.Override + public SchedulingHolidayCalendarList build() { + return new SchedulingHolidayCalendarList(object, data, hasMore, additionalProperties); + } + + @java.lang.Override + public Builder additionalProperty(String key, Object value) { + this.additionalProperties.put(key, value); + return this; + } + + @java.lang.Override + public Builder additionalProperties(Map additionalProperties) { + this.additionalProperties.putAll(additionalProperties); + return this; + } + } +} diff --git a/sdks/java/src/main/java/com/coss/types/SchedulingHolidayCalendarListObject.java b/sdks/java/src/main/java/com/coss/types/SchedulingHolidayCalendarListObject.java new file mode 100644 index 000000000..9cc5aec29 --- /dev/null +++ b/sdks/java/src/main/java/com/coss/types/SchedulingHolidayCalendarListObject.java @@ -0,0 +1,75 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.coss.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class SchedulingHolidayCalendarListObject { + public static final SchedulingHolidayCalendarListObject LIST = + new SchedulingHolidayCalendarListObject(Value.LIST, "list"); + + private final Value value; + + private final String string; + + SchedulingHolidayCalendarListObject(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof SchedulingHolidayCalendarListObject + && this.string.equals(((SchedulingHolidayCalendarListObject) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case LIST: + return visitor.visitList(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static SchedulingHolidayCalendarListObject valueOf(String value) { + switch (value) { + case "list": + return LIST; + default: + return new SchedulingHolidayCalendarListObject(Value.UNKNOWN, value); + } + } + + public enum Value { + LIST, + + UNKNOWN + } + + public interface Visitor { + T visitList(); + + T visitUnknown(String unknownType); + } +} diff --git a/sdks/java/src/main/java/com/coss/types/SchedulingHolidayCalendarObject.java b/sdks/java/src/main/java/com/coss/types/SchedulingHolidayCalendarObject.java new file mode 100644 index 000000000..a7df82d48 --- /dev/null +++ b/sdks/java/src/main/java/com/coss/types/SchedulingHolidayCalendarObject.java @@ -0,0 +1,75 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.coss.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class SchedulingHolidayCalendarObject { + public static final SchedulingHolidayCalendarObject SCHEDULING_HOLIDAY_CALENDAR = + new SchedulingHolidayCalendarObject(Value.SCHEDULING_HOLIDAY_CALENDAR, "scheduling.holiday_calendar"); + + private final Value value; + + private final String string; + + SchedulingHolidayCalendarObject(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof SchedulingHolidayCalendarObject + && this.string.equals(((SchedulingHolidayCalendarObject) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case SCHEDULING_HOLIDAY_CALENDAR: + return visitor.visitSchedulingHolidayCalendar(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static SchedulingHolidayCalendarObject valueOf(String value) { + switch (value) { + case "scheduling.holiday_calendar": + return SCHEDULING_HOLIDAY_CALENDAR; + default: + return new SchedulingHolidayCalendarObject(Value.UNKNOWN, value); + } + } + + public enum Value { + SCHEDULING_HOLIDAY_CALENDAR, + + UNKNOWN + } + + public interface Visitor { + T visitSchedulingHolidayCalendar(); + + T visitUnknown(String unknownType); + } +} diff --git a/sdks/java/src/main/java/com/coss/types/SchedulingHolidayCalendarSource.java b/sdks/java/src/main/java/com/coss/types/SchedulingHolidayCalendarSource.java new file mode 100644 index 000000000..b2477de24 --- /dev/null +++ b/sdks/java/src/main/java/com/coss/types/SchedulingHolidayCalendarSource.java @@ -0,0 +1,85 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.coss.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class SchedulingHolidayCalendarSource { + public static final SchedulingHolidayCalendarSource COUNTRY = + new SchedulingHolidayCalendarSource(Value.COUNTRY, "country"); + + public static final SchedulingHolidayCalendarSource ICS = new SchedulingHolidayCalendarSource(Value.ICS, "ics"); + + private final Value value; + + private final String string; + + SchedulingHolidayCalendarSource(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof SchedulingHolidayCalendarSource + && this.string.equals(((SchedulingHolidayCalendarSource) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case COUNTRY: + return visitor.visitCountry(); + case ICS: + return visitor.visitIcs(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static SchedulingHolidayCalendarSource valueOf(String value) { + switch (value) { + case "country": + return COUNTRY; + case "ics": + return ICS; + default: + return new SchedulingHolidayCalendarSource(Value.UNKNOWN, value); + } + } + + public enum Value { + COUNTRY, + + ICS, + + UNKNOWN + } + + public interface Visitor { + T visitCountry(); + + T visitIcs(); + + T visitUnknown(String unknownType); + } +} diff --git a/sdks/java/src/main/java/com/coss/types/SchedulingHolidayList.java b/sdks/java/src/main/java/com/coss/types/SchedulingHolidayList.java new file mode 100644 index 000000000..f4bd90f64 --- /dev/null +++ b/sdks/java/src/main/java/com/coss/types/SchedulingHolidayList.java @@ -0,0 +1,188 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.coss.types; + +import com.coss.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = SchedulingHolidayList.Builder.class) +public final class SchedulingHolidayList { + private final SchedulingHolidayListObject object; + + private final List data; + + private final boolean hasMore; + + private final Map additionalProperties; + + private SchedulingHolidayList( + SchedulingHolidayListObject object, + List data, + boolean hasMore, + Map additionalProperties) { + this.object = object; + this.data = data; + this.hasMore = hasMore; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("object") + public SchedulingHolidayListObject getObject() { + return object; + } + + @JsonProperty("data") + public List getData() { + return data; + } + + @JsonProperty("has_more") + public boolean getHasMore() { + return hasMore; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof SchedulingHolidayList && equalTo((SchedulingHolidayList) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(SchedulingHolidayList other) { + return object.equals(other.object) && data.equals(other.data) && hasMore == other.hasMore; + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.object, this.data, this.hasMore); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ObjectStage builder() { + return new Builder(); + } + + public interface ObjectStage { + HasMoreStage object(@NotNull SchedulingHolidayListObject object); + + Builder from(SchedulingHolidayList other); + } + + public interface HasMoreStage { + _FinalStage hasMore(boolean hasMore); + } + + public interface _FinalStage { + SchedulingHolidayList build(); + + _FinalStage additionalProperty(String key, Object value); + + _FinalStage additionalProperties(Map additionalProperties); + + _FinalStage data(List data); + + _FinalStage addData(SchedulingHolidayListDataItem data); + + _FinalStage addAllData(List data); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ObjectStage, HasMoreStage, _FinalStage { + private SchedulingHolidayListObject object; + + private boolean hasMore; + + private List data = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(SchedulingHolidayList other) { + object(other.getObject()); + data(other.getData()); + hasMore(other.getHasMore()); + return this; + } + + @java.lang.Override + @JsonSetter("object") + public HasMoreStage object(@NotNull SchedulingHolidayListObject object) { + this.object = Objects.requireNonNull(object, "object must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("has_more") + public _FinalStage hasMore(boolean hasMore) { + this.hasMore = hasMore; + return this; + } + + @java.lang.Override + public _FinalStage addAllData(List data) { + if (data != null) { + this.data.addAll(data); + } + return this; + } + + @java.lang.Override + public _FinalStage addData(SchedulingHolidayListDataItem data) { + this.data.add(data); + return this; + } + + @java.lang.Override + @JsonSetter(value = "data", nulls = Nulls.SKIP) + public _FinalStage data(List data) { + this.data.clear(); + if (data != null) { + this.data.addAll(data); + } + return this; + } + + @java.lang.Override + public SchedulingHolidayList build() { + return new SchedulingHolidayList(object, data, hasMore, additionalProperties); + } + + @java.lang.Override + public Builder additionalProperty(String key, Object value) { + this.additionalProperties.put(key, value); + return this; + } + + @java.lang.Override + public Builder additionalProperties(Map additionalProperties) { + this.additionalProperties.putAll(additionalProperties); + return this; + } + } +} diff --git a/sdks/java/src/main/java/com/coss/types/SchedulingHolidayListDataItem.java b/sdks/java/src/main/java/com/coss/types/SchedulingHolidayListDataItem.java new file mode 100644 index 000000000..3799928af --- /dev/null +++ b/sdks/java/src/main/java/com/coss/types/SchedulingHolidayListDataItem.java @@ -0,0 +1,210 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.coss.types; + +import com.coss.core.Nullable; +import com.coss.core.NullableNonemptyFilter; +import com.coss.core.ObjectMappers; +import com.coss.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = SchedulingHolidayListDataItem.Builder.class) +public final class SchedulingHolidayListDataItem { + private final String date; + + private final String name; + + private final OptionalNullable region; + + private final Map additionalProperties; + + private SchedulingHolidayListDataItem( + String date, String name, OptionalNullable region, Map additionalProperties) { + this.date = date; + this.name = name; + this.region = region; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("date") + public String getDate() { + return date; + } + + @JsonProperty("name") + public String getName() { + return name; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("region") + public OptionalNullable getRegion() { + if (region == null) { + return OptionalNullable.absent(); + } + return region; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("region") + private OptionalNullable _getRegion() { + return region; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof SchedulingHolidayListDataItem && equalTo((SchedulingHolidayListDataItem) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(SchedulingHolidayListDataItem other) { + return date.equals(other.date) && name.equals(other.name) && region.equals(other.region); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.date, this.name, this.region); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static DateStage builder() { + return new Builder(); + } + + public interface DateStage { + NameStage date(@NotNull String date); + + Builder from(SchedulingHolidayListDataItem other); + } + + public interface NameStage { + _FinalStage name(@NotNull String name); + } + + public interface _FinalStage { + SchedulingHolidayListDataItem build(); + + _FinalStage additionalProperty(String key, Object value); + + _FinalStage additionalProperties(Map additionalProperties); + + _FinalStage region(OptionalNullable region); + + _FinalStage region(String region); + + _FinalStage region(Optional region); + + _FinalStage region(Nullable region); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements DateStage, NameStage, _FinalStage { + private String date; + + private String name; + + private OptionalNullable region = OptionalNullable.absent(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(SchedulingHolidayListDataItem other) { + date(other.getDate()); + name(other.getName()); + region(other.getRegion()); + return this; + } + + @java.lang.Override + @JsonSetter("date") + public NameStage date(@NotNull String date) { + this.date = Objects.requireNonNull(date, "date must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("name") + public _FinalStage name(@NotNull String name) { + this.name = Objects.requireNonNull(name, "name must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage region(Nullable region) { + if (region.isNull()) { + this.region = OptionalNullable.ofNull(); + } else if (region.isEmpty()) { + this.region = OptionalNullable.absent(); + } else { + this.region = OptionalNullable.of(region.get()); + } + return this; + } + + @java.lang.Override + public _FinalStage region(Optional region) { + if (region.isPresent()) { + this.region = OptionalNullable.of(region.get()); + } else { + this.region = OptionalNullable.absent(); + } + return this; + } + + @java.lang.Override + public _FinalStage region(String region) { + this.region = OptionalNullable.of(region); + return this; + } + + @java.lang.Override + @JsonSetter(value = "region", nulls = Nulls.SKIP) + public _FinalStage region(OptionalNullable region) { + this.region = region; + return this; + } + + @java.lang.Override + public SchedulingHolidayListDataItem build() { + return new SchedulingHolidayListDataItem(date, name, region, additionalProperties); + } + + @java.lang.Override + public Builder additionalProperty(String key, Object value) { + this.additionalProperties.put(key, value); + return this; + } + + @java.lang.Override + public Builder additionalProperties(Map additionalProperties) { + this.additionalProperties.putAll(additionalProperties); + return this; + } + } +} diff --git a/sdks/java/src/main/java/com/coss/types/SchedulingHolidayListObject.java b/sdks/java/src/main/java/com/coss/types/SchedulingHolidayListObject.java new file mode 100644 index 000000000..7af1f3c2c --- /dev/null +++ b/sdks/java/src/main/java/com/coss/types/SchedulingHolidayListObject.java @@ -0,0 +1,74 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.coss.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class SchedulingHolidayListObject { + public static final SchedulingHolidayListObject LIST = new SchedulingHolidayListObject(Value.LIST, "list"); + + private final Value value; + + private final String string; + + SchedulingHolidayListObject(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof SchedulingHolidayListObject + && this.string.equals(((SchedulingHolidayListObject) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case LIST: + return visitor.visitList(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static SchedulingHolidayListObject valueOf(String value) { + switch (value) { + case "list": + return LIST; + default: + return new SchedulingHolidayListObject(Value.UNKNOWN, value); + } + } + + public enum Value { + LIST, + + UNKNOWN + } + + public interface Visitor { + T visitList(); + + T visitUnknown(String unknownType); + } +} diff --git a/sdks/java/src/main/java/com/coss/types/SchedulingLocation.java b/sdks/java/src/main/java/com/coss/types/SchedulingLocation.java index a1b929705..1f0dace36 100644 --- a/sdks/java/src/main/java/com/coss/types/SchedulingLocation.java +++ b/sdks/java/src/main/java/com/coss/types/SchedulingLocation.java @@ -3,454 +3,154 @@ */ package com.coss.types; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonUnwrapped; +import com.coss.core.ObjectMappers; import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import java.io.IOException; +import java.util.Map; import java.util.Objects; -import java.util.Optional; +@JsonDeserialize(using = SchedulingLocation.Deserializer.class) public final class SchedulingLocation { - private final Value value; + private final Object value; - @JsonCreator(mode = JsonCreator.Mode.DELEGATING) - private SchedulingLocation(Value value) { - this.value = value; - } - - public T visit(Visitor visitor) { - return value.visit(visitor); - } - - public static SchedulingLocation link(SchedulingLocationLink value) { - return new SchedulingLocation(new LinkValue(value)); - } - - public static SchedulingLocation phone(SchedulingLocationPhone value) { - return new SchedulingLocation(new PhoneValue(value)); - } - - public static SchedulingLocation inPerson(SchedulingLocationInPerson value) { - return new SchedulingLocation(new InPersonValue(value)); - } - - public static SchedulingLocation googleMeet(SchedulingLocationGoogleMeet value) { - return new SchedulingLocation(new GoogleMeetValue(value)); - } - - public static SchedulingLocation microsoftTeams(SchedulingLocationMicrosoftTeams value) { - return new SchedulingLocation(new MicrosoftTeamsValue(value)); - } - - public static SchedulingLocation zoom(SchedulingLocationZoom value) { - return new SchedulingLocation(new ZoomValue(value)); - } - - public boolean isLink() { - return value instanceof LinkValue; - } - - public boolean isPhone() { - return value instanceof PhoneValue; - } + private final int type; - public boolean isInPerson() { - return value instanceof InPersonValue; - } - - public boolean isGoogleMeet() { - return value instanceof GoogleMeetValue; - } - - public boolean isMicrosoftTeams() { - return value instanceof MicrosoftTeamsValue; - } - - public boolean isZoom() { - return value instanceof ZoomValue; - } - - public boolean _isUnknown() { - return value instanceof _UnknownValue; - } - - public Optional getLink() { - if (isLink()) { - return Optional.of(((LinkValue) value).value); - } - return Optional.empty(); - } - - public Optional getPhone() { - if (isPhone()) { - return Optional.of(((PhoneValue) value).value); - } - return Optional.empty(); - } - - public Optional getInPerson() { - if (isInPerson()) { - return Optional.of(((InPersonValue) value).value); - } - return Optional.empty(); - } - - public Optional getGoogleMeet() { - if (isGoogleMeet()) { - return Optional.of(((GoogleMeetValue) value).value); - } - return Optional.empty(); - } - - public Optional getMicrosoftTeams() { - if (isMicrosoftTeams()) { - return Optional.of(((MicrosoftTeamsValue) value).value); - } - return Optional.empty(); - } - - public Optional getZoom() { - if (isZoom()) { - return Optional.of(((ZoomValue) value).value); - } - return Optional.empty(); + private SchedulingLocation(Object value, int type) { + this.value = value; + this.type = type; } - public Optional _getUnknown() { - if (_isUnknown()) { - return Optional.of(((_UnknownValue) value).value); - } - return Optional.empty(); + @JsonValue + public Object get() { + return this.value; } - @Override + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((SchedulingLocationZero) this.value); + } else if (this.type == 1) { + return visitor.visit((SchedulingLocationNumber) this.value); + } else if (this.type == 2) { + return visitor.visit((SchedulingLocationAddress) this.value); + } else if (this.type == 3) { + return visitor.visit((SchedulingLocationThree) this.value); + } else if (this.type == 4) { + return visitor.visit((SchedulingLocationFour) this.value); + } else if (this.type == 5) { + return visitor.visit((SchedulingLocationFive) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; - return other instanceof SchedulingLocation && value.equals(((SchedulingLocation) other).value); + return other instanceof SchedulingLocation && equalTo((SchedulingLocation) other); + } + + private boolean equalTo(SchedulingLocation other) { + return value.equals(other.value); } - @Override + @java.lang.Override public int hashCode() { - return Objects.hash(value); + return Objects.hash(this.value); } - @Override + @java.lang.Override public String toString() { - return value.toString(); + return this.value.toString(); } - @JsonValue - private Value getValue() { - return this.value; + public static SchedulingLocation of(SchedulingLocationZero value) { + return new SchedulingLocation(value, 0); } - public interface Visitor { - T visitLink(SchedulingLocationLink link); - - T visitPhone(SchedulingLocationPhone phone); - - T visitInPerson(SchedulingLocationInPerson inPerson); - - T visitGoogleMeet(SchedulingLocationGoogleMeet googleMeet); - - T visitMicrosoftTeams(SchedulingLocationMicrosoftTeams microsoftTeams); - - T visitZoom(SchedulingLocationZoom zoom); - - T _visitUnknown(Object unknownType); + public static SchedulingLocation of(SchedulingLocationNumber value) { + return new SchedulingLocation(value, 1); } - @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "type", visible = true, defaultImpl = _UnknownValue.class) - @JsonSubTypes({ - @JsonSubTypes.Type(LinkValue.class), - @JsonSubTypes.Type(PhoneValue.class), - @JsonSubTypes.Type(InPersonValue.class), - @JsonSubTypes.Type(GoogleMeetValue.class), - @JsonSubTypes.Type(MicrosoftTeamsValue.class), - @JsonSubTypes.Type(ZoomValue.class) - }) - @JsonIgnoreProperties(ignoreUnknown = true) - private interface Value { - T visit(Visitor visitor); + public static SchedulingLocation of(SchedulingLocationAddress value) { + return new SchedulingLocation(value, 2); } - @JsonTypeName("link") - @JsonIgnoreProperties("type") - private static final class LinkValue implements Value { - @JsonUnwrapped - @JsonIgnoreProperties(value = "type", allowSetters = true) - private SchedulingLocationLink value; - - @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) - private LinkValue() {} - - private LinkValue(SchedulingLocationLink value) { - this.value = value; - } - - @java.lang.Override - public T visit(Visitor visitor) { - return visitor.visitLink(value); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof LinkValue && equalTo((LinkValue) other); - } - - private boolean equalTo(LinkValue other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return "SchedulingLocation{" + "value: " + value + "}"; - } + public static SchedulingLocation of(SchedulingLocationThree value) { + return new SchedulingLocation(value, 3); } - @JsonTypeName("phone") - @JsonIgnoreProperties("type") - private static final class PhoneValue implements Value { - @JsonUnwrapped - @JsonIgnoreProperties(value = "type", allowSetters = true) - private SchedulingLocationPhone value; - - @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) - private PhoneValue() {} - - private PhoneValue(SchedulingLocationPhone value) { - this.value = value; - } - - @java.lang.Override - public T visit(Visitor visitor) { - return visitor.visitPhone(value); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof PhoneValue && equalTo((PhoneValue) other); - } - - private boolean equalTo(PhoneValue other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return "SchedulingLocation{" + "value: " + value + "}"; - } + public static SchedulingLocation of(SchedulingLocationFour value) { + return new SchedulingLocation(value, 4); } - @JsonTypeName("in_person") - @JsonIgnoreProperties("type") - private static final class InPersonValue implements Value { - @JsonUnwrapped - @JsonIgnoreProperties(value = "type", allowSetters = true) - private SchedulingLocationInPerson value; - - @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) - private InPersonValue() {} - - private InPersonValue(SchedulingLocationInPerson value) { - this.value = value; - } - - @java.lang.Override - public T visit(Visitor visitor) { - return visitor.visitInPerson(value); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof InPersonValue && equalTo((InPersonValue) other); - } - - private boolean equalTo(InPersonValue other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return "SchedulingLocation{" + "value: " + value + "}"; - } + public static SchedulingLocation of(SchedulingLocationFive value) { + return new SchedulingLocation(value, 5); } - @JsonTypeName("google_meet") - @JsonIgnoreProperties("type") - private static final class GoogleMeetValue implements Value { - @JsonUnwrapped - @JsonIgnoreProperties(value = "type", allowSetters = true) - private SchedulingLocationGoogleMeet value; - - @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) - private GoogleMeetValue() {} - - private GoogleMeetValue(SchedulingLocationGoogleMeet value) { - this.value = value; - } - - @java.lang.Override - public T visit(Visitor visitor) { - return visitor.visitGoogleMeet(value); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof GoogleMeetValue && equalTo((GoogleMeetValue) other); - } - - private boolean equalTo(GoogleMeetValue other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return "SchedulingLocation{" + "value: " + value + "}"; - } - } - - @JsonTypeName("microsoft_teams") - @JsonIgnoreProperties("type") - private static final class MicrosoftTeamsValue implements Value { - @JsonUnwrapped - @JsonIgnoreProperties(value = "type", allowSetters = true) - private SchedulingLocationMicrosoftTeams value; - - @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) - private MicrosoftTeamsValue() {} - - private MicrosoftTeamsValue(SchedulingLocationMicrosoftTeams value) { - this.value = value; - } - - @java.lang.Override - public T visit(Visitor visitor) { - return visitor.visitMicrosoftTeams(value); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof MicrosoftTeamsValue && equalTo((MicrosoftTeamsValue) other); - } - - private boolean equalTo(MicrosoftTeamsValue other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return "SchedulingLocation{" + "value: " + value + "}"; - } - } - - @JsonTypeName("zoom") - @JsonIgnoreProperties("type") - private static final class ZoomValue implements Value { - @JsonUnwrapped - @JsonIgnoreProperties(value = "type", allowSetters = true) - private SchedulingLocationZoom value; - - @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) - private ZoomValue() {} - - private ZoomValue(SchedulingLocationZoom value) { - this.value = value; - } - - @java.lang.Override - public T visit(Visitor visitor) { - return visitor.visitZoom(value); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof ZoomValue && equalTo((ZoomValue) other); - } - - private boolean equalTo(ZoomValue other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return "SchedulingLocation{" + "value: " + value + "}"; - } - } - - @JsonIgnoreProperties("type") - private static final class _UnknownValue implements Value { - private String type; - - @JsonValue - private Object value; - - @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) - private _UnknownValue(@JsonProperty("value") Object value) {} - - @java.lang.Override - public T visit(Visitor visitor) { - return visitor._visitUnknown(value); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof _UnknownValue && equalTo((_UnknownValue) other); - } - - private boolean equalTo(_UnknownValue other) { - return type.equals(other.type) && value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.type, this.value); - } - - @java.lang.Override - public String toString() { - return "SchedulingLocation{" + "type: " + type + ", value: " + value + "}"; + public interface Visitor { + T visit(SchedulingLocationZero value); + + T visit(SchedulingLocationNumber value); + + T visit(SchedulingLocationAddress value); + + T visit(SchedulingLocationThree value); + + T visit(SchedulingLocationFour value); + + T visit(SchedulingLocationFive value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(SchedulingLocation.class); + } + + @java.lang.Override + public SchedulingLocation deserialize(JsonParser p, DeserializationContext context) throws IOException { + Object value = p.readValueAs(Object.class); + if (value instanceof Map && ((Map) value).containsKey("type")) { + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, SchedulingLocationZero.class)); + } catch (RuntimeException e) { + } + } + if (value instanceof Map && ((Map) value).containsKey("type")) { + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, SchedulingLocationNumber.class)); + } catch (RuntimeException e) { + } + } + if (value instanceof Map && ((Map) value).containsKey("type")) { + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, SchedulingLocationAddress.class)); + } catch (RuntimeException e) { + } + } + if (value instanceof Map && ((Map) value).containsKey("type")) { + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, SchedulingLocationThree.class)); + } catch (RuntimeException e) { + } + } + if (value instanceof Map && ((Map) value).containsKey("type")) { + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, SchedulingLocationFour.class)); + } catch (RuntimeException e) { + } + } + if (value instanceof Map && ((Map) value).containsKey("type")) { + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, SchedulingLocationFive.class)); + } catch (RuntimeException e) { + } + } + throw new JsonParseException(p, "Failed to deserialize"); } } } diff --git a/sdks/java/src/main/java/com/coss/types/SchedulingLocationInPerson.java b/sdks/java/src/main/java/com/coss/types/SchedulingLocationAddress.java similarity index 52% rename from sdks/java/src/main/java/com/coss/types/SchedulingLocationInPerson.java rename to sdks/java/src/main/java/com/coss/types/SchedulingLocationAddress.java index 47ea1457d..d6c11c169 100644 --- a/sdks/java/src/main/java/com/coss/types/SchedulingLocationInPerson.java +++ b/sdks/java/src/main/java/com/coss/types/SchedulingLocationAddress.java @@ -19,19 +19,31 @@ import java.util.Map; import java.util.Objects; import java.util.Optional; +import org.jetbrains.annotations.NotNull; @JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = SchedulingLocationInPerson.Builder.class) -public final class SchedulingLocationInPerson { +@JsonDeserialize(builder = SchedulingLocationAddress.Builder.class) +public final class SchedulingLocationAddress { + private final SchedulingLocationAddressType type; + private final OptionalNullable address; private final Map additionalProperties; - private SchedulingLocationInPerson(OptionalNullable address, Map additionalProperties) { + private SchedulingLocationAddress( + SchedulingLocationAddressType type, + OptionalNullable address, + Map additionalProperties) { + this.type = type; this.address = address; this.additionalProperties = additionalProperties; } + @JsonProperty("type") + public SchedulingLocationAddressType getType() { + return type; + } + /** * @return The address to meet at. null on an event type means the booking supplies its own. */ @@ -53,7 +65,7 @@ private OptionalNullable _getAddress() { @java.lang.Override public boolean equals(Object other) { if (this == other) return true; - return other instanceof SchedulingLocationInPerson && equalTo((SchedulingLocationInPerson) other); + return other instanceof SchedulingLocationAddress && equalTo((SchedulingLocationAddress) other); } @JsonAnyGetter @@ -61,13 +73,13 @@ public Map getAdditionalProperties() { return this.additionalProperties; } - private boolean equalTo(SchedulingLocationInPerson other) { - return address.equals(other.address); + private boolean equalTo(SchedulingLocationAddress other) { + return type.equals(other.type) && address.equals(other.address); } @java.lang.Override public int hashCode() { - return Objects.hash(this.address); + return Objects.hash(this.type, this.address); } @java.lang.Override @@ -75,12 +87,39 @@ public String toString() { return ObjectMappers.stringify(this); } - public static Builder builder() { + public static TypeStage builder() { return new Builder(); } + public interface TypeStage { + _FinalStage type(@NotNull SchedulingLocationAddressType type); + + Builder from(SchedulingLocationAddress other); + } + + public interface _FinalStage { + SchedulingLocationAddress build(); + + _FinalStage additionalProperty(String key, Object value); + + _FinalStage additionalProperties(Map additionalProperties); + + /** + *

The address to meet at. null on an event type means the booking supplies its own.

+ */ + _FinalStage address(OptionalNullable address); + + _FinalStage address(String address); + + _FinalStage address(Optional address); + + _FinalStage address(Nullable address); + } + @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { + public static final class Builder implements TypeStage, _FinalStage { + private SchedulingLocationAddressType type; + private OptionalNullable address = OptionalNullable.absent(); @JsonAnySetter @@ -88,26 +127,42 @@ public static final class Builder { private Builder() {} - public Builder from(SchedulingLocationInPerson other) { + @java.lang.Override + public Builder from(SchedulingLocationAddress other) { + type(other.getType()); address(other.getAddress()); return this; } - /** - *

The address to meet at. null on an event type means the booking supplies its own.

- */ - @JsonSetter(value = "address", nulls = Nulls.SKIP) - public Builder address(OptionalNullable address) { - this.address = address; + @java.lang.Override + @JsonSetter("type") + public _FinalStage type(@NotNull SchedulingLocationAddressType type) { + this.type = Objects.requireNonNull(type, "type must not be null"); return this; } - public Builder address(String address) { - this.address = OptionalNullable.of(address); + /** + *

The address to meet at. null on an event type means the booking supplies its own.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage address(Nullable address) { + if (address.isNull()) { + this.address = OptionalNullable.ofNull(); + } else if (address.isEmpty()) { + this.address = OptionalNullable.absent(); + } else { + this.address = OptionalNullable.of(address.get()); + } return this; } - public Builder address(Optional address) { + /** + *

The address to meet at. null on an event type means the booking supplies its own.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage address(Optional address) { if (address.isPresent()) { this.address = OptionalNullable.of(address.get()); } else { @@ -116,26 +171,38 @@ public Builder address(Optional address) { return this; } - public Builder address(Nullable address) { - if (address.isNull()) { - this.address = OptionalNullable.ofNull(); - } else if (address.isEmpty()) { - this.address = OptionalNullable.absent(); - } else { - this.address = OptionalNullable.of(address.get()); - } + /** + *

The address to meet at. null on an event type means the booking supplies its own.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage address(String address) { + this.address = OptionalNullable.of(address); + return this; + } + + /** + *

The address to meet at. null on an event type means the booking supplies its own.

+ */ + @java.lang.Override + @JsonSetter(value = "address", nulls = Nulls.SKIP) + public _FinalStage address(OptionalNullable address) { + this.address = address; return this; } - public SchedulingLocationInPerson build() { - return new SchedulingLocationInPerson(address, additionalProperties); + @java.lang.Override + public SchedulingLocationAddress build() { + return new SchedulingLocationAddress(type, address, additionalProperties); } + @java.lang.Override public Builder additionalProperty(String key, Object value) { this.additionalProperties.put(key, value); return this; } + @java.lang.Override public Builder additionalProperties(Map additionalProperties) { this.additionalProperties.putAll(additionalProperties); return this; diff --git a/sdks/java/src/main/java/com/coss/types/SchedulingLocationAddressType.java b/sdks/java/src/main/java/com/coss/types/SchedulingLocationAddressType.java new file mode 100644 index 000000000..bab8bfc86 --- /dev/null +++ b/sdks/java/src/main/java/com/coss/types/SchedulingLocationAddressType.java @@ -0,0 +1,75 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.coss.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class SchedulingLocationAddressType { + public static final SchedulingLocationAddressType IN_PERSON = + new SchedulingLocationAddressType(Value.IN_PERSON, "in_person"); + + private final Value value; + + private final String string; + + SchedulingLocationAddressType(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof SchedulingLocationAddressType + && this.string.equals(((SchedulingLocationAddressType) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case IN_PERSON: + return visitor.visitInPerson(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static SchedulingLocationAddressType valueOf(String value) { + switch (value) { + case "in_person": + return IN_PERSON; + default: + return new SchedulingLocationAddressType(Value.UNKNOWN, value); + } + } + + public enum Value { + IN_PERSON, + + UNKNOWN + } + + public interface Visitor { + T visitInPerson(); + + T visitUnknown(String unknownType); + } +} diff --git a/sdks/java/src/main/java/com/coss/types/SchedulingLocationZoom.java b/sdks/java/src/main/java/com/coss/types/SchedulingLocationFive.java similarity index 53% rename from sdks/java/src/main/java/com/coss/types/SchedulingLocationZoom.java rename to sdks/java/src/main/java/com/coss/types/SchedulingLocationFive.java index ce011e934..e84714ab9 100644 --- a/sdks/java/src/main/java/com/coss/types/SchedulingLocationZoom.java +++ b/sdks/java/src/main/java/com/coss/types/SchedulingLocationFive.java @@ -19,19 +19,29 @@ import java.util.Map; import java.util.Objects; import java.util.Optional; +import org.jetbrains.annotations.NotNull; @JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = SchedulingLocationZoom.Builder.class) -public final class SchedulingLocationZoom { +@JsonDeserialize(builder = SchedulingLocationFive.Builder.class) +public final class SchedulingLocationFive { + private final SchedulingLocationFiveType type; + private final OptionalNullable url; private final Map additionalProperties; - private SchedulingLocationZoom(OptionalNullable url, Map additionalProperties) { + private SchedulingLocationFive( + SchedulingLocationFiveType type, OptionalNullable url, Map additionalProperties) { + this.type = type; this.url = url; this.additionalProperties = additionalProperties; } + @JsonProperty("type") + public SchedulingLocationFiveType getType() { + return type; + } + /** * @return The meeting's link, once it's created on the host's Zoom account. */ @@ -53,7 +63,7 @@ private OptionalNullable _getUrl() { @java.lang.Override public boolean equals(Object other) { if (this == other) return true; - return other instanceof SchedulingLocationZoom && equalTo((SchedulingLocationZoom) other); + return other instanceof SchedulingLocationFive && equalTo((SchedulingLocationFive) other); } @JsonAnyGetter @@ -61,13 +71,13 @@ public Map getAdditionalProperties() { return this.additionalProperties; } - private boolean equalTo(SchedulingLocationZoom other) { - return url.equals(other.url); + private boolean equalTo(SchedulingLocationFive other) { + return type.equals(other.type) && url.equals(other.url); } @java.lang.Override public int hashCode() { - return Objects.hash(this.url); + return Objects.hash(this.type, this.url); } @java.lang.Override @@ -75,12 +85,39 @@ public String toString() { return ObjectMappers.stringify(this); } - public static Builder builder() { + public static TypeStage builder() { return new Builder(); } + public interface TypeStage { + _FinalStage type(@NotNull SchedulingLocationFiveType type); + + Builder from(SchedulingLocationFive other); + } + + public interface _FinalStage { + SchedulingLocationFive build(); + + _FinalStage additionalProperty(String key, Object value); + + _FinalStage additionalProperties(Map additionalProperties); + + /** + *

The meeting's link, once it's created on the host's Zoom account.

+ */ + _FinalStage url(OptionalNullable url); + + _FinalStage url(String url); + + _FinalStage url(Optional url); + + _FinalStage url(Nullable url); + } + @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { + public static final class Builder implements TypeStage, _FinalStage { + private SchedulingLocationFiveType type; + private OptionalNullable url = OptionalNullable.absent(); @JsonAnySetter @@ -88,26 +125,42 @@ public static final class Builder { private Builder() {} - public Builder from(SchedulingLocationZoom other) { + @java.lang.Override + public Builder from(SchedulingLocationFive other) { + type(other.getType()); url(other.getUrl()); return this; } - /** - *

The meeting's link, once it's created on the host's Zoom account.

- */ - @JsonSetter(value = "url", nulls = Nulls.SKIP) - public Builder url(OptionalNullable url) { - this.url = url; + @java.lang.Override + @JsonSetter("type") + public _FinalStage type(@NotNull SchedulingLocationFiveType type) { + this.type = Objects.requireNonNull(type, "type must not be null"); return this; } - public Builder url(String url) { - this.url = OptionalNullable.of(url); + /** + *

The meeting's link, once it's created on the host's Zoom account.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage url(Nullable url) { + if (url.isNull()) { + this.url = OptionalNullable.ofNull(); + } else if (url.isEmpty()) { + this.url = OptionalNullable.absent(); + } else { + this.url = OptionalNullable.of(url.get()); + } return this; } - public Builder url(Optional url) { + /** + *

The meeting's link, once it's created on the host's Zoom account.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage url(Optional url) { if (url.isPresent()) { this.url = OptionalNullable.of(url.get()); } else { @@ -116,26 +169,38 @@ public Builder url(Optional url) { return this; } - public Builder url(Nullable url) { - if (url.isNull()) { - this.url = OptionalNullable.ofNull(); - } else if (url.isEmpty()) { - this.url = OptionalNullable.absent(); - } else { - this.url = OptionalNullable.of(url.get()); - } + /** + *

The meeting's link, once it's created on the host's Zoom account.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage url(String url) { + this.url = OptionalNullable.of(url); + return this; + } + + /** + *

The meeting's link, once it's created on the host's Zoom account.

+ */ + @java.lang.Override + @JsonSetter(value = "url", nulls = Nulls.SKIP) + public _FinalStage url(OptionalNullable url) { + this.url = url; return this; } - public SchedulingLocationZoom build() { - return new SchedulingLocationZoom(url, additionalProperties); + @java.lang.Override + public SchedulingLocationFive build() { + return new SchedulingLocationFive(type, url, additionalProperties); } + @java.lang.Override public Builder additionalProperty(String key, Object value) { this.additionalProperties.put(key, value); return this; } + @java.lang.Override public Builder additionalProperties(Map additionalProperties) { this.additionalProperties.putAll(additionalProperties); return this; diff --git a/sdks/java/src/main/java/com/coss/types/SchedulingLocationFiveType.java b/sdks/java/src/main/java/com/coss/types/SchedulingLocationFiveType.java new file mode 100644 index 000000000..9ea2c0491 --- /dev/null +++ b/sdks/java/src/main/java/com/coss/types/SchedulingLocationFiveType.java @@ -0,0 +1,74 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.coss.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class SchedulingLocationFiveType { + public static final SchedulingLocationFiveType ZOOM = new SchedulingLocationFiveType(Value.ZOOM, "zoom"); + + private final Value value; + + private final String string; + + SchedulingLocationFiveType(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof SchedulingLocationFiveType + && this.string.equals(((SchedulingLocationFiveType) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case ZOOM: + return visitor.visitZoom(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static SchedulingLocationFiveType valueOf(String value) { + switch (value) { + case "zoom": + return ZOOM; + default: + return new SchedulingLocationFiveType(Value.UNKNOWN, value); + } + } + + public enum Value { + ZOOM, + + UNKNOWN + } + + public interface Visitor { + T visitZoom(); + + T visitUnknown(String unknownType); + } +} diff --git a/sdks/java/src/main/java/com/coss/types/SchedulingLocationFour.java b/sdks/java/src/main/java/com/coss/types/SchedulingLocationFour.java new file mode 100644 index 000000000..3c74bb1ec --- /dev/null +++ b/sdks/java/src/main/java/com/coss/types/SchedulingLocationFour.java @@ -0,0 +1,118 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.coss.types; + +import com.coss.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = SchedulingLocationFour.Builder.class) +public final class SchedulingLocationFour { + private final SchedulingLocationFourType type; + + private final Map additionalProperties; + + private SchedulingLocationFour(SchedulingLocationFourType type, Map additionalProperties) { + this.type = type; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("type") + public SchedulingLocationFourType getType() { + return type; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof SchedulingLocationFour && equalTo((SchedulingLocationFour) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(SchedulingLocationFour other) { + return type.equals(other.type); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.type); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static TypeStage builder() { + return new Builder(); + } + + public interface TypeStage { + _FinalStage type(@NotNull SchedulingLocationFourType type); + + Builder from(SchedulingLocationFour other); + } + + public interface _FinalStage { + SchedulingLocationFour build(); + + _FinalStage additionalProperty(String key, Object value); + + _FinalStage additionalProperties(Map additionalProperties); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements TypeStage, _FinalStage { + private SchedulingLocationFourType type; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(SchedulingLocationFour other) { + type(other.getType()); + return this; + } + + @java.lang.Override + @JsonSetter("type") + public _FinalStage type(@NotNull SchedulingLocationFourType type) { + this.type = Objects.requireNonNull(type, "type must not be null"); + return this; + } + + @java.lang.Override + public SchedulingLocationFour build() { + return new SchedulingLocationFour(type, additionalProperties); + } + + @java.lang.Override + public Builder additionalProperty(String key, Object value) { + this.additionalProperties.put(key, value); + return this; + } + + @java.lang.Override + public Builder additionalProperties(Map additionalProperties) { + this.additionalProperties.putAll(additionalProperties); + return this; + } + } +} diff --git a/sdks/java/src/main/java/com/coss/types/SchedulingLocationFourType.java b/sdks/java/src/main/java/com/coss/types/SchedulingLocationFourType.java new file mode 100644 index 000000000..acee55165 --- /dev/null +++ b/sdks/java/src/main/java/com/coss/types/SchedulingLocationFourType.java @@ -0,0 +1,75 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.coss.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class SchedulingLocationFourType { + public static final SchedulingLocationFourType MICROSOFT_TEAMS = + new SchedulingLocationFourType(Value.MICROSOFT_TEAMS, "microsoft_teams"); + + private final Value value; + + private final String string; + + SchedulingLocationFourType(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof SchedulingLocationFourType + && this.string.equals(((SchedulingLocationFourType) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case MICROSOFT_TEAMS: + return visitor.visitMicrosoftTeams(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static SchedulingLocationFourType valueOf(String value) { + switch (value) { + case "microsoft_teams": + return MICROSOFT_TEAMS; + default: + return new SchedulingLocationFourType(Value.UNKNOWN, value); + } + } + + public enum Value { + MICROSOFT_TEAMS, + + UNKNOWN + } + + public interface Visitor { + T visitMicrosoftTeams(); + + T visitUnknown(String unknownType); + } +} diff --git a/sdks/java/src/main/java/com/coss/types/SchedulingLocationPhone.java b/sdks/java/src/main/java/com/coss/types/SchedulingLocationNumber.java similarity index 52% rename from sdks/java/src/main/java/com/coss/types/SchedulingLocationPhone.java rename to sdks/java/src/main/java/com/coss/types/SchedulingLocationNumber.java index 6b99e29f7..9594bde88 100644 --- a/sdks/java/src/main/java/com/coss/types/SchedulingLocationPhone.java +++ b/sdks/java/src/main/java/com/coss/types/SchedulingLocationNumber.java @@ -19,19 +19,31 @@ import java.util.Map; import java.util.Objects; import java.util.Optional; +import org.jetbrains.annotations.NotNull; @JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = SchedulingLocationPhone.Builder.class) -public final class SchedulingLocationPhone { +@JsonDeserialize(builder = SchedulingLocationNumber.Builder.class) +public final class SchedulingLocationNumber { + private final SchedulingLocationNumberType type; + private final OptionalNullable number; private final Map additionalProperties; - private SchedulingLocationPhone(OptionalNullable number, Map additionalProperties) { + private SchedulingLocationNumber( + SchedulingLocationNumberType type, + OptionalNullable number, + Map additionalProperties) { + this.type = type; this.number = number; this.additionalProperties = additionalProperties; } + @JsonProperty("type") + public SchedulingLocationNumberType getType() { + return type; + } + /** * @return The phone number to call. null on an event type means the booking supplies its own. */ @@ -53,7 +65,7 @@ private OptionalNullable _getNumber() { @java.lang.Override public boolean equals(Object other) { if (this == other) return true; - return other instanceof SchedulingLocationPhone && equalTo((SchedulingLocationPhone) other); + return other instanceof SchedulingLocationNumber && equalTo((SchedulingLocationNumber) other); } @JsonAnyGetter @@ -61,13 +73,13 @@ public Map getAdditionalProperties() { return this.additionalProperties; } - private boolean equalTo(SchedulingLocationPhone other) { - return number.equals(other.number); + private boolean equalTo(SchedulingLocationNumber other) { + return type.equals(other.type) && number.equals(other.number); } @java.lang.Override public int hashCode() { - return Objects.hash(this.number); + return Objects.hash(this.type, this.number); } @java.lang.Override @@ -75,12 +87,39 @@ public String toString() { return ObjectMappers.stringify(this); } - public static Builder builder() { + public static TypeStage builder() { return new Builder(); } + public interface TypeStage { + _FinalStage type(@NotNull SchedulingLocationNumberType type); + + Builder from(SchedulingLocationNumber other); + } + + public interface _FinalStage { + SchedulingLocationNumber build(); + + _FinalStage additionalProperty(String key, Object value); + + _FinalStage additionalProperties(Map additionalProperties); + + /** + *

The phone number to call. null on an event type means the booking supplies its own.

+ */ + _FinalStage number(OptionalNullable number); + + _FinalStage number(String number); + + _FinalStage number(Optional number); + + _FinalStage number(Nullable number); + } + @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { + public static final class Builder implements TypeStage, _FinalStage { + private SchedulingLocationNumberType type; + private OptionalNullable number = OptionalNullable.absent(); @JsonAnySetter @@ -88,26 +127,42 @@ public static final class Builder { private Builder() {} - public Builder from(SchedulingLocationPhone other) { + @java.lang.Override + public Builder from(SchedulingLocationNumber other) { + type(other.getType()); number(other.getNumber()); return this; } - /** - *

The phone number to call. null on an event type means the booking supplies its own.

- */ - @JsonSetter(value = "number", nulls = Nulls.SKIP) - public Builder number(OptionalNullable number) { - this.number = number; + @java.lang.Override + @JsonSetter("type") + public _FinalStage type(@NotNull SchedulingLocationNumberType type) { + this.type = Objects.requireNonNull(type, "type must not be null"); return this; } - public Builder number(String number) { - this.number = OptionalNullable.of(number); + /** + *

The phone number to call. null on an event type means the booking supplies its own.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage number(Nullable number) { + if (number.isNull()) { + this.number = OptionalNullable.ofNull(); + } else if (number.isEmpty()) { + this.number = OptionalNullable.absent(); + } else { + this.number = OptionalNullable.of(number.get()); + } return this; } - public Builder number(Optional number) { + /** + *

The phone number to call. null on an event type means the booking supplies its own.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage number(Optional number) { if (number.isPresent()) { this.number = OptionalNullable.of(number.get()); } else { @@ -116,26 +171,38 @@ public Builder number(Optional number) { return this; } - public Builder number(Nullable number) { - if (number.isNull()) { - this.number = OptionalNullable.ofNull(); - } else if (number.isEmpty()) { - this.number = OptionalNullable.absent(); - } else { - this.number = OptionalNullable.of(number.get()); - } + /** + *

The phone number to call. null on an event type means the booking supplies its own.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage number(String number) { + this.number = OptionalNullable.of(number); + return this; + } + + /** + *

The phone number to call. null on an event type means the booking supplies its own.

+ */ + @java.lang.Override + @JsonSetter(value = "number", nulls = Nulls.SKIP) + public _FinalStage number(OptionalNullable number) { + this.number = number; return this; } - public SchedulingLocationPhone build() { - return new SchedulingLocationPhone(number, additionalProperties); + @java.lang.Override + public SchedulingLocationNumber build() { + return new SchedulingLocationNumber(type, number, additionalProperties); } + @java.lang.Override public Builder additionalProperty(String key, Object value) { this.additionalProperties.put(key, value); return this; } + @java.lang.Override public Builder additionalProperties(Map additionalProperties) { this.additionalProperties.putAll(additionalProperties); return this; diff --git a/sdks/java/src/main/java/com/coss/types/SchedulingLocationNumberType.java b/sdks/java/src/main/java/com/coss/types/SchedulingLocationNumberType.java new file mode 100644 index 000000000..3c31369c3 --- /dev/null +++ b/sdks/java/src/main/java/com/coss/types/SchedulingLocationNumberType.java @@ -0,0 +1,74 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.coss.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class SchedulingLocationNumberType { + public static final SchedulingLocationNumberType PHONE = new SchedulingLocationNumberType(Value.PHONE, "phone"); + + private final Value value; + + private final String string; + + SchedulingLocationNumberType(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof SchedulingLocationNumberType + && this.string.equals(((SchedulingLocationNumberType) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case PHONE: + return visitor.visitPhone(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static SchedulingLocationNumberType valueOf(String value) { + switch (value) { + case "phone": + return PHONE; + default: + return new SchedulingLocationNumberType(Value.UNKNOWN, value); + } + } + + public enum Value { + PHONE, + + UNKNOWN + } + + public interface Visitor { + T visitPhone(); + + T visitUnknown(String unknownType); + } +} diff --git a/sdks/java/src/main/java/com/coss/types/SchedulingLocationThree.java b/sdks/java/src/main/java/com/coss/types/SchedulingLocationThree.java new file mode 100644 index 000000000..bf64a394f --- /dev/null +++ b/sdks/java/src/main/java/com/coss/types/SchedulingLocationThree.java @@ -0,0 +1,118 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.coss.types; + +import com.coss.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = SchedulingLocationThree.Builder.class) +public final class SchedulingLocationThree { + private final SchedulingLocationThreeType type; + + private final Map additionalProperties; + + private SchedulingLocationThree(SchedulingLocationThreeType type, Map additionalProperties) { + this.type = type; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("type") + public SchedulingLocationThreeType getType() { + return type; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof SchedulingLocationThree && equalTo((SchedulingLocationThree) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(SchedulingLocationThree other) { + return type.equals(other.type); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.type); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static TypeStage builder() { + return new Builder(); + } + + public interface TypeStage { + _FinalStage type(@NotNull SchedulingLocationThreeType type); + + Builder from(SchedulingLocationThree other); + } + + public interface _FinalStage { + SchedulingLocationThree build(); + + _FinalStage additionalProperty(String key, Object value); + + _FinalStage additionalProperties(Map additionalProperties); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements TypeStage, _FinalStage { + private SchedulingLocationThreeType type; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(SchedulingLocationThree other) { + type(other.getType()); + return this; + } + + @java.lang.Override + @JsonSetter("type") + public _FinalStage type(@NotNull SchedulingLocationThreeType type) { + this.type = Objects.requireNonNull(type, "type must not be null"); + return this; + } + + @java.lang.Override + public SchedulingLocationThree build() { + return new SchedulingLocationThree(type, additionalProperties); + } + + @java.lang.Override + public Builder additionalProperty(String key, Object value) { + this.additionalProperties.put(key, value); + return this; + } + + @java.lang.Override + public Builder additionalProperties(Map additionalProperties) { + this.additionalProperties.putAll(additionalProperties); + return this; + } + } +} diff --git a/sdks/java/src/main/java/com/coss/types/SchedulingLocationThreeType.java b/sdks/java/src/main/java/com/coss/types/SchedulingLocationThreeType.java new file mode 100644 index 000000000..98c520831 --- /dev/null +++ b/sdks/java/src/main/java/com/coss/types/SchedulingLocationThreeType.java @@ -0,0 +1,75 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.coss.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class SchedulingLocationThreeType { + public static final SchedulingLocationThreeType GOOGLE_MEET = + new SchedulingLocationThreeType(Value.GOOGLE_MEET, "google_meet"); + + private final Value value; + + private final String string; + + SchedulingLocationThreeType(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof SchedulingLocationThreeType + && this.string.equals(((SchedulingLocationThreeType) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case GOOGLE_MEET: + return visitor.visitGoogleMeet(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static SchedulingLocationThreeType valueOf(String value) { + switch (value) { + case "google_meet": + return GOOGLE_MEET; + default: + return new SchedulingLocationThreeType(Value.UNKNOWN, value); + } + } + + public enum Value { + GOOGLE_MEET, + + UNKNOWN + } + + public interface Visitor { + T visitGoogleMeet(); + + T visitUnknown(String unknownType); + } +} diff --git a/sdks/java/src/main/java/com/coss/types/SchedulingLocationLink.java b/sdks/java/src/main/java/com/coss/types/SchedulingLocationZero.java similarity index 53% rename from sdks/java/src/main/java/com/coss/types/SchedulingLocationLink.java rename to sdks/java/src/main/java/com/coss/types/SchedulingLocationZero.java index d0e63309d..e3196f4de 100644 --- a/sdks/java/src/main/java/com/coss/types/SchedulingLocationLink.java +++ b/sdks/java/src/main/java/com/coss/types/SchedulingLocationZero.java @@ -19,19 +19,29 @@ import java.util.Map; import java.util.Objects; import java.util.Optional; +import org.jetbrains.annotations.NotNull; @JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = SchedulingLocationLink.Builder.class) -public final class SchedulingLocationLink { +@JsonDeserialize(builder = SchedulingLocationZero.Builder.class) +public final class SchedulingLocationZero { + private final SchedulingLocationZeroType type; + private final OptionalNullable url; private final Map additionalProperties; - private SchedulingLocationLink(OptionalNullable url, Map additionalProperties) { + private SchedulingLocationZero( + SchedulingLocationZeroType type, OptionalNullable url, Map additionalProperties) { + this.type = type; this.url = url; this.additionalProperties = additionalProperties; } + @JsonProperty("type") + public SchedulingLocationZeroType getType() { + return type; + } + /** * @return The meeting link. null on an event type means the booking supplies its own. */ @@ -53,7 +63,7 @@ private OptionalNullable _getUrl() { @java.lang.Override public boolean equals(Object other) { if (this == other) return true; - return other instanceof SchedulingLocationLink && equalTo((SchedulingLocationLink) other); + return other instanceof SchedulingLocationZero && equalTo((SchedulingLocationZero) other); } @JsonAnyGetter @@ -61,13 +71,13 @@ public Map getAdditionalProperties() { return this.additionalProperties; } - private boolean equalTo(SchedulingLocationLink other) { - return url.equals(other.url); + private boolean equalTo(SchedulingLocationZero other) { + return type.equals(other.type) && url.equals(other.url); } @java.lang.Override public int hashCode() { - return Objects.hash(this.url); + return Objects.hash(this.type, this.url); } @java.lang.Override @@ -75,12 +85,39 @@ public String toString() { return ObjectMappers.stringify(this); } - public static Builder builder() { + public static TypeStage builder() { return new Builder(); } + public interface TypeStage { + _FinalStage type(@NotNull SchedulingLocationZeroType type); + + Builder from(SchedulingLocationZero other); + } + + public interface _FinalStage { + SchedulingLocationZero build(); + + _FinalStage additionalProperty(String key, Object value); + + _FinalStage additionalProperties(Map additionalProperties); + + /** + *

The meeting link. null on an event type means the booking supplies its own.

+ */ + _FinalStage url(OptionalNullable url); + + _FinalStage url(String url); + + _FinalStage url(Optional url); + + _FinalStage url(Nullable url); + } + @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { + public static final class Builder implements TypeStage, _FinalStage { + private SchedulingLocationZeroType type; + private OptionalNullable url = OptionalNullable.absent(); @JsonAnySetter @@ -88,26 +125,42 @@ public static final class Builder { private Builder() {} - public Builder from(SchedulingLocationLink other) { + @java.lang.Override + public Builder from(SchedulingLocationZero other) { + type(other.getType()); url(other.getUrl()); return this; } - /** - *

The meeting link. null on an event type means the booking supplies its own.

- */ - @JsonSetter(value = "url", nulls = Nulls.SKIP) - public Builder url(OptionalNullable url) { - this.url = url; + @java.lang.Override + @JsonSetter("type") + public _FinalStage type(@NotNull SchedulingLocationZeroType type) { + this.type = Objects.requireNonNull(type, "type must not be null"); return this; } - public Builder url(String url) { - this.url = OptionalNullable.of(url); + /** + *

The meeting link. null on an event type means the booking supplies its own.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage url(Nullable url) { + if (url.isNull()) { + this.url = OptionalNullable.ofNull(); + } else if (url.isEmpty()) { + this.url = OptionalNullable.absent(); + } else { + this.url = OptionalNullable.of(url.get()); + } return this; } - public Builder url(Optional url) { + /** + *

The meeting link. null on an event type means the booking supplies its own.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage url(Optional url) { if (url.isPresent()) { this.url = OptionalNullable.of(url.get()); } else { @@ -116,26 +169,38 @@ public Builder url(Optional url) { return this; } - public Builder url(Nullable url) { - if (url.isNull()) { - this.url = OptionalNullable.ofNull(); - } else if (url.isEmpty()) { - this.url = OptionalNullable.absent(); - } else { - this.url = OptionalNullable.of(url.get()); - } + /** + *

The meeting link. null on an event type means the booking supplies its own.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage url(String url) { + this.url = OptionalNullable.of(url); + return this; + } + + /** + *

The meeting link. null on an event type means the booking supplies its own.

+ */ + @java.lang.Override + @JsonSetter(value = "url", nulls = Nulls.SKIP) + public _FinalStage url(OptionalNullable url) { + this.url = url; return this; } - public SchedulingLocationLink build() { - return new SchedulingLocationLink(url, additionalProperties); + @java.lang.Override + public SchedulingLocationZero build() { + return new SchedulingLocationZero(type, url, additionalProperties); } + @java.lang.Override public Builder additionalProperty(String key, Object value) { this.additionalProperties.put(key, value); return this; } + @java.lang.Override public Builder additionalProperties(Map additionalProperties) { this.additionalProperties.putAll(additionalProperties); return this; diff --git a/sdks/java/src/main/java/com/coss/types/SchedulingLocationZeroType.java b/sdks/java/src/main/java/com/coss/types/SchedulingLocationZeroType.java new file mode 100644 index 000000000..4a0ab7731 --- /dev/null +++ b/sdks/java/src/main/java/com/coss/types/SchedulingLocationZeroType.java @@ -0,0 +1,74 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.coss.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class SchedulingLocationZeroType { + public static final SchedulingLocationZeroType LINK = new SchedulingLocationZeroType(Value.LINK, "link"); + + private final Value value; + + private final String string; + + SchedulingLocationZeroType(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof SchedulingLocationZeroType + && this.string.equals(((SchedulingLocationZeroType) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case LINK: + return visitor.visitLink(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static SchedulingLocationZeroType valueOf(String value) { + switch (value) { + case "link": + return LINK; + default: + return new SchedulingLocationZeroType(Value.UNKNOWN, value); + } + } + + public enum Value { + LINK, + + UNKNOWN + } + + public interface Visitor { + T visitLink(); + + T visitUnknown(String unknownType); + } +} diff --git a/sdks/java/src/main/java/com/coss/types/SchedulingOauthApp.java b/sdks/java/src/main/java/com/coss/types/SchedulingOauthApp.java new file mode 100644 index 000000000..c92f2e869 --- /dev/null +++ b/sdks/java/src/main/java/com/coss/types/SchedulingOauthApp.java @@ -0,0 +1,1026 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.coss.types; + +import com.coss.core.Nullable; +import com.coss.core.NullableNonemptyFilter; +import com.coss.core.ObjectMappers; +import com.coss.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = SchedulingOauthApp.Builder.class) +public final class SchedulingOauthApp { + private final SchedulingOauthAppObject object; + + private final String id; + + private final SchedulingOauthAppProvider provider; + + private final String clientId; + + private final OptionalNullable tenantId; + + private final OptionalNullable redirectUri; + + private final String cossCallbackUrl; + + private final OptionalNullable completionUrl; + + private final OptionalNullable zoomEventUrl; + + private final List scopes; + + private final SchedulingOauthAppStatus status; + + private final OptionalNullable lastErrorCode; + + private final OptionalNullable lastErrorAt; + + private final OptionalNullable secretExpiresAt; + + private final OptionalNullable verifiedAt; + + private final long connections; + + private final String createdAt; + + private final String updatedAt; + + private final Map additionalProperties; + + private SchedulingOauthApp( + SchedulingOauthAppObject object, + String id, + SchedulingOauthAppProvider provider, + String clientId, + OptionalNullable tenantId, + OptionalNullable redirectUri, + String cossCallbackUrl, + OptionalNullable completionUrl, + OptionalNullable zoomEventUrl, + List scopes, + SchedulingOauthAppStatus status, + OptionalNullable lastErrorCode, + OptionalNullable lastErrorAt, + OptionalNullable secretExpiresAt, + OptionalNullable verifiedAt, + long connections, + String createdAt, + String updatedAt, + Map additionalProperties) { + this.object = object; + this.id = id; + this.provider = provider; + this.clientId = clientId; + this.tenantId = tenantId; + this.redirectUri = redirectUri; + this.cossCallbackUrl = cossCallbackUrl; + this.completionUrl = completionUrl; + this.zoomEventUrl = zoomEventUrl; + this.scopes = scopes; + this.status = status; + this.lastErrorCode = lastErrorCode; + this.lastErrorAt = lastErrorAt; + this.secretExpiresAt = secretExpiresAt; + this.verifiedAt = verifiedAt; + this.connections = connections; + this.createdAt = createdAt; + this.updatedAt = updatedAt; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("object") + public SchedulingOauthAppObject getObject() { + return object; + } + + @JsonProperty("id") + public String getId() { + return id; + } + + @JsonProperty("provider") + public SchedulingOauthAppProvider getProvider() { + return provider; + } + + @JsonProperty("client_id") + public String getClientId() { + return clientId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("tenant_id") + public OptionalNullable getTenantId() { + if (tenantId == null) { + return OptionalNullable.absent(); + } + return tenantId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("redirect_uri") + public OptionalNullable getRedirectUri() { + if (redirectUri == null) { + return OptionalNullable.absent(); + } + return redirectUri; + } + + /** + * @return Register this with the provider if redirect_uri isn't set. If it is, that page forwards code and state here. + */ + @JsonProperty("coss_callback_url") + public String getCossCallbackUrl() { + return cossCallbackUrl; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("completion_url") + public OptionalNullable getCompletionUrl() { + if (completionUrl == null) { + return OptionalNullable.absent(); + } + return completionUrl; + } + + /** + * @return Zoom only: the Event notification endpoint URL for your app's deauthorization events. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("zoom_event_url") + public OptionalNullable getZoomEventUrl() { + if (zoomEventUrl == null) { + return OptionalNullable.absent(); + } + return zoomEventUrl; + } + + /** + * @return What to enable on your app at the provider. + */ + @JsonProperty("scopes") + public List getScopes() { + return scopes; + } + + /** + * @return failing: the provider refused the app's credentials. New consents are refused, and calendars connected through it can't be read until they work again. + */ + @JsonProperty("status") + public SchedulingOauthAppStatus getStatus() { + return status; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("last_error_code") + public OptionalNullable getLastErrorCode() { + if (lastErrorCode == null) { + return OptionalNullable.absent(); + } + return lastErrorCode; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("last_error_at") + public OptionalNullable getLastErrorAt() { + if (lastErrorAt == null) { + return OptionalNullable.absent(); + } + return lastErrorAt; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("secret_expires_at") + public OptionalNullable getSecretExpiresAt() { + if (secretExpiresAt == null) { + return OptionalNullable.absent(); + } + return secretExpiresAt; + } + + /** + * @return When a consent first completed through this app, which proves its secret. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("verified_at") + public OptionalNullable getVerifiedAt() { + if (verifiedAt == null) { + return OptionalNullable.absent(); + } + return verifiedAt; + } + + /** + * @return Calendar connections using this app. It can't be deleted while there are any. + */ + @JsonProperty("connections") + public long getConnections() { + return connections; + } + + @JsonProperty("created_at") + public String getCreatedAt() { + return createdAt; + } + + @JsonProperty("updated_at") + public String getUpdatedAt() { + return updatedAt; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("tenant_id") + private OptionalNullable _getTenantId() { + return tenantId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("redirect_uri") + private OptionalNullable _getRedirectUri() { + return redirectUri; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("completion_url") + private OptionalNullable _getCompletionUrl() { + return completionUrl; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("zoom_event_url") + private OptionalNullable _getZoomEventUrl() { + return zoomEventUrl; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("last_error_code") + private OptionalNullable _getLastErrorCode() { + return lastErrorCode; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("last_error_at") + private OptionalNullable _getLastErrorAt() { + return lastErrorAt; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("secret_expires_at") + private OptionalNullable _getSecretExpiresAt() { + return secretExpiresAt; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("verified_at") + private OptionalNullable _getVerifiedAt() { + return verifiedAt; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof SchedulingOauthApp && equalTo((SchedulingOauthApp) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(SchedulingOauthApp other) { + return object.equals(other.object) + && id.equals(other.id) + && provider.equals(other.provider) + && clientId.equals(other.clientId) + && tenantId.equals(other.tenantId) + && redirectUri.equals(other.redirectUri) + && cossCallbackUrl.equals(other.cossCallbackUrl) + && completionUrl.equals(other.completionUrl) + && zoomEventUrl.equals(other.zoomEventUrl) + && scopes.equals(other.scopes) + && status.equals(other.status) + && lastErrorCode.equals(other.lastErrorCode) + && lastErrorAt.equals(other.lastErrorAt) + && secretExpiresAt.equals(other.secretExpiresAt) + && verifiedAt.equals(other.verifiedAt) + && connections == other.connections + && createdAt.equals(other.createdAt) + && updatedAt.equals(other.updatedAt); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.object, + this.id, + this.provider, + this.clientId, + this.tenantId, + this.redirectUri, + this.cossCallbackUrl, + this.completionUrl, + this.zoomEventUrl, + this.scopes, + this.status, + this.lastErrorCode, + this.lastErrorAt, + this.secretExpiresAt, + this.verifiedAt, + this.connections, + this.createdAt, + this.updatedAt); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ObjectStage builder() { + return new Builder(); + } + + public interface ObjectStage { + IdStage object(@NotNull SchedulingOauthAppObject object); + + Builder from(SchedulingOauthApp other); + } + + public interface IdStage { + ProviderStage id(@NotNull String id); + } + + public interface ProviderStage { + ClientIdStage provider(@NotNull SchedulingOauthAppProvider provider); + } + + public interface ClientIdStage { + CossCallbackUrlStage clientId(@NotNull String clientId); + } + + public interface CossCallbackUrlStage { + /** + *

Register this with the provider if redirect_uri isn't set. If it is, that page forwards code and state here.

+ */ + StatusStage cossCallbackUrl(@NotNull String cossCallbackUrl); + } + + public interface StatusStage { + /** + *

failing: the provider refused the app's credentials. New consents are refused, and calendars connected through it can't be read until they work again.

+ */ + ConnectionsStage status(@NotNull SchedulingOauthAppStatus status); + } + + public interface ConnectionsStage { + /** + *

Calendar connections using this app. It can't be deleted while there are any.

+ */ + CreatedAtStage connections(long connections); + } + + public interface CreatedAtStage { + UpdatedAtStage createdAt(@NotNull String createdAt); + } + + public interface UpdatedAtStage { + _FinalStage updatedAt(@NotNull String updatedAt); + } + + public interface _FinalStage { + SchedulingOauthApp build(); + + _FinalStage additionalProperty(String key, Object value); + + _FinalStage additionalProperties(Map additionalProperties); + + _FinalStage tenantId(OptionalNullable tenantId); + + _FinalStage tenantId(String tenantId); + + _FinalStage tenantId(Optional tenantId); + + _FinalStage tenantId(Nullable tenantId); + + _FinalStage redirectUri(OptionalNullable redirectUri); + + _FinalStage redirectUri(String redirectUri); + + _FinalStage redirectUri(Optional redirectUri); + + _FinalStage redirectUri(Nullable redirectUri); + + _FinalStage completionUrl(OptionalNullable completionUrl); + + _FinalStage completionUrl(String completionUrl); + + _FinalStage completionUrl(Optional completionUrl); + + _FinalStage completionUrl(Nullable completionUrl); + + /** + *

Zoom only: the Event notification endpoint URL for your app's deauthorization events.

+ */ + _FinalStage zoomEventUrl(OptionalNullable zoomEventUrl); + + _FinalStage zoomEventUrl(String zoomEventUrl); + + _FinalStage zoomEventUrl(Optional zoomEventUrl); + + _FinalStage zoomEventUrl(Nullable zoomEventUrl); + + /** + *

What to enable on your app at the provider.

+ */ + _FinalStage scopes(List scopes); + + _FinalStage addScopes(String scopes); + + _FinalStage addAllScopes(List scopes); + + _FinalStage lastErrorCode(OptionalNullable lastErrorCode); + + _FinalStage lastErrorCode(String lastErrorCode); + + _FinalStage lastErrorCode(Optional lastErrorCode); + + _FinalStage lastErrorCode(Nullable lastErrorCode); + + _FinalStage lastErrorAt(OptionalNullable lastErrorAt); + + _FinalStage lastErrorAt(String lastErrorAt); + + _FinalStage lastErrorAt(Optional lastErrorAt); + + _FinalStage lastErrorAt(Nullable lastErrorAt); + + _FinalStage secretExpiresAt(OptionalNullable secretExpiresAt); + + _FinalStage secretExpiresAt(String secretExpiresAt); + + _FinalStage secretExpiresAt(Optional secretExpiresAt); + + _FinalStage secretExpiresAt(Nullable secretExpiresAt); + + /** + *

When a consent first completed through this app, which proves its secret.

+ */ + _FinalStage verifiedAt(OptionalNullable verifiedAt); + + _FinalStage verifiedAt(String verifiedAt); + + _FinalStage verifiedAt(Optional verifiedAt); + + _FinalStage verifiedAt(Nullable verifiedAt); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder + implements ObjectStage, + IdStage, + ProviderStage, + ClientIdStage, + CossCallbackUrlStage, + StatusStage, + ConnectionsStage, + CreatedAtStage, + UpdatedAtStage, + _FinalStage { + private SchedulingOauthAppObject object; + + private String id; + + private SchedulingOauthAppProvider provider; + + private String clientId; + + private String cossCallbackUrl; + + private SchedulingOauthAppStatus status; + + private long connections; + + private String createdAt; + + private String updatedAt; + + private OptionalNullable verifiedAt = OptionalNullable.absent(); + + private OptionalNullable secretExpiresAt = OptionalNullable.absent(); + + private OptionalNullable lastErrorAt = OptionalNullable.absent(); + + private OptionalNullable lastErrorCode = OptionalNullable.absent(); + + private List scopes = new ArrayList<>(); + + private OptionalNullable zoomEventUrl = OptionalNullable.absent(); + + private OptionalNullable completionUrl = OptionalNullable.absent(); + + private OptionalNullable redirectUri = OptionalNullable.absent(); + + private OptionalNullable tenantId = OptionalNullable.absent(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(SchedulingOauthApp other) { + object(other.getObject()); + id(other.getId()); + provider(other.getProvider()); + clientId(other.getClientId()); + tenantId(other.getTenantId()); + redirectUri(other.getRedirectUri()); + cossCallbackUrl(other.getCossCallbackUrl()); + completionUrl(other.getCompletionUrl()); + zoomEventUrl(other.getZoomEventUrl()); + scopes(other.getScopes()); + status(other.getStatus()); + lastErrorCode(other.getLastErrorCode()); + lastErrorAt(other.getLastErrorAt()); + secretExpiresAt(other.getSecretExpiresAt()); + verifiedAt(other.getVerifiedAt()); + connections(other.getConnections()); + createdAt(other.getCreatedAt()); + updatedAt(other.getUpdatedAt()); + return this; + } + + @java.lang.Override + @JsonSetter("object") + public IdStage object(@NotNull SchedulingOauthAppObject object) { + this.object = Objects.requireNonNull(object, "object must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("id") + public ProviderStage id(@NotNull String id) { + this.id = Objects.requireNonNull(id, "id must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("provider") + public ClientIdStage provider(@NotNull SchedulingOauthAppProvider provider) { + this.provider = Objects.requireNonNull(provider, "provider must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("client_id") + public CossCallbackUrlStage clientId(@NotNull String clientId) { + this.clientId = Objects.requireNonNull(clientId, "clientId must not be null"); + return this; + } + + /** + *

Register this with the provider if redirect_uri isn't set. If it is, that page forwards code and state here.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("coss_callback_url") + public StatusStage cossCallbackUrl(@NotNull String cossCallbackUrl) { + this.cossCallbackUrl = Objects.requireNonNull(cossCallbackUrl, "cossCallbackUrl must not be null"); + return this; + } + + /** + *

failing: the provider refused the app's credentials. New consents are refused, and calendars connected through it can't be read until they work again.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("status") + public ConnectionsStage status(@NotNull SchedulingOauthAppStatus status) { + this.status = Objects.requireNonNull(status, "status must not be null"); + return this; + } + + /** + *

Calendar connections using this app. It can't be deleted while there are any.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("connections") + public CreatedAtStage connections(long connections) { + this.connections = connections; + return this; + } + + @java.lang.Override + @JsonSetter("created_at") + public UpdatedAtStage createdAt(@NotNull String createdAt) { + this.createdAt = Objects.requireNonNull(createdAt, "createdAt must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("updated_at") + public _FinalStage updatedAt(@NotNull String updatedAt) { + this.updatedAt = Objects.requireNonNull(updatedAt, "updatedAt must not be null"); + return this; + } + + /** + *

When a consent first completed through this app, which proves its secret.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage verifiedAt(Nullable verifiedAt) { + if (verifiedAt.isNull()) { + this.verifiedAt = OptionalNullable.ofNull(); + } else if (verifiedAt.isEmpty()) { + this.verifiedAt = OptionalNullable.absent(); + } else { + this.verifiedAt = OptionalNullable.of(verifiedAt.get()); + } + return this; + } + + /** + *

When a consent first completed through this app, which proves its secret.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage verifiedAt(Optional verifiedAt) { + if (verifiedAt.isPresent()) { + this.verifiedAt = OptionalNullable.of(verifiedAt.get()); + } else { + this.verifiedAt = OptionalNullable.absent(); + } + return this; + } + + /** + *

When a consent first completed through this app, which proves its secret.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage verifiedAt(String verifiedAt) { + this.verifiedAt = OptionalNullable.of(verifiedAt); + return this; + } + + /** + *

When a consent first completed through this app, which proves its secret.

+ */ + @java.lang.Override + @JsonSetter(value = "verified_at", nulls = Nulls.SKIP) + public _FinalStage verifiedAt(OptionalNullable verifiedAt) { + this.verifiedAt = verifiedAt; + return this; + } + + @java.lang.Override + public _FinalStage secretExpiresAt(Nullable secretExpiresAt) { + if (secretExpiresAt.isNull()) { + this.secretExpiresAt = OptionalNullable.ofNull(); + } else if (secretExpiresAt.isEmpty()) { + this.secretExpiresAt = OptionalNullable.absent(); + } else { + this.secretExpiresAt = OptionalNullable.of(secretExpiresAt.get()); + } + return this; + } + + @java.lang.Override + public _FinalStage secretExpiresAt(Optional secretExpiresAt) { + if (secretExpiresAt.isPresent()) { + this.secretExpiresAt = OptionalNullable.of(secretExpiresAt.get()); + } else { + this.secretExpiresAt = OptionalNullable.absent(); + } + return this; + } + + @java.lang.Override + public _FinalStage secretExpiresAt(String secretExpiresAt) { + this.secretExpiresAt = OptionalNullable.of(secretExpiresAt); + return this; + } + + @java.lang.Override + @JsonSetter(value = "secret_expires_at", nulls = Nulls.SKIP) + public _FinalStage secretExpiresAt(OptionalNullable secretExpiresAt) { + this.secretExpiresAt = secretExpiresAt; + return this; + } + + @java.lang.Override + public _FinalStage lastErrorAt(Nullable lastErrorAt) { + if (lastErrorAt.isNull()) { + this.lastErrorAt = OptionalNullable.ofNull(); + } else if (lastErrorAt.isEmpty()) { + this.lastErrorAt = OptionalNullable.absent(); + } else { + this.lastErrorAt = OptionalNullable.of(lastErrorAt.get()); + } + return this; + } + + @java.lang.Override + public _FinalStage lastErrorAt(Optional lastErrorAt) { + if (lastErrorAt.isPresent()) { + this.lastErrorAt = OptionalNullable.of(lastErrorAt.get()); + } else { + this.lastErrorAt = OptionalNullable.absent(); + } + return this; + } + + @java.lang.Override + public _FinalStage lastErrorAt(String lastErrorAt) { + this.lastErrorAt = OptionalNullable.of(lastErrorAt); + return this; + } + + @java.lang.Override + @JsonSetter(value = "last_error_at", nulls = Nulls.SKIP) + public _FinalStage lastErrorAt(OptionalNullable lastErrorAt) { + this.lastErrorAt = lastErrorAt; + return this; + } + + @java.lang.Override + public _FinalStage lastErrorCode(Nullable lastErrorCode) { + if (lastErrorCode.isNull()) { + this.lastErrorCode = OptionalNullable.ofNull(); + } else if (lastErrorCode.isEmpty()) { + this.lastErrorCode = OptionalNullable.absent(); + } else { + this.lastErrorCode = OptionalNullable.of(lastErrorCode.get()); + } + return this; + } + + @java.lang.Override + public _FinalStage lastErrorCode(Optional lastErrorCode) { + if (lastErrorCode.isPresent()) { + this.lastErrorCode = OptionalNullable.of(lastErrorCode.get()); + } else { + this.lastErrorCode = OptionalNullable.absent(); + } + return this; + } + + @java.lang.Override + public _FinalStage lastErrorCode(String lastErrorCode) { + this.lastErrorCode = OptionalNullable.of(lastErrorCode); + return this; + } + + @java.lang.Override + @JsonSetter(value = "last_error_code", nulls = Nulls.SKIP) + public _FinalStage lastErrorCode(OptionalNullable lastErrorCode) { + this.lastErrorCode = lastErrorCode; + return this; + } + + /** + *

What to enable on your app at the provider.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage addAllScopes(List scopes) { + if (scopes != null) { + this.scopes.addAll(scopes); + } + return this; + } + + /** + *

What to enable on your app at the provider.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage addScopes(String scopes) { + this.scopes.add(scopes); + return this; + } + + /** + *

What to enable on your app at the provider.

+ */ + @java.lang.Override + @JsonSetter(value = "scopes", nulls = Nulls.SKIP) + public _FinalStage scopes(List scopes) { + this.scopes.clear(); + if (scopes != null) { + this.scopes.addAll(scopes); + } + return this; + } + + /** + *

Zoom only: the Event notification endpoint URL for your app's deauthorization events.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage zoomEventUrl(Nullable zoomEventUrl) { + if (zoomEventUrl.isNull()) { + this.zoomEventUrl = OptionalNullable.ofNull(); + } else if (zoomEventUrl.isEmpty()) { + this.zoomEventUrl = OptionalNullable.absent(); + } else { + this.zoomEventUrl = OptionalNullable.of(zoomEventUrl.get()); + } + return this; + } + + /** + *

Zoom only: the Event notification endpoint URL for your app's deauthorization events.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage zoomEventUrl(Optional zoomEventUrl) { + if (zoomEventUrl.isPresent()) { + this.zoomEventUrl = OptionalNullable.of(zoomEventUrl.get()); + } else { + this.zoomEventUrl = OptionalNullable.absent(); + } + return this; + } + + /** + *

Zoom only: the Event notification endpoint URL for your app's deauthorization events.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage zoomEventUrl(String zoomEventUrl) { + this.zoomEventUrl = OptionalNullable.of(zoomEventUrl); + return this; + } + + /** + *

Zoom only: the Event notification endpoint URL for your app's deauthorization events.

+ */ + @java.lang.Override + @JsonSetter(value = "zoom_event_url", nulls = Nulls.SKIP) + public _FinalStage zoomEventUrl(OptionalNullable zoomEventUrl) { + this.zoomEventUrl = zoomEventUrl; + return this; + } + + @java.lang.Override + public _FinalStage completionUrl(Nullable completionUrl) { + if (completionUrl.isNull()) { + this.completionUrl = OptionalNullable.ofNull(); + } else if (completionUrl.isEmpty()) { + this.completionUrl = OptionalNullable.absent(); + } else { + this.completionUrl = OptionalNullable.of(completionUrl.get()); + } + return this; + } + + @java.lang.Override + public _FinalStage completionUrl(Optional completionUrl) { + if (completionUrl.isPresent()) { + this.completionUrl = OptionalNullable.of(completionUrl.get()); + } else { + this.completionUrl = OptionalNullable.absent(); + } + return this; + } + + @java.lang.Override + public _FinalStage completionUrl(String completionUrl) { + this.completionUrl = OptionalNullable.of(completionUrl); + return this; + } + + @java.lang.Override + @JsonSetter(value = "completion_url", nulls = Nulls.SKIP) + public _FinalStage completionUrl(OptionalNullable completionUrl) { + this.completionUrl = completionUrl; + return this; + } + + @java.lang.Override + public _FinalStage redirectUri(Nullable redirectUri) { + if (redirectUri.isNull()) { + this.redirectUri = OptionalNullable.ofNull(); + } else if (redirectUri.isEmpty()) { + this.redirectUri = OptionalNullable.absent(); + } else { + this.redirectUri = OptionalNullable.of(redirectUri.get()); + } + return this; + } + + @java.lang.Override + public _FinalStage redirectUri(Optional redirectUri) { + if (redirectUri.isPresent()) { + this.redirectUri = OptionalNullable.of(redirectUri.get()); + } else { + this.redirectUri = OptionalNullable.absent(); + } + return this; + } + + @java.lang.Override + public _FinalStage redirectUri(String redirectUri) { + this.redirectUri = OptionalNullable.of(redirectUri); + return this; + } + + @java.lang.Override + @JsonSetter(value = "redirect_uri", nulls = Nulls.SKIP) + public _FinalStage redirectUri(OptionalNullable redirectUri) { + this.redirectUri = redirectUri; + return this; + } + + @java.lang.Override + public _FinalStage tenantId(Nullable tenantId) { + if (tenantId.isNull()) { + this.tenantId = OptionalNullable.ofNull(); + } else if (tenantId.isEmpty()) { + this.tenantId = OptionalNullable.absent(); + } else { + this.tenantId = OptionalNullable.of(tenantId.get()); + } + return this; + } + + @java.lang.Override + public _FinalStage tenantId(Optional tenantId) { + if (tenantId.isPresent()) { + this.tenantId = OptionalNullable.of(tenantId.get()); + } else { + this.tenantId = OptionalNullable.absent(); + } + return this; + } + + @java.lang.Override + public _FinalStage tenantId(String tenantId) { + this.tenantId = OptionalNullable.of(tenantId); + return this; + } + + @java.lang.Override + @JsonSetter(value = "tenant_id", nulls = Nulls.SKIP) + public _FinalStage tenantId(OptionalNullable tenantId) { + this.tenantId = tenantId; + return this; + } + + @java.lang.Override + public SchedulingOauthApp build() { + return new SchedulingOauthApp( + object, + id, + provider, + clientId, + tenantId, + redirectUri, + cossCallbackUrl, + completionUrl, + zoomEventUrl, + scopes, + status, + lastErrorCode, + lastErrorAt, + secretExpiresAt, + verifiedAt, + connections, + createdAt, + updatedAt, + additionalProperties); + } + + @java.lang.Override + public Builder additionalProperty(String key, Object value) { + this.additionalProperties.put(key, value); + return this; + } + + @java.lang.Override + public Builder additionalProperties(Map additionalProperties) { + this.additionalProperties.putAll(additionalProperties); + return this; + } + } +} diff --git a/sdks/java/src/main/java/com/coss/types/SchedulingOauthAppList.java b/sdks/java/src/main/java/com/coss/types/SchedulingOauthAppList.java new file mode 100644 index 000000000..e951c577d --- /dev/null +++ b/sdks/java/src/main/java/com/coss/types/SchedulingOauthAppList.java @@ -0,0 +1,188 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.coss.types; + +import com.coss.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = SchedulingOauthAppList.Builder.class) +public final class SchedulingOauthAppList { + private final SchedulingOauthAppListObject object; + + private final List data; + + private final boolean hasMore; + + private final Map additionalProperties; + + private SchedulingOauthAppList( + SchedulingOauthAppListObject object, + List data, + boolean hasMore, + Map additionalProperties) { + this.object = object; + this.data = data; + this.hasMore = hasMore; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("object") + public SchedulingOauthAppListObject getObject() { + return object; + } + + @JsonProperty("data") + public List getData() { + return data; + } + + @JsonProperty("has_more") + public boolean getHasMore() { + return hasMore; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof SchedulingOauthAppList && equalTo((SchedulingOauthAppList) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(SchedulingOauthAppList other) { + return object.equals(other.object) && data.equals(other.data) && hasMore == other.hasMore; + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.object, this.data, this.hasMore); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ObjectStage builder() { + return new Builder(); + } + + public interface ObjectStage { + HasMoreStage object(@NotNull SchedulingOauthAppListObject object); + + Builder from(SchedulingOauthAppList other); + } + + public interface HasMoreStage { + _FinalStage hasMore(boolean hasMore); + } + + public interface _FinalStage { + SchedulingOauthAppList build(); + + _FinalStage additionalProperty(String key, Object value); + + _FinalStage additionalProperties(Map additionalProperties); + + _FinalStage data(List data); + + _FinalStage addData(SchedulingOauthApp data); + + _FinalStage addAllData(List data); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ObjectStage, HasMoreStage, _FinalStage { + private SchedulingOauthAppListObject object; + + private boolean hasMore; + + private List data = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(SchedulingOauthAppList other) { + object(other.getObject()); + data(other.getData()); + hasMore(other.getHasMore()); + return this; + } + + @java.lang.Override + @JsonSetter("object") + public HasMoreStage object(@NotNull SchedulingOauthAppListObject object) { + this.object = Objects.requireNonNull(object, "object must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("has_more") + public _FinalStage hasMore(boolean hasMore) { + this.hasMore = hasMore; + return this; + } + + @java.lang.Override + public _FinalStage addAllData(List data) { + if (data != null) { + this.data.addAll(data); + } + return this; + } + + @java.lang.Override + public _FinalStage addData(SchedulingOauthApp data) { + this.data.add(data); + return this; + } + + @java.lang.Override + @JsonSetter(value = "data", nulls = Nulls.SKIP) + public _FinalStage data(List data) { + this.data.clear(); + if (data != null) { + this.data.addAll(data); + } + return this; + } + + @java.lang.Override + public SchedulingOauthAppList build() { + return new SchedulingOauthAppList(object, data, hasMore, additionalProperties); + } + + @java.lang.Override + public Builder additionalProperty(String key, Object value) { + this.additionalProperties.put(key, value); + return this; + } + + @java.lang.Override + public Builder additionalProperties(Map additionalProperties) { + this.additionalProperties.putAll(additionalProperties); + return this; + } + } +} diff --git a/sdks/java/src/main/java/com/coss/types/SchedulingOauthAppListObject.java b/sdks/java/src/main/java/com/coss/types/SchedulingOauthAppListObject.java new file mode 100644 index 000000000..750ebebf2 --- /dev/null +++ b/sdks/java/src/main/java/com/coss/types/SchedulingOauthAppListObject.java @@ -0,0 +1,74 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.coss.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class SchedulingOauthAppListObject { + public static final SchedulingOauthAppListObject LIST = new SchedulingOauthAppListObject(Value.LIST, "list"); + + private final Value value; + + private final String string; + + SchedulingOauthAppListObject(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof SchedulingOauthAppListObject + && this.string.equals(((SchedulingOauthAppListObject) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case LIST: + return visitor.visitList(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static SchedulingOauthAppListObject valueOf(String value) { + switch (value) { + case "list": + return LIST; + default: + return new SchedulingOauthAppListObject(Value.UNKNOWN, value); + } + } + + public enum Value { + LIST, + + UNKNOWN + } + + public interface Visitor { + T visitList(); + + T visitUnknown(String unknownType); + } +} diff --git a/sdks/java/src/main/java/com/coss/types/SchedulingOauthAppObject.java b/sdks/java/src/main/java/com/coss/types/SchedulingOauthAppObject.java new file mode 100644 index 000000000..b16ef0fbf --- /dev/null +++ b/sdks/java/src/main/java/com/coss/types/SchedulingOauthAppObject.java @@ -0,0 +1,75 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.coss.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class SchedulingOauthAppObject { + public static final SchedulingOauthAppObject SCHEDULING_OAUTH_APP = + new SchedulingOauthAppObject(Value.SCHEDULING_OAUTH_APP, "scheduling.oauth_app"); + + private final Value value; + + private final String string; + + SchedulingOauthAppObject(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof SchedulingOauthAppObject + && this.string.equals(((SchedulingOauthAppObject) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case SCHEDULING_OAUTH_APP: + return visitor.visitSchedulingOauthApp(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static SchedulingOauthAppObject valueOf(String value) { + switch (value) { + case "scheduling.oauth_app": + return SCHEDULING_OAUTH_APP; + default: + return new SchedulingOauthAppObject(Value.UNKNOWN, value); + } + } + + public enum Value { + SCHEDULING_OAUTH_APP, + + UNKNOWN + } + + public interface Visitor { + T visitSchedulingOauthApp(); + + T visitUnknown(String unknownType); + } +} diff --git a/sdks/java/src/main/java/com/coss/types/SchedulingOauthAppProvider.java b/sdks/java/src/main/java/com/coss/types/SchedulingOauthAppProvider.java new file mode 100644 index 000000000..bce09c441 --- /dev/null +++ b/sdks/java/src/main/java/com/coss/types/SchedulingOauthAppProvider.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.coss.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class SchedulingOauthAppProvider { + public static final SchedulingOauthAppProvider GOOGLE = new SchedulingOauthAppProvider(Value.GOOGLE, "google"); + + public static final SchedulingOauthAppProvider ZOOM = new SchedulingOauthAppProvider(Value.ZOOM, "zoom"); + + public static final SchedulingOauthAppProvider MICROSOFT = + new SchedulingOauthAppProvider(Value.MICROSOFT, "microsoft"); + + private final Value value; + + private final String string; + + SchedulingOauthAppProvider(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof SchedulingOauthAppProvider + && this.string.equals(((SchedulingOauthAppProvider) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case GOOGLE: + return visitor.visitGoogle(); + case ZOOM: + return visitor.visitZoom(); + case MICROSOFT: + return visitor.visitMicrosoft(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static SchedulingOauthAppProvider valueOf(String value) { + switch (value) { + case "google": + return GOOGLE; + case "zoom": + return ZOOM; + case "microsoft": + return MICROSOFT; + default: + return new SchedulingOauthAppProvider(Value.UNKNOWN, value); + } + } + + public enum Value { + GOOGLE, + + MICROSOFT, + + ZOOM, + + UNKNOWN + } + + public interface Visitor { + T visitGoogle(); + + T visitMicrosoft(); + + T visitZoom(); + + T visitUnknown(String unknownType); + } +} diff --git a/sdks/java/src/main/java/com/coss/types/SchedulingOauthAppStatus.java b/sdks/java/src/main/java/com/coss/types/SchedulingOauthAppStatus.java new file mode 100644 index 000000000..6b8c034a1 --- /dev/null +++ b/sdks/java/src/main/java/com/coss/types/SchedulingOauthAppStatus.java @@ -0,0 +1,84 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.coss.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class SchedulingOauthAppStatus { + public static final SchedulingOauthAppStatus FAILING = new SchedulingOauthAppStatus(Value.FAILING, "failing"); + + public static final SchedulingOauthAppStatus ACTIVE = new SchedulingOauthAppStatus(Value.ACTIVE, "active"); + + private final Value value; + + private final String string; + + SchedulingOauthAppStatus(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof SchedulingOauthAppStatus + && this.string.equals(((SchedulingOauthAppStatus) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case FAILING: + return visitor.visitFailing(); + case ACTIVE: + return visitor.visitActive(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static SchedulingOauthAppStatus valueOf(String value) { + switch (value) { + case "failing": + return FAILING; + case "active": + return ACTIVE; + default: + return new SchedulingOauthAppStatus(Value.UNKNOWN, value); + } + } + + public enum Value { + ACTIVE, + + FAILING, + + UNKNOWN + } + + public interface Visitor { + T visitActive(); + + T visitFailing(); + + T visitUnknown(String unknownType); + } +} diff --git a/sdks/java/src/main/java/com/coss/types/SchedulingOauthAppWebhookEvent.java b/sdks/java/src/main/java/com/coss/types/SchedulingOauthAppWebhookEvent.java new file mode 100644 index 000000000..620f5a127 --- /dev/null +++ b/sdks/java/src/main/java/com/coss/types/SchedulingOauthAppWebhookEvent.java @@ -0,0 +1,273 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.coss.types; + +import com.coss.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = SchedulingOauthAppWebhookEvent.Builder.class) +public final class SchedulingOauthAppWebhookEvent { + private final String id; + + private final SchedulingOauthAppWebhookEventObject object; + + private final String apiVersion; + + private final OffsetDateTime createdAt; + + private final SchedulingOauthAppWebhookEventType type; + + private final SchedulingOauthAppWebhookEventData data; + + private final Map additionalProperties; + + private SchedulingOauthAppWebhookEvent( + String id, + SchedulingOauthAppWebhookEventObject object, + String apiVersion, + OffsetDateTime createdAt, + SchedulingOauthAppWebhookEventType type, + SchedulingOauthAppWebhookEventData data, + Map additionalProperties) { + this.id = id; + this.object = object; + this.apiVersion = apiVersion; + this.createdAt = createdAt; + this.type = type; + this.data = data; + this.additionalProperties = additionalProperties; + } + + /** + * @return The event id. + */ + @JsonProperty("id") + public String getId() { + return id; + } + + @JsonProperty("object") + public SchedulingOauthAppWebhookEventObject getObject() { + return object; + } + + /** + * @return The API version this payload is rendered in: the endpoint's. + */ + @JsonProperty("api_version") + public String getApiVersion() { + return apiVersion; + } + + /** + * @return When the event was created. + */ + @JsonProperty("created_at") + public OffsetDateTime getCreatedAt() { + return createdAt; + } + + @JsonProperty("type") + public SchedulingOauthAppWebhookEventType getType() { + return type; + } + + @JsonProperty("data") + public SchedulingOauthAppWebhookEventData getData() { + return data; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof SchedulingOauthAppWebhookEvent && equalTo((SchedulingOauthAppWebhookEvent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(SchedulingOauthAppWebhookEvent other) { + return id.equals(other.id) + && object.equals(other.object) + && apiVersion.equals(other.apiVersion) + && createdAt.equals(other.createdAt) + && type.equals(other.type) + && data.equals(other.data); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.id, this.object, this.apiVersion, this.createdAt, this.type, this.data); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static IdStage builder() { + return new Builder(); + } + + public interface IdStage { + /** + *

The event id.

+ */ + ObjectStage id(@NotNull String id); + + Builder from(SchedulingOauthAppWebhookEvent other); + } + + public interface ObjectStage { + ApiVersionStage object(@NotNull SchedulingOauthAppWebhookEventObject object); + } + + public interface ApiVersionStage { + /** + *

The API version this payload is rendered in: the endpoint's.

+ */ + CreatedAtStage apiVersion(@NotNull String apiVersion); + } + + public interface CreatedAtStage { + /** + *

When the event was created.

+ */ + TypeStage createdAt(@NotNull OffsetDateTime createdAt); + } + + public interface TypeStage { + DataStage type(@NotNull SchedulingOauthAppWebhookEventType type); + } + + public interface DataStage { + _FinalStage data(@NotNull SchedulingOauthAppWebhookEventData data); + } + + public interface _FinalStage { + SchedulingOauthAppWebhookEvent build(); + + _FinalStage additionalProperty(String key, Object value); + + _FinalStage additionalProperties(Map additionalProperties); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder + implements IdStage, ObjectStage, ApiVersionStage, CreatedAtStage, TypeStage, DataStage, _FinalStage { + private String id; + + private SchedulingOauthAppWebhookEventObject object; + + private String apiVersion; + + private OffsetDateTime createdAt; + + private SchedulingOauthAppWebhookEventType type; + + private SchedulingOauthAppWebhookEventData data; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(SchedulingOauthAppWebhookEvent other) { + id(other.getId()); + object(other.getObject()); + apiVersion(other.getApiVersion()); + createdAt(other.getCreatedAt()); + type(other.getType()); + data(other.getData()); + return this; + } + + /** + *

The event id.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("id") + public ObjectStage id(@NotNull String id) { + this.id = Objects.requireNonNull(id, "id must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("object") + public ApiVersionStage object(@NotNull SchedulingOauthAppWebhookEventObject object) { + this.object = Objects.requireNonNull(object, "object must not be null"); + return this; + } + + /** + *

The API version this payload is rendered in: the endpoint's.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("api_version") + public CreatedAtStage apiVersion(@NotNull String apiVersion) { + this.apiVersion = Objects.requireNonNull(apiVersion, "apiVersion must not be null"); + return this; + } + + /** + *

When the event was created.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("created_at") + public TypeStage createdAt(@NotNull OffsetDateTime createdAt) { + this.createdAt = Objects.requireNonNull(createdAt, "createdAt must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("type") + public DataStage type(@NotNull SchedulingOauthAppWebhookEventType type) { + this.type = Objects.requireNonNull(type, "type must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("data") + public _FinalStage data(@NotNull SchedulingOauthAppWebhookEventData data) { + this.data = Objects.requireNonNull(data, "data must not be null"); + return this; + } + + @java.lang.Override + public SchedulingOauthAppWebhookEvent build() { + return new SchedulingOauthAppWebhookEvent( + id, object, apiVersion, createdAt, type, data, additionalProperties); + } + + @java.lang.Override + public Builder additionalProperty(String key, Object value) { + this.additionalProperties.put(key, value); + return this; + } + + @java.lang.Override + public Builder additionalProperties(Map additionalProperties) { + this.additionalProperties.putAll(additionalProperties); + return this; + } + } +} diff --git a/sdks/java/src/main/java/com/coss/types/SchedulingOauthAppWebhookEventData.java b/sdks/java/src/main/java/com/coss/types/SchedulingOauthAppWebhookEventData.java new file mode 100644 index 000000000..25b7b3240 --- /dev/null +++ b/sdks/java/src/main/java/com/coss/types/SchedulingOauthAppWebhookEventData.java @@ -0,0 +1,261 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.coss.types; + +import com.coss.core.Nullable; +import com.coss.core.NullableNonemptyFilter; +import com.coss.core.ObjectMappers; +import com.coss.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = SchedulingOauthAppWebhookEventData.Builder.class) +public final class SchedulingOauthAppWebhookEventData { + private final String oauthAppId; + + private final String provider; + + private final OptionalNullable code; + + private final String occurredAt; + + private final Map additionalProperties; + + private SchedulingOauthAppWebhookEventData( + String oauthAppId, + String provider, + OptionalNullable code, + String occurredAt, + Map additionalProperties) { + this.oauthAppId = oauthAppId; + this.provider = provider; + this.code = code; + this.occurredAt = occurredAt; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("oauth_app_id") + public String getOauthAppId() { + return oauthAppId; + } + + @JsonProperty("provider") + public String getProvider() { + return provider; + } + + /** + * @return What the provider said, when it refused. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("code") + public OptionalNullable getCode() { + if (code == null) { + return OptionalNullable.absent(); + } + return code; + } + + @JsonProperty("occurred_at") + public String getOccurredAt() { + return occurredAt; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("code") + private OptionalNullable _getCode() { + return code; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof SchedulingOauthAppWebhookEventData + && equalTo((SchedulingOauthAppWebhookEventData) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(SchedulingOauthAppWebhookEventData other) { + return oauthAppId.equals(other.oauthAppId) + && provider.equals(other.provider) + && code.equals(other.code) + && occurredAt.equals(other.occurredAt); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.oauthAppId, this.provider, this.code, this.occurredAt); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static OauthAppIdStage builder() { + return new Builder(); + } + + public interface OauthAppIdStage { + ProviderStage oauthAppId(@NotNull String oauthAppId); + + Builder from(SchedulingOauthAppWebhookEventData other); + } + + public interface ProviderStage { + OccurredAtStage provider(@NotNull String provider); + } + + public interface OccurredAtStage { + _FinalStage occurredAt(@NotNull String occurredAt); + } + + public interface _FinalStage { + SchedulingOauthAppWebhookEventData build(); + + _FinalStage additionalProperty(String key, Object value); + + _FinalStage additionalProperties(Map additionalProperties); + + /** + *

What the provider said, when it refused.

+ */ + _FinalStage code(OptionalNullable code); + + _FinalStage code(String code); + + _FinalStage code(Optional code); + + _FinalStage code(Nullable code); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements OauthAppIdStage, ProviderStage, OccurredAtStage, _FinalStage { + private String oauthAppId; + + private String provider; + + private String occurredAt; + + private OptionalNullable code = OptionalNullable.absent(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(SchedulingOauthAppWebhookEventData other) { + oauthAppId(other.getOauthAppId()); + provider(other.getProvider()); + code(other.getCode()); + occurredAt(other.getOccurredAt()); + return this; + } + + @java.lang.Override + @JsonSetter("oauth_app_id") + public ProviderStage oauthAppId(@NotNull String oauthAppId) { + this.oauthAppId = Objects.requireNonNull(oauthAppId, "oauthAppId must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("provider") + public OccurredAtStage provider(@NotNull String provider) { + this.provider = Objects.requireNonNull(provider, "provider must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("occurred_at") + public _FinalStage occurredAt(@NotNull String occurredAt) { + this.occurredAt = Objects.requireNonNull(occurredAt, "occurredAt must not be null"); + return this; + } + + /** + *

What the provider said, when it refused.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage code(Nullable code) { + if (code.isNull()) { + this.code = OptionalNullable.ofNull(); + } else if (code.isEmpty()) { + this.code = OptionalNullable.absent(); + } else { + this.code = OptionalNullable.of(code.get()); + } + return this; + } + + /** + *

What the provider said, when it refused.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage code(Optional code) { + if (code.isPresent()) { + this.code = OptionalNullable.of(code.get()); + } else { + this.code = OptionalNullable.absent(); + } + return this; + } + + /** + *

What the provider said, when it refused.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage code(String code) { + this.code = OptionalNullable.of(code); + return this; + } + + /** + *

What the provider said, when it refused.

+ */ + @java.lang.Override + @JsonSetter(value = "code", nulls = Nulls.SKIP) + public _FinalStage code(OptionalNullable code) { + this.code = code; + return this; + } + + @java.lang.Override + public SchedulingOauthAppWebhookEventData build() { + return new SchedulingOauthAppWebhookEventData(oauthAppId, provider, code, occurredAt, additionalProperties); + } + + @java.lang.Override + public Builder additionalProperty(String key, Object value) { + this.additionalProperties.put(key, value); + return this; + } + + @java.lang.Override + public Builder additionalProperties(Map additionalProperties) { + this.additionalProperties.putAll(additionalProperties); + return this; + } + } +} diff --git a/sdks/java/src/main/java/com/coss/types/SchedulingOauthAppWebhookEventObject.java b/sdks/java/src/main/java/com/coss/types/SchedulingOauthAppWebhookEventObject.java new file mode 100644 index 000000000..aa7244de9 --- /dev/null +++ b/sdks/java/src/main/java/com/coss/types/SchedulingOauthAppWebhookEventObject.java @@ -0,0 +1,75 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.coss.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class SchedulingOauthAppWebhookEventObject { + public static final SchedulingOauthAppWebhookEventObject EVENT = + new SchedulingOauthAppWebhookEventObject(Value.EVENT, "event"); + + private final Value value; + + private final String string; + + SchedulingOauthAppWebhookEventObject(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof SchedulingOauthAppWebhookEventObject + && this.string.equals(((SchedulingOauthAppWebhookEventObject) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case EVENT: + return visitor.visitEvent(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static SchedulingOauthAppWebhookEventObject valueOf(String value) { + switch (value) { + case "event": + return EVENT; + default: + return new SchedulingOauthAppWebhookEventObject(Value.UNKNOWN, value); + } + } + + public enum Value { + EVENT, + + UNKNOWN + } + + public interface Visitor { + T visitEvent(); + + T visitUnknown(String unknownType); + } +} diff --git a/sdks/java/src/main/java/com/coss/types/SchedulingOauthAppWebhookEventType.java b/sdks/java/src/main/java/com/coss/types/SchedulingOauthAppWebhookEventType.java new file mode 100644 index 000000000..aa0f28ca1 --- /dev/null +++ b/sdks/java/src/main/java/com/coss/types/SchedulingOauthAppWebhookEventType.java @@ -0,0 +1,87 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.coss.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class SchedulingOauthAppWebhookEventType { + public static final SchedulingOauthAppWebhookEventType SCHEDULING_OAUTH_APP_FAILING = + new SchedulingOauthAppWebhookEventType(Value.SCHEDULING_OAUTH_APP_FAILING, "scheduling.oauth_app.failing"); + + public static final SchedulingOauthAppWebhookEventType SCHEDULING_OAUTH_APP_RESTORED = + new SchedulingOauthAppWebhookEventType( + Value.SCHEDULING_OAUTH_APP_RESTORED, "scheduling.oauth_app.restored"); + + private final Value value; + + private final String string; + + SchedulingOauthAppWebhookEventType(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof SchedulingOauthAppWebhookEventType + && this.string.equals(((SchedulingOauthAppWebhookEventType) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case SCHEDULING_OAUTH_APP_FAILING: + return visitor.visitSchedulingOauthAppFailing(); + case SCHEDULING_OAUTH_APP_RESTORED: + return visitor.visitSchedulingOauthAppRestored(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static SchedulingOauthAppWebhookEventType valueOf(String value) { + switch (value) { + case "scheduling.oauth_app.failing": + return SCHEDULING_OAUTH_APP_FAILING; + case "scheduling.oauth_app.restored": + return SCHEDULING_OAUTH_APP_RESTORED; + default: + return new SchedulingOauthAppWebhookEventType(Value.UNKNOWN, value); + } + } + + public enum Value { + SCHEDULING_OAUTH_APP_FAILING, + + SCHEDULING_OAUTH_APP_RESTORED, + + UNKNOWN + } + + public interface Visitor { + T visitSchedulingOauthAppFailing(); + + T visitSchedulingOauthAppRestored(); + + T visitUnknown(String unknownType); + } +} diff --git a/sdks/java/src/main/java/com/coss/types/SchedulingOutOfOffice.java b/sdks/java/src/main/java/com/coss/types/SchedulingOutOfOffice.java new file mode 100644 index 000000000..79d6e160d --- /dev/null +++ b/sdks/java/src/main/java/com/coss/types/SchedulingOutOfOffice.java @@ -0,0 +1,846 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.coss.types; + +import com.coss.core.Nullable; +import com.coss.core.NullableNonemptyFilter; +import com.coss.core.ObjectMappers; +import com.coss.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = SchedulingOutOfOffice.Builder.class) +public final class SchedulingOutOfOffice { + private final SchedulingOutOfOfficeObject object; + + private final String id; + + private final String host; + + private final String start; + + private final String end; + + private final OptionalNullable allDay; + + private final String reason; + + private final OptionalNullable notes; + + private final OptionalNullable publicMessage; + + private final boolean showOnCalendar; + + private final List delegates; + + private final SchedulingOutOfOfficeExistingBookings existingBookings; + + private final OptionalNullable externalId; + + private final OptionalNullable group; + + private final SchedulingOutOfOfficeSource source; + + private final String createdAt; + + private final String updatedAt; + + private final Map additionalProperties; + + private SchedulingOutOfOffice( + SchedulingOutOfOfficeObject object, + String id, + String host, + String start, + String end, + OptionalNullable allDay, + String reason, + OptionalNullable notes, + OptionalNullable publicMessage, + boolean showOnCalendar, + List delegates, + SchedulingOutOfOfficeExistingBookings existingBookings, + OptionalNullable externalId, + OptionalNullable group, + SchedulingOutOfOfficeSource source, + String createdAt, + String updatedAt, + Map additionalProperties) { + this.object = object; + this.id = id; + this.host = host; + this.start = start; + this.end = end; + this.allDay = allDay; + this.reason = reason; + this.notes = notes; + this.publicMessage = publicMessage; + this.showOnCalendar = showOnCalendar; + this.delegates = delegates; + this.existingBookings = existingBookings; + this.externalId = externalId; + this.group = group; + this.source = source; + this.createdAt = createdAt; + this.updatedAt = updatedAt; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("object") + public SchedulingOutOfOfficeObject getObject() { + return object; + } + + @JsonProperty("id") + public String getId() { + return id; + } + + @JsonProperty("host") + public String getHost() { + return host; + } + + @JsonProperty("start") + public String getStart() { + return start; + } + + @JsonProperty("end") + public String getEnd() { + return end; + } + + /** + * @return How it was given, when it was as whole dates. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("all_day") + public OptionalNullable getAllDay() { + if (allDay == null) { + return OptionalNullable.absent(); + } + return allDay; + } + + @JsonProperty("reason") + public String getReason() { + return reason; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("notes") + public OptionalNullable getNotes() { + if (notes == null) { + return OptionalNullable.absent(); + } + return notes; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("public_message") + public OptionalNullable getPublicMessage() { + if (publicMessage == null) { + return OptionalNullable.absent(); + } + return publicMessage; + } + + @JsonProperty("show_on_calendar") + public boolean getShowOnCalendar() { + return showOnCalendar; + } + + /** + * @return Who can be booked in their place. + */ + @JsonProperty("delegates") + public List getDelegates() { + return delegates; + } + + @JsonProperty("existing_bookings") + public SchedulingOutOfOfficeExistingBookings getExistingBookings() { + return existingBookings; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("external_id") + public OptionalNullable getExternalId() { + if (externalId == null) { + return OptionalNullable.absent(); + } + return externalId; + } + + /** + * @return Shared by the entries one request made for several hosts. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("group") + public OptionalNullable getGroup() { + if (group == null) { + return OptionalNullable.absent(); + } + return group; + } + + @JsonProperty("source") + public SchedulingOutOfOfficeSource getSource() { + return source; + } + + @JsonProperty("created_at") + public String getCreatedAt() { + return createdAt; + } + + @JsonProperty("updated_at") + public String getUpdatedAt() { + return updatedAt; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("all_day") + private OptionalNullable _getAllDay() { + return allDay; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("notes") + private OptionalNullable _getNotes() { + return notes; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("public_message") + private OptionalNullable _getPublicMessage() { + return publicMessage; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("external_id") + private OptionalNullable _getExternalId() { + return externalId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("group") + private OptionalNullable _getGroup() { + return group; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof SchedulingOutOfOffice && equalTo((SchedulingOutOfOffice) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(SchedulingOutOfOffice other) { + return object.equals(other.object) + && id.equals(other.id) + && host.equals(other.host) + && start.equals(other.start) + && end.equals(other.end) + && allDay.equals(other.allDay) + && reason.equals(other.reason) + && notes.equals(other.notes) + && publicMessage.equals(other.publicMessage) + && showOnCalendar == other.showOnCalendar + && delegates.equals(other.delegates) + && existingBookings.equals(other.existingBookings) + && externalId.equals(other.externalId) + && group.equals(other.group) + && source.equals(other.source) + && createdAt.equals(other.createdAt) + && updatedAt.equals(other.updatedAt); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.object, + this.id, + this.host, + this.start, + this.end, + this.allDay, + this.reason, + this.notes, + this.publicMessage, + this.showOnCalendar, + this.delegates, + this.existingBookings, + this.externalId, + this.group, + this.source, + this.createdAt, + this.updatedAt); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ObjectStage builder() { + return new Builder(); + } + + public interface ObjectStage { + IdStage object(@NotNull SchedulingOutOfOfficeObject object); + + Builder from(SchedulingOutOfOffice other); + } + + public interface IdStage { + HostStage id(@NotNull String id); + } + + public interface HostStage { + StartStage host(@NotNull String host); + } + + public interface StartStage { + EndStage start(@NotNull String start); + } + + public interface EndStage { + ReasonStage end(@NotNull String end); + } + + public interface ReasonStage { + ShowOnCalendarStage reason(@NotNull String reason); + } + + public interface ShowOnCalendarStage { + ExistingBookingsStage showOnCalendar(boolean showOnCalendar); + } + + public interface ExistingBookingsStage { + SourceStage existingBookings(@NotNull SchedulingOutOfOfficeExistingBookings existingBookings); + } + + public interface SourceStage { + CreatedAtStage source(@NotNull SchedulingOutOfOfficeSource source); + } + + public interface CreatedAtStage { + UpdatedAtStage createdAt(@NotNull String createdAt); + } + + public interface UpdatedAtStage { + _FinalStage updatedAt(@NotNull String updatedAt); + } + + public interface _FinalStage { + SchedulingOutOfOffice build(); + + _FinalStage additionalProperty(String key, Object value); + + _FinalStage additionalProperties(Map additionalProperties); + + /** + *

How it was given, when it was as whole dates.

+ */ + _FinalStage allDay(OptionalNullable allDay); + + _FinalStage allDay(SchedulingOutOfOfficeAllDay allDay); + + _FinalStage allDay(Optional allDay); + + _FinalStage allDay(Nullable allDay); + + _FinalStage notes(OptionalNullable notes); + + _FinalStage notes(String notes); + + _FinalStage notes(Optional notes); + + _FinalStage notes(Nullable notes); + + _FinalStage publicMessage(OptionalNullable publicMessage); + + _FinalStage publicMessage(String publicMessage); + + _FinalStage publicMessage(Optional publicMessage); + + _FinalStage publicMessage(Nullable publicMessage); + + /** + *

Who can be booked in their place.

+ */ + _FinalStage delegates(List delegates); + + _FinalStage addDelegates(String delegates); + + _FinalStage addAllDelegates(List delegates); + + _FinalStage externalId(OptionalNullable externalId); + + _FinalStage externalId(String externalId); + + _FinalStage externalId(Optional externalId); + + _FinalStage externalId(Nullable externalId); + + /** + *

Shared by the entries one request made for several hosts.

+ */ + _FinalStage group(OptionalNullable group); + + _FinalStage group(String group); + + _FinalStage group(Optional group); + + _FinalStage group(Nullable group); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder + implements ObjectStage, + IdStage, + HostStage, + StartStage, + EndStage, + ReasonStage, + ShowOnCalendarStage, + ExistingBookingsStage, + SourceStage, + CreatedAtStage, + UpdatedAtStage, + _FinalStage { + private SchedulingOutOfOfficeObject object; + + private String id; + + private String host; + + private String start; + + private String end; + + private String reason; + + private boolean showOnCalendar; + + private SchedulingOutOfOfficeExistingBookings existingBookings; + + private SchedulingOutOfOfficeSource source; + + private String createdAt; + + private String updatedAt; + + private OptionalNullable group = OptionalNullable.absent(); + + private OptionalNullable externalId = OptionalNullable.absent(); + + private List delegates = new ArrayList<>(); + + private OptionalNullable publicMessage = OptionalNullable.absent(); + + private OptionalNullable notes = OptionalNullable.absent(); + + private OptionalNullable allDay = OptionalNullable.absent(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(SchedulingOutOfOffice other) { + object(other.getObject()); + id(other.getId()); + host(other.getHost()); + start(other.getStart()); + end(other.getEnd()); + allDay(other.getAllDay()); + reason(other.getReason()); + notes(other.getNotes()); + publicMessage(other.getPublicMessage()); + showOnCalendar(other.getShowOnCalendar()); + delegates(other.getDelegates()); + existingBookings(other.getExistingBookings()); + externalId(other.getExternalId()); + group(other.getGroup()); + source(other.getSource()); + createdAt(other.getCreatedAt()); + updatedAt(other.getUpdatedAt()); + return this; + } + + @java.lang.Override + @JsonSetter("object") + public IdStage object(@NotNull SchedulingOutOfOfficeObject object) { + this.object = Objects.requireNonNull(object, "object must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("id") + public HostStage id(@NotNull String id) { + this.id = Objects.requireNonNull(id, "id must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("host") + public StartStage host(@NotNull String host) { + this.host = Objects.requireNonNull(host, "host must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("start") + public EndStage start(@NotNull String start) { + this.start = Objects.requireNonNull(start, "start must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("end") + public ReasonStage end(@NotNull String end) { + this.end = Objects.requireNonNull(end, "end must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("reason") + public ShowOnCalendarStage reason(@NotNull String reason) { + this.reason = Objects.requireNonNull(reason, "reason must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("show_on_calendar") + public ExistingBookingsStage showOnCalendar(boolean showOnCalendar) { + this.showOnCalendar = showOnCalendar; + return this; + } + + @java.lang.Override + @JsonSetter("existing_bookings") + public SourceStage existingBookings(@NotNull SchedulingOutOfOfficeExistingBookings existingBookings) { + this.existingBookings = Objects.requireNonNull(existingBookings, "existingBookings must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("source") + public CreatedAtStage source(@NotNull SchedulingOutOfOfficeSource source) { + this.source = Objects.requireNonNull(source, "source must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("created_at") + public UpdatedAtStage createdAt(@NotNull String createdAt) { + this.createdAt = Objects.requireNonNull(createdAt, "createdAt must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("updated_at") + public _FinalStage updatedAt(@NotNull String updatedAt) { + this.updatedAt = Objects.requireNonNull(updatedAt, "updatedAt must not be null"); + return this; + } + + /** + *

Shared by the entries one request made for several hosts.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage group(Nullable group) { + if (group.isNull()) { + this.group = OptionalNullable.ofNull(); + } else if (group.isEmpty()) { + this.group = OptionalNullable.absent(); + } else { + this.group = OptionalNullable.of(group.get()); + } + return this; + } + + /** + *

Shared by the entries one request made for several hosts.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage group(Optional group) { + if (group.isPresent()) { + this.group = OptionalNullable.of(group.get()); + } else { + this.group = OptionalNullable.absent(); + } + return this; + } + + /** + *

Shared by the entries one request made for several hosts.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage group(String group) { + this.group = OptionalNullable.of(group); + return this; + } + + /** + *

Shared by the entries one request made for several hosts.

+ */ + @java.lang.Override + @JsonSetter(value = "group", nulls = Nulls.SKIP) + public _FinalStage group(OptionalNullable group) { + this.group = group; + return this; + } + + @java.lang.Override + public _FinalStage externalId(Nullable externalId) { + if (externalId.isNull()) { + this.externalId = OptionalNullable.ofNull(); + } else if (externalId.isEmpty()) { + this.externalId = OptionalNullable.absent(); + } else { + this.externalId = OptionalNullable.of(externalId.get()); + } + return this; + } + + @java.lang.Override + public _FinalStage externalId(Optional externalId) { + if (externalId.isPresent()) { + this.externalId = OptionalNullable.of(externalId.get()); + } else { + this.externalId = OptionalNullable.absent(); + } + return this; + } + + @java.lang.Override + public _FinalStage externalId(String externalId) { + this.externalId = OptionalNullable.of(externalId); + return this; + } + + @java.lang.Override + @JsonSetter(value = "external_id", nulls = Nulls.SKIP) + public _FinalStage externalId(OptionalNullable externalId) { + this.externalId = externalId; + return this; + } + + /** + *

Who can be booked in their place.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage addAllDelegates(List delegates) { + if (delegates != null) { + this.delegates.addAll(delegates); + } + return this; + } + + /** + *

Who can be booked in their place.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage addDelegates(String delegates) { + this.delegates.add(delegates); + return this; + } + + /** + *

Who can be booked in their place.

+ */ + @java.lang.Override + @JsonSetter(value = "delegates", nulls = Nulls.SKIP) + public _FinalStage delegates(List delegates) { + this.delegates.clear(); + if (delegates != null) { + this.delegates.addAll(delegates); + } + return this; + } + + @java.lang.Override + public _FinalStage publicMessage(Nullable publicMessage) { + if (publicMessage.isNull()) { + this.publicMessage = OptionalNullable.ofNull(); + } else if (publicMessage.isEmpty()) { + this.publicMessage = OptionalNullable.absent(); + } else { + this.publicMessage = OptionalNullable.of(publicMessage.get()); + } + return this; + } + + @java.lang.Override + public _FinalStage publicMessage(Optional publicMessage) { + if (publicMessage.isPresent()) { + this.publicMessage = OptionalNullable.of(publicMessage.get()); + } else { + this.publicMessage = OptionalNullable.absent(); + } + return this; + } + + @java.lang.Override + public _FinalStage publicMessage(String publicMessage) { + this.publicMessage = OptionalNullable.of(publicMessage); + return this; + } + + @java.lang.Override + @JsonSetter(value = "public_message", nulls = Nulls.SKIP) + public _FinalStage publicMessage(OptionalNullable publicMessage) { + this.publicMessage = publicMessage; + return this; + } + + @java.lang.Override + public _FinalStage notes(Nullable notes) { + if (notes.isNull()) { + this.notes = OptionalNullable.ofNull(); + } else if (notes.isEmpty()) { + this.notes = OptionalNullable.absent(); + } else { + this.notes = OptionalNullable.of(notes.get()); + } + return this; + } + + @java.lang.Override + public _FinalStage notes(Optional notes) { + if (notes.isPresent()) { + this.notes = OptionalNullable.of(notes.get()); + } else { + this.notes = OptionalNullable.absent(); + } + return this; + } + + @java.lang.Override + public _FinalStage notes(String notes) { + this.notes = OptionalNullable.of(notes); + return this; + } + + @java.lang.Override + @JsonSetter(value = "notes", nulls = Nulls.SKIP) + public _FinalStage notes(OptionalNullable notes) { + this.notes = notes; + return this; + } + + /** + *

How it was given, when it was as whole dates.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage allDay(Nullable allDay) { + if (allDay.isNull()) { + this.allDay = OptionalNullable.ofNull(); + } else if (allDay.isEmpty()) { + this.allDay = OptionalNullable.absent(); + } else { + this.allDay = OptionalNullable.of(allDay.get()); + } + return this; + } + + /** + *

How it was given, when it was as whole dates.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage allDay(Optional allDay) { + if (allDay.isPresent()) { + this.allDay = OptionalNullable.of(allDay.get()); + } else { + this.allDay = OptionalNullable.absent(); + } + return this; + } + + /** + *

How it was given, when it was as whole dates.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage allDay(SchedulingOutOfOfficeAllDay allDay) { + this.allDay = OptionalNullable.of(allDay); + return this; + } + + /** + *

How it was given, when it was as whole dates.

+ */ + @java.lang.Override + @JsonSetter(value = "all_day", nulls = Nulls.SKIP) + public _FinalStage allDay(OptionalNullable allDay) { + this.allDay = allDay; + return this; + } + + @java.lang.Override + public SchedulingOutOfOffice build() { + return new SchedulingOutOfOffice( + object, + id, + host, + start, + end, + allDay, + reason, + notes, + publicMessage, + showOnCalendar, + delegates, + existingBookings, + externalId, + group, + source, + createdAt, + updatedAt, + additionalProperties); + } + + @java.lang.Override + public Builder additionalProperty(String key, Object value) { + this.additionalProperties.put(key, value); + return this; + } + + @java.lang.Override + public Builder additionalProperties(Map additionalProperties) { + this.additionalProperties.putAll(additionalProperties); + return this; + } + } +} diff --git a/sdks/java/src/main/java/com/coss/types/SchedulingOutOfOfficeAllDay.java b/sdks/java/src/main/java/com/coss/types/SchedulingOutOfOfficeAllDay.java new file mode 100644 index 000000000..e2a513920 --- /dev/null +++ b/sdks/java/src/main/java/com/coss/types/SchedulingOutOfOfficeAllDay.java @@ -0,0 +1,163 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.coss.types; + +import com.coss.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = SchedulingOutOfOfficeAllDay.Builder.class) +public final class SchedulingOutOfOfficeAllDay { + private final String startDate; + + private final String endDate; + + private final String timeZone; + + private final Map additionalProperties; + + private SchedulingOutOfOfficeAllDay( + String startDate, String endDate, String timeZone, Map additionalProperties) { + this.startDate = startDate; + this.endDate = endDate; + this.timeZone = timeZone; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("start_date") + public String getStartDate() { + return startDate; + } + + @JsonProperty("end_date") + public String getEndDate() { + return endDate; + } + + @JsonProperty("time_zone") + public String getTimeZone() { + return timeZone; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof SchedulingOutOfOfficeAllDay && equalTo((SchedulingOutOfOfficeAllDay) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(SchedulingOutOfOfficeAllDay other) { + return startDate.equals(other.startDate) && endDate.equals(other.endDate) && timeZone.equals(other.timeZone); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.startDate, this.endDate, this.timeZone); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static StartDateStage builder() { + return new Builder(); + } + + public interface StartDateStage { + EndDateStage startDate(@NotNull String startDate); + + Builder from(SchedulingOutOfOfficeAllDay other); + } + + public interface EndDateStage { + TimeZoneStage endDate(@NotNull String endDate); + } + + public interface TimeZoneStage { + _FinalStage timeZone(@NotNull String timeZone); + } + + public interface _FinalStage { + SchedulingOutOfOfficeAllDay build(); + + _FinalStage additionalProperty(String key, Object value); + + _FinalStage additionalProperties(Map additionalProperties); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements StartDateStage, EndDateStage, TimeZoneStage, _FinalStage { + private String startDate; + + private String endDate; + + private String timeZone; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(SchedulingOutOfOfficeAllDay other) { + startDate(other.getStartDate()); + endDate(other.getEndDate()); + timeZone(other.getTimeZone()); + return this; + } + + @java.lang.Override + @JsonSetter("start_date") + public EndDateStage startDate(@NotNull String startDate) { + this.startDate = Objects.requireNonNull(startDate, "startDate must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("end_date") + public TimeZoneStage endDate(@NotNull String endDate) { + this.endDate = Objects.requireNonNull(endDate, "endDate must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("time_zone") + public _FinalStage timeZone(@NotNull String timeZone) { + this.timeZone = Objects.requireNonNull(timeZone, "timeZone must not be null"); + return this; + } + + @java.lang.Override + public SchedulingOutOfOfficeAllDay build() { + return new SchedulingOutOfOfficeAllDay(startDate, endDate, timeZone, additionalProperties); + } + + @java.lang.Override + public Builder additionalProperty(String key, Object value) { + this.additionalProperties.put(key, value); + return this; + } + + @java.lang.Override + public Builder additionalProperties(Map additionalProperties) { + this.additionalProperties.putAll(additionalProperties); + return this; + } + } +} diff --git a/sdks/java/src/main/java/com/coss/types/SchedulingOutOfOfficeConflict.java b/sdks/java/src/main/java/com/coss/types/SchedulingOutOfOfficeConflict.java new file mode 100644 index 000000000..65023c271 --- /dev/null +++ b/sdks/java/src/main/java/com/coss/types/SchedulingOutOfOfficeConflict.java @@ -0,0 +1,419 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.coss.types; + +import com.coss.core.Nullable; +import com.coss.core.NullableNonemptyFilter; +import com.coss.core.ObjectMappers; +import com.coss.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = SchedulingOutOfOfficeConflict.Builder.class) +public final class SchedulingOutOfOfficeConflict { + private final SchedulingOutOfOfficeConflictObject object; + + private final String booking; + + private final String eventType; + + private final String title; + + private final SchedulingOutOfOfficeConflictStatus status; + + private final String start; + + private final String end; + + private final OptionalNullable series; + + private final OptionalNullable groupSession; + + private final Map additionalProperties; + + private SchedulingOutOfOfficeConflict( + SchedulingOutOfOfficeConflictObject object, + String booking, + String eventType, + String title, + SchedulingOutOfOfficeConflictStatus status, + String start, + String end, + OptionalNullable series, + OptionalNullable groupSession, + Map additionalProperties) { + this.object = object; + this.booking = booking; + this.eventType = eventType; + this.title = title; + this.status = status; + this.start = start; + this.end = end; + this.series = series; + this.groupSession = groupSession; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("object") + public SchedulingOutOfOfficeConflictObject getObject() { + return object; + } + + @JsonProperty("booking") + public String getBooking() { + return booking; + } + + @JsonProperty("event_type") + public String getEventType() { + return eventType; + } + + @JsonProperty("title") + public String getTitle() { + return title; + } + + @JsonProperty("status") + public SchedulingOutOfOfficeConflictStatus getStatus() { + return status; + } + + @JsonProperty("start") + public String getStart() { + return start; + } + + @JsonProperty("end") + public String getEnd() { + return end; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("series") + public OptionalNullable getSeries() { + if (series == null) { + return OptionalNullable.absent(); + } + return series; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("group_session") + public OptionalNullable getGroupSession() { + if (groupSession == null) { + return OptionalNullable.absent(); + } + return groupSession; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("series") + private OptionalNullable _getSeries() { + return series; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("group_session") + private OptionalNullable _getGroupSession() { + return groupSession; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof SchedulingOutOfOfficeConflict && equalTo((SchedulingOutOfOfficeConflict) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(SchedulingOutOfOfficeConflict other) { + return object.equals(other.object) + && booking.equals(other.booking) + && eventType.equals(other.eventType) + && title.equals(other.title) + && status.equals(other.status) + && start.equals(other.start) + && end.equals(other.end) + && series.equals(other.series) + && groupSession.equals(other.groupSession); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.object, + this.booking, + this.eventType, + this.title, + this.status, + this.start, + this.end, + this.series, + this.groupSession); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ObjectStage builder() { + return new Builder(); + } + + public interface ObjectStage { + BookingStage object(@NotNull SchedulingOutOfOfficeConflictObject object); + + Builder from(SchedulingOutOfOfficeConflict other); + } + + public interface BookingStage { + EventTypeStage booking(@NotNull String booking); + } + + public interface EventTypeStage { + TitleStage eventType(@NotNull String eventType); + } + + public interface TitleStage { + StatusStage title(@NotNull String title); + } + + public interface StatusStage { + StartStage status(@NotNull SchedulingOutOfOfficeConflictStatus status); + } + + public interface StartStage { + EndStage start(@NotNull String start); + } + + public interface EndStage { + _FinalStage end(@NotNull String end); + } + + public interface _FinalStage { + SchedulingOutOfOfficeConflict build(); + + _FinalStage additionalProperty(String key, Object value); + + _FinalStage additionalProperties(Map additionalProperties); + + _FinalStage series(OptionalNullable series); + + _FinalStage series(String series); + + _FinalStage series(Optional series); + + _FinalStage series(Nullable series); + + _FinalStage groupSession(OptionalNullable groupSession); + + _FinalStage groupSession(String groupSession); + + _FinalStage groupSession(Optional groupSession); + + _FinalStage groupSession(Nullable groupSession); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder + implements ObjectStage, + BookingStage, + EventTypeStage, + TitleStage, + StatusStage, + StartStage, + EndStage, + _FinalStage { + private SchedulingOutOfOfficeConflictObject object; + + private String booking; + + private String eventType; + + private String title; + + private SchedulingOutOfOfficeConflictStatus status; + + private String start; + + private String end; + + private OptionalNullable groupSession = OptionalNullable.absent(); + + private OptionalNullable series = OptionalNullable.absent(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(SchedulingOutOfOfficeConflict other) { + object(other.getObject()); + booking(other.getBooking()); + eventType(other.getEventType()); + title(other.getTitle()); + status(other.getStatus()); + start(other.getStart()); + end(other.getEnd()); + series(other.getSeries()); + groupSession(other.getGroupSession()); + return this; + } + + @java.lang.Override + @JsonSetter("object") + public BookingStage object(@NotNull SchedulingOutOfOfficeConflictObject object) { + this.object = Objects.requireNonNull(object, "object must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("booking") + public EventTypeStage booking(@NotNull String booking) { + this.booking = Objects.requireNonNull(booking, "booking must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("event_type") + public TitleStage eventType(@NotNull String eventType) { + this.eventType = Objects.requireNonNull(eventType, "eventType must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("title") + public StatusStage title(@NotNull String title) { + this.title = Objects.requireNonNull(title, "title must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("status") + public StartStage status(@NotNull SchedulingOutOfOfficeConflictStatus status) { + this.status = Objects.requireNonNull(status, "status must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("start") + public EndStage start(@NotNull String start) { + this.start = Objects.requireNonNull(start, "start must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("end") + public _FinalStage end(@NotNull String end) { + this.end = Objects.requireNonNull(end, "end must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage groupSession(Nullable groupSession) { + if (groupSession.isNull()) { + this.groupSession = OptionalNullable.ofNull(); + } else if (groupSession.isEmpty()) { + this.groupSession = OptionalNullable.absent(); + } else { + this.groupSession = OptionalNullable.of(groupSession.get()); + } + return this; + } + + @java.lang.Override + public _FinalStage groupSession(Optional groupSession) { + if (groupSession.isPresent()) { + this.groupSession = OptionalNullable.of(groupSession.get()); + } else { + this.groupSession = OptionalNullable.absent(); + } + return this; + } + + @java.lang.Override + public _FinalStage groupSession(String groupSession) { + this.groupSession = OptionalNullable.of(groupSession); + return this; + } + + @java.lang.Override + @JsonSetter(value = "group_session", nulls = Nulls.SKIP) + public _FinalStage groupSession(OptionalNullable groupSession) { + this.groupSession = groupSession; + return this; + } + + @java.lang.Override + public _FinalStage series(Nullable series) { + if (series.isNull()) { + this.series = OptionalNullable.ofNull(); + } else if (series.isEmpty()) { + this.series = OptionalNullable.absent(); + } else { + this.series = OptionalNullable.of(series.get()); + } + return this; + } + + @java.lang.Override + public _FinalStage series(Optional series) { + if (series.isPresent()) { + this.series = OptionalNullable.of(series.get()); + } else { + this.series = OptionalNullable.absent(); + } + return this; + } + + @java.lang.Override + public _FinalStage series(String series) { + this.series = OptionalNullable.of(series); + return this; + } + + @java.lang.Override + @JsonSetter(value = "series", nulls = Nulls.SKIP) + public _FinalStage series(OptionalNullable series) { + this.series = series; + return this; + } + + @java.lang.Override + public SchedulingOutOfOfficeConflict build() { + return new SchedulingOutOfOfficeConflict( + object, booking, eventType, title, status, start, end, series, groupSession, additionalProperties); + } + + @java.lang.Override + public Builder additionalProperty(String key, Object value) { + this.additionalProperties.put(key, value); + return this; + } + + @java.lang.Override + public Builder additionalProperties(Map additionalProperties) { + this.additionalProperties.putAll(additionalProperties); + return this; + } + } +} diff --git a/sdks/java/src/main/java/com/coss/types/SchedulingOutOfOfficeConflictList.java b/sdks/java/src/main/java/com/coss/types/SchedulingOutOfOfficeConflictList.java new file mode 100644 index 000000000..1b1282bb6 --- /dev/null +++ b/sdks/java/src/main/java/com/coss/types/SchedulingOutOfOfficeConflictList.java @@ -0,0 +1,188 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.coss.types; + +import com.coss.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = SchedulingOutOfOfficeConflictList.Builder.class) +public final class SchedulingOutOfOfficeConflictList { + private final SchedulingOutOfOfficeConflictListObject object; + + private final List data; + + private final boolean hasMore; + + private final Map additionalProperties; + + private SchedulingOutOfOfficeConflictList( + SchedulingOutOfOfficeConflictListObject object, + List data, + boolean hasMore, + Map additionalProperties) { + this.object = object; + this.data = data; + this.hasMore = hasMore; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("object") + public SchedulingOutOfOfficeConflictListObject getObject() { + return object; + } + + @JsonProperty("data") + public List getData() { + return data; + } + + @JsonProperty("has_more") + public boolean getHasMore() { + return hasMore; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof SchedulingOutOfOfficeConflictList && equalTo((SchedulingOutOfOfficeConflictList) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(SchedulingOutOfOfficeConflictList other) { + return object.equals(other.object) && data.equals(other.data) && hasMore == other.hasMore; + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.object, this.data, this.hasMore); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ObjectStage builder() { + return new Builder(); + } + + public interface ObjectStage { + HasMoreStage object(@NotNull SchedulingOutOfOfficeConflictListObject object); + + Builder from(SchedulingOutOfOfficeConflictList other); + } + + public interface HasMoreStage { + _FinalStage hasMore(boolean hasMore); + } + + public interface _FinalStage { + SchedulingOutOfOfficeConflictList build(); + + _FinalStage additionalProperty(String key, Object value); + + _FinalStage additionalProperties(Map additionalProperties); + + _FinalStage data(List data); + + _FinalStage addData(SchedulingOutOfOfficeConflict data); + + _FinalStage addAllData(List data); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ObjectStage, HasMoreStage, _FinalStage { + private SchedulingOutOfOfficeConflictListObject object; + + private boolean hasMore; + + private List data = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(SchedulingOutOfOfficeConflictList other) { + object(other.getObject()); + data(other.getData()); + hasMore(other.getHasMore()); + return this; + } + + @java.lang.Override + @JsonSetter("object") + public HasMoreStage object(@NotNull SchedulingOutOfOfficeConflictListObject object) { + this.object = Objects.requireNonNull(object, "object must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("has_more") + public _FinalStage hasMore(boolean hasMore) { + this.hasMore = hasMore; + return this; + } + + @java.lang.Override + public _FinalStage addAllData(List data) { + if (data != null) { + this.data.addAll(data); + } + return this; + } + + @java.lang.Override + public _FinalStage addData(SchedulingOutOfOfficeConflict data) { + this.data.add(data); + return this; + } + + @java.lang.Override + @JsonSetter(value = "data", nulls = Nulls.SKIP) + public _FinalStage data(List data) { + this.data.clear(); + if (data != null) { + this.data.addAll(data); + } + return this; + } + + @java.lang.Override + public SchedulingOutOfOfficeConflictList build() { + return new SchedulingOutOfOfficeConflictList(object, data, hasMore, additionalProperties); + } + + @java.lang.Override + public Builder additionalProperty(String key, Object value) { + this.additionalProperties.put(key, value); + return this; + } + + @java.lang.Override + public Builder additionalProperties(Map additionalProperties) { + this.additionalProperties.putAll(additionalProperties); + return this; + } + } +} diff --git a/sdks/java/src/main/java/com/coss/types/SchedulingOutOfOfficeConflictListObject.java b/sdks/java/src/main/java/com/coss/types/SchedulingOutOfOfficeConflictListObject.java new file mode 100644 index 000000000..b196e7166 --- /dev/null +++ b/sdks/java/src/main/java/com/coss/types/SchedulingOutOfOfficeConflictListObject.java @@ -0,0 +1,75 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.coss.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class SchedulingOutOfOfficeConflictListObject { + public static final SchedulingOutOfOfficeConflictListObject LIST = + new SchedulingOutOfOfficeConflictListObject(Value.LIST, "list"); + + private final Value value; + + private final String string; + + SchedulingOutOfOfficeConflictListObject(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof SchedulingOutOfOfficeConflictListObject + && this.string.equals(((SchedulingOutOfOfficeConflictListObject) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case LIST: + return visitor.visitList(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static SchedulingOutOfOfficeConflictListObject valueOf(String value) { + switch (value) { + case "list": + return LIST; + default: + return new SchedulingOutOfOfficeConflictListObject(Value.UNKNOWN, value); + } + } + + public enum Value { + LIST, + + UNKNOWN + } + + public interface Visitor { + T visitList(); + + T visitUnknown(String unknownType); + } +} diff --git a/sdks/java/src/main/java/com/coss/types/SchedulingOutOfOfficeConflictObject.java b/sdks/java/src/main/java/com/coss/types/SchedulingOutOfOfficeConflictObject.java new file mode 100644 index 000000000..8d85bc482 --- /dev/null +++ b/sdks/java/src/main/java/com/coss/types/SchedulingOutOfOfficeConflictObject.java @@ -0,0 +1,76 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.coss.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class SchedulingOutOfOfficeConflictObject { + public static final SchedulingOutOfOfficeConflictObject SCHEDULING_OUT_OF_OFFICE_CONFLICT = + new SchedulingOutOfOfficeConflictObject( + Value.SCHEDULING_OUT_OF_OFFICE_CONFLICT, "scheduling.out_of_office_conflict"); + + private final Value value; + + private final String string; + + SchedulingOutOfOfficeConflictObject(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof SchedulingOutOfOfficeConflictObject + && this.string.equals(((SchedulingOutOfOfficeConflictObject) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case SCHEDULING_OUT_OF_OFFICE_CONFLICT: + return visitor.visitSchedulingOutOfOfficeConflict(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static SchedulingOutOfOfficeConflictObject valueOf(String value) { + switch (value) { + case "scheduling.out_of_office_conflict": + return SCHEDULING_OUT_OF_OFFICE_CONFLICT; + default: + return new SchedulingOutOfOfficeConflictObject(Value.UNKNOWN, value); + } + } + + public enum Value { + SCHEDULING_OUT_OF_OFFICE_CONFLICT, + + UNKNOWN + } + + public interface Visitor { + T visitSchedulingOutOfOfficeConflict(); + + T visitUnknown(String unknownType); + } +} diff --git a/sdks/java/src/main/java/com/coss/types/SchedulingOutOfOfficeConflictStatus.java b/sdks/java/src/main/java/com/coss/types/SchedulingOutOfOfficeConflictStatus.java new file mode 100644 index 000000000..ae8703ca5 --- /dev/null +++ b/sdks/java/src/main/java/com/coss/types/SchedulingOutOfOfficeConflictStatus.java @@ -0,0 +1,119 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.coss.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class SchedulingOutOfOfficeConflictStatus { + public static final SchedulingOutOfOfficeConflictStatus HELD = + new SchedulingOutOfOfficeConflictStatus(Value.HELD, "held"); + + public static final SchedulingOutOfOfficeConflictStatus DECLINED = + new SchedulingOutOfOfficeConflictStatus(Value.DECLINED, "declined"); + + public static final SchedulingOutOfOfficeConflictStatus CONFIRMED = + new SchedulingOutOfOfficeConflictStatus(Value.CONFIRMED, "confirmed"); + + public static final SchedulingOutOfOfficeConflictStatus CANCELLED = + new SchedulingOutOfOfficeConflictStatus(Value.CANCELLED, "cancelled"); + + public static final SchedulingOutOfOfficeConflictStatus PENDING_APPROVAL = + new SchedulingOutOfOfficeConflictStatus(Value.PENDING_APPROVAL, "pending_approval"); + + private final Value value; + + private final String string; + + SchedulingOutOfOfficeConflictStatus(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof SchedulingOutOfOfficeConflictStatus + && this.string.equals(((SchedulingOutOfOfficeConflictStatus) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case HELD: + return visitor.visitHeld(); + case DECLINED: + return visitor.visitDeclined(); + case CONFIRMED: + return visitor.visitConfirmed(); + case CANCELLED: + return visitor.visitCancelled(); + case PENDING_APPROVAL: + return visitor.visitPendingApproval(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static SchedulingOutOfOfficeConflictStatus valueOf(String value) { + switch (value) { + case "held": + return HELD; + case "declined": + return DECLINED; + case "confirmed": + return CONFIRMED; + case "cancelled": + return CANCELLED; + case "pending_approval": + return PENDING_APPROVAL; + default: + return new SchedulingOutOfOfficeConflictStatus(Value.UNKNOWN, value); + } + } + + public enum Value { + HELD, + + PENDING_APPROVAL, + + CONFIRMED, + + CANCELLED, + + DECLINED, + + UNKNOWN + } + + public interface Visitor { + T visitHeld(); + + T visitPendingApproval(); + + T visitConfirmed(); + + T visitCancelled(); + + T visitDeclined(); + + T visitUnknown(String unknownType); + } +} diff --git a/sdks/java/src/main/java/com/coss/types/SchedulingOutOfOfficeExistingBookings.java b/sdks/java/src/main/java/com/coss/types/SchedulingOutOfOfficeExistingBookings.java new file mode 100644 index 000000000..08724bf5a --- /dev/null +++ b/sdks/java/src/main/java/com/coss/types/SchedulingOutOfOfficeExistingBookings.java @@ -0,0 +1,86 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.coss.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class SchedulingOutOfOfficeExistingBookings { + public static final SchedulingOutOfOfficeExistingBookings REASSIGN = + new SchedulingOutOfOfficeExistingBookings(Value.REASSIGN, "reassign"); + + public static final SchedulingOutOfOfficeExistingBookings LEAVE = + new SchedulingOutOfOfficeExistingBookings(Value.LEAVE, "leave"); + + private final Value value; + + private final String string; + + SchedulingOutOfOfficeExistingBookings(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof SchedulingOutOfOfficeExistingBookings + && this.string.equals(((SchedulingOutOfOfficeExistingBookings) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case REASSIGN: + return visitor.visitReassign(); + case LEAVE: + return visitor.visitLeave(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static SchedulingOutOfOfficeExistingBookings valueOf(String value) { + switch (value) { + case "reassign": + return REASSIGN; + case "leave": + return LEAVE; + default: + return new SchedulingOutOfOfficeExistingBookings(Value.UNKNOWN, value); + } + } + + public enum Value { + LEAVE, + + REASSIGN, + + UNKNOWN + } + + public interface Visitor { + T visitLeave(); + + T visitReassign(); + + T visitUnknown(String unknownType); + } +} diff --git a/sdks/java/src/main/java/com/coss/types/SchedulingOutOfOfficeList.java b/sdks/java/src/main/java/com/coss/types/SchedulingOutOfOfficeList.java new file mode 100644 index 000000000..6a5b4ab82 --- /dev/null +++ b/sdks/java/src/main/java/com/coss/types/SchedulingOutOfOfficeList.java @@ -0,0 +1,188 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.coss.types; + +import com.coss.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = SchedulingOutOfOfficeList.Builder.class) +public final class SchedulingOutOfOfficeList { + private final SchedulingOutOfOfficeListObject object; + + private final List data; + + private final boolean hasMore; + + private final Map additionalProperties; + + private SchedulingOutOfOfficeList( + SchedulingOutOfOfficeListObject object, + List data, + boolean hasMore, + Map additionalProperties) { + this.object = object; + this.data = data; + this.hasMore = hasMore; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("object") + public SchedulingOutOfOfficeListObject getObject() { + return object; + } + + @JsonProperty("data") + public List getData() { + return data; + } + + @JsonProperty("has_more") + public boolean getHasMore() { + return hasMore; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof SchedulingOutOfOfficeList && equalTo((SchedulingOutOfOfficeList) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(SchedulingOutOfOfficeList other) { + return object.equals(other.object) && data.equals(other.data) && hasMore == other.hasMore; + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.object, this.data, this.hasMore); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ObjectStage builder() { + return new Builder(); + } + + public interface ObjectStage { + HasMoreStage object(@NotNull SchedulingOutOfOfficeListObject object); + + Builder from(SchedulingOutOfOfficeList other); + } + + public interface HasMoreStage { + _FinalStage hasMore(boolean hasMore); + } + + public interface _FinalStage { + SchedulingOutOfOfficeList build(); + + _FinalStage additionalProperty(String key, Object value); + + _FinalStage additionalProperties(Map additionalProperties); + + _FinalStage data(List data); + + _FinalStage addData(SchedulingOutOfOffice data); + + _FinalStage addAllData(List data); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ObjectStage, HasMoreStage, _FinalStage { + private SchedulingOutOfOfficeListObject object; + + private boolean hasMore; + + private List data = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(SchedulingOutOfOfficeList other) { + object(other.getObject()); + data(other.getData()); + hasMore(other.getHasMore()); + return this; + } + + @java.lang.Override + @JsonSetter("object") + public HasMoreStage object(@NotNull SchedulingOutOfOfficeListObject object) { + this.object = Objects.requireNonNull(object, "object must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("has_more") + public _FinalStage hasMore(boolean hasMore) { + this.hasMore = hasMore; + return this; + } + + @java.lang.Override + public _FinalStage addAllData(List data) { + if (data != null) { + this.data.addAll(data); + } + return this; + } + + @java.lang.Override + public _FinalStage addData(SchedulingOutOfOffice data) { + this.data.add(data); + return this; + } + + @java.lang.Override + @JsonSetter(value = "data", nulls = Nulls.SKIP) + public _FinalStage data(List data) { + this.data.clear(); + if (data != null) { + this.data.addAll(data); + } + return this; + } + + @java.lang.Override + public SchedulingOutOfOfficeList build() { + return new SchedulingOutOfOfficeList(object, data, hasMore, additionalProperties); + } + + @java.lang.Override + public Builder additionalProperty(String key, Object value) { + this.additionalProperties.put(key, value); + return this; + } + + @java.lang.Override + public Builder additionalProperties(Map additionalProperties) { + this.additionalProperties.putAll(additionalProperties); + return this; + } + } +} diff --git a/sdks/java/src/main/java/com/coss/types/SchedulingOutOfOfficeListObject.java b/sdks/java/src/main/java/com/coss/types/SchedulingOutOfOfficeListObject.java new file mode 100644 index 000000000..d8d3b09d5 --- /dev/null +++ b/sdks/java/src/main/java/com/coss/types/SchedulingOutOfOfficeListObject.java @@ -0,0 +1,74 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.coss.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class SchedulingOutOfOfficeListObject { + public static final SchedulingOutOfOfficeListObject LIST = new SchedulingOutOfOfficeListObject(Value.LIST, "list"); + + private final Value value; + + private final String string; + + SchedulingOutOfOfficeListObject(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof SchedulingOutOfOfficeListObject + && this.string.equals(((SchedulingOutOfOfficeListObject) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case LIST: + return visitor.visitList(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static SchedulingOutOfOfficeListObject valueOf(String value) { + switch (value) { + case "list": + return LIST; + default: + return new SchedulingOutOfOfficeListObject(Value.UNKNOWN, value); + } + } + + public enum Value { + LIST, + + UNKNOWN + } + + public interface Visitor { + T visitList(); + + T visitUnknown(String unknownType); + } +} diff --git a/sdks/java/src/main/java/com/coss/types/SchedulingOutOfOfficeObject.java b/sdks/java/src/main/java/com/coss/types/SchedulingOutOfOfficeObject.java new file mode 100644 index 000000000..91676ad7b --- /dev/null +++ b/sdks/java/src/main/java/com/coss/types/SchedulingOutOfOfficeObject.java @@ -0,0 +1,75 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.coss.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class SchedulingOutOfOfficeObject { + public static final SchedulingOutOfOfficeObject SCHEDULING_OUT_OF_OFFICE = + new SchedulingOutOfOfficeObject(Value.SCHEDULING_OUT_OF_OFFICE, "scheduling.out_of_office"); + + private final Value value; + + private final String string; + + SchedulingOutOfOfficeObject(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof SchedulingOutOfOfficeObject + && this.string.equals(((SchedulingOutOfOfficeObject) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case SCHEDULING_OUT_OF_OFFICE: + return visitor.visitSchedulingOutOfOffice(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static SchedulingOutOfOfficeObject valueOf(String value) { + switch (value) { + case "scheduling.out_of_office": + return SCHEDULING_OUT_OF_OFFICE; + default: + return new SchedulingOutOfOfficeObject(Value.UNKNOWN, value); + } + } + + public enum Value { + SCHEDULING_OUT_OF_OFFICE, + + UNKNOWN + } + + public interface Visitor { + T visitSchedulingOutOfOffice(); + + T visitUnknown(String unknownType); + } +} diff --git a/sdks/java/src/main/java/com/coss/types/SchedulingOutOfOfficeSource.java b/sdks/java/src/main/java/com/coss/types/SchedulingOutOfOfficeSource.java new file mode 100644 index 000000000..5ea525c31 --- /dev/null +++ b/sdks/java/src/main/java/com/coss/types/SchedulingOutOfOfficeSource.java @@ -0,0 +1,115 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.coss.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class SchedulingOutOfOfficeSource { + public static final SchedulingOutOfOfficeSource DASHBOARD = + new SchedulingOutOfOfficeSource(Value.DASHBOARD, "dashboard"); + + public static final SchedulingOutOfOfficeSource HOST = new SchedulingOutOfOfficeSource(Value.HOST, "host"); + + public static final SchedulingOutOfOfficeSource MANAGER = new SchedulingOutOfOfficeSource(Value.MANAGER, "manager"); + + public static final SchedulingOutOfOfficeSource API = new SchedulingOutOfOfficeSource(Value.API, "api"); + + public static final SchedulingOutOfOfficeSource HOLIDAY = new SchedulingOutOfOfficeSource(Value.HOLIDAY, "holiday"); + + private final Value value; + + private final String string; + + SchedulingOutOfOfficeSource(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof SchedulingOutOfOfficeSource + && this.string.equals(((SchedulingOutOfOfficeSource) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case DASHBOARD: + return visitor.visitDashboard(); + case HOST: + return visitor.visitHost(); + case MANAGER: + return visitor.visitManager(); + case API: + return visitor.visitApi(); + case HOLIDAY: + return visitor.visitHoliday(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static SchedulingOutOfOfficeSource valueOf(String value) { + switch (value) { + case "dashboard": + return DASHBOARD; + case "host": + return HOST; + case "manager": + return MANAGER; + case "api": + return API; + case "holiday": + return HOLIDAY; + default: + return new SchedulingOutOfOfficeSource(Value.UNKNOWN, value); + } + } + + public enum Value { + API, + + HOST, + + MANAGER, + + DASHBOARD, + + HOLIDAY, + + UNKNOWN + } + + public interface Visitor { + T visitApi(); + + T visitHost(); + + T visitManager(); + + T visitDashboard(); + + T visitHoliday(); + + T visitUnknown(String unknownType); + } +} diff --git a/sdks/java/src/main/java/com/coss/types/SchedulingOutOfOfficeWebhookEvent.java b/sdks/java/src/main/java/com/coss/types/SchedulingOutOfOfficeWebhookEvent.java new file mode 100644 index 000000000..60f7409bf --- /dev/null +++ b/sdks/java/src/main/java/com/coss/types/SchedulingOutOfOfficeWebhookEvent.java @@ -0,0 +1,273 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.coss.types; + +import com.coss.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = SchedulingOutOfOfficeWebhookEvent.Builder.class) +public final class SchedulingOutOfOfficeWebhookEvent { + private final String id; + + private final SchedulingOutOfOfficeWebhookEventObject object; + + private final String apiVersion; + + private final OffsetDateTime createdAt; + + private final SchedulingOutOfOfficeWebhookEventType type; + + private final SchedulingOutOfOfficeWebhookEventData data; + + private final Map additionalProperties; + + private SchedulingOutOfOfficeWebhookEvent( + String id, + SchedulingOutOfOfficeWebhookEventObject object, + String apiVersion, + OffsetDateTime createdAt, + SchedulingOutOfOfficeWebhookEventType type, + SchedulingOutOfOfficeWebhookEventData data, + Map additionalProperties) { + this.id = id; + this.object = object; + this.apiVersion = apiVersion; + this.createdAt = createdAt; + this.type = type; + this.data = data; + this.additionalProperties = additionalProperties; + } + + /** + * @return The event id. + */ + @JsonProperty("id") + public String getId() { + return id; + } + + @JsonProperty("object") + public SchedulingOutOfOfficeWebhookEventObject getObject() { + return object; + } + + /** + * @return The API version this payload is rendered in: the endpoint's. + */ + @JsonProperty("api_version") + public String getApiVersion() { + return apiVersion; + } + + /** + * @return When the event was created. + */ + @JsonProperty("created_at") + public OffsetDateTime getCreatedAt() { + return createdAt; + } + + @JsonProperty("type") + public SchedulingOutOfOfficeWebhookEventType getType() { + return type; + } + + @JsonProperty("data") + public SchedulingOutOfOfficeWebhookEventData getData() { + return data; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof SchedulingOutOfOfficeWebhookEvent && equalTo((SchedulingOutOfOfficeWebhookEvent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(SchedulingOutOfOfficeWebhookEvent other) { + return id.equals(other.id) + && object.equals(other.object) + && apiVersion.equals(other.apiVersion) + && createdAt.equals(other.createdAt) + && type.equals(other.type) + && data.equals(other.data); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.id, this.object, this.apiVersion, this.createdAt, this.type, this.data); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static IdStage builder() { + return new Builder(); + } + + public interface IdStage { + /** + *

The event id.

+ */ + ObjectStage id(@NotNull String id); + + Builder from(SchedulingOutOfOfficeWebhookEvent other); + } + + public interface ObjectStage { + ApiVersionStage object(@NotNull SchedulingOutOfOfficeWebhookEventObject object); + } + + public interface ApiVersionStage { + /** + *

The API version this payload is rendered in: the endpoint's.

+ */ + CreatedAtStage apiVersion(@NotNull String apiVersion); + } + + public interface CreatedAtStage { + /** + *

When the event was created.

+ */ + TypeStage createdAt(@NotNull OffsetDateTime createdAt); + } + + public interface TypeStage { + DataStage type(@NotNull SchedulingOutOfOfficeWebhookEventType type); + } + + public interface DataStage { + _FinalStage data(@NotNull SchedulingOutOfOfficeWebhookEventData data); + } + + public interface _FinalStage { + SchedulingOutOfOfficeWebhookEvent build(); + + _FinalStage additionalProperty(String key, Object value); + + _FinalStage additionalProperties(Map additionalProperties); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder + implements IdStage, ObjectStage, ApiVersionStage, CreatedAtStage, TypeStage, DataStage, _FinalStage { + private String id; + + private SchedulingOutOfOfficeWebhookEventObject object; + + private String apiVersion; + + private OffsetDateTime createdAt; + + private SchedulingOutOfOfficeWebhookEventType type; + + private SchedulingOutOfOfficeWebhookEventData data; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(SchedulingOutOfOfficeWebhookEvent other) { + id(other.getId()); + object(other.getObject()); + apiVersion(other.getApiVersion()); + createdAt(other.getCreatedAt()); + type(other.getType()); + data(other.getData()); + return this; + } + + /** + *

The event id.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("id") + public ObjectStage id(@NotNull String id) { + this.id = Objects.requireNonNull(id, "id must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("object") + public ApiVersionStage object(@NotNull SchedulingOutOfOfficeWebhookEventObject object) { + this.object = Objects.requireNonNull(object, "object must not be null"); + return this; + } + + /** + *

The API version this payload is rendered in: the endpoint's.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("api_version") + public CreatedAtStage apiVersion(@NotNull String apiVersion) { + this.apiVersion = Objects.requireNonNull(apiVersion, "apiVersion must not be null"); + return this; + } + + /** + *

When the event was created.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("created_at") + public TypeStage createdAt(@NotNull OffsetDateTime createdAt) { + this.createdAt = Objects.requireNonNull(createdAt, "createdAt must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("type") + public DataStage type(@NotNull SchedulingOutOfOfficeWebhookEventType type) { + this.type = Objects.requireNonNull(type, "type must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("data") + public _FinalStage data(@NotNull SchedulingOutOfOfficeWebhookEventData data) { + this.data = Objects.requireNonNull(data, "data must not be null"); + return this; + } + + @java.lang.Override + public SchedulingOutOfOfficeWebhookEvent build() { + return new SchedulingOutOfOfficeWebhookEvent( + id, object, apiVersion, createdAt, type, data, additionalProperties); + } + + @java.lang.Override + public Builder additionalProperty(String key, Object value) { + this.additionalProperties.put(key, value); + return this; + } + + @java.lang.Override + public Builder additionalProperties(Map additionalProperties) { + this.additionalProperties.putAll(additionalProperties); + return this; + } + } +} diff --git a/sdks/java/src/main/java/com/coss/types/SchedulingOutOfOfficeWebhookEventData.java b/sdks/java/src/main/java/com/coss/types/SchedulingOutOfOfficeWebhookEventData.java new file mode 100644 index 000000000..ba63328bf --- /dev/null +++ b/sdks/java/src/main/java/com/coss/types/SchedulingOutOfOfficeWebhookEventData.java @@ -0,0 +1,290 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.coss.types; + +import com.coss.core.Nullable; +import com.coss.core.NullableNonemptyFilter; +import com.coss.core.ObjectMappers; +import com.coss.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = SchedulingOutOfOfficeWebhookEventData.Builder.class) +public final class SchedulingOutOfOfficeWebhookEventData { + private final String outOfOfficeId; + + private final String hostId; + + private final String start; + + private final String end; + + private final OptionalNullable group; + + private final String occurredAt; + + private final Map additionalProperties; + + private SchedulingOutOfOfficeWebhookEventData( + String outOfOfficeId, + String hostId, + String start, + String end, + OptionalNullable group, + String occurredAt, + Map additionalProperties) { + this.outOfOfficeId = outOfOfficeId; + this.hostId = hostId; + this.start = start; + this.end = end; + this.group = group; + this.occurredAt = occurredAt; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("out_of_office_id") + public String getOutOfOfficeId() { + return outOfOfficeId; + } + + @JsonProperty("host_id") + public String getHostId() { + return hostId; + } + + @JsonProperty("start") + public String getStart() { + return start; + } + + @JsonProperty("end") + public String getEnd() { + return end; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("group") + public OptionalNullable getGroup() { + if (group == null) { + return OptionalNullable.absent(); + } + return group; + } + + @JsonProperty("occurred_at") + public String getOccurredAt() { + return occurredAt; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("group") + private OptionalNullable _getGroup() { + return group; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof SchedulingOutOfOfficeWebhookEventData + && equalTo((SchedulingOutOfOfficeWebhookEventData) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(SchedulingOutOfOfficeWebhookEventData other) { + return outOfOfficeId.equals(other.outOfOfficeId) + && hostId.equals(other.hostId) + && start.equals(other.start) + && end.equals(other.end) + && group.equals(other.group) + && occurredAt.equals(other.occurredAt); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.outOfOfficeId, this.hostId, this.start, this.end, this.group, this.occurredAt); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static OutOfOfficeIdStage builder() { + return new Builder(); + } + + public interface OutOfOfficeIdStage { + HostIdStage outOfOfficeId(@NotNull String outOfOfficeId); + + Builder from(SchedulingOutOfOfficeWebhookEventData other); + } + + public interface HostIdStage { + StartStage hostId(@NotNull String hostId); + } + + public interface StartStage { + EndStage start(@NotNull String start); + } + + public interface EndStage { + OccurredAtStage end(@NotNull String end); + } + + public interface OccurredAtStage { + _FinalStage occurredAt(@NotNull String occurredAt); + } + + public interface _FinalStage { + SchedulingOutOfOfficeWebhookEventData build(); + + _FinalStage additionalProperty(String key, Object value); + + _FinalStage additionalProperties(Map additionalProperties); + + _FinalStage group(OptionalNullable group); + + _FinalStage group(String group); + + _FinalStage group(Optional group); + + _FinalStage group(Nullable group); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder + implements OutOfOfficeIdStage, HostIdStage, StartStage, EndStage, OccurredAtStage, _FinalStage { + private String outOfOfficeId; + + private String hostId; + + private String start; + + private String end; + + private String occurredAt; + + private OptionalNullable group = OptionalNullable.absent(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(SchedulingOutOfOfficeWebhookEventData other) { + outOfOfficeId(other.getOutOfOfficeId()); + hostId(other.getHostId()); + start(other.getStart()); + end(other.getEnd()); + group(other.getGroup()); + occurredAt(other.getOccurredAt()); + return this; + } + + @java.lang.Override + @JsonSetter("out_of_office_id") + public HostIdStage outOfOfficeId(@NotNull String outOfOfficeId) { + this.outOfOfficeId = Objects.requireNonNull(outOfOfficeId, "outOfOfficeId must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("host_id") + public StartStage hostId(@NotNull String hostId) { + this.hostId = Objects.requireNonNull(hostId, "hostId must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("start") + public EndStage start(@NotNull String start) { + this.start = Objects.requireNonNull(start, "start must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("end") + public OccurredAtStage end(@NotNull String end) { + this.end = Objects.requireNonNull(end, "end must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("occurred_at") + public _FinalStage occurredAt(@NotNull String occurredAt) { + this.occurredAt = Objects.requireNonNull(occurredAt, "occurredAt must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage group(Nullable group) { + if (group.isNull()) { + this.group = OptionalNullable.ofNull(); + } else if (group.isEmpty()) { + this.group = OptionalNullable.absent(); + } else { + this.group = OptionalNullable.of(group.get()); + } + return this; + } + + @java.lang.Override + public _FinalStage group(Optional group) { + if (group.isPresent()) { + this.group = OptionalNullable.of(group.get()); + } else { + this.group = OptionalNullable.absent(); + } + return this; + } + + @java.lang.Override + public _FinalStage group(String group) { + this.group = OptionalNullable.of(group); + return this; + } + + @java.lang.Override + @JsonSetter(value = "group", nulls = Nulls.SKIP) + public _FinalStage group(OptionalNullable group) { + this.group = group; + return this; + } + + @java.lang.Override + public SchedulingOutOfOfficeWebhookEventData build() { + return new SchedulingOutOfOfficeWebhookEventData( + outOfOfficeId, hostId, start, end, group, occurredAt, additionalProperties); + } + + @java.lang.Override + public Builder additionalProperty(String key, Object value) { + this.additionalProperties.put(key, value); + return this; + } + + @java.lang.Override + public Builder additionalProperties(Map additionalProperties) { + this.additionalProperties.putAll(additionalProperties); + return this; + } + } +} diff --git a/sdks/java/src/main/java/com/coss/types/SchedulingOutOfOfficeWebhookEventObject.java b/sdks/java/src/main/java/com/coss/types/SchedulingOutOfOfficeWebhookEventObject.java new file mode 100644 index 000000000..90e22a336 --- /dev/null +++ b/sdks/java/src/main/java/com/coss/types/SchedulingOutOfOfficeWebhookEventObject.java @@ -0,0 +1,75 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.coss.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class SchedulingOutOfOfficeWebhookEventObject { + public static final SchedulingOutOfOfficeWebhookEventObject EVENT = + new SchedulingOutOfOfficeWebhookEventObject(Value.EVENT, "event"); + + private final Value value; + + private final String string; + + SchedulingOutOfOfficeWebhookEventObject(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof SchedulingOutOfOfficeWebhookEventObject + && this.string.equals(((SchedulingOutOfOfficeWebhookEventObject) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case EVENT: + return visitor.visitEvent(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static SchedulingOutOfOfficeWebhookEventObject valueOf(String value) { + switch (value) { + case "event": + return EVENT; + default: + return new SchedulingOutOfOfficeWebhookEventObject(Value.UNKNOWN, value); + } + } + + public enum Value { + EVENT, + + UNKNOWN + } + + public interface Visitor { + T visitEvent(); + + T visitUnknown(String unknownType); + } +} diff --git a/sdks/java/src/main/java/com/coss/types/SchedulingOutOfOfficeWebhookEventType.java b/sdks/java/src/main/java/com/coss/types/SchedulingOutOfOfficeWebhookEventType.java new file mode 100644 index 000000000..e1e85c084 --- /dev/null +++ b/sdks/java/src/main/java/com/coss/types/SchedulingOutOfOfficeWebhookEventType.java @@ -0,0 +1,124 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.coss.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class SchedulingOutOfOfficeWebhookEventType { + public static final SchedulingOutOfOfficeWebhookEventType SCHEDULING_OUT_OF_OFFICE_DELETED = + new SchedulingOutOfOfficeWebhookEventType( + Value.SCHEDULING_OUT_OF_OFFICE_DELETED, "scheduling.out_of_office.deleted"); + + public static final SchedulingOutOfOfficeWebhookEventType SCHEDULING_OUT_OF_OFFICE_CREATED = + new SchedulingOutOfOfficeWebhookEventType( + Value.SCHEDULING_OUT_OF_OFFICE_CREATED, "scheduling.out_of_office.created"); + + public static final SchedulingOutOfOfficeWebhookEventType SCHEDULING_OUT_OF_OFFICE_UPDATED = + new SchedulingOutOfOfficeWebhookEventType( + Value.SCHEDULING_OUT_OF_OFFICE_UPDATED, "scheduling.out_of_office.updated"); + + public static final SchedulingOutOfOfficeWebhookEventType SCHEDULING_OUT_OF_OFFICE_STARTED = + new SchedulingOutOfOfficeWebhookEventType( + Value.SCHEDULING_OUT_OF_OFFICE_STARTED, "scheduling.out_of_office.started"); + + public static final SchedulingOutOfOfficeWebhookEventType SCHEDULING_OUT_OF_OFFICE_ENDED = + new SchedulingOutOfOfficeWebhookEventType( + Value.SCHEDULING_OUT_OF_OFFICE_ENDED, "scheduling.out_of_office.ended"); + + private final Value value; + + private final String string; + + SchedulingOutOfOfficeWebhookEventType(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof SchedulingOutOfOfficeWebhookEventType + && this.string.equals(((SchedulingOutOfOfficeWebhookEventType) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case SCHEDULING_OUT_OF_OFFICE_DELETED: + return visitor.visitSchedulingOutOfOfficeDeleted(); + case SCHEDULING_OUT_OF_OFFICE_CREATED: + return visitor.visitSchedulingOutOfOfficeCreated(); + case SCHEDULING_OUT_OF_OFFICE_UPDATED: + return visitor.visitSchedulingOutOfOfficeUpdated(); + case SCHEDULING_OUT_OF_OFFICE_STARTED: + return visitor.visitSchedulingOutOfOfficeStarted(); + case SCHEDULING_OUT_OF_OFFICE_ENDED: + return visitor.visitSchedulingOutOfOfficeEnded(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static SchedulingOutOfOfficeWebhookEventType valueOf(String value) { + switch (value) { + case "scheduling.out_of_office.deleted": + return SCHEDULING_OUT_OF_OFFICE_DELETED; + case "scheduling.out_of_office.created": + return SCHEDULING_OUT_OF_OFFICE_CREATED; + case "scheduling.out_of_office.updated": + return SCHEDULING_OUT_OF_OFFICE_UPDATED; + case "scheduling.out_of_office.started": + return SCHEDULING_OUT_OF_OFFICE_STARTED; + case "scheduling.out_of_office.ended": + return SCHEDULING_OUT_OF_OFFICE_ENDED; + default: + return new SchedulingOutOfOfficeWebhookEventType(Value.UNKNOWN, value); + } + } + + public enum Value { + SCHEDULING_OUT_OF_OFFICE_CREATED, + + SCHEDULING_OUT_OF_OFFICE_UPDATED, + + SCHEDULING_OUT_OF_OFFICE_DELETED, + + SCHEDULING_OUT_OF_OFFICE_STARTED, + + SCHEDULING_OUT_OF_OFFICE_ENDED, + + UNKNOWN + } + + public interface Visitor { + T visitSchedulingOutOfOfficeCreated(); + + T visitSchedulingOutOfOfficeUpdated(); + + T visitSchedulingOutOfOfficeDeleted(); + + T visitSchedulingOutOfOfficeStarted(); + + T visitSchedulingOutOfOfficeEnded(); + + T visitUnknown(String unknownType); + } +} diff --git a/sdks/java/src/main/java/com/coss/types/SchedulingReassignCandidate.java b/sdks/java/src/main/java/com/coss/types/SchedulingReassignCandidate.java new file mode 100644 index 000000000..3fd052e3d --- /dev/null +++ b/sdks/java/src/main/java/com/coss/types/SchedulingReassignCandidate.java @@ -0,0 +1,632 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.coss.types; + +import com.coss.core.Nullable; +import com.coss.core.NullableNonemptyFilter; +import com.coss.core.ObjectMappers; +import com.coss.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = SchedulingReassignCandidate.Builder.class) +public final class SchedulingReassignCandidate { + private final SchedulingReassignCandidateObject object; + + private final String host; + + private final OptionalNullable uid; + + private final String name; + + private final boolean member; + + private final boolean available; + + private final OptionalNullable reason; + + private final List reasons; + + private final double load; + + private final OptionalNullable rank; + + private final boolean meetingProviderMissing; + + private final Map additionalProperties; + + private SchedulingReassignCandidate( + SchedulingReassignCandidateObject object, + String host, + OptionalNullable uid, + String name, + boolean member, + boolean available, + OptionalNullable reason, + List reasons, + double load, + OptionalNullable rank, + boolean meetingProviderMissing, + Map additionalProperties) { + this.object = object; + this.host = host; + this.uid = uid; + this.name = name; + this.member = member; + this.available = available; + this.reason = reason; + this.reasons = reasons; + this.load = load; + this.rank = rank; + this.meetingProviderMissing = meetingProviderMissing; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("object") + public SchedulingReassignCandidateObject getObject() { + return object; + } + + @JsonProperty("host") + public String getHost() { + return host; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("uid") + public OptionalNullable getUid() { + if (uid == null) { + return OptionalNullable.absent(); + } + return uid; + } + + @JsonProperty("name") + public String getName() { + return name; + } + + /** + * @return Takes this event type, and fits what the booking was routed with. Otherwise it needs any_host. + */ + @JsonProperty("member") + public boolean getMember() { + return member; + } + + @JsonProperty("available") + public boolean getAvailable() { + return available; + } + + /** + * @return Why they aren't available, the first of reasons. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("reason") + public OptionalNullable getReason() { + if (reason == null) { + return OptionalNullable.absent(); + } + return reason; + } + + /** + * @return Everything in the way, each needing its override. already_claimed can't be overridden. + */ + @JsonProperty("reasons") + public List getReasons() { + return reasons; + } + + /** + * @return Their live bookings in the week from this one. + */ + @JsonProperty("load") + public double getLoad() { + return load; + } + + /** + * @return Their place in who a pool would pick next, from 1. Null for a non-member. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("rank") + public OptionalNullable getRank() { + if (rank == null) { + return OptionalNullable.absent(); + } + return rank; + } + + /** + * @return They haven't connected what this booking's meeting needs, so it'd have none. + */ + @JsonProperty("meeting_provider_missing") + public boolean getMeetingProviderMissing() { + return meetingProviderMissing; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("uid") + private OptionalNullable _getUid() { + return uid; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("reason") + private OptionalNullable _getReason() { + return reason; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("rank") + private OptionalNullable _getRank() { + return rank; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof SchedulingReassignCandidate && equalTo((SchedulingReassignCandidate) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(SchedulingReassignCandidate other) { + return object.equals(other.object) + && host.equals(other.host) + && uid.equals(other.uid) + && name.equals(other.name) + && member == other.member + && available == other.available + && reason.equals(other.reason) + && reasons.equals(other.reasons) + && load == other.load + && rank.equals(other.rank) + && meetingProviderMissing == other.meetingProviderMissing; + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.object, + this.host, + this.uid, + this.name, + this.member, + this.available, + this.reason, + this.reasons, + this.load, + this.rank, + this.meetingProviderMissing); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ObjectStage builder() { + return new Builder(); + } + + public interface ObjectStage { + HostStage object(@NotNull SchedulingReassignCandidateObject object); + + Builder from(SchedulingReassignCandidate other); + } + + public interface HostStage { + NameStage host(@NotNull String host); + } + + public interface NameStage { + MemberStage name(@NotNull String name); + } + + public interface MemberStage { + /** + *

Takes this event type, and fits what the booking was routed with. Otherwise it needs any_host.

+ */ + AvailableStage member(boolean member); + } + + public interface AvailableStage { + LoadStage available(boolean available); + } + + public interface LoadStage { + /** + *

Their live bookings in the week from this one.

+ */ + MeetingProviderMissingStage load(double load); + } + + public interface MeetingProviderMissingStage { + /** + *

They haven't connected what this booking's meeting needs, so it'd have none.

+ */ + _FinalStage meetingProviderMissing(boolean meetingProviderMissing); + } + + public interface _FinalStage { + SchedulingReassignCandidate build(); + + _FinalStage additionalProperty(String key, Object value); + + _FinalStage additionalProperties(Map additionalProperties); + + _FinalStage uid(OptionalNullable uid); + + _FinalStage uid(String uid); + + _FinalStage uid(Optional uid); + + _FinalStage uid(Nullable uid); + + /** + *

Why they aren't available, the first of reasons.

+ */ + _FinalStage reason(OptionalNullable reason); + + _FinalStage reason(String reason); + + _FinalStage reason(Optional reason); + + _FinalStage reason(Nullable reason); + + /** + *

Everything in the way, each needing its override. already_claimed can't be overridden.

+ */ + _FinalStage reasons(List reasons); + + _FinalStage addReasons(String reasons); + + _FinalStage addAllReasons(List reasons); + + /** + *

Their place in who a pool would pick next, from 1. Null for a non-member.

+ */ + _FinalStage rank(OptionalNullable rank); + + _FinalStage rank(Double rank); + + _FinalStage rank(Optional rank); + + _FinalStage rank(Nullable rank); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder + implements ObjectStage, + HostStage, + NameStage, + MemberStage, + AvailableStage, + LoadStage, + MeetingProviderMissingStage, + _FinalStage { + private SchedulingReassignCandidateObject object; + + private String host; + + private String name; + + private boolean member; + + private boolean available; + + private double load; + + private boolean meetingProviderMissing; + + private OptionalNullable rank = OptionalNullable.absent(); + + private List reasons = new ArrayList<>(); + + private OptionalNullable reason = OptionalNullable.absent(); + + private OptionalNullable uid = OptionalNullable.absent(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(SchedulingReassignCandidate other) { + object(other.getObject()); + host(other.getHost()); + uid(other.getUid()); + name(other.getName()); + member(other.getMember()); + available(other.getAvailable()); + reason(other.getReason()); + reasons(other.getReasons()); + load(other.getLoad()); + rank(other.getRank()); + meetingProviderMissing(other.getMeetingProviderMissing()); + return this; + } + + @java.lang.Override + @JsonSetter("object") + public HostStage object(@NotNull SchedulingReassignCandidateObject object) { + this.object = Objects.requireNonNull(object, "object must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("host") + public NameStage host(@NotNull String host) { + this.host = Objects.requireNonNull(host, "host must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("name") + public MemberStage name(@NotNull String name) { + this.name = Objects.requireNonNull(name, "name must not be null"); + return this; + } + + /** + *

Takes this event type, and fits what the booking was routed with. Otherwise it needs any_host.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("member") + public AvailableStage member(boolean member) { + this.member = member; + return this; + } + + @java.lang.Override + @JsonSetter("available") + public LoadStage available(boolean available) { + this.available = available; + return this; + } + + /** + *

Their live bookings in the week from this one.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("load") + public MeetingProviderMissingStage load(double load) { + this.load = load; + return this; + } + + /** + *

They haven't connected what this booking's meeting needs, so it'd have none.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("meeting_provider_missing") + public _FinalStage meetingProviderMissing(boolean meetingProviderMissing) { + this.meetingProviderMissing = meetingProviderMissing; + return this; + } + + /** + *

Their place in who a pool would pick next, from 1. Null for a non-member.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage rank(Nullable rank) { + if (rank.isNull()) { + this.rank = OptionalNullable.ofNull(); + } else if (rank.isEmpty()) { + this.rank = OptionalNullable.absent(); + } else { + this.rank = OptionalNullable.of(rank.get()); + } + return this; + } + + /** + *

Their place in who a pool would pick next, from 1. Null for a non-member.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage rank(Optional rank) { + if (rank.isPresent()) { + this.rank = OptionalNullable.of(rank.get()); + } else { + this.rank = OptionalNullable.absent(); + } + return this; + } + + /** + *

Their place in who a pool would pick next, from 1. Null for a non-member.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage rank(Double rank) { + this.rank = OptionalNullable.of(rank); + return this; + } + + /** + *

Their place in who a pool would pick next, from 1. Null for a non-member.

+ */ + @java.lang.Override + @JsonSetter(value = "rank", nulls = Nulls.SKIP) + public _FinalStage rank(OptionalNullable rank) { + this.rank = rank; + return this; + } + + /** + *

Everything in the way, each needing its override. already_claimed can't be overridden.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage addAllReasons(List reasons) { + if (reasons != null) { + this.reasons.addAll(reasons); + } + return this; + } + + /** + *

Everything in the way, each needing its override. already_claimed can't be overridden.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage addReasons(String reasons) { + this.reasons.add(reasons); + return this; + } + + /** + *

Everything in the way, each needing its override. already_claimed can't be overridden.

+ */ + @java.lang.Override + @JsonSetter(value = "reasons", nulls = Nulls.SKIP) + public _FinalStage reasons(List reasons) { + this.reasons.clear(); + if (reasons != null) { + this.reasons.addAll(reasons); + } + return this; + } + + /** + *

Why they aren't available, the first of reasons.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage reason(Nullable reason) { + if (reason.isNull()) { + this.reason = OptionalNullable.ofNull(); + } else if (reason.isEmpty()) { + this.reason = OptionalNullable.absent(); + } else { + this.reason = OptionalNullable.of(reason.get()); + } + return this; + } + + /** + *

Why they aren't available, the first of reasons.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage reason(Optional reason) { + if (reason.isPresent()) { + this.reason = OptionalNullable.of(reason.get()); + } else { + this.reason = OptionalNullable.absent(); + } + return this; + } + + /** + *

Why they aren't available, the first of reasons.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage reason(String reason) { + this.reason = OptionalNullable.of(reason); + return this; + } + + /** + *

Why they aren't available, the first of reasons.

+ */ + @java.lang.Override + @JsonSetter(value = "reason", nulls = Nulls.SKIP) + public _FinalStage reason(OptionalNullable reason) { + this.reason = reason; + return this; + } + + @java.lang.Override + public _FinalStage uid(Nullable uid) { + if (uid.isNull()) { + this.uid = OptionalNullable.ofNull(); + } else if (uid.isEmpty()) { + this.uid = OptionalNullable.absent(); + } else { + this.uid = OptionalNullable.of(uid.get()); + } + return this; + } + + @java.lang.Override + public _FinalStage uid(Optional uid) { + if (uid.isPresent()) { + this.uid = OptionalNullable.of(uid.get()); + } else { + this.uid = OptionalNullable.absent(); + } + return this; + } + + @java.lang.Override + public _FinalStage uid(String uid) { + this.uid = OptionalNullable.of(uid); + return this; + } + + @java.lang.Override + @JsonSetter(value = "uid", nulls = Nulls.SKIP) + public _FinalStage uid(OptionalNullable uid) { + this.uid = uid; + return this; + } + + @java.lang.Override + public SchedulingReassignCandidate build() { + return new SchedulingReassignCandidate( + object, + host, + uid, + name, + member, + available, + reason, + reasons, + load, + rank, + meetingProviderMissing, + additionalProperties); + } + + @java.lang.Override + public Builder additionalProperty(String key, Object value) { + this.additionalProperties.put(key, value); + return this; + } + + @java.lang.Override + public Builder additionalProperties(Map additionalProperties) { + this.additionalProperties.putAll(additionalProperties); + return this; + } + } +} diff --git a/sdks/java/src/main/java/com/coss/types/SchedulingReassignCandidateList.java b/sdks/java/src/main/java/com/coss/types/SchedulingReassignCandidateList.java new file mode 100644 index 000000000..3fa610d99 --- /dev/null +++ b/sdks/java/src/main/java/com/coss/types/SchedulingReassignCandidateList.java @@ -0,0 +1,188 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.coss.types; + +import com.coss.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = SchedulingReassignCandidateList.Builder.class) +public final class SchedulingReassignCandidateList { + private final SchedulingReassignCandidateListObject object; + + private final List data; + + private final boolean hasMore; + + private final Map additionalProperties; + + private SchedulingReassignCandidateList( + SchedulingReassignCandidateListObject object, + List data, + boolean hasMore, + Map additionalProperties) { + this.object = object; + this.data = data; + this.hasMore = hasMore; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("object") + public SchedulingReassignCandidateListObject getObject() { + return object; + } + + @JsonProperty("data") + public List getData() { + return data; + } + + @JsonProperty("has_more") + public boolean getHasMore() { + return hasMore; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof SchedulingReassignCandidateList && equalTo((SchedulingReassignCandidateList) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(SchedulingReassignCandidateList other) { + return object.equals(other.object) && data.equals(other.data) && hasMore == other.hasMore; + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.object, this.data, this.hasMore); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ObjectStage builder() { + return new Builder(); + } + + public interface ObjectStage { + HasMoreStage object(@NotNull SchedulingReassignCandidateListObject object); + + Builder from(SchedulingReassignCandidateList other); + } + + public interface HasMoreStage { + _FinalStage hasMore(boolean hasMore); + } + + public interface _FinalStage { + SchedulingReassignCandidateList build(); + + _FinalStage additionalProperty(String key, Object value); + + _FinalStage additionalProperties(Map additionalProperties); + + _FinalStage data(List data); + + _FinalStage addData(SchedulingReassignCandidate data); + + _FinalStage addAllData(List data); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ObjectStage, HasMoreStage, _FinalStage { + private SchedulingReassignCandidateListObject object; + + private boolean hasMore; + + private List data = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(SchedulingReassignCandidateList other) { + object(other.getObject()); + data(other.getData()); + hasMore(other.getHasMore()); + return this; + } + + @java.lang.Override + @JsonSetter("object") + public HasMoreStage object(@NotNull SchedulingReassignCandidateListObject object) { + this.object = Objects.requireNonNull(object, "object must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("has_more") + public _FinalStage hasMore(boolean hasMore) { + this.hasMore = hasMore; + return this; + } + + @java.lang.Override + public _FinalStage addAllData(List data) { + if (data != null) { + this.data.addAll(data); + } + return this; + } + + @java.lang.Override + public _FinalStage addData(SchedulingReassignCandidate data) { + this.data.add(data); + return this; + } + + @java.lang.Override + @JsonSetter(value = "data", nulls = Nulls.SKIP) + public _FinalStage data(List data) { + this.data.clear(); + if (data != null) { + this.data.addAll(data); + } + return this; + } + + @java.lang.Override + public SchedulingReassignCandidateList build() { + return new SchedulingReassignCandidateList(object, data, hasMore, additionalProperties); + } + + @java.lang.Override + public Builder additionalProperty(String key, Object value) { + this.additionalProperties.put(key, value); + return this; + } + + @java.lang.Override + public Builder additionalProperties(Map additionalProperties) { + this.additionalProperties.putAll(additionalProperties); + return this; + } + } +} diff --git a/sdks/java/src/main/java/com/coss/types/SchedulingReassignCandidateListObject.java b/sdks/java/src/main/java/com/coss/types/SchedulingReassignCandidateListObject.java new file mode 100644 index 000000000..6a7862157 --- /dev/null +++ b/sdks/java/src/main/java/com/coss/types/SchedulingReassignCandidateListObject.java @@ -0,0 +1,75 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.coss.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class SchedulingReassignCandidateListObject { + public static final SchedulingReassignCandidateListObject LIST = + new SchedulingReassignCandidateListObject(Value.LIST, "list"); + + private final Value value; + + private final String string; + + SchedulingReassignCandidateListObject(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof SchedulingReassignCandidateListObject + && this.string.equals(((SchedulingReassignCandidateListObject) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case LIST: + return visitor.visitList(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static SchedulingReassignCandidateListObject valueOf(String value) { + switch (value) { + case "list": + return LIST; + default: + return new SchedulingReassignCandidateListObject(Value.UNKNOWN, value); + } + } + + public enum Value { + LIST, + + UNKNOWN + } + + public interface Visitor { + T visitList(); + + T visitUnknown(String unknownType); + } +} diff --git a/sdks/java/src/main/java/com/coss/types/SchedulingReassignCandidateObject.java b/sdks/java/src/main/java/com/coss/types/SchedulingReassignCandidateObject.java new file mode 100644 index 000000000..38949f4d5 --- /dev/null +++ b/sdks/java/src/main/java/com/coss/types/SchedulingReassignCandidateObject.java @@ -0,0 +1,75 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.coss.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class SchedulingReassignCandidateObject { + public static final SchedulingReassignCandidateObject SCHEDULING_REASSIGN_CANDIDATE = + new SchedulingReassignCandidateObject(Value.SCHEDULING_REASSIGN_CANDIDATE, "scheduling.reassign_candidate"); + + private final Value value; + + private final String string; + + SchedulingReassignCandidateObject(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof SchedulingReassignCandidateObject + && this.string.equals(((SchedulingReassignCandidateObject) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case SCHEDULING_REASSIGN_CANDIDATE: + return visitor.visitSchedulingReassignCandidate(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static SchedulingReassignCandidateObject valueOf(String value) { + switch (value) { + case "scheduling.reassign_candidate": + return SCHEDULING_REASSIGN_CANDIDATE; + default: + return new SchedulingReassignCandidateObject(Value.UNKNOWN, value); + } + } + + public enum Value { + SCHEDULING_REASSIGN_CANDIDATE, + + UNKNOWN + } + + public interface Visitor { + T visitSchedulingReassignCandidate(); + + T visitUnknown(String unknownType); + } +} diff --git a/sdks/java/src/main/java/com/coss/types/SchedulingReassignment.java b/sdks/java/src/main/java/com/coss/types/SchedulingReassignment.java new file mode 100644 index 000000000..4b512a71e --- /dev/null +++ b/sdks/java/src/main/java/com/coss/types/SchedulingReassignment.java @@ -0,0 +1,531 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.coss.types; + +import com.coss.core.Nullable; +import com.coss.core.NullableNonemptyFilter; +import com.coss.core.ObjectMappers; +import com.coss.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = SchedulingReassignment.Builder.class) +public final class SchedulingReassignment { + private final SchedulingReassignmentObject object; + + private final String id; + + private final SchedulingReassignmentStatus status; + + private final SchedulingReassignmentReasonCode reasonCode; + + private final OptionalNullable outOfOffice; + + private final OptionalNullable undoOf; + + private final SchedulingReassignmentCounts counts; + + private final String createdAt; + + private final OptionalNullable startedAt; + + private final OptionalNullable finishedAt; + + private final Map additionalProperties; + + private SchedulingReassignment( + SchedulingReassignmentObject object, + String id, + SchedulingReassignmentStatus status, + SchedulingReassignmentReasonCode reasonCode, + OptionalNullable outOfOffice, + OptionalNullable undoOf, + SchedulingReassignmentCounts counts, + String createdAt, + OptionalNullable startedAt, + OptionalNullable finishedAt, + Map additionalProperties) { + this.object = object; + this.id = id; + this.status = status; + this.reasonCode = reasonCode; + this.outOfOffice = outOfOffice; + this.undoOf = undoOf; + this.counts = counts; + this.createdAt = createdAt; + this.startedAt = startedAt; + this.finishedAt = finishedAt; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("object") + public SchedulingReassignmentObject getObject() { + return object; + } + + @JsonProperty("id") + public String getId() { + return id; + } + + @JsonProperty("status") + public SchedulingReassignmentStatus getStatus() { + return status; + } + + @JsonProperty("reason_code") + public SchedulingReassignmentReasonCode getReasonCode() { + return reasonCode; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("out_of_office") + public OptionalNullable getOutOfOffice() { + if (outOfOffice == null) { + return OptionalNullable.absent(); + } + return outOfOffice; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("undo_of") + public OptionalNullable getUndoOf() { + if (undoOf == null) { + return OptionalNullable.absent(); + } + return undoOf; + } + + @JsonProperty("counts") + public SchedulingReassignmentCounts getCounts() { + return counts; + } + + @JsonProperty("created_at") + public String getCreatedAt() { + return createdAt; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("started_at") + public OptionalNullable getStartedAt() { + if (startedAt == null) { + return OptionalNullable.absent(); + } + return startedAt; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("finished_at") + public OptionalNullable getFinishedAt() { + if (finishedAt == null) { + return OptionalNullable.absent(); + } + return finishedAt; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("out_of_office") + private OptionalNullable _getOutOfOffice() { + return outOfOffice; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("undo_of") + private OptionalNullable _getUndoOf() { + return undoOf; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("started_at") + private OptionalNullable _getStartedAt() { + return startedAt; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("finished_at") + private OptionalNullable _getFinishedAt() { + return finishedAt; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof SchedulingReassignment && equalTo((SchedulingReassignment) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(SchedulingReassignment other) { + return object.equals(other.object) + && id.equals(other.id) + && status.equals(other.status) + && reasonCode.equals(other.reasonCode) + && outOfOffice.equals(other.outOfOffice) + && undoOf.equals(other.undoOf) + && counts.equals(other.counts) + && createdAt.equals(other.createdAt) + && startedAt.equals(other.startedAt) + && finishedAt.equals(other.finishedAt); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.object, + this.id, + this.status, + this.reasonCode, + this.outOfOffice, + this.undoOf, + this.counts, + this.createdAt, + this.startedAt, + this.finishedAt); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ObjectStage builder() { + return new Builder(); + } + + public interface ObjectStage { + IdStage object(@NotNull SchedulingReassignmentObject object); + + Builder from(SchedulingReassignment other); + } + + public interface IdStage { + StatusStage id(@NotNull String id); + } + + public interface StatusStage { + ReasonCodeStage status(@NotNull SchedulingReassignmentStatus status); + } + + public interface ReasonCodeStage { + CountsStage reasonCode(@NotNull SchedulingReassignmentReasonCode reasonCode); + } + + public interface CountsStage { + CreatedAtStage counts(@NotNull SchedulingReassignmentCounts counts); + } + + public interface CreatedAtStage { + _FinalStage createdAt(@NotNull String createdAt); + } + + public interface _FinalStage { + SchedulingReassignment build(); + + _FinalStage additionalProperty(String key, Object value); + + _FinalStage additionalProperties(Map additionalProperties); + + _FinalStage outOfOffice(OptionalNullable outOfOffice); + + _FinalStage outOfOffice(String outOfOffice); + + _FinalStage outOfOffice(Optional outOfOffice); + + _FinalStage outOfOffice(Nullable outOfOffice); + + _FinalStage undoOf(OptionalNullable undoOf); + + _FinalStage undoOf(String undoOf); + + _FinalStage undoOf(Optional undoOf); + + _FinalStage undoOf(Nullable undoOf); + + _FinalStage startedAt(OptionalNullable startedAt); + + _FinalStage startedAt(String startedAt); + + _FinalStage startedAt(Optional startedAt); + + _FinalStage startedAt(Nullable startedAt); + + _FinalStage finishedAt(OptionalNullable finishedAt); + + _FinalStage finishedAt(String finishedAt); + + _FinalStage finishedAt(Optional finishedAt); + + _FinalStage finishedAt(Nullable finishedAt); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder + implements ObjectStage, IdStage, StatusStage, ReasonCodeStage, CountsStage, CreatedAtStage, _FinalStage { + private SchedulingReassignmentObject object; + + private String id; + + private SchedulingReassignmentStatus status; + + private SchedulingReassignmentReasonCode reasonCode; + + private SchedulingReassignmentCounts counts; + + private String createdAt; + + private OptionalNullable finishedAt = OptionalNullable.absent(); + + private OptionalNullable startedAt = OptionalNullable.absent(); + + private OptionalNullable undoOf = OptionalNullable.absent(); + + private OptionalNullable outOfOffice = OptionalNullable.absent(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(SchedulingReassignment other) { + object(other.getObject()); + id(other.getId()); + status(other.getStatus()); + reasonCode(other.getReasonCode()); + outOfOffice(other.getOutOfOffice()); + undoOf(other.getUndoOf()); + counts(other.getCounts()); + createdAt(other.getCreatedAt()); + startedAt(other.getStartedAt()); + finishedAt(other.getFinishedAt()); + return this; + } + + @java.lang.Override + @JsonSetter("object") + public IdStage object(@NotNull SchedulingReassignmentObject object) { + this.object = Objects.requireNonNull(object, "object must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("id") + public StatusStage id(@NotNull String id) { + this.id = Objects.requireNonNull(id, "id must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("status") + public ReasonCodeStage status(@NotNull SchedulingReassignmentStatus status) { + this.status = Objects.requireNonNull(status, "status must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("reason_code") + public CountsStage reasonCode(@NotNull SchedulingReassignmentReasonCode reasonCode) { + this.reasonCode = Objects.requireNonNull(reasonCode, "reasonCode must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("counts") + public CreatedAtStage counts(@NotNull SchedulingReassignmentCounts counts) { + this.counts = Objects.requireNonNull(counts, "counts must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("created_at") + public _FinalStage createdAt(@NotNull String createdAt) { + this.createdAt = Objects.requireNonNull(createdAt, "createdAt must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage finishedAt(Nullable finishedAt) { + if (finishedAt.isNull()) { + this.finishedAt = OptionalNullable.ofNull(); + } else if (finishedAt.isEmpty()) { + this.finishedAt = OptionalNullable.absent(); + } else { + this.finishedAt = OptionalNullable.of(finishedAt.get()); + } + return this; + } + + @java.lang.Override + public _FinalStage finishedAt(Optional finishedAt) { + if (finishedAt.isPresent()) { + this.finishedAt = OptionalNullable.of(finishedAt.get()); + } else { + this.finishedAt = OptionalNullable.absent(); + } + return this; + } + + @java.lang.Override + public _FinalStage finishedAt(String finishedAt) { + this.finishedAt = OptionalNullable.of(finishedAt); + return this; + } + + @java.lang.Override + @JsonSetter(value = "finished_at", nulls = Nulls.SKIP) + public _FinalStage finishedAt(OptionalNullable finishedAt) { + this.finishedAt = finishedAt; + return this; + } + + @java.lang.Override + public _FinalStage startedAt(Nullable startedAt) { + if (startedAt.isNull()) { + this.startedAt = OptionalNullable.ofNull(); + } else if (startedAt.isEmpty()) { + this.startedAt = OptionalNullable.absent(); + } else { + this.startedAt = OptionalNullable.of(startedAt.get()); + } + return this; + } + + @java.lang.Override + public _FinalStage startedAt(Optional startedAt) { + if (startedAt.isPresent()) { + this.startedAt = OptionalNullable.of(startedAt.get()); + } else { + this.startedAt = OptionalNullable.absent(); + } + return this; + } + + @java.lang.Override + public _FinalStage startedAt(String startedAt) { + this.startedAt = OptionalNullable.of(startedAt); + return this; + } + + @java.lang.Override + @JsonSetter(value = "started_at", nulls = Nulls.SKIP) + public _FinalStage startedAt(OptionalNullable startedAt) { + this.startedAt = startedAt; + return this; + } + + @java.lang.Override + public _FinalStage undoOf(Nullable undoOf) { + if (undoOf.isNull()) { + this.undoOf = OptionalNullable.ofNull(); + } else if (undoOf.isEmpty()) { + this.undoOf = OptionalNullable.absent(); + } else { + this.undoOf = OptionalNullable.of(undoOf.get()); + } + return this; + } + + @java.lang.Override + public _FinalStage undoOf(Optional undoOf) { + if (undoOf.isPresent()) { + this.undoOf = OptionalNullable.of(undoOf.get()); + } else { + this.undoOf = OptionalNullable.absent(); + } + return this; + } + + @java.lang.Override + public _FinalStage undoOf(String undoOf) { + this.undoOf = OptionalNullable.of(undoOf); + return this; + } + + @java.lang.Override + @JsonSetter(value = "undo_of", nulls = Nulls.SKIP) + public _FinalStage undoOf(OptionalNullable undoOf) { + this.undoOf = undoOf; + return this; + } + + @java.lang.Override + public _FinalStage outOfOffice(Nullable outOfOffice) { + if (outOfOffice.isNull()) { + this.outOfOffice = OptionalNullable.ofNull(); + } else if (outOfOffice.isEmpty()) { + this.outOfOffice = OptionalNullable.absent(); + } else { + this.outOfOffice = OptionalNullable.of(outOfOffice.get()); + } + return this; + } + + @java.lang.Override + public _FinalStage outOfOffice(Optional outOfOffice) { + if (outOfOffice.isPresent()) { + this.outOfOffice = OptionalNullable.of(outOfOffice.get()); + } else { + this.outOfOffice = OptionalNullable.absent(); + } + return this; + } + + @java.lang.Override + public _FinalStage outOfOffice(String outOfOffice) { + this.outOfOffice = OptionalNullable.of(outOfOffice); + return this; + } + + @java.lang.Override + @JsonSetter(value = "out_of_office", nulls = Nulls.SKIP) + public _FinalStage outOfOffice(OptionalNullable outOfOffice) { + this.outOfOffice = outOfOffice; + return this; + } + + @java.lang.Override + public SchedulingReassignment build() { + return new SchedulingReassignment( + object, + id, + status, + reasonCode, + outOfOffice, + undoOf, + counts, + createdAt, + startedAt, + finishedAt, + additionalProperties); + } + + @java.lang.Override + public Builder additionalProperty(String key, Object value) { + this.additionalProperties.put(key, value); + return this; + } + + @java.lang.Override + public Builder additionalProperties(Map additionalProperties) { + this.additionalProperties.putAll(additionalProperties); + return this; + } + } +} diff --git a/sdks/java/src/main/java/com/coss/types/SchedulingReassignmentCounts.java b/sdks/java/src/main/java/com/coss/types/SchedulingReassignmentCounts.java new file mode 100644 index 000000000..ce160c848 --- /dev/null +++ b/sdks/java/src/main/java/com/coss/types/SchedulingReassignmentCounts.java @@ -0,0 +1,293 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.coss.types; + +import com.coss.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = SchedulingReassignmentCounts.Builder.class) +public final class SchedulingReassignmentCounts { + private final double total; + + private final double pending; + + private final double reassigned; + + private final double skipped; + + private final double noCandidate; + + private final double failed; + + private final double cancelled; + + private final Map additionalProperties; + + private SchedulingReassignmentCounts( + double total, + double pending, + double reassigned, + double skipped, + double noCandidate, + double failed, + double cancelled, + Map additionalProperties) { + this.total = total; + this.pending = pending; + this.reassigned = reassigned; + this.skipped = skipped; + this.noCandidate = noCandidate; + this.failed = failed; + this.cancelled = cancelled; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("total") + public double getTotal() { + return total; + } + + @JsonProperty("pending") + public double getPending() { + return pending; + } + + @JsonProperty("reassigned") + public double getReassigned() { + return reassigned; + } + + /** + * @return They'd moved on since it was selected. + */ + @JsonProperty("skipped") + public double getSkipped() { + return skipped; + } + + /** + * @return Nobody could take them: they stayed. + */ + @JsonProperty("no_candidate") + public double getNoCandidate() { + return noCandidate; + } + + @JsonProperty("failed") + public double getFailed() { + return failed; + } + + @JsonProperty("cancelled") + public double getCancelled() { + return cancelled; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof SchedulingReassignmentCounts && equalTo((SchedulingReassignmentCounts) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(SchedulingReassignmentCounts other) { + return total == other.total + && pending == other.pending + && reassigned == other.reassigned + && skipped == other.skipped + && noCandidate == other.noCandidate + && failed == other.failed + && cancelled == other.cancelled; + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.total, this.pending, this.reassigned, this.skipped, this.noCandidate, this.failed, this.cancelled); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static TotalStage builder() { + return new Builder(); + } + + public interface TotalStage { + PendingStage total(double total); + + Builder from(SchedulingReassignmentCounts other); + } + + public interface PendingStage { + ReassignedStage pending(double pending); + } + + public interface ReassignedStage { + SkippedStage reassigned(double reassigned); + } + + public interface SkippedStage { + /** + *

They'd moved on since it was selected.

+ */ + NoCandidateStage skipped(double skipped); + } + + public interface NoCandidateStage { + /** + *

Nobody could take them: they stayed.

+ */ + FailedStage noCandidate(double noCandidate); + } + + public interface FailedStage { + CancelledStage failed(double failed); + } + + public interface CancelledStage { + _FinalStage cancelled(double cancelled); + } + + public interface _FinalStage { + SchedulingReassignmentCounts build(); + + _FinalStage additionalProperty(String key, Object value); + + _FinalStage additionalProperties(Map additionalProperties); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder + implements TotalStage, + PendingStage, + ReassignedStage, + SkippedStage, + NoCandidateStage, + FailedStage, + CancelledStage, + _FinalStage { + private double total; + + private double pending; + + private double reassigned; + + private double skipped; + + private double noCandidate; + + private double failed; + + private double cancelled; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(SchedulingReassignmentCounts other) { + total(other.getTotal()); + pending(other.getPending()); + reassigned(other.getReassigned()); + skipped(other.getSkipped()); + noCandidate(other.getNoCandidate()); + failed(other.getFailed()); + cancelled(other.getCancelled()); + return this; + } + + @java.lang.Override + @JsonSetter("total") + public PendingStage total(double total) { + this.total = total; + return this; + } + + @java.lang.Override + @JsonSetter("pending") + public ReassignedStage pending(double pending) { + this.pending = pending; + return this; + } + + @java.lang.Override + @JsonSetter("reassigned") + public SkippedStage reassigned(double reassigned) { + this.reassigned = reassigned; + return this; + } + + /** + *

They'd moved on since it was selected.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("skipped") + public NoCandidateStage skipped(double skipped) { + this.skipped = skipped; + return this; + } + + /** + *

Nobody could take them: they stayed.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("no_candidate") + public FailedStage noCandidate(double noCandidate) { + this.noCandidate = noCandidate; + return this; + } + + @java.lang.Override + @JsonSetter("failed") + public CancelledStage failed(double failed) { + this.failed = failed; + return this; + } + + @java.lang.Override + @JsonSetter("cancelled") + public _FinalStage cancelled(double cancelled) { + this.cancelled = cancelled; + return this; + } + + @java.lang.Override + public SchedulingReassignmentCounts build() { + return new SchedulingReassignmentCounts( + total, pending, reassigned, skipped, noCandidate, failed, cancelled, additionalProperties); + } + + @java.lang.Override + public Builder additionalProperty(String key, Object value) { + this.additionalProperties.put(key, value); + return this; + } + + @java.lang.Override + public Builder additionalProperties(Map additionalProperties) { + this.additionalProperties.putAll(additionalProperties); + return this; + } + } +} diff --git a/sdks/java/src/main/java/com/coss/types/SchedulingReassignmentItem.java b/sdks/java/src/main/java/com/coss/types/SchedulingReassignmentItem.java new file mode 100644 index 000000000..694344560 --- /dev/null +++ b/sdks/java/src/main/java/com/coss/types/SchedulingReassignmentItem.java @@ -0,0 +1,397 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.coss.types; + +import com.coss.core.Nullable; +import com.coss.core.NullableNonemptyFilter; +import com.coss.core.ObjectMappers; +import com.coss.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = SchedulingReassignmentItem.Builder.class) +public final class SchedulingReassignmentItem { + private final SchedulingReassignmentItemObject object; + + private final String id; + + private final String booking; + + private final OptionalNullable fromHost; + + private final OptionalNullable toHost; + + private final SchedulingReassignmentItemOutcome outcome; + + private final OptionalNullable errorCode; + + private final Map additionalProperties; + + private SchedulingReassignmentItem( + SchedulingReassignmentItemObject object, + String id, + String booking, + OptionalNullable fromHost, + OptionalNullable toHost, + SchedulingReassignmentItemOutcome outcome, + OptionalNullable errorCode, + Map additionalProperties) { + this.object = object; + this.id = id; + this.booking = booking; + this.fromHost = fromHost; + this.toHost = toHost; + this.outcome = outcome; + this.errorCode = errorCode; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("object") + public SchedulingReassignmentItemObject getObject() { + return object; + } + + @JsonProperty("id") + public String getId() { + return id; + } + + @JsonProperty("booking") + public String getBooking() { + return booking; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("from_host") + public OptionalNullable getFromHost() { + if (fromHost == null) { + return OptionalNullable.absent(); + } + return fromHost; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("to_host") + public OptionalNullable getToHost() { + if (toHost == null) { + return OptionalNullable.absent(); + } + return toHost; + } + + @JsonProperty("outcome") + public SchedulingReassignmentItemOutcome getOutcome() { + return outcome; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("error_code") + public OptionalNullable getErrorCode() { + if (errorCode == null) { + return OptionalNullable.absent(); + } + return errorCode; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("from_host") + private OptionalNullable _getFromHost() { + return fromHost; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("to_host") + private OptionalNullable _getToHost() { + return toHost; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("error_code") + private OptionalNullable _getErrorCode() { + return errorCode; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof SchedulingReassignmentItem && equalTo((SchedulingReassignmentItem) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(SchedulingReassignmentItem other) { + return object.equals(other.object) + && id.equals(other.id) + && booking.equals(other.booking) + && fromHost.equals(other.fromHost) + && toHost.equals(other.toHost) + && outcome.equals(other.outcome) + && errorCode.equals(other.errorCode); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.object, this.id, this.booking, this.fromHost, this.toHost, this.outcome, this.errorCode); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ObjectStage builder() { + return new Builder(); + } + + public interface ObjectStage { + IdStage object(@NotNull SchedulingReassignmentItemObject object); + + Builder from(SchedulingReassignmentItem other); + } + + public interface IdStage { + BookingStage id(@NotNull String id); + } + + public interface BookingStage { + OutcomeStage booking(@NotNull String booking); + } + + public interface OutcomeStage { + _FinalStage outcome(@NotNull SchedulingReassignmentItemOutcome outcome); + } + + public interface _FinalStage { + SchedulingReassignmentItem build(); + + _FinalStage additionalProperty(String key, Object value); + + _FinalStage additionalProperties(Map additionalProperties); + + _FinalStage fromHost(OptionalNullable fromHost); + + _FinalStage fromHost(String fromHost); + + _FinalStage fromHost(Optional fromHost); + + _FinalStage fromHost(Nullable fromHost); + + _FinalStage toHost(OptionalNullable toHost); + + _FinalStage toHost(String toHost); + + _FinalStage toHost(Optional toHost); + + _FinalStage toHost(Nullable toHost); + + _FinalStage errorCode(OptionalNullable errorCode); + + _FinalStage errorCode(String errorCode); + + _FinalStage errorCode(Optional errorCode); + + _FinalStage errorCode(Nullable errorCode); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ObjectStage, IdStage, BookingStage, OutcomeStage, _FinalStage { + private SchedulingReassignmentItemObject object; + + private String id; + + private String booking; + + private SchedulingReassignmentItemOutcome outcome; + + private OptionalNullable errorCode = OptionalNullable.absent(); + + private OptionalNullable toHost = OptionalNullable.absent(); + + private OptionalNullable fromHost = OptionalNullable.absent(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(SchedulingReassignmentItem other) { + object(other.getObject()); + id(other.getId()); + booking(other.getBooking()); + fromHost(other.getFromHost()); + toHost(other.getToHost()); + outcome(other.getOutcome()); + errorCode(other.getErrorCode()); + return this; + } + + @java.lang.Override + @JsonSetter("object") + public IdStage object(@NotNull SchedulingReassignmentItemObject object) { + this.object = Objects.requireNonNull(object, "object must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("id") + public BookingStage id(@NotNull String id) { + this.id = Objects.requireNonNull(id, "id must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("booking") + public OutcomeStage booking(@NotNull String booking) { + this.booking = Objects.requireNonNull(booking, "booking must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("outcome") + public _FinalStage outcome(@NotNull SchedulingReassignmentItemOutcome outcome) { + this.outcome = Objects.requireNonNull(outcome, "outcome must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage errorCode(Nullable errorCode) { + if (errorCode.isNull()) { + this.errorCode = OptionalNullable.ofNull(); + } else if (errorCode.isEmpty()) { + this.errorCode = OptionalNullable.absent(); + } else { + this.errorCode = OptionalNullable.of(errorCode.get()); + } + return this; + } + + @java.lang.Override + public _FinalStage errorCode(Optional errorCode) { + if (errorCode.isPresent()) { + this.errorCode = OptionalNullable.of(errorCode.get()); + } else { + this.errorCode = OptionalNullable.absent(); + } + return this; + } + + @java.lang.Override + public _FinalStage errorCode(String errorCode) { + this.errorCode = OptionalNullable.of(errorCode); + return this; + } + + @java.lang.Override + @JsonSetter(value = "error_code", nulls = Nulls.SKIP) + public _FinalStage errorCode(OptionalNullable errorCode) { + this.errorCode = errorCode; + return this; + } + + @java.lang.Override + public _FinalStage toHost(Nullable toHost) { + if (toHost.isNull()) { + this.toHost = OptionalNullable.ofNull(); + } else if (toHost.isEmpty()) { + this.toHost = OptionalNullable.absent(); + } else { + this.toHost = OptionalNullable.of(toHost.get()); + } + return this; + } + + @java.lang.Override + public _FinalStage toHost(Optional toHost) { + if (toHost.isPresent()) { + this.toHost = OptionalNullable.of(toHost.get()); + } else { + this.toHost = OptionalNullable.absent(); + } + return this; + } + + @java.lang.Override + public _FinalStage toHost(String toHost) { + this.toHost = OptionalNullable.of(toHost); + return this; + } + + @java.lang.Override + @JsonSetter(value = "to_host", nulls = Nulls.SKIP) + public _FinalStage toHost(OptionalNullable toHost) { + this.toHost = toHost; + return this; + } + + @java.lang.Override + public _FinalStage fromHost(Nullable fromHost) { + if (fromHost.isNull()) { + this.fromHost = OptionalNullable.ofNull(); + } else if (fromHost.isEmpty()) { + this.fromHost = OptionalNullable.absent(); + } else { + this.fromHost = OptionalNullable.of(fromHost.get()); + } + return this; + } + + @java.lang.Override + public _FinalStage fromHost(Optional fromHost) { + if (fromHost.isPresent()) { + this.fromHost = OptionalNullable.of(fromHost.get()); + } else { + this.fromHost = OptionalNullable.absent(); + } + return this; + } + + @java.lang.Override + public _FinalStage fromHost(String fromHost) { + this.fromHost = OptionalNullable.of(fromHost); + return this; + } + + @java.lang.Override + @JsonSetter(value = "from_host", nulls = Nulls.SKIP) + public _FinalStage fromHost(OptionalNullable fromHost) { + this.fromHost = fromHost; + return this; + } + + @java.lang.Override + public SchedulingReassignmentItem build() { + return new SchedulingReassignmentItem( + object, id, booking, fromHost, toHost, outcome, errorCode, additionalProperties); + } + + @java.lang.Override + public Builder additionalProperty(String key, Object value) { + this.additionalProperties.put(key, value); + return this; + } + + @java.lang.Override + public Builder additionalProperties(Map additionalProperties) { + this.additionalProperties.putAll(additionalProperties); + return this; + } + } +} diff --git a/sdks/java/src/main/java/com/coss/types/SchedulingReassignmentItemList.java b/sdks/java/src/main/java/com/coss/types/SchedulingReassignmentItemList.java new file mode 100644 index 000000000..e94c5f07a --- /dev/null +++ b/sdks/java/src/main/java/com/coss/types/SchedulingReassignmentItemList.java @@ -0,0 +1,188 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.coss.types; + +import com.coss.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = SchedulingReassignmentItemList.Builder.class) +public final class SchedulingReassignmentItemList { + private final SchedulingReassignmentItemListObject object; + + private final List data; + + private final boolean hasMore; + + private final Map additionalProperties; + + private SchedulingReassignmentItemList( + SchedulingReassignmentItemListObject object, + List data, + boolean hasMore, + Map additionalProperties) { + this.object = object; + this.data = data; + this.hasMore = hasMore; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("object") + public SchedulingReassignmentItemListObject getObject() { + return object; + } + + @JsonProperty("data") + public List getData() { + return data; + } + + @JsonProperty("has_more") + public boolean getHasMore() { + return hasMore; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof SchedulingReassignmentItemList && equalTo((SchedulingReassignmentItemList) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(SchedulingReassignmentItemList other) { + return object.equals(other.object) && data.equals(other.data) && hasMore == other.hasMore; + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.object, this.data, this.hasMore); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ObjectStage builder() { + return new Builder(); + } + + public interface ObjectStage { + HasMoreStage object(@NotNull SchedulingReassignmentItemListObject object); + + Builder from(SchedulingReassignmentItemList other); + } + + public interface HasMoreStage { + _FinalStage hasMore(boolean hasMore); + } + + public interface _FinalStage { + SchedulingReassignmentItemList build(); + + _FinalStage additionalProperty(String key, Object value); + + _FinalStage additionalProperties(Map additionalProperties); + + _FinalStage data(List data); + + _FinalStage addData(SchedulingReassignmentItem data); + + _FinalStage addAllData(List data); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ObjectStage, HasMoreStage, _FinalStage { + private SchedulingReassignmentItemListObject object; + + private boolean hasMore; + + private List data = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(SchedulingReassignmentItemList other) { + object(other.getObject()); + data(other.getData()); + hasMore(other.getHasMore()); + return this; + } + + @java.lang.Override + @JsonSetter("object") + public HasMoreStage object(@NotNull SchedulingReassignmentItemListObject object) { + this.object = Objects.requireNonNull(object, "object must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("has_more") + public _FinalStage hasMore(boolean hasMore) { + this.hasMore = hasMore; + return this; + } + + @java.lang.Override + public _FinalStage addAllData(List data) { + if (data != null) { + this.data.addAll(data); + } + return this; + } + + @java.lang.Override + public _FinalStage addData(SchedulingReassignmentItem data) { + this.data.add(data); + return this; + } + + @java.lang.Override + @JsonSetter(value = "data", nulls = Nulls.SKIP) + public _FinalStage data(List data) { + this.data.clear(); + if (data != null) { + this.data.addAll(data); + } + return this; + } + + @java.lang.Override + public SchedulingReassignmentItemList build() { + return new SchedulingReassignmentItemList(object, data, hasMore, additionalProperties); + } + + @java.lang.Override + public Builder additionalProperty(String key, Object value) { + this.additionalProperties.put(key, value); + return this; + } + + @java.lang.Override + public Builder additionalProperties(Map additionalProperties) { + this.additionalProperties.putAll(additionalProperties); + return this; + } + } +} diff --git a/sdks/java/src/main/java/com/coss/types/SchedulingReassignmentItemListObject.java b/sdks/java/src/main/java/com/coss/types/SchedulingReassignmentItemListObject.java new file mode 100644 index 000000000..d3ef5cdac --- /dev/null +++ b/sdks/java/src/main/java/com/coss/types/SchedulingReassignmentItemListObject.java @@ -0,0 +1,75 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.coss.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class SchedulingReassignmentItemListObject { + public static final SchedulingReassignmentItemListObject LIST = + new SchedulingReassignmentItemListObject(Value.LIST, "list"); + + private final Value value; + + private final String string; + + SchedulingReassignmentItemListObject(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof SchedulingReassignmentItemListObject + && this.string.equals(((SchedulingReassignmentItemListObject) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case LIST: + return visitor.visitList(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static SchedulingReassignmentItemListObject valueOf(String value) { + switch (value) { + case "list": + return LIST; + default: + return new SchedulingReassignmentItemListObject(Value.UNKNOWN, value); + } + } + + public enum Value { + LIST, + + UNKNOWN + } + + public interface Visitor { + T visitList(); + + T visitUnknown(String unknownType); + } +} diff --git a/sdks/java/src/main/java/com/coss/types/SchedulingReassignmentItemObject.java b/sdks/java/src/main/java/com/coss/types/SchedulingReassignmentItemObject.java new file mode 100644 index 000000000..3cd084edb --- /dev/null +++ b/sdks/java/src/main/java/com/coss/types/SchedulingReassignmentItemObject.java @@ -0,0 +1,75 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.coss.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class SchedulingReassignmentItemObject { + public static final SchedulingReassignmentItemObject SCHEDULING_REASSIGNMENT_ITEM = + new SchedulingReassignmentItemObject(Value.SCHEDULING_REASSIGNMENT_ITEM, "scheduling.reassignment_item"); + + private final Value value; + + private final String string; + + SchedulingReassignmentItemObject(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof SchedulingReassignmentItemObject + && this.string.equals(((SchedulingReassignmentItemObject) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case SCHEDULING_REASSIGNMENT_ITEM: + return visitor.visitSchedulingReassignmentItem(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static SchedulingReassignmentItemObject valueOf(String value) { + switch (value) { + case "scheduling.reassignment_item": + return SCHEDULING_REASSIGNMENT_ITEM; + default: + return new SchedulingReassignmentItemObject(Value.UNKNOWN, value); + } + } + + public enum Value { + SCHEDULING_REASSIGNMENT_ITEM, + + UNKNOWN + } + + public interface Visitor { + T visitSchedulingReassignmentItem(); + + T visitUnknown(String unknownType); + } +} diff --git a/sdks/java/src/main/java/com/coss/types/SchedulingReassignmentItemOutcome.java b/sdks/java/src/main/java/com/coss/types/SchedulingReassignmentItemOutcome.java new file mode 100644 index 000000000..f59aa8afb --- /dev/null +++ b/sdks/java/src/main/java/com/coss/types/SchedulingReassignmentItemOutcome.java @@ -0,0 +1,130 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.coss.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class SchedulingReassignmentItemOutcome { + public static final SchedulingReassignmentItemOutcome FAILED = + new SchedulingReassignmentItemOutcome(Value.FAILED, "failed"); + + public static final SchedulingReassignmentItemOutcome SKIPPED_CHANGED = + new SchedulingReassignmentItemOutcome(Value.SKIPPED_CHANGED, "skipped_changed"); + + public static final SchedulingReassignmentItemOutcome NO_CANDIDATE = + new SchedulingReassignmentItemOutcome(Value.NO_CANDIDATE, "no_candidate"); + + public static final SchedulingReassignmentItemOutcome PENDING = + new SchedulingReassignmentItemOutcome(Value.PENDING, "pending"); + + public static final SchedulingReassignmentItemOutcome REASSIGNED = + new SchedulingReassignmentItemOutcome(Value.REASSIGNED, "reassigned"); + + public static final SchedulingReassignmentItemOutcome CANCELLED = + new SchedulingReassignmentItemOutcome(Value.CANCELLED, "cancelled"); + + private final Value value; + + private final String string; + + SchedulingReassignmentItemOutcome(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof SchedulingReassignmentItemOutcome + && this.string.equals(((SchedulingReassignmentItemOutcome) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case FAILED: + return visitor.visitFailed(); + case SKIPPED_CHANGED: + return visitor.visitSkippedChanged(); + case NO_CANDIDATE: + return visitor.visitNoCandidate(); + case PENDING: + return visitor.visitPending(); + case REASSIGNED: + return visitor.visitReassigned(); + case CANCELLED: + return visitor.visitCancelled(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static SchedulingReassignmentItemOutcome valueOf(String value) { + switch (value) { + case "failed": + return FAILED; + case "skipped_changed": + return SKIPPED_CHANGED; + case "no_candidate": + return NO_CANDIDATE; + case "pending": + return PENDING; + case "reassigned": + return REASSIGNED; + case "cancelled": + return CANCELLED; + default: + return new SchedulingReassignmentItemOutcome(Value.UNKNOWN, value); + } + } + + public enum Value { + PENDING, + + REASSIGNED, + + SKIPPED_CHANGED, + + NO_CANDIDATE, + + FAILED, + + CANCELLED, + + UNKNOWN + } + + public interface Visitor { + T visitPending(); + + T visitReassigned(); + + T visitSkippedChanged(); + + T visitNoCandidate(); + + T visitFailed(); + + T visitCancelled(); + + T visitUnknown(String unknownType); + } +} diff --git a/sdks/java/src/main/java/com/coss/types/SchedulingReassignmentList.java b/sdks/java/src/main/java/com/coss/types/SchedulingReassignmentList.java new file mode 100644 index 000000000..cf9a2417c --- /dev/null +++ b/sdks/java/src/main/java/com/coss/types/SchedulingReassignmentList.java @@ -0,0 +1,188 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.coss.types; + +import com.coss.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = SchedulingReassignmentList.Builder.class) +public final class SchedulingReassignmentList { + private final SchedulingReassignmentListObject object; + + private final List data; + + private final boolean hasMore; + + private final Map additionalProperties; + + private SchedulingReassignmentList( + SchedulingReassignmentListObject object, + List data, + boolean hasMore, + Map additionalProperties) { + this.object = object; + this.data = data; + this.hasMore = hasMore; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("object") + public SchedulingReassignmentListObject getObject() { + return object; + } + + @JsonProperty("data") + public List getData() { + return data; + } + + @JsonProperty("has_more") + public boolean getHasMore() { + return hasMore; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof SchedulingReassignmentList && equalTo((SchedulingReassignmentList) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(SchedulingReassignmentList other) { + return object.equals(other.object) && data.equals(other.data) && hasMore == other.hasMore; + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.object, this.data, this.hasMore); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ObjectStage builder() { + return new Builder(); + } + + public interface ObjectStage { + HasMoreStage object(@NotNull SchedulingReassignmentListObject object); + + Builder from(SchedulingReassignmentList other); + } + + public interface HasMoreStage { + _FinalStage hasMore(boolean hasMore); + } + + public interface _FinalStage { + SchedulingReassignmentList build(); + + _FinalStage additionalProperty(String key, Object value); + + _FinalStage additionalProperties(Map additionalProperties); + + _FinalStage data(List data); + + _FinalStage addData(SchedulingReassignment data); + + _FinalStage addAllData(List data); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ObjectStage, HasMoreStage, _FinalStage { + private SchedulingReassignmentListObject object; + + private boolean hasMore; + + private List data = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(SchedulingReassignmentList other) { + object(other.getObject()); + data(other.getData()); + hasMore(other.getHasMore()); + return this; + } + + @java.lang.Override + @JsonSetter("object") + public HasMoreStage object(@NotNull SchedulingReassignmentListObject object) { + this.object = Objects.requireNonNull(object, "object must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("has_more") + public _FinalStage hasMore(boolean hasMore) { + this.hasMore = hasMore; + return this; + } + + @java.lang.Override + public _FinalStage addAllData(List data) { + if (data != null) { + this.data.addAll(data); + } + return this; + } + + @java.lang.Override + public _FinalStage addData(SchedulingReassignment data) { + this.data.add(data); + return this; + } + + @java.lang.Override + @JsonSetter(value = "data", nulls = Nulls.SKIP) + public _FinalStage data(List data) { + this.data.clear(); + if (data != null) { + this.data.addAll(data); + } + return this; + } + + @java.lang.Override + public SchedulingReassignmentList build() { + return new SchedulingReassignmentList(object, data, hasMore, additionalProperties); + } + + @java.lang.Override + public Builder additionalProperty(String key, Object value) { + this.additionalProperties.put(key, value); + return this; + } + + @java.lang.Override + public Builder additionalProperties(Map additionalProperties) { + this.additionalProperties.putAll(additionalProperties); + return this; + } + } +} diff --git a/sdks/java/src/main/java/com/coss/types/SchedulingReassignmentListObject.java b/sdks/java/src/main/java/com/coss/types/SchedulingReassignmentListObject.java new file mode 100644 index 000000000..88f66f61b --- /dev/null +++ b/sdks/java/src/main/java/com/coss/types/SchedulingReassignmentListObject.java @@ -0,0 +1,75 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.coss.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class SchedulingReassignmentListObject { + public static final SchedulingReassignmentListObject LIST = + new SchedulingReassignmentListObject(Value.LIST, "list"); + + private final Value value; + + private final String string; + + SchedulingReassignmentListObject(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof SchedulingReassignmentListObject + && this.string.equals(((SchedulingReassignmentListObject) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case LIST: + return visitor.visitList(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static SchedulingReassignmentListObject valueOf(String value) { + switch (value) { + case "list": + return LIST; + default: + return new SchedulingReassignmentListObject(Value.UNKNOWN, value); + } + } + + public enum Value { + LIST, + + UNKNOWN + } + + public interface Visitor { + T visitList(); + + T visitUnknown(String unknownType); + } +} diff --git a/sdks/java/src/main/java/com/coss/types/SchedulingReassignmentObject.java b/sdks/java/src/main/java/com/coss/types/SchedulingReassignmentObject.java new file mode 100644 index 000000000..0327ff51c --- /dev/null +++ b/sdks/java/src/main/java/com/coss/types/SchedulingReassignmentObject.java @@ -0,0 +1,75 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.coss.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class SchedulingReassignmentObject { + public static final SchedulingReassignmentObject SCHEDULING_REASSIGNMENT = + new SchedulingReassignmentObject(Value.SCHEDULING_REASSIGNMENT, "scheduling.reassignment"); + + private final Value value; + + private final String string; + + SchedulingReassignmentObject(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof SchedulingReassignmentObject + && this.string.equals(((SchedulingReassignmentObject) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case SCHEDULING_REASSIGNMENT: + return visitor.visitSchedulingReassignment(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static SchedulingReassignmentObject valueOf(String value) { + switch (value) { + case "scheduling.reassignment": + return SCHEDULING_REASSIGNMENT; + default: + return new SchedulingReassignmentObject(Value.UNKNOWN, value); + } + } + + public enum Value { + SCHEDULING_REASSIGNMENT, + + UNKNOWN + } + + public interface Visitor { + T visitSchedulingReassignment(); + + T visitUnknown(String unknownType); + } +} diff --git a/sdks/java/src/main/java/com/coss/types/SchedulingReassignmentPreview.java b/sdks/java/src/main/java/com/coss/types/SchedulingReassignmentPreview.java new file mode 100644 index 000000000..17e0fdbcb --- /dev/null +++ b/sdks/java/src/main/java/com/coss/types/SchedulingReassignmentPreview.java @@ -0,0 +1,198 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.coss.types; + +import com.coss.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = SchedulingReassignmentPreview.Builder.class) +public final class SchedulingReassignmentPreview { + private final SchedulingReassignmentPreviewObject object; + + private final List items; + + private final boolean truncated; + + private final Map additionalProperties; + + private SchedulingReassignmentPreview( + SchedulingReassignmentPreviewObject object, + List items, + boolean truncated, + Map additionalProperties) { + this.object = object; + this.items = items; + this.truncated = truncated; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("object") + public SchedulingReassignmentPreviewObject getObject() { + return object; + } + + @JsonProperty("items") + public List getItems() { + return items; + } + + /** + * @return There are more than a preview covers. + */ + @JsonProperty("truncated") + public boolean getTruncated() { + return truncated; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof SchedulingReassignmentPreview && equalTo((SchedulingReassignmentPreview) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(SchedulingReassignmentPreview other) { + return object.equals(other.object) && items.equals(other.items) && truncated == other.truncated; + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.object, this.items, this.truncated); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ObjectStage builder() { + return new Builder(); + } + + public interface ObjectStage { + TruncatedStage object(@NotNull SchedulingReassignmentPreviewObject object); + + Builder from(SchedulingReassignmentPreview other); + } + + public interface TruncatedStage { + /** + *

There are more than a preview covers.

+ */ + _FinalStage truncated(boolean truncated); + } + + public interface _FinalStage { + SchedulingReassignmentPreview build(); + + _FinalStage additionalProperty(String key, Object value); + + _FinalStage additionalProperties(Map additionalProperties); + + _FinalStage items(List items); + + _FinalStage addItems(SchedulingReassignmentPreviewItemsItem items); + + _FinalStage addAllItems(List items); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ObjectStage, TruncatedStage, _FinalStage { + private SchedulingReassignmentPreviewObject object; + + private boolean truncated; + + private List items = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(SchedulingReassignmentPreview other) { + object(other.getObject()); + items(other.getItems()); + truncated(other.getTruncated()); + return this; + } + + @java.lang.Override + @JsonSetter("object") + public TruncatedStage object(@NotNull SchedulingReassignmentPreviewObject object) { + this.object = Objects.requireNonNull(object, "object must not be null"); + return this; + } + + /** + *

There are more than a preview covers.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("truncated") + public _FinalStage truncated(boolean truncated) { + this.truncated = truncated; + return this; + } + + @java.lang.Override + public _FinalStage addAllItems(List items) { + if (items != null) { + this.items.addAll(items); + } + return this; + } + + @java.lang.Override + public _FinalStage addItems(SchedulingReassignmentPreviewItemsItem items) { + this.items.add(items); + return this; + } + + @java.lang.Override + @JsonSetter(value = "items", nulls = Nulls.SKIP) + public _FinalStage items(List items) { + this.items.clear(); + if (items != null) { + this.items.addAll(items); + } + return this; + } + + @java.lang.Override + public SchedulingReassignmentPreview build() { + return new SchedulingReassignmentPreview(object, items, truncated, additionalProperties); + } + + @java.lang.Override + public Builder additionalProperty(String key, Object value) { + this.additionalProperties.put(key, value); + return this; + } + + @java.lang.Override + public Builder additionalProperties(Map additionalProperties) { + this.additionalProperties.putAll(additionalProperties); + return this; + } + } +} diff --git a/sdks/java/src/main/java/com/coss/types/SchedulingReassignmentPreviewItemsItem.java b/sdks/java/src/main/java/com/coss/types/SchedulingReassignmentPreviewItemsItem.java new file mode 100644 index 000000000..9b90890ba --- /dev/null +++ b/sdks/java/src/main/java/com/coss/types/SchedulingReassignmentPreviewItemsItem.java @@ -0,0 +1,642 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.coss.types; + +import com.coss.core.Nullable; +import com.coss.core.NullableNonemptyFilter; +import com.coss.core.ObjectMappers; +import com.coss.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = SchedulingReassignmentPreviewItemsItem.Builder.class) +public final class SchedulingReassignmentPreviewItemsItem { + private final String booking; + + private final String eventType; + + private final String title; + + private final SchedulingReassignmentPreviewItemsItemStatus status; + + private final String start; + + private final String end; + + private final OptionalNullable series; + + private final OptionalNullable groupSession; + + private final OptionalNullable fromHost; + + private final OptionalNullable toHost; + + private final OptionalNullable reason; + + private final Map additionalProperties; + + private SchedulingReassignmentPreviewItemsItem( + String booking, + String eventType, + String title, + SchedulingReassignmentPreviewItemsItemStatus status, + String start, + String end, + OptionalNullable series, + OptionalNullable groupSession, + OptionalNullable fromHost, + OptionalNullable toHost, + OptionalNullable reason, + Map additionalProperties) { + this.booking = booking; + this.eventType = eventType; + this.title = title; + this.status = status; + this.start = start; + this.end = end; + this.series = series; + this.groupSession = groupSession; + this.fromHost = fromHost; + this.toHost = toHost; + this.reason = reason; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("booking") + public String getBooking() { + return booking; + } + + @JsonProperty("event_type") + public String getEventType() { + return eventType; + } + + @JsonProperty("title") + public String getTitle() { + return title; + } + + @JsonProperty("status") + public SchedulingReassignmentPreviewItemsItemStatus getStatus() { + return status; + } + + @JsonProperty("start") + public String getStart() { + return start; + } + + @JsonProperty("end") + public String getEnd() { + return end; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("series") + public OptionalNullable getSeries() { + if (series == null) { + return OptionalNullable.absent(); + } + return series; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("group_session") + public OptionalNullable getGroupSession() { + if (groupSession == null) { + return OptionalNullable.absent(); + } + return groupSession; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("from_host") + public OptionalNullable getFromHost() { + if (fromHost == null) { + return OptionalNullable.absent(); + } + return fromHost; + } + + /** + * @return Null when nobody could take it. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("to_host") + public OptionalNullable getToHost() { + if (toHost == null) { + return OptionalNullable.absent(); + } + return toHost; + } + + /** + * @return Why it would stay where it is. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("reason") + public OptionalNullable getReason() { + if (reason == null) { + return OptionalNullable.absent(); + } + return reason; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("series") + private OptionalNullable _getSeries() { + return series; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("group_session") + private OptionalNullable _getGroupSession() { + return groupSession; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("from_host") + private OptionalNullable _getFromHost() { + return fromHost; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("to_host") + private OptionalNullable _getToHost() { + return toHost; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("reason") + private OptionalNullable _getReason() { + return reason; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof SchedulingReassignmentPreviewItemsItem + && equalTo((SchedulingReassignmentPreviewItemsItem) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(SchedulingReassignmentPreviewItemsItem other) { + return booking.equals(other.booking) + && eventType.equals(other.eventType) + && title.equals(other.title) + && status.equals(other.status) + && start.equals(other.start) + && end.equals(other.end) + && series.equals(other.series) + && groupSession.equals(other.groupSession) + && fromHost.equals(other.fromHost) + && toHost.equals(other.toHost) + && reason.equals(other.reason); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.booking, + this.eventType, + this.title, + this.status, + this.start, + this.end, + this.series, + this.groupSession, + this.fromHost, + this.toHost, + this.reason); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static BookingStage builder() { + return new Builder(); + } + + public interface BookingStage { + EventTypeStage booking(@NotNull String booking); + + Builder from(SchedulingReassignmentPreviewItemsItem other); + } + + public interface EventTypeStage { + TitleStage eventType(@NotNull String eventType); + } + + public interface TitleStage { + StatusStage title(@NotNull String title); + } + + public interface StatusStage { + StartStage status(@NotNull SchedulingReassignmentPreviewItemsItemStatus status); + } + + public interface StartStage { + EndStage start(@NotNull String start); + } + + public interface EndStage { + _FinalStage end(@NotNull String end); + } + + public interface _FinalStage { + SchedulingReassignmentPreviewItemsItem build(); + + _FinalStage additionalProperty(String key, Object value); + + _FinalStage additionalProperties(Map additionalProperties); + + _FinalStage series(OptionalNullable series); + + _FinalStage series(String series); + + _FinalStage series(Optional series); + + _FinalStage series(Nullable series); + + _FinalStage groupSession(OptionalNullable groupSession); + + _FinalStage groupSession(String groupSession); + + _FinalStage groupSession(Optional groupSession); + + _FinalStage groupSession(Nullable groupSession); + + _FinalStage fromHost(OptionalNullable fromHost); + + _FinalStage fromHost(String fromHost); + + _FinalStage fromHost(Optional fromHost); + + _FinalStage fromHost(Nullable fromHost); + + /** + *

Null when nobody could take it.

+ */ + _FinalStage toHost(OptionalNullable toHost); + + _FinalStage toHost(String toHost); + + _FinalStage toHost(Optional toHost); + + _FinalStage toHost(Nullable toHost); + + /** + *

Why it would stay where it is.

+ */ + _FinalStage reason(OptionalNullable reason); + + _FinalStage reason(String reason); + + _FinalStage reason(Optional reason); + + _FinalStage reason(Nullable reason); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder + implements BookingStage, EventTypeStage, TitleStage, StatusStage, StartStage, EndStage, _FinalStage { + private String booking; + + private String eventType; + + private String title; + + private SchedulingReassignmentPreviewItemsItemStatus status; + + private String start; + + private String end; + + private OptionalNullable reason = OptionalNullable.absent(); + + private OptionalNullable toHost = OptionalNullable.absent(); + + private OptionalNullable fromHost = OptionalNullable.absent(); + + private OptionalNullable groupSession = OptionalNullable.absent(); + + private OptionalNullable series = OptionalNullable.absent(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(SchedulingReassignmentPreviewItemsItem other) { + booking(other.getBooking()); + eventType(other.getEventType()); + title(other.getTitle()); + status(other.getStatus()); + start(other.getStart()); + end(other.getEnd()); + series(other.getSeries()); + groupSession(other.getGroupSession()); + fromHost(other.getFromHost()); + toHost(other.getToHost()); + reason(other.getReason()); + return this; + } + + @java.lang.Override + @JsonSetter("booking") + public EventTypeStage booking(@NotNull String booking) { + this.booking = Objects.requireNonNull(booking, "booking must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("event_type") + public TitleStage eventType(@NotNull String eventType) { + this.eventType = Objects.requireNonNull(eventType, "eventType must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("title") + public StatusStage title(@NotNull String title) { + this.title = Objects.requireNonNull(title, "title must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("status") + public StartStage status(@NotNull SchedulingReassignmentPreviewItemsItemStatus status) { + this.status = Objects.requireNonNull(status, "status must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("start") + public EndStage start(@NotNull String start) { + this.start = Objects.requireNonNull(start, "start must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("end") + public _FinalStage end(@NotNull String end) { + this.end = Objects.requireNonNull(end, "end must not be null"); + return this; + } + + /** + *

Why it would stay where it is.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage reason(Nullable reason) { + if (reason.isNull()) { + this.reason = OptionalNullable.ofNull(); + } else if (reason.isEmpty()) { + this.reason = OptionalNullable.absent(); + } else { + this.reason = OptionalNullable.of(reason.get()); + } + return this; + } + + /** + *

Why it would stay where it is.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage reason(Optional reason) { + if (reason.isPresent()) { + this.reason = OptionalNullable.of(reason.get()); + } else { + this.reason = OptionalNullable.absent(); + } + return this; + } + + /** + *

Why it would stay where it is.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage reason(String reason) { + this.reason = OptionalNullable.of(reason); + return this; + } + + /** + *

Why it would stay where it is.

+ */ + @java.lang.Override + @JsonSetter(value = "reason", nulls = Nulls.SKIP) + public _FinalStage reason(OptionalNullable reason) { + this.reason = reason; + return this; + } + + /** + *

Null when nobody could take it.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage toHost(Nullable toHost) { + if (toHost.isNull()) { + this.toHost = OptionalNullable.ofNull(); + } else if (toHost.isEmpty()) { + this.toHost = OptionalNullable.absent(); + } else { + this.toHost = OptionalNullable.of(toHost.get()); + } + return this; + } + + /** + *

Null when nobody could take it.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage toHost(Optional toHost) { + if (toHost.isPresent()) { + this.toHost = OptionalNullable.of(toHost.get()); + } else { + this.toHost = OptionalNullable.absent(); + } + return this; + } + + /** + *

Null when nobody could take it.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage toHost(String toHost) { + this.toHost = OptionalNullable.of(toHost); + return this; + } + + /** + *

Null when nobody could take it.

+ */ + @java.lang.Override + @JsonSetter(value = "to_host", nulls = Nulls.SKIP) + public _FinalStage toHost(OptionalNullable toHost) { + this.toHost = toHost; + return this; + } + + @java.lang.Override + public _FinalStage fromHost(Nullable fromHost) { + if (fromHost.isNull()) { + this.fromHost = OptionalNullable.ofNull(); + } else if (fromHost.isEmpty()) { + this.fromHost = OptionalNullable.absent(); + } else { + this.fromHost = OptionalNullable.of(fromHost.get()); + } + return this; + } + + @java.lang.Override + public _FinalStage fromHost(Optional fromHost) { + if (fromHost.isPresent()) { + this.fromHost = OptionalNullable.of(fromHost.get()); + } else { + this.fromHost = OptionalNullable.absent(); + } + return this; + } + + @java.lang.Override + public _FinalStage fromHost(String fromHost) { + this.fromHost = OptionalNullable.of(fromHost); + return this; + } + + @java.lang.Override + @JsonSetter(value = "from_host", nulls = Nulls.SKIP) + public _FinalStage fromHost(OptionalNullable fromHost) { + this.fromHost = fromHost; + return this; + } + + @java.lang.Override + public _FinalStage groupSession(Nullable groupSession) { + if (groupSession.isNull()) { + this.groupSession = OptionalNullable.ofNull(); + } else if (groupSession.isEmpty()) { + this.groupSession = OptionalNullable.absent(); + } else { + this.groupSession = OptionalNullable.of(groupSession.get()); + } + return this; + } + + @java.lang.Override + public _FinalStage groupSession(Optional groupSession) { + if (groupSession.isPresent()) { + this.groupSession = OptionalNullable.of(groupSession.get()); + } else { + this.groupSession = OptionalNullable.absent(); + } + return this; + } + + @java.lang.Override + public _FinalStage groupSession(String groupSession) { + this.groupSession = OptionalNullable.of(groupSession); + return this; + } + + @java.lang.Override + @JsonSetter(value = "group_session", nulls = Nulls.SKIP) + public _FinalStage groupSession(OptionalNullable groupSession) { + this.groupSession = groupSession; + return this; + } + + @java.lang.Override + public _FinalStage series(Nullable series) { + if (series.isNull()) { + this.series = OptionalNullable.ofNull(); + } else if (series.isEmpty()) { + this.series = OptionalNullable.absent(); + } else { + this.series = OptionalNullable.of(series.get()); + } + return this; + } + + @java.lang.Override + public _FinalStage series(Optional series) { + if (series.isPresent()) { + this.series = OptionalNullable.of(series.get()); + } else { + this.series = OptionalNullable.absent(); + } + return this; + } + + @java.lang.Override + public _FinalStage series(String series) { + this.series = OptionalNullable.of(series); + return this; + } + + @java.lang.Override + @JsonSetter(value = "series", nulls = Nulls.SKIP) + public _FinalStage series(OptionalNullable series) { + this.series = series; + return this; + } + + @java.lang.Override + public SchedulingReassignmentPreviewItemsItem build() { + return new SchedulingReassignmentPreviewItemsItem( + booking, + eventType, + title, + status, + start, + end, + series, + groupSession, + fromHost, + toHost, + reason, + additionalProperties); + } + + @java.lang.Override + public Builder additionalProperty(String key, Object value) { + this.additionalProperties.put(key, value); + return this; + } + + @java.lang.Override + public Builder additionalProperties(Map additionalProperties) { + this.additionalProperties.putAll(additionalProperties); + return this; + } + } +} diff --git a/sdks/java/src/main/java/com/coss/types/SchedulingReassignmentPreviewItemsItemStatus.java b/sdks/java/src/main/java/com/coss/types/SchedulingReassignmentPreviewItemsItemStatus.java new file mode 100644 index 000000000..a2e8c9a00 --- /dev/null +++ b/sdks/java/src/main/java/com/coss/types/SchedulingReassignmentPreviewItemsItemStatus.java @@ -0,0 +1,119 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.coss.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class SchedulingReassignmentPreviewItemsItemStatus { + public static final SchedulingReassignmentPreviewItemsItemStatus HELD = + new SchedulingReassignmentPreviewItemsItemStatus(Value.HELD, "held"); + + public static final SchedulingReassignmentPreviewItemsItemStatus DECLINED = + new SchedulingReassignmentPreviewItemsItemStatus(Value.DECLINED, "declined"); + + public static final SchedulingReassignmentPreviewItemsItemStatus CONFIRMED = + new SchedulingReassignmentPreviewItemsItemStatus(Value.CONFIRMED, "confirmed"); + + public static final SchedulingReassignmentPreviewItemsItemStatus CANCELLED = + new SchedulingReassignmentPreviewItemsItemStatus(Value.CANCELLED, "cancelled"); + + public static final SchedulingReassignmentPreviewItemsItemStatus PENDING_APPROVAL = + new SchedulingReassignmentPreviewItemsItemStatus(Value.PENDING_APPROVAL, "pending_approval"); + + private final Value value; + + private final String string; + + SchedulingReassignmentPreviewItemsItemStatus(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof SchedulingReassignmentPreviewItemsItemStatus + && this.string.equals(((SchedulingReassignmentPreviewItemsItemStatus) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case HELD: + return visitor.visitHeld(); + case DECLINED: + return visitor.visitDeclined(); + case CONFIRMED: + return visitor.visitConfirmed(); + case CANCELLED: + return visitor.visitCancelled(); + case PENDING_APPROVAL: + return visitor.visitPendingApproval(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static SchedulingReassignmentPreviewItemsItemStatus valueOf(String value) { + switch (value) { + case "held": + return HELD; + case "declined": + return DECLINED; + case "confirmed": + return CONFIRMED; + case "cancelled": + return CANCELLED; + case "pending_approval": + return PENDING_APPROVAL; + default: + return new SchedulingReassignmentPreviewItemsItemStatus(Value.UNKNOWN, value); + } + } + + public enum Value { + HELD, + + PENDING_APPROVAL, + + CONFIRMED, + + CANCELLED, + + DECLINED, + + UNKNOWN + } + + public interface Visitor { + T visitHeld(); + + T visitPendingApproval(); + + T visitConfirmed(); + + T visitCancelled(); + + T visitDeclined(); + + T visitUnknown(String unknownType); + } +} diff --git a/sdks/java/src/main/java/com/coss/types/SchedulingReassignmentPreviewObject.java b/sdks/java/src/main/java/com/coss/types/SchedulingReassignmentPreviewObject.java new file mode 100644 index 000000000..c5b82c52b --- /dev/null +++ b/sdks/java/src/main/java/com/coss/types/SchedulingReassignmentPreviewObject.java @@ -0,0 +1,76 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.coss.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class SchedulingReassignmentPreviewObject { + public static final SchedulingReassignmentPreviewObject SCHEDULING_REASSIGNMENT_PREVIEW = + new SchedulingReassignmentPreviewObject( + Value.SCHEDULING_REASSIGNMENT_PREVIEW, "scheduling.reassignment_preview"); + + private final Value value; + + private final String string; + + SchedulingReassignmentPreviewObject(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof SchedulingReassignmentPreviewObject + && this.string.equals(((SchedulingReassignmentPreviewObject) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case SCHEDULING_REASSIGNMENT_PREVIEW: + return visitor.visitSchedulingReassignmentPreview(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static SchedulingReassignmentPreviewObject valueOf(String value) { + switch (value) { + case "scheduling.reassignment_preview": + return SCHEDULING_REASSIGNMENT_PREVIEW; + default: + return new SchedulingReassignmentPreviewObject(Value.UNKNOWN, value); + } + } + + public enum Value { + SCHEDULING_REASSIGNMENT_PREVIEW, + + UNKNOWN + } + + public interface Visitor { + T visitSchedulingReassignmentPreview(); + + T visitUnknown(String unknownType); + } +} diff --git a/sdks/java/src/main/java/com/coss/types/SchedulingReassignmentReasonCode.java b/sdks/java/src/main/java/com/coss/types/SchedulingReassignmentReasonCode.java new file mode 100644 index 000000000..b446024e0 --- /dev/null +++ b/sdks/java/src/main/java/com/coss/types/SchedulingReassignmentReasonCode.java @@ -0,0 +1,130 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.coss.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class SchedulingReassignmentReasonCode { + public static final SchedulingReassignmentReasonCode CUSTOMER_REQUEST = + new SchedulingReassignmentReasonCode(Value.CUSTOMER_REQUEST, "customer_request"); + + public static final SchedulingReassignmentReasonCode OTHER = + new SchedulingReassignmentReasonCode(Value.OTHER, "other"); + + public static final SchedulingReassignmentReasonCode OUT_OF_OFFICE = + new SchedulingReassignmentReasonCode(Value.OUT_OF_OFFICE, "out_of_office"); + + public static final SchedulingReassignmentReasonCode OFFBOARDING = + new SchedulingReassignmentReasonCode(Value.OFFBOARDING, "offboarding"); + + public static final SchedulingReassignmentReasonCode HOST_UNAVAILABLE = + new SchedulingReassignmentReasonCode(Value.HOST_UNAVAILABLE, "host_unavailable"); + + public static final SchedulingReassignmentReasonCode WORKLOAD = + new SchedulingReassignmentReasonCode(Value.WORKLOAD, "workload"); + + private final Value value; + + private final String string; + + SchedulingReassignmentReasonCode(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof SchedulingReassignmentReasonCode + && this.string.equals(((SchedulingReassignmentReasonCode) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case CUSTOMER_REQUEST: + return visitor.visitCustomerRequest(); + case OTHER: + return visitor.visitOther(); + case OUT_OF_OFFICE: + return visitor.visitOutOfOffice(); + case OFFBOARDING: + return visitor.visitOffboarding(); + case HOST_UNAVAILABLE: + return visitor.visitHostUnavailable(); + case WORKLOAD: + return visitor.visitWorkload(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static SchedulingReassignmentReasonCode valueOf(String value) { + switch (value) { + case "customer_request": + return CUSTOMER_REQUEST; + case "other": + return OTHER; + case "out_of_office": + return OUT_OF_OFFICE; + case "offboarding": + return OFFBOARDING; + case "host_unavailable": + return HOST_UNAVAILABLE; + case "workload": + return WORKLOAD; + default: + return new SchedulingReassignmentReasonCode(Value.UNKNOWN, value); + } + } + + public enum Value { + HOST_UNAVAILABLE, + + OUT_OF_OFFICE, + + WORKLOAD, + + CUSTOMER_REQUEST, + + OFFBOARDING, + + OTHER, + + UNKNOWN + } + + public interface Visitor { + T visitHostUnavailable(); + + T visitOutOfOffice(); + + T visitWorkload(); + + T visitCustomerRequest(); + + T visitOffboarding(); + + T visitOther(); + + T visitUnknown(String unknownType); + } +} diff --git a/sdks/java/src/main/java/com/coss/types/SchedulingReassignmentSelection.java b/sdks/java/src/main/java/com/coss/types/SchedulingReassignmentSelection.java new file mode 100644 index 000000000..580e312c5 --- /dev/null +++ b/sdks/java/src/main/java/com/coss/types/SchedulingReassignmentSelection.java @@ -0,0 +1,329 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.coss.types; + +import com.coss.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = SchedulingReassignmentSelection.Builder.class) +public final class SchedulingReassignmentSelection { + private final Optional host; + + private final Optional outOfOffice; + + private final Optional> bookingIds; + + private final Optional series; + + private final Optional startAfter; + + private final Optional startBefore; + + private final Optional> eventTypes; + + private final Optional externalConflict; + + private final Map additionalProperties; + + private SchedulingReassignmentSelection( + Optional host, + Optional outOfOffice, + Optional> bookingIds, + Optional series, + Optional startAfter, + Optional startBefore, + Optional> eventTypes, + Optional externalConflict, + Map additionalProperties) { + this.host = host; + this.outOfOffice = outOfOffice; + this.bookingIds = bookingIds; + this.series = series; + this.startAfter = startAfter; + this.startBefore = startBefore; + this.eventTypes = eventTypes; + this.externalConflict = externalConflict; + this.additionalProperties = additionalProperties; + } + + /** + * @return This host's bookings, by id or uid. + */ + @JsonProperty("host") + public Optional getHost() { + return host; + } + + /** + * @return The bookings that fall in this entry. + */ + @JsonProperty("out_of_office") + public Optional getOutOfOffice() { + return outOfOffice; + } + + @JsonProperty("booking_ids") + public Optional> getBookingIds() { + return bookingIds; + } + + /** + * @return A series' occurrences still to come. + */ + @JsonProperty("series") + public Optional getSeries() { + return series; + } + + /** + * @return An ISO 8601 instant with an offset. + */ + @JsonProperty("start_after") + public Optional getStartAfter() { + return startAfter; + } + + /** + * @return An ISO 8601 instant with an offset. + */ + @JsonProperty("start_before") + public Optional getStartBefore() { + return startBefore; + } + + @JsonProperty("event_types") + public Optional> getEventTypes() { + return eventTypes; + } + + /** + * @return Only those with something else on the host's calendar at that time. + */ + @JsonProperty("external_conflict") + public Optional getExternalConflict() { + return externalConflict; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof SchedulingReassignmentSelection && equalTo((SchedulingReassignmentSelection) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(SchedulingReassignmentSelection other) { + return host.equals(other.host) + && outOfOffice.equals(other.outOfOffice) + && bookingIds.equals(other.bookingIds) + && series.equals(other.series) + && startAfter.equals(other.startAfter) + && startBefore.equals(other.startBefore) + && eventTypes.equals(other.eventTypes) + && externalConflict.equals(other.externalConflict); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.host, + this.outOfOffice, + this.bookingIds, + this.series, + this.startAfter, + this.startBefore, + this.eventTypes, + this.externalConflict); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional host = Optional.empty(); + + private Optional outOfOffice = Optional.empty(); + + private Optional> bookingIds = Optional.empty(); + + private Optional series = Optional.empty(); + + private Optional startAfter = Optional.empty(); + + private Optional startBefore = Optional.empty(); + + private Optional> eventTypes = Optional.empty(); + + private Optional externalConflict = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(SchedulingReassignmentSelection other) { + host(other.getHost()); + outOfOffice(other.getOutOfOffice()); + bookingIds(other.getBookingIds()); + series(other.getSeries()); + startAfter(other.getStartAfter()); + startBefore(other.getStartBefore()); + eventTypes(other.getEventTypes()); + externalConflict(other.getExternalConflict()); + return this; + } + + /** + *

This host's bookings, by id or uid.

+ */ + @JsonSetter(value = "host", nulls = Nulls.SKIP) + public Builder host(Optional host) { + this.host = host; + return this; + } + + public Builder host(String host) { + this.host = Optional.ofNullable(host); + return this; + } + + /** + *

The bookings that fall in this entry.

+ */ + @JsonSetter(value = "out_of_office", nulls = Nulls.SKIP) + public Builder outOfOffice(Optional outOfOffice) { + this.outOfOffice = outOfOffice; + return this; + } + + public Builder outOfOffice(String outOfOffice) { + this.outOfOffice = Optional.ofNullable(outOfOffice); + return this; + } + + @JsonSetter(value = "booking_ids", nulls = Nulls.SKIP) + public Builder bookingIds(Optional> bookingIds) { + this.bookingIds = bookingIds; + return this; + } + + public Builder bookingIds(List bookingIds) { + this.bookingIds = Optional.ofNullable(bookingIds); + return this; + } + + /** + *

A series' occurrences still to come.

+ */ + @JsonSetter(value = "series", nulls = Nulls.SKIP) + public Builder series(Optional series) { + this.series = series; + return this; + } + + public Builder series(String series) { + this.series = Optional.ofNullable(series); + return this; + } + + /** + *

An ISO 8601 instant with an offset.

+ */ + @JsonSetter(value = "start_after", nulls = Nulls.SKIP) + public Builder startAfter(Optional startAfter) { + this.startAfter = startAfter; + return this; + } + + public Builder startAfter(String startAfter) { + this.startAfter = Optional.ofNullable(startAfter); + return this; + } + + /** + *

An ISO 8601 instant with an offset.

+ */ + @JsonSetter(value = "start_before", nulls = Nulls.SKIP) + public Builder startBefore(Optional startBefore) { + this.startBefore = startBefore; + return this; + } + + public Builder startBefore(String startBefore) { + this.startBefore = Optional.ofNullable(startBefore); + return this; + } + + @JsonSetter(value = "event_types", nulls = Nulls.SKIP) + public Builder eventTypes(Optional> eventTypes) { + this.eventTypes = eventTypes; + return this; + } + + public Builder eventTypes(List eventTypes) { + this.eventTypes = Optional.ofNullable(eventTypes); + return this; + } + + /** + *

Only those with something else on the host's calendar at that time.

+ */ + @JsonSetter(value = "external_conflict", nulls = Nulls.SKIP) + public Builder externalConflict(Optional externalConflict) { + this.externalConflict = externalConflict; + return this; + } + + public Builder externalConflict(Boolean externalConflict) { + this.externalConflict = Optional.ofNullable(externalConflict); + return this; + } + + public SchedulingReassignmentSelection build() { + return new SchedulingReassignmentSelection( + host, + outOfOffice, + bookingIds, + series, + startAfter, + startBefore, + eventTypes, + externalConflict, + additionalProperties); + } + + public Builder additionalProperty(String key, Object value) { + this.additionalProperties.put(key, value); + return this; + } + + public Builder additionalProperties(Map additionalProperties) { + this.additionalProperties.putAll(additionalProperties); + return this; + } + } +} diff --git a/sdks/java/src/main/java/com/coss/types/SchedulingReassignmentStatus.java b/sdks/java/src/main/java/com/coss/types/SchedulingReassignmentStatus.java new file mode 100644 index 000000000..ab56ac384 --- /dev/null +++ b/sdks/java/src/main/java/com/coss/types/SchedulingReassignmentStatus.java @@ -0,0 +1,108 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.coss.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class SchedulingReassignmentStatus { + public static final SchedulingReassignmentStatus PENDING = + new SchedulingReassignmentStatus(Value.PENDING, "pending"); + + public static final SchedulingReassignmentStatus COMPLETED = + new SchedulingReassignmentStatus(Value.COMPLETED, "completed"); + + public static final SchedulingReassignmentStatus CANCELLED = + new SchedulingReassignmentStatus(Value.CANCELLED, "cancelled"); + + public static final SchedulingReassignmentStatus RUNNING = + new SchedulingReassignmentStatus(Value.RUNNING, "running"); + + private final Value value; + + private final String string; + + SchedulingReassignmentStatus(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof SchedulingReassignmentStatus + && this.string.equals(((SchedulingReassignmentStatus) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case PENDING: + return visitor.visitPending(); + case COMPLETED: + return visitor.visitCompleted(); + case CANCELLED: + return visitor.visitCancelled(); + case RUNNING: + return visitor.visitRunning(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static SchedulingReassignmentStatus valueOf(String value) { + switch (value) { + case "pending": + return PENDING; + case "completed": + return COMPLETED; + case "cancelled": + return CANCELLED; + case "running": + return RUNNING; + default: + return new SchedulingReassignmentStatus(Value.UNKNOWN, value); + } + } + + public enum Value { + PENDING, + + RUNNING, + + COMPLETED, + + CANCELLED, + + UNKNOWN + } + + public interface Visitor { + T visitPending(); + + T visitRunning(); + + T visitCompleted(); + + T visitCancelled(); + + T visitUnknown(String unknownType); + } +} diff --git a/sdks/java/src/main/java/com/coss/types/SchedulingReassignmentStrategy.java b/sdks/java/src/main/java/com/coss/types/SchedulingReassignmentStrategy.java new file mode 100644 index 000000000..89240616d --- /dev/null +++ b/sdks/java/src/main/java/com/coss/types/SchedulingReassignmentStrategy.java @@ -0,0 +1,205 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.coss.types; + +import com.coss.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = SchedulingReassignmentStrategy.Builder.class) +public final class SchedulingReassignmentStrategy { + private final Optional toHost; + + private final Optional> preferredHosts; + + private final Optional otherwise; + + private final Optional> assignments; + + private final Map additionalProperties; + + private SchedulingReassignmentStrategy( + Optional toHost, + Optional> preferredHosts, + Optional otherwise, + Optional> assignments, + Map additionalProperties) { + this.toHost = toHost; + this.preferredHosts = preferredHosts; + this.otherwise = otherwise; + this.assignments = assignments; + this.additionalProperties = additionalProperties; + } + + /** + * @return Give them all to this host. + */ + @JsonProperty("to_host") + public Optional getToHost() { + return toHost; + } + + /** + * @return Try these first, in order. + */ + @JsonProperty("preferred_hosts") + public Optional> getPreferredHosts() { + return preferredHosts; + } + + /** + * @return After preferred_hosts: auto picks the fairest who's free, leave keeps it where it is. + */ + @JsonProperty("otherwise") + public Optional getOtherwise() { + return otherwise; + } + + /** + * @return Who each goes to: a preview, with your changes. + */ + @JsonProperty("assignments") + public Optional> getAssignments() { + return assignments; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof SchedulingReassignmentStrategy && equalTo((SchedulingReassignmentStrategy) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(SchedulingReassignmentStrategy other) { + return toHost.equals(other.toHost) + && preferredHosts.equals(other.preferredHosts) + && otherwise.equals(other.otherwise) + && assignments.equals(other.assignments); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.toHost, this.preferredHosts, this.otherwise, this.assignments); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional toHost = Optional.empty(); + + private Optional> preferredHosts = Optional.empty(); + + private Optional otherwise = Optional.empty(); + + private Optional> assignments = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(SchedulingReassignmentStrategy other) { + toHost(other.getToHost()); + preferredHosts(other.getPreferredHosts()); + otherwise(other.getOtherwise()); + assignments(other.getAssignments()); + return this; + } + + /** + *

Give them all to this host.

+ */ + @JsonSetter(value = "to_host", nulls = Nulls.SKIP) + public Builder toHost(Optional toHost) { + this.toHost = toHost; + return this; + } + + public Builder toHost(String toHost) { + this.toHost = Optional.ofNullable(toHost); + return this; + } + + /** + *

Try these first, in order.

+ */ + @JsonSetter(value = "preferred_hosts", nulls = Nulls.SKIP) + public Builder preferredHosts(Optional> preferredHosts) { + this.preferredHosts = preferredHosts; + return this; + } + + public Builder preferredHosts(List preferredHosts) { + this.preferredHosts = Optional.ofNullable(preferredHosts); + return this; + } + + /** + *

After preferred_hosts: auto picks the fairest who's free, leave keeps it where it is.

+ */ + @JsonSetter(value = "otherwise", nulls = Nulls.SKIP) + public Builder otherwise(Optional otherwise) { + this.otherwise = otherwise; + return this; + } + + public Builder otherwise(SchedulingReassignmentStrategyOtherwise otherwise) { + this.otherwise = Optional.ofNullable(otherwise); + return this; + } + + /** + *

Who each goes to: a preview, with your changes.

+ */ + @JsonSetter(value = "assignments", nulls = Nulls.SKIP) + public Builder assignments(Optional> assignments) { + this.assignments = assignments; + return this; + } + + public Builder assignments(List assignments) { + this.assignments = Optional.ofNullable(assignments); + return this; + } + + public SchedulingReassignmentStrategy build() { + return new SchedulingReassignmentStrategy( + toHost, preferredHosts, otherwise, assignments, additionalProperties); + } + + public Builder additionalProperty(String key, Object value) { + this.additionalProperties.put(key, value); + return this; + } + + public Builder additionalProperties(Map additionalProperties) { + this.additionalProperties.putAll(additionalProperties); + return this; + } + } +} diff --git a/sdks/java/src/main/java/com/coss/types/SchedulingReassignmentStrategyAssignmentsItem.java b/sdks/java/src/main/java/com/coss/types/SchedulingReassignmentStrategyAssignmentsItem.java new file mode 100644 index 000000000..b0e06bc19 --- /dev/null +++ b/sdks/java/src/main/java/com/coss/types/SchedulingReassignmentStrategyAssignmentsItem.java @@ -0,0 +1,172 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.coss.types; + +import com.coss.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = SchedulingReassignmentStrategyAssignmentsItem.Builder.class) +public final class SchedulingReassignmentStrategyAssignmentsItem { + private final String booking; + + private final String toHost; + + private final Optional fromHost; + + private final Map additionalProperties; + + private SchedulingReassignmentStrategyAssignmentsItem( + String booking, String toHost, Optional fromHost, Map additionalProperties) { + this.booking = booking; + this.toHost = toHost; + this.fromHost = fromHost; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("booking") + public String getBooking() { + return booking; + } + + @JsonProperty("to_host") + public String getToHost() { + return toHost; + } + + @JsonProperty("from_host") + public Optional getFromHost() { + return fromHost; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof SchedulingReassignmentStrategyAssignmentsItem + && equalTo((SchedulingReassignmentStrategyAssignmentsItem) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(SchedulingReassignmentStrategyAssignmentsItem other) { + return booking.equals(other.booking) && toHost.equals(other.toHost) && fromHost.equals(other.fromHost); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.booking, this.toHost, this.fromHost); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static BookingStage builder() { + return new Builder(); + } + + public interface BookingStage { + ToHostStage booking(@NotNull String booking); + + Builder from(SchedulingReassignmentStrategyAssignmentsItem other); + } + + public interface ToHostStage { + _FinalStage toHost(@NotNull String toHost); + } + + public interface _FinalStage { + SchedulingReassignmentStrategyAssignmentsItem build(); + + _FinalStage additionalProperty(String key, Object value); + + _FinalStage additionalProperties(Map additionalProperties); + + _FinalStage fromHost(Optional fromHost); + + _FinalStage fromHost(String fromHost); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements BookingStage, ToHostStage, _FinalStage { + private String booking; + + private String toHost; + + private Optional fromHost = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(SchedulingReassignmentStrategyAssignmentsItem other) { + booking(other.getBooking()); + toHost(other.getToHost()); + fromHost(other.getFromHost()); + return this; + } + + @java.lang.Override + @JsonSetter("booking") + public ToHostStage booking(@NotNull String booking) { + this.booking = Objects.requireNonNull(booking, "booking must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("to_host") + public _FinalStage toHost(@NotNull String toHost) { + this.toHost = Objects.requireNonNull(toHost, "toHost must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage fromHost(String fromHost) { + this.fromHost = Optional.ofNullable(fromHost); + return this; + } + + @java.lang.Override + @JsonSetter(value = "from_host", nulls = Nulls.SKIP) + public _FinalStage fromHost(Optional fromHost) { + this.fromHost = fromHost; + return this; + } + + @java.lang.Override + public SchedulingReassignmentStrategyAssignmentsItem build() { + return new SchedulingReassignmentStrategyAssignmentsItem(booking, toHost, fromHost, additionalProperties); + } + + @java.lang.Override + public Builder additionalProperty(String key, Object value) { + this.additionalProperties.put(key, value); + return this; + } + + @java.lang.Override + public Builder additionalProperties(Map additionalProperties) { + this.additionalProperties.putAll(additionalProperties); + return this; + } + } +} diff --git a/sdks/java/src/main/java/com/coss/types/SchedulingReassignmentStrategyOtherwise.java b/sdks/java/src/main/java/com/coss/types/SchedulingReassignmentStrategyOtherwise.java new file mode 100644 index 000000000..1d311d5f6 --- /dev/null +++ b/sdks/java/src/main/java/com/coss/types/SchedulingReassignmentStrategyOtherwise.java @@ -0,0 +1,86 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.coss.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class SchedulingReassignmentStrategyOtherwise { + public static final SchedulingReassignmentStrategyOtherwise AUTO = + new SchedulingReassignmentStrategyOtherwise(Value.AUTO, "auto"); + + public static final SchedulingReassignmentStrategyOtherwise LEAVE = + new SchedulingReassignmentStrategyOtherwise(Value.LEAVE, "leave"); + + private final Value value; + + private final String string; + + SchedulingReassignmentStrategyOtherwise(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof SchedulingReassignmentStrategyOtherwise + && this.string.equals(((SchedulingReassignmentStrategyOtherwise) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case AUTO: + return visitor.visitAuto(); + case LEAVE: + return visitor.visitLeave(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static SchedulingReassignmentStrategyOtherwise valueOf(String value) { + switch (value) { + case "auto": + return AUTO; + case "leave": + return LEAVE; + default: + return new SchedulingReassignmentStrategyOtherwise(Value.UNKNOWN, value); + } + } + + public enum Value { + AUTO, + + LEAVE, + + UNKNOWN + } + + public interface Visitor { + T visitAuto(); + + T visitLeave(); + + T visitUnknown(String unknownType); + } +} diff --git a/sdks/java/src/main/java/com/coss/types/SchedulingReassignmentWebhookEvent.java b/sdks/java/src/main/java/com/coss/types/SchedulingReassignmentWebhookEvent.java new file mode 100644 index 000000000..73d0621de --- /dev/null +++ b/sdks/java/src/main/java/com/coss/types/SchedulingReassignmentWebhookEvent.java @@ -0,0 +1,274 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.coss.types; + +import com.coss.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = SchedulingReassignmentWebhookEvent.Builder.class) +public final class SchedulingReassignmentWebhookEvent { + private final String id; + + private final SchedulingReassignmentWebhookEventObject object; + + private final String apiVersion; + + private final OffsetDateTime createdAt; + + private final SchedulingReassignmentWebhookEventType type; + + private final SchedulingReassignmentWebhookEventData data; + + private final Map additionalProperties; + + private SchedulingReassignmentWebhookEvent( + String id, + SchedulingReassignmentWebhookEventObject object, + String apiVersion, + OffsetDateTime createdAt, + SchedulingReassignmentWebhookEventType type, + SchedulingReassignmentWebhookEventData data, + Map additionalProperties) { + this.id = id; + this.object = object; + this.apiVersion = apiVersion; + this.createdAt = createdAt; + this.type = type; + this.data = data; + this.additionalProperties = additionalProperties; + } + + /** + * @return The event id. + */ + @JsonProperty("id") + public String getId() { + return id; + } + + @JsonProperty("object") + public SchedulingReassignmentWebhookEventObject getObject() { + return object; + } + + /** + * @return The API version this payload is rendered in: the endpoint's. + */ + @JsonProperty("api_version") + public String getApiVersion() { + return apiVersion; + } + + /** + * @return When the event was created. + */ + @JsonProperty("created_at") + public OffsetDateTime getCreatedAt() { + return createdAt; + } + + @JsonProperty("type") + public SchedulingReassignmentWebhookEventType getType() { + return type; + } + + @JsonProperty("data") + public SchedulingReassignmentWebhookEventData getData() { + return data; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof SchedulingReassignmentWebhookEvent + && equalTo((SchedulingReassignmentWebhookEvent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(SchedulingReassignmentWebhookEvent other) { + return id.equals(other.id) + && object.equals(other.object) + && apiVersion.equals(other.apiVersion) + && createdAt.equals(other.createdAt) + && type.equals(other.type) + && data.equals(other.data); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.id, this.object, this.apiVersion, this.createdAt, this.type, this.data); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static IdStage builder() { + return new Builder(); + } + + public interface IdStage { + /** + *

The event id.

+ */ + ObjectStage id(@NotNull String id); + + Builder from(SchedulingReassignmentWebhookEvent other); + } + + public interface ObjectStage { + ApiVersionStage object(@NotNull SchedulingReassignmentWebhookEventObject object); + } + + public interface ApiVersionStage { + /** + *

The API version this payload is rendered in: the endpoint's.

+ */ + CreatedAtStage apiVersion(@NotNull String apiVersion); + } + + public interface CreatedAtStage { + /** + *

When the event was created.

+ */ + TypeStage createdAt(@NotNull OffsetDateTime createdAt); + } + + public interface TypeStage { + DataStage type(@NotNull SchedulingReassignmentWebhookEventType type); + } + + public interface DataStage { + _FinalStage data(@NotNull SchedulingReassignmentWebhookEventData data); + } + + public interface _FinalStage { + SchedulingReassignmentWebhookEvent build(); + + _FinalStage additionalProperty(String key, Object value); + + _FinalStage additionalProperties(Map additionalProperties); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder + implements IdStage, ObjectStage, ApiVersionStage, CreatedAtStage, TypeStage, DataStage, _FinalStage { + private String id; + + private SchedulingReassignmentWebhookEventObject object; + + private String apiVersion; + + private OffsetDateTime createdAt; + + private SchedulingReassignmentWebhookEventType type; + + private SchedulingReassignmentWebhookEventData data; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(SchedulingReassignmentWebhookEvent other) { + id(other.getId()); + object(other.getObject()); + apiVersion(other.getApiVersion()); + createdAt(other.getCreatedAt()); + type(other.getType()); + data(other.getData()); + return this; + } + + /** + *

The event id.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("id") + public ObjectStage id(@NotNull String id) { + this.id = Objects.requireNonNull(id, "id must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("object") + public ApiVersionStage object(@NotNull SchedulingReassignmentWebhookEventObject object) { + this.object = Objects.requireNonNull(object, "object must not be null"); + return this; + } + + /** + *

The API version this payload is rendered in: the endpoint's.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("api_version") + public CreatedAtStage apiVersion(@NotNull String apiVersion) { + this.apiVersion = Objects.requireNonNull(apiVersion, "apiVersion must not be null"); + return this; + } + + /** + *

When the event was created.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("created_at") + public TypeStage createdAt(@NotNull OffsetDateTime createdAt) { + this.createdAt = Objects.requireNonNull(createdAt, "createdAt must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("type") + public DataStage type(@NotNull SchedulingReassignmentWebhookEventType type) { + this.type = Objects.requireNonNull(type, "type must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("data") + public _FinalStage data(@NotNull SchedulingReassignmentWebhookEventData data) { + this.data = Objects.requireNonNull(data, "data must not be null"); + return this; + } + + @java.lang.Override + public SchedulingReassignmentWebhookEvent build() { + return new SchedulingReassignmentWebhookEvent( + id, object, apiVersion, createdAt, type, data, additionalProperties); + } + + @java.lang.Override + public Builder additionalProperty(String key, Object value) { + this.additionalProperties.put(key, value); + return this; + } + + @java.lang.Override + public Builder additionalProperties(Map additionalProperties) { + this.additionalProperties.putAll(additionalProperties); + return this; + } + } +} diff --git a/sdks/java/src/main/java/com/coss/types/SchedulingReassignmentWebhookEventData.java b/sdks/java/src/main/java/com/coss/types/SchedulingReassignmentWebhookEventData.java new file mode 100644 index 000000000..691ca5607 --- /dev/null +++ b/sdks/java/src/main/java/com/coss/types/SchedulingReassignmentWebhookEventData.java @@ -0,0 +1,266 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.coss.types; + +import com.coss.core.Nullable; +import com.coss.core.NullableNonemptyFilter; +import com.coss.core.ObjectMappers; +import com.coss.core.OptionalNullable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = SchedulingReassignmentWebhookEventData.Builder.class) +public final class SchedulingReassignmentWebhookEventData { + private final String reassignmentId; + + private final SchedulingReassignmentWebhookEventDataStatus status; + + private final OptionalNullable outOfOfficeId; + + private final SchedulingReassignmentWebhookEventDataCounts counts; + + private final String occurredAt; + + private final Map additionalProperties; + + private SchedulingReassignmentWebhookEventData( + String reassignmentId, + SchedulingReassignmentWebhookEventDataStatus status, + OptionalNullable outOfOfficeId, + SchedulingReassignmentWebhookEventDataCounts counts, + String occurredAt, + Map additionalProperties) { + this.reassignmentId = reassignmentId; + this.status = status; + this.outOfOfficeId = outOfOfficeId; + this.counts = counts; + this.occurredAt = occurredAt; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("reassignment_id") + public String getReassignmentId() { + return reassignmentId; + } + + @JsonProperty("status") + public SchedulingReassignmentWebhookEventDataStatus getStatus() { + return status; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("out_of_office_id") + public OptionalNullable getOutOfOfficeId() { + if (outOfOfficeId == null) { + return OptionalNullable.absent(); + } + return outOfOfficeId; + } + + @JsonProperty("counts") + public SchedulingReassignmentWebhookEventDataCounts getCounts() { + return counts; + } + + @JsonProperty("occurred_at") + public String getOccurredAt() { + return occurredAt; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("out_of_office_id") + private OptionalNullable _getOutOfOfficeId() { + return outOfOfficeId; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof SchedulingReassignmentWebhookEventData + && equalTo((SchedulingReassignmentWebhookEventData) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(SchedulingReassignmentWebhookEventData other) { + return reassignmentId.equals(other.reassignmentId) + && status.equals(other.status) + && outOfOfficeId.equals(other.outOfOfficeId) + && counts.equals(other.counts) + && occurredAt.equals(other.occurredAt); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.reassignmentId, this.status, this.outOfOfficeId, this.counts, this.occurredAt); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ReassignmentIdStage builder() { + return new Builder(); + } + + public interface ReassignmentIdStage { + StatusStage reassignmentId(@NotNull String reassignmentId); + + Builder from(SchedulingReassignmentWebhookEventData other); + } + + public interface StatusStage { + CountsStage status(@NotNull SchedulingReassignmentWebhookEventDataStatus status); + } + + public interface CountsStage { + OccurredAtStage counts(@NotNull SchedulingReassignmentWebhookEventDataCounts counts); + } + + public interface OccurredAtStage { + _FinalStage occurredAt(@NotNull String occurredAt); + } + + public interface _FinalStage { + SchedulingReassignmentWebhookEventData build(); + + _FinalStage additionalProperty(String key, Object value); + + _FinalStage additionalProperties(Map additionalProperties); + + _FinalStage outOfOfficeId(OptionalNullable outOfOfficeId); + + _FinalStage outOfOfficeId(String outOfOfficeId); + + _FinalStage outOfOfficeId(Optional outOfOfficeId); + + _FinalStage outOfOfficeId(Nullable outOfOfficeId); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder + implements ReassignmentIdStage, StatusStage, CountsStage, OccurredAtStage, _FinalStage { + private String reassignmentId; + + private SchedulingReassignmentWebhookEventDataStatus status; + + private SchedulingReassignmentWebhookEventDataCounts counts; + + private String occurredAt; + + private OptionalNullable outOfOfficeId = OptionalNullable.absent(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(SchedulingReassignmentWebhookEventData other) { + reassignmentId(other.getReassignmentId()); + status(other.getStatus()); + outOfOfficeId(other.getOutOfOfficeId()); + counts(other.getCounts()); + occurredAt(other.getOccurredAt()); + return this; + } + + @java.lang.Override + @JsonSetter("reassignment_id") + public StatusStage reassignmentId(@NotNull String reassignmentId) { + this.reassignmentId = Objects.requireNonNull(reassignmentId, "reassignmentId must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("status") + public CountsStage status(@NotNull SchedulingReassignmentWebhookEventDataStatus status) { + this.status = Objects.requireNonNull(status, "status must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("counts") + public OccurredAtStage counts(@NotNull SchedulingReassignmentWebhookEventDataCounts counts) { + this.counts = Objects.requireNonNull(counts, "counts must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("occurred_at") + public _FinalStage occurredAt(@NotNull String occurredAt) { + this.occurredAt = Objects.requireNonNull(occurredAt, "occurredAt must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage outOfOfficeId(Nullable outOfOfficeId) { + if (outOfOfficeId.isNull()) { + this.outOfOfficeId = OptionalNullable.ofNull(); + } else if (outOfOfficeId.isEmpty()) { + this.outOfOfficeId = OptionalNullable.absent(); + } else { + this.outOfOfficeId = OptionalNullable.of(outOfOfficeId.get()); + } + return this; + } + + @java.lang.Override + public _FinalStage outOfOfficeId(Optional outOfOfficeId) { + if (outOfOfficeId.isPresent()) { + this.outOfOfficeId = OptionalNullable.of(outOfOfficeId.get()); + } else { + this.outOfOfficeId = OptionalNullable.absent(); + } + return this; + } + + @java.lang.Override + public _FinalStage outOfOfficeId(String outOfOfficeId) { + this.outOfOfficeId = OptionalNullable.of(outOfOfficeId); + return this; + } + + @java.lang.Override + @JsonSetter(value = "out_of_office_id", nulls = Nulls.SKIP) + public _FinalStage outOfOfficeId(OptionalNullable outOfOfficeId) { + this.outOfOfficeId = outOfOfficeId; + return this; + } + + @java.lang.Override + public SchedulingReassignmentWebhookEventData build() { + return new SchedulingReassignmentWebhookEventData( + reassignmentId, status, outOfOfficeId, counts, occurredAt, additionalProperties); + } + + @java.lang.Override + public Builder additionalProperty(String key, Object value) { + this.additionalProperties.put(key, value); + return this; + } + + @java.lang.Override + public Builder additionalProperties(Map additionalProperties) { + this.additionalProperties.putAll(additionalProperties); + return this; + } + } +} diff --git a/sdks/java/src/main/java/com/coss/types/SchedulingReassignmentWebhookEventDataCounts.java b/sdks/java/src/main/java/com/coss/types/SchedulingReassignmentWebhookEventDataCounts.java new file mode 100644 index 000000000..9d0617c2a --- /dev/null +++ b/sdks/java/src/main/java/com/coss/types/SchedulingReassignmentWebhookEventDataCounts.java @@ -0,0 +1,294 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.coss.types; + +import com.coss.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = SchedulingReassignmentWebhookEventDataCounts.Builder.class) +public final class SchedulingReassignmentWebhookEventDataCounts { + private final double total; + + private final double pending; + + private final double reassigned; + + private final double skipped; + + private final double noCandidate; + + private final double failed; + + private final double cancelled; + + private final Map additionalProperties; + + private SchedulingReassignmentWebhookEventDataCounts( + double total, + double pending, + double reassigned, + double skipped, + double noCandidate, + double failed, + double cancelled, + Map additionalProperties) { + this.total = total; + this.pending = pending; + this.reassigned = reassigned; + this.skipped = skipped; + this.noCandidate = noCandidate; + this.failed = failed; + this.cancelled = cancelled; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("total") + public double getTotal() { + return total; + } + + @JsonProperty("pending") + public double getPending() { + return pending; + } + + @JsonProperty("reassigned") + public double getReassigned() { + return reassigned; + } + + /** + * @return They'd moved on since it was selected. + */ + @JsonProperty("skipped") + public double getSkipped() { + return skipped; + } + + /** + * @return Nobody could take them: they stayed. + */ + @JsonProperty("no_candidate") + public double getNoCandidate() { + return noCandidate; + } + + @JsonProperty("failed") + public double getFailed() { + return failed; + } + + @JsonProperty("cancelled") + public double getCancelled() { + return cancelled; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof SchedulingReassignmentWebhookEventDataCounts + && equalTo((SchedulingReassignmentWebhookEventDataCounts) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(SchedulingReassignmentWebhookEventDataCounts other) { + return total == other.total + && pending == other.pending + && reassigned == other.reassigned + && skipped == other.skipped + && noCandidate == other.noCandidate + && failed == other.failed + && cancelled == other.cancelled; + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.total, this.pending, this.reassigned, this.skipped, this.noCandidate, this.failed, this.cancelled); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static TotalStage builder() { + return new Builder(); + } + + public interface TotalStage { + PendingStage total(double total); + + Builder from(SchedulingReassignmentWebhookEventDataCounts other); + } + + public interface PendingStage { + ReassignedStage pending(double pending); + } + + public interface ReassignedStage { + SkippedStage reassigned(double reassigned); + } + + public interface SkippedStage { + /** + *

They'd moved on since it was selected.

+ */ + NoCandidateStage skipped(double skipped); + } + + public interface NoCandidateStage { + /** + *

Nobody could take them: they stayed.

+ */ + FailedStage noCandidate(double noCandidate); + } + + public interface FailedStage { + CancelledStage failed(double failed); + } + + public interface CancelledStage { + _FinalStage cancelled(double cancelled); + } + + public interface _FinalStage { + SchedulingReassignmentWebhookEventDataCounts build(); + + _FinalStage additionalProperty(String key, Object value); + + _FinalStage additionalProperties(Map additionalProperties); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder + implements TotalStage, + PendingStage, + ReassignedStage, + SkippedStage, + NoCandidateStage, + FailedStage, + CancelledStage, + _FinalStage { + private double total; + + private double pending; + + private double reassigned; + + private double skipped; + + private double noCandidate; + + private double failed; + + private double cancelled; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(SchedulingReassignmentWebhookEventDataCounts other) { + total(other.getTotal()); + pending(other.getPending()); + reassigned(other.getReassigned()); + skipped(other.getSkipped()); + noCandidate(other.getNoCandidate()); + failed(other.getFailed()); + cancelled(other.getCancelled()); + return this; + } + + @java.lang.Override + @JsonSetter("total") + public PendingStage total(double total) { + this.total = total; + return this; + } + + @java.lang.Override + @JsonSetter("pending") + public ReassignedStage pending(double pending) { + this.pending = pending; + return this; + } + + @java.lang.Override + @JsonSetter("reassigned") + public SkippedStage reassigned(double reassigned) { + this.reassigned = reassigned; + return this; + } + + /** + *

They'd moved on since it was selected.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("skipped") + public NoCandidateStage skipped(double skipped) { + this.skipped = skipped; + return this; + } + + /** + *

Nobody could take them: they stayed.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("no_candidate") + public FailedStage noCandidate(double noCandidate) { + this.noCandidate = noCandidate; + return this; + } + + @java.lang.Override + @JsonSetter("failed") + public CancelledStage failed(double failed) { + this.failed = failed; + return this; + } + + @java.lang.Override + @JsonSetter("cancelled") + public _FinalStage cancelled(double cancelled) { + this.cancelled = cancelled; + return this; + } + + @java.lang.Override + public SchedulingReassignmentWebhookEventDataCounts build() { + return new SchedulingReassignmentWebhookEventDataCounts( + total, pending, reassigned, skipped, noCandidate, failed, cancelled, additionalProperties); + } + + @java.lang.Override + public Builder additionalProperty(String key, Object value) { + this.additionalProperties.put(key, value); + return this; + } + + @java.lang.Override + public Builder additionalProperties(Map additionalProperties) { + this.additionalProperties.putAll(additionalProperties); + return this; + } + } +} diff --git a/sdks/java/src/main/java/com/coss/types/SchedulingReassignmentWebhookEventDataStatus.java b/sdks/java/src/main/java/com/coss/types/SchedulingReassignmentWebhookEventDataStatus.java new file mode 100644 index 000000000..713bd670f --- /dev/null +++ b/sdks/java/src/main/java/com/coss/types/SchedulingReassignmentWebhookEventDataStatus.java @@ -0,0 +1,86 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.coss.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class SchedulingReassignmentWebhookEventDataStatus { + public static final SchedulingReassignmentWebhookEventDataStatus COMPLETED = + new SchedulingReassignmentWebhookEventDataStatus(Value.COMPLETED, "completed"); + + public static final SchedulingReassignmentWebhookEventDataStatus CANCELLED = + new SchedulingReassignmentWebhookEventDataStatus(Value.CANCELLED, "cancelled"); + + private final Value value; + + private final String string; + + SchedulingReassignmentWebhookEventDataStatus(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof SchedulingReassignmentWebhookEventDataStatus + && this.string.equals(((SchedulingReassignmentWebhookEventDataStatus) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case COMPLETED: + return visitor.visitCompleted(); + case CANCELLED: + return visitor.visitCancelled(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static SchedulingReassignmentWebhookEventDataStatus valueOf(String value) { + switch (value) { + case "completed": + return COMPLETED; + case "cancelled": + return CANCELLED; + default: + return new SchedulingReassignmentWebhookEventDataStatus(Value.UNKNOWN, value); + } + } + + public enum Value { + COMPLETED, + + CANCELLED, + + UNKNOWN + } + + public interface Visitor { + T visitCompleted(); + + T visitCancelled(); + + T visitUnknown(String unknownType); + } +} diff --git a/sdks/java/src/main/java/com/coss/types/SchedulingReassignmentWebhookEventObject.java b/sdks/java/src/main/java/com/coss/types/SchedulingReassignmentWebhookEventObject.java new file mode 100644 index 000000000..b453c7653 --- /dev/null +++ b/sdks/java/src/main/java/com/coss/types/SchedulingReassignmentWebhookEventObject.java @@ -0,0 +1,75 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.coss.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class SchedulingReassignmentWebhookEventObject { + public static final SchedulingReassignmentWebhookEventObject EVENT = + new SchedulingReassignmentWebhookEventObject(Value.EVENT, "event"); + + private final Value value; + + private final String string; + + SchedulingReassignmentWebhookEventObject(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof SchedulingReassignmentWebhookEventObject + && this.string.equals(((SchedulingReassignmentWebhookEventObject) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case EVENT: + return visitor.visitEvent(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static SchedulingReassignmentWebhookEventObject valueOf(String value) { + switch (value) { + case "event": + return EVENT; + default: + return new SchedulingReassignmentWebhookEventObject(Value.UNKNOWN, value); + } + } + + public enum Value { + EVENT, + + UNKNOWN + } + + public interface Visitor { + T visitEvent(); + + T visitUnknown(String unknownType); + } +} diff --git a/sdks/java/src/main/java/com/coss/types/SchedulingReassignmentWebhookEventType.java b/sdks/java/src/main/java/com/coss/types/SchedulingReassignmentWebhookEventType.java new file mode 100644 index 000000000..dbebcdb2a --- /dev/null +++ b/sdks/java/src/main/java/com/coss/types/SchedulingReassignmentWebhookEventType.java @@ -0,0 +1,76 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.coss.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class SchedulingReassignmentWebhookEventType { + public static final SchedulingReassignmentWebhookEventType SCHEDULING_REASSIGNMENT_COMPLETED = + new SchedulingReassignmentWebhookEventType( + Value.SCHEDULING_REASSIGNMENT_COMPLETED, "scheduling.reassignment.completed"); + + private final Value value; + + private final String string; + + SchedulingReassignmentWebhookEventType(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof SchedulingReassignmentWebhookEventType + && this.string.equals(((SchedulingReassignmentWebhookEventType) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case SCHEDULING_REASSIGNMENT_COMPLETED: + return visitor.visitSchedulingReassignmentCompleted(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static SchedulingReassignmentWebhookEventType valueOf(String value) { + switch (value) { + case "scheduling.reassignment.completed": + return SCHEDULING_REASSIGNMENT_COMPLETED; + default: + return new SchedulingReassignmentWebhookEventType(Value.UNKNOWN, value); + } + } + + public enum Value { + SCHEDULING_REASSIGNMENT_COMPLETED, + + UNKNOWN + } + + public interface Visitor { + T visitSchedulingReassignmentCompleted(); + + T visitUnknown(String unknownType); + } +} diff --git a/sdks/java/src/main/java/com/coss/types/SchedulingSettings.java b/sdks/java/src/main/java/com/coss/types/SchedulingSettings.java index 458c60791..4a38ce972 100644 --- a/sdks/java/src/main/java/com/coss/types/SchedulingSettings.java +++ b/sdks/java/src/main/java/com/coss/types/SchedulingSettings.java @@ -36,10 +36,18 @@ public final class SchedulingSettings { private final OptionalNullable logo; + private final OptionalNullable privacyUrl; + private final OptionalNullable emailFrom; private final OptionalNullable smsFrom; + private final boolean nameHostInAttendeeEmails; + + private final SchedulingSettingsHostReassignment hostReassignment; + + private final List outOfOfficeReasons; + private final SchedulingSettingsCalendarFailureMode calendarFailureMode; private final OptionalNullable>> notifications; @@ -56,8 +64,12 @@ private SchedulingSettings( OptionalNullable brandName, OptionalNullable accentColor, OptionalNullable logo, + OptionalNullable privacyUrl, OptionalNullable emailFrom, OptionalNullable smsFrom, + boolean nameHostInAttendeeEmails, + SchedulingSettingsHostReassignment hostReassignment, + List outOfOfficeReasons, SchedulingSettingsCalendarFailureMode calendarFailureMode, OptionalNullable>> notifications, OptionalNullable emailReplyTo, @@ -68,8 +80,12 @@ private SchedulingSettings( this.brandName = brandName; this.accentColor = accentColor; this.logo = logo; + this.privacyUrl = privacyUrl; this.emailFrom = emailFrom; this.smsFrom = smsFrom; + this.nameHostInAttendeeEmails = nameHostInAttendeeEmails; + this.hostReassignment = hostReassignment; + this.outOfOfficeReasons = outOfOfficeReasons; this.calendarFailureMode = calendarFailureMode; this.notifications = notifications; this.emailReplyTo = emailReplyTo; @@ -126,6 +142,18 @@ public OptionalNullable getLogo() { return logo; } + /** + * @return Your privacy policy, linked on a host's page beside what connecting a calendar does, once this environment has its own OAuth app and a brand_name. + */ + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("privacy_url") + public OptionalNullable getPrivacyUrl() { + if (privacyUrl == null) { + return OptionalNullable.absent(); + } + return privacyUrl; + } + /** * @return Sender of booking emails, on a verified domain. */ @@ -150,6 +178,30 @@ public OptionalNullable getSmsFrom() { return smsFrom; } + /** + * @return Name the new host when telling an attendee their booking has one. + */ + @JsonProperty("name_host_in_attendee_emails") + public boolean getNameHostInAttendeeEmails() { + return nameHostInAttendeeEmails; + } + + /** + * @return Whether hosts can give their own bookings to someone else from their page. eligible lets them, to anyone free who takes that event type. + */ + @JsonProperty("host_reassignment") + public SchedulingSettingsHostReassignment getHostReassignment() { + return hostReassignment; + } + + /** + * @return Reasons of your own for time away, on top of the preset ones. + */ + @JsonProperty("out_of_office_reasons") + public List getOutOfOfficeReasons() { + return outOfOfficeReasons; + } + /** * @return When a host's calendar can't be read: hide stops offering them, last_known keeps offering their last known times. */ @@ -209,6 +261,12 @@ private OptionalNullable _getLogo() { return logo; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("privacy_url") + private OptionalNullable _getPrivacyUrl() { + return privacyUrl; + } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) @JsonProperty("email_from") private OptionalNullable _getEmailFrom() { @@ -256,8 +314,12 @@ private boolean equalTo(SchedulingSettings other) { && brandName.equals(other.brandName) && accentColor.equals(other.accentColor) && logo.equals(other.logo) + && privacyUrl.equals(other.privacyUrl) && emailFrom.equals(other.emailFrom) && smsFrom.equals(other.smsFrom) + && nameHostInAttendeeEmails == other.nameHostInAttendeeEmails + && hostReassignment.equals(other.hostReassignment) + && outOfOfficeReasons.equals(other.outOfOfficeReasons) && calendarFailureMode.equals(other.calendarFailureMode) && notifications.equals(other.notifications) && emailReplyTo.equals(other.emailReplyTo) @@ -272,8 +334,12 @@ public int hashCode() { this.brandName, this.accentColor, this.logo, + this.privacyUrl, this.emailFrom, this.smsFrom, + this.nameHostInAttendeeEmails, + this.hostReassignment, + this.outOfOfficeReasons, this.calendarFailureMode, this.notifications, this.emailReplyTo, @@ -290,11 +356,25 @@ public static ObjectStage builder() { } public interface ObjectStage { - CalendarFailureModeStage object(@NotNull SchedulingSettingsObject object); + NameHostInAttendeeEmailsStage object(@NotNull SchedulingSettingsObject object); Builder from(SchedulingSettings other); } + public interface NameHostInAttendeeEmailsStage { + /** + *

Name the new host when telling an attendee their booking has one.

+ */ + HostReassignmentStage nameHostInAttendeeEmails(boolean nameHostInAttendeeEmails); + } + + public interface HostReassignmentStage { + /** + *

Whether hosts can give their own bookings to someone else from their page. eligible lets them, to anyone free who takes that event type.

+ */ + CalendarFailureModeStage hostReassignment(@NotNull SchedulingSettingsHostReassignment hostReassignment); + } + public interface CalendarFailureModeStage { /** *

When a host's calendar can't be read: hide stops offering them, last_known keeps offering their last known times.

@@ -351,6 +431,17 @@ public interface _FinalStage { _FinalStage logo(Nullable logo); + /** + *

Your privacy policy, linked on a host's page beside what connecting a calendar does, once this environment has its own OAuth app and a brand_name.

+ */ + _FinalStage privacyUrl(OptionalNullable privacyUrl); + + _FinalStage privacyUrl(String privacyUrl); + + _FinalStage privacyUrl(Optional privacyUrl); + + _FinalStage privacyUrl(Nullable privacyUrl); + /** *

Sender of booking emails, on a verified domain.

*/ @@ -373,6 +464,15 @@ public interface _FinalStage { _FinalStage smsFrom(Nullable smsFrom); + /** + *

Reasons of your own for time away, on top of the preset ones.

+ */ + _FinalStage outOfOfficeReasons(List outOfOfficeReasons); + + _FinalStage addOutOfOfficeReasons(SchedulingSettingsOutOfOfficeReasonsItem outOfOfficeReasons); + + _FinalStage addAllOutOfOfficeReasons(List outOfOfficeReasons); + /** *

Per event, overriding the defaults.

*/ @@ -408,9 +508,18 @@ _FinalStage notifications( } @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements ObjectStage, CalendarFailureModeStage, _FinalStage { + public static final class Builder + implements ObjectStage, + NameHostInAttendeeEmailsStage, + HostReassignmentStage, + CalendarFailureModeStage, + _FinalStage { private SchedulingSettingsObject object; + private boolean nameHostInAttendeeEmails; + + private SchedulingSettingsHostReassignment hostReassignment; + private SchedulingSettingsCalendarFailureMode calendarFailureMode; private OptionalNullable> reminders = OptionalNullable.absent(); @@ -420,10 +529,14 @@ public static final class Builder implements ObjectStage, CalendarFailureModeSta private OptionalNullable>> notifications = OptionalNullable.absent(); + private List outOfOfficeReasons = new ArrayList<>(); + private OptionalNullable smsFrom = OptionalNullable.absent(); private OptionalNullable emailFrom = OptionalNullable.absent(); + private OptionalNullable privacyUrl = OptionalNullable.absent(); + private OptionalNullable logo = OptionalNullable.absent(); private OptionalNullable accentColor = OptionalNullable.absent(); @@ -444,8 +557,12 @@ public Builder from(SchedulingSettings other) { brandName(other.getBrandName()); accentColor(other.getAccentColor()); logo(other.getLogo()); + privacyUrl(other.getPrivacyUrl()); emailFrom(other.getEmailFrom()); smsFrom(other.getSmsFrom()); + nameHostInAttendeeEmails(other.getNameHostInAttendeeEmails()); + hostReassignment(other.getHostReassignment()); + outOfOfficeReasons(other.getOutOfOfficeReasons()); calendarFailureMode(other.getCalendarFailureMode()); notifications(other.getNotifications()); emailReplyTo(other.getEmailReplyTo()); @@ -455,11 +572,33 @@ public Builder from(SchedulingSettings other) { @java.lang.Override @JsonSetter("object") - public CalendarFailureModeStage object(@NotNull SchedulingSettingsObject object) { + public NameHostInAttendeeEmailsStage object(@NotNull SchedulingSettingsObject object) { this.object = Objects.requireNonNull(object, "object must not be null"); return this; } + /** + *

Name the new host when telling an attendee their booking has one.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("name_host_in_attendee_emails") + public HostReassignmentStage nameHostInAttendeeEmails(boolean nameHostInAttendeeEmails) { + this.nameHostInAttendeeEmails = nameHostInAttendeeEmails; + return this; + } + + /** + *

Whether hosts can give their own bookings to someone else from their page. eligible lets them, to anyone free who takes that event type.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("host_reassignment") + public CalendarFailureModeStage hostReassignment(@NotNull SchedulingSettingsHostReassignment hostReassignment) { + this.hostReassignment = Objects.requireNonNull(hostReassignment, "hostReassignment must not be null"); + return this; + } + /** *

When a host's calendar can't be read: hide stops offering them, last_known keeps offering their last known times.

* @return Reference to {@code this} so that method calls can be chained together. @@ -611,6 +750,41 @@ public _FinalStage notifications( return this; } + /** + *

Reasons of your own for time away, on top of the preset ones.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage addAllOutOfOfficeReasons(List outOfOfficeReasons) { + if (outOfOfficeReasons != null) { + this.outOfOfficeReasons.addAll(outOfOfficeReasons); + } + return this; + } + + /** + *

Reasons of your own for time away, on top of the preset ones.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage addOutOfOfficeReasons(SchedulingSettingsOutOfOfficeReasonsItem outOfOfficeReasons) { + this.outOfOfficeReasons.add(outOfOfficeReasons); + return this; + } + + /** + *

Reasons of your own for time away, on top of the preset ones.

+ */ + @java.lang.Override + @JsonSetter(value = "out_of_office_reasons", nulls = Nulls.SKIP) + public _FinalStage outOfOfficeReasons(List outOfOfficeReasons) { + this.outOfOfficeReasons.clear(); + if (outOfOfficeReasons != null) { + this.outOfOfficeReasons.addAll(outOfOfficeReasons); + } + return this; + } + /** *

Your approved number for SMS reminders. Without one, no SMS is sent.

* @return Reference to {@code this} so that method calls can be chained together. @@ -711,6 +885,56 @@ public _FinalStage emailFrom(OptionalNullable emailFrom) { return this; } + /** + *

Your privacy policy, linked on a host's page beside what connecting a calendar does, once this environment has its own OAuth app and a brand_name.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage privacyUrl(Nullable privacyUrl) { + if (privacyUrl.isNull()) { + this.privacyUrl = OptionalNullable.ofNull(); + } else if (privacyUrl.isEmpty()) { + this.privacyUrl = OptionalNullable.absent(); + } else { + this.privacyUrl = OptionalNullable.of(privacyUrl.get()); + } + return this; + } + + /** + *

Your privacy policy, linked on a host's page beside what connecting a calendar does, once this environment has its own OAuth app and a brand_name.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage privacyUrl(Optional privacyUrl) { + if (privacyUrl.isPresent()) { + this.privacyUrl = OptionalNullable.of(privacyUrl.get()); + } else { + this.privacyUrl = OptionalNullable.absent(); + } + return this; + } + + /** + *

Your privacy policy, linked on a host's page beside what connecting a calendar does, once this environment has its own OAuth app and a brand_name.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage privacyUrl(String privacyUrl) { + this.privacyUrl = OptionalNullable.of(privacyUrl); + return this; + } + + /** + *

Your privacy policy, linked on a host's page beside what connecting a calendar does, once this environment has its own OAuth app and a brand_name.

+ */ + @java.lang.Override + @JsonSetter(value = "privacy_url", nulls = Nulls.SKIP) + public _FinalStage privacyUrl(OptionalNullable privacyUrl) { + this.privacyUrl = privacyUrl; + return this; + } + /** *

At the top of the hosted pages, and of emails sent from email_from.

* @return Reference to {@code this} so that method calls can be chained together. @@ -904,8 +1128,12 @@ public SchedulingSettings build() { brandName, accentColor, logo, + privacyUrl, emailFrom, smsFrom, + nameHostInAttendeeEmails, + hostReassignment, + outOfOfficeReasons, calendarFailureMode, notifications, emailReplyTo, diff --git a/sdks/java/src/main/java/com/coss/types/SchedulingSettingsHostReassignment.java b/sdks/java/src/main/java/com/coss/types/SchedulingSettingsHostReassignment.java new file mode 100644 index 000000000..fb2826d5f --- /dev/null +++ b/sdks/java/src/main/java/com/coss/types/SchedulingSettingsHostReassignment.java @@ -0,0 +1,86 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.coss.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class SchedulingSettingsHostReassignment { + public static final SchedulingSettingsHostReassignment OFF = + new SchedulingSettingsHostReassignment(Value.OFF, "off"); + + public static final SchedulingSettingsHostReassignment ELIGIBLE = + new SchedulingSettingsHostReassignment(Value.ELIGIBLE, "eligible"); + + private final Value value; + + private final String string; + + SchedulingSettingsHostReassignment(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof SchedulingSettingsHostReassignment + && this.string.equals(((SchedulingSettingsHostReassignment) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case OFF: + return visitor.visitOff(); + case ELIGIBLE: + return visitor.visitEligible(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static SchedulingSettingsHostReassignment valueOf(String value) { + switch (value) { + case "off": + return OFF; + case "eligible": + return ELIGIBLE; + default: + return new SchedulingSettingsHostReassignment(Value.UNKNOWN, value); + } + } + + public enum Value { + OFF, + + ELIGIBLE, + + UNKNOWN + } + + public interface Visitor { + T visitOff(); + + T visitEligible(); + + T visitUnknown(String unknownType); + } +} diff --git a/sdks/java/src/main/java/com/coss/types/SchedulingSettingsOutOfOfficeReasonsItem.java b/sdks/java/src/main/java/com/coss/types/SchedulingSettingsOutOfOfficeReasonsItem.java new file mode 100644 index 000000000..8133cfb85 --- /dev/null +++ b/sdks/java/src/main/java/com/coss/types/SchedulingSettingsOutOfOfficeReasonsItem.java @@ -0,0 +1,142 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.coss.types; + +import com.coss.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = SchedulingSettingsOutOfOfficeReasonsItem.Builder.class) +public final class SchedulingSettingsOutOfOfficeReasonsItem { + private final String key; + + private final String label; + + private final Map additionalProperties; + + private SchedulingSettingsOutOfOfficeReasonsItem( + String key, String label, Map additionalProperties) { + this.key = key; + this.label = label; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("key") + public String getKey() { + return key; + } + + @JsonProperty("label") + public String getLabel() { + return label; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof SchedulingSettingsOutOfOfficeReasonsItem + && equalTo((SchedulingSettingsOutOfOfficeReasonsItem) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(SchedulingSettingsOutOfOfficeReasonsItem other) { + return key.equals(other.key) && label.equals(other.label); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.key, this.label); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static KeyStage builder() { + return new Builder(); + } + + public interface KeyStage { + LabelStage key(@NotNull String key); + + Builder from(SchedulingSettingsOutOfOfficeReasonsItem other); + } + + public interface LabelStage { + _FinalStage label(@NotNull String label); + } + + public interface _FinalStage { + SchedulingSettingsOutOfOfficeReasonsItem build(); + + _FinalStage additionalProperty(String key, Object value); + + _FinalStage additionalProperties(Map additionalProperties); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements KeyStage, LabelStage, _FinalStage { + private String key; + + private String label; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(SchedulingSettingsOutOfOfficeReasonsItem other) { + key(other.getKey()); + label(other.getLabel()); + return this; + } + + @java.lang.Override + @JsonSetter("key") + public LabelStage key(@NotNull String key) { + this.key = Objects.requireNonNull(key, "key must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("label") + public _FinalStage label(@NotNull String label) { + this.label = Objects.requireNonNull(label, "label must not be null"); + return this; + } + + @java.lang.Override + public SchedulingSettingsOutOfOfficeReasonsItem build() { + return new SchedulingSettingsOutOfOfficeReasonsItem(key, label, additionalProperties); + } + + @java.lang.Override + public Builder additionalProperty(String key, Object value) { + this.additionalProperties.put(key, value); + return this; + } + + @java.lang.Override + public Builder additionalProperties(Map additionalProperties) { + this.additionalProperties.putAll(additionalProperties); + return this; + } + } +} diff --git a/sdks/java/src/main/java/com/coss/types/SchedulingSlotExplanation.java b/sdks/java/src/main/java/com/coss/types/SchedulingSlotExplanation.java index ba62641e7..ddcb604d1 100644 --- a/sdks/java/src/main/java/com/coss/types/SchedulingSlotExplanation.java +++ b/sdks/java/src/main/java/com/coss/types/SchedulingSlotExplanation.java @@ -87,7 +87,7 @@ public boolean getAvailable() { } /** - * @return Why it can't: not_on_grid, too_soon, outside_booking_window, calendar_unverified, outside_availability, host_busy, already_claimed, limit_reached or session_full, or event_type_inactive or no_hosts. null when it can. With several hosts refused, the first one's reason: see hosts. + * @return Why it can't: not_on_grid, too_soon, outside_booking_window, out_of_office, outside_coverage, calendar_unverified, outside_availability, host_busy, already_claimed, limit_reached or session_full, or event_type_inactive or no_hosts. null when it can. With several hosts refused, the first one's reason: see hosts. */ @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) @JsonProperty("reason") @@ -181,7 +181,7 @@ public interface _FinalStage { _FinalStage additionalProperties(Map additionalProperties); /** - *

Why it can't: not_on_grid, too_soon, outside_booking_window, calendar_unverified, outside_availability, host_busy, already_claimed, limit_reached or session_full, or event_type_inactive or no_hosts. null when it can. With several hosts refused, the first one's reason: see hosts.

+ *

Why it can't: not_on_grid, too_soon, outside_booking_window, out_of_office, outside_coverage, calendar_unverified, outside_availability, host_busy, already_claimed, limit_reached or session_full, or event_type_inactive or no_hosts. null when it can. With several hosts refused, the first one's reason: see hosts.

*/ _FinalStage reason(OptionalNullable reason); @@ -307,7 +307,7 @@ public _FinalStage hosts(List hosts) { } /** - *

Why it can't: not_on_grid, too_soon, outside_booking_window, calendar_unverified, outside_availability, host_busy, already_claimed, limit_reached or session_full, or event_type_inactive or no_hosts. null when it can. With several hosts refused, the first one's reason: see hosts.

+ *

Why it can't: not_on_grid, too_soon, outside_booking_window, out_of_office, outside_coverage, calendar_unverified, outside_availability, host_busy, already_claimed, limit_reached or session_full, or event_type_inactive or no_hosts. null when it can. With several hosts refused, the first one's reason: see hosts.

* @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override @@ -323,7 +323,7 @@ public _FinalStage reason(Nullable reason) { } /** - *

Why it can't: not_on_grid, too_soon, outside_booking_window, calendar_unverified, outside_availability, host_busy, already_claimed, limit_reached or session_full, or event_type_inactive or no_hosts. null when it can. With several hosts refused, the first one's reason: see hosts.

+ *

Why it can't: not_on_grid, too_soon, outside_booking_window, out_of_office, outside_coverage, calendar_unverified, outside_availability, host_busy, already_claimed, limit_reached or session_full, or event_type_inactive or no_hosts. null when it can. With several hosts refused, the first one's reason: see hosts.

* @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override @@ -337,7 +337,7 @@ public _FinalStage reason(Optional reason) { } /** - *

Why it can't: not_on_grid, too_soon, outside_booking_window, calendar_unverified, outside_availability, host_busy, already_claimed, limit_reached or session_full, or event_type_inactive or no_hosts. null when it can. With several hosts refused, the first one's reason: see hosts.

+ *

Why it can't: not_on_grid, too_soon, outside_booking_window, out_of_office, outside_coverage, calendar_unverified, outside_availability, host_busy, already_claimed, limit_reached or session_full, or event_type_inactive or no_hosts. null when it can. With several hosts refused, the first one's reason: see hosts.

* @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override @@ -347,7 +347,7 @@ public _FinalStage reason(String reason) { } /** - *

Why it can't: not_on_grid, too_soon, outside_booking_window, calendar_unverified, outside_availability, host_busy, already_claimed, limit_reached or session_full, or event_type_inactive or no_hosts. null when it can. With several hosts refused, the first one's reason: see hosts.

+ *

Why it can't: not_on_grid, too_soon, outside_booking_window, out_of_office, outside_coverage, calendar_unverified, outside_availability, host_busy, already_claimed, limit_reached or session_full, or event_type_inactive or no_hosts. null when it can. With several hosts refused, the first one's reason: see hosts.

*/ @java.lang.Override @JsonSetter(value = "reason", nulls = Nulls.SKIP) diff --git a/sdks/java/src/main/java/com/coss/types/SchedulingSlotExplanationHostsItem.java b/sdks/java/src/main/java/com/coss/types/SchedulingSlotExplanationHostsItem.java index 33101d5dd..f3b889752 100644 --- a/sdks/java/src/main/java/com/coss/types/SchedulingSlotExplanationHostsItem.java +++ b/sdks/java/src/main/java/com/coss/types/SchedulingSlotExplanationHostsItem.java @@ -76,7 +76,7 @@ public boolean getAvailable() { } /** - * @return Why not: not_on_grid, too_soon, outside_booking_window, calendar_unverified, outside_availability, host_busy, already_claimed, limit_reached or session_full. null when they could. + * @return Why not: not_on_grid, too_soon, outside_booking_window, out_of_office, outside_coverage, calendar_unverified, outside_availability, host_busy, already_claimed, limit_reached or session_full. null when they could. */ @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) @JsonProperty("reason") @@ -176,7 +176,7 @@ public interface _FinalStage { _FinalStage additionalProperties(Map additionalProperties); /** - *

Why not: not_on_grid, too_soon, outside_booking_window, calendar_unverified, outside_availability, host_busy, already_claimed, limit_reached or session_full. null when they could.

+ *

Why not: not_on_grid, too_soon, outside_booking_window, out_of_office, outside_coverage, calendar_unverified, outside_availability, host_busy, already_claimed, limit_reached or session_full. null when they could.

*/ _FinalStage reason(OptionalNullable reason); @@ -309,7 +309,7 @@ public _FinalStage calendarReason(OptionalNullable calendarReason) { } /** - *

Why not: not_on_grid, too_soon, outside_booking_window, calendar_unverified, outside_availability, host_busy, already_claimed, limit_reached or session_full. null when they could.

+ *

Why not: not_on_grid, too_soon, outside_booking_window, out_of_office, outside_coverage, calendar_unverified, outside_availability, host_busy, already_claimed, limit_reached or session_full. null when they could.

* @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override @@ -325,7 +325,7 @@ public _FinalStage reason(Nullable reason) { } /** - *

Why not: not_on_grid, too_soon, outside_booking_window, calendar_unverified, outside_availability, host_busy, already_claimed, limit_reached or session_full. null when they could.

+ *

Why not: not_on_grid, too_soon, outside_booking_window, out_of_office, outside_coverage, calendar_unverified, outside_availability, host_busy, already_claimed, limit_reached or session_full. null when they could.

* @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override @@ -339,7 +339,7 @@ public _FinalStage reason(Optional reason) { } /** - *

Why not: not_on_grid, too_soon, outside_booking_window, calendar_unverified, outside_availability, host_busy, already_claimed, limit_reached or session_full. null when they could.

+ *

Why not: not_on_grid, too_soon, outside_booking_window, out_of_office, outside_coverage, calendar_unverified, outside_availability, host_busy, already_claimed, limit_reached or session_full. null when they could.

* @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override @@ -349,7 +349,7 @@ public _FinalStage reason(String reason) { } /** - *

Why not: not_on_grid, too_soon, outside_booking_window, calendar_unverified, outside_availability, host_busy, already_claimed, limit_reached or session_full. null when they could.

+ *

Why not: not_on_grid, too_soon, outside_booking_window, out_of_office, outside_coverage, calendar_unverified, outside_availability, host_busy, already_claimed, limit_reached or session_full. null when they could.

*/ @java.lang.Override @JsonSetter(value = "reason", nulls = Nulls.SKIP) diff --git a/sdks/java/src/main/java/com/coss/types/WebhookTestEventEvent.java b/sdks/java/src/main/java/com/coss/types/WebhookTestEventEvent.java index 968fe69a6..d10f32966 100644 --- a/sdks/java/src/main/java/com/coss/types/WebhookTestEventEvent.java +++ b/sdks/java/src/main/java/com/coss/types/WebhookTestEventEvent.java @@ -61,7 +61,13 @@ public T visit(Visitor visitor) { } else if (this.type == 13) { return visitor.visit((SchedulingCalendarWebhookEvent) this.value); } else if (this.type == 14) { + return visitor.visit((SchedulingOutOfOfficeWebhookEvent) this.value); + } else if (this.type == 15) { + return visitor.visit((SchedulingReassignmentWebhookEvent) this.value); + } else if (this.type == 16) { return visitor.visit((SchedulingCalendarDelegationWebhookEvent) this.value); + } else if (this.type == 17) { + return visitor.visit((SchedulingOauthAppWebhookEvent) this.value); } throw new IllegalStateException("Failed to visit value. This should never happen."); } @@ -142,10 +148,22 @@ public static WebhookTestEventEvent of(SchedulingCalendarWebhookEvent value) { return new WebhookTestEventEvent(value, 13); } - public static WebhookTestEventEvent of(SchedulingCalendarDelegationWebhookEvent value) { + public static WebhookTestEventEvent of(SchedulingOutOfOfficeWebhookEvent value) { return new WebhookTestEventEvent(value, 14); } + public static WebhookTestEventEvent of(SchedulingReassignmentWebhookEvent value) { + return new WebhookTestEventEvent(value, 15); + } + + public static WebhookTestEventEvent of(SchedulingCalendarDelegationWebhookEvent value) { + return new WebhookTestEventEvent(value, 16); + } + + public static WebhookTestEventEvent of(SchedulingOauthAppWebhookEvent value) { + return new WebhookTestEventEvent(value, 17); + } + public interface Visitor { T visit(EmailWebhookEvent value); @@ -175,7 +193,13 @@ public interface Visitor { T visit(SchedulingCalendarWebhookEvent value); + T visit(SchedulingOutOfOfficeWebhookEvent value); + + T visit(SchedulingReassignmentWebhookEvent value); + T visit(SchedulingCalendarDelegationWebhookEvent value); + + T visit(SchedulingOauthAppWebhookEvent value); } static final class Deserializer extends StdDeserializer { @@ -354,6 +378,30 @@ public WebhookTestEventEvent deserialize(JsonParser p, DeserializationContext co } catch (RuntimeException e) { } } + if (value instanceof Map + && ((Map) value).containsKey("id") + && ((Map) value).containsKey("object") + && ((Map) value).containsKey("api_version") + && ((Map) value).containsKey("created_at") + && ((Map) value).containsKey("type") + && ((Map) value).containsKey("data")) { + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, SchedulingOutOfOfficeWebhookEvent.class)); + } catch (RuntimeException e) { + } + } + if (value instanceof Map + && ((Map) value).containsKey("id") + && ((Map) value).containsKey("object") + && ((Map) value).containsKey("api_version") + && ((Map) value).containsKey("created_at") + && ((Map) value).containsKey("type") + && ((Map) value).containsKey("data")) { + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, SchedulingReassignmentWebhookEvent.class)); + } catch (RuntimeException e) { + } + } if (value instanceof Map && ((Map) value).containsKey("id") && ((Map) value).containsKey("object") @@ -367,6 +415,18 @@ public WebhookTestEventEvent deserialize(JsonParser p, DeserializationContext co } catch (RuntimeException e) { } } + if (value instanceof Map + && ((Map) value).containsKey("id") + && ((Map) value).containsKey("object") + && ((Map) value).containsKey("api_version") + && ((Map) value).containsKey("created_at") + && ((Map) value).containsKey("type") + && ((Map) value).containsKey("data")) { + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, SchedulingOauthAppWebhookEvent.class)); + } catch (RuntimeException e) { + } + } throw new JsonParseException(p, "Failed to deserialize"); } } diff --git a/sdks/php/CHANGELOG.md b/sdks/php/CHANGELOG.md index 8ba8118a4..4152bfb5e 100644 --- a/sdks/php/CHANGELOG.md +++ b/sdks/php/CHANGELOG.md @@ -1,5 +1,10 @@ # Changelog +## 0.4.0 + +- Regenerated from the API's OpenAPI document at 2eb77126153a. What changed in the API: the + [API changelog](https://coss.com/docs/api-reference/changelog). + ## 0.3.0 - Regenerated from the API's OpenAPI document at 820256d03a44. What changed in the API: the diff --git a/sdks/php/composer.json b/sdks/php/composer.json index 699ec2b93..e00c06b36 100644 --- a/sdks/php/composer.json +++ b/sdks/php/composer.json @@ -1,6 +1,6 @@ { "name": "coss/coss", - "version": "0.3.0", + "version": "0.4.0", "description": "The coss.com SDK for PHP", "keywords": [ "coss", diff --git a/sdks/php/reference.md b/sdks/php/reference.md index f728eefed..83db52507 100644 --- a/sdks/php/reference.md +++ b/sdks/php/reference.md @@ -16867,8 +16867,8 @@ $client->scheduling->hosts->update( -## Scheduling Schedules -
$client->scheduling->schedules->list($host) -> ?SchedulingScheduleList +## Scheduling Bookings +
$client->scheduling->bookings->reassign($id, $request) -> ?SchedulingBooking
@@ -16880,7 +16880,7 @@ $client->scheduling->hosts->update(
-All of the host's schedules, oldest first. +Gives a booking to another host, keeping its id and time. Works for every kind: a group session moves as a whole, from any of its seats, and one that's already started changes for the record, with nobody told. Whoever leaves and joins is told, and the attendee unless you say not to.
@@ -16895,8 +16895,16 @@ All of the host's schedules, oldest first.
```php -$client->scheduling->schedules->list( - 'host_01kd2m9a0b1c2d3e4f5g6h7j8m', +$client->scheduling->bookings->reassign( + 'book_01kd2m9a0b1c2d3e4f5g6h7j8m', + new ReassignSchedulingBookingRequest([ + 'changes' => [ + new ReassignSchedulingBookingRequestChangesItem([ + 'toHost' => 'doctor_518', + ]), + ], + 'reasonCode' => ReassignSchedulingBookingRequestReasonCode::OutOfOffice->value, + ]), ); ```
@@ -16912,92 +16920,39 @@ $client->scheduling->schedules->list(
-**$host:** `string` — The host's id or uid. +**$id:** `string` — The booking's id.
- -
- - - - -
-
$client->scheduling->schedules->create($host, $request) -> ?SchedulingSchedule
-#### 📝 Description - -
-
+**$changes:** `array` — A session or a one-on-one has one. A collective can change several. + +
+
-A host's weekly hours and date overrides, in local time. The first one is the host's default. -
-
+**$reasonCode:** `string` +
-#### 🔌 Usage - -
-
-
-```php -$client->scheduling->schedules->create( - 'host_01kd2m9a0b1c2d3e4f5g6h7j8m', - new CreateSchedulesRequest([ - 'body' => new UpsertScheduleRequest([ - 'name' => 'Clinic hours', - 'rules' => [ - new SchedulingWeeklyRule([ - 'days' => [ - 1, - 2, - 3, - 4, - 5, - ], - 'start' => '09:00', - 'end' => '17:00', - ]), - ], - 'overrides' => [ - new SchedulingScheduleOverride([ - 'date' => '2027-12-24', - 'ranges' => [ - new SchedulingScheduleOverrideRangesItem([ - 'start' => 'start', - 'end' => 'end', - ]), - ], - ]), - ], - ]), - ]), -); -``` -
-
+**$note:** `?string` — Why, in your words: required with an override of someone's availability. Encrypted, and only in the booking's history. +
-#### ⚙️ Parameters - -
-
-
-**$host:** `string` — The host's id or uid. +**$overrides:** `?array` — Go ahead anyway: `any_host` for someone who doesn't take this event type, and the rest for what a candidate's `reason` said. A host who already has something at this time can never be overridden.
@@ -17005,7 +16960,7 @@ $client->scheduling->schedules->create(
-**$request:** `UpsertScheduleRequest` +**$notify:** `?ReassignSchedulingBookingRequestNotify`
@@ -17017,7 +16972,7 @@ $client->scheduling->schedules->create(
-
$client->scheduling->schedules->get($host, $scheduleId) -> ?SchedulingSchedule +
$client->scheduling->bookings->reassignCandidates($id, $request) -> ?SchedulingReassignCandidateList
@@ -17029,7 +16984,7 @@ $client->scheduling->schedules->create(
-One of the host's schedules. +The environment's other active hosts: members of the event type first, in the order a pool would pick them, each saying whether they're free and why not. Things can change before you ask: reassigning decides again.
@@ -17044,9 +16999,9 @@ One of the host's schedules.
```php -$client->scheduling->schedules->get( - 'host_01kd2m9a0b1c2d3e4f5g6h7j8m', - 'sched_01kd2m9a0b1c2d3e4f5g6h7j8m', +$client->scheduling->bookings->reassignCandidates( + 'book_01kd2m9a0b1c2d3e4f5g6h7j8m', + new ReassignCandidatesBookingsRequest([]), ); ```
@@ -17062,7 +17017,7 @@ $client->scheduling->schedules->get(
-**$host:** `string` — The host's id or uid. +**$id:** `string` — The booking's id.
@@ -17070,7 +17025,7 @@ $client->scheduling->schedules->get(
-**$scheduleId:** `string` — The schedule's id. +**$fromHost:** `?string` — The host who'd leave, when it could be several.
@@ -17082,7 +17037,7 @@ $client->scheduling->schedules->get(
-
$client->scheduling->schedules->update($host, $scheduleId, $request) -> ?SchedulingSchedule +
$client->scheduling->bookings->list($request) -> ?SchedulingBookingList
@@ -17094,7 +17049,7 @@ $client->scheduling->schedules->get(
-Replaces its weekly rules, and its overrides when given. Existing bookings stay: a schedule only decides what's offered next. +The environment's bookings, newest first. Answers aren't included.
@@ -17109,37 +17064,10 @@ Replaces its weekly rules, and its overrides when given. Existing bookings stay:
```php -$client->scheduling->schedules->update( - 'host_01kd2m9a0b1c2d3e4f5g6h7j8m', - 'sched_01kd2m9a0b1c2d3e4f5g6h7j8m', - new UpdateSchedulesRequest([ - 'body' => new UpsertScheduleRequest([ - 'name' => 'Clinic hours', - 'rules' => [ - new SchedulingWeeklyRule([ - 'days' => [ - 1, - 2, - 3, - 4, - 5, - ], - 'start' => '09:00', - 'end' => '17:00', - ]), - ], - 'overrides' => [ - new SchedulingScheduleOverride([ - 'date' => '2027-12-24', - 'ranges' => [ - new SchedulingScheduleOverrideRangesItem([ - 'start' => 'start', - 'end' => 'end', - ]), - ], - ]), - ], - ]), +$client->scheduling->bookings->list( + new ListBookingsRequest([ + 'startAfter' => '2027-01-04T15:00:00.000Z', + 'startBefore' => '2027-01-04T15:00:00.000Z', ]), ); ``` @@ -17156,7 +17084,7 @@ $client->scheduling->schedules->update(
-**$host:** `string` — The host's id or uid. +**$limit:** `?int`
@@ -17164,7 +17092,7 @@ $client->scheduling->schedules->update(
-**$scheduleId:** `string` — The schedule's id. +**$after:** `?string` — The last id of the previous page.
@@ -17172,7 +17100,47 @@ $client->scheduling->schedules->update(
-**$request:** `UpsertScheduleRequest` +**$host:** `?string` + +
+
+ +
+
+ +**$eventType:** `?string` + +
+
+ +
+
+ +**$status:** `?string` + +
+
+ +
+
+ +**$attendeeUid:** `?string` + +
+
+ +
+
+ +**$startAfter:** `?string` — An ISO 8601 instant with an offset. + +
+
+ +
+
+ +**$startBefore:** `?string` — An ISO 8601 instant with an offset.
@@ -17184,7 +17152,7 @@ $client->scheduling->schedules->update(
-
$client->scheduling->schedules->remove($host, $scheduleId) -> ?DeletedSchedulingSchedule +
$client->scheduling->bookings->create($request) -> ?SchedulingBooking
@@ -17196,7 +17164,7 @@ $client->scheduling->schedules->update(
-Refused for the host's default schedule. +Books a slot, or joins a group session. Without a `host`, a pool chooses fairly among those free. An event type that requires approval answers with a `pending_approval` booking.
@@ -17211,9 +17179,18 @@ Refused for the host's default schedule.
```php -$client->scheduling->schedules->remove( - 'host_01kd2m9a0b1c2d3e4f5g6h7j8m', - 'sched_01kd2m9a0b1c2d3e4f5g6h7j8m', +$client->scheduling->bookings->create( + new CreateBookingRequest([ + 'idempotencyKey' => 'welcome-user-123', + 'eventType' => 'evtype_01kd2m9a0b1c2d3e4f5g6h7j8m', + 'start' => '2027-01-04T15:00:00.000Z', + 'attendee' => new SchedulingAttendeeInput([ + 'uid' => 'patient_77', + 'name' => 'Sam Lee', + 'email' => 'sam@example.com', + 'timeZone' => 'UTC', + ]), + ]), ); ```
@@ -17229,7 +17206,7 @@ $client->scheduling->schedules->remove(
-**$host:** `string` — The host's id or uid. +**$idempotencyKey:** `?string` — Makes retries safe: a repeated request with the same key and body returns the original booking instead of creating another, for 24 hours. A refused request keeps no key. 1-256 characters.
@@ -17237,64 +17214,71 @@ $client->scheduling->schedules->remove(
-**$scheduleId:** `string` — The schedule's id. +**$eventType:** `string` — The event type's id or uid.
- -
+
+
+**$start:** `string` — An ISO 8601 instant with an offset. +
-
-## Scheduling EventTypes -
$client->scheduling->eventTypes->list($request) -> ?SchedulingEventTypeList
-#### 📝 Description +**$host:** `?string` — A specific host (id or uid). Default: chosen fairly from those free. + +
+
+**$attributes:** `?array` — Only choose among pool hosts matching all of these. + +
+
+
-The environment's event types, newest first. -
-
+**$durationMinutes:** `?int` — One of the event type's `duration_options`. + -#### 🔌 Usage -
+**$attendee:** `SchedulingAttendeeInput` + +
+
+
-```php -$client->scheduling->eventTypes->list( - new ListEventTypesRequest([]), -); -``` -
-
+**$guests:** `?array` — Up to the event type's `max_guests`. + -#### ⚙️ Parameters -
+**$answers:** `?array` — Answers to the event type's questions. Stored encrypted, and returned only by retrieving the booking. + +
+
+
-**$limit:** `?int` +**$location:** `?CreateBookingRequestLocation` — One of the event type's `locations`, with your link filled in if it has none.
@@ -17302,7 +17286,7 @@ $client->scheduling->eventTypes->list(
-**$after:** `?string` — The last id of the previous page. +**$metadata:** `?array` — Your own key-value pairs. Don't put sensitive data here.
@@ -17314,7 +17298,7 @@ $client->scheduling->eventTypes->list(
-
$client->scheduling->eventTypes->create($request) -> ?SchedulingEventType +
$client->scheduling->bookings->get($id) -> ?SchedulingBooking
@@ -17326,7 +17310,7 @@ $client->scheduling->eventTypes->list(
-What can be booked: `one_on_one` with one host, `pool` for any free host, `collective` when every required host must be free, or `group` for a session with seats. +A booking with its attendees and their answers.
@@ -17341,19 +17325,8 @@ What can be booked: `one_on_one` with one host, `pool` for any free host, `colle
```php -$client->scheduling->eventTypes->create( - new CreateEventTypeRequest([ - 'kind' => CreateEventTypeRequestKind::OneOnOne->value, - 'title' => 'Initial consultation', - 'durationMinutes' => 30, - 'bufferAfterMinutes' => 10, - 'minNoticeMinutes' => 120, - 'hosts' => [ - new SchedulingEventTypeHostInput([ - 'host' => 'doctor_482', - ]), - ], - ]), +$client->scheduling->bookings->get( + 'book_01kd2m9a0b1c2d3e4f5g6h7j8m', ); ```
@@ -17369,31 +17342,66 @@ $client->scheduling->eventTypes->create(
-**$uid:** `?string` — Your own id for this event type, unique in the environment, accepted wherever its id is. +**$id:** `string` — The booking's id.
+ +
+ + + + +
+
$client->scheduling->bookings->reschedule($id, $request) -> ?SchedulingBooking
-**$kind:** `?string` — Who a booking needs. `one_on_one`: one host. `pool`: any one of its hosts. `collective`: every `required` host, plus at most one `member`. `group`: one host, with attendees taking seats up to `capacity`. Fixed once created. - +#### 📝 Description + +
+
+ +
+
+ +Moves it to a new time, keeping its id. The old time stays booked if the new one isn't free.
+
+
+ +#### 🔌 Usage
-**$description:** `?string` — Plain text about the event type, shown on hosted booking pages and never in emails. Links, and anything shaped like a domain, must be on your organization's verified domains or their subdomains, and use `https`. `null` removes it. - +
+
+ +```php +$client->scheduling->bookings->reschedule( + 'book_01kd2m9a0b1c2d3e4f5g6h7j8m', + new RescheduleBookingRequest([ + 'start' => '2027-01-05T15:00:00.000Z', + ]), +); +``` +
+
+#### ⚙️ Parameters +
-**$title:** `string` — Shown to attendees and in emails. Host calendars show it only with `host_calendar_details: full`. +
+
+ +**$id:** `string` — The booking's id.
@@ -17401,7 +17409,7 @@ $client->scheduling->eventTypes->create(
-**$durationMinutes:** `int` — How long a booking lasts by default, in minutes. +**$start:** `string` — The new start. The old time stays booked unless this one's free.
@@ -17409,31 +17417,66 @@ $client->scheduling->eventTypes->create(
-**$durationOptions:** `?array` — Other lengths an attendee may choose, in minutes. Empty: only `duration_minutes`. +**$host:** `?string` — Move a pool booking to this host. Default: its current hosts.
+
+
+ +
+
+
+ +
$client->scheduling->bookings->cancel($id, $request) -> ?SchedulingBooking
-**$stepMinutes:** `?int` — How far apart slots start. Default: the duration. - +#### 📝 Description + +
+
+ +
+
+ +Frees the time and removes the calendar event. A cancelled booking stays charged. +
+
+#### 🔌 Usage +
-**$gridTimeZone:** `?string` — The zone slots align in. Default: each host's own. - +
+
+ +```php +$client->scheduling->bookings->cancel( + 'book_01kd2m9a0b1c2d3e4f5g6h7j8m', + new CancelSchedulingBookingRequest([ + 'reason' => 'Feeling better', + ]), +); +``` +
+
+#### ⚙️ Parameters +
-**$bufferBeforeMinutes:** `?int` — Minutes kept free before each booking. Default: 0. +
+
+ +**$id:** `string` — The booking's id.
@@ -17441,31 +17484,64 @@ $client->scheduling->eventTypes->create(
-**$bufferAfterMinutes:** `?int` — Minutes kept free after each booking. Default: 0. +**$reason:** `?string` — Why it's being cancelled. Only retrieving this booking returns it: it's never in webhooks, logs or emails.
+
+
+ + +
+
+
+
$client->scheduling->bookings->events($id, $request) -> ?SchedulingBookingEventList
-**$minNoticeMinutes:** `?int` — Slots starting sooner than this many minutes from now aren't offered. Default: 0. - +#### 📝 Description + +
+
+ +
+
+ +What's happened to a booking, oldest first, and who did it. There's no personal data in here.
+
+
+ +#### 🔌 Usage
-**$bookingWindow:** `SchedulingBookingWindowDays|SchedulingBookingWindowFrom|null` - +
+
+ +```php +$client->scheduling->bookings->events( + 'book_01kd2m9a0b1c2d3e4f5g6h7j8m', + new EventsBookingsRequest([]), +); +``` +
+
+#### ⚙️ Parameters +
-**$limits:** `?array` — Caps on bookings per day or week. Default: none. +
+
+ +**$id:** `string` — The booking's id.
@@ -17473,7 +17549,7 @@ $client->scheduling->eventTypes->create(
-**$capacity:** `?int` — Attendees per session. Required for, and only allowed on, `group`. +**$limit:** `?int`
@@ -17481,47 +17557,2372 @@ $client->scheduling->eventTypes->create(
-**$requiresApproval:** `?bool` — Bookings start as `pending_approval`, holding the time until approved or declined. Default: `false`. +**$after:** `?string` — The last id of the previous page.
+
+
+ + +
+
+
+
$client->scheduling->bookings->approve($id) -> ?SchedulingBooking
-**$approvalTtlMinutes:** `?int` — How long a booking can wait for approval before it's declined, in minutes. Default: 1440. - +#### 📝 Description + +
+
+ +
+
+ +Confirms a `pending_approval` booking. +
+
+#### 🔌 Usage +
-**$holdTtlSeconds:** `?int` — How long a hold keeps its slot, in seconds. Default: 600. - +
+
+ +```php +$client->scheduling->bookings->approve( + 'book_01kd2m9a0b1c2d3e4f5g6h7j8m', +); +``` +
+
+#### ⚙️ Parameters +
-**$cancelNoticeMinutes:** `?int` — Attendees can't cancel closer to the start than this. API keys can. +
+
+ +**$id:** `string` — The booking's id.
+
+
+ +
+
+
+ +
$client->scheduling->bookings->decline($id) -> ?SchedulingBooking
-**$rescheduleNoticeMinutes:** `?int` — Attendees can't reschedule closer to the start than this. API keys can. Default: 0. +#### 📝 Description + +
+
+ +
+
+ +Refuses a `pending_approval` booking and frees the time. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```php +$client->scheduling->bookings->decline( + 'book_01kd2m9a0b1c2d3e4f5g6h7j8m', +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**$id:** `string` — The booking's id.
+
+
+ + +
+
+
+ +
$client->scheduling->bookings->notifications($id, $request) -> ?SchedulingBookingNotificationList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +What's been queued for this booking and what became of it, newest first, including why something wasn't sent. It never says who it went to. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```php +$client->scheduling->bookings->notifications( + 'book_01kd2m9a0b1c2d3e4f5g6h7j8m', + new NotificationsBookingsRequest([]), +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**$id:** `string` — The booking's id. + +
+
+ +
+
+ +**$limit:** `?int` + +
+
+ +
+
+ +**$after:** `?string` — The last id of the previous page. + +
+
+
+
+ + +
+
+
+ +
$client->scheduling->bookings->markNoShow($id) -> ?SchedulingBooking +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Records that the attendee didn't come, once the booking has started. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```php +$client->scheduling->bookings->markNoShow( + 'book_01kd2m9a0b1c2d3e4f5g6h7j8m', +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**$id:** `string` — The booking's id. + +
+
+
+
+ + +
+
+
+ +
$client->scheduling->bookings->updateLocation($id, $request) -> ?SchedulingBooking +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Where it happens, such as the meeting link you made after the `scheduling.booking.confirmed` webhook. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```php +$client->scheduling->bookings->updateLocation( + 'book_01kd2m9a0b1c2d3e4f5g6h7j8m', + new UpdateBookingLocationRequest([ + 'location' => new SchedulingLocationZero([ + 'type' => SchedulingLocationZeroType::Link->value, + 'url' => 'https://meet.example.com/abc', + ]), + ]), +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**$id:** `string` — The booking's id. + +
+
+ +
+
+ +**$location:** `SchedulingLocationZero|SchedulingLocationNumber|SchedulingLocationAddress|SchedulingLocationThree|SchedulingLocationFour|SchedulingLocationFive|null` + +
+
+
+
+ + +
+
+
+ +## Scheduling Reassignments +
$client->scheduling->reassignments->preview($request) -> ?SchedulingReassignmentPreview +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Who each booking would go to, and why not when nobody can take it, without moving anything. It works down them in order, so two can't both be promised the same free hour. Change any of it and start the run with `assignments`. Covers the first 500. Things can change before you start it: the run decides again. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```php +$client->scheduling->reassignments->preview( + new PreviewSchedulingReassignmentRequest([ + 'selection' => new SchedulingReassignmentSelection([ + 'host' => 'doctor_482', + 'startBefore' => '2027-08-14T00:00:00.000Z', + ]), + 'strategy' => new SchedulingReassignmentStrategy([ + 'preferredHosts' => [ + 'doctor_518', + ], + ]), + ]), +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**$selection:** `SchedulingReassignmentSelection` + +
+
+ +
+
+ +**$strategy:** `?SchedulingReassignmentStrategy` + +
+
+ +
+
+ +**$overrides:** `?array` + +
+
+
+
+ + +
+
+
+ +
$client->scheduling->reassignments->list($request) -> ?SchedulingReassignmentList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Newest first, with how each is going. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```php +$client->scheduling->reassignments->list( + new ListReassignmentsRequest([]), +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**$limit:** `?int` + +
+
+ +
+
+ +**$after:** `?string` — The last id of the previous page. + +
+
+
+
+ + +
+
+
+ +
$client->scheduling->reassignments->create($request) -> ?SchedulingReassignment +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Moves up to 5,000 bookings in the background, each on its own, so one that can't move never holds up the rest. Nothing's ever cancelled: a booking nobody can take stays where it is, and its item says so. It answers at once: follow the run by its id, or wait for `scheduling.reassignment.completed`. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```php +$client->scheduling->reassignments->create( + new CreateSchedulingReassignmentRequest([ + 'idempotencyKey' => 'welcome-user-123', + 'selection' => new SchedulingReassignmentSelection([ + 'outOfOffice' => 'ooo_01kd2m9a0b1c2d3e4f5g6h7j8m', + ]), + 'strategy' => new SchedulingReassignmentStrategy([ + 'preferredHosts' => [ + 'doctor_518', + ], + ]), + 'reasonCode' => CreateSchedulingReassignmentRequestReasonCode::OutOfOffice->value, + ]), +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**$idempotencyKey:** `?string` — Makes retries safe: a repeated request with the same key and body returns the original run instead of starting another, for 24 hours. 1-256 characters. + +
+
+ +
+
+ +**$selection:** `SchedulingReassignmentSelection` + +
+
+ +
+
+ +**$strategy:** `?SchedulingReassignmentStrategy` + +
+
+ +
+
+ +**$reasonCode:** `string` + +
+
+ +
+
+ +**$note:** `?string` — Why, in your words: required with an override of someone's availability. + +
+
+ +
+
+ +**$overrides:** `?array` + +
+
+ +
+
+ +**$notify:** `?CreateSchedulingReassignmentRequestNotify` + +
+
+
+
+ + +
+
+
+ +
$client->scheduling->reassignments->get($id) -> ?SchedulingReassignment +
+
+ +#### 📝 Description + +
+
+ +
+
+ +How it's going. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```php +$client->scheduling->reassignments->get( + 'id', +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**$id:** `string` — The reassignment's id. + +
+
+
+
+ + +
+
+
+ +
$client->scheduling->reassignments->items($id, $request) -> ?SchedulingReassignmentItemList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Each booking it covers and what happened to it. A group session has one, for one of its seats. Empty until the worker's started on it. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```php +$client->scheduling->reassignments->items( + 'id', + new ItemsReassignmentsRequest([]), +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**$id:** `string` — The reassignment's id. + +
+
+ +
+
+ +**$limit:** `?int` + +
+
+ +
+
+ +**$after:** `?string` — The last id of the previous page. + +
+
+
+
+ + +
+
+
+ +
$client->scheduling->reassignments->cancel($id) -> ?SchedulingReassignment +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Stops what hasn't happened yet. What's moved stays moved: undo it for that. Cancelling one that's finished changes nothing. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```php +$client->scheduling->reassignments->cancel( + 'id', +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**$id:** `string` — The reassignment's id. + +
+
+
+
+ + +
+
+
+ +
$client->scheduling->reassignments->undo($id, $request) -> ?SchedulingReassignment +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Gives back what a finished run moved, as a new run. A booking that's moved on since stays where it went, and a former host who's no longer free keeps it from going back, unless you pass `overrides`. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```php +$client->scheduling->reassignments->undo( + 'id', + new UndoSchedulingReassignmentRequest([ + 'reasonCode' => UndoSchedulingReassignmentRequestReasonCode::Other->value, + ]), +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**$id:** `string` — The reassignment's id. + +
+
+ +
+
+ +**$reasonCode:** `?string` + +
+
+ +
+
+ +**$note:** `?string` + +
+
+ +
+
+ +**$overrides:** `?array` + +
+
+ +
+
+ +**$notify:** `?UndoSchedulingReassignmentRequestNotify` + +
+
+
+
+ + +
+
+
+ +## Scheduling HolidayCalendars +
$client->scheduling->holidayCalendars->list() -> ?SchedulingHolidayCalendarList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +By name. A feed's URL is never shown again. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```php +$client->scheduling->holidayCalendars->list(); +``` +
+
+
+
+ + +
+
+
+ +
$client->scheduling->holidayCalendars->create($request) -> ?SchedulingHolidayCalendar +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Applies a country's public holidays, or your own feed, to some hosts as ordinary out of office entries, kept up to date by coss.com. A host who removes one keeps it removed. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```php +$client->scheduling->holidayCalendars->create( + new CreateSchedulingHolidayCalendarRequest([ + 'name' => 'UK team', + 'country' => 'GB', + 'hostFilter' => [ + 'team' => 'london', + ], + ]), +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**$name:** `string` + +
+
+ +
+
+ +**$country:** `?string` — A code from the list of holiday calendars, such as `GB`. + +
+
+ +
+
+ +**$icsUrl:** `?string` — Your own feed, https or webcal, read in live environments. Stored encrypted. + +
+
+ +
+
+ +**$hosts:** `?array` — These hosts, by id or uid. + +
+
+ +
+
+ +**$hostFilter:** `?array` — Everyone matching these attributes, asked again at every sync. + +
+
+ +
+
+ +**$regions:** `?array` — Which regional holidays apply, matched against how the calendar names them, such as `England`. Without this, all of them do; empty, only nationwide ones. + +
+
+ +
+
+ +**$delegates:** `?array` — Who can be booked in their place on those days, by id or uid, in order. + +
+
+ +
+
+ +**$existingBookings:** `?string` — What happens to bookings already on a holiday. `leave` (the default) only reports them. `reassign` moves them. + +
+
+
+
+ + +
+
+
+ +
$client->scheduling->holidayCalendars->get($id) -> ?SchedulingHolidayCalendar +
+
+ +#### 📝 Description + +
+
+ +
+
+ +With when it was last read, and why not if it couldn't be. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```php +$client->scheduling->holidayCalendars->get( + 'id', +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**$id:** `string` — The holiday calendar's id. + +
+
+
+
+ + +
+
+
+ +
$client->scheduling->holidayCalendars->remove($id) -> ?DeletedSchedulingHolidayCalendar +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Hosts can be booked on its days again, shortly: past entries stay. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```php +$client->scheduling->holidayCalendars->remove( + 'id', +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**$id:** `string` — The holiday calendar's id. + +
+
+
+
+ + +
+
+
+ +
$client->scheduling->holidayCalendars->update($id, $request) -> ?SchedulingHolidayCalendar +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Who it applies to, who covers and what happens to bookings. Takes effect shortly. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```php +$client->scheduling->holidayCalendars->update( + 'id', + new UpdateSchedulingHolidayCalendarRequest([ + 'hostFilter' => [ + 'team' => 'london', + ], + ]), +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**$id:** `string` — The holiday calendar's id. + +
+
+ +
+
+ +**$name:** `?string` + +
+
+ +
+
+ +**$hosts:** `?array` — These hosts, by id or uid. + +
+
+ +
+
+ +**$hostFilter:** `?array` — Everyone matching these attributes, asked again at every sync. + +
+
+ +
+
+ +**$regions:** `?array` — Which regional holidays apply, matched against how the calendar names them, such as `England`. Without this, all of them do; empty, only nationwide ones. + +
+
+ +
+
+ +**$delegates:** `?array` — Who can be booked in their place on those days, by id or uid, in order. + +
+
+ +
+
+ +**$existingBookings:** `?string` — What happens to bookings already on a holiday. `leave` (the default) only reports them. `reassign` moves them. + +
+
+
+
+ + +
+
+
+ +
$client->scheduling->holidayCalendars->holidays($id) -> ?SchedulingHolidayList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +What's coming, with names, as last read. Empty until its first read. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```php +$client->scheduling->holidayCalendars->holidays( + 'id', +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**$id:** `string` — The holiday calendar's id. + +
+
+
+
+ + +
+
+
+ +## Scheduling OutOfOffice +
$client->scheduling->outOfOffice->list($request) -> ?SchedulingOutOfOfficeList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +The environment's entries, newest first. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```php +$client->scheduling->outOfOffice->list( + new ListOutOfOfficeRequest([ + 'startAfter' => '2027-01-04T15:00:00.000Z', + 'startBefore' => '2027-01-04T15:00:00.000Z', + ]), +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**$limit:** `?int` + +
+
+ +
+
+ +**$after:** `?string` — The last id of the previous page. + +
+
+ +
+
+ +**$host:** `?string` — One host's entries, by id or uid. + +
+
+ +
+
+ +**$startAfter:** `?string` — Entries ending after this. + +
+
+ +
+
+ +**$startBefore:** `?string` — Entries starting before this. + +
+
+ +
+
+ +**$group:** `?string` — The entries one request made. + +
+
+
+
+ + +
+
+
+ +
$client->scheduling->outOfOffice->create($request) -> ?SchedulingOutOfOfficeList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Marks one host, a list of hosts or everyone matching some attributes as away, for part of a day or for whole dates. They aren't offered during it. Existing bookings stay as they are: list them with the entry's conflicts. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```php +$client->scheduling->outOfOffice->create( + new CreateSchedulingOutOfOfficeRequest([ + 'host' => 'doctor_482', + 'startDate' => '2027-08-02', + 'endDate' => '2027-08-13', + 'reason' => 'vacation', + 'publicMessage' => 'Back on the 16th.', + ]), +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**$host:** `?string` — One host, by id or uid. + +
+
+ +
+
+ +**$hosts:** `?array` — Several hosts, by id or uid. Each gets an entry of their own. + +
+
+ +
+
+ +**$hostFilter:** `?array` — Every active host matching these attributes right now. A host added later isn't covered. + +
+
+ +
+
+ +**$start:** `?string` — An ISO 8601 instant with an offset. + +
+
+ +
+
+ +**$end:** `?string` — An ISO 8601 instant with an offset. + +
+
+ +
+
+ +**$startDate:** `?string` — The first whole day away. Use instead of `start` and `end`. + +
+
+ +
+
+ +**$endDate:** `?string` — The last whole day away, which is included. + +
+
+ +
+
+ +**$timeZone:** `?string` — What the dates mean in. Default: the host's zone when this is made. + +
+
+ +
+
+ +**$delegates:** `?array` — Who can be booked in this host's place during it, by id or uid, in the order to try them. They still have to fit how a booking's routed. + +
+
+ +
+
+ +**$reason:** `?string` — One of `unspecified`, `vacation`, `travel`, `sick`, `public_holiday`, `parental_leave`, `training` and `other`, or a key from the settings' `out_of_office_reasons`. Only people who manage this host see it: never bookers, webhooks or calendars. + +
+
+ +
+
+ +**$notes:** `?string` — For people who manage this host. Encrypted, and never shown to a booker. + +
+
+ +
+
+ +**$publicMessage:** `?string` — Shown to bookers while this host is away. Can't contain a link. + +
+
+ +
+
+ +**$showOnCalendar:** `?bool` — Put a private "Out of office" event on the host's calendar. Default: true. + +
+
+ +
+
+ +**$existingBookings:** `?string` — What happens to bookings already in the way. `leave` (the default) only reports them. `reassign` moves them, and any nobody can take stay where they are. + +
+
+ +
+
+ +**$reassign:** `?CreateSchedulingOutOfOfficeRequestReassign` — With `existing_bookings: reassign`: who they go to. Default: the fairest who's free. + +
+
+ +
+
+ +**$externalId:** `?string` — Your own id for this entry, unique in the environment. Needs one host. + +
+
+
+
+ + +
+
+
+ +
$client->scheduling->outOfOffice->get($id) -> ?SchedulingOutOfOffice +
+
+ +#### 📝 Description + +
+
+ +
+
+ +One entry. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```php +$client->scheduling->outOfOffice->get( + 'ooo_01kd2m9a0b1c2d3e4f5g6h7j8m', +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**$id:** `string` — The entry's id. + +
+
+
+
+ + +
+
+
+ +
$client->scheduling->outOfOffice->remove($id) -> ?DeletedSchedulingOutOfOffice +
+
+ +#### 📝 Description + +
+
+ +
+
+ +The host can be booked in that time again, and any calendar event for it goes. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```php +$client->scheduling->outOfOffice->remove( + 'ooo_01kd2m9a0b1c2d3e4f5g6h7j8m', +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**$id:** `string` — The entry's id. + +
+
+
+
+ + +
+
+
+ +
$client->scheduling->outOfOffice->update($id, $request) -> ?SchedulingOutOfOffice +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Changes what's given. An entry stays with its host. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```php +$client->scheduling->outOfOffice->update( + 'ooo_01kd2m9a0b1c2d3e4f5g6h7j8m', + new UpdateSchedulingOutOfOfficeRequest([ + 'endDate' => '2027-08-20', + ]), +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**$id:** `string` — The entry's id. + +
+
+ +
+
+ +**$start:** `?string` — An ISO 8601 instant with an offset. + +
+
+ +
+
+ +**$end:** `?string` — An ISO 8601 instant with an offset. + +
+
+ +
+
+ +**$startDate:** `?string` — The first whole day away. Use instead of `start` and `end`. + +
+
+ +
+
+ +**$endDate:** `?string` — The last whole day away, which is included. + +
+
+ +
+
+ +**$timeZone:** `?string` — What the dates mean in. Default: the host's zone when this is made. + +
+
+ +
+
+ +**$reason:** `?string` — One of `unspecified`, `vacation`, `travel`, `sick`, `public_holiday`, `parental_leave`, `training` and `other`, or a key from the settings' `out_of_office_reasons`. Only people who manage this host see it: never bookers, webhooks or calendars. + +
+
+ +
+
+ +**$notes:** `?string` + +
+
+ +
+
+ +**$publicMessage:** `?string` + +
+
+ +
+
+ +**$showOnCalendar:** `?bool` + +
+
+ +
+
+ +**$delegates:** `?array` — Who can be booked in this host's place during it, by id or uid, in the order to try them. They still have to fit how a booking's routed. + +
+
+ +
+
+ +**$existingBookings:** `?string` — What happens to bookings already in the way. `leave` (the default) only reports them. `reassign` moves them, and any nobody can take stay where they are. + +
+
+ +
+
+ +**$reassign:** `?UpdateSchedulingOutOfOfficeRequestReassign` — With `existing_bookings: reassign`: who they go to. Default: the fairest who's free. + +
+
+
+
+ + +
+
+
+ +
$client->scheduling->outOfOffice->put($externalId, $request) -> ?SchedulingOutOfOffice +
+
+ +#### 📝 Description + +
+
+ +
+
+ +For syncing from a system of record such as an HR tool: send what it says, as often as you like, and there's one entry for it. Give every field you want to keep. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```php +$client->scheduling->outOfOffice->put( + 'hr_leave_4471', + new PutSchedulingOutOfOfficeRequest([ + 'host' => 'doctor_482', + 'startDate' => '2027-08-02', + 'endDate' => '2027-08-13', + 'reason' => 'vacation', + ]), +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**$externalId:** `string` — Your own id for the entry. + +
+
+ +
+
+ +**$host:** `string` — The host, by id or uid. + +
+
+ +
+
+ +**$start:** `?string` — An ISO 8601 instant with an offset. + +
+
+ +
+
+ +**$end:** `?string` — An ISO 8601 instant with an offset. + +
+
+ +
+
+ +**$startDate:** `?string` — The first whole day away. Use instead of `start` and `end`. + +
+
+ +
+
+ +**$endDate:** `?string` — The last whole day away, which is included. + +
+
+ +
+
+ +**$timeZone:** `?string` — What the dates mean in. Default: the host's zone when this is made. + +
+
+ +
+
+ +**$delegates:** `?array` — Who can be booked in this host's place during it, by id or uid, in the order to try them. They still have to fit how a booking's routed. + +
+
+ +
+
+ +**$reason:** `?string` — One of `unspecified`, `vacation`, `travel`, `sick`, `public_holiday`, `parental_leave`, `training` and `other`, or a key from the settings' `out_of_office_reasons`. Only people who manage this host see it: never bookers, webhooks or calendars. + +
+
+ +
+
+ +**$notes:** `?string` — For people who manage this host. Encrypted, and never shown to a booker. + +
+
+ +
+
+ +**$publicMessage:** `?string` — Shown to bookers while this host is away. Can't contain a link. + +
+
+ +
+
+ +**$showOnCalendar:** `?bool` — Put a private "Out of office" event on the host's calendar. Default: true. + +
+
+ +
+
+ +**$existingBookings:** `?string` — What happens to bookings already in the way. `leave` (the default) only reports them. `reassign` moves them, and any nobody can take stay where they are. + +
+
+ +
+
+ +**$reassign:** `?PutSchedulingOutOfOfficeRequestReassign` — With `existing_bookings: reassign`: who they go to. Default: the fairest who's free. + +
+
+
+
+ + +
+
+
+ +
$client->scheduling->outOfOffice->conflicts($id, $request) -> ?SchedulingOutOfOfficeConflictList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Live bookings of the host that fall in the entry, soonest first. Entries never change them. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```php +$client->scheduling->outOfOffice->conflicts( + 'ooo_01kd2m9a0b1c2d3e4f5g6h7j8m', + new ConflictsOutOfOfficeRequest([]), +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**$id:** `string` — The entry's id. + +
+
+ +
+
+ +**$limit:** `?int` + +
+
+
+
+ + +
+
+
+ +## Scheduling Schedules +
$client->scheduling->schedules->list($host) -> ?SchedulingScheduleList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +All of the host's schedules, oldest first. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```php +$client->scheduling->schedules->list( + 'host_01kd2m9a0b1c2d3e4f5g6h7j8m', +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**$host:** `string` — The host's id or uid. + +
+
+
+
+ + +
+
+
+ +
$client->scheduling->schedules->create($host, $request) -> ?SchedulingSchedule +
+
+ +#### 📝 Description + +
+
+ +
+
+ +A host's weekly hours and date overrides, in local time. The first one is the host's default. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```php +$client->scheduling->schedules->create( + 'host_01kd2m9a0b1c2d3e4f5g6h7j8m', + new CreateSchedulesRequest([ + 'body' => new UpsertScheduleRequest([ + 'name' => 'Clinic hours', + 'rules' => [ + new SchedulingWeeklyRule([ + 'days' => [ + 1, + 2, + 3, + 4, + 5, + ], + 'start' => '09:00', + 'end' => '17:00', + ]), + ], + 'overrides' => [ + new SchedulingScheduleOverride([ + 'date' => '2027-12-24', + 'ranges' => [ + new SchedulingScheduleOverrideRangesItem([ + 'start' => 'start', + 'end' => 'end', + ]), + ], + ]), + ], + ]), + ]), +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**$host:** `string` — The host's id or uid. + +
+
+ +
+
+ +**$request:** `UpsertScheduleRequest` + +
+
+
+
+ + +
+
+
+ +
$client->scheduling->schedules->get($host, $scheduleId) -> ?SchedulingSchedule +
+
+ +#### 📝 Description + +
+
+ +
+
+ +One of the host's schedules. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```php +$client->scheduling->schedules->get( + 'host_01kd2m9a0b1c2d3e4f5g6h7j8m', + 'sched_01kd2m9a0b1c2d3e4f5g6h7j8m', +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**$host:** `string` — The host's id or uid. + +
+
+ +
+
+ +**$scheduleId:** `string` — The schedule's id. + +
+
+
+
+ + +
+
+
+ +
$client->scheduling->schedules->update($host, $scheduleId, $request) -> ?SchedulingSchedule +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Replaces its weekly rules, and its overrides when given. Existing bookings stay: a schedule only decides what's offered next. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```php +$client->scheduling->schedules->update( + 'host_01kd2m9a0b1c2d3e4f5g6h7j8m', + 'sched_01kd2m9a0b1c2d3e4f5g6h7j8m', + new UpdateSchedulesRequest([ + 'body' => new UpsertScheduleRequest([ + 'name' => 'Clinic hours', + 'rules' => [ + new SchedulingWeeklyRule([ + 'days' => [ + 1, + 2, + 3, + 4, + 5, + ], + 'start' => '09:00', + 'end' => '17:00', + ]), + ], + 'overrides' => [ + new SchedulingScheduleOverride([ + 'date' => '2027-12-24', + 'ranges' => [ + new SchedulingScheduleOverrideRangesItem([ + 'start' => 'start', + 'end' => 'end', + ]), + ], + ]), + ], + ]), + ]), +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
-**$maxGuests:** `?int` — How many people an attendee can add to a booking. Default: 0. Guests are emailed about it. Not on `group`. +**$host:** `string` — The host's id or uid.
@@ -17529,7 +19930,7 @@ $client->scheduling->eventTypes->create(
-**$maxActiveBookingsPerAttendee:** `?int` — How many upcoming bookings of this event type one person can have at a time, known by `uid` or email. Default: `null`, no limit. Past this, booking answers `attendee_limit_reached`. Guests don't count, and each occurrence of a series does. +**$scheduleId:** `string` — The schedule's id.
@@ -17537,55 +19938,64 @@ $client->scheduling->eventTypes->create(
-**$hostCalendarDetails:** `?string` — What hosts' calendars say about a booking. `neutral` (the default): a private event titled "Appointment". `full`: a private event with this title and the attendee's name, plus names, emails and phone numbers in its description, which go to the host's calendar provider. Never answers. Refused in HIPAA mode. +**$request:** `UpsertScheduleRequest`
+
+
-
-
-**$questions:** `?array` — What attendees are asked when booking. Keys must be unique. -
+
+
$client->scheduling->schedules->remove($host, $scheduleId) -> ?DeletedSchedulingSchedule
-**$locations:** `?array` — Where bookings can meet. A browser only chooses among these. A `group` event type can't use `zoom`. - -
-
+#### 📝 Description
-**$hostFilter:** `?array` — Pool members also include active hosts matching all of these attributes. - -
-
-
-**$notifications:** `?array` — Per event, overriding your settings for this event type. - +Refused for the host's default schedule. +
+
+#### 🔌 Usage +
-**$reminders:** `?array` — Replaces your settings' `reminders` for this event type. `null` inherits them; an empty list means none. - +
+
+ +```php +$client->scheduling->schedules->remove( + 'host_01kd2m9a0b1c2d3e4f5g6h7j8m', + 'sched_01kd2m9a0b1c2d3e4f5g6h7j8m', +); +``` +
+
+#### ⚙️ Parameters +
-**$metadata:** `?array` — Your own key-value pairs. +
+
+ +**$host:** `string` — The host's id or uid.
@@ -17593,7 +20003,7 @@ $client->scheduling->eventTypes->create(
-**$hosts:** `?array` — Who can be booked. `one_on_one` and `group` take one; `collective` needs at least one `required` host. +**$scheduleId:** `string` — The schedule's id.
@@ -17605,7 +20015,8 @@ $client->scheduling->eventTypes->create(
-
$client->scheduling->eventTypes->get($eventType) -> ?SchedulingEventType +## Scheduling EventTypes +
$client->scheduling->eventTypes->list($request) -> ?SchedulingEventTypeList
@@ -17617,7 +20028,7 @@ $client->scheduling->eventTypes->create(
-An event type by its id or your uid. +The environment's event types, newest first.
@@ -17632,8 +20043,8 @@ An event type by its id or your uid.
```php -$client->scheduling->eventTypes->get( - 'evtype_01kd2m9a0b1c2d3e4f5g6h7j8m', +$client->scheduling->eventTypes->list( + new ListEventTypesRequest([]), ); ```
@@ -17649,7 +20060,15 @@ $client->scheduling->eventTypes->get(
-**$eventType:** `string` — The event type's id or uid. +**$limit:** `?int` + +
+
+ +
+
+ +**$after:** `?string` — The last id of the previous page.
@@ -17661,7 +20080,7 @@ $client->scheduling->eventTypes->get(
-
$client->scheduling->eventTypes->update($eventType, $request) -> ?SchedulingEventType +
$client->scheduling->eventTypes->create($request) -> ?SchedulingEventType
@@ -17673,7 +20092,7 @@ $client->scheduling->eventTypes->get(
-Changes what's given. Existing bookings keep what they were booked with. Set `status` to `archived` to stop new bookings. +What can be booked: `one_on_one` with one host, `pool` for any free host, `collective` when every required host must be free, or `group` for a session with seats.
@@ -17688,10 +20107,18 @@ Changes what's given. Existing bookings keep what they were booked with. Set `st
```php -$client->scheduling->eventTypes->update( - 'evtype_01kd2m9a0b1c2d3e4f5g6h7j8m', - new UpdateEventTypeRequest([ - 'minNoticeMinutes' => 240, +$client->scheduling->eventTypes->create( + new CreateEventTypeRequest([ + 'kind' => CreateEventTypeRequestKind::OneOnOne->value, + 'title' => 'Initial consultation', + 'durationMinutes' => 30, + 'bufferAfterMinutes' => 10, + 'minNoticeMinutes' => 120, + 'hosts' => [ + new SchedulingEventTypeHostInput([ + 'host' => 'doctor_482', + ]), + ], ]), ); ``` @@ -17708,7 +20135,7 @@ $client->scheduling->eventTypes->update(
-**$eventType:** `string` — The event type's id or uid. +**$uid:** `?string` — Your own id for this event type, unique in the environment, accepted wherever its id is.
@@ -17716,7 +20143,7 @@ $client->scheduling->eventTypes->update(
-**$uid:** `?string` — Your own id for this event type. `null` removes it. +**$kind:** `?string` — Who a booking needs. `one_on_one`: one host. `pool`: any one of its hosts. `collective`: every `required` host, plus at most one `member`. `group`: one host, with attendees taking seats up to `capacity`. Fixed once created.
@@ -17732,7 +20159,7 @@ $client->scheduling->eventTypes->update(
-**$title:** `?string` — Shown to attendees and in emails. Host calendars show it only with `host_calendar_details: full`. +**$title:** `string` — Shown to attendees and in emails. Host calendars show it only with `host_calendar_details: full`.
@@ -17740,7 +20167,7 @@ $client->scheduling->eventTypes->update(
-**$durationMinutes:** `?int` — How long a booking lasts by default, in minutes. +**$durationMinutes:** `int` — How long a booking lasts by default, in minutes.
@@ -17828,6 +20255,14 @@ $client->scheduling->eventTypes->update(
+**$reassignmentEnabled:** `?bool` — Whether bookings of this event type can go to another host. Default: true. + +
+
+ +
+
+ **$approvalTtlMinutes:** `?int` — How long a booking can wait for approval before it's declined, in minutes. Default: 1440.
@@ -17932,116 +20367,7 @@ $client->scheduling->eventTypes->update(
-**$status:** `?string` — `archived` stops new bookings, and keeps existing ones. - -
-
- -
-
- -**$hosts:** `?array` — Replaces the assigned hosts. Removed hosts keep their existing bookings. - -
-
-
-
- - - - -
- -## Scheduling Slots -
$client->scheduling->slots->list($eventType, $request) -> ?SchedulingSlotList -
-
- -#### 📝 Description - -
-
- -
-
- -Starts an attendee can book between `start` and `end` (at most 62 days), as UTC instants to show in their own time zone. A host whose calendar can't be read isn't offered. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```php -$client->scheduling->slots->list( - 'evtype_01kd2m9a0b1c2d3e4f5g6h7j8m', - new ListSlotsRequest([ - 'start' => '2027-01-04T15:00:00.000Z', - 'end' => '2027-01-04T15:00:00.000Z', - ]), -); -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**$eventType:** `string` — The event type's id or uid. - -
-
- -
-
- -**$start:** `string` — An ISO 8601 instant with an offset. - -
-
- -
-
- -**$end:** `string` — An ISO 8601 instant with an offset. - -
-
- -
-
- -**$host:** `?string` — Only this host's slots (id or uid). - -
-
- -
-
- -**$durationMinutes:** `?int` - -
-
- -
-
- -**$attributes:** `?string` — A JSON object narrowing a pool, such as `{"licensed_in":"CA"}`. +**$hosts:** `?array` — Who can be booked. `one_on_one` and `group` take one; `collective` needs at least one `required` host.
@@ -18053,7 +20379,7 @@ $client->scheduling->slots->list(
-
$client->scheduling->slots->explain($eventType, $request) -> ?SchedulingSlotExplanation +
$client->scheduling->eventTypes->get($eventType) -> ?SchedulingEventType
@@ -18065,7 +20391,7 @@ $client->scheduling->slots->list(
-Why one start can or can't be booked right now, host by host, decided the same way a booking is. For support and debugging: it says when a host is busy, so don't show it to attendees. +An event type by its id or your uid.
@@ -18080,11 +20406,8 @@ Why one start can or can't be booked right now, host by host, decided the same w
```php -$client->scheduling->slots->explain( +$client->scheduling->eventTypes->get( 'evtype_01kd2m9a0b1c2d3e4f5g6h7j8m', - new ExplainSlotsRequest([ - 'start' => '2027-01-04T15:00:00.000Z', - ]), ); ```
@@ -18092,47 +20415,15 @@ $client->scheduling->slots->explain(
-#### ⚙️ Parameters - -
-
- -
-
- -**$eventType:** `string` — The event type's id or uid. - -
-
- -
-
- -**$start:** `string` — An ISO 8601 instant with an offset. - -
-
- -
-
- -**$host:** `?string` — Only this host (id or uid). - -
-
- +#### ⚙️ Parameters +
-**$durationMinutes:** `?int` - -
-
-
-**$attributes:** `?string` — A JSON object narrowing a pool, such as `{"licensed_in":"CA"}`. +**$eventType:** `string` — The event type's id or uid.
@@ -18144,8 +20435,7 @@ $client->scheduling->slots->explain(
-## Scheduling Availability -
$client->scheduling->availability->search($request) -> ?SchedulingAvailabilitySearchResult +
$client->scheduling->eventTypes->update($eventType, $request) -> ?SchedulingEventType
@@ -18157,7 +20447,7 @@ $client->scheduling->slots->explain(
-For "who's free" pages: each matching host's soonest slots, soonest first, across up to 500 hosts. +Changes what's given. Existing bookings keep what they were booked with. Set `status` to `archived` to stop new bookings.
@@ -18172,14 +20462,10 @@ For "who's free" pages: each matching host's soonest slots, soonest first, acros
```php -$client->scheduling->availability->search( - new AvailabilitySearchRequest([ - 'eventType' => 'evtype_01kd2m9a0b1c2d3e4f5g6h7j8m', - 'start' => '2027-01-04T00:00:00.000Z', - 'end' => '2027-01-18T00:00:00.000Z', - 'attributes' => [ - 'licensed_in' => 'CA', - ], +$client->scheduling->eventTypes->update( + 'evtype_01kd2m9a0b1c2d3e4f5g6h7j8m', + new UpdateEventTypeRequest([ + 'minNoticeMinutes' => 240, ]), ); ``` @@ -18204,7 +20490,7 @@ $client->scheduling->availability->search(
-**$start:** `string` — An ISO 8601 instant with an offset. +**$uid:** `?string` — Your own id for this event type. `null` removes it.
@@ -18212,7 +20498,7 @@ $client->scheduling->availability->search(
-**$end:** `string` — An ISO 8601 instant with an offset. +**$description:** `?string` — Plain text about the event type, shown on hosted booking pages and never in emails. Links, and anything shaped like a domain, must be on your organization's verified domains or their subdomains, and use `https`. `null` removes it.
@@ -18220,7 +20506,7 @@ $client->scheduling->availability->search(
-**$attributes:** `?array` — Only hosts matching all of these. +**$title:** `?string` — Shown to attendees and in emails. Host calendars show it only with `host_calendar_details: full`.
@@ -18228,7 +20514,7 @@ $client->scheduling->availability->search(
-**$hosts:** `?array` — Only these hosts (ids or uids). Default: everyone the event type could offer. +**$durationMinutes:** `?int` — How long a booking lasts by default, in minutes.
@@ -18236,7 +20522,7 @@ $client->scheduling->availability->search(
-**$slotsPerHost:** `?int` — How many of each host's soonest slots to return. +**$durationOptions:** `?array` — Other lengths an attendee may choose, in minutes. Empty: only `duration_minutes`.
@@ -18244,67 +20530,31 @@ $client->scheduling->availability->search(
-**$limit:** `?int` — Hosts to return, soonest availability first. +**$stepMinutes:** `?int` — How far apart slots start. Default: the duration.
-
-
- - - - -
- -## Scheduling Bookings -
$client->scheduling->bookings->list($request) -> ?SchedulingBookingList -
-
- -#### 📝 Description
-
-
- -The environment's bookings, newest first. Answers aren't included. -
-
+**$gridTimeZone:** `?string` — The zone slots align in. Default: each host's own. +
-#### 🔌 Usage - -
-
-
-```php -$client->scheduling->bookings->list( - new ListBookingsRequest([ - 'startAfter' => '2027-01-04T15:00:00.000Z', - 'startBefore' => '2027-01-04T15:00:00.000Z', - ]), -); -``` -
-
+**$bufferBeforeMinutes:** `?int` — Minutes kept free before each booking. Default: 0. +
-#### ⚙️ Parameters - -
-
-
-**$limit:** `?int` +**$bufferAfterMinutes:** `?int` — Minutes kept free after each booking. Default: 0.
@@ -18312,7 +20562,7 @@ $client->scheduling->bookings->list(
-**$after:** `?string` — The last id of the previous page. +**$minNoticeMinutes:** `?int` — Slots starting sooner than this many minutes from now aren't offered. Default: 0.
@@ -18320,7 +20570,7 @@ $client->scheduling->bookings->list(
-**$host:** `?string` +**$bookingWindow:** `SchedulingBookingWindowDays|SchedulingBookingWindowFrom|null`
@@ -18328,7 +20578,7 @@ $client->scheduling->bookings->list(
-**$eventType:** `?string` +**$limits:** `?array` — Caps on bookings per day or week. Default: none.
@@ -18336,7 +20586,7 @@ $client->scheduling->bookings->list(
-**$status:** `?string` +**$capacity:** `?int` — Attendees per session. Required for, and only allowed on, `group`.
@@ -18344,7 +20594,7 @@ $client->scheduling->bookings->list(
-**$attendeeUid:** `?string` +**$requiresApproval:** `?bool` — Bookings start as `pending_approval`, holding the time until approved or declined. Default: `false`.
@@ -18352,7 +20602,7 @@ $client->scheduling->bookings->list(
-**$startAfter:** `?string` — An ISO 8601 instant with an offset. +**$reassignmentEnabled:** `?bool` — Whether bookings of this event type can go to another host. Default: true.
@@ -18360,73 +20610,39 @@ $client->scheduling->bookings->list(
-**$startBefore:** `?string` — An ISO 8601 instant with an offset. +**$approvalTtlMinutes:** `?int` — How long a booking can wait for approval before it's declined, in minutes. Default: 1440.
-
-
- - -
-
-
-
$client->scheduling->bookings->create($request) -> ?SchedulingBooking
-#### 📝 Description - -
-
+**$holdTtlSeconds:** `?int` — How long a hold keeps its slot, in seconds. Default: 600. + +
+
-Books a slot, or joins a group session. Without a `host`, a pool chooses fairly among those free. An event type that requires approval answers with a `pending_approval` booking. -
-
+**$cancelNoticeMinutes:** `?int` — Attendees can't cancel closer to the start than this. API keys can. +
-#### 🔌 Usage -
-
-
- -```php -$client->scheduling->bookings->create( - new CreateBookingRequest([ - 'idempotencyKey' => 'welcome-user-123', - 'eventType' => 'evtype_01kd2m9a0b1c2d3e4f5g6h7j8m', - 'start' => '2027-01-04T15:00:00.000Z', - 'attendee' => new SchedulingAttendeeInput([ - 'uid' => 'patient_77', - 'name' => 'Sam Lee', - 'email' => 'sam@example.com', - 'timeZone' => 'UTC', - ]), - ]), -); -``` -
-
+**$rescheduleNoticeMinutes:** `?int` — Attendees can't reschedule closer to the start than this. API keys can. Default: 0. +
-#### ⚙️ Parameters -
-
-
- -**$idempotencyKey:** `?string` — Makes retries safe: a repeated request with the same key and body returns the original booking instead of creating another, for 24 hours. A refused request keeps no key. 1-256 characters. +**$maxGuests:** `?int` — How many people an attendee can add to a booking. Default: 0. Guests are emailed about it. Not on `group`.
@@ -18434,7 +20650,7 @@ $client->scheduling->bookings->create(
-**$eventType:** `string` — The event type's id or uid. +**$maxActiveBookingsPerAttendee:** `?int` — How many upcoming bookings of this event type one person can have at a time, known by `uid` or email. Default: `null`, no limit. Past this, booking answers `attendee_limit_reached`. Guests don't count, and each occurrence of a series does.
@@ -18442,7 +20658,7 @@ $client->scheduling->bookings->create(
-**$start:** `string` — An ISO 8601 instant with an offset. +**$hostCalendarDetails:** `?string` — What hosts' calendars say about a booking. `neutral` (the default): a private event titled "Appointment". `full`: a private event with this title and the attendee's name, plus names, emails and phone numbers in its description, which go to the host's calendar provider. Never answers. Refused in HIPAA mode.
@@ -18450,7 +20666,7 @@ $client->scheduling->bookings->create(
-**$host:** `?string` — A specific host (id or uid). Default: chosen fairly from those free. +**$questions:** `?array` — What attendees are asked when booking. Keys must be unique.
@@ -18458,7 +20674,7 @@ $client->scheduling->bookings->create(
-**$attributes:** `?array` — Only choose among pool hosts matching all of these. +**$locations:** `?array` — Where bookings can meet. A browser only chooses among these. A `group` event type can't use `zoom`.
@@ -18466,7 +20682,7 @@ $client->scheduling->bookings->create(
-**$durationMinutes:** `?int` — One of the event type's `duration_options`. +**$hostFilter:** `?array` — Pool members also include active hosts matching all of these attributes.
@@ -18474,7 +20690,7 @@ $client->scheduling->bookings->create(
-**$attendee:** `SchedulingAttendeeInput` +**$notifications:** `?array` — Per event, overriding your settings for this event type.
@@ -18482,7 +20698,7 @@ $client->scheduling->bookings->create(
-**$guests:** `?array` — Up to the event type's `max_guests`. +**$reminders:** `?array` — Replaces your settings' `reminders` for this event type. `null` inherits them; an empty list means none.
@@ -18490,7 +20706,7 @@ $client->scheduling->bookings->create(
-**$answers:** `?array` — Answers to the event type's questions. Stored encrypted, and returned only by retrieving the booking. +**$metadata:** `?array` — Your own key-value pairs.
@@ -18498,7 +20714,7 @@ $client->scheduling->bookings->create(
-**$location:** `?CreateBookingRequestLocation` — One of the event type's `locations`, with your link filled in if it has none. +**$status:** `?string` — `archived` stops new bookings, and keeps existing ones.
@@ -18506,7 +20722,7 @@ $client->scheduling->bookings->create(
-**$metadata:** `?array` — Your own key-value pairs. Don't put sensitive data here. +**$hosts:** `?array` — Replaces the assigned hosts. Removed hosts keep their existing bookings.
@@ -18518,7 +20734,8 @@ $client->scheduling->bookings->create(
-
$client->scheduling->bookings->get($id) -> ?SchedulingBooking +## Scheduling Slots +
$client->scheduling->slots->list($eventType, $request) -> ?SchedulingSlotList
@@ -18530,7 +20747,7 @@ $client->scheduling->bookings->create(
-A booking with its attendees and their answers. +Starts an attendee can book between `start` and `end` (at most 62 days), as UTC instants to show in their own time zone. A host whose calendar can't be read isn't offered.
@@ -18545,8 +20762,12 @@ A booking with its attendees and their answers.
```php -$client->scheduling->bookings->get( - 'book_01kd2m9a0b1c2d3e4f5g6h7j8m', +$client->scheduling->slots->list( + 'evtype_01kd2m9a0b1c2d3e4f5g6h7j8m', + new ListSlotsRequest([ + 'start' => '2027-01-04T15:00:00.000Z', + 'end' => '2027-01-04T15:00:00.000Z', + ]), ); ```
@@ -18562,7 +20783,47 @@ $client->scheduling->bookings->get(
-**$id:** `string` — The booking's id. +**$eventType:** `string` — The event type's id or uid. + +
+
+ +
+
+ +**$start:** `string` — An ISO 8601 instant with an offset. + +
+
+ +
+
+ +**$end:** `string` — An ISO 8601 instant with an offset. + +
+
+ +
+
+ +**$host:** `?string` — Only this host's slots (id or uid). + +
+
+ +
+
+ +**$durationMinutes:** `?int` + +
+
+ +
+
+ +**$attributes:** `?string` — A JSON object narrowing a pool, such as `{"licensed_in":"CA"}`.
@@ -18574,7 +20835,7 @@ $client->scheduling->bookings->get(
-
$client->scheduling->bookings->reschedule($id, $request) -> ?SchedulingBooking +
$client->scheduling->slots->explain($eventType, $request) -> ?SchedulingSlotExplanation
@@ -18586,7 +20847,7 @@ $client->scheduling->bookings->get(
-Moves it to a new time, keeping its id. The old time stays booked if the new one isn't free. +Why one start can or can't be booked right now, host by host, decided the same way a booking is. For support and debugging: it says when a host is busy, so don't show it to attendees.
@@ -18601,10 +20862,10 @@ Moves it to a new time, keeping its id. The old time stays booked if the new one
```php -$client->scheduling->bookings->reschedule( - 'book_01kd2m9a0b1c2d3e4f5g6h7j8m', - new RescheduleBookingRequest([ - 'start' => '2027-01-05T15:00:00.000Z', +$client->scheduling->slots->explain( + 'evtype_01kd2m9a0b1c2d3e4f5g6h7j8m', + new ExplainSlotsRequest([ + 'start' => '2027-01-04T15:00:00.000Z', ]), ); ``` @@ -18621,7 +20882,7 @@ $client->scheduling->bookings->reschedule(
-**$id:** `string` — The booking's id. +**$eventType:** `string` — The event type's id or uid.
@@ -18629,7 +20890,23 @@ $client->scheduling->bookings->reschedule(
-**$start:** `string` — The new start. The old time stays booked unless this one's free. +**$start:** `string` — An ISO 8601 instant with an offset. + +
+
+ +
+
+ +**$host:** `?string` — Only this host (id or uid). + +
+
+ +
+
+ +**$durationMinutes:** `?int`
@@ -18637,7 +20914,7 @@ $client->scheduling->bookings->reschedule(
-**$host:** `?string` — Move a pool booking to this host. Default: its current hosts. +**$attributes:** `?string` — A JSON object narrowing a pool, such as `{"licensed_in":"CA"}`.
@@ -18649,7 +20926,8 @@ $client->scheduling->bookings->reschedule(
-
$client->scheduling->bookings->cancel($id, $request) -> ?SchedulingBooking +## Scheduling Availability +
$client->scheduling->availability->search($request) -> ?SchedulingAvailabilitySearchResult
@@ -18661,7 +20939,7 @@ $client->scheduling->bookings->reschedule(
-Frees the time and removes the calendar event. A cancelled booking stays charged. +For "who's free" pages: each matching host's soonest slots, soonest first, across up to 500 hosts.
@@ -18676,10 +20954,14 @@ Frees the time and removes the calendar event. A cancelled booking stays charged
```php -$client->scheduling->bookings->cancel( - 'book_01kd2m9a0b1c2d3e4f5g6h7j8m', - new CancelSchedulingBookingRequest([ - 'reason' => 'Feeling better', +$client->scheduling->availability->search( + new AvailabilitySearchRequest([ + 'eventType' => 'evtype_01kd2m9a0b1c2d3e4f5g6h7j8m', + 'start' => '2027-01-04T00:00:00.000Z', + 'end' => '2027-01-18T00:00:00.000Z', + 'attributes' => [ + 'licensed_in' => 'CA', + ], ]), ); ``` @@ -18696,7 +20978,7 @@ $client->scheduling->bookings->cancel(
-**$id:** `string` — The booking's id. +**$eventType:** `string` — The event type's id or uid.
@@ -18704,7 +20986,47 @@ $client->scheduling->bookings->cancel(
-**$reason:** `?string` — Why it's being cancelled. Only retrieving this booking returns it: it's never in webhooks, logs or emails. +**$start:** `string` — An ISO 8601 instant with an offset. + +
+
+ +
+
+ +**$end:** `string` — An ISO 8601 instant with an offset. + +
+
+ +
+
+ +**$attributes:** `?array` — Only hosts matching all of these. + +
+
+ +
+
+ +**$hosts:** `?array` — Only these hosts (ids or uids). Default: everyone the event type could offer. + +
+
+ +
+
+ +**$slotsPerHost:** `?int` — How many of each host's soonest slots to return. + +
+
+ +
+
+ +**$limit:** `?int` — Hosts to return, soonest availability first.
@@ -18716,7 +21038,8 @@ $client->scheduling->bookings->cancel(
-
$client->scheduling->bookings->events($id, $request) -> ?SchedulingBookingEventList +## Scheduling Holds +
$client->scheduling->holds->create($request) -> ?SchedulingBooking
@@ -18728,7 +21051,7 @@ $client->scheduling->bookings->cancel(
-What's happened to a booking, oldest first, and who did it. There's no personal data in here. +Keeps a slot for a while (the event type's `hold_ttl_seconds`) so you can take payment, then confirm it. Answers with a `held` booking, which isn't charged and sends nothing.
@@ -18743,9 +21066,16 @@ What's happened to a booking, oldest first, and who did it. There's no personal
```php -$client->scheduling->bookings->events( - 'book_01kd2m9a0b1c2d3e4f5g6h7j8m', - new EventsBookingsRequest([]), +$client->scheduling->holds->create( + new CreateHoldRequest([ + 'idempotencyKey' => 'welcome-user-123', + 'eventType' => 'evtype_01kd2m9a0b1c2d3e4f5g6h7j8m', + 'start' => '2027-01-04T15:00:00.000Z', + 'attendee' => new SchedulingAttendeeInput([ + 'uid' => 'patient_77', + 'timeZone' => 'UTC', + ]), + ]), ); ```
@@ -18761,7 +21091,7 @@ $client->scheduling->bookings->events(
-**$id:** `string` — The booking's id. +**$idempotencyKey:** `?string` — Makes retries safe: a repeated request with the same key and body returns the original booking instead of creating another, for 24 hours. A refused request keeps no key. 1-256 characters.
@@ -18769,7 +21099,7 @@ $client->scheduling->bookings->events(
-**$limit:** `?int` +**$eventType:** `string` — The event type's id or uid.
@@ -18777,63 +21107,71 @@ $client->scheduling->bookings->events(
-**$after:** `?string` — The last id of the previous page. +**$start:** `string` — An ISO 8601 instant with an offset.
- -
+
+
+**$host:** `?string` — A specific host (id or uid). Default: chosen fairly from those free. +
-
-
$client->scheduling->bookings->approve($id) -> ?SchedulingBooking
-#### 📝 Description +**$attributes:** `?array` — Only choose among pool hosts matching all of these. + +
+
+**$durationMinutes:** `?int` — One of the event type's `duration_options`. + +
+
+
-Confirms a `pending_approval` booking. -
-
+**$attendee:** `SchedulingAttendeeInput` + -#### 🔌 Usage -
+**$guests:** `?array` — Up to the event type's `max_guests`. + +
+
+
-```php -$client->scheduling->bookings->approve( - 'book_01kd2m9a0b1c2d3e4f5g6h7j8m', -); -``` -
-
+**$answers:** `?array` — Answers to the event type's questions. Stored encrypted, and returned only by retrieving the booking. + -#### ⚙️ Parameters -
+**$location:** `?CreateHoldRequestLocation` — One of the event type's `locations`, with your link filled in if it has none. + +
+
+
-**$id:** `string` — The booking's id. +**$metadata:** `?array` — Your own key-value pairs. Don't put sensitive data here.
@@ -18845,7 +21183,7 @@ $client->scheduling->bookings->approve(
-
$client->scheduling->bookings->decline($id) -> ?SchedulingBooking +
$client->scheduling->holds->confirm($id, $request) -> ?SchedulingBooking
@@ -18857,7 +21195,7 @@ $client->scheduling->bookings->approve(
-Refuses a `pending_approval` booking and frees the time. +Turns a hold into a booking. Always succeeds before the hold expires. Repeating it is safe.
@@ -18872,8 +21210,11 @@ Refuses a `pending_approval` booking and frees the time.
```php -$client->scheduling->bookings->decline( +$client->scheduling->holds->confirm( 'book_01kd2m9a0b1c2d3e4f5g6h7j8m', + new ConfirmHoldRequest([ + 'ifStillFree' => true, + ]), ); ```
@@ -18891,6 +21232,14 @@ $client->scheduling->bookings->decline( **$id:** `string` — The booking's id. + +
+ +
+
+ +**$ifStillFree:** `?bool` — After the hold expired, book anyway if nobody else took the slot. Default: refuse with `hold_expired`. +
@@ -18901,7 +21250,7 @@ $client->scheduling->bookings->decline(
-
$client->scheduling->bookings->notifications($id, $request) -> ?SchedulingBookingNotificationList +
$client->scheduling->holds->release($id) -> ?SchedulingBooking
@@ -18913,7 +21262,7 @@ $client->scheduling->bookings->decline(
-What's been queued for this booking and what became of it, newest first, including why something wasn't sent. It never says who it went to. +Gives the slot back early.
@@ -18928,9 +21277,8 @@ What's been queued for this booking and what became of it, newest first, includi
```php -$client->scheduling->bookings->notifications( +$client->scheduling->holds->release( 'book_01kd2m9a0b1c2d3e4f5g6h7j8m', - new NotificationsBookingsRequest([]), ); ```
@@ -18948,22 +21296,6 @@ $client->scheduling->bookings->notifications( **$id:** `string` — The booking's id. - -
- -
-
- -**$limit:** `?int` - -
-
- -
-
- -**$after:** `?string` — The last id of the previous page. -
@@ -18974,7 +21306,8 @@ $client->scheduling->bookings->notifications(
-
$client->scheduling->bookings->markNoShow($id) -> ?SchedulingBooking +## Scheduling Series +
$client->scheduling->series->create($request) -> ?SchedulingSeries
@@ -18986,7 +21319,7 @@ $client->scheduling->bookings->notifications(
-Records that the attendee didn't come, once the booking has started. +Books up to 52 occurrences, keeping the attendee's local time across DST changes. Each one is an ordinary booking that can move on its own, and a pool keeps one host throughout.
@@ -19001,8 +21334,23 @@ Records that the attendee didn't come, once the booking has started.
```php -$client->scheduling->bookings->markNoShow( - 'book_01kd2m9a0b1c2d3e4f5g6h7j8m', +$client->scheduling->series->create( + new CreateSeriesBody([ + 'idempotencyKey' => 'welcome-user-123', + 'body' => new CreateSeriesRequest([ + 'eventType' => 'evtype_01kd2m9a0b1c2d3e4f5g6h7j8m', + 'start' => '2027-01-04T15:00:00.000Z', + 'attendee' => new SchedulingAttendeeInput([ + 'uid' => 'patient_77', + 'timeZone' => 'America/New_York', + ]), + 'recurrence' => new CreateSeriesRequestRecurrence([ + 'frequency' => CreateSeriesRequestRecurrenceFrequency::Weekly->value, + 'interval' => 1, + 'count' => 12, + ]), + ]), + ]), ); ```
@@ -19018,7 +21366,15 @@ $client->scheduling->bookings->markNoShow(
-**$id:** `string` — The booking's id. +**$idempotencyKey:** `?string` — Makes retries safe: a repeated request with the same key and body returns the original booking instead of creating another, for 24 hours. A refused request keeps no key. 1-256 characters. + +
+
+ +
+
+ +**$request:** `CreateSeriesRequest`
@@ -19030,7 +21386,7 @@ $client->scheduling->bookings->markNoShow(
-
$client->scheduling->bookings->updateLocation($id, $request) -> ?SchedulingBooking +
$client->scheduling->series->preview($request) -> ?SchedulingSeriesPreview
@@ -19042,7 +21398,7 @@ $client->scheduling->bookings->markNoShow(
-Where it happens, such as the meeting link you made after the `scheduling.booking.confirmed` webhook. +Which occurrences would be free, without booking anything.
@@ -19057,12 +21413,19 @@ Where it happens, such as the meeting link you made after the `scheduling.bookin
```php -$client->scheduling->bookings->updateLocation( - 'book_01kd2m9a0b1c2d3e4f5g6h7j8m', - new UpdateBookingLocationRequest([ - 'location' => SchedulingLocation::link(new SchedulingLocationLink([ - 'url' => 'https://meet.example.com/abc', - ])), +$client->scheduling->series->preview( + new CreateSeriesRequest([ + 'eventType' => 'evtype_01kd2m9a0b1c2d3e4f5g6h7j8m', + 'start' => '2027-01-04T15:00:00.000Z', + 'attendee' => new SchedulingAttendeeInput([ + 'uid' => 'patient_77', + 'timeZone' => 'America/New_York', + ]), + 'recurrence' => new CreateSeriesRequestRecurrence([ + 'frequency' => CreateSeriesRequestRecurrenceFrequency::Weekly->value, + 'interval' => 1, + 'count' => 12, + ]), ]), ); ``` @@ -19079,15 +21442,7 @@ $client->scheduling->bookings->updateLocation(
-**$id:** `string` — The booking's id. - -
-
- -
-
- -**$location:** `SchedulingLocation` +**$request:** `CreateSeriesRequest`
@@ -19099,8 +21454,7 @@ $client->scheduling->bookings->updateLocation(
-## Scheduling Holds -
$client->scheduling->holds->create($request) -> ?SchedulingBooking +
$client->scheduling->series->cancel($id, $request) -> ?SchedulingCancelledSeries
@@ -19112,7 +21466,7 @@ $client->scheduling->bookings->updateLocation(
-Keeps a slot for a while (the event type's `hold_ttl_seconds`) so you can take payment, then confirm it. Answers with a `held` booking, which isn't charged and sends nothing. +Cancels the occurrences from `from_index` on, or all of them.
@@ -19127,15 +21481,10 @@ Keeps a slot for a while (the event type's `hold_ttl_seconds`) so you can take p
```php -$client->scheduling->holds->create( - new CreateHoldRequest([ - 'idempotencyKey' => 'welcome-user-123', - 'eventType' => 'evtype_01kd2m9a0b1c2d3e4f5g6h7j8m', - 'start' => '2027-01-04T15:00:00.000Z', - 'attendee' => new SchedulingAttendeeInput([ - 'uid' => 'patient_77', - 'timeZone' => 'UTC', - ]), +$client->scheduling->series->cancel( + 'series_01kd2m9a0b1c2d3e4f5g6h7j8m', + new CancelSeriesRequest([ + 'fromIndex' => 4, ]), ); ``` @@ -19152,7 +21501,7 @@ $client->scheduling->holds->create(
-**$idempotencyKey:** `?string` — Makes retries safe: a repeated request with the same key and body returns the original booking instead of creating another, for 24 hours. A refused request keeps no key. 1-256 characters. +**$id:** `string` — The series' id.
@@ -19160,79 +21509,64 @@ $client->scheduling->holds->create(
-**$eventType:** `string` — The event type's id or uid. +**$fromIndex:** `?int` — Cancel this occurrence and those after it. Default: all of them.
- -
-
- -**$start:** `string` — An ISO 8601 instant with an offset. -
-
-
-**$host:** `?string` — A specific host (id or uid). Default: chosen fairly from those free. -
+
+## Scheduling Attendees +
$client->scheduling->attendees->erase($uid) -> ?SchedulingAttendeeErasure
-**$attributes:** `?array` — Only choose among pool hosts matching all of these. - -
-
+#### 📝 Description
-**$durationMinutes:** `?int` — One of the event type's `duration_options`. - -
-
-
-**$attendee:** `SchedulingAttendeeInput` - +Removes this person's details and answers from every booking now, and ends any booker session fixed to them. The bookings themselves stay.
+ + + +#### 🔌 Usage
-**$guests:** `?array` — Up to the event type's `max_guests`. - -
-
-
-**$answers:** `?array` — Answers to the event type's questions. Stored encrypted, and returned only by retrieving the booking. - +```php +$client->scheduling->attendees->erase( + 'patient_77', +); +```
+ + + +#### ⚙️ Parameters
-**$location:** `?CreateHoldRequestLocation` — One of the event type's `locations`, with your link filled in if it has none. - -
-
-
-**$metadata:** `?array` — Your own key-value pairs. Don't put sensitive data here. +**$uid:** `string` — Your id for the attendee.
@@ -19244,7 +21578,7 @@ $client->scheduling->holds->create(
-
$client->scheduling->holds->confirm($id, $request) -> ?SchedulingBooking +
$client->scheduling->attendees->eraseByEmail($request) -> ?SchedulingAttendeeErasureByEmail
@@ -19256,7 +21590,7 @@ $client->scheduling->holds->create(
-Turns a hold into a booking. Always succeeds before the hold expires. Repeating it is safe. +Removes this address's details and answers from every booking now, for someone you have no `uid` for, such as a guest. The bookings themselves stay.
@@ -19271,10 +21605,9 @@ Turns a hold into a booking. Always succeeds before the hold expires. Repeating
```php -$client->scheduling->holds->confirm( - 'book_01kd2m9a0b1c2d3e4f5g6h7j8m', - new ConfirmHoldRequest([ - 'ifStillFree' => true, +$client->scheduling->attendees->eraseByEmail( + new EraseSchedulingAttendeeByEmailRequest([ + 'email' => 'sam@example.com', ]), ); ``` @@ -19291,15 +21624,7 @@ $client->scheduling->holds->confirm(
-**$id:** `string` — The booking's id. - -
-
- -
-
- -**$ifStillFree:** `?bool` — After the hold expired, book anyway if nobody else took the slot. Default: refuse with `hold_expired`. +**$email:** `string` — The address to forget, an attendee's or a guest's.
@@ -19311,7 +21636,8 @@ $client->scheduling->holds->confirm(
-
$client->scheduling->holds->release($id) -> ?SchedulingBooking +## Scheduling Calendars +
$client->scheduling->calendars->authorize($host, $request) -> ?SchedulingCalendarAuthorization
@@ -19323,7 +21649,7 @@ $client->scheduling->holds->confirm(
-Gives the slot back early. +A URL for the host to give consent at Google or Microsoft. Open it in a new window: providers refuse to be framed. Coss.com reads only busy times, and writes events with a neutral title unless the event type's `host_calendar_details` is `full`.
@@ -19338,8 +21664,11 @@ Gives the slot back early.
```php -$client->scheduling->holds->release( - 'book_01kd2m9a0b1c2d3e4f5g6h7j8m', +$client->scheduling->calendars->authorize( + 'host_01kd2m9a0b1c2d3e4f5g6h7j8m', + new AuthorizeCalendarRequest([ + 'provider' => AuthorizeCalendarRequestProvider::Google->value, + ]), ); ```
@@ -19355,7 +21684,23 @@ $client->scheduling->holds->release(
-**$id:** `string` — The booking's id. +**$host:** `string` — The host's id or uid. + +
+
+ +
+
+ +**$provider:** `string` — Whose consent page to open. CalDAV connects with a password instead. + +
+
+ +
+
+ +**$returnUrl:** `?string` — Where to send the browser afterwards, on one of the environment's allowed origins. `coss_calendar` says what happened: `connected`, `denied` or `invalid`.
@@ -19367,8 +21712,7 @@ $client->scheduling->holds->release(
-## Scheduling Series -
$client->scheduling->series->create($request) -> ?SchedulingSeries +
$client->scheduling->calendars->list($host) -> ?SchedulingCalendarConnectionList
@@ -19380,7 +21724,7 @@ $client->scheduling->holds->release(
-Books up to 52 occurrences, keeping the attendee's local time across DST changes. Each one is an ordinary booking that can move on its own, and a pool keeps one host throughout. +With each connection's calendars and which of them count.
@@ -19395,23 +21739,8 @@ Books up to 52 occurrences, keeping the attendee's local time across DST changes
```php -$client->scheduling->series->create( - new CreateSeriesBody([ - 'idempotencyKey' => 'welcome-user-123', - 'body' => new CreateSeriesRequest([ - 'eventType' => 'evtype_01kd2m9a0b1c2d3e4f5g6h7j8m', - 'start' => '2027-01-04T15:00:00.000Z', - 'attendee' => new SchedulingAttendeeInput([ - 'uid' => 'patient_77', - 'timeZone' => 'America/New_York', - ]), - 'recurrence' => new CreateSeriesRequestRecurrence([ - 'frequency' => CreateSeriesRequestRecurrenceFrequency::Weekly->value, - 'interval' => 1, - 'count' => 12, - ]), - ]), - ]), +$client->scheduling->calendars->list( + 'host_01kd2m9a0b1c2d3e4f5g6h7j8m', ); ```
@@ -19427,15 +21756,7 @@ $client->scheduling->series->create(
-**$idempotencyKey:** `?string` — Makes retries safe: a repeated request with the same key and body returns the original booking instead of creating another, for 24 hours. A refused request keeps no key. 1-256 characters. - -
-
- -
-
- -**$request:** `CreateSeriesRequest` +**$host:** `string` — The host's id or uid.
@@ -19447,7 +21768,7 @@ $client->scheduling->series->create(
-
$client->scheduling->series->preview($request) -> ?SchedulingSeriesPreview +
$client->scheduling->calendars->connect($host, $request) -> ?SchedulingCalendarConnection
@@ -19459,7 +21780,7 @@ $client->scheduling->series->create(
-Which occurrences would be free, without booking anything. +CalDAV (Apple and others) with an app password, or, in sandbox environments, a `simulated` calendar whose busy times you set yourself. Google and Microsoft use `authorize`.
@@ -19474,19 +21795,14 @@ Which occurrences would be free, without booking anything.
```php -$client->scheduling->series->preview( - new CreateSeriesRequest([ - 'eventType' => 'evtype_01kd2m9a0b1c2d3e4f5g6h7j8m', - 'start' => '2027-01-04T15:00:00.000Z', - 'attendee' => new SchedulingAttendeeInput([ - 'uid' => 'patient_77', - 'timeZone' => 'America/New_York', - ]), - 'recurrence' => new CreateSeriesRequestRecurrence([ - 'frequency' => CreateSeriesRequestRecurrenceFrequency::Weekly->value, - 'interval' => 1, - 'count' => 12, - ]), +$client->scheduling->calendars->connect( + 'host_01kd2m9a0b1c2d3e4f5g6h7j8m', + new ConnectCalendarsRequest([ + 'body' => CreateCalendarConnectionRequest::caldav(new CreateCalendarConnectionRequestCaldav([ + 'url' => 'url', + 'username' => 'username', + 'password' => 'password', + ])), ]), ); ``` @@ -19503,7 +21819,15 @@ $client->scheduling->series->preview(
-**$request:** `CreateSeriesRequest` +**$host:** `string` — The host's id or uid. + +
+
+ +
+
+ +**$request:** `CreateCalendarConnectionRequest`
@@ -19515,7 +21839,7 @@ $client->scheduling->series->preview(
-
$client->scheduling->series->cancel($id, $request) -> ?SchedulingCancelledSeries +
$client->scheduling->calendars->disconnect($host, $id) -> ?DeletedSchedulingCalendarConnection
@@ -19527,7 +21851,7 @@ $client->scheduling->series->preview(
-Cancels the occurrences from `from_index` on, or all of them. +Revokes coss.com's access and deletes every busy time read through it. One a calendar delegation manages is refused (`calendar_managed`).
@@ -19542,11 +21866,9 @@ Cancels the occurrences from `from_index` on, or all of them.
```php -$client->scheduling->series->cancel( - 'series_01kd2m9a0b1c2d3e4f5g6h7j8m', - new CancelSeriesRequest([ - 'fromIndex' => 4, - ]), +$client->scheduling->calendars->disconnect( + 'host_01kd2m9a0b1c2d3e4f5g6h7j8m', + 'calconn_01kd2m9a0b1c2d3e4f5g6h7j8m', ); ```
@@ -19562,7 +21884,7 @@ $client->scheduling->series->cancel(
-**$id:** `string` — The series' id. +**$host:** `string` — The host's id or uid.
@@ -19570,7 +21892,7 @@ $client->scheduling->series->cancel(
-**$fromIndex:** `?int` — Cancel this occurrence and those after it. Default: all of them. +**$id:** `string` — The connection's id.
@@ -19582,8 +21904,7 @@ $client->scheduling->series->cancel(
-## Scheduling Attendees -
$client->scheduling->attendees->erase($uid) -> ?SchedulingAttendeeErasure +
$client->scheduling->calendars->update($host, $calendarId, $request) -> ?SchedulingCalendarConnectionList
@@ -19595,7 +21916,7 @@ $client->scheduling->series->cancel(
-Removes this person's details and answers from every booking now, and ends any booker session fixed to them. The bookings themselves stay. +Whether its busy times block slots, and whether bookings are written to it.
@@ -19610,8 +21931,12 @@ Removes this person's details and answers from every booking now, and ends any b
```php -$client->scheduling->attendees->erase( - 'patient_77', +$client->scheduling->calendars->update( + 'host_01kd2m9a0b1c2d3e4f5g6h7j8m', + 'cal_01kd2m9a0b1c2d3e4f5g6h7j8m', + new UpdateCalendarRequest([ + 'readBusy' => true, + ]), ); ```
@@ -19627,7 +21952,31 @@ $client->scheduling->attendees->erase(
-**$uid:** `string` — Your id for the attendee. +**$host:** `string` — The host's id or uid. + +
+
+ +
+
+ +**$calendarId:** `string` — The calendar's id. + +
+
+ +
+
+ +**$readBusy:** `?bool` — Whether this calendar's busy times block slots. + +
+
+ +
+
+ +**$writeTarget:** `?bool` — Bookings are written to one calendar; setting this moves it here.
@@ -19639,7 +21988,7 @@ $client->scheduling->attendees->erase(
-
$client->scheduling->attendees->eraseByEmail($request) -> ?SchedulingAttendeeErasureByEmail +
$client->scheduling->calendars->setSimulatedBusy($host, $request)
@@ -19651,7 +22000,7 @@ $client->scheduling->attendees->erase(
-Removes this address's details and answers from every booking now, for someone you have no `uid` for, such as a guest. The bookings themselves stay. +Sandbox environments only: test how bookings react to a busy calendar.
@@ -19666,9 +22015,15 @@ Removes this address's details and answers from every booking now, for someone y
```php -$client->scheduling->attendees->eraseByEmail( - new EraseSchedulingAttendeeByEmailRequest([ - 'email' => 'sam@example.com', +$client->scheduling->calendars->setSimulatedBusy( + 'host_01kd2m9a0b1c2d3e4f5g6h7j8m', + new SetSimulatedBusyRequest([ + 'intervals' => [ + new SetSimulatedBusyRequestIntervalsItem([ + 'start' => '2027-01-04T15:00:00.000Z', + 'end' => '2027-01-04T16:00:00.000Z', + ]), + ], ]), ); ``` @@ -19685,7 +22040,15 @@ $client->scheduling->attendees->eraseByEmail(
-**$email:** `string` — The address to forget, an attendee's or a guest's. +**$host:** `string` — The host's id or uid. + +
+
+ +
+
+ +**$intervals:** `array` — The simulated calendar's busy times.
@@ -19697,8 +22060,8 @@ $client->scheduling->attendees->eraseByEmail(
-## Scheduling Calendars -
$client->scheduling->calendars->authorize($host, $request) -> ?SchedulingCalendarAuthorization +## Scheduling CalendarDelegations +
$client->scheduling->calendarDelegations->list() -> ?SchedulingCalendarDelegationList
@@ -19710,7 +22073,7 @@ $client->scheduling->attendees->eraseByEmail(
-A URL for the host to give consent at Google or Microsoft. Open it in a new window: providers refuse to be framed. Coss.com reads only busy times, and writes events with a neutral title unless the event type's `host_calendar_details` is `full`. +With how many hosts each has connected.
@@ -19725,55 +22088,19 @@ A URL for the host to give consent at Google or Microsoft. Open it in a new wind
```php -$client->scheduling->calendars->authorize( - 'host_01kd2m9a0b1c2d3e4f5g6h7j8m', - new AuthorizeCalendarRequest([ - 'provider' => AuthorizeCalendarRequestProvider::Google->value, - ]), -); +$client->scheduling->calendarDelegations->list(); ```
-#### ⚙️ Parameters - -
-
- -
-
- -**$host:** `string` — The host's id or uid. - -
-
- -
-
- -**$provider:** `string` — Whose consent page to open. CalDAV connects with a password instead. - -
-
- -
-
- -**$returnUrl:** `?string` — Where to send the browser afterwards, on one of the environment's allowed origins. `coss_calendar` says what happened: `connected`, `denied` or `invalid`. - -
-
-
-
-
-
$client->scheduling->calendars->list($host) -> ?SchedulingCalendarConnectionList +
$client->scheduling->calendarDelegations->create($request) -> ?SchedulingCalendarDelegation
@@ -19785,7 +22112,7 @@ $client->scheduling->calendars->authorize(
-With each connection's calendars and which of them count. +An admin authorizes once, and every host on the domain gets their calendar with no consent screen. It stays `pending`: authorize what it returns, then verify it. Credentials are never returned.
@@ -19800,8 +22127,11 @@ With each connection's calendars and which of them count.
```php -$client->scheduling->calendars->list( - 'host_01kd2m9a0b1c2d3e4f5g6h7j8m', +$client->scheduling->calendarDelegations->create( + CreateCalendarDelegationRequest::google(new CreateCalendarDelegationRequestGoogle([ + 'domain' => 'domain', + 'serviceAccountKey' => 'service_account_key', + ])), ); ```
@@ -19817,7 +22147,7 @@ $client->scheduling->calendars->list(
-**$host:** `string` — The host's id or uid. +**$request:** `CreateCalendarDelegationRequest`
@@ -19829,7 +22159,7 @@ $client->scheduling->calendars->list(
-
$client->scheduling->calendars->connect($host, $request) -> ?SchedulingCalendarConnection +
$client->scheduling->calendarDelegations->get($id) -> ?SchedulingCalendarDelegation
@@ -19841,7 +22171,7 @@ $client->scheduling->calendars->list(
-CalDAV (Apple and others) with an app password, or, in sandbox environments, a `simulated` calendar whose busy times you set yourself. Google and Microsoft use `authorize`. +Its status, what to authorize, and how many hosts it has connected.
@@ -19856,15 +22186,8 @@ CalDAV (Apple and others) with an app password, or, in sandbox environments, a `
```php -$client->scheduling->calendars->connect( - 'host_01kd2m9a0b1c2d3e4f5g6h7j8m', - new ConnectCalendarsRequest([ - 'body' => CreateCalendarConnectionRequest::caldav(new CreateCalendarConnectionRequestCaldav([ - 'url' => 'url', - 'username' => 'username', - 'password' => 'password', - ])), - ]), +$client->scheduling->calendarDelegations->get( + 'caldlg_01kd2m9a0b1c2d3e4f5g6h7j8m', ); ```
@@ -19880,15 +22203,7 @@ $client->scheduling->calendars->connect(
-**$host:** `string` — The host's id or uid. - -
-
- -
-
- -**$request:** `CreateCalendarConnectionRequest` +**$id:** `string` — The delegation's id.
@@ -19900,7 +22215,7 @@ $client->scheduling->calendars->connect(
-
$client->scheduling->calendars->disconnect($host, $id) -> ?DeletedSchedulingCalendarConnection +
$client->scheduling->calendarDelegations->delete($id) -> ?DeletedSchedulingCalendarDelegation
@@ -19912,7 +22227,7 @@ $client->scheduling->calendars->connect(
-Revokes coss.com's access and deletes every busy time read through it. One a calendar delegation manages is refused (`calendar_managed`). +Its hosts lose these calendars within minutes. They stay bookable with no conflict check, and events already written stay on their calendars, out of reach of later moves or cancellations.
@@ -19927,9 +22242,8 @@ Revokes coss.com's access and deletes every busy time read through it. One a cal
```php -$client->scheduling->calendars->disconnect( - 'host_01kd2m9a0b1c2d3e4f5g6h7j8m', - 'calconn_01kd2m9a0b1c2d3e4f5g6h7j8m', +$client->scheduling->calendarDelegations->delete( + 'caldlg_01kd2m9a0b1c2d3e4f5g6h7j8m', ); ```
@@ -19945,15 +22259,7 @@ $client->scheduling->calendars->disconnect(
-**$host:** `string` — The host's id or uid. - -
-
- -
-
- -**$id:** `string` — The connection's id. +**$id:** `string` — The delegation's id.
@@ -19965,7 +22271,7 @@ $client->scheduling->calendars->disconnect(
-
$client->scheduling->calendars->update($host, $calendarId, $request) -> ?SchedulingCalendarConnectionList +
$client->scheduling->calendarDelegations->update($id, $request) -> ?SchedulingCalendarDelegation
@@ -19977,7 +22283,7 @@ $client->scheduling->calendars->disconnect(
-Whether its busy times block slots, and whether bookings are written to it. +New credentials are tried on the verified mailbox before they replace the old ones, and end an outage if they work.
@@ -19992,11 +22298,10 @@ Whether its busy times block slots, and whether bookings are written to it.
```php -$client->scheduling->calendars->update( - 'host_01kd2m9a0b1c2d3e4f5g6h7j8m', - 'cal_01kd2m9a0b1c2d3e4f5g6h7j8m', - new UpdateCalendarRequest([ - 'readBusy' => true, +$client->scheduling->calendarDelegations->update( + 'caldlg_01kd2m9a0b1c2d3e4f5g6h7j8m', + new UpdateCalendarDelegationRequest([ + 'matchHostEmail' => false, ]), ); ``` @@ -20013,7 +22318,7 @@ $client->scheduling->calendars->update(
-**$host:** `string` — The host's id or uid. +**$id:** `string` — The delegation's id.
@@ -20021,7 +22326,7 @@ $client->scheduling->calendars->update(
-**$calendarId:** `string` — The calendar's id. +**$matchHostEmail:** `?bool` — Whether a host's `email` picks their mailbox when `calendar_account` isn't set. Turn it off if end users can type their own email into your app: otherwise one could name a colleague's address and reach that calendar.
@@ -20029,7 +22334,7 @@ $client->scheduling->calendars->update(
-**$readBusy:** `?bool` — Whether this calendar's busy times block slots. +**$serviceAccountKey:** `?string` — A new key. It's tried on the verified mailbox before it replaces the old one.
@@ -20037,7 +22342,15 @@ $client->scheduling->calendars->update(
-**$writeTarget:** `?bool` — Bookings are written to one calendar; setting this moves it here. +**$clientSecret:** `?string` — A new client secret. It's tried on the verified mailbox before it replaces the old one. + +
+
+ +
+
+ +**$secretExpiresAt:** `?DateTime` — When the Entra client secret expires. Owners and admins are warned 14 days before.
@@ -20049,7 +22362,7 @@ $client->scheduling->calendars->update(
-
$client->scheduling->calendars->setSimulatedBusy($host, $request) +
$client->scheduling->calendarDelegations->verify($id, $request) -> ?SchedulingCalendarDelegation
@@ -20061,7 +22374,7 @@ $client->scheduling->calendars->update(
-Sandbox environments only: test how bookings react to a busy calendar. +Tries one real mailbox. Passing makes it `active`, and its hosts start connecting. Google can take up to 24 hours to apply a new authorization, so a refusal may just need time.
@@ -20076,15 +22389,10 @@ Sandbox environments only: test how bookings react to a busy calendar.
```php -$client->scheduling->calendars->setSimulatedBusy( - 'host_01kd2m9a0b1c2d3e4f5g6h7j8m', - new SetSimulatedBusyRequest([ - 'intervals' => [ - new SetSimulatedBusyRequestIntervalsItem([ - 'start' => '2027-01-04T15:00:00.000Z', - 'end' => '2027-01-04T16:00:00.000Z', - ]), - ], +$client->scheduling->calendarDelegations->verify( + 'caldlg_01kd2m9a0b1c2d3e4f5g6h7j8m', + new VerifyCalendarDelegationRequest([ + 'account' => 'ana@example.com', ]), ); ``` @@ -20101,7 +22409,7 @@ $client->scheduling->calendars->setSimulatedBusy(
-**$host:** `string` — The host's id or uid. +**$id:** `string` — The delegation's id.
@@ -20109,7 +22417,7 @@ $client->scheduling->calendars->setSimulatedBusy(
-**$intervals:** `array` — The simulated calendar's busy times. +**$account:** `string` — A real mailbox on the domain to try. In Microsoft 365, a user principal name.
@@ -20121,8 +22429,8 @@ $client->scheduling->calendars->setSimulatedBusy(
-## Scheduling CalendarDelegations -
$client->scheduling->calendarDelegations->list() -> ?SchedulingCalendarDelegationList +## Scheduling OauthApps +
$client->scheduling->oauthApps->list() -> ?SchedulingOauthAppList
@@ -20134,7 +22442,7 @@ $client->scheduling->calendars->setSimulatedBusy(
-With how many hosts each has connected. +At most one per provider, with how many connections use each.
@@ -20149,7 +22457,7 @@ With how many hosts each has connected.
```php -$client->scheduling->calendarDelegations->list(); +$client->scheduling->oauthApps->list(); ```
@@ -20161,7 +22469,7 @@ $client->scheduling->calendarDelegations->list();
-
$client->scheduling->calendarDelegations->create($request) -> ?SchedulingCalendarDelegation +
$client->scheduling->oauthApps->create($request) -> ?SchedulingOauthApp
@@ -20173,7 +22481,7 @@ $client->scheduling->calendarDelegations->list();
-An admin authorizes once, and every host on the domain gets their calendar with no consent screen. It stays `pending`: authorize what it returns, then verify it. Credentials are never returned. +New consents in this environment use it, so the consent screen shows your brand. Connections made before it stay on coss.com's app until their host consents again. On the Scale plan and above. Secrets are never returned.
@@ -20188,10 +22496,10 @@ An admin authorizes once, and every host on the domain gets their calendar with
```php -$client->scheduling->calendarDelegations->create( - CreateCalendarDelegationRequest::google(new CreateCalendarDelegationRequestGoogle([ - 'domain' => 'domain', - 'serviceAccountKey' => 'service_account_key', +$client->scheduling->oauthApps->create( + CreateOauthAppRequest::google(new CreateOauthAppRequestGoogle([ + 'clientId' => 'client_id', + 'clientSecret' => 'client_secret', ])), ); ``` @@ -20208,7 +22516,7 @@ $client->scheduling->calendarDelegations->create(
-**$request:** `CreateCalendarDelegationRequest` +**$request:** `CreateOauthAppRequest`
@@ -20220,7 +22528,7 @@ $client->scheduling->calendarDelegations->create(
-
$client->scheduling->calendarDelegations->get($id) -> ?SchedulingCalendarDelegation +
$client->scheduling->oauthApps->get($id) -> ?SchedulingOauthApp
@@ -20232,7 +22540,7 @@ $client->scheduling->calendarDelegations->create(
-Its status, what to authorize, and how many hosts it has connected. +Its status, what to register at the provider, and how many connections use it.
@@ -20247,8 +22555,8 @@ Its status, what to authorize, and how many hosts it has connected.
```php -$client->scheduling->calendarDelegations->get( - 'caldlg_01kd2m9a0b1c2d3e4f5g6h7j8m', +$client->scheduling->oauthApps->get( + 'calapp_01kd2m9a0b1c2d3e4f5g6h7j8m', ); ```
@@ -20264,7 +22572,7 @@ $client->scheduling->calendarDelegations->get(
-**$id:** `string` — The delegation's id. +**$id:** `string` — The OAuth app's id.
@@ -20276,7 +22584,7 @@ $client->scheduling->calendarDelegations->get(
-
$client->scheduling->calendarDelegations->delete($id) -> ?DeletedSchedulingCalendarDelegation +
$client->scheduling->oauthApps->delete($id) -> ?DeletedSchedulingOauthApp
@@ -20288,7 +22596,7 @@ $client->scheduling->calendarDelegations->get(
-Its hosts lose these calendars within minutes. They stay bookable with no conflict check, and events already written stay on their calendars, out of reach of later moves or cancellations. +Refused while connections use it (`oauth_app_in_use`), since only it can refresh their access: disconnect them first. New consents go back to coss.com's app.
@@ -20303,8 +22611,8 @@ Its hosts lose these calendars within minutes. They stay bookable with no confli
```php -$client->scheduling->calendarDelegations->delete( - 'caldlg_01kd2m9a0b1c2d3e4f5g6h7j8m', +$client->scheduling->oauthApps->delete( + 'calapp_01kd2m9a0b1c2d3e4f5g6h7j8m', ); ```
@@ -20320,7 +22628,7 @@ $client->scheduling->calendarDelegations->delete(
-**$id:** `string` — The delegation's id. +**$id:** `string` — The OAuth app's id.
@@ -20332,7 +22640,7 @@ $client->scheduling->calendarDelegations->delete(
-
$client->scheduling->calendarDelegations->update($id, $request) -> ?SchedulingCalendarDelegation +
$client->scheduling->oauthApps->update($id, $request) -> ?SchedulingOauthApp
@@ -20344,7 +22652,7 @@ $client->scheduling->calendarDelegations->delete(
-New credentials are tried on the verified mailbox before they replace the old ones, and end an outage if they work. +A new client secret is tried on a connection before it replaces the old one, and ends an outage if it works. Its client ID can't change: a different app needs its hosts to consent again.
@@ -20359,10 +22667,10 @@ New credentials are tried on the verified mailbox before they replace the old on
```php -$client->scheduling->calendarDelegations->update( - 'caldlg_01kd2m9a0b1c2d3e4f5g6h7j8m', - new UpdateCalendarDelegationRequest([ - 'matchHostEmail' => false, +$client->scheduling->oauthApps->update( + 'calapp_01kd2m9a0b1c2d3e4f5g6h7j8m', + new UpdateOauthAppRequest([ + 'clientSecret' => 'GOCSPX-abcdefghijklmnopqrstuvwxyz', ]), ); ``` @@ -20379,7 +22687,7 @@ $client->scheduling->calendarDelegations->update(
-**$id:** `string` — The delegation's id. +**$id:** `string` — The OAuth app's id.
@@ -20387,7 +22695,7 @@ $client->scheduling->calendarDelegations->update(
-**$matchHostEmail:** `?bool` — Whether a host's `email` picks their mailbox when `calendar_account` isn't set. Turn it off if end users can type their own email into your app: otherwise one could name a colleague's address and reach that calendar. +**$clientSecret:** `?string` — A new client secret. It's tried on a connection before it replaces the old one.
@@ -20395,7 +22703,7 @@ $client->scheduling->calendarDelegations->update(
-**$serviceAccountKey:** `?string` — A new key. It's tried on the verified mailbox before it replaces the old one. +**$tenantId:** `?string` — The Directory (tenant) ID, for an app that's only for your own tenant. Leave it out for a multi-tenant app.
@@ -20403,7 +22711,7 @@ $client->scheduling->calendarDelegations->update(
-**$clientSecret:** `?string` — A new client secret. It's tried on the verified mailbox before it replaces the old one. +**$webhookSecret:** `?string` — The Secret Token of your Zoom app, which signs its events at `zoom_event_url`. Never returned.
@@ -20411,7 +22719,23 @@ $client->scheduling->calendarDelegations->update(
-**$secretExpiresAt:** `?DateTime` — When the Entra client secret expires. Owners and admins are warned 14 days before. +**$redirectUri:** `?string` — A page on your own domain, registered with the provider, that forwards `code` and `state` to `coss_callback_url`. Google requires this for an external app, since it has to verify the redirect's domain as yours. Leave it out to use `coss_callback_url` directly. + +
+
+ +
+
+ +**$completionUrl:** `?string` — Where the browser lands after a consent that didn't name a `return_url`, with `coss_calendar` set to `connected`, `denied` or `invalid`. Leave it out for a plain page saying what happened. + +
+
+ +
+
+ +**$secretExpiresAt:** `?DateTime` — When the client secret expires. Owners and admins are warned 14 days before.
@@ -20423,7 +22747,8 @@ $client->scheduling->calendarDelegations->update(
-
$client->scheduling->calendarDelegations->verify($id, $request) -> ?SchedulingCalendarDelegation +## Scheduling Sessions +
$client->scheduling->sessions->createForManager($request) -> ?SchedulingSession
@@ -20435,7 +22760,7 @@ $client->scheduling->calendarDelegations->update(
-Tries one real mailbox. Passing makes it `active`, and its hosts start connecting. Google can take up to 24 hours to apply a new authorization, so a refusal may just need time. +Lets a team lead manage cover for the hosts you name, or those matching an attribute filter whenever it's asked: time off, bookings that need someone else, and moving them. It never sees attendees' details. Send the `url` to their browser, or embed it with `coss/scheduling`.
@@ -20450,10 +22775,12 @@ Tries one real mailbox. Passing makes it `active`, and its hosts start connectin
```php -$client->scheduling->calendarDelegations->verify( - 'caldlg_01kd2m9a0b1c2d3e4f5g6h7j8m', - new VerifyCalendarDelegationRequest([ - 'account' => 'ana@example.com', +$client->scheduling->sessions->createForManager( + new CreateSchedulingManagerSessionRequest([ + 'hostFilter' => [ + 'team' => 'cardiology', + ], + 'expiresIn' => 3600, ]), ); ``` @@ -20470,7 +22797,7 @@ $client->scheduling->calendarDelegations->verify(
-**$id:** `string` — The delegation's id. +**$hosts:** `?array` — The hosts this page can reach, by id or uid.
@@ -20478,7 +22805,23 @@ $client->scheduling->calendarDelegations->verify(
-**$account:** `string` — A real mailbox on the domain to try. In Microsoft 365, a user principal name. +**$hostFilter:** `?array` — Everyone matching these attributes, asked again on every request. + +
+
+ +
+
+ +**$expiresIn:** `?int` — Seconds until it stops working. At most a day. + +
+
+ +
+
+ +**$readOnly:** `?bool`
@@ -20490,7 +22833,6 @@ $client->scheduling->calendarDelegations->verify(
-## Scheduling Sessions
$client->scheduling->sessions->createForHost($host, $request) -> ?SchedulingSession
@@ -20835,6 +23177,14 @@ $client->scheduling->settings->update(
+**$privacyUrl:** `?string` — Your privacy policy, as an https URL, for hosts connecting a calendar through your own OAuth app. `null` removes it. + +
+
+ +
+
+ **$emailFrom:** `?string` — Sender of booking emails, on a verified domain. `null`: coss.com's own address.
@@ -20859,6 +23209,30 @@ $client->scheduling->settings->update(
+**$nameHostInAttendeeEmails:** `?bool` — Name the new host when telling an attendee their booking has one. + +
+
+ +
+
+ +**$hostReassignment:** `?string` — Whether hosts can give their own bookings to someone else from their page. `eligible` lets them, to anyone free who takes that event type. + +
+
+ +
+
+ +**$outOfOfficeReasons:** `?array` — Reasons of your own, on top of the preset ones. Hosts and managers see them. + +
+
+ +
+
+ **$notifications:** `?array` — Per event (`confirmed`, `pending_approval`, `rescheduled`, `cancelled`, `declined`, `reminder`), overriding the defaults. `null` restores them.
diff --git a/sdks/php/src/Coss.php b/sdks/php/src/Coss.php index 3138eb5f8..ff6351a61 100644 --- a/sdks/php/src/Coss.php +++ b/sdks/php/src/Coss.php @@ -166,8 +166,8 @@ public function __construct( 'Authorization' => "Bearer $apiKey", 'X-Fern-Language' => 'PHP', 'X-Fern-SDK-Name' => 'Coss', - 'X-Fern-SDK-Version' => '0.3.0', - 'User-Agent' => 'coss-php/0.3.0', + 'X-Fern-SDK-Version' => '0.4.0', + 'User-Agent' => 'coss-php/0.4.0', ]; if ($apiVersion != null) { $defaultHeaders['Coss-Version'] = $apiVersion; diff --git a/sdks/php/src/Scheduling/Bookings/BookingsClient.php b/sdks/php/src/Scheduling/Bookings/BookingsClient.php index 3dae75d8d..815dda2ba 100644 --- a/sdks/php/src/Scheduling/Bookings/BookingsClient.php +++ b/sdks/php/src/Scheduling/Bookings/BookingsClient.php @@ -4,18 +4,21 @@ use Psr\Http\Client\ClientInterface; use Coss\Core\Client\RawClient; -use Coss\Scheduling\Bookings\Requests\ListBookingsRequest; -use Coss\Types\SchedulingBookingList; +use Coss\Scheduling\Bookings\Requests\ReassignSchedulingBookingRequest; +use Coss\Types\SchedulingBooking; use Coss\Exceptions\CossException; use Coss\Exceptions\CossApiException; +use Coss\Core\Client\IdempotencyKey; use Coss\Core\Json\JsonApiRequest; use Coss\Environments; use Coss\Core\Client\HttpMethod; use JsonException; use Psr\Http\Client\ClientExceptionInterface; +use Coss\Scheduling\Bookings\Requests\ReassignCandidatesBookingsRequest; +use Coss\Types\SchedulingReassignCandidateList; +use Coss\Scheduling\Bookings\Requests\ListBookingsRequest; +use Coss\Types\SchedulingBookingList; use Coss\Scheduling\Bookings\Requests\CreateBookingRequest; -use Coss\Types\SchedulingBooking; -use Coss\Core\Client\IdempotencyKey; use Coss\Scheduling\Bookings\Requests\RescheduleBookingRequest; use Coss\Scheduling\Bookings\Requests\CancelSchedulingBookingRequest; use Coss\Scheduling\Bookings\Requests\EventsBookingsRequest; @@ -60,6 +63,137 @@ public function __construct( $this->options = $options ?? []; } + /** + * Gives a booking to another host, keeping its id and time. Works for every kind: a group session moves as a whole, from any of its seats, and one that's already started changes for the record, with nobody told. Whoever leaves and joins is told, and the attendee unless you say not to. + * + * Example: + * ```php + * $client->scheduling->bookings->reassign( + * 'book_01kd2m9a0b1c2d3e4f5g6h7j8m', + * new ReassignSchedulingBookingRequest([ + * 'changes' => [ + * new ReassignSchedulingBookingRequestChangesItem([ + * 'toHost' => 'doctor_518', + * ]), + * ], + * 'reasonCode' => ReassignSchedulingBookingRequestReasonCode::OutOfOffice->value, + * ]), + * ); + * ``` + * + * @param string $id The booking's id. + * @param ReassignSchedulingBookingRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return ?SchedulingBooking + * @throws CossException + * @throws CossApiException + */ + public function reassign(string $id, ReassignSchedulingBookingRequest $request, ?array $options = null): ?SchedulingBooking + { + $options = array_merge($this->options, $options ?? []); + $options['maxRetries'] = 0; + $headers = []; + $headers['Idempotency-Key'] ??= IdempotencyKey::generate(); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Default_->value, + path: "v1/scheduling/bookings/" . RawClient::encodePathParam($id) . "/reassign", + method: HttpMethod::POST, + headers: $headers, + body: $request, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + if (empty($json)) { + return null; + } + return SchedulingBooking::fromJson($json); + } + } catch (JsonException $e) { + throw new CossException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (ClientExceptionInterface $e) { + throw new CossException(message: $e->getMessage(), previous: $e); + } + throw new CossApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * The environment's other active hosts: members of the event type first, in the order a pool would pick them, each saying whether they're free and why not. Things can change before you ask: reassigning decides again. + * + * Example: + * ```php + * $client->scheduling->bookings->reassignCandidates( + * 'book_01kd2m9a0b1c2d3e4f5g6h7j8m', + * new ReassignCandidatesBookingsRequest([]), + * ); + * ``` + * + * @param string $id The booking's id. + * @param ReassignCandidatesBookingsRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return ?SchedulingReassignCandidateList + * @throws CossException + * @throws CossApiException + */ + public function reassignCandidates(string $id, ReassignCandidatesBookingsRequest $request = new ReassignCandidatesBookingsRequest(), ?array $options = null): ?SchedulingReassignCandidateList + { + $options = array_merge($this->options, $options ?? []); + $query = []; + if ($request->fromHost != null) { + $query['from_host'] = $request->fromHost; + } + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Default_->value, + path: "v1/scheduling/bookings/" . RawClient::encodePathParam($id) . "/reassign_candidates", + method: HttpMethod::GET, + query: $query, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + if (empty($json)) { + return null; + } + return SchedulingReassignCandidateList::fromJson($json); + } + } catch (JsonException $e) { + throw new CossException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (ClientExceptionInterface $e) { + throw new CossException(message: $e->getMessage(), previous: $e); + } + throw new CossApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + /** * The environment's bookings, newest first. Answers aren't included. * @@ -709,9 +843,10 @@ public function markNoShow(string $id, ?array $options = null): ?SchedulingBooki * $client->scheduling->bookings->updateLocation( * 'book_01kd2m9a0b1c2d3e4f5g6h7j8m', * new UpdateBookingLocationRequest([ - * 'location' => SchedulingLocation::link(new SchedulingLocationLink([ + * 'location' => new SchedulingLocationZero([ + * 'type' => SchedulingLocationZeroType::Link->value, * 'url' => 'https://meet.example.com/abc', - * ])), + * ]), * ]), * ); * ``` diff --git a/sdks/php/src/Scheduling/Bookings/Requests/ReassignCandidatesBookingsRequest.php b/sdks/php/src/Scheduling/Bookings/Requests/ReassignCandidatesBookingsRequest.php new file mode 100644 index 000000000..027cbf139 --- /dev/null +++ b/sdks/php/src/Scheduling/Bookings/Requests/ReassignCandidatesBookingsRequest.php @@ -0,0 +1,27 @@ +fromHost = $values['fromHost'] ?? null; + if (array_key_exists('fromHost', $values)) { + $this->_setField('fromHost'); + } + } +} diff --git a/sdks/php/src/Scheduling/Bookings/Requests/ReassignSchedulingBookingRequest.php b/sdks/php/src/Scheduling/Bookings/Requests/ReassignSchedulingBookingRequest.php new file mode 100644 index 000000000..f50c58ef4 --- /dev/null +++ b/sdks/php/src/Scheduling/Bookings/Requests/ReassignSchedulingBookingRequest.php @@ -0,0 +1,72 @@ + $changes A session or a one-on-one has one. A collective can change several. + */ + #[JsonProperty('changes'), ArrayType([ReassignSchedulingBookingRequestChangesItem::class])] + public array $changes; + + /** + * @var value-of $reasonCode + */ + #[JsonProperty('reason_code')] + public string $reasonCode; + + /** + * @var ?string $note Why, in your words: required with an override of someone's availability. Encrypted, and only in the booking's history. + */ + #[JsonProperty('note')] + public ?string $note; + + /** + * @var ?array> $overrides Go ahead anyway: `any_host` for someone who doesn't take this event type, and the rest for what a candidate's `reason` said. A host who already has something at this time can never be overridden. + */ + #[JsonProperty('overrides'), ArrayType(['string'])] + public ?array $overrides; + + /** + * @var ?ReassignSchedulingBookingRequestNotify $notify + */ + #[JsonProperty('notify')] + public ?ReassignSchedulingBookingRequestNotify $notify; + + /** + * @param array{ + * changes: array, + * reasonCode: value-of, + * note?: ?string, + * overrides?: ?array>, + * notify?: ?ReassignSchedulingBookingRequestNotify, + * } $values + */ + public function __construct( + array $values, + ) { + $this->changes = $values['changes']; + $this->reasonCode = $values['reasonCode']; + $this->note = $values['note'] ?? null; + if (array_key_exists('note', $values)) { + $this->_setField('note'); + } + $this->overrides = $values['overrides'] ?? null; + if (array_key_exists('overrides', $values)) { + $this->_setField('overrides'); + } + $this->notify = $values['notify'] ?? null; + if (array_key_exists('notify', $values)) { + $this->_setField('notify'); + } + } +} diff --git a/sdks/php/src/Scheduling/Bookings/Requests/UpdateBookingLocationRequest.php b/sdks/php/src/Scheduling/Bookings/Requests/UpdateBookingLocationRequest.php index ee32f8fbb..bc13c4a73 100644 --- a/sdks/php/src/Scheduling/Bookings/Requests/UpdateBookingLocationRequest.php +++ b/sdks/php/src/Scheduling/Bookings/Requests/UpdateBookingLocationRequest.php @@ -3,25 +3,48 @@ namespace Coss\Scheduling\Bookings\Requests; use Coss\Core\Json\JsonSerializableType; -use Coss\Types\SchedulingLocation; +use Coss\Types\SchedulingLocationZero; +use Coss\Types\SchedulingLocationNumber; +use Coss\Types\SchedulingLocationAddress; +use Coss\Types\SchedulingLocationThree; +use Coss\Types\SchedulingLocationFour; +use Coss\Types\SchedulingLocationFive; use Coss\Core\Json\JsonProperty; +use Coss\Core\Types\Union; class UpdateBookingLocationRequest extends JsonSerializableType { /** - * @var SchedulingLocation $location + * @var ( + * SchedulingLocationZero + * |SchedulingLocationNumber + * |SchedulingLocationAddress + * |SchedulingLocationThree + * |SchedulingLocationFour + * |SchedulingLocationFive + * )|null $location */ - #[JsonProperty('location')] - public SchedulingLocation $location; + #[JsonProperty('location'), Union(SchedulingLocationZero::class, SchedulingLocationNumber::class, SchedulingLocationAddress::class, SchedulingLocationThree::class, SchedulingLocationFour::class, SchedulingLocationFive::class, 'null')] + public SchedulingLocationZero|SchedulingLocationNumber|SchedulingLocationAddress|SchedulingLocationThree|SchedulingLocationFour|SchedulingLocationFive|null $location; /** * @param array{ - * location: SchedulingLocation, + * location?: ( + * SchedulingLocationZero + * |SchedulingLocationNumber + * |SchedulingLocationAddress + * |SchedulingLocationThree + * |SchedulingLocationFour + * |SchedulingLocationFive + * )|null, * } $values */ public function __construct( - array $values, + array $values = [], ) { - $this->location = $values['location']; + $this->location = $values['location'] ?? null; + if (array_key_exists('location', $values)) { + $this->_setField('location'); + } } } diff --git a/sdks/php/src/Scheduling/Bookings/Types/ReassignSchedulingBookingRequestChangesItem.php b/sdks/php/src/Scheduling/Bookings/Types/ReassignSchedulingBookingRequestChangesItem.php new file mode 100644 index 000000000..c8c17a6a2 --- /dev/null +++ b/sdks/php/src/Scheduling/Bookings/Types/ReassignSchedulingBookingRequestChangesItem.php @@ -0,0 +1,71 @@ + $preferredHosts With `auto`: try these first, in order. + */ + #[JsonProperty('preferred_hosts'), ArrayType(['string'])] + public ?array $preferredHosts; + + /** + * @param array{ + * fromHost?: ?string, + * toHost?: ?string, + * auto?: ?bool, + * preferredHosts?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->fromHost = $values['fromHost'] ?? null; + if (array_key_exists('fromHost', $values)) { + $this->_setField('fromHost'); + } + $this->toHost = $values['toHost'] ?? null; + if (array_key_exists('toHost', $values)) { + $this->_setField('toHost'); + } + $this->auto = $values['auto'] ?? null; + if (array_key_exists('auto', $values)) { + $this->_setField('auto'); + } + $this->preferredHosts = $values['preferredHosts'] ?? null; + if (array_key_exists('preferredHosts', $values)) { + $this->_setField('preferredHosts'); + } + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/sdks/php/src/Scheduling/Bookings/Types/ReassignSchedulingBookingRequestNotify.php b/sdks/php/src/Scheduling/Bookings/Types/ReassignSchedulingBookingRequestNotify.php new file mode 100644 index 000000000..0a00ab186 --- /dev/null +++ b/sdks/php/src/Scheduling/Bookings/Types/ReassignSchedulingBookingRequestNotify.php @@ -0,0 +1,37 @@ +attendee = $values['attendee'] ?? null; + if (array_key_exists('attendee', $values)) { + $this->_setField('attendee'); + } + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/sdks/php/src/Scheduling/Bookings/Types/ReassignSchedulingBookingRequestOverridesItem.php b/sdks/php/src/Scheduling/Bookings/Types/ReassignSchedulingBookingRequestOverridesItem.php new file mode 100644 index 000000000..fdb99ffa1 --- /dev/null +++ b/sdks/php/src/Scheduling/Bookings/Types/ReassignSchedulingBookingRequestOverridesItem.php @@ -0,0 +1,13 @@ + $locations Where bookings can meet. A browser only chooses among these. A `group` event type can't use `zoom`. + * @var ?array<( + * SchedulingLocationZero + * |SchedulingLocationNumber + * |SchedulingLocationAddress + * |SchedulingLocationThree + * |SchedulingLocationFour + * |SchedulingLocationFive + * )|null> $locations Where bookings can meet. A browser only chooses among these. A `group` event type can't use `zoom`. */ - #[JsonProperty('locations'), ArrayType([SchedulingLocation::class])] + #[JsonProperty('locations'), ArrayType([new Union(new Union(SchedulingLocationZero::class, SchedulingLocationNumber::class, SchedulingLocationAddress::class, SchedulingLocationThree::class, SchedulingLocationFour::class, SchedulingLocationFive::class), 'null')])] public ?array $locations; /** @@ -219,6 +237,7 @@ class CreateEventTypeRequest extends JsonSerializableType * limits?: ?array, * capacity?: ?int, * requiresApproval?: ?bool, + * reassignmentEnabled?: ?bool, * approvalTtlMinutes?: ?int, * holdTtlSeconds?: ?int, * cancelNoticeMinutes?: ?int, @@ -227,7 +246,14 @@ class CreateEventTypeRequest extends JsonSerializableType * maxActiveBookingsPerAttendee?: ?int, * hostCalendarDetails?: ?value-of, * questions?: ?array, - * locations?: ?array, + * locations?: ?array<( + * SchedulingLocationZero + * |SchedulingLocationNumber + * |SchedulingLocationAddress + * |SchedulingLocationThree + * |SchedulingLocationFour + * |SchedulingLocationFive + * )|null>, * hostFilter?: ?array @@ -295,6 +321,10 @@ public function __construct( if (array_key_exists('requiresApproval', $values)) { $this->_setField('requiresApproval'); } + $this->reassignmentEnabled = $values['reassignmentEnabled'] ?? null; + if (array_key_exists('reassignmentEnabled', $values)) { + $this->_setField('reassignmentEnabled'); + } $this->approvalTtlMinutes = $values['approvalTtlMinutes'] ?? null; if (array_key_exists('approvalTtlMinutes', $values)) { $this->_setField('approvalTtlMinutes'); diff --git a/sdks/php/src/Scheduling/EventTypes/Requests/UpdateEventTypeRequest.php b/sdks/php/src/Scheduling/EventTypes/Requests/UpdateEventTypeRequest.php index 92c255dce..c797c2474 100644 --- a/sdks/php/src/Scheduling/EventTypes/Requests/UpdateEventTypeRequest.php +++ b/sdks/php/src/Scheduling/EventTypes/Requests/UpdateEventTypeRequest.php @@ -11,7 +11,12 @@ use Coss\Types\SchedulingLimit; use Coss\Scheduling\EventTypes\Types\UpdateEventTypeRequestHostCalendarDetails; use Coss\Types\SchedulingQuestion; -use Coss\Types\SchedulingLocation; +use Coss\Types\SchedulingLocationZero; +use Coss\Types\SchedulingLocationNumber; +use Coss\Types\SchedulingLocationAddress; +use Coss\Types\SchedulingLocationThree; +use Coss\Types\SchedulingLocationFour; +use Coss\Types\SchedulingLocationFive; use Coss\Scheduling\EventTypes\Types\UpdateEventTypeRequestNotificationsValue; use Coss\Types\SchedulingReminderInput; use Coss\Scheduling\EventTypes\Types\UpdateEventTypeRequestStatus; @@ -106,6 +111,12 @@ class UpdateEventTypeRequest extends JsonSerializableType #[JsonProperty('requires_approval')] public ?bool $requiresApproval; + /** + * @var ?bool $reassignmentEnabled Whether bookings of this event type can go to another host. Default: true. + */ + #[JsonProperty('reassignment_enabled')] + public ?bool $reassignmentEnabled; + /** * @var ?int $approvalTtlMinutes How long a booking can wait for approval before it's declined, in minutes. Default: 1440. */ @@ -155,9 +166,16 @@ class UpdateEventTypeRequest extends JsonSerializableType public ?array $questions; /** - * @var ?array $locations Where bookings can meet. A browser only chooses among these. A `group` event type can't use `zoom`. + * @var ?array<( + * SchedulingLocationZero + * |SchedulingLocationNumber + * |SchedulingLocationAddress + * |SchedulingLocationThree + * |SchedulingLocationFour + * |SchedulingLocationFive + * )|null> $locations Where bookings can meet. A browser only chooses among these. A `group` event type can't use `zoom`. */ - #[JsonProperty('locations'), ArrayType([SchedulingLocation::class])] + #[JsonProperty('locations'), ArrayType([new Union(new Union(SchedulingLocationZero::class, SchedulingLocationNumber::class, SchedulingLocationAddress::class, SchedulingLocationThree::class, SchedulingLocationFour::class, SchedulingLocationFive::class), 'null')])] public ?array $locations; /** @@ -218,6 +236,7 @@ class UpdateEventTypeRequest extends JsonSerializableType * limits?: ?array, * capacity?: ?int, * requiresApproval?: ?bool, + * reassignmentEnabled?: ?bool, * approvalTtlMinutes?: ?int, * holdTtlSeconds?: ?int, * cancelNoticeMinutes?: ?int, @@ -226,7 +245,14 @@ class UpdateEventTypeRequest extends JsonSerializableType * maxActiveBookingsPerAttendee?: ?int, * hostCalendarDetails?: ?value-of, * questions?: ?array, - * locations?: ?array, + * locations?: ?array<( + * SchedulingLocationZero + * |SchedulingLocationNumber + * |SchedulingLocationAddress + * |SchedulingLocationThree + * |SchedulingLocationFour + * |SchedulingLocationFive + * )|null>, * hostFilter?: ?array @@ -297,6 +323,10 @@ public function __construct( if (array_key_exists('requiresApproval', $values)) { $this->_setField('requiresApproval'); } + $this->reassignmentEnabled = $values['reassignmentEnabled'] ?? null; + if (array_key_exists('reassignmentEnabled', $values)) { + $this->_setField('reassignmentEnabled'); + } $this->approvalTtlMinutes = $values['approvalTtlMinutes'] ?? null; if (array_key_exists('approvalTtlMinutes', $values)) { $this->_setField('approvalTtlMinutes'); diff --git a/sdks/php/src/Scheduling/HolidayCalendars/HolidayCalendarsClient.php b/sdks/php/src/Scheduling/HolidayCalendars/HolidayCalendarsClient.php new file mode 100644 index 000000000..05339d246 --- /dev/null +++ b/sdks/php/src/Scheduling/HolidayCalendars/HolidayCalendarsClient.php @@ -0,0 +1,402 @@ +, + * } $options @phpstan-ignore-next-line Property is used in endpoint methods via HttpEndpointGenerator + */ + private array $options; + + /** + * @var RawClient $client + */ + private RawClient $client; + + /** + * @param RawClient $client + * @param ?array{ + * baseUrl?: string, + * client?: ClientInterface, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * } $options + */ + public function __construct( + RawClient $client, + ?array $options = null, + ) { + $this->client = $client; + $this->options = $options ?? []; + } + + /** + * By name. A feed's URL is never shown again. + * + * Example: + * ```php + * $client->scheduling->holidayCalendars->list(); + * ``` + * + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return ?SchedulingHolidayCalendarList + * @throws CossException + * @throws CossApiException + */ + public function list(?array $options = null): ?SchedulingHolidayCalendarList + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Default_->value, + path: "v1/scheduling/holiday_calendars", + method: HttpMethod::GET, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + if (empty($json)) { + return null; + } + return SchedulingHolidayCalendarList::fromJson($json); + } + } catch (JsonException $e) { + throw new CossException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (ClientExceptionInterface $e) { + throw new CossException(message: $e->getMessage(), previous: $e); + } + throw new CossApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Applies a country's public holidays, or your own feed, to some hosts as ordinary out of office entries, kept up to date by coss.com. A host who removes one keeps it removed. + * + * Example: + * ```php + * $client->scheduling->holidayCalendars->create( + * new CreateSchedulingHolidayCalendarRequest([ + * 'name' => 'UK team', + * 'country' => 'GB', + * 'hostFilter' => [ + * 'team' => 'london', + * ], + * ]), + * ); + * ``` + * + * @param CreateSchedulingHolidayCalendarRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return ?SchedulingHolidayCalendar + * @throws CossException + * @throws CossApiException + */ + public function create(CreateSchedulingHolidayCalendarRequest $request, ?array $options = null): ?SchedulingHolidayCalendar + { + $options = array_merge($this->options, $options ?? []); + $options['maxRetries'] = 0; + $headers = []; + $headers['Idempotency-Key'] ??= IdempotencyKey::generate(); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Default_->value, + path: "v1/scheduling/holiday_calendars", + method: HttpMethod::POST, + headers: $headers, + body: $request, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + if (empty($json)) { + return null; + } + return SchedulingHolidayCalendar::fromJson($json); + } + } catch (JsonException $e) { + throw new CossException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (ClientExceptionInterface $e) { + throw new CossException(message: $e->getMessage(), previous: $e); + } + throw new CossApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * With when it was last read, and why not if it couldn't be. + * + * Example: + * ```php + * $client->scheduling->holidayCalendars->get( + * 'id', + * ); + * ``` + * + * @param string $id The holiday calendar's id. + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return ?SchedulingHolidayCalendar + * @throws CossException + * @throws CossApiException + */ + public function get(string $id, ?array $options = null): ?SchedulingHolidayCalendar + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Default_->value, + path: "v1/scheduling/holiday_calendars/" . RawClient::encodePathParam($id), + method: HttpMethod::GET, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + if (empty($json)) { + return null; + } + return SchedulingHolidayCalendar::fromJson($json); + } + } catch (JsonException $e) { + throw new CossException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (ClientExceptionInterface $e) { + throw new CossException(message: $e->getMessage(), previous: $e); + } + throw new CossApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Hosts can be booked on its days again, shortly: past entries stay. + * + * Example: + * ```php + * $client->scheduling->holidayCalendars->remove( + * 'id', + * ); + * ``` + * + * @param string $id The holiday calendar's id. + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return ?DeletedSchedulingHolidayCalendar + * @throws CossException + * @throws CossApiException + */ + public function remove(string $id, ?array $options = null): ?DeletedSchedulingHolidayCalendar + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Default_->value, + path: "v1/scheduling/holiday_calendars/" . RawClient::encodePathParam($id), + method: HttpMethod::DELETE, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + if (empty($json)) { + return null; + } + return DeletedSchedulingHolidayCalendar::fromJson($json); + } + } catch (JsonException $e) { + throw new CossException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (ClientExceptionInterface $e) { + throw new CossException(message: $e->getMessage(), previous: $e); + } + throw new CossApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Who it applies to, who covers and what happens to bookings. Takes effect shortly. + * + * Example: + * ```php + * $client->scheduling->holidayCalendars->update( + * 'id', + * new UpdateSchedulingHolidayCalendarRequest([ + * 'hostFilter' => [ + * 'team' => 'london', + * ], + * ]), + * ); + * ``` + * + * @param string $id The holiday calendar's id. + * @param UpdateSchedulingHolidayCalendarRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return ?SchedulingHolidayCalendar + * @throws CossException + * @throws CossApiException + */ + public function update(string $id, UpdateSchedulingHolidayCalendarRequest $request = new UpdateSchedulingHolidayCalendarRequest(), ?array $options = null): ?SchedulingHolidayCalendar + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Default_->value, + path: "v1/scheduling/holiday_calendars/" . RawClient::encodePathParam($id), + method: HttpMethod::PATCH, + body: $request, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + if (empty($json)) { + return null; + } + return SchedulingHolidayCalendar::fromJson($json); + } + } catch (JsonException $e) { + throw new CossException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (ClientExceptionInterface $e) { + throw new CossException(message: $e->getMessage(), previous: $e); + } + throw new CossApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * What's coming, with names, as last read. Empty until its first read. + * + * Example: + * ```php + * $client->scheduling->holidayCalendars->holidays( + * 'id', + * ); + * ``` + * + * @param string $id The holiday calendar's id. + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return ?SchedulingHolidayList + * @throws CossException + * @throws CossApiException + */ + public function holidays(string $id, ?array $options = null): ?SchedulingHolidayList + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Default_->value, + path: "v1/scheduling/holiday_calendars/" . RawClient::encodePathParam($id) . "/holidays", + method: HttpMethod::GET, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + if (empty($json)) { + return null; + } + return SchedulingHolidayList::fromJson($json); + } + } catch (JsonException $e) { + throw new CossException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (ClientExceptionInterface $e) { + throw new CossException(message: $e->getMessage(), previous: $e); + } + throw new CossApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } +} diff --git a/sdks/php/src/Scheduling/HolidayCalendars/Requests/CreateSchedulingHolidayCalendarRequest.php b/sdks/php/src/Scheduling/HolidayCalendars/Requests/CreateSchedulingHolidayCalendarRequest.php new file mode 100644 index 000000000..3b68033bd --- /dev/null +++ b/sdks/php/src/Scheduling/HolidayCalendars/Requests/CreateSchedulingHolidayCalendarRequest.php @@ -0,0 +1,112 @@ + $hosts These hosts, by id or uid. + */ + #[JsonProperty('hosts'), ArrayType(['string'])] + public ?array $hosts; + + /** + * @var ?array + * )> $hostFilter Everyone matching these attributes, asked again at every sync. + */ + #[JsonProperty('host_filter'), ArrayType(['string' => new Union('string', ['string'])])] + public ?array $hostFilter; + + /** + * @var ?array $regions Which regional holidays apply, matched against how the calendar names them, such as `England`. Without this, all of them do; empty, only nationwide ones. + */ + #[JsonProperty('regions'), ArrayType(['string'])] + public ?array $regions; + + /** + * @var ?array $delegates Who can be booked in their place on those days, by id or uid, in order. + */ + #[JsonProperty('delegates'), ArrayType(['string'])] + public ?array $delegates; + + /** + * @var ?value-of $existingBookings What happens to bookings already on a holiday. `leave` (the default) only reports them. `reassign` moves them. + */ + #[JsonProperty('existing_bookings')] + public ?string $existingBookings; + + /** + * @param array{ + * name: string, + * country?: ?string, + * icsUrl?: ?string, + * hosts?: ?array, + * hostFilter?: ?array + * )>, + * regions?: ?array, + * delegates?: ?array, + * existingBookings?: ?value-of, + * } $values + */ + public function __construct( + array $values, + ) { + $this->name = $values['name']; + $this->country = $values['country'] ?? null; + if (array_key_exists('country', $values)) { + $this->_setField('country'); + } + $this->icsUrl = $values['icsUrl'] ?? null; + if (array_key_exists('icsUrl', $values)) { + $this->_setField('icsUrl'); + } + $this->hosts = $values['hosts'] ?? null; + if (array_key_exists('hosts', $values)) { + $this->_setField('hosts'); + } + $this->hostFilter = $values['hostFilter'] ?? null; + if (array_key_exists('hostFilter', $values)) { + $this->_setField('hostFilter'); + } + $this->regions = $values['regions'] ?? null; + if (array_key_exists('regions', $values)) { + $this->_setField('regions'); + } + $this->delegates = $values['delegates'] ?? null; + if (array_key_exists('delegates', $values)) { + $this->_setField('delegates'); + } + $this->existingBookings = $values['existingBookings'] ?? null; + if (array_key_exists('existingBookings', $values)) { + $this->_setField('existingBookings'); + } + } +} diff --git a/sdks/php/src/Scheduling/HolidayCalendars/Requests/UpdateSchedulingHolidayCalendarRequest.php b/sdks/php/src/Scheduling/HolidayCalendars/Requests/UpdateSchedulingHolidayCalendarRequest.php new file mode 100644 index 000000000..da8911612 --- /dev/null +++ b/sdks/php/src/Scheduling/HolidayCalendars/Requests/UpdateSchedulingHolidayCalendarRequest.php @@ -0,0 +1,93 @@ + $hosts These hosts, by id or uid. + */ + #[JsonProperty('hosts'), ArrayType(['string'])] + public ?array $hosts; + + /** + * @var ?array + * )> $hostFilter Everyone matching these attributes, asked again at every sync. + */ + #[JsonProperty('host_filter'), ArrayType(['string' => new Union('string', ['string'])])] + public ?array $hostFilter; + + /** + * @var ?array $regions Which regional holidays apply, matched against how the calendar names them, such as `England`. Without this, all of them do; empty, only nationwide ones. + */ + #[JsonProperty('regions'), ArrayType(['string'])] + public ?array $regions; + + /** + * @var ?array $delegates Who can be booked in their place on those days, by id or uid, in order. + */ + #[JsonProperty('delegates'), ArrayType(['string'])] + public ?array $delegates; + + /** + * @var ?value-of $existingBookings What happens to bookings already on a holiday. `leave` (the default) only reports them. `reassign` moves them. + */ + #[JsonProperty('existing_bookings')] + public ?string $existingBookings; + + /** + * @param array{ + * name?: ?string, + * hosts?: ?array, + * hostFilter?: ?array + * )>, + * regions?: ?array, + * delegates?: ?array, + * existingBookings?: ?value-of, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->name = $values['name'] ?? null; + if (array_key_exists('name', $values)) { + $this->_setField('name'); + } + $this->hosts = $values['hosts'] ?? null; + if (array_key_exists('hosts', $values)) { + $this->_setField('hosts'); + } + $this->hostFilter = $values['hostFilter'] ?? null; + if (array_key_exists('hostFilter', $values)) { + $this->_setField('hostFilter'); + } + $this->regions = $values['regions'] ?? null; + if (array_key_exists('regions', $values)) { + $this->_setField('regions'); + } + $this->delegates = $values['delegates'] ?? null; + if (array_key_exists('delegates', $values)) { + $this->_setField('delegates'); + } + $this->existingBookings = $values['existingBookings'] ?? null; + if (array_key_exists('existingBookings', $values)) { + $this->_setField('existingBookings'); + } + } +} diff --git a/sdks/php/src/Scheduling/HolidayCalendars/Types/CreateSchedulingHolidayCalendarRequestExistingBookings.php b/sdks/php/src/Scheduling/HolidayCalendars/Types/CreateSchedulingHolidayCalendarRequestExistingBookings.php new file mode 100644 index 000000000..bc18db4ca --- /dev/null +++ b/sdks/php/src/Scheduling/HolidayCalendars/Types/CreateSchedulingHolidayCalendarRequestExistingBookings.php @@ -0,0 +1,9 @@ +, + * } $options @phpstan-ignore-next-line Property is used in endpoint methods via HttpEndpointGenerator + */ + private array $options; + + /** + * @var RawClient $client + */ + private RawClient $client; + + /** + * @param RawClient $client + * @param ?array{ + * baseUrl?: string, + * client?: ClientInterface, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * } $options + */ + public function __construct( + RawClient $client, + ?array $options = null, + ) { + $this->client = $client; + $this->options = $options ?? []; + } + + /** + * At most one per provider, with how many connections use each. + * + * Example: + * ```php + * $client->scheduling->oauthApps->list(); + * ``` + * + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return ?SchedulingOauthAppList + * @throws CossException + * @throws CossApiException + */ + public function list(?array $options = null): ?SchedulingOauthAppList + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Default_->value, + path: "v1/scheduling/oauth_apps", + method: HttpMethod::GET, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + if (empty($json)) { + return null; + } + return SchedulingOauthAppList::fromJson($json); + } + } catch (JsonException $e) { + throw new CossException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (ClientExceptionInterface $e) { + throw new CossException(message: $e->getMessage(), previous: $e); + } + throw new CossApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * New consents in this environment use it, so the consent screen shows your brand. Connections made before it stay on coss.com's app until their host consents again. On the Scale plan and above. Secrets are never returned. + * + * Example: + * ```php + * $client->scheduling->oauthApps->create( + * CreateOauthAppRequest::google(new CreateOauthAppRequestGoogle([ + * 'clientId' => 'client_id', + * 'clientSecret' => 'client_secret', + * ])), + * ); + * ``` + * + * @param CreateOauthAppRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return ?SchedulingOauthApp + * @throws CossException + * @throws CossApiException + */ + public function create(CreateOauthAppRequest $request, ?array $options = null): ?SchedulingOauthApp + { + $options = array_merge($this->options, $options ?? []); + $options['maxRetries'] = 0; + $headers = []; + $headers['Idempotency-Key'] ??= IdempotencyKey::generate(); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Default_->value, + path: "v1/scheduling/oauth_apps", + method: HttpMethod::POST, + headers: $headers, + body: $request, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + if (empty($json)) { + return null; + } + return SchedulingOauthApp::fromJson($json); + } + } catch (JsonException $e) { + throw new CossException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (ClientExceptionInterface $e) { + throw new CossException(message: $e->getMessage(), previous: $e); + } + throw new CossApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Its status, what to register at the provider, and how many connections use it. + * + * Example: + * ```php + * $client->scheduling->oauthApps->get( + * 'calapp_01kd2m9a0b1c2d3e4f5g6h7j8m', + * ); + * ``` + * + * @param string $id The OAuth app's id. + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return ?SchedulingOauthApp + * @throws CossException + * @throws CossApiException + */ + public function get(string $id, ?array $options = null): ?SchedulingOauthApp + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Default_->value, + path: "v1/scheduling/oauth_apps/" . RawClient::encodePathParam($id), + method: HttpMethod::GET, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + if (empty($json)) { + return null; + } + return SchedulingOauthApp::fromJson($json); + } + } catch (JsonException $e) { + throw new CossException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (ClientExceptionInterface $e) { + throw new CossException(message: $e->getMessage(), previous: $e); + } + throw new CossApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Refused while connections use it (`oauth_app_in_use`), since only it can refresh their access: disconnect them first. New consents go back to coss.com's app. + * + * Example: + * ```php + * $client->scheduling->oauthApps->delete( + * 'calapp_01kd2m9a0b1c2d3e4f5g6h7j8m', + * ); + * ``` + * + * @param string $id The OAuth app's id. + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return ?DeletedSchedulingOauthApp + * @throws CossException + * @throws CossApiException + */ + public function delete(string $id, ?array $options = null): ?DeletedSchedulingOauthApp + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Default_->value, + path: "v1/scheduling/oauth_apps/" . RawClient::encodePathParam($id), + method: HttpMethod::DELETE, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + if (empty($json)) { + return null; + } + return DeletedSchedulingOauthApp::fromJson($json); + } + } catch (JsonException $e) { + throw new CossException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (ClientExceptionInterface $e) { + throw new CossException(message: $e->getMessage(), previous: $e); + } + throw new CossApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * A new client secret is tried on a connection before it replaces the old one, and ends an outage if it works. Its client ID can't change: a different app needs its hosts to consent again. + * + * Example: + * ```php + * $client->scheduling->oauthApps->update( + * 'calapp_01kd2m9a0b1c2d3e4f5g6h7j8m', + * new UpdateOauthAppRequest([ + * 'clientSecret' => 'GOCSPX-abcdefghijklmnopqrstuvwxyz', + * ]), + * ); + * ``` + * + * @param string $id The OAuth app's id. + * @param UpdateOauthAppRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return ?SchedulingOauthApp + * @throws CossException + * @throws CossApiException + */ + public function update(string $id, UpdateOauthAppRequest $request = new UpdateOauthAppRequest(), ?array $options = null): ?SchedulingOauthApp + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Default_->value, + path: "v1/scheduling/oauth_apps/" . RawClient::encodePathParam($id), + method: HttpMethod::PATCH, + body: $request, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + if (empty($json)) { + return null; + } + return SchedulingOauthApp::fromJson($json); + } + } catch (JsonException $e) { + throw new CossException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (ClientExceptionInterface $e) { + throw new CossException(message: $e->getMessage(), previous: $e); + } + throw new CossApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } +} diff --git a/sdks/php/src/Scheduling/OauthApps/Requests/UpdateOauthAppRequest.php b/sdks/php/src/Scheduling/OauthApps/Requests/UpdateOauthAppRequest.php new file mode 100644 index 000000000..98e587655 --- /dev/null +++ b/sdks/php/src/Scheduling/OauthApps/Requests/UpdateOauthAppRequest.php @@ -0,0 +1,86 @@ +clientSecret = $values['clientSecret'] ?? null; + if (array_key_exists('clientSecret', $values)) { + $this->_setField('clientSecret'); + } + $this->tenantId = $values['tenantId'] ?? null; + if (array_key_exists('tenantId', $values)) { + $this->_setField('tenantId'); + } + $this->webhookSecret = $values['webhookSecret'] ?? null; + if (array_key_exists('webhookSecret', $values)) { + $this->_setField('webhookSecret'); + } + $this->redirectUri = $values['redirectUri'] ?? null; + if (array_key_exists('redirectUri', $values)) { + $this->_setField('redirectUri'); + } + $this->completionUrl = $values['completionUrl'] ?? null; + if (array_key_exists('completionUrl', $values)) { + $this->_setField('completionUrl'); + } + $this->secretExpiresAt = $values['secretExpiresAt'] ?? null; + if (array_key_exists('secretExpiresAt', $values)) { + $this->_setField('secretExpiresAt'); + } + } +} diff --git a/sdks/php/src/Scheduling/OutOfOffice/OutOfOfficeClient.php b/sdks/php/src/Scheduling/OutOfOffice/OutOfOfficeClient.php new file mode 100644 index 000000000..2802d41b9 --- /dev/null +++ b/sdks/php/src/Scheduling/OutOfOffice/OutOfOfficeClient.php @@ -0,0 +1,499 @@ +, + * } $options @phpstan-ignore-next-line Property is used in endpoint methods via HttpEndpointGenerator + */ + private array $options; + + /** + * @var RawClient $client + */ + private RawClient $client; + + /** + * @param RawClient $client + * @param ?array{ + * baseUrl?: string, + * client?: ClientInterface, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * } $options + */ + public function __construct( + RawClient $client, + ?array $options = null, + ) { + $this->client = $client; + $this->options = $options ?? []; + } + + /** + * The environment's entries, newest first. + * + * Example: + * ```php + * $client->scheduling->outOfOffice->list( + * new ListOutOfOfficeRequest([ + * 'startAfter' => '2027-01-04T15:00:00.000Z', + * 'startBefore' => '2027-01-04T15:00:00.000Z', + * ]), + * ); + * ``` + * + * @param ListOutOfOfficeRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return ?SchedulingOutOfOfficeList + * @throws CossException + * @throws CossApiException + */ + public function list(ListOutOfOfficeRequest $request = new ListOutOfOfficeRequest(), ?array $options = null): ?SchedulingOutOfOfficeList + { + $options = array_merge($this->options, $options ?? []); + $query = []; + if ($request->limit != null) { + $query['limit'] = $request->limit; + } + if ($request->after != null) { + $query['after'] = $request->after; + } + if ($request->host != null) { + $query['host'] = $request->host; + } + if ($request->startAfter != null) { + $query['start_after'] = $request->startAfter; + } + if ($request->startBefore != null) { + $query['start_before'] = $request->startBefore; + } + if ($request->group != null) { + $query['group'] = $request->group; + } + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Default_->value, + path: "v1/scheduling/out_of_office", + method: HttpMethod::GET, + query: $query, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + if (empty($json)) { + return null; + } + return SchedulingOutOfOfficeList::fromJson($json); + } + } catch (JsonException $e) { + throw new CossException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (ClientExceptionInterface $e) { + throw new CossException(message: $e->getMessage(), previous: $e); + } + throw new CossApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Marks one host, a list of hosts or everyone matching some attributes as away, for part of a day or for whole dates. They aren't offered during it. Existing bookings stay as they are: list them with the entry's conflicts. + * + * Example: + * ```php + * $client->scheduling->outOfOffice->create( + * new CreateSchedulingOutOfOfficeRequest([ + * 'host' => 'doctor_482', + * 'startDate' => '2027-08-02', + * 'endDate' => '2027-08-13', + * 'reason' => 'vacation', + * 'publicMessage' => 'Back on the 16th.', + * ]), + * ); + * ``` + * + * @param CreateSchedulingOutOfOfficeRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return ?SchedulingOutOfOfficeList + * @throws CossException + * @throws CossApiException + */ + public function create(CreateSchedulingOutOfOfficeRequest $request = new CreateSchedulingOutOfOfficeRequest(), ?array $options = null): ?SchedulingOutOfOfficeList + { + $options = array_merge($this->options, $options ?? []); + $options['maxRetries'] = 0; + $headers = []; + $headers['Idempotency-Key'] ??= IdempotencyKey::generate(); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Default_->value, + path: "v1/scheduling/out_of_office", + method: HttpMethod::POST, + headers: $headers, + body: $request, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + if (empty($json)) { + return null; + } + return SchedulingOutOfOfficeList::fromJson($json); + } + } catch (JsonException $e) { + throw new CossException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (ClientExceptionInterface $e) { + throw new CossException(message: $e->getMessage(), previous: $e); + } + throw new CossApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * One entry. + * + * Example: + * ```php + * $client->scheduling->outOfOffice->get( + * 'ooo_01kd2m9a0b1c2d3e4f5g6h7j8m', + * ); + * ``` + * + * @param string $id The entry's id. + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return ?SchedulingOutOfOffice + * @throws CossException + * @throws CossApiException + */ + public function get(string $id, ?array $options = null): ?SchedulingOutOfOffice + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Default_->value, + path: "v1/scheduling/out_of_office/" . RawClient::encodePathParam($id), + method: HttpMethod::GET, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + if (empty($json)) { + return null; + } + return SchedulingOutOfOffice::fromJson($json); + } + } catch (JsonException $e) { + throw new CossException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (ClientExceptionInterface $e) { + throw new CossException(message: $e->getMessage(), previous: $e); + } + throw new CossApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * The host can be booked in that time again, and any calendar event for it goes. + * + * Example: + * ```php + * $client->scheduling->outOfOffice->remove( + * 'ooo_01kd2m9a0b1c2d3e4f5g6h7j8m', + * ); + * ``` + * + * @param string $id The entry's id. + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return ?DeletedSchedulingOutOfOffice + * @throws CossException + * @throws CossApiException + */ + public function remove(string $id, ?array $options = null): ?DeletedSchedulingOutOfOffice + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Default_->value, + path: "v1/scheduling/out_of_office/" . RawClient::encodePathParam($id), + method: HttpMethod::DELETE, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + if (empty($json)) { + return null; + } + return DeletedSchedulingOutOfOffice::fromJson($json); + } + } catch (JsonException $e) { + throw new CossException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (ClientExceptionInterface $e) { + throw new CossException(message: $e->getMessage(), previous: $e); + } + throw new CossApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Changes what's given. An entry stays with its host. + * + * Example: + * ```php + * $client->scheduling->outOfOffice->update( + * 'ooo_01kd2m9a0b1c2d3e4f5g6h7j8m', + * new UpdateSchedulingOutOfOfficeRequest([ + * 'endDate' => '2027-08-20', + * ]), + * ); + * ``` + * + * @param string $id The entry's id. + * @param UpdateSchedulingOutOfOfficeRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return ?SchedulingOutOfOffice + * @throws CossException + * @throws CossApiException + */ + public function update(string $id, UpdateSchedulingOutOfOfficeRequest $request = new UpdateSchedulingOutOfOfficeRequest(), ?array $options = null): ?SchedulingOutOfOffice + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Default_->value, + path: "v1/scheduling/out_of_office/" . RawClient::encodePathParam($id), + method: HttpMethod::PATCH, + body: $request, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + if (empty($json)) { + return null; + } + return SchedulingOutOfOffice::fromJson($json); + } + } catch (JsonException $e) { + throw new CossException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (ClientExceptionInterface $e) { + throw new CossException(message: $e->getMessage(), previous: $e); + } + throw new CossApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * For syncing from a system of record such as an HR tool: send what it says, as often as you like, and there's one entry for it. Give every field you want to keep. + * + * Example: + * ```php + * $client->scheduling->outOfOffice->put( + * 'hr_leave_4471', + * new PutSchedulingOutOfOfficeRequest([ + * 'host' => 'doctor_482', + * 'startDate' => '2027-08-02', + * 'endDate' => '2027-08-13', + * 'reason' => 'vacation', + * ]), + * ); + * ``` + * + * @param string $externalId Your own id for the entry. + * @param PutSchedulingOutOfOfficeRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return ?SchedulingOutOfOffice + * @throws CossException + * @throws CossApiException + */ + public function put(string $externalId, PutSchedulingOutOfOfficeRequest $request, ?array $options = null): ?SchedulingOutOfOffice + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Default_->value, + path: "v1/scheduling/out_of_office/by_external_id/" . RawClient::encodePathParam($externalId), + method: HttpMethod::PUT, + body: $request, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + if (empty($json)) { + return null; + } + return SchedulingOutOfOffice::fromJson($json); + } + } catch (JsonException $e) { + throw new CossException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (ClientExceptionInterface $e) { + throw new CossException(message: $e->getMessage(), previous: $e); + } + throw new CossApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Live bookings of the host that fall in the entry, soonest first. Entries never change them. + * + * Example: + * ```php + * $client->scheduling->outOfOffice->conflicts( + * 'ooo_01kd2m9a0b1c2d3e4f5g6h7j8m', + * new ConflictsOutOfOfficeRequest([]), + * ); + * ``` + * + * @param string $id The entry's id. + * @param ConflictsOutOfOfficeRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return ?SchedulingOutOfOfficeConflictList + * @throws CossException + * @throws CossApiException + */ + public function conflicts(string $id, ConflictsOutOfOfficeRequest $request = new ConflictsOutOfOfficeRequest(), ?array $options = null): ?SchedulingOutOfOfficeConflictList + { + $options = array_merge($this->options, $options ?? []); + $query = []; + if ($request->limit != null) { + $query['limit'] = $request->limit; + } + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Default_->value, + path: "v1/scheduling/out_of_office/" . RawClient::encodePathParam($id) . "/conflicts", + method: HttpMethod::GET, + query: $query, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + if (empty($json)) { + return null; + } + return SchedulingOutOfOfficeConflictList::fromJson($json); + } + } catch (JsonException $e) { + throw new CossException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (ClientExceptionInterface $e) { + throw new CossException(message: $e->getMessage(), previous: $e); + } + throw new CossApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } +} diff --git a/sdks/php/src/Scheduling/OutOfOffice/Requests/ConflictsOutOfOfficeRequest.php b/sdks/php/src/Scheduling/OutOfOffice/Requests/ConflictsOutOfOfficeRequest.php new file mode 100644 index 000000000..48792a9d9 --- /dev/null +++ b/sdks/php/src/Scheduling/OutOfOffice/Requests/ConflictsOutOfOfficeRequest.php @@ -0,0 +1,27 @@ +limit = $values['limit'] ?? null; + if (array_key_exists('limit', $values)) { + $this->_setField('limit'); + } + } +} diff --git a/sdks/php/src/Scheduling/OutOfOffice/Requests/CreateSchedulingOutOfOfficeRequest.php b/sdks/php/src/Scheduling/OutOfOffice/Requests/CreateSchedulingOutOfOfficeRequest.php new file mode 100644 index 000000000..912b4a2b5 --- /dev/null +++ b/sdks/php/src/Scheduling/OutOfOffice/Requests/CreateSchedulingOutOfOfficeRequest.php @@ -0,0 +1,204 @@ + $hosts Several hosts, by id or uid. Each gets an entry of their own. + */ + #[JsonProperty('hosts'), ArrayType(['string'])] + public ?array $hosts; + + /** + * @var ?array + * )> $hostFilter Every active host matching these attributes right now. A host added later isn't covered. + */ + #[JsonProperty('host_filter'), ArrayType(['string' => new Union('string', ['string'])])] + public ?array $hostFilter; + + /** + * @var ?string $start An ISO 8601 instant with an offset. + */ + #[JsonProperty('start')] + public ?string $start; + + /** + * @var ?string $end An ISO 8601 instant with an offset. + */ + #[JsonProperty('end')] + public ?string $end; + + /** + * @var ?string $startDate The first whole day away. Use instead of `start` and `end`. + */ + #[JsonProperty('start_date')] + public ?string $startDate; + + /** + * @var ?string $endDate The last whole day away, which is included. + */ + #[JsonProperty('end_date')] + public ?string $endDate; + + /** + * @var ?string $timeZone What the dates mean in. Default: the host's zone when this is made. + */ + #[JsonProperty('time_zone')] + public ?string $timeZone; + + /** + * @var ?array $delegates Who can be booked in this host's place during it, by id or uid, in the order to try them. They still have to fit how a booking's routed. + */ + #[JsonProperty('delegates'), ArrayType(['string'])] + public ?array $delegates; + + /** + * @var ?string $reason One of `unspecified`, `vacation`, `travel`, `sick`, `public_holiday`, `parental_leave`, `training` and `other`, or a key from the settings' `out_of_office_reasons`. Only people who manage this host see it: never bookers, webhooks or calendars. + */ + #[JsonProperty('reason')] + public ?string $reason; + + /** + * @var ?string $notes For people who manage this host. Encrypted, and never shown to a booker. + */ + #[JsonProperty('notes')] + public ?string $notes; + + /** + * @var ?string $publicMessage Shown to bookers while this host is away. Can't contain a link. + */ + #[JsonProperty('public_message')] + public ?string $publicMessage; + + /** + * @var ?bool $showOnCalendar Put a private "Out of office" event on the host's calendar. Default: true. + */ + #[JsonProperty('show_on_calendar')] + public ?bool $showOnCalendar; + + /** + * @var ?value-of $existingBookings What happens to bookings already in the way. `leave` (the default) only reports them. `reassign` moves them, and any nobody can take stay where they are. + */ + #[JsonProperty('existing_bookings')] + public ?string $existingBookings; + + /** + * @var ?CreateSchedulingOutOfOfficeRequestReassign $reassign With `existing_bookings: reassign`: who they go to. Default: the fairest who's free. + */ + #[JsonProperty('reassign')] + public ?CreateSchedulingOutOfOfficeRequestReassign $reassign; + + /** + * @var ?string $externalId Your own id for this entry, unique in the environment. Needs one host. + */ + #[JsonProperty('external_id')] + public ?string $externalId; + + /** + * @param array{ + * host?: ?string, + * hosts?: ?array, + * hostFilter?: ?array + * )>, + * start?: ?string, + * end?: ?string, + * startDate?: ?string, + * endDate?: ?string, + * timeZone?: ?string, + * delegates?: ?array, + * reason?: ?string, + * notes?: ?string, + * publicMessage?: ?string, + * showOnCalendar?: ?bool, + * existingBookings?: ?value-of, + * reassign?: ?CreateSchedulingOutOfOfficeRequestReassign, + * externalId?: ?string, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->host = $values['host'] ?? null; + if (array_key_exists('host', $values)) { + $this->_setField('host'); + } + $this->hosts = $values['hosts'] ?? null; + if (array_key_exists('hosts', $values)) { + $this->_setField('hosts'); + } + $this->hostFilter = $values['hostFilter'] ?? null; + if (array_key_exists('hostFilter', $values)) { + $this->_setField('hostFilter'); + } + $this->start = $values['start'] ?? null; + if (array_key_exists('start', $values)) { + $this->_setField('start'); + } + $this->end = $values['end'] ?? null; + if (array_key_exists('end', $values)) { + $this->_setField('end'); + } + $this->startDate = $values['startDate'] ?? null; + if (array_key_exists('startDate', $values)) { + $this->_setField('startDate'); + } + $this->endDate = $values['endDate'] ?? null; + if (array_key_exists('endDate', $values)) { + $this->_setField('endDate'); + } + $this->timeZone = $values['timeZone'] ?? null; + if (array_key_exists('timeZone', $values)) { + $this->_setField('timeZone'); + } + $this->delegates = $values['delegates'] ?? null; + if (array_key_exists('delegates', $values)) { + $this->_setField('delegates'); + } + $this->reason = $values['reason'] ?? null; + if (array_key_exists('reason', $values)) { + $this->_setField('reason'); + } + $this->notes = $values['notes'] ?? null; + if (array_key_exists('notes', $values)) { + $this->_setField('notes'); + } + $this->publicMessage = $values['publicMessage'] ?? null; + if (array_key_exists('publicMessage', $values)) { + $this->_setField('publicMessage'); + } + $this->showOnCalendar = $values['showOnCalendar'] ?? null; + if (array_key_exists('showOnCalendar', $values)) { + $this->_setField('showOnCalendar'); + } + $this->existingBookings = $values['existingBookings'] ?? null; + if (array_key_exists('existingBookings', $values)) { + $this->_setField('existingBookings'); + } + $this->reassign = $values['reassign'] ?? null; + if (array_key_exists('reassign', $values)) { + $this->_setField('reassign'); + } + $this->externalId = $values['externalId'] ?? null; + if (array_key_exists('externalId', $values)) { + $this->_setField('externalId'); + } + } +} diff --git a/sdks/php/src/Scheduling/OutOfOffice/Requests/ListOutOfOfficeRequest.php b/sdks/php/src/Scheduling/OutOfOffice/Requests/ListOutOfOfficeRequest.php new file mode 100644 index 000000000..88c92a538 --- /dev/null +++ b/sdks/php/src/Scheduling/OutOfOffice/Requests/ListOutOfOfficeRequest.php @@ -0,0 +1,77 @@ +limit = $values['limit'] ?? null; + if (array_key_exists('limit', $values)) { + $this->_setField('limit'); + } + $this->after = $values['after'] ?? null; + if (array_key_exists('after', $values)) { + $this->_setField('after'); + } + $this->host = $values['host'] ?? null; + if (array_key_exists('host', $values)) { + $this->_setField('host'); + } + $this->startAfter = $values['startAfter'] ?? null; + if (array_key_exists('startAfter', $values)) { + $this->_setField('startAfter'); + } + $this->startBefore = $values['startBefore'] ?? null; + if (array_key_exists('startBefore', $values)) { + $this->_setField('startBefore'); + } + $this->group = $values['group'] ?? null; + if (array_key_exists('group', $values)) { + $this->_setField('group'); + } + } +} diff --git a/sdks/php/src/Scheduling/OutOfOffice/Requests/PutSchedulingOutOfOfficeRequest.php b/sdks/php/src/Scheduling/OutOfOffice/Requests/PutSchedulingOutOfOfficeRequest.php new file mode 100644 index 000000000..d827bc94a --- /dev/null +++ b/sdks/php/src/Scheduling/OutOfOffice/Requests/PutSchedulingOutOfOfficeRequest.php @@ -0,0 +1,161 @@ + $delegates Who can be booked in this host's place during it, by id or uid, in the order to try them. They still have to fit how a booking's routed. + */ + #[JsonProperty('delegates'), ArrayType(['string'])] + public ?array $delegates; + + /** + * @var ?string $reason One of `unspecified`, `vacation`, `travel`, `sick`, `public_holiday`, `parental_leave`, `training` and `other`, or a key from the settings' `out_of_office_reasons`. Only people who manage this host see it: never bookers, webhooks or calendars. + */ + #[JsonProperty('reason')] + public ?string $reason; + + /** + * @var ?string $notes For people who manage this host. Encrypted, and never shown to a booker. + */ + #[JsonProperty('notes')] + public ?string $notes; + + /** + * @var ?string $publicMessage Shown to bookers while this host is away. Can't contain a link. + */ + #[JsonProperty('public_message')] + public ?string $publicMessage; + + /** + * @var ?bool $showOnCalendar Put a private "Out of office" event on the host's calendar. Default: true. + */ + #[JsonProperty('show_on_calendar')] + public ?bool $showOnCalendar; + + /** + * @var ?value-of $existingBookings What happens to bookings already in the way. `leave` (the default) only reports them. `reassign` moves them, and any nobody can take stay where they are. + */ + #[JsonProperty('existing_bookings')] + public ?string $existingBookings; + + /** + * @var ?PutSchedulingOutOfOfficeRequestReassign $reassign With `existing_bookings: reassign`: who they go to. Default: the fairest who's free. + */ + #[JsonProperty('reassign')] + public ?PutSchedulingOutOfOfficeRequestReassign $reassign; + + /** + * @param array{ + * host: string, + * start?: ?string, + * end?: ?string, + * startDate?: ?string, + * endDate?: ?string, + * timeZone?: ?string, + * delegates?: ?array, + * reason?: ?string, + * notes?: ?string, + * publicMessage?: ?string, + * showOnCalendar?: ?bool, + * existingBookings?: ?value-of, + * reassign?: ?PutSchedulingOutOfOfficeRequestReassign, + * } $values + */ + public function __construct( + array $values, + ) { + $this->host = $values['host']; + $this->start = $values['start'] ?? null; + if (array_key_exists('start', $values)) { + $this->_setField('start'); + } + $this->end = $values['end'] ?? null; + if (array_key_exists('end', $values)) { + $this->_setField('end'); + } + $this->startDate = $values['startDate'] ?? null; + if (array_key_exists('startDate', $values)) { + $this->_setField('startDate'); + } + $this->endDate = $values['endDate'] ?? null; + if (array_key_exists('endDate', $values)) { + $this->_setField('endDate'); + } + $this->timeZone = $values['timeZone'] ?? null; + if (array_key_exists('timeZone', $values)) { + $this->_setField('timeZone'); + } + $this->delegates = $values['delegates'] ?? null; + if (array_key_exists('delegates', $values)) { + $this->_setField('delegates'); + } + $this->reason = $values['reason'] ?? null; + if (array_key_exists('reason', $values)) { + $this->_setField('reason'); + } + $this->notes = $values['notes'] ?? null; + if (array_key_exists('notes', $values)) { + $this->_setField('notes'); + } + $this->publicMessage = $values['publicMessage'] ?? null; + if (array_key_exists('publicMessage', $values)) { + $this->_setField('publicMessage'); + } + $this->showOnCalendar = $values['showOnCalendar'] ?? null; + if (array_key_exists('showOnCalendar', $values)) { + $this->_setField('showOnCalendar'); + } + $this->existingBookings = $values['existingBookings'] ?? null; + if (array_key_exists('existingBookings', $values)) { + $this->_setField('existingBookings'); + } + $this->reassign = $values['reassign'] ?? null; + if (array_key_exists('reassign', $values)) { + $this->_setField('reassign'); + } + } +} diff --git a/sdks/php/src/Scheduling/OutOfOffice/Requests/UpdateSchedulingOutOfOfficeRequest.php b/sdks/php/src/Scheduling/OutOfOffice/Requests/UpdateSchedulingOutOfOfficeRequest.php new file mode 100644 index 000000000..ae7be1ac6 --- /dev/null +++ b/sdks/php/src/Scheduling/OutOfOffice/Requests/UpdateSchedulingOutOfOfficeRequest.php @@ -0,0 +1,153 @@ + $delegates Who can be booked in this host's place during it, by id or uid, in the order to try them. They still have to fit how a booking's routed. + */ + #[JsonProperty('delegates'), ArrayType(['string'])] + public ?array $delegates; + + /** + * @var ?value-of $existingBookings What happens to bookings already in the way. `leave` (the default) only reports them. `reassign` moves them, and any nobody can take stay where they are. + */ + #[JsonProperty('existing_bookings')] + public ?string $existingBookings; + + /** + * @var ?UpdateSchedulingOutOfOfficeRequestReassign $reassign With `existing_bookings: reassign`: who they go to. Default: the fairest who's free. + */ + #[JsonProperty('reassign')] + public ?UpdateSchedulingOutOfOfficeRequestReassign $reassign; + + /** + * @param array{ + * start?: ?string, + * end?: ?string, + * startDate?: ?string, + * endDate?: ?string, + * timeZone?: ?string, + * reason?: ?string, + * notes?: ?string, + * publicMessage?: ?string, + * showOnCalendar?: ?bool, + * delegates?: ?array, + * existingBookings?: ?value-of, + * reassign?: ?UpdateSchedulingOutOfOfficeRequestReassign, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->start = $values['start'] ?? null; + if (array_key_exists('start', $values)) { + $this->_setField('start'); + } + $this->end = $values['end'] ?? null; + if (array_key_exists('end', $values)) { + $this->_setField('end'); + } + $this->startDate = $values['startDate'] ?? null; + if (array_key_exists('startDate', $values)) { + $this->_setField('startDate'); + } + $this->endDate = $values['endDate'] ?? null; + if (array_key_exists('endDate', $values)) { + $this->_setField('endDate'); + } + $this->timeZone = $values['timeZone'] ?? null; + if (array_key_exists('timeZone', $values)) { + $this->_setField('timeZone'); + } + $this->reason = $values['reason'] ?? null; + if (array_key_exists('reason', $values)) { + $this->_setField('reason'); + } + $this->notes = $values['notes'] ?? null; + if (array_key_exists('notes', $values)) { + $this->_setField('notes'); + } + $this->publicMessage = $values['publicMessage'] ?? null; + if (array_key_exists('publicMessage', $values)) { + $this->_setField('publicMessage'); + } + $this->showOnCalendar = $values['showOnCalendar'] ?? null; + if (array_key_exists('showOnCalendar', $values)) { + $this->_setField('showOnCalendar'); + } + $this->delegates = $values['delegates'] ?? null; + if (array_key_exists('delegates', $values)) { + $this->_setField('delegates'); + } + $this->existingBookings = $values['existingBookings'] ?? null; + if (array_key_exists('existingBookings', $values)) { + $this->_setField('existingBookings'); + } + $this->reassign = $values['reassign'] ?? null; + if (array_key_exists('reassign', $values)) { + $this->_setField('reassign'); + } + } +} diff --git a/sdks/php/src/Scheduling/OutOfOffice/Types/CreateSchedulingOutOfOfficeRequestExistingBookings.php b/sdks/php/src/Scheduling/OutOfOffice/Types/CreateSchedulingOutOfOfficeRequestExistingBookings.php new file mode 100644 index 000000000..c44843c99 --- /dev/null +++ b/sdks/php/src/Scheduling/OutOfOffice/Types/CreateSchedulingOutOfOfficeRequestExistingBookings.php @@ -0,0 +1,9 @@ + $preferredHosts Try these first, in order. + */ + #[JsonProperty('preferred_hosts'), ArrayType(['string'])] + public ?array $preferredHosts; + + /** + * @var ?value-of $otherwise After `preferred_hosts`: `auto` picks the fairest who's free (the default), `leave` keeps it where it is. + */ + #[JsonProperty('otherwise')] + public ?string $otherwise; + + /** + * @param array{ + * toHost?: ?string, + * preferredHosts?: ?array, + * otherwise?: ?value-of, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->toHost = $values['toHost'] ?? null; + if (array_key_exists('toHost', $values)) { + $this->_setField('toHost'); + } + $this->preferredHosts = $values['preferredHosts'] ?? null; + if (array_key_exists('preferredHosts', $values)) { + $this->_setField('preferredHosts'); + } + $this->otherwise = $values['otherwise'] ?? null; + if (array_key_exists('otherwise', $values)) { + $this->_setField('otherwise'); + } + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/sdks/php/src/Scheduling/OutOfOffice/Types/CreateSchedulingOutOfOfficeRequestReassignOtherwise.php b/sdks/php/src/Scheduling/OutOfOffice/Types/CreateSchedulingOutOfOfficeRequestReassignOtherwise.php new file mode 100644 index 000000000..37460c00b --- /dev/null +++ b/sdks/php/src/Scheduling/OutOfOffice/Types/CreateSchedulingOutOfOfficeRequestReassignOtherwise.php @@ -0,0 +1,9 @@ + $preferredHosts Try these first, in order. + */ + #[JsonProperty('preferred_hosts'), ArrayType(['string'])] + public ?array $preferredHosts; + + /** + * @var ?value-of $otherwise After `preferred_hosts`: `auto` picks the fairest who's free (the default), `leave` keeps it where it is. + */ + #[JsonProperty('otherwise')] + public ?string $otherwise; + + /** + * @param array{ + * toHost?: ?string, + * preferredHosts?: ?array, + * otherwise?: ?value-of, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->toHost = $values['toHost'] ?? null; + if (array_key_exists('toHost', $values)) { + $this->_setField('toHost'); + } + $this->preferredHosts = $values['preferredHosts'] ?? null; + if (array_key_exists('preferredHosts', $values)) { + $this->_setField('preferredHosts'); + } + $this->otherwise = $values['otherwise'] ?? null; + if (array_key_exists('otherwise', $values)) { + $this->_setField('otherwise'); + } + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/sdks/php/src/Scheduling/OutOfOffice/Types/PutSchedulingOutOfOfficeRequestReassignOtherwise.php b/sdks/php/src/Scheduling/OutOfOffice/Types/PutSchedulingOutOfOfficeRequestReassignOtherwise.php new file mode 100644 index 000000000..67b089637 --- /dev/null +++ b/sdks/php/src/Scheduling/OutOfOffice/Types/PutSchedulingOutOfOfficeRequestReassignOtherwise.php @@ -0,0 +1,9 @@ + $preferredHosts Try these first, in order. + */ + #[JsonProperty('preferred_hosts'), ArrayType(['string'])] + public ?array $preferredHosts; + + /** + * @var ?value-of $otherwise After `preferred_hosts`: `auto` picks the fairest who's free (the default), `leave` keeps it where it is. + */ + #[JsonProperty('otherwise')] + public ?string $otherwise; + + /** + * @param array{ + * toHost?: ?string, + * preferredHosts?: ?array, + * otherwise?: ?value-of, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->toHost = $values['toHost'] ?? null; + if (array_key_exists('toHost', $values)) { + $this->_setField('toHost'); + } + $this->preferredHosts = $values['preferredHosts'] ?? null; + if (array_key_exists('preferredHosts', $values)) { + $this->_setField('preferredHosts'); + } + $this->otherwise = $values['otherwise'] ?? null; + if (array_key_exists('otherwise', $values)) { + $this->_setField('otherwise'); + } + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/sdks/php/src/Scheduling/OutOfOffice/Types/UpdateSchedulingOutOfOfficeRequestReassignOtherwise.php b/sdks/php/src/Scheduling/OutOfOffice/Types/UpdateSchedulingOutOfOfficeRequestReassignOtherwise.php new file mode 100644 index 000000000..aa6daa596 --- /dev/null +++ b/sdks/php/src/Scheduling/OutOfOffice/Types/UpdateSchedulingOutOfOfficeRequestReassignOtherwise.php @@ -0,0 +1,9 @@ +, + * } $options @phpstan-ignore-next-line Property is used in endpoint methods via HttpEndpointGenerator + */ + private array $options; + + /** + * @var RawClient $client + */ + private RawClient $client; + + /** + * @param RawClient $client + * @param ?array{ + * baseUrl?: string, + * client?: ClientInterface, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * } $options + */ + public function __construct( + RawClient $client, + ?array $options = null, + ) { + $this->client = $client; + $this->options = $options ?? []; + } + + /** + * Who each booking would go to, and why not when nobody can take it, without moving anything. It works down them in order, so two can't both be promised the same free hour. Change any of it and start the run with `assignments`. Covers the first 500. Things can change before you start it: the run decides again. + * + * Example: + * ```php + * $client->scheduling->reassignments->preview( + * new PreviewSchedulingReassignmentRequest([ + * 'selection' => new SchedulingReassignmentSelection([ + * 'host' => 'doctor_482', + * 'startBefore' => '2027-08-14T00:00:00.000Z', + * ]), + * 'strategy' => new SchedulingReassignmentStrategy([ + * 'preferredHosts' => [ + * 'doctor_518', + * ], + * ]), + * ]), + * ); + * ``` + * + * @param PreviewSchedulingReassignmentRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return ?SchedulingReassignmentPreview + * @throws CossException + * @throws CossApiException + */ + public function preview(PreviewSchedulingReassignmentRequest $request, ?array $options = null): ?SchedulingReassignmentPreview + { + $options = array_merge($this->options, $options ?? []); + $headers = []; + $headers['Idempotency-Key'] ??= IdempotencyKey::generate(); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Default_->value, + path: "v1/scheduling/reassignments/preview", + method: HttpMethod::POST, + headers: $headers, + body: $request, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + if (empty($json)) { + return null; + } + return SchedulingReassignmentPreview::fromJson($json); + } + } catch (JsonException $e) { + throw new CossException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (ClientExceptionInterface $e) { + throw new CossException(message: $e->getMessage(), previous: $e); + } + throw new CossApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Newest first, with how each is going. + * + * Example: + * ```php + * $client->scheduling->reassignments->list( + * new ListReassignmentsRequest([]), + * ); + * ``` + * + * @param ListReassignmentsRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return ?SchedulingReassignmentList + * @throws CossException + * @throws CossApiException + */ + public function list(ListReassignmentsRequest $request = new ListReassignmentsRequest(), ?array $options = null): ?SchedulingReassignmentList + { + $options = array_merge($this->options, $options ?? []); + $query = []; + if ($request->limit != null) { + $query['limit'] = $request->limit; + } + if ($request->after != null) { + $query['after'] = $request->after; + } + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Default_->value, + path: "v1/scheduling/reassignments", + method: HttpMethod::GET, + query: $query, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + if (empty($json)) { + return null; + } + return SchedulingReassignmentList::fromJson($json); + } + } catch (JsonException $e) { + throw new CossException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (ClientExceptionInterface $e) { + throw new CossException(message: $e->getMessage(), previous: $e); + } + throw new CossApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Moves up to 5,000 bookings in the background, each on its own, so one that can't move never holds up the rest. Nothing's ever cancelled: a booking nobody can take stays where it is, and its item says so. It answers at once: follow the run by its id, or wait for `scheduling.reassignment.completed`. + * + * Example: + * ```php + * $client->scheduling->reassignments->create( + * new CreateSchedulingReassignmentRequest([ + * 'idempotencyKey' => 'welcome-user-123', + * 'selection' => new SchedulingReassignmentSelection([ + * 'outOfOffice' => 'ooo_01kd2m9a0b1c2d3e4f5g6h7j8m', + * ]), + * 'strategy' => new SchedulingReassignmentStrategy([ + * 'preferredHosts' => [ + * 'doctor_518', + * ], + * ]), + * 'reasonCode' => CreateSchedulingReassignmentRequestReasonCode::OutOfOffice->value, + * ]), + * ); + * ``` + * + * @param CreateSchedulingReassignmentRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return ?SchedulingReassignment + * @throws CossException + * @throws CossApiException + */ + public function create(CreateSchedulingReassignmentRequest $request, ?array $options = null): ?SchedulingReassignment + { + $options = array_merge($this->options, $options ?? []); + $headers = []; + if ($request->idempotencyKey != null) { + $headers['Idempotency-Key'] = $request->idempotencyKey; + } + $headers['Idempotency-Key'] ??= IdempotencyKey::generate(); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Default_->value, + path: "v1/scheduling/reassignments", + method: HttpMethod::POST, + headers: $headers, + body: $request, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + if (empty($json)) { + return null; + } + return SchedulingReassignment::fromJson($json); + } + } catch (JsonException $e) { + throw new CossException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (ClientExceptionInterface $e) { + throw new CossException(message: $e->getMessage(), previous: $e); + } + throw new CossApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * How it's going. + * + * Example: + * ```php + * $client->scheduling->reassignments->get( + * 'id', + * ); + * ``` + * + * @param string $id The reassignment's id. + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return ?SchedulingReassignment + * @throws CossException + * @throws CossApiException + */ + public function get(string $id, ?array $options = null): ?SchedulingReassignment + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Default_->value, + path: "v1/scheduling/reassignments/" . RawClient::encodePathParam($id), + method: HttpMethod::GET, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + if (empty($json)) { + return null; + } + return SchedulingReassignment::fromJson($json); + } + } catch (JsonException $e) { + throw new CossException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (ClientExceptionInterface $e) { + throw new CossException(message: $e->getMessage(), previous: $e); + } + throw new CossApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Each booking it covers and what happened to it. A group session has one, for one of its seats. Empty until the worker's started on it. + * + * Example: + * ```php + * $client->scheduling->reassignments->items( + * 'id', + * new ItemsReassignmentsRequest([]), + * ); + * ``` + * + * @param string $id The reassignment's id. + * @param ItemsReassignmentsRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return ?SchedulingReassignmentItemList + * @throws CossException + * @throws CossApiException + */ + public function items(string $id, ItemsReassignmentsRequest $request = new ItemsReassignmentsRequest(), ?array $options = null): ?SchedulingReassignmentItemList + { + $options = array_merge($this->options, $options ?? []); + $query = []; + if ($request->limit != null) { + $query['limit'] = $request->limit; + } + if ($request->after != null) { + $query['after'] = $request->after; + } + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Default_->value, + path: "v1/scheduling/reassignments/" . RawClient::encodePathParam($id) . "/items", + method: HttpMethod::GET, + query: $query, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + if (empty($json)) { + return null; + } + return SchedulingReassignmentItemList::fromJson($json); + } + } catch (JsonException $e) { + throw new CossException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (ClientExceptionInterface $e) { + throw new CossException(message: $e->getMessage(), previous: $e); + } + throw new CossApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Stops what hasn't happened yet. What's moved stays moved: undo it for that. Cancelling one that's finished changes nothing. + * + * Example: + * ```php + * $client->scheduling->reassignments->cancel( + * 'id', + * ); + * ``` + * + * @param string $id The reassignment's id. + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return ?SchedulingReassignment + * @throws CossException + * @throws CossApiException + */ + public function cancel(string $id, ?array $options = null): ?SchedulingReassignment + { + $options = array_merge($this->options, $options ?? []); + $headers = []; + $headers['Idempotency-Key'] ??= IdempotencyKey::generate(); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Default_->value, + path: "v1/scheduling/reassignments/" . RawClient::encodePathParam($id) . "/cancel", + method: HttpMethod::POST, + headers: $headers, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + if (empty($json)) { + return null; + } + return SchedulingReassignment::fromJson($json); + } + } catch (JsonException $e) { + throw new CossException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (ClientExceptionInterface $e) { + throw new CossException(message: $e->getMessage(), previous: $e); + } + throw new CossApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Gives back what a finished run moved, as a new run. A booking that's moved on since stays where it went, and a former host who's no longer free keeps it from going back, unless you pass `overrides`. + * + * Example: + * ```php + * $client->scheduling->reassignments->undo( + * 'id', + * new UndoSchedulingReassignmentRequest([ + * 'reasonCode' => UndoSchedulingReassignmentRequestReasonCode::Other->value, + * ]), + * ); + * ``` + * + * @param string $id The reassignment's id. + * @param UndoSchedulingReassignmentRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return ?SchedulingReassignment + * @throws CossException + * @throws CossApiException + */ + public function undo(string $id, UndoSchedulingReassignmentRequest $request = new UndoSchedulingReassignmentRequest(), ?array $options = null): ?SchedulingReassignment + { + $options = array_merge($this->options, $options ?? []); + $options['maxRetries'] = 0; + $headers = []; + $headers['Idempotency-Key'] ??= IdempotencyKey::generate(); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Default_->value, + path: "v1/scheduling/reassignments/" . RawClient::encodePathParam($id) . "/undo", + method: HttpMethod::POST, + headers: $headers, + body: $request, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + if (empty($json)) { + return null; + } + return SchedulingReassignment::fromJson($json); + } + } catch (JsonException $e) { + throw new CossException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (ClientExceptionInterface $e) { + throw new CossException(message: $e->getMessage(), previous: $e); + } + throw new CossApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } +} diff --git a/sdks/php/src/Scheduling/Reassignments/Requests/CreateSchedulingReassignmentRequest.php b/sdks/php/src/Scheduling/Reassignments/Requests/CreateSchedulingReassignmentRequest.php new file mode 100644 index 000000000..7a7e98e4d --- /dev/null +++ b/sdks/php/src/Scheduling/Reassignments/Requests/CreateSchedulingReassignmentRequest.php @@ -0,0 +1,94 @@ + $reasonCode + */ + #[JsonProperty('reason_code')] + public string $reasonCode; + + /** + * @var ?string $note Why, in your words: required with an override of someone's availability. + */ + #[JsonProperty('note')] + public ?string $note; + + /** + * @var ?array> $overrides + */ + #[JsonProperty('overrides'), ArrayType(['string'])] + public ?array $overrides; + + /** + * @var ?CreateSchedulingReassignmentRequestNotify $notify + */ + #[JsonProperty('notify')] + public ?CreateSchedulingReassignmentRequestNotify $notify; + + /** + * @param array{ + * selection: SchedulingReassignmentSelection, + * reasonCode: value-of, + * idempotencyKey?: ?string, + * strategy?: ?SchedulingReassignmentStrategy, + * note?: ?string, + * overrides?: ?array>, + * notify?: ?CreateSchedulingReassignmentRequestNotify, + * } $values + */ + public function __construct( + array $values, + ) { + $this->idempotencyKey = $values['idempotencyKey'] ?? null; + if (array_key_exists('idempotencyKey', $values)) { + $this->_setField('idempotencyKey'); + } + $this->selection = $values['selection']; + $this->strategy = $values['strategy'] ?? null; + if (array_key_exists('strategy', $values)) { + $this->_setField('strategy'); + } + $this->reasonCode = $values['reasonCode']; + $this->note = $values['note'] ?? null; + if (array_key_exists('note', $values)) { + $this->_setField('note'); + } + $this->overrides = $values['overrides'] ?? null; + if (array_key_exists('overrides', $values)) { + $this->_setField('overrides'); + } + $this->notify = $values['notify'] ?? null; + if (array_key_exists('notify', $values)) { + $this->_setField('notify'); + } + } +} diff --git a/sdks/php/src/Scheduling/Reassignments/Requests/ItemsReassignmentsRequest.php b/sdks/php/src/Scheduling/Reassignments/Requests/ItemsReassignmentsRequest.php new file mode 100644 index 000000000..3a0dc8586 --- /dev/null +++ b/sdks/php/src/Scheduling/Reassignments/Requests/ItemsReassignmentsRequest.php @@ -0,0 +1,37 @@ +limit = $values['limit'] ?? null; + if (array_key_exists('limit', $values)) { + $this->_setField('limit'); + } + $this->after = $values['after'] ?? null; + if (array_key_exists('after', $values)) { + $this->_setField('after'); + } + } +} diff --git a/sdks/php/src/Scheduling/Reassignments/Requests/ListReassignmentsRequest.php b/sdks/php/src/Scheduling/Reassignments/Requests/ListReassignmentsRequest.php new file mode 100644 index 000000000..a28e006fe --- /dev/null +++ b/sdks/php/src/Scheduling/Reassignments/Requests/ListReassignmentsRequest.php @@ -0,0 +1,37 @@ +limit = $values['limit'] ?? null; + if (array_key_exists('limit', $values)) { + $this->_setField('limit'); + } + $this->after = $values['after'] ?? null; + if (array_key_exists('after', $values)) { + $this->_setField('after'); + } + } +} diff --git a/sdks/php/src/Scheduling/Reassignments/Requests/PreviewSchedulingReassignmentRequest.php b/sdks/php/src/Scheduling/Reassignments/Requests/PreviewSchedulingReassignmentRequest.php new file mode 100644 index 000000000..7b208ba0f --- /dev/null +++ b/sdks/php/src/Scheduling/Reassignments/Requests/PreviewSchedulingReassignmentRequest.php @@ -0,0 +1,52 @@ +> $overrides + */ + #[JsonProperty('overrides'), ArrayType(['string'])] + public ?array $overrides; + + /** + * @param array{ + * selection: SchedulingReassignmentSelection, + * strategy?: ?SchedulingReassignmentStrategy, + * overrides?: ?array>, + * } $values + */ + public function __construct( + array $values, + ) { + $this->selection = $values['selection']; + $this->strategy = $values['strategy'] ?? null; + if (array_key_exists('strategy', $values)) { + $this->_setField('strategy'); + } + $this->overrides = $values['overrides'] ?? null; + if (array_key_exists('overrides', $values)) { + $this->_setField('overrides'); + } + } +} diff --git a/sdks/php/src/Scheduling/Reassignments/Requests/UndoSchedulingReassignmentRequest.php b/sdks/php/src/Scheduling/Reassignments/Requests/UndoSchedulingReassignmentRequest.php new file mode 100644 index 000000000..edf45ea5a --- /dev/null +++ b/sdks/php/src/Scheduling/Reassignments/Requests/UndoSchedulingReassignmentRequest.php @@ -0,0 +1,66 @@ + $reasonCode + */ + #[JsonProperty('reason_code')] + public ?string $reasonCode; + + /** + * @var ?string $note + */ + #[JsonProperty('note')] + public ?string $note; + + /** + * @var ?array> $overrides + */ + #[JsonProperty('overrides'), ArrayType(['string'])] + public ?array $overrides; + + /** + * @var ?UndoSchedulingReassignmentRequestNotify $notify + */ + #[JsonProperty('notify')] + public ?UndoSchedulingReassignmentRequestNotify $notify; + + /** + * @param array{ + * reasonCode?: ?value-of, + * note?: ?string, + * overrides?: ?array>, + * notify?: ?UndoSchedulingReassignmentRequestNotify, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->reasonCode = $values['reasonCode'] ?? null; + if (array_key_exists('reasonCode', $values)) { + $this->_setField('reasonCode'); + } + $this->note = $values['note'] ?? null; + if (array_key_exists('note', $values)) { + $this->_setField('note'); + } + $this->overrides = $values['overrides'] ?? null; + if (array_key_exists('overrides', $values)) { + $this->_setField('overrides'); + } + $this->notify = $values['notify'] ?? null; + if (array_key_exists('notify', $values)) { + $this->_setField('notify'); + } + } +} diff --git a/sdks/php/src/Scheduling/Reassignments/Types/CreateSchedulingReassignmentRequestNotify.php b/sdks/php/src/Scheduling/Reassignments/Types/CreateSchedulingReassignmentRequestNotify.php new file mode 100644 index 000000000..c70b31dd8 --- /dev/null +++ b/sdks/php/src/Scheduling/Reassignments/Types/CreateSchedulingReassignmentRequestNotify.php @@ -0,0 +1,48 @@ + $hosts `digest` (the default) sends each host one email for the run. + */ + #[JsonProperty('hosts')] + public ?string $hosts; + + /** + * @param array{ + * attendees?: ?bool, + * hosts?: ?value-of, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->attendees = $values['attendees'] ?? null; + if (array_key_exists('attendees', $values)) { + $this->_setField('attendees'); + } + $this->hosts = $values['hosts'] ?? null; + if (array_key_exists('hosts', $values)) { + $this->_setField('hosts'); + } + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/sdks/php/src/Scheduling/Reassignments/Types/CreateSchedulingReassignmentRequestNotifyHosts.php b/sdks/php/src/Scheduling/Reassignments/Types/CreateSchedulingReassignmentRequestNotifyHosts.php new file mode 100644 index 000000000..cc5bb92c4 --- /dev/null +++ b/sdks/php/src/Scheduling/Reassignments/Types/CreateSchedulingReassignmentRequestNotifyHosts.php @@ -0,0 +1,10 @@ + $hosts `digest` (the default) sends each host one email for the run. + */ + #[JsonProperty('hosts')] + public ?string $hosts; + + /** + * @param array{ + * attendees?: ?bool, + * hosts?: ?value-of, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->attendees = $values['attendees'] ?? null; + if (array_key_exists('attendees', $values)) { + $this->_setField('attendees'); + } + $this->hosts = $values['hosts'] ?? null; + if (array_key_exists('hosts', $values)) { + $this->_setField('hosts'); + } + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/sdks/php/src/Scheduling/Reassignments/Types/UndoSchedulingReassignmentRequestNotifyHosts.php b/sdks/php/src/Scheduling/Reassignments/Types/UndoSchedulingReassignmentRequestNotifyHosts.php new file mode 100644 index 000000000..50085e7d8 --- /dev/null +++ b/sdks/php/src/Scheduling/Reassignments/Types/UndoSchedulingReassignmentRequestNotifyHosts.php @@ -0,0 +1,10 @@ +client = $client; $this->options = $options ?? []; $this->hosts = new HostsClient($this->client, $this->options); + $this->bookings = new BookingsClient($this->client, $this->options); + $this->reassignments = new ReassignmentsClient($this->client, $this->options); + $this->holidayCalendars = new HolidayCalendarsClient($this->client, $this->options); + $this->outOfOffice = new OutOfOfficeClient($this->client, $this->options); $this->schedules = new SchedulesClient($this->client, $this->options); $this->eventTypes = new EventTypesClient($this->client, $this->options); $this->slots = new SlotsClient($this->client, $this->options); $this->availability = new AvailabilityClient($this->client, $this->options); - $this->bookings = new BookingsClient($this->client, $this->options); $this->holds = new HoldsClient($this->client, $this->options); $this->series = new SeriesClient($this->client, $this->options); $this->attendees = new AttendeesClient($this->client, $this->options); $this->calendars = new CalendarsClient($this->client, $this->options); $this->calendarDelegations = new CalendarDelegationsClient($this->client, $this->options); + $this->oauthApps = new OauthAppsClient($this->client, $this->options); $this->sessions = new SessionsClient($this->client, $this->options); $this->settings = new SettingsClient($this->client, $this->options); } diff --git a/sdks/php/src/Scheduling/Sessions/Requests/CreateSchedulingManagerSessionRequest.php b/sdks/php/src/Scheduling/Sessions/Requests/CreateSchedulingManagerSessionRequest.php new file mode 100644 index 000000000..ebce8495f --- /dev/null +++ b/sdks/php/src/Scheduling/Sessions/Requests/CreateSchedulingManagerSessionRequest.php @@ -0,0 +1,70 @@ + $hosts The hosts this page can reach, by id or uid. + */ + #[JsonProperty('hosts'), ArrayType(['string'])] + public ?array $hosts; + + /** + * @var ?array + * )> $hostFilter Everyone matching these attributes, asked again on every request. + */ + #[JsonProperty('host_filter'), ArrayType(['string' => new Union('string', ['string'])])] + public ?array $hostFilter; + + /** + * @var ?int $expiresIn Seconds until it stops working. At most a day. + */ + #[JsonProperty('expires_in')] + public ?int $expiresIn; + + /** + * @var ?bool $readOnly + */ + #[JsonProperty('read_only')] + public ?bool $readOnly; + + /** + * @param array{ + * hosts?: ?array, + * hostFilter?: ?array + * )>, + * expiresIn?: ?int, + * readOnly?: ?bool, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->hosts = $values['hosts'] ?? null; + if (array_key_exists('hosts', $values)) { + $this->_setField('hosts'); + } + $this->hostFilter = $values['hostFilter'] ?? null; + if (array_key_exists('hostFilter', $values)) { + $this->_setField('hostFilter'); + } + $this->expiresIn = $values['expiresIn'] ?? null; + if (array_key_exists('expiresIn', $values)) { + $this->_setField('expiresIn'); + } + $this->readOnly = $values['readOnly'] ?? null; + if (array_key_exists('readOnly', $values)) { + $this->_setField('readOnly'); + } + } +} diff --git a/sdks/php/src/Scheduling/Sessions/SessionsClient.php b/sdks/php/src/Scheduling/Sessions/SessionsClient.php index db8bb15a6..dcd18e5b0 100644 --- a/sdks/php/src/Scheduling/Sessions/SessionsClient.php +++ b/sdks/php/src/Scheduling/Sessions/SessionsClient.php @@ -4,7 +4,7 @@ use Psr\Http\Client\ClientInterface; use Coss\Core\Client\RawClient; -use Coss\Scheduling\Sessions\Requests\CreateSchedulingHostSessionRequest; +use Coss\Scheduling\Sessions\Requests\CreateSchedulingManagerSessionRequest; use Coss\Types\SchedulingSession; use Coss\Exceptions\CossException; use Coss\Exceptions\CossApiException; @@ -14,6 +14,7 @@ use Coss\Core\Client\HttpMethod; use JsonException; use Psr\Http\Client\ClientExceptionInterface; +use Coss\Scheduling\Sessions\Requests\CreateSchedulingHostSessionRequest; use Coss\Scheduling\Sessions\Requests\CreateSchedulingBookerSessionRequest; class SessionsClient @@ -52,6 +53,71 @@ public function __construct( $this->options = $options ?? []; } + /** + * Lets a team lead manage cover for the hosts you name, or those matching an attribute filter whenever it's asked: time off, bookings that need someone else, and moving them. It never sees attendees' details. Send the `url` to their browser, or embed it with `coss/scheduling`. + * + * Example: + * ```php + * $client->scheduling->sessions->createForManager( + * new CreateSchedulingManagerSessionRequest([ + * 'hostFilter' => [ + * 'team' => 'cardiology', + * ], + * 'expiresIn' => 3600, + * ]), + * ); + * ``` + * + * @param CreateSchedulingManagerSessionRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return ?SchedulingSession + * @throws CossException + * @throws CossApiException + */ + public function createForManager(CreateSchedulingManagerSessionRequest $request = new CreateSchedulingManagerSessionRequest(), ?array $options = null): ?SchedulingSession + { + $options = array_merge($this->options, $options ?? []); + $options['maxRetries'] = 0; + $headers = []; + $headers['Idempotency-Key'] ??= IdempotencyKey::generate(); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Default_->value, + path: "v1/scheduling/manager_sessions", + method: HttpMethod::POST, + headers: $headers, + body: $request, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + if (empty($json)) { + return null; + } + return SchedulingSession::fromJson($json); + } + } catch (JsonException $e) { + throw new CossException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (ClientExceptionInterface $e) { + throw new CossException(message: $e->getMessage(), previous: $e); + } + throw new CossApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + /** * Lets one host manage their own hours, calendars and locations, on coss.com's hosted page or your own UI. Send the `url` to their browser, or embed it with `coss/scheduling`. * diff --git a/sdks/php/src/Scheduling/Settings/Requests/UpdateSchedulingSettingsRequest.php b/sdks/php/src/Scheduling/Settings/Requests/UpdateSchedulingSettingsRequest.php index 807a0a2eb..2ace1d0be 100644 --- a/sdks/php/src/Scheduling/Settings/Requests/UpdateSchedulingSettingsRequest.php +++ b/sdks/php/src/Scheduling/Settings/Requests/UpdateSchedulingSettingsRequest.php @@ -7,6 +7,8 @@ use Coss\Core\Types\ArrayType; use Coss\Scheduling\Settings\Types\UpdateSchedulingSettingsRequestLogo; use Coss\Scheduling\Settings\Types\UpdateSchedulingSettingsRequestCalendarFailureMode; +use Coss\Scheduling\Settings\Types\UpdateSchedulingSettingsRequestHostReassignment; +use Coss\Scheduling\Settings\Types\UpdateSchedulingSettingsRequestOutOfOfficeReasonsItem; use Coss\Scheduling\Settings\Types\UpdateSchedulingSettingsRequestNotificationsValue; use Coss\Core\Types\Union; use Coss\Types\SchedulingReminderInput; @@ -37,6 +39,12 @@ class UpdateSchedulingSettingsRequest extends JsonSerializableType #[JsonProperty('logo')] public ?UpdateSchedulingSettingsRequestLogo $logo; + /** + * @var ?string $privacyUrl Your privacy policy, as an https URL, for hosts connecting a calendar through your own OAuth app. `null` removes it. + */ + #[JsonProperty('privacy_url')] + public ?string $privacyUrl; + /** * @var ?string $emailFrom Sender of booking emails, on a verified domain. `null`: coss.com's own address. */ @@ -55,6 +63,24 @@ class UpdateSchedulingSettingsRequest extends JsonSerializableType #[JsonProperty('calendar_failure_mode')] public ?string $calendarFailureMode; + /** + * @var ?bool $nameHostInAttendeeEmails Name the new host when telling an attendee their booking has one. + */ + #[JsonProperty('name_host_in_attendee_emails')] + public ?bool $nameHostInAttendeeEmails; + + /** + * @var ?value-of $hostReassignment Whether hosts can give their own bookings to someone else from their page. `eligible` lets them, to anyone free who takes that event type. + */ + #[JsonProperty('host_reassignment')] + public ?string $hostReassignment; + + /** + * @var ?array $outOfOfficeReasons Reasons of your own, on top of the preset ones. Hosts and managers see them. + */ + #[JsonProperty('out_of_office_reasons'), ArrayType([UpdateSchedulingSettingsRequestOutOfOfficeReasonsItem::class])] + public ?array $outOfOfficeReasons; + /** * @var ?array $notifications Per event (`confirmed`, `pending_approval`, `rescheduled`, `cancelled`, `declined`, `reminder`), overriding the defaults. `null` restores them. */ @@ -79,9 +105,13 @@ class UpdateSchedulingSettingsRequest extends JsonSerializableType * brandName?: ?string, * accentColor?: ?string, * logo?: ?UpdateSchedulingSettingsRequestLogo, + * privacyUrl?: ?string, * emailFrom?: ?string, * smsFrom?: ?string, * calendarFailureMode?: ?value-of, + * nameHostInAttendeeEmails?: ?bool, + * hostReassignment?: ?value-of, + * outOfOfficeReasons?: ?array, * notifications?: ?array, * emailReplyTo?: ?string, * reminders?: ?array, @@ -106,6 +136,10 @@ public function __construct( if (array_key_exists('logo', $values)) { $this->_setField('logo'); } + $this->privacyUrl = $values['privacyUrl'] ?? null; + if (array_key_exists('privacyUrl', $values)) { + $this->_setField('privacyUrl'); + } $this->emailFrom = $values['emailFrom'] ?? null; if (array_key_exists('emailFrom', $values)) { $this->_setField('emailFrom'); @@ -118,6 +152,18 @@ public function __construct( if (array_key_exists('calendarFailureMode', $values)) { $this->_setField('calendarFailureMode'); } + $this->nameHostInAttendeeEmails = $values['nameHostInAttendeeEmails'] ?? null; + if (array_key_exists('nameHostInAttendeeEmails', $values)) { + $this->_setField('nameHostInAttendeeEmails'); + } + $this->hostReassignment = $values['hostReassignment'] ?? null; + if (array_key_exists('hostReassignment', $values)) { + $this->_setField('hostReassignment'); + } + $this->outOfOfficeReasons = $values['outOfOfficeReasons'] ?? null; + if (array_key_exists('outOfOfficeReasons', $values)) { + $this->_setField('outOfOfficeReasons'); + } $this->notifications = $values['notifications'] ?? null; if (array_key_exists('notifications', $values)) { $this->_setField('notifications'); diff --git a/sdks/php/src/Scheduling/Settings/Types/UpdateSchedulingSettingsRequestHostReassignment.php b/sdks/php/src/Scheduling/Settings/Types/UpdateSchedulingSettingsRequestHostReassignment.php new file mode 100644 index 000000000..c0154eccb --- /dev/null +++ b/sdks/php/src/Scheduling/Settings/Types/UpdateSchedulingSettingsRequestHostReassignment.php @@ -0,0 +1,9 @@ +key = $values['key']; + $this->label = $values['label']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/sdks/php/src/Types/CreateOauthAppRequest.php b/sdks/php/src/Types/CreateOauthAppRequest.php new file mode 100644 index 000000000..1c51860ee --- /dev/null +++ b/sdks/php/src/Types/CreateOauthAppRequest.php @@ -0,0 +1,241 @@ +provider = $values['provider']; + $this->value = $values['value']; + } + + /** + * @param CreateOauthAppRequestGoogle $google + * @return CreateOauthAppRequest + */ + public static function google(CreateOauthAppRequestGoogle $google): CreateOauthAppRequest + { + return new CreateOauthAppRequest([ + 'provider' => 'google', + 'value' => $google, + ]); + } + + /** + * @param CreateOauthAppRequestMicrosoft $microsoft + * @return CreateOauthAppRequest + */ + public static function microsoft(CreateOauthAppRequestMicrosoft $microsoft): CreateOauthAppRequest + { + return new CreateOauthAppRequest([ + 'provider' => 'microsoft', + 'value' => $microsoft, + ]); + } + + /** + * @param CreateOauthAppRequestZoom $zoom + * @return CreateOauthAppRequest + */ + public static function zoom(CreateOauthAppRequestZoom $zoom): CreateOauthAppRequest + { + return new CreateOauthAppRequest([ + 'provider' => 'zoom', + 'value' => $zoom, + ]); + } + + /** + * @return bool + */ + public function isGoogle(): bool + { + return $this->value instanceof CreateOauthAppRequestGoogle && $this->provider === 'google'; + } + + /** + * @return CreateOauthAppRequestGoogle + */ + public function asGoogle(): CreateOauthAppRequestGoogle + { + if (!($this->value instanceof CreateOauthAppRequestGoogle && $this->provider === 'google')) { + throw new Exception( + "Expected google; got " . $this->provider . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isMicrosoft(): bool + { + return $this->value instanceof CreateOauthAppRequestMicrosoft && $this->provider === 'microsoft'; + } + + /** + * @return CreateOauthAppRequestMicrosoft + */ + public function asMicrosoft(): CreateOauthAppRequestMicrosoft + { + if (!($this->value instanceof CreateOauthAppRequestMicrosoft && $this->provider === 'microsoft')) { + throw new Exception( + "Expected microsoft; got " . $this->provider . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isZoom(): bool + { + return $this->value instanceof CreateOauthAppRequestZoom && $this->provider === 'zoom'; + } + + /** + * @return CreateOauthAppRequestZoom + */ + public function asZoom(): CreateOauthAppRequestZoom + { + if (!($this->value instanceof CreateOauthAppRequestZoom && $this->provider === 'zoom')) { + throw new Exception( + "Expected zoom; got " . $this->provider . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } + + /** + * @return array + */ + public function jsonSerialize(): array + { + $result = []; + $result['provider'] = $this->provider; + + $base = parent::jsonSerialize(); + $result = array_merge($base, $result); + + switch ($this->provider) { + case 'google': + $value = $this->asGoogle()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'microsoft': + $value = $this->asMicrosoft()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'zoom': + $value = $this->asZoom()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case '_unknown': + default: + if (is_null($this->value)) { + break; + } + if ($this->value instanceof JsonSerializableType) { + $value = $this->value->jsonSerialize(); + $result = array_merge($value, $result); + } elseif (is_array($this->value)) { + $result = array_merge($this->value, $result); + } + } + + return $result; + } + + /** + * @param array $data + */ + public static function jsonDeserialize(array $data): static + { + $args = []; + if (!array_key_exists('provider', $data)) { + throw new Exception( + "JSON data is missing property 'provider'", + ); + } + $provider = $data['provider']; + if (!(is_string($provider))) { + throw new Exception( + "Expected property 'provider' in JSON data to be string, instead received " . get_debug_type($data['provider']), + ); + } + + $args['provider'] = $provider; + switch ($provider) { + case 'google': + $args['value'] = CreateOauthAppRequestGoogle::jsonDeserialize($data); + break; + case 'microsoft': + $args['value'] = CreateOauthAppRequestMicrosoft::jsonDeserialize($data); + break; + case 'zoom': + $args['value'] = CreateOauthAppRequestZoom::jsonDeserialize($data); + break; + case '_unknown': + default: + $args['provider'] = '_unknown'; + $args['value'] = $data; + } + + // @phpstan-ignore-next-line + return new static($args); + } +} diff --git a/sdks/php/src/Types/CreateOauthAppRequestGoogle.php b/sdks/php/src/Types/CreateOauthAppRequestGoogle.php new file mode 100644 index 000000000..65ca429c2 --- /dev/null +++ b/sdks/php/src/Types/CreateOauthAppRequestGoogle.php @@ -0,0 +1,77 @@ +clientId = $values['clientId']; + $this->clientSecret = $values['clientSecret']; + $this->redirectUri = $values['redirectUri'] ?? null; + if (array_key_exists('redirectUri', $values)) { + $this->_setField('redirectUri'); + } + $this->completionUrl = $values['completionUrl'] ?? null; + if (array_key_exists('completionUrl', $values)) { + $this->_setField('completionUrl'); + } + $this->secretExpiresAt = $values['secretExpiresAt'] ?? null; + if (array_key_exists('secretExpiresAt', $values)) { + $this->_setField('secretExpiresAt'); + } + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/sdks/php/src/Types/CreateOauthAppRequestMicrosoft.php b/sdks/php/src/Types/CreateOauthAppRequestMicrosoft.php new file mode 100644 index 000000000..08c13a864 --- /dev/null +++ b/sdks/php/src/Types/CreateOauthAppRequestMicrosoft.php @@ -0,0 +1,88 @@ +clientId = $values['clientId']; + $this->clientSecret = $values['clientSecret']; + $this->tenantId = $values['tenantId'] ?? null; + if (array_key_exists('tenantId', $values)) { + $this->_setField('tenantId'); + } + $this->redirectUri = $values['redirectUri'] ?? null; + if (array_key_exists('redirectUri', $values)) { + $this->_setField('redirectUri'); + } + $this->completionUrl = $values['completionUrl'] ?? null; + if (array_key_exists('completionUrl', $values)) { + $this->_setField('completionUrl'); + } + $this->secretExpiresAt = $values['secretExpiresAt'] ?? null; + if (array_key_exists('secretExpiresAt', $values)) { + $this->_setField('secretExpiresAt'); + } + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/sdks/php/src/Types/CreateOauthAppRequestZoom.php b/sdks/php/src/Types/CreateOauthAppRequestZoom.php new file mode 100644 index 000000000..cc0fdb2b4 --- /dev/null +++ b/sdks/php/src/Types/CreateOauthAppRequestZoom.php @@ -0,0 +1,88 @@ +clientId = $values['clientId']; + $this->clientSecret = $values['clientSecret']; + $this->webhookSecret = $values['webhookSecret'] ?? null; + if (array_key_exists('webhookSecret', $values)) { + $this->_setField('webhookSecret'); + } + $this->redirectUri = $values['redirectUri'] ?? null; + if (array_key_exists('redirectUri', $values)) { + $this->_setField('redirectUri'); + } + $this->completionUrl = $values['completionUrl'] ?? null; + if (array_key_exists('completionUrl', $values)) { + $this->_setField('completionUrl'); + } + $this->secretExpiresAt = $values['secretExpiresAt'] ?? null; + if (array_key_exists('secretExpiresAt', $values)) { + $this->_setField('secretExpiresAt'); + } + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/sdks/php/src/Types/DeletedSchedulingHolidayCalendar.php b/sdks/php/src/Types/DeletedSchedulingHolidayCalendar.php new file mode 100644 index 000000000..53ee0e459 --- /dev/null +++ b/sdks/php/src/Types/DeletedSchedulingHolidayCalendar.php @@ -0,0 +1,42 @@ +id = $values['id']; + $this->deleted = $values['deleted']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/sdks/php/src/Types/DeletedSchedulingOauthApp.php b/sdks/php/src/Types/DeletedSchedulingOauthApp.php new file mode 100644 index 000000000..73da6cade --- /dev/null +++ b/sdks/php/src/Types/DeletedSchedulingOauthApp.php @@ -0,0 +1,50 @@ + $object + */ + #[JsonProperty('object')] + public string $object; + + /** + * @var string $id + */ + #[JsonProperty('id')] + public string $id; + + /** + * @var bool $deleted + */ + #[JsonProperty('deleted')] + public bool $deleted; + + /** + * @param array{ + * object: value-of, + * id: string, + * deleted: bool, + * } $values + */ + public function __construct( + array $values, + ) { + $this->object = $values['object']; + $this->id = $values['id']; + $this->deleted = $values['deleted']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/sdks/php/src/Types/DeletedSchedulingOauthAppObject.php b/sdks/php/src/Types/DeletedSchedulingOauthAppObject.php new file mode 100644 index 000000000..119a07606 --- /dev/null +++ b/sdks/php/src/Types/DeletedSchedulingOauthAppObject.php @@ -0,0 +1,8 @@ + $object + */ + #[JsonProperty('object')] + public string $object; + + /** + * @var string $id + */ + #[JsonProperty('id')] + public string $id; + + /** + * @var bool $deleted + */ + #[JsonProperty('deleted')] + public bool $deleted; + + /** + * @param array{ + * object: value-of, + * id: string, + * deleted: bool, + * } $values + */ + public function __construct( + array $values, + ) { + $this->object = $values['object']; + $this->id = $values['id']; + $this->deleted = $values['deleted']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/sdks/php/src/Types/DeletedSchedulingOutOfOfficeObject.php b/sdks/php/src/Types/DeletedSchedulingOutOfOfficeObject.php new file mode 100644 index 000000000..74fa3232e --- /dev/null +++ b/sdks/php/src/Types/DeletedSchedulingOutOfOfficeObject.php @@ -0,0 +1,8 @@ +, * attendees: array, - * location: SchedulingLocation, * calendarUnverified: bool, * metadata: array, * createdAt: string, * updatedAt: string, + * location?: ( + * SchedulingLocationZero + * |SchedulingLocationNumber + * |SchedulingLocationAddress + * |SchedulingLocationThree + * |SchedulingLocationFour + * |SchedulingLocationFive + * )|null, * holdExpiresAt?: ?string, * approvalExpiresAt?: ?string, * series?: ?string, @@ -192,7 +207,10 @@ public function __construct( $this->end = $values['end']; $this->hosts = $values['hosts']; $this->attendees = $values['attendees']; - $this->location = $values['location']; + $this->location = $values['location'] ?? null; + if (array_key_exists('location', $values)) { + $this->_setField('location'); + } $this->holdExpiresAt = $values['holdExpiresAt'] ?? null; if (array_key_exists('holdExpiresAt', $values)) { $this->_setField('holdExpiresAt'); diff --git a/sdks/php/src/Types/SchedulingBookingCancelledBy.php b/sdks/php/src/Types/SchedulingBookingCancelledBy.php index e5e6459be..ec870c888 100644 --- a/sdks/php/src/Types/SchedulingBookingCancelledBy.php +++ b/sdks/php/src/Types/SchedulingBookingCancelledBy.php @@ -9,5 +9,6 @@ enum SchedulingBookingCancelledBy: string case HostSession = "host_session"; case BookerSession = "booker_session"; case ManageSession = "manage_session"; + case ManagerSession = "manager_session"; case System = "system"; } diff --git a/sdks/php/src/Types/SchedulingBookingEventActorKind.php b/sdks/php/src/Types/SchedulingBookingEventActorKind.php index 68b9f42b2..3accd082d 100644 --- a/sdks/php/src/Types/SchedulingBookingEventActorKind.php +++ b/sdks/php/src/Types/SchedulingBookingEventActorKind.php @@ -9,5 +9,6 @@ enum SchedulingBookingEventActorKind: string case HostSession = "host_session"; case BookerSession = "booker_session"; case ManageSession = "manage_session"; + case ManagerSession = "manager_session"; case System = "system"; } diff --git a/sdks/php/src/Types/SchedulingBookingWebhookData.php b/sdks/php/src/Types/SchedulingBookingWebhookData.php index 7e8e74b9f..9b7cf46a5 100644 --- a/sdks/php/src/Types/SchedulingBookingWebhookData.php +++ b/sdks/php/src/Types/SchedulingBookingWebhookData.php @@ -65,6 +65,18 @@ class SchedulingBookingWebhookData extends JsonSerializableType #[JsonProperty('previous_start')] public ?string $previousStart; + /** + * @var ?array $previousHostIds On `scheduling.booking.reassigned`: who had it before. + */ + #[JsonProperty('previous_host_ids'), ArrayType(['string'])] + public ?array $previousHostIds; + + /** + * @var ?string $reassignmentId On `scheduling.booking.reassigned`: the bulk reassignment it was part of. + */ + #[JsonProperty('reassignment_id')] + public ?string $reassignmentId; + /** * @var ?SchedulingBookingWebhookDataReminder $reminder `scheduling.booking.reminder`: which reminder this is. */ @@ -89,6 +101,8 @@ class SchedulingBookingWebhookData extends JsonSerializableType * occurredAt: string, * seriesId?: ?string, * previousStart?: ?string, + * previousHostIds?: ?array, + * reassignmentId?: ?string, * reminder?: ?SchedulingBookingWebhookDataReminder, * } $values */ @@ -110,6 +124,14 @@ public function __construct( if (array_key_exists('previousStart', $values)) { $this->_setField('previousStart'); } + $this->previousHostIds = $values['previousHostIds'] ?? null; + if (array_key_exists('previousHostIds', $values)) { + $this->_setField('previousHostIds'); + } + $this->reassignmentId = $values['reassignmentId'] ?? null; + if (array_key_exists('reassignmentId', $values)) { + $this->_setField('reassignmentId'); + } $this->reminder = $values['reminder'] ?? null; if (array_key_exists('reminder', $values)) { $this->_setField('reminder'); diff --git a/sdks/php/src/Types/SchedulingBookingWebhookEventType.php b/sdks/php/src/Types/SchedulingBookingWebhookEventType.php index 657a66e71..abc857891 100644 --- a/sdks/php/src/Types/SchedulingBookingWebhookEventType.php +++ b/sdks/php/src/Types/SchedulingBookingWebhookEventType.php @@ -14,6 +14,7 @@ enum SchedulingBookingWebhookEventType: string case SchedulingBookingExternalConflict = "scheduling.booking.external_conflict"; case SchedulingBookingCalendarWriteFailed = "scheduling.booking.calendar_write_failed"; case SchedulingBookingLocationReady = "scheduling.booking.location_ready"; + case SchedulingBookingReassigned = "scheduling.booking.reassigned"; case SchedulingBookingStarted = "scheduling.booking.started"; case SchedulingBookingEnded = "scheduling.booking.ended"; case SchedulingBookingReminder = "scheduling.booking.reminder"; diff --git a/sdks/php/src/Types/SchedulingCalendarConnection.php b/sdks/php/src/Types/SchedulingCalendarConnection.php index 3251a5371..970986d6c 100644 --- a/sdks/php/src/Types/SchedulingCalendarConnection.php +++ b/sdks/php/src/Types/SchedulingCalendarConnection.php @@ -44,6 +44,12 @@ class SchedulingCalendarConnection extends JsonSerializableType #[JsonProperty('status')] public string $status; + /** + * @var ?string $oauthApp Your own OAuth app this connection's access came through. `null`: coss.com's, or no consent was involved. + */ + #[JsonProperty('oauth_app')] + public ?string $oauthApp; + /** * @var ?string $delegation The calendar delegation that manages this connection. It can't be disconnected or reconnected by itself. */ @@ -72,6 +78,7 @@ class SchedulingCalendarConnection extends JsonSerializableType * status: value-of, * calendars: array, * createdAt: string, + * oauthApp?: ?string, * delegation?: ?string, * } $values */ @@ -84,6 +91,10 @@ public function __construct( $this->provider = $values['provider']; $this->account = $values['account']; $this->status = $values['status']; + $this->oauthApp = $values['oauthApp'] ?? null; + if (array_key_exists('oauthApp', $values)) { + $this->_setField('oauthApp'); + } $this->delegation = $values['delegation'] ?? null; if (array_key_exists('delegation', $values)) { $this->_setField('delegation'); diff --git a/sdks/php/src/Types/SchedulingEventType.php b/sdks/php/src/Types/SchedulingEventType.php index 36916ff21..d6b1953a3 100644 --- a/sdks/php/src/Types/SchedulingEventType.php +++ b/sdks/php/src/Types/SchedulingEventType.php @@ -120,6 +120,12 @@ class SchedulingEventType extends JsonSerializableType #[JsonProperty('requires_approval')] public bool $requiresApproval; + /** + * @var bool $reassignmentEnabled Whether bookings of this event type can go to another host. + */ + #[JsonProperty('reassignment_enabled')] + public bool $reassignmentEnabled; + /** * @var float $approvalTtlMinutes How long a booking can wait for approval before it's declined, in minutes. */ @@ -169,9 +175,16 @@ class SchedulingEventType extends JsonSerializableType public array $questions; /** - * @var array $locations Where bookings can meet. A browser only chooses among these. + * @var array<( + * SchedulingLocationZero + * |SchedulingLocationNumber + * |SchedulingLocationAddress + * |SchedulingLocationThree + * |SchedulingLocationFour + * |SchedulingLocationFive + * )|null> $locations Where bookings can meet. A browser only chooses among these. */ - #[JsonProperty('locations'), ArrayType([SchedulingLocation::class])] + #[JsonProperty('locations'), ArrayType([new Union(new Union(SchedulingLocationZero::class, SchedulingLocationNumber::class, SchedulingLocationAddress::class, SchedulingLocationThree::class, SchedulingLocationFour::class, SchedulingLocationFive::class), 'null')])] public array $locations; /** @@ -234,6 +247,7 @@ class SchedulingEventType extends JsonSerializableType * minNoticeMinutes: float, * limits: array, * requiresApproval: bool, + * reassignmentEnabled: bool, * approvalTtlMinutes: float, * holdTtlSeconds: float, * cancelNoticeMinutes: float, @@ -241,7 +255,14 @@ class SchedulingEventType extends JsonSerializableType * maxGuests: float, * hostCalendarDetails: value-of, * questions: array, - * locations: array, + * locations: array<( + * SchedulingLocationZero + * |SchedulingLocationNumber + * |SchedulingLocationAddress + * |SchedulingLocationThree + * |SchedulingLocationFour + * |SchedulingLocationFive + * )|null>, * hosts: array, * metadata: array, * createdAt: string, @@ -299,6 +320,7 @@ public function __construct( $this->_setField('capacity'); } $this->requiresApproval = $values['requiresApproval']; + $this->reassignmentEnabled = $values['reassignmentEnabled']; $this->approvalTtlMinutes = $values['approvalTtlMinutes']; $this->holdTtlSeconds = $values['holdTtlSeconds']; $this->cancelNoticeMinutes = $values['cancelNoticeMinutes']; diff --git a/sdks/php/src/Types/SchedulingHolidayCalendar.php b/sdks/php/src/Types/SchedulingHolidayCalendar.php new file mode 100644 index 000000000..b47009c53 --- /dev/null +++ b/sdks/php/src/Types/SchedulingHolidayCalendar.php @@ -0,0 +1,164 @@ + $object + */ + #[JsonProperty('object')] + public string $object; + + /** + * @var string $id + */ + #[JsonProperty('id')] + public string $id; + + /** + * @var string $name + */ + #[JsonProperty('name')] + public string $name; + + /** + * @var value-of $source + */ + #[JsonProperty('source')] + public string $source; + + /** + * @var ?string $country + */ + #[JsonProperty('country')] + public ?string $country; + + /** + * @var ?array $hosts + */ + #[JsonProperty('hosts'), ArrayType(['string'])] + public ?array $hosts; + + /** + * @var ?array + * )|null> $hostFilter + */ + #[JsonProperty('host_filter'), ArrayType(['string' => new Union(new Union('string', ['string']), 'null')])] + public ?array $hostFilter; + + /** + * @var ?array $regions + */ + #[JsonProperty('regions'), ArrayType(['string'])] + public ?array $regions; + + /** + * @var array $delegates + */ + #[JsonProperty('delegates'), ArrayType(['string'])] + public array $delegates; + + /** + * @var value-of $existingBookings + */ + #[JsonProperty('existing_bookings')] + public string $existingBookings; + + /** + * @var ?string $lastReadAt + */ + #[JsonProperty('last_read_at')] + public ?string $lastReadAt; + + /** + * @var ?string $lastError Why its feed couldn't be read. + */ + #[JsonProperty('last_error')] + public ?string $lastError; + + /** + * @var string $createdAt + */ + #[JsonProperty('created_at')] + public string $createdAt; + + /** + * @var string $updatedAt + */ + #[JsonProperty('updated_at')] + public string $updatedAt; + + /** + * @param array{ + * object: value-of, + * id: string, + * name: string, + * source: value-of, + * delegates: array, + * existingBookings: value-of, + * createdAt: string, + * updatedAt: string, + * country?: ?string, + * hosts?: ?array, + * hostFilter?: ?array + * )|null>, + * regions?: ?array, + * lastReadAt?: ?string, + * lastError?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->object = $values['object']; + $this->id = $values['id']; + $this->name = $values['name']; + $this->source = $values['source']; + $this->country = $values['country'] ?? null; + if (array_key_exists('country', $values)) { + $this->_setField('country'); + } + $this->hosts = $values['hosts'] ?? null; + if (array_key_exists('hosts', $values)) { + $this->_setField('hosts'); + } + $this->hostFilter = $values['hostFilter'] ?? null; + if (array_key_exists('hostFilter', $values)) { + $this->_setField('hostFilter'); + } + $this->regions = $values['regions'] ?? null; + if (array_key_exists('regions', $values)) { + $this->_setField('regions'); + } + $this->delegates = $values['delegates']; + $this->existingBookings = $values['existingBookings']; + $this->lastReadAt = $values['lastReadAt'] ?? null; + if (array_key_exists('lastReadAt', $values)) { + $this->_setField('lastReadAt'); + } + $this->lastError = $values['lastError'] ?? null; + if (array_key_exists('lastError', $values)) { + $this->_setField('lastError'); + } + $this->createdAt = $values['createdAt']; + $this->updatedAt = $values['updatedAt']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/sdks/php/src/Types/SchedulingHolidayCalendarExistingBookings.php b/sdks/php/src/Types/SchedulingHolidayCalendarExistingBookings.php new file mode 100644 index 000000000..9be20d9b9 --- /dev/null +++ b/sdks/php/src/Types/SchedulingHolidayCalendarExistingBookings.php @@ -0,0 +1,9 @@ + $object + */ + #[JsonProperty('object')] + public string $object; + + /** + * @var array $data + */ + #[JsonProperty('data'), ArrayType([SchedulingHolidayCalendar::class])] + public array $data; + + /** + * @var bool $hasMore + */ + #[JsonProperty('has_more')] + public bool $hasMore; + + /** + * @param array{ + * object: value-of, + * data: array, + * hasMore: bool, + * } $values + */ + public function __construct( + array $values, + ) { + $this->object = $values['object']; + $this->data = $values['data']; + $this->hasMore = $values['hasMore']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/sdks/php/src/Types/SchedulingHolidayCalendarListObject.php b/sdks/php/src/Types/SchedulingHolidayCalendarListObject.php new file mode 100644 index 000000000..fd18ef376 --- /dev/null +++ b/sdks/php/src/Types/SchedulingHolidayCalendarListObject.php @@ -0,0 +1,8 @@ + $object + */ + #[JsonProperty('object')] + public string $object; + + /** + * @var array $data + */ + #[JsonProperty('data'), ArrayType([SchedulingHolidayListDataItem::class])] + public array $data; + + /** + * @var bool $hasMore + */ + #[JsonProperty('has_more')] + public bool $hasMore; + + /** + * @param array{ + * object: value-of, + * data: array, + * hasMore: bool, + * } $values + */ + public function __construct( + array $values, + ) { + $this->object = $values['object']; + $this->data = $values['data']; + $this->hasMore = $values['hasMore']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/sdks/php/src/Types/SchedulingHolidayListDataItem.php b/sdks/php/src/Types/SchedulingHolidayListDataItem.php new file mode 100644 index 000000000..e5b98729c --- /dev/null +++ b/sdks/php/src/Types/SchedulingHolidayListDataItem.php @@ -0,0 +1,53 @@ +date = $values['date']; + $this->name = $values['name']; + $this->region = $values['region'] ?? null; + if (array_key_exists('region', $values)) { + $this->_setField('region'); + } + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/sdks/php/src/Types/SchedulingHolidayListObject.php b/sdks/php/src/Types/SchedulingHolidayListObject.php new file mode 100644 index 000000000..88908f10e --- /dev/null +++ b/sdks/php/src/Types/SchedulingHolidayListObject.php @@ -0,0 +1,8 @@ +type = $values['type']; - $this->value = $values['value']; - } - - /** - * @param SchedulingLocationLink $link - * @return SchedulingLocation - */ - public static function link(SchedulingLocationLink $link): SchedulingLocation - { - return new SchedulingLocation([ - 'type' => 'link', - 'value' => $link, - ]); - } - - /** - * @param SchedulingLocationPhone $phone - * @return SchedulingLocation - */ - public static function phone(SchedulingLocationPhone $phone): SchedulingLocation - { - return new SchedulingLocation([ - 'type' => 'phone', - 'value' => $phone, - ]); - } - - /** - * @param SchedulingLocationInPerson $inPerson - * @return SchedulingLocation - */ - public static function inPerson(SchedulingLocationInPerson $inPerson): SchedulingLocation - { - return new SchedulingLocation([ - 'type' => 'in_person', - 'value' => $inPerson, - ]); - } - - /** - * @param SchedulingLocationGoogleMeet $googleMeet - * @return SchedulingLocation - */ - public static function googleMeet(SchedulingLocationGoogleMeet $googleMeet): SchedulingLocation - { - return new SchedulingLocation([ - 'type' => 'google_meet', - 'value' => $googleMeet, - ]); - } - - /** - * @param SchedulingLocationMicrosoftTeams $microsoftTeams - * @return SchedulingLocation - */ - public static function microsoftTeams(SchedulingLocationMicrosoftTeams $microsoftTeams): SchedulingLocation - { - return new SchedulingLocation([ - 'type' => 'microsoft_teams', - 'value' => $microsoftTeams, - ]); - } - - /** - * @param SchedulingLocationZoom $zoom - * @return SchedulingLocation - */ - public static function zoom(SchedulingLocationZoom $zoom): SchedulingLocation - { - return new SchedulingLocation([ - 'type' => 'zoom', - 'value' => $zoom, - ]); - } - - /** - * @return bool - */ - public function isLink(): bool - { - return $this->value instanceof SchedulingLocationLink && $this->type === 'link'; - } - - /** - * @return SchedulingLocationLink - */ - public function asLink(): SchedulingLocationLink - { - if (!($this->value instanceof SchedulingLocationLink && $this->type === 'link')) { - throw new Exception( - "Expected link; got " . $this->type . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isPhone(): bool - { - return $this->value instanceof SchedulingLocationPhone && $this->type === 'phone'; - } - - /** - * @return SchedulingLocationPhone - */ - public function asPhone(): SchedulingLocationPhone - { - if (!($this->value instanceof SchedulingLocationPhone && $this->type === 'phone')) { - throw new Exception( - "Expected phone; got " . $this->type . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isInPerson(): bool - { - return $this->value instanceof SchedulingLocationInPerson && $this->type === 'in_person'; - } - - /** - * @return SchedulingLocationInPerson - */ - public function asInPerson(): SchedulingLocationInPerson - { - if (!($this->value instanceof SchedulingLocationInPerson && $this->type === 'in_person')) { - throw new Exception( - "Expected in_person; got " . $this->type . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isGoogleMeet(): bool - { - return $this->value instanceof SchedulingLocationGoogleMeet && $this->type === 'google_meet'; - } - - /** - * @return SchedulingLocationGoogleMeet - */ - public function asGoogleMeet(): SchedulingLocationGoogleMeet - { - if (!($this->value instanceof SchedulingLocationGoogleMeet && $this->type === 'google_meet')) { - throw new Exception( - "Expected google_meet; got " . $this->type . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isMicrosoftTeams(): bool - { - return $this->value instanceof SchedulingLocationMicrosoftTeams && $this->type === 'microsoft_teams'; - } - - /** - * @return SchedulingLocationMicrosoftTeams - */ - public function asMicrosoftTeams(): SchedulingLocationMicrosoftTeams - { - if (!($this->value instanceof SchedulingLocationMicrosoftTeams && $this->type === 'microsoft_teams')) { - throw new Exception( - "Expected microsoft_teams; got " . $this->type . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isZoom(): bool - { - return $this->value instanceof SchedulingLocationZoom && $this->type === 'zoom'; - } - - /** - * @return SchedulingLocationZoom - */ - public function asZoom(): SchedulingLocationZoom - { - if (!($this->value instanceof SchedulingLocationZoom && $this->type === 'zoom')) { - throw new Exception( - "Expected zoom; got " . $this->type . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } - - /** - * @return array - */ - public function jsonSerialize(): array - { - $result = []; - $result['type'] = $this->type; - - $base = parent::jsonSerialize(); - $result = array_merge($base, $result); - - switch ($this->type) { - case 'link': - $value = $this->asLink()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'phone': - $value = $this->asPhone()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'in_person': - $value = $this->asInPerson()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'google_meet': - $value = $this->asGoogleMeet()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'microsoft_teams': - $value = $this->asMicrosoftTeams()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'zoom': - $value = $this->asZoom()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case '_unknown': - default: - if (is_null($this->value)) { - break; - } - if ($this->value instanceof JsonSerializableType) { - $value = $this->value->jsonSerialize(); - $result = array_merge($value, $result); - } elseif (is_array($this->value)) { - $result = array_merge($this->value, $result); - } - } - - return $result; - } - - /** - * @param array $data - */ - public static function jsonDeserialize(array $data): static - { - $args = []; - if (!array_key_exists('type', $data)) { - throw new Exception( - "JSON data is missing property 'type'", - ); - } - $type = $data['type']; - if (!(is_string($type))) { - throw new Exception( - "Expected property 'type' in JSON data to be string, instead received " . get_debug_type($data['type']), - ); - } - - $args['type'] = $type; - switch ($type) { - case 'link': - $args['value'] = SchedulingLocationLink::jsonDeserialize($data); - break; - case 'phone': - $args['value'] = SchedulingLocationPhone::jsonDeserialize($data); - break; - case 'in_person': - $args['value'] = SchedulingLocationInPerson::jsonDeserialize($data); - break; - case 'google_meet': - $args['value'] = SchedulingLocationGoogleMeet::jsonDeserialize($data); - break; - case 'microsoft_teams': - $args['value'] = SchedulingLocationMicrosoftTeams::jsonDeserialize($data); - break; - case 'zoom': - $args['value'] = SchedulingLocationZoom::jsonDeserialize($data); - break; - case '_unknown': - default: - $args['type'] = '_unknown'; - $args['value'] = $data; - } - - // @phpstan-ignore-next-line - return new static($args); - } -} diff --git a/sdks/php/src/Types/SchedulingLocationInPerson.php b/sdks/php/src/Types/SchedulingLocationAddress.php similarity index 69% rename from sdks/php/src/Types/SchedulingLocationInPerson.php rename to sdks/php/src/Types/SchedulingLocationAddress.php index a9cccc79d..ea6d6f615 100644 --- a/sdks/php/src/Types/SchedulingLocationInPerson.php +++ b/sdks/php/src/Types/SchedulingLocationAddress.php @@ -5,8 +5,14 @@ use Coss\Core\Json\JsonSerializableType; use Coss\Core\Json\JsonProperty; -class SchedulingLocationInPerson extends JsonSerializableType +class SchedulingLocationAddress extends JsonSerializableType { + /** + * @var value-of $type + */ + #[JsonProperty('type')] + public string $type; + /** * @var ?string $address The address to meet at. `null` on an event type means the booking supplies its own. */ @@ -15,12 +21,14 @@ class SchedulingLocationInPerson extends JsonSerializableType /** * @param array{ + * type: value-of, * address?: ?string, * } $values */ public function __construct( - array $values = [], + array $values, ) { + $this->type = $values['type']; $this->address = $values['address'] ?? null; if (array_key_exists('address', $values)) { $this->_setField('address'); diff --git a/sdks/php/src/Types/SchedulingLocationAddressType.php b/sdks/php/src/Types/SchedulingLocationAddressType.php new file mode 100644 index 000000000..151ef42cd --- /dev/null +++ b/sdks/php/src/Types/SchedulingLocationAddressType.php @@ -0,0 +1,8 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + /** * @var ?string $url The meeting's link, once it's created on the host's Zoom account. */ @@ -15,12 +21,14 @@ class SchedulingLocationZoom extends JsonSerializableType /** * @param array{ + * type: value-of, * url?: ?string, * } $values */ public function __construct( - array $values = [], + array $values, ) { + $this->type = $values['type']; $this->url = $values['url'] ?? null; if (array_key_exists('url', $values)) { $this->_setField('url'); diff --git a/sdks/php/src/Types/SchedulingLocationFiveType.php b/sdks/php/src/Types/SchedulingLocationFiveType.php new file mode 100644 index 000000000..e2eeb2b1c --- /dev/null +++ b/sdks/php/src/Types/SchedulingLocationFiveType.php @@ -0,0 +1,8 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @param array{ + * type: value-of, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/sdks/php/src/Types/SchedulingLocationFourType.php b/sdks/php/src/Types/SchedulingLocationFourType.php new file mode 100644 index 000000000..5260c5c0e --- /dev/null +++ b/sdks/php/src/Types/SchedulingLocationFourType.php @@ -0,0 +1,8 @@ +toJson(); - } -} diff --git a/sdks/php/src/Types/SchedulingLocationMicrosoftTeams.php b/sdks/php/src/Types/SchedulingLocationMicrosoftTeams.php deleted file mode 100644 index a81f99659..000000000 --- a/sdks/php/src/Types/SchedulingLocationMicrosoftTeams.php +++ /dev/null @@ -1,26 +0,0 @@ -toJson(); - } -} diff --git a/sdks/php/src/Types/SchedulingLocationPhone.php b/sdks/php/src/Types/SchedulingLocationNumber.php similarity index 69% rename from sdks/php/src/Types/SchedulingLocationPhone.php rename to sdks/php/src/Types/SchedulingLocationNumber.php index 6c861c229..b6cb89218 100644 --- a/sdks/php/src/Types/SchedulingLocationPhone.php +++ b/sdks/php/src/Types/SchedulingLocationNumber.php @@ -5,8 +5,14 @@ use Coss\Core\Json\JsonSerializableType; use Coss\Core\Json\JsonProperty; -class SchedulingLocationPhone extends JsonSerializableType +class SchedulingLocationNumber extends JsonSerializableType { + /** + * @var value-of $type + */ + #[JsonProperty('type')] + public string $type; + /** * @var ?string $number The phone number to call. `null` on an event type means the booking supplies its own. */ @@ -15,12 +21,14 @@ class SchedulingLocationPhone extends JsonSerializableType /** * @param array{ + * type: value-of, * number?: ?string, * } $values */ public function __construct( - array $values = [], + array $values, ) { + $this->type = $values['type']; $this->number = $values['number'] ?? null; if (array_key_exists('number', $values)) { $this->_setField('number'); diff --git a/sdks/php/src/Types/SchedulingLocationNumberType.php b/sdks/php/src/Types/SchedulingLocationNumberType.php new file mode 100644 index 000000000..b0bc9ed67 --- /dev/null +++ b/sdks/php/src/Types/SchedulingLocationNumberType.php @@ -0,0 +1,8 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @param array{ + * type: value-of, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/sdks/php/src/Types/SchedulingLocationThreeType.php b/sdks/php/src/Types/SchedulingLocationThreeType.php new file mode 100644 index 000000000..40a90ee12 --- /dev/null +++ b/sdks/php/src/Types/SchedulingLocationThreeType.php @@ -0,0 +1,8 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + /** * @var ?string $url The meeting link. `null` on an event type means the booking supplies its own. */ @@ -15,12 +21,14 @@ class SchedulingLocationLink extends JsonSerializableType /** * @param array{ + * type: value-of, * url?: ?string, * } $values */ public function __construct( - array $values = [], + array $values, ) { + $this->type = $values['type']; $this->url = $values['url'] ?? null; if (array_key_exists('url', $values)) { $this->_setField('url'); diff --git a/sdks/php/src/Types/SchedulingLocationZeroType.php b/sdks/php/src/Types/SchedulingLocationZeroType.php new file mode 100644 index 000000000..680a959ae --- /dev/null +++ b/sdks/php/src/Types/SchedulingLocationZeroType.php @@ -0,0 +1,8 @@ + $object + */ + #[JsonProperty('object')] + public string $object; + + /** + * @var string $id + */ + #[JsonProperty('id')] + public string $id; + + /** + * @var value-of $provider + */ + #[JsonProperty('provider')] + public string $provider; + + /** + * @var string $clientId + */ + #[JsonProperty('client_id')] + public string $clientId; + + /** + * @var ?string $tenantId + */ + #[JsonProperty('tenant_id')] + public ?string $tenantId; + + /** + * @var ?string $redirectUri + */ + #[JsonProperty('redirect_uri')] + public ?string $redirectUri; + + /** + * @var string $cossCallbackUrl Register this with the provider if `redirect_uri` isn't set. If it is, that page forwards `code` and `state` here. + */ + #[JsonProperty('coss_callback_url')] + public string $cossCallbackUrl; + + /** + * @var ?string $completionUrl + */ + #[JsonProperty('completion_url')] + public ?string $completionUrl; + + /** + * @var ?string $zoomEventUrl Zoom only: the Event notification endpoint URL for your app's deauthorization events. + */ + #[JsonProperty('zoom_event_url')] + public ?string $zoomEventUrl; + + /** + * @var array $scopes What to enable on your app at the provider. + */ + #[JsonProperty('scopes'), ArrayType(['string'])] + public array $scopes; + + /** + * @var value-of $status `failing`: the provider refused the app's credentials. New consents are refused, and calendars connected through it can't be read until they work again. + */ + #[JsonProperty('status')] + public string $status; + + /** + * @var ?string $lastErrorCode + */ + #[JsonProperty('last_error_code')] + public ?string $lastErrorCode; + + /** + * @var ?string $lastErrorAt + */ + #[JsonProperty('last_error_at')] + public ?string $lastErrorAt; + + /** + * @var ?string $secretExpiresAt + */ + #[JsonProperty('secret_expires_at')] + public ?string $secretExpiresAt; + + /** + * @var ?string $verifiedAt When a consent first completed through this app, which proves its secret. + */ + #[JsonProperty('verified_at')] + public ?string $verifiedAt; + + /** + * @var int $connections Calendar connections using this app. It can't be deleted while there are any. + */ + #[JsonProperty('connections')] + public int $connections; + + /** + * @var string $createdAt + */ + #[JsonProperty('created_at')] + public string $createdAt; + + /** + * @var string $updatedAt + */ + #[JsonProperty('updated_at')] + public string $updatedAt; + + /** + * @param array{ + * object: value-of, + * id: string, + * provider: value-of, + * clientId: string, + * cossCallbackUrl: string, + * scopes: array, + * status: value-of, + * connections: int, + * createdAt: string, + * updatedAt: string, + * tenantId?: ?string, + * redirectUri?: ?string, + * completionUrl?: ?string, + * zoomEventUrl?: ?string, + * lastErrorCode?: ?string, + * lastErrorAt?: ?string, + * secretExpiresAt?: ?string, + * verifiedAt?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->object = $values['object']; + $this->id = $values['id']; + $this->provider = $values['provider']; + $this->clientId = $values['clientId']; + $this->tenantId = $values['tenantId'] ?? null; + if (array_key_exists('tenantId', $values)) { + $this->_setField('tenantId'); + } + $this->redirectUri = $values['redirectUri'] ?? null; + if (array_key_exists('redirectUri', $values)) { + $this->_setField('redirectUri'); + } + $this->cossCallbackUrl = $values['cossCallbackUrl']; + $this->completionUrl = $values['completionUrl'] ?? null; + if (array_key_exists('completionUrl', $values)) { + $this->_setField('completionUrl'); + } + $this->zoomEventUrl = $values['zoomEventUrl'] ?? null; + if (array_key_exists('zoomEventUrl', $values)) { + $this->_setField('zoomEventUrl'); + } + $this->scopes = $values['scopes']; + $this->status = $values['status']; + $this->lastErrorCode = $values['lastErrorCode'] ?? null; + if (array_key_exists('lastErrorCode', $values)) { + $this->_setField('lastErrorCode'); + } + $this->lastErrorAt = $values['lastErrorAt'] ?? null; + if (array_key_exists('lastErrorAt', $values)) { + $this->_setField('lastErrorAt'); + } + $this->secretExpiresAt = $values['secretExpiresAt'] ?? null; + if (array_key_exists('secretExpiresAt', $values)) { + $this->_setField('secretExpiresAt'); + } + $this->verifiedAt = $values['verifiedAt'] ?? null; + if (array_key_exists('verifiedAt', $values)) { + $this->_setField('verifiedAt'); + } + $this->connections = $values['connections']; + $this->createdAt = $values['createdAt']; + $this->updatedAt = $values['updatedAt']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/sdks/php/src/Types/SchedulingOauthAppList.php b/sdks/php/src/Types/SchedulingOauthAppList.php new file mode 100644 index 000000000..a987113dd --- /dev/null +++ b/sdks/php/src/Types/SchedulingOauthAppList.php @@ -0,0 +1,51 @@ + $object + */ + #[JsonProperty('object')] + public string $object; + + /** + * @var array $data + */ + #[JsonProperty('data'), ArrayType([SchedulingOauthApp::class])] + public array $data; + + /** + * @var bool $hasMore + */ + #[JsonProperty('has_more')] + public bool $hasMore; + + /** + * @param array{ + * object: value-of, + * data: array, + * hasMore: bool, + * } $values + */ + public function __construct( + array $values, + ) { + $this->object = $values['object']; + $this->data = $values['data']; + $this->hasMore = $values['hasMore']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/sdks/php/src/Types/SchedulingOauthAppListObject.php b/sdks/php/src/Types/SchedulingOauthAppListObject.php new file mode 100644 index 000000000..5004c0dbf --- /dev/null +++ b/sdks/php/src/Types/SchedulingOauthAppListObject.php @@ -0,0 +1,8 @@ + $object + */ + #[JsonProperty('object')] + public string $object; + + /** + * @var string $apiVersion The API version this payload is rendered in: the endpoint's. + */ + #[JsonProperty('api_version')] + public string $apiVersion; + + /** + * @var DateTime $createdAt When the event was created. + */ + #[JsonProperty('created_at'), Date(Date::TYPE_DATETIME)] + public DateTime $createdAt; + + /** + * @var value-of $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var SchedulingOauthAppWebhookEventData $data + */ + #[JsonProperty('data')] + public SchedulingOauthAppWebhookEventData $data; + + /** + * @param array{ + * id: string, + * object: value-of, + * apiVersion: string, + * createdAt: DateTime, + * type: value-of, + * data: SchedulingOauthAppWebhookEventData, + * } $values + */ + public function __construct( + array $values, + ) { + $this->id = $values['id']; + $this->object = $values['object']; + $this->apiVersion = $values['apiVersion']; + $this->createdAt = $values['createdAt']; + $this->type = $values['type']; + $this->data = $values['data']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/sdks/php/src/Types/SchedulingOauthAppWebhookEventData.php b/sdks/php/src/Types/SchedulingOauthAppWebhookEventData.php new file mode 100644 index 000000000..090138e79 --- /dev/null +++ b/sdks/php/src/Types/SchedulingOauthAppWebhookEventData.php @@ -0,0 +1,61 @@ +oauthAppId = $values['oauthAppId']; + $this->provider = $values['provider']; + $this->code = $values['code'] ?? null; + if (array_key_exists('code', $values)) { + $this->_setField('code'); + } + $this->occurredAt = $values['occurredAt']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/sdks/php/src/Types/SchedulingOauthAppWebhookEventObject.php b/sdks/php/src/Types/SchedulingOauthAppWebhookEventObject.php new file mode 100644 index 000000000..e519c8a6b --- /dev/null +++ b/sdks/php/src/Types/SchedulingOauthAppWebhookEventObject.php @@ -0,0 +1,8 @@ + $object + */ + #[JsonProperty('object')] + public string $object; + + /** + * @var string $id + */ + #[JsonProperty('id')] + public string $id; + + /** + * @var string $host + */ + #[JsonProperty('host')] + public string $host; + + /** + * @var string $start + */ + #[JsonProperty('start')] + public string $start; + + /** + * @var string $end + */ + #[JsonProperty('end')] + public string $end; + + /** + * @var ?SchedulingOutOfOfficeAllDay $allDay How it was given, when it was as whole dates. + */ + #[JsonProperty('all_day')] + public ?SchedulingOutOfOfficeAllDay $allDay; + + /** + * @var string $reason + */ + #[JsonProperty('reason')] + public string $reason; + + /** + * @var ?string $notes + */ + #[JsonProperty('notes')] + public ?string $notes; + + /** + * @var ?string $publicMessage + */ + #[JsonProperty('public_message')] + public ?string $publicMessage; + + /** + * @var bool $showOnCalendar + */ + #[JsonProperty('show_on_calendar')] + public bool $showOnCalendar; + + /** + * @var array $delegates Who can be booked in their place. + */ + #[JsonProperty('delegates'), ArrayType(['string'])] + public array $delegates; + + /** + * @var value-of $existingBookings + */ + #[JsonProperty('existing_bookings')] + public string $existingBookings; + + /** + * @var ?string $externalId + */ + #[JsonProperty('external_id')] + public ?string $externalId; + + /** + * @var ?string $group Shared by the entries one request made for several hosts. + */ + #[JsonProperty('group')] + public ?string $group; + + /** + * @var value-of $source + */ + #[JsonProperty('source')] + public string $source; + + /** + * @var string $createdAt + */ + #[JsonProperty('created_at')] + public string $createdAt; + + /** + * @var string $updatedAt + */ + #[JsonProperty('updated_at')] + public string $updatedAt; + + /** + * @param array{ + * object: value-of, + * id: string, + * host: string, + * start: string, + * end: string, + * reason: string, + * showOnCalendar: bool, + * delegates: array, + * existingBookings: value-of, + * source: value-of, + * createdAt: string, + * updatedAt: string, + * allDay?: ?SchedulingOutOfOfficeAllDay, + * notes?: ?string, + * publicMessage?: ?string, + * externalId?: ?string, + * group?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->object = $values['object']; + $this->id = $values['id']; + $this->host = $values['host']; + $this->start = $values['start']; + $this->end = $values['end']; + $this->allDay = $values['allDay'] ?? null; + if (array_key_exists('allDay', $values)) { + $this->_setField('allDay'); + } + $this->reason = $values['reason']; + $this->notes = $values['notes'] ?? null; + if (array_key_exists('notes', $values)) { + $this->_setField('notes'); + } + $this->publicMessage = $values['publicMessage'] ?? null; + if (array_key_exists('publicMessage', $values)) { + $this->_setField('publicMessage'); + } + $this->showOnCalendar = $values['showOnCalendar']; + $this->delegates = $values['delegates']; + $this->existingBookings = $values['existingBookings']; + $this->externalId = $values['externalId'] ?? null; + if (array_key_exists('externalId', $values)) { + $this->_setField('externalId'); + } + $this->group = $values['group'] ?? null; + if (array_key_exists('group', $values)) { + $this->_setField('group'); + } + $this->source = $values['source']; + $this->createdAt = $values['createdAt']; + $this->updatedAt = $values['updatedAt']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/sdks/php/src/Types/SchedulingOutOfOfficeAllDay.php b/sdks/php/src/Types/SchedulingOutOfOfficeAllDay.php new file mode 100644 index 000000000..12e9b7cce --- /dev/null +++ b/sdks/php/src/Types/SchedulingOutOfOfficeAllDay.php @@ -0,0 +1,53 @@ +startDate = $values['startDate']; + $this->endDate = $values['endDate']; + $this->timeZone = $values['timeZone']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/sdks/php/src/Types/SchedulingOutOfOfficeConflict.php b/sdks/php/src/Types/SchedulingOutOfOfficeConflict.php new file mode 100644 index 000000000..491e66728 --- /dev/null +++ b/sdks/php/src/Types/SchedulingOutOfOfficeConflict.php @@ -0,0 +1,104 @@ + $object + */ + #[JsonProperty('object')] + public string $object; + + /** + * @var string $booking + */ + #[JsonProperty('booking')] + public string $booking; + + /** + * @var string $eventType + */ + #[JsonProperty('event_type')] + public string $eventType; + + /** + * @var string $title + */ + #[JsonProperty('title')] + public string $title; + + /** + * @var value-of $status + */ + #[JsonProperty('status')] + public string $status; + + /** + * @var string $start + */ + #[JsonProperty('start')] + public string $start; + + /** + * @var string $end + */ + #[JsonProperty('end')] + public string $end; + + /** + * @var ?string $series + */ + #[JsonProperty('series')] + public ?string $series; + + /** + * @var ?string $groupSession + */ + #[JsonProperty('group_session')] + public ?string $groupSession; + + /** + * @param array{ + * object: value-of, + * booking: string, + * eventType: string, + * title: string, + * status: value-of, + * start: string, + * end: string, + * series?: ?string, + * groupSession?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->object = $values['object']; + $this->booking = $values['booking']; + $this->eventType = $values['eventType']; + $this->title = $values['title']; + $this->status = $values['status']; + $this->start = $values['start']; + $this->end = $values['end']; + $this->series = $values['series'] ?? null; + if (array_key_exists('series', $values)) { + $this->_setField('series'); + } + $this->groupSession = $values['groupSession'] ?? null; + if (array_key_exists('groupSession', $values)) { + $this->_setField('groupSession'); + } + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/sdks/php/src/Types/SchedulingOutOfOfficeConflictList.php b/sdks/php/src/Types/SchedulingOutOfOfficeConflictList.php new file mode 100644 index 000000000..a2bd1cbf8 --- /dev/null +++ b/sdks/php/src/Types/SchedulingOutOfOfficeConflictList.php @@ -0,0 +1,51 @@ + $object + */ + #[JsonProperty('object')] + public string $object; + + /** + * @var array $data + */ + #[JsonProperty('data'), ArrayType([SchedulingOutOfOfficeConflict::class])] + public array $data; + + /** + * @var bool $hasMore + */ + #[JsonProperty('has_more')] + public bool $hasMore; + + /** + * @param array{ + * object: value-of, + * data: array, + * hasMore: bool, + * } $values + */ + public function __construct( + array $values, + ) { + $this->object = $values['object']; + $this->data = $values['data']; + $this->hasMore = $values['hasMore']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/sdks/php/src/Types/SchedulingOutOfOfficeConflictListObject.php b/sdks/php/src/Types/SchedulingOutOfOfficeConflictListObject.php new file mode 100644 index 000000000..128650592 --- /dev/null +++ b/sdks/php/src/Types/SchedulingOutOfOfficeConflictListObject.php @@ -0,0 +1,8 @@ + $object + */ + #[JsonProperty('object')] + public string $object; + + /** + * @var array $data + */ + #[JsonProperty('data'), ArrayType([SchedulingOutOfOffice::class])] + public array $data; + + /** + * @var bool $hasMore + */ + #[JsonProperty('has_more')] + public bool $hasMore; + + /** + * @param array{ + * object: value-of, + * data: array, + * hasMore: bool, + * } $values + */ + public function __construct( + array $values, + ) { + $this->object = $values['object']; + $this->data = $values['data']; + $this->hasMore = $values['hasMore']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/sdks/php/src/Types/SchedulingOutOfOfficeListObject.php b/sdks/php/src/Types/SchedulingOutOfOfficeListObject.php new file mode 100644 index 000000000..f02ea9176 --- /dev/null +++ b/sdks/php/src/Types/SchedulingOutOfOfficeListObject.php @@ -0,0 +1,8 @@ + $object + */ + #[JsonProperty('object')] + public string $object; + + /** + * @var string $apiVersion The API version this payload is rendered in: the endpoint's. + */ + #[JsonProperty('api_version')] + public string $apiVersion; + + /** + * @var DateTime $createdAt When the event was created. + */ + #[JsonProperty('created_at'), Date(Date::TYPE_DATETIME)] + public DateTime $createdAt; + + /** + * @var value-of $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var SchedulingOutOfOfficeWebhookEventData $data + */ + #[JsonProperty('data')] + public SchedulingOutOfOfficeWebhookEventData $data; + + /** + * @param array{ + * id: string, + * object: value-of, + * apiVersion: string, + * createdAt: DateTime, + * type: value-of, + * data: SchedulingOutOfOfficeWebhookEventData, + * } $values + */ + public function __construct( + array $values, + ) { + $this->id = $values['id']; + $this->object = $values['object']; + $this->apiVersion = $values['apiVersion']; + $this->createdAt = $values['createdAt']; + $this->type = $values['type']; + $this->data = $values['data']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/sdks/php/src/Types/SchedulingOutOfOfficeWebhookEventData.php b/sdks/php/src/Types/SchedulingOutOfOfficeWebhookEventData.php new file mode 100644 index 000000000..65d9fcce9 --- /dev/null +++ b/sdks/php/src/Types/SchedulingOutOfOfficeWebhookEventData.php @@ -0,0 +1,77 @@ +outOfOfficeId = $values['outOfOfficeId']; + $this->hostId = $values['hostId']; + $this->start = $values['start']; + $this->end = $values['end']; + $this->group = $values['group'] ?? null; + if (array_key_exists('group', $values)) { + $this->_setField('group'); + } + $this->occurredAt = $values['occurredAt']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/sdks/php/src/Types/SchedulingOutOfOfficeWebhookEventObject.php b/sdks/php/src/Types/SchedulingOutOfOfficeWebhookEventObject.php new file mode 100644 index 000000000..32ee06389 --- /dev/null +++ b/sdks/php/src/Types/SchedulingOutOfOfficeWebhookEventObject.php @@ -0,0 +1,8 @@ + $object + */ + #[JsonProperty('object')] + public string $object; + + /** + * @var string $host + */ + #[JsonProperty('host')] + public string $host; + + /** + * @var ?string $uid + */ + #[JsonProperty('uid')] + public ?string $uid; + + /** + * @var string $name + */ + #[JsonProperty('name')] + public string $name; + + /** + * @var bool $member Takes this event type, and fits what the booking was routed with. Otherwise it needs `any_host`. + */ + #[JsonProperty('member')] + public bool $member; + + /** + * @var bool $available + */ + #[JsonProperty('available')] + public bool $available; + + /** + * @var ?string $reason Why they aren't available, the first of `reasons`. + */ + #[JsonProperty('reason')] + public ?string $reason; + + /** + * @var array $reasons Everything in the way, each needing its override. `already_claimed` can't be overridden. + */ + #[JsonProperty('reasons'), ArrayType(['string'])] + public array $reasons; + + /** + * @var float $load Their live bookings in the week from this one. + */ + #[JsonProperty('load')] + public float $load; + + /** + * @var ?float $rank Their place in who a pool would pick next, from 1. Null for a non-member. + */ + #[JsonProperty('rank')] + public ?float $rank; + + /** + * @var bool $meetingProviderMissing They haven't connected what this booking's meeting needs, so it'd have none. + */ + #[JsonProperty('meeting_provider_missing')] + public bool $meetingProviderMissing; + + /** + * @param array{ + * object: value-of, + * host: string, + * name: string, + * member: bool, + * available: bool, + * reasons: array, + * load: float, + * meetingProviderMissing: bool, + * uid?: ?string, + * reason?: ?string, + * rank?: ?float, + * } $values + */ + public function __construct( + array $values, + ) { + $this->object = $values['object']; + $this->host = $values['host']; + $this->uid = $values['uid'] ?? null; + if (array_key_exists('uid', $values)) { + $this->_setField('uid'); + } + $this->name = $values['name']; + $this->member = $values['member']; + $this->available = $values['available']; + $this->reason = $values['reason'] ?? null; + if (array_key_exists('reason', $values)) { + $this->_setField('reason'); + } + $this->reasons = $values['reasons']; + $this->load = $values['load']; + $this->rank = $values['rank'] ?? null; + if (array_key_exists('rank', $values)) { + $this->_setField('rank'); + } + $this->meetingProviderMissing = $values['meetingProviderMissing']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/sdks/php/src/Types/SchedulingReassignCandidateList.php b/sdks/php/src/Types/SchedulingReassignCandidateList.php new file mode 100644 index 000000000..05d21327f --- /dev/null +++ b/sdks/php/src/Types/SchedulingReassignCandidateList.php @@ -0,0 +1,51 @@ + $object + */ + #[JsonProperty('object')] + public string $object; + + /** + * @var array $data + */ + #[JsonProperty('data'), ArrayType([SchedulingReassignCandidate::class])] + public array $data; + + /** + * @var bool $hasMore + */ + #[JsonProperty('has_more')] + public bool $hasMore; + + /** + * @param array{ + * object: value-of, + * data: array, + * hasMore: bool, + * } $values + */ + public function __construct( + array $values, + ) { + $this->object = $values['object']; + $this->data = $values['data']; + $this->hasMore = $values['hasMore']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/sdks/php/src/Types/SchedulingReassignCandidateListObject.php b/sdks/php/src/Types/SchedulingReassignCandidateListObject.php new file mode 100644 index 000000000..e8cd0a863 --- /dev/null +++ b/sdks/php/src/Types/SchedulingReassignCandidateListObject.php @@ -0,0 +1,8 @@ + $object + */ + #[JsonProperty('object')] + public string $object; + + /** + * @var string $id + */ + #[JsonProperty('id')] + public string $id; + + /** + * @var value-of $status + */ + #[JsonProperty('status')] + public string $status; + + /** + * @var value-of $reasonCode + */ + #[JsonProperty('reason_code')] + public string $reasonCode; + + /** + * @var ?string $outOfOffice + */ + #[JsonProperty('out_of_office')] + public ?string $outOfOffice; + + /** + * @var ?string $undoOf + */ + #[JsonProperty('undo_of')] + public ?string $undoOf; + + /** + * @var SchedulingReassignmentCounts $counts + */ + #[JsonProperty('counts')] + public SchedulingReassignmentCounts $counts; + + /** + * @var string $createdAt + */ + #[JsonProperty('created_at')] + public string $createdAt; + + /** + * @var ?string $startedAt + */ + #[JsonProperty('started_at')] + public ?string $startedAt; + + /** + * @var ?string $finishedAt + */ + #[JsonProperty('finished_at')] + public ?string $finishedAt; + + /** + * @param array{ + * object: value-of, + * id: string, + * status: value-of, + * reasonCode: value-of, + * counts: SchedulingReassignmentCounts, + * createdAt: string, + * outOfOffice?: ?string, + * undoOf?: ?string, + * startedAt?: ?string, + * finishedAt?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->object = $values['object']; + $this->id = $values['id']; + $this->status = $values['status']; + $this->reasonCode = $values['reasonCode']; + $this->outOfOffice = $values['outOfOffice'] ?? null; + if (array_key_exists('outOfOffice', $values)) { + $this->_setField('outOfOffice'); + } + $this->undoOf = $values['undoOf'] ?? null; + if (array_key_exists('undoOf', $values)) { + $this->_setField('undoOf'); + } + $this->counts = $values['counts']; + $this->createdAt = $values['createdAt']; + $this->startedAt = $values['startedAt'] ?? null; + if (array_key_exists('startedAt', $values)) { + $this->_setField('startedAt'); + } + $this->finishedAt = $values['finishedAt'] ?? null; + if (array_key_exists('finishedAt', $values)) { + $this->_setField('finishedAt'); + } + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/sdks/php/src/Types/SchedulingReassignmentCounts.php b/sdks/php/src/Types/SchedulingReassignmentCounts.php new file mode 100644 index 000000000..3a804a002 --- /dev/null +++ b/sdks/php/src/Types/SchedulingReassignmentCounts.php @@ -0,0 +1,82 @@ +total = $values['total']; + $this->pending = $values['pending']; + $this->reassigned = $values['reassigned']; + $this->skipped = $values['skipped']; + $this->noCandidate = $values['noCandidate']; + $this->failed = $values['failed']; + $this->cancelled = $values['cancelled']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/sdks/php/src/Types/SchedulingReassignmentItem.php b/sdks/php/src/Types/SchedulingReassignmentItem.php new file mode 100644 index 000000000..d511c1563 --- /dev/null +++ b/sdks/php/src/Types/SchedulingReassignmentItem.php @@ -0,0 +1,91 @@ + $object + */ + #[JsonProperty('object')] + public string $object; + + /** + * @var string $id + */ + #[JsonProperty('id')] + public string $id; + + /** + * @var string $booking + */ + #[JsonProperty('booking')] + public string $booking; + + /** + * @var ?string $fromHost + */ + #[JsonProperty('from_host')] + public ?string $fromHost; + + /** + * @var ?string $toHost + */ + #[JsonProperty('to_host')] + public ?string $toHost; + + /** + * @var value-of $outcome + */ + #[JsonProperty('outcome')] + public string $outcome; + + /** + * @var ?string $errorCode + */ + #[JsonProperty('error_code')] + public ?string $errorCode; + + /** + * @param array{ + * object: value-of, + * id: string, + * booking: string, + * outcome: value-of, + * fromHost?: ?string, + * toHost?: ?string, + * errorCode?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->object = $values['object']; + $this->id = $values['id']; + $this->booking = $values['booking']; + $this->fromHost = $values['fromHost'] ?? null; + if (array_key_exists('fromHost', $values)) { + $this->_setField('fromHost'); + } + $this->toHost = $values['toHost'] ?? null; + if (array_key_exists('toHost', $values)) { + $this->_setField('toHost'); + } + $this->outcome = $values['outcome']; + $this->errorCode = $values['errorCode'] ?? null; + if (array_key_exists('errorCode', $values)) { + $this->_setField('errorCode'); + } + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/sdks/php/src/Types/SchedulingReassignmentItemList.php b/sdks/php/src/Types/SchedulingReassignmentItemList.php new file mode 100644 index 000000000..f4c6823a8 --- /dev/null +++ b/sdks/php/src/Types/SchedulingReassignmentItemList.php @@ -0,0 +1,51 @@ + $object + */ + #[JsonProperty('object')] + public string $object; + + /** + * @var array $data + */ + #[JsonProperty('data'), ArrayType([SchedulingReassignmentItem::class])] + public array $data; + + /** + * @var bool $hasMore + */ + #[JsonProperty('has_more')] + public bool $hasMore; + + /** + * @param array{ + * object: value-of, + * data: array, + * hasMore: bool, + * } $values + */ + public function __construct( + array $values, + ) { + $this->object = $values['object']; + $this->data = $values['data']; + $this->hasMore = $values['hasMore']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/sdks/php/src/Types/SchedulingReassignmentItemListObject.php b/sdks/php/src/Types/SchedulingReassignmentItemListObject.php new file mode 100644 index 000000000..b2325f51b --- /dev/null +++ b/sdks/php/src/Types/SchedulingReassignmentItemListObject.php @@ -0,0 +1,8 @@ + $object + */ + #[JsonProperty('object')] + public string $object; + + /** + * @var array $data + */ + #[JsonProperty('data'), ArrayType([SchedulingReassignment::class])] + public array $data; + + /** + * @var bool $hasMore + */ + #[JsonProperty('has_more')] + public bool $hasMore; + + /** + * @param array{ + * object: value-of, + * data: array, + * hasMore: bool, + * } $values + */ + public function __construct( + array $values, + ) { + $this->object = $values['object']; + $this->data = $values['data']; + $this->hasMore = $values['hasMore']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/sdks/php/src/Types/SchedulingReassignmentListObject.php b/sdks/php/src/Types/SchedulingReassignmentListObject.php new file mode 100644 index 000000000..f1be4e5bf --- /dev/null +++ b/sdks/php/src/Types/SchedulingReassignmentListObject.php @@ -0,0 +1,8 @@ + $object + */ + #[JsonProperty('object')] + public string $object; + + /** + * @var array $items + */ + #[JsonProperty('items'), ArrayType([SchedulingReassignmentPreviewItemsItem::class])] + public array $items; + + /** + * @var bool $truncated There are more than a preview covers. + */ + #[JsonProperty('truncated')] + public bool $truncated; + + /** + * @param array{ + * object: value-of, + * items: array, + * truncated: bool, + * } $values + */ + public function __construct( + array $values, + ) { + $this->object = $values['object']; + $this->items = $values['items']; + $this->truncated = $values['truncated']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/sdks/php/src/Types/SchedulingReassignmentPreviewItemsItem.php b/sdks/php/src/Types/SchedulingReassignmentPreviewItemsItem.php new file mode 100644 index 000000000..246311330 --- /dev/null +++ b/sdks/php/src/Types/SchedulingReassignmentPreviewItemsItem.php @@ -0,0 +1,129 @@ + $status + */ + #[JsonProperty('status')] + public string $status; + + /** + * @var string $start + */ + #[JsonProperty('start')] + public string $start; + + /** + * @var string $end + */ + #[JsonProperty('end')] + public string $end; + + /** + * @var ?string $series + */ + #[JsonProperty('series')] + public ?string $series; + + /** + * @var ?string $groupSession + */ + #[JsonProperty('group_session')] + public ?string $groupSession; + + /** + * @var ?string $fromHost + */ + #[JsonProperty('from_host')] + public ?string $fromHost; + + /** + * @var ?string $toHost Null when nobody could take it. + */ + #[JsonProperty('to_host')] + public ?string $toHost; + + /** + * @var ?string $reason Why it would stay where it is. + */ + #[JsonProperty('reason')] + public ?string $reason; + + /** + * @param array{ + * booking: string, + * eventType: string, + * title: string, + * status: value-of, + * start: string, + * end: string, + * series?: ?string, + * groupSession?: ?string, + * fromHost?: ?string, + * toHost?: ?string, + * reason?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->booking = $values['booking']; + $this->eventType = $values['eventType']; + $this->title = $values['title']; + $this->status = $values['status']; + $this->start = $values['start']; + $this->end = $values['end']; + $this->series = $values['series'] ?? null; + if (array_key_exists('series', $values)) { + $this->_setField('series'); + } + $this->groupSession = $values['groupSession'] ?? null; + if (array_key_exists('groupSession', $values)) { + $this->_setField('groupSession'); + } + $this->fromHost = $values['fromHost'] ?? null; + if (array_key_exists('fromHost', $values)) { + $this->_setField('fromHost'); + } + $this->toHost = $values['toHost'] ?? null; + if (array_key_exists('toHost', $values)) { + $this->_setField('toHost'); + } + $this->reason = $values['reason'] ?? null; + if (array_key_exists('reason', $values)) { + $this->_setField('reason'); + } + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/sdks/php/src/Types/SchedulingReassignmentPreviewItemsItemStatus.php b/sdks/php/src/Types/SchedulingReassignmentPreviewItemsItemStatus.php new file mode 100644 index 000000000..5b774d957 --- /dev/null +++ b/sdks/php/src/Types/SchedulingReassignmentPreviewItemsItemStatus.php @@ -0,0 +1,12 @@ + $bookingIds + */ + #[JsonProperty('booking_ids'), ArrayType(['string'])] + public ?array $bookingIds; + + /** + * @var ?string $series A series' occurrences still to come. + */ + #[JsonProperty('series')] + public ?string $series; + + /** + * @var ?string $startAfter An ISO 8601 instant with an offset. + */ + #[JsonProperty('start_after')] + public ?string $startAfter; + + /** + * @var ?string $startBefore An ISO 8601 instant with an offset. + */ + #[JsonProperty('start_before')] + public ?string $startBefore; + + /** + * @var ?array $eventTypes + */ + #[JsonProperty('event_types'), ArrayType(['string'])] + public ?array $eventTypes; + + /** + * @var ?bool $externalConflict Only those with something else on the host's calendar at that time. + */ + #[JsonProperty('external_conflict')] + public ?bool $externalConflict; + + /** + * @param array{ + * host?: ?string, + * outOfOffice?: ?string, + * bookingIds?: ?array, + * series?: ?string, + * startAfter?: ?string, + * startBefore?: ?string, + * eventTypes?: ?array, + * externalConflict?: ?bool, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->host = $values['host'] ?? null; + if (array_key_exists('host', $values)) { + $this->_setField('host'); + } + $this->outOfOffice = $values['outOfOffice'] ?? null; + if (array_key_exists('outOfOffice', $values)) { + $this->_setField('outOfOffice'); + } + $this->bookingIds = $values['bookingIds'] ?? null; + if (array_key_exists('bookingIds', $values)) { + $this->_setField('bookingIds'); + } + $this->series = $values['series'] ?? null; + if (array_key_exists('series', $values)) { + $this->_setField('series'); + } + $this->startAfter = $values['startAfter'] ?? null; + if (array_key_exists('startAfter', $values)) { + $this->_setField('startAfter'); + } + $this->startBefore = $values['startBefore'] ?? null; + if (array_key_exists('startBefore', $values)) { + $this->_setField('startBefore'); + } + $this->eventTypes = $values['eventTypes'] ?? null; + if (array_key_exists('eventTypes', $values)) { + $this->_setField('eventTypes'); + } + $this->externalConflict = $values['externalConflict'] ?? null; + if (array_key_exists('externalConflict', $values)) { + $this->_setField('externalConflict'); + } + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/sdks/php/src/Types/SchedulingReassignmentStatus.php b/sdks/php/src/Types/SchedulingReassignmentStatus.php new file mode 100644 index 000000000..6de853b30 --- /dev/null +++ b/sdks/php/src/Types/SchedulingReassignmentStatus.php @@ -0,0 +1,11 @@ + $preferredHosts Try these first, in order. + */ + #[JsonProperty('preferred_hosts'), ArrayType(['string'])] + public ?array $preferredHosts; + + /** + * @var ?value-of $otherwise After `preferred_hosts`: `auto` picks the fairest who's free, `leave` keeps it where it is. + */ + #[JsonProperty('otherwise')] + public ?string $otherwise; + + /** + * @var ?array $assignments Who each goes to: a preview, with your changes. + */ + #[JsonProperty('assignments'), ArrayType([SchedulingReassignmentStrategyAssignmentsItem::class])] + public ?array $assignments; + + /** + * @param array{ + * toHost?: ?string, + * preferredHosts?: ?array, + * otherwise?: ?value-of, + * assignments?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->toHost = $values['toHost'] ?? null; + if (array_key_exists('toHost', $values)) { + $this->_setField('toHost'); + } + $this->preferredHosts = $values['preferredHosts'] ?? null; + if (array_key_exists('preferredHosts', $values)) { + $this->_setField('preferredHosts'); + } + $this->otherwise = $values['otherwise'] ?? null; + if (array_key_exists('otherwise', $values)) { + $this->_setField('otherwise'); + } + $this->assignments = $values['assignments'] ?? null; + if (array_key_exists('assignments', $values)) { + $this->_setField('assignments'); + } + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/sdks/php/src/Types/SchedulingReassignmentStrategyAssignmentsItem.php b/sdks/php/src/Types/SchedulingReassignmentStrategyAssignmentsItem.php new file mode 100644 index 000000000..d327b549b --- /dev/null +++ b/sdks/php/src/Types/SchedulingReassignmentStrategyAssignmentsItem.php @@ -0,0 +1,53 @@ +booking = $values['booking']; + $this->toHost = $values['toHost']; + $this->fromHost = $values['fromHost'] ?? null; + if (array_key_exists('fromHost', $values)) { + $this->_setField('fromHost'); + } + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/sdks/php/src/Types/SchedulingReassignmentStrategyOtherwise.php b/sdks/php/src/Types/SchedulingReassignmentStrategyOtherwise.php new file mode 100644 index 000000000..e5f6dbe83 --- /dev/null +++ b/sdks/php/src/Types/SchedulingReassignmentStrategyOtherwise.php @@ -0,0 +1,9 @@ + $object + */ + #[JsonProperty('object')] + public string $object; + + /** + * @var string $apiVersion The API version this payload is rendered in: the endpoint's. + */ + #[JsonProperty('api_version')] + public string $apiVersion; + + /** + * @var DateTime $createdAt When the event was created. + */ + #[JsonProperty('created_at'), Date(Date::TYPE_DATETIME)] + public DateTime $createdAt; + + /** + * @var value-of $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var SchedulingReassignmentWebhookEventData $data + */ + #[JsonProperty('data')] + public SchedulingReassignmentWebhookEventData $data; + + /** + * @param array{ + * id: string, + * object: value-of, + * apiVersion: string, + * createdAt: DateTime, + * type: value-of, + * data: SchedulingReassignmentWebhookEventData, + * } $values + */ + public function __construct( + array $values, + ) { + $this->id = $values['id']; + $this->object = $values['object']; + $this->apiVersion = $values['apiVersion']; + $this->createdAt = $values['createdAt']; + $this->type = $values['type']; + $this->data = $values['data']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/sdks/php/src/Types/SchedulingReassignmentWebhookEventData.php b/sdks/php/src/Types/SchedulingReassignmentWebhookEventData.php new file mode 100644 index 000000000..d35eda678 --- /dev/null +++ b/sdks/php/src/Types/SchedulingReassignmentWebhookEventData.php @@ -0,0 +1,69 @@ + $status + */ + #[JsonProperty('status')] + public string $status; + + /** + * @var ?string $outOfOfficeId + */ + #[JsonProperty('out_of_office_id')] + public ?string $outOfOfficeId; + + /** + * @var SchedulingReassignmentWebhookEventDataCounts $counts + */ + #[JsonProperty('counts')] + public SchedulingReassignmentWebhookEventDataCounts $counts; + + /** + * @var string $occurredAt + */ + #[JsonProperty('occurred_at')] + public string $occurredAt; + + /** + * @param array{ + * reassignmentId: string, + * status: value-of, + * counts: SchedulingReassignmentWebhookEventDataCounts, + * occurredAt: string, + * outOfOfficeId?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->reassignmentId = $values['reassignmentId']; + $this->status = $values['status']; + $this->outOfOfficeId = $values['outOfOfficeId'] ?? null; + if (array_key_exists('outOfOfficeId', $values)) { + $this->_setField('outOfOfficeId'); + } + $this->counts = $values['counts']; + $this->occurredAt = $values['occurredAt']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/sdks/php/src/Types/SchedulingReassignmentWebhookEventDataCounts.php b/sdks/php/src/Types/SchedulingReassignmentWebhookEventDataCounts.php new file mode 100644 index 000000000..eb923b264 --- /dev/null +++ b/sdks/php/src/Types/SchedulingReassignmentWebhookEventDataCounts.php @@ -0,0 +1,82 @@ +total = $values['total']; + $this->pending = $values['pending']; + $this->reassigned = $values['reassigned']; + $this->skipped = $values['skipped']; + $this->noCandidate = $values['noCandidate']; + $this->failed = $values['failed']; + $this->cancelled = $values['cancelled']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/sdks/php/src/Types/SchedulingReassignmentWebhookEventDataStatus.php b/sdks/php/src/Types/SchedulingReassignmentWebhookEventDataStatus.php new file mode 100644 index 000000000..7865b2bd9 --- /dev/null +++ b/sdks/php/src/Types/SchedulingReassignmentWebhookEventDataStatus.php @@ -0,0 +1,9 @@ + $hostReassignment Whether hosts can give their own bookings to someone else from their page. `eligible` lets them, to anyone free who takes that event type. + */ + #[JsonProperty('host_reassignment')] + public string $hostReassignment; + + /** + * @var array $outOfOfficeReasons Reasons of your own for time away, on top of the preset ones. + */ + #[JsonProperty('out_of_office_reasons'), ArrayType([SchedulingSettingsOutOfOfficeReasonsItem::class])] + public array $outOfOfficeReasons; + /** * @var value-of $calendarFailureMode When a host's calendar can't be read: `hide` stops offering them, `last_known` keeps offering their last known times. */ @@ -79,10 +103,14 @@ class SchedulingSettings extends JsonSerializableType * @param array{ * object: value-of, * allowedOrigins: array, + * nameHostInAttendeeEmails: bool, + * hostReassignment: value-of, + * outOfOfficeReasons: array, * calendarFailureMode: value-of, * brandName?: ?string, * accentColor?: ?string, * logo?: ?SchedulingSettingsLogo, + * privacyUrl?: ?string, * emailFrom?: ?string, * smsFrom?: ?string, * notifications?: ?array, @@ -107,6 +135,10 @@ public function __construct( if (array_key_exists('logo', $values)) { $this->_setField('logo'); } + $this->privacyUrl = $values['privacyUrl'] ?? null; + if (array_key_exists('privacyUrl', $values)) { + $this->_setField('privacyUrl'); + } $this->emailFrom = $values['emailFrom'] ?? null; if (array_key_exists('emailFrom', $values)) { $this->_setField('emailFrom'); @@ -115,6 +147,9 @@ public function __construct( if (array_key_exists('smsFrom', $values)) { $this->_setField('smsFrom'); } + $this->nameHostInAttendeeEmails = $values['nameHostInAttendeeEmails']; + $this->hostReassignment = $values['hostReassignment']; + $this->outOfOfficeReasons = $values['outOfOfficeReasons']; $this->calendarFailureMode = $values['calendarFailureMode']; $this->notifications = $values['notifications'] ?? null; if (array_key_exists('notifications', $values)) { diff --git a/sdks/php/src/Types/SchedulingSettingsHostReassignment.php b/sdks/php/src/Types/SchedulingSettingsHostReassignment.php new file mode 100644 index 000000000..ca1ebc7da --- /dev/null +++ b/sdks/php/src/Types/SchedulingSettingsHostReassignment.php @@ -0,0 +1,9 @@ +key = $values['key']; + $this->label = $values['label']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/sdks/php/src/Types/SchedulingSlotExplanation.php b/sdks/php/src/Types/SchedulingSlotExplanation.php index a55fbdf26..657da6b5c 100644 --- a/sdks/php/src/Types/SchedulingSlotExplanation.php +++ b/sdks/php/src/Types/SchedulingSlotExplanation.php @@ -33,7 +33,7 @@ class SchedulingSlotExplanation extends JsonSerializableType public bool $available; /** - * @var ?string $reason Why it can't: `not_on_grid`, `too_soon`, `outside_booking_window`, `calendar_unverified`, `outside_availability`, `host_busy`, `already_claimed`, `limit_reached` or `session_full`, or `event_type_inactive` or `no_hosts`. `null` when it can. With several hosts refused, the first one's reason: see `hosts`. + * @var ?string $reason Why it can't: `not_on_grid`, `too_soon`, `outside_booking_window`, `out_of_office`, `outside_coverage`, `calendar_unverified`, `outside_availability`, `host_busy`, `already_claimed`, `limit_reached` or `session_full`, or `event_type_inactive` or `no_hosts`. `null` when it can. With several hosts refused, the first one's reason: see `hosts`. */ #[JsonProperty('reason')] public ?string $reason; diff --git a/sdks/php/src/Types/SchedulingSlotExplanationHostsItem.php b/sdks/php/src/Types/SchedulingSlotExplanationHostsItem.php index 0a4498707..9f6f593d0 100644 --- a/sdks/php/src/Types/SchedulingSlotExplanationHostsItem.php +++ b/sdks/php/src/Types/SchedulingSlotExplanationHostsItem.php @@ -26,7 +26,7 @@ class SchedulingSlotExplanationHostsItem extends JsonSerializableType public bool $available; /** - * @var ?string $reason Why not: `not_on_grid`, `too_soon`, `outside_booking_window`, `calendar_unverified`, `outside_availability`, `host_busy`, `already_claimed`, `limit_reached` or `session_full`. `null` when they could. + * @var ?string $reason Why not: `not_on_grid`, `too_soon`, `outside_booking_window`, `out_of_office`, `outside_coverage`, `calendar_unverified`, `outside_availability`, `host_busy`, `already_claimed`, `limit_reached` or `session_full`. `null` when they could. */ #[JsonProperty('reason')] public ?string $reason; diff --git a/sdks/php/src/Types/WebhookTestEvent.php b/sdks/php/src/Types/WebhookTestEvent.php index 1f24d6123..12f7c67d5 100644 --- a/sdks/php/src/Types/WebhookTestEvent.php +++ b/sdks/php/src/Types/WebhookTestEvent.php @@ -30,11 +30,14 @@ class WebhookTestEvent extends JsonSerializableType * |FormSubmissionWebhookEvent * |SchedulingBookingWebhookEvent * |SchedulingCalendarWebhookEvent + * |SchedulingOutOfOfficeWebhookEvent + * |SchedulingReassignmentWebhookEvent * |SchedulingCalendarDelegationWebhookEvent + * |SchedulingOauthAppWebhookEvent * ) $event The event, as an endpoint on the request's API version receives it. Its `webhook-id` header is `event.id`. */ - #[JsonProperty('event'), Union(EmailWebhookEvent::class, ReceivedEmailWebhookEvent::class, HookEndpointWebhookEvent::class, RiskWebhookEvent::class, ContactWebhookEvent::class, BroadcastWebhookEvent::class, InboxMessageReceivedWebhookEvent::class, SmsWebhookEvent::class, ReceivedSmsWebhookEvent::class, SignRequestWebhookEvent::class, VerificationWebhookEvent::class, FormSubmissionWebhookEvent::class, SchedulingBookingWebhookEvent::class, SchedulingCalendarWebhookEvent::class, SchedulingCalendarDelegationWebhookEvent::class)] - public EmailWebhookEvent|ReceivedEmailWebhookEvent|HookEndpointWebhookEvent|RiskWebhookEvent|ContactWebhookEvent|BroadcastWebhookEvent|InboxMessageReceivedWebhookEvent|SmsWebhookEvent|ReceivedSmsWebhookEvent|SignRequestWebhookEvent|VerificationWebhookEvent|FormSubmissionWebhookEvent|SchedulingBookingWebhookEvent|SchedulingCalendarWebhookEvent|SchedulingCalendarDelegationWebhookEvent $event; + #[JsonProperty('event'), Union(EmailWebhookEvent::class, ReceivedEmailWebhookEvent::class, HookEndpointWebhookEvent::class, RiskWebhookEvent::class, ContactWebhookEvent::class, BroadcastWebhookEvent::class, InboxMessageReceivedWebhookEvent::class, SmsWebhookEvent::class, ReceivedSmsWebhookEvent::class, SignRequestWebhookEvent::class, VerificationWebhookEvent::class, FormSubmissionWebhookEvent::class, SchedulingBookingWebhookEvent::class, SchedulingCalendarWebhookEvent::class, SchedulingOutOfOfficeWebhookEvent::class, SchedulingReassignmentWebhookEvent::class, SchedulingCalendarDelegationWebhookEvent::class, SchedulingOauthAppWebhookEvent::class)] + public EmailWebhookEvent|ReceivedEmailWebhookEvent|HookEndpointWebhookEvent|RiskWebhookEvent|ContactWebhookEvent|BroadcastWebhookEvent|InboxMessageReceivedWebhookEvent|SmsWebhookEvent|ReceivedSmsWebhookEvent|SignRequestWebhookEvent|VerificationWebhookEvent|FormSubmissionWebhookEvent|SchedulingBookingWebhookEvent|SchedulingCalendarWebhookEvent|SchedulingOutOfOfficeWebhookEvent|SchedulingReassignmentWebhookEvent|SchedulingCalendarDelegationWebhookEvent|SchedulingOauthAppWebhookEvent $event; /** * @var int $endpoints Enabled endpoints of the environment subscribed to the type, each sent it once. @@ -66,7 +69,10 @@ class WebhookTestEvent extends JsonSerializableType * |FormSubmissionWebhookEvent * |SchedulingBookingWebhookEvent * |SchedulingCalendarWebhookEvent + * |SchedulingOutOfOfficeWebhookEvent + * |SchedulingReassignmentWebhookEvent * |SchedulingCalendarDelegationWebhookEvent + * |SchedulingOauthAppWebhookEvent * ), * endpoints: int, * listeners: int, diff --git a/sdks/php/src/WebhookEndpoints/Types/CreateWebhookEndpointRequestEventTypesItem.php b/sdks/php/src/WebhookEndpoints/Types/CreateWebhookEndpointRequestEventTypesItem.php index 116ba787b..35671ac31 100644 --- a/sdks/php/src/WebhookEndpoints/Types/CreateWebhookEndpointRequestEventTypesItem.php +++ b/sdks/php/src/WebhookEndpoints/Types/CreateWebhookEndpointRequestEventTypesItem.php @@ -87,6 +87,7 @@ enum CreateWebhookEndpointRequestEventTypesItem: string case SchedulingBookingExternalConflict = "scheduling.booking.external_conflict"; case SchedulingBookingCalendarWriteFailed = "scheduling.booking.calendar_write_failed"; case SchedulingBookingLocationReady = "scheduling.booking.location_ready"; + case SchedulingBookingReassigned = "scheduling.booking.reassigned"; case SchedulingBookingStarted = "scheduling.booking.started"; case SchedulingBookingEnded = "scheduling.booking.ended"; case SchedulingBookingReminder = "scheduling.booking.reminder"; @@ -95,4 +96,12 @@ enum CreateWebhookEndpointRequestEventTypesItem: string case SchedulingCalendarDisconnected = "scheduling.calendar.disconnected"; case SchedulingCalendarDelegationFailing = "scheduling.calendar_delegation.failing"; case SchedulingCalendarDelegationRestored = "scheduling.calendar_delegation.restored"; + case SchedulingOutOfOfficeCreated = "scheduling.out_of_office.created"; + case SchedulingOutOfOfficeUpdated = "scheduling.out_of_office.updated"; + case SchedulingOutOfOfficeDeleted = "scheduling.out_of_office.deleted"; + case SchedulingOutOfOfficeStarted = "scheduling.out_of_office.started"; + case SchedulingOutOfOfficeEnded = "scheduling.out_of_office.ended"; + case SchedulingReassignmentCompleted = "scheduling.reassignment.completed"; + case SchedulingOauthAppFailing = "scheduling.oauth_app.failing"; + case SchedulingOauthAppRestored = "scheduling.oauth_app.restored"; } diff --git a/sdks/php/src/WebhookEndpoints/Types/UpdateWebhookEndpointRequestEventTypesItem.php b/sdks/php/src/WebhookEndpoints/Types/UpdateWebhookEndpointRequestEventTypesItem.php index 5736e7ded..64c28267f 100644 --- a/sdks/php/src/WebhookEndpoints/Types/UpdateWebhookEndpointRequestEventTypesItem.php +++ b/sdks/php/src/WebhookEndpoints/Types/UpdateWebhookEndpointRequestEventTypesItem.php @@ -87,6 +87,7 @@ enum UpdateWebhookEndpointRequestEventTypesItem: string case SchedulingBookingExternalConflict = "scheduling.booking.external_conflict"; case SchedulingBookingCalendarWriteFailed = "scheduling.booking.calendar_write_failed"; case SchedulingBookingLocationReady = "scheduling.booking.location_ready"; + case SchedulingBookingReassigned = "scheduling.booking.reassigned"; case SchedulingBookingStarted = "scheduling.booking.started"; case SchedulingBookingEnded = "scheduling.booking.ended"; case SchedulingBookingReminder = "scheduling.booking.reminder"; @@ -95,4 +96,12 @@ enum UpdateWebhookEndpointRequestEventTypesItem: string case SchedulingCalendarDisconnected = "scheduling.calendar.disconnected"; case SchedulingCalendarDelegationFailing = "scheduling.calendar_delegation.failing"; case SchedulingCalendarDelegationRestored = "scheduling.calendar_delegation.restored"; + case SchedulingOutOfOfficeCreated = "scheduling.out_of_office.created"; + case SchedulingOutOfOfficeUpdated = "scheduling.out_of_office.updated"; + case SchedulingOutOfOfficeDeleted = "scheduling.out_of_office.deleted"; + case SchedulingOutOfOfficeStarted = "scheduling.out_of_office.started"; + case SchedulingOutOfOfficeEnded = "scheduling.out_of_office.ended"; + case SchedulingReassignmentCompleted = "scheduling.reassignment.completed"; + case SchedulingOauthAppFailing = "scheduling.oauth_app.failing"; + case SchedulingOauthAppRestored = "scheduling.oauth_app.restored"; } diff --git a/sdks/php/src/WebhookEvents/Types/CreateTestWebhookEventRequestType.php b/sdks/php/src/WebhookEvents/Types/CreateTestWebhookEventRequestType.php index 9fcb027e7..60ced7704 100644 --- a/sdks/php/src/WebhookEvents/Types/CreateTestWebhookEventRequestType.php +++ b/sdks/php/src/WebhookEvents/Types/CreateTestWebhookEventRequestType.php @@ -87,6 +87,7 @@ enum CreateTestWebhookEventRequestType: string case SchedulingBookingExternalConflict = "scheduling.booking.external_conflict"; case SchedulingBookingCalendarWriteFailed = "scheduling.booking.calendar_write_failed"; case SchedulingBookingLocationReady = "scheduling.booking.location_ready"; + case SchedulingBookingReassigned = "scheduling.booking.reassigned"; case SchedulingBookingStarted = "scheduling.booking.started"; case SchedulingBookingEnded = "scheduling.booking.ended"; case SchedulingBookingReminder = "scheduling.booking.reminder"; @@ -95,4 +96,12 @@ enum CreateTestWebhookEventRequestType: string case SchedulingCalendarDisconnected = "scheduling.calendar.disconnected"; case SchedulingCalendarDelegationFailing = "scheduling.calendar_delegation.failing"; case SchedulingCalendarDelegationRestored = "scheduling.calendar_delegation.restored"; + case SchedulingOutOfOfficeCreated = "scheduling.out_of_office.created"; + case SchedulingOutOfOfficeUpdated = "scheduling.out_of_office.updated"; + case SchedulingOutOfOfficeDeleted = "scheduling.out_of_office.deleted"; + case SchedulingOutOfOfficeStarted = "scheduling.out_of_office.started"; + case SchedulingOutOfOfficeEnded = "scheduling.out_of_office.ended"; + case SchedulingReassignmentCompleted = "scheduling.reassignment.completed"; + case SchedulingOauthAppFailing = "scheduling.oauth_app.failing"; + case SchedulingOauthAppRestored = "scheduling.oauth_app.restored"; } diff --git a/sdks/php/src/WebhookListeners/Types/CreateWebhookListenerRequestEventTypesItem.php b/sdks/php/src/WebhookListeners/Types/CreateWebhookListenerRequestEventTypesItem.php index e995c1424..c659fdbda 100644 --- a/sdks/php/src/WebhookListeners/Types/CreateWebhookListenerRequestEventTypesItem.php +++ b/sdks/php/src/WebhookListeners/Types/CreateWebhookListenerRequestEventTypesItem.php @@ -87,6 +87,7 @@ enum CreateWebhookListenerRequestEventTypesItem: string case SchedulingBookingExternalConflict = "scheduling.booking.external_conflict"; case SchedulingBookingCalendarWriteFailed = "scheduling.booking.calendar_write_failed"; case SchedulingBookingLocationReady = "scheduling.booking.location_ready"; + case SchedulingBookingReassigned = "scheduling.booking.reassigned"; case SchedulingBookingStarted = "scheduling.booking.started"; case SchedulingBookingEnded = "scheduling.booking.ended"; case SchedulingBookingReminder = "scheduling.booking.reminder"; @@ -95,4 +96,12 @@ enum CreateWebhookListenerRequestEventTypesItem: string case SchedulingCalendarDisconnected = "scheduling.calendar.disconnected"; case SchedulingCalendarDelegationFailing = "scheduling.calendar_delegation.failing"; case SchedulingCalendarDelegationRestored = "scheduling.calendar_delegation.restored"; + case SchedulingOutOfOfficeCreated = "scheduling.out_of_office.created"; + case SchedulingOutOfOfficeUpdated = "scheduling.out_of_office.updated"; + case SchedulingOutOfOfficeDeleted = "scheduling.out_of_office.deleted"; + case SchedulingOutOfOfficeStarted = "scheduling.out_of_office.started"; + case SchedulingOutOfOfficeEnded = "scheduling.out_of_office.ended"; + case SchedulingReassignmentCompleted = "scheduling.reassignment.completed"; + case SchedulingOauthAppFailing = "scheduling.oauth_app.failing"; + case SchedulingOauthAppRestored = "scheduling.oauth_app.restored"; } diff --git a/sdks/python/CHANGELOG.md b/sdks/python/CHANGELOG.md index 8ba8118a4..4152bfb5e 100644 --- a/sdks/python/CHANGELOG.md +++ b/sdks/python/CHANGELOG.md @@ -1,5 +1,10 @@ # Changelog +## 0.4.0 + +- Regenerated from the API's OpenAPI document at 2eb77126153a. What changed in the API: the + [API changelog](https://coss.com/docs/api-reference/changelog). + ## 0.3.0 - Regenerated from the API's OpenAPI document at 820256d03a44. What changed in the API: the diff --git a/sdks/python/pyproject.toml b/sdks/python/pyproject.toml index bdd957df9..ce4a975c7 100644 --- a/sdks/python/pyproject.toml +++ b/sdks/python/pyproject.toml @@ -4,7 +4,7 @@ dynamic = ["version"] [tool.poetry] name = "cosscom" -version = "0.3.0" +version = "0.4.0" description = "The coss.com SDK for Python" readme = "README.md" authors = ["coss.com"] diff --git a/sdks/python/reference.md b/sdks/python/reference.md index f010abeac..0f57ab237 100644 --- a/sdks/python/reference.md +++ b/sdks/python/reference.md @@ -20751,8 +20751,8 @@ client.scheduling.hosts.update(
-## Scheduling Schedules -
client.scheduling.schedules.list(...) -> SchedulingScheduleList +## Scheduling Bookings +
client.scheduling.bookings.reassign(...) -> SchedulingBooking
@@ -20764,7 +20764,7 @@ client.scheduling.hosts.update(
-All of the host's schedules, oldest first. +Gives a booking to another host, keeping its id and time. Works for every kind: a group session moves as a whole, from any of its seats, and one that's already started changes for the record, with nobody told. Whoever leaves and joins is told, and the attendee unless you say not to.
@@ -20781,14 +20781,21 @@ All of the host's schedules, oldest first. ```python from coss import Coss from coss.environment import CossEnvironment +from coss.scheduling.bookings import ReassignSchedulingBookingRequestChangesItem client = Coss( api_key="", environment=CossEnvironment.DEFAULT, ) -client.scheduling.schedules.list( - host="host_01kd2m9a0b1c2d3e4f5g6h7j8m", +client.scheduling.bookings.reassign( + id="book_01kd2m9a0b1c2d3e4f5g6h7j8m", + changes=[ + ReassignSchedulingBookingRequestChangesItem( + to_host="doctor_518", + ) + ], + reason_code="out_of_office", ) ``` @@ -20805,7 +20812,7 @@ client.scheduling.schedules.list(
-**host:** `str` — The host's id or uid. +**id:** `str` — The booking's id.
@@ -20813,97 +20820,31 @@ client.scheduling.schedules.list(
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. +**changes:** `typing.List[ReassignSchedulingBookingRequestChangesItem]` — A session or a one-on-one has one. A collective can change several.
- -
- - - - -
- -
client.scheduling.schedules.create(...) -> SchedulingSchedule -
-
- -#### 📝 Description - -
-
-A host's weekly hours and date overrides, in local time. The first one is the host's default. -
-
+**reason_code:** `ReassignSchedulingBookingRequestReasonCode` +
-#### 🔌 Usage - -
-
-
-```python -from coss import Coss, SchedulingWeeklyRule, SchedulingScheduleOverride, SchedulingScheduleOverrideRangesItem -from coss.environment import CossEnvironment - -client = Coss( - api_key="", - environment=CossEnvironment.DEFAULT, -) - -client.scheduling.schedules.create( - host="host_01kd2m9a0b1c2d3e4f5g6h7j8m", - name="Clinic hours", - rules=[ - SchedulingWeeklyRule( - days=[ - 1, - 2, - 3, - 4, - 5 - ], - start="09:00", - end="17:00", - ) - ], - overrides=[ - SchedulingScheduleOverride( - date="2027-12-24", - ranges=[ - SchedulingScheduleOverrideRangesItem( - start="start", - end="end", - ) - ], - ) - ], -) - -``` -
-
+**note:** `typing.Optional[str]` — Why, in your words: required with an override of someone's availability. Encrypted, and only in the booking's history. +
-#### ⚙️ Parameters - -
-
-
-**host:** `str` — The host's id or uid. +**overrides:** `typing.Optional[typing.List[ReassignSchedulingBookingRequestOverridesItem]]` — Go ahead anyway: `any_host` for someone who doesn't take this event type, and the rest for what a candidate's `reason` said. A host who already has something at this time can never be overridden.
@@ -20911,7 +20852,7 @@ client.scheduling.schedules.create(
-**request:** `UpsertScheduleRequest` +**notify:** `typing.Optional[ReassignSchedulingBookingRequestNotify]`
@@ -20931,7 +20872,7 @@ client.scheduling.schedules.create(
-
client.scheduling.schedules.get(...) -> SchedulingSchedule +
client.scheduling.bookings.reassign_candidates(...) -> SchedulingReassignCandidateList
@@ -20943,7 +20884,7 @@ client.scheduling.schedules.create(
-One of the host's schedules. +The environment's other active hosts: members of the event type first, in the order a pool would pick them, each saying whether they're free and why not. Things can change before you ask: reassigning decides again.
@@ -20966,9 +20907,8 @@ client = Coss( environment=CossEnvironment.DEFAULT, ) -client.scheduling.schedules.get( - host="host_01kd2m9a0b1c2d3e4f5g6h7j8m", - schedule_id="sched_01kd2m9a0b1c2d3e4f5g6h7j8m", +client.scheduling.bookings.reassign_candidates( + id="book_01kd2m9a0b1c2d3e4f5g6h7j8m", ) ``` @@ -20985,7 +20925,7 @@ client.scheduling.schedules.get(
-**host:** `str` — The host's id or uid. +**id:** `str` — The booking's id.
@@ -20993,7 +20933,7 @@ client.scheduling.schedules.get(
-**schedule_id:** `str` — The schedule's id. +**from_host:** `typing.Optional[str]` — The host who'd leave, when it could be several.
@@ -21013,7 +20953,7 @@ client.scheduling.schedules.get(
-
client.scheduling.schedules.update(...) -> SchedulingSchedule +
client.scheduling.bookings.list(...) -> SchedulingBookingList
@@ -21025,7 +20965,7 @@ client.scheduling.schedules.get(
-Replaces its weekly rules, and its overrides when given. Existing bookings stay: a schedule only decides what's offered next. +The environment's bookings, newest first. Answers aren't included.
@@ -21040,7 +20980,7 @@ Replaces its weekly rules, and its overrides when given. Existing bookings stay:
```python -from coss import Coss, SchedulingWeeklyRule, SchedulingScheduleOverride, SchedulingScheduleOverrideRangesItem +from coss import Coss from coss.environment import CossEnvironment client = Coss( @@ -21048,34 +20988,9 @@ client = Coss( environment=CossEnvironment.DEFAULT, ) -client.scheduling.schedules.update( - host="host_01kd2m9a0b1c2d3e4f5g6h7j8m", - schedule_id="sched_01kd2m9a0b1c2d3e4f5g6h7j8m", - name="Clinic hours", - rules=[ - SchedulingWeeklyRule( - days=[ - 1, - 2, - 3, - 4, - 5 - ], - start="09:00", - end="17:00", - ) - ], - overrides=[ - SchedulingScheduleOverride( - date="2027-12-24", - ranges=[ - SchedulingScheduleOverrideRangesItem( - start="start", - end="end", - ) - ], - ) - ], +client.scheduling.bookings.list( + start_after="2027-01-04T15:00:00.000Z", + start_before="2027-01-04T15:00:00.000Z", ) ``` @@ -21092,7 +21007,7 @@ client.scheduling.schedules.update(
-**host:** `str` — The host's id or uid. +**limit:** `typing.Optional[int]`
@@ -21100,7 +21015,7 @@ client.scheduling.schedules.update(
-**schedule_id:** `str` — The schedule's id. +**after:** `typing.Optional[str]` — The last id of the previous page.
@@ -21108,7 +21023,7 @@ client.scheduling.schedules.update(
-**request:** `UpsertScheduleRequest` +**host:** `typing.Optional[str]`
@@ -21116,73 +21031,31 @@ client.scheduling.schedules.update(
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. +**event_type:** `typing.Optional[str]`
-
-
- - - - -
- -
client.scheduling.schedules.remove(...) -> DeletedSchedulingSchedule -
-
- -#### 📝 Description - -
-
-Refused for the host's default schedule. -
-
+**status:** `typing.Optional[ListBookingsRequestStatus]` +
-#### 🔌 Usage - -
-
-
-```python -from coss import Coss -from coss.environment import CossEnvironment - -client = Coss( - api_key="", - environment=CossEnvironment.DEFAULT, -) - -client.scheduling.schedules.remove( - host="host_01kd2m9a0b1c2d3e4f5g6h7j8m", - schedule_id="sched_01kd2m9a0b1c2d3e4f5g6h7j8m", -) - -``` -
-
+**attendee_uid:** `typing.Optional[str]` +
-#### ⚙️ Parameters - -
-
-
-**host:** `str` — The host's id or uid. +**start_after:** `typing.Optional[str]` — An ISO 8601 instant with an offset.
@@ -21190,7 +21063,7 @@ client.scheduling.schedules.remove(
-**schedule_id:** `str` — The schedule's id. +**start_before:** `typing.Optional[str]` — An ISO 8601 instant with an offset.
@@ -21210,8 +21083,7 @@ client.scheduling.schedules.remove(
-## Scheduling EventTypes -
client.scheduling.event_types.list(...) -> SchedulingEventTypeList +
client.scheduling.bookings.create(...) -> SchedulingBooking
@@ -21223,7 +21095,7 @@ client.scheduling.schedules.remove(
-The environment's event types, newest first. +Books a slot, or joins a group session. Without a `host`, a pool chooses fairly among those free. An event type that requires approval answers with a `pending_approval` booking.
@@ -21238,7 +21110,7 @@ The environment's event types, newest first.
```python -from coss import Coss +from coss import Coss, SchedulingAttendeeInput from coss.environment import CossEnvironment client = Coss( @@ -21246,7 +21118,17 @@ client = Coss( environment=CossEnvironment.DEFAULT, ) -client.scheduling.event_types.list() +client.scheduling.bookings.create( + idempotency_key="welcome-user-123", + event_type="evtype_01kd2m9a0b1c2d3e4f5g6h7j8m", + start="2027-01-04T15:00:00.000Z", + attendee=SchedulingAttendeeInput( + uid="patient_77", + name="Sam Lee", + email="sam@example.com", + time_zone="UTC", + ), +) ```
@@ -21262,7 +21144,7 @@ client.scheduling.event_types.list()
-**limit:** `typing.Optional[int]` +**event_type:** `str` — The event type's id or uid.
@@ -21270,7 +21152,7 @@ client.scheduling.event_types.list()
-**after:** `typing.Optional[str]` — The last id of the previous page. +**start:** `str` — An ISO 8601 instant with an offset.
@@ -21278,64 +21160,127 @@ client.scheduling.event_types.list()
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. +**attendee:** `SchedulingAttendeeInput`
- -
+
+
+**idempotency_key:** `typing.Optional[str]` — Makes retries safe: a repeated request with the same key and body returns the original booking instead of creating another, for 24 hours. A refused request keeps no key. 1-256 characters. +
-
-
client.scheduling.event_types.create(...) -> SchedulingEventType
-#### 📝 Description +**host:** `typing.Optional[str]` — A specific host (id or uid). Default: chosen fairly from those free. + +
+
+**attributes:** `typing.Optional[typing.Dict[str, CreateBookingRequestAttributesValue]]` — Only choose among pool hosts matching all of these. + +
+
+
-What can be booked: `one_on_one` with one host, `pool` for any free host, `collective` when every required host must be free, or `group` for a session with seats. +**duration_minutes:** `typing.Optional[int]` — One of the event type's `duration_options`. +
+ +
+
+ +**guests:** `typing.Optional[typing.List[SchedulingGuestInput]]` — Up to the event type's `max_guests`. +
-#### 🔌 Usage -
+**answers:** `typing.Optional[typing.Dict[str, CreateBookingRequestAnswersValue]]` — Answers to the event type's questions. Stored encrypted, and returned only by retrieving the booking. + +
+
+
-```python -from coss import Coss, SchedulingEventTypeHostInput -from coss.environment import CossEnvironment +**location:** `typing.Optional[CreateBookingRequestLocation]` — One of the event type's `locations`, with your link filled in if it has none. + +
+
+ +
+
+ +**metadata:** `typing.Optional[typing.Dict[str, str]]` — Your own key-value pairs. Don't put sensitive data here. + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+ + + + + + +
+ +
client.scheduling.bookings.get(...) -> SchedulingBooking +
+
+ +#### 📝 Description + +
+
+ +
+
+ +A booking with its attendees and their answers. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from coss import Coss +from coss.environment import CossEnvironment client = Coss( api_key="", environment=CossEnvironment.DEFAULT, ) -client.scheduling.event_types.create( - kind="one_on_one", - title="Initial consultation", - duration_minutes=30, - buffer_after_minutes=10, - min_notice_minutes=120, - hosts=[ - SchedulingEventTypeHostInput( - host="doctor_482", - ) - ], +client.scheduling.bookings.get( + id="book_01kd2m9a0b1c2d3e4f5g6h7j8m", ) ``` @@ -21352,7 +21297,7 @@ client.scheduling.event_types.create(
-**title:** `str` — Shown to attendees and in emails. Host calendars show it only with `host_calendar_details: full`. +**id:** `str` — The booking's id.
@@ -21360,47 +21305,73 @@ client.scheduling.event_types.create(
-**duration_minutes:** `int` — How long a booking lasts by default, in minutes. +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
-
-
-**uid:** `typing.Optional[str]` — Your own id for this event type, unique in the environment, accepted wherever its id is. -
+
+
client.scheduling.bookings.reschedule(...) -> SchedulingBooking
-**kind:** `typing.Optional[CreateEventTypeRequestKind]` — Who a booking needs. `one_on_one`: one host. `pool`: any one of its hosts. `collective`: every `required` host, plus at most one `member`. `group`: one host, with attendees taking seats up to `capacity`. Fixed once created. - -
-
+#### 📝 Description
-**description:** `typing.Optional[str]` — Plain text about the event type, shown on hosted booking pages and never in emails. Links, and anything shaped like a domain, must be on your organization's verified domains or their subdomains, and use `https`. `null` removes it. - +
+
+ +Moves it to a new time, keeping its id. The old time stays booked if the new one isn't free. +
+
+#### 🔌 Usage +
-**duration_options:** `typing.Optional[typing.List[int]]` — Other lengths an attendee may choose, in minutes. Empty: only `duration_minutes`. - +
+
+ +```python +from coss import Coss +from coss.environment import CossEnvironment + +client = Coss( + api_key="", + environment=CossEnvironment.DEFAULT, +) + +client.scheduling.bookings.reschedule( + id="book_01kd2m9a0b1c2d3e4f5g6h7j8m", + start="2027-01-05T15:00:00.000Z", +) + +``` +
+
+#### ⚙️ Parameters +
-**step_minutes:** `typing.Optional[int]` — How far apart slots start. Default: the duration. +
+
+ +**id:** `str` — The booking's id.
@@ -21408,7 +21379,7 @@ client.scheduling.event_types.create(
-**grid_time_zone:** `typing.Optional[str]` — The zone slots align in. Default: each host's own. +**start:** `str` — The new start. The old time stays booked unless this one's free.
@@ -21416,7 +21387,7 @@ client.scheduling.event_types.create(
-**buffer_before_minutes:** `typing.Optional[int]` — Minutes kept free before each booking. Default: 0. +**host:** `typing.Optional[str]` — Move a pool booking to this host. Default: its current hosts.
@@ -21424,47 +21395,73 @@ client.scheduling.event_types.create(
-**buffer_after_minutes:** `typing.Optional[int]` — Minutes kept free after each booking. Default: 0. +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
-
-
-**min_notice_minutes:** `typing.Optional[int]` — Slots starting sooner than this many minutes from now aren't offered. Default: 0. -
+
+
client.scheduling.bookings.cancel(...) -> SchedulingBooking
-**booking_window:** `typing.Optional[SchedulingBookingWindow]` - -
-
+#### 📝 Description
-**limits:** `typing.Optional[typing.List[SchedulingLimit]]` — Caps on bookings per day or week. Default: none. - +
+
+ +Frees the time and removes the calendar event. A cancelled booking stays charged. +
+
+#### 🔌 Usage +
-**capacity:** `typing.Optional[int]` — Attendees per session. Required for, and only allowed on, `group`. - +
+
+ +```python +from coss import Coss +from coss.environment import CossEnvironment + +client = Coss( + api_key="", + environment=CossEnvironment.DEFAULT, +) + +client.scheduling.bookings.cancel( + id="book_01kd2m9a0b1c2d3e4f5g6h7j8m", + reason="Feeling better", +) + +``` +
+
+#### ⚙️ Parameters +
-**requires_approval:** `typing.Optional[bool]` — Bookings start as `pending_approval`, holding the time until approved or declined. Default: `false`. +
+
+ +**id:** `str` — The booking's id.
@@ -21472,7 +21469,7 @@ client.scheduling.event_types.create(
-**approval_ttl_minutes:** `typing.Optional[int]` — How long a booking can wait for approval before it's declined, in minutes. Default: 1440. +**reason:** `typing.Optional[str]` — Why it's being cancelled. Only retrieving this booking returns it: it's never in webhooks, logs or emails.
@@ -21480,47 +21477,72 @@ client.scheduling.event_types.create(
-**hold_ttl_seconds:** `typing.Optional[int]` — How long a hold keeps its slot, in seconds. Default: 600. +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
-
-
-**cancel_notice_minutes:** `typing.Optional[int]` — Attendees can't cancel closer to the start than this. API keys can. -
+
+
client.scheduling.bookings.events(...) -> SchedulingBookingEventList
-**reschedule_notice_minutes:** `typing.Optional[int]` — Attendees can't reschedule closer to the start than this. API keys can. Default: 0. - -
-
+#### 📝 Description
-**max_guests:** `typing.Optional[int]` — How many people an attendee can add to a booking. Default: 0. Guests are emailed about it. Not on `group`. - +
+
+ +What's happened to a booking, oldest first, and who did it. There's no personal data in here. +
+
+#### 🔌 Usage +
-**max_active_bookings_per_attendee:** `typing.Optional[int]` — How many upcoming bookings of this event type one person can have at a time, known by `uid` or email. Default: `null`, no limit. Past this, booking answers `attendee_limit_reached`. Guests don't count, and each occurrence of a series does. - +
+
+ +```python +from coss import Coss +from coss.environment import CossEnvironment + +client = Coss( + api_key="", + environment=CossEnvironment.DEFAULT, +) + +client.scheduling.bookings.events( + id="book_01kd2m9a0b1c2d3e4f5g6h7j8m", +) + +``` +
+
+#### ⚙️ Parameters +
-**host_calendar_details:** `typing.Optional[CreateEventTypeRequestHostCalendarDetails]` — What hosts' calendars say about a booking. `neutral` (the default): a private event titled "Appointment". `full`: a private event with this title and the attendee's name, plus names, emails and phone numbers in its description, which go to the host's calendar provider. Never answers. Refused in HIPAA mode. +
+
+ +**id:** `str` — The booking's id.
@@ -21528,7 +21550,7 @@ client.scheduling.event_types.create(
-**questions:** `typing.Optional[typing.List[SchedulingQuestion]]` — What attendees are asked when booking. Keys must be unique. +**limit:** `typing.Optional[int]`
@@ -21536,7 +21558,7 @@ client.scheduling.event_types.create(
-**locations:** `typing.Optional[typing.List[SchedulingLocation]]` — Where bookings can meet. A browser only chooses among these. A `group` event type can't use `zoom`. +**after:** `typing.Optional[str]` — The last id of the previous page.
@@ -21544,23 +21566,2831 @@ client.scheduling.event_types.create(
-**host_filter:** `typing.Optional[typing.Dict[str, typing.Optional[CreateEventTypeRequestHostFilterValue]]]` — Pool members also include active hosts matching all of these attributes. +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+ + + + +
+ +
client.scheduling.bookings.approve(...) -> SchedulingBooking +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Confirms a `pending_approval` booking. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from coss import Coss +from coss.environment import CossEnvironment + +client = Coss( + api_key="", + environment=CossEnvironment.DEFAULT, +) + +client.scheduling.bookings.approve( + id="book_01kd2m9a0b1c2d3e4f5g6h7j8m", +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `str` — The booking's id. + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.scheduling.bookings.decline(...) -> SchedulingBooking +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Refuses a `pending_approval` booking and frees the time. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from coss import Coss +from coss.environment import CossEnvironment + +client = Coss( + api_key="", + environment=CossEnvironment.DEFAULT, +) + +client.scheduling.bookings.decline( + id="book_01kd2m9a0b1c2d3e4f5g6h7j8m", +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `str` — The booking's id. + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.scheduling.bookings.notifications(...) -> SchedulingBookingNotificationList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +What's been queued for this booking and what became of it, newest first, including why something wasn't sent. It never says who it went to. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from coss import Coss +from coss.environment import CossEnvironment + +client = Coss( + api_key="", + environment=CossEnvironment.DEFAULT, +) + +client.scheduling.bookings.notifications( + id="book_01kd2m9a0b1c2d3e4f5g6h7j8m", +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `str` — The booking's id. + +
+
+ +
+
+ +**limit:** `typing.Optional[int]` + +
+
+ +
+
+ +**after:** `typing.Optional[str]` — The last id of the previous page. + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.scheduling.bookings.mark_no_show(...) -> SchedulingBooking +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Records that the attendee didn't come, once the booking has started. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from coss import Coss +from coss.environment import CossEnvironment + +client = Coss( + api_key="", + environment=CossEnvironment.DEFAULT, +) + +client.scheduling.bookings.mark_no_show( + id="book_01kd2m9a0b1c2d3e4f5g6h7j8m", +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `str` — The booking's id. + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.scheduling.bookings.update_location(...) -> SchedulingBooking +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Where it happens, such as the meeting link you made after the `scheduling.booking.confirmed` webhook. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from coss import Coss, SchedulingLocationZero +from coss.environment import CossEnvironment + +client = Coss( + api_key="", + environment=CossEnvironment.DEFAULT, +) + +client.scheduling.bookings.update_location( + id="book_01kd2m9a0b1c2d3e4f5g6h7j8m", + location=SchedulingLocationZero( + type="link", + url="https://meet.example.com/abc", + ), +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `str` — The booking's id. + +
+
+ +
+
+ +**location:** `typing.Optional[SchedulingLocation]` + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +## Scheduling Reassignments +
client.scheduling.reassignments.preview(...) -> SchedulingReassignmentPreview +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Who each booking would go to, and why not when nobody can take it, without moving anything. It works down them in order, so two can't both be promised the same free hour. Change any of it and start the run with `assignments`. Covers the first 500. Things can change before you start it: the run decides again. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from coss import Coss, SchedulingReassignmentSelection, SchedulingReassignmentStrategy +from coss.environment import CossEnvironment + +client = Coss( + api_key="", + environment=CossEnvironment.DEFAULT, +) + +client.scheduling.reassignments.preview( + selection=SchedulingReassignmentSelection( + host="doctor_482", + start_before="2027-08-14T00:00:00.000Z", + ), + strategy=SchedulingReassignmentStrategy( + preferred_hosts=[ + "doctor_518" + ], + ), +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**selection:** `SchedulingReassignmentSelection` + +
+
+ +
+
+ +**strategy:** `typing.Optional[SchedulingReassignmentStrategy]` + +
+
+ +
+
+ +**overrides:** `typing.Optional[typing.List[PreviewSchedulingReassignmentRequestOverridesItem]]` + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.scheduling.reassignments.list(...) -> SchedulingReassignmentList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Newest first, with how each is going. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from coss import Coss +from coss.environment import CossEnvironment + +client = Coss( + api_key="", + environment=CossEnvironment.DEFAULT, +) + +client.scheduling.reassignments.list() + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**limit:** `typing.Optional[int]` + +
+
+ +
+
+ +**after:** `typing.Optional[str]` — The last id of the previous page. + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.scheduling.reassignments.create(...) -> SchedulingReassignment +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Moves up to 5,000 bookings in the background, each on its own, so one that can't move never holds up the rest. Nothing's ever cancelled: a booking nobody can take stays where it is, and its item says so. It answers at once: follow the run by its id, or wait for `scheduling.reassignment.completed`. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from coss import Coss, SchedulingReassignmentSelection, SchedulingReassignmentStrategy +from coss.environment import CossEnvironment + +client = Coss( + api_key="", + environment=CossEnvironment.DEFAULT, +) + +client.scheduling.reassignments.create( + idempotency_key="welcome-user-123", + selection=SchedulingReassignmentSelection( + out_of_office="ooo_01kd2m9a0b1c2d3e4f5g6h7j8m", + ), + strategy=SchedulingReassignmentStrategy( + preferred_hosts=[ + "doctor_518" + ], + ), + reason_code="out_of_office", +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**selection:** `SchedulingReassignmentSelection` + +
+
+ +
+
+ +**reason_code:** `CreateSchedulingReassignmentRequestReasonCode` + +
+
+ +
+
+ +**idempotency_key:** `typing.Optional[str]` — Makes retries safe: a repeated request with the same key and body returns the original run instead of starting another, for 24 hours. 1-256 characters. + +
+
+ +
+
+ +**strategy:** `typing.Optional[SchedulingReassignmentStrategy]` + +
+
+ +
+
+ +**note:** `typing.Optional[str]` — Why, in your words: required with an override of someone's availability. + +
+
+ +
+
+ +**overrides:** `typing.Optional[typing.List[CreateSchedulingReassignmentRequestOverridesItem]]` + +
+
+ +
+
+ +**notify:** `typing.Optional[CreateSchedulingReassignmentRequestNotify]` + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.scheduling.reassignments.get(...) -> SchedulingReassignment +
+
+ +#### 📝 Description + +
+
+ +
+
+ +How it's going. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from coss import Coss +from coss.environment import CossEnvironment + +client = Coss( + api_key="", + environment=CossEnvironment.DEFAULT, +) + +client.scheduling.reassignments.get( + id="id", +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `str` — The reassignment's id. + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.scheduling.reassignments.items(...) -> SchedulingReassignmentItemList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Each booking it covers and what happened to it. A group session has one, for one of its seats. Empty until the worker's started on it. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from coss import Coss +from coss.environment import CossEnvironment + +client = Coss( + api_key="", + environment=CossEnvironment.DEFAULT, +) + +client.scheduling.reassignments.items( + id="id", +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `str` — The reassignment's id. + +
+
+ +
+
+ +**limit:** `typing.Optional[int]` + +
+
+ +
+
+ +**after:** `typing.Optional[str]` — The last id of the previous page. + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.scheduling.reassignments.cancel(...) -> SchedulingReassignment +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Stops what hasn't happened yet. What's moved stays moved: undo it for that. Cancelling one that's finished changes nothing. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from coss import Coss +from coss.environment import CossEnvironment + +client = Coss( + api_key="", + environment=CossEnvironment.DEFAULT, +) + +client.scheduling.reassignments.cancel( + id="id", +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `str` — The reassignment's id. + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.scheduling.reassignments.undo(...) -> SchedulingReassignment +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Gives back what a finished run moved, as a new run. A booking that's moved on since stays where it went, and a former host who's no longer free keeps it from going back, unless you pass `overrides`. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from coss import Coss +from coss.environment import CossEnvironment + +client = Coss( + api_key="", + environment=CossEnvironment.DEFAULT, +) + +client.scheduling.reassignments.undo( + id="id", + reason_code="other", +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `str` — The reassignment's id. + +
+
+ +
+
+ +**reason_code:** `typing.Optional[UndoSchedulingReassignmentRequestReasonCode]` + +
+
+ +
+
+ +**note:** `typing.Optional[str]` + +
+
+ +
+
+ +**overrides:** `typing.Optional[typing.List[UndoSchedulingReassignmentRequestOverridesItem]]` + +
+
+ +
+
+ +**notify:** `typing.Optional[UndoSchedulingReassignmentRequestNotify]` + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +## Scheduling HolidayCalendars +
client.scheduling.holiday_calendars.list() -> SchedulingHolidayCalendarList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +By name. A feed's URL is never shown again. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from coss import Coss +from coss.environment import CossEnvironment + +client = Coss( + api_key="", + environment=CossEnvironment.DEFAULT, +) + +client.scheduling.holiday_calendars.list() + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.scheduling.holiday_calendars.create(...) -> SchedulingHolidayCalendar +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Applies a country's public holidays, or your own feed, to some hosts as ordinary out of office entries, kept up to date by coss.com. A host who removes one keeps it removed. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from coss import Coss +from coss.environment import CossEnvironment + +client = Coss( + api_key="", + environment=CossEnvironment.DEFAULT, +) + +client.scheduling.holiday_calendars.create( + name="UK team", + country="GB", + host_filter={ + "team": "london" + }, +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**name:** `str` + +
+
+ +
+
+ +**country:** `typing.Optional[str]` — A code from the list of holiday calendars, such as `GB`. + +
+
+ +
+
+ +**ics_url:** `typing.Optional[str]` — Your own feed, https or webcal, read in live environments. Stored encrypted. + +
+
+ +
+
+ +**hosts:** `typing.Optional[typing.List[str]]` — These hosts, by id or uid. + +
+
+ +
+
+ +**host_filter:** `typing.Optional[typing.Dict[str, CreateSchedulingHolidayCalendarRequestHostFilterValue]]` — Everyone matching these attributes, asked again at every sync. + +
+
+ +
+
+ +**regions:** `typing.Optional[typing.List[str]]` — Which regional holidays apply, matched against how the calendar names them, such as `England`. Without this, all of them do; empty, only nationwide ones. + +
+
+ +
+
+ +**delegates:** `typing.Optional[typing.List[str]]` — Who can be booked in their place on those days, by id or uid, in order. + +
+
+ +
+
+ +**existing_bookings:** `typing.Optional[CreateSchedulingHolidayCalendarRequestExistingBookings]` — What happens to bookings already on a holiday. `leave` (the default) only reports them. `reassign` moves them. + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.scheduling.holiday_calendars.get(...) -> SchedulingHolidayCalendar +
+
+ +#### 📝 Description + +
+
+ +
+
+ +With when it was last read, and why not if it couldn't be. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from coss import Coss +from coss.environment import CossEnvironment + +client = Coss( + api_key="", + environment=CossEnvironment.DEFAULT, +) + +client.scheduling.holiday_calendars.get( + id="id", +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `str` — The holiday calendar's id. + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.scheduling.holiday_calendars.remove(...) -> DeletedSchedulingHolidayCalendar +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Hosts can be booked on its days again, shortly: past entries stay. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from coss import Coss +from coss.environment import CossEnvironment + +client = Coss( + api_key="", + environment=CossEnvironment.DEFAULT, +) + +client.scheduling.holiday_calendars.remove( + id="id", +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `str` — The holiday calendar's id. + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.scheduling.holiday_calendars.update(...) -> SchedulingHolidayCalendar +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Who it applies to, who covers and what happens to bookings. Takes effect shortly. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from coss import Coss +from coss.environment import CossEnvironment + +client = Coss( + api_key="", + environment=CossEnvironment.DEFAULT, +) + +client.scheduling.holiday_calendars.update( + id="id", + host_filter={ + "team": "london" + }, +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `str` — The holiday calendar's id. + +
+
+ +
+
+ +**name:** `typing.Optional[str]` + +
+
+ +
+
+ +**hosts:** `typing.Optional[typing.List[str]]` — These hosts, by id or uid. + +
+
+ +
+
+ +**host_filter:** `typing.Optional[typing.Dict[str, UpdateSchedulingHolidayCalendarRequestHostFilterValue]]` — Everyone matching these attributes, asked again at every sync. + +
+
+ +
+
+ +**regions:** `typing.Optional[typing.List[str]]` — Which regional holidays apply, matched against how the calendar names them, such as `England`. Without this, all of them do; empty, only nationwide ones. + +
+
+ +
+
+ +**delegates:** `typing.Optional[typing.List[str]]` — Who can be booked in their place on those days, by id or uid, in order. + +
+
+ +
+
+ +**existing_bookings:** `typing.Optional[UpdateSchedulingHolidayCalendarRequestExistingBookings]` — What happens to bookings already on a holiday. `leave` (the default) only reports them. `reassign` moves them. + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.scheduling.holiday_calendars.holidays(...) -> SchedulingHolidayList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +What's coming, with names, as last read. Empty until its first read. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from coss import Coss +from coss.environment import CossEnvironment + +client = Coss( + api_key="", + environment=CossEnvironment.DEFAULT, +) + +client.scheduling.holiday_calendars.holidays( + id="id", +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `str` — The holiday calendar's id. + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +## Scheduling OutOfOffice +
client.scheduling.out_of_office.list(...) -> SchedulingOutOfOfficeList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +The environment's entries, newest first. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from coss import Coss +from coss.environment import CossEnvironment + +client = Coss( + api_key="", + environment=CossEnvironment.DEFAULT, +) + +client.scheduling.out_of_office.list( + start_after="2027-01-04T15:00:00.000Z", + start_before="2027-01-04T15:00:00.000Z", +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**limit:** `typing.Optional[int]` + +
+
+ +
+
+ +**after:** `typing.Optional[str]` — The last id of the previous page. + +
+
+ +
+
+ +**host:** `typing.Optional[str]` — One host's entries, by id or uid. + +
+
+ +
+
+ +**start_after:** `typing.Optional[str]` — Entries ending after this. + +
+
+ +
+
+ +**start_before:** `typing.Optional[str]` — Entries starting before this. + +
+
+ +
+
+ +**group:** `typing.Optional[str]` — The entries one request made. + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.scheduling.out_of_office.create(...) -> SchedulingOutOfOfficeList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Marks one host, a list of hosts or everyone matching some attributes as away, for part of a day or for whole dates. They aren't offered during it. Existing bookings stay as they are: list them with the entry's conflicts. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from coss import Coss +from coss.environment import CossEnvironment + +client = Coss( + api_key="", + environment=CossEnvironment.DEFAULT, +) + +client.scheduling.out_of_office.create( + host="doctor_482", + start_date="2027-08-02", + end_date="2027-08-13", + reason="vacation", + public_message="Back on the 16th.", +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**host:** `typing.Optional[str]` — One host, by id or uid. + +
+
+ +
+
+ +**hosts:** `typing.Optional[typing.List[str]]` — Several hosts, by id or uid. Each gets an entry of their own. + +
+
+ +
+
+ +**host_filter:** `typing.Optional[typing.Dict[str, CreateSchedulingOutOfOfficeRequestHostFilterValue]]` — Every active host matching these attributes right now. A host added later isn't covered. + +
+
+ +
+
+ +**start:** `typing.Optional[str]` — An ISO 8601 instant with an offset. + +
+
+ +
+
+ +**end:** `typing.Optional[str]` — An ISO 8601 instant with an offset. + +
+
+ +
+
+ +**start_date:** `typing.Optional[str]` — The first whole day away. Use instead of `start` and `end`. + +
+
+ +
+
+ +**end_date:** `typing.Optional[str]` — The last whole day away, which is included. + +
+
+ +
+
+ +**time_zone:** `typing.Optional[str]` — What the dates mean in. Default: the host's zone when this is made. + +
+
+ +
+
+ +**delegates:** `typing.Optional[typing.List[str]]` — Who can be booked in this host's place during it, by id or uid, in the order to try them. They still have to fit how a booking's routed. + +
+
+ +
+
+ +**reason:** `typing.Optional[str]` — One of `unspecified`, `vacation`, `travel`, `sick`, `public_holiday`, `parental_leave`, `training` and `other`, or a key from the settings' `out_of_office_reasons`. Only people who manage this host see it: never bookers, webhooks or calendars. + +
+
+ +
+
+ +**notes:** `typing.Optional[str]` — For people who manage this host. Encrypted, and never shown to a booker. + +
+
+ +
+
+ +**public_message:** `typing.Optional[str]` — Shown to bookers while this host is away. Can't contain a link. + +
+
+ +
+
+ +**show_on_calendar:** `typing.Optional[bool]` — Put a private "Out of office" event on the host's calendar. Default: true. + +
+
+ +
+
+ +**existing_bookings:** `typing.Optional[CreateSchedulingOutOfOfficeRequestExistingBookings]` — What happens to bookings already in the way. `leave` (the default) only reports them. `reassign` moves them, and any nobody can take stay where they are. + +
+
+ +
+
+ +**reassign:** `typing.Optional[CreateSchedulingOutOfOfficeRequestReassign]` — With `existing_bookings: reassign`: who they go to. Default: the fairest who's free. + +
+
+ +
+
+ +**external_id:** `typing.Optional[str]` — Your own id for this entry, unique in the environment. Needs one host. + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.scheduling.out_of_office.get(...) -> SchedulingOutOfOffice +
+
+ +#### 📝 Description + +
+
+ +
+
+ +One entry. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from coss import Coss +from coss.environment import CossEnvironment + +client = Coss( + api_key="", + environment=CossEnvironment.DEFAULT, +) + +client.scheduling.out_of_office.get( + id="ooo_01kd2m9a0b1c2d3e4f5g6h7j8m", +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `str` — The entry's id. + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.scheduling.out_of_office.remove(...) -> DeletedSchedulingOutOfOffice +
+
+ +#### 📝 Description + +
+
+ +
+
+ +The host can be booked in that time again, and any calendar event for it goes. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from coss import Coss +from coss.environment import CossEnvironment + +client = Coss( + api_key="", + environment=CossEnvironment.DEFAULT, +) + +client.scheduling.out_of_office.remove( + id="ooo_01kd2m9a0b1c2d3e4f5g6h7j8m", +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `str` — The entry's id. + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.scheduling.out_of_office.update(...) -> SchedulingOutOfOffice +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Changes what's given. An entry stays with its host. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from coss import Coss +from coss.environment import CossEnvironment + +client = Coss( + api_key="", + environment=CossEnvironment.DEFAULT, +) + +client.scheduling.out_of_office.update( + id="ooo_01kd2m9a0b1c2d3e4f5g6h7j8m", + end_date="2027-08-20", +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `str` — The entry's id. + +
+
+ +
+
+ +**start:** `typing.Optional[str]` — An ISO 8601 instant with an offset. + +
+
+ +
+
+ +**end:** `typing.Optional[str]` — An ISO 8601 instant with an offset. + +
+
+ +
+
+ +**start_date:** `typing.Optional[str]` — The first whole day away. Use instead of `start` and `end`. + +
+
+ +
+
+ +**end_date:** `typing.Optional[str]` — The last whole day away, which is included. + +
+
+ +
+
+ +**time_zone:** `typing.Optional[str]` — What the dates mean in. Default: the host's zone when this is made. + +
+
+ +
+
+ +**reason:** `typing.Optional[str]` — One of `unspecified`, `vacation`, `travel`, `sick`, `public_holiday`, `parental_leave`, `training` and `other`, or a key from the settings' `out_of_office_reasons`. Only people who manage this host see it: never bookers, webhooks or calendars. + +
+
+ +
+
+ +**notes:** `typing.Optional[str]` + +
+
+ +
+
+ +**public_message:** `typing.Optional[str]` + +
+
+ +
+
+ +**show_on_calendar:** `typing.Optional[bool]` + +
+
+ +
+
+ +**delegates:** `typing.Optional[typing.List[str]]` — Who can be booked in this host's place during it, by id or uid, in the order to try them. They still have to fit how a booking's routed. + +
+
+ +
+
+ +**existing_bookings:** `typing.Optional[UpdateSchedulingOutOfOfficeRequestExistingBookings]` — What happens to bookings already in the way. `leave` (the default) only reports them. `reassign` moves them, and any nobody can take stay where they are. + +
+
+ +
+
+ +**reassign:** `typing.Optional[UpdateSchedulingOutOfOfficeRequestReassign]` — With `existing_bookings: reassign`: who they go to. Default: the fairest who's free. + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.scheduling.out_of_office.put(...) -> SchedulingOutOfOffice +
+
+ +#### 📝 Description + +
+
+ +
+
+ +For syncing from a system of record such as an HR tool: send what it says, as often as you like, and there's one entry for it. Give every field you want to keep. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from coss import Coss +from coss.environment import CossEnvironment + +client = Coss( + api_key="", + environment=CossEnvironment.DEFAULT, +) + +client.scheduling.out_of_office.put( + external_id="hr_leave_4471", + host="doctor_482", + start_date="2027-08-02", + end_date="2027-08-13", + reason="vacation", +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**external_id:** `str` — Your own id for the entry. + +
+
+ +
+
+ +**host:** `str` — The host, by id or uid. + +
+
+ +
+
+ +**start:** `typing.Optional[str]` — An ISO 8601 instant with an offset. + +
+
+ +
+
+ +**end:** `typing.Optional[str]` — An ISO 8601 instant with an offset. + +
+
+ +
+
+ +**start_date:** `typing.Optional[str]` — The first whole day away. Use instead of `start` and `end`. + +
+
+ +
+
+ +**end_date:** `typing.Optional[str]` — The last whole day away, which is included. + +
+
+ +
+
+ +**time_zone:** `typing.Optional[str]` — What the dates mean in. Default: the host's zone when this is made. + +
+
+ +
+
+ +**delegates:** `typing.Optional[typing.List[str]]` — Who can be booked in this host's place during it, by id or uid, in the order to try them. They still have to fit how a booking's routed. + +
+
+ +
+
+ +**reason:** `typing.Optional[str]` — One of `unspecified`, `vacation`, `travel`, `sick`, `public_holiday`, `parental_leave`, `training` and `other`, or a key from the settings' `out_of_office_reasons`. Only people who manage this host see it: never bookers, webhooks or calendars. + +
+
+ +
+
+ +**notes:** `typing.Optional[str]` — For people who manage this host. Encrypted, and never shown to a booker. + +
+
+ +
+
+ +**public_message:** `typing.Optional[str]` — Shown to bookers while this host is away. Can't contain a link. + +
+
+ +
+
+ +**show_on_calendar:** `typing.Optional[bool]` — Put a private "Out of office" event on the host's calendar. Default: true. + +
+
+ +
+
+ +**existing_bookings:** `typing.Optional[PutSchedulingOutOfOfficeRequestExistingBookings]` — What happens to bookings already in the way. `leave` (the default) only reports them. `reassign` moves them, and any nobody can take stay where they are. + +
+
+ +
+
+ +**reassign:** `typing.Optional[PutSchedulingOutOfOfficeRequestReassign]` — With `existing_bookings: reassign`: who they go to. Default: the fairest who's free. + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.scheduling.out_of_office.conflicts(...) -> SchedulingOutOfOfficeConflictList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Live bookings of the host that fall in the entry, soonest first. Entries never change them. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from coss import Coss +from coss.environment import CossEnvironment + +client = Coss( + api_key="", + environment=CossEnvironment.DEFAULT, +) + +client.scheduling.out_of_office.conflicts( + id="ooo_01kd2m9a0b1c2d3e4f5g6h7j8m", +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `str` — The entry's id. + +
+
+ +
+
+ +**limit:** `typing.Optional[int]` + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +## Scheduling Schedules +
client.scheduling.schedules.list(...) -> SchedulingScheduleList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +All of the host's schedules, oldest first. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from coss import Coss +from coss.environment import CossEnvironment + +client = Coss( + api_key="", + environment=CossEnvironment.DEFAULT, +) + +client.scheduling.schedules.list( + host="host_01kd2m9a0b1c2d3e4f5g6h7j8m", +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**host:** `str` — The host's id or uid. + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.scheduling.schedules.create(...) -> SchedulingSchedule +
+
+ +#### 📝 Description + +
+
+ +
+
+ +A host's weekly hours and date overrides, in local time. The first one is the host's default. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from coss import Coss, SchedulingWeeklyRule, SchedulingScheduleOverride, SchedulingScheduleOverrideRangesItem +from coss.environment import CossEnvironment + +client = Coss( + api_key="", + environment=CossEnvironment.DEFAULT, +) + +client.scheduling.schedules.create( + host="host_01kd2m9a0b1c2d3e4f5g6h7j8m", + name="Clinic hours", + rules=[ + SchedulingWeeklyRule( + days=[ + 1, + 2, + 3, + 4, + 5 + ], + start="09:00", + end="17:00", + ) + ], + overrides=[ + SchedulingScheduleOverride( + date="2027-12-24", + ranges=[ + SchedulingScheduleOverrideRangesItem( + start="start", + end="end", + ) + ], + ) + ], +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**host:** `str` — The host's id or uid. + +
+
+ +
+
+ +**request:** `UpsertScheduleRequest` + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.scheduling.schedules.get(...) -> SchedulingSchedule +
+
+ +#### 📝 Description + +
+
+ +
+
+ +One of the host's schedules. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from coss import Coss +from coss.environment import CossEnvironment + +client = Coss( + api_key="", + environment=CossEnvironment.DEFAULT, +) + +client.scheduling.schedules.get( + host="host_01kd2m9a0b1c2d3e4f5g6h7j8m", + schedule_id="sched_01kd2m9a0b1c2d3e4f5g6h7j8m", +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**host:** `str` — The host's id or uid. + +
+
+ +
+
+ +**schedule_id:** `str` — The schedule's id. + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.scheduling.schedules.update(...) -> SchedulingSchedule +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Replaces its weekly rules, and its overrides when given. Existing bookings stay: a schedule only decides what's offered next. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from coss import Coss, SchedulingWeeklyRule, SchedulingScheduleOverride, SchedulingScheduleOverrideRangesItem +from coss.environment import CossEnvironment + +client = Coss( + api_key="", + environment=CossEnvironment.DEFAULT, +) + +client.scheduling.schedules.update( + host="host_01kd2m9a0b1c2d3e4f5g6h7j8m", + schedule_id="sched_01kd2m9a0b1c2d3e4f5g6h7j8m", + name="Clinic hours", + rules=[ + SchedulingWeeklyRule( + days=[ + 1, + 2, + 3, + 4, + 5 + ], + start="09:00", + end="17:00", + ) + ], + overrides=[ + SchedulingScheduleOverride( + date="2027-12-24", + ranges=[ + SchedulingScheduleOverrideRangesItem( + start="start", + end="end", + ) + ], + ) + ], +) + +``` +
+
+
+
+ +#### ⚙️ Parameters
-**notifications:** `typing.Optional[typing.Dict[str, typing.Optional[CreateEventTypeRequestNotificationsValue]]]` — Per event, overriding your settings for this event type. - -
-
-
-**reminders:** `typing.Optional[typing.List[SchedulingReminderInput]]` — Replaces your settings' `reminders` for this event type. `null` inherits them; an empty list means none. +**host:** `str` — The host's id or uid.
@@ -21568,7 +24398,7 @@ client.scheduling.event_types.create(
-**metadata:** `typing.Optional[typing.Dict[str, str]]` — Your own key-value pairs. +**schedule_id:** `str` — The schedule's id.
@@ -21576,7 +24406,7 @@ client.scheduling.event_types.create(
-**hosts:** `typing.Optional[typing.List[SchedulingEventTypeHostInput]]` — Who can be booked. `one_on_one` and `group` take one; `collective` needs at least one `required` host. +**request:** `UpsertScheduleRequest`
@@ -21596,7 +24426,7 @@ client.scheduling.event_types.create(
-
client.scheduling.event_types.get(...) -> SchedulingEventType +
client.scheduling.schedules.remove(...) -> DeletedSchedulingSchedule
@@ -21608,7 +24438,7 @@ client.scheduling.event_types.create(
-An event type by its id or your uid. +Refused for the host's default schedule.
@@ -21631,8 +24461,9 @@ client = Coss( environment=CossEnvironment.DEFAULT, ) -client.scheduling.event_types.get( - event_type="evtype_01kd2m9a0b1c2d3e4f5g6h7j8m", +client.scheduling.schedules.remove( + host="host_01kd2m9a0b1c2d3e4f5g6h7j8m", + schedule_id="sched_01kd2m9a0b1c2d3e4f5g6h7j8m", ) ``` @@ -21649,7 +24480,15 @@ client.scheduling.event_types.get(
-**event_type:** `str` — The event type's id or uid. +**host:** `str` — The host's id or uid. + +
+
+ +
+
+ +**schedule_id:** `str` — The schedule's id.
@@ -21669,7 +24508,8 @@ client.scheduling.event_types.get(
-
client.scheduling.event_types.update(...) -> SchedulingEventType +## Scheduling EventTypes +
client.scheduling.event_types.list(...) -> SchedulingEventTypeList
@@ -21681,7 +24521,7 @@ client.scheduling.event_types.get(
-Changes what's given. Existing bookings keep what they were booked with. Set `status` to `archived` to stop new bookings. +The environment's event types, newest first.
@@ -21704,10 +24544,7 @@ client = Coss( environment=CossEnvironment.DEFAULT, ) -client.scheduling.event_types.update( - event_type="evtype_01kd2m9a0b1c2d3e4f5g6h7j8m", - min_notice_minutes=240, -) +client.scheduling.event_types.list() ``` @@ -21723,7 +24560,7 @@ client.scheduling.event_types.update(
-**event_type:** `str` — The event type's id or uid. +**limit:** `typing.Optional[int]`
@@ -21731,7 +24568,7 @@ client.scheduling.event_types.update(
-**uid:** `typing.Optional[str]` — Your own id for this event type. `null` removes it. +**after:** `typing.Optional[str]` — The last id of the previous page.
@@ -21739,71 +24576,81 @@ client.scheduling.event_types.update(
-**description:** `typing.Optional[str]` — Plain text about the event type, shown on hosted booking pages and never in emails. Links, and anything shaped like a domain, must be on your organization's verified domains or their subdomains, and use `https`. `null` removes it. +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+ +
-
-
-**title:** `typing.Optional[str]` — Shown to attendees and in emails. Host calendars show it only with `host_calendar_details: full`. -
+
+
client.scheduling.event_types.create(...) -> SchedulingEventType
-**duration_minutes:** `typing.Optional[int]` — How long a booking lasts by default, in minutes. - -
-
+#### 📝 Description
-**duration_options:** `typing.Optional[typing.List[int]]` — Other lengths an attendee may choose, in minutes. Empty: only `duration_minutes`. - -
-
-
-**step_minutes:** `typing.Optional[int]` — How far apart slots start. Default: the duration. - +What can be booked: `one_on_one` with one host, `pool` for any free host, `collective` when every required host must be free, or `group` for a session with seats.
+ + + +#### 🔌 Usage
-**grid_time_zone:** `typing.Optional[str]` — The zone slots align in. Default: each host's own. - -
-
-
-**buffer_before_minutes:** `typing.Optional[int]` — Minutes kept free before each booking. Default: 0. - +```python +from coss import Coss, SchedulingEventTypeHostInput +from coss.environment import CossEnvironment + +client = Coss( + api_key="", + environment=CossEnvironment.DEFAULT, +) + +client.scheduling.event_types.create( + kind="one_on_one", + title="Initial consultation", + duration_minutes=30, + buffer_after_minutes=10, + min_notice_minutes=120, + hosts=[ + SchedulingEventTypeHostInput( + host="doctor_482", + ) + ], +) + +``` +
+
+#### ⚙️ Parameters +
-**buffer_after_minutes:** `typing.Optional[int]` — Minutes kept free after each booking. Default: 0. - -
-
-
-**min_notice_minutes:** `typing.Optional[int]` — Slots starting sooner than this many minutes from now aren't offered. Default: 0. +**title:** `str` — Shown to attendees and in emails. Host calendars show it only with `host_calendar_details: full`.
@@ -21811,7 +24658,7 @@ client.scheduling.event_types.update(
-**booking_window:** `typing.Optional[SchedulingBookingWindow]` +**duration_minutes:** `int` — How long a booking lasts by default, in minutes.
@@ -21819,7 +24666,7 @@ client.scheduling.event_types.update(
-**limits:** `typing.Optional[typing.List[SchedulingLimit]]` — Caps on bookings per day or week. Default: none. +**uid:** `typing.Optional[str]` — Your own id for this event type, unique in the environment, accepted wherever its id is.
@@ -21827,7 +24674,7 @@ client.scheduling.event_types.update(
-**capacity:** `typing.Optional[int]` — Attendees per session. Required for, and only allowed on, `group`. +**kind:** `typing.Optional[CreateEventTypeRequestKind]` — Who a booking needs. `one_on_one`: one host. `pool`: any one of its hosts. `collective`: every `required` host, plus at most one `member`. `group`: one host, with attendees taking seats up to `capacity`. Fixed once created.
@@ -21835,7 +24682,7 @@ client.scheduling.event_types.update(
-**requires_approval:** `typing.Optional[bool]` — Bookings start as `pending_approval`, holding the time until approved or declined. Default: `false`. +**description:** `typing.Optional[str]` — Plain text about the event type, shown on hosted booking pages and never in emails. Links, and anything shaped like a domain, must be on your organization's verified domains or their subdomains, and use `https`. `null` removes it.
@@ -21843,7 +24690,7 @@ client.scheduling.event_types.update(
-**approval_ttl_minutes:** `typing.Optional[int]` — How long a booking can wait for approval before it's declined, in minutes. Default: 1440. +**duration_options:** `typing.Optional[typing.List[int]]` — Other lengths an attendee may choose, in minutes. Empty: only `duration_minutes`.
@@ -21851,7 +24698,7 @@ client.scheduling.event_types.update(
-**hold_ttl_seconds:** `typing.Optional[int]` — How long a hold keeps its slot, in seconds. Default: 600. +**step_minutes:** `typing.Optional[int]` — How far apart slots start. Default: the duration.
@@ -21859,7 +24706,7 @@ client.scheduling.event_types.update(
-**cancel_notice_minutes:** `typing.Optional[int]` — Attendees can't cancel closer to the start than this. API keys can. +**grid_time_zone:** `typing.Optional[str]` — The zone slots align in. Default: each host's own.
@@ -21867,7 +24714,7 @@ client.scheduling.event_types.update(
-**reschedule_notice_minutes:** `typing.Optional[int]` — Attendees can't reschedule closer to the start than this. API keys can. Default: 0. +**buffer_before_minutes:** `typing.Optional[int]` — Minutes kept free before each booking. Default: 0.
@@ -21875,7 +24722,7 @@ client.scheduling.event_types.update(
-**max_guests:** `typing.Optional[int]` — How many people an attendee can add to a booking. Default: 0. Guests are emailed about it. Not on `group`. +**buffer_after_minutes:** `typing.Optional[int]` — Minutes kept free after each booking. Default: 0.
@@ -21883,7 +24730,7 @@ client.scheduling.event_types.update(
-**max_active_bookings_per_attendee:** `typing.Optional[int]` — How many upcoming bookings of this event type one person can have at a time, known by `uid` or email. Default: `null`, no limit. Past this, booking answers `attendee_limit_reached`. Guests don't count, and each occurrence of a series does. +**min_notice_minutes:** `typing.Optional[int]` — Slots starting sooner than this many minutes from now aren't offered. Default: 0.
@@ -21891,7 +24738,7 @@ client.scheduling.event_types.update(
-**host_calendar_details:** `typing.Optional[UpdateEventTypeRequestHostCalendarDetails]` — What hosts' calendars say about a booking. `neutral` (the default): a private event titled "Appointment". `full`: a private event with this title and the attendee's name, plus names, emails and phone numbers in its description, which go to the host's calendar provider. Never answers. Refused in HIPAA mode. +**booking_window:** `typing.Optional[SchedulingBookingWindow]`
@@ -21899,7 +24746,7 @@ client.scheduling.event_types.update(
-**questions:** `typing.Optional[typing.List[SchedulingQuestion]]` — What attendees are asked when booking. Keys must be unique. +**limits:** `typing.Optional[typing.List[SchedulingLimit]]` — Caps on bookings per day or week. Default: none.
@@ -21907,7 +24754,7 @@ client.scheduling.event_types.update(
-**locations:** `typing.Optional[typing.List[SchedulingLocation]]` — Where bookings can meet. A browser only chooses among these. A `group` event type can't use `zoom`. +**capacity:** `typing.Optional[int]` — Attendees per session. Required for, and only allowed on, `group`.
@@ -21915,7 +24762,7 @@ client.scheduling.event_types.update(
-**host_filter:** `typing.Optional[typing.Dict[str, typing.Optional[UpdateEventTypeRequestHostFilterValue]]]` — Pool members also include active hosts matching all of these attributes. +**requires_approval:** `typing.Optional[bool]` — Bookings start as `pending_approval`, holding the time until approved or declined. Default: `false`.
@@ -21923,7 +24770,7 @@ client.scheduling.event_types.update(
-**notifications:** `typing.Optional[typing.Dict[str, typing.Optional[UpdateEventTypeRequestNotificationsValue]]]` — Per event, overriding your settings for this event type. +**reassignment_enabled:** `typing.Optional[bool]` — Whether bookings of this event type can go to another host. Default: true.
@@ -21931,7 +24778,7 @@ client.scheduling.event_types.update(
-**reminders:** `typing.Optional[typing.List[SchedulingReminderInput]]` — Replaces your settings' `reminders` for this event type. `null` inherits them; an empty list means none. +**approval_ttl_minutes:** `typing.Optional[int]` — How long a booking can wait for approval before it's declined, in minutes. Default: 1440.
@@ -21939,7 +24786,7 @@ client.scheduling.event_types.update(
-**metadata:** `typing.Optional[typing.Dict[str, str]]` — Your own key-value pairs. +**hold_ttl_seconds:** `typing.Optional[int]` — How long a hold keeps its slot, in seconds. Default: 600.
@@ -21947,7 +24794,7 @@ client.scheduling.event_types.update(
-**status:** `typing.Optional[UpdateEventTypeRequestStatus]` — `archived` stops new bookings, and keeps existing ones. +**cancel_notice_minutes:** `typing.Optional[int]` — Attendees can't cancel closer to the start than this. API keys can.
@@ -21955,7 +24802,7 @@ client.scheduling.event_types.update(
-**hosts:** `typing.Optional[typing.List[SchedulingEventTypeHostInput]]` — Replaces the assigned hosts. Removed hosts keep their existing bookings. +**reschedule_notice_minutes:** `typing.Optional[int]` — Attendees can't reschedule closer to the start than this. API keys can. Default: 0.
@@ -21963,75 +24810,39 @@ client.scheduling.event_types.update(
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. +**max_guests:** `typing.Optional[int]` — How many people an attendee can add to a booking. Default: 0. Guests are emailed about it. Not on `group`.
- - - - - - -
-## Scheduling Slots -
client.scheduling.slots.list(...) -> SchedulingSlotList
-#### 📝 Description - -
-
+**max_active_bookings_per_attendee:** `typing.Optional[int]` — How many upcoming bookings of this event type one person can have at a time, known by `uid` or email. Default: `null`, no limit. Past this, booking answers `attendee_limit_reached`. Guests don't count, and each occurrence of a series does. + +
+
-Starts an attendee can book between `start` and `end` (at most 62 days), as UTC instants to show in their own time zone. A host whose calendar can't be read isn't offered. -
-
+**host_calendar_details:** `typing.Optional[CreateEventTypeRequestHostCalendarDetails]` — What hosts' calendars say about a booking. `neutral` (the default): a private event titled "Appointment". `full`: a private event with this title and the attendee's name, plus names, emails and phone numbers in its description, which go to the host's calendar provider. Never answers. Refused in HIPAA mode. +
-#### 🔌 Usage - -
-
-
-```python -from coss import Coss -from coss.environment import CossEnvironment - -client = Coss( - api_key="", - environment=CossEnvironment.DEFAULT, -) - -client.scheduling.slots.list( - event_type="evtype_01kd2m9a0b1c2d3e4f5g6h7j8m", - start="2027-01-04T15:00:00.000Z", - end="2027-01-04T15:00:00.000Z", -) - -``` -
-
+**questions:** `typing.Optional[typing.List[SchedulingQuestion]]` — What attendees are asked when booking. Keys must be unique. +
-#### ⚙️ Parameters -
-
-
- -**event_type:** `str` — The event type's id or uid. +**locations:** `typing.Optional[typing.List[typing.Optional[SchedulingLocation]]]` — Where bookings can meet. A browser only chooses among these. A `group` event type can't use `zoom`.
@@ -22039,7 +24850,7 @@ client.scheduling.slots.list(
-**start:** `str` — An ISO 8601 instant with an offset. +**host_filter:** `typing.Optional[typing.Dict[str, typing.Optional[CreateEventTypeRequestHostFilterValue]]]` — Pool members also include active hosts matching all of these attributes.
@@ -22047,7 +24858,7 @@ client.scheduling.slots.list(
-**end:** `str` — An ISO 8601 instant with an offset. +**notifications:** `typing.Optional[typing.Dict[str, typing.Optional[CreateEventTypeRequestNotificationsValue]]]` — Per event, overriding your settings for this event type.
@@ -22055,7 +24866,7 @@ client.scheduling.slots.list(
-**host:** `typing.Optional[str]` — Only this host's slots (id or uid). +**reminders:** `typing.Optional[typing.List[SchedulingReminderInput]]` — Replaces your settings' `reminders` for this event type. `null` inherits them; an empty list means none.
@@ -22063,7 +24874,7 @@ client.scheduling.slots.list(
-**duration_minutes:** `typing.Optional[int]` +**metadata:** `typing.Optional[typing.Dict[str, str]]` — Your own key-value pairs.
@@ -22071,7 +24882,7 @@ client.scheduling.slots.list(
-**attributes:** `typing.Optional[str]` — A JSON object narrowing a pool, such as `{"licensed_in":"CA"}`. +**hosts:** `typing.Optional[typing.List[SchedulingEventTypeHostInput]]` — Who can be booked. `one_on_one` and `group` take one; `collective` needs at least one `required` host.
@@ -22091,7 +24902,7 @@ client.scheduling.slots.list(
-
client.scheduling.slots.explain(...) -> SchedulingSlotExplanation +
client.scheduling.event_types.get(...) -> SchedulingEventType
@@ -22103,7 +24914,7 @@ client.scheduling.slots.list(
-Why one start can or can't be booked right now, host by host, decided the same way a booking is. For support and debugging: it says when a host is busy, so don't show it to attendees. +An event type by its id or your uid.
@@ -22126,9 +24937,8 @@ client = Coss( environment=CossEnvironment.DEFAULT, ) -client.scheduling.slots.explain( +client.scheduling.event_types.get( event_type="evtype_01kd2m9a0b1c2d3e4f5g6h7j8m", - start="2027-01-04T15:00:00.000Z", ) ``` @@ -22142,42 +24952,10 @@ client.scheduling.slots.explain(
-
-
- -**event_type:** `str` — The event type's id or uid. - -
-
- -
-
- -**start:** `str` — An ISO 8601 instant with an offset. - -
-
- -
-
- -**host:** `typing.Optional[str]` — Only this host (id or uid). - -
-
- -
-
- -**duration_minutes:** `typing.Optional[int]` - -
-
- -
-
- -**attributes:** `typing.Optional[str]` — A JSON object narrowing a pool, such as `{"licensed_in":"CA"}`. +
+
+ +**event_type:** `str` — The event type's id or uid.
@@ -22197,8 +24975,7 @@ client.scheduling.slots.explain(
-## Scheduling Availability -
client.scheduling.availability.search(...) -> SchedulingAvailabilitySearchResult +
client.scheduling.event_types.update(...) -> SchedulingEventType
@@ -22210,7 +24987,7 @@ client.scheduling.slots.explain(
-For "who's free" pages: each matching host's soonest slots, soonest first, across up to 500 hosts. +Changes what's given. Existing bookings keep what they were booked with. Set `status` to `archived` to stop new bookings.
@@ -22233,13 +25010,9 @@ client = Coss( environment=CossEnvironment.DEFAULT, ) -client.scheduling.availability.search( +client.scheduling.event_types.update( event_type="evtype_01kd2m9a0b1c2d3e4f5g6h7j8m", - start="2027-01-04T00:00:00.000Z", - end="2027-01-18T00:00:00.000Z", - attributes={ - "licensed_in": "CA" - }, + min_notice_minutes=240, ) ``` @@ -22264,7 +25037,7 @@ client.scheduling.availability.search(
-**start:** `str` — An ISO 8601 instant with an offset. +**uid:** `typing.Optional[str]` — Your own id for this event type. `null` removes it.
@@ -22272,7 +25045,7 @@ client.scheduling.availability.search(
-**end:** `str` — An ISO 8601 instant with an offset. +**description:** `typing.Optional[str]` — Plain text about the event type, shown on hosted booking pages and never in emails. Links, and anything shaped like a domain, must be on your organization's verified domains or their subdomains, and use `https`. `null` removes it.
@@ -22280,7 +25053,7 @@ client.scheduling.availability.search(
-**attributes:** `typing.Optional[typing.Dict[str, AvailabilitySearchRequestAttributesValue]]` — Only hosts matching all of these. +**title:** `typing.Optional[str]` — Shown to attendees and in emails. Host calendars show it only with `host_calendar_details: full`.
@@ -22288,7 +25061,7 @@ client.scheduling.availability.search(
-**hosts:** `typing.Optional[typing.List[str]]` — Only these hosts (ids or uids). Default: everyone the event type could offer. +**duration_minutes:** `typing.Optional[int]` — How long a booking lasts by default, in minutes.
@@ -22296,7 +25069,7 @@ client.scheduling.availability.search(
-**slots_per_host:** `typing.Optional[int]` — How many of each host's soonest slots to return. +**duration_options:** `typing.Optional[typing.List[int]]` — Other lengths an attendee may choose, in minutes. Empty: only `duration_minutes`.
@@ -22304,7 +25077,7 @@ client.scheduling.availability.search(
-**limit:** `typing.Optional[int]` — Hosts to return, soonest availability first. +**step_minutes:** `typing.Optional[int]` — How far apart slots start. Default: the duration.
@@ -22312,74 +25085,23 @@ client.scheduling.availability.search(
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. +**grid_time_zone:** `typing.Optional[str]` — The zone slots align in. Default: each host's own.
- -
- - - - -
- -## Scheduling Bookings -
client.scheduling.bookings.list(...) -> SchedulingBookingList -
-
- -#### 📝 Description - -
-
- -
-
- -The environment's bookings, newest first. Answers aren't included. -
-
-
-
- -#### 🔌 Usage
-
-
- -```python -from coss import Coss -from coss.environment import CossEnvironment - -client = Coss( - api_key="", - environment=CossEnvironment.DEFAULT, -) - -client.scheduling.bookings.list( - start_after="2027-01-04T15:00:00.000Z", - start_before="2027-01-04T15:00:00.000Z", -) - -``` -
-
+**buffer_before_minutes:** `typing.Optional[int]` — Minutes kept free before each booking. Default: 0. +
-#### ⚙️ Parameters -
-
-
- -**limit:** `typing.Optional[int]` +**buffer_after_minutes:** `typing.Optional[int]` — Minutes kept free after each booking. Default: 0.
@@ -22387,7 +25109,7 @@ client.scheduling.bookings.list(
-**after:** `typing.Optional[str]` — The last id of the previous page. +**min_notice_minutes:** `typing.Optional[int]` — Slots starting sooner than this many minutes from now aren't offered. Default: 0.
@@ -22395,7 +25117,7 @@ client.scheduling.bookings.list(
-**host:** `typing.Optional[str]` +**booking_window:** `typing.Optional[SchedulingBookingWindow]`
@@ -22403,7 +25125,7 @@ client.scheduling.bookings.list(
-**event_type:** `typing.Optional[str]` +**limits:** `typing.Optional[typing.List[SchedulingLimit]]` — Caps on bookings per day or week. Default: none.
@@ -22411,7 +25133,7 @@ client.scheduling.bookings.list(
-**status:** `typing.Optional[ListBookingsRequestStatus]` +**capacity:** `typing.Optional[int]` — Attendees per session. Required for, and only allowed on, `group`.
@@ -22419,7 +25141,7 @@ client.scheduling.bookings.list(
-**attendee_uid:** `typing.Optional[str]` +**requires_approval:** `typing.Optional[bool]` — Bookings start as `pending_approval`, holding the time until approved or declined. Default: `false`.
@@ -22427,7 +25149,7 @@ client.scheduling.bookings.list(
-**start_after:** `typing.Optional[str]` — An ISO 8601 instant with an offset. +**reassignment_enabled:** `typing.Optional[bool]` — Whether bookings of this event type can go to another host. Default: true.
@@ -22435,7 +25157,7 @@ client.scheduling.bookings.list(
-**start_before:** `typing.Optional[str]` — An ISO 8601 instant with an offset. +**approval_ttl_minutes:** `typing.Optional[int]` — How long a booking can wait for approval before it's declined, in minutes. Default: 1440.
@@ -22443,80 +25165,31 @@ client.scheduling.bookings.list(
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. +**hold_ttl_seconds:** `typing.Optional[int]` — How long a hold keeps its slot, in seconds. Default: 600.
-
-
- - -
-
-
- -
client.scheduling.bookings.create(...) -> SchedulingBooking -
-
- -#### 📝 Description - -
-
-Books a slot, or joins a group session. Without a `host`, a pool chooses fairly among those free. An event type that requires approval answers with a `pending_approval` booking. -
-
+**cancel_notice_minutes:** `typing.Optional[int]` — Attendees can't cancel closer to the start than this. API keys can. +
-#### 🔌 Usage - -
-
-
-```python -from coss import Coss, SchedulingAttendeeInput -from coss.environment import CossEnvironment - -client = Coss( - api_key="", - environment=CossEnvironment.DEFAULT, -) - -client.scheduling.bookings.create( - idempotency_key="welcome-user-123", - event_type="evtype_01kd2m9a0b1c2d3e4f5g6h7j8m", - start="2027-01-04T15:00:00.000Z", - attendee=SchedulingAttendeeInput( - uid="patient_77", - name="Sam Lee", - email="sam@example.com", - time_zone="UTC", - ), -) - -``` -
-
+**reschedule_notice_minutes:** `typing.Optional[int]` — Attendees can't reschedule closer to the start than this. API keys can. Default: 0. +
-#### ⚙️ Parameters - -
-
-
-**event_type:** `str` — The event type's id or uid. +**max_guests:** `typing.Optional[int]` — How many people an attendee can add to a booking. Default: 0. Guests are emailed about it. Not on `group`.
@@ -22524,7 +25197,7 @@ client.scheduling.bookings.create(
-**start:** `str` — An ISO 8601 instant with an offset. +**max_active_bookings_per_attendee:** `typing.Optional[int]` — How many upcoming bookings of this event type one person can have at a time, known by `uid` or email. Default: `null`, no limit. Past this, booking answers `attendee_limit_reached`. Guests don't count, and each occurrence of a series does.
@@ -22532,7 +25205,7 @@ client.scheduling.bookings.create(
-**attendee:** `SchedulingAttendeeInput` +**host_calendar_details:** `typing.Optional[UpdateEventTypeRequestHostCalendarDetails]` — What hosts' calendars say about a booking. `neutral` (the default): a private event titled "Appointment". `full`: a private event with this title and the attendee's name, plus names, emails and phone numbers in its description, which go to the host's calendar provider. Never answers. Refused in HIPAA mode.
@@ -22540,7 +25213,7 @@ client.scheduling.bookings.create(
-**idempotency_key:** `typing.Optional[str]` — Makes retries safe: a repeated request with the same key and body returns the original booking instead of creating another, for 24 hours. A refused request keeps no key. 1-256 characters. +**questions:** `typing.Optional[typing.List[SchedulingQuestion]]` — What attendees are asked when booking. Keys must be unique.
@@ -22548,7 +25221,7 @@ client.scheduling.bookings.create(
-**host:** `typing.Optional[str]` — A specific host (id or uid). Default: chosen fairly from those free. +**locations:** `typing.Optional[typing.List[typing.Optional[SchedulingLocation]]]` — Where bookings can meet. A browser only chooses among these. A `group` event type can't use `zoom`.
@@ -22556,7 +25229,7 @@ client.scheduling.bookings.create(
-**attributes:** `typing.Optional[typing.Dict[str, CreateBookingRequestAttributesValue]]` — Only choose among pool hosts matching all of these. +**host_filter:** `typing.Optional[typing.Dict[str, typing.Optional[UpdateEventTypeRequestHostFilterValue]]]` — Pool members also include active hosts matching all of these attributes.
@@ -22564,7 +25237,7 @@ client.scheduling.bookings.create(
-**duration_minutes:** `typing.Optional[int]` — One of the event type's `duration_options`. +**notifications:** `typing.Optional[typing.Dict[str, typing.Optional[UpdateEventTypeRequestNotificationsValue]]]` — Per event, overriding your settings for this event type.
@@ -22572,7 +25245,7 @@ client.scheduling.bookings.create(
-**guests:** `typing.Optional[typing.List[SchedulingGuestInput]]` — Up to the event type's `max_guests`. +**reminders:** `typing.Optional[typing.List[SchedulingReminderInput]]` — Replaces your settings' `reminders` for this event type. `null` inherits them; an empty list means none.
@@ -22580,7 +25253,7 @@ client.scheduling.bookings.create(
-**answers:** `typing.Optional[typing.Dict[str, CreateBookingRequestAnswersValue]]` — Answers to the event type's questions. Stored encrypted, and returned only by retrieving the booking. +**metadata:** `typing.Optional[typing.Dict[str, str]]` — Your own key-value pairs.
@@ -22588,7 +25261,7 @@ client.scheduling.bookings.create(
-**location:** `typing.Optional[CreateBookingRequestLocation]` — One of the event type's `locations`, with your link filled in if it has none. +**status:** `typing.Optional[UpdateEventTypeRequestStatus]` — `archived` stops new bookings, and keeps existing ones.
@@ -22596,7 +25269,7 @@ client.scheduling.bookings.create(
-**metadata:** `typing.Optional[typing.Dict[str, str]]` — Your own key-value pairs. Don't put sensitive data here. +**hosts:** `typing.Optional[typing.List[SchedulingEventTypeHostInput]]` — Replaces the assigned hosts. Removed hosts keep their existing bookings.
@@ -22616,7 +25289,8 @@ client.scheduling.bookings.create(
-
client.scheduling.bookings.get(...) -> SchedulingBooking +## Scheduling Slots +
client.scheduling.slots.list(...) -> SchedulingSlotList
@@ -22628,7 +25302,7 @@ client.scheduling.bookings.create(
-A booking with its attendees and their answers. +Starts an attendee can book between `start` and `end` (at most 62 days), as UTC instants to show in their own time zone. A host whose calendar can't be read isn't offered.
@@ -22651,8 +25325,10 @@ client = Coss( environment=CossEnvironment.DEFAULT, ) -client.scheduling.bookings.get( - id="book_01kd2m9a0b1c2d3e4f5g6h7j8m", +client.scheduling.slots.list( + event_type="evtype_01kd2m9a0b1c2d3e4f5g6h7j8m", + start="2027-01-04T15:00:00.000Z", + end="2027-01-04T15:00:00.000Z", ) ``` @@ -22669,7 +25345,47 @@ client.scheduling.bookings.get(
-**id:** `str` — The booking's id. +**event_type:** `str` — The event type's id or uid. + +
+
+ +
+
+ +**start:** `str` — An ISO 8601 instant with an offset. + +
+
+ +
+
+ +**end:** `str` — An ISO 8601 instant with an offset. + +
+
+ +
+
+ +**host:** `typing.Optional[str]` — Only this host's slots (id or uid). + +
+
+ +
+
+ +**duration_minutes:** `typing.Optional[int]` + +
+
+ +
+
+ +**attributes:** `typing.Optional[str]` — A JSON object narrowing a pool, such as `{"licensed_in":"CA"}`.
@@ -22689,7 +25405,7 @@ client.scheduling.bookings.get(
-
client.scheduling.bookings.reschedule(...) -> SchedulingBooking +
client.scheduling.slots.explain(...) -> SchedulingSlotExplanation
@@ -22701,7 +25417,7 @@ client.scheduling.bookings.get(
-Moves it to a new time, keeping its id. The old time stays booked if the new one isn't free. +Why one start can or can't be booked right now, host by host, decided the same way a booking is. For support and debugging: it says when a host is busy, so don't show it to attendees.
@@ -22724,26 +25440,42 @@ client = Coss( environment=CossEnvironment.DEFAULT, ) -client.scheduling.bookings.reschedule( - id="book_01kd2m9a0b1c2d3e4f5g6h7j8m", - start="2027-01-05T15:00:00.000Z", +client.scheduling.slots.explain( + event_type="evtype_01kd2m9a0b1c2d3e4f5g6h7j8m", + start="2027-01-04T15:00:00.000Z", ) -``` - -
+``` + + + + + +#### ⚙️ Parameters + +
+
+ +
+
+ +**event_type:** `str` — The event type's id or uid. +
-#### ⚙️ Parameters -
+**start:** `str` — An ISO 8601 instant with an offset. + +
+
+
-**id:** `str` — The booking's id. +**host:** `typing.Optional[str]` — Only this host (id or uid).
@@ -22751,7 +25483,7 @@ client.scheduling.bookings.reschedule(
-**start:** `str` — The new start. The old time stays booked unless this one's free. +**duration_minutes:** `typing.Optional[int]`
@@ -22759,7 +25491,7 @@ client.scheduling.bookings.reschedule(
-**host:** `typing.Optional[str]` — Move a pool booking to this host. Default: its current hosts. +**attributes:** `typing.Optional[str]` — A JSON object narrowing a pool, such as `{"licensed_in":"CA"}`.
@@ -22779,7 +25511,8 @@ client.scheduling.bookings.reschedule(
-
client.scheduling.bookings.cancel(...) -> SchedulingBooking +## Scheduling Availability +
client.scheduling.availability.search(...) -> SchedulingAvailabilitySearchResult
@@ -22791,7 +25524,7 @@ client.scheduling.bookings.reschedule(
-Frees the time and removes the calendar event. A cancelled booking stays charged. +For "who's free" pages: each matching host's soonest slots, soonest first, across up to 500 hosts.
@@ -22814,9 +25547,13 @@ client = Coss( environment=CossEnvironment.DEFAULT, ) -client.scheduling.bookings.cancel( - id="book_01kd2m9a0b1c2d3e4f5g6h7j8m", - reason="Feeling better", +client.scheduling.availability.search( + event_type="evtype_01kd2m9a0b1c2d3e4f5g6h7j8m", + start="2027-01-04T00:00:00.000Z", + end="2027-01-18T00:00:00.000Z", + attributes={ + "licensed_in": "CA" + }, ) ``` @@ -22833,7 +25570,7 @@ client.scheduling.bookings.cancel(
-**id:** `str` — The booking's id. +**event_type:** `str` — The event type's id or uid.
@@ -22841,7 +25578,47 @@ client.scheduling.bookings.cancel(
-**reason:** `typing.Optional[str]` — Why it's being cancelled. Only retrieving this booking returns it: it's never in webhooks, logs or emails. +**start:** `str` — An ISO 8601 instant with an offset. + +
+
+ +
+
+ +**end:** `str` — An ISO 8601 instant with an offset. + +
+
+ +
+
+ +**attributes:** `typing.Optional[typing.Dict[str, AvailabilitySearchRequestAttributesValue]]` — Only hosts matching all of these. + +
+
+ +
+
+ +**hosts:** `typing.Optional[typing.List[str]]` — Only these hosts (ids or uids). Default: everyone the event type could offer. + +
+
+ +
+
+ +**slots_per_host:** `typing.Optional[int]` — How many of each host's soonest slots to return. + +
+
+ +
+
+ +**limit:** `typing.Optional[int]` — Hosts to return, soonest availability first.
@@ -22861,7 +25638,8 @@ client.scheduling.bookings.cancel(
-
client.scheduling.bookings.events(...) -> SchedulingBookingEventList +## Scheduling Holds +
client.scheduling.holds.create(...) -> SchedulingBooking
@@ -22873,7 +25651,7 @@ client.scheduling.bookings.cancel(
-What's happened to a booking, oldest first, and who did it. There's no personal data in here. +Keeps a slot for a while (the event type's `hold_ttl_seconds`) so you can take payment, then confirm it. Answers with a `held` booking, which isn't charged and sends nothing.
@@ -22888,7 +25666,7 @@ What's happened to a booking, oldest first, and who did it. There's no personal
```python -from coss import Coss +from coss import Coss, SchedulingAttendeeInput from coss.environment import CossEnvironment client = Coss( @@ -22896,8 +25674,14 @@ client = Coss( environment=CossEnvironment.DEFAULT, ) -client.scheduling.bookings.events( - id="book_01kd2m9a0b1c2d3e4f5g6h7j8m", +client.scheduling.holds.create( + idempotency_key="welcome-user-123", + event_type="evtype_01kd2m9a0b1c2d3e4f5g6h7j8m", + start="2027-01-04T15:00:00.000Z", + attendee=SchedulingAttendeeInput( + uid="patient_77", + time_zone="UTC", + ), ) ``` @@ -22914,7 +25698,7 @@ client.scheduling.bookings.events(
-**id:** `str` — The booking's id. +**event_type:** `str` — The event type's id or uid.
@@ -22922,7 +25706,7 @@ client.scheduling.bookings.events(
-**limit:** `typing.Optional[int]` +**start:** `str` — An ISO 8601 instant with an offset.
@@ -22930,7 +25714,7 @@ client.scheduling.bookings.events(
-**after:** `typing.Optional[str]` — The last id of the previous page. +**attendee:** `SchedulingAttendeeInput`
@@ -22938,72 +25722,63 @@ client.scheduling.bookings.events(
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. +**idempotency_key:** `typing.Optional[str]` — Makes retries safe: a repeated request with the same key and body returns the original booking instead of creating another, for 24 hours. A refused request keeps no key. 1-256 characters.
-
-
+
+
+**host:** `typing.Optional[str]` — A specific host (id or uid). Default: chosen fairly from those free. +
-
-
client.scheduling.bookings.approve(...) -> SchedulingBooking
-#### 📝 Description - -
-
+**attributes:** `typing.Optional[typing.Dict[str, CreateHoldRequestAttributesValue]]` — Only choose among pool hosts matching all of these. + +
+
-Confirms a `pending_approval` booking. -
-
+**duration_minutes:** `typing.Optional[int]` — One of the event type's `duration_options`. +
-#### 🔌 Usage -
+**guests:** `typing.Optional[typing.List[SchedulingGuestInput]]` — Up to the event type's `max_guests`. + +
+
+
-```python -from coss import Coss -from coss.environment import CossEnvironment - -client = Coss( - api_key="", - environment=CossEnvironment.DEFAULT, -) - -client.scheduling.bookings.approve( - id="book_01kd2m9a0b1c2d3e4f5g6h7j8m", -) - -``` -
-
+**answers:** `typing.Optional[typing.Dict[str, CreateHoldRequestAnswersValue]]` — Answers to the event type's questions. Stored encrypted, and returned only by retrieving the booking. + -#### ⚙️ Parameters -
+**location:** `typing.Optional[CreateHoldRequestLocation]` — One of the event type's `locations`, with your link filled in if it has none. + +
+
+
-**id:** `str` — The booking's id. +**metadata:** `typing.Optional[typing.Dict[str, str]]` — Your own key-value pairs. Don't put sensitive data here.
@@ -23023,7 +25798,7 @@ client.scheduling.bookings.approve(
-
client.scheduling.bookings.decline(...) -> SchedulingBooking +
client.scheduling.holds.confirm(...) -> SchedulingBooking
@@ -23035,7 +25810,7 @@ client.scheduling.bookings.approve(
-Refuses a `pending_approval` booking and frees the time. +Turns a hold into a booking. Always succeeds before the hold expires. Repeating it is safe.
@@ -23058,8 +25833,9 @@ client = Coss( environment=CossEnvironment.DEFAULT, ) -client.scheduling.bookings.decline( +client.scheduling.holds.confirm( id="book_01kd2m9a0b1c2d3e4f5g6h7j8m", + if_still_free=True, ) ``` @@ -23084,6 +25860,14 @@ client.scheduling.bookings.decline(
+**if_still_free:** `typing.Optional[bool]` — After the hold expired, book anyway if nobody else took the slot. Default: refuse with `hold_expired`. + +
+
+ +
+
+ **request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
@@ -23096,7 +25880,7 @@ client.scheduling.bookings.decline(
-
client.scheduling.bookings.notifications(...) -> SchedulingBookingNotificationList +
client.scheduling.holds.release(...) -> SchedulingBooking
@@ -23108,7 +25892,7 @@ client.scheduling.bookings.decline(
-What's been queued for this booking and what became of it, newest first, including why something wasn't sent. It never says who it went to. +Gives the slot back early.
@@ -23131,7 +25915,7 @@ client = Coss( environment=CossEnvironment.DEFAULT, ) -client.scheduling.bookings.notifications( +client.scheduling.holds.release( id="book_01kd2m9a0b1c2d3e4f5g6h7j8m", ) @@ -23157,22 +25941,6 @@ client.scheduling.bookings.notifications(
-**limit:** `typing.Optional[int]` - -
-
- -
-
- -**after:** `typing.Optional[str]` — The last id of the previous page. - -
-
- -
-
- **request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
@@ -23185,7 +25953,8 @@ client.scheduling.bookings.notifications(
-
client.scheduling.bookings.mark_no_show(...) -> SchedulingBooking +## Scheduling Series +
client.scheduling.series.create(...) -> SchedulingSeries
@@ -23197,7 +25966,7 @@ client.scheduling.bookings.notifications(
-Records that the attendee didn't come, once the booking has started. +Books up to 52 occurrences, keeping the attendee's local time across DST changes. Each one is an ordinary booking that can move on its own, and a pool keeps one host throughout.
@@ -23212,7 +25981,7 @@ Records that the attendee didn't come, once the booking has started.
```python -from coss import Coss +from coss import Coss, SchedulingAttendeeInput, CreateSeriesRequestRecurrence from coss.environment import CossEnvironment client = Coss( @@ -23220,8 +25989,19 @@ client = Coss( environment=CossEnvironment.DEFAULT, ) -client.scheduling.bookings.mark_no_show( - id="book_01kd2m9a0b1c2d3e4f5g6h7j8m", +client.scheduling.series.create( + idempotency_key="welcome-user-123", + event_type="evtype_01kd2m9a0b1c2d3e4f5g6h7j8m", + start="2027-01-04T15:00:00.000Z", + attendee=SchedulingAttendeeInput( + uid="patient_77", + time_zone="America/New_York", + ), + recurrence=CreateSeriesRequestRecurrence( + frequency="weekly", + interval=1, + count=12, + ), ) ``` @@ -23238,7 +26018,15 @@ client.scheduling.bookings.mark_no_show(
-**id:** `str` — The booking's id. +**request:** `CreateSeriesRequest` + +
+
+ +
+
+ +**idempotency_key:** `typing.Optional[str]` — Makes retries safe: a repeated request with the same key and body returns the original booking instead of creating another, for 24 hours. A refused request keeps no key. 1-256 characters.
@@ -23258,7 +26046,7 @@ client.scheduling.bookings.mark_no_show(
-
client.scheduling.bookings.update_location(...) -> SchedulingBooking +
client.scheduling.series.preview(...) -> SchedulingSeriesPreview
@@ -23270,7 +26058,7 @@ client.scheduling.bookings.mark_no_show(
-Where it happens, such as the meeting link you made after the `scheduling.booking.confirmed` webhook. +Which occurrences would be free, without booking anything.
@@ -23285,7 +26073,7 @@ Where it happens, such as the meeting link you made after the `scheduling.bookin
```python -from coss import Coss, SchedulingLocation_Link +from coss import Coss, SchedulingAttendeeInput, CreateSeriesRequestRecurrence from coss.environment import CossEnvironment client = Coss( @@ -23293,10 +26081,17 @@ client = Coss( environment=CossEnvironment.DEFAULT, ) -client.scheduling.bookings.update_location( - id="book_01kd2m9a0b1c2d3e4f5g6h7j8m", - location=SchedulingLocation_Link( - url="https://meet.example.com/abc", +client.scheduling.series.preview( + event_type="evtype_01kd2m9a0b1c2d3e4f5g6h7j8m", + start="2027-01-04T15:00:00.000Z", + attendee=SchedulingAttendeeInput( + uid="patient_77", + time_zone="America/New_York", + ), + recurrence=CreateSeriesRequestRecurrence( + frequency="weekly", + interval=1, + count=12, ), ) @@ -23314,15 +26109,7 @@ client.scheduling.bookings.update_location(
-**id:** `str` — The booking's id. - -
-
- -
-
- -**location:** `SchedulingLocation` +**request:** `CreateSeriesRequest`
@@ -23342,8 +26129,7 @@ client.scheduling.bookings.update_location(
-## Scheduling Holds -
client.scheduling.holds.create(...) -> SchedulingBooking +
client.scheduling.series.cancel(...) -> SchedulingCancelledSeries
@@ -23355,7 +26141,7 @@ client.scheduling.bookings.update_location(
-Keeps a slot for a while (the event type's `hold_ttl_seconds`) so you can take payment, then confirm it. Answers with a `held` booking, which isn't charged and sends nothing. +Cancels the occurrences from `from_index` on, or all of them.
@@ -23370,7 +26156,7 @@ Keeps a slot for a while (the event type's `hold_ttl_seconds`) so you can take p
```python -from coss import Coss, SchedulingAttendeeInput +from coss import Coss from coss.environment import CossEnvironment client = Coss( @@ -23378,14 +26164,9 @@ client = Coss( environment=CossEnvironment.DEFAULT, ) -client.scheduling.holds.create( - idempotency_key="welcome-user-123", - event_type="evtype_01kd2m9a0b1c2d3e4f5g6h7j8m", - start="2027-01-04T15:00:00.000Z", - attendee=SchedulingAttendeeInput( - uid="patient_77", - time_zone="UTC", - ), +client.scheduling.series.cancel( + id="series_01kd2m9a0b1c2d3e4f5g6h7j8m", + from_index=4, ) ``` @@ -23402,7 +26183,7 @@ client.scheduling.holds.create(
-**event_type:** `str` — The event type's id or uid. +**id:** `str` — The series' id.
@@ -23410,7 +26191,7 @@ client.scheduling.holds.create(
-**start:** `str` — An ISO 8601 instant with an offset. +**from_index:** `typing.Optional[int]` — Cancel this occurrence and those after it. Default: all of them.
@@ -23418,71 +26199,73 @@ client.scheduling.holds.create(
-**attendee:** `SchedulingAttendeeInput` +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
-
-
-**idempotency_key:** `typing.Optional[str]` — Makes retries safe: a repeated request with the same key and body returns the original booking instead of creating another, for 24 hours. A refused request keeps no key. 1-256 characters. -
+
+## Scheduling Attendees +
client.scheduling.attendees.erase(...) -> SchedulingAttendeeErasure
-**host:** `typing.Optional[str]` — A specific host (id or uid). Default: chosen fairly from those free. - -
-
+#### 📝 Description
-**attributes:** `typing.Optional[typing.Dict[str, CreateHoldRequestAttributesValue]]` — Only choose among pool hosts matching all of these. - -
-
-
-**duration_minutes:** `typing.Optional[int]` — One of the event type's `duration_options`. - +Removes this person's details and answers from every booking now, and ends any booker session fixed to them. The bookings themselves stay. +
+
+#### 🔌 Usage +
-**guests:** `typing.Optional[typing.List[SchedulingGuestInput]]` — Up to the event type's `max_guests`. - -
-
-
-**answers:** `typing.Optional[typing.Dict[str, CreateHoldRequestAnswersValue]]` — Answers to the event type's questions. Stored encrypted, and returned only by retrieving the booking. - +```python +from coss import Coss +from coss.environment import CossEnvironment + +client = Coss( + api_key="", + environment=CossEnvironment.DEFAULT, +) + +client.scheduling.attendees.erase( + uid="patient_77", +) + +```
+ + + +#### ⚙️ Parameters
-**location:** `typing.Optional[CreateHoldRequestLocation]` — One of the event type's `locations`, with your link filled in if it has none. - -
-
-
-**metadata:** `typing.Optional[typing.Dict[str, str]]` — Your own key-value pairs. Don't put sensitive data here. +**uid:** `str` — Your id for the attendee.
@@ -23502,7 +26285,7 @@ client.scheduling.holds.create(
-
client.scheduling.holds.confirm(...) -> SchedulingBooking +
client.scheduling.attendees.erase_by_email(...) -> SchedulingAttendeeErasureByEmail
@@ -23514,7 +26297,7 @@ client.scheduling.holds.create(
-Turns a hold into a booking. Always succeeds before the hold expires. Repeating it is safe. +Removes this address's details and answers from every booking now, for someone you have no `uid` for, such as a guest. The bookings themselves stay.
@@ -23537,9 +26320,8 @@ client = Coss( environment=CossEnvironment.DEFAULT, ) -client.scheduling.holds.confirm( - id="book_01kd2m9a0b1c2d3e4f5g6h7j8m", - if_still_free=True, +client.scheduling.attendees.erase_by_email( + email="sam@example.com", ) ``` @@ -23556,15 +26338,7 @@ client.scheduling.holds.confirm(
-**id:** `str` — The booking's id. - -
-
- -
-
- -**if_still_free:** `typing.Optional[bool]` — After the hold expired, book anyway if nobody else took the slot. Default: refuse with `hold_expired`. +**email:** `str` — The address to forget, an attendee's or a guest's.
@@ -23584,7 +26358,8 @@ client.scheduling.holds.confirm(
-
client.scheduling.holds.release(...) -> SchedulingBooking +## Scheduling Calendars +
client.scheduling.calendars.authorize(...) -> SchedulingCalendarAuthorization
@@ -23596,7 +26371,7 @@ client.scheduling.holds.confirm(
-Gives the slot back early. +A URL for the host to give consent at Google or Microsoft. Open it in a new window: providers refuse to be framed. Coss.com reads only busy times, and writes events with a neutral title unless the event type's `host_calendar_details` is `full`.
@@ -23619,8 +26394,9 @@ client = Coss( environment=CossEnvironment.DEFAULT, ) -client.scheduling.holds.release( - id="book_01kd2m9a0b1c2d3e4f5g6h7j8m", +client.scheduling.calendars.authorize( + host="host_01kd2m9a0b1c2d3e4f5g6h7j8m", + provider="google", ) ``` @@ -23637,7 +26413,23 @@ client.scheduling.holds.release(
-**id:** `str` — The booking's id. +**host:** `str` — The host's id or uid. + +
+
+ +
+
+ +**provider:** `AuthorizeCalendarRequestProvider` — Whose consent page to open. CalDAV connects with a password instead. + +
+
+ +
+
+ +**return_url:** `typing.Optional[str]` — Where to send the browser afterwards, on one of the environment's allowed origins. `coss_calendar` says what happened: `connected`, `denied` or `invalid`.
@@ -23657,8 +26449,7 @@ client.scheduling.holds.release(
-## Scheduling Series -
client.scheduling.series.create(...) -> SchedulingSeries +
client.scheduling.calendars.list(...) -> SchedulingCalendarConnectionList
@@ -23670,7 +26461,7 @@ client.scheduling.holds.release(
-Books up to 52 occurrences, keeping the attendee's local time across DST changes. Each one is an ordinary booking that can move on its own, and a pool keeps one host throughout. +With each connection's calendars and which of them count.
@@ -23685,7 +26476,7 @@ Books up to 52 occurrences, keeping the attendee's local time across DST changes
```python -from coss import Coss, SchedulingAttendeeInput, CreateSeriesRequestRecurrence +from coss import Coss from coss.environment import CossEnvironment client = Coss( @@ -23693,19 +26484,8 @@ client = Coss( environment=CossEnvironment.DEFAULT, ) -client.scheduling.series.create( - idempotency_key="welcome-user-123", - event_type="evtype_01kd2m9a0b1c2d3e4f5g6h7j8m", - start="2027-01-04T15:00:00.000Z", - attendee=SchedulingAttendeeInput( - uid="patient_77", - time_zone="America/New_York", - ), - recurrence=CreateSeriesRequestRecurrence( - frequency="weekly", - interval=1, - count=12, - ), +client.scheduling.calendars.list( + host="host_01kd2m9a0b1c2d3e4f5g6h7j8m", ) ``` @@ -23722,15 +26502,7 @@ client.scheduling.series.create(
-**request:** `CreateSeriesRequest` - -
-
- -
-
- -**idempotency_key:** `typing.Optional[str]` — Makes retries safe: a repeated request with the same key and body returns the original booking instead of creating another, for 24 hours. A refused request keeps no key. 1-256 characters. +**host:** `str` — The host's id or uid.
@@ -23750,7 +26522,7 @@ client.scheduling.series.create(
-
client.scheduling.series.preview(...) -> SchedulingSeriesPreview +
client.scheduling.calendars.connect(...) -> SchedulingCalendarConnection
@@ -23762,7 +26534,7 @@ client.scheduling.series.create(
-Which occurrences would be free, without booking anything. +CalDAV (Apple and others) with an app password, or, in sandbox environments, a `simulated` calendar whose busy times you set yourself. Google and Microsoft use `authorize`.
@@ -23777,7 +26549,7 @@ Which occurrences would be free, without booking anything.
```python -from coss import Coss, SchedulingAttendeeInput, CreateSeriesRequestRecurrence +from coss import Coss, CreateCalendarConnectionRequest_Caldav from coss.environment import CossEnvironment client = Coss( @@ -23785,17 +26557,12 @@ client = Coss( environment=CossEnvironment.DEFAULT, ) -client.scheduling.series.preview( - event_type="evtype_01kd2m9a0b1c2d3e4f5g6h7j8m", - start="2027-01-04T15:00:00.000Z", - attendee=SchedulingAttendeeInput( - uid="patient_77", - time_zone="America/New_York", - ), - recurrence=CreateSeriesRequestRecurrence( - frequency="weekly", - interval=1, - count=12, +client.scheduling.calendars.connect( + host="host_01kd2m9a0b1c2d3e4f5g6h7j8m", + request=CreateCalendarConnectionRequest_Caldav( + url="url", + username="username", + password="password", ), ) @@ -23813,7 +26580,15 @@ client.scheduling.series.preview(
-**request:** `CreateSeriesRequest` +**host:** `str` — The host's id or uid. + +
+
+ +
+
+ +**request:** `CreateCalendarConnectionRequest`
@@ -23833,7 +26608,7 @@ client.scheduling.series.preview(
-
client.scheduling.series.cancel(...) -> SchedulingCancelledSeries +
client.scheduling.calendars.disconnect(...) -> DeletedSchedulingCalendarConnection
@@ -23845,7 +26620,7 @@ client.scheduling.series.preview(
-Cancels the occurrences from `from_index` on, or all of them. +Revokes coss.com's access and deletes every busy time read through it. One a calendar delegation manages is refused (`calendar_managed`).
@@ -23868,9 +26643,9 @@ client = Coss( environment=CossEnvironment.DEFAULT, ) -client.scheduling.series.cancel( - id="series_01kd2m9a0b1c2d3e4f5g6h7j8m", - from_index=4, +client.scheduling.calendars.disconnect( + host="host_01kd2m9a0b1c2d3e4f5g6h7j8m", + id="calconn_01kd2m9a0b1c2d3e4f5g6h7j8m", ) ``` @@ -23887,7 +26662,7 @@ client.scheduling.series.cancel(
-**id:** `str` — The series' id. +**host:** `str` — The host's id or uid.
@@ -23895,7 +26670,7 @@ client.scheduling.series.cancel(
-**from_index:** `typing.Optional[int]` — Cancel this occurrence and those after it. Default: all of them. +**id:** `str` — The connection's id.
@@ -23915,8 +26690,7 @@ client.scheduling.series.cancel(
-## Scheduling Attendees -
client.scheduling.attendees.erase(...) -> SchedulingAttendeeErasure +
client.scheduling.calendars.update(...) -> SchedulingCalendarConnectionList
@@ -23928,7 +26702,7 @@ client.scheduling.series.cancel(
-Removes this person's details and answers from every booking now, and ends any booker session fixed to them. The bookings themselves stay. +Whether its busy times block slots, and whether bookings are written to it.
@@ -23951,8 +26725,10 @@ client = Coss( environment=CossEnvironment.DEFAULT, ) -client.scheduling.attendees.erase( - uid="patient_77", +client.scheduling.calendars.update( + host="host_01kd2m9a0b1c2d3e4f5g6h7j8m", + calendar_id="cal_01kd2m9a0b1c2d3e4f5g6h7j8m", + read_busy=True, ) ``` @@ -23969,7 +26745,31 @@ client.scheduling.attendees.erase(
-**uid:** `str` — Your id for the attendee. +**host:** `str` — The host's id or uid. + +
+
+ +
+
+ +**calendar_id:** `str` — The calendar's id. + +
+
+ +
+
+ +**read_busy:** `typing.Optional[bool]` — Whether this calendar's busy times block slots. + +
+
+ +
+
+ +**write_target:** `typing.Optional[bool]` — Bookings are written to one calendar; setting this moves it here.
@@ -23989,7 +26789,7 @@ client.scheduling.attendees.erase(
-
client.scheduling.attendees.erase_by_email(...) -> SchedulingAttendeeErasureByEmail +
client.scheduling.calendars.set_simulated_busy(...)
@@ -24001,7 +26801,7 @@ client.scheduling.attendees.erase(
-Removes this address's details and answers from every booking now, for someone you have no `uid` for, such as a guest. The bookings themselves stay. +Sandbox environments only: test how bookings react to a busy calendar.
@@ -24018,14 +26818,21 @@ Removes this address's details and answers from every booking now, for someone y ```python from coss import Coss from coss.environment import CossEnvironment +from coss.scheduling.calendars import SetSimulatedBusyRequestIntervalsItem client = Coss( api_key="", environment=CossEnvironment.DEFAULT, ) -client.scheduling.attendees.erase_by_email( - email="sam@example.com", +client.scheduling.calendars.set_simulated_busy( + host="host_01kd2m9a0b1c2d3e4f5g6h7j8m", + intervals=[ + SetSimulatedBusyRequestIntervalsItem( + start="2027-01-04T15:00:00.000Z", + end="2027-01-04T16:00:00.000Z", + ) + ], ) ``` @@ -24042,7 +26849,15 @@ client.scheduling.attendees.erase_by_email(
-**email:** `str` — The address to forget, an attendee's or a guest's. +**host:** `str` — The host's id or uid. + +
+
+ +
+
+ +**intervals:** `typing.List[SetSimulatedBusyRequestIntervalsItem]` — The simulated calendar's busy times.
@@ -24062,8 +26877,8 @@ client.scheduling.attendees.erase_by_email(
-## Scheduling Calendars -
client.scheduling.calendars.authorize(...) -> SchedulingCalendarAuthorization +## Scheduling CalendarDelegations +
client.scheduling.calendar_delegations.list() -> SchedulingCalendarDelegationList
@@ -24075,7 +26890,7 @@ client.scheduling.attendees.erase_by_email(
-A URL for the host to give consent at Google or Microsoft. Open it in a new window: providers refuse to be framed. Coss.com reads only busy times, and writes events with a neutral title unless the event type's `host_calendar_details` is `full`. +With how many hosts each has connected.
@@ -24098,10 +26913,7 @@ client = Coss( environment=CossEnvironment.DEFAULT, ) -client.scheduling.calendars.authorize( - host="host_01kd2m9a0b1c2d3e4f5g6h7j8m", - provider="google", -) +client.scheduling.calendar_delegations.list() ``` @@ -24117,30 +26929,6 @@ client.scheduling.calendars.authorize(
-**host:** `str` — The host's id or uid. - -
-
- -
-
- -**provider:** `AuthorizeCalendarRequestProvider` — Whose consent page to open. CalDAV connects with a password instead. - -
-
- -
-
- -**return_url:** `typing.Optional[str]` — Where to send the browser afterwards, on one of the environment's allowed origins. `coss_calendar` says what happened: `connected`, `denied` or `invalid`. - -
-
- -
-
- **request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
@@ -24153,7 +26941,7 @@ client.scheduling.calendars.authorize(
-
client.scheduling.calendars.list(...) -> SchedulingCalendarConnectionList +
client.scheduling.calendar_delegations.create(...) -> SchedulingCalendarDelegation
@@ -24165,7 +26953,7 @@ client.scheduling.calendars.authorize(
-With each connection's calendars and which of them count. +An admin authorizes once, and every host on the domain gets their calendar with no consent screen. It stays `pending`: authorize what it returns, then verify it. Credentials are never returned.
@@ -24180,7 +26968,7 @@ With each connection's calendars and which of them count.
```python -from coss import Coss +from coss import Coss, CreateCalendarDelegationRequest_Google from coss.environment import CossEnvironment client = Coss( @@ -24188,8 +26976,11 @@ client = Coss( environment=CossEnvironment.DEFAULT, ) -client.scheduling.calendars.list( - host="host_01kd2m9a0b1c2d3e4f5g6h7j8m", +client.scheduling.calendar_delegations.create( + request=CreateCalendarDelegationRequest_Google( + domain="domain", + service_account_key="service_account_key", + ), ) ``` @@ -24206,7 +26997,7 @@ client.scheduling.calendars.list(
-**host:** `str` — The host's id or uid. +**request:** `CreateCalendarDelegationRequest`
@@ -24226,7 +27017,7 @@ client.scheduling.calendars.list(
-
client.scheduling.calendars.connect(...) -> SchedulingCalendarConnection +
client.scheduling.calendar_delegations.get(...) -> SchedulingCalendarDelegation
@@ -24238,7 +27029,7 @@ client.scheduling.calendars.list(
-CalDAV (Apple and others) with an app password, or, in sandbox environments, a `simulated` calendar whose busy times you set yourself. Google and Microsoft use `authorize`. +Its status, what to authorize, and how many hosts it has connected.
@@ -24253,7 +27044,7 @@ CalDAV (Apple and others) with an app password, or, in sandbox environments, a `
```python -from coss import Coss, CreateCalendarConnectionRequest_Caldav +from coss import Coss from coss.environment import CossEnvironment client = Coss( @@ -24261,13 +27052,8 @@ client = Coss( environment=CossEnvironment.DEFAULT, ) -client.scheduling.calendars.connect( - host="host_01kd2m9a0b1c2d3e4f5g6h7j8m", - request=CreateCalendarConnectionRequest_Caldav( - url="url", - username="username", - password="password", - ), +client.scheduling.calendar_delegations.get( + id="caldlg_01kd2m9a0b1c2d3e4f5g6h7j8m", ) ``` @@ -24284,15 +27070,7 @@ client.scheduling.calendars.connect(
-**host:** `str` — The host's id or uid. - -
-
- -
-
- -**request:** `CreateCalendarConnectionRequest` +**id:** `str` — The delegation's id.
@@ -24312,7 +27090,7 @@ client.scheduling.calendars.connect(
-
client.scheduling.calendars.disconnect(...) -> DeletedSchedulingCalendarConnection +
client.scheduling.calendar_delegations.delete(...) -> DeletedSchedulingCalendarDelegation
@@ -24324,7 +27102,7 @@ client.scheduling.calendars.connect(
-Revokes coss.com's access and deletes every busy time read through it. One a calendar delegation manages is refused (`calendar_managed`). +Its hosts lose these calendars within minutes. They stay bookable with no conflict check, and events already written stay on their calendars, out of reach of later moves or cancellations.
@@ -24347,9 +27125,8 @@ client = Coss( environment=CossEnvironment.DEFAULT, ) -client.scheduling.calendars.disconnect( - host="host_01kd2m9a0b1c2d3e4f5g6h7j8m", - id="calconn_01kd2m9a0b1c2d3e4f5g6h7j8m", +client.scheduling.calendar_delegations.delete( + id="caldlg_01kd2m9a0b1c2d3e4f5g6h7j8m", ) ``` @@ -24366,15 +27143,7 @@ client.scheduling.calendars.disconnect(
-**host:** `str` — The host's id or uid. - -
-
- -
-
- -**id:** `str` — The connection's id. +**id:** `str` — The delegation's id.
@@ -24394,7 +27163,7 @@ client.scheduling.calendars.disconnect(
-
client.scheduling.calendars.update(...) -> SchedulingCalendarConnectionList +
client.scheduling.calendar_delegations.update(...) -> SchedulingCalendarDelegation
@@ -24406,7 +27175,7 @@ client.scheduling.calendars.disconnect(
-Whether its busy times block slots, and whether bookings are written to it. +New credentials are tried on the verified mailbox before they replace the old ones, and end an outage if they work.
@@ -24429,10 +27198,9 @@ client = Coss( environment=CossEnvironment.DEFAULT, ) -client.scheduling.calendars.update( - host="host_01kd2m9a0b1c2d3e4f5g6h7j8m", - calendar_id="cal_01kd2m9a0b1c2d3e4f5g6h7j8m", - read_busy=True, +client.scheduling.calendar_delegations.update( + id="caldlg_01kd2m9a0b1c2d3e4f5g6h7j8m", + match_host_email=False, ) ``` @@ -24449,7 +27217,7 @@ client.scheduling.calendars.update(
-**host:** `str` — The host's id or uid. +**id:** `str` — The delegation's id.
@@ -24457,7 +27225,7 @@ client.scheduling.calendars.update(
-**calendar_id:** `str` — The calendar's id. +**match_host_email:** `typing.Optional[bool]` — Whether a host's `email` picks their mailbox when `calendar_account` isn't set. Turn it off if end users can type their own email into your app: otherwise one could name a colleague's address and reach that calendar.
@@ -24465,7 +27233,7 @@ client.scheduling.calendars.update(
-**read_busy:** `typing.Optional[bool]` — Whether this calendar's busy times block slots. +**service_account_key:** `typing.Optional[str]` — A new key. It's tried on the verified mailbox before it replaces the old one.
@@ -24473,7 +27241,15 @@ client.scheduling.calendars.update(
-**write_target:** `typing.Optional[bool]` — Bookings are written to one calendar; setting this moves it here. +**client_secret:** `typing.Optional[str]` — A new client secret. It's tried on the verified mailbox before it replaces the old one. + +
+
+ +
+
+ +**secret_expires_at:** `typing.Optional[datetime.datetime]` — When the Entra client secret expires. Owners and admins are warned 14 days before.
@@ -24493,7 +27269,7 @@ client.scheduling.calendars.update(
-
client.scheduling.calendars.set_simulated_busy(...) +
client.scheduling.calendar_delegations.verify(...) -> SchedulingCalendarDelegation
@@ -24505,7 +27281,7 @@ client.scheduling.calendars.update(
-Sandbox environments only: test how bookings react to a busy calendar. +Tries one real mailbox. Passing makes it `active`, and its hosts start connecting. Google can take up to 24 hours to apply a new authorization, so a refusal may just need time.
@@ -24522,21 +27298,15 @@ Sandbox environments only: test how bookings react to a busy calendar. ```python from coss import Coss from coss.environment import CossEnvironment -from coss.scheduling.calendars import SetSimulatedBusyRequestIntervalsItem client = Coss( api_key="", environment=CossEnvironment.DEFAULT, ) -client.scheduling.calendars.set_simulated_busy( - host="host_01kd2m9a0b1c2d3e4f5g6h7j8m", - intervals=[ - SetSimulatedBusyRequestIntervalsItem( - start="2027-01-04T15:00:00.000Z", - end="2027-01-04T16:00:00.000Z", - ) - ], +client.scheduling.calendar_delegations.verify( + id="caldlg_01kd2m9a0b1c2d3e4f5g6h7j8m", + account="ana@example.com", ) ``` @@ -24553,7 +27323,7 @@ client.scheduling.calendars.set_simulated_busy(
-**host:** `str` — The host's id or uid. +**id:** `str` — The delegation's id.
@@ -24561,7 +27331,7 @@ client.scheduling.calendars.set_simulated_busy(
-**intervals:** `typing.List[SetSimulatedBusyRequestIntervalsItem]` — The simulated calendar's busy times. +**account:** `str` — A real mailbox on the domain to try. In Microsoft 365, a user principal name.
@@ -24581,8 +27351,8 @@ client.scheduling.calendars.set_simulated_busy(
-## Scheduling CalendarDelegations -
client.scheduling.calendar_delegations.list() -> SchedulingCalendarDelegationList +## Scheduling OauthApps +
client.scheduling.oauth_apps.list() -> SchedulingOauthAppList
@@ -24594,7 +27364,7 @@ client.scheduling.calendars.set_simulated_busy(
-With how many hosts each has connected. +At most one per provider, with how many connections use each.
@@ -24617,7 +27387,7 @@ client = Coss( environment=CossEnvironment.DEFAULT, ) -client.scheduling.calendar_delegations.list() +client.scheduling.oauth_apps.list() ``` @@ -24645,7 +27415,7 @@ client.scheduling.calendar_delegations.list()
-
client.scheduling.calendar_delegations.create(...) -> SchedulingCalendarDelegation +
client.scheduling.oauth_apps.create(...) -> SchedulingOauthApp
@@ -24657,7 +27427,7 @@ client.scheduling.calendar_delegations.list()
-An admin authorizes once, and every host on the domain gets their calendar with no consent screen. It stays `pending`: authorize what it returns, then verify it. Credentials are never returned. +New consents in this environment use it, so the consent screen shows your brand. Connections made before it stay on coss.com's app until their host consents again. On the Scale plan and above. Secrets are never returned.
@@ -24672,7 +27442,7 @@ An admin authorizes once, and every host on the domain gets their calendar with
```python -from coss import Coss, CreateCalendarDelegationRequest_Google +from coss import Coss, CreateOauthAppRequest_Google from coss.environment import CossEnvironment client = Coss( @@ -24680,10 +27450,10 @@ client = Coss( environment=CossEnvironment.DEFAULT, ) -client.scheduling.calendar_delegations.create( - request=CreateCalendarDelegationRequest_Google( - domain="domain", - service_account_key="service_account_key", +client.scheduling.oauth_apps.create( + request=CreateOauthAppRequest_Google( + client_id="client_id", + client_secret="client_secret", ), ) @@ -24701,7 +27471,7 @@ client.scheduling.calendar_delegations.create(
-**request:** `CreateCalendarDelegationRequest` +**request:** `CreateOauthAppRequest`
@@ -24721,7 +27491,7 @@ client.scheduling.calendar_delegations.create(
-
client.scheduling.calendar_delegations.get(...) -> SchedulingCalendarDelegation +
client.scheduling.oauth_apps.get(...) -> SchedulingOauthApp
@@ -24733,7 +27503,7 @@ client.scheduling.calendar_delegations.create(
-Its status, what to authorize, and how many hosts it has connected. +Its status, what to register at the provider, and how many connections use it.
@@ -24756,8 +27526,8 @@ client = Coss( environment=CossEnvironment.DEFAULT, ) -client.scheduling.calendar_delegations.get( - id="caldlg_01kd2m9a0b1c2d3e4f5g6h7j8m", +client.scheduling.oauth_apps.get( + id="calapp_01kd2m9a0b1c2d3e4f5g6h7j8m", ) ``` @@ -24774,7 +27544,7 @@ client.scheduling.calendar_delegations.get(
-**id:** `str` — The delegation's id. +**id:** `str` — The OAuth app's id.
@@ -24794,7 +27564,7 @@ client.scheduling.calendar_delegations.get(
-
client.scheduling.calendar_delegations.delete(...) -> DeletedSchedulingCalendarDelegation +
client.scheduling.oauth_apps.delete(...) -> DeletedSchedulingOauthApp
@@ -24806,7 +27576,7 @@ client.scheduling.calendar_delegations.get(
-Its hosts lose these calendars within minutes. They stay bookable with no conflict check, and events already written stay on their calendars, out of reach of later moves or cancellations. +Refused while connections use it (`oauth_app_in_use`), since only it can refresh their access: disconnect them first. New consents go back to coss.com's app.
@@ -24829,8 +27599,8 @@ client = Coss( environment=CossEnvironment.DEFAULT, ) -client.scheduling.calendar_delegations.delete( - id="caldlg_01kd2m9a0b1c2d3e4f5g6h7j8m", +client.scheduling.oauth_apps.delete( + id="calapp_01kd2m9a0b1c2d3e4f5g6h7j8m", ) ``` @@ -24847,7 +27617,7 @@ client.scheduling.calendar_delegations.delete(
-**id:** `str` — The delegation's id. +**id:** `str` — The OAuth app's id.
@@ -24867,7 +27637,7 @@ client.scheduling.calendar_delegations.delete(
-
client.scheduling.calendar_delegations.update(...) -> SchedulingCalendarDelegation +
client.scheduling.oauth_apps.update(...) -> SchedulingOauthApp
@@ -24879,7 +27649,7 @@ client.scheduling.calendar_delegations.delete(
-New credentials are tried on the verified mailbox before they replace the old ones, and end an outage if they work. +A new client secret is tried on a connection before it replaces the old one, and ends an outage if it works. Its client ID can't change: a different app needs its hosts to consent again.
@@ -24902,9 +27672,9 @@ client = Coss( environment=CossEnvironment.DEFAULT, ) -client.scheduling.calendar_delegations.update( - id="caldlg_01kd2m9a0b1c2d3e4f5g6h7j8m", - match_host_email=False, +client.scheduling.oauth_apps.update( + id="calapp_01kd2m9a0b1c2d3e4f5g6h7j8m", + client_secret="GOCSPX-abcdefghijklmnopqrstuvwxyz", ) ``` @@ -24921,7 +27691,7 @@ client.scheduling.calendar_delegations.update(
-**id:** `str` — The delegation's id. +**id:** `str` — The OAuth app's id.
@@ -24929,7 +27699,7 @@ client.scheduling.calendar_delegations.update(
-**match_host_email:** `typing.Optional[bool]` — Whether a host's `email` picks their mailbox when `calendar_account` isn't set. Turn it off if end users can type their own email into your app: otherwise one could name a colleague's address and reach that calendar. +**client_secret:** `typing.Optional[str]` — A new client secret. It's tried on a connection before it replaces the old one.
@@ -24937,7 +27707,7 @@ client.scheduling.calendar_delegations.update(
-**service_account_key:** `typing.Optional[str]` — A new key. It's tried on the verified mailbox before it replaces the old one. +**tenant_id:** `typing.Optional[str]` — The Directory (tenant) ID, for an app that's only for your own tenant. Leave it out for a multi-tenant app.
@@ -24945,7 +27715,7 @@ client.scheduling.calendar_delegations.update(
-**client_secret:** `typing.Optional[str]` — A new client secret. It's tried on the verified mailbox before it replaces the old one. +**webhook_secret:** `typing.Optional[str]` — The Secret Token of your Zoom app, which signs its events at `zoom_event_url`. Never returned.
@@ -24953,7 +27723,23 @@ client.scheduling.calendar_delegations.update(
-**secret_expires_at:** `typing.Optional[datetime.datetime]` — When the Entra client secret expires. Owners and admins are warned 14 days before. +**redirect_uri:** `typing.Optional[str]` — A page on your own domain, registered with the provider, that forwards `code` and `state` to `coss_callback_url`. Google requires this for an external app, since it has to verify the redirect's domain as yours. Leave it out to use `coss_callback_url` directly. + +
+
+ +
+
+ +**completion_url:** `typing.Optional[str]` — Where the browser lands after a consent that didn't name a `return_url`, with `coss_calendar` set to `connected`, `denied` or `invalid`. Leave it out for a plain page saying what happened. + +
+
+ +
+
+ +**secret_expires_at:** `typing.Optional[datetime.datetime]` — When the client secret expires. Owners and admins are warned 14 days before.
@@ -24973,7 +27759,8 @@ client.scheduling.calendar_delegations.update(
-
client.scheduling.calendar_delegations.verify(...) -> SchedulingCalendarDelegation +## Scheduling Sessions +
client.scheduling.sessions.create_for_manager(...) -> SchedulingSession
@@ -24985,7 +27772,7 @@ client.scheduling.calendar_delegations.update(
-Tries one real mailbox. Passing makes it `active`, and its hosts start connecting. Google can take up to 24 hours to apply a new authorization, so a refusal may just need time. +Lets a team lead manage cover for the hosts you name, or those matching an attribute filter whenever it's asked: time off, bookings that need someone else, and moving them. It never sees attendees' details. Send the `url` to their browser, or embed it with `coss/scheduling`.
@@ -25008,9 +27795,11 @@ client = Coss( environment=CossEnvironment.DEFAULT, ) -client.scheduling.calendar_delegations.verify( - id="caldlg_01kd2m9a0b1c2d3e4f5g6h7j8m", - account="ana@example.com", +client.scheduling.sessions.create_for_manager( + host_filter={ + "team": "cardiology" + }, + expires_in=3600, ) ``` @@ -25027,7 +27816,7 @@ client.scheduling.calendar_delegations.verify(
-**id:** `str` — The delegation's id. +**hosts:** `typing.Optional[typing.List[str]]` — The hosts this page can reach, by id or uid.
@@ -25035,7 +27824,23 @@ client.scheduling.calendar_delegations.verify(
-**account:** `str` — A real mailbox on the domain to try. In Microsoft 365, a user principal name. +**host_filter:** `typing.Optional[typing.Dict[str, CreateSchedulingManagerSessionRequestHostFilterValue]]` — Everyone matching these attributes, asked again on every request. + +
+
+ +
+
+ +**expires_in:** `typing.Optional[int]` — Seconds until it stops working. At most a day. + +
+
+ +
+
+ +**read_only:** `typing.Optional[bool]`
@@ -25055,7 +27860,6 @@ client.scheduling.calendar_delegations.verify(
-## Scheduling Sessions
client.scheduling.sessions.create_for_host(...) -> SchedulingSession
@@ -25479,6 +28283,14 @@ client.scheduling.settings.update(
+**privacy_url:** `typing.Optional[str]` — Your privacy policy, as an https URL, for hosts connecting a calendar through your own OAuth app. `null` removes it. + +
+
+ +
+
+ **email_from:** `typing.Optional[str]` — Sender of booking emails, on a verified domain. `null`: coss.com's own address.
@@ -25503,6 +28315,30 @@ client.scheduling.settings.update(
+**name_host_in_attendee_emails:** `typing.Optional[bool]` — Name the new host when telling an attendee their booking has one. + +
+
+ +
+
+ +**host_reassignment:** `typing.Optional[UpdateSchedulingSettingsRequestHostReassignment]` — Whether hosts can give their own bookings to someone else from their page. `eligible` lets them, to anyone free who takes that event type. + +
+
+ +
+
+ +**out_of_office_reasons:** `typing.Optional[typing.List[UpdateSchedulingSettingsRequestOutOfOfficeReasonsItem]]` — Reasons of your own, on top of the preset ones. Hosts and managers see them. + +
+
+ +
+
+ **notifications:** `typing.Optional[typing.Dict[str, typing.Optional[UpdateSchedulingSettingsRequestNotificationsValue]]]` — Per event (`confirmed`, `pending_approval`, `rescheduled`, `cancelled`, `declined`, `reminder`), overriding the defaults. `null` restores them.
diff --git a/sdks/python/src/coss/__init__.py b/sdks/python/src/coss/__init__.py index fb4b11260..38972ac5b 100644 --- a/sdks/python/src/coss/__init__.py +++ b/sdks/python/src/coss/__init__.py @@ -148,6 +148,13 @@ CreateCalendarDelegationRequestMicrosoft, CreateCalendarDelegationRequest_Google, CreateCalendarDelegationRequest_Microsoft, + CreateOauthAppRequest, + CreateOauthAppRequestGoogle, + CreateOauthAppRequestMicrosoft, + CreateOauthAppRequestZoom, + CreateOauthAppRequest_Google, + CreateOauthAppRequest_Microsoft, + CreateOauthAppRequest_Zoom, CreateSeriesRequest, CreateSeriesRequestAnswersValue, CreateSeriesRequestAttributesValue, @@ -220,8 +227,13 @@ DeletedSchedulingCalendarConnectionObject, DeletedSchedulingCalendarDelegation, DeletedSchedulingCalendarDelegationObject, + DeletedSchedulingHolidayCalendar, DeletedSchedulingHost, DeletedSchedulingHostObject, + DeletedSchedulingOauthApp, + DeletedSchedulingOauthAppObject, + DeletedSchedulingOutOfOffice, + DeletedSchedulingOutOfOfficeObject, DeletedSchedulingSchedule, DeletedSchedulingScheduleObject, DeletedSegment, @@ -749,6 +761,16 @@ SchedulingEventTypeObject, SchedulingEventTypeStatus, SchedulingGuestInput, + SchedulingHolidayCalendar, + SchedulingHolidayCalendarExistingBookings, + SchedulingHolidayCalendarHostFilterValue, + SchedulingHolidayCalendarList, + SchedulingHolidayCalendarListObject, + SchedulingHolidayCalendarObject, + SchedulingHolidayCalendarSource, + SchedulingHolidayList, + SchedulingHolidayListDataItem, + SchedulingHolidayListObject, SchedulingHost, SchedulingHostAttributesValue, SchedulingHostList, @@ -766,20 +788,76 @@ SchedulingLimitPeriod, SchedulingLimitScope, SchedulingLocation, - SchedulingLocationGoogleMeet, - SchedulingLocationInPerson, - SchedulingLocationLink, - SchedulingLocationMicrosoftTeams, - SchedulingLocationPhone, - SchedulingLocationZoom, - SchedulingLocation_GoogleMeet, - SchedulingLocation_InPerson, - SchedulingLocation_Link, - SchedulingLocation_MicrosoftTeams, - SchedulingLocation_Phone, - SchedulingLocation_Zoom, + SchedulingLocationAddress, + SchedulingLocationAddressType, + SchedulingLocationFive, + SchedulingLocationFiveType, + SchedulingLocationFour, + SchedulingLocationFourType, + SchedulingLocationNumber, + SchedulingLocationNumberType, + SchedulingLocationThree, + SchedulingLocationThreeType, + SchedulingLocationZero, + SchedulingLocationZeroType, + SchedulingOauthApp, + SchedulingOauthAppList, + SchedulingOauthAppListObject, + SchedulingOauthAppObject, + SchedulingOauthAppProvider, + SchedulingOauthAppStatus, + SchedulingOauthAppWebhookEvent, + SchedulingOauthAppWebhookEventData, + SchedulingOauthAppWebhookEventObject, + SchedulingOauthAppWebhookEventType, + SchedulingOutOfOffice, + SchedulingOutOfOfficeAllDay, + SchedulingOutOfOfficeConflict, + SchedulingOutOfOfficeConflictList, + SchedulingOutOfOfficeConflictListObject, + SchedulingOutOfOfficeConflictObject, + SchedulingOutOfOfficeConflictStatus, + SchedulingOutOfOfficeExistingBookings, + SchedulingOutOfOfficeList, + SchedulingOutOfOfficeListObject, + SchedulingOutOfOfficeObject, + SchedulingOutOfOfficeSource, + SchedulingOutOfOfficeWebhookEvent, + SchedulingOutOfOfficeWebhookEventData, + SchedulingOutOfOfficeWebhookEventObject, + SchedulingOutOfOfficeWebhookEventType, SchedulingQuestion, SchedulingQuestionType, + SchedulingReassignCandidate, + SchedulingReassignCandidateList, + SchedulingReassignCandidateListObject, + SchedulingReassignCandidateObject, + SchedulingReassignment, + SchedulingReassignmentCounts, + SchedulingReassignmentItem, + SchedulingReassignmentItemList, + SchedulingReassignmentItemListObject, + SchedulingReassignmentItemObject, + SchedulingReassignmentItemOutcome, + SchedulingReassignmentList, + SchedulingReassignmentListObject, + SchedulingReassignmentObject, + SchedulingReassignmentPreview, + SchedulingReassignmentPreviewItemsItem, + SchedulingReassignmentPreviewItemsItemStatus, + SchedulingReassignmentPreviewObject, + SchedulingReassignmentReasonCode, + SchedulingReassignmentSelection, + SchedulingReassignmentStatus, + SchedulingReassignmentStrategy, + SchedulingReassignmentStrategyAssignmentsItem, + SchedulingReassignmentStrategyOtherwise, + SchedulingReassignmentWebhookEvent, + SchedulingReassignmentWebhookEventData, + SchedulingReassignmentWebhookEventDataCounts, + SchedulingReassignmentWebhookEventDataStatus, + SchedulingReassignmentWebhookEventObject, + SchedulingReassignmentWebhookEventType, SchedulingReminder, SchedulingReminderAnchor, SchedulingReminderButton, @@ -810,10 +888,12 @@ SchedulingSessionObject, SchedulingSettings, SchedulingSettingsCalendarFailureMode, + SchedulingSettingsHostReassignment, SchedulingSettingsLogo, SchedulingSettingsLogoContentType, SchedulingSettingsNotificationsValue, SchedulingSettingsObject, + SchedulingSettingsOutOfOfficeReasonsItem, SchedulingSlot, SchedulingSlotExplanation, SchedulingSlotExplanationHostsItem, @@ -1331,6 +1411,13 @@ "CreateFormRequestSpamOnReview": ".resources", "CreateFormRequestSubmitter": ".resources", "CreateLogDrainRequestFormat": ".resources", + "CreateOauthAppRequest": ".types", + "CreateOauthAppRequestGoogle": ".types", + "CreateOauthAppRequestMicrosoft": ".types", + "CreateOauthAppRequestZoom": ".types", + "CreateOauthAppRequest_Google": ".types", + "CreateOauthAppRequest_Microsoft": ".types", + "CreateOauthAppRequest_Zoom": ".types", "CreateRiskAssessmentRequestCaptcha": ".resources", "CreateRiskAssessmentRequestContent": ".resources", "CreateRiskAssessmentRequestDevice": ".resources", @@ -1414,8 +1501,13 @@ "DeletedSchedulingCalendarConnectionObject": ".types", "DeletedSchedulingCalendarDelegation": ".types", "DeletedSchedulingCalendarDelegationObject": ".types", + "DeletedSchedulingHolidayCalendar": ".types", "DeletedSchedulingHost": ".types", "DeletedSchedulingHostObject": ".types", + "DeletedSchedulingOauthApp": ".types", + "DeletedSchedulingOauthAppObject": ".types", + "DeletedSchedulingOutOfOffice": ".types", + "DeletedSchedulingOutOfOfficeObject": ".types", "DeletedSchedulingSchedule": ".types", "DeletedSchedulingScheduleObject": ".types", "DeletedSegment": ".types", @@ -1948,6 +2040,16 @@ "SchedulingEventTypeObject": ".types", "SchedulingEventTypeStatus": ".types", "SchedulingGuestInput": ".types", + "SchedulingHolidayCalendar": ".types", + "SchedulingHolidayCalendarExistingBookings": ".types", + "SchedulingHolidayCalendarHostFilterValue": ".types", + "SchedulingHolidayCalendarList": ".types", + "SchedulingHolidayCalendarListObject": ".types", + "SchedulingHolidayCalendarObject": ".types", + "SchedulingHolidayCalendarSource": ".types", + "SchedulingHolidayList": ".types", + "SchedulingHolidayListDataItem": ".types", + "SchedulingHolidayListObject": ".types", "SchedulingHost": ".types", "SchedulingHostAttributesValue": ".types", "SchedulingHostList": ".types", @@ -1965,20 +2067,76 @@ "SchedulingLimitPeriod": ".types", "SchedulingLimitScope": ".types", "SchedulingLocation": ".types", - "SchedulingLocationGoogleMeet": ".types", - "SchedulingLocationInPerson": ".types", - "SchedulingLocationLink": ".types", - "SchedulingLocationMicrosoftTeams": ".types", - "SchedulingLocationPhone": ".types", - "SchedulingLocationZoom": ".types", - "SchedulingLocation_GoogleMeet": ".types", - "SchedulingLocation_InPerson": ".types", - "SchedulingLocation_Link": ".types", - "SchedulingLocation_MicrosoftTeams": ".types", - "SchedulingLocation_Phone": ".types", - "SchedulingLocation_Zoom": ".types", + "SchedulingLocationAddress": ".types", + "SchedulingLocationAddressType": ".types", + "SchedulingLocationFive": ".types", + "SchedulingLocationFiveType": ".types", + "SchedulingLocationFour": ".types", + "SchedulingLocationFourType": ".types", + "SchedulingLocationNumber": ".types", + "SchedulingLocationNumberType": ".types", + "SchedulingLocationThree": ".types", + "SchedulingLocationThreeType": ".types", + "SchedulingLocationZero": ".types", + "SchedulingLocationZeroType": ".types", + "SchedulingOauthApp": ".types", + "SchedulingOauthAppList": ".types", + "SchedulingOauthAppListObject": ".types", + "SchedulingOauthAppObject": ".types", + "SchedulingOauthAppProvider": ".types", + "SchedulingOauthAppStatus": ".types", + "SchedulingOauthAppWebhookEvent": ".types", + "SchedulingOauthAppWebhookEventData": ".types", + "SchedulingOauthAppWebhookEventObject": ".types", + "SchedulingOauthAppWebhookEventType": ".types", + "SchedulingOutOfOffice": ".types", + "SchedulingOutOfOfficeAllDay": ".types", + "SchedulingOutOfOfficeConflict": ".types", + "SchedulingOutOfOfficeConflictList": ".types", + "SchedulingOutOfOfficeConflictListObject": ".types", + "SchedulingOutOfOfficeConflictObject": ".types", + "SchedulingOutOfOfficeConflictStatus": ".types", + "SchedulingOutOfOfficeExistingBookings": ".types", + "SchedulingOutOfOfficeList": ".types", + "SchedulingOutOfOfficeListObject": ".types", + "SchedulingOutOfOfficeObject": ".types", + "SchedulingOutOfOfficeSource": ".types", + "SchedulingOutOfOfficeWebhookEvent": ".types", + "SchedulingOutOfOfficeWebhookEventData": ".types", + "SchedulingOutOfOfficeWebhookEventObject": ".types", + "SchedulingOutOfOfficeWebhookEventType": ".types", "SchedulingQuestion": ".types", "SchedulingQuestionType": ".types", + "SchedulingReassignCandidate": ".types", + "SchedulingReassignCandidateList": ".types", + "SchedulingReassignCandidateListObject": ".types", + "SchedulingReassignCandidateObject": ".types", + "SchedulingReassignment": ".types", + "SchedulingReassignmentCounts": ".types", + "SchedulingReassignmentItem": ".types", + "SchedulingReassignmentItemList": ".types", + "SchedulingReassignmentItemListObject": ".types", + "SchedulingReassignmentItemObject": ".types", + "SchedulingReassignmentItemOutcome": ".types", + "SchedulingReassignmentList": ".types", + "SchedulingReassignmentListObject": ".types", + "SchedulingReassignmentObject": ".types", + "SchedulingReassignmentPreview": ".types", + "SchedulingReassignmentPreviewItemsItem": ".types", + "SchedulingReassignmentPreviewItemsItemStatus": ".types", + "SchedulingReassignmentPreviewObject": ".types", + "SchedulingReassignmentReasonCode": ".types", + "SchedulingReassignmentSelection": ".types", + "SchedulingReassignmentStatus": ".types", + "SchedulingReassignmentStrategy": ".types", + "SchedulingReassignmentStrategyAssignmentsItem": ".types", + "SchedulingReassignmentStrategyOtherwise": ".types", + "SchedulingReassignmentWebhookEvent": ".types", + "SchedulingReassignmentWebhookEventData": ".types", + "SchedulingReassignmentWebhookEventDataCounts": ".types", + "SchedulingReassignmentWebhookEventDataStatus": ".types", + "SchedulingReassignmentWebhookEventObject": ".types", + "SchedulingReassignmentWebhookEventType": ".types", "SchedulingReminder": ".types", "SchedulingReminderAnchor": ".types", "SchedulingReminderButton": ".types", @@ -2009,10 +2167,12 @@ "SchedulingSessionObject": ".types", "SchedulingSettings": ".types", "SchedulingSettingsCalendarFailureMode": ".types", + "SchedulingSettingsHostReassignment": ".types", "SchedulingSettingsLogo": ".types", "SchedulingSettingsLogoContentType": ".types", "SchedulingSettingsNotificationsValue": ".types", "SchedulingSettingsObject": ".types", + "SchedulingSettingsOutOfOfficeReasonsItem": ".types", "SchedulingSlot": ".types", "SchedulingSlotExplanation": ".types", "SchedulingSlotExplanationHostsItem": ".types", @@ -2521,6 +2681,13 @@ def __dir__(): "CreateFormRequestSpamOnReview", "CreateFormRequestSubmitter", "CreateLogDrainRequestFormat", + "CreateOauthAppRequest", + "CreateOauthAppRequestGoogle", + "CreateOauthAppRequestMicrosoft", + "CreateOauthAppRequestZoom", + "CreateOauthAppRequest_Google", + "CreateOauthAppRequest_Microsoft", + "CreateOauthAppRequest_Zoom", "CreateRiskAssessmentRequestCaptcha", "CreateRiskAssessmentRequestContent", "CreateRiskAssessmentRequestDevice", @@ -2604,8 +2771,13 @@ def __dir__(): "DeletedSchedulingCalendarConnectionObject", "DeletedSchedulingCalendarDelegation", "DeletedSchedulingCalendarDelegationObject", + "DeletedSchedulingHolidayCalendar", "DeletedSchedulingHost", "DeletedSchedulingHostObject", + "DeletedSchedulingOauthApp", + "DeletedSchedulingOauthAppObject", + "DeletedSchedulingOutOfOffice", + "DeletedSchedulingOutOfOfficeObject", "DeletedSchedulingSchedule", "DeletedSchedulingScheduleObject", "DeletedSegment", @@ -3138,6 +3310,16 @@ def __dir__(): "SchedulingEventTypeObject", "SchedulingEventTypeStatus", "SchedulingGuestInput", + "SchedulingHolidayCalendar", + "SchedulingHolidayCalendarExistingBookings", + "SchedulingHolidayCalendarHostFilterValue", + "SchedulingHolidayCalendarList", + "SchedulingHolidayCalendarListObject", + "SchedulingHolidayCalendarObject", + "SchedulingHolidayCalendarSource", + "SchedulingHolidayList", + "SchedulingHolidayListDataItem", + "SchedulingHolidayListObject", "SchedulingHost", "SchedulingHostAttributesValue", "SchedulingHostList", @@ -3155,20 +3337,76 @@ def __dir__(): "SchedulingLimitPeriod", "SchedulingLimitScope", "SchedulingLocation", - "SchedulingLocationGoogleMeet", - "SchedulingLocationInPerson", - "SchedulingLocationLink", - "SchedulingLocationMicrosoftTeams", - "SchedulingLocationPhone", - "SchedulingLocationZoom", - "SchedulingLocation_GoogleMeet", - "SchedulingLocation_InPerson", - "SchedulingLocation_Link", - "SchedulingLocation_MicrosoftTeams", - "SchedulingLocation_Phone", - "SchedulingLocation_Zoom", + "SchedulingLocationAddress", + "SchedulingLocationAddressType", + "SchedulingLocationFive", + "SchedulingLocationFiveType", + "SchedulingLocationFour", + "SchedulingLocationFourType", + "SchedulingLocationNumber", + "SchedulingLocationNumberType", + "SchedulingLocationThree", + "SchedulingLocationThreeType", + "SchedulingLocationZero", + "SchedulingLocationZeroType", + "SchedulingOauthApp", + "SchedulingOauthAppList", + "SchedulingOauthAppListObject", + "SchedulingOauthAppObject", + "SchedulingOauthAppProvider", + "SchedulingOauthAppStatus", + "SchedulingOauthAppWebhookEvent", + "SchedulingOauthAppWebhookEventData", + "SchedulingOauthAppWebhookEventObject", + "SchedulingOauthAppWebhookEventType", + "SchedulingOutOfOffice", + "SchedulingOutOfOfficeAllDay", + "SchedulingOutOfOfficeConflict", + "SchedulingOutOfOfficeConflictList", + "SchedulingOutOfOfficeConflictListObject", + "SchedulingOutOfOfficeConflictObject", + "SchedulingOutOfOfficeConflictStatus", + "SchedulingOutOfOfficeExistingBookings", + "SchedulingOutOfOfficeList", + "SchedulingOutOfOfficeListObject", + "SchedulingOutOfOfficeObject", + "SchedulingOutOfOfficeSource", + "SchedulingOutOfOfficeWebhookEvent", + "SchedulingOutOfOfficeWebhookEventData", + "SchedulingOutOfOfficeWebhookEventObject", + "SchedulingOutOfOfficeWebhookEventType", "SchedulingQuestion", "SchedulingQuestionType", + "SchedulingReassignCandidate", + "SchedulingReassignCandidateList", + "SchedulingReassignCandidateListObject", + "SchedulingReassignCandidateObject", + "SchedulingReassignment", + "SchedulingReassignmentCounts", + "SchedulingReassignmentItem", + "SchedulingReassignmentItemList", + "SchedulingReassignmentItemListObject", + "SchedulingReassignmentItemObject", + "SchedulingReassignmentItemOutcome", + "SchedulingReassignmentList", + "SchedulingReassignmentListObject", + "SchedulingReassignmentObject", + "SchedulingReassignmentPreview", + "SchedulingReassignmentPreviewItemsItem", + "SchedulingReassignmentPreviewItemsItemStatus", + "SchedulingReassignmentPreviewObject", + "SchedulingReassignmentReasonCode", + "SchedulingReassignmentSelection", + "SchedulingReassignmentStatus", + "SchedulingReassignmentStrategy", + "SchedulingReassignmentStrategyAssignmentsItem", + "SchedulingReassignmentStrategyOtherwise", + "SchedulingReassignmentWebhookEvent", + "SchedulingReassignmentWebhookEventData", + "SchedulingReassignmentWebhookEventDataCounts", + "SchedulingReassignmentWebhookEventDataStatus", + "SchedulingReassignmentWebhookEventObject", + "SchedulingReassignmentWebhookEventType", "SchedulingReminder", "SchedulingReminderAnchor", "SchedulingReminderButton", @@ -3199,10 +3437,12 @@ def __dir__(): "SchedulingSessionObject", "SchedulingSettings", "SchedulingSettingsCalendarFailureMode", + "SchedulingSettingsHostReassignment", "SchedulingSettingsLogo", "SchedulingSettingsLogoContentType", "SchedulingSettingsNotificationsValue", "SchedulingSettingsObject", + "SchedulingSettingsOutOfOfficeReasonsItem", "SchedulingSlot", "SchedulingSlotExplanation", "SchedulingSlotExplanationHostsItem", diff --git a/sdks/python/src/coss/core/client_wrapper.py b/sdks/python/src/coss/core/client_wrapper.py index ea526f3a2..4a3d0565b 100644 --- a/sdks/python/src/coss/core/client_wrapper.py +++ b/sdks/python/src/coss/core/client_wrapper.py @@ -35,12 +35,12 @@ def get_headers(self, *, include_token: bool = True) -> typing.Dict[str, str]: import platform headers: typing.Dict[str, str] = { - "User-Agent": "coss-python/0.3.0", + "User-Agent": "coss-python/0.4.0", "X-Fern-Language": "Python", "X-Fern-Runtime": f"python/{platform.python_version()}", "X-Fern-Platform": f"{platform.system().lower()}/{platform.release()}", "X-Fern-SDK-Name": "coss", - "X-Fern-SDK-Version": "0.3.0", + "X-Fern-SDK-Version": "0.4.0", **(self.get_custom_headers() or {}), } if self._api_version is not None: diff --git a/sdks/python/src/coss/resources/scheduling/__init__.py b/sdks/python/src/coss/resources/scheduling/__init__.py index 17bf1b16a..a071fdffb 100644 --- a/sdks/python/src/coss/resources/scheduling/__init__.py +++ b/sdks/python/src/coss/resources/scheduling/__init__.py @@ -46,17 +46,47 @@ CreateHostRequestAttributesValue, CreateSchedulingBookerSessionRequestAttendee, CreateSchedulingBookerSessionRequestAttributesValue, + CreateSchedulingHolidayCalendarRequestExistingBookings, + CreateSchedulingHolidayCalendarRequestHostFilterValue, + CreateSchedulingManagerSessionRequestHostFilterValue, + CreateSchedulingOutOfOfficeRequestExistingBookings, + CreateSchedulingOutOfOfficeRequestHostFilterValue, + CreateSchedulingOutOfOfficeRequestReassign, + CreateSchedulingOutOfOfficeRequestReassignOtherwise, + CreateSchedulingReassignmentRequestNotify, + CreateSchedulingReassignmentRequestNotifyHosts, + CreateSchedulingReassignmentRequestOverridesItem, + CreateSchedulingReassignmentRequestReasonCode, ListBookingsRequestStatus, + PreviewSchedulingReassignmentRequestOverridesItem, + PutSchedulingOutOfOfficeRequestExistingBookings, + PutSchedulingOutOfOfficeRequestReassign, + PutSchedulingOutOfOfficeRequestReassignOtherwise, + ReassignSchedulingBookingRequestChangesItem, + ReassignSchedulingBookingRequestNotify, + ReassignSchedulingBookingRequestOverridesItem, + ReassignSchedulingBookingRequestReasonCode, SetSimulatedBusyRequestIntervalsItem, + UndoSchedulingReassignmentRequestNotify, + UndoSchedulingReassignmentRequestNotifyHosts, + UndoSchedulingReassignmentRequestOverridesItem, + UndoSchedulingReassignmentRequestReasonCode, UpdateEventTypeRequestHostCalendarDetails, UpdateEventTypeRequestHostFilterValue, UpdateEventTypeRequestNotificationsValue, UpdateEventTypeRequestStatus, UpdateHostRequestAttributesValue, UpdateHostRequestStatus, + UpdateSchedulingHolidayCalendarRequestExistingBookings, + UpdateSchedulingHolidayCalendarRequestHostFilterValue, + UpdateSchedulingOutOfOfficeRequestExistingBookings, + UpdateSchedulingOutOfOfficeRequestReassign, + UpdateSchedulingOutOfOfficeRequestReassignOtherwise, UpdateSchedulingSettingsRequestCalendarFailureMode, + UpdateSchedulingSettingsRequestHostReassignment, UpdateSchedulingSettingsRequestLogo, UpdateSchedulingSettingsRequestNotificationsValue, + UpdateSchedulingSettingsRequestOutOfOfficeReasonsItem, attendees, availability, bookings, @@ -64,7 +94,11 @@ calendars, event_types, holds, + holiday_calendars, hosts, + oauth_apps, + out_of_office, + reassignments, schedules, series, sessions, @@ -111,17 +145,47 @@ "CreateHostRequestAttributesValue": ".resources", "CreateSchedulingBookerSessionRequestAttendee": ".resources", "CreateSchedulingBookerSessionRequestAttributesValue": ".resources", + "CreateSchedulingHolidayCalendarRequestExistingBookings": ".resources", + "CreateSchedulingHolidayCalendarRequestHostFilterValue": ".resources", + "CreateSchedulingManagerSessionRequestHostFilterValue": ".resources", + "CreateSchedulingOutOfOfficeRequestExistingBookings": ".resources", + "CreateSchedulingOutOfOfficeRequestHostFilterValue": ".resources", + "CreateSchedulingOutOfOfficeRequestReassign": ".resources", + "CreateSchedulingOutOfOfficeRequestReassignOtherwise": ".resources", + "CreateSchedulingReassignmentRequestNotify": ".resources", + "CreateSchedulingReassignmentRequestNotifyHosts": ".resources", + "CreateSchedulingReassignmentRequestOverridesItem": ".resources", + "CreateSchedulingReassignmentRequestReasonCode": ".resources", "ListBookingsRequestStatus": ".resources", + "PreviewSchedulingReassignmentRequestOverridesItem": ".resources", + "PutSchedulingOutOfOfficeRequestExistingBookings": ".resources", + "PutSchedulingOutOfOfficeRequestReassign": ".resources", + "PutSchedulingOutOfOfficeRequestReassignOtherwise": ".resources", + "ReassignSchedulingBookingRequestChangesItem": ".resources", + "ReassignSchedulingBookingRequestNotify": ".resources", + "ReassignSchedulingBookingRequestOverridesItem": ".resources", + "ReassignSchedulingBookingRequestReasonCode": ".resources", "SetSimulatedBusyRequestIntervalsItem": ".resources", + "UndoSchedulingReassignmentRequestNotify": ".resources", + "UndoSchedulingReassignmentRequestNotifyHosts": ".resources", + "UndoSchedulingReassignmentRequestOverridesItem": ".resources", + "UndoSchedulingReassignmentRequestReasonCode": ".resources", "UpdateEventTypeRequestHostCalendarDetails": ".resources", "UpdateEventTypeRequestHostFilterValue": ".resources", "UpdateEventTypeRequestNotificationsValue": ".resources", "UpdateEventTypeRequestStatus": ".resources", "UpdateHostRequestAttributesValue": ".resources", "UpdateHostRequestStatus": ".resources", + "UpdateSchedulingHolidayCalendarRequestExistingBookings": ".resources", + "UpdateSchedulingHolidayCalendarRequestHostFilterValue": ".resources", + "UpdateSchedulingOutOfOfficeRequestExistingBookings": ".resources", + "UpdateSchedulingOutOfOfficeRequestReassign": ".resources", + "UpdateSchedulingOutOfOfficeRequestReassignOtherwise": ".resources", "UpdateSchedulingSettingsRequestCalendarFailureMode": ".resources", + "UpdateSchedulingSettingsRequestHostReassignment": ".resources", "UpdateSchedulingSettingsRequestLogo": ".resources", "UpdateSchedulingSettingsRequestNotificationsValue": ".resources", + "UpdateSchedulingSettingsRequestOutOfOfficeReasonsItem": ".resources", "attendees": ".resources", "availability": ".resources", "bookings": ".resources", @@ -129,7 +193,11 @@ "calendars": ".resources", "event_types": ".resources", "holds": ".resources", + "holiday_calendars": ".resources", "hosts": ".resources", + "oauth_apps": ".resources", + "out_of_office": ".resources", + "reassignments": ".resources", "schedules": ".resources", "series": ".resources", "sessions": ".resources", @@ -199,17 +267,47 @@ def __dir__(): "CreateHostRequestAttributesValue", "CreateSchedulingBookerSessionRequestAttendee", "CreateSchedulingBookerSessionRequestAttributesValue", + "CreateSchedulingHolidayCalendarRequestExistingBookings", + "CreateSchedulingHolidayCalendarRequestHostFilterValue", + "CreateSchedulingManagerSessionRequestHostFilterValue", + "CreateSchedulingOutOfOfficeRequestExistingBookings", + "CreateSchedulingOutOfOfficeRequestHostFilterValue", + "CreateSchedulingOutOfOfficeRequestReassign", + "CreateSchedulingOutOfOfficeRequestReassignOtherwise", + "CreateSchedulingReassignmentRequestNotify", + "CreateSchedulingReassignmentRequestNotifyHosts", + "CreateSchedulingReassignmentRequestOverridesItem", + "CreateSchedulingReassignmentRequestReasonCode", "ListBookingsRequestStatus", + "PreviewSchedulingReassignmentRequestOverridesItem", + "PutSchedulingOutOfOfficeRequestExistingBookings", + "PutSchedulingOutOfOfficeRequestReassign", + "PutSchedulingOutOfOfficeRequestReassignOtherwise", + "ReassignSchedulingBookingRequestChangesItem", + "ReassignSchedulingBookingRequestNotify", + "ReassignSchedulingBookingRequestOverridesItem", + "ReassignSchedulingBookingRequestReasonCode", "SetSimulatedBusyRequestIntervalsItem", + "UndoSchedulingReassignmentRequestNotify", + "UndoSchedulingReassignmentRequestNotifyHosts", + "UndoSchedulingReassignmentRequestOverridesItem", + "UndoSchedulingReassignmentRequestReasonCode", "UpdateEventTypeRequestHostCalendarDetails", "UpdateEventTypeRequestHostFilterValue", "UpdateEventTypeRequestNotificationsValue", "UpdateEventTypeRequestStatus", "UpdateHostRequestAttributesValue", "UpdateHostRequestStatus", + "UpdateSchedulingHolidayCalendarRequestExistingBookings", + "UpdateSchedulingHolidayCalendarRequestHostFilterValue", + "UpdateSchedulingOutOfOfficeRequestExistingBookings", + "UpdateSchedulingOutOfOfficeRequestReassign", + "UpdateSchedulingOutOfOfficeRequestReassignOtherwise", "UpdateSchedulingSettingsRequestCalendarFailureMode", + "UpdateSchedulingSettingsRequestHostReassignment", "UpdateSchedulingSettingsRequestLogo", "UpdateSchedulingSettingsRequestNotificationsValue", + "UpdateSchedulingSettingsRequestOutOfOfficeReasonsItem", "attendees", "availability", "bookings", @@ -217,7 +315,11 @@ def __dir__(): "calendars", "event_types", "holds", + "holiday_calendars", "hosts", + "oauth_apps", + "out_of_office", + "reassignments", "schedules", "series", "sessions", diff --git a/sdks/python/src/coss/resources/scheduling/client.py b/sdks/python/src/coss/resources/scheduling/client.py index f0a3333a0..448a7891f 100644 --- a/sdks/python/src/coss/resources/scheduling/client.py +++ b/sdks/python/src/coss/resources/scheduling/client.py @@ -15,7 +15,11 @@ from .resources.calendars.client import AsyncCalendarsClient, CalendarsClient from .resources.event_types.client import AsyncEventTypesClient, EventTypesClient from .resources.holds.client import AsyncHoldsClient, HoldsClient + from .resources.holiday_calendars.client import AsyncHolidayCalendarsClient, HolidayCalendarsClient from .resources.hosts.client import AsyncHostsClient, HostsClient + from .resources.oauth_apps.client import AsyncOauthAppsClient, OauthAppsClient + from .resources.out_of_office.client import AsyncOutOfOfficeClient, OutOfOfficeClient + from .resources.reassignments.client import AsyncReassignmentsClient, ReassignmentsClient from .resources.schedules.client import AsyncSchedulesClient, SchedulesClient from .resources.series.client import AsyncSeriesClient, SeriesClient from .resources.sessions.client import AsyncSessionsClient, SessionsClient @@ -28,16 +32,20 @@ def __init__(self, *, client_wrapper: SyncClientWrapper): self._raw_client = RawSchedulingClient(client_wrapper=client_wrapper) self._client_wrapper = client_wrapper self._hosts: typing.Optional[HostsClient] = None + self._bookings: typing.Optional[BookingsClient] = None + self._reassignments: typing.Optional[ReassignmentsClient] = None + self._holiday_calendars: typing.Optional[HolidayCalendarsClient] = None + self._out_of_office: typing.Optional[OutOfOfficeClient] = None self._schedules: typing.Optional[SchedulesClient] = None self._event_types: typing.Optional[EventTypesClient] = None self._slots: typing.Optional[SlotsClient] = None self._availability: typing.Optional[AvailabilityClient] = None - self._bookings: typing.Optional[BookingsClient] = None self._holds: typing.Optional[HoldsClient] = None self._series: typing.Optional[SeriesClient] = None self._attendees: typing.Optional[AttendeesClient] = None self._calendars: typing.Optional[CalendarsClient] = None self._calendar_delegations: typing.Optional[CalendarDelegationsClient] = None + self._oauth_apps: typing.Optional[OauthAppsClient] = None self._sessions: typing.Optional[SessionsClient] = None self._settings: typing.Optional[SettingsClient] = None @@ -60,6 +68,38 @@ def hosts(self): self._hosts = HostsClient(client_wrapper=self._client_wrapper) return self._hosts + @property + def bookings(self): + if self._bookings is None: + from .resources.bookings.client import BookingsClient # noqa: E402 + + self._bookings = BookingsClient(client_wrapper=self._client_wrapper) + return self._bookings + + @property + def reassignments(self): + if self._reassignments is None: + from .resources.reassignments.client import ReassignmentsClient # noqa: E402 + + self._reassignments = ReassignmentsClient(client_wrapper=self._client_wrapper) + return self._reassignments + + @property + def holiday_calendars(self): + if self._holiday_calendars is None: + from .resources.holiday_calendars.client import HolidayCalendarsClient # noqa: E402 + + self._holiday_calendars = HolidayCalendarsClient(client_wrapper=self._client_wrapper) + return self._holiday_calendars + + @property + def out_of_office(self): + if self._out_of_office is None: + from .resources.out_of_office.client import OutOfOfficeClient # noqa: E402 + + self._out_of_office = OutOfOfficeClient(client_wrapper=self._client_wrapper) + return self._out_of_office + @property def schedules(self): if self._schedules is None: @@ -92,14 +132,6 @@ def availability(self): self._availability = AvailabilityClient(client_wrapper=self._client_wrapper) return self._availability - @property - def bookings(self): - if self._bookings is None: - from .resources.bookings.client import BookingsClient # noqa: E402 - - self._bookings = BookingsClient(client_wrapper=self._client_wrapper) - return self._bookings - @property def holds(self): if self._holds is None: @@ -140,6 +172,14 @@ def calendar_delegations(self): self._calendar_delegations = CalendarDelegationsClient(client_wrapper=self._client_wrapper) return self._calendar_delegations + @property + def oauth_apps(self): + if self._oauth_apps is None: + from .resources.oauth_apps.client import OauthAppsClient # noqa: E402 + + self._oauth_apps = OauthAppsClient(client_wrapper=self._client_wrapper) + return self._oauth_apps + @property def sessions(self): if self._sessions is None: @@ -162,16 +202,20 @@ def __init__(self, *, client_wrapper: AsyncClientWrapper): self._raw_client = AsyncRawSchedulingClient(client_wrapper=client_wrapper) self._client_wrapper = client_wrapper self._hosts: typing.Optional[AsyncHostsClient] = None + self._bookings: typing.Optional[AsyncBookingsClient] = None + self._reassignments: typing.Optional[AsyncReassignmentsClient] = None + self._holiday_calendars: typing.Optional[AsyncHolidayCalendarsClient] = None + self._out_of_office: typing.Optional[AsyncOutOfOfficeClient] = None self._schedules: typing.Optional[AsyncSchedulesClient] = None self._event_types: typing.Optional[AsyncEventTypesClient] = None self._slots: typing.Optional[AsyncSlotsClient] = None self._availability: typing.Optional[AsyncAvailabilityClient] = None - self._bookings: typing.Optional[AsyncBookingsClient] = None self._holds: typing.Optional[AsyncHoldsClient] = None self._series: typing.Optional[AsyncSeriesClient] = None self._attendees: typing.Optional[AsyncAttendeesClient] = None self._calendars: typing.Optional[AsyncCalendarsClient] = None self._calendar_delegations: typing.Optional[AsyncCalendarDelegationsClient] = None + self._oauth_apps: typing.Optional[AsyncOauthAppsClient] = None self._sessions: typing.Optional[AsyncSessionsClient] = None self._settings: typing.Optional[AsyncSettingsClient] = None @@ -194,6 +238,38 @@ def hosts(self): self._hosts = AsyncHostsClient(client_wrapper=self._client_wrapper) return self._hosts + @property + def bookings(self): + if self._bookings is None: + from .resources.bookings.client import AsyncBookingsClient # noqa: E402 + + self._bookings = AsyncBookingsClient(client_wrapper=self._client_wrapper) + return self._bookings + + @property + def reassignments(self): + if self._reassignments is None: + from .resources.reassignments.client import AsyncReassignmentsClient # noqa: E402 + + self._reassignments = AsyncReassignmentsClient(client_wrapper=self._client_wrapper) + return self._reassignments + + @property + def holiday_calendars(self): + if self._holiday_calendars is None: + from .resources.holiday_calendars.client import AsyncHolidayCalendarsClient # noqa: E402 + + self._holiday_calendars = AsyncHolidayCalendarsClient(client_wrapper=self._client_wrapper) + return self._holiday_calendars + + @property + def out_of_office(self): + if self._out_of_office is None: + from .resources.out_of_office.client import AsyncOutOfOfficeClient # noqa: E402 + + self._out_of_office = AsyncOutOfOfficeClient(client_wrapper=self._client_wrapper) + return self._out_of_office + @property def schedules(self): if self._schedules is None: @@ -226,14 +302,6 @@ def availability(self): self._availability = AsyncAvailabilityClient(client_wrapper=self._client_wrapper) return self._availability - @property - def bookings(self): - if self._bookings is None: - from .resources.bookings.client import AsyncBookingsClient # noqa: E402 - - self._bookings = AsyncBookingsClient(client_wrapper=self._client_wrapper) - return self._bookings - @property def holds(self): if self._holds is None: @@ -274,6 +342,14 @@ def calendar_delegations(self): self._calendar_delegations = AsyncCalendarDelegationsClient(client_wrapper=self._client_wrapper) return self._calendar_delegations + @property + def oauth_apps(self): + if self._oauth_apps is None: + from .resources.oauth_apps.client import AsyncOauthAppsClient # noqa: E402 + + self._oauth_apps = AsyncOauthAppsClient(client_wrapper=self._client_wrapper) + return self._oauth_apps + @property def sessions(self): if self._sessions is None: diff --git a/sdks/python/src/coss/resources/scheduling/resources/__init__.py b/sdks/python/src/coss/resources/scheduling/resources/__init__.py index d9201abea..bc3adc8da 100644 --- a/sdks/python/src/coss/resources/scheduling/resources/__init__.py +++ b/sdks/python/src/coss/resources/scheduling/resources/__init__.py @@ -14,7 +14,11 @@ calendars, event_types, holds, + holiday_calendars, hosts, + oauth_apps, + out_of_office, + reassignments, schedules, series, sessions, @@ -39,6 +43,10 @@ CreateBookingRequestLocation_Phone, CreateBookingRequestLocation_Zoom, ListBookingsRequestStatus, + ReassignSchedulingBookingRequestChangesItem, + ReassignSchedulingBookingRequestNotify, + ReassignSchedulingBookingRequestOverridesItem, + ReassignSchedulingBookingRequestReasonCode, ) from .calendars import AuthorizeCalendarRequestProvider, SetSimulatedBusyRequestIntervalsItem from .event_types import ( @@ -68,15 +76,47 @@ CreateHoldRequestLocation_Phone, CreateHoldRequestLocation_Zoom, ) + from .holiday_calendars import ( + CreateSchedulingHolidayCalendarRequestExistingBookings, + CreateSchedulingHolidayCalendarRequestHostFilterValue, + UpdateSchedulingHolidayCalendarRequestExistingBookings, + UpdateSchedulingHolidayCalendarRequestHostFilterValue, + ) from .hosts import CreateHostRequestAttributesValue, UpdateHostRequestAttributesValue, UpdateHostRequestStatus + from .out_of_office import ( + CreateSchedulingOutOfOfficeRequestExistingBookings, + CreateSchedulingOutOfOfficeRequestHostFilterValue, + CreateSchedulingOutOfOfficeRequestReassign, + CreateSchedulingOutOfOfficeRequestReassignOtherwise, + PutSchedulingOutOfOfficeRequestExistingBookings, + PutSchedulingOutOfOfficeRequestReassign, + PutSchedulingOutOfOfficeRequestReassignOtherwise, + UpdateSchedulingOutOfOfficeRequestExistingBookings, + UpdateSchedulingOutOfOfficeRequestReassign, + UpdateSchedulingOutOfOfficeRequestReassignOtherwise, + ) + from .reassignments import ( + CreateSchedulingReassignmentRequestNotify, + CreateSchedulingReassignmentRequestNotifyHosts, + CreateSchedulingReassignmentRequestOverridesItem, + CreateSchedulingReassignmentRequestReasonCode, + PreviewSchedulingReassignmentRequestOverridesItem, + UndoSchedulingReassignmentRequestNotify, + UndoSchedulingReassignmentRequestNotifyHosts, + UndoSchedulingReassignmentRequestOverridesItem, + UndoSchedulingReassignmentRequestReasonCode, + ) from .sessions import ( CreateSchedulingBookerSessionRequestAttendee, CreateSchedulingBookerSessionRequestAttributesValue, + CreateSchedulingManagerSessionRequestHostFilterValue, ) from .settings import ( UpdateSchedulingSettingsRequestCalendarFailureMode, + UpdateSchedulingSettingsRequestHostReassignment, UpdateSchedulingSettingsRequestLogo, UpdateSchedulingSettingsRequestNotificationsValue, + UpdateSchedulingSettingsRequestOutOfOfficeReasonsItem, ) _dynamic_imports: typing.Dict[str, str] = { "AuthorizeCalendarRequestProvider": ".calendars", @@ -118,17 +158,47 @@ "CreateHostRequestAttributesValue": ".hosts", "CreateSchedulingBookerSessionRequestAttendee": ".sessions", "CreateSchedulingBookerSessionRequestAttributesValue": ".sessions", + "CreateSchedulingHolidayCalendarRequestExistingBookings": ".holiday_calendars", + "CreateSchedulingHolidayCalendarRequestHostFilterValue": ".holiday_calendars", + "CreateSchedulingManagerSessionRequestHostFilterValue": ".sessions", + "CreateSchedulingOutOfOfficeRequestExistingBookings": ".out_of_office", + "CreateSchedulingOutOfOfficeRequestHostFilterValue": ".out_of_office", + "CreateSchedulingOutOfOfficeRequestReassign": ".out_of_office", + "CreateSchedulingOutOfOfficeRequestReassignOtherwise": ".out_of_office", + "CreateSchedulingReassignmentRequestNotify": ".reassignments", + "CreateSchedulingReassignmentRequestNotifyHosts": ".reassignments", + "CreateSchedulingReassignmentRequestOverridesItem": ".reassignments", + "CreateSchedulingReassignmentRequestReasonCode": ".reassignments", "ListBookingsRequestStatus": ".bookings", + "PreviewSchedulingReassignmentRequestOverridesItem": ".reassignments", + "PutSchedulingOutOfOfficeRequestExistingBookings": ".out_of_office", + "PutSchedulingOutOfOfficeRequestReassign": ".out_of_office", + "PutSchedulingOutOfOfficeRequestReassignOtherwise": ".out_of_office", + "ReassignSchedulingBookingRequestChangesItem": ".bookings", + "ReassignSchedulingBookingRequestNotify": ".bookings", + "ReassignSchedulingBookingRequestOverridesItem": ".bookings", + "ReassignSchedulingBookingRequestReasonCode": ".bookings", "SetSimulatedBusyRequestIntervalsItem": ".calendars", + "UndoSchedulingReassignmentRequestNotify": ".reassignments", + "UndoSchedulingReassignmentRequestNotifyHosts": ".reassignments", + "UndoSchedulingReassignmentRequestOverridesItem": ".reassignments", + "UndoSchedulingReassignmentRequestReasonCode": ".reassignments", "UpdateEventTypeRequestHostCalendarDetails": ".event_types", "UpdateEventTypeRequestHostFilterValue": ".event_types", "UpdateEventTypeRequestNotificationsValue": ".event_types", "UpdateEventTypeRequestStatus": ".event_types", "UpdateHostRequestAttributesValue": ".hosts", "UpdateHostRequestStatus": ".hosts", + "UpdateSchedulingHolidayCalendarRequestExistingBookings": ".holiday_calendars", + "UpdateSchedulingHolidayCalendarRequestHostFilterValue": ".holiday_calendars", + "UpdateSchedulingOutOfOfficeRequestExistingBookings": ".out_of_office", + "UpdateSchedulingOutOfOfficeRequestReassign": ".out_of_office", + "UpdateSchedulingOutOfOfficeRequestReassignOtherwise": ".out_of_office", "UpdateSchedulingSettingsRequestCalendarFailureMode": ".settings", + "UpdateSchedulingSettingsRequestHostReassignment": ".settings", "UpdateSchedulingSettingsRequestLogo": ".settings", "UpdateSchedulingSettingsRequestNotificationsValue": ".settings", + "UpdateSchedulingSettingsRequestOutOfOfficeReasonsItem": ".settings", "attendees": ".attendees", "availability": ".availability", "bookings": ".bookings", @@ -136,7 +206,11 @@ "calendars": ".calendars", "event_types": ".event_types", "holds": ".holds", + "holiday_calendars": ".holiday_calendars", "hosts": ".hosts", + "oauth_apps": ".oauth_apps", + "out_of_office": ".out_of_office", + "reassignments": ".reassignments", "schedules": ".schedules", "series": ".series", "sessions": ".sessions", @@ -206,17 +280,47 @@ def __dir__(): "CreateHostRequestAttributesValue", "CreateSchedulingBookerSessionRequestAttendee", "CreateSchedulingBookerSessionRequestAttributesValue", + "CreateSchedulingHolidayCalendarRequestExistingBookings", + "CreateSchedulingHolidayCalendarRequestHostFilterValue", + "CreateSchedulingManagerSessionRequestHostFilterValue", + "CreateSchedulingOutOfOfficeRequestExistingBookings", + "CreateSchedulingOutOfOfficeRequestHostFilterValue", + "CreateSchedulingOutOfOfficeRequestReassign", + "CreateSchedulingOutOfOfficeRequestReassignOtherwise", + "CreateSchedulingReassignmentRequestNotify", + "CreateSchedulingReassignmentRequestNotifyHosts", + "CreateSchedulingReassignmentRequestOverridesItem", + "CreateSchedulingReassignmentRequestReasonCode", "ListBookingsRequestStatus", + "PreviewSchedulingReassignmentRequestOverridesItem", + "PutSchedulingOutOfOfficeRequestExistingBookings", + "PutSchedulingOutOfOfficeRequestReassign", + "PutSchedulingOutOfOfficeRequestReassignOtherwise", + "ReassignSchedulingBookingRequestChangesItem", + "ReassignSchedulingBookingRequestNotify", + "ReassignSchedulingBookingRequestOverridesItem", + "ReassignSchedulingBookingRequestReasonCode", "SetSimulatedBusyRequestIntervalsItem", + "UndoSchedulingReassignmentRequestNotify", + "UndoSchedulingReassignmentRequestNotifyHosts", + "UndoSchedulingReassignmentRequestOverridesItem", + "UndoSchedulingReassignmentRequestReasonCode", "UpdateEventTypeRequestHostCalendarDetails", "UpdateEventTypeRequestHostFilterValue", "UpdateEventTypeRequestNotificationsValue", "UpdateEventTypeRequestStatus", "UpdateHostRequestAttributesValue", "UpdateHostRequestStatus", + "UpdateSchedulingHolidayCalendarRequestExistingBookings", + "UpdateSchedulingHolidayCalendarRequestHostFilterValue", + "UpdateSchedulingOutOfOfficeRequestExistingBookings", + "UpdateSchedulingOutOfOfficeRequestReassign", + "UpdateSchedulingOutOfOfficeRequestReassignOtherwise", "UpdateSchedulingSettingsRequestCalendarFailureMode", + "UpdateSchedulingSettingsRequestHostReassignment", "UpdateSchedulingSettingsRequestLogo", "UpdateSchedulingSettingsRequestNotificationsValue", + "UpdateSchedulingSettingsRequestOutOfOfficeReasonsItem", "attendees", "availability", "bookings", @@ -224,7 +328,11 @@ def __dir__(): "calendars", "event_types", "holds", + "holiday_calendars", "hosts", + "oauth_apps", + "out_of_office", + "reassignments", "schedules", "series", "sessions", diff --git a/sdks/python/src/coss/resources/scheduling/resources/bookings/__init__.py b/sdks/python/src/coss/resources/scheduling/resources/bookings/__init__.py index 13cddc005..ded65890e 100644 --- a/sdks/python/src/coss/resources/scheduling/resources/bookings/__init__.py +++ b/sdks/python/src/coss/resources/scheduling/resources/bookings/__init__.py @@ -23,6 +23,10 @@ CreateBookingRequestLocation_Phone, CreateBookingRequestLocation_Zoom, ListBookingsRequestStatus, + ReassignSchedulingBookingRequestChangesItem, + ReassignSchedulingBookingRequestNotify, + ReassignSchedulingBookingRequestOverridesItem, + ReassignSchedulingBookingRequestReasonCode, ) _dynamic_imports: typing.Dict[str, str] = { "CreateBookingRequestAnswersValue": ".types", @@ -41,6 +45,10 @@ "CreateBookingRequestLocation_Phone": ".types", "CreateBookingRequestLocation_Zoom": ".types", "ListBookingsRequestStatus": ".types", + "ReassignSchedulingBookingRequestChangesItem": ".types", + "ReassignSchedulingBookingRequestNotify": ".types", + "ReassignSchedulingBookingRequestOverridesItem": ".types", + "ReassignSchedulingBookingRequestReasonCode": ".types", } @@ -82,4 +90,8 @@ def __dir__(): "CreateBookingRequestLocation_Phone", "CreateBookingRequestLocation_Zoom", "ListBookingsRequestStatus", + "ReassignSchedulingBookingRequestChangesItem", + "ReassignSchedulingBookingRequestNotify", + "ReassignSchedulingBookingRequestOverridesItem", + "ReassignSchedulingBookingRequestReasonCode", ] diff --git a/sdks/python/src/coss/resources/scheduling/resources/bookings/client.py b/sdks/python/src/coss/resources/scheduling/resources/bookings/client.py index 7b86ed2b6..70d89fbe4 100644 --- a/sdks/python/src/coss/resources/scheduling/resources/bookings/client.py +++ b/sdks/python/src/coss/resources/scheduling/resources/bookings/client.py @@ -11,11 +11,16 @@ from .....types.scheduling_booking_notification_list import SchedulingBookingNotificationList from .....types.scheduling_guest_input import SchedulingGuestInput from .....types.scheduling_location import SchedulingLocation +from .....types.scheduling_reassign_candidate_list import SchedulingReassignCandidateList from .raw_client import AsyncRawBookingsClient, RawBookingsClient from .types.create_booking_request_answers_value import CreateBookingRequestAnswersValue from .types.create_booking_request_attributes_value import CreateBookingRequestAttributesValue from .types.create_booking_request_location import CreateBookingRequestLocation from .types.list_bookings_request_status import ListBookingsRequestStatus +from .types.reassign_scheduling_booking_request_changes_item import ReassignSchedulingBookingRequestChangesItem +from .types.reassign_scheduling_booking_request_notify import ReassignSchedulingBookingRequestNotify +from .types.reassign_scheduling_booking_request_overrides_item import ReassignSchedulingBookingRequestOverridesItem +from .types.reassign_scheduling_booking_request_reason_code import ReassignSchedulingBookingRequestReasonCode # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) @@ -36,6 +41,119 @@ def with_raw_response(self) -> RawBookingsClient: """ return self._raw_client + def reassign( + self, + id: str, + *, + changes: typing.Sequence[ReassignSchedulingBookingRequestChangesItem], + reason_code: ReassignSchedulingBookingRequestReasonCode, + note: typing.Optional[str] = OMIT, + overrides: typing.Optional[typing.Sequence[ReassignSchedulingBookingRequestOverridesItem]] = OMIT, + notify: typing.Optional[ReassignSchedulingBookingRequestNotify] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> SchedulingBooking: + """ + Gives a booking to another host, keeping its id and time. Works for every kind: a group session moves as a whole, from any of its seats, and one that's already started changes for the record, with nobody told. Whoever leaves and joins is told, and the attendee unless you say not to. + + Parameters + ---------- + id : str + The booking's id. + + changes : typing.Sequence[ReassignSchedulingBookingRequestChangesItem] + A session or a one-on-one has one. A collective can change several. + + reason_code : ReassignSchedulingBookingRequestReasonCode + + note : typing.Optional[str] + Why, in your words: required with an override of someone's availability. Encrypted, and only in the booking's history. + + overrides : typing.Optional[typing.Sequence[ReassignSchedulingBookingRequestOverridesItem]] + Go ahead anyway: `any_host` for someone who doesn't take this event type, and the rest for what a candidate's `reason` said. A host who already has something at this time can never be overridden. + + notify : typing.Optional[ReassignSchedulingBookingRequestNotify] + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + SchedulingBooking + The booking. + + Examples + -------- + from coss import Coss + from coss.resources.scheduling.resources.bookings import ( + ReassignSchedulingBookingRequestChangesItem, + ) + + client = Coss( + "2026-10-10", + api_key="YOUR_API_KEY", + ) + client.scheduling.bookings.reassign( + id="book_01kd2m9a0b1c2d3e4f5g6h7j8m", + changes=[ + ReassignSchedulingBookingRequestChangesItem( + to_host="doctor_518", + ) + ], + reason_code="out_of_office", + ) + """ + _response = self._raw_client.reassign( + id, + changes=changes, + reason_code=reason_code, + note=note, + overrides=overrides, + notify=notify, + request_options=request_options, + ) + return _response.data + + def reassign_candidates( + self, + id: str, + *, + from_host: typing.Optional[str] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> SchedulingReassignCandidateList: + """ + The environment's other active hosts: members of the event type first, in the order a pool would pick them, each saying whether they're free and why not. Things can change before you ask: reassigning decides again. + + Parameters + ---------- + id : str + The booking's id. + + from_host : typing.Optional[str] + The host who'd leave, when it could be several. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + SchedulingReassignCandidateList + The candidates. + + Examples + -------- + from coss import Coss + + client = Coss( + "2026-10-10", + api_key="YOUR_API_KEY", + ) + client.scheduling.bookings.reassign_candidates( + id="book_01kd2m9a0b1c2d3e4f5g6h7j8m", + ) + """ + _response = self._raw_client.reassign_candidates(id, from_host=from_host, request_options=request_options) + return _response.data + def list( self, *, @@ -505,7 +623,11 @@ def mark_no_show(self, id: str, *, request_options: typing.Optional[RequestOptio return _response.data def update_location( - self, id: str, *, location: SchedulingLocation, request_options: typing.Optional[RequestOptions] = None + self, + id: str, + *, + location: typing.Optional[SchedulingLocation] = OMIT, + request_options: typing.Optional[RequestOptions] = None, ) -> SchedulingBooking: """ Where it happens, such as the meeting link you made after the `scheduling.booking.confirmed` webhook. @@ -515,7 +637,7 @@ def update_location( id : str The booking's id. - location : SchedulingLocation + location : typing.Optional[SchedulingLocation] request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -527,7 +649,7 @@ def update_location( Examples -------- - from coss import Coss, SchedulingLocation_Link + from coss import Coss, SchedulingLocationZero client = Coss( "2026-10-10", @@ -535,7 +657,8 @@ def update_location( ) client.scheduling.bookings.update_location( id="book_01kd2m9a0b1c2d3e4f5g6h7j8m", - location=SchedulingLocation_Link( + location=SchedulingLocationZero( + type="link", url="https://meet.example.com/abc", ), ) @@ -559,6 +682,135 @@ def with_raw_response(self) -> AsyncRawBookingsClient: """ return self._raw_client + async def reassign( + self, + id: str, + *, + changes: typing.Sequence[ReassignSchedulingBookingRequestChangesItem], + reason_code: ReassignSchedulingBookingRequestReasonCode, + note: typing.Optional[str] = OMIT, + overrides: typing.Optional[typing.Sequence[ReassignSchedulingBookingRequestOverridesItem]] = OMIT, + notify: typing.Optional[ReassignSchedulingBookingRequestNotify] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> SchedulingBooking: + """ + Gives a booking to another host, keeping its id and time. Works for every kind: a group session moves as a whole, from any of its seats, and one that's already started changes for the record, with nobody told. Whoever leaves and joins is told, and the attendee unless you say not to. + + Parameters + ---------- + id : str + The booking's id. + + changes : typing.Sequence[ReassignSchedulingBookingRequestChangesItem] + A session or a one-on-one has one. A collective can change several. + + reason_code : ReassignSchedulingBookingRequestReasonCode + + note : typing.Optional[str] + Why, in your words: required with an override of someone's availability. Encrypted, and only in the booking's history. + + overrides : typing.Optional[typing.Sequence[ReassignSchedulingBookingRequestOverridesItem]] + Go ahead anyway: `any_host` for someone who doesn't take this event type, and the rest for what a candidate's `reason` said. A host who already has something at this time can never be overridden. + + notify : typing.Optional[ReassignSchedulingBookingRequestNotify] + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + SchedulingBooking + The booking. + + Examples + -------- + import asyncio + + from coss import AsyncCoss + from coss.resources.scheduling.resources.bookings import ( + ReassignSchedulingBookingRequestChangesItem, + ) + + client = AsyncCoss( + "2026-10-10", + api_key="YOUR_API_KEY", + ) + + + async def main() -> None: + await client.scheduling.bookings.reassign( + id="book_01kd2m9a0b1c2d3e4f5g6h7j8m", + changes=[ + ReassignSchedulingBookingRequestChangesItem( + to_host="doctor_518", + ) + ], + reason_code="out_of_office", + ) + + + asyncio.run(main()) + """ + _response = await self._raw_client.reassign( + id, + changes=changes, + reason_code=reason_code, + note=note, + overrides=overrides, + notify=notify, + request_options=request_options, + ) + return _response.data + + async def reassign_candidates( + self, + id: str, + *, + from_host: typing.Optional[str] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> SchedulingReassignCandidateList: + """ + The environment's other active hosts: members of the event type first, in the order a pool would pick them, each saying whether they're free and why not. Things can change before you ask: reassigning decides again. + + Parameters + ---------- + id : str + The booking's id. + + from_host : typing.Optional[str] + The host who'd leave, when it could be several. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + SchedulingReassignCandidateList + The candidates. + + Examples + -------- + import asyncio + + from coss import AsyncCoss + + client = AsyncCoss( + "2026-10-10", + api_key="YOUR_API_KEY", + ) + + + async def main() -> None: + await client.scheduling.bookings.reassign_candidates( + id="book_01kd2m9a0b1c2d3e4f5g6h7j8m", + ) + + + asyncio.run(main()) + """ + _response = await self._raw_client.reassign_candidates(id, from_host=from_host, request_options=request_options) + return _response.data + async def list( self, *, @@ -1110,7 +1362,11 @@ async def main() -> None: return _response.data async def update_location( - self, id: str, *, location: SchedulingLocation, request_options: typing.Optional[RequestOptions] = None + self, + id: str, + *, + location: typing.Optional[SchedulingLocation] = OMIT, + request_options: typing.Optional[RequestOptions] = None, ) -> SchedulingBooking: """ Where it happens, such as the meeting link you made after the `scheduling.booking.confirmed` webhook. @@ -1120,7 +1376,7 @@ async def update_location( id : str The booking's id. - location : SchedulingLocation + location : typing.Optional[SchedulingLocation] request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -1134,7 +1390,7 @@ async def update_location( -------- import asyncio - from coss import AsyncCoss, SchedulingLocation_Link + from coss import AsyncCoss, SchedulingLocationZero client = AsyncCoss( "2026-10-10", @@ -1145,7 +1401,8 @@ async def update_location( async def main() -> None: await client.scheduling.bookings.update_location( id="book_01kd2m9a0b1c2d3e4f5g6h7j8m", - location=SchedulingLocation_Link( + location=SchedulingLocationZero( + type="link", url="https://meet.example.com/abc", ), ) diff --git a/sdks/python/src/coss/resources/scheduling/resources/bookings/raw_client.py b/sdks/python/src/coss/resources/scheduling/resources/bookings/raw_client.py index 2cc7eb421..2e9e98592 100644 --- a/sdks/python/src/coss/resources/scheduling/resources/bookings/raw_client.py +++ b/sdks/python/src/coss/resources/scheduling/resources/bookings/raw_client.py @@ -31,10 +31,15 @@ from .....types.scheduling_booking_notification_list import SchedulingBookingNotificationList from .....types.scheduling_guest_input import SchedulingGuestInput from .....types.scheduling_location import SchedulingLocation +from .....types.scheduling_reassign_candidate_list import SchedulingReassignCandidateList from .types.create_booking_request_answers_value import CreateBookingRequestAnswersValue from .types.create_booking_request_attributes_value import CreateBookingRequestAttributesValue from .types.create_booking_request_location import CreateBookingRequestLocation from .types.list_bookings_request_status import ListBookingsRequestStatus +from .types.reassign_scheduling_booking_request_changes_item import ReassignSchedulingBookingRequestChangesItem +from .types.reassign_scheduling_booking_request_notify import ReassignSchedulingBookingRequestNotify +from .types.reassign_scheduling_booking_request_overrides_item import ReassignSchedulingBookingRequestOverridesItem +from .types.reassign_scheduling_booking_request_reason_code import ReassignSchedulingBookingRequestReasonCode from pydantic import ValidationError # this is used as the default value for optional parameters @@ -45,72 +50,752 @@ class RawBookingsClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper + def reassign( + self, + id: str, + *, + changes: typing.Sequence[ReassignSchedulingBookingRequestChangesItem], + reason_code: ReassignSchedulingBookingRequestReasonCode, + note: typing.Optional[str] = OMIT, + overrides: typing.Optional[typing.Sequence[ReassignSchedulingBookingRequestOverridesItem]] = OMIT, + notify: typing.Optional[ReassignSchedulingBookingRequestNotify] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> HttpResponse[SchedulingBooking]: + """ + Gives a booking to another host, keeping its id and time. Works for every kind: a group session moves as a whole, from any of its seats, and one that's already started changes for the record, with nobody told. Whoever leaves and joins is told, and the attendee unless you say not to. + + Parameters + ---------- + id : str + The booking's id. + + changes : typing.Sequence[ReassignSchedulingBookingRequestChangesItem] + A session or a one-on-one has one. A collective can change several. + + reason_code : ReassignSchedulingBookingRequestReasonCode + + note : typing.Optional[str] + Why, in your words: required with an override of someone's availability. Encrypted, and only in the booking's history. + + overrides : typing.Optional[typing.Sequence[ReassignSchedulingBookingRequestOverridesItem]] + Go ahead anyway: `any_host` for someone who doesn't take this event type, and the rest for what a candidate's `reason` said. A host who already has something at this time can never be overridden. + + notify : typing.Optional[ReassignSchedulingBookingRequestNotify] + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + HttpResponse[SchedulingBooking] + The booking. + """ + _request_options_with_retries_disabled: typing.Optional[RequestOptions] = ( + {**request_options, "max_retries": 0} if request_options is not None else {"max_retries": 0} + ) + _response = self._client_wrapper.httpx_client.request( + f"v1/scheduling/bookings/{encode_path_param(id)}/reassign", + method="POST", + json={ + "changes": convert_and_respect_annotation_metadata( + object_=changes, + annotation=typing.Sequence[ReassignSchedulingBookingRequestChangesItem], + direction="write", + ), + "reason_code": reason_code, + "note": note, + "overrides": overrides, + "notify": convert_and_respect_annotation_metadata( + object_=notify, annotation=ReassignSchedulingBookingRequestNotify, direction="write" + ), + }, + headers={ + "content-type": "application/json", + "Idempotency-Key": generate_idempotency_key(), + }, + request_options=_request_options_with_retries_disabled, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + SchedulingBooking, + parse_obj_as( + type_=SchedulingBooking, # type: ignore + object_=_response.json(), + ), + ) + return HttpResponse(response=_response, data=_data) + if _response.status_code == 400: + raise BadRequestError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 401: + raise UnauthorizedError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 403: + raise ForbiddenError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 404: + raise NotFoundError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 415: + raise UnsupportedMediaTypeError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 422: + raise UnprocessableEntityError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 429: + raise TooManyRequestsError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 500: + raise InternalServerError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 503: + raise ServiceUnavailableError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) + except ValidationError as e: + raise ParsingError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e + ) + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + + def reassign_candidates( + self, + id: str, + *, + from_host: typing.Optional[str] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> HttpResponse[SchedulingReassignCandidateList]: + """ + The environment's other active hosts: members of the event type first, in the order a pool would pick them, each saying whether they're free and why not. Things can change before you ask: reassigning decides again. + + Parameters + ---------- + id : str + The booking's id. + + from_host : typing.Optional[str] + The host who'd leave, when it could be several. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + HttpResponse[SchedulingReassignCandidateList] + The candidates. + """ + _response = self._client_wrapper.httpx_client.request( + f"v1/scheduling/bookings/{encode_path_param(id)}/reassign_candidates", + method="GET", + params={ + "from_host": from_host, + }, + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + SchedulingReassignCandidateList, + parse_obj_as( + type_=SchedulingReassignCandidateList, # type: ignore + object_=_response.json(), + ), + ) + return HttpResponse(response=_response, data=_data) + if _response.status_code == 400: + raise BadRequestError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 401: + raise UnauthorizedError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 403: + raise ForbiddenError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 404: + raise NotFoundError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 422: + raise UnprocessableEntityError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 429: + raise TooManyRequestsError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 500: + raise InternalServerError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 503: + raise ServiceUnavailableError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) + except ValidationError as e: + raise ParsingError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e + ) + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + def list( self, *, - limit: typing.Optional[int] = None, - after: typing.Optional[str] = None, - host: typing.Optional[str] = None, - event_type: typing.Optional[str] = None, - status: typing.Optional[ListBookingsRequestStatus] = None, - attendee_uid: typing.Optional[str] = None, - start_after: typing.Optional[str] = None, - start_before: typing.Optional[str] = None, + limit: typing.Optional[int] = None, + after: typing.Optional[str] = None, + host: typing.Optional[str] = None, + event_type: typing.Optional[str] = None, + status: typing.Optional[ListBookingsRequestStatus] = None, + attendee_uid: typing.Optional[str] = None, + start_after: typing.Optional[str] = None, + start_before: typing.Optional[str] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> HttpResponse[SchedulingBookingList]: + """ + The environment's bookings, newest first. Answers aren't included. + + Parameters + ---------- + limit : typing.Optional[int] + + after : typing.Optional[str] + The last id of the previous page. + + host : typing.Optional[str] + + event_type : typing.Optional[str] + + status : typing.Optional[ListBookingsRequestStatus] + + attendee_uid : typing.Optional[str] + + start_after : typing.Optional[str] + An ISO 8601 instant with an offset. + + start_before : typing.Optional[str] + An ISO 8601 instant with an offset. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + HttpResponse[SchedulingBookingList] + A page of bookings. + """ + _response = self._client_wrapper.httpx_client.request( + "v1/scheduling/bookings", + method="GET", + params={ + "limit": limit, + "after": after, + "host": host, + "event_type": event_type, + "status": status, + "attendee_uid": attendee_uid, + "start_after": start_after, + "start_before": start_before, + }, + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + SchedulingBookingList, + parse_obj_as( + type_=SchedulingBookingList, # type: ignore + object_=_response.json(), + ), + ) + return HttpResponse(response=_response, data=_data) + if _response.status_code == 400: + raise BadRequestError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 401: + raise UnauthorizedError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 403: + raise ForbiddenError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 422: + raise UnprocessableEntityError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 429: + raise TooManyRequestsError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 500: + raise InternalServerError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 503: + raise ServiceUnavailableError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) + except ValidationError as e: + raise ParsingError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e + ) + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + + def create( + self, + *, + event_type: str, + start: str, + attendee: SchedulingAttendeeInput, + idempotency_key: typing.Optional[str] = None, + host: typing.Optional[str] = OMIT, + attributes: typing.Optional[typing.Dict[str, CreateBookingRequestAttributesValue]] = OMIT, + duration_minutes: typing.Optional[int] = OMIT, + guests: typing.Optional[typing.Sequence[SchedulingGuestInput]] = OMIT, + answers: typing.Optional[typing.Dict[str, CreateBookingRequestAnswersValue]] = OMIT, + location: typing.Optional[CreateBookingRequestLocation] = OMIT, + metadata: typing.Optional[typing.Dict[str, str]] = OMIT, request_options: typing.Optional[RequestOptions] = None, - ) -> HttpResponse[SchedulingBookingList]: + ) -> HttpResponse[SchedulingBooking]: + """ + Books a slot, or joins a group session. Without a `host`, a pool chooses fairly among those free. An event type that requires approval answers with a `pending_approval` booking. + + Parameters + ---------- + event_type : str + The event type's id or uid. + + start : str + An ISO 8601 instant with an offset. + + attendee : SchedulingAttendeeInput + + idempotency_key : typing.Optional[str] + Makes retries safe: a repeated request with the same key and body returns the original booking instead of creating another, for 24 hours. A refused request keeps no key. 1-256 characters. + + host : typing.Optional[str] + A specific host (id or uid). Default: chosen fairly from those free. + + attributes : typing.Optional[typing.Dict[str, CreateBookingRequestAttributesValue]] + Only choose among pool hosts matching all of these. + + duration_minutes : typing.Optional[int] + One of the event type's `duration_options`. + + guests : typing.Optional[typing.Sequence[SchedulingGuestInput]] + Up to the event type's `max_guests`. + + answers : typing.Optional[typing.Dict[str, CreateBookingRequestAnswersValue]] + Answers to the event type's questions. Stored encrypted, and returned only by retrieving the booking. + + location : typing.Optional[CreateBookingRequestLocation] + One of the event type's `locations`, with your link filled in if it has none. + + metadata : typing.Optional[typing.Dict[str, str]] + Your own key-value pairs. Don't put sensitive data here. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + HttpResponse[SchedulingBooking] + The booking. + """ + _response = self._client_wrapper.httpx_client.request( + "v1/scheduling/bookings", + method="POST", + json={ + "event_type": event_type, + "start": start, + "host": host, + "attributes": convert_and_respect_annotation_metadata( + object_=attributes, + annotation=typing.Dict[str, CreateBookingRequestAttributesValue], + direction="write", + ), + "duration_minutes": duration_minutes, + "attendee": convert_and_respect_annotation_metadata( + object_=attendee, annotation=SchedulingAttendeeInput, direction="write" + ), + "guests": convert_and_respect_annotation_metadata( + object_=guests, annotation=typing.Sequence[SchedulingGuestInput], direction="write" + ), + "answers": convert_and_respect_annotation_metadata( + object_=answers, annotation=typing.Dict[str, CreateBookingRequestAnswersValue], direction="write" + ), + "location": convert_and_respect_annotation_metadata( + object_=location, annotation=CreateBookingRequestLocation, direction="write" + ), + "metadata": metadata, + }, + headers={ + "content-type": "application/json", + "Idempotency-Key": str(idempotency_key) if idempotency_key is not None else generate_idempotency_key(), + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + SchedulingBooking, + parse_obj_as( + type_=SchedulingBooking, # type: ignore + object_=_response.json(), + ), + ) + return HttpResponse(response=_response, data=_data) + if _response.status_code == 400: + raise BadRequestError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 401: + raise UnauthorizedError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 402: + raise PaymentRequiredError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 403: + raise ForbiddenError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 404: + raise NotFoundError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 409: + raise ConflictError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 415: + raise UnsupportedMediaTypeError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 422: + raise UnprocessableEntityError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 429: + raise TooManyRequestsError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 500: + raise InternalServerError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 503: + raise ServiceUnavailableError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) + except ValidationError as e: + raise ParsingError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e + ) + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + + def get( + self, id: str, *, request_options: typing.Optional[RequestOptions] = None + ) -> HttpResponse[SchedulingBooking]: """ - The environment's bookings, newest first. Answers aren't included. + A booking with its attendees and their answers. Parameters ---------- - limit : typing.Optional[int] - - after : typing.Optional[str] - The last id of the previous page. - - host : typing.Optional[str] - - event_type : typing.Optional[str] - - status : typing.Optional[ListBookingsRequestStatus] - - attendee_uid : typing.Optional[str] - - start_after : typing.Optional[str] - An ISO 8601 instant with an offset. - - start_before : typing.Optional[str] - An ISO 8601 instant with an offset. + id : str + The booking's id. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - HttpResponse[SchedulingBookingList] - A page of bookings. + HttpResponse[SchedulingBooking] + The booking. """ _response = self._client_wrapper.httpx_client.request( - "v1/scheduling/bookings", + f"v1/scheduling/bookings/{encode_path_param(id)}", method="GET", - params={ - "limit": limit, - "after": after, - "host": host, - "event_type": event_type, - "status": status, - "attendee_uid": attendee_uid, - "start_after": start_after, - "start_before": start_before, - }, request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( - SchedulingBookingList, + SchedulingBooking, parse_obj_as( - type_=SchedulingBookingList, # type: ignore + type_=SchedulingBooking, # type: ignore object_=_response.json(), ), ) @@ -148,8 +833,8 @@ def list( ), ), ) - if _response.status_code == 422: - raise UnprocessableEntityError( + if _response.status_code == 404: + raise NotFoundError( headers=dict(_response.headers), body=typing.cast( Error, @@ -201,58 +886,27 @@ def list( ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - def create( + def reschedule( self, + id: str, *, - event_type: str, start: str, - attendee: SchedulingAttendeeInput, - idempotency_key: typing.Optional[str] = None, host: typing.Optional[str] = OMIT, - attributes: typing.Optional[typing.Dict[str, CreateBookingRequestAttributesValue]] = OMIT, - duration_minutes: typing.Optional[int] = OMIT, - guests: typing.Optional[typing.Sequence[SchedulingGuestInput]] = OMIT, - answers: typing.Optional[typing.Dict[str, CreateBookingRequestAnswersValue]] = OMIT, - location: typing.Optional[CreateBookingRequestLocation] = OMIT, - metadata: typing.Optional[typing.Dict[str, str]] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[SchedulingBooking]: """ - Books a slot, or joins a group session. Without a `host`, a pool chooses fairly among those free. An event type that requires approval answers with a `pending_approval` booking. + Moves it to a new time, keeping its id. The old time stays booked if the new one isn't free. Parameters ---------- - event_type : str - The event type's id or uid. + id : str + The booking's id. start : str - An ISO 8601 instant with an offset. - - attendee : SchedulingAttendeeInput - - idempotency_key : typing.Optional[str] - Makes retries safe: a repeated request with the same key and body returns the original booking instead of creating another, for 24 hours. A refused request keeps no key. 1-256 characters. + The new start. The old time stays booked unless this one's free. host : typing.Optional[str] - A specific host (id or uid). Default: chosen fairly from those free. - - attributes : typing.Optional[typing.Dict[str, CreateBookingRequestAttributesValue]] - Only choose among pool hosts matching all of these. - - duration_minutes : typing.Optional[int] - One of the event type's `duration_options`. - - guests : typing.Optional[typing.Sequence[SchedulingGuestInput]] - Up to the event type's `max_guests`. - - answers : typing.Optional[typing.Dict[str, CreateBookingRequestAnswersValue]] - Answers to the event type's questions. Stored encrypted, and returned only by retrieving the booking. - - location : typing.Optional[CreateBookingRequestLocation] - One of the event type's `locations`, with your link filled in if it has none. - - metadata : typing.Optional[typing.Dict[str, str]] - Your own key-value pairs. Don't put sensitive data here. + Move a pool booking to this host. Default: its current hosts. request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -263,35 +917,15 @@ def create( The booking. """ _response = self._client_wrapper.httpx_client.request( - "v1/scheduling/bookings", + f"v1/scheduling/bookings/{encode_path_param(id)}/reschedule", method="POST", json={ - "event_type": event_type, "start": start, "host": host, - "attributes": convert_and_respect_annotation_metadata( - object_=attributes, - annotation=typing.Dict[str, CreateBookingRequestAttributesValue], - direction="write", - ), - "duration_minutes": duration_minutes, - "attendee": convert_and_respect_annotation_metadata( - object_=attendee, annotation=SchedulingAttendeeInput, direction="write" - ), - "guests": convert_and_respect_annotation_metadata( - object_=guests, annotation=typing.Sequence[SchedulingGuestInput], direction="write" - ), - "answers": convert_and_respect_annotation_metadata( - object_=answers, annotation=typing.Dict[str, CreateBookingRequestAnswersValue], direction="write" - ), - "location": convert_and_respect_annotation_metadata( - object_=location, annotation=CreateBookingRequestLocation, direction="write" - ), - "metadata": metadata, }, headers={ "content-type": "application/json", - "Idempotency-Key": str(idempotency_key) if idempotency_key is not None else generate_idempotency_key(), + "Idempotency-Key": generate_idempotency_key(), }, request_options=request_options, omit=OMIT, @@ -328,17 +962,6 @@ def create( ), ), ) - if _response.status_code == 402: - raise PaymentRequiredError( - headers=dict(_response.headers), - body=typing.cast( - Error, - parse_obj_as( - type_=Error, # type: ignore - object_=_response.json(), - ), - ), - ) if _response.status_code == 403: raise ForbiddenError( headers=dict(_response.headers), @@ -361,17 +984,6 @@ def create( ), ), ) - if _response.status_code == 409: - raise ConflictError( - headers=dict(_response.headers), - body=typing.cast( - Error, - parse_obj_as( - type_=Error, # type: ignore - object_=_response.json(), - ), - ), - ) if _response.status_code == 415: raise UnsupportedMediaTypeError( headers=dict(_response.headers), @@ -436,17 +1048,20 @@ def create( ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - def get( - self, id: str, *, request_options: typing.Optional[RequestOptions] = None + def cancel( + self, id: str, *, reason: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None ) -> HttpResponse[SchedulingBooking]: """ - A booking with its attendees and their answers. + Frees the time and removes the calendar event. A cancelled booking stays charged. Parameters ---------- id : str The booking's id. + reason : typing.Optional[str] + Why it's being cancelled. Only retrieving this booking returns it: it's never in webhooks, logs or emails. + request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -456,9 +1071,17 @@ def get( The booking. """ _response = self._client_wrapper.httpx_client.request( - f"v1/scheduling/bookings/{encode_path_param(id)}", - method="GET", + f"v1/scheduling/bookings/{encode_path_param(id)}/cancel", + method="POST", + json={ + "reason": reason, + }, + headers={ + "content-type": "application/json", + "Idempotency-Key": generate_idempotency_key(), + }, request_options=request_options, + omit=OMIT, ) try: if 200 <= _response.status_code < 300: @@ -514,6 +1137,17 @@ def get( ), ), ) + if _response.status_code == 422: + raise UnprocessableEntityError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) if _response.status_code == 429: raise TooManyRequestsError( headers=dict(_response.headers), @@ -556,56 +1190,50 @@ def get( ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - def reschedule( + def events( self, id: str, *, - start: str, - host: typing.Optional[str] = OMIT, + limit: typing.Optional[int] = None, + after: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> HttpResponse[SchedulingBooking]: + ) -> HttpResponse[SchedulingBookingEventList]: """ - Moves it to a new time, keeping its id. The old time stays booked if the new one isn't free. + What's happened to a booking, oldest first, and who did it. There's no personal data in here. Parameters ---------- id : str The booking's id. - start : str - The new start. The old time stays booked unless this one's free. + limit : typing.Optional[int] - host : typing.Optional[str] - Move a pool booking to this host. Default: its current hosts. + after : typing.Optional[str] + The last id of the previous page. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - HttpResponse[SchedulingBooking] - The booking. + HttpResponse[SchedulingBookingEventList] + The events. """ _response = self._client_wrapper.httpx_client.request( - f"v1/scheduling/bookings/{encode_path_param(id)}/reschedule", - method="POST", - json={ - "start": start, - "host": host, - }, - headers={ - "content-type": "application/json", - "Idempotency-Key": generate_idempotency_key(), + f"v1/scheduling/bookings/{encode_path_param(id)}/events", + method="GET", + params={ + "limit": limit, + "after": after, }, request_options=request_options, - omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( - SchedulingBooking, + SchedulingBookingEventList, parse_obj_as( - type_=SchedulingBooking, # type: ignore + type_=SchedulingBookingEventList, # type: ignore object_=_response.json(), ), ) @@ -654,28 +1282,6 @@ def reschedule( ), ), ) - if _response.status_code == 415: - raise UnsupportedMediaTypeError( - headers=dict(_response.headers), - body=typing.cast( - Error, - parse_obj_as( - type_=Error, # type: ignore - object_=_response.json(), - ), - ), - ) - if _response.status_code == 422: - raise UnprocessableEntityError( - headers=dict(_response.headers), - body=typing.cast( - Error, - parse_obj_as( - type_=Error, # type: ignore - object_=_response.json(), - ), - ), - ) if _response.status_code == 429: raise TooManyRequestsError( headers=dict(_response.headers), @@ -718,20 +1324,17 @@ def reschedule( ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - def cancel( - self, id: str, *, reason: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None + def approve( + self, id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> HttpResponse[SchedulingBooking]: """ - Frees the time and removes the calendar event. A cancelled booking stays charged. + Confirms a `pending_approval` booking. Parameters ---------- id : str The booking's id. - reason : typing.Optional[str] - Why it's being cancelled. Only retrieving this booking returns it: it's never in webhooks, logs or emails. - request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -741,17 +1344,12 @@ def cancel( The booking. """ _response = self._client_wrapper.httpx_client.request( - f"v1/scheduling/bookings/{encode_path_param(id)}/cancel", + f"v1/scheduling/bookings/{encode_path_param(id)}/approve", method="POST", - json={ - "reason": reason, - }, headers={ - "content-type": "application/json", "Idempotency-Key": generate_idempotency_key(), }, request_options=request_options, - omit=OMIT, ) try: if 200 <= _response.status_code < 300: @@ -860,50 +1458,39 @@ def cancel( ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - def events( - self, - id: str, - *, - limit: typing.Optional[int] = None, - after: typing.Optional[str] = None, - request_options: typing.Optional[RequestOptions] = None, - ) -> HttpResponse[SchedulingBookingEventList]: + def decline( + self, id: str, *, request_options: typing.Optional[RequestOptions] = None + ) -> HttpResponse[SchedulingBooking]: """ - What's happened to a booking, oldest first, and who did it. There's no personal data in here. + Refuses a `pending_approval` booking and frees the time. Parameters ---------- id : str The booking's id. - limit : typing.Optional[int] - - after : typing.Optional[str] - The last id of the previous page. - request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - HttpResponse[SchedulingBookingEventList] - The events. + HttpResponse[SchedulingBooking] + The booking. """ _response = self._client_wrapper.httpx_client.request( - f"v1/scheduling/bookings/{encode_path_param(id)}/events", - method="GET", - params={ - "limit": limit, - "after": after, + f"v1/scheduling/bookings/{encode_path_param(id)}/decline", + method="POST", + headers={ + "Idempotency-Key": generate_idempotency_key(), }, request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( - SchedulingBookingEventList, + SchedulingBooking, parse_obj_as( - type_=SchedulingBookingEventList, # type: ignore + type_=SchedulingBooking, # type: ignore object_=_response.json(), ), ) @@ -952,6 +1539,17 @@ def events( ), ), ) + if _response.status_code == 422: + raise UnprocessableEntityError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) if _response.status_code == 429: raise TooManyRequestsError( headers=dict(_response.headers), @@ -994,39 +1592,50 @@ def events( ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - def approve( - self, id: str, *, request_options: typing.Optional[RequestOptions] = None - ) -> HttpResponse[SchedulingBooking]: + def notifications( + self, + id: str, + *, + limit: typing.Optional[int] = None, + after: typing.Optional[str] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> HttpResponse[SchedulingBookingNotificationList]: """ - Confirms a `pending_approval` booking. + What's been queued for this booking and what became of it, newest first, including why something wasn't sent. It never says who it went to. Parameters ---------- id : str The booking's id. + limit : typing.Optional[int] + + after : typing.Optional[str] + The last id of the previous page. + request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - HttpResponse[SchedulingBooking] - The booking. + HttpResponse[SchedulingBookingNotificationList] + The notifications. """ _response = self._client_wrapper.httpx_client.request( - f"v1/scheduling/bookings/{encode_path_param(id)}/approve", - method="POST", - headers={ - "Idempotency-Key": generate_idempotency_key(), + f"v1/scheduling/bookings/{encode_path_param(id)}/notifications", + method="GET", + params={ + "limit": limit, + "after": after, }, request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( - SchedulingBooking, + SchedulingBookingNotificationList, parse_obj_as( - type_=SchedulingBooking, # type: ignore + type_=SchedulingBookingNotificationList, # type: ignore object_=_response.json(), ), ) @@ -1075,17 +1684,6 @@ def approve( ), ), ) - if _response.status_code == 422: - raise UnprocessableEntityError( - headers=dict(_response.headers), - body=typing.cast( - Error, - parse_obj_as( - type_=Error, # type: ignore - object_=_response.json(), - ), - ), - ) if _response.status_code == 429: raise TooManyRequestsError( headers=dict(_response.headers), @@ -1128,11 +1726,11 @@ def approve( ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - def decline( + def mark_no_show( self, id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> HttpResponse[SchedulingBooking]: """ - Refuses a `pending_approval` booking and frees the time. + Records that the attendee didn't come, once the booking has started. Parameters ---------- @@ -1148,7 +1746,7 @@ def decline( The booking. """ _response = self._client_wrapper.httpx_client.request( - f"v1/scheduling/bookings/{encode_path_param(id)}/decline", + f"v1/scheduling/bookings/{encode_path_param(id)}/no_show", method="POST", headers={ "Idempotency-Key": generate_idempotency_key(), @@ -1262,50 +1860,51 @@ def decline( ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - def notifications( + def update_location( self, id: str, *, - limit: typing.Optional[int] = None, - after: typing.Optional[str] = None, + location: typing.Optional[SchedulingLocation] = OMIT, request_options: typing.Optional[RequestOptions] = None, - ) -> HttpResponse[SchedulingBookingNotificationList]: + ) -> HttpResponse[SchedulingBooking]: """ - What's been queued for this booking and what became of it, newest first, including why something wasn't sent. It never says who it went to. + Where it happens, such as the meeting link you made after the `scheduling.booking.confirmed` webhook. Parameters ---------- id : str The booking's id. - limit : typing.Optional[int] - - after : typing.Optional[str] - The last id of the previous page. + location : typing.Optional[SchedulingLocation] request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - HttpResponse[SchedulingBookingNotificationList] - The notifications. + HttpResponse[SchedulingBooking] + The booking. """ _response = self._client_wrapper.httpx_client.request( - f"v1/scheduling/bookings/{encode_path_param(id)}/notifications", - method="GET", - params={ - "limit": limit, - "after": after, + f"v1/scheduling/bookings/{encode_path_param(id)}/location", + method="PATCH", + json={ + "location": convert_and_respect_annotation_metadata( + object_=location, annotation=typing.Optional[SchedulingLocation], direction="write" + ), + }, + headers={ + "content-type": "application/json", }, request_options=request_options, + omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( - SchedulingBookingNotificationList, + SchedulingBooking, parse_obj_as( - type_=SchedulingBookingNotificationList, # type: ignore + type_=SchedulingBooking, # type: ignore object_=_response.json(), ), ) @@ -1354,6 +1953,28 @@ def notifications( ), ), ) + if _response.status_code == 415: + raise UnsupportedMediaTypeError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 422: + raise UnprocessableEntityError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) if _response.status_code == 429: raise TooManyRequestsError( headers=dict(_response.headers), @@ -1396,32 +2017,76 @@ def notifications( ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - def mark_no_show( - self, id: str, *, request_options: typing.Optional[RequestOptions] = None - ) -> HttpResponse[SchedulingBooking]: + +class AsyncRawBookingsClient: + def __init__(self, *, client_wrapper: AsyncClientWrapper): + self._client_wrapper = client_wrapper + + async def reassign( + self, + id: str, + *, + changes: typing.Sequence[ReassignSchedulingBookingRequestChangesItem], + reason_code: ReassignSchedulingBookingRequestReasonCode, + note: typing.Optional[str] = OMIT, + overrides: typing.Optional[typing.Sequence[ReassignSchedulingBookingRequestOverridesItem]] = OMIT, + notify: typing.Optional[ReassignSchedulingBookingRequestNotify] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> AsyncHttpResponse[SchedulingBooking]: """ - Records that the attendee didn't come, once the booking has started. + Gives a booking to another host, keeping its id and time. Works for every kind: a group session moves as a whole, from any of its seats, and one that's already started changes for the record, with nobody told. Whoever leaves and joins is told, and the attendee unless you say not to. Parameters ---------- id : str The booking's id. + changes : typing.Sequence[ReassignSchedulingBookingRequestChangesItem] + A session or a one-on-one has one. A collective can change several. + + reason_code : ReassignSchedulingBookingRequestReasonCode + + note : typing.Optional[str] + Why, in your words: required with an override of someone's availability. Encrypted, and only in the booking's history. + + overrides : typing.Optional[typing.Sequence[ReassignSchedulingBookingRequestOverridesItem]] + Go ahead anyway: `any_host` for someone who doesn't take this event type, and the rest for what a candidate's `reason` said. A host who already has something at this time can never be overridden. + + notify : typing.Optional[ReassignSchedulingBookingRequestNotify] + request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - HttpResponse[SchedulingBooking] + AsyncHttpResponse[SchedulingBooking] The booking. """ - _response = self._client_wrapper.httpx_client.request( - f"v1/scheduling/bookings/{encode_path_param(id)}/no_show", + _request_options_with_retries_disabled: typing.Optional[RequestOptions] = ( + {**request_options, "max_retries": 0} if request_options is not None else {"max_retries": 0} + ) + _response = await self._client_wrapper.httpx_client.request( + f"v1/scheduling/bookings/{encode_path_param(id)}/reassign", method="POST", + json={ + "changes": convert_and_respect_annotation_metadata( + object_=changes, + annotation=typing.Sequence[ReassignSchedulingBookingRequestChangesItem], + direction="write", + ), + "reason_code": reason_code, + "note": note, + "overrides": overrides, + "notify": convert_and_respect_annotation_metadata( + object_=notify, annotation=ReassignSchedulingBookingRequestNotify, direction="write" + ), + }, headers={ + "content-type": "application/json", "Idempotency-Key": generate_idempotency_key(), }, - request_options=request_options, + request_options=_request_options_with_retries_disabled, + omit=OMIT, ) try: if 200 <= _response.status_code < 300: @@ -1432,7 +2097,7 @@ def mark_no_show( object_=_response.json(), ), ) - return HttpResponse(response=_response, data=_data) + return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 400: raise BadRequestError( headers=dict(_response.headers), @@ -1477,6 +2142,17 @@ def mark_no_show( ), ), ) + if _response.status_code == 415: + raise UnsupportedMediaTypeError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), @@ -1530,51 +2206,50 @@ def mark_no_show( ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - def update_location( - self, id: str, *, location: SchedulingLocation, request_options: typing.Optional[RequestOptions] = None - ) -> HttpResponse[SchedulingBooking]: + async def reassign_candidates( + self, + id: str, + *, + from_host: typing.Optional[str] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> AsyncHttpResponse[SchedulingReassignCandidateList]: """ - Where it happens, such as the meeting link you made after the `scheduling.booking.confirmed` webhook. + The environment's other active hosts: members of the event type first, in the order a pool would pick them, each saying whether they're free and why not. Things can change before you ask: reassigning decides again. Parameters ---------- id : str The booking's id. - location : SchedulingLocation + from_host : typing.Optional[str] + The host who'd leave, when it could be several. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - HttpResponse[SchedulingBooking] - The booking. + AsyncHttpResponse[SchedulingReassignCandidateList] + The candidates. """ - _response = self._client_wrapper.httpx_client.request( - f"v1/scheduling/bookings/{encode_path_param(id)}/location", - method="PATCH", - json={ - "location": convert_and_respect_annotation_metadata( - object_=location, annotation=SchedulingLocation, direction="write" - ), - }, - headers={ - "content-type": "application/json", + _response = await self._client_wrapper.httpx_client.request( + f"v1/scheduling/bookings/{encode_path_param(id)}/reassign_candidates", + method="GET", + params={ + "from_host": from_host, }, request_options=request_options, - omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( - SchedulingBooking, + SchedulingReassignCandidateList, parse_obj_as( - type_=SchedulingBooking, # type: ignore + type_=SchedulingReassignCandidateList, # type: ignore object_=_response.json(), ), ) - return HttpResponse(response=_response, data=_data) + return AsyncHttpResponse(response=_response, data=_data) if _response.status_code == 400: raise BadRequestError( headers=dict(_response.headers), @@ -1619,17 +2294,6 @@ def update_location( ), ), ) - if _response.status_code == 415: - raise UnsupportedMediaTypeError( - headers=dict(_response.headers), - body=typing.cast( - Error, - parse_obj_as( - type_=Error, # type: ignore - object_=_response.json(), - ), - ), - ) if _response.status_code == 422: raise UnprocessableEntityError( headers=dict(_response.headers), @@ -1683,11 +2347,6 @@ def update_location( ) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - -class AsyncRawBookingsClient: - def __init__(self, *, client_wrapper: AsyncClientWrapper): - self._client_wrapper = client_wrapper - async def list( self, *, @@ -3174,7 +3833,11 @@ async def mark_no_show( raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) async def update_location( - self, id: str, *, location: SchedulingLocation, request_options: typing.Optional[RequestOptions] = None + self, + id: str, + *, + location: typing.Optional[SchedulingLocation] = OMIT, + request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[SchedulingBooking]: """ Where it happens, such as the meeting link you made after the `scheduling.booking.confirmed` webhook. @@ -3184,7 +3847,7 @@ async def update_location( id : str The booking's id. - location : SchedulingLocation + location : typing.Optional[SchedulingLocation] request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -3199,7 +3862,7 @@ async def update_location( method="PATCH", json={ "location": convert_and_respect_annotation_metadata( - object_=location, annotation=SchedulingLocation, direction="write" + object_=location, annotation=typing.Optional[SchedulingLocation], direction="write" ), }, headers={ diff --git a/sdks/python/src/coss/resources/scheduling/resources/bookings/types/__init__.py b/sdks/python/src/coss/resources/scheduling/resources/bookings/types/__init__.py index 5996761e8..b0b04c0d1 100644 --- a/sdks/python/src/coss/resources/scheduling/resources/bookings/types/__init__.py +++ b/sdks/python/src/coss/resources/scheduling/resources/bookings/types/__init__.py @@ -24,6 +24,10 @@ from .create_booking_request_location_phone import CreateBookingRequestLocationPhone from .create_booking_request_location_zoom import CreateBookingRequestLocationZoom from .list_bookings_request_status import ListBookingsRequestStatus + from .reassign_scheduling_booking_request_changes_item import ReassignSchedulingBookingRequestChangesItem + from .reassign_scheduling_booking_request_notify import ReassignSchedulingBookingRequestNotify + from .reassign_scheduling_booking_request_overrides_item import ReassignSchedulingBookingRequestOverridesItem + from .reassign_scheduling_booking_request_reason_code import ReassignSchedulingBookingRequestReasonCode _dynamic_imports: typing.Dict[str, str] = { "CreateBookingRequestAnswersValue": ".create_booking_request_answers_value", "CreateBookingRequestAttributesValue": ".create_booking_request_attributes_value", @@ -41,6 +45,10 @@ "CreateBookingRequestLocation_Phone": ".create_booking_request_location", "CreateBookingRequestLocation_Zoom": ".create_booking_request_location", "ListBookingsRequestStatus": ".list_bookings_request_status", + "ReassignSchedulingBookingRequestChangesItem": ".reassign_scheduling_booking_request_changes_item", + "ReassignSchedulingBookingRequestNotify": ".reassign_scheduling_booking_request_notify", + "ReassignSchedulingBookingRequestOverridesItem": ".reassign_scheduling_booking_request_overrides_item", + "ReassignSchedulingBookingRequestReasonCode": ".reassign_scheduling_booking_request_reason_code", } @@ -82,4 +90,8 @@ def __dir__(): "CreateBookingRequestLocation_Phone", "CreateBookingRequestLocation_Zoom", "ListBookingsRequestStatus", + "ReassignSchedulingBookingRequestChangesItem", + "ReassignSchedulingBookingRequestNotify", + "ReassignSchedulingBookingRequestOverridesItem", + "ReassignSchedulingBookingRequestReasonCode", ] diff --git a/sdks/python/src/coss/resources/scheduling/resources/bookings/types/reassign_scheduling_booking_request_changes_item.py b/sdks/python/src/coss/resources/scheduling/resources/bookings/types/reassign_scheduling_booking_request_changes_item.py new file mode 100644 index 000000000..0d767cb28 --- /dev/null +++ b/sdks/python/src/coss/resources/scheduling/resources/bookings/types/reassign_scheduling_booking_request_changes_item.py @@ -0,0 +1,37 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ......core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel + + +class ReassignSchedulingBookingRequestChangesItem(UniversalBaseModel): + from_host: typing.Optional[str] = pydantic.Field(default=None) + """ + The host leaving, by id or uid. Needed when it could be several. + """ + + to_host: typing.Optional[str] = pydantic.Field(default=None) + """ + The host taking over, by id or uid. Or set `auto`. + """ + + auto: typing.Optional[bool] = pydantic.Field(default=None) + """ + Let coss.com pick, as a pool would: the fairest who's free and fits what the booking was routed with. + """ + + preferred_hosts: typing.Optional[typing.List[str]] = pydantic.Field(default=None) + """ + With `auto`: try these first, in order. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/sdks/python/src/coss/resources/scheduling/resources/bookings/types/reassign_scheduling_booking_request_notify.py b/sdks/python/src/coss/resources/scheduling/resources/bookings/types/reassign_scheduling_booking_request_notify.py new file mode 100644 index 000000000..0239869d0 --- /dev/null +++ b/sdks/python/src/coss/resources/scheduling/resources/bookings/types/reassign_scheduling_booking_request_notify.py @@ -0,0 +1,22 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ......core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel + + +class ReassignSchedulingBookingRequestNotify(UniversalBaseModel): + attendee: typing.Optional[bool] = pydantic.Field(default=None) + """ + Tell the attendee. Default: true. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/sdks/python/src/coss/resources/scheduling/resources/bookings/types/reassign_scheduling_booking_request_overrides_item.py b/sdks/python/src/coss/resources/scheduling/resources/bookings/types/reassign_scheduling_booking_request_overrides_item.py new file mode 100644 index 000000000..cc1b8ec0c --- /dev/null +++ b/sdks/python/src/coss/resources/scheduling/resources/bookings/types/reassign_scheduling_booking_request_overrides_item.py @@ -0,0 +1,10 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +ReassignSchedulingBookingRequestOverridesItem = typing.Union[ + typing.Literal[ + "any_host", "out_of_office", "outside_availability", "host_busy", "limit_reached", "calendar_unverified" + ], + typing.Any, +] diff --git a/sdks/python/src/coss/resources/scheduling/resources/bookings/types/reassign_scheduling_booking_request_reason_code.py b/sdks/python/src/coss/resources/scheduling/resources/bookings/types/reassign_scheduling_booking_request_reason_code.py new file mode 100644 index 000000000..91478a087 --- /dev/null +++ b/sdks/python/src/coss/resources/scheduling/resources/bookings/types/reassign_scheduling_booking_request_reason_code.py @@ -0,0 +1,8 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +ReassignSchedulingBookingRequestReasonCode = typing.Union[ + typing.Literal["host_unavailable", "out_of_office", "workload", "customer_request", "offboarding", "other"], + typing.Any, +] diff --git a/sdks/python/src/coss/resources/scheduling/resources/event_types/client.py b/sdks/python/src/coss/resources/scheduling/resources/event_types/client.py index 596c17e1c..e7b8fd03d 100644 --- a/sdks/python/src/coss/resources/scheduling/resources/event_types/client.py +++ b/sdks/python/src/coss/resources/scheduling/resources/event_types/client.py @@ -97,6 +97,7 @@ def create( limits: typing.Optional[typing.Sequence[SchedulingLimit]] = OMIT, capacity: typing.Optional[int] = OMIT, requires_approval: typing.Optional[bool] = OMIT, + reassignment_enabled: typing.Optional[bool] = OMIT, approval_ttl_minutes: typing.Optional[int] = OMIT, hold_ttl_seconds: typing.Optional[int] = OMIT, cancel_notice_minutes: typing.Optional[int] = OMIT, @@ -105,7 +106,7 @@ def create( max_active_bookings_per_attendee: typing.Optional[int] = OMIT, host_calendar_details: typing.Optional[CreateEventTypeRequestHostCalendarDetails] = OMIT, questions: typing.Optional[typing.Sequence[SchedulingQuestion]] = OMIT, - locations: typing.Optional[typing.Sequence[SchedulingLocation]] = OMIT, + locations: typing.Optional[typing.Sequence[typing.Optional[SchedulingLocation]]] = OMIT, host_filter: typing.Optional[typing.Dict[str, typing.Optional[CreateEventTypeRequestHostFilterValue]]] = OMIT, notifications: typing.Optional[ typing.Dict[str, typing.Optional[CreateEventTypeRequestNotificationsValue]] @@ -164,6 +165,9 @@ def create( requires_approval : typing.Optional[bool] Bookings start as `pending_approval`, holding the time until approved or declined. Default: `false`. + reassignment_enabled : typing.Optional[bool] + Whether bookings of this event type can go to another host. Default: true. + approval_ttl_minutes : typing.Optional[int] How long a booking can wait for approval before it's declined, in minutes. Default: 1440. @@ -188,7 +192,7 @@ def create( questions : typing.Optional[typing.Sequence[SchedulingQuestion]] What attendees are asked when booking. Keys must be unique. - locations : typing.Optional[typing.Sequence[SchedulingLocation]] + locations : typing.Optional[typing.Sequence[typing.Optional[SchedulingLocation]]] Where bookings can meet. A browser only chooses among these. A `group` event type can't use `zoom`. host_filter : typing.Optional[typing.Dict[str, typing.Optional[CreateEventTypeRequestHostFilterValue]]] @@ -251,6 +255,7 @@ def create( limits=limits, capacity=capacity, requires_approval=requires_approval, + reassignment_enabled=reassignment_enabled, approval_ttl_minutes=approval_ttl_minutes, hold_ttl_seconds=hold_ttl_seconds, cancel_notice_minutes=cancel_notice_minutes, @@ -319,6 +324,7 @@ def update( limits: typing.Optional[typing.Sequence[SchedulingLimit]] = OMIT, capacity: typing.Optional[int] = OMIT, requires_approval: typing.Optional[bool] = OMIT, + reassignment_enabled: typing.Optional[bool] = OMIT, approval_ttl_minutes: typing.Optional[int] = OMIT, hold_ttl_seconds: typing.Optional[int] = OMIT, cancel_notice_minutes: typing.Optional[int] = OMIT, @@ -327,7 +333,7 @@ def update( max_active_bookings_per_attendee: typing.Optional[int] = OMIT, host_calendar_details: typing.Optional[UpdateEventTypeRequestHostCalendarDetails] = OMIT, questions: typing.Optional[typing.Sequence[SchedulingQuestion]] = OMIT, - locations: typing.Optional[typing.Sequence[SchedulingLocation]] = OMIT, + locations: typing.Optional[typing.Sequence[typing.Optional[SchedulingLocation]]] = OMIT, host_filter: typing.Optional[typing.Dict[str, typing.Optional[UpdateEventTypeRequestHostFilterValue]]] = OMIT, notifications: typing.Optional[ typing.Dict[str, typing.Optional[UpdateEventTypeRequestNotificationsValue]] @@ -387,6 +393,9 @@ def update( requires_approval : typing.Optional[bool] Bookings start as `pending_approval`, holding the time until approved or declined. Default: `false`. + reassignment_enabled : typing.Optional[bool] + Whether bookings of this event type can go to another host. Default: true. + approval_ttl_minutes : typing.Optional[int] How long a booking can wait for approval before it's declined, in minutes. Default: 1440. @@ -411,7 +420,7 @@ def update( questions : typing.Optional[typing.Sequence[SchedulingQuestion]] What attendees are asked when booking. Keys must be unique. - locations : typing.Optional[typing.Sequence[SchedulingLocation]] + locations : typing.Optional[typing.Sequence[typing.Optional[SchedulingLocation]]] Where bookings can meet. A browser only chooses among these. A `group` event type can't use `zoom`. host_filter : typing.Optional[typing.Dict[str, typing.Optional[UpdateEventTypeRequestHostFilterValue]]] @@ -469,6 +478,7 @@ def update( limits=limits, capacity=capacity, requires_approval=requires_approval, + reassignment_enabled=reassignment_enabled, approval_ttl_minutes=approval_ttl_minutes, hold_ttl_seconds=hold_ttl_seconds, cancel_notice_minutes=cancel_notice_minutes, @@ -568,6 +578,7 @@ async def create( limits: typing.Optional[typing.Sequence[SchedulingLimit]] = OMIT, capacity: typing.Optional[int] = OMIT, requires_approval: typing.Optional[bool] = OMIT, + reassignment_enabled: typing.Optional[bool] = OMIT, approval_ttl_minutes: typing.Optional[int] = OMIT, hold_ttl_seconds: typing.Optional[int] = OMIT, cancel_notice_minutes: typing.Optional[int] = OMIT, @@ -576,7 +587,7 @@ async def create( max_active_bookings_per_attendee: typing.Optional[int] = OMIT, host_calendar_details: typing.Optional[CreateEventTypeRequestHostCalendarDetails] = OMIT, questions: typing.Optional[typing.Sequence[SchedulingQuestion]] = OMIT, - locations: typing.Optional[typing.Sequence[SchedulingLocation]] = OMIT, + locations: typing.Optional[typing.Sequence[typing.Optional[SchedulingLocation]]] = OMIT, host_filter: typing.Optional[typing.Dict[str, typing.Optional[CreateEventTypeRequestHostFilterValue]]] = OMIT, notifications: typing.Optional[ typing.Dict[str, typing.Optional[CreateEventTypeRequestNotificationsValue]] @@ -635,6 +646,9 @@ async def create( requires_approval : typing.Optional[bool] Bookings start as `pending_approval`, holding the time until approved or declined. Default: `false`. + reassignment_enabled : typing.Optional[bool] + Whether bookings of this event type can go to another host. Default: true. + approval_ttl_minutes : typing.Optional[int] How long a booking can wait for approval before it's declined, in minutes. Default: 1440. @@ -659,7 +673,7 @@ async def create( questions : typing.Optional[typing.Sequence[SchedulingQuestion]] What attendees are asked when booking. Keys must be unique. - locations : typing.Optional[typing.Sequence[SchedulingLocation]] + locations : typing.Optional[typing.Sequence[typing.Optional[SchedulingLocation]]] Where bookings can meet. A browser only chooses among these. A `group` event type can't use `zoom`. host_filter : typing.Optional[typing.Dict[str, typing.Optional[CreateEventTypeRequestHostFilterValue]]] @@ -730,6 +744,7 @@ async def main() -> None: limits=limits, capacity=capacity, requires_approval=requires_approval, + reassignment_enabled=reassignment_enabled, approval_ttl_minutes=approval_ttl_minutes, hold_ttl_seconds=hold_ttl_seconds, cancel_notice_minutes=cancel_notice_minutes, @@ -808,6 +823,7 @@ async def update( limits: typing.Optional[typing.Sequence[SchedulingLimit]] = OMIT, capacity: typing.Optional[int] = OMIT, requires_approval: typing.Optional[bool] = OMIT, + reassignment_enabled: typing.Optional[bool] = OMIT, approval_ttl_minutes: typing.Optional[int] = OMIT, hold_ttl_seconds: typing.Optional[int] = OMIT, cancel_notice_minutes: typing.Optional[int] = OMIT, @@ -816,7 +832,7 @@ async def update( max_active_bookings_per_attendee: typing.Optional[int] = OMIT, host_calendar_details: typing.Optional[UpdateEventTypeRequestHostCalendarDetails] = OMIT, questions: typing.Optional[typing.Sequence[SchedulingQuestion]] = OMIT, - locations: typing.Optional[typing.Sequence[SchedulingLocation]] = OMIT, + locations: typing.Optional[typing.Sequence[typing.Optional[SchedulingLocation]]] = OMIT, host_filter: typing.Optional[typing.Dict[str, typing.Optional[UpdateEventTypeRequestHostFilterValue]]] = OMIT, notifications: typing.Optional[ typing.Dict[str, typing.Optional[UpdateEventTypeRequestNotificationsValue]] @@ -876,6 +892,9 @@ async def update( requires_approval : typing.Optional[bool] Bookings start as `pending_approval`, holding the time until approved or declined. Default: `false`. + reassignment_enabled : typing.Optional[bool] + Whether bookings of this event type can go to another host. Default: true. + approval_ttl_minutes : typing.Optional[int] How long a booking can wait for approval before it's declined, in minutes. Default: 1440. @@ -900,7 +919,7 @@ async def update( questions : typing.Optional[typing.Sequence[SchedulingQuestion]] What attendees are asked when booking. Keys must be unique. - locations : typing.Optional[typing.Sequence[SchedulingLocation]] + locations : typing.Optional[typing.Sequence[typing.Optional[SchedulingLocation]]] Where bookings can meet. A browser only chooses among these. A `group` event type can't use `zoom`. host_filter : typing.Optional[typing.Dict[str, typing.Optional[UpdateEventTypeRequestHostFilterValue]]] @@ -966,6 +985,7 @@ async def main() -> None: limits=limits, capacity=capacity, requires_approval=requires_approval, + reassignment_enabled=reassignment_enabled, approval_ttl_minutes=approval_ttl_minutes, hold_ttl_seconds=hold_ttl_seconds, cancel_notice_minutes=cancel_notice_minutes, diff --git a/sdks/python/src/coss/resources/scheduling/resources/event_types/raw_client.py b/sdks/python/src/coss/resources/scheduling/resources/event_types/raw_client.py index a867e8dab..588843ba5 100644 --- a/sdks/python/src/coss/resources/scheduling/resources/event_types/raw_client.py +++ b/sdks/python/src/coss/resources/scheduling/resources/event_types/raw_client.py @@ -197,6 +197,7 @@ def create( limits: typing.Optional[typing.Sequence[SchedulingLimit]] = OMIT, capacity: typing.Optional[int] = OMIT, requires_approval: typing.Optional[bool] = OMIT, + reassignment_enabled: typing.Optional[bool] = OMIT, approval_ttl_minutes: typing.Optional[int] = OMIT, hold_ttl_seconds: typing.Optional[int] = OMIT, cancel_notice_minutes: typing.Optional[int] = OMIT, @@ -205,7 +206,7 @@ def create( max_active_bookings_per_attendee: typing.Optional[int] = OMIT, host_calendar_details: typing.Optional[CreateEventTypeRequestHostCalendarDetails] = OMIT, questions: typing.Optional[typing.Sequence[SchedulingQuestion]] = OMIT, - locations: typing.Optional[typing.Sequence[SchedulingLocation]] = OMIT, + locations: typing.Optional[typing.Sequence[typing.Optional[SchedulingLocation]]] = OMIT, host_filter: typing.Optional[typing.Dict[str, typing.Optional[CreateEventTypeRequestHostFilterValue]]] = OMIT, notifications: typing.Optional[ typing.Dict[str, typing.Optional[CreateEventTypeRequestNotificationsValue]] @@ -264,6 +265,9 @@ def create( requires_approval : typing.Optional[bool] Bookings start as `pending_approval`, holding the time until approved or declined. Default: `false`. + reassignment_enabled : typing.Optional[bool] + Whether bookings of this event type can go to another host. Default: true. + approval_ttl_minutes : typing.Optional[int] How long a booking can wait for approval before it's declined, in minutes. Default: 1440. @@ -288,7 +292,7 @@ def create( questions : typing.Optional[typing.Sequence[SchedulingQuestion]] What attendees are asked when booking. Keys must be unique. - locations : typing.Optional[typing.Sequence[SchedulingLocation]] + locations : typing.Optional[typing.Sequence[typing.Optional[SchedulingLocation]]] Where bookings can meet. A browser only chooses among these. A `group` event type can't use `zoom`. host_filter : typing.Optional[typing.Dict[str, typing.Optional[CreateEventTypeRequestHostFilterValue]]] @@ -340,6 +344,7 @@ def create( ), "capacity": capacity, "requires_approval": requires_approval, + "reassignment_enabled": reassignment_enabled, "approval_ttl_minutes": approval_ttl_minutes, "hold_ttl_seconds": hold_ttl_seconds, "cancel_notice_minutes": cancel_notice_minutes, @@ -351,7 +356,9 @@ def create( object_=questions, annotation=typing.Sequence[SchedulingQuestion], direction="write" ), "locations": convert_and_respect_annotation_metadata( - object_=locations, annotation=typing.Sequence[SchedulingLocation], direction="write" + object_=locations, + annotation=typing.Sequence[typing.Optional[SchedulingLocation]], + direction="write", ), "host_filter": convert_and_respect_annotation_metadata( object_=host_filter, @@ -651,6 +658,7 @@ def update( limits: typing.Optional[typing.Sequence[SchedulingLimit]] = OMIT, capacity: typing.Optional[int] = OMIT, requires_approval: typing.Optional[bool] = OMIT, + reassignment_enabled: typing.Optional[bool] = OMIT, approval_ttl_minutes: typing.Optional[int] = OMIT, hold_ttl_seconds: typing.Optional[int] = OMIT, cancel_notice_minutes: typing.Optional[int] = OMIT, @@ -659,7 +667,7 @@ def update( max_active_bookings_per_attendee: typing.Optional[int] = OMIT, host_calendar_details: typing.Optional[UpdateEventTypeRequestHostCalendarDetails] = OMIT, questions: typing.Optional[typing.Sequence[SchedulingQuestion]] = OMIT, - locations: typing.Optional[typing.Sequence[SchedulingLocation]] = OMIT, + locations: typing.Optional[typing.Sequence[typing.Optional[SchedulingLocation]]] = OMIT, host_filter: typing.Optional[typing.Dict[str, typing.Optional[UpdateEventTypeRequestHostFilterValue]]] = OMIT, notifications: typing.Optional[ typing.Dict[str, typing.Optional[UpdateEventTypeRequestNotificationsValue]] @@ -719,6 +727,9 @@ def update( requires_approval : typing.Optional[bool] Bookings start as `pending_approval`, holding the time until approved or declined. Default: `false`. + reassignment_enabled : typing.Optional[bool] + Whether bookings of this event type can go to another host. Default: true. + approval_ttl_minutes : typing.Optional[int] How long a booking can wait for approval before it's declined, in minutes. Default: 1440. @@ -743,7 +754,7 @@ def update( questions : typing.Optional[typing.Sequence[SchedulingQuestion]] What attendees are asked when booking. Keys must be unique. - locations : typing.Optional[typing.Sequence[SchedulingLocation]] + locations : typing.Optional[typing.Sequence[typing.Optional[SchedulingLocation]]] Where bookings can meet. A browser only chooses among these. A `group` event type can't use `zoom`. host_filter : typing.Optional[typing.Dict[str, typing.Optional[UpdateEventTypeRequestHostFilterValue]]] @@ -794,6 +805,7 @@ def update( ), "capacity": capacity, "requires_approval": requires_approval, + "reassignment_enabled": reassignment_enabled, "approval_ttl_minutes": approval_ttl_minutes, "hold_ttl_seconds": hold_ttl_seconds, "cancel_notice_minutes": cancel_notice_minutes, @@ -805,7 +817,9 @@ def update( object_=questions, annotation=typing.Sequence[SchedulingQuestion], direction="write" ), "locations": convert_and_respect_annotation_metadata( - object_=locations, annotation=typing.Sequence[SchedulingLocation], direction="write" + object_=locations, + annotation=typing.Sequence[typing.Optional[SchedulingLocation]], + direction="write", ), "host_filter": convert_and_respect_annotation_metadata( object_=host_filter, @@ -1120,6 +1134,7 @@ async def create( limits: typing.Optional[typing.Sequence[SchedulingLimit]] = OMIT, capacity: typing.Optional[int] = OMIT, requires_approval: typing.Optional[bool] = OMIT, + reassignment_enabled: typing.Optional[bool] = OMIT, approval_ttl_minutes: typing.Optional[int] = OMIT, hold_ttl_seconds: typing.Optional[int] = OMIT, cancel_notice_minutes: typing.Optional[int] = OMIT, @@ -1128,7 +1143,7 @@ async def create( max_active_bookings_per_attendee: typing.Optional[int] = OMIT, host_calendar_details: typing.Optional[CreateEventTypeRequestHostCalendarDetails] = OMIT, questions: typing.Optional[typing.Sequence[SchedulingQuestion]] = OMIT, - locations: typing.Optional[typing.Sequence[SchedulingLocation]] = OMIT, + locations: typing.Optional[typing.Sequence[typing.Optional[SchedulingLocation]]] = OMIT, host_filter: typing.Optional[typing.Dict[str, typing.Optional[CreateEventTypeRequestHostFilterValue]]] = OMIT, notifications: typing.Optional[ typing.Dict[str, typing.Optional[CreateEventTypeRequestNotificationsValue]] @@ -1187,6 +1202,9 @@ async def create( requires_approval : typing.Optional[bool] Bookings start as `pending_approval`, holding the time until approved or declined. Default: `false`. + reassignment_enabled : typing.Optional[bool] + Whether bookings of this event type can go to another host. Default: true. + approval_ttl_minutes : typing.Optional[int] How long a booking can wait for approval before it's declined, in minutes. Default: 1440. @@ -1211,7 +1229,7 @@ async def create( questions : typing.Optional[typing.Sequence[SchedulingQuestion]] What attendees are asked when booking. Keys must be unique. - locations : typing.Optional[typing.Sequence[SchedulingLocation]] + locations : typing.Optional[typing.Sequence[typing.Optional[SchedulingLocation]]] Where bookings can meet. A browser only chooses among these. A `group` event type can't use `zoom`. host_filter : typing.Optional[typing.Dict[str, typing.Optional[CreateEventTypeRequestHostFilterValue]]] @@ -1263,6 +1281,7 @@ async def create( ), "capacity": capacity, "requires_approval": requires_approval, + "reassignment_enabled": reassignment_enabled, "approval_ttl_minutes": approval_ttl_minutes, "hold_ttl_seconds": hold_ttl_seconds, "cancel_notice_minutes": cancel_notice_minutes, @@ -1274,7 +1293,9 @@ async def create( object_=questions, annotation=typing.Sequence[SchedulingQuestion], direction="write" ), "locations": convert_and_respect_annotation_metadata( - object_=locations, annotation=typing.Sequence[SchedulingLocation], direction="write" + object_=locations, + annotation=typing.Sequence[typing.Optional[SchedulingLocation]], + direction="write", ), "host_filter": convert_and_respect_annotation_metadata( object_=host_filter, @@ -1574,6 +1595,7 @@ async def update( limits: typing.Optional[typing.Sequence[SchedulingLimit]] = OMIT, capacity: typing.Optional[int] = OMIT, requires_approval: typing.Optional[bool] = OMIT, + reassignment_enabled: typing.Optional[bool] = OMIT, approval_ttl_minutes: typing.Optional[int] = OMIT, hold_ttl_seconds: typing.Optional[int] = OMIT, cancel_notice_minutes: typing.Optional[int] = OMIT, @@ -1582,7 +1604,7 @@ async def update( max_active_bookings_per_attendee: typing.Optional[int] = OMIT, host_calendar_details: typing.Optional[UpdateEventTypeRequestHostCalendarDetails] = OMIT, questions: typing.Optional[typing.Sequence[SchedulingQuestion]] = OMIT, - locations: typing.Optional[typing.Sequence[SchedulingLocation]] = OMIT, + locations: typing.Optional[typing.Sequence[typing.Optional[SchedulingLocation]]] = OMIT, host_filter: typing.Optional[typing.Dict[str, typing.Optional[UpdateEventTypeRequestHostFilterValue]]] = OMIT, notifications: typing.Optional[ typing.Dict[str, typing.Optional[UpdateEventTypeRequestNotificationsValue]] @@ -1642,6 +1664,9 @@ async def update( requires_approval : typing.Optional[bool] Bookings start as `pending_approval`, holding the time until approved or declined. Default: `false`. + reassignment_enabled : typing.Optional[bool] + Whether bookings of this event type can go to another host. Default: true. + approval_ttl_minutes : typing.Optional[int] How long a booking can wait for approval before it's declined, in minutes. Default: 1440. @@ -1666,7 +1691,7 @@ async def update( questions : typing.Optional[typing.Sequence[SchedulingQuestion]] What attendees are asked when booking. Keys must be unique. - locations : typing.Optional[typing.Sequence[SchedulingLocation]] + locations : typing.Optional[typing.Sequence[typing.Optional[SchedulingLocation]]] Where bookings can meet. A browser only chooses among these. A `group` event type can't use `zoom`. host_filter : typing.Optional[typing.Dict[str, typing.Optional[UpdateEventTypeRequestHostFilterValue]]] @@ -1717,6 +1742,7 @@ async def update( ), "capacity": capacity, "requires_approval": requires_approval, + "reassignment_enabled": reassignment_enabled, "approval_ttl_minutes": approval_ttl_minutes, "hold_ttl_seconds": hold_ttl_seconds, "cancel_notice_minutes": cancel_notice_minutes, @@ -1728,7 +1754,9 @@ async def update( object_=questions, annotation=typing.Sequence[SchedulingQuestion], direction="write" ), "locations": convert_and_respect_annotation_metadata( - object_=locations, annotation=typing.Sequence[SchedulingLocation], direction="write" + object_=locations, + annotation=typing.Sequence[typing.Optional[SchedulingLocation]], + direction="write", ), "host_filter": convert_and_respect_annotation_metadata( object_=host_filter, diff --git a/sdks/python/src/coss/resources/scheduling/resources/holiday_calendars/__init__.py b/sdks/python/src/coss/resources/scheduling/resources/holiday_calendars/__init__.py new file mode 100644 index 000000000..20bc7c7f7 --- /dev/null +++ b/sdks/python/src/coss/resources/scheduling/resources/holiday_calendars/__init__.py @@ -0,0 +1,49 @@ +# This file was auto-generated by Fern from our API Definition. + +# isort: skip_file + +import typing +from importlib import import_module + +if typing.TYPE_CHECKING: + from .types import ( + CreateSchedulingHolidayCalendarRequestExistingBookings, + CreateSchedulingHolidayCalendarRequestHostFilterValue, + UpdateSchedulingHolidayCalendarRequestExistingBookings, + UpdateSchedulingHolidayCalendarRequestHostFilterValue, + ) +_dynamic_imports: typing.Dict[str, str] = { + "CreateSchedulingHolidayCalendarRequestExistingBookings": ".types", + "CreateSchedulingHolidayCalendarRequestHostFilterValue": ".types", + "UpdateSchedulingHolidayCalendarRequestExistingBookings": ".types", + "UpdateSchedulingHolidayCalendarRequestHostFilterValue": ".types", +} + + +def __getattr__(attr_name: str) -> typing.Any: + module_name = _dynamic_imports.get(attr_name) + if module_name is None: + raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") + try: + module = import_module(module_name, __package__) + if module_name == f".{attr_name}": + return module + else: + return getattr(module, attr_name) + except ImportError as e: + raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e + except AttributeError as e: + raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e + + +def __dir__(): + lazy_attrs = list(_dynamic_imports.keys()) + return sorted(lazy_attrs) + + +__all__ = [ + "CreateSchedulingHolidayCalendarRequestExistingBookings", + "CreateSchedulingHolidayCalendarRequestHostFilterValue", + "UpdateSchedulingHolidayCalendarRequestExistingBookings", + "UpdateSchedulingHolidayCalendarRequestHostFilterValue", +] diff --git a/sdks/python/src/coss/resources/scheduling/resources/holiday_calendars/client.py b/sdks/python/src/coss/resources/scheduling/resources/holiday_calendars/client.py new file mode 100644 index 000000000..ec01e89eb --- /dev/null +++ b/sdks/python/src/coss/resources/scheduling/resources/holiday_calendars/client.py @@ -0,0 +1,652 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper +from .....core.request_options import RequestOptions +from .....types.deleted_scheduling_holiday_calendar import DeletedSchedulingHolidayCalendar +from .....types.scheduling_holiday_calendar import SchedulingHolidayCalendar +from .....types.scheduling_holiday_calendar_list import SchedulingHolidayCalendarList +from .....types.scheduling_holiday_list import SchedulingHolidayList +from .raw_client import AsyncRawHolidayCalendarsClient, RawHolidayCalendarsClient +from .types.create_scheduling_holiday_calendar_request_existing_bookings import ( + CreateSchedulingHolidayCalendarRequestExistingBookings, +) +from .types.create_scheduling_holiday_calendar_request_host_filter_value import ( + CreateSchedulingHolidayCalendarRequestHostFilterValue, +) +from .types.update_scheduling_holiday_calendar_request_existing_bookings import ( + UpdateSchedulingHolidayCalendarRequestExistingBookings, +) +from .types.update_scheduling_holiday_calendar_request_host_filter_value import ( + UpdateSchedulingHolidayCalendarRequestHostFilterValue, +) + +# this is used as the default value for optional parameters +OMIT = typing.cast(typing.Any, ...) + + +class HolidayCalendarsClient: + def __init__(self, *, client_wrapper: SyncClientWrapper): + self._raw_client = RawHolidayCalendarsClient(client_wrapper=client_wrapper) + + @property + def with_raw_response(self) -> RawHolidayCalendarsClient: + """ + Retrieves a raw implementation of this client that returns raw responses. + + Returns + ------- + RawHolidayCalendarsClient + """ + return self._raw_client + + def list(self, *, request_options: typing.Optional[RequestOptions] = None) -> SchedulingHolidayCalendarList: + """ + By name. A feed's URL is never shown again. + + Parameters + ---------- + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + SchedulingHolidayCalendarList + The calendars. + + Examples + -------- + from coss import Coss + + client = Coss( + "2026-10-10", + api_key="YOUR_API_KEY", + ) + client.scheduling.holiday_calendars.list() + """ + _response = self._raw_client.list(request_options=request_options) + return _response.data + + def create( + self, + *, + name: str, + country: typing.Optional[str] = OMIT, + ics_url: typing.Optional[str] = OMIT, + hosts: typing.Optional[typing.Sequence[str]] = OMIT, + host_filter: typing.Optional[typing.Dict[str, CreateSchedulingHolidayCalendarRequestHostFilterValue]] = OMIT, + regions: typing.Optional[typing.Sequence[str]] = OMIT, + delegates: typing.Optional[typing.Sequence[str]] = OMIT, + existing_bookings: typing.Optional[CreateSchedulingHolidayCalendarRequestExistingBookings] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> SchedulingHolidayCalendar: + """ + Applies a country's public holidays, or your own feed, to some hosts as ordinary out of office entries, kept up to date by coss.com. A host who removes one keeps it removed. + + Parameters + ---------- + name : str + + country : typing.Optional[str] + A code from the list of holiday calendars, such as `GB`. + + ics_url : typing.Optional[str] + Your own feed, https or webcal, read in live environments. Stored encrypted. + + hosts : typing.Optional[typing.Sequence[str]] + These hosts, by id or uid. + + host_filter : typing.Optional[typing.Dict[str, CreateSchedulingHolidayCalendarRequestHostFilterValue]] + Everyone matching these attributes, asked again at every sync. + + regions : typing.Optional[typing.Sequence[str]] + Which regional holidays apply, matched against how the calendar names them, such as `England`. Without this, all of them do; empty, only nationwide ones. + + delegates : typing.Optional[typing.Sequence[str]] + Who can be booked in their place on those days, by id or uid, in order. + + existing_bookings : typing.Optional[CreateSchedulingHolidayCalendarRequestExistingBookings] + What happens to bookings already on a holiday. `leave` (the default) only reports them. `reassign` moves them. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + SchedulingHolidayCalendar + The calendar. + + Examples + -------- + from coss import Coss + + client = Coss( + "2026-10-10", + api_key="YOUR_API_KEY", + ) + client.scheduling.holiday_calendars.create( + name="UK team", + country="GB", + host_filter={"team": "london"}, + ) + """ + _response = self._raw_client.create( + name=name, + country=country, + ics_url=ics_url, + hosts=hosts, + host_filter=host_filter, + regions=regions, + delegates=delegates, + existing_bookings=existing_bookings, + request_options=request_options, + ) + return _response.data + + def get(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> SchedulingHolidayCalendar: + """ + With when it was last read, and why not if it couldn't be. + + Parameters + ---------- + id : str + The holiday calendar's id. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + SchedulingHolidayCalendar + The calendar. + + Examples + -------- + from coss import Coss + + client = Coss( + "2026-10-10", + api_key="YOUR_API_KEY", + ) + client.scheduling.holiday_calendars.get( + id="id", + ) + """ + _response = self._raw_client.get(id, request_options=request_options) + return _response.data + + def remove( + self, id: str, *, request_options: typing.Optional[RequestOptions] = None + ) -> DeletedSchedulingHolidayCalendar: + """ + Hosts can be booked on its days again, shortly: past entries stay. + + Parameters + ---------- + id : str + The holiday calendar's id. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + DeletedSchedulingHolidayCalendar + It's going. + + Examples + -------- + from coss import Coss + + client = Coss( + "2026-10-10", + api_key="YOUR_API_KEY", + ) + client.scheduling.holiday_calendars.remove( + id="id", + ) + """ + _response = self._raw_client.remove(id, request_options=request_options) + return _response.data + + def update( + self, + id: str, + *, + name: typing.Optional[str] = OMIT, + hosts: typing.Optional[typing.Sequence[str]] = OMIT, + host_filter: typing.Optional[typing.Dict[str, UpdateSchedulingHolidayCalendarRequestHostFilterValue]] = OMIT, + regions: typing.Optional[typing.Sequence[str]] = OMIT, + delegates: typing.Optional[typing.Sequence[str]] = OMIT, + existing_bookings: typing.Optional[UpdateSchedulingHolidayCalendarRequestExistingBookings] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> SchedulingHolidayCalendar: + """ + Who it applies to, who covers and what happens to bookings. Takes effect shortly. + + Parameters + ---------- + id : str + The holiday calendar's id. + + name : typing.Optional[str] + + hosts : typing.Optional[typing.Sequence[str]] + These hosts, by id or uid. + + host_filter : typing.Optional[typing.Dict[str, UpdateSchedulingHolidayCalendarRequestHostFilterValue]] + Everyone matching these attributes, asked again at every sync. + + regions : typing.Optional[typing.Sequence[str]] + Which regional holidays apply, matched against how the calendar names them, such as `England`. Without this, all of them do; empty, only nationwide ones. + + delegates : typing.Optional[typing.Sequence[str]] + Who can be booked in their place on those days, by id or uid, in order. + + existing_bookings : typing.Optional[UpdateSchedulingHolidayCalendarRequestExistingBookings] + What happens to bookings already on a holiday. `leave` (the default) only reports them. `reassign` moves them. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + SchedulingHolidayCalendar + The calendar. + + Examples + -------- + from coss import Coss + + client = Coss( + "2026-10-10", + api_key="YOUR_API_KEY", + ) + client.scheduling.holiday_calendars.update( + id="id", + host_filter={"team": "london"}, + ) + """ + _response = self._raw_client.update( + id, + name=name, + hosts=hosts, + host_filter=host_filter, + regions=regions, + delegates=delegates, + existing_bookings=existing_bookings, + request_options=request_options, + ) + return _response.data + + def holidays(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> SchedulingHolidayList: + """ + What's coming, with names, as last read. Empty until its first read. + + Parameters + ---------- + id : str + The holiday calendar's id. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + SchedulingHolidayList + The holidays. + + Examples + -------- + from coss import Coss + + client = Coss( + "2026-10-10", + api_key="YOUR_API_KEY", + ) + client.scheduling.holiday_calendars.holidays( + id="id", + ) + """ + _response = self._raw_client.holidays(id, request_options=request_options) + return _response.data + + +class AsyncHolidayCalendarsClient: + def __init__(self, *, client_wrapper: AsyncClientWrapper): + self._raw_client = AsyncRawHolidayCalendarsClient(client_wrapper=client_wrapper) + + @property + def with_raw_response(self) -> AsyncRawHolidayCalendarsClient: + """ + Retrieves a raw implementation of this client that returns raw responses. + + Returns + ------- + AsyncRawHolidayCalendarsClient + """ + return self._raw_client + + async def list(self, *, request_options: typing.Optional[RequestOptions] = None) -> SchedulingHolidayCalendarList: + """ + By name. A feed's URL is never shown again. + + Parameters + ---------- + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + SchedulingHolidayCalendarList + The calendars. + + Examples + -------- + import asyncio + + from coss import AsyncCoss + + client = AsyncCoss( + "2026-10-10", + api_key="YOUR_API_KEY", + ) + + + async def main() -> None: + await client.scheduling.holiday_calendars.list() + + + asyncio.run(main()) + """ + _response = await self._raw_client.list(request_options=request_options) + return _response.data + + async def create( + self, + *, + name: str, + country: typing.Optional[str] = OMIT, + ics_url: typing.Optional[str] = OMIT, + hosts: typing.Optional[typing.Sequence[str]] = OMIT, + host_filter: typing.Optional[typing.Dict[str, CreateSchedulingHolidayCalendarRequestHostFilterValue]] = OMIT, + regions: typing.Optional[typing.Sequence[str]] = OMIT, + delegates: typing.Optional[typing.Sequence[str]] = OMIT, + existing_bookings: typing.Optional[CreateSchedulingHolidayCalendarRequestExistingBookings] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> SchedulingHolidayCalendar: + """ + Applies a country's public holidays, or your own feed, to some hosts as ordinary out of office entries, kept up to date by coss.com. A host who removes one keeps it removed. + + Parameters + ---------- + name : str + + country : typing.Optional[str] + A code from the list of holiday calendars, such as `GB`. + + ics_url : typing.Optional[str] + Your own feed, https or webcal, read in live environments. Stored encrypted. + + hosts : typing.Optional[typing.Sequence[str]] + These hosts, by id or uid. + + host_filter : typing.Optional[typing.Dict[str, CreateSchedulingHolidayCalendarRequestHostFilterValue]] + Everyone matching these attributes, asked again at every sync. + + regions : typing.Optional[typing.Sequence[str]] + Which regional holidays apply, matched against how the calendar names them, such as `England`. Without this, all of them do; empty, only nationwide ones. + + delegates : typing.Optional[typing.Sequence[str]] + Who can be booked in their place on those days, by id or uid, in order. + + existing_bookings : typing.Optional[CreateSchedulingHolidayCalendarRequestExistingBookings] + What happens to bookings already on a holiday. `leave` (the default) only reports them. `reassign` moves them. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + SchedulingHolidayCalendar + The calendar. + + Examples + -------- + import asyncio + + from coss import AsyncCoss + + client = AsyncCoss( + "2026-10-10", + api_key="YOUR_API_KEY", + ) + + + async def main() -> None: + await client.scheduling.holiday_calendars.create( + name="UK team", + country="GB", + host_filter={"team": "london"}, + ) + + + asyncio.run(main()) + """ + _response = await self._raw_client.create( + name=name, + country=country, + ics_url=ics_url, + hosts=hosts, + host_filter=host_filter, + regions=regions, + delegates=delegates, + existing_bookings=existing_bookings, + request_options=request_options, + ) + return _response.data + + async def get( + self, id: str, *, request_options: typing.Optional[RequestOptions] = None + ) -> SchedulingHolidayCalendar: + """ + With when it was last read, and why not if it couldn't be. + + Parameters + ---------- + id : str + The holiday calendar's id. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + SchedulingHolidayCalendar + The calendar. + + Examples + -------- + import asyncio + + from coss import AsyncCoss + + client = AsyncCoss( + "2026-10-10", + api_key="YOUR_API_KEY", + ) + + + async def main() -> None: + await client.scheduling.holiday_calendars.get( + id="id", + ) + + + asyncio.run(main()) + """ + _response = await self._raw_client.get(id, request_options=request_options) + return _response.data + + async def remove( + self, id: str, *, request_options: typing.Optional[RequestOptions] = None + ) -> DeletedSchedulingHolidayCalendar: + """ + Hosts can be booked on its days again, shortly: past entries stay. + + Parameters + ---------- + id : str + The holiday calendar's id. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + DeletedSchedulingHolidayCalendar + It's going. + + Examples + -------- + import asyncio + + from coss import AsyncCoss + + client = AsyncCoss( + "2026-10-10", + api_key="YOUR_API_KEY", + ) + + + async def main() -> None: + await client.scheduling.holiday_calendars.remove( + id="id", + ) + + + asyncio.run(main()) + """ + _response = await self._raw_client.remove(id, request_options=request_options) + return _response.data + + async def update( + self, + id: str, + *, + name: typing.Optional[str] = OMIT, + hosts: typing.Optional[typing.Sequence[str]] = OMIT, + host_filter: typing.Optional[typing.Dict[str, UpdateSchedulingHolidayCalendarRequestHostFilterValue]] = OMIT, + regions: typing.Optional[typing.Sequence[str]] = OMIT, + delegates: typing.Optional[typing.Sequence[str]] = OMIT, + existing_bookings: typing.Optional[UpdateSchedulingHolidayCalendarRequestExistingBookings] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> SchedulingHolidayCalendar: + """ + Who it applies to, who covers and what happens to bookings. Takes effect shortly. + + Parameters + ---------- + id : str + The holiday calendar's id. + + name : typing.Optional[str] + + hosts : typing.Optional[typing.Sequence[str]] + These hosts, by id or uid. + + host_filter : typing.Optional[typing.Dict[str, UpdateSchedulingHolidayCalendarRequestHostFilterValue]] + Everyone matching these attributes, asked again at every sync. + + regions : typing.Optional[typing.Sequence[str]] + Which regional holidays apply, matched against how the calendar names them, such as `England`. Without this, all of them do; empty, only nationwide ones. + + delegates : typing.Optional[typing.Sequence[str]] + Who can be booked in their place on those days, by id or uid, in order. + + existing_bookings : typing.Optional[UpdateSchedulingHolidayCalendarRequestExistingBookings] + What happens to bookings already on a holiday. `leave` (the default) only reports them. `reassign` moves them. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + SchedulingHolidayCalendar + The calendar. + + Examples + -------- + import asyncio + + from coss import AsyncCoss + + client = AsyncCoss( + "2026-10-10", + api_key="YOUR_API_KEY", + ) + + + async def main() -> None: + await client.scheduling.holiday_calendars.update( + id="id", + host_filter={"team": "london"}, + ) + + + asyncio.run(main()) + """ + _response = await self._raw_client.update( + id, + name=name, + hosts=hosts, + host_filter=host_filter, + regions=regions, + delegates=delegates, + existing_bookings=existing_bookings, + request_options=request_options, + ) + return _response.data + + async def holidays( + self, id: str, *, request_options: typing.Optional[RequestOptions] = None + ) -> SchedulingHolidayList: + """ + What's coming, with names, as last read. Empty until its first read. + + Parameters + ---------- + id : str + The holiday calendar's id. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + SchedulingHolidayList + The holidays. + + Examples + -------- + import asyncio + + from coss import AsyncCoss + + client = AsyncCoss( + "2026-10-10", + api_key="YOUR_API_KEY", + ) + + + async def main() -> None: + await client.scheduling.holiday_calendars.holidays( + id="id", + ) + + + asyncio.run(main()) + """ + _response = await self._raw_client.holidays(id, request_options=request_options) + return _response.data diff --git a/sdks/python/src/coss/resources/scheduling/resources/holiday_calendars/raw_client.py b/sdks/python/src/coss/resources/scheduling/resources/holiday_calendars/raw_client.py new file mode 100644 index 000000000..2110e37d9 --- /dev/null +++ b/sdks/python/src/coss/resources/scheduling/resources/holiday_calendars/raw_client.py @@ -0,0 +1,1742 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing +from json.decoder import JSONDecodeError + +from .....core.api_error import ApiError +from .....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper +from .....core.http_response import AsyncHttpResponse, HttpResponse +from .....core.idempotency import generate_idempotency_key +from .....core.jsonable_encoder import encode_path_param +from .....core.parse_error import ParsingError +from .....core.pydantic_utilities import parse_obj_as +from .....core.request_options import RequestOptions +from .....core.serialization import convert_and_respect_annotation_metadata +from .....errors.bad_request_error import BadRequestError +from .....errors.forbidden_error import ForbiddenError +from .....errors.internal_server_error import InternalServerError +from .....errors.not_found_error import NotFoundError +from .....errors.service_unavailable_error import ServiceUnavailableError +from .....errors.too_many_requests_error import TooManyRequestsError +from .....errors.unauthorized_error import UnauthorizedError +from .....errors.unprocessable_entity_error import UnprocessableEntityError +from .....errors.unsupported_media_type_error import UnsupportedMediaTypeError +from .....types.deleted_scheduling_holiday_calendar import DeletedSchedulingHolidayCalendar +from .....types.error import Error +from .....types.scheduling_holiday_calendar import SchedulingHolidayCalendar +from .....types.scheduling_holiday_calendar_list import SchedulingHolidayCalendarList +from .....types.scheduling_holiday_list import SchedulingHolidayList +from .types.create_scheduling_holiday_calendar_request_existing_bookings import ( + CreateSchedulingHolidayCalendarRequestExistingBookings, +) +from .types.create_scheduling_holiday_calendar_request_host_filter_value import ( + CreateSchedulingHolidayCalendarRequestHostFilterValue, +) +from .types.update_scheduling_holiday_calendar_request_existing_bookings import ( + UpdateSchedulingHolidayCalendarRequestExistingBookings, +) +from .types.update_scheduling_holiday_calendar_request_host_filter_value import ( + UpdateSchedulingHolidayCalendarRequestHostFilterValue, +) +from pydantic import ValidationError + +# this is used as the default value for optional parameters +OMIT = typing.cast(typing.Any, ...) + + +class RawHolidayCalendarsClient: + def __init__(self, *, client_wrapper: SyncClientWrapper): + self._client_wrapper = client_wrapper + + def list( + self, *, request_options: typing.Optional[RequestOptions] = None + ) -> HttpResponse[SchedulingHolidayCalendarList]: + """ + By name. A feed's URL is never shown again. + + Parameters + ---------- + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + HttpResponse[SchedulingHolidayCalendarList] + The calendars. + """ + _response = self._client_wrapper.httpx_client.request( + "v1/scheduling/holiday_calendars", + method="GET", + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + SchedulingHolidayCalendarList, + parse_obj_as( + type_=SchedulingHolidayCalendarList, # type: ignore + object_=_response.json(), + ), + ) + return HttpResponse(response=_response, data=_data) + if _response.status_code == 400: + raise BadRequestError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 401: + raise UnauthorizedError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 403: + raise ForbiddenError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 429: + raise TooManyRequestsError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 500: + raise InternalServerError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 503: + raise ServiceUnavailableError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) + except ValidationError as e: + raise ParsingError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e + ) + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + + def create( + self, + *, + name: str, + country: typing.Optional[str] = OMIT, + ics_url: typing.Optional[str] = OMIT, + hosts: typing.Optional[typing.Sequence[str]] = OMIT, + host_filter: typing.Optional[typing.Dict[str, CreateSchedulingHolidayCalendarRequestHostFilterValue]] = OMIT, + regions: typing.Optional[typing.Sequence[str]] = OMIT, + delegates: typing.Optional[typing.Sequence[str]] = OMIT, + existing_bookings: typing.Optional[CreateSchedulingHolidayCalendarRequestExistingBookings] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> HttpResponse[SchedulingHolidayCalendar]: + """ + Applies a country's public holidays, or your own feed, to some hosts as ordinary out of office entries, kept up to date by coss.com. A host who removes one keeps it removed. + + Parameters + ---------- + name : str + + country : typing.Optional[str] + A code from the list of holiday calendars, such as `GB`. + + ics_url : typing.Optional[str] + Your own feed, https or webcal, read in live environments. Stored encrypted. + + hosts : typing.Optional[typing.Sequence[str]] + These hosts, by id or uid. + + host_filter : typing.Optional[typing.Dict[str, CreateSchedulingHolidayCalendarRequestHostFilterValue]] + Everyone matching these attributes, asked again at every sync. + + regions : typing.Optional[typing.Sequence[str]] + Which regional holidays apply, matched against how the calendar names them, such as `England`. Without this, all of them do; empty, only nationwide ones. + + delegates : typing.Optional[typing.Sequence[str]] + Who can be booked in their place on those days, by id or uid, in order. + + existing_bookings : typing.Optional[CreateSchedulingHolidayCalendarRequestExistingBookings] + What happens to bookings already on a holiday. `leave` (the default) only reports them. `reassign` moves them. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + HttpResponse[SchedulingHolidayCalendar] + The calendar. + """ + _request_options_with_retries_disabled: typing.Optional[RequestOptions] = ( + {**request_options, "max_retries": 0} if request_options is not None else {"max_retries": 0} + ) + _response = self._client_wrapper.httpx_client.request( + "v1/scheduling/holiday_calendars", + method="POST", + json={ + "name": name, + "country": country, + "ics_url": ics_url, + "hosts": hosts, + "host_filter": convert_and_respect_annotation_metadata( + object_=host_filter, + annotation=typing.Dict[str, CreateSchedulingHolidayCalendarRequestHostFilterValue], + direction="write", + ), + "regions": regions, + "delegates": delegates, + "existing_bookings": existing_bookings, + }, + headers={ + "content-type": "application/json", + "Idempotency-Key": generate_idempotency_key(), + }, + request_options=_request_options_with_retries_disabled, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + SchedulingHolidayCalendar, + parse_obj_as( + type_=SchedulingHolidayCalendar, # type: ignore + object_=_response.json(), + ), + ) + return HttpResponse(response=_response, data=_data) + if _response.status_code == 400: + raise BadRequestError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 401: + raise UnauthorizedError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 403: + raise ForbiddenError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 404: + raise NotFoundError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 415: + raise UnsupportedMediaTypeError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 422: + raise UnprocessableEntityError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 429: + raise TooManyRequestsError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 500: + raise InternalServerError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 503: + raise ServiceUnavailableError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) + except ValidationError as e: + raise ParsingError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e + ) + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + + def get( + self, id: str, *, request_options: typing.Optional[RequestOptions] = None + ) -> HttpResponse[SchedulingHolidayCalendar]: + """ + With when it was last read, and why not if it couldn't be. + + Parameters + ---------- + id : str + The holiday calendar's id. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + HttpResponse[SchedulingHolidayCalendar] + The calendar. + """ + _response = self._client_wrapper.httpx_client.request( + f"v1/scheduling/holiday_calendars/{encode_path_param(id)}", + method="GET", + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + SchedulingHolidayCalendar, + parse_obj_as( + type_=SchedulingHolidayCalendar, # type: ignore + object_=_response.json(), + ), + ) + return HttpResponse(response=_response, data=_data) + if _response.status_code == 400: + raise BadRequestError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 401: + raise UnauthorizedError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 403: + raise ForbiddenError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 404: + raise NotFoundError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 429: + raise TooManyRequestsError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 500: + raise InternalServerError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 503: + raise ServiceUnavailableError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) + except ValidationError as e: + raise ParsingError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e + ) + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + + def remove( + self, id: str, *, request_options: typing.Optional[RequestOptions] = None + ) -> HttpResponse[DeletedSchedulingHolidayCalendar]: + """ + Hosts can be booked on its days again, shortly: past entries stay. + + Parameters + ---------- + id : str + The holiday calendar's id. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + HttpResponse[DeletedSchedulingHolidayCalendar] + It's going. + """ + _response = self._client_wrapper.httpx_client.request( + f"v1/scheduling/holiday_calendars/{encode_path_param(id)}", + method="DELETE", + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + DeletedSchedulingHolidayCalendar, + parse_obj_as( + type_=DeletedSchedulingHolidayCalendar, # type: ignore + object_=_response.json(), + ), + ) + return HttpResponse(response=_response, data=_data) + if _response.status_code == 400: + raise BadRequestError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 401: + raise UnauthorizedError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 403: + raise ForbiddenError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 404: + raise NotFoundError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 429: + raise TooManyRequestsError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 500: + raise InternalServerError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 503: + raise ServiceUnavailableError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) + except ValidationError as e: + raise ParsingError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e + ) + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + + def update( + self, + id: str, + *, + name: typing.Optional[str] = OMIT, + hosts: typing.Optional[typing.Sequence[str]] = OMIT, + host_filter: typing.Optional[typing.Dict[str, UpdateSchedulingHolidayCalendarRequestHostFilterValue]] = OMIT, + regions: typing.Optional[typing.Sequence[str]] = OMIT, + delegates: typing.Optional[typing.Sequence[str]] = OMIT, + existing_bookings: typing.Optional[UpdateSchedulingHolidayCalendarRequestExistingBookings] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> HttpResponse[SchedulingHolidayCalendar]: + """ + Who it applies to, who covers and what happens to bookings. Takes effect shortly. + + Parameters + ---------- + id : str + The holiday calendar's id. + + name : typing.Optional[str] + + hosts : typing.Optional[typing.Sequence[str]] + These hosts, by id or uid. + + host_filter : typing.Optional[typing.Dict[str, UpdateSchedulingHolidayCalendarRequestHostFilterValue]] + Everyone matching these attributes, asked again at every sync. + + regions : typing.Optional[typing.Sequence[str]] + Which regional holidays apply, matched against how the calendar names them, such as `England`. Without this, all of them do; empty, only nationwide ones. + + delegates : typing.Optional[typing.Sequence[str]] + Who can be booked in their place on those days, by id or uid, in order. + + existing_bookings : typing.Optional[UpdateSchedulingHolidayCalendarRequestExistingBookings] + What happens to bookings already on a holiday. `leave` (the default) only reports them. `reassign` moves them. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + HttpResponse[SchedulingHolidayCalendar] + The calendar. + """ + _response = self._client_wrapper.httpx_client.request( + f"v1/scheduling/holiday_calendars/{encode_path_param(id)}", + method="PATCH", + json={ + "name": name, + "hosts": hosts, + "host_filter": convert_and_respect_annotation_metadata( + object_=host_filter, + annotation=typing.Dict[str, UpdateSchedulingHolidayCalendarRequestHostFilterValue], + direction="write", + ), + "regions": regions, + "delegates": delegates, + "existing_bookings": existing_bookings, + }, + headers={ + "content-type": "application/json", + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + SchedulingHolidayCalendar, + parse_obj_as( + type_=SchedulingHolidayCalendar, # type: ignore + object_=_response.json(), + ), + ) + return HttpResponse(response=_response, data=_data) + if _response.status_code == 400: + raise BadRequestError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 401: + raise UnauthorizedError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 403: + raise ForbiddenError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 404: + raise NotFoundError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 415: + raise UnsupportedMediaTypeError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 422: + raise UnprocessableEntityError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 429: + raise TooManyRequestsError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 500: + raise InternalServerError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 503: + raise ServiceUnavailableError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) + except ValidationError as e: + raise ParsingError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e + ) + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + + def holidays( + self, id: str, *, request_options: typing.Optional[RequestOptions] = None + ) -> HttpResponse[SchedulingHolidayList]: + """ + What's coming, with names, as last read. Empty until its first read. + + Parameters + ---------- + id : str + The holiday calendar's id. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + HttpResponse[SchedulingHolidayList] + The holidays. + """ + _response = self._client_wrapper.httpx_client.request( + f"v1/scheduling/holiday_calendars/{encode_path_param(id)}/holidays", + method="GET", + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + SchedulingHolidayList, + parse_obj_as( + type_=SchedulingHolidayList, # type: ignore + object_=_response.json(), + ), + ) + return HttpResponse(response=_response, data=_data) + if _response.status_code == 400: + raise BadRequestError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 401: + raise UnauthorizedError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 403: + raise ForbiddenError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 404: + raise NotFoundError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 429: + raise TooManyRequestsError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 500: + raise InternalServerError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 503: + raise ServiceUnavailableError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) + except ValidationError as e: + raise ParsingError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e + ) + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + + +class AsyncRawHolidayCalendarsClient: + def __init__(self, *, client_wrapper: AsyncClientWrapper): + self._client_wrapper = client_wrapper + + async def list( + self, *, request_options: typing.Optional[RequestOptions] = None + ) -> AsyncHttpResponse[SchedulingHolidayCalendarList]: + """ + By name. A feed's URL is never shown again. + + Parameters + ---------- + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AsyncHttpResponse[SchedulingHolidayCalendarList] + The calendars. + """ + _response = await self._client_wrapper.httpx_client.request( + "v1/scheduling/holiday_calendars", + method="GET", + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + SchedulingHolidayCalendarList, + parse_obj_as( + type_=SchedulingHolidayCalendarList, # type: ignore + object_=_response.json(), + ), + ) + return AsyncHttpResponse(response=_response, data=_data) + if _response.status_code == 400: + raise BadRequestError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 401: + raise UnauthorizedError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 403: + raise ForbiddenError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 429: + raise TooManyRequestsError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 500: + raise InternalServerError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 503: + raise ServiceUnavailableError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) + except ValidationError as e: + raise ParsingError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e + ) + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + + async def create( + self, + *, + name: str, + country: typing.Optional[str] = OMIT, + ics_url: typing.Optional[str] = OMIT, + hosts: typing.Optional[typing.Sequence[str]] = OMIT, + host_filter: typing.Optional[typing.Dict[str, CreateSchedulingHolidayCalendarRequestHostFilterValue]] = OMIT, + regions: typing.Optional[typing.Sequence[str]] = OMIT, + delegates: typing.Optional[typing.Sequence[str]] = OMIT, + existing_bookings: typing.Optional[CreateSchedulingHolidayCalendarRequestExistingBookings] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> AsyncHttpResponse[SchedulingHolidayCalendar]: + """ + Applies a country's public holidays, or your own feed, to some hosts as ordinary out of office entries, kept up to date by coss.com. A host who removes one keeps it removed. + + Parameters + ---------- + name : str + + country : typing.Optional[str] + A code from the list of holiday calendars, such as `GB`. + + ics_url : typing.Optional[str] + Your own feed, https or webcal, read in live environments. Stored encrypted. + + hosts : typing.Optional[typing.Sequence[str]] + These hosts, by id or uid. + + host_filter : typing.Optional[typing.Dict[str, CreateSchedulingHolidayCalendarRequestHostFilterValue]] + Everyone matching these attributes, asked again at every sync. + + regions : typing.Optional[typing.Sequence[str]] + Which regional holidays apply, matched against how the calendar names them, such as `England`. Without this, all of them do; empty, only nationwide ones. + + delegates : typing.Optional[typing.Sequence[str]] + Who can be booked in their place on those days, by id or uid, in order. + + existing_bookings : typing.Optional[CreateSchedulingHolidayCalendarRequestExistingBookings] + What happens to bookings already on a holiday. `leave` (the default) only reports them. `reassign` moves them. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AsyncHttpResponse[SchedulingHolidayCalendar] + The calendar. + """ + _request_options_with_retries_disabled: typing.Optional[RequestOptions] = ( + {**request_options, "max_retries": 0} if request_options is not None else {"max_retries": 0} + ) + _response = await self._client_wrapper.httpx_client.request( + "v1/scheduling/holiday_calendars", + method="POST", + json={ + "name": name, + "country": country, + "ics_url": ics_url, + "hosts": hosts, + "host_filter": convert_and_respect_annotation_metadata( + object_=host_filter, + annotation=typing.Dict[str, CreateSchedulingHolidayCalendarRequestHostFilterValue], + direction="write", + ), + "regions": regions, + "delegates": delegates, + "existing_bookings": existing_bookings, + }, + headers={ + "content-type": "application/json", + "Idempotency-Key": generate_idempotency_key(), + }, + request_options=_request_options_with_retries_disabled, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + SchedulingHolidayCalendar, + parse_obj_as( + type_=SchedulingHolidayCalendar, # type: ignore + object_=_response.json(), + ), + ) + return AsyncHttpResponse(response=_response, data=_data) + if _response.status_code == 400: + raise BadRequestError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 401: + raise UnauthorizedError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 403: + raise ForbiddenError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 404: + raise NotFoundError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 415: + raise UnsupportedMediaTypeError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 422: + raise UnprocessableEntityError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 429: + raise TooManyRequestsError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 500: + raise InternalServerError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 503: + raise ServiceUnavailableError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) + except ValidationError as e: + raise ParsingError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e + ) + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + + async def get( + self, id: str, *, request_options: typing.Optional[RequestOptions] = None + ) -> AsyncHttpResponse[SchedulingHolidayCalendar]: + """ + With when it was last read, and why not if it couldn't be. + + Parameters + ---------- + id : str + The holiday calendar's id. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AsyncHttpResponse[SchedulingHolidayCalendar] + The calendar. + """ + _response = await self._client_wrapper.httpx_client.request( + f"v1/scheduling/holiday_calendars/{encode_path_param(id)}", + method="GET", + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + SchedulingHolidayCalendar, + parse_obj_as( + type_=SchedulingHolidayCalendar, # type: ignore + object_=_response.json(), + ), + ) + return AsyncHttpResponse(response=_response, data=_data) + if _response.status_code == 400: + raise BadRequestError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 401: + raise UnauthorizedError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 403: + raise ForbiddenError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 404: + raise NotFoundError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 429: + raise TooManyRequestsError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 500: + raise InternalServerError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 503: + raise ServiceUnavailableError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) + except ValidationError as e: + raise ParsingError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e + ) + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + + async def remove( + self, id: str, *, request_options: typing.Optional[RequestOptions] = None + ) -> AsyncHttpResponse[DeletedSchedulingHolidayCalendar]: + """ + Hosts can be booked on its days again, shortly: past entries stay. + + Parameters + ---------- + id : str + The holiday calendar's id. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AsyncHttpResponse[DeletedSchedulingHolidayCalendar] + It's going. + """ + _response = await self._client_wrapper.httpx_client.request( + f"v1/scheduling/holiday_calendars/{encode_path_param(id)}", + method="DELETE", + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + DeletedSchedulingHolidayCalendar, + parse_obj_as( + type_=DeletedSchedulingHolidayCalendar, # type: ignore + object_=_response.json(), + ), + ) + return AsyncHttpResponse(response=_response, data=_data) + if _response.status_code == 400: + raise BadRequestError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 401: + raise UnauthorizedError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 403: + raise ForbiddenError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 404: + raise NotFoundError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 429: + raise TooManyRequestsError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 500: + raise InternalServerError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 503: + raise ServiceUnavailableError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) + except ValidationError as e: + raise ParsingError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e + ) + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + + async def update( + self, + id: str, + *, + name: typing.Optional[str] = OMIT, + hosts: typing.Optional[typing.Sequence[str]] = OMIT, + host_filter: typing.Optional[typing.Dict[str, UpdateSchedulingHolidayCalendarRequestHostFilterValue]] = OMIT, + regions: typing.Optional[typing.Sequence[str]] = OMIT, + delegates: typing.Optional[typing.Sequence[str]] = OMIT, + existing_bookings: typing.Optional[UpdateSchedulingHolidayCalendarRequestExistingBookings] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> AsyncHttpResponse[SchedulingHolidayCalendar]: + """ + Who it applies to, who covers and what happens to bookings. Takes effect shortly. + + Parameters + ---------- + id : str + The holiday calendar's id. + + name : typing.Optional[str] + + hosts : typing.Optional[typing.Sequence[str]] + These hosts, by id or uid. + + host_filter : typing.Optional[typing.Dict[str, UpdateSchedulingHolidayCalendarRequestHostFilterValue]] + Everyone matching these attributes, asked again at every sync. + + regions : typing.Optional[typing.Sequence[str]] + Which regional holidays apply, matched against how the calendar names them, such as `England`. Without this, all of them do; empty, only nationwide ones. + + delegates : typing.Optional[typing.Sequence[str]] + Who can be booked in their place on those days, by id or uid, in order. + + existing_bookings : typing.Optional[UpdateSchedulingHolidayCalendarRequestExistingBookings] + What happens to bookings already on a holiday. `leave` (the default) only reports them. `reassign` moves them. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AsyncHttpResponse[SchedulingHolidayCalendar] + The calendar. + """ + _response = await self._client_wrapper.httpx_client.request( + f"v1/scheduling/holiday_calendars/{encode_path_param(id)}", + method="PATCH", + json={ + "name": name, + "hosts": hosts, + "host_filter": convert_and_respect_annotation_metadata( + object_=host_filter, + annotation=typing.Dict[str, UpdateSchedulingHolidayCalendarRequestHostFilterValue], + direction="write", + ), + "regions": regions, + "delegates": delegates, + "existing_bookings": existing_bookings, + }, + headers={ + "content-type": "application/json", + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + SchedulingHolidayCalendar, + parse_obj_as( + type_=SchedulingHolidayCalendar, # type: ignore + object_=_response.json(), + ), + ) + return AsyncHttpResponse(response=_response, data=_data) + if _response.status_code == 400: + raise BadRequestError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 401: + raise UnauthorizedError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 403: + raise ForbiddenError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 404: + raise NotFoundError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 415: + raise UnsupportedMediaTypeError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 422: + raise UnprocessableEntityError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 429: + raise TooManyRequestsError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 500: + raise InternalServerError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 503: + raise ServiceUnavailableError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) + except ValidationError as e: + raise ParsingError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e + ) + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + + async def holidays( + self, id: str, *, request_options: typing.Optional[RequestOptions] = None + ) -> AsyncHttpResponse[SchedulingHolidayList]: + """ + What's coming, with names, as last read. Empty until its first read. + + Parameters + ---------- + id : str + The holiday calendar's id. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AsyncHttpResponse[SchedulingHolidayList] + The holidays. + """ + _response = await self._client_wrapper.httpx_client.request( + f"v1/scheduling/holiday_calendars/{encode_path_param(id)}/holidays", + method="GET", + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + SchedulingHolidayList, + parse_obj_as( + type_=SchedulingHolidayList, # type: ignore + object_=_response.json(), + ), + ) + return AsyncHttpResponse(response=_response, data=_data) + if _response.status_code == 400: + raise BadRequestError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 401: + raise UnauthorizedError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 403: + raise ForbiddenError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 404: + raise NotFoundError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 429: + raise TooManyRequestsError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 500: + raise InternalServerError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 503: + raise ServiceUnavailableError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) + except ValidationError as e: + raise ParsingError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e + ) + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) diff --git a/sdks/python/src/coss/resources/scheduling/resources/holiday_calendars/types/__init__.py b/sdks/python/src/coss/resources/scheduling/resources/holiday_calendars/types/__init__.py new file mode 100644 index 000000000..0a4c82925 --- /dev/null +++ b/sdks/python/src/coss/resources/scheduling/resources/holiday_calendars/types/__init__.py @@ -0,0 +1,55 @@ +# This file was auto-generated by Fern from our API Definition. + +# isort: skip_file + +import typing +from importlib import import_module + +if typing.TYPE_CHECKING: + from .create_scheduling_holiday_calendar_request_existing_bookings import ( + CreateSchedulingHolidayCalendarRequestExistingBookings, + ) + from .create_scheduling_holiday_calendar_request_host_filter_value import ( + CreateSchedulingHolidayCalendarRequestHostFilterValue, + ) + from .update_scheduling_holiday_calendar_request_existing_bookings import ( + UpdateSchedulingHolidayCalendarRequestExistingBookings, + ) + from .update_scheduling_holiday_calendar_request_host_filter_value import ( + UpdateSchedulingHolidayCalendarRequestHostFilterValue, + ) +_dynamic_imports: typing.Dict[str, str] = { + "CreateSchedulingHolidayCalendarRequestExistingBookings": ".create_scheduling_holiday_calendar_request_existing_bookings", + "CreateSchedulingHolidayCalendarRequestHostFilterValue": ".create_scheduling_holiday_calendar_request_host_filter_value", + "UpdateSchedulingHolidayCalendarRequestExistingBookings": ".update_scheduling_holiday_calendar_request_existing_bookings", + "UpdateSchedulingHolidayCalendarRequestHostFilterValue": ".update_scheduling_holiday_calendar_request_host_filter_value", +} + + +def __getattr__(attr_name: str) -> typing.Any: + module_name = _dynamic_imports.get(attr_name) + if module_name is None: + raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") + try: + module = import_module(module_name, __package__) + if module_name == f".{attr_name}": + return module + else: + return getattr(module, attr_name) + except ImportError as e: + raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e + except AttributeError as e: + raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e + + +def __dir__(): + lazy_attrs = list(_dynamic_imports.keys()) + return sorted(lazy_attrs) + + +__all__ = [ + "CreateSchedulingHolidayCalendarRequestExistingBookings", + "CreateSchedulingHolidayCalendarRequestHostFilterValue", + "UpdateSchedulingHolidayCalendarRequestExistingBookings", + "UpdateSchedulingHolidayCalendarRequestHostFilterValue", +] diff --git a/sdks/python/src/coss/resources/scheduling/resources/holiday_calendars/types/create_scheduling_holiday_calendar_request_existing_bookings.py b/sdks/python/src/coss/resources/scheduling/resources/holiday_calendars/types/create_scheduling_holiday_calendar_request_existing_bookings.py new file mode 100644 index 000000000..6a10b16f8 --- /dev/null +++ b/sdks/python/src/coss/resources/scheduling/resources/holiday_calendars/types/create_scheduling_holiday_calendar_request_existing_bookings.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +CreateSchedulingHolidayCalendarRequestExistingBookings = typing.Union[typing.Literal["leave", "reassign"], typing.Any] diff --git a/sdks/python/src/coss/resources/scheduling/resources/holiday_calendars/types/create_scheduling_holiday_calendar_request_host_filter_value.py b/sdks/python/src/coss/resources/scheduling/resources/holiday_calendars/types/create_scheduling_holiday_calendar_request_host_filter_value.py new file mode 100644 index 000000000..23e21b728 --- /dev/null +++ b/sdks/python/src/coss/resources/scheduling/resources/holiday_calendars/types/create_scheduling_holiday_calendar_request_host_filter_value.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +CreateSchedulingHolidayCalendarRequestHostFilterValue = typing.Union[str, typing.List[str]] diff --git a/sdks/python/src/coss/resources/scheduling/resources/holiday_calendars/types/update_scheduling_holiday_calendar_request_existing_bookings.py b/sdks/python/src/coss/resources/scheduling/resources/holiday_calendars/types/update_scheduling_holiday_calendar_request_existing_bookings.py new file mode 100644 index 000000000..c51c61e1d --- /dev/null +++ b/sdks/python/src/coss/resources/scheduling/resources/holiday_calendars/types/update_scheduling_holiday_calendar_request_existing_bookings.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +UpdateSchedulingHolidayCalendarRequestExistingBookings = typing.Union[typing.Literal["leave", "reassign"], typing.Any] diff --git a/sdks/python/src/coss/resources/scheduling/resources/holiday_calendars/types/update_scheduling_holiday_calendar_request_host_filter_value.py b/sdks/python/src/coss/resources/scheduling/resources/holiday_calendars/types/update_scheduling_holiday_calendar_request_host_filter_value.py new file mode 100644 index 000000000..e3d392b42 --- /dev/null +++ b/sdks/python/src/coss/resources/scheduling/resources/holiday_calendars/types/update_scheduling_holiday_calendar_request_host_filter_value.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +UpdateSchedulingHolidayCalendarRequestHostFilterValue = typing.Union[str, typing.List[str]] diff --git a/sdks/python/src/coss/resources/scheduling/resources/oauth_apps/__init__.py b/sdks/python/src/coss/resources/scheduling/resources/oauth_apps/__init__.py new file mode 100644 index 000000000..5cde0202d --- /dev/null +++ b/sdks/python/src/coss/resources/scheduling/resources/oauth_apps/__init__.py @@ -0,0 +1,4 @@ +# This file was auto-generated by Fern from our API Definition. + +# isort: skip_file + diff --git a/sdks/python/src/coss/resources/scheduling/resources/oauth_apps/client.py b/sdks/python/src/coss/resources/scheduling/resources/oauth_apps/client.py new file mode 100644 index 000000000..81ebc2b30 --- /dev/null +++ b/sdks/python/src/coss/resources/scheduling/resources/oauth_apps/client.py @@ -0,0 +1,485 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +from .....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper +from .....core.request_options import RequestOptions +from .....types.create_oauth_app_request import CreateOauthAppRequest +from .....types.deleted_scheduling_oauth_app import DeletedSchedulingOauthApp +from .....types.scheduling_oauth_app import SchedulingOauthApp +from .....types.scheduling_oauth_app_list import SchedulingOauthAppList +from .raw_client import AsyncRawOauthAppsClient, RawOauthAppsClient + +# this is used as the default value for optional parameters +OMIT = typing.cast(typing.Any, ...) + + +class OauthAppsClient: + def __init__(self, *, client_wrapper: SyncClientWrapper): + self._raw_client = RawOauthAppsClient(client_wrapper=client_wrapper) + + @property + def with_raw_response(self) -> RawOauthAppsClient: + """ + Retrieves a raw implementation of this client that returns raw responses. + + Returns + ------- + RawOauthAppsClient + """ + return self._raw_client + + def list(self, *, request_options: typing.Optional[RequestOptions] = None) -> SchedulingOauthAppList: + """ + At most one per provider, with how many connections use each. + + Parameters + ---------- + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + SchedulingOauthAppList + The apps. + + Examples + -------- + from coss import Coss + + client = Coss( + "2026-10-10", + api_key="YOUR_API_KEY", + ) + client.scheduling.oauth_apps.list() + """ + _response = self._raw_client.list(request_options=request_options) + return _response.data + + def create( + self, *, request: CreateOauthAppRequest, request_options: typing.Optional[RequestOptions] = None + ) -> SchedulingOauthApp: + """ + New consents in this environment use it, so the consent screen shows your brand. Connections made before it stay on coss.com's app until their host consents again. On the Scale plan and above. Secrets are never returned. + + Parameters + ---------- + request : CreateOauthAppRequest + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + SchedulingOauthApp + The app. + + Examples + -------- + from coss import Coss, CreateOauthAppRequest_Google + + client = Coss( + "2026-10-10", + api_key="YOUR_API_KEY", + ) + client.scheduling.oauth_apps.create( + request=CreateOauthAppRequest_Google( + client_id="client_id", + client_secret="client_secret", + ), + ) + """ + _response = self._raw_client.create(request=request, request_options=request_options) + return _response.data + + def get(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> SchedulingOauthApp: + """ + Its status, what to register at the provider, and how many connections use it. + + Parameters + ---------- + id : str + The OAuth app's id. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + SchedulingOauthApp + The app. + + Examples + -------- + from coss import Coss + + client = Coss( + "2026-10-10", + api_key="YOUR_API_KEY", + ) + client.scheduling.oauth_apps.get( + id="calapp_01kd2m9a0b1c2d3e4f5g6h7j8m", + ) + """ + _response = self._raw_client.get(id, request_options=request_options) + return _response.data + + def delete(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> DeletedSchedulingOauthApp: + """ + Refused while connections use it (`oauth_app_in_use`), since only it can refresh their access: disconnect them first. New consents go back to coss.com's app. + + Parameters + ---------- + id : str + The OAuth app's id. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + DeletedSchedulingOauthApp + Deleted. + + Examples + -------- + from coss import Coss + + client = Coss( + "2026-10-10", + api_key="YOUR_API_KEY", + ) + client.scheduling.oauth_apps.delete( + id="calapp_01kd2m9a0b1c2d3e4f5g6h7j8m", + ) + """ + _response = self._raw_client.delete(id, request_options=request_options) + return _response.data + + def update( + self, + id: str, + *, + client_secret: typing.Optional[str] = OMIT, + tenant_id: typing.Optional[str] = OMIT, + webhook_secret: typing.Optional[str] = OMIT, + redirect_uri: typing.Optional[str] = OMIT, + completion_url: typing.Optional[str] = OMIT, + secret_expires_at: typing.Optional[dt.datetime] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> SchedulingOauthApp: + """ + A new client secret is tried on a connection before it replaces the old one, and ends an outage if it works. Its client ID can't change: a different app needs its hosts to consent again. + + Parameters + ---------- + id : str + The OAuth app's id. + + client_secret : typing.Optional[str] + A new client secret. It's tried on a connection before it replaces the old one. + + tenant_id : typing.Optional[str] + The Directory (tenant) ID, for an app that's only for your own tenant. Leave it out for a multi-tenant app. + + webhook_secret : typing.Optional[str] + The Secret Token of your Zoom app, which signs its events at `zoom_event_url`. Never returned. + + redirect_uri : typing.Optional[str] + A page on your own domain, registered with the provider, that forwards `code` and `state` to `coss_callback_url`. Google requires this for an external app, since it has to verify the redirect's domain as yours. Leave it out to use `coss_callback_url` directly. + + completion_url : typing.Optional[str] + Where the browser lands after a consent that didn't name a `return_url`, with `coss_calendar` set to `connected`, `denied` or `invalid`. Leave it out for a plain page saying what happened. + + secret_expires_at : typing.Optional[dt.datetime] + When the client secret expires. Owners and admins are warned 14 days before. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + SchedulingOauthApp + The app. + + Examples + -------- + from coss import Coss + + client = Coss( + "2026-10-10", + api_key="YOUR_API_KEY", + ) + client.scheduling.oauth_apps.update( + id="calapp_01kd2m9a0b1c2d3e4f5g6h7j8m", + client_secret="GOCSPX-abcdefghijklmnopqrstuvwxyz", + ) + """ + _response = self._raw_client.update( + id, + client_secret=client_secret, + tenant_id=tenant_id, + webhook_secret=webhook_secret, + redirect_uri=redirect_uri, + completion_url=completion_url, + secret_expires_at=secret_expires_at, + request_options=request_options, + ) + return _response.data + + +class AsyncOauthAppsClient: + def __init__(self, *, client_wrapper: AsyncClientWrapper): + self._raw_client = AsyncRawOauthAppsClient(client_wrapper=client_wrapper) + + @property + def with_raw_response(self) -> AsyncRawOauthAppsClient: + """ + Retrieves a raw implementation of this client that returns raw responses. + + Returns + ------- + AsyncRawOauthAppsClient + """ + return self._raw_client + + async def list(self, *, request_options: typing.Optional[RequestOptions] = None) -> SchedulingOauthAppList: + """ + At most one per provider, with how many connections use each. + + Parameters + ---------- + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + SchedulingOauthAppList + The apps. + + Examples + -------- + import asyncio + + from coss import AsyncCoss + + client = AsyncCoss( + "2026-10-10", + api_key="YOUR_API_KEY", + ) + + + async def main() -> None: + await client.scheduling.oauth_apps.list() + + + asyncio.run(main()) + """ + _response = await self._raw_client.list(request_options=request_options) + return _response.data + + async def create( + self, *, request: CreateOauthAppRequest, request_options: typing.Optional[RequestOptions] = None + ) -> SchedulingOauthApp: + """ + New consents in this environment use it, so the consent screen shows your brand. Connections made before it stay on coss.com's app until their host consents again. On the Scale plan and above. Secrets are never returned. + + Parameters + ---------- + request : CreateOauthAppRequest + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + SchedulingOauthApp + The app. + + Examples + -------- + import asyncio + + from coss import AsyncCoss, CreateOauthAppRequest_Google + + client = AsyncCoss( + "2026-10-10", + api_key="YOUR_API_KEY", + ) + + + async def main() -> None: + await client.scheduling.oauth_apps.create( + request=CreateOauthAppRequest_Google( + client_id="client_id", + client_secret="client_secret", + ), + ) + + + asyncio.run(main()) + """ + _response = await self._raw_client.create(request=request, request_options=request_options) + return _response.data + + async def get(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> SchedulingOauthApp: + """ + Its status, what to register at the provider, and how many connections use it. + + Parameters + ---------- + id : str + The OAuth app's id. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + SchedulingOauthApp + The app. + + Examples + -------- + import asyncio + + from coss import AsyncCoss + + client = AsyncCoss( + "2026-10-10", + api_key="YOUR_API_KEY", + ) + + + async def main() -> None: + await client.scheduling.oauth_apps.get( + id="calapp_01kd2m9a0b1c2d3e4f5g6h7j8m", + ) + + + asyncio.run(main()) + """ + _response = await self._raw_client.get(id, request_options=request_options) + return _response.data + + async def delete( + self, id: str, *, request_options: typing.Optional[RequestOptions] = None + ) -> DeletedSchedulingOauthApp: + """ + Refused while connections use it (`oauth_app_in_use`), since only it can refresh their access: disconnect them first. New consents go back to coss.com's app. + + Parameters + ---------- + id : str + The OAuth app's id. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + DeletedSchedulingOauthApp + Deleted. + + Examples + -------- + import asyncio + + from coss import AsyncCoss + + client = AsyncCoss( + "2026-10-10", + api_key="YOUR_API_KEY", + ) + + + async def main() -> None: + await client.scheduling.oauth_apps.delete( + id="calapp_01kd2m9a0b1c2d3e4f5g6h7j8m", + ) + + + asyncio.run(main()) + """ + _response = await self._raw_client.delete(id, request_options=request_options) + return _response.data + + async def update( + self, + id: str, + *, + client_secret: typing.Optional[str] = OMIT, + tenant_id: typing.Optional[str] = OMIT, + webhook_secret: typing.Optional[str] = OMIT, + redirect_uri: typing.Optional[str] = OMIT, + completion_url: typing.Optional[str] = OMIT, + secret_expires_at: typing.Optional[dt.datetime] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> SchedulingOauthApp: + """ + A new client secret is tried on a connection before it replaces the old one, and ends an outage if it works. Its client ID can't change: a different app needs its hosts to consent again. + + Parameters + ---------- + id : str + The OAuth app's id. + + client_secret : typing.Optional[str] + A new client secret. It's tried on a connection before it replaces the old one. + + tenant_id : typing.Optional[str] + The Directory (tenant) ID, for an app that's only for your own tenant. Leave it out for a multi-tenant app. + + webhook_secret : typing.Optional[str] + The Secret Token of your Zoom app, which signs its events at `zoom_event_url`. Never returned. + + redirect_uri : typing.Optional[str] + A page on your own domain, registered with the provider, that forwards `code` and `state` to `coss_callback_url`. Google requires this for an external app, since it has to verify the redirect's domain as yours. Leave it out to use `coss_callback_url` directly. + + completion_url : typing.Optional[str] + Where the browser lands after a consent that didn't name a `return_url`, with `coss_calendar` set to `connected`, `denied` or `invalid`. Leave it out for a plain page saying what happened. + + secret_expires_at : typing.Optional[dt.datetime] + When the client secret expires. Owners and admins are warned 14 days before. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + SchedulingOauthApp + The app. + + Examples + -------- + import asyncio + + from coss import AsyncCoss + + client = AsyncCoss( + "2026-10-10", + api_key="YOUR_API_KEY", + ) + + + async def main() -> None: + await client.scheduling.oauth_apps.update( + id="calapp_01kd2m9a0b1c2d3e4f5g6h7j8m", + client_secret="GOCSPX-abcdefghijklmnopqrstuvwxyz", + ) + + + asyncio.run(main()) + """ + _response = await self._raw_client.update( + id, + client_secret=client_secret, + tenant_id=tenant_id, + webhook_secret=webhook_secret, + redirect_uri=redirect_uri, + completion_url=completion_url, + secret_expires_at=secret_expires_at, + request_options=request_options, + ) + return _response.data diff --git a/sdks/python/src/coss/resources/scheduling/resources/oauth_apps/raw_client.py b/sdks/python/src/coss/resources/scheduling/resources/oauth_apps/raw_client.py new file mode 100644 index 000000000..02cb5988c --- /dev/null +++ b/sdks/python/src/coss/resources/scheduling/resources/oauth_apps/raw_client.py @@ -0,0 +1,1420 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing +from json.decoder import JSONDecodeError + +from .....core.api_error import ApiError +from .....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper +from .....core.http_response import AsyncHttpResponse, HttpResponse +from .....core.idempotency import generate_idempotency_key +from .....core.jsonable_encoder import encode_path_param +from .....core.parse_error import ParsingError +from .....core.pydantic_utilities import parse_obj_as +from .....core.request_options import RequestOptions +from .....core.serialization import convert_and_respect_annotation_metadata +from .....errors.bad_request_error import BadRequestError +from .....errors.forbidden_error import ForbiddenError +from .....errors.internal_server_error import InternalServerError +from .....errors.not_found_error import NotFoundError +from .....errors.payment_required_error import PaymentRequiredError +from .....errors.service_unavailable_error import ServiceUnavailableError +from .....errors.too_many_requests_error import TooManyRequestsError +from .....errors.unauthorized_error import UnauthorizedError +from .....errors.unprocessable_entity_error import UnprocessableEntityError +from .....errors.unsupported_media_type_error import UnsupportedMediaTypeError +from .....types.create_oauth_app_request import CreateOauthAppRequest +from .....types.deleted_scheduling_oauth_app import DeletedSchedulingOauthApp +from .....types.error import Error +from .....types.scheduling_oauth_app import SchedulingOauthApp +from .....types.scheduling_oauth_app_list import SchedulingOauthAppList +from pydantic import ValidationError + +# this is used as the default value for optional parameters +OMIT = typing.cast(typing.Any, ...) + + +class RawOauthAppsClient: + def __init__(self, *, client_wrapper: SyncClientWrapper): + self._client_wrapper = client_wrapper + + def list(self, *, request_options: typing.Optional[RequestOptions] = None) -> HttpResponse[SchedulingOauthAppList]: + """ + At most one per provider, with how many connections use each. + + Parameters + ---------- + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + HttpResponse[SchedulingOauthAppList] + The apps. + """ + _response = self._client_wrapper.httpx_client.request( + "v1/scheduling/oauth_apps", + method="GET", + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + SchedulingOauthAppList, + parse_obj_as( + type_=SchedulingOauthAppList, # type: ignore + object_=_response.json(), + ), + ) + return HttpResponse(response=_response, data=_data) + if _response.status_code == 400: + raise BadRequestError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 401: + raise UnauthorizedError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 403: + raise ForbiddenError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 429: + raise TooManyRequestsError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 500: + raise InternalServerError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 503: + raise ServiceUnavailableError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) + except ValidationError as e: + raise ParsingError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e + ) + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + + def create( + self, *, request: CreateOauthAppRequest, request_options: typing.Optional[RequestOptions] = None + ) -> HttpResponse[SchedulingOauthApp]: + """ + New consents in this environment use it, so the consent screen shows your brand. Connections made before it stay on coss.com's app until their host consents again. On the Scale plan and above. Secrets are never returned. + + Parameters + ---------- + request : CreateOauthAppRequest + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + HttpResponse[SchedulingOauthApp] + The app. + """ + _request_options_with_retries_disabled: typing.Optional[RequestOptions] = ( + {**request_options, "max_retries": 0} if request_options is not None else {"max_retries": 0} + ) + _response = self._client_wrapper.httpx_client.request( + "v1/scheduling/oauth_apps", + method="POST", + json=convert_and_respect_annotation_metadata( + object_=request, annotation=CreateOauthAppRequest, direction="write" + ), + headers={ + "Idempotency-Key": generate_idempotency_key(), + }, + request_options=_request_options_with_retries_disabled, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + SchedulingOauthApp, + parse_obj_as( + type_=SchedulingOauthApp, # type: ignore + object_=_response.json(), + ), + ) + return HttpResponse(response=_response, data=_data) + if _response.status_code == 400: + raise BadRequestError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 401: + raise UnauthorizedError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 402: + raise PaymentRequiredError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 403: + raise ForbiddenError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 415: + raise UnsupportedMediaTypeError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 422: + raise UnprocessableEntityError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 429: + raise TooManyRequestsError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 500: + raise InternalServerError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 503: + raise ServiceUnavailableError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) + except ValidationError as e: + raise ParsingError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e + ) + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + + def get( + self, id: str, *, request_options: typing.Optional[RequestOptions] = None + ) -> HttpResponse[SchedulingOauthApp]: + """ + Its status, what to register at the provider, and how many connections use it. + + Parameters + ---------- + id : str + The OAuth app's id. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + HttpResponse[SchedulingOauthApp] + The app. + """ + _response = self._client_wrapper.httpx_client.request( + f"v1/scheduling/oauth_apps/{encode_path_param(id)}", + method="GET", + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + SchedulingOauthApp, + parse_obj_as( + type_=SchedulingOauthApp, # type: ignore + object_=_response.json(), + ), + ) + return HttpResponse(response=_response, data=_data) + if _response.status_code == 400: + raise BadRequestError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 401: + raise UnauthorizedError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 403: + raise ForbiddenError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 404: + raise NotFoundError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 429: + raise TooManyRequestsError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 500: + raise InternalServerError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 503: + raise ServiceUnavailableError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) + except ValidationError as e: + raise ParsingError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e + ) + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + + def delete( + self, id: str, *, request_options: typing.Optional[RequestOptions] = None + ) -> HttpResponse[DeletedSchedulingOauthApp]: + """ + Refused while connections use it (`oauth_app_in_use`), since only it can refresh their access: disconnect them first. New consents go back to coss.com's app. + + Parameters + ---------- + id : str + The OAuth app's id. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + HttpResponse[DeletedSchedulingOauthApp] + Deleted. + """ + _response = self._client_wrapper.httpx_client.request( + f"v1/scheduling/oauth_apps/{encode_path_param(id)}", + method="DELETE", + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + DeletedSchedulingOauthApp, + parse_obj_as( + type_=DeletedSchedulingOauthApp, # type: ignore + object_=_response.json(), + ), + ) + return HttpResponse(response=_response, data=_data) + if _response.status_code == 400: + raise BadRequestError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 401: + raise UnauthorizedError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 403: + raise ForbiddenError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 404: + raise NotFoundError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 422: + raise UnprocessableEntityError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 429: + raise TooManyRequestsError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 500: + raise InternalServerError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 503: + raise ServiceUnavailableError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) + except ValidationError as e: + raise ParsingError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e + ) + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + + def update( + self, + id: str, + *, + client_secret: typing.Optional[str] = OMIT, + tenant_id: typing.Optional[str] = OMIT, + webhook_secret: typing.Optional[str] = OMIT, + redirect_uri: typing.Optional[str] = OMIT, + completion_url: typing.Optional[str] = OMIT, + secret_expires_at: typing.Optional[dt.datetime] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> HttpResponse[SchedulingOauthApp]: + """ + A new client secret is tried on a connection before it replaces the old one, and ends an outage if it works. Its client ID can't change: a different app needs its hosts to consent again. + + Parameters + ---------- + id : str + The OAuth app's id. + + client_secret : typing.Optional[str] + A new client secret. It's tried on a connection before it replaces the old one. + + tenant_id : typing.Optional[str] + The Directory (tenant) ID, for an app that's only for your own tenant. Leave it out for a multi-tenant app. + + webhook_secret : typing.Optional[str] + The Secret Token of your Zoom app, which signs its events at `zoom_event_url`. Never returned. + + redirect_uri : typing.Optional[str] + A page on your own domain, registered with the provider, that forwards `code` and `state` to `coss_callback_url`. Google requires this for an external app, since it has to verify the redirect's domain as yours. Leave it out to use `coss_callback_url` directly. + + completion_url : typing.Optional[str] + Where the browser lands after a consent that didn't name a `return_url`, with `coss_calendar` set to `connected`, `denied` or `invalid`. Leave it out for a plain page saying what happened. + + secret_expires_at : typing.Optional[dt.datetime] + When the client secret expires. Owners and admins are warned 14 days before. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + HttpResponse[SchedulingOauthApp] + The app. + """ + _response = self._client_wrapper.httpx_client.request( + f"v1/scheduling/oauth_apps/{encode_path_param(id)}", + method="PATCH", + json={ + "client_secret": client_secret, + "tenant_id": tenant_id, + "webhook_secret": webhook_secret, + "redirect_uri": redirect_uri, + "completion_url": completion_url, + "secret_expires_at": secret_expires_at, + }, + headers={ + "content-type": "application/json", + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + SchedulingOauthApp, + parse_obj_as( + type_=SchedulingOauthApp, # type: ignore + object_=_response.json(), + ), + ) + return HttpResponse(response=_response, data=_data) + if _response.status_code == 400: + raise BadRequestError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 401: + raise UnauthorizedError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 403: + raise ForbiddenError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 404: + raise NotFoundError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 415: + raise UnsupportedMediaTypeError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 422: + raise UnprocessableEntityError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 429: + raise TooManyRequestsError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 500: + raise InternalServerError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 503: + raise ServiceUnavailableError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) + except ValidationError as e: + raise ParsingError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e + ) + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + + +class AsyncRawOauthAppsClient: + def __init__(self, *, client_wrapper: AsyncClientWrapper): + self._client_wrapper = client_wrapper + + async def list( + self, *, request_options: typing.Optional[RequestOptions] = None + ) -> AsyncHttpResponse[SchedulingOauthAppList]: + """ + At most one per provider, with how many connections use each. + + Parameters + ---------- + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AsyncHttpResponse[SchedulingOauthAppList] + The apps. + """ + _response = await self._client_wrapper.httpx_client.request( + "v1/scheduling/oauth_apps", + method="GET", + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + SchedulingOauthAppList, + parse_obj_as( + type_=SchedulingOauthAppList, # type: ignore + object_=_response.json(), + ), + ) + return AsyncHttpResponse(response=_response, data=_data) + if _response.status_code == 400: + raise BadRequestError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 401: + raise UnauthorizedError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 403: + raise ForbiddenError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 429: + raise TooManyRequestsError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 500: + raise InternalServerError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 503: + raise ServiceUnavailableError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) + except ValidationError as e: + raise ParsingError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e + ) + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + + async def create( + self, *, request: CreateOauthAppRequest, request_options: typing.Optional[RequestOptions] = None + ) -> AsyncHttpResponse[SchedulingOauthApp]: + """ + New consents in this environment use it, so the consent screen shows your brand. Connections made before it stay on coss.com's app until their host consents again. On the Scale plan and above. Secrets are never returned. + + Parameters + ---------- + request : CreateOauthAppRequest + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AsyncHttpResponse[SchedulingOauthApp] + The app. + """ + _request_options_with_retries_disabled: typing.Optional[RequestOptions] = ( + {**request_options, "max_retries": 0} if request_options is not None else {"max_retries": 0} + ) + _response = await self._client_wrapper.httpx_client.request( + "v1/scheduling/oauth_apps", + method="POST", + json=convert_and_respect_annotation_metadata( + object_=request, annotation=CreateOauthAppRequest, direction="write" + ), + headers={ + "Idempotency-Key": generate_idempotency_key(), + }, + request_options=_request_options_with_retries_disabled, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + SchedulingOauthApp, + parse_obj_as( + type_=SchedulingOauthApp, # type: ignore + object_=_response.json(), + ), + ) + return AsyncHttpResponse(response=_response, data=_data) + if _response.status_code == 400: + raise BadRequestError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 401: + raise UnauthorizedError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 402: + raise PaymentRequiredError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 403: + raise ForbiddenError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 415: + raise UnsupportedMediaTypeError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 422: + raise UnprocessableEntityError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 429: + raise TooManyRequestsError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 500: + raise InternalServerError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 503: + raise ServiceUnavailableError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) + except ValidationError as e: + raise ParsingError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e + ) + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + + async def get( + self, id: str, *, request_options: typing.Optional[RequestOptions] = None + ) -> AsyncHttpResponse[SchedulingOauthApp]: + """ + Its status, what to register at the provider, and how many connections use it. + + Parameters + ---------- + id : str + The OAuth app's id. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AsyncHttpResponse[SchedulingOauthApp] + The app. + """ + _response = await self._client_wrapper.httpx_client.request( + f"v1/scheduling/oauth_apps/{encode_path_param(id)}", + method="GET", + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + SchedulingOauthApp, + parse_obj_as( + type_=SchedulingOauthApp, # type: ignore + object_=_response.json(), + ), + ) + return AsyncHttpResponse(response=_response, data=_data) + if _response.status_code == 400: + raise BadRequestError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 401: + raise UnauthorizedError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 403: + raise ForbiddenError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 404: + raise NotFoundError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 429: + raise TooManyRequestsError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 500: + raise InternalServerError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 503: + raise ServiceUnavailableError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) + except ValidationError as e: + raise ParsingError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e + ) + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + + async def delete( + self, id: str, *, request_options: typing.Optional[RequestOptions] = None + ) -> AsyncHttpResponse[DeletedSchedulingOauthApp]: + """ + Refused while connections use it (`oauth_app_in_use`), since only it can refresh their access: disconnect them first. New consents go back to coss.com's app. + + Parameters + ---------- + id : str + The OAuth app's id. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AsyncHttpResponse[DeletedSchedulingOauthApp] + Deleted. + """ + _response = await self._client_wrapper.httpx_client.request( + f"v1/scheduling/oauth_apps/{encode_path_param(id)}", + method="DELETE", + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + DeletedSchedulingOauthApp, + parse_obj_as( + type_=DeletedSchedulingOauthApp, # type: ignore + object_=_response.json(), + ), + ) + return AsyncHttpResponse(response=_response, data=_data) + if _response.status_code == 400: + raise BadRequestError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 401: + raise UnauthorizedError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 403: + raise ForbiddenError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 404: + raise NotFoundError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 422: + raise UnprocessableEntityError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 429: + raise TooManyRequestsError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 500: + raise InternalServerError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 503: + raise ServiceUnavailableError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) + except ValidationError as e: + raise ParsingError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e + ) + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + + async def update( + self, + id: str, + *, + client_secret: typing.Optional[str] = OMIT, + tenant_id: typing.Optional[str] = OMIT, + webhook_secret: typing.Optional[str] = OMIT, + redirect_uri: typing.Optional[str] = OMIT, + completion_url: typing.Optional[str] = OMIT, + secret_expires_at: typing.Optional[dt.datetime] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> AsyncHttpResponse[SchedulingOauthApp]: + """ + A new client secret is tried on a connection before it replaces the old one, and ends an outage if it works. Its client ID can't change: a different app needs its hosts to consent again. + + Parameters + ---------- + id : str + The OAuth app's id. + + client_secret : typing.Optional[str] + A new client secret. It's tried on a connection before it replaces the old one. + + tenant_id : typing.Optional[str] + The Directory (tenant) ID, for an app that's only for your own tenant. Leave it out for a multi-tenant app. + + webhook_secret : typing.Optional[str] + The Secret Token of your Zoom app, which signs its events at `zoom_event_url`. Never returned. + + redirect_uri : typing.Optional[str] + A page on your own domain, registered with the provider, that forwards `code` and `state` to `coss_callback_url`. Google requires this for an external app, since it has to verify the redirect's domain as yours. Leave it out to use `coss_callback_url` directly. + + completion_url : typing.Optional[str] + Where the browser lands after a consent that didn't name a `return_url`, with `coss_calendar` set to `connected`, `denied` or `invalid`. Leave it out for a plain page saying what happened. + + secret_expires_at : typing.Optional[dt.datetime] + When the client secret expires. Owners and admins are warned 14 days before. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AsyncHttpResponse[SchedulingOauthApp] + The app. + """ + _response = await self._client_wrapper.httpx_client.request( + f"v1/scheduling/oauth_apps/{encode_path_param(id)}", + method="PATCH", + json={ + "client_secret": client_secret, + "tenant_id": tenant_id, + "webhook_secret": webhook_secret, + "redirect_uri": redirect_uri, + "completion_url": completion_url, + "secret_expires_at": secret_expires_at, + }, + headers={ + "content-type": "application/json", + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + SchedulingOauthApp, + parse_obj_as( + type_=SchedulingOauthApp, # type: ignore + object_=_response.json(), + ), + ) + return AsyncHttpResponse(response=_response, data=_data) + if _response.status_code == 400: + raise BadRequestError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 401: + raise UnauthorizedError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 403: + raise ForbiddenError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 404: + raise NotFoundError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 415: + raise UnsupportedMediaTypeError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 422: + raise UnprocessableEntityError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 429: + raise TooManyRequestsError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 500: + raise InternalServerError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 503: + raise ServiceUnavailableError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) + except ValidationError as e: + raise ParsingError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e + ) + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) diff --git a/sdks/python/src/coss/resources/scheduling/resources/out_of_office/__init__.py b/sdks/python/src/coss/resources/scheduling/resources/out_of_office/__init__.py new file mode 100644 index 000000000..62f36950b --- /dev/null +++ b/sdks/python/src/coss/resources/scheduling/resources/out_of_office/__init__.py @@ -0,0 +1,67 @@ +# This file was auto-generated by Fern from our API Definition. + +# isort: skip_file + +import typing +from importlib import import_module + +if typing.TYPE_CHECKING: + from .types import ( + CreateSchedulingOutOfOfficeRequestExistingBookings, + CreateSchedulingOutOfOfficeRequestHostFilterValue, + CreateSchedulingOutOfOfficeRequestReassign, + CreateSchedulingOutOfOfficeRequestReassignOtherwise, + PutSchedulingOutOfOfficeRequestExistingBookings, + PutSchedulingOutOfOfficeRequestReassign, + PutSchedulingOutOfOfficeRequestReassignOtherwise, + UpdateSchedulingOutOfOfficeRequestExistingBookings, + UpdateSchedulingOutOfOfficeRequestReassign, + UpdateSchedulingOutOfOfficeRequestReassignOtherwise, + ) +_dynamic_imports: typing.Dict[str, str] = { + "CreateSchedulingOutOfOfficeRequestExistingBookings": ".types", + "CreateSchedulingOutOfOfficeRequestHostFilterValue": ".types", + "CreateSchedulingOutOfOfficeRequestReassign": ".types", + "CreateSchedulingOutOfOfficeRequestReassignOtherwise": ".types", + "PutSchedulingOutOfOfficeRequestExistingBookings": ".types", + "PutSchedulingOutOfOfficeRequestReassign": ".types", + "PutSchedulingOutOfOfficeRequestReassignOtherwise": ".types", + "UpdateSchedulingOutOfOfficeRequestExistingBookings": ".types", + "UpdateSchedulingOutOfOfficeRequestReassign": ".types", + "UpdateSchedulingOutOfOfficeRequestReassignOtherwise": ".types", +} + + +def __getattr__(attr_name: str) -> typing.Any: + module_name = _dynamic_imports.get(attr_name) + if module_name is None: + raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") + try: + module = import_module(module_name, __package__) + if module_name == f".{attr_name}": + return module + else: + return getattr(module, attr_name) + except ImportError as e: + raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e + except AttributeError as e: + raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e + + +def __dir__(): + lazy_attrs = list(_dynamic_imports.keys()) + return sorted(lazy_attrs) + + +__all__ = [ + "CreateSchedulingOutOfOfficeRequestExistingBookings", + "CreateSchedulingOutOfOfficeRequestHostFilterValue", + "CreateSchedulingOutOfOfficeRequestReassign", + "CreateSchedulingOutOfOfficeRequestReassignOtherwise", + "PutSchedulingOutOfOfficeRequestExistingBookings", + "PutSchedulingOutOfOfficeRequestReassign", + "PutSchedulingOutOfOfficeRequestReassignOtherwise", + "UpdateSchedulingOutOfOfficeRequestExistingBookings", + "UpdateSchedulingOutOfOfficeRequestReassign", + "UpdateSchedulingOutOfOfficeRequestReassignOtherwise", +] diff --git a/sdks/python/src/coss/resources/scheduling/resources/out_of_office/client.py b/sdks/python/src/coss/resources/scheduling/resources/out_of_office/client.py new file mode 100644 index 000000000..8f463f215 --- /dev/null +++ b/sdks/python/src/coss/resources/scheduling/resources/out_of_office/client.py @@ -0,0 +1,1103 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper +from .....core.request_options import RequestOptions +from .....types.deleted_scheduling_out_of_office import DeletedSchedulingOutOfOffice +from .....types.scheduling_out_of_office import SchedulingOutOfOffice +from .....types.scheduling_out_of_office_conflict_list import SchedulingOutOfOfficeConflictList +from .....types.scheduling_out_of_office_list import SchedulingOutOfOfficeList +from .raw_client import AsyncRawOutOfOfficeClient, RawOutOfOfficeClient +from .types.create_scheduling_out_of_office_request_existing_bookings import ( + CreateSchedulingOutOfOfficeRequestExistingBookings, +) +from .types.create_scheduling_out_of_office_request_host_filter_value import ( + CreateSchedulingOutOfOfficeRequestHostFilterValue, +) +from .types.create_scheduling_out_of_office_request_reassign import CreateSchedulingOutOfOfficeRequestReassign +from .types.put_scheduling_out_of_office_request_existing_bookings import ( + PutSchedulingOutOfOfficeRequestExistingBookings, +) +from .types.put_scheduling_out_of_office_request_reassign import PutSchedulingOutOfOfficeRequestReassign +from .types.update_scheduling_out_of_office_request_existing_bookings import ( + UpdateSchedulingOutOfOfficeRequestExistingBookings, +) +from .types.update_scheduling_out_of_office_request_reassign import UpdateSchedulingOutOfOfficeRequestReassign + +# this is used as the default value for optional parameters +OMIT = typing.cast(typing.Any, ...) + + +class OutOfOfficeClient: + def __init__(self, *, client_wrapper: SyncClientWrapper): + self._raw_client = RawOutOfOfficeClient(client_wrapper=client_wrapper) + + @property + def with_raw_response(self) -> RawOutOfOfficeClient: + """ + Retrieves a raw implementation of this client that returns raw responses. + + Returns + ------- + RawOutOfOfficeClient + """ + return self._raw_client + + def list( + self, + *, + limit: typing.Optional[int] = None, + after: typing.Optional[str] = None, + host: typing.Optional[str] = None, + start_after: typing.Optional[str] = None, + start_before: typing.Optional[str] = None, + group: typing.Optional[str] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> SchedulingOutOfOfficeList: + """ + The environment's entries, newest first. + + Parameters + ---------- + limit : typing.Optional[int] + + after : typing.Optional[str] + The last id of the previous page. + + host : typing.Optional[str] + One host's entries, by id or uid. + + start_after : typing.Optional[str] + Entries ending after this. + + start_before : typing.Optional[str] + Entries starting before this. + + group : typing.Optional[str] + The entries one request made. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + SchedulingOutOfOfficeList + A page of entries. + + Examples + -------- + from coss import Coss + + client = Coss( + "2026-10-10", + api_key="YOUR_API_KEY", + ) + client.scheduling.out_of_office.list( + start_after="2027-01-04T15:00:00.000Z", + start_before="2027-01-04T15:00:00.000Z", + ) + """ + _response = self._raw_client.list( + limit=limit, + after=after, + host=host, + start_after=start_after, + start_before=start_before, + group=group, + request_options=request_options, + ) + return _response.data + + def create( + self, + *, + host: typing.Optional[str] = OMIT, + hosts: typing.Optional[typing.Sequence[str]] = OMIT, + host_filter: typing.Optional[typing.Dict[str, CreateSchedulingOutOfOfficeRequestHostFilterValue]] = OMIT, + start: typing.Optional[str] = OMIT, + end: typing.Optional[str] = OMIT, + start_date: typing.Optional[str] = OMIT, + end_date: typing.Optional[str] = OMIT, + time_zone: typing.Optional[str] = OMIT, + delegates: typing.Optional[typing.Sequence[str]] = OMIT, + reason: typing.Optional[str] = OMIT, + notes: typing.Optional[str] = OMIT, + public_message: typing.Optional[str] = OMIT, + show_on_calendar: typing.Optional[bool] = OMIT, + existing_bookings: typing.Optional[CreateSchedulingOutOfOfficeRequestExistingBookings] = OMIT, + reassign: typing.Optional[CreateSchedulingOutOfOfficeRequestReassign] = OMIT, + external_id: typing.Optional[str] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> SchedulingOutOfOfficeList: + """ + Marks one host, a list of hosts or everyone matching some attributes as away, for part of a day or for whole dates. They aren't offered during it. Existing bookings stay as they are: list them with the entry's conflicts. + + Parameters + ---------- + host : typing.Optional[str] + One host, by id or uid. + + hosts : typing.Optional[typing.Sequence[str]] + Several hosts, by id or uid. Each gets an entry of their own. + + host_filter : typing.Optional[typing.Dict[str, CreateSchedulingOutOfOfficeRequestHostFilterValue]] + Every active host matching these attributes right now. A host added later isn't covered. + + start : typing.Optional[str] + An ISO 8601 instant with an offset. + + end : typing.Optional[str] + An ISO 8601 instant with an offset. + + start_date : typing.Optional[str] + The first whole day away. Use instead of `start` and `end`. + + end_date : typing.Optional[str] + The last whole day away, which is included. + + time_zone : typing.Optional[str] + What the dates mean in. Default: the host's zone when this is made. + + delegates : typing.Optional[typing.Sequence[str]] + Who can be booked in this host's place during it, by id or uid, in the order to try them. They still have to fit how a booking's routed. + + reason : typing.Optional[str] + One of `unspecified`, `vacation`, `travel`, `sick`, `public_holiday`, `parental_leave`, `training` and `other`, or a key from the settings' `out_of_office_reasons`. Only people who manage this host see it: never bookers, webhooks or calendars. + + notes : typing.Optional[str] + For people who manage this host. Encrypted, and never shown to a booker. + + public_message : typing.Optional[str] + Shown to bookers while this host is away. Can't contain a link. + + show_on_calendar : typing.Optional[bool] + Put a private "Out of office" event on the host's calendar. Default: true. + + existing_bookings : typing.Optional[CreateSchedulingOutOfOfficeRequestExistingBookings] + What happens to bookings already in the way. `leave` (the default) only reports them. `reassign` moves them, and any nobody can take stay where they are. + + reassign : typing.Optional[CreateSchedulingOutOfOfficeRequestReassign] + With `existing_bookings: reassign`: who they go to. Default: the fairest who's free. + + external_id : typing.Optional[str] + Your own id for this entry, unique in the environment. Needs one host. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + SchedulingOutOfOfficeList + An entry per host. + + Examples + -------- + from coss import Coss + + client = Coss( + "2026-10-10", + api_key="YOUR_API_KEY", + ) + client.scheduling.out_of_office.create( + host="doctor_482", + start_date="2027-08-02", + end_date="2027-08-13", + reason="vacation", + public_message="Back on the 16th.", + ) + """ + _response = self._raw_client.create( + host=host, + hosts=hosts, + host_filter=host_filter, + start=start, + end=end, + start_date=start_date, + end_date=end_date, + time_zone=time_zone, + delegates=delegates, + reason=reason, + notes=notes, + public_message=public_message, + show_on_calendar=show_on_calendar, + existing_bookings=existing_bookings, + reassign=reassign, + external_id=external_id, + request_options=request_options, + ) + return _response.data + + def get(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> SchedulingOutOfOffice: + """ + One entry. + + Parameters + ---------- + id : str + The entry's id. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + SchedulingOutOfOffice + The entry. + + Examples + -------- + from coss import Coss + + client = Coss( + "2026-10-10", + api_key="YOUR_API_KEY", + ) + client.scheduling.out_of_office.get( + id="ooo_01kd2m9a0b1c2d3e4f5g6h7j8m", + ) + """ + _response = self._raw_client.get(id, request_options=request_options) + return _response.data + + def remove( + self, id: str, *, request_options: typing.Optional[RequestOptions] = None + ) -> DeletedSchedulingOutOfOffice: + """ + The host can be booked in that time again, and any calendar event for it goes. + + Parameters + ---------- + id : str + The entry's id. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + DeletedSchedulingOutOfOffice + Deleted. + + Examples + -------- + from coss import Coss + + client = Coss( + "2026-10-10", + api_key="YOUR_API_KEY", + ) + client.scheduling.out_of_office.remove( + id="ooo_01kd2m9a0b1c2d3e4f5g6h7j8m", + ) + """ + _response = self._raw_client.remove(id, request_options=request_options) + return _response.data + + def update( + self, + id: str, + *, + start: typing.Optional[str] = OMIT, + end: typing.Optional[str] = OMIT, + start_date: typing.Optional[str] = OMIT, + end_date: typing.Optional[str] = OMIT, + time_zone: typing.Optional[str] = OMIT, + reason: typing.Optional[str] = OMIT, + notes: typing.Optional[str] = OMIT, + public_message: typing.Optional[str] = OMIT, + show_on_calendar: typing.Optional[bool] = OMIT, + delegates: typing.Optional[typing.Sequence[str]] = OMIT, + existing_bookings: typing.Optional[UpdateSchedulingOutOfOfficeRequestExistingBookings] = OMIT, + reassign: typing.Optional[UpdateSchedulingOutOfOfficeRequestReassign] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> SchedulingOutOfOffice: + """ + Changes what's given. An entry stays with its host. + + Parameters + ---------- + id : str + The entry's id. + + start : typing.Optional[str] + An ISO 8601 instant with an offset. + + end : typing.Optional[str] + An ISO 8601 instant with an offset. + + start_date : typing.Optional[str] + The first whole day away. Use instead of `start` and `end`. + + end_date : typing.Optional[str] + The last whole day away, which is included. + + time_zone : typing.Optional[str] + What the dates mean in. Default: the host's zone when this is made. + + reason : typing.Optional[str] + One of `unspecified`, `vacation`, `travel`, `sick`, `public_holiday`, `parental_leave`, `training` and `other`, or a key from the settings' `out_of_office_reasons`. Only people who manage this host see it: never bookers, webhooks or calendars. + + notes : typing.Optional[str] + + public_message : typing.Optional[str] + + show_on_calendar : typing.Optional[bool] + + delegates : typing.Optional[typing.Sequence[str]] + Who can be booked in this host's place during it, by id or uid, in the order to try them. They still have to fit how a booking's routed. + + existing_bookings : typing.Optional[UpdateSchedulingOutOfOfficeRequestExistingBookings] + What happens to bookings already in the way. `leave` (the default) only reports them. `reassign` moves them, and any nobody can take stay where they are. + + reassign : typing.Optional[UpdateSchedulingOutOfOfficeRequestReassign] + With `existing_bookings: reassign`: who they go to. Default: the fairest who's free. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + SchedulingOutOfOffice + The entry. + + Examples + -------- + from coss import Coss + + client = Coss( + "2026-10-10", + api_key="YOUR_API_KEY", + ) + client.scheduling.out_of_office.update( + id="ooo_01kd2m9a0b1c2d3e4f5g6h7j8m", + end_date="2027-08-20", + ) + """ + _response = self._raw_client.update( + id, + start=start, + end=end, + start_date=start_date, + end_date=end_date, + time_zone=time_zone, + reason=reason, + notes=notes, + public_message=public_message, + show_on_calendar=show_on_calendar, + delegates=delegates, + existing_bookings=existing_bookings, + reassign=reassign, + request_options=request_options, + ) + return _response.data + + def put( + self, + external_id: str, + *, + host: str, + start: typing.Optional[str] = OMIT, + end: typing.Optional[str] = OMIT, + start_date: typing.Optional[str] = OMIT, + end_date: typing.Optional[str] = OMIT, + time_zone: typing.Optional[str] = OMIT, + delegates: typing.Optional[typing.Sequence[str]] = OMIT, + reason: typing.Optional[str] = OMIT, + notes: typing.Optional[str] = OMIT, + public_message: typing.Optional[str] = OMIT, + show_on_calendar: typing.Optional[bool] = OMIT, + existing_bookings: typing.Optional[PutSchedulingOutOfOfficeRequestExistingBookings] = OMIT, + reassign: typing.Optional[PutSchedulingOutOfOfficeRequestReassign] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> SchedulingOutOfOffice: + """ + For syncing from a system of record such as an HR tool: send what it says, as often as you like, and there's one entry for it. Give every field you want to keep. + + Parameters + ---------- + external_id : str + Your own id for the entry. + + host : str + The host, by id or uid. + + start : typing.Optional[str] + An ISO 8601 instant with an offset. + + end : typing.Optional[str] + An ISO 8601 instant with an offset. + + start_date : typing.Optional[str] + The first whole day away. Use instead of `start` and `end`. + + end_date : typing.Optional[str] + The last whole day away, which is included. + + time_zone : typing.Optional[str] + What the dates mean in. Default: the host's zone when this is made. + + delegates : typing.Optional[typing.Sequence[str]] + Who can be booked in this host's place during it, by id or uid, in the order to try them. They still have to fit how a booking's routed. + + reason : typing.Optional[str] + One of `unspecified`, `vacation`, `travel`, `sick`, `public_holiday`, `parental_leave`, `training` and `other`, or a key from the settings' `out_of_office_reasons`. Only people who manage this host see it: never bookers, webhooks or calendars. + + notes : typing.Optional[str] + For people who manage this host. Encrypted, and never shown to a booker. + + public_message : typing.Optional[str] + Shown to bookers while this host is away. Can't contain a link. + + show_on_calendar : typing.Optional[bool] + Put a private "Out of office" event on the host's calendar. Default: true. + + existing_bookings : typing.Optional[PutSchedulingOutOfOfficeRequestExistingBookings] + What happens to bookings already in the way. `leave` (the default) only reports them. `reassign` moves them, and any nobody can take stay where they are. + + reassign : typing.Optional[PutSchedulingOutOfOfficeRequestReassign] + With `existing_bookings: reassign`: who they go to. Default: the fairest who's free. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + SchedulingOutOfOffice + The entry, replaced. + + Examples + -------- + from coss import Coss + + client = Coss( + "2026-10-10", + api_key="YOUR_API_KEY", + ) + client.scheduling.out_of_office.put( + external_id="hr_leave_4471", + host="doctor_482", + start_date="2027-08-02", + end_date="2027-08-13", + reason="vacation", + ) + """ + _response = self._raw_client.put( + external_id, + host=host, + start=start, + end=end, + start_date=start_date, + end_date=end_date, + time_zone=time_zone, + delegates=delegates, + reason=reason, + notes=notes, + public_message=public_message, + show_on_calendar=show_on_calendar, + existing_bookings=existing_bookings, + reassign=reassign, + request_options=request_options, + ) + return _response.data + + def conflicts( + self, id: str, *, limit: typing.Optional[int] = None, request_options: typing.Optional[RequestOptions] = None + ) -> SchedulingOutOfOfficeConflictList: + """ + Live bookings of the host that fall in the entry, soonest first. Entries never change them. + + Parameters + ---------- + id : str + The entry's id. + + limit : typing.Optional[int] + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + SchedulingOutOfOfficeConflictList + The bookings. + + Examples + -------- + from coss import Coss + + client = Coss( + "2026-10-10", + api_key="YOUR_API_KEY", + ) + client.scheduling.out_of_office.conflicts( + id="ooo_01kd2m9a0b1c2d3e4f5g6h7j8m", + ) + """ + _response = self._raw_client.conflicts(id, limit=limit, request_options=request_options) + return _response.data + + +class AsyncOutOfOfficeClient: + def __init__(self, *, client_wrapper: AsyncClientWrapper): + self._raw_client = AsyncRawOutOfOfficeClient(client_wrapper=client_wrapper) + + @property + def with_raw_response(self) -> AsyncRawOutOfOfficeClient: + """ + Retrieves a raw implementation of this client that returns raw responses. + + Returns + ------- + AsyncRawOutOfOfficeClient + """ + return self._raw_client + + async def list( + self, + *, + limit: typing.Optional[int] = None, + after: typing.Optional[str] = None, + host: typing.Optional[str] = None, + start_after: typing.Optional[str] = None, + start_before: typing.Optional[str] = None, + group: typing.Optional[str] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> SchedulingOutOfOfficeList: + """ + The environment's entries, newest first. + + Parameters + ---------- + limit : typing.Optional[int] + + after : typing.Optional[str] + The last id of the previous page. + + host : typing.Optional[str] + One host's entries, by id or uid. + + start_after : typing.Optional[str] + Entries ending after this. + + start_before : typing.Optional[str] + Entries starting before this. + + group : typing.Optional[str] + The entries one request made. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + SchedulingOutOfOfficeList + A page of entries. + + Examples + -------- + import asyncio + + from coss import AsyncCoss + + client = AsyncCoss( + "2026-10-10", + api_key="YOUR_API_KEY", + ) + + + async def main() -> None: + await client.scheduling.out_of_office.list( + start_after="2027-01-04T15:00:00.000Z", + start_before="2027-01-04T15:00:00.000Z", + ) + + + asyncio.run(main()) + """ + _response = await self._raw_client.list( + limit=limit, + after=after, + host=host, + start_after=start_after, + start_before=start_before, + group=group, + request_options=request_options, + ) + return _response.data + + async def create( + self, + *, + host: typing.Optional[str] = OMIT, + hosts: typing.Optional[typing.Sequence[str]] = OMIT, + host_filter: typing.Optional[typing.Dict[str, CreateSchedulingOutOfOfficeRequestHostFilterValue]] = OMIT, + start: typing.Optional[str] = OMIT, + end: typing.Optional[str] = OMIT, + start_date: typing.Optional[str] = OMIT, + end_date: typing.Optional[str] = OMIT, + time_zone: typing.Optional[str] = OMIT, + delegates: typing.Optional[typing.Sequence[str]] = OMIT, + reason: typing.Optional[str] = OMIT, + notes: typing.Optional[str] = OMIT, + public_message: typing.Optional[str] = OMIT, + show_on_calendar: typing.Optional[bool] = OMIT, + existing_bookings: typing.Optional[CreateSchedulingOutOfOfficeRequestExistingBookings] = OMIT, + reassign: typing.Optional[CreateSchedulingOutOfOfficeRequestReassign] = OMIT, + external_id: typing.Optional[str] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> SchedulingOutOfOfficeList: + """ + Marks one host, a list of hosts or everyone matching some attributes as away, for part of a day or for whole dates. They aren't offered during it. Existing bookings stay as they are: list them with the entry's conflicts. + + Parameters + ---------- + host : typing.Optional[str] + One host, by id or uid. + + hosts : typing.Optional[typing.Sequence[str]] + Several hosts, by id or uid. Each gets an entry of their own. + + host_filter : typing.Optional[typing.Dict[str, CreateSchedulingOutOfOfficeRequestHostFilterValue]] + Every active host matching these attributes right now. A host added later isn't covered. + + start : typing.Optional[str] + An ISO 8601 instant with an offset. + + end : typing.Optional[str] + An ISO 8601 instant with an offset. + + start_date : typing.Optional[str] + The first whole day away. Use instead of `start` and `end`. + + end_date : typing.Optional[str] + The last whole day away, which is included. + + time_zone : typing.Optional[str] + What the dates mean in. Default: the host's zone when this is made. + + delegates : typing.Optional[typing.Sequence[str]] + Who can be booked in this host's place during it, by id or uid, in the order to try them. They still have to fit how a booking's routed. + + reason : typing.Optional[str] + One of `unspecified`, `vacation`, `travel`, `sick`, `public_holiday`, `parental_leave`, `training` and `other`, or a key from the settings' `out_of_office_reasons`. Only people who manage this host see it: never bookers, webhooks or calendars. + + notes : typing.Optional[str] + For people who manage this host. Encrypted, and never shown to a booker. + + public_message : typing.Optional[str] + Shown to bookers while this host is away. Can't contain a link. + + show_on_calendar : typing.Optional[bool] + Put a private "Out of office" event on the host's calendar. Default: true. + + existing_bookings : typing.Optional[CreateSchedulingOutOfOfficeRequestExistingBookings] + What happens to bookings already in the way. `leave` (the default) only reports them. `reassign` moves them, and any nobody can take stay where they are. + + reassign : typing.Optional[CreateSchedulingOutOfOfficeRequestReassign] + With `existing_bookings: reassign`: who they go to. Default: the fairest who's free. + + external_id : typing.Optional[str] + Your own id for this entry, unique in the environment. Needs one host. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + SchedulingOutOfOfficeList + An entry per host. + + Examples + -------- + import asyncio + + from coss import AsyncCoss + + client = AsyncCoss( + "2026-10-10", + api_key="YOUR_API_KEY", + ) + + + async def main() -> None: + await client.scheduling.out_of_office.create( + host="doctor_482", + start_date="2027-08-02", + end_date="2027-08-13", + reason="vacation", + public_message="Back on the 16th.", + ) + + + asyncio.run(main()) + """ + _response = await self._raw_client.create( + host=host, + hosts=hosts, + host_filter=host_filter, + start=start, + end=end, + start_date=start_date, + end_date=end_date, + time_zone=time_zone, + delegates=delegates, + reason=reason, + notes=notes, + public_message=public_message, + show_on_calendar=show_on_calendar, + existing_bookings=existing_bookings, + reassign=reassign, + external_id=external_id, + request_options=request_options, + ) + return _response.data + + async def get(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> SchedulingOutOfOffice: + """ + One entry. + + Parameters + ---------- + id : str + The entry's id. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + SchedulingOutOfOffice + The entry. + + Examples + -------- + import asyncio + + from coss import AsyncCoss + + client = AsyncCoss( + "2026-10-10", + api_key="YOUR_API_KEY", + ) + + + async def main() -> None: + await client.scheduling.out_of_office.get( + id="ooo_01kd2m9a0b1c2d3e4f5g6h7j8m", + ) + + + asyncio.run(main()) + """ + _response = await self._raw_client.get(id, request_options=request_options) + return _response.data + + async def remove( + self, id: str, *, request_options: typing.Optional[RequestOptions] = None + ) -> DeletedSchedulingOutOfOffice: + """ + The host can be booked in that time again, and any calendar event for it goes. + + Parameters + ---------- + id : str + The entry's id. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + DeletedSchedulingOutOfOffice + Deleted. + + Examples + -------- + import asyncio + + from coss import AsyncCoss + + client = AsyncCoss( + "2026-10-10", + api_key="YOUR_API_KEY", + ) + + + async def main() -> None: + await client.scheduling.out_of_office.remove( + id="ooo_01kd2m9a0b1c2d3e4f5g6h7j8m", + ) + + + asyncio.run(main()) + """ + _response = await self._raw_client.remove(id, request_options=request_options) + return _response.data + + async def update( + self, + id: str, + *, + start: typing.Optional[str] = OMIT, + end: typing.Optional[str] = OMIT, + start_date: typing.Optional[str] = OMIT, + end_date: typing.Optional[str] = OMIT, + time_zone: typing.Optional[str] = OMIT, + reason: typing.Optional[str] = OMIT, + notes: typing.Optional[str] = OMIT, + public_message: typing.Optional[str] = OMIT, + show_on_calendar: typing.Optional[bool] = OMIT, + delegates: typing.Optional[typing.Sequence[str]] = OMIT, + existing_bookings: typing.Optional[UpdateSchedulingOutOfOfficeRequestExistingBookings] = OMIT, + reassign: typing.Optional[UpdateSchedulingOutOfOfficeRequestReassign] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> SchedulingOutOfOffice: + """ + Changes what's given. An entry stays with its host. + + Parameters + ---------- + id : str + The entry's id. + + start : typing.Optional[str] + An ISO 8601 instant with an offset. + + end : typing.Optional[str] + An ISO 8601 instant with an offset. + + start_date : typing.Optional[str] + The first whole day away. Use instead of `start` and `end`. + + end_date : typing.Optional[str] + The last whole day away, which is included. + + time_zone : typing.Optional[str] + What the dates mean in. Default: the host's zone when this is made. + + reason : typing.Optional[str] + One of `unspecified`, `vacation`, `travel`, `sick`, `public_holiday`, `parental_leave`, `training` and `other`, or a key from the settings' `out_of_office_reasons`. Only people who manage this host see it: never bookers, webhooks or calendars. + + notes : typing.Optional[str] + + public_message : typing.Optional[str] + + show_on_calendar : typing.Optional[bool] + + delegates : typing.Optional[typing.Sequence[str]] + Who can be booked in this host's place during it, by id or uid, in the order to try them. They still have to fit how a booking's routed. + + existing_bookings : typing.Optional[UpdateSchedulingOutOfOfficeRequestExistingBookings] + What happens to bookings already in the way. `leave` (the default) only reports them. `reassign` moves them, and any nobody can take stay where they are. + + reassign : typing.Optional[UpdateSchedulingOutOfOfficeRequestReassign] + With `existing_bookings: reassign`: who they go to. Default: the fairest who's free. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + SchedulingOutOfOffice + The entry. + + Examples + -------- + import asyncio + + from coss import AsyncCoss + + client = AsyncCoss( + "2026-10-10", + api_key="YOUR_API_KEY", + ) + + + async def main() -> None: + await client.scheduling.out_of_office.update( + id="ooo_01kd2m9a0b1c2d3e4f5g6h7j8m", + end_date="2027-08-20", + ) + + + asyncio.run(main()) + """ + _response = await self._raw_client.update( + id, + start=start, + end=end, + start_date=start_date, + end_date=end_date, + time_zone=time_zone, + reason=reason, + notes=notes, + public_message=public_message, + show_on_calendar=show_on_calendar, + delegates=delegates, + existing_bookings=existing_bookings, + reassign=reassign, + request_options=request_options, + ) + return _response.data + + async def put( + self, + external_id: str, + *, + host: str, + start: typing.Optional[str] = OMIT, + end: typing.Optional[str] = OMIT, + start_date: typing.Optional[str] = OMIT, + end_date: typing.Optional[str] = OMIT, + time_zone: typing.Optional[str] = OMIT, + delegates: typing.Optional[typing.Sequence[str]] = OMIT, + reason: typing.Optional[str] = OMIT, + notes: typing.Optional[str] = OMIT, + public_message: typing.Optional[str] = OMIT, + show_on_calendar: typing.Optional[bool] = OMIT, + existing_bookings: typing.Optional[PutSchedulingOutOfOfficeRequestExistingBookings] = OMIT, + reassign: typing.Optional[PutSchedulingOutOfOfficeRequestReassign] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> SchedulingOutOfOffice: + """ + For syncing from a system of record such as an HR tool: send what it says, as often as you like, and there's one entry for it. Give every field you want to keep. + + Parameters + ---------- + external_id : str + Your own id for the entry. + + host : str + The host, by id or uid. + + start : typing.Optional[str] + An ISO 8601 instant with an offset. + + end : typing.Optional[str] + An ISO 8601 instant with an offset. + + start_date : typing.Optional[str] + The first whole day away. Use instead of `start` and `end`. + + end_date : typing.Optional[str] + The last whole day away, which is included. + + time_zone : typing.Optional[str] + What the dates mean in. Default: the host's zone when this is made. + + delegates : typing.Optional[typing.Sequence[str]] + Who can be booked in this host's place during it, by id or uid, in the order to try them. They still have to fit how a booking's routed. + + reason : typing.Optional[str] + One of `unspecified`, `vacation`, `travel`, `sick`, `public_holiday`, `parental_leave`, `training` and `other`, or a key from the settings' `out_of_office_reasons`. Only people who manage this host see it: never bookers, webhooks or calendars. + + notes : typing.Optional[str] + For people who manage this host. Encrypted, and never shown to a booker. + + public_message : typing.Optional[str] + Shown to bookers while this host is away. Can't contain a link. + + show_on_calendar : typing.Optional[bool] + Put a private "Out of office" event on the host's calendar. Default: true. + + existing_bookings : typing.Optional[PutSchedulingOutOfOfficeRequestExistingBookings] + What happens to bookings already in the way. `leave` (the default) only reports them. `reassign` moves them, and any nobody can take stay where they are. + + reassign : typing.Optional[PutSchedulingOutOfOfficeRequestReassign] + With `existing_bookings: reassign`: who they go to. Default: the fairest who's free. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + SchedulingOutOfOffice + The entry, replaced. + + Examples + -------- + import asyncio + + from coss import AsyncCoss + + client = AsyncCoss( + "2026-10-10", + api_key="YOUR_API_KEY", + ) + + + async def main() -> None: + await client.scheduling.out_of_office.put( + external_id="hr_leave_4471", + host="doctor_482", + start_date="2027-08-02", + end_date="2027-08-13", + reason="vacation", + ) + + + asyncio.run(main()) + """ + _response = await self._raw_client.put( + external_id, + host=host, + start=start, + end=end, + start_date=start_date, + end_date=end_date, + time_zone=time_zone, + delegates=delegates, + reason=reason, + notes=notes, + public_message=public_message, + show_on_calendar=show_on_calendar, + existing_bookings=existing_bookings, + reassign=reassign, + request_options=request_options, + ) + return _response.data + + async def conflicts( + self, id: str, *, limit: typing.Optional[int] = None, request_options: typing.Optional[RequestOptions] = None + ) -> SchedulingOutOfOfficeConflictList: + """ + Live bookings of the host that fall in the entry, soonest first. Entries never change them. + + Parameters + ---------- + id : str + The entry's id. + + limit : typing.Optional[int] + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + SchedulingOutOfOfficeConflictList + The bookings. + + Examples + -------- + import asyncio + + from coss import AsyncCoss + + client = AsyncCoss( + "2026-10-10", + api_key="YOUR_API_KEY", + ) + + + async def main() -> None: + await client.scheduling.out_of_office.conflicts( + id="ooo_01kd2m9a0b1c2d3e4f5g6h7j8m", + ) + + + asyncio.run(main()) + """ + _response = await self._raw_client.conflicts(id, limit=limit, request_options=request_options) + return _response.data diff --git a/sdks/python/src/coss/resources/scheduling/resources/out_of_office/raw_client.py b/sdks/python/src/coss/resources/scheduling/resources/out_of_office/raw_client.py new file mode 100644 index 000000000..90c1d0e26 --- /dev/null +++ b/sdks/python/src/coss/resources/scheduling/resources/out_of_office/raw_client.py @@ -0,0 +1,2461 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing +from json.decoder import JSONDecodeError + +from .....core.api_error import ApiError +from .....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper +from .....core.http_response import AsyncHttpResponse, HttpResponse +from .....core.idempotency import generate_idempotency_key +from .....core.jsonable_encoder import encode_path_param +from .....core.parse_error import ParsingError +from .....core.pydantic_utilities import parse_obj_as +from .....core.request_options import RequestOptions +from .....core.serialization import convert_and_respect_annotation_metadata +from .....errors.bad_request_error import BadRequestError +from .....errors.forbidden_error import ForbiddenError +from .....errors.internal_server_error import InternalServerError +from .....errors.not_found_error import NotFoundError +from .....errors.service_unavailable_error import ServiceUnavailableError +from .....errors.too_many_requests_error import TooManyRequestsError +from .....errors.unauthorized_error import UnauthorizedError +from .....errors.unprocessable_entity_error import UnprocessableEntityError +from .....errors.unsupported_media_type_error import UnsupportedMediaTypeError +from .....types.deleted_scheduling_out_of_office import DeletedSchedulingOutOfOffice +from .....types.error import Error +from .....types.scheduling_out_of_office import SchedulingOutOfOffice +from .....types.scheduling_out_of_office_conflict_list import SchedulingOutOfOfficeConflictList +from .....types.scheduling_out_of_office_list import SchedulingOutOfOfficeList +from .types.create_scheduling_out_of_office_request_existing_bookings import ( + CreateSchedulingOutOfOfficeRequestExistingBookings, +) +from .types.create_scheduling_out_of_office_request_host_filter_value import ( + CreateSchedulingOutOfOfficeRequestHostFilterValue, +) +from .types.create_scheduling_out_of_office_request_reassign import CreateSchedulingOutOfOfficeRequestReassign +from .types.put_scheduling_out_of_office_request_existing_bookings import ( + PutSchedulingOutOfOfficeRequestExistingBookings, +) +from .types.put_scheduling_out_of_office_request_reassign import PutSchedulingOutOfOfficeRequestReassign +from .types.update_scheduling_out_of_office_request_existing_bookings import ( + UpdateSchedulingOutOfOfficeRequestExistingBookings, +) +from .types.update_scheduling_out_of_office_request_reassign import UpdateSchedulingOutOfOfficeRequestReassign +from pydantic import ValidationError + +# this is used as the default value for optional parameters +OMIT = typing.cast(typing.Any, ...) + + +class RawOutOfOfficeClient: + def __init__(self, *, client_wrapper: SyncClientWrapper): + self._client_wrapper = client_wrapper + + def list( + self, + *, + limit: typing.Optional[int] = None, + after: typing.Optional[str] = None, + host: typing.Optional[str] = None, + start_after: typing.Optional[str] = None, + start_before: typing.Optional[str] = None, + group: typing.Optional[str] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> HttpResponse[SchedulingOutOfOfficeList]: + """ + The environment's entries, newest first. + + Parameters + ---------- + limit : typing.Optional[int] + + after : typing.Optional[str] + The last id of the previous page. + + host : typing.Optional[str] + One host's entries, by id or uid. + + start_after : typing.Optional[str] + Entries ending after this. + + start_before : typing.Optional[str] + Entries starting before this. + + group : typing.Optional[str] + The entries one request made. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + HttpResponse[SchedulingOutOfOfficeList] + A page of entries. + """ + _response = self._client_wrapper.httpx_client.request( + "v1/scheduling/out_of_office", + method="GET", + params={ + "limit": limit, + "after": after, + "host": host, + "start_after": start_after, + "start_before": start_before, + "group": group, + }, + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + SchedulingOutOfOfficeList, + parse_obj_as( + type_=SchedulingOutOfOfficeList, # type: ignore + object_=_response.json(), + ), + ) + return HttpResponse(response=_response, data=_data) + if _response.status_code == 400: + raise BadRequestError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 401: + raise UnauthorizedError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 403: + raise ForbiddenError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 404: + raise NotFoundError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 422: + raise UnprocessableEntityError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 429: + raise TooManyRequestsError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 500: + raise InternalServerError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 503: + raise ServiceUnavailableError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) + except ValidationError as e: + raise ParsingError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e + ) + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + + def create( + self, + *, + host: typing.Optional[str] = OMIT, + hosts: typing.Optional[typing.Sequence[str]] = OMIT, + host_filter: typing.Optional[typing.Dict[str, CreateSchedulingOutOfOfficeRequestHostFilterValue]] = OMIT, + start: typing.Optional[str] = OMIT, + end: typing.Optional[str] = OMIT, + start_date: typing.Optional[str] = OMIT, + end_date: typing.Optional[str] = OMIT, + time_zone: typing.Optional[str] = OMIT, + delegates: typing.Optional[typing.Sequence[str]] = OMIT, + reason: typing.Optional[str] = OMIT, + notes: typing.Optional[str] = OMIT, + public_message: typing.Optional[str] = OMIT, + show_on_calendar: typing.Optional[bool] = OMIT, + existing_bookings: typing.Optional[CreateSchedulingOutOfOfficeRequestExistingBookings] = OMIT, + reassign: typing.Optional[CreateSchedulingOutOfOfficeRequestReassign] = OMIT, + external_id: typing.Optional[str] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> HttpResponse[SchedulingOutOfOfficeList]: + """ + Marks one host, a list of hosts or everyone matching some attributes as away, for part of a day or for whole dates. They aren't offered during it. Existing bookings stay as they are: list them with the entry's conflicts. + + Parameters + ---------- + host : typing.Optional[str] + One host, by id or uid. + + hosts : typing.Optional[typing.Sequence[str]] + Several hosts, by id or uid. Each gets an entry of their own. + + host_filter : typing.Optional[typing.Dict[str, CreateSchedulingOutOfOfficeRequestHostFilterValue]] + Every active host matching these attributes right now. A host added later isn't covered. + + start : typing.Optional[str] + An ISO 8601 instant with an offset. + + end : typing.Optional[str] + An ISO 8601 instant with an offset. + + start_date : typing.Optional[str] + The first whole day away. Use instead of `start` and `end`. + + end_date : typing.Optional[str] + The last whole day away, which is included. + + time_zone : typing.Optional[str] + What the dates mean in. Default: the host's zone when this is made. + + delegates : typing.Optional[typing.Sequence[str]] + Who can be booked in this host's place during it, by id or uid, in the order to try them. They still have to fit how a booking's routed. + + reason : typing.Optional[str] + One of `unspecified`, `vacation`, `travel`, `sick`, `public_holiday`, `parental_leave`, `training` and `other`, or a key from the settings' `out_of_office_reasons`. Only people who manage this host see it: never bookers, webhooks or calendars. + + notes : typing.Optional[str] + For people who manage this host. Encrypted, and never shown to a booker. + + public_message : typing.Optional[str] + Shown to bookers while this host is away. Can't contain a link. + + show_on_calendar : typing.Optional[bool] + Put a private "Out of office" event on the host's calendar. Default: true. + + existing_bookings : typing.Optional[CreateSchedulingOutOfOfficeRequestExistingBookings] + What happens to bookings already in the way. `leave` (the default) only reports them. `reassign` moves them, and any nobody can take stay where they are. + + reassign : typing.Optional[CreateSchedulingOutOfOfficeRequestReassign] + With `existing_bookings: reassign`: who they go to. Default: the fairest who's free. + + external_id : typing.Optional[str] + Your own id for this entry, unique in the environment. Needs one host. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + HttpResponse[SchedulingOutOfOfficeList] + An entry per host. + """ + _request_options_with_retries_disabled: typing.Optional[RequestOptions] = ( + {**request_options, "max_retries": 0} if request_options is not None else {"max_retries": 0} + ) + _response = self._client_wrapper.httpx_client.request( + "v1/scheduling/out_of_office", + method="POST", + json={ + "host": host, + "hosts": hosts, + "host_filter": convert_and_respect_annotation_metadata( + object_=host_filter, + annotation=typing.Dict[str, CreateSchedulingOutOfOfficeRequestHostFilterValue], + direction="write", + ), + "start": start, + "end": end, + "start_date": start_date, + "end_date": end_date, + "time_zone": time_zone, + "delegates": delegates, + "reason": reason, + "notes": notes, + "public_message": public_message, + "show_on_calendar": show_on_calendar, + "existing_bookings": existing_bookings, + "reassign": convert_and_respect_annotation_metadata( + object_=reassign, annotation=CreateSchedulingOutOfOfficeRequestReassign, direction="write" + ), + "external_id": external_id, + }, + headers={ + "content-type": "application/json", + "Idempotency-Key": generate_idempotency_key(), + }, + request_options=_request_options_with_retries_disabled, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + SchedulingOutOfOfficeList, + parse_obj_as( + type_=SchedulingOutOfOfficeList, # type: ignore + object_=_response.json(), + ), + ) + return HttpResponse(response=_response, data=_data) + if _response.status_code == 400: + raise BadRequestError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 401: + raise UnauthorizedError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 403: + raise ForbiddenError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 404: + raise NotFoundError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 415: + raise UnsupportedMediaTypeError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 422: + raise UnprocessableEntityError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 429: + raise TooManyRequestsError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 500: + raise InternalServerError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 503: + raise ServiceUnavailableError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) + except ValidationError as e: + raise ParsingError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e + ) + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + + def get( + self, id: str, *, request_options: typing.Optional[RequestOptions] = None + ) -> HttpResponse[SchedulingOutOfOffice]: + """ + One entry. + + Parameters + ---------- + id : str + The entry's id. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + HttpResponse[SchedulingOutOfOffice] + The entry. + """ + _response = self._client_wrapper.httpx_client.request( + f"v1/scheduling/out_of_office/{encode_path_param(id)}", + method="GET", + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + SchedulingOutOfOffice, + parse_obj_as( + type_=SchedulingOutOfOffice, # type: ignore + object_=_response.json(), + ), + ) + return HttpResponse(response=_response, data=_data) + if _response.status_code == 400: + raise BadRequestError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 401: + raise UnauthorizedError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 403: + raise ForbiddenError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 404: + raise NotFoundError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 429: + raise TooManyRequestsError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 500: + raise InternalServerError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 503: + raise ServiceUnavailableError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) + except ValidationError as e: + raise ParsingError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e + ) + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + + def remove( + self, id: str, *, request_options: typing.Optional[RequestOptions] = None + ) -> HttpResponse[DeletedSchedulingOutOfOffice]: + """ + The host can be booked in that time again, and any calendar event for it goes. + + Parameters + ---------- + id : str + The entry's id. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + HttpResponse[DeletedSchedulingOutOfOffice] + Deleted. + """ + _response = self._client_wrapper.httpx_client.request( + f"v1/scheduling/out_of_office/{encode_path_param(id)}", + method="DELETE", + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + DeletedSchedulingOutOfOffice, + parse_obj_as( + type_=DeletedSchedulingOutOfOffice, # type: ignore + object_=_response.json(), + ), + ) + return HttpResponse(response=_response, data=_data) + if _response.status_code == 400: + raise BadRequestError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 401: + raise UnauthorizedError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 403: + raise ForbiddenError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 404: + raise NotFoundError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 429: + raise TooManyRequestsError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 500: + raise InternalServerError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 503: + raise ServiceUnavailableError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) + except ValidationError as e: + raise ParsingError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e + ) + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + + def update( + self, + id: str, + *, + start: typing.Optional[str] = OMIT, + end: typing.Optional[str] = OMIT, + start_date: typing.Optional[str] = OMIT, + end_date: typing.Optional[str] = OMIT, + time_zone: typing.Optional[str] = OMIT, + reason: typing.Optional[str] = OMIT, + notes: typing.Optional[str] = OMIT, + public_message: typing.Optional[str] = OMIT, + show_on_calendar: typing.Optional[bool] = OMIT, + delegates: typing.Optional[typing.Sequence[str]] = OMIT, + existing_bookings: typing.Optional[UpdateSchedulingOutOfOfficeRequestExistingBookings] = OMIT, + reassign: typing.Optional[UpdateSchedulingOutOfOfficeRequestReassign] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> HttpResponse[SchedulingOutOfOffice]: + """ + Changes what's given. An entry stays with its host. + + Parameters + ---------- + id : str + The entry's id. + + start : typing.Optional[str] + An ISO 8601 instant with an offset. + + end : typing.Optional[str] + An ISO 8601 instant with an offset. + + start_date : typing.Optional[str] + The first whole day away. Use instead of `start` and `end`. + + end_date : typing.Optional[str] + The last whole day away, which is included. + + time_zone : typing.Optional[str] + What the dates mean in. Default: the host's zone when this is made. + + reason : typing.Optional[str] + One of `unspecified`, `vacation`, `travel`, `sick`, `public_holiday`, `parental_leave`, `training` and `other`, or a key from the settings' `out_of_office_reasons`. Only people who manage this host see it: never bookers, webhooks or calendars. + + notes : typing.Optional[str] + + public_message : typing.Optional[str] + + show_on_calendar : typing.Optional[bool] + + delegates : typing.Optional[typing.Sequence[str]] + Who can be booked in this host's place during it, by id or uid, in the order to try them. They still have to fit how a booking's routed. + + existing_bookings : typing.Optional[UpdateSchedulingOutOfOfficeRequestExistingBookings] + What happens to bookings already in the way. `leave` (the default) only reports them. `reassign` moves them, and any nobody can take stay where they are. + + reassign : typing.Optional[UpdateSchedulingOutOfOfficeRequestReassign] + With `existing_bookings: reassign`: who they go to. Default: the fairest who's free. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + HttpResponse[SchedulingOutOfOffice] + The entry. + """ + _response = self._client_wrapper.httpx_client.request( + f"v1/scheduling/out_of_office/{encode_path_param(id)}", + method="PATCH", + json={ + "start": start, + "end": end, + "start_date": start_date, + "end_date": end_date, + "time_zone": time_zone, + "reason": reason, + "notes": notes, + "public_message": public_message, + "show_on_calendar": show_on_calendar, + "delegates": delegates, + "existing_bookings": existing_bookings, + "reassign": convert_and_respect_annotation_metadata( + object_=reassign, annotation=UpdateSchedulingOutOfOfficeRequestReassign, direction="write" + ), + }, + headers={ + "content-type": "application/json", + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + SchedulingOutOfOffice, + parse_obj_as( + type_=SchedulingOutOfOffice, # type: ignore + object_=_response.json(), + ), + ) + return HttpResponse(response=_response, data=_data) + if _response.status_code == 400: + raise BadRequestError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 401: + raise UnauthorizedError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 403: + raise ForbiddenError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 404: + raise NotFoundError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 415: + raise UnsupportedMediaTypeError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 422: + raise UnprocessableEntityError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 429: + raise TooManyRequestsError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 500: + raise InternalServerError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 503: + raise ServiceUnavailableError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) + except ValidationError as e: + raise ParsingError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e + ) + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + + def put( + self, + external_id: str, + *, + host: str, + start: typing.Optional[str] = OMIT, + end: typing.Optional[str] = OMIT, + start_date: typing.Optional[str] = OMIT, + end_date: typing.Optional[str] = OMIT, + time_zone: typing.Optional[str] = OMIT, + delegates: typing.Optional[typing.Sequence[str]] = OMIT, + reason: typing.Optional[str] = OMIT, + notes: typing.Optional[str] = OMIT, + public_message: typing.Optional[str] = OMIT, + show_on_calendar: typing.Optional[bool] = OMIT, + existing_bookings: typing.Optional[PutSchedulingOutOfOfficeRequestExistingBookings] = OMIT, + reassign: typing.Optional[PutSchedulingOutOfOfficeRequestReassign] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> HttpResponse[SchedulingOutOfOffice]: + """ + For syncing from a system of record such as an HR tool: send what it says, as often as you like, and there's one entry for it. Give every field you want to keep. + + Parameters + ---------- + external_id : str + Your own id for the entry. + + host : str + The host, by id or uid. + + start : typing.Optional[str] + An ISO 8601 instant with an offset. + + end : typing.Optional[str] + An ISO 8601 instant with an offset. + + start_date : typing.Optional[str] + The first whole day away. Use instead of `start` and `end`. + + end_date : typing.Optional[str] + The last whole day away, which is included. + + time_zone : typing.Optional[str] + What the dates mean in. Default: the host's zone when this is made. + + delegates : typing.Optional[typing.Sequence[str]] + Who can be booked in this host's place during it, by id or uid, in the order to try them. They still have to fit how a booking's routed. + + reason : typing.Optional[str] + One of `unspecified`, `vacation`, `travel`, `sick`, `public_holiday`, `parental_leave`, `training` and `other`, or a key from the settings' `out_of_office_reasons`. Only people who manage this host see it: never bookers, webhooks or calendars. + + notes : typing.Optional[str] + For people who manage this host. Encrypted, and never shown to a booker. + + public_message : typing.Optional[str] + Shown to bookers while this host is away. Can't contain a link. + + show_on_calendar : typing.Optional[bool] + Put a private "Out of office" event on the host's calendar. Default: true. + + existing_bookings : typing.Optional[PutSchedulingOutOfOfficeRequestExistingBookings] + What happens to bookings already in the way. `leave` (the default) only reports them. `reassign` moves them, and any nobody can take stay where they are. + + reassign : typing.Optional[PutSchedulingOutOfOfficeRequestReassign] + With `existing_bookings: reassign`: who they go to. Default: the fairest who's free. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + HttpResponse[SchedulingOutOfOffice] + The entry, replaced. + """ + _response = self._client_wrapper.httpx_client.request( + f"v1/scheduling/out_of_office/by_external_id/{encode_path_param(external_id)}", + method="PUT", + json={ + "host": host, + "start": start, + "end": end, + "start_date": start_date, + "end_date": end_date, + "time_zone": time_zone, + "delegates": delegates, + "reason": reason, + "notes": notes, + "public_message": public_message, + "show_on_calendar": show_on_calendar, + "existing_bookings": existing_bookings, + "reassign": convert_and_respect_annotation_metadata( + object_=reassign, annotation=PutSchedulingOutOfOfficeRequestReassign, direction="write" + ), + }, + headers={ + "content-type": "application/json", + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + SchedulingOutOfOffice, + parse_obj_as( + type_=SchedulingOutOfOffice, # type: ignore + object_=_response.json(), + ), + ) + return HttpResponse(response=_response, data=_data) + if _response.status_code == 400: + raise BadRequestError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 401: + raise UnauthorizedError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 403: + raise ForbiddenError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 404: + raise NotFoundError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 415: + raise UnsupportedMediaTypeError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 422: + raise UnprocessableEntityError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 429: + raise TooManyRequestsError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 500: + raise InternalServerError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 503: + raise ServiceUnavailableError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) + except ValidationError as e: + raise ParsingError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e + ) + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + + def conflicts( + self, id: str, *, limit: typing.Optional[int] = None, request_options: typing.Optional[RequestOptions] = None + ) -> HttpResponse[SchedulingOutOfOfficeConflictList]: + """ + Live bookings of the host that fall in the entry, soonest first. Entries never change them. + + Parameters + ---------- + id : str + The entry's id. + + limit : typing.Optional[int] + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + HttpResponse[SchedulingOutOfOfficeConflictList] + The bookings. + """ + _response = self._client_wrapper.httpx_client.request( + f"v1/scheduling/out_of_office/{encode_path_param(id)}/conflicts", + method="GET", + params={ + "limit": limit, + }, + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + SchedulingOutOfOfficeConflictList, + parse_obj_as( + type_=SchedulingOutOfOfficeConflictList, # type: ignore + object_=_response.json(), + ), + ) + return HttpResponse(response=_response, data=_data) + if _response.status_code == 400: + raise BadRequestError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 401: + raise UnauthorizedError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 403: + raise ForbiddenError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 404: + raise NotFoundError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 422: + raise UnprocessableEntityError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 429: + raise TooManyRequestsError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 500: + raise InternalServerError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 503: + raise ServiceUnavailableError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) + except ValidationError as e: + raise ParsingError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e + ) + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + + +class AsyncRawOutOfOfficeClient: + def __init__(self, *, client_wrapper: AsyncClientWrapper): + self._client_wrapper = client_wrapper + + async def list( + self, + *, + limit: typing.Optional[int] = None, + after: typing.Optional[str] = None, + host: typing.Optional[str] = None, + start_after: typing.Optional[str] = None, + start_before: typing.Optional[str] = None, + group: typing.Optional[str] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> AsyncHttpResponse[SchedulingOutOfOfficeList]: + """ + The environment's entries, newest first. + + Parameters + ---------- + limit : typing.Optional[int] + + after : typing.Optional[str] + The last id of the previous page. + + host : typing.Optional[str] + One host's entries, by id or uid. + + start_after : typing.Optional[str] + Entries ending after this. + + start_before : typing.Optional[str] + Entries starting before this. + + group : typing.Optional[str] + The entries one request made. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AsyncHttpResponse[SchedulingOutOfOfficeList] + A page of entries. + """ + _response = await self._client_wrapper.httpx_client.request( + "v1/scheduling/out_of_office", + method="GET", + params={ + "limit": limit, + "after": after, + "host": host, + "start_after": start_after, + "start_before": start_before, + "group": group, + }, + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + SchedulingOutOfOfficeList, + parse_obj_as( + type_=SchedulingOutOfOfficeList, # type: ignore + object_=_response.json(), + ), + ) + return AsyncHttpResponse(response=_response, data=_data) + if _response.status_code == 400: + raise BadRequestError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 401: + raise UnauthorizedError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 403: + raise ForbiddenError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 404: + raise NotFoundError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 422: + raise UnprocessableEntityError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 429: + raise TooManyRequestsError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 500: + raise InternalServerError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 503: + raise ServiceUnavailableError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) + except ValidationError as e: + raise ParsingError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e + ) + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + + async def create( + self, + *, + host: typing.Optional[str] = OMIT, + hosts: typing.Optional[typing.Sequence[str]] = OMIT, + host_filter: typing.Optional[typing.Dict[str, CreateSchedulingOutOfOfficeRequestHostFilterValue]] = OMIT, + start: typing.Optional[str] = OMIT, + end: typing.Optional[str] = OMIT, + start_date: typing.Optional[str] = OMIT, + end_date: typing.Optional[str] = OMIT, + time_zone: typing.Optional[str] = OMIT, + delegates: typing.Optional[typing.Sequence[str]] = OMIT, + reason: typing.Optional[str] = OMIT, + notes: typing.Optional[str] = OMIT, + public_message: typing.Optional[str] = OMIT, + show_on_calendar: typing.Optional[bool] = OMIT, + existing_bookings: typing.Optional[CreateSchedulingOutOfOfficeRequestExistingBookings] = OMIT, + reassign: typing.Optional[CreateSchedulingOutOfOfficeRequestReassign] = OMIT, + external_id: typing.Optional[str] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> AsyncHttpResponse[SchedulingOutOfOfficeList]: + """ + Marks one host, a list of hosts or everyone matching some attributes as away, for part of a day or for whole dates. They aren't offered during it. Existing bookings stay as they are: list them with the entry's conflicts. + + Parameters + ---------- + host : typing.Optional[str] + One host, by id or uid. + + hosts : typing.Optional[typing.Sequence[str]] + Several hosts, by id or uid. Each gets an entry of their own. + + host_filter : typing.Optional[typing.Dict[str, CreateSchedulingOutOfOfficeRequestHostFilterValue]] + Every active host matching these attributes right now. A host added later isn't covered. + + start : typing.Optional[str] + An ISO 8601 instant with an offset. + + end : typing.Optional[str] + An ISO 8601 instant with an offset. + + start_date : typing.Optional[str] + The first whole day away. Use instead of `start` and `end`. + + end_date : typing.Optional[str] + The last whole day away, which is included. + + time_zone : typing.Optional[str] + What the dates mean in. Default: the host's zone when this is made. + + delegates : typing.Optional[typing.Sequence[str]] + Who can be booked in this host's place during it, by id or uid, in the order to try them. They still have to fit how a booking's routed. + + reason : typing.Optional[str] + One of `unspecified`, `vacation`, `travel`, `sick`, `public_holiday`, `parental_leave`, `training` and `other`, or a key from the settings' `out_of_office_reasons`. Only people who manage this host see it: never bookers, webhooks or calendars. + + notes : typing.Optional[str] + For people who manage this host. Encrypted, and never shown to a booker. + + public_message : typing.Optional[str] + Shown to bookers while this host is away. Can't contain a link. + + show_on_calendar : typing.Optional[bool] + Put a private "Out of office" event on the host's calendar. Default: true. + + existing_bookings : typing.Optional[CreateSchedulingOutOfOfficeRequestExistingBookings] + What happens to bookings already in the way. `leave` (the default) only reports them. `reassign` moves them, and any nobody can take stay where they are. + + reassign : typing.Optional[CreateSchedulingOutOfOfficeRequestReassign] + With `existing_bookings: reassign`: who they go to. Default: the fairest who's free. + + external_id : typing.Optional[str] + Your own id for this entry, unique in the environment. Needs one host. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AsyncHttpResponse[SchedulingOutOfOfficeList] + An entry per host. + """ + _request_options_with_retries_disabled: typing.Optional[RequestOptions] = ( + {**request_options, "max_retries": 0} if request_options is not None else {"max_retries": 0} + ) + _response = await self._client_wrapper.httpx_client.request( + "v1/scheduling/out_of_office", + method="POST", + json={ + "host": host, + "hosts": hosts, + "host_filter": convert_and_respect_annotation_metadata( + object_=host_filter, + annotation=typing.Dict[str, CreateSchedulingOutOfOfficeRequestHostFilterValue], + direction="write", + ), + "start": start, + "end": end, + "start_date": start_date, + "end_date": end_date, + "time_zone": time_zone, + "delegates": delegates, + "reason": reason, + "notes": notes, + "public_message": public_message, + "show_on_calendar": show_on_calendar, + "existing_bookings": existing_bookings, + "reassign": convert_and_respect_annotation_metadata( + object_=reassign, annotation=CreateSchedulingOutOfOfficeRequestReassign, direction="write" + ), + "external_id": external_id, + }, + headers={ + "content-type": "application/json", + "Idempotency-Key": generate_idempotency_key(), + }, + request_options=_request_options_with_retries_disabled, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + SchedulingOutOfOfficeList, + parse_obj_as( + type_=SchedulingOutOfOfficeList, # type: ignore + object_=_response.json(), + ), + ) + return AsyncHttpResponse(response=_response, data=_data) + if _response.status_code == 400: + raise BadRequestError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 401: + raise UnauthorizedError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 403: + raise ForbiddenError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 404: + raise NotFoundError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 415: + raise UnsupportedMediaTypeError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 422: + raise UnprocessableEntityError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 429: + raise TooManyRequestsError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 500: + raise InternalServerError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 503: + raise ServiceUnavailableError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) + except ValidationError as e: + raise ParsingError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e + ) + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + + async def get( + self, id: str, *, request_options: typing.Optional[RequestOptions] = None + ) -> AsyncHttpResponse[SchedulingOutOfOffice]: + """ + One entry. + + Parameters + ---------- + id : str + The entry's id. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AsyncHttpResponse[SchedulingOutOfOffice] + The entry. + """ + _response = await self._client_wrapper.httpx_client.request( + f"v1/scheduling/out_of_office/{encode_path_param(id)}", + method="GET", + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + SchedulingOutOfOffice, + parse_obj_as( + type_=SchedulingOutOfOffice, # type: ignore + object_=_response.json(), + ), + ) + return AsyncHttpResponse(response=_response, data=_data) + if _response.status_code == 400: + raise BadRequestError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 401: + raise UnauthorizedError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 403: + raise ForbiddenError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 404: + raise NotFoundError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 429: + raise TooManyRequestsError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 500: + raise InternalServerError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 503: + raise ServiceUnavailableError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) + except ValidationError as e: + raise ParsingError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e + ) + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + + async def remove( + self, id: str, *, request_options: typing.Optional[RequestOptions] = None + ) -> AsyncHttpResponse[DeletedSchedulingOutOfOffice]: + """ + The host can be booked in that time again, and any calendar event for it goes. + + Parameters + ---------- + id : str + The entry's id. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AsyncHttpResponse[DeletedSchedulingOutOfOffice] + Deleted. + """ + _response = await self._client_wrapper.httpx_client.request( + f"v1/scheduling/out_of_office/{encode_path_param(id)}", + method="DELETE", + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + DeletedSchedulingOutOfOffice, + parse_obj_as( + type_=DeletedSchedulingOutOfOffice, # type: ignore + object_=_response.json(), + ), + ) + return AsyncHttpResponse(response=_response, data=_data) + if _response.status_code == 400: + raise BadRequestError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 401: + raise UnauthorizedError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 403: + raise ForbiddenError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 404: + raise NotFoundError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 429: + raise TooManyRequestsError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 500: + raise InternalServerError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 503: + raise ServiceUnavailableError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) + except ValidationError as e: + raise ParsingError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e + ) + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + + async def update( + self, + id: str, + *, + start: typing.Optional[str] = OMIT, + end: typing.Optional[str] = OMIT, + start_date: typing.Optional[str] = OMIT, + end_date: typing.Optional[str] = OMIT, + time_zone: typing.Optional[str] = OMIT, + reason: typing.Optional[str] = OMIT, + notes: typing.Optional[str] = OMIT, + public_message: typing.Optional[str] = OMIT, + show_on_calendar: typing.Optional[bool] = OMIT, + delegates: typing.Optional[typing.Sequence[str]] = OMIT, + existing_bookings: typing.Optional[UpdateSchedulingOutOfOfficeRequestExistingBookings] = OMIT, + reassign: typing.Optional[UpdateSchedulingOutOfOfficeRequestReassign] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> AsyncHttpResponse[SchedulingOutOfOffice]: + """ + Changes what's given. An entry stays with its host. + + Parameters + ---------- + id : str + The entry's id. + + start : typing.Optional[str] + An ISO 8601 instant with an offset. + + end : typing.Optional[str] + An ISO 8601 instant with an offset. + + start_date : typing.Optional[str] + The first whole day away. Use instead of `start` and `end`. + + end_date : typing.Optional[str] + The last whole day away, which is included. + + time_zone : typing.Optional[str] + What the dates mean in. Default: the host's zone when this is made. + + reason : typing.Optional[str] + One of `unspecified`, `vacation`, `travel`, `sick`, `public_holiday`, `parental_leave`, `training` and `other`, or a key from the settings' `out_of_office_reasons`. Only people who manage this host see it: never bookers, webhooks or calendars. + + notes : typing.Optional[str] + + public_message : typing.Optional[str] + + show_on_calendar : typing.Optional[bool] + + delegates : typing.Optional[typing.Sequence[str]] + Who can be booked in this host's place during it, by id or uid, in the order to try them. They still have to fit how a booking's routed. + + existing_bookings : typing.Optional[UpdateSchedulingOutOfOfficeRequestExistingBookings] + What happens to bookings already in the way. `leave` (the default) only reports them. `reassign` moves them, and any nobody can take stay where they are. + + reassign : typing.Optional[UpdateSchedulingOutOfOfficeRequestReassign] + With `existing_bookings: reassign`: who they go to. Default: the fairest who's free. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AsyncHttpResponse[SchedulingOutOfOffice] + The entry. + """ + _response = await self._client_wrapper.httpx_client.request( + f"v1/scheduling/out_of_office/{encode_path_param(id)}", + method="PATCH", + json={ + "start": start, + "end": end, + "start_date": start_date, + "end_date": end_date, + "time_zone": time_zone, + "reason": reason, + "notes": notes, + "public_message": public_message, + "show_on_calendar": show_on_calendar, + "delegates": delegates, + "existing_bookings": existing_bookings, + "reassign": convert_and_respect_annotation_metadata( + object_=reassign, annotation=UpdateSchedulingOutOfOfficeRequestReassign, direction="write" + ), + }, + headers={ + "content-type": "application/json", + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + SchedulingOutOfOffice, + parse_obj_as( + type_=SchedulingOutOfOffice, # type: ignore + object_=_response.json(), + ), + ) + return AsyncHttpResponse(response=_response, data=_data) + if _response.status_code == 400: + raise BadRequestError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 401: + raise UnauthorizedError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 403: + raise ForbiddenError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 404: + raise NotFoundError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 415: + raise UnsupportedMediaTypeError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 422: + raise UnprocessableEntityError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 429: + raise TooManyRequestsError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 500: + raise InternalServerError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 503: + raise ServiceUnavailableError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) + except ValidationError as e: + raise ParsingError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e + ) + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + + async def put( + self, + external_id: str, + *, + host: str, + start: typing.Optional[str] = OMIT, + end: typing.Optional[str] = OMIT, + start_date: typing.Optional[str] = OMIT, + end_date: typing.Optional[str] = OMIT, + time_zone: typing.Optional[str] = OMIT, + delegates: typing.Optional[typing.Sequence[str]] = OMIT, + reason: typing.Optional[str] = OMIT, + notes: typing.Optional[str] = OMIT, + public_message: typing.Optional[str] = OMIT, + show_on_calendar: typing.Optional[bool] = OMIT, + existing_bookings: typing.Optional[PutSchedulingOutOfOfficeRequestExistingBookings] = OMIT, + reassign: typing.Optional[PutSchedulingOutOfOfficeRequestReassign] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> AsyncHttpResponse[SchedulingOutOfOffice]: + """ + For syncing from a system of record such as an HR tool: send what it says, as often as you like, and there's one entry for it. Give every field you want to keep. + + Parameters + ---------- + external_id : str + Your own id for the entry. + + host : str + The host, by id or uid. + + start : typing.Optional[str] + An ISO 8601 instant with an offset. + + end : typing.Optional[str] + An ISO 8601 instant with an offset. + + start_date : typing.Optional[str] + The first whole day away. Use instead of `start` and `end`. + + end_date : typing.Optional[str] + The last whole day away, which is included. + + time_zone : typing.Optional[str] + What the dates mean in. Default: the host's zone when this is made. + + delegates : typing.Optional[typing.Sequence[str]] + Who can be booked in this host's place during it, by id or uid, in the order to try them. They still have to fit how a booking's routed. + + reason : typing.Optional[str] + One of `unspecified`, `vacation`, `travel`, `sick`, `public_holiday`, `parental_leave`, `training` and `other`, or a key from the settings' `out_of_office_reasons`. Only people who manage this host see it: never bookers, webhooks or calendars. + + notes : typing.Optional[str] + For people who manage this host. Encrypted, and never shown to a booker. + + public_message : typing.Optional[str] + Shown to bookers while this host is away. Can't contain a link. + + show_on_calendar : typing.Optional[bool] + Put a private "Out of office" event on the host's calendar. Default: true. + + existing_bookings : typing.Optional[PutSchedulingOutOfOfficeRequestExistingBookings] + What happens to bookings already in the way. `leave` (the default) only reports them. `reassign` moves them, and any nobody can take stay where they are. + + reassign : typing.Optional[PutSchedulingOutOfOfficeRequestReassign] + With `existing_bookings: reassign`: who they go to. Default: the fairest who's free. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AsyncHttpResponse[SchedulingOutOfOffice] + The entry, replaced. + """ + _response = await self._client_wrapper.httpx_client.request( + f"v1/scheduling/out_of_office/by_external_id/{encode_path_param(external_id)}", + method="PUT", + json={ + "host": host, + "start": start, + "end": end, + "start_date": start_date, + "end_date": end_date, + "time_zone": time_zone, + "delegates": delegates, + "reason": reason, + "notes": notes, + "public_message": public_message, + "show_on_calendar": show_on_calendar, + "existing_bookings": existing_bookings, + "reassign": convert_and_respect_annotation_metadata( + object_=reassign, annotation=PutSchedulingOutOfOfficeRequestReassign, direction="write" + ), + }, + headers={ + "content-type": "application/json", + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + SchedulingOutOfOffice, + parse_obj_as( + type_=SchedulingOutOfOffice, # type: ignore + object_=_response.json(), + ), + ) + return AsyncHttpResponse(response=_response, data=_data) + if _response.status_code == 400: + raise BadRequestError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 401: + raise UnauthorizedError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 403: + raise ForbiddenError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 404: + raise NotFoundError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 415: + raise UnsupportedMediaTypeError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 422: + raise UnprocessableEntityError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 429: + raise TooManyRequestsError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 500: + raise InternalServerError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 503: + raise ServiceUnavailableError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) + except ValidationError as e: + raise ParsingError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e + ) + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + + async def conflicts( + self, id: str, *, limit: typing.Optional[int] = None, request_options: typing.Optional[RequestOptions] = None + ) -> AsyncHttpResponse[SchedulingOutOfOfficeConflictList]: + """ + Live bookings of the host that fall in the entry, soonest first. Entries never change them. + + Parameters + ---------- + id : str + The entry's id. + + limit : typing.Optional[int] + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AsyncHttpResponse[SchedulingOutOfOfficeConflictList] + The bookings. + """ + _response = await self._client_wrapper.httpx_client.request( + f"v1/scheduling/out_of_office/{encode_path_param(id)}/conflicts", + method="GET", + params={ + "limit": limit, + }, + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + SchedulingOutOfOfficeConflictList, + parse_obj_as( + type_=SchedulingOutOfOfficeConflictList, # type: ignore + object_=_response.json(), + ), + ) + return AsyncHttpResponse(response=_response, data=_data) + if _response.status_code == 400: + raise BadRequestError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 401: + raise UnauthorizedError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 403: + raise ForbiddenError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 404: + raise NotFoundError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 422: + raise UnprocessableEntityError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 429: + raise TooManyRequestsError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 500: + raise InternalServerError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 503: + raise ServiceUnavailableError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) + except ValidationError as e: + raise ParsingError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e + ) + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) diff --git a/sdks/python/src/coss/resources/scheduling/resources/out_of_office/types/__init__.py b/sdks/python/src/coss/resources/scheduling/resources/out_of_office/types/__init__.py new file mode 100644 index 000000000..a71ee824c --- /dev/null +++ b/sdks/python/src/coss/resources/scheduling/resources/out_of_office/types/__init__.py @@ -0,0 +1,77 @@ +# This file was auto-generated by Fern from our API Definition. + +# isort: skip_file + +import typing +from importlib import import_module + +if typing.TYPE_CHECKING: + from .create_scheduling_out_of_office_request_existing_bookings import ( + CreateSchedulingOutOfOfficeRequestExistingBookings, + ) + from .create_scheduling_out_of_office_request_host_filter_value import ( + CreateSchedulingOutOfOfficeRequestHostFilterValue, + ) + from .create_scheduling_out_of_office_request_reassign import CreateSchedulingOutOfOfficeRequestReassign + from .create_scheduling_out_of_office_request_reassign_otherwise import ( + CreateSchedulingOutOfOfficeRequestReassignOtherwise, + ) + from .put_scheduling_out_of_office_request_existing_bookings import PutSchedulingOutOfOfficeRequestExistingBookings + from .put_scheduling_out_of_office_request_reassign import PutSchedulingOutOfOfficeRequestReassign + from .put_scheduling_out_of_office_request_reassign_otherwise import ( + PutSchedulingOutOfOfficeRequestReassignOtherwise, + ) + from .update_scheduling_out_of_office_request_existing_bookings import ( + UpdateSchedulingOutOfOfficeRequestExistingBookings, + ) + from .update_scheduling_out_of_office_request_reassign import UpdateSchedulingOutOfOfficeRequestReassign + from .update_scheduling_out_of_office_request_reassign_otherwise import ( + UpdateSchedulingOutOfOfficeRequestReassignOtherwise, + ) +_dynamic_imports: typing.Dict[str, str] = { + "CreateSchedulingOutOfOfficeRequestExistingBookings": ".create_scheduling_out_of_office_request_existing_bookings", + "CreateSchedulingOutOfOfficeRequestHostFilterValue": ".create_scheduling_out_of_office_request_host_filter_value", + "CreateSchedulingOutOfOfficeRequestReassign": ".create_scheduling_out_of_office_request_reassign", + "CreateSchedulingOutOfOfficeRequestReassignOtherwise": ".create_scheduling_out_of_office_request_reassign_otherwise", + "PutSchedulingOutOfOfficeRequestExistingBookings": ".put_scheduling_out_of_office_request_existing_bookings", + "PutSchedulingOutOfOfficeRequestReassign": ".put_scheduling_out_of_office_request_reassign", + "PutSchedulingOutOfOfficeRequestReassignOtherwise": ".put_scheduling_out_of_office_request_reassign_otherwise", + "UpdateSchedulingOutOfOfficeRequestExistingBookings": ".update_scheduling_out_of_office_request_existing_bookings", + "UpdateSchedulingOutOfOfficeRequestReassign": ".update_scheduling_out_of_office_request_reassign", + "UpdateSchedulingOutOfOfficeRequestReassignOtherwise": ".update_scheduling_out_of_office_request_reassign_otherwise", +} + + +def __getattr__(attr_name: str) -> typing.Any: + module_name = _dynamic_imports.get(attr_name) + if module_name is None: + raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") + try: + module = import_module(module_name, __package__) + if module_name == f".{attr_name}": + return module + else: + return getattr(module, attr_name) + except ImportError as e: + raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e + except AttributeError as e: + raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e + + +def __dir__(): + lazy_attrs = list(_dynamic_imports.keys()) + return sorted(lazy_attrs) + + +__all__ = [ + "CreateSchedulingOutOfOfficeRequestExistingBookings", + "CreateSchedulingOutOfOfficeRequestHostFilterValue", + "CreateSchedulingOutOfOfficeRequestReassign", + "CreateSchedulingOutOfOfficeRequestReassignOtherwise", + "PutSchedulingOutOfOfficeRequestExistingBookings", + "PutSchedulingOutOfOfficeRequestReassign", + "PutSchedulingOutOfOfficeRequestReassignOtherwise", + "UpdateSchedulingOutOfOfficeRequestExistingBookings", + "UpdateSchedulingOutOfOfficeRequestReassign", + "UpdateSchedulingOutOfOfficeRequestReassignOtherwise", +] diff --git a/sdks/python/src/coss/resources/scheduling/resources/out_of_office/types/create_scheduling_out_of_office_request_existing_bookings.py b/sdks/python/src/coss/resources/scheduling/resources/out_of_office/types/create_scheduling_out_of_office_request_existing_bookings.py new file mode 100644 index 000000000..860bffeb0 --- /dev/null +++ b/sdks/python/src/coss/resources/scheduling/resources/out_of_office/types/create_scheduling_out_of_office_request_existing_bookings.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +CreateSchedulingOutOfOfficeRequestExistingBookings = typing.Union[typing.Literal["leave", "reassign"], typing.Any] diff --git a/sdks/python/src/coss/resources/scheduling/resources/out_of_office/types/create_scheduling_out_of_office_request_host_filter_value.py b/sdks/python/src/coss/resources/scheduling/resources/out_of_office/types/create_scheduling_out_of_office_request_host_filter_value.py new file mode 100644 index 000000000..b9efdfbd7 --- /dev/null +++ b/sdks/python/src/coss/resources/scheduling/resources/out_of_office/types/create_scheduling_out_of_office_request_host_filter_value.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +CreateSchedulingOutOfOfficeRequestHostFilterValue = typing.Union[str, typing.List[str]] diff --git a/sdks/python/src/coss/resources/scheduling/resources/out_of_office/types/create_scheduling_out_of_office_request_reassign.py b/sdks/python/src/coss/resources/scheduling/resources/out_of_office/types/create_scheduling_out_of_office_request_reassign.py new file mode 100644 index 000000000..b9e6d27da --- /dev/null +++ b/sdks/python/src/coss/resources/scheduling/resources/out_of_office/types/create_scheduling_out_of_office_request_reassign.py @@ -0,0 +1,39 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ......core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from .create_scheduling_out_of_office_request_reassign_otherwise import ( + CreateSchedulingOutOfOfficeRequestReassignOtherwise, +) + + +class CreateSchedulingOutOfOfficeRequestReassign(UniversalBaseModel): + """ + With `existing_bookings: reassign`: who they go to. Default: the fairest who's free. + """ + + to_host: typing.Optional[str] = pydantic.Field(default=None) + """ + Give them all to this host. + """ + + preferred_hosts: typing.Optional[typing.List[str]] = pydantic.Field(default=None) + """ + Try these first, in order. + """ + + otherwise: typing.Optional[CreateSchedulingOutOfOfficeRequestReassignOtherwise] = pydantic.Field(default=None) + """ + After `preferred_hosts`: `auto` picks the fairest who's free (the default), `leave` keeps it where it is. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/sdks/python/src/coss/resources/scheduling/resources/out_of_office/types/create_scheduling_out_of_office_request_reassign_otherwise.py b/sdks/python/src/coss/resources/scheduling/resources/out_of_office/types/create_scheduling_out_of_office_request_reassign_otherwise.py new file mode 100644 index 000000000..a2f8bc684 --- /dev/null +++ b/sdks/python/src/coss/resources/scheduling/resources/out_of_office/types/create_scheduling_out_of_office_request_reassign_otherwise.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +CreateSchedulingOutOfOfficeRequestReassignOtherwise = typing.Union[typing.Literal["auto", "leave"], typing.Any] diff --git a/sdks/python/src/coss/resources/scheduling/resources/out_of_office/types/put_scheduling_out_of_office_request_existing_bookings.py b/sdks/python/src/coss/resources/scheduling/resources/out_of_office/types/put_scheduling_out_of_office_request_existing_bookings.py new file mode 100644 index 000000000..d3e4dd063 --- /dev/null +++ b/sdks/python/src/coss/resources/scheduling/resources/out_of_office/types/put_scheduling_out_of_office_request_existing_bookings.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +PutSchedulingOutOfOfficeRequestExistingBookings = typing.Union[typing.Literal["leave", "reassign"], typing.Any] diff --git a/sdks/python/src/coss/resources/scheduling/resources/out_of_office/types/put_scheduling_out_of_office_request_reassign.py b/sdks/python/src/coss/resources/scheduling/resources/out_of_office/types/put_scheduling_out_of_office_request_reassign.py new file mode 100644 index 000000000..a46e38c11 --- /dev/null +++ b/sdks/python/src/coss/resources/scheduling/resources/out_of_office/types/put_scheduling_out_of_office_request_reassign.py @@ -0,0 +1,37 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ......core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from .put_scheduling_out_of_office_request_reassign_otherwise import PutSchedulingOutOfOfficeRequestReassignOtherwise + + +class PutSchedulingOutOfOfficeRequestReassign(UniversalBaseModel): + """ + With `existing_bookings: reassign`: who they go to. Default: the fairest who's free. + """ + + to_host: typing.Optional[str] = pydantic.Field(default=None) + """ + Give them all to this host. + """ + + preferred_hosts: typing.Optional[typing.List[str]] = pydantic.Field(default=None) + """ + Try these first, in order. + """ + + otherwise: typing.Optional[PutSchedulingOutOfOfficeRequestReassignOtherwise] = pydantic.Field(default=None) + """ + After `preferred_hosts`: `auto` picks the fairest who's free (the default), `leave` keeps it where it is. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/sdks/python/src/coss/resources/scheduling/resources/out_of_office/types/put_scheduling_out_of_office_request_reassign_otherwise.py b/sdks/python/src/coss/resources/scheduling/resources/out_of_office/types/put_scheduling_out_of_office_request_reassign_otherwise.py new file mode 100644 index 000000000..4fc59a41c --- /dev/null +++ b/sdks/python/src/coss/resources/scheduling/resources/out_of_office/types/put_scheduling_out_of_office_request_reassign_otherwise.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +PutSchedulingOutOfOfficeRequestReassignOtherwise = typing.Union[typing.Literal["auto", "leave"], typing.Any] diff --git a/sdks/python/src/coss/resources/scheduling/resources/out_of_office/types/update_scheduling_out_of_office_request_existing_bookings.py b/sdks/python/src/coss/resources/scheduling/resources/out_of_office/types/update_scheduling_out_of_office_request_existing_bookings.py new file mode 100644 index 000000000..f16bbb827 --- /dev/null +++ b/sdks/python/src/coss/resources/scheduling/resources/out_of_office/types/update_scheduling_out_of_office_request_existing_bookings.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +UpdateSchedulingOutOfOfficeRequestExistingBookings = typing.Union[typing.Literal["leave", "reassign"], typing.Any] diff --git a/sdks/python/src/coss/resources/scheduling/resources/out_of_office/types/update_scheduling_out_of_office_request_reassign.py b/sdks/python/src/coss/resources/scheduling/resources/out_of_office/types/update_scheduling_out_of_office_request_reassign.py new file mode 100644 index 000000000..291ab5fe7 --- /dev/null +++ b/sdks/python/src/coss/resources/scheduling/resources/out_of_office/types/update_scheduling_out_of_office_request_reassign.py @@ -0,0 +1,39 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ......core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from .update_scheduling_out_of_office_request_reassign_otherwise import ( + UpdateSchedulingOutOfOfficeRequestReassignOtherwise, +) + + +class UpdateSchedulingOutOfOfficeRequestReassign(UniversalBaseModel): + """ + With `existing_bookings: reassign`: who they go to. Default: the fairest who's free. + """ + + to_host: typing.Optional[str] = pydantic.Field(default=None) + """ + Give them all to this host. + """ + + preferred_hosts: typing.Optional[typing.List[str]] = pydantic.Field(default=None) + """ + Try these first, in order. + """ + + otherwise: typing.Optional[UpdateSchedulingOutOfOfficeRequestReassignOtherwise] = pydantic.Field(default=None) + """ + After `preferred_hosts`: `auto` picks the fairest who's free (the default), `leave` keeps it where it is. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/sdks/python/src/coss/resources/scheduling/resources/out_of_office/types/update_scheduling_out_of_office_request_reassign_otherwise.py b/sdks/python/src/coss/resources/scheduling/resources/out_of_office/types/update_scheduling_out_of_office_request_reassign_otherwise.py new file mode 100644 index 000000000..d1b45c5c5 --- /dev/null +++ b/sdks/python/src/coss/resources/scheduling/resources/out_of_office/types/update_scheduling_out_of_office_request_reassign_otherwise.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +UpdateSchedulingOutOfOfficeRequestReassignOtherwise = typing.Union[typing.Literal["auto", "leave"], typing.Any] diff --git a/sdks/python/src/coss/resources/scheduling/resources/reassignments/__init__.py b/sdks/python/src/coss/resources/scheduling/resources/reassignments/__init__.py new file mode 100644 index 000000000..cfb3f425a --- /dev/null +++ b/sdks/python/src/coss/resources/scheduling/resources/reassignments/__init__.py @@ -0,0 +1,64 @@ +# This file was auto-generated by Fern from our API Definition. + +# isort: skip_file + +import typing +from importlib import import_module + +if typing.TYPE_CHECKING: + from .types import ( + CreateSchedulingReassignmentRequestNotify, + CreateSchedulingReassignmentRequestNotifyHosts, + CreateSchedulingReassignmentRequestOverridesItem, + CreateSchedulingReassignmentRequestReasonCode, + PreviewSchedulingReassignmentRequestOverridesItem, + UndoSchedulingReassignmentRequestNotify, + UndoSchedulingReassignmentRequestNotifyHosts, + UndoSchedulingReassignmentRequestOverridesItem, + UndoSchedulingReassignmentRequestReasonCode, + ) +_dynamic_imports: typing.Dict[str, str] = { + "CreateSchedulingReassignmentRequestNotify": ".types", + "CreateSchedulingReassignmentRequestNotifyHosts": ".types", + "CreateSchedulingReassignmentRequestOverridesItem": ".types", + "CreateSchedulingReassignmentRequestReasonCode": ".types", + "PreviewSchedulingReassignmentRequestOverridesItem": ".types", + "UndoSchedulingReassignmentRequestNotify": ".types", + "UndoSchedulingReassignmentRequestNotifyHosts": ".types", + "UndoSchedulingReassignmentRequestOverridesItem": ".types", + "UndoSchedulingReassignmentRequestReasonCode": ".types", +} + + +def __getattr__(attr_name: str) -> typing.Any: + module_name = _dynamic_imports.get(attr_name) + if module_name is None: + raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") + try: + module = import_module(module_name, __package__) + if module_name == f".{attr_name}": + return module + else: + return getattr(module, attr_name) + except ImportError as e: + raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e + except AttributeError as e: + raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e + + +def __dir__(): + lazy_attrs = list(_dynamic_imports.keys()) + return sorted(lazy_attrs) + + +__all__ = [ + "CreateSchedulingReassignmentRequestNotify", + "CreateSchedulingReassignmentRequestNotifyHosts", + "CreateSchedulingReassignmentRequestOverridesItem", + "CreateSchedulingReassignmentRequestReasonCode", + "PreviewSchedulingReassignmentRequestOverridesItem", + "UndoSchedulingReassignmentRequestNotify", + "UndoSchedulingReassignmentRequestNotifyHosts", + "UndoSchedulingReassignmentRequestOverridesItem", + "UndoSchedulingReassignmentRequestReasonCode", +] diff --git a/sdks/python/src/coss/resources/scheduling/resources/reassignments/client.py b/sdks/python/src/coss/resources/scheduling/resources/reassignments/client.py new file mode 100644 index 000000000..4d25e7985 --- /dev/null +++ b/sdks/python/src/coss/resources/scheduling/resources/reassignments/client.py @@ -0,0 +1,773 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper +from .....core.request_options import RequestOptions +from .....types.scheduling_reassignment import SchedulingReassignment +from .....types.scheduling_reassignment_item_list import SchedulingReassignmentItemList +from .....types.scheduling_reassignment_list import SchedulingReassignmentList +from .....types.scheduling_reassignment_preview import SchedulingReassignmentPreview +from .....types.scheduling_reassignment_selection import SchedulingReassignmentSelection +from .....types.scheduling_reassignment_strategy import SchedulingReassignmentStrategy +from .raw_client import AsyncRawReassignmentsClient, RawReassignmentsClient +from .types.create_scheduling_reassignment_request_notify import CreateSchedulingReassignmentRequestNotify +from .types.create_scheduling_reassignment_request_overrides_item import ( + CreateSchedulingReassignmentRequestOverridesItem, +) +from .types.create_scheduling_reassignment_request_reason_code import CreateSchedulingReassignmentRequestReasonCode +from .types.preview_scheduling_reassignment_request_overrides_item import ( + PreviewSchedulingReassignmentRequestOverridesItem, +) +from .types.undo_scheduling_reassignment_request_notify import UndoSchedulingReassignmentRequestNotify +from .types.undo_scheduling_reassignment_request_overrides_item import UndoSchedulingReassignmentRequestOverridesItem +from .types.undo_scheduling_reassignment_request_reason_code import UndoSchedulingReassignmentRequestReasonCode + +# this is used as the default value for optional parameters +OMIT = typing.cast(typing.Any, ...) + + +class ReassignmentsClient: + def __init__(self, *, client_wrapper: SyncClientWrapper): + self._raw_client = RawReassignmentsClient(client_wrapper=client_wrapper) + + @property + def with_raw_response(self) -> RawReassignmentsClient: + """ + Retrieves a raw implementation of this client that returns raw responses. + + Returns + ------- + RawReassignmentsClient + """ + return self._raw_client + + def preview( + self, + *, + selection: SchedulingReassignmentSelection, + strategy: typing.Optional[SchedulingReassignmentStrategy] = OMIT, + overrides: typing.Optional[typing.Sequence[PreviewSchedulingReassignmentRequestOverridesItem]] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> SchedulingReassignmentPreview: + """ + Who each booking would go to, and why not when nobody can take it, without moving anything. It works down them in order, so two can't both be promised the same free hour. Change any of it and start the run with `assignments`. Covers the first 500. Things can change before you start it: the run decides again. + + Parameters + ---------- + selection : SchedulingReassignmentSelection + + strategy : typing.Optional[SchedulingReassignmentStrategy] + + overrides : typing.Optional[typing.Sequence[PreviewSchedulingReassignmentRequestOverridesItem]] + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + SchedulingReassignmentPreview + What would happen. + + Examples + -------- + from coss import ( + Coss, + SchedulingReassignmentSelection, + SchedulingReassignmentStrategy, + ) + + client = Coss( + "2026-10-10", + api_key="YOUR_API_KEY", + ) + client.scheduling.reassignments.preview( + selection=SchedulingReassignmentSelection( + host="doctor_482", + start_before="2027-08-14T00:00:00.000Z", + ), + strategy=SchedulingReassignmentStrategy( + preferred_hosts=["doctor_518"], + ), + ) + """ + _response = self._raw_client.preview( + selection=selection, strategy=strategy, overrides=overrides, request_options=request_options + ) + return _response.data + + def list( + self, + *, + limit: typing.Optional[int] = None, + after: typing.Optional[str] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> SchedulingReassignmentList: + """ + Newest first, with how each is going. + + Parameters + ---------- + limit : typing.Optional[int] + + after : typing.Optional[str] + The last id of the previous page. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + SchedulingReassignmentList + The runs. + + Examples + -------- + from coss import Coss + + client = Coss( + "2026-10-10", + api_key="YOUR_API_KEY", + ) + client.scheduling.reassignments.list() + """ + _response = self._raw_client.list(limit=limit, after=after, request_options=request_options) + return _response.data + + def create( + self, + *, + selection: SchedulingReassignmentSelection, + reason_code: CreateSchedulingReassignmentRequestReasonCode, + idempotency_key: typing.Optional[str] = None, + strategy: typing.Optional[SchedulingReassignmentStrategy] = OMIT, + note: typing.Optional[str] = OMIT, + overrides: typing.Optional[typing.Sequence[CreateSchedulingReassignmentRequestOverridesItem]] = OMIT, + notify: typing.Optional[CreateSchedulingReassignmentRequestNotify] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> SchedulingReassignment: + """ + Moves up to 5,000 bookings in the background, each on its own, so one that can't move never holds up the rest. Nothing's ever cancelled: a booking nobody can take stays where it is, and its item says so. It answers at once: follow the run by its id, or wait for `scheduling.reassignment.completed`. + + Parameters + ---------- + selection : SchedulingReassignmentSelection + + reason_code : CreateSchedulingReassignmentRequestReasonCode + + idempotency_key : typing.Optional[str] + Makes retries safe: a repeated request with the same key and body returns the original run instead of starting another, for 24 hours. 1-256 characters. + + strategy : typing.Optional[SchedulingReassignmentStrategy] + + note : typing.Optional[str] + Why, in your words: required with an override of someone's availability. + + overrides : typing.Optional[typing.Sequence[CreateSchedulingReassignmentRequestOverridesItem]] + + notify : typing.Optional[CreateSchedulingReassignmentRequestNotify] + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + SchedulingReassignment + The run, waiting to start. + + Examples + -------- + from coss import ( + Coss, + SchedulingReassignmentSelection, + SchedulingReassignmentStrategy, + ) + + client = Coss( + "2026-10-10", + api_key="YOUR_API_KEY", + ) + client.scheduling.reassignments.create( + idempotency_key="welcome-user-123", + selection=SchedulingReassignmentSelection( + out_of_office="ooo_01kd2m9a0b1c2d3e4f5g6h7j8m", + ), + strategy=SchedulingReassignmentStrategy( + preferred_hosts=["doctor_518"], + ), + reason_code="out_of_office", + ) + """ + _response = self._raw_client.create( + selection=selection, + reason_code=reason_code, + idempotency_key=idempotency_key, + strategy=strategy, + note=note, + overrides=overrides, + notify=notify, + request_options=request_options, + ) + return _response.data + + def get(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> SchedulingReassignment: + """ + How it's going. + + Parameters + ---------- + id : str + The reassignment's id. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + SchedulingReassignment + The run. + + Examples + -------- + from coss import Coss + + client = Coss( + "2026-10-10", + api_key="YOUR_API_KEY", + ) + client.scheduling.reassignments.get( + id="id", + ) + """ + _response = self._raw_client.get(id, request_options=request_options) + return _response.data + + def items( + self, + id: str, + *, + limit: typing.Optional[int] = None, + after: typing.Optional[str] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> SchedulingReassignmentItemList: + """ + Each booking it covers and what happened to it. A group session has one, for one of its seats. Empty until the worker's started on it. + + Parameters + ---------- + id : str + The reassignment's id. + + limit : typing.Optional[int] + + after : typing.Optional[str] + The last id of the previous page. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + SchedulingReassignmentItemList + The items. + + Examples + -------- + from coss import Coss + + client = Coss( + "2026-10-10", + api_key="YOUR_API_KEY", + ) + client.scheduling.reassignments.items( + id="id", + ) + """ + _response = self._raw_client.items(id, limit=limit, after=after, request_options=request_options) + return _response.data + + def cancel(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> SchedulingReassignment: + """ + Stops what hasn't happened yet. What's moved stays moved: undo it for that. Cancelling one that's finished changes nothing. + + Parameters + ---------- + id : str + The reassignment's id. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + SchedulingReassignment + The run. + + Examples + -------- + from coss import Coss + + client = Coss( + "2026-10-10", + api_key="YOUR_API_KEY", + ) + client.scheduling.reassignments.cancel( + id="id", + ) + """ + _response = self._raw_client.cancel(id, request_options=request_options) + return _response.data + + def undo( + self, + id: str, + *, + reason_code: typing.Optional[UndoSchedulingReassignmentRequestReasonCode] = OMIT, + note: typing.Optional[str] = OMIT, + overrides: typing.Optional[typing.Sequence[UndoSchedulingReassignmentRequestOverridesItem]] = OMIT, + notify: typing.Optional[UndoSchedulingReassignmentRequestNotify] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> SchedulingReassignment: + """ + Gives back what a finished run moved, as a new run. A booking that's moved on since stays where it went, and a former host who's no longer free keeps it from going back, unless you pass `overrides`. + + Parameters + ---------- + id : str + The reassignment's id. + + reason_code : typing.Optional[UndoSchedulingReassignmentRequestReasonCode] + + note : typing.Optional[str] + + overrides : typing.Optional[typing.Sequence[UndoSchedulingReassignmentRequestOverridesItem]] + + notify : typing.Optional[UndoSchedulingReassignmentRequestNotify] + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + SchedulingReassignment + The new run. + + Examples + -------- + from coss import Coss + + client = Coss( + "2026-10-10", + api_key="YOUR_API_KEY", + ) + client.scheduling.reassignments.undo( + id="id", + reason_code="other", + ) + """ + _response = self._raw_client.undo( + id, reason_code=reason_code, note=note, overrides=overrides, notify=notify, request_options=request_options + ) + return _response.data + + +class AsyncReassignmentsClient: + def __init__(self, *, client_wrapper: AsyncClientWrapper): + self._raw_client = AsyncRawReassignmentsClient(client_wrapper=client_wrapper) + + @property + def with_raw_response(self) -> AsyncRawReassignmentsClient: + """ + Retrieves a raw implementation of this client that returns raw responses. + + Returns + ------- + AsyncRawReassignmentsClient + """ + return self._raw_client + + async def preview( + self, + *, + selection: SchedulingReassignmentSelection, + strategy: typing.Optional[SchedulingReassignmentStrategy] = OMIT, + overrides: typing.Optional[typing.Sequence[PreviewSchedulingReassignmentRequestOverridesItem]] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> SchedulingReassignmentPreview: + """ + Who each booking would go to, and why not when nobody can take it, without moving anything. It works down them in order, so two can't both be promised the same free hour. Change any of it and start the run with `assignments`. Covers the first 500. Things can change before you start it: the run decides again. + + Parameters + ---------- + selection : SchedulingReassignmentSelection + + strategy : typing.Optional[SchedulingReassignmentStrategy] + + overrides : typing.Optional[typing.Sequence[PreviewSchedulingReassignmentRequestOverridesItem]] + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + SchedulingReassignmentPreview + What would happen. + + Examples + -------- + import asyncio + + from coss import ( + AsyncCoss, + SchedulingReassignmentSelection, + SchedulingReassignmentStrategy, + ) + + client = AsyncCoss( + "2026-10-10", + api_key="YOUR_API_KEY", + ) + + + async def main() -> None: + await client.scheduling.reassignments.preview( + selection=SchedulingReassignmentSelection( + host="doctor_482", + start_before="2027-08-14T00:00:00.000Z", + ), + strategy=SchedulingReassignmentStrategy( + preferred_hosts=["doctor_518"], + ), + ) + + + asyncio.run(main()) + """ + _response = await self._raw_client.preview( + selection=selection, strategy=strategy, overrides=overrides, request_options=request_options + ) + return _response.data + + async def list( + self, + *, + limit: typing.Optional[int] = None, + after: typing.Optional[str] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> SchedulingReassignmentList: + """ + Newest first, with how each is going. + + Parameters + ---------- + limit : typing.Optional[int] + + after : typing.Optional[str] + The last id of the previous page. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + SchedulingReassignmentList + The runs. + + Examples + -------- + import asyncio + + from coss import AsyncCoss + + client = AsyncCoss( + "2026-10-10", + api_key="YOUR_API_KEY", + ) + + + async def main() -> None: + await client.scheduling.reassignments.list() + + + asyncio.run(main()) + """ + _response = await self._raw_client.list(limit=limit, after=after, request_options=request_options) + return _response.data + + async def create( + self, + *, + selection: SchedulingReassignmentSelection, + reason_code: CreateSchedulingReassignmentRequestReasonCode, + idempotency_key: typing.Optional[str] = None, + strategy: typing.Optional[SchedulingReassignmentStrategy] = OMIT, + note: typing.Optional[str] = OMIT, + overrides: typing.Optional[typing.Sequence[CreateSchedulingReassignmentRequestOverridesItem]] = OMIT, + notify: typing.Optional[CreateSchedulingReassignmentRequestNotify] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> SchedulingReassignment: + """ + Moves up to 5,000 bookings in the background, each on its own, so one that can't move never holds up the rest. Nothing's ever cancelled: a booking nobody can take stays where it is, and its item says so. It answers at once: follow the run by its id, or wait for `scheduling.reassignment.completed`. + + Parameters + ---------- + selection : SchedulingReassignmentSelection + + reason_code : CreateSchedulingReassignmentRequestReasonCode + + idempotency_key : typing.Optional[str] + Makes retries safe: a repeated request with the same key and body returns the original run instead of starting another, for 24 hours. 1-256 characters. + + strategy : typing.Optional[SchedulingReassignmentStrategy] + + note : typing.Optional[str] + Why, in your words: required with an override of someone's availability. + + overrides : typing.Optional[typing.Sequence[CreateSchedulingReassignmentRequestOverridesItem]] + + notify : typing.Optional[CreateSchedulingReassignmentRequestNotify] + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + SchedulingReassignment + The run, waiting to start. + + Examples + -------- + import asyncio + + from coss import ( + AsyncCoss, + SchedulingReassignmentSelection, + SchedulingReassignmentStrategy, + ) + + client = AsyncCoss( + "2026-10-10", + api_key="YOUR_API_KEY", + ) + + + async def main() -> None: + await client.scheduling.reassignments.create( + idempotency_key="welcome-user-123", + selection=SchedulingReassignmentSelection( + out_of_office="ooo_01kd2m9a0b1c2d3e4f5g6h7j8m", + ), + strategy=SchedulingReassignmentStrategy( + preferred_hosts=["doctor_518"], + ), + reason_code="out_of_office", + ) + + + asyncio.run(main()) + """ + _response = await self._raw_client.create( + selection=selection, + reason_code=reason_code, + idempotency_key=idempotency_key, + strategy=strategy, + note=note, + overrides=overrides, + notify=notify, + request_options=request_options, + ) + return _response.data + + async def get(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> SchedulingReassignment: + """ + How it's going. + + Parameters + ---------- + id : str + The reassignment's id. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + SchedulingReassignment + The run. + + Examples + -------- + import asyncio + + from coss import AsyncCoss + + client = AsyncCoss( + "2026-10-10", + api_key="YOUR_API_KEY", + ) + + + async def main() -> None: + await client.scheduling.reassignments.get( + id="id", + ) + + + asyncio.run(main()) + """ + _response = await self._raw_client.get(id, request_options=request_options) + return _response.data + + async def items( + self, + id: str, + *, + limit: typing.Optional[int] = None, + after: typing.Optional[str] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> SchedulingReassignmentItemList: + """ + Each booking it covers and what happened to it. A group session has one, for one of its seats. Empty until the worker's started on it. + + Parameters + ---------- + id : str + The reassignment's id. + + limit : typing.Optional[int] + + after : typing.Optional[str] + The last id of the previous page. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + SchedulingReassignmentItemList + The items. + + Examples + -------- + import asyncio + + from coss import AsyncCoss + + client = AsyncCoss( + "2026-10-10", + api_key="YOUR_API_KEY", + ) + + + async def main() -> None: + await client.scheduling.reassignments.items( + id="id", + ) + + + asyncio.run(main()) + """ + _response = await self._raw_client.items(id, limit=limit, after=after, request_options=request_options) + return _response.data + + async def cancel( + self, id: str, *, request_options: typing.Optional[RequestOptions] = None + ) -> SchedulingReassignment: + """ + Stops what hasn't happened yet. What's moved stays moved: undo it for that. Cancelling one that's finished changes nothing. + + Parameters + ---------- + id : str + The reassignment's id. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + SchedulingReassignment + The run. + + Examples + -------- + import asyncio + + from coss import AsyncCoss + + client = AsyncCoss( + "2026-10-10", + api_key="YOUR_API_KEY", + ) + + + async def main() -> None: + await client.scheduling.reassignments.cancel( + id="id", + ) + + + asyncio.run(main()) + """ + _response = await self._raw_client.cancel(id, request_options=request_options) + return _response.data + + async def undo( + self, + id: str, + *, + reason_code: typing.Optional[UndoSchedulingReassignmentRequestReasonCode] = OMIT, + note: typing.Optional[str] = OMIT, + overrides: typing.Optional[typing.Sequence[UndoSchedulingReassignmentRequestOverridesItem]] = OMIT, + notify: typing.Optional[UndoSchedulingReassignmentRequestNotify] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> SchedulingReassignment: + """ + Gives back what a finished run moved, as a new run. A booking that's moved on since stays where it went, and a former host who's no longer free keeps it from going back, unless you pass `overrides`. + + Parameters + ---------- + id : str + The reassignment's id. + + reason_code : typing.Optional[UndoSchedulingReassignmentRequestReasonCode] + + note : typing.Optional[str] + + overrides : typing.Optional[typing.Sequence[UndoSchedulingReassignmentRequestOverridesItem]] + + notify : typing.Optional[UndoSchedulingReassignmentRequestNotify] + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + SchedulingReassignment + The new run. + + Examples + -------- + import asyncio + + from coss import AsyncCoss + + client = AsyncCoss( + "2026-10-10", + api_key="YOUR_API_KEY", + ) + + + async def main() -> None: + await client.scheduling.reassignments.undo( + id="id", + reason_code="other", + ) + + + asyncio.run(main()) + """ + _response = await self._raw_client.undo( + id, reason_code=reason_code, note=note, overrides=overrides, notify=notify, request_options=request_options + ) + return _response.data diff --git a/sdks/python/src/coss/resources/scheduling/resources/reassignments/raw_client.py b/sdks/python/src/coss/resources/scheduling/resources/reassignments/raw_client.py new file mode 100644 index 000000000..7ac89c23f --- /dev/null +++ b/sdks/python/src/coss/resources/scheduling/resources/reassignments/raw_client.py @@ -0,0 +1,2154 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing +from json.decoder import JSONDecodeError + +from .....core.api_error import ApiError +from .....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper +from .....core.http_response import AsyncHttpResponse, HttpResponse +from .....core.idempotency import generate_idempotency_key +from .....core.jsonable_encoder import encode_path_param +from .....core.parse_error import ParsingError +from .....core.pydantic_utilities import parse_obj_as +from .....core.request_options import RequestOptions +from .....core.serialization import convert_and_respect_annotation_metadata +from .....errors.bad_request_error import BadRequestError +from .....errors.conflict_error import ConflictError +from .....errors.forbidden_error import ForbiddenError +from .....errors.internal_server_error import InternalServerError +from .....errors.not_found_error import NotFoundError +from .....errors.service_unavailable_error import ServiceUnavailableError +from .....errors.too_many_requests_error import TooManyRequestsError +from .....errors.unauthorized_error import UnauthorizedError +from .....errors.unprocessable_entity_error import UnprocessableEntityError +from .....errors.unsupported_media_type_error import UnsupportedMediaTypeError +from .....types.error import Error +from .....types.scheduling_reassignment import SchedulingReassignment +from .....types.scheduling_reassignment_item_list import SchedulingReassignmentItemList +from .....types.scheduling_reassignment_list import SchedulingReassignmentList +from .....types.scheduling_reassignment_preview import SchedulingReassignmentPreview +from .....types.scheduling_reassignment_selection import SchedulingReassignmentSelection +from .....types.scheduling_reassignment_strategy import SchedulingReassignmentStrategy +from .types.create_scheduling_reassignment_request_notify import CreateSchedulingReassignmentRequestNotify +from .types.create_scheduling_reassignment_request_overrides_item import ( + CreateSchedulingReassignmentRequestOverridesItem, +) +from .types.create_scheduling_reassignment_request_reason_code import CreateSchedulingReassignmentRequestReasonCode +from .types.preview_scheduling_reassignment_request_overrides_item import ( + PreviewSchedulingReassignmentRequestOverridesItem, +) +from .types.undo_scheduling_reassignment_request_notify import UndoSchedulingReassignmentRequestNotify +from .types.undo_scheduling_reassignment_request_overrides_item import UndoSchedulingReassignmentRequestOverridesItem +from .types.undo_scheduling_reassignment_request_reason_code import UndoSchedulingReassignmentRequestReasonCode +from pydantic import ValidationError + +# this is used as the default value for optional parameters +OMIT = typing.cast(typing.Any, ...) + + +class RawReassignmentsClient: + def __init__(self, *, client_wrapper: SyncClientWrapper): + self._client_wrapper = client_wrapper + + def preview( + self, + *, + selection: SchedulingReassignmentSelection, + strategy: typing.Optional[SchedulingReassignmentStrategy] = OMIT, + overrides: typing.Optional[typing.Sequence[PreviewSchedulingReassignmentRequestOverridesItem]] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> HttpResponse[SchedulingReassignmentPreview]: + """ + Who each booking would go to, and why not when nobody can take it, without moving anything. It works down them in order, so two can't both be promised the same free hour. Change any of it and start the run with `assignments`. Covers the first 500. Things can change before you start it: the run decides again. + + Parameters + ---------- + selection : SchedulingReassignmentSelection + + strategy : typing.Optional[SchedulingReassignmentStrategy] + + overrides : typing.Optional[typing.Sequence[PreviewSchedulingReassignmentRequestOverridesItem]] + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + HttpResponse[SchedulingReassignmentPreview] + What would happen. + """ + _response = self._client_wrapper.httpx_client.request( + "v1/scheduling/reassignments/preview", + method="POST", + json={ + "selection": convert_and_respect_annotation_metadata( + object_=selection, annotation=SchedulingReassignmentSelection, direction="write" + ), + "strategy": convert_and_respect_annotation_metadata( + object_=strategy, annotation=SchedulingReassignmentStrategy, direction="write" + ), + "overrides": overrides, + }, + headers={ + "content-type": "application/json", + "Idempotency-Key": generate_idempotency_key(), + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + SchedulingReassignmentPreview, + parse_obj_as( + type_=SchedulingReassignmentPreview, # type: ignore + object_=_response.json(), + ), + ) + return HttpResponse(response=_response, data=_data) + if _response.status_code == 400: + raise BadRequestError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 401: + raise UnauthorizedError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 403: + raise ForbiddenError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 404: + raise NotFoundError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 415: + raise UnsupportedMediaTypeError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 422: + raise UnprocessableEntityError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 429: + raise TooManyRequestsError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 500: + raise InternalServerError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 503: + raise ServiceUnavailableError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) + except ValidationError as e: + raise ParsingError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e + ) + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + + def list( + self, + *, + limit: typing.Optional[int] = None, + after: typing.Optional[str] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> HttpResponse[SchedulingReassignmentList]: + """ + Newest first, with how each is going. + + Parameters + ---------- + limit : typing.Optional[int] + + after : typing.Optional[str] + The last id of the previous page. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + HttpResponse[SchedulingReassignmentList] + The runs. + """ + _response = self._client_wrapper.httpx_client.request( + "v1/scheduling/reassignments", + method="GET", + params={ + "limit": limit, + "after": after, + }, + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + SchedulingReassignmentList, + parse_obj_as( + type_=SchedulingReassignmentList, # type: ignore + object_=_response.json(), + ), + ) + return HttpResponse(response=_response, data=_data) + if _response.status_code == 400: + raise BadRequestError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 401: + raise UnauthorizedError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 403: + raise ForbiddenError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 422: + raise UnprocessableEntityError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 429: + raise TooManyRequestsError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 500: + raise InternalServerError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 503: + raise ServiceUnavailableError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) + except ValidationError as e: + raise ParsingError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e + ) + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + + def create( + self, + *, + selection: SchedulingReassignmentSelection, + reason_code: CreateSchedulingReassignmentRequestReasonCode, + idempotency_key: typing.Optional[str] = None, + strategy: typing.Optional[SchedulingReassignmentStrategy] = OMIT, + note: typing.Optional[str] = OMIT, + overrides: typing.Optional[typing.Sequence[CreateSchedulingReassignmentRequestOverridesItem]] = OMIT, + notify: typing.Optional[CreateSchedulingReassignmentRequestNotify] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> HttpResponse[SchedulingReassignment]: + """ + Moves up to 5,000 bookings in the background, each on its own, so one that can't move never holds up the rest. Nothing's ever cancelled: a booking nobody can take stays where it is, and its item says so. It answers at once: follow the run by its id, or wait for `scheduling.reassignment.completed`. + + Parameters + ---------- + selection : SchedulingReassignmentSelection + + reason_code : CreateSchedulingReassignmentRequestReasonCode + + idempotency_key : typing.Optional[str] + Makes retries safe: a repeated request with the same key and body returns the original run instead of starting another, for 24 hours. 1-256 characters. + + strategy : typing.Optional[SchedulingReassignmentStrategy] + + note : typing.Optional[str] + Why, in your words: required with an override of someone's availability. + + overrides : typing.Optional[typing.Sequence[CreateSchedulingReassignmentRequestOverridesItem]] + + notify : typing.Optional[CreateSchedulingReassignmentRequestNotify] + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + HttpResponse[SchedulingReassignment] + The run, waiting to start. + """ + _response = self._client_wrapper.httpx_client.request( + "v1/scheduling/reassignments", + method="POST", + json={ + "selection": convert_and_respect_annotation_metadata( + object_=selection, annotation=SchedulingReassignmentSelection, direction="write" + ), + "strategy": convert_and_respect_annotation_metadata( + object_=strategy, annotation=SchedulingReassignmentStrategy, direction="write" + ), + "reason_code": reason_code, + "note": note, + "overrides": overrides, + "notify": convert_and_respect_annotation_metadata( + object_=notify, annotation=CreateSchedulingReassignmentRequestNotify, direction="write" + ), + }, + headers={ + "content-type": "application/json", + "Idempotency-Key": str(idempotency_key) if idempotency_key is not None else generate_idempotency_key(), + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + SchedulingReassignment, + parse_obj_as( + type_=SchedulingReassignment, # type: ignore + object_=_response.json(), + ), + ) + return HttpResponse(response=_response, data=_data) + if _response.status_code == 400: + raise BadRequestError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 401: + raise UnauthorizedError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 403: + raise ForbiddenError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 404: + raise NotFoundError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 409: + raise ConflictError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 415: + raise UnsupportedMediaTypeError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 422: + raise UnprocessableEntityError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 429: + raise TooManyRequestsError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 500: + raise InternalServerError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 503: + raise ServiceUnavailableError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) + except ValidationError as e: + raise ParsingError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e + ) + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + + def get( + self, id: str, *, request_options: typing.Optional[RequestOptions] = None + ) -> HttpResponse[SchedulingReassignment]: + """ + How it's going. + + Parameters + ---------- + id : str + The reassignment's id. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + HttpResponse[SchedulingReassignment] + The run. + """ + _response = self._client_wrapper.httpx_client.request( + f"v1/scheduling/reassignments/{encode_path_param(id)}", + method="GET", + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + SchedulingReassignment, + parse_obj_as( + type_=SchedulingReassignment, # type: ignore + object_=_response.json(), + ), + ) + return HttpResponse(response=_response, data=_data) + if _response.status_code == 400: + raise BadRequestError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 401: + raise UnauthorizedError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 403: + raise ForbiddenError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 404: + raise NotFoundError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 429: + raise TooManyRequestsError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 500: + raise InternalServerError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 503: + raise ServiceUnavailableError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) + except ValidationError as e: + raise ParsingError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e + ) + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + + def items( + self, + id: str, + *, + limit: typing.Optional[int] = None, + after: typing.Optional[str] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> HttpResponse[SchedulingReassignmentItemList]: + """ + Each booking it covers and what happened to it. A group session has one, for one of its seats. Empty until the worker's started on it. + + Parameters + ---------- + id : str + The reassignment's id. + + limit : typing.Optional[int] + + after : typing.Optional[str] + The last id of the previous page. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + HttpResponse[SchedulingReassignmentItemList] + The items. + """ + _response = self._client_wrapper.httpx_client.request( + f"v1/scheduling/reassignments/{encode_path_param(id)}/items", + method="GET", + params={ + "limit": limit, + "after": after, + }, + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + SchedulingReassignmentItemList, + parse_obj_as( + type_=SchedulingReassignmentItemList, # type: ignore + object_=_response.json(), + ), + ) + return HttpResponse(response=_response, data=_data) + if _response.status_code == 400: + raise BadRequestError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 401: + raise UnauthorizedError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 403: + raise ForbiddenError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 404: + raise NotFoundError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 422: + raise UnprocessableEntityError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 429: + raise TooManyRequestsError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 500: + raise InternalServerError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 503: + raise ServiceUnavailableError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) + except ValidationError as e: + raise ParsingError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e + ) + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + + def cancel( + self, id: str, *, request_options: typing.Optional[RequestOptions] = None + ) -> HttpResponse[SchedulingReassignment]: + """ + Stops what hasn't happened yet. What's moved stays moved: undo it for that. Cancelling one that's finished changes nothing. + + Parameters + ---------- + id : str + The reassignment's id. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + HttpResponse[SchedulingReassignment] + The run. + """ + _response = self._client_wrapper.httpx_client.request( + f"v1/scheduling/reassignments/{encode_path_param(id)}/cancel", + method="POST", + headers={ + "Idempotency-Key": generate_idempotency_key(), + }, + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + SchedulingReassignment, + parse_obj_as( + type_=SchedulingReassignment, # type: ignore + object_=_response.json(), + ), + ) + return HttpResponse(response=_response, data=_data) + if _response.status_code == 400: + raise BadRequestError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 401: + raise UnauthorizedError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 403: + raise ForbiddenError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 404: + raise NotFoundError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 429: + raise TooManyRequestsError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 500: + raise InternalServerError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 503: + raise ServiceUnavailableError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) + except ValidationError as e: + raise ParsingError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e + ) + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + + def undo( + self, + id: str, + *, + reason_code: typing.Optional[UndoSchedulingReassignmentRequestReasonCode] = OMIT, + note: typing.Optional[str] = OMIT, + overrides: typing.Optional[typing.Sequence[UndoSchedulingReassignmentRequestOverridesItem]] = OMIT, + notify: typing.Optional[UndoSchedulingReassignmentRequestNotify] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> HttpResponse[SchedulingReassignment]: + """ + Gives back what a finished run moved, as a new run. A booking that's moved on since stays where it went, and a former host who's no longer free keeps it from going back, unless you pass `overrides`. + + Parameters + ---------- + id : str + The reassignment's id. + + reason_code : typing.Optional[UndoSchedulingReassignmentRequestReasonCode] + + note : typing.Optional[str] + + overrides : typing.Optional[typing.Sequence[UndoSchedulingReassignmentRequestOverridesItem]] + + notify : typing.Optional[UndoSchedulingReassignmentRequestNotify] + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + HttpResponse[SchedulingReassignment] + The new run. + """ + _request_options_with_retries_disabled: typing.Optional[RequestOptions] = ( + {**request_options, "max_retries": 0} if request_options is not None else {"max_retries": 0} + ) + _response = self._client_wrapper.httpx_client.request( + f"v1/scheduling/reassignments/{encode_path_param(id)}/undo", + method="POST", + json={ + "reason_code": reason_code, + "note": note, + "overrides": overrides, + "notify": convert_and_respect_annotation_metadata( + object_=notify, annotation=UndoSchedulingReassignmentRequestNotify, direction="write" + ), + }, + headers={ + "content-type": "application/json", + "Idempotency-Key": generate_idempotency_key(), + }, + request_options=_request_options_with_retries_disabled, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + SchedulingReassignment, + parse_obj_as( + type_=SchedulingReassignment, # type: ignore + object_=_response.json(), + ), + ) + return HttpResponse(response=_response, data=_data) + if _response.status_code == 400: + raise BadRequestError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 401: + raise UnauthorizedError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 403: + raise ForbiddenError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 404: + raise NotFoundError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 415: + raise UnsupportedMediaTypeError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 422: + raise UnprocessableEntityError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 429: + raise TooManyRequestsError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 500: + raise InternalServerError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 503: + raise ServiceUnavailableError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) + except ValidationError as e: + raise ParsingError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e + ) + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + + +class AsyncRawReassignmentsClient: + def __init__(self, *, client_wrapper: AsyncClientWrapper): + self._client_wrapper = client_wrapper + + async def preview( + self, + *, + selection: SchedulingReassignmentSelection, + strategy: typing.Optional[SchedulingReassignmentStrategy] = OMIT, + overrides: typing.Optional[typing.Sequence[PreviewSchedulingReassignmentRequestOverridesItem]] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> AsyncHttpResponse[SchedulingReassignmentPreview]: + """ + Who each booking would go to, and why not when nobody can take it, without moving anything. It works down them in order, so two can't both be promised the same free hour. Change any of it and start the run with `assignments`. Covers the first 500. Things can change before you start it: the run decides again. + + Parameters + ---------- + selection : SchedulingReassignmentSelection + + strategy : typing.Optional[SchedulingReassignmentStrategy] + + overrides : typing.Optional[typing.Sequence[PreviewSchedulingReassignmentRequestOverridesItem]] + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AsyncHttpResponse[SchedulingReassignmentPreview] + What would happen. + """ + _response = await self._client_wrapper.httpx_client.request( + "v1/scheduling/reassignments/preview", + method="POST", + json={ + "selection": convert_and_respect_annotation_metadata( + object_=selection, annotation=SchedulingReassignmentSelection, direction="write" + ), + "strategy": convert_and_respect_annotation_metadata( + object_=strategy, annotation=SchedulingReassignmentStrategy, direction="write" + ), + "overrides": overrides, + }, + headers={ + "content-type": "application/json", + "Idempotency-Key": generate_idempotency_key(), + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + SchedulingReassignmentPreview, + parse_obj_as( + type_=SchedulingReassignmentPreview, # type: ignore + object_=_response.json(), + ), + ) + return AsyncHttpResponse(response=_response, data=_data) + if _response.status_code == 400: + raise BadRequestError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 401: + raise UnauthorizedError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 403: + raise ForbiddenError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 404: + raise NotFoundError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 415: + raise UnsupportedMediaTypeError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 422: + raise UnprocessableEntityError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 429: + raise TooManyRequestsError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 500: + raise InternalServerError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 503: + raise ServiceUnavailableError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) + except ValidationError as e: + raise ParsingError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e + ) + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + + async def list( + self, + *, + limit: typing.Optional[int] = None, + after: typing.Optional[str] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> AsyncHttpResponse[SchedulingReassignmentList]: + """ + Newest first, with how each is going. + + Parameters + ---------- + limit : typing.Optional[int] + + after : typing.Optional[str] + The last id of the previous page. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AsyncHttpResponse[SchedulingReassignmentList] + The runs. + """ + _response = await self._client_wrapper.httpx_client.request( + "v1/scheduling/reassignments", + method="GET", + params={ + "limit": limit, + "after": after, + }, + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + SchedulingReassignmentList, + parse_obj_as( + type_=SchedulingReassignmentList, # type: ignore + object_=_response.json(), + ), + ) + return AsyncHttpResponse(response=_response, data=_data) + if _response.status_code == 400: + raise BadRequestError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 401: + raise UnauthorizedError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 403: + raise ForbiddenError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 422: + raise UnprocessableEntityError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 429: + raise TooManyRequestsError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 500: + raise InternalServerError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 503: + raise ServiceUnavailableError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) + except ValidationError as e: + raise ParsingError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e + ) + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + + async def create( + self, + *, + selection: SchedulingReassignmentSelection, + reason_code: CreateSchedulingReassignmentRequestReasonCode, + idempotency_key: typing.Optional[str] = None, + strategy: typing.Optional[SchedulingReassignmentStrategy] = OMIT, + note: typing.Optional[str] = OMIT, + overrides: typing.Optional[typing.Sequence[CreateSchedulingReassignmentRequestOverridesItem]] = OMIT, + notify: typing.Optional[CreateSchedulingReassignmentRequestNotify] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> AsyncHttpResponse[SchedulingReassignment]: + """ + Moves up to 5,000 bookings in the background, each on its own, so one that can't move never holds up the rest. Nothing's ever cancelled: a booking nobody can take stays where it is, and its item says so. It answers at once: follow the run by its id, or wait for `scheduling.reassignment.completed`. + + Parameters + ---------- + selection : SchedulingReassignmentSelection + + reason_code : CreateSchedulingReassignmentRequestReasonCode + + idempotency_key : typing.Optional[str] + Makes retries safe: a repeated request with the same key and body returns the original run instead of starting another, for 24 hours. 1-256 characters. + + strategy : typing.Optional[SchedulingReassignmentStrategy] + + note : typing.Optional[str] + Why, in your words: required with an override of someone's availability. + + overrides : typing.Optional[typing.Sequence[CreateSchedulingReassignmentRequestOverridesItem]] + + notify : typing.Optional[CreateSchedulingReassignmentRequestNotify] + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AsyncHttpResponse[SchedulingReassignment] + The run, waiting to start. + """ + _response = await self._client_wrapper.httpx_client.request( + "v1/scheduling/reassignments", + method="POST", + json={ + "selection": convert_and_respect_annotation_metadata( + object_=selection, annotation=SchedulingReassignmentSelection, direction="write" + ), + "strategy": convert_and_respect_annotation_metadata( + object_=strategy, annotation=SchedulingReassignmentStrategy, direction="write" + ), + "reason_code": reason_code, + "note": note, + "overrides": overrides, + "notify": convert_and_respect_annotation_metadata( + object_=notify, annotation=CreateSchedulingReassignmentRequestNotify, direction="write" + ), + }, + headers={ + "content-type": "application/json", + "Idempotency-Key": str(idempotency_key) if idempotency_key is not None else generate_idempotency_key(), + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + SchedulingReassignment, + parse_obj_as( + type_=SchedulingReassignment, # type: ignore + object_=_response.json(), + ), + ) + return AsyncHttpResponse(response=_response, data=_data) + if _response.status_code == 400: + raise BadRequestError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 401: + raise UnauthorizedError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 403: + raise ForbiddenError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 404: + raise NotFoundError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 409: + raise ConflictError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 415: + raise UnsupportedMediaTypeError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 422: + raise UnprocessableEntityError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 429: + raise TooManyRequestsError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 500: + raise InternalServerError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 503: + raise ServiceUnavailableError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) + except ValidationError as e: + raise ParsingError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e + ) + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + + async def get( + self, id: str, *, request_options: typing.Optional[RequestOptions] = None + ) -> AsyncHttpResponse[SchedulingReassignment]: + """ + How it's going. + + Parameters + ---------- + id : str + The reassignment's id. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AsyncHttpResponse[SchedulingReassignment] + The run. + """ + _response = await self._client_wrapper.httpx_client.request( + f"v1/scheduling/reassignments/{encode_path_param(id)}", + method="GET", + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + SchedulingReassignment, + parse_obj_as( + type_=SchedulingReassignment, # type: ignore + object_=_response.json(), + ), + ) + return AsyncHttpResponse(response=_response, data=_data) + if _response.status_code == 400: + raise BadRequestError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 401: + raise UnauthorizedError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 403: + raise ForbiddenError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 404: + raise NotFoundError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 429: + raise TooManyRequestsError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 500: + raise InternalServerError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 503: + raise ServiceUnavailableError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) + except ValidationError as e: + raise ParsingError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e + ) + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + + async def items( + self, + id: str, + *, + limit: typing.Optional[int] = None, + after: typing.Optional[str] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> AsyncHttpResponse[SchedulingReassignmentItemList]: + """ + Each booking it covers and what happened to it. A group session has one, for one of its seats. Empty until the worker's started on it. + + Parameters + ---------- + id : str + The reassignment's id. + + limit : typing.Optional[int] + + after : typing.Optional[str] + The last id of the previous page. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AsyncHttpResponse[SchedulingReassignmentItemList] + The items. + """ + _response = await self._client_wrapper.httpx_client.request( + f"v1/scheduling/reassignments/{encode_path_param(id)}/items", + method="GET", + params={ + "limit": limit, + "after": after, + }, + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + SchedulingReassignmentItemList, + parse_obj_as( + type_=SchedulingReassignmentItemList, # type: ignore + object_=_response.json(), + ), + ) + return AsyncHttpResponse(response=_response, data=_data) + if _response.status_code == 400: + raise BadRequestError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 401: + raise UnauthorizedError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 403: + raise ForbiddenError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 404: + raise NotFoundError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 422: + raise UnprocessableEntityError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 429: + raise TooManyRequestsError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 500: + raise InternalServerError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 503: + raise ServiceUnavailableError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) + except ValidationError as e: + raise ParsingError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e + ) + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + + async def cancel( + self, id: str, *, request_options: typing.Optional[RequestOptions] = None + ) -> AsyncHttpResponse[SchedulingReassignment]: + """ + Stops what hasn't happened yet. What's moved stays moved: undo it for that. Cancelling one that's finished changes nothing. + + Parameters + ---------- + id : str + The reassignment's id. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AsyncHttpResponse[SchedulingReassignment] + The run. + """ + _response = await self._client_wrapper.httpx_client.request( + f"v1/scheduling/reassignments/{encode_path_param(id)}/cancel", + method="POST", + headers={ + "Idempotency-Key": generate_idempotency_key(), + }, + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + SchedulingReassignment, + parse_obj_as( + type_=SchedulingReassignment, # type: ignore + object_=_response.json(), + ), + ) + return AsyncHttpResponse(response=_response, data=_data) + if _response.status_code == 400: + raise BadRequestError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 401: + raise UnauthorizedError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 403: + raise ForbiddenError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 404: + raise NotFoundError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 429: + raise TooManyRequestsError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 500: + raise InternalServerError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 503: + raise ServiceUnavailableError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) + except ValidationError as e: + raise ParsingError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e + ) + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + + async def undo( + self, + id: str, + *, + reason_code: typing.Optional[UndoSchedulingReassignmentRequestReasonCode] = OMIT, + note: typing.Optional[str] = OMIT, + overrides: typing.Optional[typing.Sequence[UndoSchedulingReassignmentRequestOverridesItem]] = OMIT, + notify: typing.Optional[UndoSchedulingReassignmentRequestNotify] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> AsyncHttpResponse[SchedulingReassignment]: + """ + Gives back what a finished run moved, as a new run. A booking that's moved on since stays where it went, and a former host who's no longer free keeps it from going back, unless you pass `overrides`. + + Parameters + ---------- + id : str + The reassignment's id. + + reason_code : typing.Optional[UndoSchedulingReassignmentRequestReasonCode] + + note : typing.Optional[str] + + overrides : typing.Optional[typing.Sequence[UndoSchedulingReassignmentRequestOverridesItem]] + + notify : typing.Optional[UndoSchedulingReassignmentRequestNotify] + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AsyncHttpResponse[SchedulingReassignment] + The new run. + """ + _request_options_with_retries_disabled: typing.Optional[RequestOptions] = ( + {**request_options, "max_retries": 0} if request_options is not None else {"max_retries": 0} + ) + _response = await self._client_wrapper.httpx_client.request( + f"v1/scheduling/reassignments/{encode_path_param(id)}/undo", + method="POST", + json={ + "reason_code": reason_code, + "note": note, + "overrides": overrides, + "notify": convert_and_respect_annotation_metadata( + object_=notify, annotation=UndoSchedulingReassignmentRequestNotify, direction="write" + ), + }, + headers={ + "content-type": "application/json", + "Idempotency-Key": generate_idempotency_key(), + }, + request_options=_request_options_with_retries_disabled, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + SchedulingReassignment, + parse_obj_as( + type_=SchedulingReassignment, # type: ignore + object_=_response.json(), + ), + ) + return AsyncHttpResponse(response=_response, data=_data) + if _response.status_code == 400: + raise BadRequestError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 401: + raise UnauthorizedError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 403: + raise ForbiddenError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 404: + raise NotFoundError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 415: + raise UnsupportedMediaTypeError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 422: + raise UnprocessableEntityError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 429: + raise TooManyRequestsError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 500: + raise InternalServerError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 503: + raise ServiceUnavailableError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) + except ValidationError as e: + raise ParsingError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e + ) + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) diff --git a/sdks/python/src/coss/resources/scheduling/resources/reassignments/types/__init__.py b/sdks/python/src/coss/resources/scheduling/resources/reassignments/types/__init__.py new file mode 100644 index 000000000..58f28c6b7 --- /dev/null +++ b/sdks/python/src/coss/resources/scheduling/resources/reassignments/types/__init__.py @@ -0,0 +1,64 @@ +# This file was auto-generated by Fern from our API Definition. + +# isort: skip_file + +import typing +from importlib import import_module + +if typing.TYPE_CHECKING: + from .create_scheduling_reassignment_request_notify import CreateSchedulingReassignmentRequestNotify + from .create_scheduling_reassignment_request_notify_hosts import CreateSchedulingReassignmentRequestNotifyHosts + from .create_scheduling_reassignment_request_overrides_item import CreateSchedulingReassignmentRequestOverridesItem + from .create_scheduling_reassignment_request_reason_code import CreateSchedulingReassignmentRequestReasonCode + from .preview_scheduling_reassignment_request_overrides_item import ( + PreviewSchedulingReassignmentRequestOverridesItem, + ) + from .undo_scheduling_reassignment_request_notify import UndoSchedulingReassignmentRequestNotify + from .undo_scheduling_reassignment_request_notify_hosts import UndoSchedulingReassignmentRequestNotifyHosts + from .undo_scheduling_reassignment_request_overrides_item import UndoSchedulingReassignmentRequestOverridesItem + from .undo_scheduling_reassignment_request_reason_code import UndoSchedulingReassignmentRequestReasonCode +_dynamic_imports: typing.Dict[str, str] = { + "CreateSchedulingReassignmentRequestNotify": ".create_scheduling_reassignment_request_notify", + "CreateSchedulingReassignmentRequestNotifyHosts": ".create_scheduling_reassignment_request_notify_hosts", + "CreateSchedulingReassignmentRequestOverridesItem": ".create_scheduling_reassignment_request_overrides_item", + "CreateSchedulingReassignmentRequestReasonCode": ".create_scheduling_reassignment_request_reason_code", + "PreviewSchedulingReassignmentRequestOverridesItem": ".preview_scheduling_reassignment_request_overrides_item", + "UndoSchedulingReassignmentRequestNotify": ".undo_scheduling_reassignment_request_notify", + "UndoSchedulingReassignmentRequestNotifyHosts": ".undo_scheduling_reassignment_request_notify_hosts", + "UndoSchedulingReassignmentRequestOverridesItem": ".undo_scheduling_reassignment_request_overrides_item", + "UndoSchedulingReassignmentRequestReasonCode": ".undo_scheduling_reassignment_request_reason_code", +} + + +def __getattr__(attr_name: str) -> typing.Any: + module_name = _dynamic_imports.get(attr_name) + if module_name is None: + raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") + try: + module = import_module(module_name, __package__) + if module_name == f".{attr_name}": + return module + else: + return getattr(module, attr_name) + except ImportError as e: + raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e + except AttributeError as e: + raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e + + +def __dir__(): + lazy_attrs = list(_dynamic_imports.keys()) + return sorted(lazy_attrs) + + +__all__ = [ + "CreateSchedulingReassignmentRequestNotify", + "CreateSchedulingReassignmentRequestNotifyHosts", + "CreateSchedulingReassignmentRequestOverridesItem", + "CreateSchedulingReassignmentRequestReasonCode", + "PreviewSchedulingReassignmentRequestOverridesItem", + "UndoSchedulingReassignmentRequestNotify", + "UndoSchedulingReassignmentRequestNotifyHosts", + "UndoSchedulingReassignmentRequestOverridesItem", + "UndoSchedulingReassignmentRequestReasonCode", +] diff --git a/sdks/python/src/coss/resources/scheduling/resources/reassignments/types/create_scheduling_reassignment_request_notify.py b/sdks/python/src/coss/resources/scheduling/resources/reassignments/types/create_scheduling_reassignment_request_notify.py new file mode 100644 index 000000000..adecbd589 --- /dev/null +++ b/sdks/python/src/coss/resources/scheduling/resources/reassignments/types/create_scheduling_reassignment_request_notify.py @@ -0,0 +1,28 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ......core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from .create_scheduling_reassignment_request_notify_hosts import CreateSchedulingReassignmentRequestNotifyHosts + + +class CreateSchedulingReassignmentRequestNotify(UniversalBaseModel): + attendees: typing.Optional[bool] = pydantic.Field(default=None) + """ + Tell attendees. Default: true. + """ + + hosts: typing.Optional[CreateSchedulingReassignmentRequestNotifyHosts] = pydantic.Field(default=None) + """ + `digest` (the default) sends each host one email for the run. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/sdks/python/src/coss/resources/scheduling/resources/reassignments/types/create_scheduling_reassignment_request_notify_hosts.py b/sdks/python/src/coss/resources/scheduling/resources/reassignments/types/create_scheduling_reassignment_request_notify_hosts.py new file mode 100644 index 000000000..f0c7f1891 --- /dev/null +++ b/sdks/python/src/coss/resources/scheduling/resources/reassignments/types/create_scheduling_reassignment_request_notify_hosts.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +CreateSchedulingReassignmentRequestNotifyHosts = typing.Union[typing.Literal["digest", "each", "none"], typing.Any] diff --git a/sdks/python/src/coss/resources/scheduling/resources/reassignments/types/create_scheduling_reassignment_request_overrides_item.py b/sdks/python/src/coss/resources/scheduling/resources/reassignments/types/create_scheduling_reassignment_request_overrides_item.py new file mode 100644 index 000000000..3eec0c793 --- /dev/null +++ b/sdks/python/src/coss/resources/scheduling/resources/reassignments/types/create_scheduling_reassignment_request_overrides_item.py @@ -0,0 +1,10 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +CreateSchedulingReassignmentRequestOverridesItem = typing.Union[ + typing.Literal[ + "any_host", "out_of_office", "outside_availability", "host_busy", "limit_reached", "calendar_unverified" + ], + typing.Any, +] diff --git a/sdks/python/src/coss/resources/scheduling/resources/reassignments/types/create_scheduling_reassignment_request_reason_code.py b/sdks/python/src/coss/resources/scheduling/resources/reassignments/types/create_scheduling_reassignment_request_reason_code.py new file mode 100644 index 000000000..a02dccebb --- /dev/null +++ b/sdks/python/src/coss/resources/scheduling/resources/reassignments/types/create_scheduling_reassignment_request_reason_code.py @@ -0,0 +1,8 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +CreateSchedulingReassignmentRequestReasonCode = typing.Union[ + typing.Literal["host_unavailable", "out_of_office", "workload", "customer_request", "offboarding", "other"], + typing.Any, +] diff --git a/sdks/python/src/coss/resources/scheduling/resources/reassignments/types/preview_scheduling_reassignment_request_overrides_item.py b/sdks/python/src/coss/resources/scheduling/resources/reassignments/types/preview_scheduling_reassignment_request_overrides_item.py new file mode 100644 index 000000000..e174c6a9f --- /dev/null +++ b/sdks/python/src/coss/resources/scheduling/resources/reassignments/types/preview_scheduling_reassignment_request_overrides_item.py @@ -0,0 +1,10 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +PreviewSchedulingReassignmentRequestOverridesItem = typing.Union[ + typing.Literal[ + "any_host", "out_of_office", "outside_availability", "host_busy", "limit_reached", "calendar_unverified" + ], + typing.Any, +] diff --git a/sdks/python/src/coss/resources/scheduling/resources/reassignments/types/undo_scheduling_reassignment_request_notify.py b/sdks/python/src/coss/resources/scheduling/resources/reassignments/types/undo_scheduling_reassignment_request_notify.py new file mode 100644 index 000000000..ac5b8e1ad --- /dev/null +++ b/sdks/python/src/coss/resources/scheduling/resources/reassignments/types/undo_scheduling_reassignment_request_notify.py @@ -0,0 +1,28 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ......core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from .undo_scheduling_reassignment_request_notify_hosts import UndoSchedulingReassignmentRequestNotifyHosts + + +class UndoSchedulingReassignmentRequestNotify(UniversalBaseModel): + attendees: typing.Optional[bool] = pydantic.Field(default=None) + """ + Tell attendees. Default: true. + """ + + hosts: typing.Optional[UndoSchedulingReassignmentRequestNotifyHosts] = pydantic.Field(default=None) + """ + `digest` (the default) sends each host one email for the run. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/sdks/python/src/coss/resources/scheduling/resources/reassignments/types/undo_scheduling_reassignment_request_notify_hosts.py b/sdks/python/src/coss/resources/scheduling/resources/reassignments/types/undo_scheduling_reassignment_request_notify_hosts.py new file mode 100644 index 000000000..2842be005 --- /dev/null +++ b/sdks/python/src/coss/resources/scheduling/resources/reassignments/types/undo_scheduling_reassignment_request_notify_hosts.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +UndoSchedulingReassignmentRequestNotifyHosts = typing.Union[typing.Literal["digest", "each", "none"], typing.Any] diff --git a/sdks/python/src/coss/resources/scheduling/resources/reassignments/types/undo_scheduling_reassignment_request_overrides_item.py b/sdks/python/src/coss/resources/scheduling/resources/reassignments/types/undo_scheduling_reassignment_request_overrides_item.py new file mode 100644 index 000000000..d896eb49d --- /dev/null +++ b/sdks/python/src/coss/resources/scheduling/resources/reassignments/types/undo_scheduling_reassignment_request_overrides_item.py @@ -0,0 +1,10 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +UndoSchedulingReassignmentRequestOverridesItem = typing.Union[ + typing.Literal[ + "any_host", "out_of_office", "outside_availability", "host_busy", "limit_reached", "calendar_unverified" + ], + typing.Any, +] diff --git a/sdks/python/src/coss/resources/scheduling/resources/reassignments/types/undo_scheduling_reassignment_request_reason_code.py b/sdks/python/src/coss/resources/scheduling/resources/reassignments/types/undo_scheduling_reassignment_request_reason_code.py new file mode 100644 index 000000000..87b0f15ad --- /dev/null +++ b/sdks/python/src/coss/resources/scheduling/resources/reassignments/types/undo_scheduling_reassignment_request_reason_code.py @@ -0,0 +1,8 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +UndoSchedulingReassignmentRequestReasonCode = typing.Union[ + typing.Literal["host_unavailable", "out_of_office", "workload", "customer_request", "offboarding", "other"], + typing.Any, +] diff --git a/sdks/python/src/coss/resources/scheduling/resources/sessions/__init__.py b/sdks/python/src/coss/resources/scheduling/resources/sessions/__init__.py index 9e1611649..123819593 100644 --- a/sdks/python/src/coss/resources/scheduling/resources/sessions/__init__.py +++ b/sdks/python/src/coss/resources/scheduling/resources/sessions/__init__.py @@ -6,10 +6,15 @@ from importlib import import_module if typing.TYPE_CHECKING: - from .types import CreateSchedulingBookerSessionRequestAttendee, CreateSchedulingBookerSessionRequestAttributesValue + from .types import ( + CreateSchedulingBookerSessionRequestAttendee, + CreateSchedulingBookerSessionRequestAttributesValue, + CreateSchedulingManagerSessionRequestHostFilterValue, + ) _dynamic_imports: typing.Dict[str, str] = { "CreateSchedulingBookerSessionRequestAttendee": ".types", "CreateSchedulingBookerSessionRequestAttributesValue": ".types", + "CreateSchedulingManagerSessionRequestHostFilterValue": ".types", } @@ -34,4 +39,8 @@ def __dir__(): return sorted(lazy_attrs) -__all__ = ["CreateSchedulingBookerSessionRequestAttendee", "CreateSchedulingBookerSessionRequestAttributesValue"] +__all__ = [ + "CreateSchedulingBookerSessionRequestAttendee", + "CreateSchedulingBookerSessionRequestAttributesValue", + "CreateSchedulingManagerSessionRequestHostFilterValue", +] diff --git a/sdks/python/src/coss/resources/scheduling/resources/sessions/client.py b/sdks/python/src/coss/resources/scheduling/resources/sessions/client.py index 287475385..5bea971f8 100644 --- a/sdks/python/src/coss/resources/scheduling/resources/sessions/client.py +++ b/sdks/python/src/coss/resources/scheduling/resources/sessions/client.py @@ -10,6 +10,9 @@ from .types.create_scheduling_booker_session_request_attributes_value import ( CreateSchedulingBookerSessionRequestAttributesValue, ) +from .types.create_scheduling_manager_session_request_host_filter_value import ( + CreateSchedulingManagerSessionRequestHostFilterValue, +) # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) @@ -30,6 +33,61 @@ def with_raw_response(self) -> RawSessionsClient: """ return self._raw_client + def create_for_manager( + self, + *, + hosts: typing.Optional[typing.Sequence[str]] = OMIT, + host_filter: typing.Optional[typing.Dict[str, CreateSchedulingManagerSessionRequestHostFilterValue]] = OMIT, + expires_in: typing.Optional[int] = OMIT, + read_only: typing.Optional[bool] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> SchedulingSession: + """ + Lets a team lead manage cover for the hosts you name, or those matching an attribute filter whenever it's asked: time off, bookings that need someone else, and moving them. It never sees attendees' details. Send the `url` to their browser, or embed it with `coss/scheduling`. + + Parameters + ---------- + hosts : typing.Optional[typing.Sequence[str]] + The hosts this page can reach, by id or uid. + + host_filter : typing.Optional[typing.Dict[str, CreateSchedulingManagerSessionRequestHostFilterValue]] + Everyone matching these attributes, asked again on every request. + + expires_in : typing.Optional[int] + Seconds until it stops working. At most a day. + + read_only : typing.Optional[bool] + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + SchedulingSession + The session. + + Examples + -------- + from coss import Coss + + client = Coss( + "2026-10-10", + api_key="YOUR_API_KEY", + ) + client.scheduling.sessions.create_for_manager( + host_filter={"team": "cardiology"}, + expires_in=3600, + ) + """ + _response = self._raw_client.create_for_manager( + hosts=hosts, + host_filter=host_filter, + expires_in=expires_in, + read_only=read_only, + request_options=request_options, + ) + return _response.data + def create_for_host( self, host: str, @@ -196,6 +254,69 @@ def with_raw_response(self) -> AsyncRawSessionsClient: """ return self._raw_client + async def create_for_manager( + self, + *, + hosts: typing.Optional[typing.Sequence[str]] = OMIT, + host_filter: typing.Optional[typing.Dict[str, CreateSchedulingManagerSessionRequestHostFilterValue]] = OMIT, + expires_in: typing.Optional[int] = OMIT, + read_only: typing.Optional[bool] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> SchedulingSession: + """ + Lets a team lead manage cover for the hosts you name, or those matching an attribute filter whenever it's asked: time off, bookings that need someone else, and moving them. It never sees attendees' details. Send the `url` to their browser, or embed it with `coss/scheduling`. + + Parameters + ---------- + hosts : typing.Optional[typing.Sequence[str]] + The hosts this page can reach, by id or uid. + + host_filter : typing.Optional[typing.Dict[str, CreateSchedulingManagerSessionRequestHostFilterValue]] + Everyone matching these attributes, asked again on every request. + + expires_in : typing.Optional[int] + Seconds until it stops working. At most a day. + + read_only : typing.Optional[bool] + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + SchedulingSession + The session. + + Examples + -------- + import asyncio + + from coss import AsyncCoss + + client = AsyncCoss( + "2026-10-10", + api_key="YOUR_API_KEY", + ) + + + async def main() -> None: + await client.scheduling.sessions.create_for_manager( + host_filter={"team": "cardiology"}, + expires_in=3600, + ) + + + asyncio.run(main()) + """ + _response = await self._raw_client.create_for_manager( + hosts=hosts, + host_filter=host_filter, + expires_in=expires_in, + read_only=read_only, + request_options=request_options, + ) + return _response.data + async def create_for_host( self, host: str, diff --git a/sdks/python/src/coss/resources/scheduling/resources/sessions/raw_client.py b/sdks/python/src/coss/resources/scheduling/resources/sessions/raw_client.py index 3ffc1b60a..054f12e78 100644 --- a/sdks/python/src/coss/resources/scheduling/resources/sessions/raw_client.py +++ b/sdks/python/src/coss/resources/scheduling/resources/sessions/raw_client.py @@ -28,6 +28,9 @@ from .types.create_scheduling_booker_session_request_attributes_value import ( CreateSchedulingBookerSessionRequestAttributesValue, ) +from .types.create_scheduling_manager_session_request_host_filter_value import ( + CreateSchedulingManagerSessionRequestHostFilterValue, +) from pydantic import ValidationError # this is used as the default value for optional parameters @@ -38,6 +41,180 @@ class RawSessionsClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper + def create_for_manager( + self, + *, + hosts: typing.Optional[typing.Sequence[str]] = OMIT, + host_filter: typing.Optional[typing.Dict[str, CreateSchedulingManagerSessionRequestHostFilterValue]] = OMIT, + expires_in: typing.Optional[int] = OMIT, + read_only: typing.Optional[bool] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> HttpResponse[SchedulingSession]: + """ + Lets a team lead manage cover for the hosts you name, or those matching an attribute filter whenever it's asked: time off, bookings that need someone else, and moving them. It never sees attendees' details. Send the `url` to their browser, or embed it with `coss/scheduling`. + + Parameters + ---------- + hosts : typing.Optional[typing.Sequence[str]] + The hosts this page can reach, by id or uid. + + host_filter : typing.Optional[typing.Dict[str, CreateSchedulingManagerSessionRequestHostFilterValue]] + Everyone matching these attributes, asked again on every request. + + expires_in : typing.Optional[int] + Seconds until it stops working. At most a day. + + read_only : typing.Optional[bool] + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + HttpResponse[SchedulingSession] + The session. + """ + _request_options_with_retries_disabled: typing.Optional[RequestOptions] = ( + {**request_options, "max_retries": 0} if request_options is not None else {"max_retries": 0} + ) + _response = self._client_wrapper.httpx_client.request( + "v1/scheduling/manager_sessions", + method="POST", + json={ + "hosts": hosts, + "host_filter": convert_and_respect_annotation_metadata( + object_=host_filter, + annotation=typing.Dict[str, CreateSchedulingManagerSessionRequestHostFilterValue], + direction="write", + ), + "expires_in": expires_in, + "read_only": read_only, + }, + headers={ + "content-type": "application/json", + "Idempotency-Key": generate_idempotency_key(), + }, + request_options=_request_options_with_retries_disabled, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + SchedulingSession, + parse_obj_as( + type_=SchedulingSession, # type: ignore + object_=_response.json(), + ), + ) + return HttpResponse(response=_response, data=_data) + if _response.status_code == 400: + raise BadRequestError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 401: + raise UnauthorizedError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 403: + raise ForbiddenError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 404: + raise NotFoundError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 415: + raise UnsupportedMediaTypeError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 422: + raise UnprocessableEntityError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 429: + raise TooManyRequestsError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 500: + raise InternalServerError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 503: + raise ServiceUnavailableError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) + except ValidationError as e: + raise ParsingError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e + ) + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + def create_for_host( self, host: str, @@ -538,6 +715,180 @@ class AsyncRawSessionsClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper + async def create_for_manager( + self, + *, + hosts: typing.Optional[typing.Sequence[str]] = OMIT, + host_filter: typing.Optional[typing.Dict[str, CreateSchedulingManagerSessionRequestHostFilterValue]] = OMIT, + expires_in: typing.Optional[int] = OMIT, + read_only: typing.Optional[bool] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> AsyncHttpResponse[SchedulingSession]: + """ + Lets a team lead manage cover for the hosts you name, or those matching an attribute filter whenever it's asked: time off, bookings that need someone else, and moving them. It never sees attendees' details. Send the `url` to their browser, or embed it with `coss/scheduling`. + + Parameters + ---------- + hosts : typing.Optional[typing.Sequence[str]] + The hosts this page can reach, by id or uid. + + host_filter : typing.Optional[typing.Dict[str, CreateSchedulingManagerSessionRequestHostFilterValue]] + Everyone matching these attributes, asked again on every request. + + expires_in : typing.Optional[int] + Seconds until it stops working. At most a day. + + read_only : typing.Optional[bool] + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AsyncHttpResponse[SchedulingSession] + The session. + """ + _request_options_with_retries_disabled: typing.Optional[RequestOptions] = ( + {**request_options, "max_retries": 0} if request_options is not None else {"max_retries": 0} + ) + _response = await self._client_wrapper.httpx_client.request( + "v1/scheduling/manager_sessions", + method="POST", + json={ + "hosts": hosts, + "host_filter": convert_and_respect_annotation_metadata( + object_=host_filter, + annotation=typing.Dict[str, CreateSchedulingManagerSessionRequestHostFilterValue], + direction="write", + ), + "expires_in": expires_in, + "read_only": read_only, + }, + headers={ + "content-type": "application/json", + "Idempotency-Key": generate_idempotency_key(), + }, + request_options=_request_options_with_retries_disabled, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + SchedulingSession, + parse_obj_as( + type_=SchedulingSession, # type: ignore + object_=_response.json(), + ), + ) + return AsyncHttpResponse(response=_response, data=_data) + if _response.status_code == 400: + raise BadRequestError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 401: + raise UnauthorizedError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 403: + raise ForbiddenError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 404: + raise NotFoundError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 415: + raise UnsupportedMediaTypeError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 422: + raise UnprocessableEntityError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 429: + raise TooManyRequestsError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 500: + raise InternalServerError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 503: + raise ServiceUnavailableError( + headers=dict(_response.headers), + body=typing.cast( + Error, + parse_obj_as( + type_=Error, # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) + except ValidationError as e: + raise ParsingError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e + ) + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + async def create_for_host( self, host: str, diff --git a/sdks/python/src/coss/resources/scheduling/resources/sessions/types/__init__.py b/sdks/python/src/coss/resources/scheduling/resources/sessions/types/__init__.py index 7d8724f62..1f8c150f1 100644 --- a/sdks/python/src/coss/resources/scheduling/resources/sessions/types/__init__.py +++ b/sdks/python/src/coss/resources/scheduling/resources/sessions/types/__init__.py @@ -10,9 +10,13 @@ from .create_scheduling_booker_session_request_attributes_value import ( CreateSchedulingBookerSessionRequestAttributesValue, ) + from .create_scheduling_manager_session_request_host_filter_value import ( + CreateSchedulingManagerSessionRequestHostFilterValue, + ) _dynamic_imports: typing.Dict[str, str] = { "CreateSchedulingBookerSessionRequestAttendee": ".create_scheduling_booker_session_request_attendee", "CreateSchedulingBookerSessionRequestAttributesValue": ".create_scheduling_booker_session_request_attributes_value", + "CreateSchedulingManagerSessionRequestHostFilterValue": ".create_scheduling_manager_session_request_host_filter_value", } @@ -37,4 +41,8 @@ def __dir__(): return sorted(lazy_attrs) -__all__ = ["CreateSchedulingBookerSessionRequestAttendee", "CreateSchedulingBookerSessionRequestAttributesValue"] +__all__ = [ + "CreateSchedulingBookerSessionRequestAttendee", + "CreateSchedulingBookerSessionRequestAttributesValue", + "CreateSchedulingManagerSessionRequestHostFilterValue", +] diff --git a/sdks/python/src/coss/resources/scheduling/resources/sessions/types/create_scheduling_manager_session_request_host_filter_value.py b/sdks/python/src/coss/resources/scheduling/resources/sessions/types/create_scheduling_manager_session_request_host_filter_value.py new file mode 100644 index 000000000..ebfa8cd96 --- /dev/null +++ b/sdks/python/src/coss/resources/scheduling/resources/sessions/types/create_scheduling_manager_session_request_host_filter_value.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +CreateSchedulingManagerSessionRequestHostFilterValue = typing.Union[str, typing.List[str]] diff --git a/sdks/python/src/coss/resources/scheduling/resources/settings/__init__.py b/sdks/python/src/coss/resources/scheduling/resources/settings/__init__.py index 641293b34..af2070240 100644 --- a/sdks/python/src/coss/resources/scheduling/resources/settings/__init__.py +++ b/sdks/python/src/coss/resources/scheduling/resources/settings/__init__.py @@ -8,13 +8,17 @@ if typing.TYPE_CHECKING: from .types import ( UpdateSchedulingSettingsRequestCalendarFailureMode, + UpdateSchedulingSettingsRequestHostReassignment, UpdateSchedulingSettingsRequestLogo, UpdateSchedulingSettingsRequestNotificationsValue, + UpdateSchedulingSettingsRequestOutOfOfficeReasonsItem, ) _dynamic_imports: typing.Dict[str, str] = { "UpdateSchedulingSettingsRequestCalendarFailureMode": ".types", + "UpdateSchedulingSettingsRequestHostReassignment": ".types", "UpdateSchedulingSettingsRequestLogo": ".types", "UpdateSchedulingSettingsRequestNotificationsValue": ".types", + "UpdateSchedulingSettingsRequestOutOfOfficeReasonsItem": ".types", } @@ -41,6 +45,8 @@ def __dir__(): __all__ = [ "UpdateSchedulingSettingsRequestCalendarFailureMode", + "UpdateSchedulingSettingsRequestHostReassignment", "UpdateSchedulingSettingsRequestLogo", "UpdateSchedulingSettingsRequestNotificationsValue", + "UpdateSchedulingSettingsRequestOutOfOfficeReasonsItem", ] diff --git a/sdks/python/src/coss/resources/scheduling/resources/settings/client.py b/sdks/python/src/coss/resources/scheduling/resources/settings/client.py index accb5d470..b6d37e77c 100644 --- a/sdks/python/src/coss/resources/scheduling/resources/settings/client.py +++ b/sdks/python/src/coss/resources/scheduling/resources/settings/client.py @@ -10,10 +10,14 @@ from .types.update_scheduling_settings_request_calendar_failure_mode import ( UpdateSchedulingSettingsRequestCalendarFailureMode, ) +from .types.update_scheduling_settings_request_host_reassignment import UpdateSchedulingSettingsRequestHostReassignment from .types.update_scheduling_settings_request_logo import UpdateSchedulingSettingsRequestLogo from .types.update_scheduling_settings_request_notifications_value import ( UpdateSchedulingSettingsRequestNotificationsValue, ) +from .types.update_scheduling_settings_request_out_of_office_reasons_item import ( + UpdateSchedulingSettingsRequestOutOfOfficeReasonsItem, +) # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) @@ -68,9 +72,15 @@ def update( brand_name: typing.Optional[str] = OMIT, accent_color: typing.Optional[str] = OMIT, logo: typing.Optional[UpdateSchedulingSettingsRequestLogo] = OMIT, + privacy_url: typing.Optional[str] = OMIT, email_from: typing.Optional[str] = OMIT, sms_from: typing.Optional[str] = OMIT, calendar_failure_mode: typing.Optional[UpdateSchedulingSettingsRequestCalendarFailureMode] = OMIT, + name_host_in_attendee_emails: typing.Optional[bool] = OMIT, + host_reassignment: typing.Optional[UpdateSchedulingSettingsRequestHostReassignment] = OMIT, + out_of_office_reasons: typing.Optional[ + typing.Sequence[UpdateSchedulingSettingsRequestOutOfOfficeReasonsItem] + ] = OMIT, notifications: typing.Optional[ typing.Dict[str, typing.Optional[UpdateSchedulingSettingsRequestNotificationsValue]] ] = OMIT, @@ -95,6 +105,9 @@ def update( logo : typing.Optional[UpdateSchedulingSettingsRequestLogo] Your logo, a PNG or JPEG. `null` removes it. + privacy_url : typing.Optional[str] + Your privacy policy, as an https URL, for hosts connecting a calendar through your own OAuth app. `null` removes it. + email_from : typing.Optional[str] Sender of booking emails, on a verified domain. `null`: coss.com's own address. @@ -104,6 +117,15 @@ def update( calendar_failure_mode : typing.Optional[UpdateSchedulingSettingsRequestCalendarFailureMode] When a host's calendar can't be read: `hide` stops offering them, `last_known` keeps offering their last known times. + name_host_in_attendee_emails : typing.Optional[bool] + Name the new host when telling an attendee their booking has one. + + host_reassignment : typing.Optional[UpdateSchedulingSettingsRequestHostReassignment] + Whether hosts can give their own bookings to someone else from their page. `eligible` lets them, to anyone free who takes that event type. + + out_of_office_reasons : typing.Optional[typing.Sequence[UpdateSchedulingSettingsRequestOutOfOfficeReasonsItem]] + Reasons of your own, on top of the preset ones. Hosts and managers see them. + notifications : typing.Optional[typing.Dict[str, typing.Optional[UpdateSchedulingSettingsRequestNotificationsValue]]] Per event (`confirmed`, `pending_approval`, `rescheduled`, `cancelled`, `declined`, `reminder`), overriding the defaults. `null` restores them. @@ -138,9 +160,13 @@ def update( brand_name=brand_name, accent_color=accent_color, logo=logo, + privacy_url=privacy_url, email_from=email_from, sms_from=sms_from, calendar_failure_mode=calendar_failure_mode, + name_host_in_attendee_emails=name_host_in_attendee_emails, + host_reassignment=host_reassignment, + out_of_office_reasons=out_of_office_reasons, notifications=notifications, email_reply_to=email_reply_to, reminders=reminders, @@ -206,9 +232,15 @@ async def update( brand_name: typing.Optional[str] = OMIT, accent_color: typing.Optional[str] = OMIT, logo: typing.Optional[UpdateSchedulingSettingsRequestLogo] = OMIT, + privacy_url: typing.Optional[str] = OMIT, email_from: typing.Optional[str] = OMIT, sms_from: typing.Optional[str] = OMIT, calendar_failure_mode: typing.Optional[UpdateSchedulingSettingsRequestCalendarFailureMode] = OMIT, + name_host_in_attendee_emails: typing.Optional[bool] = OMIT, + host_reassignment: typing.Optional[UpdateSchedulingSettingsRequestHostReassignment] = OMIT, + out_of_office_reasons: typing.Optional[ + typing.Sequence[UpdateSchedulingSettingsRequestOutOfOfficeReasonsItem] + ] = OMIT, notifications: typing.Optional[ typing.Dict[str, typing.Optional[UpdateSchedulingSettingsRequestNotificationsValue]] ] = OMIT, @@ -233,6 +265,9 @@ async def update( logo : typing.Optional[UpdateSchedulingSettingsRequestLogo] Your logo, a PNG or JPEG. `null` removes it. + privacy_url : typing.Optional[str] + Your privacy policy, as an https URL, for hosts connecting a calendar through your own OAuth app. `null` removes it. + email_from : typing.Optional[str] Sender of booking emails, on a verified domain. `null`: coss.com's own address. @@ -242,6 +277,15 @@ async def update( calendar_failure_mode : typing.Optional[UpdateSchedulingSettingsRequestCalendarFailureMode] When a host's calendar can't be read: `hide` stops offering them, `last_known` keeps offering their last known times. + name_host_in_attendee_emails : typing.Optional[bool] + Name the new host when telling an attendee their booking has one. + + host_reassignment : typing.Optional[UpdateSchedulingSettingsRequestHostReassignment] + Whether hosts can give their own bookings to someone else from their page. `eligible` lets them, to anyone free who takes that event type. + + out_of_office_reasons : typing.Optional[typing.Sequence[UpdateSchedulingSettingsRequestOutOfOfficeReasonsItem]] + Reasons of your own, on top of the preset ones. Hosts and managers see them. + notifications : typing.Optional[typing.Dict[str, typing.Optional[UpdateSchedulingSettingsRequestNotificationsValue]]] Per event (`confirmed`, `pending_approval`, `rescheduled`, `cancelled`, `declined`, `reminder`), overriding the defaults. `null` restores them. @@ -284,9 +328,13 @@ async def main() -> None: brand_name=brand_name, accent_color=accent_color, logo=logo, + privacy_url=privacy_url, email_from=email_from, sms_from=sms_from, calendar_failure_mode=calendar_failure_mode, + name_host_in_attendee_emails=name_host_in_attendee_emails, + host_reassignment=host_reassignment, + out_of_office_reasons=out_of_office_reasons, notifications=notifications, email_reply_to=email_reply_to, reminders=reminders, diff --git a/sdks/python/src/coss/resources/scheduling/resources/settings/raw_client.py b/sdks/python/src/coss/resources/scheduling/resources/settings/raw_client.py index 27dd8a64c..abfaa501b 100644 --- a/sdks/python/src/coss/resources/scheduling/resources/settings/raw_client.py +++ b/sdks/python/src/coss/resources/scheduling/resources/settings/raw_client.py @@ -24,10 +24,14 @@ from .types.update_scheduling_settings_request_calendar_failure_mode import ( UpdateSchedulingSettingsRequestCalendarFailureMode, ) +from .types.update_scheduling_settings_request_host_reassignment import UpdateSchedulingSettingsRequestHostReassignment from .types.update_scheduling_settings_request_logo import UpdateSchedulingSettingsRequestLogo from .types.update_scheduling_settings_request_notifications_value import ( UpdateSchedulingSettingsRequestNotificationsValue, ) +from .types.update_scheduling_settings_request_out_of_office_reasons_item import ( + UpdateSchedulingSettingsRequestOutOfOfficeReasonsItem, +) from pydantic import ValidationError # this is used as the default value for optional parameters @@ -149,9 +153,15 @@ def update( brand_name: typing.Optional[str] = OMIT, accent_color: typing.Optional[str] = OMIT, logo: typing.Optional[UpdateSchedulingSettingsRequestLogo] = OMIT, + privacy_url: typing.Optional[str] = OMIT, email_from: typing.Optional[str] = OMIT, sms_from: typing.Optional[str] = OMIT, calendar_failure_mode: typing.Optional[UpdateSchedulingSettingsRequestCalendarFailureMode] = OMIT, + name_host_in_attendee_emails: typing.Optional[bool] = OMIT, + host_reassignment: typing.Optional[UpdateSchedulingSettingsRequestHostReassignment] = OMIT, + out_of_office_reasons: typing.Optional[ + typing.Sequence[UpdateSchedulingSettingsRequestOutOfOfficeReasonsItem] + ] = OMIT, notifications: typing.Optional[ typing.Dict[str, typing.Optional[UpdateSchedulingSettingsRequestNotificationsValue]] ] = OMIT, @@ -176,6 +186,9 @@ def update( logo : typing.Optional[UpdateSchedulingSettingsRequestLogo] Your logo, a PNG or JPEG. `null` removes it. + privacy_url : typing.Optional[str] + Your privacy policy, as an https URL, for hosts connecting a calendar through your own OAuth app. `null` removes it. + email_from : typing.Optional[str] Sender of booking emails, on a verified domain. `null`: coss.com's own address. @@ -185,6 +198,15 @@ def update( calendar_failure_mode : typing.Optional[UpdateSchedulingSettingsRequestCalendarFailureMode] When a host's calendar can't be read: `hide` stops offering them, `last_known` keeps offering their last known times. + name_host_in_attendee_emails : typing.Optional[bool] + Name the new host when telling an attendee their booking has one. + + host_reassignment : typing.Optional[UpdateSchedulingSettingsRequestHostReassignment] + Whether hosts can give their own bookings to someone else from their page. `eligible` lets them, to anyone free who takes that event type. + + out_of_office_reasons : typing.Optional[typing.Sequence[UpdateSchedulingSettingsRequestOutOfOfficeReasonsItem]] + Reasons of your own, on top of the preset ones. Hosts and managers see them. + notifications : typing.Optional[typing.Dict[str, typing.Optional[UpdateSchedulingSettingsRequestNotificationsValue]]] Per event (`confirmed`, `pending_approval`, `rescheduled`, `cancelled`, `declined`, `reminder`), overriding the defaults. `null` restores them. @@ -212,9 +234,17 @@ def update( "logo": convert_and_respect_annotation_metadata( object_=logo, annotation=typing.Optional[UpdateSchedulingSettingsRequestLogo], direction="write" ), + "privacy_url": privacy_url, "email_from": email_from, "sms_from": sms_from, "calendar_failure_mode": calendar_failure_mode, + "name_host_in_attendee_emails": name_host_in_attendee_emails, + "host_reassignment": host_reassignment, + "out_of_office_reasons": convert_and_respect_annotation_metadata( + object_=out_of_office_reasons, + annotation=typing.Optional[typing.Sequence[UpdateSchedulingSettingsRequestOutOfOfficeReasonsItem]], + direction="write", + ), "notifications": convert_and_respect_annotation_metadata( object_=notifications, annotation=typing.Optional[ @@ -460,9 +490,15 @@ async def update( brand_name: typing.Optional[str] = OMIT, accent_color: typing.Optional[str] = OMIT, logo: typing.Optional[UpdateSchedulingSettingsRequestLogo] = OMIT, + privacy_url: typing.Optional[str] = OMIT, email_from: typing.Optional[str] = OMIT, sms_from: typing.Optional[str] = OMIT, calendar_failure_mode: typing.Optional[UpdateSchedulingSettingsRequestCalendarFailureMode] = OMIT, + name_host_in_attendee_emails: typing.Optional[bool] = OMIT, + host_reassignment: typing.Optional[UpdateSchedulingSettingsRequestHostReassignment] = OMIT, + out_of_office_reasons: typing.Optional[ + typing.Sequence[UpdateSchedulingSettingsRequestOutOfOfficeReasonsItem] + ] = OMIT, notifications: typing.Optional[ typing.Dict[str, typing.Optional[UpdateSchedulingSettingsRequestNotificationsValue]] ] = OMIT, @@ -487,6 +523,9 @@ async def update( logo : typing.Optional[UpdateSchedulingSettingsRequestLogo] Your logo, a PNG or JPEG. `null` removes it. + privacy_url : typing.Optional[str] + Your privacy policy, as an https URL, for hosts connecting a calendar through your own OAuth app. `null` removes it. + email_from : typing.Optional[str] Sender of booking emails, on a verified domain. `null`: coss.com's own address. @@ -496,6 +535,15 @@ async def update( calendar_failure_mode : typing.Optional[UpdateSchedulingSettingsRequestCalendarFailureMode] When a host's calendar can't be read: `hide` stops offering them, `last_known` keeps offering their last known times. + name_host_in_attendee_emails : typing.Optional[bool] + Name the new host when telling an attendee their booking has one. + + host_reassignment : typing.Optional[UpdateSchedulingSettingsRequestHostReassignment] + Whether hosts can give their own bookings to someone else from their page. `eligible` lets them, to anyone free who takes that event type. + + out_of_office_reasons : typing.Optional[typing.Sequence[UpdateSchedulingSettingsRequestOutOfOfficeReasonsItem]] + Reasons of your own, on top of the preset ones. Hosts and managers see them. + notifications : typing.Optional[typing.Dict[str, typing.Optional[UpdateSchedulingSettingsRequestNotificationsValue]]] Per event (`confirmed`, `pending_approval`, `rescheduled`, `cancelled`, `declined`, `reminder`), overriding the defaults. `null` restores them. @@ -523,9 +571,17 @@ async def update( "logo": convert_and_respect_annotation_metadata( object_=logo, annotation=typing.Optional[UpdateSchedulingSettingsRequestLogo], direction="write" ), + "privacy_url": privacy_url, "email_from": email_from, "sms_from": sms_from, "calendar_failure_mode": calendar_failure_mode, + "name_host_in_attendee_emails": name_host_in_attendee_emails, + "host_reassignment": host_reassignment, + "out_of_office_reasons": convert_and_respect_annotation_metadata( + object_=out_of_office_reasons, + annotation=typing.Optional[typing.Sequence[UpdateSchedulingSettingsRequestOutOfOfficeReasonsItem]], + direction="write", + ), "notifications": convert_and_respect_annotation_metadata( object_=notifications, annotation=typing.Optional[ diff --git a/sdks/python/src/coss/resources/scheduling/resources/settings/types/__init__.py b/sdks/python/src/coss/resources/scheduling/resources/settings/types/__init__.py index 87274079c..d325f449e 100644 --- a/sdks/python/src/coss/resources/scheduling/resources/settings/types/__init__.py +++ b/sdks/python/src/coss/resources/scheduling/resources/settings/types/__init__.py @@ -9,14 +9,20 @@ from .update_scheduling_settings_request_calendar_failure_mode import ( UpdateSchedulingSettingsRequestCalendarFailureMode, ) + from .update_scheduling_settings_request_host_reassignment import UpdateSchedulingSettingsRequestHostReassignment from .update_scheduling_settings_request_logo import UpdateSchedulingSettingsRequestLogo from .update_scheduling_settings_request_notifications_value import ( UpdateSchedulingSettingsRequestNotificationsValue, ) + from .update_scheduling_settings_request_out_of_office_reasons_item import ( + UpdateSchedulingSettingsRequestOutOfOfficeReasonsItem, + ) _dynamic_imports: typing.Dict[str, str] = { "UpdateSchedulingSettingsRequestCalendarFailureMode": ".update_scheduling_settings_request_calendar_failure_mode", + "UpdateSchedulingSettingsRequestHostReassignment": ".update_scheduling_settings_request_host_reassignment", "UpdateSchedulingSettingsRequestLogo": ".update_scheduling_settings_request_logo", "UpdateSchedulingSettingsRequestNotificationsValue": ".update_scheduling_settings_request_notifications_value", + "UpdateSchedulingSettingsRequestOutOfOfficeReasonsItem": ".update_scheduling_settings_request_out_of_office_reasons_item", } @@ -43,6 +49,8 @@ def __dir__(): __all__ = [ "UpdateSchedulingSettingsRequestCalendarFailureMode", + "UpdateSchedulingSettingsRequestHostReassignment", "UpdateSchedulingSettingsRequestLogo", "UpdateSchedulingSettingsRequestNotificationsValue", + "UpdateSchedulingSettingsRequestOutOfOfficeReasonsItem", ] diff --git a/sdks/python/src/coss/resources/scheduling/resources/settings/types/update_scheduling_settings_request_host_reassignment.py b/sdks/python/src/coss/resources/scheduling/resources/settings/types/update_scheduling_settings_request_host_reassignment.py new file mode 100644 index 000000000..e1ff328f6 --- /dev/null +++ b/sdks/python/src/coss/resources/scheduling/resources/settings/types/update_scheduling_settings_request_host_reassignment.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +UpdateSchedulingSettingsRequestHostReassignment = typing.Union[typing.Literal["off", "eligible"], typing.Any] diff --git a/sdks/python/src/coss/resources/scheduling/resources/settings/types/update_scheduling_settings_request_out_of_office_reasons_item.py b/sdks/python/src/coss/resources/scheduling/resources/settings/types/update_scheduling_settings_request_out_of_office_reasons_item.py new file mode 100644 index 000000000..7ab2fb2c3 --- /dev/null +++ b/sdks/python/src/coss/resources/scheduling/resources/settings/types/update_scheduling_settings_request_out_of_office_reasons_item.py @@ -0,0 +1,24 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ......core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel + + +class UpdateSchedulingSettingsRequestOutOfOfficeReasonsItem(UniversalBaseModel): + key: str = pydantic.Field() + """ + One of `unspecified`, `vacation`, `travel`, `sick`, `public_holiday`, `parental_leave`, `training` and `other`, or a key from the settings' `out_of_office_reasons`. Only people who manage this host see it: never bookers, webhooks or calendars. + """ + + label: str + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/sdks/python/src/coss/resources/webhook_endpoints/types/create_webhook_endpoint_request_event_types_item.py b/sdks/python/src/coss/resources/webhook_endpoints/types/create_webhook_endpoint_request_event_types_item.py index b729cc595..da705b7f9 100644 --- a/sdks/python/src/coss/resources/webhook_endpoints/types/create_webhook_endpoint_request_event_types_item.py +++ b/sdks/python/src/coss/resources/webhook_endpoints/types/create_webhook_endpoint_request_event_types_item.py @@ -87,6 +87,7 @@ "scheduling.booking.external_conflict", "scheduling.booking.calendar_write_failed", "scheduling.booking.location_ready", + "scheduling.booking.reassigned", "scheduling.booking.started", "scheduling.booking.ended", "scheduling.booking.reminder", @@ -95,6 +96,14 @@ "scheduling.calendar.disconnected", "scheduling.calendar_delegation.failing", "scheduling.calendar_delegation.restored", + "scheduling.out_of_office.created", + "scheduling.out_of_office.updated", + "scheduling.out_of_office.deleted", + "scheduling.out_of_office.started", + "scheduling.out_of_office.ended", + "scheduling.reassignment.completed", + "scheduling.oauth_app.failing", + "scheduling.oauth_app.restored", ], typing.Any, ] diff --git a/sdks/python/src/coss/resources/webhook_endpoints/types/update_webhook_endpoint_request_event_types_item.py b/sdks/python/src/coss/resources/webhook_endpoints/types/update_webhook_endpoint_request_event_types_item.py index 8545ae075..49a0670ae 100644 --- a/sdks/python/src/coss/resources/webhook_endpoints/types/update_webhook_endpoint_request_event_types_item.py +++ b/sdks/python/src/coss/resources/webhook_endpoints/types/update_webhook_endpoint_request_event_types_item.py @@ -87,6 +87,7 @@ "scheduling.booking.external_conflict", "scheduling.booking.calendar_write_failed", "scheduling.booking.location_ready", + "scheduling.booking.reassigned", "scheduling.booking.started", "scheduling.booking.ended", "scheduling.booking.reminder", @@ -95,6 +96,14 @@ "scheduling.calendar.disconnected", "scheduling.calendar_delegation.failing", "scheduling.calendar_delegation.restored", + "scheduling.out_of_office.created", + "scheduling.out_of_office.updated", + "scheduling.out_of_office.deleted", + "scheduling.out_of_office.started", + "scheduling.out_of_office.ended", + "scheduling.reassignment.completed", + "scheduling.oauth_app.failing", + "scheduling.oauth_app.restored", ], typing.Any, ] diff --git a/sdks/python/src/coss/resources/webhook_events/types/create_test_webhook_event_request_type.py b/sdks/python/src/coss/resources/webhook_events/types/create_test_webhook_event_request_type.py index 669b3258c..556cb4b13 100644 --- a/sdks/python/src/coss/resources/webhook_events/types/create_test_webhook_event_request_type.py +++ b/sdks/python/src/coss/resources/webhook_events/types/create_test_webhook_event_request_type.py @@ -87,6 +87,7 @@ "scheduling.booking.external_conflict", "scheduling.booking.calendar_write_failed", "scheduling.booking.location_ready", + "scheduling.booking.reassigned", "scheduling.booking.started", "scheduling.booking.ended", "scheduling.booking.reminder", @@ -95,6 +96,14 @@ "scheduling.calendar.disconnected", "scheduling.calendar_delegation.failing", "scheduling.calendar_delegation.restored", + "scheduling.out_of_office.created", + "scheduling.out_of_office.updated", + "scheduling.out_of_office.deleted", + "scheduling.out_of_office.started", + "scheduling.out_of_office.ended", + "scheduling.reassignment.completed", + "scheduling.oauth_app.failing", + "scheduling.oauth_app.restored", ], typing.Any, ] diff --git a/sdks/python/src/coss/resources/webhook_listeners/types/create_webhook_listener_request_event_types_item.py b/sdks/python/src/coss/resources/webhook_listeners/types/create_webhook_listener_request_event_types_item.py index 84db17ad8..6385e3ace 100644 --- a/sdks/python/src/coss/resources/webhook_listeners/types/create_webhook_listener_request_event_types_item.py +++ b/sdks/python/src/coss/resources/webhook_listeners/types/create_webhook_listener_request_event_types_item.py @@ -87,6 +87,7 @@ "scheduling.booking.external_conflict", "scheduling.booking.calendar_write_failed", "scheduling.booking.location_ready", + "scheduling.booking.reassigned", "scheduling.booking.started", "scheduling.booking.ended", "scheduling.booking.reminder", @@ -95,6 +96,14 @@ "scheduling.calendar.disconnected", "scheduling.calendar_delegation.failing", "scheduling.calendar_delegation.restored", + "scheduling.out_of_office.created", + "scheduling.out_of_office.updated", + "scheduling.out_of_office.deleted", + "scheduling.out_of_office.started", + "scheduling.out_of_office.ended", + "scheduling.reassignment.completed", + "scheduling.oauth_app.failing", + "scheduling.oauth_app.restored", ], typing.Any, ] diff --git a/sdks/python/src/coss/types/__init__.py b/sdks/python/src/coss/types/__init__.py index 6363cb55d..7b9eade80 100644 --- a/sdks/python/src/coss/types/__init__.py +++ b/sdks/python/src/coss/types/__init__.py @@ -151,6 +151,15 @@ ) from .create_calendar_delegation_request_google import CreateCalendarDelegationRequestGoogle from .create_calendar_delegation_request_microsoft import CreateCalendarDelegationRequestMicrosoft + from .create_oauth_app_request import ( + CreateOauthAppRequest, + CreateOauthAppRequest_Google, + CreateOauthAppRequest_Microsoft, + CreateOauthAppRequest_Zoom, + ) + from .create_oauth_app_request_google import CreateOauthAppRequestGoogle + from .create_oauth_app_request_microsoft import CreateOauthAppRequestMicrosoft + from .create_oauth_app_request_zoom import CreateOauthAppRequestZoom from .create_series_request import CreateSeriesRequest from .create_series_request_answers_value import CreateSeriesRequestAnswersValue from .create_series_request_attributes_value import CreateSeriesRequestAttributesValue @@ -225,8 +234,13 @@ from .deleted_scheduling_calendar_connection_object import DeletedSchedulingCalendarConnectionObject from .deleted_scheduling_calendar_delegation import DeletedSchedulingCalendarDelegation from .deleted_scheduling_calendar_delegation_object import DeletedSchedulingCalendarDelegationObject + from .deleted_scheduling_holiday_calendar import DeletedSchedulingHolidayCalendar from .deleted_scheduling_host import DeletedSchedulingHost from .deleted_scheduling_host_object import DeletedSchedulingHostObject + from .deleted_scheduling_oauth_app import DeletedSchedulingOauthApp + from .deleted_scheduling_oauth_app_object import DeletedSchedulingOauthAppObject + from .deleted_scheduling_out_of_office import DeletedSchedulingOutOfOffice + from .deleted_scheduling_out_of_office_object import DeletedSchedulingOutOfOfficeObject from .deleted_scheduling_schedule import DeletedSchedulingSchedule from .deleted_scheduling_schedule_object import DeletedSchedulingScheduleObject from .deleted_segment import DeletedSegment @@ -756,6 +770,16 @@ from .scheduling_event_type_object import SchedulingEventTypeObject from .scheduling_event_type_status import SchedulingEventTypeStatus from .scheduling_guest_input import SchedulingGuestInput + from .scheduling_holiday_calendar import SchedulingHolidayCalendar + from .scheduling_holiday_calendar_existing_bookings import SchedulingHolidayCalendarExistingBookings + from .scheduling_holiday_calendar_host_filter_value import SchedulingHolidayCalendarHostFilterValue + from .scheduling_holiday_calendar_list import SchedulingHolidayCalendarList + from .scheduling_holiday_calendar_list_object import SchedulingHolidayCalendarListObject + from .scheduling_holiday_calendar_object import SchedulingHolidayCalendarObject + from .scheduling_holiday_calendar_source import SchedulingHolidayCalendarSource + from .scheduling_holiday_list import SchedulingHolidayList + from .scheduling_holiday_list_data_item import SchedulingHolidayListDataItem + from .scheduling_holiday_list_object import SchedulingHolidayListObject from .scheduling_host import SchedulingHost from .scheduling_host_attributes_value import SchedulingHostAttributesValue from .scheduling_host_list import SchedulingHostList @@ -774,23 +798,77 @@ from .scheduling_limit import SchedulingLimit from .scheduling_limit_period import SchedulingLimitPeriod from .scheduling_limit_scope import SchedulingLimitScope - from .scheduling_location import ( - SchedulingLocation, - SchedulingLocation_GoogleMeet, - SchedulingLocation_InPerson, - SchedulingLocation_Link, - SchedulingLocation_MicrosoftTeams, - SchedulingLocation_Phone, - SchedulingLocation_Zoom, - ) - from .scheduling_location_google_meet import SchedulingLocationGoogleMeet - from .scheduling_location_in_person import SchedulingLocationInPerson - from .scheduling_location_link import SchedulingLocationLink - from .scheduling_location_microsoft_teams import SchedulingLocationMicrosoftTeams - from .scheduling_location_phone import SchedulingLocationPhone - from .scheduling_location_zoom import SchedulingLocationZoom + from .scheduling_location import SchedulingLocation + from .scheduling_location_address import SchedulingLocationAddress + from .scheduling_location_address_type import SchedulingLocationAddressType + from .scheduling_location_five import SchedulingLocationFive + from .scheduling_location_five_type import SchedulingLocationFiveType + from .scheduling_location_four import SchedulingLocationFour + from .scheduling_location_four_type import SchedulingLocationFourType + from .scheduling_location_number import SchedulingLocationNumber + from .scheduling_location_number_type import SchedulingLocationNumberType + from .scheduling_location_three import SchedulingLocationThree + from .scheduling_location_three_type import SchedulingLocationThreeType + from .scheduling_location_zero import SchedulingLocationZero + from .scheduling_location_zero_type import SchedulingLocationZeroType + from .scheduling_oauth_app import SchedulingOauthApp + from .scheduling_oauth_app_list import SchedulingOauthAppList + from .scheduling_oauth_app_list_object import SchedulingOauthAppListObject + from .scheduling_oauth_app_object import SchedulingOauthAppObject + from .scheduling_oauth_app_provider import SchedulingOauthAppProvider + from .scheduling_oauth_app_status import SchedulingOauthAppStatus + from .scheduling_oauth_app_webhook_event import SchedulingOauthAppWebhookEvent + from .scheduling_oauth_app_webhook_event_data import SchedulingOauthAppWebhookEventData + from .scheduling_oauth_app_webhook_event_object import SchedulingOauthAppWebhookEventObject + from .scheduling_oauth_app_webhook_event_type import SchedulingOauthAppWebhookEventType + from .scheduling_out_of_office import SchedulingOutOfOffice + from .scheduling_out_of_office_all_day import SchedulingOutOfOfficeAllDay + from .scheduling_out_of_office_conflict import SchedulingOutOfOfficeConflict + from .scheduling_out_of_office_conflict_list import SchedulingOutOfOfficeConflictList + from .scheduling_out_of_office_conflict_list_object import SchedulingOutOfOfficeConflictListObject + from .scheduling_out_of_office_conflict_object import SchedulingOutOfOfficeConflictObject + from .scheduling_out_of_office_conflict_status import SchedulingOutOfOfficeConflictStatus + from .scheduling_out_of_office_existing_bookings import SchedulingOutOfOfficeExistingBookings + from .scheduling_out_of_office_list import SchedulingOutOfOfficeList + from .scheduling_out_of_office_list_object import SchedulingOutOfOfficeListObject + from .scheduling_out_of_office_object import SchedulingOutOfOfficeObject + from .scheduling_out_of_office_source import SchedulingOutOfOfficeSource + from .scheduling_out_of_office_webhook_event import SchedulingOutOfOfficeWebhookEvent + from .scheduling_out_of_office_webhook_event_data import SchedulingOutOfOfficeWebhookEventData + from .scheduling_out_of_office_webhook_event_object import SchedulingOutOfOfficeWebhookEventObject + from .scheduling_out_of_office_webhook_event_type import SchedulingOutOfOfficeWebhookEventType from .scheduling_question import SchedulingQuestion from .scheduling_question_type import SchedulingQuestionType + from .scheduling_reassign_candidate import SchedulingReassignCandidate + from .scheduling_reassign_candidate_list import SchedulingReassignCandidateList + from .scheduling_reassign_candidate_list_object import SchedulingReassignCandidateListObject + from .scheduling_reassign_candidate_object import SchedulingReassignCandidateObject + from .scheduling_reassignment import SchedulingReassignment + from .scheduling_reassignment_counts import SchedulingReassignmentCounts + from .scheduling_reassignment_item import SchedulingReassignmentItem + from .scheduling_reassignment_item_list import SchedulingReassignmentItemList + from .scheduling_reassignment_item_list_object import SchedulingReassignmentItemListObject + from .scheduling_reassignment_item_object import SchedulingReassignmentItemObject + from .scheduling_reassignment_item_outcome import SchedulingReassignmentItemOutcome + from .scheduling_reassignment_list import SchedulingReassignmentList + from .scheduling_reassignment_list_object import SchedulingReassignmentListObject + from .scheduling_reassignment_object import SchedulingReassignmentObject + from .scheduling_reassignment_preview import SchedulingReassignmentPreview + from .scheduling_reassignment_preview_items_item import SchedulingReassignmentPreviewItemsItem + from .scheduling_reassignment_preview_items_item_status import SchedulingReassignmentPreviewItemsItemStatus + from .scheduling_reassignment_preview_object import SchedulingReassignmentPreviewObject + from .scheduling_reassignment_reason_code import SchedulingReassignmentReasonCode + from .scheduling_reassignment_selection import SchedulingReassignmentSelection + from .scheduling_reassignment_status import SchedulingReassignmentStatus + from .scheduling_reassignment_strategy import SchedulingReassignmentStrategy + from .scheduling_reassignment_strategy_assignments_item import SchedulingReassignmentStrategyAssignmentsItem + from .scheduling_reassignment_strategy_otherwise import SchedulingReassignmentStrategyOtherwise + from .scheduling_reassignment_webhook_event import SchedulingReassignmentWebhookEvent + from .scheduling_reassignment_webhook_event_data import SchedulingReassignmentWebhookEventData + from .scheduling_reassignment_webhook_event_data_counts import SchedulingReassignmentWebhookEventDataCounts + from .scheduling_reassignment_webhook_event_data_status import SchedulingReassignmentWebhookEventDataStatus + from .scheduling_reassignment_webhook_event_object import SchedulingReassignmentWebhookEventObject + from .scheduling_reassignment_webhook_event_type import SchedulingReassignmentWebhookEventType from .scheduling_reminder import SchedulingReminder from .scheduling_reminder_anchor import SchedulingReminderAnchor from .scheduling_reminder_button import SchedulingReminderButton @@ -821,10 +899,12 @@ from .scheduling_session_object import SchedulingSessionObject from .scheduling_settings import SchedulingSettings from .scheduling_settings_calendar_failure_mode import SchedulingSettingsCalendarFailureMode + from .scheduling_settings_host_reassignment import SchedulingSettingsHostReassignment from .scheduling_settings_logo import SchedulingSettingsLogo from .scheduling_settings_logo_content_type import SchedulingSettingsLogoContentType from .scheduling_settings_notifications_value import SchedulingSettingsNotificationsValue from .scheduling_settings_object import SchedulingSettingsObject + from .scheduling_settings_out_of_office_reasons_item import SchedulingSettingsOutOfOfficeReasonsItem from .scheduling_slot import SchedulingSlot from .scheduling_slot_explanation import SchedulingSlotExplanation from .scheduling_slot_explanation_hosts_item import SchedulingSlotExplanationHostsItem @@ -1276,6 +1356,13 @@ "CreateCalendarDelegationRequestMicrosoft": ".create_calendar_delegation_request_microsoft", "CreateCalendarDelegationRequest_Google": ".create_calendar_delegation_request", "CreateCalendarDelegationRequest_Microsoft": ".create_calendar_delegation_request", + "CreateOauthAppRequest": ".create_oauth_app_request", + "CreateOauthAppRequestGoogle": ".create_oauth_app_request_google", + "CreateOauthAppRequestMicrosoft": ".create_oauth_app_request_microsoft", + "CreateOauthAppRequestZoom": ".create_oauth_app_request_zoom", + "CreateOauthAppRequest_Google": ".create_oauth_app_request", + "CreateOauthAppRequest_Microsoft": ".create_oauth_app_request", + "CreateOauthAppRequest_Zoom": ".create_oauth_app_request", "CreateSeriesRequest": ".create_series_request", "CreateSeriesRequestAnswersValue": ".create_series_request_answers_value", "CreateSeriesRequestAttributesValue": ".create_series_request_attributes_value", @@ -1348,8 +1435,13 @@ "DeletedSchedulingCalendarConnectionObject": ".deleted_scheduling_calendar_connection_object", "DeletedSchedulingCalendarDelegation": ".deleted_scheduling_calendar_delegation", "DeletedSchedulingCalendarDelegationObject": ".deleted_scheduling_calendar_delegation_object", + "DeletedSchedulingHolidayCalendar": ".deleted_scheduling_holiday_calendar", "DeletedSchedulingHost": ".deleted_scheduling_host", "DeletedSchedulingHostObject": ".deleted_scheduling_host_object", + "DeletedSchedulingOauthApp": ".deleted_scheduling_oauth_app", + "DeletedSchedulingOauthAppObject": ".deleted_scheduling_oauth_app_object", + "DeletedSchedulingOutOfOffice": ".deleted_scheduling_out_of_office", + "DeletedSchedulingOutOfOfficeObject": ".deleted_scheduling_out_of_office_object", "DeletedSchedulingSchedule": ".deleted_scheduling_schedule", "DeletedSchedulingScheduleObject": ".deleted_scheduling_schedule_object", "DeletedSegment": ".deleted_segment", @@ -1877,6 +1969,16 @@ "SchedulingEventTypeObject": ".scheduling_event_type_object", "SchedulingEventTypeStatus": ".scheduling_event_type_status", "SchedulingGuestInput": ".scheduling_guest_input", + "SchedulingHolidayCalendar": ".scheduling_holiday_calendar", + "SchedulingHolidayCalendarExistingBookings": ".scheduling_holiday_calendar_existing_bookings", + "SchedulingHolidayCalendarHostFilterValue": ".scheduling_holiday_calendar_host_filter_value", + "SchedulingHolidayCalendarList": ".scheduling_holiday_calendar_list", + "SchedulingHolidayCalendarListObject": ".scheduling_holiday_calendar_list_object", + "SchedulingHolidayCalendarObject": ".scheduling_holiday_calendar_object", + "SchedulingHolidayCalendarSource": ".scheduling_holiday_calendar_source", + "SchedulingHolidayList": ".scheduling_holiday_list", + "SchedulingHolidayListDataItem": ".scheduling_holiday_list_data_item", + "SchedulingHolidayListObject": ".scheduling_holiday_list_object", "SchedulingHost": ".scheduling_host", "SchedulingHostAttributesValue": ".scheduling_host_attributes_value", "SchedulingHostList": ".scheduling_host_list", @@ -1894,20 +1996,76 @@ "SchedulingLimitPeriod": ".scheduling_limit_period", "SchedulingLimitScope": ".scheduling_limit_scope", "SchedulingLocation": ".scheduling_location", - "SchedulingLocationGoogleMeet": ".scheduling_location_google_meet", - "SchedulingLocationInPerson": ".scheduling_location_in_person", - "SchedulingLocationLink": ".scheduling_location_link", - "SchedulingLocationMicrosoftTeams": ".scheduling_location_microsoft_teams", - "SchedulingLocationPhone": ".scheduling_location_phone", - "SchedulingLocationZoom": ".scheduling_location_zoom", - "SchedulingLocation_GoogleMeet": ".scheduling_location", - "SchedulingLocation_InPerson": ".scheduling_location", - "SchedulingLocation_Link": ".scheduling_location", - "SchedulingLocation_MicrosoftTeams": ".scheduling_location", - "SchedulingLocation_Phone": ".scheduling_location", - "SchedulingLocation_Zoom": ".scheduling_location", + "SchedulingLocationAddress": ".scheduling_location_address", + "SchedulingLocationAddressType": ".scheduling_location_address_type", + "SchedulingLocationFive": ".scheduling_location_five", + "SchedulingLocationFiveType": ".scheduling_location_five_type", + "SchedulingLocationFour": ".scheduling_location_four", + "SchedulingLocationFourType": ".scheduling_location_four_type", + "SchedulingLocationNumber": ".scheduling_location_number", + "SchedulingLocationNumberType": ".scheduling_location_number_type", + "SchedulingLocationThree": ".scheduling_location_three", + "SchedulingLocationThreeType": ".scheduling_location_three_type", + "SchedulingLocationZero": ".scheduling_location_zero", + "SchedulingLocationZeroType": ".scheduling_location_zero_type", + "SchedulingOauthApp": ".scheduling_oauth_app", + "SchedulingOauthAppList": ".scheduling_oauth_app_list", + "SchedulingOauthAppListObject": ".scheduling_oauth_app_list_object", + "SchedulingOauthAppObject": ".scheduling_oauth_app_object", + "SchedulingOauthAppProvider": ".scheduling_oauth_app_provider", + "SchedulingOauthAppStatus": ".scheduling_oauth_app_status", + "SchedulingOauthAppWebhookEvent": ".scheduling_oauth_app_webhook_event", + "SchedulingOauthAppWebhookEventData": ".scheduling_oauth_app_webhook_event_data", + "SchedulingOauthAppWebhookEventObject": ".scheduling_oauth_app_webhook_event_object", + "SchedulingOauthAppWebhookEventType": ".scheduling_oauth_app_webhook_event_type", + "SchedulingOutOfOffice": ".scheduling_out_of_office", + "SchedulingOutOfOfficeAllDay": ".scheduling_out_of_office_all_day", + "SchedulingOutOfOfficeConflict": ".scheduling_out_of_office_conflict", + "SchedulingOutOfOfficeConflictList": ".scheduling_out_of_office_conflict_list", + "SchedulingOutOfOfficeConflictListObject": ".scheduling_out_of_office_conflict_list_object", + "SchedulingOutOfOfficeConflictObject": ".scheduling_out_of_office_conflict_object", + "SchedulingOutOfOfficeConflictStatus": ".scheduling_out_of_office_conflict_status", + "SchedulingOutOfOfficeExistingBookings": ".scheduling_out_of_office_existing_bookings", + "SchedulingOutOfOfficeList": ".scheduling_out_of_office_list", + "SchedulingOutOfOfficeListObject": ".scheduling_out_of_office_list_object", + "SchedulingOutOfOfficeObject": ".scheduling_out_of_office_object", + "SchedulingOutOfOfficeSource": ".scheduling_out_of_office_source", + "SchedulingOutOfOfficeWebhookEvent": ".scheduling_out_of_office_webhook_event", + "SchedulingOutOfOfficeWebhookEventData": ".scheduling_out_of_office_webhook_event_data", + "SchedulingOutOfOfficeWebhookEventObject": ".scheduling_out_of_office_webhook_event_object", + "SchedulingOutOfOfficeWebhookEventType": ".scheduling_out_of_office_webhook_event_type", "SchedulingQuestion": ".scheduling_question", "SchedulingQuestionType": ".scheduling_question_type", + "SchedulingReassignCandidate": ".scheduling_reassign_candidate", + "SchedulingReassignCandidateList": ".scheduling_reassign_candidate_list", + "SchedulingReassignCandidateListObject": ".scheduling_reassign_candidate_list_object", + "SchedulingReassignCandidateObject": ".scheduling_reassign_candidate_object", + "SchedulingReassignment": ".scheduling_reassignment", + "SchedulingReassignmentCounts": ".scheduling_reassignment_counts", + "SchedulingReassignmentItem": ".scheduling_reassignment_item", + "SchedulingReassignmentItemList": ".scheduling_reassignment_item_list", + "SchedulingReassignmentItemListObject": ".scheduling_reassignment_item_list_object", + "SchedulingReassignmentItemObject": ".scheduling_reassignment_item_object", + "SchedulingReassignmentItemOutcome": ".scheduling_reassignment_item_outcome", + "SchedulingReassignmentList": ".scheduling_reassignment_list", + "SchedulingReassignmentListObject": ".scheduling_reassignment_list_object", + "SchedulingReassignmentObject": ".scheduling_reassignment_object", + "SchedulingReassignmentPreview": ".scheduling_reassignment_preview", + "SchedulingReassignmentPreviewItemsItem": ".scheduling_reassignment_preview_items_item", + "SchedulingReassignmentPreviewItemsItemStatus": ".scheduling_reassignment_preview_items_item_status", + "SchedulingReassignmentPreviewObject": ".scheduling_reassignment_preview_object", + "SchedulingReassignmentReasonCode": ".scheduling_reassignment_reason_code", + "SchedulingReassignmentSelection": ".scheduling_reassignment_selection", + "SchedulingReassignmentStatus": ".scheduling_reassignment_status", + "SchedulingReassignmentStrategy": ".scheduling_reassignment_strategy", + "SchedulingReassignmentStrategyAssignmentsItem": ".scheduling_reassignment_strategy_assignments_item", + "SchedulingReassignmentStrategyOtherwise": ".scheduling_reassignment_strategy_otherwise", + "SchedulingReassignmentWebhookEvent": ".scheduling_reassignment_webhook_event", + "SchedulingReassignmentWebhookEventData": ".scheduling_reassignment_webhook_event_data", + "SchedulingReassignmentWebhookEventDataCounts": ".scheduling_reassignment_webhook_event_data_counts", + "SchedulingReassignmentWebhookEventDataStatus": ".scheduling_reassignment_webhook_event_data_status", + "SchedulingReassignmentWebhookEventObject": ".scheduling_reassignment_webhook_event_object", + "SchedulingReassignmentWebhookEventType": ".scheduling_reassignment_webhook_event_type", "SchedulingReminder": ".scheduling_reminder", "SchedulingReminderAnchor": ".scheduling_reminder_anchor", "SchedulingReminderButton": ".scheduling_reminder_button", @@ -1938,10 +2096,12 @@ "SchedulingSessionObject": ".scheduling_session_object", "SchedulingSettings": ".scheduling_settings", "SchedulingSettingsCalendarFailureMode": ".scheduling_settings_calendar_failure_mode", + "SchedulingSettingsHostReassignment": ".scheduling_settings_host_reassignment", "SchedulingSettingsLogo": ".scheduling_settings_logo", "SchedulingSettingsLogoContentType": ".scheduling_settings_logo_content_type", "SchedulingSettingsNotificationsValue": ".scheduling_settings_notifications_value", "SchedulingSettingsObject": ".scheduling_settings_object", + "SchedulingSettingsOutOfOfficeReasonsItem": ".scheduling_settings_out_of_office_reasons_item", "SchedulingSlot": ".scheduling_slot", "SchedulingSlotExplanation": ".scheduling_slot_explanation", "SchedulingSlotExplanationHostsItem": ".scheduling_slot_explanation_hosts_item", @@ -2389,6 +2549,13 @@ def __dir__(): "CreateCalendarDelegationRequestMicrosoft", "CreateCalendarDelegationRequest_Google", "CreateCalendarDelegationRequest_Microsoft", + "CreateOauthAppRequest", + "CreateOauthAppRequestGoogle", + "CreateOauthAppRequestMicrosoft", + "CreateOauthAppRequestZoom", + "CreateOauthAppRequest_Google", + "CreateOauthAppRequest_Microsoft", + "CreateOauthAppRequest_Zoom", "CreateSeriesRequest", "CreateSeriesRequestAnswersValue", "CreateSeriesRequestAttributesValue", @@ -2461,8 +2628,13 @@ def __dir__(): "DeletedSchedulingCalendarConnectionObject", "DeletedSchedulingCalendarDelegation", "DeletedSchedulingCalendarDelegationObject", + "DeletedSchedulingHolidayCalendar", "DeletedSchedulingHost", "DeletedSchedulingHostObject", + "DeletedSchedulingOauthApp", + "DeletedSchedulingOauthAppObject", + "DeletedSchedulingOutOfOffice", + "DeletedSchedulingOutOfOfficeObject", "DeletedSchedulingSchedule", "DeletedSchedulingScheduleObject", "DeletedSegment", @@ -2990,6 +3162,16 @@ def __dir__(): "SchedulingEventTypeObject", "SchedulingEventTypeStatus", "SchedulingGuestInput", + "SchedulingHolidayCalendar", + "SchedulingHolidayCalendarExistingBookings", + "SchedulingHolidayCalendarHostFilterValue", + "SchedulingHolidayCalendarList", + "SchedulingHolidayCalendarListObject", + "SchedulingHolidayCalendarObject", + "SchedulingHolidayCalendarSource", + "SchedulingHolidayList", + "SchedulingHolidayListDataItem", + "SchedulingHolidayListObject", "SchedulingHost", "SchedulingHostAttributesValue", "SchedulingHostList", @@ -3007,20 +3189,76 @@ def __dir__(): "SchedulingLimitPeriod", "SchedulingLimitScope", "SchedulingLocation", - "SchedulingLocationGoogleMeet", - "SchedulingLocationInPerson", - "SchedulingLocationLink", - "SchedulingLocationMicrosoftTeams", - "SchedulingLocationPhone", - "SchedulingLocationZoom", - "SchedulingLocation_GoogleMeet", - "SchedulingLocation_InPerson", - "SchedulingLocation_Link", - "SchedulingLocation_MicrosoftTeams", - "SchedulingLocation_Phone", - "SchedulingLocation_Zoom", + "SchedulingLocationAddress", + "SchedulingLocationAddressType", + "SchedulingLocationFive", + "SchedulingLocationFiveType", + "SchedulingLocationFour", + "SchedulingLocationFourType", + "SchedulingLocationNumber", + "SchedulingLocationNumberType", + "SchedulingLocationThree", + "SchedulingLocationThreeType", + "SchedulingLocationZero", + "SchedulingLocationZeroType", + "SchedulingOauthApp", + "SchedulingOauthAppList", + "SchedulingOauthAppListObject", + "SchedulingOauthAppObject", + "SchedulingOauthAppProvider", + "SchedulingOauthAppStatus", + "SchedulingOauthAppWebhookEvent", + "SchedulingOauthAppWebhookEventData", + "SchedulingOauthAppWebhookEventObject", + "SchedulingOauthAppWebhookEventType", + "SchedulingOutOfOffice", + "SchedulingOutOfOfficeAllDay", + "SchedulingOutOfOfficeConflict", + "SchedulingOutOfOfficeConflictList", + "SchedulingOutOfOfficeConflictListObject", + "SchedulingOutOfOfficeConflictObject", + "SchedulingOutOfOfficeConflictStatus", + "SchedulingOutOfOfficeExistingBookings", + "SchedulingOutOfOfficeList", + "SchedulingOutOfOfficeListObject", + "SchedulingOutOfOfficeObject", + "SchedulingOutOfOfficeSource", + "SchedulingOutOfOfficeWebhookEvent", + "SchedulingOutOfOfficeWebhookEventData", + "SchedulingOutOfOfficeWebhookEventObject", + "SchedulingOutOfOfficeWebhookEventType", "SchedulingQuestion", "SchedulingQuestionType", + "SchedulingReassignCandidate", + "SchedulingReassignCandidateList", + "SchedulingReassignCandidateListObject", + "SchedulingReassignCandidateObject", + "SchedulingReassignment", + "SchedulingReassignmentCounts", + "SchedulingReassignmentItem", + "SchedulingReassignmentItemList", + "SchedulingReassignmentItemListObject", + "SchedulingReassignmentItemObject", + "SchedulingReassignmentItemOutcome", + "SchedulingReassignmentList", + "SchedulingReassignmentListObject", + "SchedulingReassignmentObject", + "SchedulingReassignmentPreview", + "SchedulingReassignmentPreviewItemsItem", + "SchedulingReassignmentPreviewItemsItemStatus", + "SchedulingReassignmentPreviewObject", + "SchedulingReassignmentReasonCode", + "SchedulingReassignmentSelection", + "SchedulingReassignmentStatus", + "SchedulingReassignmentStrategy", + "SchedulingReassignmentStrategyAssignmentsItem", + "SchedulingReassignmentStrategyOtherwise", + "SchedulingReassignmentWebhookEvent", + "SchedulingReassignmentWebhookEventData", + "SchedulingReassignmentWebhookEventDataCounts", + "SchedulingReassignmentWebhookEventDataStatus", + "SchedulingReassignmentWebhookEventObject", + "SchedulingReassignmentWebhookEventType", "SchedulingReminder", "SchedulingReminderAnchor", "SchedulingReminderButton", @@ -3051,10 +3289,12 @@ def __dir__(): "SchedulingSessionObject", "SchedulingSettings", "SchedulingSettingsCalendarFailureMode", + "SchedulingSettingsHostReassignment", "SchedulingSettingsLogo", "SchedulingSettingsLogoContentType", "SchedulingSettingsNotificationsValue", "SchedulingSettingsObject", + "SchedulingSettingsOutOfOfficeReasonsItem", "SchedulingSlot", "SchedulingSlotExplanation", "SchedulingSlotExplanationHostsItem", diff --git a/sdks/python/src/coss/types/create_oauth_app_request.py b/sdks/python/src/coss/types/create_oauth_app_request.py new file mode 100644 index 000000000..bf453a97a --- /dev/null +++ b/sdks/python/src/coss/types/create_oauth_app_request.py @@ -0,0 +1,72 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations + +import datetime as dt +import typing + +import pydantic +import typing_extensions +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel + + +class CreateOauthAppRequest_Google(UniversalBaseModel): + provider: typing.Literal["google"] = "google" + client_id: str + client_secret: str + redirect_uri: typing.Optional[str] = None + completion_url: typing.Optional[str] = None + secret_expires_at: typing.Optional[dt.datetime] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class CreateOauthAppRequest_Microsoft(UniversalBaseModel): + provider: typing.Literal["microsoft"] = "microsoft" + client_id: str + client_secret: str + tenant_id: typing.Optional[str] = None + redirect_uri: typing.Optional[str] = None + completion_url: typing.Optional[str] = None + secret_expires_at: typing.Optional[dt.datetime] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class CreateOauthAppRequest_Zoom(UniversalBaseModel): + provider: typing.Literal["zoom"] = "zoom" + client_id: str + client_secret: str + webhook_secret: typing.Optional[str] = None + redirect_uri: typing.Optional[str] = None + completion_url: typing.Optional[str] = None + secret_expires_at: typing.Optional[dt.datetime] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +CreateOauthAppRequest = typing_extensions.Annotated[ + typing.Union[CreateOauthAppRequest_Google, CreateOauthAppRequest_Microsoft, CreateOauthAppRequest_Zoom], + pydantic.Field(discriminator="provider"), +] diff --git a/sdks/python/src/coss/types/create_oauth_app_request_google.py b/sdks/python/src/coss/types/create_oauth_app_request_google.py new file mode 100644 index 000000000..cb95829d2 --- /dev/null +++ b/sdks/python/src/coss/types/create_oauth_app_request_google.py @@ -0,0 +1,43 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel + + +class CreateOauthAppRequestGoogle(UniversalBaseModel): + client_id: str = pydantic.Field() + """ + The app's client ID at the provider. + """ + + client_secret: str = pydantic.Field() + """ + The app's client secret. Never returned. + """ + + redirect_uri: typing.Optional[str] = pydantic.Field(default=None) + """ + A page on your own domain, registered with the provider, that forwards `code` and `state` to `coss_callback_url`. Google requires this for an external app, since it has to verify the redirect's domain as yours. Leave it out to use `coss_callback_url` directly. + """ + + completion_url: typing.Optional[str] = pydantic.Field(default=None) + """ + Where the browser lands after a consent that didn't name a `return_url`, with `coss_calendar` set to `connected`, `denied` or `invalid`. Leave it out for a plain page saying what happened. + """ + + secret_expires_at: typing.Optional[dt.datetime] = pydantic.Field(default=None) + """ + When the client secret expires. Owners and admins are warned 14 days before. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/sdks/python/src/coss/types/create_oauth_app_request_microsoft.py b/sdks/python/src/coss/types/create_oauth_app_request_microsoft.py new file mode 100644 index 000000000..05321c922 --- /dev/null +++ b/sdks/python/src/coss/types/create_oauth_app_request_microsoft.py @@ -0,0 +1,48 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel + + +class CreateOauthAppRequestMicrosoft(UniversalBaseModel): + client_id: str = pydantic.Field() + """ + The app's client ID at the provider. + """ + + client_secret: str = pydantic.Field() + """ + The app's client secret. Never returned. + """ + + tenant_id: typing.Optional[str] = pydantic.Field(default=None) + """ + The Directory (tenant) ID, for an app that's only for your own tenant. Leave it out for a multi-tenant app. + """ + + redirect_uri: typing.Optional[str] = pydantic.Field(default=None) + """ + A page on your own domain, registered with the provider, that forwards `code` and `state` to `coss_callback_url`. Google requires this for an external app, since it has to verify the redirect's domain as yours. Leave it out to use `coss_callback_url` directly. + """ + + completion_url: typing.Optional[str] = pydantic.Field(default=None) + """ + Where the browser lands after a consent that didn't name a `return_url`, with `coss_calendar` set to `connected`, `denied` or `invalid`. Leave it out for a plain page saying what happened. + """ + + secret_expires_at: typing.Optional[dt.datetime] = pydantic.Field(default=None) + """ + When the client secret expires. Owners and admins are warned 14 days before. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/sdks/python/src/coss/types/create_oauth_app_request_zoom.py b/sdks/python/src/coss/types/create_oauth_app_request_zoom.py new file mode 100644 index 000000000..c7189c54e --- /dev/null +++ b/sdks/python/src/coss/types/create_oauth_app_request_zoom.py @@ -0,0 +1,48 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel + + +class CreateOauthAppRequestZoom(UniversalBaseModel): + client_id: str = pydantic.Field() + """ + The app's client ID at the provider. + """ + + client_secret: str = pydantic.Field() + """ + The app's client secret. Never returned. + """ + + webhook_secret: typing.Optional[str] = pydantic.Field(default=None) + """ + The Secret Token of your Zoom app, which signs its events at `zoom_event_url`. Never returned. + """ + + redirect_uri: typing.Optional[str] = pydantic.Field(default=None) + """ + A page on your own domain, registered with the provider, that forwards `code` and `state` to `coss_callback_url`. Google requires this for an external app, since it has to verify the redirect's domain as yours. Leave it out to use `coss_callback_url` directly. + """ + + completion_url: typing.Optional[str] = pydantic.Field(default=None) + """ + Where the browser lands after a consent that didn't name a `return_url`, with `coss_calendar` set to `connected`, `denied` or `invalid`. Leave it out for a plain page saying what happened. + """ + + secret_expires_at: typing.Optional[dt.datetime] = pydantic.Field(default=None) + """ + When the client secret expires. Owners and admins are warned 14 days before. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/sdks/python/src/coss/types/scheduling_location_microsoft_teams.py b/sdks/python/src/coss/types/deleted_scheduling_holiday_calendar.py similarity index 83% rename from sdks/python/src/coss/types/scheduling_location_microsoft_teams.py rename to sdks/python/src/coss/types/deleted_scheduling_holiday_calendar.py index d8203e66e..090e08fa6 100644 --- a/sdks/python/src/coss/types/scheduling_location_microsoft_teams.py +++ b/sdks/python/src/coss/types/deleted_scheduling_holiday_calendar.py @@ -6,7 +6,10 @@ from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel -class SchedulingLocationMicrosoftTeams(UniversalBaseModel): +class DeletedSchedulingHolidayCalendar(UniversalBaseModel): + id: str + deleted: bool + if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 else: diff --git a/sdks/python/src/coss/types/deleted_scheduling_oauth_app.py b/sdks/python/src/coss/types/deleted_scheduling_oauth_app.py new file mode 100644 index 000000000..31a1c91d6 --- /dev/null +++ b/sdks/python/src/coss/types/deleted_scheduling_oauth_app.py @@ -0,0 +1,22 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from .deleted_scheduling_oauth_app_object import DeletedSchedulingOauthAppObject + + +class DeletedSchedulingOauthApp(UniversalBaseModel): + object: DeletedSchedulingOauthAppObject + id: str + deleted: bool + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/sdks/python/src/coss/types/deleted_scheduling_oauth_app_object.py b/sdks/python/src/coss/types/deleted_scheduling_oauth_app_object.py new file mode 100644 index 000000000..f61d3bfee --- /dev/null +++ b/sdks/python/src/coss/types/deleted_scheduling_oauth_app_object.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +DeletedSchedulingOauthAppObject = typing.Union[typing.Literal["scheduling.oauth_app"], typing.Any] diff --git a/sdks/python/src/coss/types/deleted_scheduling_out_of_office.py b/sdks/python/src/coss/types/deleted_scheduling_out_of_office.py new file mode 100644 index 000000000..dc972bfb5 --- /dev/null +++ b/sdks/python/src/coss/types/deleted_scheduling_out_of_office.py @@ -0,0 +1,22 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from .deleted_scheduling_out_of_office_object import DeletedSchedulingOutOfOfficeObject + + +class DeletedSchedulingOutOfOffice(UniversalBaseModel): + object: DeletedSchedulingOutOfOfficeObject + id: str + deleted: bool + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/sdks/python/src/coss/types/deleted_scheduling_out_of_office_object.py b/sdks/python/src/coss/types/deleted_scheduling_out_of_office_object.py new file mode 100644 index 000000000..8c370d085 --- /dev/null +++ b/sdks/python/src/coss/types/deleted_scheduling_out_of_office_object.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +DeletedSchedulingOutOfOfficeObject = typing.Union[typing.Literal["scheduling.out_of_office"], typing.Any] diff --git a/sdks/python/src/coss/types/scheduling_booking.py b/sdks/python/src/coss/types/scheduling_booking.py index 73b839297..f97964efc 100644 --- a/sdks/python/src/coss/types/scheduling_booking.py +++ b/sdks/python/src/coss/types/scheduling_booking.py @@ -49,7 +49,7 @@ class SchedulingBooking(UniversalBaseModel): Who's booked: the attendee first, then any guests they added. A group session's seat is its own booking. """ - location: SchedulingLocation + location: typing.Optional[SchedulingLocation] = None hold_expires_at: typing.Optional[str] = pydantic.Field(default=None) """ When a `held` booking gives up its slot. `null` otherwise. diff --git a/sdks/python/src/coss/types/scheduling_booking_cancelled_by.py b/sdks/python/src/coss/types/scheduling_booking_cancelled_by.py index bd2839899..16cc66a15 100644 --- a/sdks/python/src/coss/types/scheduling_booking_cancelled_by.py +++ b/sdks/python/src/coss/types/scheduling_booking_cancelled_by.py @@ -3,5 +3,6 @@ import typing SchedulingBookingCancelledBy = typing.Union[ - typing.Literal["api_key", "user", "host_session", "booker_session", "manage_session", "system"], typing.Any + typing.Literal["api_key", "user", "host_session", "booker_session", "manage_session", "manager_session", "system"], + typing.Any, ] diff --git a/sdks/python/src/coss/types/scheduling_booking_event_actor_kind.py b/sdks/python/src/coss/types/scheduling_booking_event_actor_kind.py index 3d1b3d740..20a7ccd64 100644 --- a/sdks/python/src/coss/types/scheduling_booking_event_actor_kind.py +++ b/sdks/python/src/coss/types/scheduling_booking_event_actor_kind.py @@ -3,5 +3,6 @@ import typing SchedulingBookingEventActorKind = typing.Union[ - typing.Literal["api_key", "user", "host_session", "booker_session", "manage_session", "system"], typing.Any + typing.Literal["api_key", "user", "host_session", "booker_session", "manage_session", "manager_session", "system"], + typing.Any, ] diff --git a/sdks/python/src/coss/types/scheduling_booking_webhook_data.py b/sdks/python/src/coss/types/scheduling_booking_webhook_data.py index 08d200537..849ece545 100644 --- a/sdks/python/src/coss/types/scheduling_booking_webhook_data.py +++ b/sdks/python/src/coss/types/scheduling_booking_webhook_data.py @@ -58,6 +58,16 @@ class SchedulingBookingWebhookData(UniversalBaseModel): `scheduling.booking.rescheduled`: when it used to start. """ + previous_host_ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None) + """ + On `scheduling.booking.reassigned`: who had it before. + """ + + reassignment_id: typing.Optional[str] = pydantic.Field(default=None) + """ + On `scheduling.booking.reassigned`: the bulk reassignment it was part of. + """ + reminder: typing.Optional[SchedulingBookingWebhookDataReminder] = pydantic.Field(default=None) """ `scheduling.booking.reminder`: which reminder this is. diff --git a/sdks/python/src/coss/types/scheduling_booking_webhook_event_type.py b/sdks/python/src/coss/types/scheduling_booking_webhook_event_type.py index ea506774f..df02db65d 100644 --- a/sdks/python/src/coss/types/scheduling_booking_webhook_event_type.py +++ b/sdks/python/src/coss/types/scheduling_booking_webhook_event_type.py @@ -14,6 +14,7 @@ "scheduling.booking.external_conflict", "scheduling.booking.calendar_write_failed", "scheduling.booking.location_ready", + "scheduling.booking.reassigned", "scheduling.booking.started", "scheduling.booking.ended", "scheduling.booking.reminder", diff --git a/sdks/python/src/coss/types/scheduling_calendar_connection.py b/sdks/python/src/coss/types/scheduling_calendar_connection.py index 2d3bbb1d6..47d9dd286 100644 --- a/sdks/python/src/coss/types/scheduling_calendar_connection.py +++ b/sdks/python/src/coss/types/scheduling_calendar_connection.py @@ -33,6 +33,11 @@ class SchedulingCalendarConnection(UniversalBaseModel): `needs_reauth`: access was lost, and this host isn't offered until it's back. """ + oauth_app: typing.Optional[str] = pydantic.Field(default=None) + """ + Your own OAuth app this connection's access came through. `null`: coss.com's, or no consent was involved. + """ + delegation: typing.Optional[str] = pydantic.Field(default=None) """ The calendar delegation that manages this connection. It can't be disconnected or reconnected by itself. diff --git a/sdks/python/src/coss/types/scheduling_event_type.py b/sdks/python/src/coss/types/scheduling_event_type.py index 1823bbb13..ab7831832 100644 --- a/sdks/python/src/coss/types/scheduling_event_type.py +++ b/sdks/python/src/coss/types/scheduling_event_type.py @@ -97,6 +97,11 @@ class SchedulingEventType(UniversalBaseModel): Whether bookings start as `pending_approval`, holding the time until approved or declined. """ + reassignment_enabled: bool = pydantic.Field() + """ + Whether bookings of this event type can go to another host. + """ + approval_ttl_minutes: float = pydantic.Field() """ How long a booking can wait for approval before it's declined, in minutes. @@ -137,7 +142,7 @@ class SchedulingEventType(UniversalBaseModel): What attendees are asked when booking. """ - locations: typing.List[SchedulingLocation] = pydantic.Field() + locations: typing.List[typing.Optional[SchedulingLocation]] = pydantic.Field() """ Where bookings can meet. A browser only chooses among these. """ diff --git a/sdks/python/src/coss/types/scheduling_holiday_calendar.py b/sdks/python/src/coss/types/scheduling_holiday_calendar.py new file mode 100644 index 000000000..c5f226af2 --- /dev/null +++ b/sdks/python/src/coss/types/scheduling_holiday_calendar.py @@ -0,0 +1,40 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from .scheduling_holiday_calendar_existing_bookings import SchedulingHolidayCalendarExistingBookings +from .scheduling_holiday_calendar_host_filter_value import SchedulingHolidayCalendarHostFilterValue +from .scheduling_holiday_calendar_object import SchedulingHolidayCalendarObject +from .scheduling_holiday_calendar_source import SchedulingHolidayCalendarSource + + +class SchedulingHolidayCalendar(UniversalBaseModel): + object: SchedulingHolidayCalendarObject + id: str + name: str + source: SchedulingHolidayCalendarSource + country: typing.Optional[str] = None + hosts: typing.Optional[typing.List[str]] = None + host_filter: typing.Optional[typing.Dict[str, typing.Optional[SchedulingHolidayCalendarHostFilterValue]]] = None + regions: typing.Optional[typing.List[str]] = None + delegates: typing.List[str] + existing_bookings: SchedulingHolidayCalendarExistingBookings + last_read_at: typing.Optional[str] = None + last_error: typing.Optional[str] = pydantic.Field(default=None) + """ + Why its feed couldn't be read. + """ + + created_at: str + updated_at: str + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/sdks/python/src/coss/types/scheduling_holiday_calendar_existing_bookings.py b/sdks/python/src/coss/types/scheduling_holiday_calendar_existing_bookings.py new file mode 100644 index 000000000..dcb34201c --- /dev/null +++ b/sdks/python/src/coss/types/scheduling_holiday_calendar_existing_bookings.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +SchedulingHolidayCalendarExistingBookings = typing.Union[typing.Literal["leave", "reassign"], typing.Any] diff --git a/sdks/python/src/coss/types/scheduling_holiday_calendar_host_filter_value.py b/sdks/python/src/coss/types/scheduling_holiday_calendar_host_filter_value.py new file mode 100644 index 000000000..9e9c1a368 --- /dev/null +++ b/sdks/python/src/coss/types/scheduling_holiday_calendar_host_filter_value.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +SchedulingHolidayCalendarHostFilterValue = typing.Union[str, typing.List[str]] diff --git a/sdks/python/src/coss/types/scheduling_holiday_calendar_list.py b/sdks/python/src/coss/types/scheduling_holiday_calendar_list.py new file mode 100644 index 000000000..0c73f43ae --- /dev/null +++ b/sdks/python/src/coss/types/scheduling_holiday_calendar_list.py @@ -0,0 +1,23 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from .scheduling_holiday_calendar import SchedulingHolidayCalendar +from .scheduling_holiday_calendar_list_object import SchedulingHolidayCalendarListObject + + +class SchedulingHolidayCalendarList(UniversalBaseModel): + object: SchedulingHolidayCalendarListObject + data: typing.List[SchedulingHolidayCalendar] + has_more: bool + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/sdks/python/src/coss/types/scheduling_holiday_calendar_list_object.py b/sdks/python/src/coss/types/scheduling_holiday_calendar_list_object.py new file mode 100644 index 000000000..99c314863 --- /dev/null +++ b/sdks/python/src/coss/types/scheduling_holiday_calendar_list_object.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +SchedulingHolidayCalendarListObject = typing.Union[typing.Literal["list"], typing.Any] diff --git a/sdks/python/src/coss/types/scheduling_holiday_calendar_object.py b/sdks/python/src/coss/types/scheduling_holiday_calendar_object.py new file mode 100644 index 000000000..2e6eaf35e --- /dev/null +++ b/sdks/python/src/coss/types/scheduling_holiday_calendar_object.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +SchedulingHolidayCalendarObject = typing.Union[typing.Literal["scheduling.holiday_calendar"], typing.Any] diff --git a/sdks/python/src/coss/types/scheduling_holiday_calendar_source.py b/sdks/python/src/coss/types/scheduling_holiday_calendar_source.py new file mode 100644 index 000000000..770a6b886 --- /dev/null +++ b/sdks/python/src/coss/types/scheduling_holiday_calendar_source.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +SchedulingHolidayCalendarSource = typing.Union[typing.Literal["country", "ics"], typing.Any] diff --git a/sdks/python/src/coss/types/scheduling_holiday_list.py b/sdks/python/src/coss/types/scheduling_holiday_list.py new file mode 100644 index 000000000..29ee2d190 --- /dev/null +++ b/sdks/python/src/coss/types/scheduling_holiday_list.py @@ -0,0 +1,23 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from .scheduling_holiday_list_data_item import SchedulingHolidayListDataItem +from .scheduling_holiday_list_object import SchedulingHolidayListObject + + +class SchedulingHolidayList(UniversalBaseModel): + object: SchedulingHolidayListObject + data: typing.List[SchedulingHolidayListDataItem] + has_more: bool + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/sdks/python/src/coss/types/scheduling_holiday_list_data_item.py b/sdks/python/src/coss/types/scheduling_holiday_list_data_item.py new file mode 100644 index 000000000..16076b1d8 --- /dev/null +++ b/sdks/python/src/coss/types/scheduling_holiday_list_data_item.py @@ -0,0 +1,21 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel + + +class SchedulingHolidayListDataItem(UniversalBaseModel): + date: str + name: str + region: typing.Optional[str] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/sdks/python/src/coss/types/scheduling_holiday_list_object.py b/sdks/python/src/coss/types/scheduling_holiday_list_object.py new file mode 100644 index 000000000..02f1afd6b --- /dev/null +++ b/sdks/python/src/coss/types/scheduling_holiday_list_object.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +SchedulingHolidayListObject = typing.Union[typing.Literal["list"], typing.Any] diff --git a/sdks/python/src/coss/types/scheduling_location.py b/sdks/python/src/coss/types/scheduling_location.py index 3d9e5bcb4..627c16c19 100644 --- a/sdks/python/src/coss/types/scheduling_location.py +++ b/sdks/python/src/coss/types/scheduling_location.py @@ -1,128 +1,19 @@ # This file was auto-generated by Fern from our API Definition. -from __future__ import annotations - import typing -import pydantic -import typing_extensions -from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel - - -class SchedulingLocation_Link(UniversalBaseModel): - """ - Where a booking meets. `link`, `phone` and `in_person` carry their details, and on an event type, left blank, use the booked host's own if they have one; `google_meet`, `microsoft_teams` and `zoom` get a meeting made on the host's connected account. - """ - - type: typing.Literal["link"] = "link" - url: typing.Optional[str] = None - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 - else: - - class Config: - frozen = True - smart_union = True - extra = pydantic.Extra.allow - - -class SchedulingLocation_Phone(UniversalBaseModel): - """ - Where a booking meets. `link`, `phone` and `in_person` carry their details, and on an event type, left blank, use the booked host's own if they have one; `google_meet`, `microsoft_teams` and `zoom` get a meeting made on the host's connected account. - """ - - type: typing.Literal["phone"] = "phone" - number: typing.Optional[str] = None - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 - else: - - class Config: - frozen = True - smart_union = True - extra = pydantic.Extra.allow - - -class SchedulingLocation_InPerson(UniversalBaseModel): - """ - Where a booking meets. `link`, `phone` and `in_person` carry their details, and on an event type, left blank, use the booked host's own if they have one; `google_meet`, `microsoft_teams` and `zoom` get a meeting made on the host's connected account. - """ - - type: typing.Literal["in_person"] = "in_person" - address: typing.Optional[str] = None - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 - else: - - class Config: - frozen = True - smart_union = True - extra = pydantic.Extra.allow - - -class SchedulingLocation_GoogleMeet(UniversalBaseModel): - """ - Where a booking meets. `link`, `phone` and `in_person` carry their details, and on an event type, left blank, use the booked host's own if they have one; `google_meet`, `microsoft_teams` and `zoom` get a meeting made on the host's connected account. - """ - - type: typing.Literal["google_meet"] = "google_meet" - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 - else: - - class Config: - frozen = True - smart_union = True - extra = pydantic.Extra.allow - - -class SchedulingLocation_MicrosoftTeams(UniversalBaseModel): - """ - Where a booking meets. `link`, `phone` and `in_person` carry their details, and on an event type, left blank, use the booked host's own if they have one; `google_meet`, `microsoft_teams` and `zoom` get a meeting made on the host's connected account. - """ - - type: typing.Literal["microsoft_teams"] = "microsoft_teams" - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 - else: - - class Config: - frozen = True - smart_union = True - extra = pydantic.Extra.allow - - -class SchedulingLocation_Zoom(UniversalBaseModel): - """ - Where a booking meets. `link`, `phone` and `in_person` carry their details, and on an event type, left blank, use the booked host's own if they have one; `google_meet`, `microsoft_teams` and `zoom` get a meeting made on the host's connected account. - """ - - type: typing.Literal["zoom"] = "zoom" - url: typing.Optional[str] = None - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 - else: - - class Config: - frozen = True - smart_union = True - extra = pydantic.Extra.allow - - -SchedulingLocation = typing_extensions.Annotated[ - typing.Union[ - SchedulingLocation_Link, - SchedulingLocation_Phone, - SchedulingLocation_InPerson, - SchedulingLocation_GoogleMeet, - SchedulingLocation_MicrosoftTeams, - SchedulingLocation_Zoom, - ], - pydantic.Field(discriminator="type"), +from .scheduling_location_address import SchedulingLocationAddress +from .scheduling_location_five import SchedulingLocationFive +from .scheduling_location_four import SchedulingLocationFour +from .scheduling_location_number import SchedulingLocationNumber +from .scheduling_location_three import SchedulingLocationThree +from .scheduling_location_zero import SchedulingLocationZero + +SchedulingLocation = typing.Union[ + SchedulingLocationZero, + SchedulingLocationNumber, + SchedulingLocationAddress, + SchedulingLocationThree, + SchedulingLocationFour, + SchedulingLocationFive, ] diff --git a/sdks/python/src/coss/types/scheduling_location_in_person.py b/sdks/python/src/coss/types/scheduling_location_address.py similarity index 78% rename from sdks/python/src/coss/types/scheduling_location_in_person.py rename to sdks/python/src/coss/types/scheduling_location_address.py index eb5dec7f4..6bba77d21 100644 --- a/sdks/python/src/coss/types/scheduling_location_in_person.py +++ b/sdks/python/src/coss/types/scheduling_location_address.py @@ -4,9 +4,11 @@ import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from .scheduling_location_address_type import SchedulingLocationAddressType -class SchedulingLocationInPerson(UniversalBaseModel): +class SchedulingLocationAddress(UniversalBaseModel): + type: SchedulingLocationAddressType address: typing.Optional[str] = pydantic.Field(default=None) """ The address to meet at. `null` on an event type means the booking supplies its own. diff --git a/sdks/python/src/coss/types/scheduling_location_address_type.py b/sdks/python/src/coss/types/scheduling_location_address_type.py new file mode 100644 index 000000000..dda05b91f --- /dev/null +++ b/sdks/python/src/coss/types/scheduling_location_address_type.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +SchedulingLocationAddressType = typing.Union[typing.Literal["in_person"], typing.Any] diff --git a/sdks/python/src/coss/types/scheduling_location_zoom.py b/sdks/python/src/coss/types/scheduling_location_five.py similarity index 79% rename from sdks/python/src/coss/types/scheduling_location_zoom.py rename to sdks/python/src/coss/types/scheduling_location_five.py index db8cc2479..829f73215 100644 --- a/sdks/python/src/coss/types/scheduling_location_zoom.py +++ b/sdks/python/src/coss/types/scheduling_location_five.py @@ -4,9 +4,11 @@ import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from .scheduling_location_five_type import SchedulingLocationFiveType -class SchedulingLocationZoom(UniversalBaseModel): +class SchedulingLocationFive(UniversalBaseModel): + type: SchedulingLocationFiveType url: typing.Optional[str] = pydantic.Field(default=None) """ The meeting's link, once it's created on the host's Zoom account. diff --git a/sdks/python/src/coss/types/scheduling_location_five_type.py b/sdks/python/src/coss/types/scheduling_location_five_type.py new file mode 100644 index 000000000..1f6a04f57 --- /dev/null +++ b/sdks/python/src/coss/types/scheduling_location_five_type.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +SchedulingLocationFiveType = typing.Union[typing.Literal["zoom"], typing.Any] diff --git a/sdks/python/src/coss/types/scheduling_location_four.py b/sdks/python/src/coss/types/scheduling_location_four.py new file mode 100644 index 000000000..3bc29a89e --- /dev/null +++ b/sdks/python/src/coss/types/scheduling_location_four.py @@ -0,0 +1,20 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from .scheduling_location_four_type import SchedulingLocationFourType + + +class SchedulingLocationFour(UniversalBaseModel): + type: SchedulingLocationFourType + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/sdks/python/src/coss/types/scheduling_location_four_type.py b/sdks/python/src/coss/types/scheduling_location_four_type.py new file mode 100644 index 000000000..5e3b1baa5 --- /dev/null +++ b/sdks/python/src/coss/types/scheduling_location_four_type.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +SchedulingLocationFourType = typing.Union[typing.Literal["microsoft_teams"], typing.Any] diff --git a/sdks/python/src/coss/types/scheduling_location_phone.py b/sdks/python/src/coss/types/scheduling_location_number.py similarity index 79% rename from sdks/python/src/coss/types/scheduling_location_phone.py rename to sdks/python/src/coss/types/scheduling_location_number.py index b9bf8320e..15985a9a3 100644 --- a/sdks/python/src/coss/types/scheduling_location_phone.py +++ b/sdks/python/src/coss/types/scheduling_location_number.py @@ -4,9 +4,11 @@ import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from .scheduling_location_number_type import SchedulingLocationNumberType -class SchedulingLocationPhone(UniversalBaseModel): +class SchedulingLocationNumber(UniversalBaseModel): + type: SchedulingLocationNumberType number: typing.Optional[str] = pydantic.Field(default=None) """ The phone number to call. `null` on an event type means the booking supplies its own. diff --git a/sdks/python/src/coss/types/scheduling_location_number_type.py b/sdks/python/src/coss/types/scheduling_location_number_type.py new file mode 100644 index 000000000..a854a7f52 --- /dev/null +++ b/sdks/python/src/coss/types/scheduling_location_number_type.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +SchedulingLocationNumberType = typing.Union[typing.Literal["phone"], typing.Any] diff --git a/sdks/python/src/coss/types/scheduling_location_three.py b/sdks/python/src/coss/types/scheduling_location_three.py new file mode 100644 index 000000000..5d39283fe --- /dev/null +++ b/sdks/python/src/coss/types/scheduling_location_three.py @@ -0,0 +1,20 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from .scheduling_location_three_type import SchedulingLocationThreeType + + +class SchedulingLocationThree(UniversalBaseModel): + type: SchedulingLocationThreeType + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/sdks/python/src/coss/types/scheduling_location_three_type.py b/sdks/python/src/coss/types/scheduling_location_three_type.py new file mode 100644 index 000000000..9e83f5229 --- /dev/null +++ b/sdks/python/src/coss/types/scheduling_location_three_type.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +SchedulingLocationThreeType = typing.Union[typing.Literal["google_meet"], typing.Any] diff --git a/sdks/python/src/coss/types/scheduling_location_link.py b/sdks/python/src/coss/types/scheduling_location_zero.py similarity index 79% rename from sdks/python/src/coss/types/scheduling_location_link.py rename to sdks/python/src/coss/types/scheduling_location_zero.py index 0f7811304..2bc1f9629 100644 --- a/sdks/python/src/coss/types/scheduling_location_link.py +++ b/sdks/python/src/coss/types/scheduling_location_zero.py @@ -4,9 +4,11 @@ import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from .scheduling_location_zero_type import SchedulingLocationZeroType -class SchedulingLocationLink(UniversalBaseModel): +class SchedulingLocationZero(UniversalBaseModel): + type: SchedulingLocationZeroType url: typing.Optional[str] = pydantic.Field(default=None) """ The meeting link. `null` on an event type means the booking supplies its own. diff --git a/sdks/python/src/coss/types/scheduling_location_zero_type.py b/sdks/python/src/coss/types/scheduling_location_zero_type.py new file mode 100644 index 000000000..41d6e5844 --- /dev/null +++ b/sdks/python/src/coss/types/scheduling_location_zero_type.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +SchedulingLocationZeroType = typing.Union[typing.Literal["link"], typing.Any] diff --git a/sdks/python/src/coss/types/scheduling_oauth_app.py b/sdks/python/src/coss/types/scheduling_oauth_app.py new file mode 100644 index 000000000..76704c197 --- /dev/null +++ b/sdks/python/src/coss/types/scheduling_oauth_app.py @@ -0,0 +1,63 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from .scheduling_oauth_app_object import SchedulingOauthAppObject +from .scheduling_oauth_app_provider import SchedulingOauthAppProvider +from .scheduling_oauth_app_status import SchedulingOauthAppStatus + + +class SchedulingOauthApp(UniversalBaseModel): + object: SchedulingOauthAppObject + id: str + provider: SchedulingOauthAppProvider + client_id: str + tenant_id: typing.Optional[str] = None + redirect_uri: typing.Optional[str] = None + coss_callback_url: str = pydantic.Field() + """ + Register this with the provider if `redirect_uri` isn't set. If it is, that page forwards `code` and `state` here. + """ + + completion_url: typing.Optional[str] = None + zoom_event_url: typing.Optional[str] = pydantic.Field(default=None) + """ + Zoom only: the Event notification endpoint URL for your app's deauthorization events. + """ + + scopes: typing.List[str] = pydantic.Field() + """ + What to enable on your app at the provider. + """ + + status: SchedulingOauthAppStatus = pydantic.Field() + """ + `failing`: the provider refused the app's credentials. New consents are refused, and calendars connected through it can't be read until they work again. + """ + + last_error_code: typing.Optional[str] = None + last_error_at: typing.Optional[str] = None + secret_expires_at: typing.Optional[str] = None + verified_at: typing.Optional[str] = pydantic.Field(default=None) + """ + When a consent first completed through this app, which proves its secret. + """ + + connections: int = pydantic.Field() + """ + Calendar connections using this app. It can't be deleted while there are any. + """ + + created_at: str + updated_at: str + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/sdks/python/src/coss/types/scheduling_oauth_app_list.py b/sdks/python/src/coss/types/scheduling_oauth_app_list.py new file mode 100644 index 000000000..4dff1899f --- /dev/null +++ b/sdks/python/src/coss/types/scheduling_oauth_app_list.py @@ -0,0 +1,23 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from .scheduling_oauth_app import SchedulingOauthApp +from .scheduling_oauth_app_list_object import SchedulingOauthAppListObject + + +class SchedulingOauthAppList(UniversalBaseModel): + object: SchedulingOauthAppListObject + data: typing.List[SchedulingOauthApp] + has_more: bool + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/sdks/python/src/coss/types/scheduling_oauth_app_list_object.py b/sdks/python/src/coss/types/scheduling_oauth_app_list_object.py new file mode 100644 index 000000000..223f1bc75 --- /dev/null +++ b/sdks/python/src/coss/types/scheduling_oauth_app_list_object.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +SchedulingOauthAppListObject = typing.Union[typing.Literal["list"], typing.Any] diff --git a/sdks/python/src/coss/types/scheduling_oauth_app_object.py b/sdks/python/src/coss/types/scheduling_oauth_app_object.py new file mode 100644 index 000000000..b66bdf885 --- /dev/null +++ b/sdks/python/src/coss/types/scheduling_oauth_app_object.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +SchedulingOauthAppObject = typing.Union[typing.Literal["scheduling.oauth_app"], typing.Any] diff --git a/sdks/python/src/coss/types/scheduling_oauth_app_provider.py b/sdks/python/src/coss/types/scheduling_oauth_app_provider.py new file mode 100644 index 000000000..3a6bdccd6 --- /dev/null +++ b/sdks/python/src/coss/types/scheduling_oauth_app_provider.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +SchedulingOauthAppProvider = typing.Union[typing.Literal["google", "microsoft", "zoom"], typing.Any] diff --git a/sdks/python/src/coss/types/scheduling_oauth_app_status.py b/sdks/python/src/coss/types/scheduling_oauth_app_status.py new file mode 100644 index 000000000..5f6060af9 --- /dev/null +++ b/sdks/python/src/coss/types/scheduling_oauth_app_status.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +SchedulingOauthAppStatus = typing.Union[typing.Literal["active", "failing"], typing.Any] diff --git a/sdks/python/src/coss/types/scheduling_oauth_app_webhook_event.py b/sdks/python/src/coss/types/scheduling_oauth_app_webhook_event.py new file mode 100644 index 000000000..2ca112434 --- /dev/null +++ b/sdks/python/src/coss/types/scheduling_oauth_app_webhook_event.py @@ -0,0 +1,40 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from .scheduling_oauth_app_webhook_event_data import SchedulingOauthAppWebhookEventData +from .scheduling_oauth_app_webhook_event_object import SchedulingOauthAppWebhookEventObject +from .scheduling_oauth_app_webhook_event_type import SchedulingOauthAppWebhookEventType + + +class SchedulingOauthAppWebhookEvent(UniversalBaseModel): + id: str = pydantic.Field() + """ + The event id. + """ + + object: SchedulingOauthAppWebhookEventObject + api_version: str = pydantic.Field() + """ + The API version this payload is rendered in: the endpoint's. + """ + + created_at: dt.datetime = pydantic.Field() + """ + When the event was created. + """ + + type: SchedulingOauthAppWebhookEventType + data: SchedulingOauthAppWebhookEventData + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/sdks/python/src/coss/types/scheduling_oauth_app_webhook_event_data.py b/sdks/python/src/coss/types/scheduling_oauth_app_webhook_event_data.py new file mode 100644 index 000000000..ecc98f42a --- /dev/null +++ b/sdks/python/src/coss/types/scheduling_oauth_app_webhook_event_data.py @@ -0,0 +1,26 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel + + +class SchedulingOauthAppWebhookEventData(UniversalBaseModel): + oauth_app_id: str + provider: str + code: typing.Optional[str] = pydantic.Field(default=None) + """ + What the provider said, when it refused. + """ + + occurred_at: str + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/sdks/python/src/coss/types/scheduling_oauth_app_webhook_event_object.py b/sdks/python/src/coss/types/scheduling_oauth_app_webhook_event_object.py new file mode 100644 index 000000000..016e178b7 --- /dev/null +++ b/sdks/python/src/coss/types/scheduling_oauth_app_webhook_event_object.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +SchedulingOauthAppWebhookEventObject = typing.Union[typing.Literal["event"], typing.Any] diff --git a/sdks/python/src/coss/types/scheduling_oauth_app_webhook_event_type.py b/sdks/python/src/coss/types/scheduling_oauth_app_webhook_event_type.py new file mode 100644 index 000000000..4bc0f6ed7 --- /dev/null +++ b/sdks/python/src/coss/types/scheduling_oauth_app_webhook_event_type.py @@ -0,0 +1,7 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +SchedulingOauthAppWebhookEventType = typing.Union[ + typing.Literal["scheduling.oauth_app.failing", "scheduling.oauth_app.restored"], typing.Any +] diff --git a/sdks/python/src/coss/types/scheduling_out_of_office.py b/sdks/python/src/coss/types/scheduling_out_of_office.py new file mode 100644 index 000000000..71ae771b9 --- /dev/null +++ b/sdks/python/src/coss/types/scheduling_out_of_office.py @@ -0,0 +1,51 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from .scheduling_out_of_office_all_day import SchedulingOutOfOfficeAllDay +from .scheduling_out_of_office_existing_bookings import SchedulingOutOfOfficeExistingBookings +from .scheduling_out_of_office_object import SchedulingOutOfOfficeObject +from .scheduling_out_of_office_source import SchedulingOutOfOfficeSource + + +class SchedulingOutOfOffice(UniversalBaseModel): + object: SchedulingOutOfOfficeObject + id: str + host: str + start: str + end: str + all_day: typing.Optional[SchedulingOutOfOfficeAllDay] = pydantic.Field(default=None) + """ + How it was given, when it was as whole dates. + """ + + reason: str + notes: typing.Optional[str] = None + public_message: typing.Optional[str] = None + show_on_calendar: bool + delegates: typing.List[str] = pydantic.Field() + """ + Who can be booked in their place. + """ + + existing_bookings: SchedulingOutOfOfficeExistingBookings + external_id: typing.Optional[str] = None + group: typing.Optional[str] = pydantic.Field(default=None) + """ + Shared by the entries one request made for several hosts. + """ + + source: SchedulingOutOfOfficeSource + created_at: str + updated_at: str + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/sdks/python/src/coss/types/scheduling_out_of_office_all_day.py b/sdks/python/src/coss/types/scheduling_out_of_office_all_day.py new file mode 100644 index 000000000..a273cdb4c --- /dev/null +++ b/sdks/python/src/coss/types/scheduling_out_of_office_all_day.py @@ -0,0 +1,25 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel + + +class SchedulingOutOfOfficeAllDay(UniversalBaseModel): + """ + How it was given, when it was as whole dates. + """ + + start_date: str + end_date: str + time_zone: str + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/sdks/python/src/coss/types/scheduling_out_of_office_conflict.py b/sdks/python/src/coss/types/scheduling_out_of_office_conflict.py new file mode 100644 index 000000000..e360fd171 --- /dev/null +++ b/sdks/python/src/coss/types/scheduling_out_of_office_conflict.py @@ -0,0 +1,29 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from .scheduling_out_of_office_conflict_object import SchedulingOutOfOfficeConflictObject +from .scheduling_out_of_office_conflict_status import SchedulingOutOfOfficeConflictStatus + + +class SchedulingOutOfOfficeConflict(UniversalBaseModel): + object: SchedulingOutOfOfficeConflictObject + booking: str + event_type: str + title: str + status: SchedulingOutOfOfficeConflictStatus + start: str + end: str + series: typing.Optional[str] = None + group_session: typing.Optional[str] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/sdks/python/src/coss/types/scheduling_out_of_office_conflict_list.py b/sdks/python/src/coss/types/scheduling_out_of_office_conflict_list.py new file mode 100644 index 000000000..c9f61765d --- /dev/null +++ b/sdks/python/src/coss/types/scheduling_out_of_office_conflict_list.py @@ -0,0 +1,23 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from .scheduling_out_of_office_conflict import SchedulingOutOfOfficeConflict +from .scheduling_out_of_office_conflict_list_object import SchedulingOutOfOfficeConflictListObject + + +class SchedulingOutOfOfficeConflictList(UniversalBaseModel): + object: SchedulingOutOfOfficeConflictListObject + data: typing.List[SchedulingOutOfOfficeConflict] + has_more: bool + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/sdks/python/src/coss/types/scheduling_out_of_office_conflict_list_object.py b/sdks/python/src/coss/types/scheduling_out_of_office_conflict_list_object.py new file mode 100644 index 000000000..02c1d683f --- /dev/null +++ b/sdks/python/src/coss/types/scheduling_out_of_office_conflict_list_object.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +SchedulingOutOfOfficeConflictListObject = typing.Union[typing.Literal["list"], typing.Any] diff --git a/sdks/python/src/coss/types/scheduling_out_of_office_conflict_object.py b/sdks/python/src/coss/types/scheduling_out_of_office_conflict_object.py new file mode 100644 index 000000000..ab31fc924 --- /dev/null +++ b/sdks/python/src/coss/types/scheduling_out_of_office_conflict_object.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +SchedulingOutOfOfficeConflictObject = typing.Union[typing.Literal["scheduling.out_of_office_conflict"], typing.Any] diff --git a/sdks/python/src/coss/types/scheduling_out_of_office_conflict_status.py b/sdks/python/src/coss/types/scheduling_out_of_office_conflict_status.py new file mode 100644 index 000000000..2ebe09e39 --- /dev/null +++ b/sdks/python/src/coss/types/scheduling_out_of_office_conflict_status.py @@ -0,0 +1,7 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +SchedulingOutOfOfficeConflictStatus = typing.Union[ + typing.Literal["held", "pending_approval", "confirmed", "cancelled", "declined"], typing.Any +] diff --git a/sdks/python/src/coss/types/scheduling_out_of_office_existing_bookings.py b/sdks/python/src/coss/types/scheduling_out_of_office_existing_bookings.py new file mode 100644 index 000000000..6382c545d --- /dev/null +++ b/sdks/python/src/coss/types/scheduling_out_of_office_existing_bookings.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +SchedulingOutOfOfficeExistingBookings = typing.Union[typing.Literal["leave", "reassign"], typing.Any] diff --git a/sdks/python/src/coss/types/scheduling_out_of_office_list.py b/sdks/python/src/coss/types/scheduling_out_of_office_list.py new file mode 100644 index 000000000..705b2370e --- /dev/null +++ b/sdks/python/src/coss/types/scheduling_out_of_office_list.py @@ -0,0 +1,23 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from .scheduling_out_of_office import SchedulingOutOfOffice +from .scheduling_out_of_office_list_object import SchedulingOutOfOfficeListObject + + +class SchedulingOutOfOfficeList(UniversalBaseModel): + object: SchedulingOutOfOfficeListObject + data: typing.List[SchedulingOutOfOffice] + has_more: bool + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/sdks/python/src/coss/types/scheduling_out_of_office_list_object.py b/sdks/python/src/coss/types/scheduling_out_of_office_list_object.py new file mode 100644 index 000000000..fab8bccfb --- /dev/null +++ b/sdks/python/src/coss/types/scheduling_out_of_office_list_object.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +SchedulingOutOfOfficeListObject = typing.Union[typing.Literal["list"], typing.Any] diff --git a/sdks/python/src/coss/types/scheduling_out_of_office_object.py b/sdks/python/src/coss/types/scheduling_out_of_office_object.py new file mode 100644 index 000000000..db1112a5d --- /dev/null +++ b/sdks/python/src/coss/types/scheduling_out_of_office_object.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +SchedulingOutOfOfficeObject = typing.Union[typing.Literal["scheduling.out_of_office"], typing.Any] diff --git a/sdks/python/src/coss/types/scheduling_out_of_office_source.py b/sdks/python/src/coss/types/scheduling_out_of_office_source.py new file mode 100644 index 000000000..336d134a4 --- /dev/null +++ b/sdks/python/src/coss/types/scheduling_out_of_office_source.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +SchedulingOutOfOfficeSource = typing.Union[typing.Literal["api", "host", "manager", "dashboard", "holiday"], typing.Any] diff --git a/sdks/python/src/coss/types/scheduling_out_of_office_webhook_event.py b/sdks/python/src/coss/types/scheduling_out_of_office_webhook_event.py new file mode 100644 index 000000000..8d013163f --- /dev/null +++ b/sdks/python/src/coss/types/scheduling_out_of_office_webhook_event.py @@ -0,0 +1,40 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from .scheduling_out_of_office_webhook_event_data import SchedulingOutOfOfficeWebhookEventData +from .scheduling_out_of_office_webhook_event_object import SchedulingOutOfOfficeWebhookEventObject +from .scheduling_out_of_office_webhook_event_type import SchedulingOutOfOfficeWebhookEventType + + +class SchedulingOutOfOfficeWebhookEvent(UniversalBaseModel): + id: str = pydantic.Field() + """ + The event id. + """ + + object: SchedulingOutOfOfficeWebhookEventObject + api_version: str = pydantic.Field() + """ + The API version this payload is rendered in: the endpoint's. + """ + + created_at: dt.datetime = pydantic.Field() + """ + When the event was created. + """ + + type: SchedulingOutOfOfficeWebhookEventType + data: SchedulingOutOfOfficeWebhookEventData + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/sdks/python/src/coss/types/scheduling_out_of_office_webhook_event_data.py b/sdks/python/src/coss/types/scheduling_out_of_office_webhook_event_data.py new file mode 100644 index 000000000..4d0605e4f --- /dev/null +++ b/sdks/python/src/coss/types/scheduling_out_of_office_webhook_event_data.py @@ -0,0 +1,24 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel + + +class SchedulingOutOfOfficeWebhookEventData(UniversalBaseModel): + out_of_office_id: str + host_id: str + start: str + end: str + group: typing.Optional[str] = None + occurred_at: str + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/sdks/python/src/coss/types/scheduling_out_of_office_webhook_event_object.py b/sdks/python/src/coss/types/scheduling_out_of_office_webhook_event_object.py new file mode 100644 index 000000000..725315cd5 --- /dev/null +++ b/sdks/python/src/coss/types/scheduling_out_of_office_webhook_event_object.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +SchedulingOutOfOfficeWebhookEventObject = typing.Union[typing.Literal["event"], typing.Any] diff --git a/sdks/python/src/coss/types/scheduling_out_of_office_webhook_event_type.py b/sdks/python/src/coss/types/scheduling_out_of_office_webhook_event_type.py new file mode 100644 index 000000000..3433133d0 --- /dev/null +++ b/sdks/python/src/coss/types/scheduling_out_of_office_webhook_event_type.py @@ -0,0 +1,14 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +SchedulingOutOfOfficeWebhookEventType = typing.Union[ + typing.Literal[ + "scheduling.out_of_office.created", + "scheduling.out_of_office.updated", + "scheduling.out_of_office.deleted", + "scheduling.out_of_office.started", + "scheduling.out_of_office.ended", + ], + typing.Any, +] diff --git a/sdks/python/src/coss/types/scheduling_reassign_candidate.py b/sdks/python/src/coss/types/scheduling_reassign_candidate.py new file mode 100644 index 000000000..ec656d017 --- /dev/null +++ b/sdks/python/src/coss/types/scheduling_reassign_candidate.py @@ -0,0 +1,53 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from .scheduling_reassign_candidate_object import SchedulingReassignCandidateObject + + +class SchedulingReassignCandidate(UniversalBaseModel): + object: SchedulingReassignCandidateObject + host: str + uid: typing.Optional[str] = None + name: str + member: bool = pydantic.Field() + """ + Takes this event type, and fits what the booking was routed with. Otherwise it needs `any_host`. + """ + + available: bool + reason: typing.Optional[str] = pydantic.Field(default=None) + """ + Why they aren't available, the first of `reasons`. + """ + + reasons: typing.List[str] = pydantic.Field() + """ + Everything in the way, each needing its override. `already_claimed` can't be overridden. + """ + + load: float = pydantic.Field() + """ + Their live bookings in the week from this one. + """ + + rank: typing.Optional[float] = pydantic.Field(default=None) + """ + Their place in who a pool would pick next, from 1. Null for a non-member. + """ + + meeting_provider_missing: bool = pydantic.Field() + """ + They haven't connected what this booking's meeting needs, so it'd have none. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/sdks/python/src/coss/types/scheduling_reassign_candidate_list.py b/sdks/python/src/coss/types/scheduling_reassign_candidate_list.py new file mode 100644 index 000000000..9884d997f --- /dev/null +++ b/sdks/python/src/coss/types/scheduling_reassign_candidate_list.py @@ -0,0 +1,23 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from .scheduling_reassign_candidate import SchedulingReassignCandidate +from .scheduling_reassign_candidate_list_object import SchedulingReassignCandidateListObject + + +class SchedulingReassignCandidateList(UniversalBaseModel): + object: SchedulingReassignCandidateListObject + data: typing.List[SchedulingReassignCandidate] + has_more: bool + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/sdks/python/src/coss/types/scheduling_reassign_candidate_list_object.py b/sdks/python/src/coss/types/scheduling_reassign_candidate_list_object.py new file mode 100644 index 000000000..db31556d7 --- /dev/null +++ b/sdks/python/src/coss/types/scheduling_reassign_candidate_list_object.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +SchedulingReassignCandidateListObject = typing.Union[typing.Literal["list"], typing.Any] diff --git a/sdks/python/src/coss/types/scheduling_reassign_candidate_object.py b/sdks/python/src/coss/types/scheduling_reassign_candidate_object.py new file mode 100644 index 000000000..2d906712b --- /dev/null +++ b/sdks/python/src/coss/types/scheduling_reassign_candidate_object.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +SchedulingReassignCandidateObject = typing.Union[typing.Literal["scheduling.reassign_candidate"], typing.Any] diff --git a/sdks/python/src/coss/types/scheduling_reassignment.py b/sdks/python/src/coss/types/scheduling_reassignment.py new file mode 100644 index 000000000..fc7015f2b --- /dev/null +++ b/sdks/python/src/coss/types/scheduling_reassignment.py @@ -0,0 +1,32 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from .scheduling_reassignment_counts import SchedulingReassignmentCounts +from .scheduling_reassignment_object import SchedulingReassignmentObject +from .scheduling_reassignment_reason_code import SchedulingReassignmentReasonCode +from .scheduling_reassignment_status import SchedulingReassignmentStatus + + +class SchedulingReassignment(UniversalBaseModel): + object: SchedulingReassignmentObject + id: str + status: SchedulingReassignmentStatus + reason_code: SchedulingReassignmentReasonCode + out_of_office: typing.Optional[str] = None + undo_of: typing.Optional[str] = None + counts: SchedulingReassignmentCounts + created_at: str + started_at: typing.Optional[str] = None + finished_at: typing.Optional[str] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/sdks/python/src/coss/types/scheduling_reassignment_counts.py b/sdks/python/src/coss/types/scheduling_reassignment_counts.py new file mode 100644 index 000000000..8b167e79f --- /dev/null +++ b/sdks/python/src/coss/types/scheduling_reassignment_counts.py @@ -0,0 +1,33 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel + + +class SchedulingReassignmentCounts(UniversalBaseModel): + total: float + pending: float + reassigned: float + skipped: float = pydantic.Field() + """ + They'd moved on since it was selected. + """ + + no_candidate: float = pydantic.Field() + """ + Nobody could take them: they stayed. + """ + + failed: float + cancelled: float + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/sdks/python/src/coss/types/scheduling_reassignment_item.py b/sdks/python/src/coss/types/scheduling_reassignment_item.py new file mode 100644 index 000000000..0f46f7c6b --- /dev/null +++ b/sdks/python/src/coss/types/scheduling_reassignment_item.py @@ -0,0 +1,27 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from .scheduling_reassignment_item_object import SchedulingReassignmentItemObject +from .scheduling_reassignment_item_outcome import SchedulingReassignmentItemOutcome + + +class SchedulingReassignmentItem(UniversalBaseModel): + object: SchedulingReassignmentItemObject + id: str + booking: str + from_host: typing.Optional[str] = None + to_host: typing.Optional[str] = None + outcome: SchedulingReassignmentItemOutcome + error_code: typing.Optional[str] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/sdks/python/src/coss/types/scheduling_reassignment_item_list.py b/sdks/python/src/coss/types/scheduling_reassignment_item_list.py new file mode 100644 index 000000000..d0bfbf279 --- /dev/null +++ b/sdks/python/src/coss/types/scheduling_reassignment_item_list.py @@ -0,0 +1,23 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from .scheduling_reassignment_item import SchedulingReassignmentItem +from .scheduling_reassignment_item_list_object import SchedulingReassignmentItemListObject + + +class SchedulingReassignmentItemList(UniversalBaseModel): + object: SchedulingReassignmentItemListObject + data: typing.List[SchedulingReassignmentItem] + has_more: bool + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/sdks/python/src/coss/types/scheduling_reassignment_item_list_object.py b/sdks/python/src/coss/types/scheduling_reassignment_item_list_object.py new file mode 100644 index 000000000..6885961cf --- /dev/null +++ b/sdks/python/src/coss/types/scheduling_reassignment_item_list_object.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +SchedulingReassignmentItemListObject = typing.Union[typing.Literal["list"], typing.Any] diff --git a/sdks/python/src/coss/types/scheduling_reassignment_item_object.py b/sdks/python/src/coss/types/scheduling_reassignment_item_object.py new file mode 100644 index 000000000..03fb300d8 --- /dev/null +++ b/sdks/python/src/coss/types/scheduling_reassignment_item_object.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +SchedulingReassignmentItemObject = typing.Union[typing.Literal["scheduling.reassignment_item"], typing.Any] diff --git a/sdks/python/src/coss/types/scheduling_reassignment_item_outcome.py b/sdks/python/src/coss/types/scheduling_reassignment_item_outcome.py new file mode 100644 index 000000000..5e50aafe1 --- /dev/null +++ b/sdks/python/src/coss/types/scheduling_reassignment_item_outcome.py @@ -0,0 +1,7 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +SchedulingReassignmentItemOutcome = typing.Union[ + typing.Literal["pending", "reassigned", "skipped_changed", "no_candidate", "failed", "cancelled"], typing.Any +] diff --git a/sdks/python/src/coss/types/scheduling_reassignment_list.py b/sdks/python/src/coss/types/scheduling_reassignment_list.py new file mode 100644 index 000000000..fdf079988 --- /dev/null +++ b/sdks/python/src/coss/types/scheduling_reassignment_list.py @@ -0,0 +1,23 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from .scheduling_reassignment import SchedulingReassignment +from .scheduling_reassignment_list_object import SchedulingReassignmentListObject + + +class SchedulingReassignmentList(UniversalBaseModel): + object: SchedulingReassignmentListObject + data: typing.List[SchedulingReassignment] + has_more: bool + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/sdks/python/src/coss/types/scheduling_reassignment_list_object.py b/sdks/python/src/coss/types/scheduling_reassignment_list_object.py new file mode 100644 index 000000000..64881ad9c --- /dev/null +++ b/sdks/python/src/coss/types/scheduling_reassignment_list_object.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +SchedulingReassignmentListObject = typing.Union[typing.Literal["list"], typing.Any] diff --git a/sdks/python/src/coss/types/scheduling_reassignment_object.py b/sdks/python/src/coss/types/scheduling_reassignment_object.py new file mode 100644 index 000000000..d8d70736e --- /dev/null +++ b/sdks/python/src/coss/types/scheduling_reassignment_object.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +SchedulingReassignmentObject = typing.Union[typing.Literal["scheduling.reassignment"], typing.Any] diff --git a/sdks/python/src/coss/types/scheduling_reassignment_preview.py b/sdks/python/src/coss/types/scheduling_reassignment_preview.py new file mode 100644 index 000000000..5f2afefcb --- /dev/null +++ b/sdks/python/src/coss/types/scheduling_reassignment_preview.py @@ -0,0 +1,26 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from .scheduling_reassignment_preview_items_item import SchedulingReassignmentPreviewItemsItem +from .scheduling_reassignment_preview_object import SchedulingReassignmentPreviewObject + + +class SchedulingReassignmentPreview(UniversalBaseModel): + object: SchedulingReassignmentPreviewObject + items: typing.List[SchedulingReassignmentPreviewItemsItem] + truncated: bool = pydantic.Field() + """ + There are more than a preview covers. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/sdks/python/src/coss/types/scheduling_reassignment_preview_items_item.py b/sdks/python/src/coss/types/scheduling_reassignment_preview_items_item.py new file mode 100644 index 000000000..4b2916169 --- /dev/null +++ b/sdks/python/src/coss/types/scheduling_reassignment_preview_items_item.py @@ -0,0 +1,37 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from .scheduling_reassignment_preview_items_item_status import SchedulingReassignmentPreviewItemsItemStatus + + +class SchedulingReassignmentPreviewItemsItem(UniversalBaseModel): + booking: str + event_type: str + title: str + status: SchedulingReassignmentPreviewItemsItemStatus + start: str + end: str + series: typing.Optional[str] = None + group_session: typing.Optional[str] = None + from_host: typing.Optional[str] = None + to_host: typing.Optional[str] = pydantic.Field(default=None) + """ + Null when nobody could take it. + """ + + reason: typing.Optional[str] = pydantic.Field(default=None) + """ + Why it would stay where it is. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/sdks/python/src/coss/types/scheduling_reassignment_preview_items_item_status.py b/sdks/python/src/coss/types/scheduling_reassignment_preview_items_item_status.py new file mode 100644 index 000000000..d25f30898 --- /dev/null +++ b/sdks/python/src/coss/types/scheduling_reassignment_preview_items_item_status.py @@ -0,0 +1,7 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +SchedulingReassignmentPreviewItemsItemStatus = typing.Union[ + typing.Literal["held", "pending_approval", "confirmed", "cancelled", "declined"], typing.Any +] diff --git a/sdks/python/src/coss/types/scheduling_reassignment_preview_object.py b/sdks/python/src/coss/types/scheduling_reassignment_preview_object.py new file mode 100644 index 000000000..32ff8aa13 --- /dev/null +++ b/sdks/python/src/coss/types/scheduling_reassignment_preview_object.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +SchedulingReassignmentPreviewObject = typing.Union[typing.Literal["scheduling.reassignment_preview"], typing.Any] diff --git a/sdks/python/src/coss/types/scheduling_reassignment_reason_code.py b/sdks/python/src/coss/types/scheduling_reassignment_reason_code.py new file mode 100644 index 000000000..839f82ce6 --- /dev/null +++ b/sdks/python/src/coss/types/scheduling_reassignment_reason_code.py @@ -0,0 +1,8 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +SchedulingReassignmentReasonCode = typing.Union[ + typing.Literal["host_unavailable", "out_of_office", "workload", "customer_request", "offboarding", "other"], + typing.Any, +] diff --git a/sdks/python/src/coss/types/scheduling_reassignment_selection.py b/sdks/python/src/coss/types/scheduling_reassignment_selection.py new file mode 100644 index 000000000..506bcafcb --- /dev/null +++ b/sdks/python/src/coss/types/scheduling_reassignment_selection.py @@ -0,0 +1,49 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel + + +class SchedulingReassignmentSelection(UniversalBaseModel): + host: typing.Optional[str] = pydantic.Field(default=None) + """ + This host's bookings, by id or uid. + """ + + out_of_office: typing.Optional[str] = pydantic.Field(default=None) + """ + The bookings that fall in this entry. + """ + + booking_ids: typing.Optional[typing.List[str]] = None + series: typing.Optional[str] = pydantic.Field(default=None) + """ + A series' occurrences still to come. + """ + + start_after: typing.Optional[str] = pydantic.Field(default=None) + """ + An ISO 8601 instant with an offset. + """ + + start_before: typing.Optional[str] = pydantic.Field(default=None) + """ + An ISO 8601 instant with an offset. + """ + + event_types: typing.Optional[typing.List[str]] = None + external_conflict: typing.Optional[bool] = pydantic.Field(default=None) + """ + Only those with something else on the host's calendar at that time. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/sdks/python/src/coss/types/scheduling_reassignment_status.py b/sdks/python/src/coss/types/scheduling_reassignment_status.py new file mode 100644 index 000000000..add5faaf3 --- /dev/null +++ b/sdks/python/src/coss/types/scheduling_reassignment_status.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +SchedulingReassignmentStatus = typing.Union[typing.Literal["pending", "running", "completed", "cancelled"], typing.Any] diff --git a/sdks/python/src/coss/types/scheduling_reassignment_strategy.py b/sdks/python/src/coss/types/scheduling_reassignment_strategy.py new file mode 100644 index 000000000..e5b7e2053 --- /dev/null +++ b/sdks/python/src/coss/types/scheduling_reassignment_strategy.py @@ -0,0 +1,41 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from .scheduling_reassignment_strategy_assignments_item import SchedulingReassignmentStrategyAssignmentsItem +from .scheduling_reassignment_strategy_otherwise import SchedulingReassignmentStrategyOtherwise + + +class SchedulingReassignmentStrategy(UniversalBaseModel): + to_host: typing.Optional[str] = pydantic.Field(default=None) + """ + Give them all to this host. + """ + + preferred_hosts: typing.Optional[typing.List[str]] = pydantic.Field(default=None) + """ + Try these first, in order. + """ + + otherwise: typing.Optional[SchedulingReassignmentStrategyOtherwise] = pydantic.Field(default=None) + """ + After `preferred_hosts`: `auto` picks the fairest who's free, `leave` keeps it where it is. + """ + + assignments: typing.Optional[typing.List[SchedulingReassignmentStrategyAssignmentsItem]] = pydantic.Field( + default=None + ) + """ + Who each goes to: a preview, with your changes. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/sdks/python/src/coss/types/scheduling_reassignment_strategy_assignments_item.py b/sdks/python/src/coss/types/scheduling_reassignment_strategy_assignments_item.py new file mode 100644 index 000000000..9ed1721d3 --- /dev/null +++ b/sdks/python/src/coss/types/scheduling_reassignment_strategy_assignments_item.py @@ -0,0 +1,21 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel + + +class SchedulingReassignmentStrategyAssignmentsItem(UniversalBaseModel): + booking: str + to_host: str + from_host: typing.Optional[str] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/sdks/python/src/coss/types/scheduling_reassignment_strategy_otherwise.py b/sdks/python/src/coss/types/scheduling_reassignment_strategy_otherwise.py new file mode 100644 index 000000000..e405f52a3 --- /dev/null +++ b/sdks/python/src/coss/types/scheduling_reassignment_strategy_otherwise.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +SchedulingReassignmentStrategyOtherwise = typing.Union[typing.Literal["auto", "leave"], typing.Any] diff --git a/sdks/python/src/coss/types/scheduling_reassignment_webhook_event.py b/sdks/python/src/coss/types/scheduling_reassignment_webhook_event.py new file mode 100644 index 000000000..79f01dcec --- /dev/null +++ b/sdks/python/src/coss/types/scheduling_reassignment_webhook_event.py @@ -0,0 +1,40 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from .scheduling_reassignment_webhook_event_data import SchedulingReassignmentWebhookEventData +from .scheduling_reassignment_webhook_event_object import SchedulingReassignmentWebhookEventObject +from .scheduling_reassignment_webhook_event_type import SchedulingReassignmentWebhookEventType + + +class SchedulingReassignmentWebhookEvent(UniversalBaseModel): + id: str = pydantic.Field() + """ + The event id. + """ + + object: SchedulingReassignmentWebhookEventObject + api_version: str = pydantic.Field() + """ + The API version this payload is rendered in: the endpoint's. + """ + + created_at: dt.datetime = pydantic.Field() + """ + When the event was created. + """ + + type: SchedulingReassignmentWebhookEventType + data: SchedulingReassignmentWebhookEventData + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/sdks/python/src/coss/types/scheduling_reassignment_webhook_event_data.py b/sdks/python/src/coss/types/scheduling_reassignment_webhook_event_data.py new file mode 100644 index 000000000..ba4c935b6 --- /dev/null +++ b/sdks/python/src/coss/types/scheduling_reassignment_webhook_event_data.py @@ -0,0 +1,25 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from .scheduling_reassignment_webhook_event_data_counts import SchedulingReassignmentWebhookEventDataCounts +from .scheduling_reassignment_webhook_event_data_status import SchedulingReassignmentWebhookEventDataStatus + + +class SchedulingReassignmentWebhookEventData(UniversalBaseModel): + reassignment_id: str + status: SchedulingReassignmentWebhookEventDataStatus + out_of_office_id: typing.Optional[str] = None + counts: SchedulingReassignmentWebhookEventDataCounts + occurred_at: str + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/sdks/python/src/coss/types/scheduling_reassignment_webhook_event_data_counts.py b/sdks/python/src/coss/types/scheduling_reassignment_webhook_event_data_counts.py new file mode 100644 index 000000000..53233b1d9 --- /dev/null +++ b/sdks/python/src/coss/types/scheduling_reassignment_webhook_event_data_counts.py @@ -0,0 +1,33 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel + + +class SchedulingReassignmentWebhookEventDataCounts(UniversalBaseModel): + total: float + pending: float + reassigned: float + skipped: float = pydantic.Field() + """ + They'd moved on since it was selected. + """ + + no_candidate: float = pydantic.Field() + """ + Nobody could take them: they stayed. + """ + + failed: float + cancelled: float + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/sdks/python/src/coss/types/scheduling_reassignment_webhook_event_data_status.py b/sdks/python/src/coss/types/scheduling_reassignment_webhook_event_data_status.py new file mode 100644 index 000000000..e3ea8ee29 --- /dev/null +++ b/sdks/python/src/coss/types/scheduling_reassignment_webhook_event_data_status.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +SchedulingReassignmentWebhookEventDataStatus = typing.Union[typing.Literal["completed", "cancelled"], typing.Any] diff --git a/sdks/python/src/coss/types/scheduling_reassignment_webhook_event_object.py b/sdks/python/src/coss/types/scheduling_reassignment_webhook_event_object.py new file mode 100644 index 000000000..3c9a46cf3 --- /dev/null +++ b/sdks/python/src/coss/types/scheduling_reassignment_webhook_event_object.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +SchedulingReassignmentWebhookEventObject = typing.Union[typing.Literal["event"], typing.Any] diff --git a/sdks/python/src/coss/types/scheduling_reassignment_webhook_event_type.py b/sdks/python/src/coss/types/scheduling_reassignment_webhook_event_type.py new file mode 100644 index 000000000..af14c4223 --- /dev/null +++ b/sdks/python/src/coss/types/scheduling_reassignment_webhook_event_type.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +SchedulingReassignmentWebhookEventType = typing.Union[typing.Literal["scheduling.reassignment.completed"], typing.Any] diff --git a/sdks/python/src/coss/types/scheduling_settings.py b/sdks/python/src/coss/types/scheduling_settings.py index 20054404d..27af99c04 100644 --- a/sdks/python/src/coss/types/scheduling_settings.py +++ b/sdks/python/src/coss/types/scheduling_settings.py @@ -6,9 +6,11 @@ from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel from .scheduling_reminder import SchedulingReminder from .scheduling_settings_calendar_failure_mode import SchedulingSettingsCalendarFailureMode +from .scheduling_settings_host_reassignment import SchedulingSettingsHostReassignment from .scheduling_settings_logo import SchedulingSettingsLogo from .scheduling_settings_notifications_value import SchedulingSettingsNotificationsValue from .scheduling_settings_object import SchedulingSettingsObject +from .scheduling_settings_out_of_office_reasons_item import SchedulingSettingsOutOfOfficeReasonsItem class SchedulingSettings(UniversalBaseModel): @@ -33,6 +35,11 @@ class SchedulingSettings(UniversalBaseModel): At the top of the hosted pages, and of emails sent from `email_from`. """ + privacy_url: typing.Optional[str] = pydantic.Field(default=None) + """ + Your privacy policy, linked on a host's page beside what connecting a calendar does, once this environment has its own OAuth app and a `brand_name`. + """ + email_from: typing.Optional[str] = pydantic.Field(default=None) """ Sender of booking emails, on a verified domain. @@ -43,6 +50,21 @@ class SchedulingSettings(UniversalBaseModel): Your approved number for SMS reminders. Without one, no SMS is sent. """ + name_host_in_attendee_emails: bool = pydantic.Field() + """ + Name the new host when telling an attendee their booking has one. + """ + + host_reassignment: SchedulingSettingsHostReassignment = pydantic.Field() + """ + Whether hosts can give their own bookings to someone else from their page. `eligible` lets them, to anyone free who takes that event type. + """ + + out_of_office_reasons: typing.List[SchedulingSettingsOutOfOfficeReasonsItem] = pydantic.Field() + """ + Reasons of your own for time away, on top of the preset ones. + """ + calendar_failure_mode: SchedulingSettingsCalendarFailureMode = pydantic.Field() """ When a host's calendar can't be read: `hide` stops offering them, `last_known` keeps offering their last known times. diff --git a/sdks/python/src/coss/types/scheduling_settings_host_reassignment.py b/sdks/python/src/coss/types/scheduling_settings_host_reassignment.py new file mode 100644 index 000000000..9eddc20e8 --- /dev/null +++ b/sdks/python/src/coss/types/scheduling_settings_host_reassignment.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +SchedulingSettingsHostReassignment = typing.Union[typing.Literal["off", "eligible"], typing.Any] diff --git a/sdks/python/src/coss/types/scheduling_location_google_meet.py b/sdks/python/src/coss/types/scheduling_settings_out_of_office_reasons_item.py similarity index 82% rename from sdks/python/src/coss/types/scheduling_location_google_meet.py rename to sdks/python/src/coss/types/scheduling_settings_out_of_office_reasons_item.py index bf799e952..c7418c5e6 100644 --- a/sdks/python/src/coss/types/scheduling_location_google_meet.py +++ b/sdks/python/src/coss/types/scheduling_settings_out_of_office_reasons_item.py @@ -6,7 +6,10 @@ from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel -class SchedulingLocationGoogleMeet(UniversalBaseModel): +class SchedulingSettingsOutOfOfficeReasonsItem(UniversalBaseModel): + key: str + label: str + if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 else: diff --git a/sdks/python/src/coss/types/scheduling_slot_explanation.py b/sdks/python/src/coss/types/scheduling_slot_explanation.py index 2171269d3..632491e79 100644 --- a/sdks/python/src/coss/types/scheduling_slot_explanation.py +++ b/sdks/python/src/coss/types/scheduling_slot_explanation.py @@ -27,7 +27,7 @@ class SchedulingSlotExplanation(UniversalBaseModel): reason: typing.Optional[str] = pydantic.Field(default=None) """ - Why it can't: `not_on_grid`, `too_soon`, `outside_booking_window`, `calendar_unverified`, `outside_availability`, `host_busy`, `already_claimed`, `limit_reached` or `session_full`, or `event_type_inactive` or `no_hosts`. `null` when it can. With several hosts refused, the first one's reason: see `hosts`. + Why it can't: `not_on_grid`, `too_soon`, `outside_booking_window`, `out_of_office`, `outside_coverage`, `calendar_unverified`, `outside_availability`, `host_busy`, `already_claimed`, `limit_reached` or `session_full`, or `event_type_inactive` or `no_hosts`. `null` when it can. With several hosts refused, the first one's reason: see `hosts`. """ hosts: typing.List[SchedulingSlotExplanationHostsItem] = pydantic.Field() diff --git a/sdks/python/src/coss/types/scheduling_slot_explanation_hosts_item.py b/sdks/python/src/coss/types/scheduling_slot_explanation_hosts_item.py index 2b50c9b19..f94a3b390 100644 --- a/sdks/python/src/coss/types/scheduling_slot_explanation_hosts_item.py +++ b/sdks/python/src/coss/types/scheduling_slot_explanation_hosts_item.py @@ -25,7 +25,7 @@ class SchedulingSlotExplanationHostsItem(UniversalBaseModel): reason: typing.Optional[str] = pydantic.Field(default=None) """ - Why not: `not_on_grid`, `too_soon`, `outside_booking_window`, `calendar_unverified`, `outside_availability`, `host_busy`, `already_claimed`, `limit_reached` or `session_full`. `null` when they could. + Why not: `not_on_grid`, `too_soon`, `outside_booking_window`, `out_of_office`, `outside_coverage`, `calendar_unverified`, `outside_availability`, `host_busy`, `already_claimed`, `limit_reached` or `session_full`. `null` when they could. """ calendar_reason: typing.Optional[str] = pydantic.Field(default=None) diff --git a/sdks/python/src/coss/types/webhook_test_event_event.py b/sdks/python/src/coss/types/webhook_test_event_event.py index 46005d1a8..b0ed10b17 100644 --- a/sdks/python/src/coss/types/webhook_test_event_event.py +++ b/sdks/python/src/coss/types/webhook_test_event_event.py @@ -14,6 +14,9 @@ from .scheduling_booking_webhook_event import SchedulingBookingWebhookEvent from .scheduling_calendar_delegation_webhook_event import SchedulingCalendarDelegationWebhookEvent from .scheduling_calendar_webhook_event import SchedulingCalendarWebhookEvent +from .scheduling_oauth_app_webhook_event import SchedulingOauthAppWebhookEvent +from .scheduling_out_of_office_webhook_event import SchedulingOutOfOfficeWebhookEvent +from .scheduling_reassignment_webhook_event import SchedulingReassignmentWebhookEvent from .sign_request_webhook_event import SignRequestWebhookEvent from .sms_webhook_event import SmsWebhookEvent from .verification_webhook_event import VerificationWebhookEvent @@ -33,5 +36,8 @@ FormSubmissionWebhookEvent, SchedulingBookingWebhookEvent, SchedulingCalendarWebhookEvent, + SchedulingOutOfOfficeWebhookEvent, + SchedulingReassignmentWebhookEvent, SchedulingCalendarDelegationWebhookEvent, + SchedulingOauthAppWebhookEvent, ] diff --git a/sdks/ruby/CHANGELOG.md b/sdks/ruby/CHANGELOG.md index 8ba8118a4..4152bfb5e 100644 --- a/sdks/ruby/CHANGELOG.md +++ b/sdks/ruby/CHANGELOG.md @@ -1,5 +1,10 @@ # Changelog +## 0.4.0 + +- Regenerated from the API's OpenAPI document at 2eb77126153a. What changed in the API: the + [API changelog](https://coss.com/docs/api-reference/changelog). + ## 0.3.0 - Regenerated from the API's OpenAPI document at 820256d03a44. What changed in the API: the diff --git a/sdks/ruby/lib/coss.rb b/sdks/ruby/lib/coss.rb index f9345ac8a..4f96ff41f 100644 --- a/sdks/ruby/lib/coss.rb +++ b/sdks/ruby/lib/coss.rb @@ -133,15 +133,10 @@ require_relative "coss/scheduling/hosts/types/create_host_request_attributes_value" require_relative "coss/scheduling/hosts/types/update_host_request_attributes_value" require_relative "coss/scheduling/hosts/types/update_host_request_status" -require_relative "coss/scheduling/event_types/types/create_event_type_request_kind" -require_relative "coss/scheduling/event_types/types/create_event_type_request_host_calendar_details" -require_relative "coss/scheduling/event_types/types/create_event_type_request_host_filter_value" -require_relative "coss/scheduling/event_types/types/create_event_type_request_notifications_value" -require_relative "coss/scheduling/event_types/types/update_event_type_request_host_calendar_details" -require_relative "coss/scheduling/event_types/types/update_event_type_request_host_filter_value" -require_relative "coss/scheduling/event_types/types/update_event_type_request_notifications_value" -require_relative "coss/scheduling/event_types/types/update_event_type_request_status" -require_relative "coss/scheduling/availability/types/availability_search_request_attributes_value" +require_relative "coss/scheduling/bookings/types/reassign_scheduling_booking_request_changes_item" +require_relative "coss/scheduling/bookings/types/reassign_scheduling_booking_request_reason_code" +require_relative "coss/scheduling/bookings/types/reassign_scheduling_booking_request_overrides_item" +require_relative "coss/scheduling/bookings/types/reassign_scheduling_booking_request_notify" require_relative "coss/scheduling/bookings/types/list_bookings_request_status" require_relative "coss/scheduling/bookings/types/create_booking_request_attributes_value" require_relative "coss/scheduling/bookings/types/create_booking_request_answers_value" @@ -152,6 +147,38 @@ require_relative "coss/scheduling/bookings/types/create_booking_request_location_microsoft_teams" require_relative "coss/scheduling/bookings/types/create_booking_request_location_zoom" require_relative "coss/scheduling/bookings/types/create_booking_request_location" +require_relative "coss/scheduling/reassignments/types/preview_scheduling_reassignment_request_overrides_item" +require_relative "coss/scheduling/reassignments/types/create_scheduling_reassignment_request_reason_code" +require_relative "coss/scheduling/reassignments/types/create_scheduling_reassignment_request_overrides_item" +require_relative "coss/scheduling/reassignments/types/create_scheduling_reassignment_request_notify_hosts" +require_relative "coss/scheduling/reassignments/types/create_scheduling_reassignment_request_notify" +require_relative "coss/scheduling/reassignments/types/undo_scheduling_reassignment_request_reason_code" +require_relative "coss/scheduling/reassignments/types/undo_scheduling_reassignment_request_overrides_item" +require_relative "coss/scheduling/reassignments/types/undo_scheduling_reassignment_request_notify_hosts" +require_relative "coss/scheduling/reassignments/types/undo_scheduling_reassignment_request_notify" +require_relative "coss/scheduling/holiday_calendars/types/create_scheduling_holiday_calendar_request_host_filter_value" +require_relative "coss/scheduling/holiday_calendars/types/create_scheduling_holiday_calendar_request_existing_bookings" +require_relative "coss/scheduling/holiday_calendars/types/update_scheduling_holiday_calendar_request_host_filter_value" +require_relative "coss/scheduling/holiday_calendars/types/update_scheduling_holiday_calendar_request_existing_bookings" +require_relative "coss/scheduling/out_of_office/types/create_scheduling_out_of_office_request_host_filter_value" +require_relative "coss/scheduling/out_of_office/types/create_scheduling_out_of_office_request_existing_bookings" +require_relative "coss/scheduling/out_of_office/types/create_scheduling_out_of_office_request_reassign_otherwise" +require_relative "coss/scheduling/out_of_office/types/create_scheduling_out_of_office_request_reassign" +require_relative "coss/scheduling/out_of_office/types/update_scheduling_out_of_office_request_existing_bookings" +require_relative "coss/scheduling/out_of_office/types/update_scheduling_out_of_office_request_reassign_otherwise" +require_relative "coss/scheduling/out_of_office/types/update_scheduling_out_of_office_request_reassign" +require_relative "coss/scheduling/out_of_office/types/put_scheduling_out_of_office_request_existing_bookings" +require_relative "coss/scheduling/out_of_office/types/put_scheduling_out_of_office_request_reassign_otherwise" +require_relative "coss/scheduling/out_of_office/types/put_scheduling_out_of_office_request_reassign" +require_relative "coss/scheduling/event_types/types/create_event_type_request_kind" +require_relative "coss/scheduling/event_types/types/create_event_type_request_host_calendar_details" +require_relative "coss/scheduling/event_types/types/create_event_type_request_host_filter_value" +require_relative "coss/scheduling/event_types/types/create_event_type_request_notifications_value" +require_relative "coss/scheduling/event_types/types/update_event_type_request_host_calendar_details" +require_relative "coss/scheduling/event_types/types/update_event_type_request_host_filter_value" +require_relative "coss/scheduling/event_types/types/update_event_type_request_notifications_value" +require_relative "coss/scheduling/event_types/types/update_event_type_request_status" +require_relative "coss/scheduling/availability/types/availability_search_request_attributes_value" require_relative "coss/scheduling/holds/types/create_hold_request_attributes_value" require_relative "coss/scheduling/holds/types/create_hold_request_answers_value" require_relative "coss/scheduling/holds/types/create_hold_request_location_link" @@ -163,10 +190,13 @@ require_relative "coss/scheduling/holds/types/create_hold_request_location" require_relative "coss/scheduling/calendars/types/authorize_calendar_request_provider" require_relative "coss/scheduling/calendars/types/set_simulated_busy_request_intervals_item" +require_relative "coss/scheduling/sessions/types/create_scheduling_manager_session_request_host_filter_value" require_relative "coss/scheduling/sessions/types/create_scheduling_booker_session_request_attributes_value" require_relative "coss/scheduling/sessions/types/create_scheduling_booker_session_request_attendee" require_relative "coss/scheduling/settings/types/update_scheduling_settings_request_logo" require_relative "coss/scheduling/settings/types/update_scheduling_settings_request_calendar_failure_mode" +require_relative "coss/scheduling/settings/types/update_scheduling_settings_request_host_reassignment" +require_relative "coss/scheduling/settings/types/update_scheduling_settings_request_out_of_office_reasons_item" require_relative "coss/scheduling/settings/types/update_scheduling_settings_request_notifications_value" require_relative "coss/sign/requests/types/create_sign_request_request_documents_item_document_id" require_relative "coss/sign/requests/types/create_sign_request_request_documents_item_content" @@ -388,6 +418,20 @@ require_relative "coss/types/scheduling_calendar_webhook_event_type" require_relative "coss/types/scheduling_calendar_webhook_event_data" require_relative "coss/types/scheduling_calendar_webhook_event" +require_relative "coss/types/scheduling_out_of_office_webhook_event_object" +require_relative "coss/types/scheduling_out_of_office_webhook_event_type" +require_relative "coss/types/scheduling_out_of_office_webhook_event_data" +require_relative "coss/types/scheduling_out_of_office_webhook_event" +require_relative "coss/types/scheduling_reassignment_webhook_event_object" +require_relative "coss/types/scheduling_reassignment_webhook_event_type" +require_relative "coss/types/scheduling_reassignment_webhook_event_data_status" +require_relative "coss/types/scheduling_reassignment_webhook_event_data_counts" +require_relative "coss/types/scheduling_reassignment_webhook_event_data" +require_relative "coss/types/scheduling_reassignment_webhook_event" +require_relative "coss/types/scheduling_oauth_app_webhook_event_object" +require_relative "coss/types/scheduling_oauth_app_webhook_event_type" +require_relative "coss/types/scheduling_oauth_app_webhook_event_data" +require_relative "coss/types/scheduling_oauth_app_webhook_event" require_relative "coss/types/environment_object" require_relative "coss/types/environment_mode" require_relative "coss/types/environment_project" @@ -764,6 +808,75 @@ require_relative "coss/types/scheduling_host_list" require_relative "coss/types/deleted_scheduling_host_object" require_relative "coss/types/deleted_scheduling_host" +require_relative "coss/types/scheduling_booking_object" +require_relative "coss/types/scheduling_booking_status" +require_relative "coss/types/scheduling_booking_attendees_item_role" +require_relative "coss/types/scheduling_booking_attendees_item_answers_value" +require_relative "coss/types/scheduling_booking_attendees_item" +require_relative "coss/types/scheduling_booking_cancelled_by" +require_relative "coss/types/scheduling_location_zero_type" +require_relative "coss/types/scheduling_location_zero" +require_relative "coss/types/scheduling_location_number_type" +require_relative "coss/types/scheduling_location_number" +require_relative "coss/types/scheduling_location_address_type" +require_relative "coss/types/scheduling_location_address" +require_relative "coss/types/scheduling_location_three_type" +require_relative "coss/types/scheduling_location_three" +require_relative "coss/types/scheduling_location_four_type" +require_relative "coss/types/scheduling_location_four" +require_relative "coss/types/scheduling_location_five_type" +require_relative "coss/types/scheduling_location_five" +require_relative "coss/types/scheduling_location" +require_relative "coss/types/scheduling_booking" +require_relative "coss/types/scheduling_reassign_candidate_list_object" +require_relative "coss/types/scheduling_reassign_candidate_object" +require_relative "coss/types/scheduling_reassign_candidate" +require_relative "coss/types/scheduling_reassign_candidate_list" +require_relative "coss/types/scheduling_reassignment_preview_object" +require_relative "coss/types/scheduling_reassignment_preview_items_item_status" +require_relative "coss/types/scheduling_reassignment_preview_items_item" +require_relative "coss/types/scheduling_reassignment_preview" +require_relative "coss/types/scheduling_reassignment_selection" +require_relative "coss/types/scheduling_reassignment_strategy_otherwise" +require_relative "coss/types/scheduling_reassignment_strategy_assignments_item" +require_relative "coss/types/scheduling_reassignment_strategy" +require_relative "coss/types/scheduling_reassignment_object" +require_relative "coss/types/scheduling_reassignment_status" +require_relative "coss/types/scheduling_reassignment_reason_code" +require_relative "coss/types/scheduling_reassignment_counts" +require_relative "coss/types/scheduling_reassignment" +require_relative "coss/types/scheduling_reassignment_list_object" +require_relative "coss/types/scheduling_reassignment_list" +require_relative "coss/types/scheduling_reassignment_item_list_object" +require_relative "coss/types/scheduling_reassignment_item_object" +require_relative "coss/types/scheduling_reassignment_item_outcome" +require_relative "coss/types/scheduling_reassignment_item" +require_relative "coss/types/scheduling_reassignment_item_list" +require_relative "coss/types/scheduling_holiday_calendar_object" +require_relative "coss/types/scheduling_holiday_calendar_source" +require_relative "coss/types/scheduling_holiday_calendar_host_filter_value" +require_relative "coss/types/scheduling_holiday_calendar_existing_bookings" +require_relative "coss/types/scheduling_holiday_calendar" +require_relative "coss/types/scheduling_holiday_calendar_list_object" +require_relative "coss/types/scheduling_holiday_calendar_list" +require_relative "coss/types/scheduling_holiday_list_object" +require_relative "coss/types/scheduling_holiday_list_data_item" +require_relative "coss/types/scheduling_holiday_list" +require_relative "coss/types/deleted_scheduling_holiday_calendar" +require_relative "coss/types/scheduling_out_of_office_list_object" +require_relative "coss/types/scheduling_out_of_office_object" +require_relative "coss/types/scheduling_out_of_office_all_day" +require_relative "coss/types/scheduling_out_of_office_existing_bookings" +require_relative "coss/types/scheduling_out_of_office_source" +require_relative "coss/types/scheduling_out_of_office" +require_relative "coss/types/scheduling_out_of_office_list" +require_relative "coss/types/deleted_scheduling_out_of_office_object" +require_relative "coss/types/deleted_scheduling_out_of_office" +require_relative "coss/types/scheduling_out_of_office_conflict_list_object" +require_relative "coss/types/scheduling_out_of_office_conflict_object" +require_relative "coss/types/scheduling_out_of_office_conflict_status" +require_relative "coss/types/scheduling_out_of_office_conflict" +require_relative "coss/types/scheduling_out_of_office_conflict_list" require_relative "coss/types/scheduling_schedule_object" require_relative "coss/types/scheduling_schedule_rules_item" require_relative "coss/types/scheduling_schedule_overrides_item_ranges_item" @@ -795,13 +908,6 @@ require_relative "coss/types/scheduling_limit" require_relative "coss/types/scheduling_question_type" require_relative "coss/types/scheduling_question" -require_relative "coss/types/scheduling_location_link" -require_relative "coss/types/scheduling_location_phone" -require_relative "coss/types/scheduling_location_in_person" -require_relative "coss/types/scheduling_location_google_meet" -require_relative "coss/types/scheduling_location_microsoft_teams" -require_relative "coss/types/scheduling_location_zoom" -require_relative "coss/types/scheduling_location" require_relative "coss/types/scheduling_reminder_anchor" require_relative "coss/types/scheduling_reminder_send_item" require_relative "coss/types/scheduling_reminder_button" @@ -829,13 +935,6 @@ require_relative "coss/types/scheduling_availability_search_result_data_item_slots_item" require_relative "coss/types/scheduling_availability_search_result_data_item" require_relative "coss/types/scheduling_availability_search_result" -require_relative "coss/types/scheduling_booking_object" -require_relative "coss/types/scheduling_booking_status" -require_relative "coss/types/scheduling_booking_attendees_item_role" -require_relative "coss/types/scheduling_booking_attendees_item_answers_value" -require_relative "coss/types/scheduling_booking_attendees_item" -require_relative "coss/types/scheduling_booking_cancelled_by" -require_relative "coss/types/scheduling_booking" require_relative "coss/types/scheduling_attendee_input" require_relative "coss/types/scheduling_guest_input" require_relative "coss/types/scheduling_booking_list_object" @@ -902,11 +1001,25 @@ require_relative "coss/types/scheduling_calendar_delegation_list" require_relative "coss/types/deleted_scheduling_calendar_delegation_object" require_relative "coss/types/deleted_scheduling_calendar_delegation" +require_relative "coss/types/scheduling_oauth_app_object" +require_relative "coss/types/scheduling_oauth_app_provider" +require_relative "coss/types/scheduling_oauth_app_status" +require_relative "coss/types/scheduling_oauth_app" +require_relative "coss/types/create_oauth_app_request_google" +require_relative "coss/types/create_oauth_app_request_microsoft" +require_relative "coss/types/create_oauth_app_request_zoom" +require_relative "coss/types/create_oauth_app_request" +require_relative "coss/types/scheduling_oauth_app_list_object" +require_relative "coss/types/scheduling_oauth_app_list" +require_relative "coss/types/deleted_scheduling_oauth_app_object" +require_relative "coss/types/deleted_scheduling_oauth_app" require_relative "coss/types/scheduling_session_object" require_relative "coss/types/scheduling_session" require_relative "coss/types/scheduling_settings_object" require_relative "coss/types/scheduling_settings_logo_content_type" require_relative "coss/types/scheduling_settings_logo" +require_relative "coss/types/scheduling_settings_host_reassignment" +require_relative "coss/types/scheduling_settings_out_of_office_reasons_item" require_relative "coss/types/scheduling_settings_calendar_failure_mode" require_relative "coss/types/scheduling_settings_notifications_value" require_relative "coss/types/scheduling_settings" @@ -1537,6 +1650,42 @@ require_relative "coss/scheduling/hosts/types/get_hosts_request" require_relative "coss/scheduling/hosts/types/remove_hosts_request" require_relative "coss/scheduling/hosts/types/update_host_request" +require_relative "coss/scheduling/bookings/client" +require_relative "coss/scheduling/bookings/types/reassign_scheduling_booking_request" +require_relative "coss/scheduling/bookings/types/reassign_candidates_bookings_request" +require_relative "coss/scheduling/bookings/types/list_bookings_request" +require_relative "coss/scheduling/bookings/types/create_booking_request" +require_relative "coss/scheduling/bookings/types/get_bookings_request" +require_relative "coss/scheduling/bookings/types/reschedule_booking_request" +require_relative "coss/scheduling/bookings/types/cancel_scheduling_booking_request" +require_relative "coss/scheduling/bookings/types/events_bookings_request" +require_relative "coss/scheduling/bookings/types/approve_bookings_request" +require_relative "coss/scheduling/bookings/types/decline_bookings_request" +require_relative "coss/scheduling/bookings/types/notifications_bookings_request" +require_relative "coss/scheduling/bookings/types/mark_no_show_bookings_request" +require_relative "coss/scheduling/bookings/types/update_booking_location_request" +require_relative "coss/scheduling/reassignments/client" +require_relative "coss/scheduling/reassignments/types/preview_scheduling_reassignment_request" +require_relative "coss/scheduling/reassignments/types/list_reassignments_request" +require_relative "coss/scheduling/reassignments/types/create_scheduling_reassignment_request" +require_relative "coss/scheduling/reassignments/types/get_reassignments_request" +require_relative "coss/scheduling/reassignments/types/items_reassignments_request" +require_relative "coss/scheduling/reassignments/types/cancel_reassignments_request" +require_relative "coss/scheduling/reassignments/types/undo_scheduling_reassignment_request" +require_relative "coss/scheduling/holiday_calendars/client" +require_relative "coss/scheduling/holiday_calendars/types/create_scheduling_holiday_calendar_request" +require_relative "coss/scheduling/holiday_calendars/types/get_holiday_calendars_request" +require_relative "coss/scheduling/holiday_calendars/types/remove_holiday_calendars_request" +require_relative "coss/scheduling/holiday_calendars/types/update_scheduling_holiday_calendar_request" +require_relative "coss/scheduling/holiday_calendars/types/holidays_holiday_calendars_request" +require_relative "coss/scheduling/out_of_office/client" +require_relative "coss/scheduling/out_of_office/types/list_out_of_office_request" +require_relative "coss/scheduling/out_of_office/types/create_scheduling_out_of_office_request" +require_relative "coss/scheduling/out_of_office/types/get_out_of_office_request" +require_relative "coss/scheduling/out_of_office/types/remove_out_of_office_request" +require_relative "coss/scheduling/out_of_office/types/update_scheduling_out_of_office_request" +require_relative "coss/scheduling/out_of_office/types/put_scheduling_out_of_office_request" +require_relative "coss/scheduling/out_of_office/types/conflicts_out_of_office_request" require_relative "coss/scheduling/schedules/client" require_relative "coss/scheduling/schedules/types/list_schedules_request" require_relative "coss/scheduling/schedules/types/create_schedules_request" @@ -1553,18 +1702,6 @@ require_relative "coss/scheduling/slots/types/explain_slots_request" require_relative "coss/scheduling/availability/client" require_relative "coss/scheduling/availability/types/availability_search_request" -require_relative "coss/scheduling/bookings/client" -require_relative "coss/scheduling/bookings/types/list_bookings_request" -require_relative "coss/scheduling/bookings/types/create_booking_request" -require_relative "coss/scheduling/bookings/types/get_bookings_request" -require_relative "coss/scheduling/bookings/types/reschedule_booking_request" -require_relative "coss/scheduling/bookings/types/cancel_scheduling_booking_request" -require_relative "coss/scheduling/bookings/types/events_bookings_request" -require_relative "coss/scheduling/bookings/types/approve_bookings_request" -require_relative "coss/scheduling/bookings/types/decline_bookings_request" -require_relative "coss/scheduling/bookings/types/notifications_bookings_request" -require_relative "coss/scheduling/bookings/types/mark_no_show_bookings_request" -require_relative "coss/scheduling/bookings/types/update_booking_location_request" require_relative "coss/scheduling/holds/client" require_relative "coss/scheduling/holds/types/create_hold_request" require_relative "coss/scheduling/holds/types/confirm_hold_request" @@ -1587,7 +1724,12 @@ require_relative "coss/scheduling/calendar_delegations/types/delete_calendar_delegations_request" require_relative "coss/scheduling/calendar_delegations/types/update_calendar_delegation_request" require_relative "coss/scheduling/calendar_delegations/types/verify_calendar_delegation_request" +require_relative "coss/scheduling/oauth_apps/client" +require_relative "coss/scheduling/oauth_apps/types/get_oauth_apps_request" +require_relative "coss/scheduling/oauth_apps/types/delete_oauth_apps_request" +require_relative "coss/scheduling/oauth_apps/types/update_oauth_app_request" require_relative "coss/scheduling/sessions/client" +require_relative "coss/scheduling/sessions/types/create_scheduling_manager_session_request" require_relative "coss/scheduling/sessions/types/create_scheduling_host_session_request" require_relative "coss/scheduling/sessions/types/create_scheduling_booker_session_request" require_relative "coss/scheduling/sessions/types/create_for_booking_sessions_request" diff --git a/sdks/ruby/lib/coss/client.rb b/sdks/ruby/lib/coss/client.rb index ff3b24dfa..adb037d19 100644 --- a/sdks/ruby/lib/coss/client.rb +++ b/sdks/ruby/lib/coss/client.rb @@ -12,7 +12,7 @@ def initialize(base_url: nil, api_key: ENV.fetch("COSS_API_KEY", nil), api_versi @raw_client = Coss::Internal::Http::RawClient.new( base_url: base_url || Coss::Environment::DEFAULT, headers: { - "User-Agent" => "coss-ruby/0.3.0", + "User-Agent" => "coss-ruby/0.4.0", "X-Fern-Language" => "Ruby", Authorization: "Bearer #{api_key}", "Coss-Version" => api_version.to_s diff --git a/sdks/ruby/lib/coss/scheduling/bookings/client.rb b/sdks/ruby/lib/coss/scheduling/bookings/client.rb index 98173d752..e1792465a 100644 --- a/sdks/ruby/lib/coss/scheduling/bookings/client.rb +++ b/sdks/ruby/lib/coss/scheduling/bookings/client.rb @@ -11,6 +11,102 @@ def initialize(client:) @client = client end + # Gives a booking to another host, keeping its id and time. Works for every kind: a group session moves as a + # whole, from any of its seats, and one that's already started changes for the record, with nobody told. Whoever + # leaves and joins is told, and the attendee unless you say not to. + # + # @param request_options [Hash] + # @param params [Coss::Scheduling::Bookings::Types::ReassignSchedulingBookingRequest] + # @option request_options [String] :base_url + # @option request_options [Hash{String => Object}] :additional_headers + # @option request_options [Hash{String => Object}] :additional_query_parameters + # @option request_options [Hash{String => Object}] :additional_body_parameters + # @option request_options [Integer] :timeout_in_seconds + # @option params [String] :id + # + # @example + # client.scheduling.bookings.reassign( + # id: "book_01kd2m9a0b1c2d3e4f5g6h7j8m", + # changes: [{ + # to_host: "doctor_518" + # }], + # reason_code: "out_of_office" + # ) + # + # @return [Coss::Types::SchedulingBooking] + def reassign(request_options: {}, **params) + params = Coss::Internal::Types::Utils.normalize_keys(params) + request_data = Coss::Scheduling::Bookings::Types::ReassignSchedulingBookingRequest.new(params).to_h + non_body_param_names = %w[id] + body = request_data.except(*non_body_param_names) + + headers = { "Idempotency-Key" => Coss::Internal::IdempotencyKey.generate } + request = Coss::Internal::JSON::Request.new( + base_url: request_options[:base_url], + method: "POST", + path: "v1/scheduling/bookings/#{URI.encode_uri_component(params[:id].to_s)}/reassign", + headers: headers, + body: body, + request_options: request_options, + max_retries: 0 + ) + begin + response = @client.send(request) + rescue Net::HTTPRequestTimeout + raise Coss::Errors::TimeoutError + end + code = response.code.to_i + if code.between?(200, 299) + (response.body.to_s.empty? ? nil : Coss::Types::SchedulingBooking.load(response.body)) + else + error_class = Coss::Errors::ResponseError.subclass_for_code(code) + raise error_class.new(response.body, code: code) + end + end + + # The environment's other active hosts: members of the event type first, in the order a pool would pick them, + # each saying whether they're free and why not. Things can change before you ask: reassigning decides again. + # + # @param request_options [Hash] + # @param params [Hash] + # @option request_options [String] :base_url + # @option request_options [Hash{String => Object}] :additional_headers + # @option request_options [Hash{String => Object}] :additional_query_parameters + # @option request_options [Hash{String => Object}] :additional_body_parameters + # @option request_options [Integer] :timeout_in_seconds + # @option params [String] :id + # @option params [String, nil] :from_host + # + # @example + # client.scheduling.bookings.reassign_candidates(id: "book_01kd2m9a0b1c2d3e4f5g6h7j8m") + # + # @return [Coss::Types::SchedulingReassignCandidateList] + def reassign_candidates(request_options: {}, **params) + params = Coss::Internal::Types::Utils.normalize_keys(params) + query_params = {} + query_params["from_host"] = params[:from_host] if params.key?(:from_host) + + request = Coss::Internal::JSON::Request.new( + base_url: request_options[:base_url], + method: "GET", + path: "v1/scheduling/bookings/#{URI.encode_uri_component(params[:id].to_s)}/reassign_candidates", + query: query_params, + request_options: request_options + ) + begin + response = @client.send(request) + rescue Net::HTTPRequestTimeout + raise Coss::Errors::TimeoutError + end + code = response.code.to_i + if code.between?(200, 299) + (response.body.to_s.empty? ? nil : Coss::Types::SchedulingReassignCandidateList.load(response.body)) + else + error_class = Coss::Errors::ResponseError.subclass_for_code(code) + raise error_class.new(response.body, code: code) + end + end + # The environment's bookings, newest first. Answers aren't included. # # @param request_options [Hash] @@ -475,7 +571,13 @@ def mark_no_show(request_options: {}, **params) # @option params [String] :id # # @example - # client.scheduling.bookings.update_location(id: "book_01kd2m9a0b1c2d3e4f5g6h7j8m") + # client.scheduling.bookings.update_location( + # id: "book_01kd2m9a0b1c2d3e4f5g6h7j8m", + # location: { + # type: "link", + # url: "https://meet.example.com/abc" + # } + # ) # # @return [Coss::Types::SchedulingBooking] def update_location(request_options: {}, **params) diff --git a/sdks/ruby/lib/coss/scheduling/bookings/types/reassign_candidates_bookings_request.rb b/sdks/ruby/lib/coss/scheduling/bookings/types/reassign_candidates_bookings_request.rb new file mode 100644 index 000000000..0de15a60e --- /dev/null +++ b/sdks/ruby/lib/coss/scheduling/bookings/types/reassign_candidates_bookings_request.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +module Coss + module Scheduling + module Bookings + module Types + class ReassignCandidatesBookingsRequest < Internal::Types::Model + field :id, -> { String }, optional: false, nullable: false + + field :from_host, -> { String }, optional: true, nullable: false + end + end + end + end +end diff --git a/sdks/ruby/lib/coss/scheduling/bookings/types/reassign_scheduling_booking_request.rb b/sdks/ruby/lib/coss/scheduling/bookings/types/reassign_scheduling_booking_request.rb new file mode 100644 index 000000000..3420a6561 --- /dev/null +++ b/sdks/ruby/lib/coss/scheduling/bookings/types/reassign_scheduling_booking_request.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true + +module Coss + module Scheduling + module Bookings + module Types + class ReassignSchedulingBookingRequest < Internal::Types::Model + field :id, -> { String }, optional: false, nullable: false + + field :changes, -> { Internal::Types::Array[Coss::Scheduling::Bookings::Types::ReassignSchedulingBookingRequestChangesItem] }, optional: false, nullable: false + + field :reason_code, -> { Coss::Scheduling::Bookings::Types::ReassignSchedulingBookingRequestReasonCode }, optional: false, nullable: false + + field :note, -> { String }, optional: true, nullable: false + + field :overrides, -> { Internal::Types::Array[Coss::Scheduling::Bookings::Types::ReassignSchedulingBookingRequestOverridesItem] }, optional: true, nullable: false + + field :notify, -> { Coss::Scheduling::Bookings::Types::ReassignSchedulingBookingRequestNotify }, optional: true, nullable: false + end + end + end + end +end diff --git a/sdks/ruby/lib/coss/scheduling/bookings/types/reassign_scheduling_booking_request_changes_item.rb b/sdks/ruby/lib/coss/scheduling/bookings/types/reassign_scheduling_booking_request_changes_item.rb new file mode 100644 index 000000000..ae63689f6 --- /dev/null +++ b/sdks/ruby/lib/coss/scheduling/bookings/types/reassign_scheduling_booking_request_changes_item.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +module Coss + module Scheduling + module Bookings + module Types + class ReassignSchedulingBookingRequestChangesItem < Internal::Types::Model + field :from_host, -> { String }, optional: true, nullable: false + + field :to_host, -> { String }, optional: true, nullable: false + + field :auto, -> { Internal::Types::Boolean }, optional: true, nullable: false + + field :preferred_hosts, -> { Internal::Types::Array[String] }, optional: true, nullable: false + end + end + end + end +end diff --git a/sdks/ruby/lib/coss/scheduling/bookings/types/reassign_scheduling_booking_request_notify.rb b/sdks/ruby/lib/coss/scheduling/bookings/types/reassign_scheduling_booking_request_notify.rb new file mode 100644 index 000000000..594ca952a --- /dev/null +++ b/sdks/ruby/lib/coss/scheduling/bookings/types/reassign_scheduling_booking_request_notify.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Coss + module Scheduling + module Bookings + module Types + class ReassignSchedulingBookingRequestNotify < Internal::Types::Model + field :attendee, -> { Internal::Types::Boolean }, optional: true, nullable: false + end + end + end + end +end diff --git a/sdks/ruby/lib/coss/scheduling/bookings/types/reassign_scheduling_booking_request_overrides_item.rb b/sdks/ruby/lib/coss/scheduling/bookings/types/reassign_scheduling_booking_request_overrides_item.rb new file mode 100644 index 000000000..7f74b7787 --- /dev/null +++ b/sdks/ruby/lib/coss/scheduling/bookings/types/reassign_scheduling_booking_request_overrides_item.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +module Coss + module Scheduling + module Bookings + module Types + module ReassignSchedulingBookingRequestOverridesItem + extend Coss::Internal::Types::Enum + + ANY_HOST = "any_host" + OUT_OF_OFFICE = "out_of_office" + OUTSIDE_AVAILABILITY = "outside_availability" + HOST_BUSY = "host_busy" + LIMIT_REACHED = "limit_reached" + CALENDAR_UNVERIFIED = "calendar_unverified" + end + end + end + end +end diff --git a/sdks/ruby/lib/coss/scheduling/bookings/types/reassign_scheduling_booking_request_reason_code.rb b/sdks/ruby/lib/coss/scheduling/bookings/types/reassign_scheduling_booking_request_reason_code.rb new file mode 100644 index 000000000..40372c0b9 --- /dev/null +++ b/sdks/ruby/lib/coss/scheduling/bookings/types/reassign_scheduling_booking_request_reason_code.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +module Coss + module Scheduling + module Bookings + module Types + module ReassignSchedulingBookingRequestReasonCode + extend Coss::Internal::Types::Enum + + HOST_UNAVAILABLE = "host_unavailable" + OUT_OF_OFFICE = "out_of_office" + WORKLOAD = "workload" + CUSTOMER_REQUEST = "customer_request" + OFFBOARDING = "offboarding" + OTHER = "other" + end + end + end + end +end diff --git a/sdks/ruby/lib/coss/scheduling/bookings/types/update_booking_location_request.rb b/sdks/ruby/lib/coss/scheduling/bookings/types/update_booking_location_request.rb index 9a6b64fdc..1803008db 100644 --- a/sdks/ruby/lib/coss/scheduling/bookings/types/update_booking_location_request.rb +++ b/sdks/ruby/lib/coss/scheduling/bookings/types/update_booking_location_request.rb @@ -7,7 +7,7 @@ module Types class UpdateBookingLocationRequest < Internal::Types::Model field :id, -> { String }, optional: false, nullable: false - field :location, -> { Coss::Types::SchedulingLocation }, optional: false, nullable: false + field :location, -> { Coss::Types::SchedulingLocation }, optional: false, nullable: true end end end diff --git a/sdks/ruby/lib/coss/scheduling/client.rb b/sdks/ruby/lib/coss/scheduling/client.rb index 85377d708..022b92784 100644 --- a/sdks/ruby/lib/coss/scheduling/client.rb +++ b/sdks/ruby/lib/coss/scheduling/client.rb @@ -15,6 +15,26 @@ def hosts @hosts ||= Coss::Scheduling::Hosts::Client.new(client: @client) end + # @return [Coss::Bookings::Client] + def bookings + @bookings ||= Coss::Scheduling::Bookings::Client.new(client: @client) + end + + # @return [Coss::Reassignments::Client] + def reassignments + @reassignments ||= Coss::Scheduling::Reassignments::Client.new(client: @client) + end + + # @return [Coss::HolidayCalendars::Client] + def holiday_calendars + @holiday_calendars ||= Coss::Scheduling::HolidayCalendars::Client.new(client: @client) + end + + # @return [Coss::OutOfOffice::Client] + def out_of_office + @out_of_office ||= Coss::Scheduling::OutOfOffice::Client.new(client: @client) + end + # @return [Coss::Schedules::Client] def schedules @schedules ||= Coss::Scheduling::Schedules::Client.new(client: @client) @@ -35,11 +55,6 @@ def availability @availability ||= Coss::Scheduling::Availability::Client.new(client: @client) end - # @return [Coss::Bookings::Client] - def bookings - @bookings ||= Coss::Scheduling::Bookings::Client.new(client: @client) - end - # @return [Coss::Holds::Client] def holds @holds ||= Coss::Scheduling::Holds::Client.new(client: @client) @@ -65,6 +80,11 @@ def calendar_delegations @calendar_delegations ||= Coss::Scheduling::CalendarDelegations::Client.new(client: @client) end + # @return [Coss::OauthApps::Client] + def oauth_apps + @oauth_apps ||= Coss::Scheduling::OauthApps::Client.new(client: @client) + end + # @return [Coss::Sessions::Client] def sessions @sessions ||= Coss::Scheduling::Sessions::Client.new(client: @client) diff --git a/sdks/ruby/lib/coss/scheduling/event_types/types/create_event_type_request.rb b/sdks/ruby/lib/coss/scheduling/event_types/types/create_event_type_request.rb index 92591e635..44a68d529 100644 --- a/sdks/ruby/lib/coss/scheduling/event_types/types/create_event_type_request.rb +++ b/sdks/ruby/lib/coss/scheduling/event_types/types/create_event_type_request.rb @@ -35,6 +35,8 @@ class CreateEventTypeRequest < Internal::Types::Model field :requires_approval, -> { Internal::Types::Boolean }, optional: true, nullable: false + field :reassignment_enabled, -> { Internal::Types::Boolean }, optional: true, nullable: false + field :approval_ttl_minutes, -> { Integer }, optional: true, nullable: false field :hold_ttl_seconds, -> { Integer }, optional: true, nullable: false diff --git a/sdks/ruby/lib/coss/scheduling/event_types/types/update_event_type_request.rb b/sdks/ruby/lib/coss/scheduling/event_types/types/update_event_type_request.rb index 33cc166da..81912d4b8 100644 --- a/sdks/ruby/lib/coss/scheduling/event_types/types/update_event_type_request.rb +++ b/sdks/ruby/lib/coss/scheduling/event_types/types/update_event_type_request.rb @@ -35,6 +35,8 @@ class UpdateEventTypeRequest < Internal::Types::Model field :requires_approval, -> { Internal::Types::Boolean }, optional: true, nullable: false + field :reassignment_enabled, -> { Internal::Types::Boolean }, optional: true, nullable: false + field :approval_ttl_minutes, -> { Integer }, optional: true, nullable: false field :hold_ttl_seconds, -> { Integer }, optional: true, nullable: false diff --git a/sdks/ruby/lib/coss/scheduling/holiday_calendars/client.rb b/sdks/ruby/lib/coss/scheduling/holiday_calendars/client.rb new file mode 100644 index 000000000..3cbe806f2 --- /dev/null +++ b/sdks/ruby/lib/coss/scheduling/holiday_calendars/client.rb @@ -0,0 +1,256 @@ +# frozen_string_literal: true + +module Coss + module Scheduling + module HolidayCalendars + class Client + # @param client [Coss::Internal::Http::RawClient] + # + # @return [void] + def initialize(client:) + @client = client + end + + # By name. A feed's URL is never shown again. + # + # @param request_options [Hash] + # @param _params [Hash] + # @option request_options [String] :base_url + # @option request_options [Hash{String => Object}] :additional_headers + # @option request_options [Hash{String => Object}] :additional_query_parameters + # @option request_options [Hash{String => Object}] :additional_body_parameters + # @option request_options [Integer] :timeout_in_seconds + # + # @example + # client.scheduling.holiday_calendars.list + # + # @return [Coss::Types::SchedulingHolidayCalendarList] + def list(request_options: {}, **_params) + request = Coss::Internal::JSON::Request.new( + base_url: request_options[:base_url], + method: "GET", + path: "v1/scheduling/holiday_calendars", + request_options: request_options + ) + begin + response = @client.send(request) + rescue Net::HTTPRequestTimeout + raise Coss::Errors::TimeoutError + end + code = response.code.to_i + if code.between?(200, 299) + (response.body.to_s.empty? ? nil : Coss::Types::SchedulingHolidayCalendarList.load(response.body)) + else + error_class = Coss::Errors::ResponseError.subclass_for_code(code) + raise error_class.new(response.body, code: code) + end + end + + # Applies a country's public holidays, or your own feed, to some hosts as ordinary out of office entries, kept + # up to date by coss.com. A host who removes one keeps it removed. + # + # @param request_options [Hash] + # @param params [Coss::Scheduling::HolidayCalendars::Types::CreateSchedulingHolidayCalendarRequest] + # @option request_options [String] :base_url + # @option request_options [Hash{String => Object}] :additional_headers + # @option request_options [Hash{String => Object}] :additional_query_parameters + # @option request_options [Hash{String => Object}] :additional_body_parameters + # @option request_options [Integer] :timeout_in_seconds + # + # @example + # client.scheduling.holiday_calendars.create( + # name: "UK team", + # country: "GB", + # host_filter: { + # team: "london" + # } + # ) + # + # @return [Coss::Types::SchedulingHolidayCalendar] + def create(request_options: {}, **params) + params = Coss::Internal::Types::Utils.normalize_keys(params) + headers = { "Idempotency-Key" => Coss::Internal::IdempotencyKey.generate } + request = Coss::Internal::JSON::Request.new( + base_url: request_options[:base_url], + method: "POST", + path: "v1/scheduling/holiday_calendars", + headers: headers, + body: Coss::Scheduling::HolidayCalendars::Types::CreateSchedulingHolidayCalendarRequest.new(params).to_h, + request_options: request_options, + max_retries: 0 + ) + begin + response = @client.send(request) + rescue Net::HTTPRequestTimeout + raise Coss::Errors::TimeoutError + end + code = response.code.to_i + if code.between?(200, 299) + (response.body.to_s.empty? ? nil : Coss::Types::SchedulingHolidayCalendar.load(response.body)) + else + error_class = Coss::Errors::ResponseError.subclass_for_code(code) + raise error_class.new(response.body, code: code) + end + end + + # With when it was last read, and why not if it couldn't be. + # + # @param request_options [Hash] + # @param params [Hash] + # @option request_options [String] :base_url + # @option request_options [Hash{String => Object}] :additional_headers + # @option request_options [Hash{String => Object}] :additional_query_parameters + # @option request_options [Hash{String => Object}] :additional_body_parameters + # @option request_options [Integer] :timeout_in_seconds + # @option params [String] :id + # + # @example + # client.scheduling.holiday_calendars.get(id: "id") + # + # @return [Coss::Types::SchedulingHolidayCalendar] + def get(request_options: {}, **params) + params = Coss::Internal::Types::Utils.normalize_keys(params) + request = Coss::Internal::JSON::Request.new( + base_url: request_options[:base_url], + method: "GET", + path: "v1/scheduling/holiday_calendars/#{URI.encode_uri_component(params[:id].to_s)}", + request_options: request_options + ) + begin + response = @client.send(request) + rescue Net::HTTPRequestTimeout + raise Coss::Errors::TimeoutError + end + code = response.code.to_i + if code.between?(200, 299) + (response.body.to_s.empty? ? nil : Coss::Types::SchedulingHolidayCalendar.load(response.body)) + else + error_class = Coss::Errors::ResponseError.subclass_for_code(code) + raise error_class.new(response.body, code: code) + end + end + + # Hosts can be booked on its days again, shortly: past entries stay. + # + # @param request_options [Hash] + # @param params [Hash] + # @option request_options [String] :base_url + # @option request_options [Hash{String => Object}] :additional_headers + # @option request_options [Hash{String => Object}] :additional_query_parameters + # @option request_options [Hash{String => Object}] :additional_body_parameters + # @option request_options [Integer] :timeout_in_seconds + # @option params [String] :id + # + # @example + # client.scheduling.holiday_calendars.remove(id: "id") + # + # @return [Coss::Types::DeletedSchedulingHolidayCalendar] + def remove(request_options: {}, **params) + params = Coss::Internal::Types::Utils.normalize_keys(params) + request = Coss::Internal::JSON::Request.new( + base_url: request_options[:base_url], + method: "DELETE", + path: "v1/scheduling/holiday_calendars/#{URI.encode_uri_component(params[:id].to_s)}", + request_options: request_options + ) + begin + response = @client.send(request) + rescue Net::HTTPRequestTimeout + raise Coss::Errors::TimeoutError + end + code = response.code.to_i + if code.between?(200, 299) + (response.body.to_s.empty? ? nil : Coss::Types::DeletedSchedulingHolidayCalendar.load(response.body)) + else + error_class = Coss::Errors::ResponseError.subclass_for_code(code) + raise error_class.new(response.body, code: code) + end + end + + # Who it applies to, who covers and what happens to bookings. Takes effect shortly. + # + # @param request_options [Hash] + # @param params [Coss::Scheduling::HolidayCalendars::Types::UpdateSchedulingHolidayCalendarRequest] + # @option request_options [String] :base_url + # @option request_options [Hash{String => Object}] :additional_headers + # @option request_options [Hash{String => Object}] :additional_query_parameters + # @option request_options [Hash{String => Object}] :additional_body_parameters + # @option request_options [Integer] :timeout_in_seconds + # @option params [String] :id + # + # @example + # client.scheduling.holiday_calendars.update( + # id: "id", + # host_filter: { + # team: "london" + # } + # ) + # + # @return [Coss::Types::SchedulingHolidayCalendar] + def update(request_options: {}, **params) + params = Coss::Internal::Types::Utils.normalize_keys(params) + request_data = Coss::Scheduling::HolidayCalendars::Types::UpdateSchedulingHolidayCalendarRequest.new(params).to_h + non_body_param_names = %w[id] + body = request_data.except(*non_body_param_names) + + request = Coss::Internal::JSON::Request.new( + base_url: request_options[:base_url], + method: "PATCH", + path: "v1/scheduling/holiday_calendars/#{URI.encode_uri_component(params[:id].to_s)}", + body: body, + request_options: request_options + ) + begin + response = @client.send(request) + rescue Net::HTTPRequestTimeout + raise Coss::Errors::TimeoutError + end + code = response.code.to_i + if code.between?(200, 299) + (response.body.to_s.empty? ? nil : Coss::Types::SchedulingHolidayCalendar.load(response.body)) + else + error_class = Coss::Errors::ResponseError.subclass_for_code(code) + raise error_class.new(response.body, code: code) + end + end + + # What's coming, with names, as last read. Empty until its first read. + # + # @param request_options [Hash] + # @param params [Hash] + # @option request_options [String] :base_url + # @option request_options [Hash{String => Object}] :additional_headers + # @option request_options [Hash{String => Object}] :additional_query_parameters + # @option request_options [Hash{String => Object}] :additional_body_parameters + # @option request_options [Integer] :timeout_in_seconds + # @option params [String] :id + # + # @example + # client.scheduling.holiday_calendars.holidays(id: "id") + # + # @return [Coss::Types::SchedulingHolidayList] + def holidays(request_options: {}, **params) + params = Coss::Internal::Types::Utils.normalize_keys(params) + request = Coss::Internal::JSON::Request.new( + base_url: request_options[:base_url], + method: "GET", + path: "v1/scheduling/holiday_calendars/#{URI.encode_uri_component(params[:id].to_s)}/holidays", + request_options: request_options + ) + begin + response = @client.send(request) + rescue Net::HTTPRequestTimeout + raise Coss::Errors::TimeoutError + end + code = response.code.to_i + if code.between?(200, 299) + (response.body.to_s.empty? ? nil : Coss::Types::SchedulingHolidayList.load(response.body)) + else + error_class = Coss::Errors::ResponseError.subclass_for_code(code) + raise error_class.new(response.body, code: code) + end + end + end + end + end +end diff --git a/sdks/ruby/lib/coss/scheduling/holiday_calendars/types/create_scheduling_holiday_calendar_request.rb b/sdks/ruby/lib/coss/scheduling/holiday_calendars/types/create_scheduling_holiday_calendar_request.rb new file mode 100644 index 000000000..0cc3f9b74 --- /dev/null +++ b/sdks/ruby/lib/coss/scheduling/holiday_calendars/types/create_scheduling_holiday_calendar_request.rb @@ -0,0 +1,27 @@ +# frozen_string_literal: true + +module Coss + module Scheduling + module HolidayCalendars + module Types + class CreateSchedulingHolidayCalendarRequest < Internal::Types::Model + field :name, -> { String }, optional: false, nullable: false + + field :country, -> { String }, optional: true, nullable: false + + field :ics_url, -> { String }, optional: true, nullable: false + + field :hosts, -> { Internal::Types::Array[String] }, optional: true, nullable: false + + field :host_filter, -> { Internal::Types::Hash[String, Coss::Scheduling::HolidayCalendars::Types::CreateSchedulingHolidayCalendarRequestHostFilterValue] }, optional: true, nullable: false + + field :regions, -> { Internal::Types::Array[String] }, optional: true, nullable: false + + field :delegates, -> { Internal::Types::Array[String] }, optional: true, nullable: false + + field :existing_bookings, -> { Coss::Scheduling::HolidayCalendars::Types::CreateSchedulingHolidayCalendarRequestExistingBookings }, optional: true, nullable: false + end + end + end + end +end diff --git a/sdks/ruby/lib/coss/scheduling/holiday_calendars/types/create_scheduling_holiday_calendar_request_existing_bookings.rb b/sdks/ruby/lib/coss/scheduling/holiday_calendars/types/create_scheduling_holiday_calendar_request_existing_bookings.rb new file mode 100644 index 000000000..3aef0072f --- /dev/null +++ b/sdks/ruby/lib/coss/scheduling/holiday_calendars/types/create_scheduling_holiday_calendar_request_existing_bookings.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +module Coss + module Scheduling + module HolidayCalendars + module Types + module CreateSchedulingHolidayCalendarRequestExistingBookings + extend Coss::Internal::Types::Enum + + LEAVE = "leave" + REASSIGN = "reassign" + end + end + end + end +end diff --git a/sdks/ruby/lib/coss/scheduling/holiday_calendars/types/create_scheduling_holiday_calendar_request_host_filter_value.rb b/sdks/ruby/lib/coss/scheduling/holiday_calendars/types/create_scheduling_holiday_calendar_request_host_filter_value.rb new file mode 100644 index 000000000..cf222e5d9 --- /dev/null +++ b/sdks/ruby/lib/coss/scheduling/holiday_calendars/types/create_scheduling_holiday_calendar_request_host_filter_value.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +module Coss + module Scheduling + module HolidayCalendars + module Types + class CreateSchedulingHolidayCalendarRequestHostFilterValue < Internal::Types::Model + extend Coss::Internal::Types::Union + + member -> { String } + + member -> { Internal::Types::Array[String] } + end + end + end + end +end diff --git a/sdks/ruby/lib/coss/scheduling/holiday_calendars/types/get_holiday_calendars_request.rb b/sdks/ruby/lib/coss/scheduling/holiday_calendars/types/get_holiday_calendars_request.rb new file mode 100644 index 000000000..3062bcfa5 --- /dev/null +++ b/sdks/ruby/lib/coss/scheduling/holiday_calendars/types/get_holiday_calendars_request.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Coss + module Scheduling + module HolidayCalendars + module Types + class GetHolidayCalendarsRequest < Internal::Types::Model + field :id, -> { String }, optional: false, nullable: false + end + end + end + end +end diff --git a/sdks/ruby/lib/coss/scheduling/holiday_calendars/types/holidays_holiday_calendars_request.rb b/sdks/ruby/lib/coss/scheduling/holiday_calendars/types/holidays_holiday_calendars_request.rb new file mode 100644 index 000000000..7e99e07ce --- /dev/null +++ b/sdks/ruby/lib/coss/scheduling/holiday_calendars/types/holidays_holiday_calendars_request.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Coss + module Scheduling + module HolidayCalendars + module Types + class HolidaysHolidayCalendarsRequest < Internal::Types::Model + field :id, -> { String }, optional: false, nullable: false + end + end + end + end +end diff --git a/sdks/ruby/lib/coss/scheduling/holiday_calendars/types/remove_holiday_calendars_request.rb b/sdks/ruby/lib/coss/scheduling/holiday_calendars/types/remove_holiday_calendars_request.rb new file mode 100644 index 000000000..ae9c8ca90 --- /dev/null +++ b/sdks/ruby/lib/coss/scheduling/holiday_calendars/types/remove_holiday_calendars_request.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Coss + module Scheduling + module HolidayCalendars + module Types + class RemoveHolidayCalendarsRequest < Internal::Types::Model + field :id, -> { String }, optional: false, nullable: false + end + end + end + end +end diff --git a/sdks/ruby/lib/coss/scheduling/holiday_calendars/types/update_scheduling_holiday_calendar_request.rb b/sdks/ruby/lib/coss/scheduling/holiday_calendars/types/update_scheduling_holiday_calendar_request.rb new file mode 100644 index 000000000..cac2c7701 --- /dev/null +++ b/sdks/ruby/lib/coss/scheduling/holiday_calendars/types/update_scheduling_holiday_calendar_request.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +module Coss + module Scheduling + module HolidayCalendars + module Types + class UpdateSchedulingHolidayCalendarRequest < Internal::Types::Model + field :id, -> { String }, optional: false, nullable: false + + field :name, -> { String }, optional: true, nullable: false + + field :hosts, -> { Internal::Types::Array[String] }, optional: true, nullable: false + + field :host_filter, -> { Internal::Types::Hash[String, Coss::Scheduling::HolidayCalendars::Types::UpdateSchedulingHolidayCalendarRequestHostFilterValue] }, optional: true, nullable: false + + field :regions, -> { Internal::Types::Array[String] }, optional: true, nullable: false + + field :delegates, -> { Internal::Types::Array[String] }, optional: true, nullable: false + + field :existing_bookings, -> { Coss::Scheduling::HolidayCalendars::Types::UpdateSchedulingHolidayCalendarRequestExistingBookings }, optional: true, nullable: false + end + end + end + end +end diff --git a/sdks/ruby/lib/coss/scheduling/holiday_calendars/types/update_scheduling_holiday_calendar_request_existing_bookings.rb b/sdks/ruby/lib/coss/scheduling/holiday_calendars/types/update_scheduling_holiday_calendar_request_existing_bookings.rb new file mode 100644 index 000000000..5b6aa8ca6 --- /dev/null +++ b/sdks/ruby/lib/coss/scheduling/holiday_calendars/types/update_scheduling_holiday_calendar_request_existing_bookings.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +module Coss + module Scheduling + module HolidayCalendars + module Types + module UpdateSchedulingHolidayCalendarRequestExistingBookings + extend Coss::Internal::Types::Enum + + LEAVE = "leave" + REASSIGN = "reassign" + end + end + end + end +end diff --git a/sdks/ruby/lib/coss/scheduling/holiday_calendars/types/update_scheduling_holiday_calendar_request_host_filter_value.rb b/sdks/ruby/lib/coss/scheduling/holiday_calendars/types/update_scheduling_holiday_calendar_request_host_filter_value.rb new file mode 100644 index 000000000..7d47db60e --- /dev/null +++ b/sdks/ruby/lib/coss/scheduling/holiday_calendars/types/update_scheduling_holiday_calendar_request_host_filter_value.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +module Coss + module Scheduling + module HolidayCalendars + module Types + class UpdateSchedulingHolidayCalendarRequestHostFilterValue < Internal::Types::Model + extend Coss::Internal::Types::Union + + member -> { String } + + member -> { Internal::Types::Array[String] } + end + end + end + end +end diff --git a/sdks/ruby/lib/coss/scheduling/oauth_apps/client.rb b/sdks/ruby/lib/coss/scheduling/oauth_apps/client.rb new file mode 100644 index 000000000..199647cf5 --- /dev/null +++ b/sdks/ruby/lib/coss/scheduling/oauth_apps/client.rb @@ -0,0 +1,214 @@ +# frozen_string_literal: true + +module Coss + module Scheduling + module OauthApps + class Client + # @param client [Coss::Internal::Http::RawClient] + # + # @return [void] + def initialize(client:) + @client = client + end + + # At most one per provider, with how many connections use each. + # + # @param request_options [Hash] + # @param _params [Hash] + # @option request_options [String] :base_url + # @option request_options [Hash{String => Object}] :additional_headers + # @option request_options [Hash{String => Object}] :additional_query_parameters + # @option request_options [Hash{String => Object}] :additional_body_parameters + # @option request_options [Integer] :timeout_in_seconds + # + # @example + # client.scheduling.oauth_apps.list + # + # @return [Coss::Types::SchedulingOauthAppList] + def list(request_options: {}, **_params) + request = Coss::Internal::JSON::Request.new( + base_url: request_options[:base_url], + method: "GET", + path: "v1/scheduling/oauth_apps", + request_options: request_options + ) + begin + response = @client.send(request) + rescue Net::HTTPRequestTimeout + raise Coss::Errors::TimeoutError + end + code = response.code.to_i + if code.between?(200, 299) + (response.body.to_s.empty? ? nil : Coss::Types::SchedulingOauthAppList.load(response.body)) + else + error_class = Coss::Errors::ResponseError.subclass_for_code(code) + raise error_class.new(response.body, code: code) + end + end + + # New consents in this environment use it, so the consent screen shows your brand. Connections made before it + # stay on coss.com's app until their host consents again. On the Scale plan and above. Secrets are never + # returned. + # + # @param request_options [Hash] + # @param params [Coss::Types::CreateOauthAppRequest] + # @option request_options [String] :base_url + # @option request_options [Hash{String => Object}] :additional_headers + # @option request_options [Hash{String => Object}] :additional_query_parameters + # @option request_options [Hash{String => Object}] :additional_body_parameters + # @option request_options [Integer] :timeout_in_seconds + # + # @example + # client.scheduling.oauth_apps.create + # + # @return [Coss::Types::SchedulingOauthApp] + def create(request_options: {}, **params) + params = Coss::Internal::Types::Utils.normalize_keys(params) + headers = { "Idempotency-Key" => Coss::Internal::IdempotencyKey.generate } + request = Coss::Internal::JSON::Request.new( + base_url: request_options[:base_url], + method: "POST", + path: "v1/scheduling/oauth_apps", + headers: headers, + body: Coss::Types::CreateOauthAppRequest.new(params).to_h, + request_options: request_options, + max_retries: 0 + ) + begin + response = @client.send(request) + rescue Net::HTTPRequestTimeout + raise Coss::Errors::TimeoutError + end + code = response.code.to_i + if code.between?(200, 299) + (response.body.to_s.empty? ? nil : Coss::Types::SchedulingOauthApp.load(response.body)) + else + error_class = Coss::Errors::ResponseError.subclass_for_code(code) + raise error_class.new(response.body, code: code) + end + end + + # Its status, what to register at the provider, and how many connections use it. + # + # @param request_options [Hash] + # @param params [Hash] + # @option request_options [String] :base_url + # @option request_options [Hash{String => Object}] :additional_headers + # @option request_options [Hash{String => Object}] :additional_query_parameters + # @option request_options [Hash{String => Object}] :additional_body_parameters + # @option request_options [Integer] :timeout_in_seconds + # @option params [String] :id + # + # @example + # client.scheduling.oauth_apps.get(id: "calapp_01kd2m9a0b1c2d3e4f5g6h7j8m") + # + # @return [Coss::Types::SchedulingOauthApp] + def get(request_options: {}, **params) + params = Coss::Internal::Types::Utils.normalize_keys(params) + request = Coss::Internal::JSON::Request.new( + base_url: request_options[:base_url], + method: "GET", + path: "v1/scheduling/oauth_apps/#{URI.encode_uri_component(params[:id].to_s)}", + request_options: request_options + ) + begin + response = @client.send(request) + rescue Net::HTTPRequestTimeout + raise Coss::Errors::TimeoutError + end + code = response.code.to_i + if code.between?(200, 299) + (response.body.to_s.empty? ? nil : Coss::Types::SchedulingOauthApp.load(response.body)) + else + error_class = Coss::Errors::ResponseError.subclass_for_code(code) + raise error_class.new(response.body, code: code) + end + end + + # Refused while connections use it (`oauth_app_in_use`), since only it can refresh their access: disconnect them + # first. New consents go back to coss.com's app. + # + # @param request_options [Hash] + # @param params [Hash] + # @option request_options [String] :base_url + # @option request_options [Hash{String => Object}] :additional_headers + # @option request_options [Hash{String => Object}] :additional_query_parameters + # @option request_options [Hash{String => Object}] :additional_body_parameters + # @option request_options [Integer] :timeout_in_seconds + # @option params [String] :id + # + # @example + # client.scheduling.oauth_apps.delete(id: "calapp_01kd2m9a0b1c2d3e4f5g6h7j8m") + # + # @return [Coss::Types::DeletedSchedulingOauthApp] + def delete(request_options: {}, **params) + params = Coss::Internal::Types::Utils.normalize_keys(params) + request = Coss::Internal::JSON::Request.new( + base_url: request_options[:base_url], + method: "DELETE", + path: "v1/scheduling/oauth_apps/#{URI.encode_uri_component(params[:id].to_s)}", + request_options: request_options + ) + begin + response = @client.send(request) + rescue Net::HTTPRequestTimeout + raise Coss::Errors::TimeoutError + end + code = response.code.to_i + if code.between?(200, 299) + (response.body.to_s.empty? ? nil : Coss::Types::DeletedSchedulingOauthApp.load(response.body)) + else + error_class = Coss::Errors::ResponseError.subclass_for_code(code) + raise error_class.new(response.body, code: code) + end + end + + # A new client secret is tried on a connection before it replaces the old one, and ends an outage if it works. + # Its client ID can't change: a different app needs its hosts to consent again. + # + # @param request_options [Hash] + # @param params [Coss::Scheduling::OauthApps::Types::UpdateOauthAppRequest] + # @option request_options [String] :base_url + # @option request_options [Hash{String => Object}] :additional_headers + # @option request_options [Hash{String => Object}] :additional_query_parameters + # @option request_options [Hash{String => Object}] :additional_body_parameters + # @option request_options [Integer] :timeout_in_seconds + # @option params [String] :id + # + # @example + # client.scheduling.oauth_apps.update( + # id: "calapp_01kd2m9a0b1c2d3e4f5g6h7j8m", + # client_secret: "GOCSPX-abcdefghijklmnopqrstuvwxyz" + # ) + # + # @return [Coss::Types::SchedulingOauthApp] + def update(request_options: {}, **params) + params = Coss::Internal::Types::Utils.normalize_keys(params) + request_data = Coss::Scheduling::OauthApps::Types::UpdateOauthAppRequest.new(params).to_h + non_body_param_names = %w[id] + body = request_data.except(*non_body_param_names) + + request = Coss::Internal::JSON::Request.new( + base_url: request_options[:base_url], + method: "PATCH", + path: "v1/scheduling/oauth_apps/#{URI.encode_uri_component(params[:id].to_s)}", + body: body, + request_options: request_options + ) + begin + response = @client.send(request) + rescue Net::HTTPRequestTimeout + raise Coss::Errors::TimeoutError + end + code = response.code.to_i + if code.between?(200, 299) + (response.body.to_s.empty? ? nil : Coss::Types::SchedulingOauthApp.load(response.body)) + else + error_class = Coss::Errors::ResponseError.subclass_for_code(code) + raise error_class.new(response.body, code: code) + end + end + end + end + end +end diff --git a/sdks/ruby/lib/coss/scheduling/oauth_apps/types/delete_oauth_apps_request.rb b/sdks/ruby/lib/coss/scheduling/oauth_apps/types/delete_oauth_apps_request.rb new file mode 100644 index 000000000..f5b60aae7 --- /dev/null +++ b/sdks/ruby/lib/coss/scheduling/oauth_apps/types/delete_oauth_apps_request.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Coss + module Scheduling + module OauthApps + module Types + class DeleteOauthAppsRequest < Internal::Types::Model + field :id, -> { String }, optional: false, nullable: false + end + end + end + end +end diff --git a/sdks/ruby/lib/coss/scheduling/oauth_apps/types/get_oauth_apps_request.rb b/sdks/ruby/lib/coss/scheduling/oauth_apps/types/get_oauth_apps_request.rb new file mode 100644 index 000000000..3225ebfd4 --- /dev/null +++ b/sdks/ruby/lib/coss/scheduling/oauth_apps/types/get_oauth_apps_request.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Coss + module Scheduling + module OauthApps + module Types + class GetOauthAppsRequest < Internal::Types::Model + field :id, -> { String }, optional: false, nullable: false + end + end + end + end +end diff --git a/sdks/ruby/lib/coss/scheduling/oauth_apps/types/update_oauth_app_request.rb b/sdks/ruby/lib/coss/scheduling/oauth_apps/types/update_oauth_app_request.rb new file mode 100644 index 000000000..a073ada13 --- /dev/null +++ b/sdks/ruby/lib/coss/scheduling/oauth_apps/types/update_oauth_app_request.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +module Coss + module Scheduling + module OauthApps + module Types + class UpdateOauthAppRequest < Internal::Types::Model + field :id, -> { String }, optional: false, nullable: false + + field :client_secret, -> { String }, optional: true, nullable: false + + field :tenant_id, -> { String }, optional: true, nullable: false + + field :webhook_secret, -> { String }, optional: true, nullable: false + + field :redirect_uri, -> { String }, optional: true, nullable: false + + field :completion_url, -> { String }, optional: true, nullable: false + + field :secret_expires_at, -> { String }, optional: true, nullable: false + end + end + end + end +end diff --git a/sdks/ruby/lib/coss/scheduling/out_of_office/client.rb b/sdks/ruby/lib/coss/scheduling/out_of_office/client.rb new file mode 100644 index 000000000..822ee6d5a --- /dev/null +++ b/sdks/ruby/lib/coss/scheduling/out_of_office/client.rb @@ -0,0 +1,328 @@ +# frozen_string_literal: true + +module Coss + module Scheduling + module OutOfOffice + class Client + # @param client [Coss::Internal::Http::RawClient] + # + # @return [void] + def initialize(client:) + @client = client + end + + # The environment's entries, newest first. + # + # @param request_options [Hash] + # @param params [Hash] + # @option request_options [String] :base_url + # @option request_options [Hash{String => Object}] :additional_headers + # @option request_options [Hash{String => Object}] :additional_query_parameters + # @option request_options [Hash{String => Object}] :additional_body_parameters + # @option request_options [Integer] :timeout_in_seconds + # @option params [Integer, nil] :limit + # @option params [String, nil] :after + # @option params [String, nil] :host + # @option params [String, nil] :start_after + # @option params [String, nil] :start_before + # @option params [String, nil] :group + # + # @example + # client.scheduling.out_of_office.list( + # start_after: "2027-01-04T15:00:00.000Z", + # start_before: "2027-01-04T15:00:00.000Z" + # ) + # + # @return [Coss::Types::SchedulingOutOfOfficeList] + def list(request_options: {}, **params) + params = Coss::Internal::Types::Utils.normalize_keys(params) + query_params = {} + query_params["limit"] = params[:limit] if params.key?(:limit) + query_params["after"] = params[:after] if params.key?(:after) + query_params["host"] = params[:host] if params.key?(:host) + query_params["start_after"] = params[:start_after] if params.key?(:start_after) + query_params["start_before"] = params[:start_before] if params.key?(:start_before) + query_params["group"] = params[:group] if params.key?(:group) + + request = Coss::Internal::JSON::Request.new( + base_url: request_options[:base_url], + method: "GET", + path: "v1/scheduling/out_of_office", + query: query_params, + request_options: request_options + ) + begin + response = @client.send(request) + rescue Net::HTTPRequestTimeout + raise Coss::Errors::TimeoutError + end + code = response.code.to_i + if code.between?(200, 299) + (response.body.to_s.empty? ? nil : Coss::Types::SchedulingOutOfOfficeList.load(response.body)) + else + error_class = Coss::Errors::ResponseError.subclass_for_code(code) + raise error_class.new(response.body, code: code) + end + end + + # Marks one host, a list of hosts or everyone matching some attributes as away, for part of a day or for whole + # dates. They aren't offered during it. Existing bookings stay as they are: list them with the entry's + # conflicts. + # + # @param request_options [Hash] + # @param params [Coss::Scheduling::OutOfOffice::Types::CreateSchedulingOutOfOfficeRequest] + # @option request_options [String] :base_url + # @option request_options [Hash{String => Object}] :additional_headers + # @option request_options [Hash{String => Object}] :additional_query_parameters + # @option request_options [Hash{String => Object}] :additional_body_parameters + # @option request_options [Integer] :timeout_in_seconds + # + # @example + # client.scheduling.out_of_office.create( + # host: "doctor_482", + # start_date: "2027-08-02", + # end_date: "2027-08-13", + # reason: "vacation", + # public_message: "Back on the 16th." + # ) + # + # @return [Coss::Types::SchedulingOutOfOfficeList] + def create(request_options: {}, **params) + params = Coss::Internal::Types::Utils.normalize_keys(params) + headers = { "Idempotency-Key" => Coss::Internal::IdempotencyKey.generate } + request = Coss::Internal::JSON::Request.new( + base_url: request_options[:base_url], + method: "POST", + path: "v1/scheduling/out_of_office", + headers: headers, + body: Coss::Scheduling::OutOfOffice::Types::CreateSchedulingOutOfOfficeRequest.new(params).to_h, + request_options: request_options, + max_retries: 0 + ) + begin + response = @client.send(request) + rescue Net::HTTPRequestTimeout + raise Coss::Errors::TimeoutError + end + code = response.code.to_i + if code.between?(200, 299) + (response.body.to_s.empty? ? nil : Coss::Types::SchedulingOutOfOfficeList.load(response.body)) + else + error_class = Coss::Errors::ResponseError.subclass_for_code(code) + raise error_class.new(response.body, code: code) + end + end + + # One entry. + # + # @param request_options [Hash] + # @param params [Hash] + # @option request_options [String] :base_url + # @option request_options [Hash{String => Object}] :additional_headers + # @option request_options [Hash{String => Object}] :additional_query_parameters + # @option request_options [Hash{String => Object}] :additional_body_parameters + # @option request_options [Integer] :timeout_in_seconds + # @option params [String] :id + # + # @example + # client.scheduling.out_of_office.get(id: "ooo_01kd2m9a0b1c2d3e4f5g6h7j8m") + # + # @return [Coss::Types::SchedulingOutOfOffice] + def get(request_options: {}, **params) + params = Coss::Internal::Types::Utils.normalize_keys(params) + request = Coss::Internal::JSON::Request.new( + base_url: request_options[:base_url], + method: "GET", + path: "v1/scheduling/out_of_office/#{URI.encode_uri_component(params[:id].to_s)}", + request_options: request_options + ) + begin + response = @client.send(request) + rescue Net::HTTPRequestTimeout + raise Coss::Errors::TimeoutError + end + code = response.code.to_i + if code.between?(200, 299) + (response.body.to_s.empty? ? nil : Coss::Types::SchedulingOutOfOffice.load(response.body)) + else + error_class = Coss::Errors::ResponseError.subclass_for_code(code) + raise error_class.new(response.body, code: code) + end + end + + # The host can be booked in that time again, and any calendar event for it goes. + # + # @param request_options [Hash] + # @param params [Hash] + # @option request_options [String] :base_url + # @option request_options [Hash{String => Object}] :additional_headers + # @option request_options [Hash{String => Object}] :additional_query_parameters + # @option request_options [Hash{String => Object}] :additional_body_parameters + # @option request_options [Integer] :timeout_in_seconds + # @option params [String] :id + # + # @example + # client.scheduling.out_of_office.remove(id: "ooo_01kd2m9a0b1c2d3e4f5g6h7j8m") + # + # @return [Coss::Types::DeletedSchedulingOutOfOffice] + def remove(request_options: {}, **params) + params = Coss::Internal::Types::Utils.normalize_keys(params) + request = Coss::Internal::JSON::Request.new( + base_url: request_options[:base_url], + method: "DELETE", + path: "v1/scheduling/out_of_office/#{URI.encode_uri_component(params[:id].to_s)}", + request_options: request_options + ) + begin + response = @client.send(request) + rescue Net::HTTPRequestTimeout + raise Coss::Errors::TimeoutError + end + code = response.code.to_i + if code.between?(200, 299) + (response.body.to_s.empty? ? nil : Coss::Types::DeletedSchedulingOutOfOffice.load(response.body)) + else + error_class = Coss::Errors::ResponseError.subclass_for_code(code) + raise error_class.new(response.body, code: code) + end + end + + # Changes what's given. An entry stays with its host. + # + # @param request_options [Hash] + # @param params [Coss::Scheduling::OutOfOffice::Types::UpdateSchedulingOutOfOfficeRequest] + # @option request_options [String] :base_url + # @option request_options [Hash{String => Object}] :additional_headers + # @option request_options [Hash{String => Object}] :additional_query_parameters + # @option request_options [Hash{String => Object}] :additional_body_parameters + # @option request_options [Integer] :timeout_in_seconds + # @option params [String] :id + # + # @example + # client.scheduling.out_of_office.update( + # id: "ooo_01kd2m9a0b1c2d3e4f5g6h7j8m", + # end_date: "2027-08-20" + # ) + # + # @return [Coss::Types::SchedulingOutOfOffice] + def update(request_options: {}, **params) + params = Coss::Internal::Types::Utils.normalize_keys(params) + request_data = Coss::Scheduling::OutOfOffice::Types::UpdateSchedulingOutOfOfficeRequest.new(params).to_h + non_body_param_names = %w[id] + body = request_data.except(*non_body_param_names) + + request = Coss::Internal::JSON::Request.new( + base_url: request_options[:base_url], + method: "PATCH", + path: "v1/scheduling/out_of_office/#{URI.encode_uri_component(params[:id].to_s)}", + body: body, + request_options: request_options + ) + begin + response = @client.send(request) + rescue Net::HTTPRequestTimeout + raise Coss::Errors::TimeoutError + end + code = response.code.to_i + if code.between?(200, 299) + (response.body.to_s.empty? ? nil : Coss::Types::SchedulingOutOfOffice.load(response.body)) + else + error_class = Coss::Errors::ResponseError.subclass_for_code(code) + raise error_class.new(response.body, code: code) + end + end + + # For syncing from a system of record such as an HR tool: send what it says, as often as you like, and there's + # one entry for it. Give every field you want to keep. + # + # @param request_options [Hash] + # @param params [Coss::Scheduling::OutOfOffice::Types::PutSchedulingOutOfOfficeRequest] + # @option request_options [String] :base_url + # @option request_options [Hash{String => Object}] :additional_headers + # @option request_options [Hash{String => Object}] :additional_query_parameters + # @option request_options [Hash{String => Object}] :additional_body_parameters + # @option request_options [Integer] :timeout_in_seconds + # @option params [String] :external_id + # + # @example + # client.scheduling.out_of_office.put( + # external_id: "hr_leave_4471", + # host: "doctor_482", + # start_date: "2027-08-02", + # end_date: "2027-08-13", + # reason: "vacation" + # ) + # + # @return [Coss::Types::SchedulingOutOfOffice] + def put(request_options: {}, **params) + params = Coss::Internal::Types::Utils.normalize_keys(params) + request_data = Coss::Scheduling::OutOfOffice::Types::PutSchedulingOutOfOfficeRequest.new(params).to_h + non_body_param_names = %w[external_id] + body = request_data.except(*non_body_param_names) + + request = Coss::Internal::JSON::Request.new( + base_url: request_options[:base_url], + method: "PUT", + path: "v1/scheduling/out_of_office/by_external_id/#{URI.encode_uri_component(params[:external_id].to_s)}", + body: body, + request_options: request_options + ) + begin + response = @client.send(request) + rescue Net::HTTPRequestTimeout + raise Coss::Errors::TimeoutError + end + code = response.code.to_i + if code.between?(200, 299) + (response.body.to_s.empty? ? nil : Coss::Types::SchedulingOutOfOffice.load(response.body)) + else + error_class = Coss::Errors::ResponseError.subclass_for_code(code) + raise error_class.new(response.body, code: code) + end + end + + # Live bookings of the host that fall in the entry, soonest first. Entries never change them. + # + # @param request_options [Hash] + # @param params [Hash] + # @option request_options [String] :base_url + # @option request_options [Hash{String => Object}] :additional_headers + # @option request_options [Hash{String => Object}] :additional_query_parameters + # @option request_options [Hash{String => Object}] :additional_body_parameters + # @option request_options [Integer] :timeout_in_seconds + # @option params [String] :id + # @option params [Integer, nil] :limit + # + # @example + # client.scheduling.out_of_office.conflicts(id: "ooo_01kd2m9a0b1c2d3e4f5g6h7j8m") + # + # @return [Coss::Types::SchedulingOutOfOfficeConflictList] + def conflicts(request_options: {}, **params) + params = Coss::Internal::Types::Utils.normalize_keys(params) + query_params = {} + query_params["limit"] = params[:limit] if params.key?(:limit) + + request = Coss::Internal::JSON::Request.new( + base_url: request_options[:base_url], + method: "GET", + path: "v1/scheduling/out_of_office/#{URI.encode_uri_component(params[:id].to_s)}/conflicts", + query: query_params, + request_options: request_options + ) + begin + response = @client.send(request) + rescue Net::HTTPRequestTimeout + raise Coss::Errors::TimeoutError + end + code = response.code.to_i + if code.between?(200, 299) + (response.body.to_s.empty? ? nil : Coss::Types::SchedulingOutOfOfficeConflictList.load(response.body)) + else + error_class = Coss::Errors::ResponseError.subclass_for_code(code) + raise error_class.new(response.body, code: code) + end + end + end + end + end +end diff --git a/sdks/ruby/lib/coss/scheduling/out_of_office/types/conflicts_out_of_office_request.rb b/sdks/ruby/lib/coss/scheduling/out_of_office/types/conflicts_out_of_office_request.rb new file mode 100644 index 000000000..439884611 --- /dev/null +++ b/sdks/ruby/lib/coss/scheduling/out_of_office/types/conflicts_out_of_office_request.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +module Coss + module Scheduling + module OutOfOffice + module Types + class ConflictsOutOfOfficeRequest < Internal::Types::Model + field :id, -> { String }, optional: false, nullable: false + + field :limit, -> { Integer }, optional: true, nullable: false + end + end + end + end +end diff --git a/sdks/ruby/lib/coss/scheduling/out_of_office/types/create_scheduling_out_of_office_request.rb b/sdks/ruby/lib/coss/scheduling/out_of_office/types/create_scheduling_out_of_office_request.rb new file mode 100644 index 000000000..8f856bf6e --- /dev/null +++ b/sdks/ruby/lib/coss/scheduling/out_of_office/types/create_scheduling_out_of_office_request.rb @@ -0,0 +1,43 @@ +# frozen_string_literal: true + +module Coss + module Scheduling + module OutOfOffice + module Types + class CreateSchedulingOutOfOfficeRequest < Internal::Types::Model + field :host, -> { String }, optional: true, nullable: false + + field :hosts, -> { Internal::Types::Array[String] }, optional: true, nullable: false + + field :host_filter, -> { Internal::Types::Hash[String, Coss::Scheduling::OutOfOffice::Types::CreateSchedulingOutOfOfficeRequestHostFilterValue] }, optional: true, nullable: false + + field :start, -> { String }, optional: true, nullable: false + + field :end_, -> { String }, optional: true, nullable: false, api_name: "end" + + field :start_date, -> { String }, optional: true, nullable: false + + field :end_date, -> { String }, optional: true, nullable: false + + field :time_zone, -> { String }, optional: true, nullable: false + + field :delegates, -> { Internal::Types::Array[String] }, optional: true, nullable: false + + field :reason, -> { String }, optional: true, nullable: false + + field :notes, -> { String }, optional: true, nullable: false + + field :public_message, -> { String }, optional: true, nullable: false + + field :show_on_calendar, -> { Internal::Types::Boolean }, optional: true, nullable: false + + field :existing_bookings, -> { Coss::Scheduling::OutOfOffice::Types::CreateSchedulingOutOfOfficeRequestExistingBookings }, optional: true, nullable: false + + field :reassign, -> { Coss::Scheduling::OutOfOffice::Types::CreateSchedulingOutOfOfficeRequestReassign }, optional: true, nullable: false + + field :external_id, -> { String }, optional: true, nullable: false + end + end + end + end +end diff --git a/sdks/ruby/lib/coss/scheduling/out_of_office/types/create_scheduling_out_of_office_request_existing_bookings.rb b/sdks/ruby/lib/coss/scheduling/out_of_office/types/create_scheduling_out_of_office_request_existing_bookings.rb new file mode 100644 index 000000000..9a97631a8 --- /dev/null +++ b/sdks/ruby/lib/coss/scheduling/out_of_office/types/create_scheduling_out_of_office_request_existing_bookings.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +module Coss + module Scheduling + module OutOfOffice + module Types + module CreateSchedulingOutOfOfficeRequestExistingBookings + extend Coss::Internal::Types::Enum + + LEAVE = "leave" + REASSIGN = "reassign" + end + end + end + end +end diff --git a/sdks/ruby/lib/coss/scheduling/out_of_office/types/create_scheduling_out_of_office_request_host_filter_value.rb b/sdks/ruby/lib/coss/scheduling/out_of_office/types/create_scheduling_out_of_office_request_host_filter_value.rb new file mode 100644 index 000000000..b12bcf7ee --- /dev/null +++ b/sdks/ruby/lib/coss/scheduling/out_of_office/types/create_scheduling_out_of_office_request_host_filter_value.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +module Coss + module Scheduling + module OutOfOffice + module Types + class CreateSchedulingOutOfOfficeRequestHostFilterValue < Internal::Types::Model + extend Coss::Internal::Types::Union + + member -> { String } + + member -> { Internal::Types::Array[String] } + end + end + end + end +end diff --git a/sdks/ruby/lib/coss/scheduling/out_of_office/types/create_scheduling_out_of_office_request_reassign.rb b/sdks/ruby/lib/coss/scheduling/out_of_office/types/create_scheduling_out_of_office_request_reassign.rb new file mode 100644 index 000000000..d23f428e5 --- /dev/null +++ b/sdks/ruby/lib/coss/scheduling/out_of_office/types/create_scheduling_out_of_office_request_reassign.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module Coss + module Scheduling + module OutOfOffice + module Types + # With `existing_bookings: reassign`: who they go to. Default: the fairest who's free. + class CreateSchedulingOutOfOfficeRequestReassign < Internal::Types::Model + field :to_host, -> { String }, optional: true, nullable: false + + field :preferred_hosts, -> { Internal::Types::Array[String] }, optional: true, nullable: false + + field :otherwise, -> { Coss::Scheduling::OutOfOffice::Types::CreateSchedulingOutOfOfficeRequestReassignOtherwise }, optional: true, nullable: false + end + end + end + end +end diff --git a/sdks/ruby/lib/coss/scheduling/out_of_office/types/create_scheduling_out_of_office_request_reassign_otherwise.rb b/sdks/ruby/lib/coss/scheduling/out_of_office/types/create_scheduling_out_of_office_request_reassign_otherwise.rb new file mode 100644 index 000000000..f74f4ed6e --- /dev/null +++ b/sdks/ruby/lib/coss/scheduling/out_of_office/types/create_scheduling_out_of_office_request_reassign_otherwise.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +module Coss + module Scheduling + module OutOfOffice + module Types + module CreateSchedulingOutOfOfficeRequestReassignOtherwise + extend Coss::Internal::Types::Enum + + AUTO = "auto" + LEAVE = "leave" + end + end + end + end +end diff --git a/sdks/ruby/lib/coss/scheduling/out_of_office/types/get_out_of_office_request.rb b/sdks/ruby/lib/coss/scheduling/out_of_office/types/get_out_of_office_request.rb new file mode 100644 index 000000000..1a73ca3cf --- /dev/null +++ b/sdks/ruby/lib/coss/scheduling/out_of_office/types/get_out_of_office_request.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Coss + module Scheduling + module OutOfOffice + module Types + class GetOutOfOfficeRequest < Internal::Types::Model + field :id, -> { String }, optional: false, nullable: false + end + end + end + end +end diff --git a/sdks/ruby/lib/coss/scheduling/out_of_office/types/list_out_of_office_request.rb b/sdks/ruby/lib/coss/scheduling/out_of_office/types/list_out_of_office_request.rb new file mode 100644 index 000000000..9ef996023 --- /dev/null +++ b/sdks/ruby/lib/coss/scheduling/out_of_office/types/list_out_of_office_request.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true + +module Coss + module Scheduling + module OutOfOffice + module Types + class ListOutOfOfficeRequest < Internal::Types::Model + field :limit, -> { Integer }, optional: true, nullable: false + + field :after, -> { String }, optional: true, nullable: false + + field :host, -> { String }, optional: true, nullable: false + + field :start_after, -> { String }, optional: true, nullable: false + + field :start_before, -> { String }, optional: true, nullable: false + + field :group, -> { String }, optional: true, nullable: false + end + end + end + end +end diff --git a/sdks/ruby/lib/coss/scheduling/out_of_office/types/put_scheduling_out_of_office_request.rb b/sdks/ruby/lib/coss/scheduling/out_of_office/types/put_scheduling_out_of_office_request.rb new file mode 100644 index 000000000..c6936aa40 --- /dev/null +++ b/sdks/ruby/lib/coss/scheduling/out_of_office/types/put_scheduling_out_of_office_request.rb @@ -0,0 +1,39 @@ +# frozen_string_literal: true + +module Coss + module Scheduling + module OutOfOffice + module Types + class PutSchedulingOutOfOfficeRequest < Internal::Types::Model + field :external_id, -> { String }, optional: false, nullable: false + + field :host, -> { String }, optional: false, nullable: false + + field :start, -> { String }, optional: true, nullable: false + + field :end_, -> { String }, optional: true, nullable: false, api_name: "end" + + field :start_date, -> { String }, optional: true, nullable: false + + field :end_date, -> { String }, optional: true, nullable: false + + field :time_zone, -> { String }, optional: true, nullable: false + + field :delegates, -> { Internal::Types::Array[String] }, optional: true, nullable: false + + field :reason, -> { String }, optional: true, nullable: false + + field :notes, -> { String }, optional: true, nullable: false + + field :public_message, -> { String }, optional: true, nullable: false + + field :show_on_calendar, -> { Internal::Types::Boolean }, optional: true, nullable: false + + field :existing_bookings, -> { Coss::Scheduling::OutOfOffice::Types::PutSchedulingOutOfOfficeRequestExistingBookings }, optional: true, nullable: false + + field :reassign, -> { Coss::Scheduling::OutOfOffice::Types::PutSchedulingOutOfOfficeRequestReassign }, optional: true, nullable: false + end + end + end + end +end diff --git a/sdks/ruby/lib/coss/scheduling/out_of_office/types/put_scheduling_out_of_office_request_existing_bookings.rb b/sdks/ruby/lib/coss/scheduling/out_of_office/types/put_scheduling_out_of_office_request_existing_bookings.rb new file mode 100644 index 000000000..80fe5380c --- /dev/null +++ b/sdks/ruby/lib/coss/scheduling/out_of_office/types/put_scheduling_out_of_office_request_existing_bookings.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +module Coss + module Scheduling + module OutOfOffice + module Types + module PutSchedulingOutOfOfficeRequestExistingBookings + extend Coss::Internal::Types::Enum + + LEAVE = "leave" + REASSIGN = "reassign" + end + end + end + end +end diff --git a/sdks/ruby/lib/coss/scheduling/out_of_office/types/put_scheduling_out_of_office_request_reassign.rb b/sdks/ruby/lib/coss/scheduling/out_of_office/types/put_scheduling_out_of_office_request_reassign.rb new file mode 100644 index 000000000..c39dd5101 --- /dev/null +++ b/sdks/ruby/lib/coss/scheduling/out_of_office/types/put_scheduling_out_of_office_request_reassign.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module Coss + module Scheduling + module OutOfOffice + module Types + # With `existing_bookings: reassign`: who they go to. Default: the fairest who's free. + class PutSchedulingOutOfOfficeRequestReassign < Internal::Types::Model + field :to_host, -> { String }, optional: true, nullable: false + + field :preferred_hosts, -> { Internal::Types::Array[String] }, optional: true, nullable: false + + field :otherwise, -> { Coss::Scheduling::OutOfOffice::Types::PutSchedulingOutOfOfficeRequestReassignOtherwise }, optional: true, nullable: false + end + end + end + end +end diff --git a/sdks/ruby/lib/coss/scheduling/out_of_office/types/put_scheduling_out_of_office_request_reassign_otherwise.rb b/sdks/ruby/lib/coss/scheduling/out_of_office/types/put_scheduling_out_of_office_request_reassign_otherwise.rb new file mode 100644 index 000000000..a0104d9c7 --- /dev/null +++ b/sdks/ruby/lib/coss/scheduling/out_of_office/types/put_scheduling_out_of_office_request_reassign_otherwise.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +module Coss + module Scheduling + module OutOfOffice + module Types + module PutSchedulingOutOfOfficeRequestReassignOtherwise + extend Coss::Internal::Types::Enum + + AUTO = "auto" + LEAVE = "leave" + end + end + end + end +end diff --git a/sdks/ruby/lib/coss/scheduling/out_of_office/types/remove_out_of_office_request.rb b/sdks/ruby/lib/coss/scheduling/out_of_office/types/remove_out_of_office_request.rb new file mode 100644 index 000000000..c9ffc539e --- /dev/null +++ b/sdks/ruby/lib/coss/scheduling/out_of_office/types/remove_out_of_office_request.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Coss + module Scheduling + module OutOfOffice + module Types + class RemoveOutOfOfficeRequest < Internal::Types::Model + field :id, -> { String }, optional: false, nullable: false + end + end + end + end +end diff --git a/sdks/ruby/lib/coss/scheduling/out_of_office/types/update_scheduling_out_of_office_request.rb b/sdks/ruby/lib/coss/scheduling/out_of_office/types/update_scheduling_out_of_office_request.rb new file mode 100644 index 000000000..1e0cec713 --- /dev/null +++ b/sdks/ruby/lib/coss/scheduling/out_of_office/types/update_scheduling_out_of_office_request.rb @@ -0,0 +1,37 @@ +# frozen_string_literal: true + +module Coss + module Scheduling + module OutOfOffice + module Types + class UpdateSchedulingOutOfOfficeRequest < Internal::Types::Model + field :id, -> { String }, optional: false, nullable: false + + field :start, -> { String }, optional: true, nullable: false + + field :end_, -> { String }, optional: true, nullable: false, api_name: "end" + + field :start_date, -> { String }, optional: true, nullable: false + + field :end_date, -> { String }, optional: true, nullable: false + + field :time_zone, -> { String }, optional: true, nullable: false + + field :reason, -> { String }, optional: true, nullable: false + + field :notes, -> { String }, optional: true, nullable: false + + field :public_message, -> { String }, optional: true, nullable: false + + field :show_on_calendar, -> { Internal::Types::Boolean }, optional: true, nullable: false + + field :delegates, -> { Internal::Types::Array[String] }, optional: true, nullable: false + + field :existing_bookings, -> { Coss::Scheduling::OutOfOffice::Types::UpdateSchedulingOutOfOfficeRequestExistingBookings }, optional: true, nullable: false + + field :reassign, -> { Coss::Scheduling::OutOfOffice::Types::UpdateSchedulingOutOfOfficeRequestReassign }, optional: true, nullable: false + end + end + end + end +end diff --git a/sdks/ruby/lib/coss/scheduling/out_of_office/types/update_scheduling_out_of_office_request_existing_bookings.rb b/sdks/ruby/lib/coss/scheduling/out_of_office/types/update_scheduling_out_of_office_request_existing_bookings.rb new file mode 100644 index 000000000..2f3a40d48 --- /dev/null +++ b/sdks/ruby/lib/coss/scheduling/out_of_office/types/update_scheduling_out_of_office_request_existing_bookings.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +module Coss + module Scheduling + module OutOfOffice + module Types + module UpdateSchedulingOutOfOfficeRequestExistingBookings + extend Coss::Internal::Types::Enum + + LEAVE = "leave" + REASSIGN = "reassign" + end + end + end + end +end diff --git a/sdks/ruby/lib/coss/scheduling/out_of_office/types/update_scheduling_out_of_office_request_reassign.rb b/sdks/ruby/lib/coss/scheduling/out_of_office/types/update_scheduling_out_of_office_request_reassign.rb new file mode 100644 index 000000000..660b82275 --- /dev/null +++ b/sdks/ruby/lib/coss/scheduling/out_of_office/types/update_scheduling_out_of_office_request_reassign.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module Coss + module Scheduling + module OutOfOffice + module Types + # With `existing_bookings: reassign`: who they go to. Default: the fairest who's free. + class UpdateSchedulingOutOfOfficeRequestReassign < Internal::Types::Model + field :to_host, -> { String }, optional: true, nullable: false + + field :preferred_hosts, -> { Internal::Types::Array[String] }, optional: true, nullable: false + + field :otherwise, -> { Coss::Scheduling::OutOfOffice::Types::UpdateSchedulingOutOfOfficeRequestReassignOtherwise }, optional: true, nullable: false + end + end + end + end +end diff --git a/sdks/ruby/lib/coss/scheduling/out_of_office/types/update_scheduling_out_of_office_request_reassign_otherwise.rb b/sdks/ruby/lib/coss/scheduling/out_of_office/types/update_scheduling_out_of_office_request_reassign_otherwise.rb new file mode 100644 index 000000000..c8275514f --- /dev/null +++ b/sdks/ruby/lib/coss/scheduling/out_of_office/types/update_scheduling_out_of_office_request_reassign_otherwise.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +module Coss + module Scheduling + module OutOfOffice + module Types + module UpdateSchedulingOutOfOfficeRequestReassignOtherwise + extend Coss::Internal::Types::Enum + + AUTO = "auto" + LEAVE = "leave" + end + end + end + end +end diff --git a/sdks/ruby/lib/coss/scheduling/reassignments/client.rb b/sdks/ruby/lib/coss/scheduling/reassignments/client.rb new file mode 100644 index 000000000..2995ed4e7 --- /dev/null +++ b/sdks/ruby/lib/coss/scheduling/reassignments/client.rb @@ -0,0 +1,336 @@ +# frozen_string_literal: true + +module Coss + module Scheduling + module Reassignments + class Client + # @param client [Coss::Internal::Http::RawClient] + # + # @return [void] + def initialize(client:) + @client = client + end + + # Who each booking would go to, and why not when nobody can take it, without moving anything. It works down them + # in order, so two can't both be promised the same free hour. Change any of it and start the run with + # `assignments`. Covers the first 500. Things can change before you start it: the run decides again. + # + # @param request_options [Hash] + # @param params [Coss::Scheduling::Reassignments::Types::PreviewSchedulingReassignmentRequest] + # @option request_options [String] :base_url + # @option request_options [Hash{String => Object}] :additional_headers + # @option request_options [Hash{String => Object}] :additional_query_parameters + # @option request_options [Hash{String => Object}] :additional_body_parameters + # @option request_options [Integer] :timeout_in_seconds + # + # @example + # client.scheduling.reassignments.preview( + # selection: { + # host: "doctor_482", + # start_before: "2027-08-14T00:00:00.000Z" + # }, + # strategy: { + # preferred_hosts: ["doctor_518"] + # } + # ) + # + # @return [Coss::Types::SchedulingReassignmentPreview] + def preview(request_options: {}, **params) + params = Coss::Internal::Types::Utils.normalize_keys(params) + headers = { "Idempotency-Key" => Coss::Internal::IdempotencyKey.generate } + request = Coss::Internal::JSON::Request.new( + base_url: request_options[:base_url], + method: "POST", + path: "v1/scheduling/reassignments/preview", + headers: headers, + body: Coss::Scheduling::Reassignments::Types::PreviewSchedulingReassignmentRequest.new(params).to_h, + request_options: request_options + ) + begin + response = @client.send(request) + rescue Net::HTTPRequestTimeout + raise Coss::Errors::TimeoutError + end + code = response.code.to_i + if code.between?(200, 299) + (response.body.to_s.empty? ? nil : Coss::Types::SchedulingReassignmentPreview.load(response.body)) + else + error_class = Coss::Errors::ResponseError.subclass_for_code(code) + raise error_class.new(response.body, code: code) + end + end + + # Newest first, with how each is going. + # + # @param request_options [Hash] + # @param params [Hash] + # @option request_options [String] :base_url + # @option request_options [Hash{String => Object}] :additional_headers + # @option request_options [Hash{String => Object}] :additional_query_parameters + # @option request_options [Hash{String => Object}] :additional_body_parameters + # @option request_options [Integer] :timeout_in_seconds + # @option params [Integer, nil] :limit + # @option params [String, nil] :after + # + # @example + # client.scheduling.reassignments.list + # + # @return [Coss::Types::SchedulingReassignmentList] + def list(request_options: {}, **params) + params = Coss::Internal::Types::Utils.normalize_keys(params) + query_params = {} + query_params["limit"] = params[:limit] if params.key?(:limit) + query_params["after"] = params[:after] if params.key?(:after) + + request = Coss::Internal::JSON::Request.new( + base_url: request_options[:base_url], + method: "GET", + path: "v1/scheduling/reassignments", + query: query_params, + request_options: request_options + ) + begin + response = @client.send(request) + rescue Net::HTTPRequestTimeout + raise Coss::Errors::TimeoutError + end + code = response.code.to_i + if code.between?(200, 299) + (response.body.to_s.empty? ? nil : Coss::Types::SchedulingReassignmentList.load(response.body)) + else + error_class = Coss::Errors::ResponseError.subclass_for_code(code) + raise error_class.new(response.body, code: code) + end + end + + # Moves up to 5,000 bookings in the background, each on its own, so one that can't move never holds up the rest. + # Nothing's ever cancelled: a booking nobody can take stays where it is, and its item says so. It answers at + # once: follow the run by its id, or wait for `scheduling.reassignment.completed`. + # + # @param request_options [Hash] + # @param params [Coss::Scheduling::Reassignments::Types::CreateSchedulingReassignmentRequest] + # @option request_options [String] :base_url + # @option request_options [Hash{String => Object}] :additional_headers + # @option request_options [Hash{String => Object}] :additional_query_parameters + # @option request_options [Hash{String => Object}] :additional_body_parameters + # @option request_options [Integer] :timeout_in_seconds + # @option params [String, nil] :idempotency_key + # + # @example + # client.scheduling.reassignments.create( + # idempotency_key: "welcome-user-123", + # selection: { + # out_of_office: "ooo_01kd2m9a0b1c2d3e4f5g6h7j8m" + # }, + # strategy: { + # preferred_hosts: ["doctor_518"] + # }, + # reason_code: "out_of_office" + # ) + # + # @return [Coss::Types::SchedulingReassignment] + def create(request_options: {}, **params) + params = Coss::Internal::Types::Utils.normalize_keys(params) + request_data = Coss::Scheduling::Reassignments::Types::CreateSchedulingReassignmentRequest.new(params).to_h + non_body_param_names = %w[Idempotency-Key] + body = request_data.except(*non_body_param_names) + + headers = {} + headers["Idempotency-Key"] = params[:idempotency_key] if params[:idempotency_key] + + request = Coss::Internal::JSON::Request.new( + base_url: request_options[:base_url], + method: "POST", + path: "v1/scheduling/reassignments", + headers: headers, + body: body, + request_options: request_options + ) + begin + response = @client.send(request) + rescue Net::HTTPRequestTimeout + raise Coss::Errors::TimeoutError + end + code = response.code.to_i + if code.between?(200, 299) + (response.body.to_s.empty? ? nil : Coss::Types::SchedulingReassignment.load(response.body)) + else + error_class = Coss::Errors::ResponseError.subclass_for_code(code) + raise error_class.new(response.body, code: code) + end + end + + # How it's going. + # + # @param request_options [Hash] + # @param params [Hash] + # @option request_options [String] :base_url + # @option request_options [Hash{String => Object}] :additional_headers + # @option request_options [Hash{String => Object}] :additional_query_parameters + # @option request_options [Hash{String => Object}] :additional_body_parameters + # @option request_options [Integer] :timeout_in_seconds + # @option params [String] :id + # + # @example + # client.scheduling.reassignments.get(id: "id") + # + # @return [Coss::Types::SchedulingReassignment] + def get(request_options: {}, **params) + params = Coss::Internal::Types::Utils.normalize_keys(params) + request = Coss::Internal::JSON::Request.new( + base_url: request_options[:base_url], + method: "GET", + path: "v1/scheduling/reassignments/#{URI.encode_uri_component(params[:id].to_s)}", + request_options: request_options + ) + begin + response = @client.send(request) + rescue Net::HTTPRequestTimeout + raise Coss::Errors::TimeoutError + end + code = response.code.to_i + if code.between?(200, 299) + (response.body.to_s.empty? ? nil : Coss::Types::SchedulingReassignment.load(response.body)) + else + error_class = Coss::Errors::ResponseError.subclass_for_code(code) + raise error_class.new(response.body, code: code) + end + end + + # Each booking it covers and what happened to it. A group session has one, for one of its seats. Empty until the + # worker's started on it. + # + # @param request_options [Hash] + # @param params [Hash] + # @option request_options [String] :base_url + # @option request_options [Hash{String => Object}] :additional_headers + # @option request_options [Hash{String => Object}] :additional_query_parameters + # @option request_options [Hash{String => Object}] :additional_body_parameters + # @option request_options [Integer] :timeout_in_seconds + # @option params [String] :id + # @option params [Integer, nil] :limit + # @option params [String, nil] :after + # + # @example + # client.scheduling.reassignments.items(id: "id") + # + # @return [Coss::Types::SchedulingReassignmentItemList] + def items(request_options: {}, **params) + params = Coss::Internal::Types::Utils.normalize_keys(params) + query_params = {} + query_params["limit"] = params[:limit] if params.key?(:limit) + query_params["after"] = params[:after] if params.key?(:after) + + request = Coss::Internal::JSON::Request.new( + base_url: request_options[:base_url], + method: "GET", + path: "v1/scheduling/reassignments/#{URI.encode_uri_component(params[:id].to_s)}/items", + query: query_params, + request_options: request_options + ) + begin + response = @client.send(request) + rescue Net::HTTPRequestTimeout + raise Coss::Errors::TimeoutError + end + code = response.code.to_i + if code.between?(200, 299) + (response.body.to_s.empty? ? nil : Coss::Types::SchedulingReassignmentItemList.load(response.body)) + else + error_class = Coss::Errors::ResponseError.subclass_for_code(code) + raise error_class.new(response.body, code: code) + end + end + + # Stops what hasn't happened yet. What's moved stays moved: undo it for that. Cancelling one that's finished + # changes nothing. + # + # @param request_options [Hash] + # @param params [Hash] + # @option request_options [String] :base_url + # @option request_options [Hash{String => Object}] :additional_headers + # @option request_options [Hash{String => Object}] :additional_query_parameters + # @option request_options [Hash{String => Object}] :additional_body_parameters + # @option request_options [Integer] :timeout_in_seconds + # @option params [String] :id + # + # @example + # client.scheduling.reassignments.cancel(id: "id") + # + # @return [Coss::Types::SchedulingReassignment] + def cancel(request_options: {}, **params) + params = Coss::Internal::Types::Utils.normalize_keys(params) + headers = { "Idempotency-Key" => Coss::Internal::IdempotencyKey.generate } + request = Coss::Internal::JSON::Request.new( + base_url: request_options[:base_url], + method: "POST", + path: "v1/scheduling/reassignments/#{URI.encode_uri_component(params[:id].to_s)}/cancel", + headers: headers, + request_options: request_options + ) + begin + response = @client.send(request) + rescue Net::HTTPRequestTimeout + raise Coss::Errors::TimeoutError + end + code = response.code.to_i + if code.between?(200, 299) + (response.body.to_s.empty? ? nil : Coss::Types::SchedulingReassignment.load(response.body)) + else + error_class = Coss::Errors::ResponseError.subclass_for_code(code) + raise error_class.new(response.body, code: code) + end + end + + # Gives back what a finished run moved, as a new run. A booking that's moved on since stays where it went, and a + # former host who's no longer free keeps it from going back, unless you pass `overrides`. + # + # @param request_options [Hash] + # @param params [Coss::Scheduling::Reassignments::Types::UndoSchedulingReassignmentRequest] + # @option request_options [String] :base_url + # @option request_options [Hash{String => Object}] :additional_headers + # @option request_options [Hash{String => Object}] :additional_query_parameters + # @option request_options [Hash{String => Object}] :additional_body_parameters + # @option request_options [Integer] :timeout_in_seconds + # @option params [String] :id + # + # @example + # client.scheduling.reassignments.undo( + # id: "id", + # reason_code: "other" + # ) + # + # @return [Coss::Types::SchedulingReassignment] + def undo(request_options: {}, **params) + params = Coss::Internal::Types::Utils.normalize_keys(params) + request_data = Coss::Scheduling::Reassignments::Types::UndoSchedulingReassignmentRequest.new(params).to_h + non_body_param_names = %w[id] + body = request_data.except(*non_body_param_names) + + headers = { "Idempotency-Key" => Coss::Internal::IdempotencyKey.generate } + request = Coss::Internal::JSON::Request.new( + base_url: request_options[:base_url], + method: "POST", + path: "v1/scheduling/reassignments/#{URI.encode_uri_component(params[:id].to_s)}/undo", + headers: headers, + body: body, + request_options: request_options, + max_retries: 0 + ) + begin + response = @client.send(request) + rescue Net::HTTPRequestTimeout + raise Coss::Errors::TimeoutError + end + code = response.code.to_i + if code.between?(200, 299) + (response.body.to_s.empty? ? nil : Coss::Types::SchedulingReassignment.load(response.body)) + else + error_class = Coss::Errors::ResponseError.subclass_for_code(code) + raise error_class.new(response.body, code: code) + end + end + end + end + end +end diff --git a/sdks/ruby/lib/coss/scheduling/reassignments/types/cancel_reassignments_request.rb b/sdks/ruby/lib/coss/scheduling/reassignments/types/cancel_reassignments_request.rb new file mode 100644 index 000000000..8cbb6d894 --- /dev/null +++ b/sdks/ruby/lib/coss/scheduling/reassignments/types/cancel_reassignments_request.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Coss + module Scheduling + module Reassignments + module Types + class CancelReassignmentsRequest < Internal::Types::Model + field :id, -> { String }, optional: false, nullable: false + end + end + end + end +end diff --git a/sdks/ruby/lib/coss/scheduling/reassignments/types/create_scheduling_reassignment_request.rb b/sdks/ruby/lib/coss/scheduling/reassignments/types/create_scheduling_reassignment_request.rb new file mode 100644 index 000000000..ace229aeb --- /dev/null +++ b/sdks/ruby/lib/coss/scheduling/reassignments/types/create_scheduling_reassignment_request.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +module Coss + module Scheduling + module Reassignments + module Types + class CreateSchedulingReassignmentRequest < Internal::Types::Model + field :idempotency_key, -> { String }, optional: true, nullable: false, api_name: "Idempotency-Key" + + field :selection, -> { Coss::Types::SchedulingReassignmentSelection }, optional: false, nullable: false + + field :strategy, -> { Coss::Types::SchedulingReassignmentStrategy }, optional: true, nullable: false + + field :reason_code, -> { Coss::Scheduling::Reassignments::Types::CreateSchedulingReassignmentRequestReasonCode }, optional: false, nullable: false + + field :note, -> { String }, optional: true, nullable: false + + field :overrides, -> { Internal::Types::Array[Coss::Scheduling::Reassignments::Types::CreateSchedulingReassignmentRequestOverridesItem] }, optional: true, nullable: false + + field :notify, -> { Coss::Scheduling::Reassignments::Types::CreateSchedulingReassignmentRequestNotify }, optional: true, nullable: false + end + end + end + end +end diff --git a/sdks/ruby/lib/coss/scheduling/reassignments/types/create_scheduling_reassignment_request_notify.rb b/sdks/ruby/lib/coss/scheduling/reassignments/types/create_scheduling_reassignment_request_notify.rb new file mode 100644 index 000000000..3fd8f2866 --- /dev/null +++ b/sdks/ruby/lib/coss/scheduling/reassignments/types/create_scheduling_reassignment_request_notify.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +module Coss + module Scheduling + module Reassignments + module Types + class CreateSchedulingReassignmentRequestNotify < Internal::Types::Model + field :attendees, -> { Internal::Types::Boolean }, optional: true, nullable: false + + field :hosts, -> { Coss::Scheduling::Reassignments::Types::CreateSchedulingReassignmentRequestNotifyHosts }, optional: true, nullable: false + end + end + end + end +end diff --git a/sdks/ruby/lib/coss/scheduling/reassignments/types/create_scheduling_reassignment_request_notify_hosts.rb b/sdks/ruby/lib/coss/scheduling/reassignments/types/create_scheduling_reassignment_request_notify_hosts.rb new file mode 100644 index 000000000..70c65ed20 --- /dev/null +++ b/sdks/ruby/lib/coss/scheduling/reassignments/types/create_scheduling_reassignment_request_notify_hosts.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +module Coss + module Scheduling + module Reassignments + module Types + module CreateSchedulingReassignmentRequestNotifyHosts + extend Coss::Internal::Types::Enum + + DIGEST = "digest" + EACH = "each" + NONE = "none" + end + end + end + end +end diff --git a/sdks/ruby/lib/coss/scheduling/reassignments/types/create_scheduling_reassignment_request_overrides_item.rb b/sdks/ruby/lib/coss/scheduling/reassignments/types/create_scheduling_reassignment_request_overrides_item.rb new file mode 100644 index 000000000..7771a9176 --- /dev/null +++ b/sdks/ruby/lib/coss/scheduling/reassignments/types/create_scheduling_reassignment_request_overrides_item.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +module Coss + module Scheduling + module Reassignments + module Types + module CreateSchedulingReassignmentRequestOverridesItem + extend Coss::Internal::Types::Enum + + ANY_HOST = "any_host" + OUT_OF_OFFICE = "out_of_office" + OUTSIDE_AVAILABILITY = "outside_availability" + HOST_BUSY = "host_busy" + LIMIT_REACHED = "limit_reached" + CALENDAR_UNVERIFIED = "calendar_unverified" + end + end + end + end +end diff --git a/sdks/ruby/lib/coss/scheduling/reassignments/types/create_scheduling_reassignment_request_reason_code.rb b/sdks/ruby/lib/coss/scheduling/reassignments/types/create_scheduling_reassignment_request_reason_code.rb new file mode 100644 index 000000000..e6de7ac87 --- /dev/null +++ b/sdks/ruby/lib/coss/scheduling/reassignments/types/create_scheduling_reassignment_request_reason_code.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +module Coss + module Scheduling + module Reassignments + module Types + module CreateSchedulingReassignmentRequestReasonCode + extend Coss::Internal::Types::Enum + + HOST_UNAVAILABLE = "host_unavailable" + OUT_OF_OFFICE = "out_of_office" + WORKLOAD = "workload" + CUSTOMER_REQUEST = "customer_request" + OFFBOARDING = "offboarding" + OTHER = "other" + end + end + end + end +end diff --git a/sdks/ruby/lib/coss/scheduling/reassignments/types/get_reassignments_request.rb b/sdks/ruby/lib/coss/scheduling/reassignments/types/get_reassignments_request.rb new file mode 100644 index 000000000..72bd33661 --- /dev/null +++ b/sdks/ruby/lib/coss/scheduling/reassignments/types/get_reassignments_request.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Coss + module Scheduling + module Reassignments + module Types + class GetReassignmentsRequest < Internal::Types::Model + field :id, -> { String }, optional: false, nullable: false + end + end + end + end +end diff --git a/sdks/ruby/lib/coss/scheduling/reassignments/types/items_reassignments_request.rb b/sdks/ruby/lib/coss/scheduling/reassignments/types/items_reassignments_request.rb new file mode 100644 index 000000000..d227c2ab3 --- /dev/null +++ b/sdks/ruby/lib/coss/scheduling/reassignments/types/items_reassignments_request.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +module Coss + module Scheduling + module Reassignments + module Types + class ItemsReassignmentsRequest < Internal::Types::Model + field :id, -> { String }, optional: false, nullable: false + + field :limit, -> { Integer }, optional: true, nullable: false + + field :after, -> { String }, optional: true, nullable: false + end + end + end + end +end diff --git a/sdks/ruby/lib/coss/scheduling/reassignments/types/list_reassignments_request.rb b/sdks/ruby/lib/coss/scheduling/reassignments/types/list_reassignments_request.rb new file mode 100644 index 000000000..964b2bb98 --- /dev/null +++ b/sdks/ruby/lib/coss/scheduling/reassignments/types/list_reassignments_request.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +module Coss + module Scheduling + module Reassignments + module Types + class ListReassignmentsRequest < Internal::Types::Model + field :limit, -> { Integer }, optional: true, nullable: false + + field :after, -> { String }, optional: true, nullable: false + end + end + end + end +end diff --git a/sdks/ruby/lib/coss/scheduling/reassignments/types/preview_scheduling_reassignment_request.rb b/sdks/ruby/lib/coss/scheduling/reassignments/types/preview_scheduling_reassignment_request.rb new file mode 100644 index 000000000..29d68407b --- /dev/null +++ b/sdks/ruby/lib/coss/scheduling/reassignments/types/preview_scheduling_reassignment_request.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +module Coss + module Scheduling + module Reassignments + module Types + class PreviewSchedulingReassignmentRequest < Internal::Types::Model + field :selection, -> { Coss::Types::SchedulingReassignmentSelection }, optional: false, nullable: false + + field :strategy, -> { Coss::Types::SchedulingReassignmentStrategy }, optional: true, nullable: false + + field :overrides, -> { Internal::Types::Array[Coss::Scheduling::Reassignments::Types::PreviewSchedulingReassignmentRequestOverridesItem] }, optional: true, nullable: false + end + end + end + end +end diff --git a/sdks/ruby/lib/coss/scheduling/reassignments/types/preview_scheduling_reassignment_request_overrides_item.rb b/sdks/ruby/lib/coss/scheduling/reassignments/types/preview_scheduling_reassignment_request_overrides_item.rb new file mode 100644 index 000000000..c96ffbb7e --- /dev/null +++ b/sdks/ruby/lib/coss/scheduling/reassignments/types/preview_scheduling_reassignment_request_overrides_item.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +module Coss + module Scheduling + module Reassignments + module Types + module PreviewSchedulingReassignmentRequestOverridesItem + extend Coss::Internal::Types::Enum + + ANY_HOST = "any_host" + OUT_OF_OFFICE = "out_of_office" + OUTSIDE_AVAILABILITY = "outside_availability" + HOST_BUSY = "host_busy" + LIMIT_REACHED = "limit_reached" + CALENDAR_UNVERIFIED = "calendar_unverified" + end + end + end + end +end diff --git a/sdks/ruby/lib/coss/scheduling/reassignments/types/undo_scheduling_reassignment_request.rb b/sdks/ruby/lib/coss/scheduling/reassignments/types/undo_scheduling_reassignment_request.rb new file mode 100644 index 000000000..ee7237fb6 --- /dev/null +++ b/sdks/ruby/lib/coss/scheduling/reassignments/types/undo_scheduling_reassignment_request.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +module Coss + module Scheduling + module Reassignments + module Types + class UndoSchedulingReassignmentRequest < Internal::Types::Model + field :id, -> { String }, optional: false, nullable: false + + field :reason_code, -> { Coss::Scheduling::Reassignments::Types::UndoSchedulingReassignmentRequestReasonCode }, optional: true, nullable: false + + field :note, -> { String }, optional: true, nullable: false + + field :overrides, -> { Internal::Types::Array[Coss::Scheduling::Reassignments::Types::UndoSchedulingReassignmentRequestOverridesItem] }, optional: true, nullable: false + + field :notify, -> { Coss::Scheduling::Reassignments::Types::UndoSchedulingReassignmentRequestNotify }, optional: true, nullable: false + end + end + end + end +end diff --git a/sdks/ruby/lib/coss/scheduling/reassignments/types/undo_scheduling_reassignment_request_notify.rb b/sdks/ruby/lib/coss/scheduling/reassignments/types/undo_scheduling_reassignment_request_notify.rb new file mode 100644 index 000000000..481ccd4a6 --- /dev/null +++ b/sdks/ruby/lib/coss/scheduling/reassignments/types/undo_scheduling_reassignment_request_notify.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +module Coss + module Scheduling + module Reassignments + module Types + class UndoSchedulingReassignmentRequestNotify < Internal::Types::Model + field :attendees, -> { Internal::Types::Boolean }, optional: true, nullable: false + + field :hosts, -> { Coss::Scheduling::Reassignments::Types::UndoSchedulingReassignmentRequestNotifyHosts }, optional: true, nullable: false + end + end + end + end +end diff --git a/sdks/ruby/lib/coss/scheduling/reassignments/types/undo_scheduling_reassignment_request_notify_hosts.rb b/sdks/ruby/lib/coss/scheduling/reassignments/types/undo_scheduling_reassignment_request_notify_hosts.rb new file mode 100644 index 000000000..47944c7ed --- /dev/null +++ b/sdks/ruby/lib/coss/scheduling/reassignments/types/undo_scheduling_reassignment_request_notify_hosts.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +module Coss + module Scheduling + module Reassignments + module Types + module UndoSchedulingReassignmentRequestNotifyHosts + extend Coss::Internal::Types::Enum + + DIGEST = "digest" + EACH = "each" + NONE = "none" + end + end + end + end +end diff --git a/sdks/ruby/lib/coss/scheduling/reassignments/types/undo_scheduling_reassignment_request_overrides_item.rb b/sdks/ruby/lib/coss/scheduling/reassignments/types/undo_scheduling_reassignment_request_overrides_item.rb new file mode 100644 index 000000000..96c7054e6 --- /dev/null +++ b/sdks/ruby/lib/coss/scheduling/reassignments/types/undo_scheduling_reassignment_request_overrides_item.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +module Coss + module Scheduling + module Reassignments + module Types + module UndoSchedulingReassignmentRequestOverridesItem + extend Coss::Internal::Types::Enum + + ANY_HOST = "any_host" + OUT_OF_OFFICE = "out_of_office" + OUTSIDE_AVAILABILITY = "outside_availability" + HOST_BUSY = "host_busy" + LIMIT_REACHED = "limit_reached" + CALENDAR_UNVERIFIED = "calendar_unverified" + end + end + end + end +end diff --git a/sdks/ruby/lib/coss/scheduling/reassignments/types/undo_scheduling_reassignment_request_reason_code.rb b/sdks/ruby/lib/coss/scheduling/reassignments/types/undo_scheduling_reassignment_request_reason_code.rb new file mode 100644 index 000000000..d4701bc64 --- /dev/null +++ b/sdks/ruby/lib/coss/scheduling/reassignments/types/undo_scheduling_reassignment_request_reason_code.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +module Coss + module Scheduling + module Reassignments + module Types + module UndoSchedulingReassignmentRequestReasonCode + extend Coss::Internal::Types::Enum + + HOST_UNAVAILABLE = "host_unavailable" + OUT_OF_OFFICE = "out_of_office" + WORKLOAD = "workload" + CUSTOMER_REQUEST = "customer_request" + OFFBOARDING = "offboarding" + OTHER = "other" + end + end + end + end +end diff --git a/sdks/ruby/lib/coss/scheduling/sessions/client.rb b/sdks/ruby/lib/coss/scheduling/sessions/client.rb index 48f3c447a..69e916593 100644 --- a/sdks/ruby/lib/coss/scheduling/sessions/client.rb +++ b/sdks/ruby/lib/coss/scheduling/sessions/client.rb @@ -11,6 +11,53 @@ def initialize(client:) @client = client end + # Lets a team lead manage cover for the hosts you name, or those matching an attribute filter whenever it's + # asked: time off, bookings that need someone else, and moving them. It never sees attendees' details. Send the + # `url` to their browser, or embed it with `coss/scheduling`. + # + # @param request_options [Hash] + # @param params [Coss::Scheduling::Sessions::Types::CreateSchedulingManagerSessionRequest] + # @option request_options [String] :base_url + # @option request_options [Hash{String => Object}] :additional_headers + # @option request_options [Hash{String => Object}] :additional_query_parameters + # @option request_options [Hash{String => Object}] :additional_body_parameters + # @option request_options [Integer] :timeout_in_seconds + # + # @example + # client.scheduling.sessions.create_for_manager( + # host_filter: { + # team: "cardiology" + # }, + # expires_in: 3600 + # ) + # + # @return [Coss::Types::SchedulingSession] + def create_for_manager(request_options: {}, **params) + params = Coss::Internal::Types::Utils.normalize_keys(params) + headers = { "Idempotency-Key" => Coss::Internal::IdempotencyKey.generate } + request = Coss::Internal::JSON::Request.new( + base_url: request_options[:base_url], + method: "POST", + path: "v1/scheduling/manager_sessions", + headers: headers, + body: Coss::Scheduling::Sessions::Types::CreateSchedulingManagerSessionRequest.new(params).to_h, + request_options: request_options, + max_retries: 0 + ) + begin + response = @client.send(request) + rescue Net::HTTPRequestTimeout + raise Coss::Errors::TimeoutError + end + code = response.code.to_i + if code.between?(200, 299) + (response.body.to_s.empty? ? nil : Coss::Types::SchedulingSession.load(response.body)) + else + error_class = Coss::Errors::ResponseError.subclass_for_code(code) + raise error_class.new(response.body, code: code) + end + end + # Lets one host manage their own hours, calendars and locations, on coss.com's hosted page or your own UI. Send # the `url` to their browser, or embed it with `coss/scheduling`. # diff --git a/sdks/ruby/lib/coss/scheduling/sessions/types/create_scheduling_manager_session_request.rb b/sdks/ruby/lib/coss/scheduling/sessions/types/create_scheduling_manager_session_request.rb new file mode 100644 index 000000000..0a85e58b8 --- /dev/null +++ b/sdks/ruby/lib/coss/scheduling/sessions/types/create_scheduling_manager_session_request.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +module Coss + module Scheduling + module Sessions + module Types + class CreateSchedulingManagerSessionRequest < Internal::Types::Model + field :hosts, -> { Internal::Types::Array[String] }, optional: true, nullable: false + + field :host_filter, -> { Internal::Types::Hash[String, Coss::Scheduling::Sessions::Types::CreateSchedulingManagerSessionRequestHostFilterValue] }, optional: true, nullable: false + + field :expires_in, -> { Integer }, optional: true, nullable: false + + field :read_only, -> { Internal::Types::Boolean }, optional: true, nullable: false + end + end + end + end +end diff --git a/sdks/ruby/lib/coss/scheduling/sessions/types/create_scheduling_manager_session_request_host_filter_value.rb b/sdks/ruby/lib/coss/scheduling/sessions/types/create_scheduling_manager_session_request_host_filter_value.rb new file mode 100644 index 000000000..bd29b4755 --- /dev/null +++ b/sdks/ruby/lib/coss/scheduling/sessions/types/create_scheduling_manager_session_request_host_filter_value.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +module Coss + module Scheduling + module Sessions + module Types + class CreateSchedulingManagerSessionRequestHostFilterValue < Internal::Types::Model + extend Coss::Internal::Types::Union + + member -> { String } + + member -> { Internal::Types::Array[String] } + end + end + end + end +end diff --git a/sdks/ruby/lib/coss/scheduling/settings/types/update_scheduling_settings_request.rb b/sdks/ruby/lib/coss/scheduling/settings/types/update_scheduling_settings_request.rb index 0f95d6bed..91d0b8a09 100644 --- a/sdks/ruby/lib/coss/scheduling/settings/types/update_scheduling_settings_request.rb +++ b/sdks/ruby/lib/coss/scheduling/settings/types/update_scheduling_settings_request.rb @@ -13,12 +13,20 @@ class UpdateSchedulingSettingsRequest < Internal::Types::Model field :logo, -> { Coss::Scheduling::Settings::Types::UpdateSchedulingSettingsRequestLogo }, optional: true, nullable: false + field :privacy_url, -> { String }, optional: true, nullable: false + field :email_from, -> { String }, optional: true, nullable: false field :sms_from, -> { String }, optional: true, nullable: false field :calendar_failure_mode, -> { Coss::Scheduling::Settings::Types::UpdateSchedulingSettingsRequestCalendarFailureMode }, optional: true, nullable: false + field :name_host_in_attendee_emails, -> { Internal::Types::Boolean }, optional: true, nullable: false + + field :host_reassignment, -> { Coss::Scheduling::Settings::Types::UpdateSchedulingSettingsRequestHostReassignment }, optional: true, nullable: false + + field :out_of_office_reasons, -> { Internal::Types::Array[Coss::Scheduling::Settings::Types::UpdateSchedulingSettingsRequestOutOfOfficeReasonsItem] }, optional: true, nullable: false + field :notifications, -> { Internal::Types::Hash[String, Coss::Scheduling::Settings::Types::UpdateSchedulingSettingsRequestNotificationsValue] }, optional: true, nullable: false field :email_reply_to, -> { String }, optional: true, nullable: false diff --git a/sdks/ruby/lib/coss/scheduling/settings/types/update_scheduling_settings_request_host_reassignment.rb b/sdks/ruby/lib/coss/scheduling/settings/types/update_scheduling_settings_request_host_reassignment.rb new file mode 100644 index 000000000..e5cac4ec8 --- /dev/null +++ b/sdks/ruby/lib/coss/scheduling/settings/types/update_scheduling_settings_request_host_reassignment.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +module Coss + module Scheduling + module Settings + module Types + module UpdateSchedulingSettingsRequestHostReassignment + extend Coss::Internal::Types::Enum + + OFF = "off" + ELIGIBLE = "eligible" + end + end + end + end +end diff --git a/sdks/ruby/lib/coss/scheduling/settings/types/update_scheduling_settings_request_out_of_office_reasons_item.rb b/sdks/ruby/lib/coss/scheduling/settings/types/update_scheduling_settings_request_out_of_office_reasons_item.rb new file mode 100644 index 000000000..7cb4d2d0f --- /dev/null +++ b/sdks/ruby/lib/coss/scheduling/settings/types/update_scheduling_settings_request_out_of_office_reasons_item.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +module Coss + module Scheduling + module Settings + module Types + class UpdateSchedulingSettingsRequestOutOfOfficeReasonsItem < Internal::Types::Model + field :key, -> { String }, optional: false, nullable: false + + field :label, -> { String }, optional: false, nullable: false + end + end + end + end +end diff --git a/sdks/ruby/lib/coss/types/create_oauth_app_request.rb b/sdks/ruby/lib/coss/types/create_oauth_app_request.rb new file mode 100644 index 000000000..b07aebd99 --- /dev/null +++ b/sdks/ruby/lib/coss/types/create_oauth_app_request.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +module Coss + module Types + class CreateOauthAppRequest < Internal::Types::Model + extend Coss::Internal::Types::Union + + discriminant :provider + + member -> { Coss::Types::CreateOauthAppRequestGoogle }, key: "GOOGLE" + + member -> { Coss::Types::CreateOauthAppRequestMicrosoft }, key: "MICROSOFT" + + member -> { Coss::Types::CreateOauthAppRequestZoom }, key: "ZOOM" + end + end +end diff --git a/sdks/ruby/lib/coss/types/create_oauth_app_request_google.rb b/sdks/ruby/lib/coss/types/create_oauth_app_request_google.rb new file mode 100644 index 000000000..b6ea8a7f9 --- /dev/null +++ b/sdks/ruby/lib/coss/types/create_oauth_app_request_google.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +module Coss + module Types + class CreateOauthAppRequestGoogle < Internal::Types::Model + field :client_id, -> { String }, optional: false, nullable: false + + field :client_secret, -> { String }, optional: false, nullable: false + + field :redirect_uri, -> { String }, optional: true, nullable: false + + field :completion_url, -> { String }, optional: true, nullable: false + + field :secret_expires_at, -> { String }, optional: true, nullable: false + end + end +end diff --git a/sdks/ruby/lib/coss/types/create_oauth_app_request_microsoft.rb b/sdks/ruby/lib/coss/types/create_oauth_app_request_microsoft.rb new file mode 100644 index 000000000..26717c8a4 --- /dev/null +++ b/sdks/ruby/lib/coss/types/create_oauth_app_request_microsoft.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +module Coss + module Types + class CreateOauthAppRequestMicrosoft < Internal::Types::Model + field :client_id, -> { String }, optional: false, nullable: false + + field :client_secret, -> { String }, optional: false, nullable: false + + field :tenant_id, -> { String }, optional: true, nullable: false + + field :redirect_uri, -> { String }, optional: true, nullable: false + + field :completion_url, -> { String }, optional: true, nullable: false + + field :secret_expires_at, -> { String }, optional: true, nullable: false + end + end +end diff --git a/sdks/ruby/lib/coss/types/create_oauth_app_request_zoom.rb b/sdks/ruby/lib/coss/types/create_oauth_app_request_zoom.rb new file mode 100644 index 000000000..c7271db17 --- /dev/null +++ b/sdks/ruby/lib/coss/types/create_oauth_app_request_zoom.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +module Coss + module Types + class CreateOauthAppRequestZoom < Internal::Types::Model + field :client_id, -> { String }, optional: false, nullable: false + + field :client_secret, -> { String }, optional: false, nullable: false + + field :webhook_secret, -> { String }, optional: true, nullable: false + + field :redirect_uri, -> { String }, optional: true, nullable: false + + field :completion_url, -> { String }, optional: true, nullable: false + + field :secret_expires_at, -> { String }, optional: true, nullable: false + end + end +end diff --git a/sdks/ruby/lib/coss/types/deleted_scheduling_holiday_calendar.rb b/sdks/ruby/lib/coss/types/deleted_scheduling_holiday_calendar.rb new file mode 100644 index 000000000..7a9f8156c --- /dev/null +++ b/sdks/ruby/lib/coss/types/deleted_scheduling_holiday_calendar.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Coss + module Types + class DeletedSchedulingHolidayCalendar < Internal::Types::Model + field :id, -> { String }, optional: false, nullable: false + + field :deleted, -> { Internal::Types::Boolean }, optional: false, nullable: false + end + end +end diff --git a/sdks/ruby/lib/coss/types/deleted_scheduling_oauth_app.rb b/sdks/ruby/lib/coss/types/deleted_scheduling_oauth_app.rb new file mode 100644 index 000000000..2f498b10b --- /dev/null +++ b/sdks/ruby/lib/coss/types/deleted_scheduling_oauth_app.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Coss + module Types + class DeletedSchedulingOauthApp < Internal::Types::Model + field :object, -> { Coss::Types::DeletedSchedulingOauthAppObject }, optional: false, nullable: false + + field :id, -> { String }, optional: false, nullable: false + + field :deleted, -> { Internal::Types::Boolean }, optional: false, nullable: false + end + end +end diff --git a/sdks/ruby/lib/coss/types/deleted_scheduling_oauth_app_object.rb b/sdks/ruby/lib/coss/types/deleted_scheduling_oauth_app_object.rb new file mode 100644 index 000000000..732f608ea --- /dev/null +++ b/sdks/ruby/lib/coss/types/deleted_scheduling_oauth_app_object.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Coss + module Types + module DeletedSchedulingOauthAppObject + extend Coss::Internal::Types::Enum + + SCHEDULING_OAUTH_APP = "scheduling.oauth_app" + end + end +end diff --git a/sdks/ruby/lib/coss/types/deleted_scheduling_out_of_office.rb b/sdks/ruby/lib/coss/types/deleted_scheduling_out_of_office.rb new file mode 100644 index 000000000..3e208e8ff --- /dev/null +++ b/sdks/ruby/lib/coss/types/deleted_scheduling_out_of_office.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Coss + module Types + class DeletedSchedulingOutOfOffice < Internal::Types::Model + field :object, -> { Coss::Types::DeletedSchedulingOutOfOfficeObject }, optional: false, nullable: false + + field :id, -> { String }, optional: false, nullable: false + + field :deleted, -> { Internal::Types::Boolean }, optional: false, nullable: false + end + end +end diff --git a/sdks/ruby/lib/coss/types/deleted_scheduling_out_of_office_object.rb b/sdks/ruby/lib/coss/types/deleted_scheduling_out_of_office_object.rb new file mode 100644 index 000000000..fe474b5ed --- /dev/null +++ b/sdks/ruby/lib/coss/types/deleted_scheduling_out_of_office_object.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Coss + module Types + module DeletedSchedulingOutOfOfficeObject + extend Coss::Internal::Types::Enum + + SCHEDULING_OUT_OF_OFFICE = "scheduling.out_of_office" + end + end +end diff --git a/sdks/ruby/lib/coss/types/scheduling_booking.rb b/sdks/ruby/lib/coss/types/scheduling_booking.rb index 061d09895..ba24108ab 100644 --- a/sdks/ruby/lib/coss/types/scheduling_booking.rb +++ b/sdks/ruby/lib/coss/types/scheduling_booking.rb @@ -21,7 +21,7 @@ class SchedulingBooking < Internal::Types::Model field :attendees, -> { Internal::Types::Array[Coss::Types::SchedulingBookingAttendeesItem] }, optional: false, nullable: false - field :location, -> { Coss::Types::SchedulingLocation }, optional: false, nullable: false + field :location, -> { Coss::Types::SchedulingLocation }, optional: false, nullable: true field :hold_expires_at, -> { String }, optional: false, nullable: true diff --git a/sdks/ruby/lib/coss/types/scheduling_booking_cancelled_by.rb b/sdks/ruby/lib/coss/types/scheduling_booking_cancelled_by.rb index 7f1ed8c11..ccd04aba1 100644 --- a/sdks/ruby/lib/coss/types/scheduling_booking_cancelled_by.rb +++ b/sdks/ruby/lib/coss/types/scheduling_booking_cancelled_by.rb @@ -10,6 +10,7 @@ module SchedulingBookingCancelledBy HOST_SESSION = "host_session" BOOKER_SESSION = "booker_session" MANAGE_SESSION = "manage_session" + MANAGER_SESSION = "manager_session" SYSTEM = "system" end end diff --git a/sdks/ruby/lib/coss/types/scheduling_booking_event_actor_kind.rb b/sdks/ruby/lib/coss/types/scheduling_booking_event_actor_kind.rb index 35367b744..fa6fb87f8 100644 --- a/sdks/ruby/lib/coss/types/scheduling_booking_event_actor_kind.rb +++ b/sdks/ruby/lib/coss/types/scheduling_booking_event_actor_kind.rb @@ -10,6 +10,7 @@ module SchedulingBookingEventActorKind HOST_SESSION = "host_session" BOOKER_SESSION = "booker_session" MANAGE_SESSION = "manage_session" + MANAGER_SESSION = "manager_session" SYSTEM = "system" end end diff --git a/sdks/ruby/lib/coss/types/scheduling_booking_webhook_data.rb b/sdks/ruby/lib/coss/types/scheduling_booking_webhook_data.rb index a27979b83..7e3113e08 100644 --- a/sdks/ruby/lib/coss/types/scheduling_booking_webhook_data.rb +++ b/sdks/ruby/lib/coss/types/scheduling_booking_webhook_data.rb @@ -22,6 +22,10 @@ class SchedulingBookingWebhookData < Internal::Types::Model field :previous_start, -> { String }, optional: true, nullable: false + field :previous_host_ids, -> { Internal::Types::Array[String] }, optional: true, nullable: false + + field :reassignment_id, -> { String }, optional: true, nullable: false + field :reminder, -> { Coss::Types::SchedulingBookingWebhookDataReminder }, optional: true, nullable: false field :occurred_at, -> { String }, optional: false, nullable: false diff --git a/sdks/ruby/lib/coss/types/scheduling_booking_webhook_event_type.rb b/sdks/ruby/lib/coss/types/scheduling_booking_webhook_event_type.rb index 150327caf..d74f34b06 100644 --- a/sdks/ruby/lib/coss/types/scheduling_booking_webhook_event_type.rb +++ b/sdks/ruby/lib/coss/types/scheduling_booking_webhook_event_type.rb @@ -15,6 +15,7 @@ module SchedulingBookingWebhookEventType SCHEDULING_BOOKING_EXTERNAL_CONFLICT = "scheduling.booking.external_conflict" SCHEDULING_BOOKING_CALENDAR_WRITE_FAILED = "scheduling.booking.calendar_write_failed" SCHEDULING_BOOKING_LOCATION_READY = "scheduling.booking.location_ready" + SCHEDULING_BOOKING_REASSIGNED = "scheduling.booking.reassigned" SCHEDULING_BOOKING_STARTED = "scheduling.booking.started" SCHEDULING_BOOKING_ENDED = "scheduling.booking.ended" SCHEDULING_BOOKING_REMINDER = "scheduling.booking.reminder" diff --git a/sdks/ruby/lib/coss/types/scheduling_calendar_connection.rb b/sdks/ruby/lib/coss/types/scheduling_calendar_connection.rb index 40fb27fb4..336e070b8 100644 --- a/sdks/ruby/lib/coss/types/scheduling_calendar_connection.rb +++ b/sdks/ruby/lib/coss/types/scheduling_calendar_connection.rb @@ -15,6 +15,8 @@ class SchedulingCalendarConnection < Internal::Types::Model field :status, -> { Coss::Types::SchedulingCalendarConnectionStatus }, optional: false, nullable: false + field :oauth_app, -> { String }, optional: false, nullable: true + field :delegation, -> { String }, optional: false, nullable: true field :calendars, -> { Internal::Types::Array[Coss::Types::SchedulingCalendarConnectionCalendarsItem] }, optional: false, nullable: false diff --git a/sdks/ruby/lib/coss/types/scheduling_event_type.rb b/sdks/ruby/lib/coss/types/scheduling_event_type.rb index 8e075baa4..aeaf6febc 100644 --- a/sdks/ruby/lib/coss/types/scheduling_event_type.rb +++ b/sdks/ruby/lib/coss/types/scheduling_event_type.rb @@ -39,6 +39,8 @@ class SchedulingEventType < Internal::Types::Model field :requires_approval, -> { Internal::Types::Boolean }, optional: false, nullable: false + field :reassignment_enabled, -> { Internal::Types::Boolean }, optional: false, nullable: false + field :approval_ttl_minutes, -> { Integer }, optional: false, nullable: false field :hold_ttl_seconds, -> { Integer }, optional: false, nullable: false diff --git a/sdks/ruby/lib/coss/types/scheduling_holiday_calendar.rb b/sdks/ruby/lib/coss/types/scheduling_holiday_calendar.rb new file mode 100644 index 000000000..ad3c9bead --- /dev/null +++ b/sdks/ruby/lib/coss/types/scheduling_holiday_calendar.rb @@ -0,0 +1,35 @@ +# frozen_string_literal: true + +module Coss + module Types + class SchedulingHolidayCalendar < Internal::Types::Model + field :object, -> { Coss::Types::SchedulingHolidayCalendarObject }, optional: false, nullable: false + + field :id, -> { String }, optional: false, nullable: false + + field :name, -> { String }, optional: false, nullable: false + + field :source, -> { Coss::Types::SchedulingHolidayCalendarSource }, optional: false, nullable: false + + field :country, -> { String }, optional: false, nullable: true + + field :hosts, -> { Internal::Types::Array[String] }, optional: false, nullable: true + + field :host_filter, -> { Internal::Types::Hash[String, Coss::Types::SchedulingHolidayCalendarHostFilterValue] }, optional: false, nullable: true + + field :regions, -> { Internal::Types::Array[String] }, optional: false, nullable: true + + field :delegates, -> { Internal::Types::Array[String] }, optional: false, nullable: false + + field :existing_bookings, -> { Coss::Types::SchedulingHolidayCalendarExistingBookings }, optional: false, nullable: false + + field :last_read_at, -> { String }, optional: false, nullable: true + + field :last_error, -> { String }, optional: false, nullable: true + + field :created_at, -> { String }, optional: false, nullable: false + + field :updated_at, -> { String }, optional: false, nullable: false + end + end +end diff --git a/sdks/ruby/lib/coss/types/scheduling_holiday_calendar_existing_bookings.rb b/sdks/ruby/lib/coss/types/scheduling_holiday_calendar_existing_bookings.rb new file mode 100644 index 000000000..e32a4a2aa --- /dev/null +++ b/sdks/ruby/lib/coss/types/scheduling_holiday_calendar_existing_bookings.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Coss + module Types + module SchedulingHolidayCalendarExistingBookings + extend Coss::Internal::Types::Enum + + LEAVE = "leave" + REASSIGN = "reassign" + end + end +end diff --git a/sdks/ruby/lib/coss/types/scheduling_holiday_calendar_host_filter_value.rb b/sdks/ruby/lib/coss/types/scheduling_holiday_calendar_host_filter_value.rb new file mode 100644 index 000000000..a9ee63b06 --- /dev/null +++ b/sdks/ruby/lib/coss/types/scheduling_holiday_calendar_host_filter_value.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Coss + module Types + class SchedulingHolidayCalendarHostFilterValue < Internal::Types::Model + extend Coss::Internal::Types::Union + + member -> { String } + + member -> { Internal::Types::Array[String] } + end + end +end diff --git a/sdks/ruby/lib/coss/types/scheduling_holiday_calendar_list.rb b/sdks/ruby/lib/coss/types/scheduling_holiday_calendar_list.rb new file mode 100644 index 000000000..d7c6c1b31 --- /dev/null +++ b/sdks/ruby/lib/coss/types/scheduling_holiday_calendar_list.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Coss + module Types + class SchedulingHolidayCalendarList < Internal::Types::Model + field :object, -> { Coss::Types::SchedulingHolidayCalendarListObject }, optional: false, nullable: false + + field :data, -> { Internal::Types::Array[Coss::Types::SchedulingHolidayCalendar] }, optional: false, nullable: false + + field :has_more, -> { Internal::Types::Boolean }, optional: false, nullable: false + end + end +end diff --git a/sdks/ruby/lib/coss/types/scheduling_holiday_calendar_list_object.rb b/sdks/ruby/lib/coss/types/scheduling_holiday_calendar_list_object.rb new file mode 100644 index 000000000..5c450260d --- /dev/null +++ b/sdks/ruby/lib/coss/types/scheduling_holiday_calendar_list_object.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Coss + module Types + module SchedulingHolidayCalendarListObject + extend Coss::Internal::Types::Enum + + LIST = "list" + end + end +end diff --git a/sdks/ruby/lib/coss/types/scheduling_holiday_calendar_object.rb b/sdks/ruby/lib/coss/types/scheduling_holiday_calendar_object.rb new file mode 100644 index 000000000..4e52da2ac --- /dev/null +++ b/sdks/ruby/lib/coss/types/scheduling_holiday_calendar_object.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Coss + module Types + module SchedulingHolidayCalendarObject + extend Coss::Internal::Types::Enum + + SCHEDULING_HOLIDAY_CALENDAR = "scheduling.holiday_calendar" + end + end +end diff --git a/sdks/ruby/lib/coss/types/scheduling_holiday_calendar_source.rb b/sdks/ruby/lib/coss/types/scheduling_holiday_calendar_source.rb new file mode 100644 index 000000000..e1e0e355b --- /dev/null +++ b/sdks/ruby/lib/coss/types/scheduling_holiday_calendar_source.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Coss + module Types + module SchedulingHolidayCalendarSource + extend Coss::Internal::Types::Enum + + COUNTRY = "country" + ICS = "ics" + end + end +end diff --git a/sdks/ruby/lib/coss/types/scheduling_holiday_list.rb b/sdks/ruby/lib/coss/types/scheduling_holiday_list.rb new file mode 100644 index 000000000..5bbd2ae88 --- /dev/null +++ b/sdks/ruby/lib/coss/types/scheduling_holiday_list.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Coss + module Types + class SchedulingHolidayList < Internal::Types::Model + field :object, -> { Coss::Types::SchedulingHolidayListObject }, optional: false, nullable: false + + field :data, -> { Internal::Types::Array[Coss::Types::SchedulingHolidayListDataItem] }, optional: false, nullable: false + + field :has_more, -> { Internal::Types::Boolean }, optional: false, nullable: false + end + end +end diff --git a/sdks/ruby/lib/coss/types/scheduling_holiday_list_data_item.rb b/sdks/ruby/lib/coss/types/scheduling_holiday_list_data_item.rb new file mode 100644 index 000000000..3819866c5 --- /dev/null +++ b/sdks/ruby/lib/coss/types/scheduling_holiday_list_data_item.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Coss + module Types + class SchedulingHolidayListDataItem < Internal::Types::Model + field :date, -> { String }, optional: false, nullable: false + + field :name, -> { String }, optional: false, nullable: false + + field :region, -> { String }, optional: false, nullable: true + end + end +end diff --git a/sdks/ruby/lib/coss/types/scheduling_holiday_list_object.rb b/sdks/ruby/lib/coss/types/scheduling_holiday_list_object.rb new file mode 100644 index 000000000..023b4e77b --- /dev/null +++ b/sdks/ruby/lib/coss/types/scheduling_holiday_list_object.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Coss + module Types + module SchedulingHolidayListObject + extend Coss::Internal::Types::Enum + + LIST = "list" + end + end +end diff --git a/sdks/ruby/lib/coss/types/scheduling_location.rb b/sdks/ruby/lib/coss/types/scheduling_location.rb index dd367e174..4fdb97f5f 100644 --- a/sdks/ruby/lib/coss/types/scheduling_location.rb +++ b/sdks/ruby/lib/coss/types/scheduling_location.rb @@ -8,19 +8,17 @@ module Types class SchedulingLocation < Internal::Types::Model extend Coss::Internal::Types::Union - discriminant :type + member -> { Coss::Types::SchedulingLocationZero } - member -> { Coss::Types::SchedulingLocationLink }, key: "LINK" + member -> { Coss::Types::SchedulingLocationNumber } - member -> { Coss::Types::SchedulingLocationPhone }, key: "PHONE" + member -> { Coss::Types::SchedulingLocationAddress } - member -> { Coss::Types::SchedulingLocationInPerson }, key: "IN_PERSON" + member -> { Coss::Types::SchedulingLocationThree } - member -> { Coss::Types::SchedulingLocationGoogleMeet }, key: "GOOGLE_MEET" + member -> { Coss::Types::SchedulingLocationFour } - member -> { Coss::Types::SchedulingLocationMicrosoftTeams }, key: "MICROSOFT_TEAMS" - - member -> { Coss::Types::SchedulingLocationZoom }, key: "ZOOM" + member -> { Coss::Types::SchedulingLocationFive } end end end diff --git a/sdks/ruby/lib/coss/types/scheduling_location_address.rb b/sdks/ruby/lib/coss/types/scheduling_location_address.rb new file mode 100644 index 000000000..552586490 --- /dev/null +++ b/sdks/ruby/lib/coss/types/scheduling_location_address.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Coss + module Types + class SchedulingLocationAddress < Internal::Types::Model + field :type, -> { Coss::Types::SchedulingLocationAddressType }, optional: false, nullable: false + + field :address, -> { String }, optional: true, nullable: false + end + end +end diff --git a/sdks/ruby/lib/coss/types/scheduling_location_address_type.rb b/sdks/ruby/lib/coss/types/scheduling_location_address_type.rb new file mode 100644 index 000000000..be8ca1970 --- /dev/null +++ b/sdks/ruby/lib/coss/types/scheduling_location_address_type.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Coss + module Types + module SchedulingLocationAddressType + extend Coss::Internal::Types::Enum + + IN_PERSON = "in_person" + end + end +end diff --git a/sdks/ruby/lib/coss/types/scheduling_location_five.rb b/sdks/ruby/lib/coss/types/scheduling_location_five.rb new file mode 100644 index 000000000..28e1b6264 --- /dev/null +++ b/sdks/ruby/lib/coss/types/scheduling_location_five.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Coss + module Types + class SchedulingLocationFive < Internal::Types::Model + field :type, -> { Coss::Types::SchedulingLocationFiveType }, optional: false, nullable: false + + field :url, -> { String }, optional: true, nullable: false + end + end +end diff --git a/sdks/ruby/lib/coss/types/scheduling_location_five_type.rb b/sdks/ruby/lib/coss/types/scheduling_location_five_type.rb new file mode 100644 index 000000000..540535be9 --- /dev/null +++ b/sdks/ruby/lib/coss/types/scheduling_location_five_type.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Coss + module Types + module SchedulingLocationFiveType + extend Coss::Internal::Types::Enum + + ZOOM = "zoom" + end + end +end diff --git a/sdks/ruby/lib/coss/types/scheduling_location_four.rb b/sdks/ruby/lib/coss/types/scheduling_location_four.rb new file mode 100644 index 000000000..5570adea4 --- /dev/null +++ b/sdks/ruby/lib/coss/types/scheduling_location_four.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +module Coss + module Types + class SchedulingLocationFour < Internal::Types::Model + field :type, -> { Coss::Types::SchedulingLocationFourType }, optional: false, nullable: false + end + end +end diff --git a/sdks/ruby/lib/coss/types/scheduling_location_four_type.rb b/sdks/ruby/lib/coss/types/scheduling_location_four_type.rb new file mode 100644 index 000000000..3469147d8 --- /dev/null +++ b/sdks/ruby/lib/coss/types/scheduling_location_four_type.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Coss + module Types + module SchedulingLocationFourType + extend Coss::Internal::Types::Enum + + MICROSOFT_TEAMS = "microsoft_teams" + end + end +end diff --git a/sdks/ruby/lib/coss/types/scheduling_location_google_meet.rb b/sdks/ruby/lib/coss/types/scheduling_location_google_meet.rb deleted file mode 100644 index 237f13093..000000000 --- a/sdks/ruby/lib/coss/types/scheduling_location_google_meet.rb +++ /dev/null @@ -1,7 +0,0 @@ -# frozen_string_literal: true - -module Coss - module Types - class SchedulingLocationGoogleMeet < Internal::Types::Model; end - end -end diff --git a/sdks/ruby/lib/coss/types/scheduling_location_in_person.rb b/sdks/ruby/lib/coss/types/scheduling_location_in_person.rb deleted file mode 100644 index 6bd02e08a..000000000 --- a/sdks/ruby/lib/coss/types/scheduling_location_in_person.rb +++ /dev/null @@ -1,9 +0,0 @@ -# frozen_string_literal: true - -module Coss - module Types - class SchedulingLocationInPerson < Internal::Types::Model - field :address, -> { String }, optional: true, nullable: false - end - end -end diff --git a/sdks/ruby/lib/coss/types/scheduling_location_link.rb b/sdks/ruby/lib/coss/types/scheduling_location_link.rb deleted file mode 100644 index 25a9ce266..000000000 --- a/sdks/ruby/lib/coss/types/scheduling_location_link.rb +++ /dev/null @@ -1,9 +0,0 @@ -# frozen_string_literal: true - -module Coss - module Types - class SchedulingLocationLink < Internal::Types::Model - field :url, -> { String }, optional: true, nullable: false - end - end -end diff --git a/sdks/ruby/lib/coss/types/scheduling_location_microsoft_teams.rb b/sdks/ruby/lib/coss/types/scheduling_location_microsoft_teams.rb deleted file mode 100644 index c2e9c790b..000000000 --- a/sdks/ruby/lib/coss/types/scheduling_location_microsoft_teams.rb +++ /dev/null @@ -1,7 +0,0 @@ -# frozen_string_literal: true - -module Coss - module Types - class SchedulingLocationMicrosoftTeams < Internal::Types::Model; end - end -end diff --git a/sdks/ruby/lib/coss/types/scheduling_location_number.rb b/sdks/ruby/lib/coss/types/scheduling_location_number.rb new file mode 100644 index 000000000..e88dacc55 --- /dev/null +++ b/sdks/ruby/lib/coss/types/scheduling_location_number.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Coss + module Types + class SchedulingLocationNumber < Internal::Types::Model + field :type, -> { Coss::Types::SchedulingLocationNumberType }, optional: false, nullable: false + + field :number, -> { String }, optional: true, nullable: false + end + end +end diff --git a/sdks/ruby/lib/coss/types/scheduling_location_number_type.rb b/sdks/ruby/lib/coss/types/scheduling_location_number_type.rb new file mode 100644 index 000000000..0fa8acaa0 --- /dev/null +++ b/sdks/ruby/lib/coss/types/scheduling_location_number_type.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Coss + module Types + module SchedulingLocationNumberType + extend Coss::Internal::Types::Enum + + PHONE = "phone" + end + end +end diff --git a/sdks/ruby/lib/coss/types/scheduling_location_phone.rb b/sdks/ruby/lib/coss/types/scheduling_location_phone.rb deleted file mode 100644 index 66b3722ab..000000000 --- a/sdks/ruby/lib/coss/types/scheduling_location_phone.rb +++ /dev/null @@ -1,9 +0,0 @@ -# frozen_string_literal: true - -module Coss - module Types - class SchedulingLocationPhone < Internal::Types::Model - field :number, -> { String }, optional: true, nullable: false - end - end -end diff --git a/sdks/ruby/lib/coss/types/scheduling_location_three.rb b/sdks/ruby/lib/coss/types/scheduling_location_three.rb new file mode 100644 index 000000000..fc63e7569 --- /dev/null +++ b/sdks/ruby/lib/coss/types/scheduling_location_three.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +module Coss + module Types + class SchedulingLocationThree < Internal::Types::Model + field :type, -> { Coss::Types::SchedulingLocationThreeType }, optional: false, nullable: false + end + end +end diff --git a/sdks/ruby/lib/coss/types/scheduling_location_three_type.rb b/sdks/ruby/lib/coss/types/scheduling_location_three_type.rb new file mode 100644 index 000000000..94ea2455f --- /dev/null +++ b/sdks/ruby/lib/coss/types/scheduling_location_three_type.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Coss + module Types + module SchedulingLocationThreeType + extend Coss::Internal::Types::Enum + + GOOGLE_MEET = "google_meet" + end + end +end diff --git a/sdks/ruby/lib/coss/types/scheduling_location_zero.rb b/sdks/ruby/lib/coss/types/scheduling_location_zero.rb new file mode 100644 index 000000000..3309216c6 --- /dev/null +++ b/sdks/ruby/lib/coss/types/scheduling_location_zero.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Coss + module Types + class SchedulingLocationZero < Internal::Types::Model + field :type, -> { Coss::Types::SchedulingLocationZeroType }, optional: false, nullable: false + + field :url, -> { String }, optional: true, nullable: false + end + end +end diff --git a/sdks/ruby/lib/coss/types/scheduling_location_zero_type.rb b/sdks/ruby/lib/coss/types/scheduling_location_zero_type.rb new file mode 100644 index 000000000..12e383eea --- /dev/null +++ b/sdks/ruby/lib/coss/types/scheduling_location_zero_type.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Coss + module Types + module SchedulingLocationZeroType + extend Coss::Internal::Types::Enum + + LINK = "link" + end + end +end diff --git a/sdks/ruby/lib/coss/types/scheduling_location_zoom.rb b/sdks/ruby/lib/coss/types/scheduling_location_zoom.rb deleted file mode 100644 index 59e0f45b6..000000000 --- a/sdks/ruby/lib/coss/types/scheduling_location_zoom.rb +++ /dev/null @@ -1,9 +0,0 @@ -# frozen_string_literal: true - -module Coss - module Types - class SchedulingLocationZoom < Internal::Types::Model - field :url, -> { String }, optional: true, nullable: false - end - end -end diff --git a/sdks/ruby/lib/coss/types/scheduling_oauth_app.rb b/sdks/ruby/lib/coss/types/scheduling_oauth_app.rb new file mode 100644 index 000000000..329814346 --- /dev/null +++ b/sdks/ruby/lib/coss/types/scheduling_oauth_app.rb @@ -0,0 +1,43 @@ +# frozen_string_literal: true + +module Coss + module Types + class SchedulingOauthApp < Internal::Types::Model + field :object, -> { Coss::Types::SchedulingOauthAppObject }, optional: false, nullable: false + + field :id, -> { String }, optional: false, nullable: false + + field :provider, -> { Coss::Types::SchedulingOauthAppProvider }, optional: false, nullable: false + + field :client_id, -> { String }, optional: false, nullable: false + + field :tenant_id, -> { String }, optional: false, nullable: true + + field :redirect_uri, -> { String }, optional: false, nullable: true + + field :coss_callback_url, -> { String }, optional: false, nullable: false + + field :completion_url, -> { String }, optional: false, nullable: true + + field :zoom_event_url, -> { String }, optional: false, nullable: true + + field :scopes, -> { Internal::Types::Array[String] }, optional: false, nullable: false + + field :status, -> { Coss::Types::SchedulingOauthAppStatus }, optional: false, nullable: false + + field :last_error_code, -> { String }, optional: false, nullable: true + + field :last_error_at, -> { String }, optional: false, nullable: true + + field :secret_expires_at, -> { String }, optional: false, nullable: true + + field :verified_at, -> { String }, optional: false, nullable: true + + field :connections, -> { Integer }, optional: false, nullable: false + + field :created_at, -> { String }, optional: false, nullable: false + + field :updated_at, -> { String }, optional: false, nullable: false + end + end +end diff --git a/sdks/ruby/lib/coss/types/scheduling_oauth_app_list.rb b/sdks/ruby/lib/coss/types/scheduling_oauth_app_list.rb new file mode 100644 index 000000000..f5ebe935c --- /dev/null +++ b/sdks/ruby/lib/coss/types/scheduling_oauth_app_list.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Coss + module Types + class SchedulingOauthAppList < Internal::Types::Model + field :object, -> { Coss::Types::SchedulingOauthAppListObject }, optional: false, nullable: false + + field :data, -> { Internal::Types::Array[Coss::Types::SchedulingOauthApp] }, optional: false, nullable: false + + field :has_more, -> { Internal::Types::Boolean }, optional: false, nullable: false + end + end +end diff --git a/sdks/ruby/lib/coss/types/scheduling_oauth_app_list_object.rb b/sdks/ruby/lib/coss/types/scheduling_oauth_app_list_object.rb new file mode 100644 index 000000000..fc0b3a3ac --- /dev/null +++ b/sdks/ruby/lib/coss/types/scheduling_oauth_app_list_object.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Coss + module Types + module SchedulingOauthAppListObject + extend Coss::Internal::Types::Enum + + LIST = "list" + end + end +end diff --git a/sdks/ruby/lib/coss/types/scheduling_oauth_app_object.rb b/sdks/ruby/lib/coss/types/scheduling_oauth_app_object.rb new file mode 100644 index 000000000..8f496b528 --- /dev/null +++ b/sdks/ruby/lib/coss/types/scheduling_oauth_app_object.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Coss + module Types + module SchedulingOauthAppObject + extend Coss::Internal::Types::Enum + + SCHEDULING_OAUTH_APP = "scheduling.oauth_app" + end + end +end diff --git a/sdks/ruby/lib/coss/types/scheduling_oauth_app_provider.rb b/sdks/ruby/lib/coss/types/scheduling_oauth_app_provider.rb new file mode 100644 index 000000000..ebfe1c5d6 --- /dev/null +++ b/sdks/ruby/lib/coss/types/scheduling_oauth_app_provider.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Coss + module Types + module SchedulingOauthAppProvider + extend Coss::Internal::Types::Enum + + GOOGLE = "google" + MICROSOFT = "microsoft" + ZOOM = "zoom" + end + end +end diff --git a/sdks/ruby/lib/coss/types/scheduling_oauth_app_status.rb b/sdks/ruby/lib/coss/types/scheduling_oauth_app_status.rb new file mode 100644 index 000000000..27c666dac --- /dev/null +++ b/sdks/ruby/lib/coss/types/scheduling_oauth_app_status.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Coss + module Types + module SchedulingOauthAppStatus + extend Coss::Internal::Types::Enum + + ACTIVE = "active" + FAILING = "failing" + end + end +end diff --git a/sdks/ruby/lib/coss/types/scheduling_oauth_app_webhook_event.rb b/sdks/ruby/lib/coss/types/scheduling_oauth_app_webhook_event.rb new file mode 100644 index 000000000..c7381b72f --- /dev/null +++ b/sdks/ruby/lib/coss/types/scheduling_oauth_app_webhook_event.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +module Coss + module Types + class SchedulingOauthAppWebhookEvent < Internal::Types::Model + field :id, -> { String }, optional: false, nullable: false + + field :object, -> { Coss::Types::SchedulingOauthAppWebhookEventObject }, optional: false, nullable: false + + field :api_version, -> { String }, optional: false, nullable: false + + field :created_at, -> { String }, optional: false, nullable: false + + field :type, -> { Coss::Types::SchedulingOauthAppWebhookEventType }, optional: false, nullable: false + + field :data, -> { Coss::Types::SchedulingOauthAppWebhookEventData }, optional: false, nullable: false + end + end +end diff --git a/sdks/ruby/lib/coss/types/scheduling_oauth_app_webhook_event_data.rb b/sdks/ruby/lib/coss/types/scheduling_oauth_app_webhook_event_data.rb new file mode 100644 index 000000000..2d817cf31 --- /dev/null +++ b/sdks/ruby/lib/coss/types/scheduling_oauth_app_webhook_event_data.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +module Coss + module Types + class SchedulingOauthAppWebhookEventData < Internal::Types::Model + field :oauth_app_id, -> { String }, optional: false, nullable: false + + field :provider, -> { String }, optional: false, nullable: false + + field :code, -> { String }, optional: false, nullable: true + + field :occurred_at, -> { String }, optional: false, nullable: false + end + end +end diff --git a/sdks/ruby/lib/coss/types/scheduling_oauth_app_webhook_event_object.rb b/sdks/ruby/lib/coss/types/scheduling_oauth_app_webhook_event_object.rb new file mode 100644 index 000000000..ceb02c0b2 --- /dev/null +++ b/sdks/ruby/lib/coss/types/scheduling_oauth_app_webhook_event_object.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Coss + module Types + module SchedulingOauthAppWebhookEventObject + extend Coss::Internal::Types::Enum + + EVENT = "event" + end + end +end diff --git a/sdks/ruby/lib/coss/types/scheduling_oauth_app_webhook_event_type.rb b/sdks/ruby/lib/coss/types/scheduling_oauth_app_webhook_event_type.rb new file mode 100644 index 000000000..988481723 --- /dev/null +++ b/sdks/ruby/lib/coss/types/scheduling_oauth_app_webhook_event_type.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Coss + module Types + module SchedulingOauthAppWebhookEventType + extend Coss::Internal::Types::Enum + + SCHEDULING_OAUTH_APP_FAILING = "scheduling.oauth_app.failing" + SCHEDULING_OAUTH_APP_RESTORED = "scheduling.oauth_app.restored" + end + end +end diff --git a/sdks/ruby/lib/coss/types/scheduling_out_of_office.rb b/sdks/ruby/lib/coss/types/scheduling_out_of_office.rb new file mode 100644 index 000000000..c6c84ec85 --- /dev/null +++ b/sdks/ruby/lib/coss/types/scheduling_out_of_office.rb @@ -0,0 +1,41 @@ +# frozen_string_literal: true + +module Coss + module Types + class SchedulingOutOfOffice < Internal::Types::Model + field :object, -> { Coss::Types::SchedulingOutOfOfficeObject }, optional: false, nullable: false + + field :id, -> { String }, optional: false, nullable: false + + field :host, -> { String }, optional: false, nullable: false + + field :start, -> { String }, optional: false, nullable: false + + field :end_, -> { String }, optional: false, nullable: false, api_name: "end" + + field :all_day, -> { Coss::Types::SchedulingOutOfOfficeAllDay }, optional: false, nullable: true + + field :reason, -> { String }, optional: false, nullable: false + + field :notes, -> { String }, optional: false, nullable: true + + field :public_message, -> { String }, optional: false, nullable: true + + field :show_on_calendar, -> { Internal::Types::Boolean }, optional: false, nullable: false + + field :delegates, -> { Internal::Types::Array[String] }, optional: false, nullable: false + + field :existing_bookings, -> { Coss::Types::SchedulingOutOfOfficeExistingBookings }, optional: false, nullable: false + + field :external_id, -> { String }, optional: false, nullable: true + + field :group, -> { String }, optional: false, nullable: true + + field :source, -> { Coss::Types::SchedulingOutOfOfficeSource }, optional: false, nullable: false + + field :created_at, -> { String }, optional: false, nullable: false + + field :updated_at, -> { String }, optional: false, nullable: false + end + end +end diff --git a/sdks/ruby/lib/coss/types/scheduling_out_of_office_all_day.rb b/sdks/ruby/lib/coss/types/scheduling_out_of_office_all_day.rb new file mode 100644 index 000000000..260917ca1 --- /dev/null +++ b/sdks/ruby/lib/coss/types/scheduling_out_of_office_all_day.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +module Coss + module Types + # How it was given, when it was as whole dates. + class SchedulingOutOfOfficeAllDay < Internal::Types::Model + field :start_date, -> { String }, optional: false, nullable: false + + field :end_date, -> { String }, optional: false, nullable: false + + field :time_zone, -> { String }, optional: false, nullable: false + end + end +end diff --git a/sdks/ruby/lib/coss/types/scheduling_out_of_office_conflict.rb b/sdks/ruby/lib/coss/types/scheduling_out_of_office_conflict.rb new file mode 100644 index 000000000..0ef2fe30b --- /dev/null +++ b/sdks/ruby/lib/coss/types/scheduling_out_of_office_conflict.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +module Coss + module Types + class SchedulingOutOfOfficeConflict < Internal::Types::Model + field :object, -> { Coss::Types::SchedulingOutOfOfficeConflictObject }, optional: false, nullable: false + + field :booking, -> { String }, optional: false, nullable: false + + field :event_type, -> { String }, optional: false, nullable: false + + field :title, -> { String }, optional: false, nullable: false + + field :status, -> { Coss::Types::SchedulingOutOfOfficeConflictStatus }, optional: false, nullable: false + + field :start, -> { String }, optional: false, nullable: false + + field :end_, -> { String }, optional: false, nullable: false, api_name: "end" + + field :series, -> { String }, optional: false, nullable: true + + field :group_session, -> { String }, optional: false, nullable: true + end + end +end diff --git a/sdks/ruby/lib/coss/types/scheduling_out_of_office_conflict_list.rb b/sdks/ruby/lib/coss/types/scheduling_out_of_office_conflict_list.rb new file mode 100644 index 000000000..5c4353802 --- /dev/null +++ b/sdks/ruby/lib/coss/types/scheduling_out_of_office_conflict_list.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Coss + module Types + class SchedulingOutOfOfficeConflictList < Internal::Types::Model + field :object, -> { Coss::Types::SchedulingOutOfOfficeConflictListObject }, optional: false, nullable: false + + field :data, -> { Internal::Types::Array[Coss::Types::SchedulingOutOfOfficeConflict] }, optional: false, nullable: false + + field :has_more, -> { Internal::Types::Boolean }, optional: false, nullable: false + end + end +end diff --git a/sdks/ruby/lib/coss/types/scheduling_out_of_office_conflict_list_object.rb b/sdks/ruby/lib/coss/types/scheduling_out_of_office_conflict_list_object.rb new file mode 100644 index 000000000..c7fce8cde --- /dev/null +++ b/sdks/ruby/lib/coss/types/scheduling_out_of_office_conflict_list_object.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Coss + module Types + module SchedulingOutOfOfficeConflictListObject + extend Coss::Internal::Types::Enum + + LIST = "list" + end + end +end diff --git a/sdks/ruby/lib/coss/types/scheduling_out_of_office_conflict_object.rb b/sdks/ruby/lib/coss/types/scheduling_out_of_office_conflict_object.rb new file mode 100644 index 000000000..10378f400 --- /dev/null +++ b/sdks/ruby/lib/coss/types/scheduling_out_of_office_conflict_object.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Coss + module Types + module SchedulingOutOfOfficeConflictObject + extend Coss::Internal::Types::Enum + + SCHEDULING_OUT_OF_OFFICE_CONFLICT = "scheduling.out_of_office_conflict" + end + end +end diff --git a/sdks/ruby/lib/coss/types/scheduling_out_of_office_conflict_status.rb b/sdks/ruby/lib/coss/types/scheduling_out_of_office_conflict_status.rb new file mode 100644 index 000000000..7851feb75 --- /dev/null +++ b/sdks/ruby/lib/coss/types/scheduling_out_of_office_conflict_status.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +module Coss + module Types + module SchedulingOutOfOfficeConflictStatus + extend Coss::Internal::Types::Enum + + HELD = "held" + PENDING_APPROVAL = "pending_approval" + CONFIRMED = "confirmed" + CANCELLED = "cancelled" + DECLINED = "declined" + end + end +end diff --git a/sdks/ruby/lib/coss/types/scheduling_out_of_office_existing_bookings.rb b/sdks/ruby/lib/coss/types/scheduling_out_of_office_existing_bookings.rb new file mode 100644 index 000000000..32ad273fa --- /dev/null +++ b/sdks/ruby/lib/coss/types/scheduling_out_of_office_existing_bookings.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Coss + module Types + module SchedulingOutOfOfficeExistingBookings + extend Coss::Internal::Types::Enum + + LEAVE = "leave" + REASSIGN = "reassign" + end + end +end diff --git a/sdks/ruby/lib/coss/types/scheduling_out_of_office_list.rb b/sdks/ruby/lib/coss/types/scheduling_out_of_office_list.rb new file mode 100644 index 000000000..f937ebffc --- /dev/null +++ b/sdks/ruby/lib/coss/types/scheduling_out_of_office_list.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Coss + module Types + class SchedulingOutOfOfficeList < Internal::Types::Model + field :object, -> { Coss::Types::SchedulingOutOfOfficeListObject }, optional: false, nullable: false + + field :data, -> { Internal::Types::Array[Coss::Types::SchedulingOutOfOffice] }, optional: false, nullable: false + + field :has_more, -> { Internal::Types::Boolean }, optional: false, nullable: false + end + end +end diff --git a/sdks/ruby/lib/coss/types/scheduling_out_of_office_list_object.rb b/sdks/ruby/lib/coss/types/scheduling_out_of_office_list_object.rb new file mode 100644 index 000000000..240454aa9 --- /dev/null +++ b/sdks/ruby/lib/coss/types/scheduling_out_of_office_list_object.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Coss + module Types + module SchedulingOutOfOfficeListObject + extend Coss::Internal::Types::Enum + + LIST = "list" + end + end +end diff --git a/sdks/ruby/lib/coss/types/scheduling_out_of_office_object.rb b/sdks/ruby/lib/coss/types/scheduling_out_of_office_object.rb new file mode 100644 index 000000000..a4f622ce5 --- /dev/null +++ b/sdks/ruby/lib/coss/types/scheduling_out_of_office_object.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Coss + module Types + module SchedulingOutOfOfficeObject + extend Coss::Internal::Types::Enum + + SCHEDULING_OUT_OF_OFFICE = "scheduling.out_of_office" + end + end +end diff --git a/sdks/ruby/lib/coss/types/scheduling_out_of_office_source.rb b/sdks/ruby/lib/coss/types/scheduling_out_of_office_source.rb new file mode 100644 index 000000000..a1e2cdc89 --- /dev/null +++ b/sdks/ruby/lib/coss/types/scheduling_out_of_office_source.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +module Coss + module Types + module SchedulingOutOfOfficeSource + extend Coss::Internal::Types::Enum + + API = "api" + HOST = "host" + MANAGER = "manager" + DASHBOARD = "dashboard" + HOLIDAY = "holiday" + end + end +end diff --git a/sdks/ruby/lib/coss/types/scheduling_out_of_office_webhook_event.rb b/sdks/ruby/lib/coss/types/scheduling_out_of_office_webhook_event.rb new file mode 100644 index 000000000..fde0a9b51 --- /dev/null +++ b/sdks/ruby/lib/coss/types/scheduling_out_of_office_webhook_event.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +module Coss + module Types + class SchedulingOutOfOfficeWebhookEvent < Internal::Types::Model + field :id, -> { String }, optional: false, nullable: false + + field :object, -> { Coss::Types::SchedulingOutOfOfficeWebhookEventObject }, optional: false, nullable: false + + field :api_version, -> { String }, optional: false, nullable: false + + field :created_at, -> { String }, optional: false, nullable: false + + field :type, -> { Coss::Types::SchedulingOutOfOfficeWebhookEventType }, optional: false, nullable: false + + field :data, -> { Coss::Types::SchedulingOutOfOfficeWebhookEventData }, optional: false, nullable: false + end + end +end diff --git a/sdks/ruby/lib/coss/types/scheduling_out_of_office_webhook_event_data.rb b/sdks/ruby/lib/coss/types/scheduling_out_of_office_webhook_event_data.rb new file mode 100644 index 000000000..98883f798 --- /dev/null +++ b/sdks/ruby/lib/coss/types/scheduling_out_of_office_webhook_event_data.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +module Coss + module Types + class SchedulingOutOfOfficeWebhookEventData < Internal::Types::Model + field :out_of_office_id, -> { String }, optional: false, nullable: false + + field :host_id, -> { String }, optional: false, nullable: false + + field :start, -> { String }, optional: false, nullable: false + + field :end_, -> { String }, optional: false, nullable: false, api_name: "end" + + field :group, -> { String }, optional: false, nullable: true + + field :occurred_at, -> { String }, optional: false, nullable: false + end + end +end diff --git a/sdks/ruby/lib/coss/types/scheduling_out_of_office_webhook_event_object.rb b/sdks/ruby/lib/coss/types/scheduling_out_of_office_webhook_event_object.rb new file mode 100644 index 000000000..fcad90773 --- /dev/null +++ b/sdks/ruby/lib/coss/types/scheduling_out_of_office_webhook_event_object.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Coss + module Types + module SchedulingOutOfOfficeWebhookEventObject + extend Coss::Internal::Types::Enum + + EVENT = "event" + end + end +end diff --git a/sdks/ruby/lib/coss/types/scheduling_out_of_office_webhook_event_type.rb b/sdks/ruby/lib/coss/types/scheduling_out_of_office_webhook_event_type.rb new file mode 100644 index 000000000..71a6e53ab --- /dev/null +++ b/sdks/ruby/lib/coss/types/scheduling_out_of_office_webhook_event_type.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +module Coss + module Types + module SchedulingOutOfOfficeWebhookEventType + extend Coss::Internal::Types::Enum + + SCHEDULING_OUT_OF_OFFICE_CREATED = "scheduling.out_of_office.created" + SCHEDULING_OUT_OF_OFFICE_UPDATED = "scheduling.out_of_office.updated" + SCHEDULING_OUT_OF_OFFICE_DELETED = "scheduling.out_of_office.deleted" + SCHEDULING_OUT_OF_OFFICE_STARTED = "scheduling.out_of_office.started" + SCHEDULING_OUT_OF_OFFICE_ENDED = "scheduling.out_of_office.ended" + end + end +end diff --git a/sdks/ruby/lib/coss/types/scheduling_reassign_candidate.rb b/sdks/ruby/lib/coss/types/scheduling_reassign_candidate.rb new file mode 100644 index 000000000..1e1293508 --- /dev/null +++ b/sdks/ruby/lib/coss/types/scheduling_reassign_candidate.rb @@ -0,0 +1,29 @@ +# frozen_string_literal: true + +module Coss + module Types + class SchedulingReassignCandidate < Internal::Types::Model + field :object, -> { Coss::Types::SchedulingReassignCandidateObject }, optional: false, nullable: false + + field :host, -> { String }, optional: false, nullable: false + + field :uid, -> { String }, optional: false, nullable: true + + field :name, -> { String }, optional: false, nullable: false + + field :member, -> { Internal::Types::Boolean }, optional: false, nullable: false + + field :available, -> { Internal::Types::Boolean }, optional: false, nullable: false + + field :reason, -> { String }, optional: false, nullable: true + + field :reasons, -> { Internal::Types::Array[String] }, optional: false, nullable: false + + field :load, -> { Integer }, optional: false, nullable: false + + field :rank, -> { Integer }, optional: false, nullable: true + + field :meeting_provider_missing, -> { Internal::Types::Boolean }, optional: false, nullable: false + end + end +end diff --git a/sdks/ruby/lib/coss/types/scheduling_reassign_candidate_list.rb b/sdks/ruby/lib/coss/types/scheduling_reassign_candidate_list.rb new file mode 100644 index 000000000..1b9ffa6de --- /dev/null +++ b/sdks/ruby/lib/coss/types/scheduling_reassign_candidate_list.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Coss + module Types + class SchedulingReassignCandidateList < Internal::Types::Model + field :object, -> { Coss::Types::SchedulingReassignCandidateListObject }, optional: false, nullable: false + + field :data, -> { Internal::Types::Array[Coss::Types::SchedulingReassignCandidate] }, optional: false, nullable: false + + field :has_more, -> { Internal::Types::Boolean }, optional: false, nullable: false + end + end +end diff --git a/sdks/ruby/lib/coss/types/scheduling_reassign_candidate_list_object.rb b/sdks/ruby/lib/coss/types/scheduling_reassign_candidate_list_object.rb new file mode 100644 index 000000000..2ef680417 --- /dev/null +++ b/sdks/ruby/lib/coss/types/scheduling_reassign_candidate_list_object.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Coss + module Types + module SchedulingReassignCandidateListObject + extend Coss::Internal::Types::Enum + + LIST = "list" + end + end +end diff --git a/sdks/ruby/lib/coss/types/scheduling_reassign_candidate_object.rb b/sdks/ruby/lib/coss/types/scheduling_reassign_candidate_object.rb new file mode 100644 index 000000000..72c34ffe7 --- /dev/null +++ b/sdks/ruby/lib/coss/types/scheduling_reassign_candidate_object.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Coss + module Types + module SchedulingReassignCandidateObject + extend Coss::Internal::Types::Enum + + SCHEDULING_REASSIGN_CANDIDATE = "scheduling.reassign_candidate" + end + end +end diff --git a/sdks/ruby/lib/coss/types/scheduling_reassignment.rb b/sdks/ruby/lib/coss/types/scheduling_reassignment.rb new file mode 100644 index 000000000..5d7e3c411 --- /dev/null +++ b/sdks/ruby/lib/coss/types/scheduling_reassignment.rb @@ -0,0 +1,27 @@ +# frozen_string_literal: true + +module Coss + module Types + class SchedulingReassignment < Internal::Types::Model + field :object, -> { Coss::Types::SchedulingReassignmentObject }, optional: false, nullable: false + + field :id, -> { String }, optional: false, nullable: false + + field :status, -> { Coss::Types::SchedulingReassignmentStatus }, optional: false, nullable: false + + field :reason_code, -> { Coss::Types::SchedulingReassignmentReasonCode }, optional: false, nullable: false + + field :out_of_office, -> { String }, optional: false, nullable: true + + field :undo_of, -> { String }, optional: false, nullable: true + + field :counts, -> { Coss::Types::SchedulingReassignmentCounts }, optional: false, nullable: false + + field :created_at, -> { String }, optional: false, nullable: false + + field :started_at, -> { String }, optional: false, nullable: true + + field :finished_at, -> { String }, optional: false, nullable: true + end + end +end diff --git a/sdks/ruby/lib/coss/types/scheduling_reassignment_counts.rb b/sdks/ruby/lib/coss/types/scheduling_reassignment_counts.rb new file mode 100644 index 000000000..8c411523f --- /dev/null +++ b/sdks/ruby/lib/coss/types/scheduling_reassignment_counts.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +module Coss + module Types + class SchedulingReassignmentCounts < Internal::Types::Model + field :total, -> { Integer }, optional: false, nullable: false + + field :pending, -> { Integer }, optional: false, nullable: false + + field :reassigned, -> { Integer }, optional: false, nullable: false + + field :skipped, -> { Integer }, optional: false, nullable: false + + field :no_candidate, -> { Integer }, optional: false, nullable: false + + field :failed, -> { Integer }, optional: false, nullable: false + + field :cancelled, -> { Integer }, optional: false, nullable: false + end + end +end diff --git a/sdks/ruby/lib/coss/types/scheduling_reassignment_item.rb b/sdks/ruby/lib/coss/types/scheduling_reassignment_item.rb new file mode 100644 index 000000000..c243f21b3 --- /dev/null +++ b/sdks/ruby/lib/coss/types/scheduling_reassignment_item.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +module Coss + module Types + class SchedulingReassignmentItem < Internal::Types::Model + field :object, -> { Coss::Types::SchedulingReassignmentItemObject }, optional: false, nullable: false + + field :id, -> { String }, optional: false, nullable: false + + field :booking, -> { String }, optional: false, nullable: false + + field :from_host, -> { String }, optional: false, nullable: true + + field :to_host, -> { String }, optional: false, nullable: true + + field :outcome, -> { Coss::Types::SchedulingReassignmentItemOutcome }, optional: false, nullable: false + + field :error_code, -> { String }, optional: false, nullable: true + end + end +end diff --git a/sdks/ruby/lib/coss/types/scheduling_reassignment_item_list.rb b/sdks/ruby/lib/coss/types/scheduling_reassignment_item_list.rb new file mode 100644 index 000000000..9af0be8b3 --- /dev/null +++ b/sdks/ruby/lib/coss/types/scheduling_reassignment_item_list.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Coss + module Types + class SchedulingReassignmentItemList < Internal::Types::Model + field :object, -> { Coss::Types::SchedulingReassignmentItemListObject }, optional: false, nullable: false + + field :data, -> { Internal::Types::Array[Coss::Types::SchedulingReassignmentItem] }, optional: false, nullable: false + + field :has_more, -> { Internal::Types::Boolean }, optional: false, nullable: false + end + end +end diff --git a/sdks/ruby/lib/coss/types/scheduling_reassignment_item_list_object.rb b/sdks/ruby/lib/coss/types/scheduling_reassignment_item_list_object.rb new file mode 100644 index 000000000..c77304257 --- /dev/null +++ b/sdks/ruby/lib/coss/types/scheduling_reassignment_item_list_object.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Coss + module Types + module SchedulingReassignmentItemListObject + extend Coss::Internal::Types::Enum + + LIST = "list" + end + end +end diff --git a/sdks/ruby/lib/coss/types/scheduling_reassignment_item_object.rb b/sdks/ruby/lib/coss/types/scheduling_reassignment_item_object.rb new file mode 100644 index 000000000..07323866f --- /dev/null +++ b/sdks/ruby/lib/coss/types/scheduling_reassignment_item_object.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Coss + module Types + module SchedulingReassignmentItemObject + extend Coss::Internal::Types::Enum + + SCHEDULING_REASSIGNMENT_ITEM = "scheduling.reassignment_item" + end + end +end diff --git a/sdks/ruby/lib/coss/types/scheduling_reassignment_item_outcome.rb b/sdks/ruby/lib/coss/types/scheduling_reassignment_item_outcome.rb new file mode 100644 index 000000000..9de3ce713 --- /dev/null +++ b/sdks/ruby/lib/coss/types/scheduling_reassignment_item_outcome.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +module Coss + module Types + module SchedulingReassignmentItemOutcome + extend Coss::Internal::Types::Enum + + PENDING = "pending" + REASSIGNED = "reassigned" + SKIPPED_CHANGED = "skipped_changed" + NO_CANDIDATE = "no_candidate" + FAILED = "failed" + CANCELLED = "cancelled" + end + end +end diff --git a/sdks/ruby/lib/coss/types/scheduling_reassignment_list.rb b/sdks/ruby/lib/coss/types/scheduling_reassignment_list.rb new file mode 100644 index 000000000..4cf1c7358 --- /dev/null +++ b/sdks/ruby/lib/coss/types/scheduling_reassignment_list.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Coss + module Types + class SchedulingReassignmentList < Internal::Types::Model + field :object, -> { Coss::Types::SchedulingReassignmentListObject }, optional: false, nullable: false + + field :data, -> { Internal::Types::Array[Coss::Types::SchedulingReassignment] }, optional: false, nullable: false + + field :has_more, -> { Internal::Types::Boolean }, optional: false, nullable: false + end + end +end diff --git a/sdks/ruby/lib/coss/types/scheduling_reassignment_list_object.rb b/sdks/ruby/lib/coss/types/scheduling_reassignment_list_object.rb new file mode 100644 index 000000000..631165a4d --- /dev/null +++ b/sdks/ruby/lib/coss/types/scheduling_reassignment_list_object.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Coss + module Types + module SchedulingReassignmentListObject + extend Coss::Internal::Types::Enum + + LIST = "list" + end + end +end diff --git a/sdks/ruby/lib/coss/types/scheduling_reassignment_object.rb b/sdks/ruby/lib/coss/types/scheduling_reassignment_object.rb new file mode 100644 index 000000000..495803953 --- /dev/null +++ b/sdks/ruby/lib/coss/types/scheduling_reassignment_object.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Coss + module Types + module SchedulingReassignmentObject + extend Coss::Internal::Types::Enum + + SCHEDULING_REASSIGNMENT = "scheduling.reassignment" + end + end +end diff --git a/sdks/ruby/lib/coss/types/scheduling_reassignment_preview.rb b/sdks/ruby/lib/coss/types/scheduling_reassignment_preview.rb new file mode 100644 index 000000000..277930ce6 --- /dev/null +++ b/sdks/ruby/lib/coss/types/scheduling_reassignment_preview.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Coss + module Types + class SchedulingReassignmentPreview < Internal::Types::Model + field :object, -> { Coss::Types::SchedulingReassignmentPreviewObject }, optional: false, nullable: false + + field :items, -> { Internal::Types::Array[Coss::Types::SchedulingReassignmentPreviewItemsItem] }, optional: false, nullable: false + + field :truncated, -> { Internal::Types::Boolean }, optional: false, nullable: false + end + end +end diff --git a/sdks/ruby/lib/coss/types/scheduling_reassignment_preview_items_item.rb b/sdks/ruby/lib/coss/types/scheduling_reassignment_preview_items_item.rb new file mode 100644 index 000000000..e4c7cabdc --- /dev/null +++ b/sdks/ruby/lib/coss/types/scheduling_reassignment_preview_items_item.rb @@ -0,0 +1,29 @@ +# frozen_string_literal: true + +module Coss + module Types + class SchedulingReassignmentPreviewItemsItem < Internal::Types::Model + field :booking, -> { String }, optional: false, nullable: false + + field :event_type, -> { String }, optional: false, nullable: false + + field :title, -> { String }, optional: false, nullable: false + + field :status, -> { Coss::Types::SchedulingReassignmentPreviewItemsItemStatus }, optional: false, nullable: false + + field :start, -> { String }, optional: false, nullable: false + + field :end_, -> { String }, optional: false, nullable: false, api_name: "end" + + field :series, -> { String }, optional: false, nullable: true + + field :group_session, -> { String }, optional: false, nullable: true + + field :from_host, -> { String }, optional: false, nullable: true + + field :to_host, -> { String }, optional: false, nullable: true + + field :reason, -> { String }, optional: false, nullable: true + end + end +end diff --git a/sdks/ruby/lib/coss/types/scheduling_reassignment_preview_items_item_status.rb b/sdks/ruby/lib/coss/types/scheduling_reassignment_preview_items_item_status.rb new file mode 100644 index 000000000..72da512a3 --- /dev/null +++ b/sdks/ruby/lib/coss/types/scheduling_reassignment_preview_items_item_status.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +module Coss + module Types + module SchedulingReassignmentPreviewItemsItemStatus + extend Coss::Internal::Types::Enum + + HELD = "held" + PENDING_APPROVAL = "pending_approval" + CONFIRMED = "confirmed" + CANCELLED = "cancelled" + DECLINED = "declined" + end + end +end diff --git a/sdks/ruby/lib/coss/types/scheduling_reassignment_preview_object.rb b/sdks/ruby/lib/coss/types/scheduling_reassignment_preview_object.rb new file mode 100644 index 000000000..7a9a540e9 --- /dev/null +++ b/sdks/ruby/lib/coss/types/scheduling_reassignment_preview_object.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Coss + module Types + module SchedulingReassignmentPreviewObject + extend Coss::Internal::Types::Enum + + SCHEDULING_REASSIGNMENT_PREVIEW = "scheduling.reassignment_preview" + end + end +end diff --git a/sdks/ruby/lib/coss/types/scheduling_reassignment_reason_code.rb b/sdks/ruby/lib/coss/types/scheduling_reassignment_reason_code.rb new file mode 100644 index 000000000..e6f4ee056 --- /dev/null +++ b/sdks/ruby/lib/coss/types/scheduling_reassignment_reason_code.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +module Coss + module Types + module SchedulingReassignmentReasonCode + extend Coss::Internal::Types::Enum + + HOST_UNAVAILABLE = "host_unavailable" + OUT_OF_OFFICE = "out_of_office" + WORKLOAD = "workload" + CUSTOMER_REQUEST = "customer_request" + OFFBOARDING = "offboarding" + OTHER = "other" + end + end +end diff --git a/sdks/ruby/lib/coss/types/scheduling_reassignment_selection.rb b/sdks/ruby/lib/coss/types/scheduling_reassignment_selection.rb new file mode 100644 index 000000000..953996f36 --- /dev/null +++ b/sdks/ruby/lib/coss/types/scheduling_reassignment_selection.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true + +module Coss + module Types + class SchedulingReassignmentSelection < Internal::Types::Model + field :host, -> { String }, optional: true, nullable: false + + field :out_of_office, -> { String }, optional: true, nullable: false + + field :booking_ids, -> { Internal::Types::Array[String] }, optional: true, nullable: false + + field :series, -> { String }, optional: true, nullable: false + + field :start_after, -> { String }, optional: true, nullable: false + + field :start_before, -> { String }, optional: true, nullable: false + + field :event_types, -> { Internal::Types::Array[String] }, optional: true, nullable: false + + field :external_conflict, -> { Internal::Types::Boolean }, optional: true, nullable: false + end + end +end diff --git a/sdks/ruby/lib/coss/types/scheduling_reassignment_status.rb b/sdks/ruby/lib/coss/types/scheduling_reassignment_status.rb new file mode 100644 index 000000000..b0d3ec263 --- /dev/null +++ b/sdks/ruby/lib/coss/types/scheduling_reassignment_status.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +module Coss + module Types + module SchedulingReassignmentStatus + extend Coss::Internal::Types::Enum + + PENDING = "pending" + RUNNING = "running" + COMPLETED = "completed" + CANCELLED = "cancelled" + end + end +end diff --git a/sdks/ruby/lib/coss/types/scheduling_reassignment_strategy.rb b/sdks/ruby/lib/coss/types/scheduling_reassignment_strategy.rb new file mode 100644 index 000000000..d7944c644 --- /dev/null +++ b/sdks/ruby/lib/coss/types/scheduling_reassignment_strategy.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +module Coss + module Types + class SchedulingReassignmentStrategy < Internal::Types::Model + field :to_host, -> { String }, optional: true, nullable: false + + field :preferred_hosts, -> { Internal::Types::Array[String] }, optional: true, nullable: false + + field :otherwise, -> { Coss::Types::SchedulingReassignmentStrategyOtherwise }, optional: true, nullable: false + + field :assignments, -> { Internal::Types::Array[Coss::Types::SchedulingReassignmentStrategyAssignmentsItem] }, optional: true, nullable: false + end + end +end diff --git a/sdks/ruby/lib/coss/types/scheduling_reassignment_strategy_assignments_item.rb b/sdks/ruby/lib/coss/types/scheduling_reassignment_strategy_assignments_item.rb new file mode 100644 index 000000000..a9ea47a8b --- /dev/null +++ b/sdks/ruby/lib/coss/types/scheduling_reassignment_strategy_assignments_item.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Coss + module Types + class SchedulingReassignmentStrategyAssignmentsItem < Internal::Types::Model + field :booking, -> { String }, optional: false, nullable: false + + field :to_host, -> { String }, optional: false, nullable: false + + field :from_host, -> { String }, optional: true, nullable: false + end + end +end diff --git a/sdks/ruby/lib/coss/types/scheduling_reassignment_strategy_otherwise.rb b/sdks/ruby/lib/coss/types/scheduling_reassignment_strategy_otherwise.rb new file mode 100644 index 000000000..3308c4f03 --- /dev/null +++ b/sdks/ruby/lib/coss/types/scheduling_reassignment_strategy_otherwise.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Coss + module Types + module SchedulingReassignmentStrategyOtherwise + extend Coss::Internal::Types::Enum + + AUTO = "auto" + LEAVE = "leave" + end + end +end diff --git a/sdks/ruby/lib/coss/types/scheduling_reassignment_webhook_event.rb b/sdks/ruby/lib/coss/types/scheduling_reassignment_webhook_event.rb new file mode 100644 index 000000000..ad89a43d3 --- /dev/null +++ b/sdks/ruby/lib/coss/types/scheduling_reassignment_webhook_event.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +module Coss + module Types + class SchedulingReassignmentWebhookEvent < Internal::Types::Model + field :id, -> { String }, optional: false, nullable: false + + field :object, -> { Coss::Types::SchedulingReassignmentWebhookEventObject }, optional: false, nullable: false + + field :api_version, -> { String }, optional: false, nullable: false + + field :created_at, -> { String }, optional: false, nullable: false + + field :type, -> { Coss::Types::SchedulingReassignmentWebhookEventType }, optional: false, nullable: false + + field :data, -> { Coss::Types::SchedulingReassignmentWebhookEventData }, optional: false, nullable: false + end + end +end diff --git a/sdks/ruby/lib/coss/types/scheduling_reassignment_webhook_event_data.rb b/sdks/ruby/lib/coss/types/scheduling_reassignment_webhook_event_data.rb new file mode 100644 index 000000000..a3c6bb9ea --- /dev/null +++ b/sdks/ruby/lib/coss/types/scheduling_reassignment_webhook_event_data.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +module Coss + module Types + class SchedulingReassignmentWebhookEventData < Internal::Types::Model + field :reassignment_id, -> { String }, optional: false, nullable: false + + field :status, -> { Coss::Types::SchedulingReassignmentWebhookEventDataStatus }, optional: false, nullable: false + + field :out_of_office_id, -> { String }, optional: false, nullable: true + + field :counts, -> { Coss::Types::SchedulingReassignmentWebhookEventDataCounts }, optional: false, nullable: false + + field :occurred_at, -> { String }, optional: false, nullable: false + end + end +end diff --git a/sdks/ruby/lib/coss/types/scheduling_reassignment_webhook_event_data_counts.rb b/sdks/ruby/lib/coss/types/scheduling_reassignment_webhook_event_data_counts.rb new file mode 100644 index 000000000..8562b546e --- /dev/null +++ b/sdks/ruby/lib/coss/types/scheduling_reassignment_webhook_event_data_counts.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +module Coss + module Types + class SchedulingReassignmentWebhookEventDataCounts < Internal::Types::Model + field :total, -> { Integer }, optional: false, nullable: false + + field :pending, -> { Integer }, optional: false, nullable: false + + field :reassigned, -> { Integer }, optional: false, nullable: false + + field :skipped, -> { Integer }, optional: false, nullable: false + + field :no_candidate, -> { Integer }, optional: false, nullable: false + + field :failed, -> { Integer }, optional: false, nullable: false + + field :cancelled, -> { Integer }, optional: false, nullable: false + end + end +end diff --git a/sdks/ruby/lib/coss/types/scheduling_reassignment_webhook_event_data_status.rb b/sdks/ruby/lib/coss/types/scheduling_reassignment_webhook_event_data_status.rb new file mode 100644 index 000000000..edbf20b66 --- /dev/null +++ b/sdks/ruby/lib/coss/types/scheduling_reassignment_webhook_event_data_status.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Coss + module Types + module SchedulingReassignmentWebhookEventDataStatus + extend Coss::Internal::Types::Enum + + COMPLETED = "completed" + CANCELLED = "cancelled" + end + end +end diff --git a/sdks/ruby/lib/coss/types/scheduling_reassignment_webhook_event_object.rb b/sdks/ruby/lib/coss/types/scheduling_reassignment_webhook_event_object.rb new file mode 100644 index 000000000..9dd57992a --- /dev/null +++ b/sdks/ruby/lib/coss/types/scheduling_reassignment_webhook_event_object.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Coss + module Types + module SchedulingReassignmentWebhookEventObject + extend Coss::Internal::Types::Enum + + EVENT = "event" + end + end +end diff --git a/sdks/ruby/lib/coss/types/scheduling_reassignment_webhook_event_type.rb b/sdks/ruby/lib/coss/types/scheduling_reassignment_webhook_event_type.rb new file mode 100644 index 000000000..dc68d201f --- /dev/null +++ b/sdks/ruby/lib/coss/types/scheduling_reassignment_webhook_event_type.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Coss + module Types + module SchedulingReassignmentWebhookEventType + extend Coss::Internal::Types::Enum + + SCHEDULING_REASSIGNMENT_COMPLETED = "scheduling.reassignment.completed" + end + end +end diff --git a/sdks/ruby/lib/coss/types/scheduling_settings.rb b/sdks/ruby/lib/coss/types/scheduling_settings.rb index aed758701..d9c1d8552 100644 --- a/sdks/ruby/lib/coss/types/scheduling_settings.rb +++ b/sdks/ruby/lib/coss/types/scheduling_settings.rb @@ -13,10 +13,18 @@ class SchedulingSettings < Internal::Types::Model field :logo, -> { Coss::Types::SchedulingSettingsLogo }, optional: false, nullable: true + field :privacy_url, -> { String }, optional: false, nullable: true + field :email_from, -> { String }, optional: false, nullable: true field :sms_from, -> { String }, optional: false, nullable: true + field :name_host_in_attendee_emails, -> { Internal::Types::Boolean }, optional: false, nullable: false + + field :host_reassignment, -> { Coss::Types::SchedulingSettingsHostReassignment }, optional: false, nullable: false + + field :out_of_office_reasons, -> { Internal::Types::Array[Coss::Types::SchedulingSettingsOutOfOfficeReasonsItem] }, optional: false, nullable: false + field :calendar_failure_mode, -> { Coss::Types::SchedulingSettingsCalendarFailureMode }, optional: false, nullable: false field :notifications, -> { Internal::Types::Hash[String, Coss::Types::SchedulingSettingsNotificationsValue] }, optional: false, nullable: true diff --git a/sdks/ruby/lib/coss/types/scheduling_settings_host_reassignment.rb b/sdks/ruby/lib/coss/types/scheduling_settings_host_reassignment.rb new file mode 100644 index 000000000..428ffc88d --- /dev/null +++ b/sdks/ruby/lib/coss/types/scheduling_settings_host_reassignment.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Coss + module Types + module SchedulingSettingsHostReassignment + extend Coss::Internal::Types::Enum + + OFF = "off" + ELIGIBLE = "eligible" + end + end +end diff --git a/sdks/ruby/lib/coss/types/scheduling_settings_out_of_office_reasons_item.rb b/sdks/ruby/lib/coss/types/scheduling_settings_out_of_office_reasons_item.rb new file mode 100644 index 000000000..1dc818910 --- /dev/null +++ b/sdks/ruby/lib/coss/types/scheduling_settings_out_of_office_reasons_item.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Coss + module Types + class SchedulingSettingsOutOfOfficeReasonsItem < Internal::Types::Model + field :key, -> { String }, optional: false, nullable: false + + field :label, -> { String }, optional: false, nullable: false + end + end +end diff --git a/sdks/ruby/lib/coss/types/webhook_test_event_event.rb b/sdks/ruby/lib/coss/types/webhook_test_event_event.rb index 057562ce4..db939ec1a 100644 --- a/sdks/ruby/lib/coss/types/webhook_test_event_event.rb +++ b/sdks/ruby/lib/coss/types/webhook_test_event_event.rb @@ -34,7 +34,13 @@ class WebhookTestEventEvent < Internal::Types::Model member -> { Coss::Types::SchedulingCalendarWebhookEvent } + member -> { Coss::Types::SchedulingOutOfOfficeWebhookEvent } + + member -> { Coss::Types::SchedulingReassignmentWebhookEvent } + member -> { Coss::Types::SchedulingCalendarDelegationWebhookEvent } + + member -> { Coss::Types::SchedulingOauthAppWebhookEvent } end end end diff --git a/sdks/ruby/lib/coss/version.rb b/sdks/ruby/lib/coss/version.rb index 43eb4e012..9f798ea27 100644 --- a/sdks/ruby/lib/coss/version.rb +++ b/sdks/ruby/lib/coss/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module Coss - VERSION = "0.3.0" + VERSION = "0.4.0" end diff --git a/sdks/ruby/lib/coss/webhook_endpoints/types/create_webhook_endpoint_request_event_types_item.rb b/sdks/ruby/lib/coss/webhook_endpoints/types/create_webhook_endpoint_request_event_types_item.rb index 4261446f5..421cfd373 100644 --- a/sdks/ruby/lib/coss/webhook_endpoints/types/create_webhook_endpoint_request_event_types_item.rb +++ b/sdks/ruby/lib/coss/webhook_endpoints/types/create_webhook_endpoint_request_event_types_item.rb @@ -89,6 +89,7 @@ module CreateWebhookEndpointRequestEventTypesItem SCHEDULING_BOOKING_EXTERNAL_CONFLICT = "scheduling.booking.external_conflict" SCHEDULING_BOOKING_CALENDAR_WRITE_FAILED = "scheduling.booking.calendar_write_failed" SCHEDULING_BOOKING_LOCATION_READY = "scheduling.booking.location_ready" + SCHEDULING_BOOKING_REASSIGNED = "scheduling.booking.reassigned" SCHEDULING_BOOKING_STARTED = "scheduling.booking.started" SCHEDULING_BOOKING_ENDED = "scheduling.booking.ended" SCHEDULING_BOOKING_REMINDER = "scheduling.booking.reminder" @@ -97,6 +98,14 @@ module CreateWebhookEndpointRequestEventTypesItem SCHEDULING_CALENDAR_DISCONNECTED = "scheduling.calendar.disconnected" SCHEDULING_CALENDAR_DELEGATION_FAILING = "scheduling.calendar_delegation.failing" SCHEDULING_CALENDAR_DELEGATION_RESTORED = "scheduling.calendar_delegation.restored" + SCHEDULING_OUT_OF_OFFICE_CREATED = "scheduling.out_of_office.created" + SCHEDULING_OUT_OF_OFFICE_UPDATED = "scheduling.out_of_office.updated" + SCHEDULING_OUT_OF_OFFICE_DELETED = "scheduling.out_of_office.deleted" + SCHEDULING_OUT_OF_OFFICE_STARTED = "scheduling.out_of_office.started" + SCHEDULING_OUT_OF_OFFICE_ENDED = "scheduling.out_of_office.ended" + SCHEDULING_REASSIGNMENT_COMPLETED = "scheduling.reassignment.completed" + SCHEDULING_OAUTH_APP_FAILING = "scheduling.oauth_app.failing" + SCHEDULING_OAUTH_APP_RESTORED = "scheduling.oauth_app.restored" end end end diff --git a/sdks/ruby/lib/coss/webhook_endpoints/types/update_webhook_endpoint_request_event_types_item.rb b/sdks/ruby/lib/coss/webhook_endpoints/types/update_webhook_endpoint_request_event_types_item.rb index bea634871..51dc43fbc 100644 --- a/sdks/ruby/lib/coss/webhook_endpoints/types/update_webhook_endpoint_request_event_types_item.rb +++ b/sdks/ruby/lib/coss/webhook_endpoints/types/update_webhook_endpoint_request_event_types_item.rb @@ -89,6 +89,7 @@ module UpdateWebhookEndpointRequestEventTypesItem SCHEDULING_BOOKING_EXTERNAL_CONFLICT = "scheduling.booking.external_conflict" SCHEDULING_BOOKING_CALENDAR_WRITE_FAILED = "scheduling.booking.calendar_write_failed" SCHEDULING_BOOKING_LOCATION_READY = "scheduling.booking.location_ready" + SCHEDULING_BOOKING_REASSIGNED = "scheduling.booking.reassigned" SCHEDULING_BOOKING_STARTED = "scheduling.booking.started" SCHEDULING_BOOKING_ENDED = "scheduling.booking.ended" SCHEDULING_BOOKING_REMINDER = "scheduling.booking.reminder" @@ -97,6 +98,14 @@ module UpdateWebhookEndpointRequestEventTypesItem SCHEDULING_CALENDAR_DISCONNECTED = "scheduling.calendar.disconnected" SCHEDULING_CALENDAR_DELEGATION_FAILING = "scheduling.calendar_delegation.failing" SCHEDULING_CALENDAR_DELEGATION_RESTORED = "scheduling.calendar_delegation.restored" + SCHEDULING_OUT_OF_OFFICE_CREATED = "scheduling.out_of_office.created" + SCHEDULING_OUT_OF_OFFICE_UPDATED = "scheduling.out_of_office.updated" + SCHEDULING_OUT_OF_OFFICE_DELETED = "scheduling.out_of_office.deleted" + SCHEDULING_OUT_OF_OFFICE_STARTED = "scheduling.out_of_office.started" + SCHEDULING_OUT_OF_OFFICE_ENDED = "scheduling.out_of_office.ended" + SCHEDULING_REASSIGNMENT_COMPLETED = "scheduling.reassignment.completed" + SCHEDULING_OAUTH_APP_FAILING = "scheduling.oauth_app.failing" + SCHEDULING_OAUTH_APP_RESTORED = "scheduling.oauth_app.restored" end end end diff --git a/sdks/ruby/lib/coss/webhook_events/types/create_test_webhook_event_request_type.rb b/sdks/ruby/lib/coss/webhook_events/types/create_test_webhook_event_request_type.rb index e2288f91a..686a6088f 100644 --- a/sdks/ruby/lib/coss/webhook_events/types/create_test_webhook_event_request_type.rb +++ b/sdks/ruby/lib/coss/webhook_events/types/create_test_webhook_event_request_type.rb @@ -89,6 +89,7 @@ module CreateTestWebhookEventRequestType SCHEDULING_BOOKING_EXTERNAL_CONFLICT = "scheduling.booking.external_conflict" SCHEDULING_BOOKING_CALENDAR_WRITE_FAILED = "scheduling.booking.calendar_write_failed" SCHEDULING_BOOKING_LOCATION_READY = "scheduling.booking.location_ready" + SCHEDULING_BOOKING_REASSIGNED = "scheduling.booking.reassigned" SCHEDULING_BOOKING_STARTED = "scheduling.booking.started" SCHEDULING_BOOKING_ENDED = "scheduling.booking.ended" SCHEDULING_BOOKING_REMINDER = "scheduling.booking.reminder" @@ -97,6 +98,14 @@ module CreateTestWebhookEventRequestType SCHEDULING_CALENDAR_DISCONNECTED = "scheduling.calendar.disconnected" SCHEDULING_CALENDAR_DELEGATION_FAILING = "scheduling.calendar_delegation.failing" SCHEDULING_CALENDAR_DELEGATION_RESTORED = "scheduling.calendar_delegation.restored" + SCHEDULING_OUT_OF_OFFICE_CREATED = "scheduling.out_of_office.created" + SCHEDULING_OUT_OF_OFFICE_UPDATED = "scheduling.out_of_office.updated" + SCHEDULING_OUT_OF_OFFICE_DELETED = "scheduling.out_of_office.deleted" + SCHEDULING_OUT_OF_OFFICE_STARTED = "scheduling.out_of_office.started" + SCHEDULING_OUT_OF_OFFICE_ENDED = "scheduling.out_of_office.ended" + SCHEDULING_REASSIGNMENT_COMPLETED = "scheduling.reassignment.completed" + SCHEDULING_OAUTH_APP_FAILING = "scheduling.oauth_app.failing" + SCHEDULING_OAUTH_APP_RESTORED = "scheduling.oauth_app.restored" end end end diff --git a/sdks/ruby/lib/coss/webhook_listeners/types/create_webhook_listener_request_event_types_item.rb b/sdks/ruby/lib/coss/webhook_listeners/types/create_webhook_listener_request_event_types_item.rb index 871d1e01b..4a5f538bd 100644 --- a/sdks/ruby/lib/coss/webhook_listeners/types/create_webhook_listener_request_event_types_item.rb +++ b/sdks/ruby/lib/coss/webhook_listeners/types/create_webhook_listener_request_event_types_item.rb @@ -89,6 +89,7 @@ module CreateWebhookListenerRequestEventTypesItem SCHEDULING_BOOKING_EXTERNAL_CONFLICT = "scheduling.booking.external_conflict" SCHEDULING_BOOKING_CALENDAR_WRITE_FAILED = "scheduling.booking.calendar_write_failed" SCHEDULING_BOOKING_LOCATION_READY = "scheduling.booking.location_ready" + SCHEDULING_BOOKING_REASSIGNED = "scheduling.booking.reassigned" SCHEDULING_BOOKING_STARTED = "scheduling.booking.started" SCHEDULING_BOOKING_ENDED = "scheduling.booking.ended" SCHEDULING_BOOKING_REMINDER = "scheduling.booking.reminder" @@ -97,6 +98,14 @@ module CreateWebhookListenerRequestEventTypesItem SCHEDULING_CALENDAR_DISCONNECTED = "scheduling.calendar.disconnected" SCHEDULING_CALENDAR_DELEGATION_FAILING = "scheduling.calendar_delegation.failing" SCHEDULING_CALENDAR_DELEGATION_RESTORED = "scheduling.calendar_delegation.restored" + SCHEDULING_OUT_OF_OFFICE_CREATED = "scheduling.out_of_office.created" + SCHEDULING_OUT_OF_OFFICE_UPDATED = "scheduling.out_of_office.updated" + SCHEDULING_OUT_OF_OFFICE_DELETED = "scheduling.out_of_office.deleted" + SCHEDULING_OUT_OF_OFFICE_STARTED = "scheduling.out_of_office.started" + SCHEDULING_OUT_OF_OFFICE_ENDED = "scheduling.out_of_office.ended" + SCHEDULING_REASSIGNMENT_COMPLETED = "scheduling.reassignment.completed" + SCHEDULING_OAUTH_APP_FAILING = "scheduling.oauth_app.failing" + SCHEDULING_OAUTH_APP_RESTORED = "scheduling.oauth_app.restored" end end end diff --git a/sdks/ruby/reference.md b/sdks/ruby/reference.md index 64ebb54c1..e62caddd6 100644 --- a/sdks/ruby/reference.md +++ b/sdks/ruby/reference.md @@ -18373,8 +18373,8 @@ client.scheduling.hosts.update(
-## Scheduling Schedules -
client.scheduling.schedules.list(host:) -> Coss::Types::SchedulingScheduleList +## Scheduling Bookings +
client.scheduling.bookings.reassign(id:, request) -> Coss::Types::SchedulingBooking
@@ -18386,7 +18386,7 @@ client.scheduling.hosts.update(
-All of the host's schedules, oldest first. +Gives a booking to another host, keeping its id and time. Works for every kind: a group session moves as a whole, from any of its seats, and one that's already started changes for the record, with nobody told. Whoever leaves and joins is told, and the attendee unless you say not to.
@@ -18401,7 +18401,13 @@ All of the host's schedules, oldest first.
```ruby -client.scheduling.schedules.list(host: "host_01kd2m9a0b1c2d3e4f5g6h7j8m") +client.scheduling.bookings.reassign( + id: "book_01kd2m9a0b1c2d3e4f5g6h7j8m", + changes: [{ + to_host: "doctor_518" + }], + reason_code: "out_of_office" +) ```
@@ -18416,7 +18422,7 @@ client.scheduling.schedules.list(host: "host_01kd2m9a0b1c2d3e4f5g6h7j8m")
-**host:** `String` — The host's id or uid. +**id:** `String` — The booking's id.
@@ -18424,76 +18430,31 @@ client.scheduling.schedules.list(host: "host_01kd2m9a0b1c2d3e4f5g6h7j8m")
-**request_options:** `Coss::Scheduling::Schedules::RequestOptions` +**changes:** `Internal::Types::Array[Coss::Scheduling::Bookings::Types::ReassignSchedulingBookingRequestChangesItem]` — A session or a one-on-one has one. A collective can change several.
- - - - - - -
- -
client.scheduling.schedules.create(host:, request) -> Coss::Types::SchedulingSchedule -
-
- -#### 📝 Description
-
-
- -A host's weekly hours and date overrides, in local time. The first one is the host's default. -
-
+**reason_code:** `Coss::Scheduling::Bookings::Types::ReassignSchedulingBookingRequestReasonCode` +
-#### 🔌 Usage - -
-
-
-```ruby -client.scheduling.schedules.create( - host: "host_01kd2m9a0b1c2d3e4f5g6h7j8m", - name: "Clinic hours", - rules: [{ - days: [1, 2, 3, 4, 5], - start: "09:00", - end_: "17:00" - }], - overrides: [{ - date: "2027-12-24", - ranges: [{ - start: "start", - end_: "end" - }] - }] -) -``` -
-
+**note:** `String` — Why, in your words: required with an override of someone's availability. Encrypted, and only in the booking's history. +
-#### ⚙️ Parameters - -
-
-
-**host:** `String` — The host's id or uid. +**overrides:** `Internal::Types::Array[Coss::Scheduling::Bookings::Types::ReassignSchedulingBookingRequestOverridesItem]` — Go ahead anyway: `any_host` for someone who doesn't take this event type, and the rest for what a candidate's `reason` said. A host who already has something at this time can never be overridden.
@@ -18501,7 +18462,7 @@ client.scheduling.schedules.create(
-**request:** `Coss::Types::UpsertScheduleRequest` +**notify:** `Coss::Scheduling::Bookings::Types::ReassignSchedulingBookingRequestNotify`
@@ -18509,7 +18470,7 @@ client.scheduling.schedules.create(
-**request_options:** `Coss::Scheduling::Schedules::RequestOptions` +**request_options:** `Coss::Scheduling::Bookings::RequestOptions`
@@ -18521,7 +18482,7 @@ client.scheduling.schedules.create(
-
client.scheduling.schedules.get(host:, schedule_id:) -> Coss::Types::SchedulingSchedule +
client.scheduling.bookings.reassign_candidates(id:) -> Coss::Types::SchedulingReassignCandidateList
@@ -18533,7 +18494,7 @@ client.scheduling.schedules.create(
-One of the host's schedules. +The environment's other active hosts: members of the event type first, in the order a pool would pick them, each saying whether they're free and why not. Things can change before you ask: reassigning decides again.
@@ -18548,10 +18509,7 @@ One of the host's schedules.
```ruby -client.scheduling.schedules.get( - host: "host_01kd2m9a0b1c2d3e4f5g6h7j8m", - schedule_id: "sched_01kd2m9a0b1c2d3e4f5g6h7j8m" -) +client.scheduling.bookings.reassign_candidates(id: "book_01kd2m9a0b1c2d3e4f5g6h7j8m") ```
@@ -18566,7 +18524,7 @@ client.scheduling.schedules.get(
-**host:** `String` — The host's id or uid. +**id:** `String` — The booking's id.
@@ -18574,7 +18532,7 @@ client.scheduling.schedules.get(
-**schedule_id:** `String` — The schedule's id. +**from_host:** `String` — The host who'd leave, when it could be several.
@@ -18582,7 +18540,7 @@ client.scheduling.schedules.get(
-**request_options:** `Coss::Scheduling::Schedules::RequestOptions` +**request_options:** `Coss::Scheduling::Bookings::RequestOptions`
@@ -18594,7 +18552,7 @@ client.scheduling.schedules.get(
-
client.scheduling.schedules.update(host:, schedule_id:, request) -> Coss::Types::SchedulingSchedule +
client.scheduling.bookings.list() -> Coss::Types::SchedulingBookingList
@@ -18606,7 +18564,7 @@ client.scheduling.schedules.get(
-Replaces its weekly rules, and its overrides when given. Existing bookings stay: a schedule only decides what's offered next. +The environment's bookings, newest first. Answers aren't included.
@@ -18621,22 +18579,9 @@ Replaces its weekly rules, and its overrides when given. Existing bookings stay:
```ruby -client.scheduling.schedules.update( - host: "host_01kd2m9a0b1c2d3e4f5g6h7j8m", - schedule_id: "sched_01kd2m9a0b1c2d3e4f5g6h7j8m", - name: "Clinic hours", - rules: [{ - days: [1, 2, 3, 4, 5], - start: "09:00", - end_: "17:00" - }], - overrides: [{ - date: "2027-12-24", - ranges: [{ - start: "start", - end_: "end" - }] - }] +client.scheduling.bookings.list( + start_after: "2027-01-04T15:00:00.000Z", + start_before: "2027-01-04T15:00:00.000Z" ) ```
@@ -18652,7 +18597,7 @@ client.scheduling.schedules.update(
-**host:** `String` — The host's id or uid. +**limit:** `Integer`
@@ -18660,7 +18605,7 @@ client.scheduling.schedules.update(
-**schedule_id:** `String` — The schedule's id. +**after:** `String` — The last id of the previous page.
@@ -18668,7 +18613,7 @@ client.scheduling.schedules.update(
-**request:** `Coss::Types::UpsertScheduleRequest` +**host:** `String`
@@ -18676,7 +18621,47 @@ client.scheduling.schedules.update(
-**request_options:** `Coss::Scheduling::Schedules::RequestOptions` +**event_type:** `String` + +
+
+ +
+
+ +**status:** `Coss::Scheduling::Bookings::Types::ListBookingsRequestStatus` + +
+
+ +
+
+ +**attendee_uid:** `String` + +
+
+ +
+
+ +**start_after:** `String` — An ISO 8601 instant with an offset. + +
+
+ +
+
+ +**start_before:** `String` — An ISO 8601 instant with an offset. + +
+
+ +
+
+ +**request_options:** `Coss::Scheduling::Bookings::RequestOptions`
@@ -18688,7 +18673,7 @@ client.scheduling.schedules.update(
-
client.scheduling.schedules.remove(host:, schedule_id:) -> Coss::Types::DeletedSchedulingSchedule +
client.scheduling.bookings.create(request) -> Coss::Types::SchedulingBooking
@@ -18700,7 +18685,7 @@ client.scheduling.schedules.update(
-Refused for the host's default schedule. +Books a slot, or joins a group session. Without a `host`, a pool chooses fairly among those free. An event type that requires approval answers with a `pending_approval` booking.
@@ -18715,9 +18700,16 @@ Refused for the host's default schedule.
```ruby -client.scheduling.schedules.remove( - host: "host_01kd2m9a0b1c2d3e4f5g6h7j8m", - schedule_id: "sched_01kd2m9a0b1c2d3e4f5g6h7j8m" +client.scheduling.bookings.create( + idempotency_key: "welcome-user-123", + event_type: "evtype_01kd2m9a0b1c2d3e4f5g6h7j8m", + start: "2027-01-04T15:00:00.000Z", + attendee: { + uid: "patient_77", + name: "Sam Lee", + email: "sam@example.com", + time_zone: "UTC" + } ) ```
@@ -18733,7 +18725,7 @@ client.scheduling.schedules.remove(
-**host:** `String` — The host's id or uid. +**idempotency_key:** `String` — Makes retries safe: a repeated request with the same key and body returns the original booking instead of creating another, for 24 hours. A refused request keeps no key. 1-256 characters.
@@ -18741,7 +18733,7 @@ client.scheduling.schedules.remove(
-**schedule_id:** `String` — The schedule's id. +**event_type:** `String` — The event type's id or uid.
@@ -18749,62 +18741,63 @@ client.scheduling.schedules.remove(
-**request_options:** `Coss::Scheduling::Schedules::RequestOptions` +**start:** `String` — An ISO 8601 instant with an offset.
- -
+
+
+**host:** `String` — A specific host (id or uid). Default: chosen fairly from those free. +
-
-## Scheduling EventTypes -
client.scheduling.event_types.list() -> Coss::Types::SchedulingEventTypeList
-#### 📝 Description - -
-
+**attributes:** `Internal::Types::Hash[String, Coss::Scheduling::Bookings::Types::CreateBookingRequestAttributesValue]` — Only choose among pool hosts matching all of these. + +
+
-The environment's event types, newest first. -
-
+**duration_minutes:** `Integer` — One of the event type's `duration_options`. +
-#### 🔌 Usage -
+**attendee:** `Coss::Types::SchedulingAttendeeInput` + +
+
+
-```ruby -client.scheduling.event_types.list -``` -
-
+**guests:** `Internal::Types::Array[Coss::Types::SchedulingGuestInput]` — Up to the event type's `max_guests`. + -#### ⚙️ Parameters -
+**answers:** `Internal::Types::Hash[String, Coss::Scheduling::Bookings::Types::CreateBookingRequestAnswersValue]` — Answers to the event type's questions. Stored encrypted, and returned only by retrieving the booking. + +
+
+
-**limit:** `Integer` +**location:** `Coss::Scheduling::Bookings::Types::CreateBookingRequestLocation` — One of the event type's `locations`, with your link filled in if it has none.
@@ -18812,7 +18805,7 @@ client.scheduling.event_types.list
-**after:** `String` — The last id of the previous page. +**metadata:** `Internal::Types::Hash[String, String]` — Your own key-value pairs. Don't put sensitive data here.
@@ -18820,7 +18813,7 @@ client.scheduling.event_types.list
-**request_options:** `Coss::Scheduling::EventTypes::RequestOptions` +**request_options:** `Coss::Scheduling::Bookings::RequestOptions`
@@ -18832,7 +18825,7 @@ client.scheduling.event_types.list
-
client.scheduling.event_types.create(request) -> Coss::Types::SchedulingEventType +
client.scheduling.bookings.get(id:) -> Coss::Types::SchedulingBooking
@@ -18844,7 +18837,7 @@ client.scheduling.event_types.list
-What can be booked: `one_on_one` with one host, `pool` for any free host, `collective` when every required host must be free, or `group` for a session with seats. +A booking with its attendees and their answers.
@@ -18859,16 +18852,7 @@ What can be booked: `one_on_one` with one host, `pool` for any free host, `colle
```ruby -client.scheduling.event_types.create( - kind: "one_on_one", - title: "Initial consultation", - duration_minutes: 30, - buffer_after_minutes: 10, - min_notice_minutes: 120, - hosts: [{ - host: "doctor_482" - }] -) +client.scheduling.bookings.get(id: "book_01kd2m9a0b1c2d3e4f5g6h7j8m") ```
@@ -18883,7 +18867,7 @@ client.scheduling.event_types.create(
-**uid:** `String` — Your own id for this event type, unique in the environment, accepted wherever its id is. +**id:** `String` — The booking's id.
@@ -18891,63 +18875,2587 @@ client.scheduling.event_types.create(
-**kind:** `Coss::Scheduling::EventTypes::Types::CreateEventTypeRequestKind` — Who a booking needs. `one_on_one`: one host. `pool`: any one of its hosts. `collective`: every `required` host, plus at most one `member`. `group`: one host, with attendees taking seats up to `capacity`. Fixed once created. +**request_options:** `Coss::Scheduling::Bookings::RequestOptions`
- -
-
- -**description:** `String` — Plain text about the event type, shown on hosted booking pages and never in emails. Links, and anything shaped like a domain, must be on your organization's verified domains or their subdomains, and use `https`. `null` removes it. -
-
-
-**title:** `String` — Shown to attendees and in emails. Host calendars show it only with `host_calendar_details: full`. -
+
+
client.scheduling.bookings.reschedule(id:, request) -> Coss::Types::SchedulingBooking
-**duration_minutes:** `Integer` — How long a booking lasts by default, in minutes. - -
-
+#### 📝 Description
-**duration_options:** `Internal::Types::Array[Integer]` — Other lengths an attendee may choose, in minutes. Empty: only `duration_minutes`. +
+
+ +Moves it to a new time, keeping its id. The old time stays booked if the new one isn't free. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```ruby +client.scheduling.bookings.reschedule( + id: "book_01kd2m9a0b1c2d3e4f5g6h7j8m", + start: "2027-01-05T15:00:00.000Z" +) +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — The booking's id. + +
+
+ +
+
+ +**start:** `String` — The new start. The old time stays booked unless this one's free. + +
+
+ +
+
+ +**host:** `String` — Move a pool booking to this host. Default: its current hosts. + +
+
+ +
+
+ +**request_options:** `Coss::Scheduling::Bookings::RequestOptions` + +
+
+
+
+ + + + +
+ +
client.scheduling.bookings.cancel(id:, request) -> Coss::Types::SchedulingBooking +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Frees the time and removes the calendar event. A cancelled booking stays charged. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```ruby +client.scheduling.bookings.cancel( + id: "book_01kd2m9a0b1c2d3e4f5g6h7j8m", + reason: "Feeling better" +) +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — The booking's id. + +
+
+ +
+
+ +**reason:** `String` — Why it's being cancelled. Only retrieving this booking returns it: it's never in webhooks, logs or emails. + +
+
+ +
+
+ +**request_options:** `Coss::Scheduling::Bookings::RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.scheduling.bookings.events(id:) -> Coss::Types::SchedulingBookingEventList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +What's happened to a booking, oldest first, and who did it. There's no personal data in here. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```ruby +client.scheduling.bookings.events(id: "book_01kd2m9a0b1c2d3e4f5g6h7j8m") +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — The booking's id. + +
+
+ +
+
+ +**limit:** `Integer` + +
+
+ +
+
+ +**after:** `String` — The last id of the previous page. + +
+
+ +
+
+ +**request_options:** `Coss::Scheduling::Bookings::RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.scheduling.bookings.approve(id:) -> Coss::Types::SchedulingBooking +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Confirms a `pending_approval` booking. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```ruby +client.scheduling.bookings.approve(id: "book_01kd2m9a0b1c2d3e4f5g6h7j8m") +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — The booking's id. + +
+
+ +
+
+ +**request_options:** `Coss::Scheduling::Bookings::RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.scheduling.bookings.decline(id:) -> Coss::Types::SchedulingBooking +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Refuses a `pending_approval` booking and frees the time. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```ruby +client.scheduling.bookings.decline(id: "book_01kd2m9a0b1c2d3e4f5g6h7j8m") +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — The booking's id. + +
+
+ +
+
+ +**request_options:** `Coss::Scheduling::Bookings::RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.scheduling.bookings.notifications(id:) -> Coss::Types::SchedulingBookingNotificationList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +What's been queued for this booking and what became of it, newest first, including why something wasn't sent. It never says who it went to. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```ruby +client.scheduling.bookings.notifications(id: "book_01kd2m9a0b1c2d3e4f5g6h7j8m") +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — The booking's id. + +
+
+ +
+
+ +**limit:** `Integer` + +
+
+ +
+
+ +**after:** `String` — The last id of the previous page. + +
+
+ +
+
+ +**request_options:** `Coss::Scheduling::Bookings::RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.scheduling.bookings.mark_no_show(id:) -> Coss::Types::SchedulingBooking +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Records that the attendee didn't come, once the booking has started. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```ruby +client.scheduling.bookings.mark_no_show(id: "book_01kd2m9a0b1c2d3e4f5g6h7j8m") +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — The booking's id. + +
+
+ +
+
+ +**request_options:** `Coss::Scheduling::Bookings::RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.scheduling.bookings.update_location(id:, request) -> Coss::Types::SchedulingBooking +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Where it happens, such as the meeting link you made after the `scheduling.booking.confirmed` webhook. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```ruby +client.scheduling.bookings.update_location( + id: "book_01kd2m9a0b1c2d3e4f5g6h7j8m", + location: { + type: "link", + url: "https://meet.example.com/abc" + } +) +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — The booking's id. + +
+
+ +
+
+ +**location:** `Coss::Types::SchedulingLocation` + +
+
+ +
+
+ +**request_options:** `Coss::Scheduling::Bookings::RequestOptions` + +
+
+
+
+ + +
+
+
+ +## Scheduling Reassignments +
client.scheduling.reassignments.preview(request) -> Coss::Types::SchedulingReassignmentPreview +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Who each booking would go to, and why not when nobody can take it, without moving anything. It works down them in order, so two can't both be promised the same free hour. Change any of it and start the run with `assignments`. Covers the first 500. Things can change before you start it: the run decides again. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```ruby +client.scheduling.reassignments.preview( + selection: { + host: "doctor_482", + start_before: "2027-08-14T00:00:00.000Z" + }, + strategy: { + preferred_hosts: ["doctor_518"] + } +) +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**selection:** `Coss::Types::SchedulingReassignmentSelection` + +
+
+ +
+
+ +**strategy:** `Coss::Types::SchedulingReassignmentStrategy` + +
+
+ +
+
+ +**overrides:** `Internal::Types::Array[Coss::Scheduling::Reassignments::Types::PreviewSchedulingReassignmentRequestOverridesItem]` + +
+
+ +
+
+ +**request_options:** `Coss::Scheduling::Reassignments::RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.scheduling.reassignments.list() -> Coss::Types::SchedulingReassignmentList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Newest first, with how each is going. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```ruby +client.scheduling.reassignments.list +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**limit:** `Integer` + +
+
+ +
+
+ +**after:** `String` — The last id of the previous page. + +
+
+ +
+
+ +**request_options:** `Coss::Scheduling::Reassignments::RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.scheduling.reassignments.create(request) -> Coss::Types::SchedulingReassignment +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Moves up to 5,000 bookings in the background, each on its own, so one that can't move never holds up the rest. Nothing's ever cancelled: a booking nobody can take stays where it is, and its item says so. It answers at once: follow the run by its id, or wait for `scheduling.reassignment.completed`. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```ruby +client.scheduling.reassignments.create( + idempotency_key: "welcome-user-123", + selection: { + out_of_office: "ooo_01kd2m9a0b1c2d3e4f5g6h7j8m" + }, + strategy: { + preferred_hosts: ["doctor_518"] + }, + reason_code: "out_of_office" +) +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**idempotency_key:** `String` — Makes retries safe: a repeated request with the same key and body returns the original run instead of starting another, for 24 hours. 1-256 characters. + +
+
+ +
+
+ +**selection:** `Coss::Types::SchedulingReassignmentSelection` + +
+
+ +
+
+ +**strategy:** `Coss::Types::SchedulingReassignmentStrategy` + +
+
+ +
+
+ +**reason_code:** `Coss::Scheduling::Reassignments::Types::CreateSchedulingReassignmentRequestReasonCode` + +
+
+ +
+
+ +**note:** `String` — Why, in your words: required with an override of someone's availability. + +
+
+ +
+
+ +**overrides:** `Internal::Types::Array[Coss::Scheduling::Reassignments::Types::CreateSchedulingReassignmentRequestOverridesItem]` + +
+
+ +
+
+ +**notify:** `Coss::Scheduling::Reassignments::Types::CreateSchedulingReassignmentRequestNotify` + +
+
+ +
+
+ +**request_options:** `Coss::Scheduling::Reassignments::RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.scheduling.reassignments.get(id:) -> Coss::Types::SchedulingReassignment +
+
+ +#### 📝 Description + +
+
+ +
+
+ +How it's going. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```ruby +client.scheduling.reassignments.get(id: "id") +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — The reassignment's id. + +
+
+ +
+
+ +**request_options:** `Coss::Scheduling::Reassignments::RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.scheduling.reassignments.items(id:) -> Coss::Types::SchedulingReassignmentItemList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Each booking it covers and what happened to it. A group session has one, for one of its seats. Empty until the worker's started on it. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```ruby +client.scheduling.reassignments.items(id: "id") +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — The reassignment's id. + +
+
+ +
+
+ +**limit:** `Integer` + +
+
+ +
+
+ +**after:** `String` — The last id of the previous page. + +
+
+ +
+
+ +**request_options:** `Coss::Scheduling::Reassignments::RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.scheduling.reassignments.cancel(id:) -> Coss::Types::SchedulingReassignment +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Stops what hasn't happened yet. What's moved stays moved: undo it for that. Cancelling one that's finished changes nothing. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```ruby +client.scheduling.reassignments.cancel(id: "id") +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — The reassignment's id. + +
+
+ +
+
+ +**request_options:** `Coss::Scheduling::Reassignments::RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.scheduling.reassignments.undo(id:, request) -> Coss::Types::SchedulingReassignment +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Gives back what a finished run moved, as a new run. A booking that's moved on since stays where it went, and a former host who's no longer free keeps it from going back, unless you pass `overrides`. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```ruby +client.scheduling.reassignments.undo( + id: "id", + reason_code: "other" +) +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — The reassignment's id. + +
+
+ +
+
+ +**reason_code:** `Coss::Scheduling::Reassignments::Types::UndoSchedulingReassignmentRequestReasonCode` + +
+
+ +
+
+ +**note:** `String` + +
+
+ +
+
+ +**overrides:** `Internal::Types::Array[Coss::Scheduling::Reassignments::Types::UndoSchedulingReassignmentRequestOverridesItem]` + +
+
+ +
+
+ +**notify:** `Coss::Scheduling::Reassignments::Types::UndoSchedulingReassignmentRequestNotify` + +
+
+ +
+
+ +**request_options:** `Coss::Scheduling::Reassignments::RequestOptions` + +
+
+
+
+ + +
+
+
+ +## Scheduling HolidayCalendars +
client.scheduling.holiday_calendars.list() -> Coss::Types::SchedulingHolidayCalendarList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +By name. A feed's URL is never shown again. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```ruby +client.scheduling.holiday_calendars.list +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request_options:** `Coss::Scheduling::HolidayCalendars::RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.scheduling.holiday_calendars.create(request) -> Coss::Types::SchedulingHolidayCalendar +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Applies a country's public holidays, or your own feed, to some hosts as ordinary out of office entries, kept up to date by coss.com. A host who removes one keeps it removed. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```ruby +client.scheduling.holiday_calendars.create( + name: "UK team", + country: "GB", + host_filter: { + team: "london" + } +) +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**name:** `String` + +
+
+ +
+
+ +**country:** `String` — A code from the list of holiday calendars, such as `GB`. + +
+
+ +
+
+ +**ics_url:** `String` — Your own feed, https or webcal, read in live environments. Stored encrypted. + +
+
+ +
+
+ +**hosts:** `Internal::Types::Array[String]` — These hosts, by id or uid. + +
+
+ +
+
+ +**host_filter:** `Internal::Types::Hash[String, Coss::Scheduling::HolidayCalendars::Types::CreateSchedulingHolidayCalendarRequestHostFilterValue]` — Everyone matching these attributes, asked again at every sync. + +
+
+ +
+
+ +**regions:** `Internal::Types::Array[String]` — Which regional holidays apply, matched against how the calendar names them, such as `England`. Without this, all of them do; empty, only nationwide ones. + +
+
+ +
+
+ +**delegates:** `Internal::Types::Array[String]` — Who can be booked in their place on those days, by id or uid, in order. + +
+
+ +
+
+ +**existing_bookings:** `Coss::Scheduling::HolidayCalendars::Types::CreateSchedulingHolidayCalendarRequestExistingBookings` — What happens to bookings already on a holiday. `leave` (the default) only reports them. `reassign` moves them. + +
+
+ +
+
+ +**request_options:** `Coss::Scheduling::HolidayCalendars::RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.scheduling.holiday_calendars.get(id:) -> Coss::Types::SchedulingHolidayCalendar +
+
+ +#### 📝 Description + +
+
+ +
+
+ +With when it was last read, and why not if it couldn't be. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```ruby +client.scheduling.holiday_calendars.get(id: "id") +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — The holiday calendar's id. + +
+
+ +
+
+ +**request_options:** `Coss::Scheduling::HolidayCalendars::RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.scheduling.holiday_calendars.remove(id:) -> Coss::Types::DeletedSchedulingHolidayCalendar +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Hosts can be booked on its days again, shortly: past entries stay. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```ruby +client.scheduling.holiday_calendars.remove(id: "id") +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — The holiday calendar's id. + +
+
+ +
+
+ +**request_options:** `Coss::Scheduling::HolidayCalendars::RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.scheduling.holiday_calendars.update(id:, request) -> Coss::Types::SchedulingHolidayCalendar +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Who it applies to, who covers and what happens to bookings. Takes effect shortly. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```ruby +client.scheduling.holiday_calendars.update( + id: "id", + host_filter: { + team: "london" + } +) +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — The holiday calendar's id. + +
+
+ +
+
+ +**name:** `String` + +
+
+ +
+
+ +**hosts:** `Internal::Types::Array[String]` — These hosts, by id or uid. + +
+
+ +
+
+ +**host_filter:** `Internal::Types::Hash[String, Coss::Scheduling::HolidayCalendars::Types::UpdateSchedulingHolidayCalendarRequestHostFilterValue]` — Everyone matching these attributes, asked again at every sync. + +
+
+ +
+
+ +**regions:** `Internal::Types::Array[String]` — Which regional holidays apply, matched against how the calendar names them, such as `England`. Without this, all of them do; empty, only nationwide ones. + +
+
+ +
+
+ +**delegates:** `Internal::Types::Array[String]` — Who can be booked in their place on those days, by id or uid, in order. + +
+
+ +
+
+ +**existing_bookings:** `Coss::Scheduling::HolidayCalendars::Types::UpdateSchedulingHolidayCalendarRequestExistingBookings` — What happens to bookings already on a holiday. `leave` (the default) only reports them. `reassign` moves them. + +
+
+ +
+
+ +**request_options:** `Coss::Scheduling::HolidayCalendars::RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.scheduling.holiday_calendars.holidays(id:) -> Coss::Types::SchedulingHolidayList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +What's coming, with names, as last read. Empty until its first read. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```ruby +client.scheduling.holiday_calendars.holidays(id: "id") +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — The holiday calendar's id. + +
+
+ +
+
+ +**request_options:** `Coss::Scheduling::HolidayCalendars::RequestOptions` + +
+
+
+
+ + +
+
+
+ +## Scheduling OutOfOffice +
client.scheduling.out_of_office.list() -> Coss::Types::SchedulingOutOfOfficeList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +The environment's entries, newest first. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```ruby +client.scheduling.out_of_office.list( + start_after: "2027-01-04T15:00:00.000Z", + start_before: "2027-01-04T15:00:00.000Z" +) +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**limit:** `Integer` + +
+
+ +
+
+ +**after:** `String` — The last id of the previous page. + +
+
+ +
+
+ +**host:** `String` — One host's entries, by id or uid. + +
+
+ +
+
+ +**start_after:** `String` — Entries ending after this. + +
+
+ +
+
+ +**start_before:** `String` — Entries starting before this. + +
+
+ +
+
+ +**group:** `String` — The entries one request made. + +
+
+ +
+
+ +**request_options:** `Coss::Scheduling::OutOfOffice::RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.scheduling.out_of_office.create(request) -> Coss::Types::SchedulingOutOfOfficeList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Marks one host, a list of hosts or everyone matching some attributes as away, for part of a day or for whole dates. They aren't offered during it. Existing bookings stay as they are: list them with the entry's conflicts. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```ruby +client.scheduling.out_of_office.create( + host: "doctor_482", + start_date: "2027-08-02", + end_date: "2027-08-13", + reason: "vacation", + public_message: "Back on the 16th." +) +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**host:** `String` — One host, by id or uid. + +
+
+ +
+
+ +**hosts:** `Internal::Types::Array[String]` — Several hosts, by id or uid. Each gets an entry of their own. + +
+
+ +
+
+ +**host_filter:** `Internal::Types::Hash[String, Coss::Scheduling::OutOfOffice::Types::CreateSchedulingOutOfOfficeRequestHostFilterValue]` — Every active host matching these attributes right now. A host added later isn't covered. + +
+
+ +
+
+ +**start:** `String` — An ISO 8601 instant with an offset. + +
+
+ +
+
+ +**end_:** `String` — An ISO 8601 instant with an offset. + +
+
+ +
+
+ +**start_date:** `String` — The first whole day away. Use instead of `start` and `end`. + +
+
+ +
+
+ +**end_date:** `String` — The last whole day away, which is included. + +
+
+ +
+
+ +**time_zone:** `String` — What the dates mean in. Default: the host's zone when this is made. + +
+
+ +
+
+ +**delegates:** `Internal::Types::Array[String]` — Who can be booked in this host's place during it, by id or uid, in the order to try them. They still have to fit how a booking's routed. + +
+
+ +
+
+ +**reason:** `String` — One of `unspecified`, `vacation`, `travel`, `sick`, `public_holiday`, `parental_leave`, `training` and `other`, or a key from the settings' `out_of_office_reasons`. Only people who manage this host see it: never bookers, webhooks or calendars. + +
+
+ +
+
+ +**notes:** `String` — For people who manage this host. Encrypted, and never shown to a booker. + +
+
+ +
+
+ +**public_message:** `String` — Shown to bookers while this host is away. Can't contain a link. + +
+
+ +
+
+ +**show_on_calendar:** `Internal::Types::Boolean` — Put a private "Out of office" event on the host's calendar. Default: true. + +
+
+ +
+
+ +**existing_bookings:** `Coss::Scheduling::OutOfOffice::Types::CreateSchedulingOutOfOfficeRequestExistingBookings` — What happens to bookings already in the way. `leave` (the default) only reports them. `reassign` moves them, and any nobody can take stay where they are. + +
+
+ +
+
+ +**reassign:** `Coss::Scheduling::OutOfOffice::Types::CreateSchedulingOutOfOfficeRequestReassign` — With `existing_bookings: reassign`: who they go to. Default: the fairest who's free. + +
+
+ +
+
+ +**external_id:** `String` — Your own id for this entry, unique in the environment. Needs one host. + +
+
+ +
+
+ +**request_options:** `Coss::Scheduling::OutOfOffice::RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.scheduling.out_of_office.get(id:) -> Coss::Types::SchedulingOutOfOffice +
+
+ +#### 📝 Description + +
+
+ +
+
+ +One entry. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```ruby +client.scheduling.out_of_office.get(id: "ooo_01kd2m9a0b1c2d3e4f5g6h7j8m") +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — The entry's id. + +
+
+ +
+
+ +**request_options:** `Coss::Scheduling::OutOfOffice::RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.scheduling.out_of_office.remove(id:) -> Coss::Types::DeletedSchedulingOutOfOffice +
+
+ +#### 📝 Description + +
+
+ +
+
+ +The host can be booked in that time again, and any calendar event for it goes. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```ruby +client.scheduling.out_of_office.remove(id: "ooo_01kd2m9a0b1c2d3e4f5g6h7j8m") +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — The entry's id. + +
+
+ +
+
+ +**request_options:** `Coss::Scheduling::OutOfOffice::RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.scheduling.out_of_office.update(id:, request) -> Coss::Types::SchedulingOutOfOffice +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Changes what's given. An entry stays with its host. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```ruby +client.scheduling.out_of_office.update( + id: "ooo_01kd2m9a0b1c2d3e4f5g6h7j8m", + end_date: "2027-08-20" +) +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — The entry's id. + +
+
+ +
+
+ +**start:** `String` — An ISO 8601 instant with an offset. + +
+
+ +
+
+ +**end_:** `String` — An ISO 8601 instant with an offset. + +
+
+ +
+
+ +**start_date:** `String` — The first whole day away. Use instead of `start` and `end`. + +
+
+ +
+
+ +**end_date:** `String` — The last whole day away, which is included. + +
+
+ +
+
+ +**time_zone:** `String` — What the dates mean in. Default: the host's zone when this is made. + +
+
+ +
+
+ +**reason:** `String` — One of `unspecified`, `vacation`, `travel`, `sick`, `public_holiday`, `parental_leave`, `training` and `other`, or a key from the settings' `out_of_office_reasons`. Only people who manage this host see it: never bookers, webhooks or calendars. + +
+
+ +
+
+ +**notes:** `String` + +
+
+ +
+
+ +**public_message:** `String` + +
+
+ +
+
+ +**show_on_calendar:** `Internal::Types::Boolean` + +
+
+ +
+
+ +**delegates:** `Internal::Types::Array[String]` — Who can be booked in this host's place during it, by id or uid, in the order to try them. They still have to fit how a booking's routed. + +
+
+ +
+
+ +**existing_bookings:** `Coss::Scheduling::OutOfOffice::Types::UpdateSchedulingOutOfOfficeRequestExistingBookings` — What happens to bookings already in the way. `leave` (the default) only reports them. `reassign` moves them, and any nobody can take stay where they are. + +
+
+ +
+
+ +**reassign:** `Coss::Scheduling::OutOfOffice::Types::UpdateSchedulingOutOfOfficeRequestReassign` — With `existing_bookings: reassign`: who they go to. Default: the fairest who's free. + +
+
+ +
+
+ +**request_options:** `Coss::Scheduling::OutOfOffice::RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.scheduling.out_of_office.put(external_id:, request) -> Coss::Types::SchedulingOutOfOffice +
+
+ +#### 📝 Description + +
+
+ +
+
+ +For syncing from a system of record such as an HR tool: send what it says, as often as you like, and there's one entry for it. Give every field you want to keep. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```ruby +client.scheduling.out_of_office.put( + external_id: "hr_leave_4471", + host: "doctor_482", + start_date: "2027-08-02", + end_date: "2027-08-13", + reason: "vacation" +) +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**external_id:** `String` — Your own id for the entry. + +
+
+ +
+
+ +**host:** `String` — The host, by id or uid. + +
+
+ +
+
+ +**start:** `String` — An ISO 8601 instant with an offset. + +
+
+ +
+
+ +**end_:** `String` — An ISO 8601 instant with an offset. + +
+
+ +
+
+ +**start_date:** `String` — The first whole day away. Use instead of `start` and `end`. + +
+
+ +
+
+ +**end_date:** `String` — The last whole day away, which is included. + +
+
+ +
+
+ +**time_zone:** `String` — What the dates mean in. Default: the host's zone when this is made. + +
+
+ +
+
+ +**delegates:** `Internal::Types::Array[String]` — Who can be booked in this host's place during it, by id or uid, in the order to try them. They still have to fit how a booking's routed. + +
+
+ +
+
+ +**reason:** `String` — One of `unspecified`, `vacation`, `travel`, `sick`, `public_holiday`, `parental_leave`, `training` and `other`, or a key from the settings' `out_of_office_reasons`. Only people who manage this host see it: never bookers, webhooks or calendars. + +
+
+ +
+
+ +**notes:** `String` — For people who manage this host. Encrypted, and never shown to a booker. + +
+
+ +
+
+ +**public_message:** `String` — Shown to bookers while this host is away. Can't contain a link. + +
+
+ +
+
+ +**show_on_calendar:** `Internal::Types::Boolean` — Put a private "Out of office" event on the host's calendar. Default: true. + +
+
+ +
+
+ +**existing_bookings:** `Coss::Scheduling::OutOfOffice::Types::PutSchedulingOutOfOfficeRequestExistingBookings` — What happens to bookings already in the way. `leave` (the default) only reports them. `reassign` moves them, and any nobody can take stay where they are. + +
+
+ +
+
+ +**reassign:** `Coss::Scheduling::OutOfOffice::Types::PutSchedulingOutOfOfficeRequestReassign` — With `existing_bookings: reassign`: who they go to. Default: the fairest who's free. + +
+
+ +
+
+ +**request_options:** `Coss::Scheduling::OutOfOffice::RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.scheduling.out_of_office.conflicts(id:) -> Coss::Types::SchedulingOutOfOfficeConflictList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Live bookings of the host that fall in the entry, soonest first. Entries never change them. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```ruby +client.scheduling.out_of_office.conflicts(id: "ooo_01kd2m9a0b1c2d3e4f5g6h7j8m") +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — The entry's id. + +
+
+ +
+
+ +**limit:** `Integer` + +
+
+ +
+
+ +**request_options:** `Coss::Scheduling::OutOfOffice::RequestOptions` + +
+
+
+
+ + +
+
+
+ +## Scheduling Schedules +
client.scheduling.schedules.list(host:) -> Coss::Types::SchedulingScheduleList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +All of the host's schedules, oldest first. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```ruby +client.scheduling.schedules.list(host: "host_01kd2m9a0b1c2d3e4f5g6h7j8m") +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**host:** `String` — The host's id or uid. + +
+
+ +
+
+ +**request_options:** `Coss::Scheduling::Schedules::RequestOptions`
+
+
+ + +
+
+
+ +
client.scheduling.schedules.create(host:, request) -> Coss::Types::SchedulingSchedule +
+
+ +#### 📝 Description + +
+
-**step_minutes:** `Integer` — How far apart slots start. Default: the duration. - +A host's weekly hours and date overrides, in local time. The first one is the host's default. +
+
+#### 🔌 Usage +
-**grid_time_zone:** `String` — The zone slots align in. Default: each host's own. - +
+
+ +```ruby +client.scheduling.schedules.create( + host: "host_01kd2m9a0b1c2d3e4f5g6h7j8m", + name: "Clinic hours", + rules: [{ + days: [1, 2, 3, 4, 5], + start: "09:00", + end_: "17:00" + }], + overrides: [{ + date: "2027-12-24", + ranges: [{ + start: "start", + end_: "end" + }] + }] +) +``` +
+
+#### ⚙️ Parameters +
-**buffer_before_minutes:** `Integer` — Minutes kept free before each booking. Default: 0. +
+
+ +**host:** `String` — The host's id or uid.
@@ -18955,7 +21463,7 @@ client.scheduling.event_types.create(
-**buffer_after_minutes:** `Integer` — Minutes kept free after each booking. Default: 0. +**request:** `Coss::Types::UpsertScheduleRequest`
@@ -18963,47 +21471,64 @@ client.scheduling.event_types.create(
-**min_notice_minutes:** `Integer` — Slots starting sooner than this many minutes from now aren't offered. Default: 0. +**request_options:** `Coss::Scheduling::Schedules::RequestOptions`
+
+
-
-
-**booking_window:** `Coss::Types::SchedulingBookingWindow` -
+
+
client.scheduling.schedules.get(host:, schedule_id:) -> Coss::Types::SchedulingSchedule
-**limits:** `Internal::Types::Array[Coss::Types::SchedulingLimit]` — Caps on bookings per day or week. Default: none. - -
-
+#### 📝 Description
-**capacity:** `Integer` — Attendees per session. Required for, and only allowed on, `group`. - +
+
+ +One of the host's schedules. +
+
+#### 🔌 Usage +
-**requires_approval:** `Internal::Types::Boolean` — Bookings start as `pending_approval`, holding the time until approved or declined. Default: `false`. - +
+
+ +```ruby +client.scheduling.schedules.get( + host: "host_01kd2m9a0b1c2d3e4f5g6h7j8m", + schedule_id: "sched_01kd2m9a0b1c2d3e4f5g6h7j8m" +) +``` +
+
+#### ⚙️ Parameters +
-**approval_ttl_minutes:** `Integer` — How long a booking can wait for approval before it's declined, in minutes. Default: 1440. +
+
+ +**host:** `String` — The host's id or uid.
@@ -19011,7 +21536,7 @@ client.scheduling.event_types.create(
-**hold_ttl_seconds:** `Integer` — How long a hold keeps its slot, in seconds. Default: 600. +**schedule_id:** `String` — The schedule's id.
@@ -19019,39 +21544,77 @@ client.scheduling.event_types.create(
-**cancel_notice_minutes:** `Integer` — Attendees can't cancel closer to the start than this. API keys can. +**request_options:** `Coss::Scheduling::Schedules::RequestOptions`
+
+
-
-
-**reschedule_notice_minutes:** `Integer` — Attendees can't reschedule closer to the start than this. API keys can. Default: 0. -
+
+
client.scheduling.schedules.update(host:, schedule_id:, request) -> Coss::Types::SchedulingSchedule
-**max_guests:** `Integer` — How many people an attendee can add to a booking. Default: 0. Guests are emailed about it. Not on `group`. - +#### 📝 Description + +
+
+ +
+
+ +Replaces its weekly rules, and its overrides when given. Existing bookings stay: a schedule only decides what's offered next. +
+
+#### 🔌 Usage +
-**max_active_bookings_per_attendee:** `Integer` — How many upcoming bookings of this event type one person can have at a time, known by `uid` or email. Default: `null`, no limit. Past this, booking answers `attendee_limit_reached`. Guests don't count, and each occurrence of a series does. - +
+
+ +```ruby +client.scheduling.schedules.update( + host: "host_01kd2m9a0b1c2d3e4f5g6h7j8m", + schedule_id: "sched_01kd2m9a0b1c2d3e4f5g6h7j8m", + name: "Clinic hours", + rules: [{ + days: [1, 2, 3, 4, 5], + start: "09:00", + end_: "17:00" + }], + overrides: [{ + date: "2027-12-24", + ranges: [{ + start: "start", + end_: "end" + }] + }] +) +``` +
+
+#### ⚙️ Parameters +
-**host_calendar_details:** `Coss::Scheduling::EventTypes::Types::CreateEventTypeRequestHostCalendarDetails` — What hosts' calendars say about a booking. `neutral` (the default): a private event titled "Appointment". `full`: a private event with this title and the attendee's name, plus names, emails and phone numbers in its description, which go to the host's calendar provider. Never answers. Refused in HIPAA mode. +
+
+ +**host:** `String` — The host's id or uid.
@@ -19059,7 +21622,7 @@ client.scheduling.event_types.create(
-**questions:** `Internal::Types::Array[Coss::Types::SchedulingQuestion]` — What attendees are asked when booking. Keys must be unique. +**schedule_id:** `String` — The schedule's id.
@@ -19067,7 +21630,7 @@ client.scheduling.event_types.create(
-**locations:** `Internal::Types::Array[Coss::Types::SchedulingLocation]` — Where bookings can meet. A browser only chooses among these. A `group` event type can't use `zoom`. +**request:** `Coss::Types::UpsertScheduleRequest`
@@ -19075,31 +21638,64 @@ client.scheduling.event_types.create(
-**host_filter:** `Internal::Types::Hash[String, Coss::Scheduling::EventTypes::Types::CreateEventTypeRequestHostFilterValue]` — Pool members also include active hosts matching all of these attributes. +**request_options:** `Coss::Scheduling::Schedules::RequestOptions`
+
+
+ + +
+
+
+ +
client.scheduling.schedules.remove(host:, schedule_id:) -> Coss::Types::DeletedSchedulingSchedule +
+
+ +#### 📝 Description
-**notifications:** `Internal::Types::Hash[String, Coss::Scheduling::EventTypes::Types::CreateEventTypeRequestNotificationsValue]` — Per event, overriding your settings for this event type. - +
+
+ +Refused for the host's default schedule. +
+
+#### 🔌 Usage +
-**reminders:** `Internal::Types::Array[Coss::Types::SchedulingReminderInput]` — Replaces your settings' `reminders` for this event type. `null` inherits them; an empty list means none. - +
+
+ +```ruby +client.scheduling.schedules.remove( + host: "host_01kd2m9a0b1c2d3e4f5g6h7j8m", + schedule_id: "sched_01kd2m9a0b1c2d3e4f5g6h7j8m" +) +``` +
+
+#### ⚙️ Parameters +
-**metadata:** `Internal::Types::Hash[String, String]` — Your own key-value pairs. +
+
+ +**host:** `String` — The host's id or uid.
@@ -19107,7 +21703,7 @@ client.scheduling.event_types.create(
-**hosts:** `Internal::Types::Array[Coss::Types::SchedulingEventTypeHostInput]` — Who can be booked. `one_on_one` and `group` take one; `collective` needs at least one `required` host. +**schedule_id:** `String` — The schedule's id.
@@ -19115,7 +21711,7 @@ client.scheduling.event_types.create(
-**request_options:** `Coss::Scheduling::EventTypes::RequestOptions` +**request_options:** `Coss::Scheduling::Schedules::RequestOptions`
@@ -19127,7 +21723,8 @@ client.scheduling.event_types.create(
-
client.scheduling.event_types.get(event_type:) -> Coss::Types::SchedulingEventType +## Scheduling EventTypes +
client.scheduling.event_types.list() -> Coss::Types::SchedulingEventTypeList
@@ -19139,7 +21736,7 @@ client.scheduling.event_types.create(
-An event type by its id or your uid. +The environment's event types, newest first.
@@ -19154,7 +21751,7 @@ An event type by its id or your uid.
```ruby -client.scheduling.event_types.get(event_type: "evtype_01kd2m9a0b1c2d3e4f5g6h7j8m") +client.scheduling.event_types.list ```
@@ -19169,7 +21766,15 @@ client.scheduling.event_types.get(event_type: "evtype_01kd2m9a0b1c2d3e4f5g6h7j8m
-**event_type:** `String` — The event type's id or uid. +**limit:** `Integer` + +
+
+ +
+
+ +**after:** `String` — The last id of the previous page.
@@ -19189,7 +21794,7 @@ client.scheduling.event_types.get(event_type: "evtype_01kd2m9a0b1c2d3e4f5g6h7j8m
-
client.scheduling.event_types.update(event_type:, request) -> Coss::Types::SchedulingEventType +
client.scheduling.event_types.create(request) -> Coss::Types::SchedulingEventType
@@ -19201,7 +21806,7 @@ client.scheduling.event_types.get(event_type: "evtype_01kd2m9a0b1c2d3e4f5g6h7j8m
-Changes what's given. Existing bookings keep what they were booked with. Set `status` to `archived` to stop new bookings. +What can be booked: `one_on_one` with one host, `pool` for any free host, `collective` when every required host must be free, or `group` for a session with seats.
@@ -19216,9 +21821,15 @@ Changes what's given. Existing bookings keep what they were booked with. Set `st
```ruby -client.scheduling.event_types.update( - event_type: "evtype_01kd2m9a0b1c2d3e4f5g6h7j8m", - min_notice_minutes: 240 +client.scheduling.event_types.create( + kind: "one_on_one", + title: "Initial consultation", + duration_minutes: 30, + buffer_after_minutes: 10, + min_notice_minutes: 120, + hosts: [{ + host: "doctor_482" + }] ) ```
@@ -19234,7 +21845,7 @@ client.scheduling.event_types.update(
-**event_type:** `String` — The event type's id or uid. +**uid:** `String` — Your own id for this event type, unique in the environment, accepted wherever its id is.
@@ -19242,7 +21853,7 @@ client.scheduling.event_types.update(
-**uid:** `String` — Your own id for this event type. `null` removes it. +**kind:** `Coss::Scheduling::EventTypes::Types::CreateEventTypeRequestKind` — Who a booking needs. `one_on_one`: one host. `pool`: any one of its hosts. `collective`: every `required` host, plus at most one `member`. `group`: one host, with attendees taking seats up to `capacity`. Fixed once created.
@@ -19354,6 +21965,14 @@ client.scheduling.event_types.update(
+**reassignment_enabled:** `Internal::Types::Boolean` — Whether bookings of this event type can go to another host. Default: true. + +
+
+ +
+
+ **approval_ttl_minutes:** `Integer` — How long a booking can wait for approval before it's declined, in minutes. Default: 1440.
@@ -19402,7 +22021,7 @@ client.scheduling.event_types.update(
-**host_calendar_details:** `Coss::Scheduling::EventTypes::Types::UpdateEventTypeRequestHostCalendarDetails` — What hosts' calendars say about a booking. `neutral` (the default): a private event titled "Appointment". `full`: a private event with this title and the attendee's name, plus names, emails and phone numbers in its description, which go to the host's calendar provider. Never answers. Refused in HIPAA mode. +**host_calendar_details:** `Coss::Scheduling::EventTypes::Types::CreateEventTypeRequestHostCalendarDetails` — What hosts' calendars say about a booking. `neutral` (the default): a private event titled "Appointment". `full`: a private event with this title and the attendee's name, plus names, emails and phone numbers in its description, which go to the host's calendar provider. Never answers. Refused in HIPAA mode.
@@ -19426,15 +22045,7 @@ client.scheduling.event_types.update(
-**host_filter:** `Internal::Types::Hash[String, Coss::Scheduling::EventTypes::Types::UpdateEventTypeRequestHostFilterValue]` — Pool members also include active hosts matching all of these attributes. - -
-
- -
-
- -**notifications:** `Internal::Types::Hash[String, Coss::Scheduling::EventTypes::Types::UpdateEventTypeRequestNotificationsValue]` — Per event, overriding your settings for this event type. +**host_filter:** `Internal::Types::Hash[String, Coss::Scheduling::EventTypes::Types::CreateEventTypeRequestHostFilterValue]` — Pool members also include active hosts matching all of these attributes.
@@ -19442,7 +22053,7 @@ client.scheduling.event_types.update(
-**reminders:** `Internal::Types::Array[Coss::Types::SchedulingReminderInput]` — Replaces your settings' `reminders` for this event type. `null` inherits them; an empty list means none. +**notifications:** `Internal::Types::Hash[String, Coss::Scheduling::EventTypes::Types::CreateEventTypeRequestNotificationsValue]` — Per event, overriding your settings for this event type.
@@ -19450,7 +22061,7 @@ client.scheduling.event_types.update(
-**metadata:** `Internal::Types::Hash[String, String]` — Your own key-value pairs. +**reminders:** `Internal::Types::Array[Coss::Types::SchedulingReminderInput]` — Replaces your settings' `reminders` for this event type. `null` inherits them; an empty list means none.
@@ -19458,7 +22069,7 @@ client.scheduling.event_types.update(
-**status:** `Coss::Scheduling::EventTypes::Types::UpdateEventTypeRequestStatus` — `archived` stops new bookings, and keeps existing ones. +**metadata:** `Internal::Types::Hash[String, String]` — Your own key-value pairs.
@@ -19466,7 +22077,7 @@ client.scheduling.event_types.update(
-**hosts:** `Internal::Types::Array[Coss::Types::SchedulingEventTypeHostInput]` — Replaces the assigned hosts. Removed hosts keep their existing bookings. +**hosts:** `Internal::Types::Array[Coss::Types::SchedulingEventTypeHostInput]` — Who can be booked. `one_on_one` and `group` take one; `collective` needs at least one `required` host.
@@ -19486,8 +22097,7 @@ client.scheduling.event_types.update(
-## Scheduling Slots -
client.scheduling.slots.list(event_type:) -> Coss::Types::SchedulingSlotList +
client.scheduling.event_types.get(event_type:) -> Coss::Types::SchedulingEventType
@@ -19499,7 +22109,7 @@ client.scheduling.event_types.update(
-Starts an attendee can book between `start` and `end` (at most 62 days), as UTC instants to show in their own time zone. A host whose calendar can't be read isn't offered. +An event type by its id or your uid.
@@ -19514,11 +22124,7 @@ Starts an attendee can book between `start` and `end` (at most 62 days), as UTC
```ruby -client.scheduling.slots.list( - event_type: "evtype_01kd2m9a0b1c2d3e4f5g6h7j8m", - start: "2027-01-04T15:00:00.000Z", - end_: "2027-01-04T15:00:00.000Z" -) +client.scheduling.event_types.get(event_type: "evtype_01kd2m9a0b1c2d3e4f5g6h7j8m") ```
@@ -19541,47 +22147,7 @@ client.scheduling.slots.list(
-**start:** `String` — An ISO 8601 instant with an offset. - -
-
- -
-
- -**end_:** `String` — An ISO 8601 instant with an offset. - -
-
- -
-
- -**host:** `String` — Only this host's slots (id or uid). - -
-
- -
-
- -**duration_minutes:** `Integer` - -
-
- -
-
- -**attributes:** `String` — A JSON object narrowing a pool, such as `{"licensed_in":"CA"}`. - -
-
- -
-
- -**request_options:** `Coss::Scheduling::Slots::RequestOptions` +**request_options:** `Coss::Scheduling::EventTypes::RequestOptions`
@@ -19593,7 +22159,7 @@ client.scheduling.slots.list(
-
client.scheduling.slots.explain(event_type:) -> Coss::Types::SchedulingSlotExplanation +
client.scheduling.event_types.update(event_type:, request) -> Coss::Types::SchedulingEventType
@@ -19605,7 +22171,7 @@ client.scheduling.slots.list(
-Why one start can or can't be booked right now, host by host, decided the same way a booking is. For support and debugging: it says when a host is busy, so don't show it to attendees. +Changes what's given. Existing bookings keep what they were booked with. Set `status` to `archived` to stop new bookings.
@@ -19620,9 +22186,9 @@ Why one start can or can't be booked right now, host by host, decided the same w
```ruby -client.scheduling.slots.explain( +client.scheduling.event_types.update( event_type: "evtype_01kd2m9a0b1c2d3e4f5g6h7j8m", - start: "2027-01-04T15:00:00.000Z" + min_notice_minutes: 240 ) ```
@@ -19646,7 +22212,7 @@ client.scheduling.slots.explain(
-**start:** `String` — An ISO 8601 instant with an offset. +**uid:** `String` — Your own id for this event type. `null` removes it.
@@ -19654,7 +22220,7 @@ client.scheduling.slots.explain(
-**host:** `String` — Only this host (id or uid). +**description:** `String` — Plain text about the event type, shown on hosted booking pages and never in emails. Links, and anything shaped like a domain, must be on your organization's verified domains or their subdomains, and use `https`. `null` removes it.
@@ -19662,7 +22228,7 @@ client.scheduling.slots.explain(
-**duration_minutes:** `Integer` +**title:** `String` — Shown to attendees and in emails. Host calendars show it only with `host_calendar_details: full`.
@@ -19670,7 +22236,7 @@ client.scheduling.slots.explain(
-**attributes:** `String` — A JSON object narrowing a pool, such as `{"licensed_in":"CA"}`. +**duration_minutes:** `Integer` — How long a booking lasts by default, in minutes.
@@ -19678,69 +22244,47 @@ client.scheduling.slots.explain(
-**request_options:** `Coss::Scheduling::Slots::RequestOptions` +**duration_options:** `Internal::Types::Array[Integer]` — Other lengths an attendee may choose, in minutes. Empty: only `duration_minutes`.
- -
+
+
+**step_minutes:** `Integer` — How far apart slots start. Default: the duration. +
-
-## Scheduling Availability -
client.scheduling.availability.search(request) -> Coss::Types::SchedulingAvailabilitySearchResult
-#### 📝 Description - -
-
+**grid_time_zone:** `String` — The zone slots align in. Default: each host's own. + +
+
-For "who's free" pages: each matching host's soonest slots, soonest first, across up to 500 hosts. -
-
+**buffer_before_minutes:** `Integer` — Minutes kept free before each booking. Default: 0. +
-#### 🔌 Usage - -
-
-
-```ruby -client.scheduling.availability.search( - event_type: "evtype_01kd2m9a0b1c2d3e4f5g6h7j8m", - start: "2027-01-04T00:00:00.000Z", - end_: "2027-01-18T00:00:00.000Z", - attributes: { - licensed_in: "CA" - } -) -``` -
-
+**buffer_after_minutes:** `Integer` — Minutes kept free after each booking. Default: 0. +
-#### ⚙️ Parameters - -
-
-
-**event_type:** `String` — The event type's id or uid. +**min_notice_minutes:** `Integer` — Slots starting sooner than this many minutes from now aren't offered. Default: 0.
@@ -19748,7 +22292,7 @@ client.scheduling.availability.search(
-**start:** `String` — An ISO 8601 instant with an offset. +**booking_window:** `Coss::Types::SchedulingBookingWindow`
@@ -19756,7 +22300,7 @@ client.scheduling.availability.search(
-**end_:** `String` — An ISO 8601 instant with an offset. +**limits:** `Internal::Types::Array[Coss::Types::SchedulingLimit]` — Caps on bookings per day or week. Default: none.
@@ -19764,7 +22308,7 @@ client.scheduling.availability.search(
-**attributes:** `Internal::Types::Hash[String, Coss::Scheduling::Availability::Types::AvailabilitySearchRequestAttributesValue]` — Only hosts matching all of these. +**capacity:** `Integer` — Attendees per session. Required for, and only allowed on, `group`.
@@ -19772,7 +22316,7 @@ client.scheduling.availability.search(
-**hosts:** `Internal::Types::Array[String]` — Only these hosts (ids or uids). Default: everyone the event type could offer. +**requires_approval:** `Internal::Types::Boolean` — Bookings start as `pending_approval`, holding the time until approved or declined. Default: `false`.
@@ -19780,7 +22324,7 @@ client.scheduling.availability.search(
-**slots_per_host:** `Integer` — How many of each host's soonest slots to return. +**reassignment_enabled:** `Internal::Types::Boolean` — Whether bookings of this event type can go to another host. Default: true.
@@ -19788,7 +22332,7 @@ client.scheduling.availability.search(
-**limit:** `Integer` — Hosts to return, soonest availability first. +**approval_ttl_minutes:** `Integer` — How long a booking can wait for approval before it's declined, in minutes. Default: 1440.
@@ -19796,65 +22340,55 @@ client.scheduling.availability.search(
-**request_options:** `Coss::Scheduling::Availability::RequestOptions` +**hold_ttl_seconds:** `Integer` — How long a hold keeps its slot, in seconds. Default: 600.
-
-
+
+
+**cancel_notice_minutes:** `Integer` — Attendees can't cancel closer to the start than this. API keys can. +
-
-## Scheduling Bookings -
client.scheduling.bookings.list() -> Coss::Types::SchedulingBookingList
-#### 📝 Description - -
-
+**reschedule_notice_minutes:** `Integer` — Attendees can't reschedule closer to the start than this. API keys can. Default: 0. + +
+
-The environment's bookings, newest first. Answers aren't included. -
-
+**max_guests:** `Integer` — How many people an attendee can add to a booking. Default: 0. Guests are emailed about it. Not on `group`. +
-#### 🔌 Usage - -
-
-
-```ruby -client.scheduling.bookings.list( - start_after: "2027-01-04T15:00:00.000Z", - start_before: "2027-01-04T15:00:00.000Z" -) -``` -
-
+**max_active_bookings_per_attendee:** `Integer` — How many upcoming bookings of this event type one person can have at a time, known by `uid` or email. Default: `null`, no limit. Past this, booking answers `attendee_limit_reached`. Guests don't count, and each occurrence of a series does. +
-#### ⚙️ Parameters -
+**host_calendar_details:** `Coss::Scheduling::EventTypes::Types::UpdateEventTypeRequestHostCalendarDetails` — What hosts' calendars say about a booking. `neutral` (the default): a private event titled "Appointment". `full`: a private event with this title and the attendee's name, plus names, emails and phone numbers in its description, which go to the host's calendar provider. Never answers. Refused in HIPAA mode. + +
+
+
-**limit:** `Integer` +**questions:** `Internal::Types::Array[Coss::Types::SchedulingQuestion]` — What attendees are asked when booking. Keys must be unique.
@@ -19862,7 +22396,7 @@ client.scheduling.bookings.list(
-**after:** `String` — The last id of the previous page. +**locations:** `Internal::Types::Array[Coss::Types::SchedulingLocation]` — Where bookings can meet. A browser only chooses among these. A `group` event type can't use `zoom`.
@@ -19870,7 +22404,7 @@ client.scheduling.bookings.list(
-**host:** `String` +**host_filter:** `Internal::Types::Hash[String, Coss::Scheduling::EventTypes::Types::UpdateEventTypeRequestHostFilterValue]` — Pool members also include active hosts matching all of these attributes.
@@ -19878,7 +22412,7 @@ client.scheduling.bookings.list(
-**event_type:** `String` +**notifications:** `Internal::Types::Hash[String, Coss::Scheduling::EventTypes::Types::UpdateEventTypeRequestNotificationsValue]` — Per event, overriding your settings for this event type.
@@ -19886,7 +22420,7 @@ client.scheduling.bookings.list(
-**status:** `Coss::Scheduling::Bookings::Types::ListBookingsRequestStatus` +**reminders:** `Internal::Types::Array[Coss::Types::SchedulingReminderInput]` — Replaces your settings' `reminders` for this event type. `null` inherits them; an empty list means none.
@@ -19894,7 +22428,7 @@ client.scheduling.bookings.list(
-**attendee_uid:** `String` +**metadata:** `Internal::Types::Hash[String, String]` — Your own key-value pairs.
@@ -19902,7 +22436,7 @@ client.scheduling.bookings.list(
-**start_after:** `String` — An ISO 8601 instant with an offset. +**status:** `Coss::Scheduling::EventTypes::Types::UpdateEventTypeRequestStatus` — `archived` stops new bookings, and keeps existing ones.
@@ -19910,7 +22444,7 @@ client.scheduling.bookings.list(
-**start_before:** `String` — An ISO 8601 instant with an offset. +**hosts:** `Internal::Types::Array[Coss::Types::SchedulingEventTypeHostInput]` — Replaces the assigned hosts. Removed hosts keep their existing bookings.
@@ -19918,7 +22452,7 @@ client.scheduling.bookings.list(
-**request_options:** `Coss::Scheduling::Bookings::RequestOptions` +**request_options:** `Coss::Scheduling::EventTypes::RequestOptions`
@@ -19930,7 +22464,8 @@ client.scheduling.bookings.list(
-
client.scheduling.bookings.create(request) -> Coss::Types::SchedulingBooking +## Scheduling Slots +
client.scheduling.slots.list(event_type:) -> Coss::Types::SchedulingSlotList
@@ -19942,7 +22477,7 @@ client.scheduling.bookings.list(
-Books a slot, or joins a group session. Without a `host`, a pool chooses fairly among those free. An event type that requires approval answers with a `pending_approval` booking. +Starts an attendee can book between `start` and `end` (at most 62 days), as UTC instants to show in their own time zone. A host whose calendar can't be read isn't offered.
@@ -19957,16 +22492,10 @@ Books a slot, or joins a group session. Without a `host`, a pool chooses fairly
```ruby -client.scheduling.bookings.create( - idempotency_key: "welcome-user-123", +client.scheduling.slots.list( event_type: "evtype_01kd2m9a0b1c2d3e4f5g6h7j8m", start: "2027-01-04T15:00:00.000Z", - attendee: { - uid: "patient_77", - name: "Sam Lee", - email: "sam@example.com", - time_zone: "UTC" - } + end_: "2027-01-04T15:00:00.000Z" ) ```
@@ -19982,14 +22511,6 @@ client.scheduling.bookings.create(
-**idempotency_key:** `String` — Makes retries safe: a repeated request with the same key and body returns the original booking instead of creating another, for 24 hours. A refused request keeps no key. 1-256 characters. - -
-
- -
-
- **event_type:** `String` — The event type's id or uid.
@@ -20006,39 +22527,7 @@ client.scheduling.bookings.create(
-**host:** `String` — A specific host (id or uid). Default: chosen fairly from those free. - -
-
- -
-
- -**attributes:** `Internal::Types::Hash[String, Coss::Scheduling::Bookings::Types::CreateBookingRequestAttributesValue]` — Only choose among pool hosts matching all of these. - -
-
- -
-
- -**duration_minutes:** `Integer` — One of the event type's `duration_options`. - -
-
- -
-
- -**attendee:** `Coss::Types::SchedulingAttendeeInput` - -
-
- -
-
- -**guests:** `Internal::Types::Array[Coss::Types::SchedulingGuestInput]` — Up to the event type's `max_guests`. +**end_:** `String` — An ISO 8601 instant with an offset.
@@ -20046,7 +22535,7 @@ client.scheduling.bookings.create(
-**answers:** `Internal::Types::Hash[String, Coss::Scheduling::Bookings::Types::CreateBookingRequestAnswersValue]` — Answers to the event type's questions. Stored encrypted, and returned only by retrieving the booking. +**host:** `String` — Only this host's slots (id or uid).
@@ -20054,7 +22543,7 @@ client.scheduling.bookings.create(
-**location:** `Coss::Scheduling::Bookings::Types::CreateBookingRequestLocation` — One of the event type's `locations`, with your link filled in if it has none. +**duration_minutes:** `Integer`
@@ -20062,7 +22551,7 @@ client.scheduling.bookings.create(
-**metadata:** `Internal::Types::Hash[String, String]` — Your own key-value pairs. Don't put sensitive data here. +**attributes:** `String` — A JSON object narrowing a pool, such as `{"licensed_in":"CA"}`.
@@ -20070,7 +22559,7 @@ client.scheduling.bookings.create(
-**request_options:** `Coss::Scheduling::Bookings::RequestOptions` +**request_options:** `Coss::Scheduling::Slots::RequestOptions`
@@ -20082,7 +22571,7 @@ client.scheduling.bookings.create(
-
client.scheduling.bookings.get(id:) -> Coss::Types::SchedulingBooking +
client.scheduling.slots.explain(event_type:) -> Coss::Types::SchedulingSlotExplanation
@@ -20094,7 +22583,7 @@ client.scheduling.bookings.create(
-A booking with its attendees and their answers. +Why one start can or can't be booked right now, host by host, decided the same way a booking is. For support and debugging: it says when a host is busy, so don't show it to attendees.
@@ -20109,7 +22598,10 @@ A booking with its attendees and their answers.
```ruby -client.scheduling.bookings.get(id: "book_01kd2m9a0b1c2d3e4f5g6h7j8m") +client.scheduling.slots.explain( + event_type: "evtype_01kd2m9a0b1c2d3e4f5g6h7j8m", + start: "2027-01-04T15:00:00.000Z" +) ```
@@ -20124,7 +22616,7 @@ client.scheduling.bookings.get(id: "book_01kd2m9a0b1c2d3e4f5g6h7j8m")
-**id:** `String` — The booking's id. +**event_type:** `String` — The event type's id or uid.
@@ -20132,7 +22624,39 @@ client.scheduling.bookings.get(id: "book_01kd2m9a0b1c2d3e4f5g6h7j8m")
-**request_options:** `Coss::Scheduling::Bookings::RequestOptions` +**start:** `String` — An ISO 8601 instant with an offset. + +
+
+ +
+
+ +**host:** `String` — Only this host (id or uid). + +
+
+ +
+
+ +**duration_minutes:** `Integer` + +
+
+ +
+
+ +**attributes:** `String` — A JSON object narrowing a pool, such as `{"licensed_in":"CA"}`. + +
+
+ +
+
+ +**request_options:** `Coss::Scheduling::Slots::RequestOptions`
@@ -20144,7 +22668,8 @@ client.scheduling.bookings.get(id: "book_01kd2m9a0b1c2d3e4f5g6h7j8m")
-
client.scheduling.bookings.reschedule(id:, request) -> Coss::Types::SchedulingBooking +## Scheduling Availability +
client.scheduling.availability.search(request) -> Coss::Types::SchedulingAvailabilitySearchResult
@@ -20156,7 +22681,7 @@ client.scheduling.bookings.get(id: "book_01kd2m9a0b1c2d3e4f5g6h7j8m")
-Moves it to a new time, keeping its id. The old time stays booked if the new one isn't free. +For "who's free" pages: each matching host's soonest slots, soonest first, across up to 500 hosts.
@@ -20171,9 +22696,13 @@ Moves it to a new time, keeping its id. The old time stays booked if the new one
```ruby -client.scheduling.bookings.reschedule( - id: "book_01kd2m9a0b1c2d3e4f5g6h7j8m", - start: "2027-01-05T15:00:00.000Z" +client.scheduling.availability.search( + event_type: "evtype_01kd2m9a0b1c2d3e4f5g6h7j8m", + start: "2027-01-04T00:00:00.000Z", + end_: "2027-01-18T00:00:00.000Z", + attributes: { + licensed_in: "CA" + } ) ```
@@ -20189,7 +22718,7 @@ client.scheduling.bookings.reschedule(
-**id:** `String` — The booking's id. +**event_type:** `String` — The event type's id or uid.
@@ -20197,7 +22726,7 @@ client.scheduling.bookings.reschedule(
-**start:** `String` — The new start. The old time stays booked unless this one's free. +**start:** `String` — An ISO 8601 instant with an offset.
@@ -20205,7 +22734,7 @@ client.scheduling.bookings.reschedule(
-**host:** `String` — Move a pool booking to this host. Default: its current hosts. +**end_:** `String` — An ISO 8601 instant with an offset.
@@ -20213,7 +22742,39 @@ client.scheduling.bookings.reschedule(
-**request_options:** `Coss::Scheduling::Bookings::RequestOptions` +**attributes:** `Internal::Types::Hash[String, Coss::Scheduling::Availability::Types::AvailabilitySearchRequestAttributesValue]` — Only hosts matching all of these. + +
+
+ +
+
+ +**hosts:** `Internal::Types::Array[String]` — Only these hosts (ids or uids). Default: everyone the event type could offer. + +
+
+ +
+
+ +**slots_per_host:** `Integer` — How many of each host's soonest slots to return. + +
+
+ +
+
+ +**limit:** `Integer` — Hosts to return, soonest availability first. + +
+
+ +
+
+ +**request_options:** `Coss::Scheduling::Availability::RequestOptions`
@@ -20225,7 +22786,8 @@ client.scheduling.bookings.reschedule(
-
client.scheduling.bookings.cancel(id:, request) -> Coss::Types::SchedulingBooking +## Scheduling Holds +
client.scheduling.holds.create(request) -> Coss::Types::SchedulingBooking
@@ -20237,7 +22799,7 @@ client.scheduling.bookings.reschedule(
-Frees the time and removes the calendar event. A cancelled booking stays charged. +Keeps a slot for a while (the event type's `hold_ttl_seconds`) so you can take payment, then confirm it. Answers with a `held` booking, which isn't charged and sends nothing.
@@ -20252,9 +22814,14 @@ Frees the time and removes the calendar event. A cancelled booking stays charged
```ruby -client.scheduling.bookings.cancel( - id: "book_01kd2m9a0b1c2d3e4f5g6h7j8m", - reason: "Feeling better" +client.scheduling.holds.create( + idempotency_key: "welcome-user-123", + event_type: "evtype_01kd2m9a0b1c2d3e4f5g6h7j8m", + start: "2027-01-04T15:00:00.000Z", + attendee: { + uid: "patient_77", + time_zone: "UTC" + } ) ```
@@ -20270,7 +22837,7 @@ client.scheduling.bookings.cancel(
-**id:** `String` — The booking's id. +**idempotency_key:** `String` — Makes retries safe: a repeated request with the same key and body returns the original booking instead of creating another, for 24 hours. A refused request keeps no key. 1-256 characters.
@@ -20278,7 +22845,7 @@ client.scheduling.bookings.cancel(
-**reason:** `String` — Why it's being cancelled. Only retrieving this booking returns it: it's never in webhooks, logs or emails. +**event_type:** `String` — The event type's id or uid.
@@ -20286,61 +22853,55 @@ client.scheduling.bookings.cancel(
-**request_options:** `Coss::Scheduling::Bookings::RequestOptions` +**start:** `String` — An ISO 8601 instant with an offset.
- -
+
+
+**host:** `String` — A specific host (id or uid). Default: chosen fairly from those free. +
-
-
client.scheduling.bookings.events(id:) -> Coss::Types::SchedulingBookingEventList
-#### 📝 Description - -
-
+**attributes:** `Internal::Types::Hash[String, Coss::Scheduling::Holds::Types::CreateHoldRequestAttributesValue]` — Only choose among pool hosts matching all of these. + +
+
-What's happened to a booking, oldest first, and who did it. There's no personal data in here. -
-
+**duration_minutes:** `Integer` — One of the event type's `duration_options`. +
-#### 🔌 Usage - -
-
-
-```ruby -client.scheduling.bookings.events(id: "book_01kd2m9a0b1c2d3e4f5g6h7j8m") -``` -
-
+**attendee:** `Coss::Types::SchedulingAttendeeInput` +
-#### ⚙️ Parameters -
+**guests:** `Internal::Types::Array[Coss::Types::SchedulingGuestInput]` — Up to the event type's `max_guests`. + +
+
+
-**id:** `String` — The booking's id. +**answers:** `Internal::Types::Hash[String, Coss::Scheduling::Holds::Types::CreateHoldRequestAnswersValue]` — Answers to the event type's questions. Stored encrypted, and returned only by retrieving the booking.
@@ -20348,7 +22909,7 @@ client.scheduling.bookings.events(id: "book_01kd2m9a0b1c2d3e4f5g6h7j8m")
-**limit:** `Integer` +**location:** `Coss::Scheduling::Holds::Types::CreateHoldRequestLocation` — One of the event type's `locations`, with your link filled in if it has none.
@@ -20356,7 +22917,7 @@ client.scheduling.bookings.events(id: "book_01kd2m9a0b1c2d3e4f5g6h7j8m")
-**after:** `String` — The last id of the previous page. +**metadata:** `Internal::Types::Hash[String, String]` — Your own key-value pairs. Don't put sensitive data here.
@@ -20364,7 +22925,7 @@ client.scheduling.bookings.events(id: "book_01kd2m9a0b1c2d3e4f5g6h7j8m")
-**request_options:** `Coss::Scheduling::Bookings::RequestOptions` +**request_options:** `Coss::Scheduling::Holds::RequestOptions`
@@ -20376,7 +22937,7 @@ client.scheduling.bookings.events(id: "book_01kd2m9a0b1c2d3e4f5g6h7j8m")
-
client.scheduling.bookings.approve(id:) -> Coss::Types::SchedulingBooking +
client.scheduling.holds.confirm(id:, request) -> Coss::Types::SchedulingBooking
@@ -20388,7 +22949,7 @@ client.scheduling.bookings.events(id: "book_01kd2m9a0b1c2d3e4f5g6h7j8m")
-Confirms a `pending_approval` booking. +Turns a hold into a booking. Always succeeds before the hold expires. Repeating it is safe.
@@ -20403,7 +22964,10 @@ Confirms a `pending_approval` booking.
```ruby -client.scheduling.bookings.approve(id: "book_01kd2m9a0b1c2d3e4f5g6h7j8m") +client.scheduling.holds.confirm( + id: "book_01kd2m9a0b1c2d3e4f5g6h7j8m", + if_still_free: true +) ```
@@ -20426,7 +22990,15 @@ client.scheduling.bookings.approve(id: "book_01kd2m9a0b1c2d3e4f5g6h7j8m")
-**request_options:** `Coss::Scheduling::Bookings::RequestOptions` +**if_still_free:** `Internal::Types::Boolean` — After the hold expired, book anyway if nobody else took the slot. Default: refuse with `hold_expired`. + +
+
+ +
+
+ +**request_options:** `Coss::Scheduling::Holds::RequestOptions`
@@ -20438,7 +23010,7 @@ client.scheduling.bookings.approve(id: "book_01kd2m9a0b1c2d3e4f5g6h7j8m")
-
client.scheduling.bookings.decline(id:) -> Coss::Types::SchedulingBooking +
client.scheduling.holds.release(id:) -> Coss::Types::SchedulingBooking
@@ -20450,7 +23022,7 @@ client.scheduling.bookings.approve(id: "book_01kd2m9a0b1c2d3e4f5g6h7j8m")
-Refuses a `pending_approval` booking and frees the time. +Gives the slot back early.
@@ -20465,7 +23037,7 @@ Refuses a `pending_approval` booking and frees the time.
```ruby -client.scheduling.bookings.decline(id: "book_01kd2m9a0b1c2d3e4f5g6h7j8m") +client.scheduling.holds.release(id: "book_01kd2m9a0b1c2d3e4f5g6h7j8m") ```
@@ -20488,7 +23060,7 @@ client.scheduling.bookings.decline(id: "book_01kd2m9a0b1c2d3e4f5g6h7j8m")
-**request_options:** `Coss::Scheduling::Bookings::RequestOptions` +**request_options:** `Coss::Scheduling::Holds::RequestOptions`
@@ -20500,7 +23072,8 @@ client.scheduling.bookings.decline(id: "book_01kd2m9a0b1c2d3e4f5g6h7j8m")
-
client.scheduling.bookings.notifications(id:) -> Coss::Types::SchedulingBookingNotificationList +## Scheduling Series +
client.scheduling.series.create(request) -> Coss::Types::SchedulingSeries
@@ -20512,7 +23085,7 @@ client.scheduling.bookings.decline(id: "book_01kd2m9a0b1c2d3e4f5g6h7j8m")
-What's been queued for this booking and what became of it, newest first, including why something wasn't sent. It never says who it went to. +Books up to 52 occurrences, keeping the attendee's local time across DST changes. Each one is an ordinary booking that can move on its own, and a pool keeps one host throughout.
@@ -20527,7 +23100,20 @@ What's been queued for this booking and what became of it, newest first, includi
```ruby -client.scheduling.bookings.notifications(id: "book_01kd2m9a0b1c2d3e4f5g6h7j8m") +client.scheduling.series.create( + idempotency_key: "welcome-user-123", + event_type: "evtype_01kd2m9a0b1c2d3e4f5g6h7j8m", + start: "2027-01-04T15:00:00.000Z", + attendee: { + uid: "patient_77", + time_zone: "America/New_York" + }, + recurrence: { + frequency: "weekly", + interval: 1, + count: 12 + } +) ```
@@ -20542,15 +23128,7 @@ client.scheduling.bookings.notifications(id: "book_01kd2m9a0b1c2d3e4f5g6h7j8m")
-**id:** `String` — The booking's id. - -
-
- -
-
- -**limit:** `Integer` +**idempotency_key:** `String` — Makes retries safe: a repeated request with the same key and body returns the original booking instead of creating another, for 24 hours. A refused request keeps no key. 1-256 characters.
@@ -20558,7 +23136,7 @@ client.scheduling.bookings.notifications(id: "book_01kd2m9a0b1c2d3e4f5g6h7j8m")
-**after:** `String` — The last id of the previous page. +**request:** `Coss::Types::CreateSeriesRequest`
@@ -20566,7 +23144,7 @@ client.scheduling.bookings.notifications(id: "book_01kd2m9a0b1c2d3e4f5g6h7j8m")
-**request_options:** `Coss::Scheduling::Bookings::RequestOptions` +**request_options:** `Coss::Scheduling::Series::RequestOptions`
@@ -20578,7 +23156,7 @@ client.scheduling.bookings.notifications(id: "book_01kd2m9a0b1c2d3e4f5g6h7j8m")
-
client.scheduling.bookings.mark_no_show(id:) -> Coss::Types::SchedulingBooking +
client.scheduling.series.preview(request) -> Coss::Types::SchedulingSeriesPreview
@@ -20590,7 +23168,7 @@ client.scheduling.bookings.notifications(id: "book_01kd2m9a0b1c2d3e4f5g6h7j8m")
-Records that the attendee didn't come, once the booking has started. +Which occurrences would be free, without booking anything.
@@ -20605,7 +23183,19 @@ Records that the attendee didn't come, once the booking has started.
```ruby -client.scheduling.bookings.mark_no_show(id: "book_01kd2m9a0b1c2d3e4f5g6h7j8m") +client.scheduling.series.preview( + event_type: "evtype_01kd2m9a0b1c2d3e4f5g6h7j8m", + start: "2027-01-04T15:00:00.000Z", + attendee: { + uid: "patient_77", + time_zone: "America/New_York" + }, + recurrence: { + frequency: "weekly", + interval: 1, + count: 12 + } +) ```
@@ -20620,7 +23210,7 @@ client.scheduling.bookings.mark_no_show(id: "book_01kd2m9a0b1c2d3e4f5g6h7j8m")
-**id:** `String` — The booking's id. +**request:** `Coss::Types::CreateSeriesRequest`
@@ -20628,7 +23218,7 @@ client.scheduling.bookings.mark_no_show(id: "book_01kd2m9a0b1c2d3e4f5g6h7j8m")
-**request_options:** `Coss::Scheduling::Bookings::RequestOptions` +**request_options:** `Coss::Scheduling::Series::RequestOptions`
@@ -20640,7 +23230,7 @@ client.scheduling.bookings.mark_no_show(id: "book_01kd2m9a0b1c2d3e4f5g6h7j8m")
-
client.scheduling.bookings.update_location(id:, request) -> Coss::Types::SchedulingBooking +
client.scheduling.series.cancel(id:, request) -> Coss::Types::SchedulingCancelledSeries
@@ -20652,7 +23242,7 @@ client.scheduling.bookings.mark_no_show(id: "book_01kd2m9a0b1c2d3e4f5g6h7j8m")
-Where it happens, such as the meeting link you made after the `scheduling.booking.confirmed` webhook. +Cancels the occurrences from `from_index` on, or all of them.
@@ -20667,7 +23257,10 @@ Where it happens, such as the meeting link you made after the `scheduling.bookin
```ruby -client.scheduling.bookings.update_location(id: "book_01kd2m9a0b1c2d3e4f5g6h7j8m") +client.scheduling.series.cancel( + id: "series_01kd2m9a0b1c2d3e4f5g6h7j8m", + from_index: 4 +) ```
@@ -20682,7 +23275,7 @@ client.scheduling.bookings.update_location(id: "book_01kd2m9a0b1c2d3e4f5g6h7j8m"
-**id:** `String` — The booking's id. +**id:** `String` — The series' id.
@@ -20690,7 +23283,7 @@ client.scheduling.bookings.update_location(id: "book_01kd2m9a0b1c2d3e4f5g6h7j8m"
-**location:** `Coss::Types::SchedulingLocation` +**from_index:** `Integer` — Cancel this occurrence and those after it. Default: all of them.
@@ -20698,7 +23291,7 @@ client.scheduling.bookings.update_location(id: "book_01kd2m9a0b1c2d3e4f5g6h7j8m"
-**request_options:** `Coss::Scheduling::Bookings::RequestOptions` +**request_options:** `Coss::Scheduling::Series::RequestOptions`
@@ -20710,8 +23303,8 @@ client.scheduling.bookings.update_location(id: "book_01kd2m9a0b1c2d3e4f5g6h7j8m"
-## Scheduling Holds -
client.scheduling.holds.create(request) -> Coss::Types::SchedulingBooking +## Scheduling Attendees +
client.scheduling.attendees.erase(uid:) -> Coss::Types::SchedulingAttendeeErasure
@@ -20723,7 +23316,7 @@ client.scheduling.bookings.update_location(id: "book_01kd2m9a0b1c2d3e4f5g6h7j8m"
-Keeps a slot for a while (the event type's `hold_ttl_seconds`) so you can take payment, then confirm it. Answers with a `held` booking, which isn't charged and sends nothing. +Removes this person's details and answers from every booking now, and ends any booker session fixed to them. The bookings themselves stay.
@@ -20738,15 +23331,7 @@ Keeps a slot for a while (the event type's `hold_ttl_seconds`) so you can take p
```ruby -client.scheduling.holds.create( - idempotency_key: "welcome-user-123", - event_type: "evtype_01kd2m9a0b1c2d3e4f5g6h7j8m", - start: "2027-01-04T15:00:00.000Z", - attendee: { - uid: "patient_77", - time_zone: "UTC" - } -) +client.scheduling.attendees.erase(uid: "patient_77") ```
@@ -20761,7 +23346,7 @@ client.scheduling.holds.create(
-**idempotency_key:** `String` — Makes retries safe: a repeated request with the same key and body returns the original booking instead of creating another, for 24 hours. A refused request keeps no key. 1-256 characters. +**uid:** `String` — Your id for the attendee.
@@ -20769,79 +23354,61 @@ client.scheduling.holds.create(
-**event_type:** `String` — The event type's id or uid. +**request_options:** `Coss::Scheduling::Attendees::RequestOptions`
- -
-
- -**start:** `String` — An ISO 8601 instant with an offset. -
-
-
-**host:** `String` — A specific host (id or uid). Default: chosen fairly from those free. -
+
+
client.scheduling.attendees.erase_by_email(request) -> Coss::Types::SchedulingAttendeeErasureByEmail
-**attributes:** `Internal::Types::Hash[String, Coss::Scheduling::Holds::Types::CreateHoldRequestAttributesValue]` — Only choose among pool hosts matching all of these. - -
-
+#### 📝 Description
-**duration_minutes:** `Integer` — One of the event type's `duration_options`. - -
-
-
-**attendee:** `Coss::Types::SchedulingAttendeeInput` - +Removes this address's details and answers from every booking now, for someone you have no `uid` for, such as a guest. The bookings themselves stay. +
+
+#### 🔌 Usage +
-**guests:** `Internal::Types::Array[Coss::Types::SchedulingGuestInput]` — Up to the event type's `max_guests`. - -
-
-
-**answers:** `Internal::Types::Hash[String, Coss::Scheduling::Holds::Types::CreateHoldRequestAnswersValue]` — Answers to the event type's questions. Stored encrypted, and returned only by retrieving the booking. - +```ruby +client.scheduling.attendees.erase_by_email(email: "sam@example.com") +```
+ + + +#### ⚙️ Parameters
-**location:** `Coss::Scheduling::Holds::Types::CreateHoldRequestLocation` — One of the event type's `locations`, with your link filled in if it has none. - -
-
-
-**metadata:** `Internal::Types::Hash[String, String]` — Your own key-value pairs. Don't put sensitive data here. +**email:** `String` — The address to forget, an attendee's or a guest's.
@@ -20849,7 +23416,7 @@ client.scheduling.holds.create(
-**request_options:** `Coss::Scheduling::Holds::RequestOptions` +**request_options:** `Coss::Scheduling::Attendees::RequestOptions`
@@ -20861,7 +23428,8 @@ client.scheduling.holds.create(
-
client.scheduling.holds.confirm(id:, request) -> Coss::Types::SchedulingBooking +## Scheduling Calendars +
client.scheduling.calendars.authorize(host:, request) -> Coss::Types::SchedulingCalendarAuthorization
@@ -20873,7 +23441,7 @@ client.scheduling.holds.create(
-Turns a hold into a booking. Always succeeds before the hold expires. Repeating it is safe. +A URL for the host to give consent at Google or Microsoft. Open it in a new window: providers refuse to be framed. Coss.com reads only busy times, and writes events with a neutral title unless the event type's `host_calendar_details` is `full`.
@@ -20888,9 +23456,9 @@ Turns a hold into a booking. Always succeeds before the hold expires. Repeating
```ruby -client.scheduling.holds.confirm( - id: "book_01kd2m9a0b1c2d3e4f5g6h7j8m", - if_still_free: true +client.scheduling.calendars.authorize( + host: "host_01kd2m9a0b1c2d3e4f5g6h7j8m", + provider: "google" ) ```
@@ -20906,7 +23474,7 @@ client.scheduling.holds.confirm(
-**id:** `String` — The booking's id. +**host:** `String` — The host's id or uid.
@@ -20914,7 +23482,7 @@ client.scheduling.holds.confirm(
-**if_still_free:** `Internal::Types::Boolean` — After the hold expired, book anyway if nobody else took the slot. Default: refuse with `hold_expired`. +**provider:** `Coss::Scheduling::Calendars::Types::AuthorizeCalendarRequestProvider` — Whose consent page to open. CalDAV connects with a password instead.
@@ -20922,7 +23490,15 @@ client.scheduling.holds.confirm(
-**request_options:** `Coss::Scheduling::Holds::RequestOptions` +**return_url:** `String` — Where to send the browser afterwards, on one of the environment's allowed origins. `coss_calendar` says what happened: `connected`, `denied` or `invalid`. + +
+
+ +
+
+ +**request_options:** `Coss::Scheduling::Calendars::RequestOptions`
@@ -20934,7 +23510,7 @@ client.scheduling.holds.confirm(
-
client.scheduling.holds.release(id:) -> Coss::Types::SchedulingBooking +
client.scheduling.calendars.list(host:) -> Coss::Types::SchedulingCalendarConnectionList
@@ -20946,7 +23522,7 @@ client.scheduling.holds.confirm(
-Gives the slot back early. +With each connection's calendars and which of them count.
@@ -20961,7 +23537,7 @@ Gives the slot back early.
```ruby -client.scheduling.holds.release(id: "book_01kd2m9a0b1c2d3e4f5g6h7j8m") +client.scheduling.calendars.list(host: "host_01kd2m9a0b1c2d3e4f5g6h7j8m") ```
@@ -20976,7 +23552,7 @@ client.scheduling.holds.release(id: "book_01kd2m9a0b1c2d3e4f5g6h7j8m")
-**id:** `String` — The booking's id. +**host:** `String` — The host's id or uid.
@@ -20984,7 +23560,7 @@ client.scheduling.holds.release(id: "book_01kd2m9a0b1c2d3e4f5g6h7j8m")
-**request_options:** `Coss::Scheduling::Holds::RequestOptions` +**request_options:** `Coss::Scheduling::Calendars::RequestOptions`
@@ -20996,8 +23572,7 @@ client.scheduling.holds.release(id: "book_01kd2m9a0b1c2d3e4f5g6h7j8m")
-## Scheduling Series -
client.scheduling.series.create(request) -> Coss::Types::SchedulingSeries +
client.scheduling.calendars.connect(host:, request) -> Coss::Types::SchedulingCalendarConnection
@@ -21009,7 +23584,7 @@ client.scheduling.holds.release(id: "book_01kd2m9a0b1c2d3e4f5g6h7j8m")
-Books up to 52 occurrences, keeping the attendee's local time across DST changes. Each one is an ordinary booking that can move on its own, and a pool keeps one host throughout. +CalDAV (Apple and others) with an app password, or, in sandbox environments, a `simulated` calendar whose busy times you set yourself. Google and Microsoft use `authorize`.
@@ -21024,20 +23599,7 @@ Books up to 52 occurrences, keeping the attendee's local time across DST changes
```ruby -client.scheduling.series.create( - idempotency_key: "welcome-user-123", - event_type: "evtype_01kd2m9a0b1c2d3e4f5g6h7j8m", - start: "2027-01-04T15:00:00.000Z", - attendee: { - uid: "patient_77", - time_zone: "America/New_York" - }, - recurrence: { - frequency: "weekly", - interval: 1, - count: 12 - } -) +client.scheduling.calendars.connect(host: "host_01kd2m9a0b1c2d3e4f5g6h7j8m") ```
@@ -21052,7 +23614,7 @@ client.scheduling.series.create(
-**idempotency_key:** `String` — Makes retries safe: a repeated request with the same key and body returns the original booking instead of creating another, for 24 hours. A refused request keeps no key. 1-256 characters. +**host:** `String` — The host's id or uid.
@@ -21060,7 +23622,7 @@ client.scheduling.series.create(
-**request:** `Coss::Types::CreateSeriesRequest` +**request:** `Coss::Types::CreateCalendarConnectionRequest`
@@ -21068,7 +23630,7 @@ client.scheduling.series.create(
-**request_options:** `Coss::Scheduling::Series::RequestOptions` +**request_options:** `Coss::Scheduling::Calendars::RequestOptions`
@@ -21080,7 +23642,7 @@ client.scheduling.series.create(
-
client.scheduling.series.preview(request) -> Coss::Types::SchedulingSeriesPreview +
client.scheduling.calendars.disconnect(host:, id:) -> Coss::Types::DeletedSchedulingCalendarConnection
@@ -21092,7 +23654,7 @@ client.scheduling.series.create(
-Which occurrences would be free, without booking anything. +Revokes coss.com's access and deletes every busy time read through it. One a calendar delegation manages is refused (`calendar_managed`).
@@ -21107,18 +23669,9 @@ Which occurrences would be free, without booking anything.
```ruby -client.scheduling.series.preview( - event_type: "evtype_01kd2m9a0b1c2d3e4f5g6h7j8m", - start: "2027-01-04T15:00:00.000Z", - attendee: { - uid: "patient_77", - time_zone: "America/New_York" - }, - recurrence: { - frequency: "weekly", - interval: 1, - count: 12 - } +client.scheduling.calendars.disconnect( + host: "host_01kd2m9a0b1c2d3e4f5g6h7j8m", + id: "calconn_01kd2m9a0b1c2d3e4f5g6h7j8m" ) ```
@@ -21134,7 +23687,7 @@ client.scheduling.series.preview(
-**request:** `Coss::Types::CreateSeriesRequest` +**host:** `String` — The host's id or uid.
@@ -21142,7 +23695,15 @@ client.scheduling.series.preview(
-**request_options:** `Coss::Scheduling::Series::RequestOptions` +**id:** `String` — The connection's id. + +
+
+ +
+
+ +**request_options:** `Coss::Scheduling::Calendars::RequestOptions`
@@ -21154,7 +23715,7 @@ client.scheduling.series.preview(
-
client.scheduling.series.cancel(id:, request) -> Coss::Types::SchedulingCancelledSeries +
client.scheduling.calendars.update(host:, calendar_id:, request) -> Coss::Types::SchedulingCalendarConnectionList
@@ -21166,7 +23727,7 @@ client.scheduling.series.preview(
-Cancels the occurrences from `from_index` on, or all of them. +Whether its busy times block slots, and whether bookings are written to it.
@@ -21181,9 +23742,10 @@ Cancels the occurrences from `from_index` on, or all of them.
```ruby -client.scheduling.series.cancel( - id: "series_01kd2m9a0b1c2d3e4f5g6h7j8m", - from_index: 4 +client.scheduling.calendars.update( + host: "host_01kd2m9a0b1c2d3e4f5g6h7j8m", + calendar_id: "cal_01kd2m9a0b1c2d3e4f5g6h7j8m", + read_busy: true ) ```
@@ -21199,7 +23761,7 @@ client.scheduling.series.cancel(
-**id:** `String` — The series' id. +**host:** `String` — The host's id or uid.
@@ -21207,7 +23769,7 @@ client.scheduling.series.cancel(
-**from_index:** `Integer` — Cancel this occurrence and those after it. Default: all of them. +**calendar_id:** `String` — The calendar's id.
@@ -21215,62 +23777,15 @@ client.scheduling.series.cancel(
-**request_options:** `Coss::Scheduling::Series::RequestOptions` +**read_busy:** `Internal::Types::Boolean` — Whether this calendar's busy times block slots.
- -
- - - - -
- -## Scheduling Attendees -
client.scheduling.attendees.erase(uid:) -> Coss::Types::SchedulingAttendeeErasure -
-
- -#### 📝 Description - -
-
- -
-
- -Removes this person's details and answers from every booking now, and ends any booker session fixed to them. The bookings themselves stay. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```ruby -client.scheduling.attendees.erase(uid: "patient_77") -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
-**uid:** `String` — Your id for the attendee. +**write_target:** `Internal::Types::Boolean` — Bookings are written to one calendar; setting this moves it here.
@@ -21278,7 +23793,7 @@ client.scheduling.attendees.erase(uid: "patient_77")
-**request_options:** `Coss::Scheduling::Attendees::RequestOptions` +**request_options:** `Coss::Scheduling::Calendars::RequestOptions`
@@ -21290,7 +23805,7 @@ client.scheduling.attendees.erase(uid: "patient_77")
-
client.scheduling.attendees.erase_by_email(request) -> Coss::Types::SchedulingAttendeeErasureByEmail +
client.scheduling.calendars.set_simulated_busy(host:, request) ->
@@ -21302,7 +23817,7 @@ client.scheduling.attendees.erase(uid: "patient_77")
-Removes this address's details and answers from every booking now, for someone you have no `uid` for, such as a guest. The bookings themselves stay. +Sandbox environments only: test how bookings react to a busy calendar.
@@ -21317,7 +23832,13 @@ Removes this address's details and answers from every booking now, for someone y
```ruby -client.scheduling.attendees.erase_by_email(email: "sam@example.com") +client.scheduling.calendars.set_simulated_busy( + host: "host_01kd2m9a0b1c2d3e4f5g6h7j8m", + intervals: [{ + start: "2027-01-04T15:00:00.000Z", + end_: "2027-01-04T16:00:00.000Z" + }] +) ```
@@ -21332,7 +23853,7 @@ client.scheduling.attendees.erase_by_email(email: "sam@example.com")
-**email:** `String` — The address to forget, an attendee's or a guest's. +**host:** `String` — The host's id or uid.
@@ -21340,7 +23861,15 @@ client.scheduling.attendees.erase_by_email(email: "sam@example.com")
-**request_options:** `Coss::Scheduling::Attendees::RequestOptions` +**intervals:** `Internal::Types::Array[Coss::Scheduling::Calendars::Types::SetSimulatedBusyRequestIntervalsItem]` — The simulated calendar's busy times. + +
+
+ +
+
+ +**request_options:** `Coss::Scheduling::Calendars::RequestOptions`
@@ -21352,8 +23881,8 @@ client.scheduling.attendees.erase_by_email(email: "sam@example.com")
-## Scheduling Calendars -
client.scheduling.calendars.authorize(host:, request) -> Coss::Types::SchedulingCalendarAuthorization +## Scheduling CalendarDelegations +
client.scheduling.calendar_delegations.list() -> Coss::Types::SchedulingCalendarDelegationList
@@ -21365,7 +23894,7 @@ client.scheduling.attendees.erase_by_email(email: "sam@example.com")
-A URL for the host to give consent at Google or Microsoft. Open it in a new window: providers refuse to be framed. Coss.com reads only busy times, and writes events with a neutral title unless the event type's `host_calendar_details` is `full`. +With how many hosts each has connected.
@@ -21380,10 +23909,7 @@ A URL for the host to give consent at Google or Microsoft. Open it in a new wind
```ruby -client.scheduling.calendars.authorize( - host: "host_01kd2m9a0b1c2d3e4f5g6h7j8m", - provider: "google" -) +client.scheduling.calendar_delegations.list ```
@@ -21398,31 +23924,7 @@ client.scheduling.calendars.authorize(
-**host:** `String` — The host's id or uid. - -
-
- -
-
- -**provider:** `Coss::Scheduling::Calendars::Types::AuthorizeCalendarRequestProvider` — Whose consent page to open. CalDAV connects with a password instead. - -
-
- -
-
- -**return_url:** `String` — Where to send the browser afterwards, on one of the environment's allowed origins. `coss_calendar` says what happened: `connected`, `denied` or `invalid`. - -
-
- -
-
- -**request_options:** `Coss::Scheduling::Calendars::RequestOptions` +**request_options:** `Coss::Scheduling::CalendarDelegations::RequestOptions`
@@ -21434,7 +23936,7 @@ client.scheduling.calendars.authorize(
-
client.scheduling.calendars.list(host:) -> Coss::Types::SchedulingCalendarConnectionList +
client.scheduling.calendar_delegations.create(request) -> Coss::Types::SchedulingCalendarDelegation
@@ -21446,7 +23948,7 @@ client.scheduling.calendars.authorize(
-With each connection's calendars and which of them count. +An admin authorizes once, and every host on the domain gets their calendar with no consent screen. It stays `pending`: authorize what it returns, then verify it. Credentials are never returned.
@@ -21461,7 +23963,7 @@ With each connection's calendars and which of them count.
```ruby -client.scheduling.calendars.list(host: "host_01kd2m9a0b1c2d3e4f5g6h7j8m") +client.scheduling.calendar_delegations.create ```
@@ -21476,7 +23978,7 @@ client.scheduling.calendars.list(host: "host_01kd2m9a0b1c2d3e4f5g6h7j8m")
-**host:** `String` — The host's id or uid. +**request:** `Coss::Types::CreateCalendarDelegationRequest`
@@ -21484,7 +23986,7 @@ client.scheduling.calendars.list(host: "host_01kd2m9a0b1c2d3e4f5g6h7j8m")
-**request_options:** `Coss::Scheduling::Calendars::RequestOptions` +**request_options:** `Coss::Scheduling::CalendarDelegations::RequestOptions`
@@ -21496,7 +23998,7 @@ client.scheduling.calendars.list(host: "host_01kd2m9a0b1c2d3e4f5g6h7j8m")
-
client.scheduling.calendars.connect(host:, request) -> Coss::Types::SchedulingCalendarConnection +
client.scheduling.calendar_delegations.get(id:) -> Coss::Types::SchedulingCalendarDelegation
@@ -21508,7 +24010,7 @@ client.scheduling.calendars.list(host: "host_01kd2m9a0b1c2d3e4f5g6h7j8m")
-CalDAV (Apple and others) with an app password, or, in sandbox environments, a `simulated` calendar whose busy times you set yourself. Google and Microsoft use `authorize`. +Its status, what to authorize, and how many hosts it has connected.
@@ -21523,7 +24025,7 @@ CalDAV (Apple and others) with an app password, or, in sandbox environments, a `
```ruby -client.scheduling.calendars.connect(host: "host_01kd2m9a0b1c2d3e4f5g6h7j8m") +client.scheduling.calendar_delegations.get(id: "caldlg_01kd2m9a0b1c2d3e4f5g6h7j8m") ```
@@ -21538,15 +24040,7 @@ client.scheduling.calendars.connect(host: "host_01kd2m9a0b1c2d3e4f5g6h7j8m")
-**host:** `String` — The host's id or uid. - -
-
- -
-
- -**request:** `Coss::Types::CreateCalendarConnectionRequest` +**id:** `String` — The delegation's id.
@@ -21554,7 +24048,7 @@ client.scheduling.calendars.connect(host: "host_01kd2m9a0b1c2d3e4f5g6h7j8m")
-**request_options:** `Coss::Scheduling::Calendars::RequestOptions` +**request_options:** `Coss::Scheduling::CalendarDelegations::RequestOptions`
@@ -21566,7 +24060,7 @@ client.scheduling.calendars.connect(host: "host_01kd2m9a0b1c2d3e4f5g6h7j8m")
-
client.scheduling.calendars.disconnect(host:, id:) -> Coss::Types::DeletedSchedulingCalendarConnection +
client.scheduling.calendar_delegations.delete(id:) -> Coss::Types::DeletedSchedulingCalendarDelegation
@@ -21578,7 +24072,7 @@ client.scheduling.calendars.connect(host: "host_01kd2m9a0b1c2d3e4f5g6h7j8m")
-Revokes coss.com's access and deletes every busy time read through it. One a calendar delegation manages is refused (`calendar_managed`). +Its hosts lose these calendars within minutes. They stay bookable with no conflict check, and events already written stay on their calendars, out of reach of later moves or cancellations.
@@ -21593,10 +24087,7 @@ Revokes coss.com's access and deletes every busy time read through it. One a cal
```ruby -client.scheduling.calendars.disconnect( - host: "host_01kd2m9a0b1c2d3e4f5g6h7j8m", - id: "calconn_01kd2m9a0b1c2d3e4f5g6h7j8m" -) +client.scheduling.calendar_delegations.delete(id: "caldlg_01kd2m9a0b1c2d3e4f5g6h7j8m") ```
@@ -21611,15 +24102,7 @@ client.scheduling.calendars.disconnect(
-**host:** `String` — The host's id or uid. - -
-
- -
-
- -**id:** `String` — The connection's id. +**id:** `String` — The delegation's id.
@@ -21627,7 +24110,7 @@ client.scheduling.calendars.disconnect(
-**request_options:** `Coss::Scheduling::Calendars::RequestOptions` +**request_options:** `Coss::Scheduling::CalendarDelegations::RequestOptions`
@@ -21639,7 +24122,7 @@ client.scheduling.calendars.disconnect(
-
client.scheduling.calendars.update(host:, calendar_id:, request) -> Coss::Types::SchedulingCalendarConnectionList +
client.scheduling.calendar_delegations.update(id:, request) -> Coss::Types::SchedulingCalendarDelegation
@@ -21651,7 +24134,7 @@ client.scheduling.calendars.disconnect(
-Whether its busy times block slots, and whether bookings are written to it. +New credentials are tried on the verified mailbox before they replace the old ones, and end an outage if they work.
@@ -21666,10 +24149,9 @@ Whether its busy times block slots, and whether bookings are written to it.
```ruby -client.scheduling.calendars.update( - host: "host_01kd2m9a0b1c2d3e4f5g6h7j8m", - calendar_id: "cal_01kd2m9a0b1c2d3e4f5g6h7j8m", - read_busy: true +client.scheduling.calendar_delegations.update( + id: "caldlg_01kd2m9a0b1c2d3e4f5g6h7j8m", + match_host_email: false ) ```
@@ -21685,7 +24167,7 @@ client.scheduling.calendars.update(
-**host:** `String` — The host's id or uid. +**id:** `String` — The delegation's id.
@@ -21693,7 +24175,7 @@ client.scheduling.calendars.update(
-**calendar_id:** `String` — The calendar's id. +**match_host_email:** `Internal::Types::Boolean` — Whether a host's `email` picks their mailbox when `calendar_account` isn't set. Turn it off if end users can type their own email into your app: otherwise one could name a colleague's address and reach that calendar.
@@ -21701,7 +24183,7 @@ client.scheduling.calendars.update(
-**read_busy:** `Internal::Types::Boolean` — Whether this calendar's busy times block slots. +**service_account_key:** `String` — A new key. It's tried on the verified mailbox before it replaces the old one.
@@ -21709,7 +24191,7 @@ client.scheduling.calendars.update(
-**write_target:** `Internal::Types::Boolean` — Bookings are written to one calendar; setting this moves it here. +**client_secret:** `String` — A new client secret. It's tried on the verified mailbox before it replaces the old one.
@@ -21717,7 +24199,15 @@ client.scheduling.calendars.update(
-**request_options:** `Coss::Scheduling::Calendars::RequestOptions` +**secret_expires_at:** `String` — When the Entra client secret expires. Owners and admins are warned 14 days before. + +
+
+ +
+
+ +**request_options:** `Coss::Scheduling::CalendarDelegations::RequestOptions`
@@ -21729,7 +24219,7 @@ client.scheduling.calendars.update(
-
client.scheduling.calendars.set_simulated_busy(host:, request) -> +
client.scheduling.calendar_delegations.verify(id:, request) -> Coss::Types::SchedulingCalendarDelegation
@@ -21741,7 +24231,7 @@ client.scheduling.calendars.update(
-Sandbox environments only: test how bookings react to a busy calendar. +Tries one real mailbox. Passing makes it `active`, and its hosts start connecting. Google can take up to 24 hours to apply a new authorization, so a refusal may just need time.
@@ -21756,12 +24246,9 @@ Sandbox environments only: test how bookings react to a busy calendar.
```ruby -client.scheduling.calendars.set_simulated_busy( - host: "host_01kd2m9a0b1c2d3e4f5g6h7j8m", - intervals: [{ - start: "2027-01-04T15:00:00.000Z", - end_: "2027-01-04T16:00:00.000Z" - }] +client.scheduling.calendar_delegations.verify( + id: "caldlg_01kd2m9a0b1c2d3e4f5g6h7j8m", + account: "ana@example.com" ) ```
@@ -21777,7 +24264,7 @@ client.scheduling.calendars.set_simulated_busy(
-**host:** `String` — The host's id or uid. +**id:** `String` — The delegation's id.
@@ -21785,7 +24272,7 @@ client.scheduling.calendars.set_simulated_busy(
-**intervals:** `Internal::Types::Array[Coss::Scheduling::Calendars::Types::SetSimulatedBusyRequestIntervalsItem]` — The simulated calendar's busy times. +**account:** `String` — A real mailbox on the domain to try. In Microsoft 365, a user principal name.
@@ -21793,7 +24280,7 @@ client.scheduling.calendars.set_simulated_busy(
-**request_options:** `Coss::Scheduling::Calendars::RequestOptions` +**request_options:** `Coss::Scheduling::CalendarDelegations::RequestOptions`
@@ -21805,8 +24292,8 @@ client.scheduling.calendars.set_simulated_busy(
-## Scheduling CalendarDelegations -
client.scheduling.calendar_delegations.list() -> Coss::Types::SchedulingCalendarDelegationList +## Scheduling OauthApps +
client.scheduling.oauth_apps.list() -> Coss::Types::SchedulingOauthAppList
@@ -21818,7 +24305,7 @@ client.scheduling.calendars.set_simulated_busy(
-With how many hosts each has connected. +At most one per provider, with how many connections use each.
@@ -21833,7 +24320,7 @@ With how many hosts each has connected.
```ruby -client.scheduling.calendar_delegations.list +client.scheduling.oauth_apps.list ```
@@ -21848,7 +24335,7 @@ client.scheduling.calendar_delegations.list
-**request_options:** `Coss::Scheduling::CalendarDelegations::RequestOptions` +**request_options:** `Coss::Scheduling::OauthApps::RequestOptions`
@@ -21860,7 +24347,7 @@ client.scheduling.calendar_delegations.list
-
client.scheduling.calendar_delegations.create(request) -> Coss::Types::SchedulingCalendarDelegation +
client.scheduling.oauth_apps.create(request) -> Coss::Types::SchedulingOauthApp
@@ -21872,7 +24359,7 @@ client.scheduling.calendar_delegations.list
-An admin authorizes once, and every host on the domain gets their calendar with no consent screen. It stays `pending`: authorize what it returns, then verify it. Credentials are never returned. +New consents in this environment use it, so the consent screen shows your brand. Connections made before it stay on coss.com's app until their host consents again. On the Scale plan and above. Secrets are never returned.
@@ -21887,7 +24374,7 @@ An admin authorizes once, and every host on the domain gets their calendar with
```ruby -client.scheduling.calendar_delegations.create +client.scheduling.oauth_apps.create ```
@@ -21902,7 +24389,7 @@ client.scheduling.calendar_delegations.create
-**request:** `Coss::Types::CreateCalendarDelegationRequest` +**request:** `Coss::Types::CreateOauthAppRequest`
@@ -21910,7 +24397,7 @@ client.scheduling.calendar_delegations.create
-**request_options:** `Coss::Scheduling::CalendarDelegations::RequestOptions` +**request_options:** `Coss::Scheduling::OauthApps::RequestOptions`
@@ -21922,7 +24409,7 @@ client.scheduling.calendar_delegations.create
-
client.scheduling.calendar_delegations.get(id:) -> Coss::Types::SchedulingCalendarDelegation +
client.scheduling.oauth_apps.get(id:) -> Coss::Types::SchedulingOauthApp
@@ -21934,7 +24421,7 @@ client.scheduling.calendar_delegations.create
-Its status, what to authorize, and how many hosts it has connected. +Its status, what to register at the provider, and how many connections use it.
@@ -21949,7 +24436,7 @@ Its status, what to authorize, and how many hosts it has connected.
```ruby -client.scheduling.calendar_delegations.get(id: "caldlg_01kd2m9a0b1c2d3e4f5g6h7j8m") +client.scheduling.oauth_apps.get(id: "calapp_01kd2m9a0b1c2d3e4f5g6h7j8m") ```
@@ -21964,7 +24451,7 @@ client.scheduling.calendar_delegations.get(id: "caldlg_01kd2m9a0b1c2d3e4f5g6h7j8
-**id:** `String` — The delegation's id. +**id:** `String` — The OAuth app's id.
@@ -21972,7 +24459,7 @@ client.scheduling.calendar_delegations.get(id: "caldlg_01kd2m9a0b1c2d3e4f5g6h7j8
-**request_options:** `Coss::Scheduling::CalendarDelegations::RequestOptions` +**request_options:** `Coss::Scheduling::OauthApps::RequestOptions`
@@ -21984,7 +24471,7 @@ client.scheduling.calendar_delegations.get(id: "caldlg_01kd2m9a0b1c2d3e4f5g6h7j8
-
client.scheduling.calendar_delegations.delete(id:) -> Coss::Types::DeletedSchedulingCalendarDelegation +
client.scheduling.oauth_apps.delete(id:) -> Coss::Types::DeletedSchedulingOauthApp
@@ -21996,7 +24483,7 @@ client.scheduling.calendar_delegations.get(id: "caldlg_01kd2m9a0b1c2d3e4f5g6h7j8
-Its hosts lose these calendars within minutes. They stay bookable with no conflict check, and events already written stay on their calendars, out of reach of later moves or cancellations. +Refused while connections use it (`oauth_app_in_use`), since only it can refresh their access: disconnect them first. New consents go back to coss.com's app.
@@ -22011,7 +24498,7 @@ Its hosts lose these calendars within minutes. They stay bookable with no confli
```ruby -client.scheduling.calendar_delegations.delete(id: "caldlg_01kd2m9a0b1c2d3e4f5g6h7j8m") +client.scheduling.oauth_apps.delete(id: "calapp_01kd2m9a0b1c2d3e4f5g6h7j8m") ```
@@ -22026,7 +24513,7 @@ client.scheduling.calendar_delegations.delete(id: "caldlg_01kd2m9a0b1c2d3e4f5g6h
-**id:** `String` — The delegation's id. +**id:** `String` — The OAuth app's id.
@@ -22034,7 +24521,7 @@ client.scheduling.calendar_delegations.delete(id: "caldlg_01kd2m9a0b1c2d3e4f5g6h
-**request_options:** `Coss::Scheduling::CalendarDelegations::RequestOptions` +**request_options:** `Coss::Scheduling::OauthApps::RequestOptions`
@@ -22046,7 +24533,7 @@ client.scheduling.calendar_delegations.delete(id: "caldlg_01kd2m9a0b1c2d3e4f5g6h
-
client.scheduling.calendar_delegations.update(id:, request) -> Coss::Types::SchedulingCalendarDelegation +
client.scheduling.oauth_apps.update(id:, request) -> Coss::Types::SchedulingOauthApp
@@ -22058,7 +24545,7 @@ client.scheduling.calendar_delegations.delete(id: "caldlg_01kd2m9a0b1c2d3e4f5g6h
-New credentials are tried on the verified mailbox before they replace the old ones, and end an outage if they work. +A new client secret is tried on a connection before it replaces the old one, and ends an outage if it works. Its client ID can't change: a different app needs its hosts to consent again.
@@ -22073,9 +24560,9 @@ New credentials are tried on the verified mailbox before they replace the old on
```ruby -client.scheduling.calendar_delegations.update( - id: "caldlg_01kd2m9a0b1c2d3e4f5g6h7j8m", - match_host_email: false +client.scheduling.oauth_apps.update( + id: "calapp_01kd2m9a0b1c2d3e4f5g6h7j8m", + client_secret: "GOCSPX-abcdefghijklmnopqrstuvwxyz" ) ```
@@ -22091,7 +24578,7 @@ client.scheduling.calendar_delegations.update(
-**id:** `String` — The delegation's id. +**id:** `String` — The OAuth app's id.
@@ -22099,7 +24586,7 @@ client.scheduling.calendar_delegations.update(
-**match_host_email:** `Internal::Types::Boolean` — Whether a host's `email` picks their mailbox when `calendar_account` isn't set. Turn it off if end users can type their own email into your app: otherwise one could name a colleague's address and reach that calendar. +**client_secret:** `String` — A new client secret. It's tried on a connection before it replaces the old one.
@@ -22107,7 +24594,7 @@ client.scheduling.calendar_delegations.update(
-**service_account_key:** `String` — A new key. It's tried on the verified mailbox before it replaces the old one. +**tenant_id:** `String` — The Directory (tenant) ID, for an app that's only for your own tenant. Leave it out for a multi-tenant app.
@@ -22115,7 +24602,7 @@ client.scheduling.calendar_delegations.update(
-**client_secret:** `String` — A new client secret. It's tried on the verified mailbox before it replaces the old one. +**webhook_secret:** `String` — The Secret Token of your Zoom app, which signs its events at `zoom_event_url`. Never returned.
@@ -22123,7 +24610,7 @@ client.scheduling.calendar_delegations.update(
-**secret_expires_at:** `String` — When the Entra client secret expires. Owners and admins are warned 14 days before. +**redirect_uri:** `String` — A page on your own domain, registered with the provider, that forwards `code` and `state` to `coss_callback_url`. Google requires this for an external app, since it has to verify the redirect's domain as yours. Leave it out to use `coss_callback_url` directly.
@@ -22131,7 +24618,23 @@ client.scheduling.calendar_delegations.update(
-**request_options:** `Coss::Scheduling::CalendarDelegations::RequestOptions` +**completion_url:** `String` — Where the browser lands after a consent that didn't name a `return_url`, with `coss_calendar` set to `connected`, `denied` or `invalid`. Leave it out for a plain page saying what happened. + +
+
+ +
+
+ +**secret_expires_at:** `String` — When the client secret expires. Owners and admins are warned 14 days before. + +
+
+ +
+
+ +**request_options:** `Coss::Scheduling::OauthApps::RequestOptions`
@@ -22143,7 +24646,8 @@ client.scheduling.calendar_delegations.update(
-
client.scheduling.calendar_delegations.verify(id:, request) -> Coss::Types::SchedulingCalendarDelegation +## Scheduling Sessions +
client.scheduling.sessions.create_for_manager(request) -> Coss::Types::SchedulingSession
@@ -22155,7 +24659,7 @@ client.scheduling.calendar_delegations.update(
-Tries one real mailbox. Passing makes it `active`, and its hosts start connecting. Google can take up to 24 hours to apply a new authorization, so a refusal may just need time. +Lets a team lead manage cover for the hosts you name, or those matching an attribute filter whenever it's asked: time off, bookings that need someone else, and moving them. It never sees attendees' details. Send the `url` to their browser, or embed it with `coss/scheduling`.
@@ -22170,9 +24674,11 @@ Tries one real mailbox. Passing makes it `active`, and its hosts start connectin
```ruby -client.scheduling.calendar_delegations.verify( - id: "caldlg_01kd2m9a0b1c2d3e4f5g6h7j8m", - account: "ana@example.com" +client.scheduling.sessions.create_for_manager( + host_filter: { + team: "cardiology" + }, + expires_in: 3600 ) ```
@@ -22188,7 +24694,7 @@ client.scheduling.calendar_delegations.verify(
-**id:** `String` — The delegation's id. +**hosts:** `Internal::Types::Array[String]` — The hosts this page can reach, by id or uid.
@@ -22196,7 +24702,7 @@ client.scheduling.calendar_delegations.verify(
-**account:** `String` — A real mailbox on the domain to try. In Microsoft 365, a user principal name. +**host_filter:** `Internal::Types::Hash[String, Coss::Scheduling::Sessions::Types::CreateSchedulingManagerSessionRequestHostFilterValue]` — Everyone matching these attributes, asked again on every request.
@@ -22204,7 +24710,23 @@ client.scheduling.calendar_delegations.verify(
-**request_options:** `Coss::Scheduling::CalendarDelegations::RequestOptions` +**expires_in:** `Integer` — Seconds until it stops working. At most a day. + +
+
+ +
+
+ +**read_only:** `Internal::Types::Boolean` + +
+
+ +
+
+ +**request_options:** `Coss::Scheduling::Sessions::RequestOptions`
@@ -22216,7 +24738,6 @@ client.scheduling.calendar_delegations.verify(
-## Scheduling Sessions
client.scheduling.sessions.create_for_host(host:, request) -> Coss::Types::SchedulingSession
@@ -22590,6 +25111,14 @@ client.scheduling.settings.update(brand_name: "Acme Health")
+**privacy_url:** `String` — Your privacy policy, as an https URL, for hosts connecting a calendar through your own OAuth app. `null` removes it. + +
+
+ +
+
+ **email_from:** `String` — Sender of booking emails, on a verified domain. `null`: coss.com's own address.
@@ -22614,6 +25143,30 @@ client.scheduling.settings.update(brand_name: "Acme Health")
+**name_host_in_attendee_emails:** `Internal::Types::Boolean` — Name the new host when telling an attendee their booking has one. + +
+
+ +
+
+ +**host_reassignment:** `Coss::Scheduling::Settings::Types::UpdateSchedulingSettingsRequestHostReassignment` — Whether hosts can give their own bookings to someone else from their page. `eligible` lets them, to anyone free who takes that event type. + +
+
+ +
+
+ +**out_of_office_reasons:** `Internal::Types::Array[Coss::Scheduling::Settings::Types::UpdateSchedulingSettingsRequestOutOfOfficeReasonsItem]` — Reasons of your own, on top of the preset ones. Hosts and managers see them. + +
+
+ +
+
+ **notifications:** `Internal::Types::Hash[String, Coss::Scheduling::Settings::Types::UpdateSchedulingSettingsRequestNotificationsValue]` — Per event (`confirmed`, `pending_approval`, `rescheduled`, `cancelled`, `declined`, `reminder`), overriding the defaults. `null` restores them.
diff --git a/tooling/sdkgen/snippets.json b/tooling/sdkgen/snippets.json index be406e20f..50d8343f5 100644 --- a/tooling/sdkgen/snippets.json +++ b/tooling/sdkgen/snippets.json @@ -191,6 +191,22 @@ "java": "import com.coss.Coss;\nimport com.coss.resources.scheduling.bookings.requests.CancelSchedulingBookingRequest;\n\nCoss client = Coss.builder().build(); // .apiKey(…) or COSS_API_KEY\n\nclient.scheduling().bookings().cancel(\n \"book_01kd2m9a0b1c2d3e4f5g6h7j8m\",\n CancelSchedulingBookingRequest\n .builder()\n .reason(\"Feeling better\")\n .build()\n);", "csharp": "using Coss;\nusing Coss.Scheduling;\n\nvar client = new CossClient(); // apiKey: or COSS_API_KEY\n\nawait client.Scheduling.Bookings.CancelAsync(\n new CancelSchedulingBookingRequest\n {\n Id = \"book_01kd2m9a0b1c2d3e4f5g6h7j8m\",\n Reason = \"Feeling better\",\n }\n);" }, + "POST /v1/scheduling/bookings/{id}/reassign": { + "python": "from coss import Coss\nfrom coss.scheduling.bookings import ReassignSchedulingBookingRequestChangesItem\n\nclient = Coss() # api_key= or COSS_API_KEY\n\nclient.scheduling.bookings.reassign(\n id=\"book_01kd2m9a0b1c2d3e4f5g6h7j8m\",\n changes=[\n ReassignSchedulingBookingRequestChangesItem(\n to_host=\"doctor_518\",\n )\n ],\n reason_code=\"out_of_office\",\n)", + "go": "import (\n\t\"context\"\n\n\tcoss \"github.com/cosscom/coss-go\"\n\tcossclient \"github.com/cosscom/coss-go/client\"\n\tscheduling \"github.com/cosscom/coss-go/scheduling\"\n)\n\nclient := cossclient.NewClient() // option.WithAPIKey(…) or COSS_API_KEY\n\nrequest := &scheduling.ReassignSchedulingBookingRequest{\n ID: \"book_01kd2m9a0b1c2d3e4f5g6h7j8m\",\n Changes: []*scheduling.ReassignSchedulingBookingRequestChangesItem{\n &scheduling.ReassignSchedulingBookingRequestChangesItem{\n ToHost: coss.String(\n \"doctor_518\",\n ),\n },\n },\n ReasonCode: scheduling.ReassignSchedulingBookingRequestReasonCodeOutOfOffice,\n}\nclient.Scheduling.Bookings.Reassign(\n context.TODO(),\n request,\n)", + "ruby": "require \"coss\"\n\nclient = Coss::Client.new # api_key: or COSS_API_KEY\n\nclient.scheduling.bookings.reassign(\n id: \"book_01kd2m9a0b1c2d3e4f5g6h7j8m\",\n changes: [{\n to_host: \"doctor_518\"\n }],\n reason_code: \"out_of_office\"\n)", + "php": "scheduling->bookings->reassign(\n 'book_01kd2m9a0b1c2d3e4f5g6h7j8m',\n new ReassignSchedulingBookingRequest([\n 'changes' => [\n new ReassignSchedulingBookingRequestChangesItem([\n 'toHost' => 'doctor_518',\n ]),\n ],\n 'reasonCode' => ReassignSchedulingBookingRequestReasonCode::OutOfOffice->value,\n ]),\n);", + "java": "import com.coss.Coss;\nimport com.coss.resources.scheduling.bookings.requests.ReassignSchedulingBookingRequest;\nimport com.coss.resources.scheduling.bookings.types.ReassignSchedulingBookingRequestChangesItem;\nimport com.coss.resources.scheduling.bookings.types.ReassignSchedulingBookingRequestReasonCode;\nimport java.util.Arrays;\n\nCoss client = Coss.builder().build(); // .apiKey(…) or COSS_API_KEY\n\nclient.scheduling().bookings().reassign(\n \"book_01kd2m9a0b1c2d3e4f5g6h7j8m\",\n ReassignSchedulingBookingRequest\n .builder()\n .reasonCode(ReassignSchedulingBookingRequestReasonCode.OUT_OF_OFFICE)\n .changes(\n Arrays.asList(\n ReassignSchedulingBookingRequestChangesItem\n .builder()\n .toHost(\"doctor_518\")\n .build()\n )\n )\n .build()\n);", + "csharp": "using Coss;\nusing Coss.Scheduling;\n\nvar client = new CossClient(); // apiKey: or COSS_API_KEY\n\nawait client.Scheduling.Bookings.ReassignAsync(\n new ReassignSchedulingBookingRequest\n {\n Id = \"book_01kd2m9a0b1c2d3e4f5g6h7j8m\",\n Changes = new List()\n {\n new ReassignSchedulingBookingRequestChangesItem { ToHost = \"doctor_518\" },\n },\n ReasonCode = ReassignSchedulingBookingRequestReasonCode.OutOfOffice,\n }\n);" + }, + "GET /v1/scheduling/bookings/{id}/reassign_candidates": { + "python": "from coss import Coss\n\nclient = Coss() # api_key= or COSS_API_KEY\n\nclient.scheduling.bookings.reassign_candidates(\n id=\"book_01kd2m9a0b1c2d3e4f5g6h7j8m\",\n)", + "go": "import (\n\t\"context\"\n\n\tcossclient \"github.com/cosscom/coss-go/client\"\n\tscheduling \"github.com/cosscom/coss-go/scheduling\"\n)\n\nclient := cossclient.NewClient() // option.WithAPIKey(…) or COSS_API_KEY\n\nrequest := &scheduling.ReassignCandidatesBookingsRequest{\n ID: \"book_01kd2m9a0b1c2d3e4f5g6h7j8m\",\n}\nclient.Scheduling.Bookings.ReassignCandidates(\n context.TODO(),\n request,\n)", + "ruby": "require \"coss\"\n\nclient = Coss::Client.new # api_key: or COSS_API_KEY\n\nclient.scheduling.bookings.reassign_candidates(id: \"book_01kd2m9a0b1c2d3e4f5g6h7j8m\")", + "php": "scheduling->bookings->reassignCandidates(\n 'book_01kd2m9a0b1c2d3e4f5g6h7j8m',\n new ReassignCandidatesBookingsRequest([]),\n);", + "java": "import com.coss.Coss;\nimport com.coss.resources.scheduling.bookings.requests.ReassignCandidatesBookingsRequest;\n\nCoss client = Coss.builder().build(); // .apiKey(…) or COSS_API_KEY\n\nclient.scheduling().bookings().reassignCandidates(\n \"book_01kd2m9a0b1c2d3e4f5g6h7j8m\",\n ReassignCandidatesBookingsRequest\n .builder()\n .build()\n);", + "csharp": "using Coss;\nusing Coss.Scheduling;\n\nvar client = new CossClient(); // apiKey: or COSS_API_KEY\n\nawait client.Scheduling.Bookings.ReassignCandidatesAsync(\n new ReassignCandidatesBookingsRequest { Id = \"book_01kd2m9a0b1c2d3e4f5g6h7j8m\" }\n);" + }, "GET /v1/scheduling/bookings/{id}/events": { "python": "from coss import Coss\n\nclient = Coss() # api_key= or COSS_API_KEY\n\nclient.scheduling.bookings.events(\n id=\"book_01kd2m9a0b1c2d3e4f5g6h7j8m\",\n)", "go": "import (\n\t\"context\"\n\n\tcossclient \"github.com/cosscom/coss-go/client\"\n\tscheduling \"github.com/cosscom/coss-go/scheduling\"\n)\n\nclient := cossclient.NewClient() // option.WithAPIKey(…) or COSS_API_KEY\n\nrequest := &scheduling.EventsBookingsRequest{\n ID: \"book_01kd2m9a0b1c2d3e4f5g6h7j8m\",\n}\nclient.Scheduling.Bookings.Events(\n context.TODO(),\n request,\n)", @@ -232,12 +248,12 @@ "csharp": "using Coss;\nusing Coss.Scheduling;\n\nvar client = new CossClient(); // apiKey: or COSS_API_KEY\n\nawait client.Scheduling.Bookings.NotificationsAsync(\n new NotificationsBookingsRequest { Id = \"book_01kd2m9a0b1c2d3e4f5g6h7j8m\" }\n);" }, "PATCH /v1/scheduling/bookings/{id}/location": { - "python": "from coss import Coss\nfrom coss import Coss, SchedulingLocation_Link\n\nclient = Coss() # api_key= or COSS_API_KEY\n\nclient.scheduling.bookings.update_location(\n id=\"book_01kd2m9a0b1c2d3e4f5g6h7j8m\",\n location=SchedulingLocation_Link(\n url=\"https://meet.example.com/abc\",\n ),\n)", - "go": "import (\n\t\"context\"\n\n\tcoss \"github.com/cosscom/coss-go\"\n\tcossclient \"github.com/cosscom/coss-go/client\"\n\tscheduling \"github.com/cosscom/coss-go/scheduling\"\n)\n\nclient := cossclient.NewClient() // option.WithAPIKey(…) or COSS_API_KEY\n\nrequest := &scheduling.UpdateBookingLocationRequest{\n ID: \"book_01kd2m9a0b1c2d3e4f5g6h7j8m\",\n Location: &coss.SchedulingLocation{\n Link: &coss.SchedulingLocationLink{\n URL: coss.String(\n \"https://meet.example.com/abc\",\n ),\n },\n },\n}\nclient.Scheduling.Bookings.UpdateLocation(\n context.TODO(),\n request,\n)", - "ruby": "require \"coss\"\n\nclient = Coss::Client.new # api_key: or COSS_API_KEY\n\nclient.scheduling.bookings.update_location(id: \"book_01kd2m9a0b1c2d3e4f5g6h7j8m\")", - "php": "scheduling->bookings->updateLocation(\n 'book_01kd2m9a0b1c2d3e4f5g6h7j8m',\n new UpdateBookingLocationRequest([\n 'location' => SchedulingLocation::link(new SchedulingLocationLink([\n 'url' => 'https://meet.example.com/abc',\n ])),\n ]),\n);", - "java": "import com.coss.Coss;\nimport com.coss.resources.scheduling.bookings.requests.UpdateBookingLocationRequest;\nimport com.coss.types.SchedulingLocation;\nimport com.coss.types.SchedulingLocationLink;\n\nCoss client = Coss.builder().build(); // .apiKey(…) or COSS_API_KEY\n\nclient.scheduling().bookings().updateLocation(\n \"book_01kd2m9a0b1c2d3e4f5g6h7j8m\",\n UpdateBookingLocationRequest\n .builder()\n .location(\n SchedulingLocation.link(\n SchedulingLocationLink\n .builder()\n .url(\n OptionalNullable.of(\"https://meet.example.com/abc\")\n )\n .build()\n )\n )\n .build()\n);", - "csharp": "using Coss;\nusing Coss.Scheduling;\n\nvar client = new CossClient(); // apiKey: or COSS_API_KEY\n\nawait client.Scheduling.Bookings.UpdateLocationAsync(\n new UpdateBookingLocationRequest\n {\n Id = \"book_01kd2m9a0b1c2d3e4f5g6h7j8m\",\n Location = new SchedulingLocation(\n new SchedulingLocation.Link(\n new SchedulingLocationLink { Url = \"https://meet.example.com/abc\" }\n )\n ),\n }\n);" + "python": "from coss import Coss\nfrom coss import Coss, SchedulingLocationZero\n\nclient = Coss() # api_key= or COSS_API_KEY\n\nclient.scheduling.bookings.update_location(\n id=\"book_01kd2m9a0b1c2d3e4f5g6h7j8m\",\n location=SchedulingLocationZero(\n type=\"link\",\n url=\"https://meet.example.com/abc\",\n ),\n)", + "go": "import (\n\t\"context\"\n\n\tcoss \"github.com/cosscom/coss-go\"\n\tcossclient \"github.com/cosscom/coss-go/client\"\n\tscheduling \"github.com/cosscom/coss-go/scheduling\"\n)\n\nclient := cossclient.NewClient() // option.WithAPIKey(…) or COSS_API_KEY\n\nrequest := &scheduling.UpdateBookingLocationRequest{\n ID: \"book_01kd2m9a0b1c2d3e4f5g6h7j8m\",\n Location: &coss.SchedulingLocation{\n SchedulingLocationZero: &coss.SchedulingLocationZero{\n Type: coss.SchedulingLocationZeroTypeLink,\n URL: coss.String(\n \"https://meet.example.com/abc\",\n ),\n },\n },\n}\nclient.Scheduling.Bookings.UpdateLocation(\n context.TODO(),\n request,\n)", + "ruby": "require \"coss\"\n\nclient = Coss::Client.new # api_key: or COSS_API_KEY\n\nclient.scheduling.bookings.update_location(\n id: \"book_01kd2m9a0b1c2d3e4f5g6h7j8m\",\n location: {\n type: \"link\",\n url: \"https://meet.example.com/abc\"\n }\n)", + "php": "scheduling->bookings->updateLocation(\n 'book_01kd2m9a0b1c2d3e4f5g6h7j8m',\n new UpdateBookingLocationRequest([\n 'location' => new SchedulingLocationZero([\n 'type' => SchedulingLocationZeroType::Link->value,\n 'url' => 'https://meet.example.com/abc',\n ]),\n ]),\n);", + "java": "import com.coss.Coss;\nimport com.coss.resources.scheduling.bookings.requests.UpdateBookingLocationRequest;\nimport com.coss.types.SchedulingLocation;\nimport com.coss.types.SchedulingLocationZero;\nimport com.coss.types.SchedulingLocationZeroType;\n\nCoss client = Coss.builder().build(); // .apiKey(…) or COSS_API_KEY\n\nclient.scheduling().bookings().updateLocation(\n \"book_01kd2m9a0b1c2d3e4f5g6h7j8m\",\n UpdateBookingLocationRequest\n .builder()\n .location(\n OptionalNullable.of(\n SchedulingLocation.of(\n SchedulingLocationZero\n .builder()\n .type(SchedulingLocationZeroType.LINK)\n .url(\n OptionalNullable.of(\"https://meet.example.com/abc\")\n )\n .build()\n )\n )\n )\n .build()\n);", + "csharp": "using Coss;\nusing Coss.Scheduling;\n\nvar client = new CossClient(); // apiKey: or COSS_API_KEY\n\nawait client.Scheduling.Bookings.UpdateLocationAsync(\n new UpdateBookingLocationRequest\n {\n Id = \"book_01kd2m9a0b1c2d3e4f5g6h7j8m\",\n Location = new SchedulingLocationZero\n {\n Type = SchedulingLocationZeroType.Link,\n Url = \"https://meet.example.com/abc\",\n },\n }\n);" }, "POST /v1/scheduling/holds": { "python": "from coss import Coss\nfrom coss import Coss, SchedulingAttendeeInput\n\nclient = Coss() # api_key= or COSS_API_KEY\n\nclient.scheduling.holds.create(\n idempotency_key=\"welcome-user-123\",\n event_type=\"evtype_01kd2m9a0b1c2d3e4f5g6h7j8m\",\n start=\"2027-01-04T15:00:00.000Z\",\n attendee=SchedulingAttendeeInput(\n uid=\"patient_77\",\n time_zone=\"UTC\",\n ),\n)", @@ -399,6 +415,46 @@ "java": "import com.coss.Coss;\nimport com.coss.resources.scheduling.calendardelegations.requests.DeleteCalendarDelegationsRequest;\n\nCoss client = Coss.builder().build(); // .apiKey(…) or COSS_API_KEY\n\nclient.scheduling().calendarDelegations().delete(\n \"caldlg_01kd2m9a0b1c2d3e4f5g6h7j8m\",\n DeleteCalendarDelegationsRequest\n .builder()\n .build()\n);", "csharp": "using Coss;\nusing Coss.Scheduling;\n\nvar client = new CossClient(); // apiKey: or COSS_API_KEY\n\nawait client.Scheduling.CalendarDelegations.DeleteAsync(\n new DeleteCalendarDelegationsRequest { Id = \"caldlg_01kd2m9a0b1c2d3e4f5g6h7j8m\" }\n);" }, + "POST /v1/scheduling/oauth_apps": { + "python": "from coss import Coss\nfrom coss import Coss, CreateOauthAppRequest_Google\n\nclient = Coss() # api_key= or COSS_API_KEY\n\nclient.scheduling.oauth_apps.create(\n request=CreateOauthAppRequest_Google(\n client_id=\"client_id\",\n client_secret=\"client_secret\",\n ),\n)", + "go": "import (\n\t\"context\"\n\n\tcoss \"github.com/cosscom/coss-go\"\n\tcossclient \"github.com/cosscom/coss-go/client\"\n)\n\nclient := cossclient.NewClient() // option.WithAPIKey(…) or COSS_API_KEY\n\nrequest := &coss.CreateOauthAppRequest{\n Google: &coss.CreateOauthAppRequestGoogle{\n ClientID: \"client_id\",\n ClientSecret: \"client_secret\",\n },\n}\nclient.Scheduling.OauthApps.Create(\n context.TODO(),\n request,\n)", + "ruby": "require \"coss\"\n\nclient = Coss::Client.new # api_key: or COSS_API_KEY\n\nclient.scheduling.oauth_apps.create", + "php": "scheduling->oauthApps->create(\n CreateOauthAppRequest::google(new CreateOauthAppRequestGoogle([\n 'clientId' => 'client_id',\n 'clientSecret' => 'client_secret',\n ])),\n);", + "java": "import com.coss.Coss;\nimport com.coss.types.CreateOauthAppRequest;\nimport com.coss.types.CreateOauthAppRequestGoogle;\n\nCoss client = Coss.builder().build(); // .apiKey(…) or COSS_API_KEY\n\nclient.scheduling().oauthApps().create(\n CreateOauthAppRequest.google(\n CreateOauthAppRequestGoogle\n .builder()\n .clientId(\"client_id\")\n .clientSecret(\"client_secret\")\n .build()\n )\n);", + "csharp": "using Coss;\n\nvar client = new CossClient(); // apiKey: or COSS_API_KEY\n\nawait client.Scheduling.OauthApps.CreateAsync(\n new CreateOauthAppRequest(\n new CreateOauthAppRequest.Google(\n new CreateOauthAppRequestGoogle\n {\n ClientId = \"client_id\",\n ClientSecret = \"client_secret\",\n }\n )\n )\n);" + }, + "GET /v1/scheduling/oauth_apps": { + "python": "from coss import Coss\n\nclient = Coss() # api_key= or COSS_API_KEY\n\nclient.scheduling.oauth_apps.list()", + "go": "import (\n\t\"context\"\n\n\tcossclient \"github.com/cosscom/coss-go/client\"\n)\n\nclient := cossclient.NewClient() // option.WithAPIKey(…) or COSS_API_KEY\n\nclient.Scheduling.OauthApps.List(\n context.TODO(),\n)", + "ruby": "require \"coss\"\n\nclient = Coss::Client.new # api_key: or COSS_API_KEY\n\nclient.scheduling.oauth_apps.list", + "php": "scheduling->oauthApps->list();", + "java": "import com.coss.Coss;\n\nCoss client = Coss.builder().build(); // .apiKey(…) or COSS_API_KEY\n\nclient.scheduling().oauthApps().list();", + "csharp": "using Coss;\n\nvar client = new CossClient(); // apiKey: or COSS_API_KEY\n\nawait client.Scheduling.OauthApps.ListAsync();" + }, + "GET /v1/scheduling/oauth_apps/{id}": { + "python": "from coss import Coss\n\nclient = Coss() # api_key= or COSS_API_KEY\n\nclient.scheduling.oauth_apps.get(\n id=\"calapp_01kd2m9a0b1c2d3e4f5g6h7j8m\",\n)", + "go": "import (\n\t\"context\"\n\n\tcossclient \"github.com/cosscom/coss-go/client\"\n\tscheduling \"github.com/cosscom/coss-go/scheduling\"\n)\n\nclient := cossclient.NewClient() // option.WithAPIKey(…) or COSS_API_KEY\n\nrequest := &scheduling.GetOauthAppsRequest{\n ID: \"calapp_01kd2m9a0b1c2d3e4f5g6h7j8m\",\n}\nclient.Scheduling.OauthApps.Get(\n context.TODO(),\n request,\n)", + "ruby": "require \"coss\"\n\nclient = Coss::Client.new # api_key: or COSS_API_KEY\n\nclient.scheduling.oauth_apps.get(id: \"calapp_01kd2m9a0b1c2d3e4f5g6h7j8m\")", + "php": "scheduling->oauthApps->get(\n 'calapp_01kd2m9a0b1c2d3e4f5g6h7j8m',\n);", + "java": "import com.coss.Coss;\nimport com.coss.resources.scheduling.oauthapps.requests.GetOauthAppsRequest;\n\nCoss client = Coss.builder().build(); // .apiKey(…) or COSS_API_KEY\n\nclient.scheduling().oauthApps().get(\n \"calapp_01kd2m9a0b1c2d3e4f5g6h7j8m\",\n GetOauthAppsRequest\n .builder()\n .build()\n);", + "csharp": "using Coss;\nusing Coss.Scheduling;\n\nvar client = new CossClient(); // apiKey: or COSS_API_KEY\n\nawait client.Scheduling.OauthApps.GetAsync(\n new GetOauthAppsRequest { Id = \"calapp_01kd2m9a0b1c2d3e4f5g6h7j8m\" }\n);" + }, + "PATCH /v1/scheduling/oauth_apps/{id}": { + "python": "from coss import Coss\n\nclient = Coss() # api_key= or COSS_API_KEY\n\nclient.scheduling.oauth_apps.update(\n id=\"calapp_01kd2m9a0b1c2d3e4f5g6h7j8m\",\n client_secret=\"GOCSPX-abcdefghijklmnopqrstuvwxyz\",\n)", + "go": "import (\n\t\"context\"\n\n\tcoss \"github.com/cosscom/coss-go\"\n\tcossclient \"github.com/cosscom/coss-go/client\"\n\tscheduling \"github.com/cosscom/coss-go/scheduling\"\n)\n\nclient := cossclient.NewClient() // option.WithAPIKey(…) or COSS_API_KEY\n\nrequest := &scheduling.UpdateOauthAppRequest{\n ID: \"calapp_01kd2m9a0b1c2d3e4f5g6h7j8m\",\n ClientSecret: coss.String(\n \"GOCSPX-abcdefghijklmnopqrstuvwxyz\",\n ),\n}\nclient.Scheduling.OauthApps.Update(\n context.TODO(),\n request,\n)", + "ruby": "require \"coss\"\n\nclient = Coss::Client.new # api_key: or COSS_API_KEY\n\nclient.scheduling.oauth_apps.update(\n id: \"calapp_01kd2m9a0b1c2d3e4f5g6h7j8m\",\n client_secret: \"GOCSPX-abcdefghijklmnopqrstuvwxyz\"\n)", + "php": "scheduling->oauthApps->update(\n 'calapp_01kd2m9a0b1c2d3e4f5g6h7j8m',\n new UpdateOauthAppRequest([\n 'clientSecret' => 'GOCSPX-abcdefghijklmnopqrstuvwxyz',\n ]),\n);", + "java": "import com.coss.Coss;\nimport com.coss.resources.scheduling.oauthapps.requests.UpdateOauthAppRequest;\n\nCoss client = Coss.builder().build(); // .apiKey(…) or COSS_API_KEY\n\nclient.scheduling().oauthApps().update(\n \"calapp_01kd2m9a0b1c2d3e4f5g6h7j8m\",\n UpdateOauthAppRequest\n .builder()\n .clientSecret(\"GOCSPX-abcdefghijklmnopqrstuvwxyz\")\n .build()\n);", + "csharp": "using Coss;\nusing Coss.Scheduling;\n\nvar client = new CossClient(); // apiKey: or COSS_API_KEY\n\nawait client.Scheduling.OauthApps.UpdateAsync(\n new UpdateOauthAppRequest\n {\n Id = \"calapp_01kd2m9a0b1c2d3e4f5g6h7j8m\",\n ClientSecret = \"GOCSPX-abcdefghijklmnopqrstuvwxyz\",\n }\n);" + }, + "DELETE /v1/scheduling/oauth_apps/{id}": { + "python": "from coss import Coss\n\nclient = Coss() # api_key= or COSS_API_KEY\n\nclient.scheduling.oauth_apps.delete(\n id=\"calapp_01kd2m9a0b1c2d3e4f5g6h7j8m\",\n)", + "go": "import (\n\t\"context\"\n\n\tcossclient \"github.com/cosscom/coss-go/client\"\n\tscheduling \"github.com/cosscom/coss-go/scheduling\"\n)\n\nclient := cossclient.NewClient() // option.WithAPIKey(…) or COSS_API_KEY\n\nrequest := &scheduling.DeleteOauthAppsRequest{\n ID: \"calapp_01kd2m9a0b1c2d3e4f5g6h7j8m\",\n}\nclient.Scheduling.OauthApps.Delete(\n context.TODO(),\n request,\n)", + "ruby": "require \"coss\"\n\nclient = Coss::Client.new # api_key: or COSS_API_KEY\n\nclient.scheduling.oauth_apps.delete(id: \"calapp_01kd2m9a0b1c2d3e4f5g6h7j8m\")", + "php": "scheduling->oauthApps->delete(\n 'calapp_01kd2m9a0b1c2d3e4f5g6h7j8m',\n);", + "java": "import com.coss.Coss;\nimport com.coss.resources.scheduling.oauthapps.requests.DeleteOauthAppsRequest;\n\nCoss client = Coss.builder().build(); // .apiKey(…) or COSS_API_KEY\n\nclient.scheduling().oauthApps().delete(\n \"calapp_01kd2m9a0b1c2d3e4f5g6h7j8m\",\n DeleteOauthAppsRequest\n .builder()\n .build()\n);", + "csharp": "using Coss;\nusing Coss.Scheduling;\n\nvar client = new CossClient(); // apiKey: or COSS_API_KEY\n\nawait client.Scheduling.OauthApps.DeleteAsync(\n new DeleteOauthAppsRequest { Id = \"calapp_01kd2m9a0b1c2d3e4f5g6h7j8m\" }\n);" + }, "POST /v1/scheduling/hosts/{host}/sessions": { "python": "from coss import Coss\n\nclient = Coss() # api_key= or COSS_API_KEY\n\nclient.scheduling.sessions.create_for_host(\n host=\"host_01kd2m9a0b1c2d3e4f5g6h7j8m\",\n expires_in=3600,\n)", "go": "import (\n\t\"context\"\n\n\tcoss \"github.com/cosscom/coss-go\"\n\tcossclient \"github.com/cosscom/coss-go/client\"\n\tscheduling \"github.com/cosscom/coss-go/scheduling\"\n)\n\nclient := cossclient.NewClient() // option.WithAPIKey(…) or COSS_API_KEY\n\nrequest := &scheduling.CreateSchedulingHostSessionRequest{\n Host: \"host_01kd2m9a0b1c2d3e4f5g6h7j8m\",\n ExpiresIn: coss.Int(\n 3600,\n ),\n}\nclient.Scheduling.Sessions.CreateForHost(\n context.TODO(),\n request,\n)", @@ -423,6 +479,174 @@ "java": "import com.coss.Coss;\nimport com.coss.resources.scheduling.sessions.requests.CreateForBookingSessionsRequest;\n\nCoss client = Coss.builder().build(); // .apiKey(…) or COSS_API_KEY\n\nclient.scheduling().sessions().createForBooking(\n \"book_01kd2m9a0b1c2d3e4f5g6h7j8m\",\n CreateForBookingSessionsRequest\n .builder()\n .build()\n);", "csharp": "using Coss;\nusing Coss.Scheduling;\n\nvar client = new CossClient(); // apiKey: or COSS_API_KEY\n\nawait client.Scheduling.Sessions.CreateForBookingAsync(\n new CreateForBookingSessionsRequest { Id = \"book_01kd2m9a0b1c2d3e4f5g6h7j8m\" }\n);" }, + "POST /v1/scheduling/out_of_office": { + "python": "from coss import Coss\n\nclient = Coss() # api_key= or COSS_API_KEY\n\nclient.scheduling.out_of_office.create(\n host=\"doctor_482\",\n start_date=\"2027-08-02\",\n end_date=\"2027-08-13\",\n reason=\"vacation\",\n public_message=\"Back on the 16th.\",\n)", + "go": "import (\n\t\"context\"\n\n\tcoss \"github.com/cosscom/coss-go\"\n\tcossclient \"github.com/cosscom/coss-go/client\"\n\tscheduling \"github.com/cosscom/coss-go/scheduling\"\n)\n\nclient := cossclient.NewClient() // option.WithAPIKey(…) or COSS_API_KEY\n\nrequest := &scheduling.CreateSchedulingOutOfOfficeRequest{\n Host: coss.String(\n \"doctor_482\",\n ),\n StartDate: coss.String(\n \"2027-08-02\",\n ),\n EndDate: coss.String(\n \"2027-08-13\",\n ),\n Reason: coss.String(\n \"vacation\",\n ),\n PublicMessage: coss.String(\n \"Back on the 16th.\",\n ),\n}\nclient.Scheduling.OutOfOffice.Create(\n context.TODO(),\n request,\n)", + "ruby": "require \"coss\"\n\nclient = Coss::Client.new # api_key: or COSS_API_KEY\n\nclient.scheduling.out_of_office.create(\n host: \"doctor_482\",\n start_date: \"2027-08-02\",\n end_date: \"2027-08-13\",\n reason: \"vacation\",\n public_message: \"Back on the 16th.\"\n)", + "php": "scheduling->outOfOffice->create(\n new CreateSchedulingOutOfOfficeRequest([\n 'host' => 'doctor_482',\n 'startDate' => '2027-08-02',\n 'endDate' => '2027-08-13',\n 'reason' => 'vacation',\n 'publicMessage' => 'Back on the 16th.',\n ]),\n);", + "java": "import com.coss.Coss;\nimport com.coss.resources.scheduling.outofoffice.requests.CreateSchedulingOutOfOfficeRequest;\n\nCoss client = Coss.builder().build(); // .apiKey(…) or COSS_API_KEY\n\nclient.scheduling().outOfOffice().create(\n CreateSchedulingOutOfOfficeRequest\n .builder()\n .host(\"doctor_482\")\n .startDate(\"2027-08-02\")\n .endDate(\"2027-08-13\")\n .reason(\"vacation\")\n .publicMessage(\"Back on the 16th.\")\n .build()\n);", + "csharp": "using Coss;\nusing Coss.Scheduling;\n\nvar client = new CossClient(); // apiKey: or COSS_API_KEY\n\nawait client.Scheduling.OutOfOffice.CreateAsync(\n new CreateSchedulingOutOfOfficeRequest\n {\n Host = \"doctor_482\",\n StartDate = \"2027-08-02\",\n EndDate = \"2027-08-13\",\n Reason = \"vacation\",\n PublicMessage = \"Back on the 16th.\",\n }\n);" + }, + "GET /v1/scheduling/out_of_office": { + "python": "from coss import Coss\n\nclient = Coss() # api_key= or COSS_API_KEY\n\nclient.scheduling.out_of_office.list(\n start_after=\"2027-01-04T15:00:00.000Z\",\n start_before=\"2027-01-04T15:00:00.000Z\",\n)", + "go": "import (\n\t\"context\"\n\n\tcoss \"github.com/cosscom/coss-go\"\n\tcossclient \"github.com/cosscom/coss-go/client\"\n\tscheduling \"github.com/cosscom/coss-go/scheduling\"\n)\n\nclient := cossclient.NewClient() // option.WithAPIKey(…) or COSS_API_KEY\n\nrequest := &scheduling.ListOutOfOfficeRequest{\n StartAfter: coss.String(\n \"2027-01-04T15:00:00.000Z\",\n ),\n StartBefore: coss.String(\n \"2027-01-04T15:00:00.000Z\",\n ),\n}\nclient.Scheduling.OutOfOffice.List(\n context.TODO(),\n request,\n)", + "ruby": "require \"coss\"\n\nclient = Coss::Client.new # api_key: or COSS_API_KEY\n\nclient.scheduling.out_of_office.list(\n start_after: \"2027-01-04T15:00:00.000Z\",\n start_before: \"2027-01-04T15:00:00.000Z\"\n)", + "php": "scheduling->outOfOffice->list(\n new ListOutOfOfficeRequest([\n 'startAfter' => '2027-01-04T15:00:00.000Z',\n 'startBefore' => '2027-01-04T15:00:00.000Z',\n ]),\n);", + "java": "import com.coss.Coss;\nimport com.coss.resources.scheduling.outofoffice.requests.ListOutOfOfficeRequest;\n\nCoss client = Coss.builder().build(); // .apiKey(…) or COSS_API_KEY\n\nclient.scheduling().outOfOffice().list(\n ListOutOfOfficeRequest\n .builder()\n .startAfter(\"2027-01-04T15:00:00.000Z\")\n .startBefore(\"2027-01-04T15:00:00.000Z\")\n .build()\n);", + "csharp": "using Coss;\nusing Coss.Scheduling;\n\nvar client = new CossClient(); // apiKey: or COSS_API_KEY\n\nawait client.Scheduling.OutOfOffice.ListAsync(\n new ListOutOfOfficeRequest\n {\n StartAfter = \"2027-01-04T15:00:00.000Z\",\n StartBefore = \"2027-01-04T15:00:00.000Z\",\n }\n);" + }, + "GET /v1/scheduling/out_of_office/{id}": { + "python": "from coss import Coss\n\nclient = Coss() # api_key= or COSS_API_KEY\n\nclient.scheduling.out_of_office.get(\n id=\"ooo_01kd2m9a0b1c2d3e4f5g6h7j8m\",\n)", + "go": "import (\n\t\"context\"\n\n\tcossclient \"github.com/cosscom/coss-go/client\"\n\tscheduling \"github.com/cosscom/coss-go/scheduling\"\n)\n\nclient := cossclient.NewClient() // option.WithAPIKey(…) or COSS_API_KEY\n\nrequest := &scheduling.GetOutOfOfficeRequest{\n ID: \"ooo_01kd2m9a0b1c2d3e4f5g6h7j8m\",\n}\nclient.Scheduling.OutOfOffice.Get(\n context.TODO(),\n request,\n)", + "ruby": "require \"coss\"\n\nclient = Coss::Client.new # api_key: or COSS_API_KEY\n\nclient.scheduling.out_of_office.get(id: \"ooo_01kd2m9a0b1c2d3e4f5g6h7j8m\")", + "php": "scheduling->outOfOffice->get(\n 'ooo_01kd2m9a0b1c2d3e4f5g6h7j8m',\n);", + "java": "import com.coss.Coss;\nimport com.coss.resources.scheduling.outofoffice.requests.GetOutOfOfficeRequest;\n\nCoss client = Coss.builder().build(); // .apiKey(…) or COSS_API_KEY\n\nclient.scheduling().outOfOffice().get(\n \"ooo_01kd2m9a0b1c2d3e4f5g6h7j8m\",\n GetOutOfOfficeRequest\n .builder()\n .build()\n);", + "csharp": "using Coss;\nusing Coss.Scheduling;\n\nvar client = new CossClient(); // apiKey: or COSS_API_KEY\n\nawait client.Scheduling.OutOfOffice.GetAsync(\n new GetOutOfOfficeRequest { Id = \"ooo_01kd2m9a0b1c2d3e4f5g6h7j8m\" }\n);" + }, + "PATCH /v1/scheduling/out_of_office/{id}": { + "python": "from coss import Coss\n\nclient = Coss() # api_key= or COSS_API_KEY\n\nclient.scheduling.out_of_office.update(\n id=\"ooo_01kd2m9a0b1c2d3e4f5g6h7j8m\",\n end_date=\"2027-08-20\",\n)", + "go": "import (\n\t\"context\"\n\n\tcoss \"github.com/cosscom/coss-go\"\n\tcossclient \"github.com/cosscom/coss-go/client\"\n\tscheduling \"github.com/cosscom/coss-go/scheduling\"\n)\n\nclient := cossclient.NewClient() // option.WithAPIKey(…) or COSS_API_KEY\n\nrequest := &scheduling.UpdateSchedulingOutOfOfficeRequest{\n ID: \"ooo_01kd2m9a0b1c2d3e4f5g6h7j8m\",\n EndDate: coss.String(\n \"2027-08-20\",\n ),\n}\nclient.Scheduling.OutOfOffice.Update(\n context.TODO(),\n request,\n)", + "ruby": "require \"coss\"\n\nclient = Coss::Client.new # api_key: or COSS_API_KEY\n\nclient.scheduling.out_of_office.update(\n id: \"ooo_01kd2m9a0b1c2d3e4f5g6h7j8m\",\n end_date: \"2027-08-20\"\n)", + "php": "scheduling->outOfOffice->update(\n 'ooo_01kd2m9a0b1c2d3e4f5g6h7j8m',\n new UpdateSchedulingOutOfOfficeRequest([\n 'endDate' => '2027-08-20',\n ]),\n);", + "java": "import com.coss.Coss;\nimport com.coss.resources.scheduling.outofoffice.requests.UpdateSchedulingOutOfOfficeRequest;\n\nCoss client = Coss.builder().build(); // .apiKey(…) or COSS_API_KEY\n\nclient.scheduling().outOfOffice().update(\n \"ooo_01kd2m9a0b1c2d3e4f5g6h7j8m\",\n UpdateSchedulingOutOfOfficeRequest\n .builder()\n .endDate(\"2027-08-20\")\n .build()\n);", + "csharp": "using Coss;\nusing Coss.Scheduling;\n\nvar client = new CossClient(); // apiKey: or COSS_API_KEY\n\nawait client.Scheduling.OutOfOffice.UpdateAsync(\n new UpdateSchedulingOutOfOfficeRequest\n {\n Id = \"ooo_01kd2m9a0b1c2d3e4f5g6h7j8m\",\n EndDate = \"2027-08-20\",\n }\n);" + }, + "PUT /v1/scheduling/out_of_office/by_external_id/{external_id}": { + "python": "from coss import Coss\n\nclient = Coss() # api_key= or COSS_API_KEY\n\nclient.scheduling.out_of_office.put(\n external_id=\"hr_leave_4471\",\n host=\"doctor_482\",\n start_date=\"2027-08-02\",\n end_date=\"2027-08-13\",\n reason=\"vacation\",\n)", + "go": "import (\n\t\"context\"\n\n\tcoss \"github.com/cosscom/coss-go\"\n\tcossclient \"github.com/cosscom/coss-go/client\"\n\tscheduling \"github.com/cosscom/coss-go/scheduling\"\n)\n\nclient := cossclient.NewClient() // option.WithAPIKey(…) or COSS_API_KEY\n\nrequest := &scheduling.PutSchedulingOutOfOfficeRequest{\n ExternalID: \"hr_leave_4471\",\n Host: \"doctor_482\",\n StartDate: coss.String(\n \"2027-08-02\",\n ),\n EndDate: coss.String(\n \"2027-08-13\",\n ),\n Reason: coss.String(\n \"vacation\",\n ),\n}\nclient.Scheduling.OutOfOffice.Put(\n context.TODO(),\n request,\n)", + "ruby": "require \"coss\"\n\nclient = Coss::Client.new # api_key: or COSS_API_KEY\n\nclient.scheduling.out_of_office.put(\n external_id: \"hr_leave_4471\",\n host: \"doctor_482\",\n start_date: \"2027-08-02\",\n end_date: \"2027-08-13\",\n reason: \"vacation\"\n)", + "php": "scheduling->outOfOffice->put(\n 'hr_leave_4471',\n new PutSchedulingOutOfOfficeRequest([\n 'host' => 'doctor_482',\n 'startDate' => '2027-08-02',\n 'endDate' => '2027-08-13',\n 'reason' => 'vacation',\n ]),\n);", + "java": "import com.coss.Coss;\nimport com.coss.resources.scheduling.outofoffice.requests.PutSchedulingOutOfOfficeRequest;\n\nCoss client = Coss.builder().build(); // .apiKey(…) or COSS_API_KEY\n\nclient.scheduling().outOfOffice().put(\n \"hr_leave_4471\",\n PutSchedulingOutOfOfficeRequest\n .builder()\n .host(\"doctor_482\")\n .startDate(\"2027-08-02\")\n .endDate(\"2027-08-13\")\n .reason(\"vacation\")\n .build()\n);", + "csharp": "using Coss;\nusing Coss.Scheduling;\n\nvar client = new CossClient(); // apiKey: or COSS_API_KEY\n\nawait client.Scheduling.OutOfOffice.PutAsync(\n new PutSchedulingOutOfOfficeRequest\n {\n ExternalId = \"hr_leave_4471\",\n Host = \"doctor_482\",\n StartDate = \"2027-08-02\",\n EndDate = \"2027-08-13\",\n Reason = \"vacation\",\n }\n);" + }, + "DELETE /v1/scheduling/out_of_office/{id}": { + "python": "from coss import Coss\n\nclient = Coss() # api_key= or COSS_API_KEY\n\nclient.scheduling.out_of_office.remove(\n id=\"ooo_01kd2m9a0b1c2d3e4f5g6h7j8m\",\n)", + "go": "import (\n\t\"context\"\n\n\tcossclient \"github.com/cosscom/coss-go/client\"\n\tscheduling \"github.com/cosscom/coss-go/scheduling\"\n)\n\nclient := cossclient.NewClient() // option.WithAPIKey(…) or COSS_API_KEY\n\nrequest := &scheduling.RemoveOutOfOfficeRequest{\n ID: \"ooo_01kd2m9a0b1c2d3e4f5g6h7j8m\",\n}\nclient.Scheduling.OutOfOffice.Remove(\n context.TODO(),\n request,\n)", + "ruby": "require \"coss\"\n\nclient = Coss::Client.new # api_key: or COSS_API_KEY\n\nclient.scheduling.out_of_office.remove(id: \"ooo_01kd2m9a0b1c2d3e4f5g6h7j8m\")", + "php": "scheduling->outOfOffice->remove(\n 'ooo_01kd2m9a0b1c2d3e4f5g6h7j8m',\n);", + "java": "import com.coss.Coss;\nimport com.coss.resources.scheduling.outofoffice.requests.RemoveOutOfOfficeRequest;\n\nCoss client = Coss.builder().build(); // .apiKey(…) or COSS_API_KEY\n\nclient.scheduling().outOfOffice().remove(\n \"ooo_01kd2m9a0b1c2d3e4f5g6h7j8m\",\n RemoveOutOfOfficeRequest\n .builder()\n .build()\n);", + "csharp": "using Coss;\nusing Coss.Scheduling;\n\nvar client = new CossClient(); // apiKey: or COSS_API_KEY\n\nawait client.Scheduling.OutOfOffice.RemoveAsync(\n new RemoveOutOfOfficeRequest { Id = \"ooo_01kd2m9a0b1c2d3e4f5g6h7j8m\" }\n);" + }, + "GET /v1/scheduling/out_of_office/{id}/conflicts": { + "python": "from coss import Coss\n\nclient = Coss() # api_key= or COSS_API_KEY\n\nclient.scheduling.out_of_office.conflicts(\n id=\"ooo_01kd2m9a0b1c2d3e4f5g6h7j8m\",\n)", + "go": "import (\n\t\"context\"\n\n\tcossclient \"github.com/cosscom/coss-go/client\"\n\tscheduling \"github.com/cosscom/coss-go/scheduling\"\n)\n\nclient := cossclient.NewClient() // option.WithAPIKey(…) or COSS_API_KEY\n\nrequest := &scheduling.ConflictsOutOfOfficeRequest{\n ID: \"ooo_01kd2m9a0b1c2d3e4f5g6h7j8m\",\n}\nclient.Scheduling.OutOfOffice.Conflicts(\n context.TODO(),\n request,\n)", + "ruby": "require \"coss\"\n\nclient = Coss::Client.new # api_key: or COSS_API_KEY\n\nclient.scheduling.out_of_office.conflicts(id: \"ooo_01kd2m9a0b1c2d3e4f5g6h7j8m\")", + "php": "scheduling->outOfOffice->conflicts(\n 'ooo_01kd2m9a0b1c2d3e4f5g6h7j8m',\n new ConflictsOutOfOfficeRequest([]),\n);", + "java": "import com.coss.Coss;\nimport com.coss.resources.scheduling.outofoffice.requests.ConflictsOutOfOfficeRequest;\n\nCoss client = Coss.builder().build(); // .apiKey(…) or COSS_API_KEY\n\nclient.scheduling().outOfOffice().conflicts(\n \"ooo_01kd2m9a0b1c2d3e4f5g6h7j8m\",\n ConflictsOutOfOfficeRequest\n .builder()\n .build()\n);", + "csharp": "using Coss;\nusing Coss.Scheduling;\n\nvar client = new CossClient(); // apiKey: or COSS_API_KEY\n\nawait client.Scheduling.OutOfOffice.ConflictsAsync(\n new ConflictsOutOfOfficeRequest { Id = \"ooo_01kd2m9a0b1c2d3e4f5g6h7j8m\" }\n);" + }, + "POST /v1/scheduling/manager_sessions": { + "python": "from coss import Coss\n\nclient = Coss() # api_key= or COSS_API_KEY\n\nclient.scheduling.sessions.create_for_manager(\n host_filter={\n \"team\": \"cardiology\"\n },\n expires_in=3600,\n)", + "go": "import (\n\t\"context\"\n\n\tcoss \"github.com/cosscom/coss-go\"\n\tcossclient \"github.com/cosscom/coss-go/client\"\n\tscheduling \"github.com/cosscom/coss-go/scheduling\"\n)\n\nclient := cossclient.NewClient() // option.WithAPIKey(…) or COSS_API_KEY\n\nrequest := &scheduling.CreateSchedulingManagerSessionRequest{\n HostFilter: map[string]*scheduling.CreateSchedulingManagerSessionRequestHostFilterValue{\n \"team\": &scheduling.CreateSchedulingManagerSessionRequestHostFilterValue{\n String: \"cardiology\",\n },\n },\n ExpiresIn: coss.Int(\n 3600,\n ),\n}\nclient.Scheduling.Sessions.CreateForManager(\n context.TODO(),\n request,\n)", + "ruby": "require \"coss\"\n\nclient = Coss::Client.new # api_key: or COSS_API_KEY\n\nclient.scheduling.sessions.create_for_manager(\n host_filter: {\n team: \"cardiology\"\n },\n expires_in: 3600\n)", + "php": "scheduling->sessions->createForManager(\n new CreateSchedulingManagerSessionRequest([\n 'hostFilter' => [\n 'team' => 'cardiology',\n ],\n 'expiresIn' => 3600,\n ]),\n);", + "java": "import com.coss.Coss;\nimport com.coss.resources.scheduling.sessions.requests.CreateSchedulingManagerSessionRequest;\nimport com.coss.resources.scheduling.sessions.types.CreateSchedulingManagerSessionRequestHostFilterValue;\nimport java.util.HashMap;\n\nCoss client = Coss.builder().build(); // .apiKey(…) or COSS_API_KEY\n\nclient.scheduling().sessions().createForManager(\n CreateSchedulingManagerSessionRequest\n .builder()\n .hostFilter(\n new HashMap() {{\n put(\"team\", CreateSchedulingManagerSessionRequestHostFilterValue.of(\"cardiology\"));\n }}\n )\n .expiresIn(3600)\n .build()\n);", + "csharp": "using Coss;\nusing Coss.Scheduling;\n\nvar client = new CossClient(); // apiKey: or COSS_API_KEY\n\nawait client.Scheduling.Sessions.CreateForManagerAsync(\n new CreateSchedulingManagerSessionRequest\n {\n HostFilter = new Dictionary>>()\n {\n { \"team\", \"cardiology\" },\n },\n ExpiresIn = 3600,\n }\n);" + }, + "POST /v1/scheduling/holiday_calendars": { + "python": "from coss import Coss\n\nclient = Coss() # api_key= or COSS_API_KEY\n\nclient.scheduling.holiday_calendars.create(\n name=\"UK team\",\n country=\"GB\",\n host_filter={\n \"team\": \"london\"\n },\n)", + "go": "import (\n\t\"context\"\n\n\tcoss \"github.com/cosscom/coss-go\"\n\tcossclient \"github.com/cosscom/coss-go/client\"\n\tscheduling \"github.com/cosscom/coss-go/scheduling\"\n)\n\nclient := cossclient.NewClient() // option.WithAPIKey(…) or COSS_API_KEY\n\nrequest := &scheduling.CreateSchedulingHolidayCalendarRequest{\n Name: \"UK team\",\n Country: coss.String(\n \"GB\",\n ),\n HostFilter: map[string]*scheduling.CreateSchedulingHolidayCalendarRequestHostFilterValue{\n \"team\": &scheduling.CreateSchedulingHolidayCalendarRequestHostFilterValue{\n String: \"london\",\n },\n },\n}\nclient.Scheduling.HolidayCalendars.Create(\n context.TODO(),\n request,\n)", + "ruby": "require \"coss\"\n\nclient = Coss::Client.new # api_key: or COSS_API_KEY\n\nclient.scheduling.holiday_calendars.create(\n name: \"UK team\",\n country: \"GB\",\n host_filter: {\n team: \"london\"\n }\n)", + "php": "scheduling->holidayCalendars->create(\n new CreateSchedulingHolidayCalendarRequest([\n 'name' => 'UK team',\n 'country' => 'GB',\n 'hostFilter' => [\n 'team' => 'london',\n ],\n ]),\n);", + "java": "import com.coss.Coss;\nimport com.coss.resources.scheduling.holidaycalendars.requests.CreateSchedulingHolidayCalendarRequest;\nimport com.coss.resources.scheduling.holidaycalendars.types.CreateSchedulingHolidayCalendarRequestHostFilterValue;\nimport java.util.HashMap;\n\nCoss client = Coss.builder().build(); // .apiKey(…) or COSS_API_KEY\n\nclient.scheduling().holidayCalendars().create(\n CreateSchedulingHolidayCalendarRequest\n .builder()\n .name(\"UK team\")\n .country(\"GB\")\n .hostFilter(\n new HashMap() {{\n put(\"team\", CreateSchedulingHolidayCalendarRequestHostFilterValue.of(\"london\"));\n }}\n )\n .build()\n);", + "csharp": "using Coss;\nusing Coss.Scheduling;\n\nvar client = new CossClient(); // apiKey: or COSS_API_KEY\n\nawait client.Scheduling.HolidayCalendars.CreateAsync(\n new CreateSchedulingHolidayCalendarRequest\n {\n Name = \"UK team\",\n Country = \"GB\",\n HostFilter = new Dictionary>>()\n {\n { \"team\", \"london\" },\n },\n }\n);" + }, + "GET /v1/scheduling/holiday_calendars": { + "python": "from coss import Coss\n\nclient = Coss() # api_key= or COSS_API_KEY\n\nclient.scheduling.holiday_calendars.list()", + "go": "import (\n\t\"context\"\n\n\tcossclient \"github.com/cosscom/coss-go/client\"\n)\n\nclient := cossclient.NewClient() // option.WithAPIKey(…) or COSS_API_KEY\n\nclient.Scheduling.HolidayCalendars.List(\n context.TODO(),\n)", + "ruby": "require \"coss\"\n\nclient = Coss::Client.new # api_key: or COSS_API_KEY\n\nclient.scheduling.holiday_calendars.list", + "php": "scheduling->holidayCalendars->list();", + "java": "import com.coss.Coss;\n\nCoss client = Coss.builder().build(); // .apiKey(…) or COSS_API_KEY\n\nclient.scheduling().holidayCalendars().list();", + "csharp": "using Coss;\n\nvar client = new CossClient(); // apiKey: or COSS_API_KEY\n\nawait client.Scheduling.HolidayCalendars.ListAsync();" + }, + "GET /v1/scheduling/holiday_calendars/{id}": { + "python": "from coss import Coss\n\nclient = Coss() # api_key= or COSS_API_KEY\n\nclient.scheduling.holiday_calendars.get(\n id=\"id\",\n)", + "go": "import (\n\t\"context\"\n\n\tcossclient \"github.com/cosscom/coss-go/client\"\n\tscheduling \"github.com/cosscom/coss-go/scheduling\"\n)\n\nclient := cossclient.NewClient() // option.WithAPIKey(…) or COSS_API_KEY\n\nrequest := &scheduling.GetHolidayCalendarsRequest{\n ID: \"id\",\n}\nclient.Scheduling.HolidayCalendars.Get(\n context.TODO(),\n request,\n)", + "ruby": "require \"coss\"\n\nclient = Coss::Client.new # api_key: or COSS_API_KEY\n\nclient.scheduling.holiday_calendars.get(id: \"id\")", + "php": "scheduling->holidayCalendars->get(\n 'id',\n);", + "java": "import com.coss.Coss;\nimport com.coss.resources.scheduling.holidaycalendars.requests.GetHolidayCalendarsRequest;\n\nCoss client = Coss.builder().build(); // .apiKey(…) or COSS_API_KEY\n\nclient.scheduling().holidayCalendars().get(\n \"id\",\n GetHolidayCalendarsRequest\n .builder()\n .build()\n);", + "csharp": "using Coss;\nusing Coss.Scheduling;\n\nvar client = new CossClient(); // apiKey: or COSS_API_KEY\n\nawait client.Scheduling.HolidayCalendars.GetAsync(new GetHolidayCalendarsRequest { Id = \"id\" });" + }, + "GET /v1/scheduling/holiday_calendars/{id}/holidays": { + "python": "from coss import Coss\n\nclient = Coss() # api_key= or COSS_API_KEY\n\nclient.scheduling.holiday_calendars.holidays(\n id=\"id\",\n)", + "go": "import (\n\t\"context\"\n\n\tcossclient \"github.com/cosscom/coss-go/client\"\n\tscheduling \"github.com/cosscom/coss-go/scheduling\"\n)\n\nclient := cossclient.NewClient() // option.WithAPIKey(…) or COSS_API_KEY\n\nrequest := &scheduling.HolidaysHolidayCalendarsRequest{\n ID: \"id\",\n}\nclient.Scheduling.HolidayCalendars.Holidays(\n context.TODO(),\n request,\n)", + "ruby": "require \"coss\"\n\nclient = Coss::Client.new # api_key: or COSS_API_KEY\n\nclient.scheduling.holiday_calendars.holidays(id: \"id\")", + "php": "scheduling->holidayCalendars->holidays(\n 'id',\n);", + "java": "import com.coss.Coss;\nimport com.coss.resources.scheduling.holidaycalendars.requests.HolidaysHolidayCalendarsRequest;\n\nCoss client = Coss.builder().build(); // .apiKey(…) or COSS_API_KEY\n\nclient.scheduling().holidayCalendars().holidays(\n \"id\",\n HolidaysHolidayCalendarsRequest\n .builder()\n .build()\n);", + "csharp": "using Coss;\nusing Coss.Scheduling;\n\nvar client = new CossClient(); // apiKey: or COSS_API_KEY\n\nawait client.Scheduling.HolidayCalendars.HolidaysAsync(\n new HolidaysHolidayCalendarsRequest { Id = \"id\" }\n);" + }, + "PATCH /v1/scheduling/holiday_calendars/{id}": { + "python": "from coss import Coss\n\nclient = Coss() # api_key= or COSS_API_KEY\n\nclient.scheduling.holiday_calendars.update(\n id=\"id\",\n host_filter={\n \"team\": \"london\"\n },\n)", + "go": "import (\n\t\"context\"\n\n\tcossclient \"github.com/cosscom/coss-go/client\"\n\tscheduling \"github.com/cosscom/coss-go/scheduling\"\n)\n\nclient := cossclient.NewClient() // option.WithAPIKey(…) or COSS_API_KEY\n\nrequest := &scheduling.UpdateSchedulingHolidayCalendarRequest{\n ID: \"id\",\n HostFilter: map[string]*scheduling.UpdateSchedulingHolidayCalendarRequestHostFilterValue{\n \"team\": &scheduling.UpdateSchedulingHolidayCalendarRequestHostFilterValue{\n String: \"london\",\n },\n },\n}\nclient.Scheduling.HolidayCalendars.Update(\n context.TODO(),\n request,\n)", + "ruby": "require \"coss\"\n\nclient = Coss::Client.new # api_key: or COSS_API_KEY\n\nclient.scheduling.holiday_calendars.update(\n id: \"id\",\n host_filter: {\n team: \"london\"\n }\n)", + "php": "scheduling->holidayCalendars->update(\n 'id',\n new UpdateSchedulingHolidayCalendarRequest([\n 'hostFilter' => [\n 'team' => 'london',\n ],\n ]),\n);", + "java": "import com.coss.Coss;\nimport com.coss.resources.scheduling.holidaycalendars.requests.UpdateSchedulingHolidayCalendarRequest;\nimport com.coss.resources.scheduling.holidaycalendars.types.UpdateSchedulingHolidayCalendarRequestHostFilterValue;\nimport java.util.HashMap;\n\nCoss client = Coss.builder().build(); // .apiKey(…) or COSS_API_KEY\n\nclient.scheduling().holidayCalendars().update(\n \"id\",\n UpdateSchedulingHolidayCalendarRequest\n .builder()\n .hostFilter(\n new HashMap() {{\n put(\"team\", UpdateSchedulingHolidayCalendarRequestHostFilterValue.of(\"london\"));\n }}\n )\n .build()\n);", + "csharp": "using Coss;\nusing Coss.Scheduling;\n\nvar client = new CossClient(); // apiKey: or COSS_API_KEY\n\nawait client.Scheduling.HolidayCalendars.UpdateAsync(\n new UpdateSchedulingHolidayCalendarRequest\n {\n Id = \"id\",\n HostFilter = new Dictionary>>()\n {\n { \"team\", \"london\" },\n },\n }\n);" + }, + "DELETE /v1/scheduling/holiday_calendars/{id}": { + "python": "from coss import Coss\n\nclient = Coss() # api_key= or COSS_API_KEY\n\nclient.scheduling.holiday_calendars.remove(\n id=\"id\",\n)", + "go": "import (\n\t\"context\"\n\n\tcossclient \"github.com/cosscom/coss-go/client\"\n\tscheduling \"github.com/cosscom/coss-go/scheduling\"\n)\n\nclient := cossclient.NewClient() // option.WithAPIKey(…) or COSS_API_KEY\n\nrequest := &scheduling.RemoveHolidayCalendarsRequest{\n ID: \"id\",\n}\nclient.Scheduling.HolidayCalendars.Remove(\n context.TODO(),\n request,\n)", + "ruby": "require \"coss\"\n\nclient = Coss::Client.new # api_key: or COSS_API_KEY\n\nclient.scheduling.holiday_calendars.remove(id: \"id\")", + "php": "scheduling->holidayCalendars->remove(\n 'id',\n);", + "java": "import com.coss.Coss;\nimport com.coss.resources.scheduling.holidaycalendars.requests.RemoveHolidayCalendarsRequest;\n\nCoss client = Coss.builder().build(); // .apiKey(…) or COSS_API_KEY\n\nclient.scheduling().holidayCalendars().remove(\n \"id\",\n RemoveHolidayCalendarsRequest\n .builder()\n .build()\n);", + "csharp": "using Coss;\nusing Coss.Scheduling;\n\nvar client = new CossClient(); // apiKey: or COSS_API_KEY\n\nawait client.Scheduling.HolidayCalendars.RemoveAsync(\n new RemoveHolidayCalendarsRequest { Id = \"id\" }\n);" + }, + "POST /v1/scheduling/reassignments": { + "python": "from coss import Coss\nfrom coss import Coss, SchedulingReassignmentSelection, SchedulingReassignmentStrategy\n\nclient = Coss() # api_key= or COSS_API_KEY\n\nclient.scheduling.reassignments.create(\n idempotency_key=\"welcome-user-123\",\n selection=SchedulingReassignmentSelection(\n out_of_office=\"ooo_01kd2m9a0b1c2d3e4f5g6h7j8m\",\n ),\n strategy=SchedulingReassignmentStrategy(\n preferred_hosts=[\n \"doctor_518\"\n ],\n ),\n reason_code=\"out_of_office\",\n)", + "go": "import (\n\t\"context\"\n\n\tcoss \"github.com/cosscom/coss-go\"\n\tcossclient \"github.com/cosscom/coss-go/client\"\n\tscheduling \"github.com/cosscom/coss-go/scheduling\"\n)\n\nclient := cossclient.NewClient() // option.WithAPIKey(…) or COSS_API_KEY\n\nrequest := &scheduling.CreateSchedulingReassignmentRequest{\n IdempotencyKey: coss.String(\n \"welcome-user-123\",\n ),\n Selection: &coss.SchedulingReassignmentSelection{\n OutOfOffice: coss.String(\n \"ooo_01kd2m9a0b1c2d3e4f5g6h7j8m\",\n ),\n },\n Strategy: &coss.SchedulingReassignmentStrategy{\n PreferredHosts: []string{\n \"doctor_518\",\n },\n },\n ReasonCode: scheduling.CreateSchedulingReassignmentRequestReasonCodeOutOfOffice,\n}\nclient.Scheduling.Reassignments.Create(\n context.TODO(),\n request,\n)", + "ruby": "require \"coss\"\n\nclient = Coss::Client.new # api_key: or COSS_API_KEY\n\nclient.scheduling.reassignments.create(\n idempotency_key: \"welcome-user-123\",\n selection: {\n out_of_office: \"ooo_01kd2m9a0b1c2d3e4f5g6h7j8m\"\n },\n strategy: {\n preferred_hosts: [\"doctor_518\"]\n },\n reason_code: \"out_of_office\"\n)", + "php": "scheduling->reassignments->create(\n new CreateSchedulingReassignmentRequest([\n 'idempotencyKey' => 'welcome-user-123',\n 'selection' => new SchedulingReassignmentSelection([\n 'outOfOffice' => 'ooo_01kd2m9a0b1c2d3e4f5g6h7j8m',\n ]),\n 'strategy' => new SchedulingReassignmentStrategy([\n 'preferredHosts' => [\n 'doctor_518',\n ],\n ]),\n 'reasonCode' => CreateSchedulingReassignmentRequestReasonCode::OutOfOffice->value,\n ]),\n);", + "java": "import com.coss.Coss;\nimport com.coss.resources.scheduling.reassignments.requests.CreateSchedulingReassignmentRequest;\nimport com.coss.resources.scheduling.reassignments.types.CreateSchedulingReassignmentRequestReasonCode;\nimport com.coss.types.SchedulingReassignmentSelection;\nimport com.coss.types.SchedulingReassignmentStrategy;\nimport java.util.Arrays;\nimport java.util.Optional;\n\nCoss client = Coss.builder().build(); // .apiKey(…) or COSS_API_KEY\n\nclient.scheduling().reassignments().create(\n CreateSchedulingReassignmentRequest\n .builder()\n .selection(\n SchedulingReassignmentSelection\n .builder()\n .outOfOffice(\"ooo_01kd2m9a0b1c2d3e4f5g6h7j8m\")\n .build()\n )\n .reasonCode(CreateSchedulingReassignmentRequestReasonCode.OUT_OF_OFFICE)\n .idempotencyKey(\"welcome-user-123\")\n .strategy(\n SchedulingReassignmentStrategy\n .builder()\n .preferredHosts(\n Optional.of(\n Arrays.asList(\"doctor_518\")\n )\n )\n .build()\n )\n .build()\n);", + "csharp": "using Coss;\nusing Coss.Scheduling;\n\nvar client = new CossClient(); // apiKey: or COSS_API_KEY\n\nawait client.Scheduling.Reassignments.CreateAsync(\n new CreateSchedulingReassignmentRequest\n {\n IdempotencyKey = \"welcome-user-123\",\n Selection = new SchedulingReassignmentSelection\n {\n OutOfOffice = \"ooo_01kd2m9a0b1c2d3e4f5g6h7j8m\",\n },\n Strategy = new SchedulingReassignmentStrategy\n {\n PreferredHosts = new List() { \"doctor_518\" },\n },\n ReasonCode = CreateSchedulingReassignmentRequestReasonCode.OutOfOffice,\n }\n);" + }, + "POST /v1/scheduling/reassignments/preview": { + "python": "from coss import Coss\nfrom coss import Coss, SchedulingReassignmentSelection, SchedulingReassignmentStrategy\n\nclient = Coss() # api_key= or COSS_API_KEY\n\nclient.scheduling.reassignments.preview(\n selection=SchedulingReassignmentSelection(\n host=\"doctor_482\",\n start_before=\"2027-08-14T00:00:00.000Z\",\n ),\n strategy=SchedulingReassignmentStrategy(\n preferred_hosts=[\n \"doctor_518\"\n ],\n ),\n)", + "go": "import (\n\t\"context\"\n\n\tcoss \"github.com/cosscom/coss-go\"\n\tcossclient \"github.com/cosscom/coss-go/client\"\n\tscheduling \"github.com/cosscom/coss-go/scheduling\"\n)\n\nclient := cossclient.NewClient() // option.WithAPIKey(…) or COSS_API_KEY\n\nrequest := &scheduling.PreviewSchedulingReassignmentRequest{\n Selection: &coss.SchedulingReassignmentSelection{\n Host: coss.String(\n \"doctor_482\",\n ),\n StartBefore: coss.String(\n \"2027-08-14T00:00:00.000Z\",\n ),\n },\n Strategy: &coss.SchedulingReassignmentStrategy{\n PreferredHosts: []string{\n \"doctor_518\",\n },\n },\n}\nclient.Scheduling.Reassignments.Preview(\n context.TODO(),\n request,\n)", + "ruby": "require \"coss\"\n\nclient = Coss::Client.new # api_key: or COSS_API_KEY\n\nclient.scheduling.reassignments.preview(\n selection: {\n host: \"doctor_482\",\n start_before: \"2027-08-14T00:00:00.000Z\"\n },\n strategy: {\n preferred_hosts: [\"doctor_518\"]\n }\n)", + "php": "scheduling->reassignments->preview(\n new PreviewSchedulingReassignmentRequest([\n 'selection' => new SchedulingReassignmentSelection([\n 'host' => 'doctor_482',\n 'startBefore' => '2027-08-14T00:00:00.000Z',\n ]),\n 'strategy' => new SchedulingReassignmentStrategy([\n 'preferredHosts' => [\n 'doctor_518',\n ],\n ]),\n ]),\n);", + "java": "import com.coss.Coss;\nimport com.coss.resources.scheduling.reassignments.requests.PreviewSchedulingReassignmentRequest;\nimport com.coss.types.SchedulingReassignmentSelection;\nimport com.coss.types.SchedulingReassignmentStrategy;\nimport java.util.Arrays;\nimport java.util.Optional;\n\nCoss client = Coss.builder().build(); // .apiKey(…) or COSS_API_KEY\n\nclient.scheduling().reassignments().preview(\n PreviewSchedulingReassignmentRequest\n .builder()\n .selection(\n SchedulingReassignmentSelection\n .builder()\n .host(\"doctor_482\")\n .startBefore(\"2027-08-14T00:00:00.000Z\")\n .build()\n )\n .strategy(\n SchedulingReassignmentStrategy\n .builder()\n .preferredHosts(\n Optional.of(\n Arrays.asList(\"doctor_518\")\n )\n )\n .build()\n )\n .build()\n);", + "csharp": "using Coss;\nusing Coss.Scheduling;\n\nvar client = new CossClient(); // apiKey: or COSS_API_KEY\n\nawait client.Scheduling.Reassignments.PreviewAsync(\n new PreviewSchedulingReassignmentRequest\n {\n Selection = new SchedulingReassignmentSelection\n {\n Host = \"doctor_482\",\n StartBefore = \"2027-08-14T00:00:00.000Z\",\n },\n Strategy = new SchedulingReassignmentStrategy\n {\n PreferredHosts = new List() { \"doctor_518\" },\n },\n }\n);" + }, + "GET /v1/scheduling/reassignments": { + "python": "from coss import Coss\n\nclient = Coss() # api_key= or COSS_API_KEY\n\nclient.scheduling.reassignments.list()", + "go": "import (\n\t\"context\"\n\n\tcossclient \"github.com/cosscom/coss-go/client\"\n\tscheduling \"github.com/cosscom/coss-go/scheduling\"\n)\n\nclient := cossclient.NewClient() // option.WithAPIKey(…) or COSS_API_KEY\n\nrequest := &scheduling.ListReassignmentsRequest{}\nclient.Scheduling.Reassignments.List(\n context.TODO(),\n request,\n)", + "ruby": "require \"coss\"\n\nclient = Coss::Client.new # api_key: or COSS_API_KEY\n\nclient.scheduling.reassignments.list", + "php": "scheduling->reassignments->list(\n new ListReassignmentsRequest([]),\n);", + "java": "import com.coss.Coss;\nimport com.coss.resources.scheduling.reassignments.requests.ListReassignmentsRequest;\n\nCoss client = Coss.builder().build(); // .apiKey(…) or COSS_API_KEY\n\nclient.scheduling().reassignments().list(\n ListReassignmentsRequest\n .builder()\n .build()\n);", + "csharp": "using Coss;\nusing Coss.Scheduling;\n\nvar client = new CossClient(); // apiKey: or COSS_API_KEY\n\nawait client.Scheduling.Reassignments.ListAsync(new ListReassignmentsRequest());" + }, + "GET /v1/scheduling/reassignments/{id}": { + "python": "from coss import Coss\n\nclient = Coss() # api_key= or COSS_API_KEY\n\nclient.scheduling.reassignments.get(\n id=\"id\",\n)", + "go": "import (\n\t\"context\"\n\n\tcossclient \"github.com/cosscom/coss-go/client\"\n\tscheduling \"github.com/cosscom/coss-go/scheduling\"\n)\n\nclient := cossclient.NewClient() // option.WithAPIKey(…) or COSS_API_KEY\n\nrequest := &scheduling.GetReassignmentsRequest{\n ID: \"id\",\n}\nclient.Scheduling.Reassignments.Get(\n context.TODO(),\n request,\n)", + "ruby": "require \"coss\"\n\nclient = Coss::Client.new # api_key: or COSS_API_KEY\n\nclient.scheduling.reassignments.get(id: \"id\")", + "php": "scheduling->reassignments->get(\n 'id',\n);", + "java": "import com.coss.Coss;\nimport com.coss.resources.scheduling.reassignments.requests.GetReassignmentsRequest;\n\nCoss client = Coss.builder().build(); // .apiKey(…) or COSS_API_KEY\n\nclient.scheduling().reassignments().get(\n \"id\",\n GetReassignmentsRequest\n .builder()\n .build()\n);", + "csharp": "using Coss;\nusing Coss.Scheduling;\n\nvar client = new CossClient(); // apiKey: or COSS_API_KEY\n\nawait client.Scheduling.Reassignments.GetAsync(new GetReassignmentsRequest { Id = \"id\" });" + }, + "GET /v1/scheduling/reassignments/{id}/items": { + "python": "from coss import Coss\n\nclient = Coss() # api_key= or COSS_API_KEY\n\nclient.scheduling.reassignments.items(\n id=\"id\",\n)", + "go": "import (\n\t\"context\"\n\n\tcossclient \"github.com/cosscom/coss-go/client\"\n\tscheduling \"github.com/cosscom/coss-go/scheduling\"\n)\n\nclient := cossclient.NewClient() // option.WithAPIKey(…) or COSS_API_KEY\n\nrequest := &scheduling.ItemsReassignmentsRequest{\n ID: \"id\",\n}\nclient.Scheduling.Reassignments.Items(\n context.TODO(),\n request,\n)", + "ruby": "require \"coss\"\n\nclient = Coss::Client.new # api_key: or COSS_API_KEY\n\nclient.scheduling.reassignments.items(id: \"id\")", + "php": "scheduling->reassignments->items(\n 'id',\n new ItemsReassignmentsRequest([]),\n);", + "java": "import com.coss.Coss;\nimport com.coss.resources.scheduling.reassignments.requests.ItemsReassignmentsRequest;\n\nCoss client = Coss.builder().build(); // .apiKey(…) or COSS_API_KEY\n\nclient.scheduling().reassignments().items(\n \"id\",\n ItemsReassignmentsRequest\n .builder()\n .build()\n);", + "csharp": "using Coss;\nusing Coss.Scheduling;\n\nvar client = new CossClient(); // apiKey: or COSS_API_KEY\n\nawait client.Scheduling.Reassignments.ItemsAsync(new ItemsReassignmentsRequest { Id = \"id\" });" + }, + "POST /v1/scheduling/reassignments/{id}/cancel": { + "python": "from coss import Coss\n\nclient = Coss() # api_key= or COSS_API_KEY\n\nclient.scheduling.reassignments.cancel(\n id=\"id\",\n)", + "go": "import (\n\t\"context\"\n\n\tcossclient \"github.com/cosscom/coss-go/client\"\n\tscheduling \"github.com/cosscom/coss-go/scheduling\"\n)\n\nclient := cossclient.NewClient() // option.WithAPIKey(…) or COSS_API_KEY\n\nrequest := &scheduling.CancelReassignmentsRequest{\n ID: \"id\",\n}\nclient.Scheduling.Reassignments.Cancel(\n context.TODO(),\n request,\n)", + "ruby": "require \"coss\"\n\nclient = Coss::Client.new # api_key: or COSS_API_KEY\n\nclient.scheduling.reassignments.cancel(id: \"id\")", + "php": "scheduling->reassignments->cancel(\n 'id',\n);", + "java": "import com.coss.Coss;\nimport com.coss.resources.scheduling.reassignments.requests.CancelReassignmentsRequest;\n\nCoss client = Coss.builder().build(); // .apiKey(…) or COSS_API_KEY\n\nclient.scheduling().reassignments().cancel(\n \"id\",\n CancelReassignmentsRequest\n .builder()\n .build()\n);", + "csharp": "using Coss;\nusing Coss.Scheduling;\n\nvar client = new CossClient(); // apiKey: or COSS_API_KEY\n\nawait client.Scheduling.Reassignments.CancelAsync(new CancelReassignmentsRequest { Id = \"id\" });" + }, + "POST /v1/scheduling/reassignments/{id}/undo": { + "python": "from coss import Coss\n\nclient = Coss() # api_key= or COSS_API_KEY\n\nclient.scheduling.reassignments.undo(\n id=\"id\",\n reason_code=\"other\",\n)", + "go": "import (\n\t\"context\"\n\n\tcossclient \"github.com/cosscom/coss-go/client\"\n\tscheduling \"github.com/cosscom/coss-go/scheduling\"\n)\n\nclient := cossclient.NewClient() // option.WithAPIKey(…) or COSS_API_KEY\n\nrequest := &scheduling.UndoSchedulingReassignmentRequest{\n ID: \"id\",\n ReasonCode: scheduling.UndoSchedulingReassignmentRequestReasonCodeOther.Ptr(),\n}\nclient.Scheduling.Reassignments.Undo(\n context.TODO(),\n request,\n)", + "ruby": "require \"coss\"\n\nclient = Coss::Client.new # api_key: or COSS_API_KEY\n\nclient.scheduling.reassignments.undo(\n id: \"id\",\n reason_code: \"other\"\n)", + "php": "scheduling->reassignments->undo(\n 'id',\n new UndoSchedulingReassignmentRequest([\n 'reasonCode' => UndoSchedulingReassignmentRequestReasonCode::Other->value,\n ]),\n);", + "java": "import com.coss.Coss;\nimport com.coss.resources.scheduling.reassignments.requests.UndoSchedulingReassignmentRequest;\nimport com.coss.resources.scheduling.reassignments.types.UndoSchedulingReassignmentRequestReasonCode;\n\nCoss client = Coss.builder().build(); // .apiKey(…) or COSS_API_KEY\n\nclient.scheduling().reassignments().undo(\n \"id\",\n UndoSchedulingReassignmentRequest\n .builder()\n .reasonCode(UndoSchedulingReassignmentRequestReasonCode.OTHER)\n .build()\n);", + "csharp": "using Coss;\nusing Coss.Scheduling;\n\nvar client = new CossClient(); // apiKey: or COSS_API_KEY\n\nawait client.Scheduling.Reassignments.UndoAsync(\n new UndoSchedulingReassignmentRequest\n {\n Id = \"id\",\n ReasonCode = UndoSchedulingReassignmentRequestReasonCode.Other,\n }\n);" + }, "GET /v1/scheduling/settings": { "python": "from coss import Coss\n\nclient = Coss() # api_key= or COSS_API_KEY\n\nclient.scheduling.settings.get()", "go": "import (\n\t\"context\"\n\n\tcossclient \"github.com/cosscom/coss-go/client\"\n)\n\nclient := cossclient.NewClient() // option.WithAPIKey(…) or COSS_API_KEY\n\nclient.Scheduling.Settings.Get(\n context.TODO(),\n)",