-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathmodel_estimate_notification_recipients_request.go
More file actions
325 lines (269 loc) · 12.5 KB
/
Copy pathmodel_estimate_notification_recipients_request.go
File metadata and controls
325 lines (269 loc) · 12.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
/*
OneSignal
A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com
Contact: devrel@onesignal.com
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package onesignal
import (
"encoding/json"
)
// EstimateNotificationRecipientsRequest The targeting subset of notification fields this endpoint honors. `included_segments` (or its `\"All\"` shorthand) is required. `excluded_segments`, `filters`, `include_aliases`, and `target_channel` narrow that segment-based audience further when present. Use `target_channel` to select which platforms to count. Other notification targeting fields (`include_subscription_ids` and the other raw subscription id/token fields, and the individual `isIos` / `isAndroid` / etc. platform flags) are not read by this endpoint. All non-targeting notification fields (content, delivery options, and so on) are accepted, but ignored.
type EstimateNotificationRecipientsRequest struct {
// The segment names you want to target. Users in these segments will receive a notification. This targeting parameter is only compatible with excluded_segments. Example: [\"Active Users\", \"Inactive Users\"] `\"All\"` is a shorthand for every subscribed user: if the array includes the string `\"All\"` and the app has no segment actually named `All`, it targets all subscribers instead of a literal segment lookup.
IncludedSegments []string `json:"included_segments,omitempty"`
// Segment that will be excluded when sending. Users in these segments will not receive a notification, even if they were included in included_segments. This targeting parameter is only compatible with included_segments. Example: [\"Active Users\", \"Inactive Users\"]
ExcludedSegments []string `json:"excluded_segments,omitempty"`
// The OneSignal App ID for your app, which can be found in Keys & IDs.
AppId string `json:"app_id"`
Filters []FilterExpression `json:"filters,omitempty"`
// Target specific users by aliases assigned via API. An alias can be an external_id, onesignal_id, or a custom alias. Accepts an object where keys are alias labels and values are arrays of alias IDs to include Example usage: { \"external_id\": [\"exId1\", \"extId2\"], \"internal_label\": [\"id1\", \"id2\"] } Keys must match API spellings exactly (for example the label for External ID is the string `external_id`; arbitrary keys such as camelCase variants are not aliases and may yield no recipients). Not compatible with any other targeting parameters. REQUIRED: REST API Key Authentication Limit of 2,000 entries per REST API call Note: If targeting push, email, or sms subscribers with same ids, use with target_channel to indicate you are sending a push or email or sms.
IncludeAliases map[string][]string `json:"include_aliases,omitempty"`
// Which platforms to count recipients for. Selects the same default platforms Create notification would use for the channel. Individual platform flags (`isIos`, `isAndroid`, etc.) are not supported by this endpoint.
TargetChannel *string `json:"target_channel,omitempty"`
AdditionalProperties map[string]interface{}
}
type _EstimateNotificationRecipientsRequest EstimateNotificationRecipientsRequest
// NewEstimateNotificationRecipientsRequest instantiates a new EstimateNotificationRecipientsRequest 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 NewEstimateNotificationRecipientsRequest(appId string) *EstimateNotificationRecipientsRequest {
this := EstimateNotificationRecipientsRequest{}
this.AppId = appId
return &this
}
// NewEstimateNotificationRecipientsRequestWithDefaults instantiates a new EstimateNotificationRecipientsRequest object
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set
func NewEstimateNotificationRecipientsRequestWithDefaults() *EstimateNotificationRecipientsRequest {
this := EstimateNotificationRecipientsRequest{}
return &this
}
// GetIncludedSegments returns the IncludedSegments field value if set, zero value otherwise.
func (o *EstimateNotificationRecipientsRequest) GetIncludedSegments() []string {
if o == nil || o.IncludedSegments == nil {
var ret []string
return ret
}
return o.IncludedSegments
}
// GetIncludedSegmentsOk returns a tuple with the IncludedSegments field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *EstimateNotificationRecipientsRequest) GetIncludedSegmentsOk() ([]string, bool) {
if o == nil || o.IncludedSegments == nil {
return nil, false
}
return o.IncludedSegments, true
}
// HasIncludedSegments returns a boolean if a field has been set.
func (o *EstimateNotificationRecipientsRequest) HasIncludedSegments() bool {
if o != nil && o.IncludedSegments != nil {
return true
}
return false
}
// SetIncludedSegments gets a reference to the given []string and assigns it to the IncludedSegments field.
func (o *EstimateNotificationRecipientsRequest) SetIncludedSegments(v []string) {
o.IncludedSegments = v
}
// GetExcludedSegments returns the ExcludedSegments field value if set, zero value otherwise.
func (o *EstimateNotificationRecipientsRequest) GetExcludedSegments() []string {
if o == nil || o.ExcludedSegments == nil {
var ret []string
return ret
}
return o.ExcludedSegments
}
// GetExcludedSegmentsOk returns a tuple with the ExcludedSegments field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *EstimateNotificationRecipientsRequest) GetExcludedSegmentsOk() ([]string, bool) {
if o == nil || o.ExcludedSegments == nil {
return nil, false
}
return o.ExcludedSegments, true
}
// HasExcludedSegments returns a boolean if a field has been set.
func (o *EstimateNotificationRecipientsRequest) HasExcludedSegments() bool {
if o != nil && o.ExcludedSegments != nil {
return true
}
return false
}
// SetExcludedSegments gets a reference to the given []string and assigns it to the ExcludedSegments field.
func (o *EstimateNotificationRecipientsRequest) SetExcludedSegments(v []string) {
o.ExcludedSegments = v
}
// GetAppId returns the AppId field value
func (o *EstimateNotificationRecipientsRequest) GetAppId() string {
if o == nil {
var ret string
return ret
}
return o.AppId
}
// GetAppIdOk returns a tuple with the AppId field value
// and a boolean to check if the value has been set.
func (o *EstimateNotificationRecipientsRequest) GetAppIdOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.AppId, true
}
// SetAppId sets field value
func (o *EstimateNotificationRecipientsRequest) SetAppId(v string) {
o.AppId = v
}
// GetFilters returns the Filters field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *EstimateNotificationRecipientsRequest) GetFilters() []FilterExpression {
if o == nil {
var ret []FilterExpression
return ret
}
return o.Filters
}
// GetFiltersOk returns a tuple with the Filters field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *EstimateNotificationRecipientsRequest) GetFiltersOk() ([]FilterExpression, bool) {
if o == nil || o.Filters == nil {
return nil, false
}
return o.Filters, true
}
// HasFilters returns a boolean if a field has been set.
func (o *EstimateNotificationRecipientsRequest) HasFilters() bool {
if o != nil && o.Filters != nil {
return true
}
return false
}
// SetFilters gets a reference to the given []FilterExpression and assigns it to the Filters field.
func (o *EstimateNotificationRecipientsRequest) SetFilters(v []FilterExpression) {
o.Filters = v
}
// GetIncludeAliases returns the IncludeAliases field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *EstimateNotificationRecipientsRequest) GetIncludeAliases() map[string][]string {
if o == nil {
var ret map[string][]string
return ret
}
return o.IncludeAliases
}
// GetIncludeAliasesOk returns a tuple with the IncludeAliases field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *EstimateNotificationRecipientsRequest) GetIncludeAliasesOk() (*map[string][]string, bool) {
if o == nil || o.IncludeAliases == nil {
return nil, false
}
return &o.IncludeAliases, true
}
// HasIncludeAliases returns a boolean if a field has been set.
func (o *EstimateNotificationRecipientsRequest) HasIncludeAliases() bool {
if o != nil && o.IncludeAliases != nil {
return true
}
return false
}
// SetIncludeAliases gets a reference to the given map[string][]string and assigns it to the IncludeAliases field.
func (o *EstimateNotificationRecipientsRequest) SetIncludeAliases(v map[string][]string) {
o.IncludeAliases = v
}
// GetTargetChannel returns the TargetChannel field value if set, zero value otherwise.
func (o *EstimateNotificationRecipientsRequest) GetTargetChannel() string {
if o == nil || o.TargetChannel == nil {
var ret string
return ret
}
return *o.TargetChannel
}
// GetTargetChannelOk returns a tuple with the TargetChannel field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *EstimateNotificationRecipientsRequest) GetTargetChannelOk() (*string, bool) {
if o == nil || o.TargetChannel == nil {
return nil, false
}
return o.TargetChannel, true
}
// HasTargetChannel returns a boolean if a field has been set.
func (o *EstimateNotificationRecipientsRequest) HasTargetChannel() bool {
if o != nil && o.TargetChannel != nil {
return true
}
return false
}
// SetTargetChannel gets a reference to the given string and assigns it to the TargetChannel field.
func (o *EstimateNotificationRecipientsRequest) SetTargetChannel(v string) {
o.TargetChannel = &v
}
func (o EstimateNotificationRecipientsRequest) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.IncludedSegments != nil {
toSerialize["included_segments"] = o.IncludedSegments
}
if o.ExcludedSegments != nil {
toSerialize["excluded_segments"] = o.ExcludedSegments
}
if true {
toSerialize["app_id"] = o.AppId
}
if o.Filters != nil {
toSerialize["filters"] = o.Filters
}
if o.IncludeAliases != nil {
toSerialize["include_aliases"] = o.IncludeAliases
}
if o.TargetChannel != nil {
toSerialize["target_channel"] = o.TargetChannel
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return json.Marshal(toSerialize)
}
func (o *EstimateNotificationRecipientsRequest) UnmarshalJSON(bytes []byte) (err error) {
varEstimateNotificationRecipientsRequest := _EstimateNotificationRecipientsRequest{}
if err = json.Unmarshal(bytes, &varEstimateNotificationRecipientsRequest); err == nil {
*o = EstimateNotificationRecipientsRequest(varEstimateNotificationRecipientsRequest)
}
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(bytes, &additionalProperties); err == nil {
delete(additionalProperties, "included_segments")
delete(additionalProperties, "excluded_segments")
delete(additionalProperties, "app_id")
delete(additionalProperties, "filters")
delete(additionalProperties, "include_aliases")
delete(additionalProperties, "target_channel")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableEstimateNotificationRecipientsRequest struct {
value *EstimateNotificationRecipientsRequest
isSet bool
}
func (v NullableEstimateNotificationRecipientsRequest) Get() *EstimateNotificationRecipientsRequest {
return v.value
}
func (v *NullableEstimateNotificationRecipientsRequest) Set(val *EstimateNotificationRecipientsRequest) {
v.value = val
v.isSet = true
}
func (v NullableEstimateNotificationRecipientsRequest) IsSet() bool {
return v.isSet
}
func (v *NullableEstimateNotificationRecipientsRequest) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableEstimateNotificationRecipientsRequest(val *EstimateNotificationRecipientsRequest) *NullableEstimateNotificationRecipientsRequest {
return &NullableEstimateNotificationRecipientsRequest{value: val, isSet: true}
}
func (v NullableEstimateNotificationRecipientsRequest) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableEstimateNotificationRecipientsRequest) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}