1package scheduler
2
3// Copyright (c) Microsoft and contributors.  All rights reserved.
4//
5// Licensed under the Apache License, Version 2.0 (the "License");
6// you may not use this file except in compliance with the License.
7// You may obtain a copy of the License at
8// http://www.apache.org/licenses/LICENSE-2.0
9//
10// Unless required by applicable law or agreed to in writing, software
11// distributed under the License is distributed on an "AS IS" BASIS,
12// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13//
14// See the License for the specific language governing permissions and
15// limitations under the License.
16//
17// Code generated by Microsoft (R) AutoRest Code Generator.
18// Changes may cause incorrect behavior and will be lost if the code is regenerated.
19
20import (
21	"encoding/json"
22	"github.com/Azure/go-autorest/autorest"
23	"github.com/Azure/go-autorest/autorest/date"
24	"github.com/Azure/go-autorest/autorest/to"
25	"net/http"
26)
27
28// DayOfWeek enumerates the values for day of week.
29type DayOfWeek string
30
31const (
32	// Friday ...
33	Friday DayOfWeek = "Friday"
34	// Monday ...
35	Monday DayOfWeek = "Monday"
36	// Saturday ...
37	Saturday DayOfWeek = "Saturday"
38	// Sunday ...
39	Sunday DayOfWeek = "Sunday"
40	// Thursday ...
41	Thursday DayOfWeek = "Thursday"
42	// Tuesday ...
43	Tuesday DayOfWeek = "Tuesday"
44	// Wednesday ...
45	Wednesday DayOfWeek = "Wednesday"
46)
47
48// PossibleDayOfWeekValues returns an array of possible values for the DayOfWeek const type.
49func PossibleDayOfWeekValues() []DayOfWeek {
50	return []DayOfWeek{Friday, Monday, Saturday, Sunday, Thursday, Tuesday, Wednesday}
51}
52
53// HTTPAuthenticationType enumerates the values for http authentication type.
54type HTTPAuthenticationType string
55
56const (
57	// ActiveDirectoryOAuth ...
58	ActiveDirectoryOAuth HTTPAuthenticationType = "ActiveDirectoryOAuth"
59	// Basic ...
60	Basic HTTPAuthenticationType = "Basic"
61	// ClientCertificate ...
62	ClientCertificate HTTPAuthenticationType = "ClientCertificate"
63	// NotSpecified ...
64	NotSpecified HTTPAuthenticationType = "NotSpecified"
65)
66
67// PossibleHTTPAuthenticationTypeValues returns an array of possible values for the HTTPAuthenticationType const type.
68func PossibleHTTPAuthenticationTypeValues() []HTTPAuthenticationType {
69	return []HTTPAuthenticationType{ActiveDirectoryOAuth, Basic, ClientCertificate, NotSpecified}
70}
71
72// JobActionType enumerates the values for job action type.
73type JobActionType string
74
75const (
76	// HTTP ...
77	HTTP JobActionType = "Http"
78	// HTTPS ...
79	HTTPS JobActionType = "Https"
80	// ServiceBusQueue ...
81	ServiceBusQueue JobActionType = "ServiceBusQueue"
82	// ServiceBusTopic ...
83	ServiceBusTopic JobActionType = "ServiceBusTopic"
84	// StorageQueue ...
85	StorageQueue JobActionType = "StorageQueue"
86)
87
88// PossibleJobActionTypeValues returns an array of possible values for the JobActionType const type.
89func PossibleJobActionTypeValues() []JobActionType {
90	return []JobActionType{HTTP, HTTPS, ServiceBusQueue, ServiceBusTopic, StorageQueue}
91}
92
93// JobCollectionState enumerates the values for job collection state.
94type JobCollectionState string
95
96const (
97	// Deleted ...
98	Deleted JobCollectionState = "Deleted"
99	// Disabled ...
100	Disabled JobCollectionState = "Disabled"
101	// Enabled ...
102	Enabled JobCollectionState = "Enabled"
103	// Suspended ...
104	Suspended JobCollectionState = "Suspended"
105)
106
107// PossibleJobCollectionStateValues returns an array of possible values for the JobCollectionState const type.
108func PossibleJobCollectionStateValues() []JobCollectionState {
109	return []JobCollectionState{Deleted, Disabled, Enabled, Suspended}
110}
111
112// JobExecutionStatus enumerates the values for job execution status.
113type JobExecutionStatus string
114
115const (
116	// Completed ...
117	Completed JobExecutionStatus = "Completed"
118	// Failed ...
119	Failed JobExecutionStatus = "Failed"
120	// Postponed ...
121	Postponed JobExecutionStatus = "Postponed"
122)
123
124// PossibleJobExecutionStatusValues returns an array of possible values for the JobExecutionStatus const type.
125func PossibleJobExecutionStatusValues() []JobExecutionStatus {
126	return []JobExecutionStatus{Completed, Failed, Postponed}
127}
128
129// JobHistoryActionName enumerates the values for job history action name.
130type JobHistoryActionName string
131
132const (
133	// ErrorAction ...
134	ErrorAction JobHistoryActionName = "ErrorAction"
135	// MainAction ...
136	MainAction JobHistoryActionName = "MainAction"
137)
138
139// PossibleJobHistoryActionNameValues returns an array of possible values for the JobHistoryActionName const type.
140func PossibleJobHistoryActionNameValues() []JobHistoryActionName {
141	return []JobHistoryActionName{ErrorAction, MainAction}
142}
143
144// JobScheduleDay enumerates the values for job schedule day.
145type JobScheduleDay string
146
147const (
148	// JobScheduleDayFriday ...
149	JobScheduleDayFriday JobScheduleDay = "Friday"
150	// JobScheduleDayMonday ...
151	JobScheduleDayMonday JobScheduleDay = "Monday"
152	// JobScheduleDaySaturday ...
153	JobScheduleDaySaturday JobScheduleDay = "Saturday"
154	// JobScheduleDaySunday ...
155	JobScheduleDaySunday JobScheduleDay = "Sunday"
156	// JobScheduleDayThursday ...
157	JobScheduleDayThursday JobScheduleDay = "Thursday"
158	// JobScheduleDayTuesday ...
159	JobScheduleDayTuesday JobScheduleDay = "Tuesday"
160	// JobScheduleDayWednesday ...
161	JobScheduleDayWednesday JobScheduleDay = "Wednesday"
162)
163
164// PossibleJobScheduleDayValues returns an array of possible values for the JobScheduleDay const type.
165func PossibleJobScheduleDayValues() []JobScheduleDay {
166	return []JobScheduleDay{JobScheduleDayFriday, JobScheduleDayMonday, JobScheduleDaySaturday, JobScheduleDaySunday, JobScheduleDayThursday, JobScheduleDayTuesday, JobScheduleDayWednesday}
167}
168
169// JobState enumerates the values for job state.
170type JobState string
171
172const (
173	// JobStateCompleted ...
174	JobStateCompleted JobState = "Completed"
175	// JobStateDisabled ...
176	JobStateDisabled JobState = "Disabled"
177	// JobStateEnabled ...
178	JobStateEnabled JobState = "Enabled"
179	// JobStateFaulted ...
180	JobStateFaulted JobState = "Faulted"
181)
182
183// PossibleJobStateValues returns an array of possible values for the JobState const type.
184func PossibleJobStateValues() []JobState {
185	return []JobState{JobStateCompleted, JobStateDisabled, JobStateEnabled, JobStateFaulted}
186}
187
188// RecurrenceFrequency enumerates the values for recurrence frequency.
189type RecurrenceFrequency string
190
191const (
192	// Day ...
193	Day RecurrenceFrequency = "Day"
194	// Hour ...
195	Hour RecurrenceFrequency = "Hour"
196	// Minute ...
197	Minute RecurrenceFrequency = "Minute"
198	// Month ...
199	Month RecurrenceFrequency = "Month"
200	// Week ...
201	Week RecurrenceFrequency = "Week"
202)
203
204// PossibleRecurrenceFrequencyValues returns an array of possible values for the RecurrenceFrequency const type.
205func PossibleRecurrenceFrequencyValues() []RecurrenceFrequency {
206	return []RecurrenceFrequency{Day, Hour, Minute, Month, Week}
207}
208
209// RetryType enumerates the values for retry type.
210type RetryType string
211
212const (
213	// Fixed ...
214	Fixed RetryType = "Fixed"
215	// None ...
216	None RetryType = "None"
217)
218
219// PossibleRetryTypeValues returns an array of possible values for the RetryType const type.
220func PossibleRetryTypeValues() []RetryType {
221	return []RetryType{Fixed, None}
222}
223
224// ServiceBusAuthenticationType enumerates the values for service bus authentication type.
225type ServiceBusAuthenticationType string
226
227const (
228	// ServiceBusAuthenticationTypeNotSpecified ...
229	ServiceBusAuthenticationTypeNotSpecified ServiceBusAuthenticationType = "NotSpecified"
230	// ServiceBusAuthenticationTypeSharedAccessKey ...
231	ServiceBusAuthenticationTypeSharedAccessKey ServiceBusAuthenticationType = "SharedAccessKey"
232)
233
234// PossibleServiceBusAuthenticationTypeValues returns an array of possible values for the ServiceBusAuthenticationType const type.
235func PossibleServiceBusAuthenticationTypeValues() []ServiceBusAuthenticationType {
236	return []ServiceBusAuthenticationType{ServiceBusAuthenticationTypeNotSpecified, ServiceBusAuthenticationTypeSharedAccessKey}
237}
238
239// ServiceBusTransportType enumerates the values for service bus transport type.
240type ServiceBusTransportType string
241
242const (
243	// ServiceBusTransportTypeAMQP ...
244	ServiceBusTransportTypeAMQP ServiceBusTransportType = "AMQP"
245	// ServiceBusTransportTypeNetMessaging ...
246	ServiceBusTransportTypeNetMessaging ServiceBusTransportType = "NetMessaging"
247	// ServiceBusTransportTypeNotSpecified ...
248	ServiceBusTransportTypeNotSpecified ServiceBusTransportType = "NotSpecified"
249)
250
251// PossibleServiceBusTransportTypeValues returns an array of possible values for the ServiceBusTransportType const type.
252func PossibleServiceBusTransportTypeValues() []ServiceBusTransportType {
253	return []ServiceBusTransportType{ServiceBusTransportTypeAMQP, ServiceBusTransportTypeNetMessaging, ServiceBusTransportTypeNotSpecified}
254}
255
256// SkuDefinition enumerates the values for sku definition.
257type SkuDefinition string
258
259const (
260	// Free ...
261	Free SkuDefinition = "Free"
262	// Premium ...
263	Premium SkuDefinition = "Premium"
264	// Standard ...
265	Standard SkuDefinition = "Standard"
266)
267
268// PossibleSkuDefinitionValues returns an array of possible values for the SkuDefinition const type.
269func PossibleSkuDefinitionValues() []SkuDefinition {
270	return []SkuDefinition{Free, Premium, Standard}
271}
272
273// BasicAuthentication ...
274type BasicAuthentication struct {
275	// Username - Gets or sets the username.
276	Username *string `json:"username,omitempty"`
277	// Password - Gets or sets the password.
278	Password *string `json:"password,omitempty"`
279	// Type - Gets or sets the http authentication type. Possible values include: 'NotSpecified', 'ClientCertificate', 'ActiveDirectoryOAuth', 'Basic'
280	Type HTTPAuthenticationType `json:"type,omitempty"`
281}
282
283// ClientCertAuthentication ...
284type ClientCertAuthentication struct {
285	// Password - Gets or sets the password.
286	Password *string `json:"password,omitempty"`
287	// Pfx - Gets or sets the pfx.
288	Pfx *string `json:"pfx,omitempty"`
289	// CertificateThumbprint - Gets or sets the certificate thumbprint.
290	CertificateThumbprint *string `json:"certificateThumbprint,omitempty"`
291	// CertificateExpirationDate - Gets or sets the certificate expiration date.
292	CertificateExpirationDate *date.Time `json:"certificateExpirationDate,omitempty"`
293	// CertificateSubjectName - Gets or sets the certificate subject name.
294	CertificateSubjectName *string `json:"certificateSubjectName,omitempty"`
295	// Type - Gets or sets the http authentication type. Possible values include: 'NotSpecified', 'ClientCertificate', 'ActiveDirectoryOAuth', 'Basic'
296	Type HTTPAuthenticationType `json:"type,omitempty"`
297}
298
299// HTTPAuthentication ...
300type HTTPAuthentication struct {
301	// Type - Gets or sets the http authentication type. Possible values include: 'NotSpecified', 'ClientCertificate', 'ActiveDirectoryOAuth', 'Basic'
302	Type HTTPAuthenticationType `json:"type,omitempty"`
303}
304
305// HTTPRequest ...
306type HTTPRequest struct {
307	// Authentication - Gets or sets the http authentication.
308	Authentication *HTTPAuthentication `json:"authentication,omitempty"`
309	// URI - Gets or sets the Uri.
310	URI *string `json:"uri,omitempty"`
311	// Method - Gets or sets the method of the request.
312	Method *string `json:"method,omitempty"`
313	// Body - Gets or sets the request body.
314	Body *string `json:"body,omitempty"`
315	// Headers - Gets or sets the headers.
316	Headers map[string]*string `json:"headers"`
317}
318
319// MarshalJSON is the custom marshaler for HTTPRequest.
320func (hr HTTPRequest) MarshalJSON() ([]byte, error) {
321	objectMap := make(map[string]interface{})
322	if hr.Authentication != nil {
323		objectMap["authentication"] = hr.Authentication
324	}
325	if hr.URI != nil {
326		objectMap["uri"] = hr.URI
327	}
328	if hr.Method != nil {
329		objectMap["method"] = hr.Method
330	}
331	if hr.Body != nil {
332		objectMap["body"] = hr.Body
333	}
334	if hr.Headers != nil {
335		objectMap["headers"] = hr.Headers
336	}
337	return json.Marshal(objectMap)
338}
339
340// JobAction ...
341type JobAction struct {
342	// Type - Gets or sets the job action type. Possible values include: 'HTTP', 'HTTPS', 'StorageQueue', 'ServiceBusQueue', 'ServiceBusTopic'
343	Type JobActionType `json:"type,omitempty"`
344	// Request - Gets or sets the http requests.
345	Request *HTTPRequest `json:"request,omitempty"`
346	// QueueMessage - Gets or sets the storage queue message.
347	QueueMessage *StorageQueueMessage `json:"queueMessage,omitempty"`
348	// ServiceBusQueueMessage - Gets or sets the service bus queue message.
349	ServiceBusQueueMessage *ServiceBusQueueMessage `json:"serviceBusQueueMessage,omitempty"`
350	// ServiceBusTopicMessage - Gets or sets the service bus topic message.
351	ServiceBusTopicMessage *ServiceBusTopicMessage `json:"serviceBusTopicMessage,omitempty"`
352	// RetryPolicy - Gets or sets the retry policy.
353	RetryPolicy *RetryPolicy `json:"retryPolicy,omitempty"`
354	// ErrorAction - Gets or sets the error action.
355	ErrorAction *JobErrorAction `json:"errorAction,omitempty"`
356}
357
358// JobCollectionDefinition ...
359type JobCollectionDefinition struct {
360	autorest.Response `json:"-"`
361	// ID - Gets the job collection resource identifier.
362	ID *string `json:"id,omitempty"`
363	// Type - Gets the job collection resource type.
364	Type *string `json:"type,omitempty"`
365	// Name - Gets or sets the job collection resource name.
366	Name *string `json:"name,omitempty"`
367	// Location - Gets or sets the storage account location.
368	Location *string `json:"location,omitempty"`
369	// Tags - Gets or sets the tags.
370	Tags map[string]*string `json:"tags"`
371	// Properties - Gets or sets the job collection properties.
372	Properties *JobCollectionProperties `json:"properties,omitempty"`
373}
374
375// MarshalJSON is the custom marshaler for JobCollectionDefinition.
376func (jcd JobCollectionDefinition) MarshalJSON() ([]byte, error) {
377	objectMap := make(map[string]interface{})
378	if jcd.ID != nil {
379		objectMap["id"] = jcd.ID
380	}
381	if jcd.Type != nil {
382		objectMap["type"] = jcd.Type
383	}
384	if jcd.Name != nil {
385		objectMap["name"] = jcd.Name
386	}
387	if jcd.Location != nil {
388		objectMap["location"] = jcd.Location
389	}
390	if jcd.Tags != nil {
391		objectMap["tags"] = jcd.Tags
392	}
393	if jcd.Properties != nil {
394		objectMap["properties"] = jcd.Properties
395	}
396	return json.Marshal(objectMap)
397}
398
399// JobCollectionListResult ...
400type JobCollectionListResult struct {
401	autorest.Response `json:"-"`
402	// Value - Gets the job collections.
403	Value *[]JobCollectionDefinition `json:"value,omitempty"`
404	// NextLink - Gets or sets the URL to get the next set of job collections.
405	NextLink *string `json:"nextLink,omitempty"`
406}
407
408// JobCollectionListResultIterator provides access to a complete listing of JobCollectionDefinition values.
409type JobCollectionListResultIterator struct {
410	i    int
411	page JobCollectionListResultPage
412}
413
414// Next advances to the next value.  If there was an error making
415// the request the iterator does not advance and the error is returned.
416func (iter *JobCollectionListResultIterator) Next() error {
417	iter.i++
418	if iter.i < len(iter.page.Values()) {
419		return nil
420	}
421	err := iter.page.Next()
422	if err != nil {
423		iter.i--
424		return err
425	}
426	iter.i = 0
427	return nil
428}
429
430// NotDone returns true if the enumeration should be started or is not yet complete.
431func (iter JobCollectionListResultIterator) NotDone() bool {
432	return iter.page.NotDone() && iter.i < len(iter.page.Values())
433}
434
435// Response returns the raw server response from the last page request.
436func (iter JobCollectionListResultIterator) Response() JobCollectionListResult {
437	return iter.page.Response()
438}
439
440// Value returns the current value or a zero-initialized value if the
441// iterator has advanced beyond the end of the collection.
442func (iter JobCollectionListResultIterator) Value() JobCollectionDefinition {
443	if !iter.page.NotDone() {
444		return JobCollectionDefinition{}
445	}
446	return iter.page.Values()[iter.i]
447}
448
449// IsEmpty returns true if the ListResult contains no values.
450func (jclr JobCollectionListResult) IsEmpty() bool {
451	return jclr.Value == nil || len(*jclr.Value) == 0
452}
453
454// jobCollectionListResultPreparer prepares a request to retrieve the next set of results.
455// It returns nil if no more results exist.
456func (jclr JobCollectionListResult) jobCollectionListResultPreparer() (*http.Request, error) {
457	if jclr.NextLink == nil || len(to.String(jclr.NextLink)) < 1 {
458		return nil, nil
459	}
460	return autorest.Prepare(&http.Request{},
461		autorest.AsJSON(),
462		autorest.AsGet(),
463		autorest.WithBaseURL(to.String(jclr.NextLink)))
464}
465
466// JobCollectionListResultPage contains a page of JobCollectionDefinition values.
467type JobCollectionListResultPage struct {
468	fn   func(JobCollectionListResult) (JobCollectionListResult, error)
469	jclr JobCollectionListResult
470}
471
472// Next advances to the next page of values.  If there was an error making
473// the request the page does not advance and the error is returned.
474func (page *JobCollectionListResultPage) Next() error {
475	next, err := page.fn(page.jclr)
476	if err != nil {
477		return err
478	}
479	page.jclr = next
480	return nil
481}
482
483// NotDone returns true if the page enumeration should be started or is not yet complete.
484func (page JobCollectionListResultPage) NotDone() bool {
485	return !page.jclr.IsEmpty()
486}
487
488// Response returns the raw server response from the last page request.
489func (page JobCollectionListResultPage) Response() JobCollectionListResult {
490	return page.jclr
491}
492
493// Values returns the slice of values for the current page or nil if there are no values.
494func (page JobCollectionListResultPage) Values() []JobCollectionDefinition {
495	if page.jclr.IsEmpty() {
496		return nil
497	}
498	return *page.jclr.Value
499}
500
501// JobCollectionProperties ...
502type JobCollectionProperties struct {
503	// Sku - Gets or sets the SKU.
504	Sku *Sku `json:"sku,omitempty"`
505	// State - Gets or sets the state. Possible values include: 'Enabled', 'Disabled', 'Suspended', 'Deleted'
506	State JobCollectionState `json:"state,omitempty"`
507	// Quota - Gets or sets the job collection quota.
508	Quota *JobCollectionQuota `json:"quota,omitempty"`
509}
510
511// JobCollectionQuota ...
512type JobCollectionQuota struct {
513	// MaxJobCount - Gets or set the maximum job count.
514	MaxJobCount *int32 `json:"maxJobCount,omitempty"`
515	// MaxJobOccurrence - Gets or sets the maximum job occurrence.
516	MaxJobOccurrence *int32 `json:"maxJobOccurrence,omitempty"`
517	// MaxRecurrence - Gets or set the maximum recurrence.
518	MaxRecurrence *JobMaxRecurrence `json:"maxRecurrence,omitempty"`
519}
520
521// JobDefinition ...
522type JobDefinition struct {
523	autorest.Response `json:"-"`
524	// ID - Gets the job resource identifier.
525	ID *string `json:"id,omitempty"`
526	// Type - Gets the job resource type.
527	Type *string `json:"type,omitempty"`
528	// Name - Gets the job resource name.
529	Name *string `json:"name,omitempty"`
530	// Properties - Gets or sets the job properties.
531	Properties *JobProperties `json:"properties,omitempty"`
532}
533
534// JobErrorAction ...
535type JobErrorAction struct {
536	// Type - Gets or sets the job error action type. Possible values include: 'HTTP', 'HTTPS', 'StorageQueue', 'ServiceBusQueue', 'ServiceBusTopic'
537	Type JobActionType `json:"type,omitempty"`
538	// Request - Gets or sets the http requests.
539	Request *HTTPRequest `json:"request,omitempty"`
540	// QueueMessage - Gets or sets the storage queue message.
541	QueueMessage *StorageQueueMessage `json:"queueMessage,omitempty"`
542	// ServiceBusQueueMessage - Gets or sets the service bus queue message.
543	ServiceBusQueueMessage *ServiceBusQueueMessage `json:"serviceBusQueueMessage,omitempty"`
544	// ServiceBusTopicMessage - Gets or sets the service bus topic message.
545	ServiceBusTopicMessage *ServiceBusTopicMessage `json:"serviceBusTopicMessage,omitempty"`
546	// RetryPolicy - Gets or sets the retry policy.
547	RetryPolicy *RetryPolicy `json:"retryPolicy,omitempty"`
548}
549
550// JobHistoryDefinition ...
551type JobHistoryDefinition struct {
552	// ID - Gets the job history identifier.
553	ID *string `json:"id,omitempty"`
554	// Type - Gets the job history resource type.
555	Type *string `json:"type,omitempty"`
556	// Name - Gets the job history name.
557	Name *string `json:"name,omitempty"`
558	// Properties - Gets or sets the job history properties.
559	Properties *JobHistoryDefinitionProperties `json:"properties,omitempty"`
560}
561
562// JobHistoryDefinitionProperties ...
563type JobHistoryDefinitionProperties struct {
564	// StartTime - Gets the start time for this job.
565	StartTime *date.Time `json:"startTime,omitempty"`
566	// EndTime - Gets the end time for this job.
567	EndTime *date.Time `json:"endTime,omitempty"`
568	// ExpectedExecutionTime - Gets the expected execution time for this job.
569	ExpectedExecutionTime *date.Time `json:"expectedExecutionTime,omitempty"`
570	// ActionName - Gets the job history action name. Possible values include: 'MainAction', 'ErrorAction'
571	ActionName JobHistoryActionName `json:"actionName,omitempty"`
572	// Status - Gets the job history status. Possible values include: 'Completed', 'Failed', 'Postponed'
573	Status JobExecutionStatus `json:"status,omitempty"`
574	// Message - Gets the message for the job history.
575	Message *string `json:"message,omitempty"`
576	// RetryCount - Gets the retry count for job.
577	RetryCount *int32 `json:"retryCount,omitempty"`
578	// RepeatCount - Gets the repeat count for the job.
579	RepeatCount *int32 `json:"repeatCount,omitempty"`
580}
581
582// JobHistoryFilter ...
583type JobHistoryFilter struct {
584	// Status - Gets or sets the job execution status. Possible values include: 'Completed', 'Failed', 'Postponed'
585	Status JobExecutionStatus `json:"status,omitempty"`
586}
587
588// JobHistoryListResult ...
589type JobHistoryListResult struct {
590	autorest.Response `json:"-"`
591	// Value - Gets or sets the job histories under job.
592	Value *[]JobHistoryDefinition `json:"value,omitempty"`
593	// NextLink - Gets or sets the URL to get the next set of job histories.
594	NextLink *string `json:"nextLink,omitempty"`
595}
596
597// JobHistoryListResultIterator provides access to a complete listing of JobHistoryDefinition values.
598type JobHistoryListResultIterator struct {
599	i    int
600	page JobHistoryListResultPage
601}
602
603// Next advances to the next value.  If there was an error making
604// the request the iterator does not advance and the error is returned.
605func (iter *JobHistoryListResultIterator) Next() error {
606	iter.i++
607	if iter.i < len(iter.page.Values()) {
608		return nil
609	}
610	err := iter.page.Next()
611	if err != nil {
612		iter.i--
613		return err
614	}
615	iter.i = 0
616	return nil
617}
618
619// NotDone returns true if the enumeration should be started or is not yet complete.
620func (iter JobHistoryListResultIterator) NotDone() bool {
621	return iter.page.NotDone() && iter.i < len(iter.page.Values())
622}
623
624// Response returns the raw server response from the last page request.
625func (iter JobHistoryListResultIterator) Response() JobHistoryListResult {
626	return iter.page.Response()
627}
628
629// Value returns the current value or a zero-initialized value if the
630// iterator has advanced beyond the end of the collection.
631func (iter JobHistoryListResultIterator) Value() JobHistoryDefinition {
632	if !iter.page.NotDone() {
633		return JobHistoryDefinition{}
634	}
635	return iter.page.Values()[iter.i]
636}
637
638// IsEmpty returns true if the ListResult contains no values.
639func (jhlr JobHistoryListResult) IsEmpty() bool {
640	return jhlr.Value == nil || len(*jhlr.Value) == 0
641}
642
643// jobHistoryListResultPreparer prepares a request to retrieve the next set of results.
644// It returns nil if no more results exist.
645func (jhlr JobHistoryListResult) jobHistoryListResultPreparer() (*http.Request, error) {
646	if jhlr.NextLink == nil || len(to.String(jhlr.NextLink)) < 1 {
647		return nil, nil
648	}
649	return autorest.Prepare(&http.Request{},
650		autorest.AsJSON(),
651		autorest.AsGet(),
652		autorest.WithBaseURL(to.String(jhlr.NextLink)))
653}
654
655// JobHistoryListResultPage contains a page of JobHistoryDefinition values.
656type JobHistoryListResultPage struct {
657	fn   func(JobHistoryListResult) (JobHistoryListResult, error)
658	jhlr JobHistoryListResult
659}
660
661// Next advances to the next page of values.  If there was an error making
662// the request the page does not advance and the error is returned.
663func (page *JobHistoryListResultPage) Next() error {
664	next, err := page.fn(page.jhlr)
665	if err != nil {
666		return err
667	}
668	page.jhlr = next
669	return nil
670}
671
672// NotDone returns true if the page enumeration should be started or is not yet complete.
673func (page JobHistoryListResultPage) NotDone() bool {
674	return !page.jhlr.IsEmpty()
675}
676
677// Response returns the raw server response from the last page request.
678func (page JobHistoryListResultPage) Response() JobHistoryListResult {
679	return page.jhlr
680}
681
682// Values returns the slice of values for the current page or nil if there are no values.
683func (page JobHistoryListResultPage) Values() []JobHistoryDefinition {
684	if page.jhlr.IsEmpty() {
685		return nil
686	}
687	return *page.jhlr.Value
688}
689
690// JobListResult ...
691type JobListResult struct {
692	autorest.Response `json:"-"`
693	// Value - Gets or sets all jobs under job collection.
694	Value *[]JobDefinition `json:"value,omitempty"`
695	// NextLink - Gets or sets the URL to get the next set of jobs.
696	NextLink *string `json:"nextLink,omitempty"`
697}
698
699// JobListResultIterator provides access to a complete listing of JobDefinition values.
700type JobListResultIterator struct {
701	i    int
702	page JobListResultPage
703}
704
705// Next advances to the next value.  If there was an error making
706// the request the iterator does not advance and the error is returned.
707func (iter *JobListResultIterator) Next() error {
708	iter.i++
709	if iter.i < len(iter.page.Values()) {
710		return nil
711	}
712	err := iter.page.Next()
713	if err != nil {
714		iter.i--
715		return err
716	}
717	iter.i = 0
718	return nil
719}
720
721// NotDone returns true if the enumeration should be started or is not yet complete.
722func (iter JobListResultIterator) NotDone() bool {
723	return iter.page.NotDone() && iter.i < len(iter.page.Values())
724}
725
726// Response returns the raw server response from the last page request.
727func (iter JobListResultIterator) Response() JobListResult {
728	return iter.page.Response()
729}
730
731// Value returns the current value or a zero-initialized value if the
732// iterator has advanced beyond the end of the collection.
733func (iter JobListResultIterator) Value() JobDefinition {
734	if !iter.page.NotDone() {
735		return JobDefinition{}
736	}
737	return iter.page.Values()[iter.i]
738}
739
740// IsEmpty returns true if the ListResult contains no values.
741func (jlr JobListResult) IsEmpty() bool {
742	return jlr.Value == nil || len(*jlr.Value) == 0
743}
744
745// jobListResultPreparer prepares a request to retrieve the next set of results.
746// It returns nil if no more results exist.
747func (jlr JobListResult) jobListResultPreparer() (*http.Request, error) {
748	if jlr.NextLink == nil || len(to.String(jlr.NextLink)) < 1 {
749		return nil, nil
750	}
751	return autorest.Prepare(&http.Request{},
752		autorest.AsJSON(),
753		autorest.AsGet(),
754		autorest.WithBaseURL(to.String(jlr.NextLink)))
755}
756
757// JobListResultPage contains a page of JobDefinition values.
758type JobListResultPage struct {
759	fn  func(JobListResult) (JobListResult, error)
760	jlr JobListResult
761}
762
763// Next advances to the next page of values.  If there was an error making
764// the request the page does not advance and the error is returned.
765func (page *JobListResultPage) Next() error {
766	next, err := page.fn(page.jlr)
767	if err != nil {
768		return err
769	}
770	page.jlr = next
771	return nil
772}
773
774// NotDone returns true if the page enumeration should be started or is not yet complete.
775func (page JobListResultPage) NotDone() bool {
776	return !page.jlr.IsEmpty()
777}
778
779// Response returns the raw server response from the last page request.
780func (page JobListResultPage) Response() JobListResult {
781	return page.jlr
782}
783
784// Values returns the slice of values for the current page or nil if there are no values.
785func (page JobListResultPage) Values() []JobDefinition {
786	if page.jlr.IsEmpty() {
787		return nil
788	}
789	return *page.jlr.Value
790}
791
792// JobMaxRecurrence ...
793type JobMaxRecurrence struct {
794	// Frequency - Gets or sets the frequency of recurrence (second, minute, hour, day, week, month). Possible values include: 'Minute', 'Hour', 'Day', 'Week', 'Month'
795	Frequency RecurrenceFrequency `json:"frequency,omitempty"`
796	// Interval - Gets or sets the interval between retries.
797	Interval *int32 `json:"interval,omitempty"`
798}
799
800// JobProperties ...
801type JobProperties struct {
802	// StartTime - Gets or sets the job start time.
803	StartTime *date.Time `json:"startTime,omitempty"`
804	// Action - Gets or sets the job action.
805	Action *JobAction `json:"action,omitempty"`
806	// Recurrence - Gets or sets the job recurrence.
807	Recurrence *JobRecurrence `json:"recurrence,omitempty"`
808	// State - Gets or set the job state. Possible values include: 'JobStateEnabled', 'JobStateDisabled', 'JobStateFaulted', 'JobStateCompleted'
809	State JobState `json:"state,omitempty"`
810	// Status - Gets the job status.
811	Status *JobStatus `json:"status,omitempty"`
812}
813
814// JobRecurrence ...
815type JobRecurrence struct {
816	// Frequency - Gets or sets the frequency of recurrence (second, minute, hour, day, week, month). Possible values include: 'Minute', 'Hour', 'Day', 'Week', 'Month'
817	Frequency RecurrenceFrequency `json:"frequency,omitempty"`
818	// Interval - Gets or sets the interval between retries.
819	Interval *int32 `json:"interval,omitempty"`
820	// Count - Gets or sets the maximum number of times that the job should run.
821	Count *int32 `json:"count,omitempty"`
822	// EndTime - Gets or sets the time at which the job will complete.
823	EndTime  *date.Time             `json:"endTime,omitempty"`
824	Schedule *JobRecurrenceSchedule `json:"schedule,omitempty"`
825}
826
827// JobRecurrenceSchedule ...
828type JobRecurrenceSchedule struct {
829	// WeekDays - Gets or sets the days of the week that the job should execute on.
830	WeekDays *[]DayOfWeek `json:"weekDays,omitempty"`
831	// Hours - Gets or sets the hours of the day that the job should execute at.
832	Hours *[]int32 `json:"hours,omitempty"`
833	// Minutes - Gets or sets the minutes of the hour that the job should execute at.
834	Minutes *[]int32 `json:"minutes,omitempty"`
835	// MonthDays - Gets or sets the days of the month that the job should execute on. Must be between 1 and 31.
836	MonthDays *[]int32 `json:"monthDays,omitempty"`
837	// MonthlyOccurrences - Gets or sets the occurrences of days within a month.
838	MonthlyOccurrences *[]JobRecurrenceScheduleMonthlyOccurrence `json:"monthlyOccurrences,omitempty"`
839}
840
841// JobRecurrenceScheduleMonthlyOccurrence ...
842type JobRecurrenceScheduleMonthlyOccurrence struct {
843	// Day - Gets or sets the day. Must be one of monday, tuesday, wednesday, thursday, friday, saturday, sunday. Possible values include: 'JobScheduleDayMonday', 'JobScheduleDayTuesday', 'JobScheduleDayWednesday', 'JobScheduleDayThursday', 'JobScheduleDayFriday', 'JobScheduleDaySaturday', 'JobScheduleDaySunday'
844	Day JobScheduleDay `json:"day,omitempty"`
845	// Occurrence - Gets or sets the occurrence. Must be between -5 and 5.
846	Occurrence *int32 `json:"Occurrence,omitempty"`
847}
848
849// JobStateFilter ...
850type JobStateFilter struct {
851	// State - Gets or sets the job state. Possible values include: 'JobStateEnabled', 'JobStateDisabled', 'JobStateFaulted', 'JobStateCompleted'
852	State JobState `json:"state,omitempty"`
853}
854
855// JobStatus ...
856type JobStatus struct {
857	// ExecutionCount - Gets the number of times this job has executed.
858	ExecutionCount *int32 `json:"executionCount,omitempty"`
859	// FailureCount - Gets the number of times this job has failed.
860	FailureCount *int32 `json:"failureCount,omitempty"`
861	// FaultedCount - Gets the number of faulted occurrences (occurrences that were retried and failed as many times as the retry policy states).
862	FaultedCount *int32 `json:"faultedCount,omitempty"`
863	// LastExecutionTime - Gets the time the last occurrence executed in ISO-8601 format.  Could be empty if job has not run yet.
864	LastExecutionTime *date.Time `json:"lastExecutionTime,omitempty"`
865	// NextExecutionTime - Gets the time of the next occurrence in ISO-8601 format. Could be empty if the job is completed.
866	NextExecutionTime *date.Time `json:"nextExecutionTime,omitempty"`
867}
868
869// OAuthAuthentication ...
870type OAuthAuthentication struct {
871	// Secret - Gets or sets the secret.
872	Secret *string `json:"secret,omitempty"`
873	// Tenant - Gets or sets the tenant.
874	Tenant *string `json:"tenant,omitempty"`
875	// Audience - Gets or sets the audience.
876	Audience *string `json:"audience,omitempty"`
877	// ClientID - Gets or sets the client identifier.
878	ClientID *string `json:"clientId,omitempty"`
879	// Type - Gets or sets the http authentication type. Possible values include: 'NotSpecified', 'ClientCertificate', 'ActiveDirectoryOAuth', 'Basic'
880	Type HTTPAuthenticationType `json:"type,omitempty"`
881}
882
883// RetryPolicy ...
884type RetryPolicy struct {
885	// RetryType - Gets or sets the retry strategy to be used. Possible values include: 'None', 'Fixed'
886	RetryType RetryType `json:"retryType,omitempty"`
887	// RetryInterval - Gets or sets the retry interval between retries.
888	RetryInterval *string `json:"retryInterval,omitempty"`
889	// RetryCount - Gets or sets the number of times a retry should be attempted.
890	RetryCount *int32 `json:"retryCount,omitempty"`
891}
892
893// ServiceBusAuthentication ...
894type ServiceBusAuthentication struct {
895	// SasKey - Gets or sets the SAS key.
896	SasKey *string `json:"sasKey,omitempty"`
897	// SasKeyName - Gets or sets the SAS key name.
898	SasKeyName *string `json:"sasKeyName,omitempty"`
899	// Type - Gets or sets the authentication type. Possible values include: 'ServiceBusAuthenticationTypeNotSpecified', 'ServiceBusAuthenticationTypeSharedAccessKey'
900	Type ServiceBusAuthenticationType `json:"type,omitempty"`
901}
902
903// ServiceBusBrokeredMessageProperties ...
904type ServiceBusBrokeredMessageProperties struct {
905	// ContentType - Gets or sets the content type.
906	ContentType *string `json:"contentType,omitempty"`
907	// CorrelationID - Gets or sets the correlation id.
908	CorrelationID *string `json:"correlationId,omitempty"`
909	// ForcePersistence - Gets or sets the force persistence.
910	ForcePersistence *bool `json:"forcePersistence,omitempty"`
911	// Label - Gets or sets the label.
912	Label *string `json:"label,omitempty"`
913	// MessageID - Gets or sets the message id.
914	MessageID *string `json:"messageId,omitempty"`
915	// PartitionKey - Gets or sets the partition key.
916	PartitionKey *string `json:"partitionKey,omitempty"`
917	// ReplyTo - Gets or sets the reply to.
918	ReplyTo *string `json:"replyTo,omitempty"`
919	// ReplyToSessionID - Gets or sets the reply to session id.
920	ReplyToSessionID *string `json:"replyToSessionId,omitempty"`
921	// ScheduledEnqueueTimeUtc - Gets or sets the scheduled enqueue time UTC.
922	ScheduledEnqueueTimeUtc *date.Time `json:"scheduledEnqueueTimeUtc,omitempty"`
923	// SessionID - Gets or sets the session id.
924	SessionID *string `json:"sessionId,omitempty"`
925	// TimeToLive - Gets or sets the time to live.
926	TimeToLive *date.Time `json:"timeToLive,omitempty"`
927	// To - Gets or sets the to.
928	To *string `json:"to,omitempty"`
929	// ViaPartitionKey - Gets or sets the via partition key.
930	ViaPartitionKey *string `json:"viaPartitionKey,omitempty"`
931}
932
933// ServiceBusMessage ...
934type ServiceBusMessage struct {
935	// Authentication - Gets or sets the authentication.
936	Authentication *ServiceBusAuthentication `json:"authentication,omitempty"`
937	// BrokeredMessageProperties - Gets or sets the brokered message properties.
938	BrokeredMessageProperties *ServiceBusBrokeredMessageProperties `json:"brokeredMessageProperties,omitempty"`
939	// CustomMessageProperties - Gets or sets the custom message properties.
940	CustomMessageProperties map[string]*string `json:"customMessageProperties"`
941	// Message - Gets or sets the message.
942	Message *string `json:"message,omitempty"`
943	// Namespace - Gets or sets the namespace.
944	Namespace *string `json:"namespace,omitempty"`
945	// TransportType - Gets or sets the transport type. Possible values include: 'ServiceBusTransportTypeNotSpecified', 'ServiceBusTransportTypeNetMessaging', 'ServiceBusTransportTypeAMQP'
946	TransportType ServiceBusTransportType `json:"transportType,omitempty"`
947}
948
949// MarshalJSON is the custom marshaler for ServiceBusMessage.
950func (sbm ServiceBusMessage) MarshalJSON() ([]byte, error) {
951	objectMap := make(map[string]interface{})
952	if sbm.Authentication != nil {
953		objectMap["authentication"] = sbm.Authentication
954	}
955	if sbm.BrokeredMessageProperties != nil {
956		objectMap["brokeredMessageProperties"] = sbm.BrokeredMessageProperties
957	}
958	if sbm.CustomMessageProperties != nil {
959		objectMap["customMessageProperties"] = sbm.CustomMessageProperties
960	}
961	if sbm.Message != nil {
962		objectMap["message"] = sbm.Message
963	}
964	if sbm.Namespace != nil {
965		objectMap["namespace"] = sbm.Namespace
966	}
967	if sbm.TransportType != "" {
968		objectMap["transportType"] = sbm.TransportType
969	}
970	return json.Marshal(objectMap)
971}
972
973// ServiceBusQueueMessage ...
974type ServiceBusQueueMessage struct {
975	// QueueName - Gets or sets the queue name.
976	QueueName *string `json:"queueName,omitempty"`
977	// Authentication - Gets or sets the authentication.
978	Authentication *ServiceBusAuthentication `json:"authentication,omitempty"`
979	// BrokeredMessageProperties - Gets or sets the brokered message properties.
980	BrokeredMessageProperties *ServiceBusBrokeredMessageProperties `json:"brokeredMessageProperties,omitempty"`
981	// CustomMessageProperties - Gets or sets the custom message properties.
982	CustomMessageProperties map[string]*string `json:"customMessageProperties"`
983	// Message - Gets or sets the message.
984	Message *string `json:"message,omitempty"`
985	// Namespace - Gets or sets the namespace.
986	Namespace *string `json:"namespace,omitempty"`
987	// TransportType - Gets or sets the transport type. Possible values include: 'ServiceBusTransportTypeNotSpecified', 'ServiceBusTransportTypeNetMessaging', 'ServiceBusTransportTypeAMQP'
988	TransportType ServiceBusTransportType `json:"transportType,omitempty"`
989}
990
991// MarshalJSON is the custom marshaler for ServiceBusQueueMessage.
992func (sbqm ServiceBusQueueMessage) MarshalJSON() ([]byte, error) {
993	objectMap := make(map[string]interface{})
994	if sbqm.QueueName != nil {
995		objectMap["queueName"] = sbqm.QueueName
996	}
997	if sbqm.Authentication != nil {
998		objectMap["authentication"] = sbqm.Authentication
999	}
1000	if sbqm.BrokeredMessageProperties != nil {
1001		objectMap["brokeredMessageProperties"] = sbqm.BrokeredMessageProperties
1002	}
1003	if sbqm.CustomMessageProperties != nil {
1004		objectMap["customMessageProperties"] = sbqm.CustomMessageProperties
1005	}
1006	if sbqm.Message != nil {
1007		objectMap["message"] = sbqm.Message
1008	}
1009	if sbqm.Namespace != nil {
1010		objectMap["namespace"] = sbqm.Namespace
1011	}
1012	if sbqm.TransportType != "" {
1013		objectMap["transportType"] = sbqm.TransportType
1014	}
1015	return json.Marshal(objectMap)
1016}
1017
1018// ServiceBusTopicMessage ...
1019type ServiceBusTopicMessage struct {
1020	// TopicPath - Gets or sets the topic path.
1021	TopicPath *string `json:"topicPath,omitempty"`
1022	// Authentication - Gets or sets the authentication.
1023	Authentication *ServiceBusAuthentication `json:"authentication,omitempty"`
1024	// BrokeredMessageProperties - Gets or sets the brokered message properties.
1025	BrokeredMessageProperties *ServiceBusBrokeredMessageProperties `json:"brokeredMessageProperties,omitempty"`
1026	// CustomMessageProperties - Gets or sets the custom message properties.
1027	CustomMessageProperties map[string]*string `json:"customMessageProperties"`
1028	// Message - Gets or sets the message.
1029	Message *string `json:"message,omitempty"`
1030	// Namespace - Gets or sets the namespace.
1031	Namespace *string `json:"namespace,omitempty"`
1032	// TransportType - Gets or sets the transport type. Possible values include: 'ServiceBusTransportTypeNotSpecified', 'ServiceBusTransportTypeNetMessaging', 'ServiceBusTransportTypeAMQP'
1033	TransportType ServiceBusTransportType `json:"transportType,omitempty"`
1034}
1035
1036// MarshalJSON is the custom marshaler for ServiceBusTopicMessage.
1037func (sbtm ServiceBusTopicMessage) MarshalJSON() ([]byte, error) {
1038	objectMap := make(map[string]interface{})
1039	if sbtm.TopicPath != nil {
1040		objectMap["topicPath"] = sbtm.TopicPath
1041	}
1042	if sbtm.Authentication != nil {
1043		objectMap["authentication"] = sbtm.Authentication
1044	}
1045	if sbtm.BrokeredMessageProperties != nil {
1046		objectMap["brokeredMessageProperties"] = sbtm.BrokeredMessageProperties
1047	}
1048	if sbtm.CustomMessageProperties != nil {
1049		objectMap["customMessageProperties"] = sbtm.CustomMessageProperties
1050	}
1051	if sbtm.Message != nil {
1052		objectMap["message"] = sbtm.Message
1053	}
1054	if sbtm.Namespace != nil {
1055		objectMap["namespace"] = sbtm.Namespace
1056	}
1057	if sbtm.TransportType != "" {
1058		objectMap["transportType"] = sbtm.TransportType
1059	}
1060	return json.Marshal(objectMap)
1061}
1062
1063// Sku ...
1064type Sku struct {
1065	// Name - Gets or set the SKU. Possible values include: 'Standard', 'Free', 'Premium'
1066	Name SkuDefinition `json:"name,omitempty"`
1067}
1068
1069// StorageQueueMessage ...
1070type StorageQueueMessage struct {
1071	// StorageAccount - Gets or sets the storage account name.
1072	StorageAccount *string `json:"storageAccount,omitempty"`
1073	// QueueName - Gets or sets the queue name.
1074	QueueName *string `json:"queueName,omitempty"`
1075	// SasToken - Gets or sets the SAS key.
1076	SasToken *string `json:"sasToken,omitempty"`
1077	// Message - Gets or sets the message.
1078	Message *string `json:"message,omitempty"`
1079}
1080