diff --git a/algolia/ingestion/api_ingestion.go b/algolia/ingestion/api_ingestion.go index 3eca93b95..48911ece8 100644 --- a/algolia/ingestion/api_ingestion.go +++ b/algolia/ingestion/api_ingestion.go @@ -4717,6 +4717,15 @@ func (r *ApiListTasksRequest) UnmarshalJSON(b []byte) error { } } } + if v, ok := req["withEmailNotifications"]; ok { + err = json.Unmarshal(v, &r.withEmailNotifications) + if err != nil { + err = json.Unmarshal(b, &r.withEmailNotifications) + if err != nil { + return fmt.Errorf("cannot unmarshal withEmailNotifications: %w", err) + } + } + } if v, ok := req["sort"]; ok { err = json.Unmarshal(v, &r.sort) if err != nil { @@ -4741,16 +4750,17 @@ func (r *ApiListTasksRequest) UnmarshalJSON(b []byte) error { // ApiListTasksRequest represents the request with all the parameters for the API call. type ApiListTasksRequest struct { - itemsPerPage *int32 - page *int32 - action []ActionType - enabled *bool - sourceID []string - sourceType []SourceType - destinationID []string - triggerType []TriggerType - sort TaskSortKeys - order OrderKeys + itemsPerPage *int32 + page *int32 + action []ActionType + enabled *bool + sourceID []string + sourceType []SourceType + destinationID []string + triggerType []TriggerType + withEmailNotifications *bool + sort TaskSortKeys + order OrderKeys } // NewApiListTasksRequest creates an instance of the ApiListTasksRequest to be used for the API call. @@ -4806,6 +4816,12 @@ func (r ApiListTasksRequest) WithTriggerType(triggerType []TriggerType) ApiListT return r } +// WithWithEmailNotifications adds the withEmailNotifications to the ApiListTasksRequest and returns the request for chaining. +func (r ApiListTasksRequest) WithWithEmailNotifications(withEmailNotifications bool) ApiListTasksRequest { + r.withEmailNotifications = &withEmailNotifications + return r +} + // WithSort adds the sort to the ApiListTasksRequest and returns the request for chaining. func (r ApiListTasksRequest) WithSort(sort TaskSortKeys) ApiListTasksRequest { r.sort = sort @@ -4837,6 +4853,7 @@ ListTasks calls the API and returns the raw response from it. @param sourceType []SourceType - Filters the tasks with the specified source type. @param destinationID []string - Destination IDs for filtering the list of tasks. @param triggerType []TriggerType - Type of task trigger for filtering the list of tasks. + @param withEmailNotifications bool - If specified, the response only includes tasks with notifications.email.enabled set to this value. @param sort TaskSortKeys - Property by which to sort the list of tasks. @param order OrderKeys - Sort order of the response, ascending or descending. @param opts ...RequestOption - Optional parameters for the API call @@ -4877,6 +4894,9 @@ func (c *APIClient) ListTasksWithHTTPInfo(r ApiListTasksRequest, opts ...Request if !utils.IsNilOrEmpty(r.triggerType) { conf.queryParams.Set("triggerType", utils.QueryParameterToString(r.triggerType)) } + if !utils.IsNilOrEmpty(r.withEmailNotifications) { + conf.queryParams.Set("withEmailNotifications", utils.QueryParameterToString(*r.withEmailNotifications)) + } if !utils.IsNilOrEmpty(r.sort) { conf.queryParams.Set("sort", utils.QueryParameterToString(r.sort)) } @@ -4919,6 +4939,7 @@ Request can be constructed by NewApiListTasksRequest with parameters below. @param sourceType []SourceType - Filters the tasks with the specified source type. @param destinationID []string - Destination IDs for filtering the list of tasks. @param triggerType []TriggerType - Type of task trigger for filtering the list of tasks. + @param withEmailNotifications bool - If specified, the response only includes tasks with notifications.email.enabled set to this value. @param sort TaskSortKeys - Property by which to sort the list of tasks. @param order OrderKeys - Sort order of the response, ascending or descending. @return ListTasksResponse diff --git a/algolia/ingestion/model_email_notifications.go b/algolia/ingestion/model_email_notifications.go new file mode 100644 index 000000000..3de98b197 --- /dev/null +++ b/algolia/ingestion/model_email_notifications.go @@ -0,0 +1,90 @@ +// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. +package ingestion + +import ( + "encoding/json" + "fmt" +) + +// EmailNotifications struct for EmailNotifications. +type EmailNotifications struct { + // Whether to send email notifications, note that this doesn't prevent the task from being blocked. + Enabled *bool `json:"enabled,omitempty"` +} + +type EmailNotificationsOption func(f *EmailNotifications) + +func WithEmailNotificationsEnabled(val bool) EmailNotificationsOption { + return func(f *EmailNotifications) { + f.Enabled = &val + } +} + +// NewEmailNotifications instantiates a new EmailNotifications object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewEmailNotifications(opts ...EmailNotificationsOption) *EmailNotifications { + this := &EmailNotifications{} + for _, opt := range opts { + opt(this) + } + return this +} + +// NewEmptyEmailNotifications return a pointer to an empty EmailNotifications object. +func NewEmptyEmailNotifications() *EmailNotifications { + return &EmailNotifications{} +} + +// GetEnabled returns the Enabled field value if set, zero value otherwise. +func (o *EmailNotifications) GetEnabled() bool { + if o == nil || o.Enabled == nil { + var ret bool + return ret + } + return *o.Enabled +} + +// GetEnabledOk returns a tuple with the Enabled field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EmailNotifications) GetEnabledOk() (*bool, bool) { + if o == nil || o.Enabled == nil { + return nil, false + } + return o.Enabled, true +} + +// HasEnabled returns a boolean if a field has been set. +func (o *EmailNotifications) HasEnabled() bool { + if o != nil && o.Enabled != nil { + return true + } + + return false +} + +// SetEnabled gets a reference to the given bool and assigns it to the Enabled field. +func (o *EmailNotifications) SetEnabled(v bool) *EmailNotifications { + o.Enabled = &v + return o +} + +func (o EmailNotifications) MarshalJSON() ([]byte, error) { + toSerialize := map[string]any{} + if o.Enabled != nil { + toSerialize["enabled"] = o.Enabled + } + serialized, err := json.Marshal(toSerialize) + if err != nil { + return nil, fmt.Errorf("failed to marshal EmailNotifications: %w", err) + } + + return serialized, nil +} + +func (o EmailNotifications) String() string { + out := "" + out += fmt.Sprintf(" enabled=%v\n", o.Enabled) + return fmt.Sprintf("EmailNotifications {\n%s}", out) +} diff --git a/algolia/ingestion/model_notifications.go b/algolia/ingestion/model_notifications.go new file mode 100644 index 000000000..30b47f340 --- /dev/null +++ b/algolia/ingestion/model_notifications.go @@ -0,0 +1,71 @@ +// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. +package ingestion + +import ( + "encoding/json" + "fmt" +) + +// Notifications Notifications settings for a task. +type Notifications struct { + Email EmailNotifications `json:"email"` +} + +// NewNotifications instantiates a new Notifications object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewNotifications(email EmailNotifications) *Notifications { + this := &Notifications{} + this.Email = email + return this +} + +// NewEmptyNotifications return a pointer to an empty Notifications object. +func NewEmptyNotifications() *Notifications { + return &Notifications{} +} + +// GetEmail returns the Email field value. +func (o *Notifications) GetEmail() EmailNotifications { + if o == nil { + var ret EmailNotifications + return ret + } + + return o.Email +} + +// GetEmailOk returns a tuple with the Email field value +// and a boolean to check if the value has been set. +func (o *Notifications) GetEmailOk() (*EmailNotifications, bool) { + if o == nil { + return nil, false + } + return &o.Email, true +} + +// SetEmail sets field value. +func (o *Notifications) SetEmail(v *EmailNotifications) *Notifications { + o.Email = *v + return o +} + +func (o Notifications) MarshalJSON() ([]byte, error) { + toSerialize := map[string]any{} + if true { + toSerialize["email"] = o.Email + } + serialized, err := json.Marshal(toSerialize) + if err != nil { + return nil, fmt.Errorf("failed to marshal Notifications: %w", err) + } + + return serialized, nil +} + +func (o Notifications) String() string { + out := "" + out += fmt.Sprintf(" email=%v\n", o.Email) + return fmt.Sprintf("Notifications {\n%s}", out) +} diff --git a/algolia/ingestion/model_policies.go b/algolia/ingestion/model_policies.go new file mode 100644 index 000000000..75a070922 --- /dev/null +++ b/algolia/ingestion/model_policies.go @@ -0,0 +1,90 @@ +// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. +package ingestion + +import ( + "encoding/json" + "fmt" +) + +// Policies Set of rules for a task. +type Policies struct { + // The number of critical failures in a row before blocking the task and sending a notification. + CriticalThreshold *int32 `json:"criticalThreshold,omitempty"` +} + +type PoliciesOption func(f *Policies) + +func WithPoliciesCriticalThreshold(val int32) PoliciesOption { + return func(f *Policies) { + f.CriticalThreshold = &val + } +} + +// NewPolicies instantiates a new Policies object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewPolicies(opts ...PoliciesOption) *Policies { + this := &Policies{} + for _, opt := range opts { + opt(this) + } + return this +} + +// NewEmptyPolicies return a pointer to an empty Policies object. +func NewEmptyPolicies() *Policies { + return &Policies{} +} + +// GetCriticalThreshold returns the CriticalThreshold field value if set, zero value otherwise. +func (o *Policies) GetCriticalThreshold() int32 { + if o == nil || o.CriticalThreshold == nil { + var ret int32 + return ret + } + return *o.CriticalThreshold +} + +// GetCriticalThresholdOk returns a tuple with the CriticalThreshold field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Policies) GetCriticalThresholdOk() (*int32, bool) { + if o == nil || o.CriticalThreshold == nil { + return nil, false + } + return o.CriticalThreshold, true +} + +// HasCriticalThreshold returns a boolean if a field has been set. +func (o *Policies) HasCriticalThreshold() bool { + if o != nil && o.CriticalThreshold != nil { + return true + } + + return false +} + +// SetCriticalThreshold gets a reference to the given int32 and assigns it to the CriticalThreshold field. +func (o *Policies) SetCriticalThreshold(v int32) *Policies { + o.CriticalThreshold = &v + return o +} + +func (o Policies) MarshalJSON() ([]byte, error) { + toSerialize := map[string]any{} + if o.CriticalThreshold != nil { + toSerialize["criticalThreshold"] = o.CriticalThreshold + } + serialized, err := json.Marshal(toSerialize) + if err != nil { + return nil, fmt.Errorf("failed to marshal Policies: %w", err) + } + + return serialized, nil +} + +func (o Policies) String() string { + out := "" + out += fmt.Sprintf(" criticalThreshold=%v\n", o.CriticalThreshold) + return fmt.Sprintf("Policies {\n%s}", out) +} diff --git a/algolia/ingestion/model_task.go b/algolia/ingestion/model_task.go index 6972ee4b7..46da4eaa7 100644 --- a/algolia/ingestion/model_task.go +++ b/algolia/ingestion/model_task.go @@ -27,7 +27,9 @@ type Task struct { FailureThreshold *int32 `json:"failureThreshold,omitempty"` Action *ActionType `json:"action,omitempty"` // Date of the last cursor in RFC 3339 format. - Cursor *string `json:"cursor,omitempty"` + Cursor *string `json:"cursor,omitempty"` + Notifications *Notifications `json:"notifications,omitempty"` + Policies *Policies `json:"policies,omitempty"` // Date of creation in RFC 3339 format. CreatedAt string `json:"createdAt"` // Date of last update in RFC 3339 format. @@ -78,6 +80,18 @@ func WithTaskCursor(val string) TaskOption { } } +func WithTaskNotifications(val Notifications) TaskOption { + return func(f *Task) { + f.Notifications = &val + } +} + +func WithTaskPolicies(val Policies) TaskOption { + return func(f *Task) { + f.Policies = &val + } +} + func WithTaskUpdatedAt(val string) TaskOption { return func(f *Task) { f.UpdatedAt = &val @@ -437,6 +451,72 @@ func (o *Task) SetCursor(v string) *Task { return o } +// GetNotifications returns the Notifications field value if set, zero value otherwise. +func (o *Task) GetNotifications() Notifications { + if o == nil || o.Notifications == nil { + var ret Notifications + return ret + } + return *o.Notifications +} + +// GetNotificationsOk returns a tuple with the Notifications field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Task) GetNotificationsOk() (*Notifications, bool) { + if o == nil || o.Notifications == nil { + return nil, false + } + return o.Notifications, true +} + +// HasNotifications returns a boolean if a field has been set. +func (o *Task) HasNotifications() bool { + if o != nil && o.Notifications != nil { + return true + } + + return false +} + +// SetNotifications gets a reference to the given Notifications and assigns it to the Notifications field. +func (o *Task) SetNotifications(v *Notifications) *Task { + o.Notifications = v + return o +} + +// GetPolicies returns the Policies field value if set, zero value otherwise. +func (o *Task) GetPolicies() Policies { + if o == nil || o.Policies == nil { + var ret Policies + return ret + } + return *o.Policies +} + +// GetPoliciesOk returns a tuple with the Policies field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Task) GetPoliciesOk() (*Policies, bool) { + if o == nil || o.Policies == nil { + return nil, false + } + return o.Policies, true +} + +// HasPolicies returns a boolean if a field has been set. +func (o *Task) HasPolicies() bool { + if o != nil && o.Policies != nil { + return true + } + + return false +} + +// SetPolicies gets a reference to the given Policies and assigns it to the Policies field. +func (o *Task) SetPolicies(v *Policies) *Task { + o.Policies = v + return o +} + // GetCreatedAt returns the CreatedAt field value. func (o *Task) GetCreatedAt() string { if o == nil { @@ -530,6 +610,12 @@ func (o Task) MarshalJSON() ([]byte, error) { if o.Cursor != nil { toSerialize["cursor"] = o.Cursor } + if o.Notifications != nil { + toSerialize["notifications"] = o.Notifications + } + if o.Policies != nil { + toSerialize["policies"] = o.Policies + } if true { toSerialize["createdAt"] = o.CreatedAt } @@ -557,6 +643,8 @@ func (o Task) String() string { out += fmt.Sprintf(" failureThreshold=%v\n", o.FailureThreshold) out += fmt.Sprintf(" action=%v\n", o.Action) out += fmt.Sprintf(" cursor=%v\n", o.Cursor) + out += fmt.Sprintf(" notifications=%v\n", o.Notifications) + out += fmt.Sprintf(" policies=%v\n", o.Policies) out += fmt.Sprintf(" createdAt=%v\n", o.CreatedAt) out += fmt.Sprintf(" updatedAt=%v\n", o.UpdatedAt) return fmt.Sprintf("Task {\n%s}", out) diff --git a/algolia/ingestion/model_task_create.go b/algolia/ingestion/model_task_create.go index 06ad209a9..60e9d0109 100644 --- a/algolia/ingestion/model_task_create.go +++ b/algolia/ingestion/model_task_create.go @@ -21,7 +21,9 @@ type TaskCreate struct { FailureThreshold *int32 `json:"failureThreshold,omitempty"` Input *TaskInput `json:"input,omitempty"` // Date of the last cursor in RFC 3339 format. - Cursor *string `json:"cursor,omitempty"` + Cursor *string `json:"cursor,omitempty"` + Notifications *Notifications `json:"notifications,omitempty"` + Policies *Policies `json:"policies,omitempty"` } type TaskCreateOption func(f *TaskCreate) @@ -56,6 +58,18 @@ func WithTaskCreateCursor(val string) TaskCreateOption { } } +func WithTaskCreateNotifications(val Notifications) TaskCreateOption { + return func(f *TaskCreate) { + f.Notifications = &val + } +} + +func WithTaskCreatePolicies(val Policies) TaskCreateOption { + return func(f *TaskCreate) { + f.Policies = &val + } +} + // NewTaskCreate instantiates a new TaskCreate object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -316,6 +330,72 @@ func (o *TaskCreate) SetCursor(v string) *TaskCreate { return o } +// GetNotifications returns the Notifications field value if set, zero value otherwise. +func (o *TaskCreate) GetNotifications() Notifications { + if o == nil || o.Notifications == nil { + var ret Notifications + return ret + } + return *o.Notifications +} + +// GetNotificationsOk returns a tuple with the Notifications field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TaskCreate) GetNotificationsOk() (*Notifications, bool) { + if o == nil || o.Notifications == nil { + return nil, false + } + return o.Notifications, true +} + +// HasNotifications returns a boolean if a field has been set. +func (o *TaskCreate) HasNotifications() bool { + if o != nil && o.Notifications != nil { + return true + } + + return false +} + +// SetNotifications gets a reference to the given Notifications and assigns it to the Notifications field. +func (o *TaskCreate) SetNotifications(v *Notifications) *TaskCreate { + o.Notifications = v + return o +} + +// GetPolicies returns the Policies field value if set, zero value otherwise. +func (o *TaskCreate) GetPolicies() Policies { + if o == nil || o.Policies == nil { + var ret Policies + return ret + } + return *o.Policies +} + +// GetPoliciesOk returns a tuple with the Policies field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TaskCreate) GetPoliciesOk() (*Policies, bool) { + if o == nil || o.Policies == nil { + return nil, false + } + return o.Policies, true +} + +// HasPolicies returns a boolean if a field has been set. +func (o *TaskCreate) HasPolicies() bool { + if o != nil && o.Policies != nil { + return true + } + + return false +} + +// SetPolicies gets a reference to the given Policies and assigns it to the Policies field. +func (o *TaskCreate) SetPolicies(v *Policies) *TaskCreate { + o.Policies = v + return o +} + func (o TaskCreate) MarshalJSON() ([]byte, error) { toSerialize := map[string]any{} if true { @@ -342,6 +422,12 @@ func (o TaskCreate) MarshalJSON() ([]byte, error) { if o.Cursor != nil { toSerialize["cursor"] = o.Cursor } + if o.Notifications != nil { + toSerialize["notifications"] = o.Notifications + } + if o.Policies != nil { + toSerialize["policies"] = o.Policies + } serialized, err := json.Marshal(toSerialize) if err != nil { return nil, fmt.Errorf("failed to marshal TaskCreate: %w", err) @@ -360,5 +446,7 @@ func (o TaskCreate) String() string { out += fmt.Sprintf(" failureThreshold=%v\n", o.FailureThreshold) out += fmt.Sprintf(" input=%v\n", o.Input) out += fmt.Sprintf(" cursor=%v\n", o.Cursor) + out += fmt.Sprintf(" notifications=%v\n", o.Notifications) + out += fmt.Sprintf(" policies=%v\n", o.Policies) return fmt.Sprintf("TaskCreate {\n%s}", out) } diff --git a/algolia/ingestion/model_task_update.go b/algolia/ingestion/model_task_update.go index 2d606c4c2..da4ede067 100644 --- a/algolia/ingestion/model_task_update.go +++ b/algolia/ingestion/model_task_update.go @@ -16,7 +16,9 @@ type TaskUpdate struct { // Whether the task is enabled. Enabled *bool `json:"enabled,omitempty"` // Maximum accepted percentage of failures for a task run to finish successfully. - FailureThreshold *int32 `json:"failureThreshold,omitempty"` + FailureThreshold *int32 `json:"failureThreshold,omitempty"` + Notifications *Notifications `json:"notifications,omitempty"` + Policies *Policies `json:"policies,omitempty"` } type TaskUpdateOption func(f *TaskUpdate) @@ -51,6 +53,18 @@ func WithTaskUpdateFailureThreshold(val int32) TaskUpdateOption { } } +func WithTaskUpdateNotifications(val Notifications) TaskUpdateOption { + return func(f *TaskUpdate) { + f.Notifications = &val + } +} + +func WithTaskUpdatePolicies(val Policies) TaskUpdateOption { + return func(f *TaskUpdate) { + f.Policies = &val + } +} + // NewTaskUpdate instantiates a new TaskUpdate object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -233,6 +247,72 @@ func (o *TaskUpdate) SetFailureThreshold(v int32) *TaskUpdate { return o } +// GetNotifications returns the Notifications field value if set, zero value otherwise. +func (o *TaskUpdate) GetNotifications() Notifications { + if o == nil || o.Notifications == nil { + var ret Notifications + return ret + } + return *o.Notifications +} + +// GetNotificationsOk returns a tuple with the Notifications field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TaskUpdate) GetNotificationsOk() (*Notifications, bool) { + if o == nil || o.Notifications == nil { + return nil, false + } + return o.Notifications, true +} + +// HasNotifications returns a boolean if a field has been set. +func (o *TaskUpdate) HasNotifications() bool { + if o != nil && o.Notifications != nil { + return true + } + + return false +} + +// SetNotifications gets a reference to the given Notifications and assigns it to the Notifications field. +func (o *TaskUpdate) SetNotifications(v *Notifications) *TaskUpdate { + o.Notifications = v + return o +} + +// GetPolicies returns the Policies field value if set, zero value otherwise. +func (o *TaskUpdate) GetPolicies() Policies { + if o == nil || o.Policies == nil { + var ret Policies + return ret + } + return *o.Policies +} + +// GetPoliciesOk returns a tuple with the Policies field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TaskUpdate) GetPoliciesOk() (*Policies, bool) { + if o == nil || o.Policies == nil { + return nil, false + } + return o.Policies, true +} + +// HasPolicies returns a boolean if a field has been set. +func (o *TaskUpdate) HasPolicies() bool { + if o != nil && o.Policies != nil { + return true + } + + return false +} + +// SetPolicies gets a reference to the given Policies and assigns it to the Policies field. +func (o *TaskUpdate) SetPolicies(v *Policies) *TaskUpdate { + o.Policies = v + return o +} + func (o TaskUpdate) MarshalJSON() ([]byte, error) { toSerialize := map[string]any{} if o.DestinationID != nil { @@ -250,6 +330,12 @@ func (o TaskUpdate) MarshalJSON() ([]byte, error) { if o.FailureThreshold != nil { toSerialize["failureThreshold"] = o.FailureThreshold } + if o.Notifications != nil { + toSerialize["notifications"] = o.Notifications + } + if o.Policies != nil { + toSerialize["policies"] = o.Policies + } serialized, err := json.Marshal(toSerialize) if err != nil { return nil, fmt.Errorf("failed to marshal TaskUpdate: %w", err) @@ -265,5 +351,7 @@ func (o TaskUpdate) String() string { out += fmt.Sprintf(" input=%v\n", o.Input) out += fmt.Sprintf(" enabled=%v\n", o.Enabled) out += fmt.Sprintf(" failureThreshold=%v\n", o.FailureThreshold) + out += fmt.Sprintf(" notifications=%v\n", o.Notifications) + out += fmt.Sprintf(" policies=%v\n", o.Policies) return fmt.Sprintf("TaskUpdate {\n%s}", out) } diff --git a/algolia/ingestion/model_task_v1.go b/algolia/ingestion/model_task_v1.go index 820d2b90d..932d27491 100644 --- a/algolia/ingestion/model_task_v1.go +++ b/algolia/ingestion/model_task_v1.go @@ -22,7 +22,9 @@ type TaskV1 struct { FailureThreshold *int32 `json:"failureThreshold,omitempty"` Action *ActionType `json:"action,omitempty"` // Date of the last cursor in RFC 3339 format. - Cursor *string `json:"cursor,omitempty"` + Cursor *string `json:"cursor,omitempty"` + Notifications *Notifications `json:"notifications,omitempty"` + Policies *Policies `json:"policies,omitempty"` // Date of creation in RFC 3339 format. CreatedAt string `json:"createdAt"` // Date of last update in RFC 3339 format. @@ -55,6 +57,18 @@ func WithTaskV1Cursor(val string) TaskV1Option { } } +func WithTaskV1Notifications(val Notifications) TaskV1Option { + return func(f *TaskV1) { + f.Notifications = &val + } +} + +func WithTaskV1Policies(val Policies) TaskV1Option { + return func(f *TaskV1) { + f.Policies = &val + } +} + func WithTaskV1UpdatedAt(val string) TaskV1Option { return func(f *TaskV1) { f.UpdatedAt = &val @@ -341,6 +355,72 @@ func (o *TaskV1) SetCursor(v string) *TaskV1 { return o } +// GetNotifications returns the Notifications field value if set, zero value otherwise. +func (o *TaskV1) GetNotifications() Notifications { + if o == nil || o.Notifications == nil { + var ret Notifications + return ret + } + return *o.Notifications +} + +// GetNotificationsOk returns a tuple with the Notifications field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TaskV1) GetNotificationsOk() (*Notifications, bool) { + if o == nil || o.Notifications == nil { + return nil, false + } + return o.Notifications, true +} + +// HasNotifications returns a boolean if a field has been set. +func (o *TaskV1) HasNotifications() bool { + if o != nil && o.Notifications != nil { + return true + } + + return false +} + +// SetNotifications gets a reference to the given Notifications and assigns it to the Notifications field. +func (o *TaskV1) SetNotifications(v *Notifications) *TaskV1 { + o.Notifications = v + return o +} + +// GetPolicies returns the Policies field value if set, zero value otherwise. +func (o *TaskV1) GetPolicies() Policies { + if o == nil || o.Policies == nil { + var ret Policies + return ret + } + return *o.Policies +} + +// GetPoliciesOk returns a tuple with the Policies field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TaskV1) GetPoliciesOk() (*Policies, bool) { + if o == nil || o.Policies == nil { + return nil, false + } + return o.Policies, true +} + +// HasPolicies returns a boolean if a field has been set. +func (o *TaskV1) HasPolicies() bool { + if o != nil && o.Policies != nil { + return true + } + + return false +} + +// SetPolicies gets a reference to the given Policies and assigns it to the Policies field. +func (o *TaskV1) SetPolicies(v *Policies) *TaskV1 { + o.Policies = v + return o +} + // GetCreatedAt returns the CreatedAt field value. func (o *TaskV1) GetCreatedAt() string { if o == nil { @@ -428,6 +508,12 @@ func (o TaskV1) MarshalJSON() ([]byte, error) { if o.Cursor != nil { toSerialize["cursor"] = o.Cursor } + if o.Notifications != nil { + toSerialize["notifications"] = o.Notifications + } + if o.Policies != nil { + toSerialize["policies"] = o.Policies + } if true { toSerialize["createdAt"] = o.CreatedAt } @@ -453,6 +539,8 @@ func (o TaskV1) String() string { out += fmt.Sprintf(" failureThreshold=%v\n", o.FailureThreshold) out += fmt.Sprintf(" action=%v\n", o.Action) out += fmt.Sprintf(" cursor=%v\n", o.Cursor) + out += fmt.Sprintf(" notifications=%v\n", o.Notifications) + out += fmt.Sprintf(" policies=%v\n", o.Policies) out += fmt.Sprintf(" createdAt=%v\n", o.CreatedAt) out += fmt.Sprintf(" updatedAt=%v\n", o.UpdatedAt) return fmt.Sprintf("TaskV1 {\n%s}", out)