1package job
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	"context"
22	"encoding/json"
23	"github.com/Azure/go-autorest/autorest"
24	"github.com/Azure/go-autorest/autorest/date"
25	"github.com/Azure/go-autorest/autorest/to"
26	"github.com/Azure/go-autorest/tracing"
27	"github.com/satori/go.uuid"
28	"net/http"
29)
30
31// The package's fully qualified name.
32const fqdn = "github.com/Azure/azure-sdk-for-go/services/datalake/analytics/2016-11-01/job"
33
34// CompileMode enumerates the values for compile mode.
35type CompileMode string
36
37const (
38	// Full ...
39	Full CompileMode = "Full"
40	// Semantic ...
41	Semantic CompileMode = "Semantic"
42	// SingleBox ...
43	SingleBox CompileMode = "SingleBox"
44)
45
46// PossibleCompileModeValues returns an array of possible values for the CompileMode const type.
47func PossibleCompileModeValues() []CompileMode {
48	return []CompileMode{Full, Semantic, SingleBox}
49}
50
51// ResourceType enumerates the values for resource type.
52type ResourceType string
53
54const (
55	// JobManagerResource ...
56	JobManagerResource ResourceType = "JobManagerResource"
57	// JobManagerResourceInUserFolder ...
58	JobManagerResourceInUserFolder ResourceType = "JobManagerResourceInUserFolder"
59	// StatisticsResource ...
60	StatisticsResource ResourceType = "StatisticsResource"
61	// StatisticsResourceInUserFolder ...
62	StatisticsResourceInUserFolder ResourceType = "StatisticsResourceInUserFolder"
63	// VertexResource ...
64	VertexResource ResourceType = "VertexResource"
65	// VertexResourceInUserFolder ...
66	VertexResourceInUserFolder ResourceType = "VertexResourceInUserFolder"
67)
68
69// PossibleResourceTypeValues returns an array of possible values for the ResourceType const type.
70func PossibleResourceTypeValues() []ResourceType {
71	return []ResourceType{JobManagerResource, JobManagerResourceInUserFolder, StatisticsResource, StatisticsResourceInUserFolder, VertexResource, VertexResourceInUserFolder}
72}
73
74// Result enumerates the values for result.
75type Result string
76
77const (
78	// Cancelled ...
79	Cancelled Result = "Cancelled"
80	// Failed ...
81	Failed Result = "Failed"
82	// None ...
83	None Result = "None"
84	// Succeeded ...
85	Succeeded Result = "Succeeded"
86)
87
88// PossibleResultValues returns an array of possible values for the Result const type.
89func PossibleResultValues() []Result {
90	return []Result{Cancelled, Failed, None, Succeeded}
91}
92
93// SeverityTypes enumerates the values for severity types.
94type SeverityTypes string
95
96const (
97	// Deprecated ...
98	Deprecated SeverityTypes = "Deprecated"
99	// Error ...
100	Error SeverityTypes = "Error"
101	// Info ...
102	Info SeverityTypes = "Info"
103	// SevereWarning ...
104	SevereWarning SeverityTypes = "SevereWarning"
105	// UserWarning ...
106	UserWarning SeverityTypes = "UserWarning"
107	// Warning ...
108	Warning SeverityTypes = "Warning"
109)
110
111// PossibleSeverityTypesValues returns an array of possible values for the SeverityTypes const type.
112func PossibleSeverityTypesValues() []SeverityTypes {
113	return []SeverityTypes{Deprecated, Error, Info, SevereWarning, UserWarning, Warning}
114}
115
116// State enumerates the values for state.
117type State string
118
119const (
120	// StateAccepted ...
121	StateAccepted State = "Accepted"
122	// StateCompiling ...
123	StateCompiling State = "Compiling"
124	// StateEnded ...
125	StateEnded State = "Ended"
126	// StateNew ...
127	StateNew State = "New"
128	// StatePaused ...
129	StatePaused State = "Paused"
130	// StateQueued ...
131	StateQueued State = "Queued"
132	// StateRunning ...
133	StateRunning State = "Running"
134	// StateScheduling ...
135	StateScheduling State = "Scheduling"
136	// StateStarting ...
137	StateStarting State = "Starting"
138	// StateWaitingForCapacity ...
139	StateWaitingForCapacity State = "WaitingForCapacity"
140)
141
142// PossibleStateValues returns an array of possible values for the State const type.
143func PossibleStateValues() []State {
144	return []State{StateAccepted, StateCompiling, StateEnded, StateNew, StatePaused, StateQueued, StateRunning, StateScheduling, StateStarting, StateWaitingForCapacity}
145}
146
147// Type enumerates the values for type.
148type Type string
149
150const (
151	// TypeHive ...
152	TypeHive Type = "Hive"
153	// TypeJobProperties ...
154	TypeJobProperties Type = "JobProperties"
155	// TypeUSQL ...
156	TypeUSQL Type = "USql"
157)
158
159// PossibleTypeValues returns an array of possible values for the Type const type.
160func PossibleTypeValues() []Type {
161	return []Type{TypeHive, TypeJobProperties, TypeUSQL}
162}
163
164// TypeBasicCreateJobProperties enumerates the values for type basic create job properties.
165type TypeBasicCreateJobProperties string
166
167const (
168	// TypeBasicCreateJobPropertiesTypeCreateJobProperties ...
169	TypeBasicCreateJobPropertiesTypeCreateJobProperties TypeBasicCreateJobProperties = "CreateJobProperties"
170	// TypeBasicCreateJobPropertiesTypeUSQL ...
171	TypeBasicCreateJobPropertiesTypeUSQL TypeBasicCreateJobProperties = "USql"
172)
173
174// PossibleTypeBasicCreateJobPropertiesValues returns an array of possible values for the TypeBasicCreateJobProperties const type.
175func PossibleTypeBasicCreateJobPropertiesValues() []TypeBasicCreateJobProperties {
176	return []TypeBasicCreateJobProperties{TypeBasicCreateJobPropertiesTypeCreateJobProperties, TypeBasicCreateJobPropertiesTypeUSQL}
177}
178
179// TypeEnum enumerates the values for type enum.
180type TypeEnum string
181
182const (
183	// Hive ...
184	Hive TypeEnum = "Hive"
185	// USQL ...
186	USQL TypeEnum = "USql"
187)
188
189// PossibleTypeEnumValues returns an array of possible values for the TypeEnum const type.
190func PossibleTypeEnumValues() []TypeEnum {
191	return []TypeEnum{Hive, USQL}
192}
193
194// BaseJobParameters data Lake Analytics Job Parameters base class for build and submit.
195type BaseJobParameters struct {
196	// Type - the job type of the current job (Hive or USql). Possible values include: 'USQL', 'Hive'
197	Type TypeEnum `json:"type,omitempty"`
198	// Properties - the job specific properties.
199	Properties BasicCreateJobProperties `json:"properties,omitempty"`
200}
201
202// UnmarshalJSON is the custom unmarshaler for BaseJobParameters struct.
203func (bjp *BaseJobParameters) UnmarshalJSON(body []byte) error {
204	var m map[string]*json.RawMessage
205	err := json.Unmarshal(body, &m)
206	if err != nil {
207		return err
208	}
209	for k, v := range m {
210		switch k {
211		case "type":
212			if v != nil {
213				var typeVar TypeEnum
214				err = json.Unmarshal(*v, &typeVar)
215				if err != nil {
216					return err
217				}
218				bjp.Type = typeVar
219			}
220		case "properties":
221			if v != nil {
222				properties, err := unmarshalBasicCreateJobProperties(*v)
223				if err != nil {
224					return err
225				}
226				bjp.Properties = properties
227			}
228		}
229	}
230
231	return nil
232}
233
234// BuildJobParameters the parameters used to build a new Data Lake Analytics job.
235type BuildJobParameters struct {
236	// Name - the friendly name of the job to build.
237	Name *string `json:"name,omitempty"`
238	// Type - the job type of the current job (Hive or USql). Possible values include: 'USQL', 'Hive'
239	Type TypeEnum `json:"type,omitempty"`
240	// Properties - the job specific properties.
241	Properties BasicCreateJobProperties `json:"properties,omitempty"`
242}
243
244// UnmarshalJSON is the custom unmarshaler for BuildJobParameters struct.
245func (bjp *BuildJobParameters) UnmarshalJSON(body []byte) error {
246	var m map[string]*json.RawMessage
247	err := json.Unmarshal(body, &m)
248	if err != nil {
249		return err
250	}
251	for k, v := range m {
252		switch k {
253		case "name":
254			if v != nil {
255				var name string
256				err = json.Unmarshal(*v, &name)
257				if err != nil {
258					return err
259				}
260				bjp.Name = &name
261			}
262		case "type":
263			if v != nil {
264				var typeVar TypeEnum
265				err = json.Unmarshal(*v, &typeVar)
266				if err != nil {
267					return err
268				}
269				bjp.Type = typeVar
270			}
271		case "properties":
272			if v != nil {
273				properties, err := unmarshalBasicCreateJobProperties(*v)
274				if err != nil {
275					return err
276				}
277				bjp.Properties = properties
278			}
279		}
280	}
281
282	return nil
283}
284
285// CreateJobParameters the parameters used to submit a new Data Lake Analytics job.
286type CreateJobParameters struct {
287	// Name - the friendly name of the job to submit.
288	Name *string `json:"name,omitempty"`
289	// DegreeOfParallelism - the degree of parallelism used for this job. At most one of degreeOfParallelism and degreeOfParallelismPercent should be specified. If none, a default value of 1 will be used.
290	DegreeOfParallelism *int32 `json:"degreeOfParallelism,omitempty"`
291	// DegreeOfParallelismPercent - the degree of parallelism in percentage used for this job. At most one of degreeOfParallelism and degreeOfParallelismPercent should be specified. If none, a default value of 1 will be used for degreeOfParallelism.
292	DegreeOfParallelismPercent *float64 `json:"degreeOfParallelismPercent,omitempty"`
293	// Priority - the priority value to use for the current job. Lower numbers have a higher priority. By default, a job has a priority of 1000. This must be greater than 0.
294	Priority *int32 `json:"priority,omitempty"`
295	// LogFilePatterns - the list of log file name patterns to find in the logFolder. '*' is the only matching character allowed. Example format: jobExecution*.log or *mylog*.txt
296	LogFilePatterns *[]string `json:"logFilePatterns,omitempty"`
297	// Related - the recurring job relationship information properties.
298	Related *RelationshipProperties `json:"related,omitempty"`
299	// Type - the job type of the current job (Hive or USql). Possible values include: 'USQL', 'Hive'
300	Type TypeEnum `json:"type,omitempty"`
301	// Properties - the job specific properties.
302	Properties BasicCreateJobProperties `json:"properties,omitempty"`
303}
304
305// UnmarshalJSON is the custom unmarshaler for CreateJobParameters struct.
306func (cjp *CreateJobParameters) UnmarshalJSON(body []byte) error {
307	var m map[string]*json.RawMessage
308	err := json.Unmarshal(body, &m)
309	if err != nil {
310		return err
311	}
312	for k, v := range m {
313		switch k {
314		case "name":
315			if v != nil {
316				var name string
317				err = json.Unmarshal(*v, &name)
318				if err != nil {
319					return err
320				}
321				cjp.Name = &name
322			}
323		case "degreeOfParallelism":
324			if v != nil {
325				var degreeOfParallelism int32
326				err = json.Unmarshal(*v, &degreeOfParallelism)
327				if err != nil {
328					return err
329				}
330				cjp.DegreeOfParallelism = &degreeOfParallelism
331			}
332		case "degreeOfParallelismPercent":
333			if v != nil {
334				var degreeOfParallelismPercent float64
335				err = json.Unmarshal(*v, &degreeOfParallelismPercent)
336				if err != nil {
337					return err
338				}
339				cjp.DegreeOfParallelismPercent = &degreeOfParallelismPercent
340			}
341		case "priority":
342			if v != nil {
343				var priority int32
344				err = json.Unmarshal(*v, &priority)
345				if err != nil {
346					return err
347				}
348				cjp.Priority = &priority
349			}
350		case "logFilePatterns":
351			if v != nil {
352				var logFilePatterns []string
353				err = json.Unmarshal(*v, &logFilePatterns)
354				if err != nil {
355					return err
356				}
357				cjp.LogFilePatterns = &logFilePatterns
358			}
359		case "related":
360			if v != nil {
361				var related RelationshipProperties
362				err = json.Unmarshal(*v, &related)
363				if err != nil {
364					return err
365				}
366				cjp.Related = &related
367			}
368		case "type":
369			if v != nil {
370				var typeVar TypeEnum
371				err = json.Unmarshal(*v, &typeVar)
372				if err != nil {
373					return err
374				}
375				cjp.Type = typeVar
376			}
377		case "properties":
378			if v != nil {
379				properties, err := unmarshalBasicCreateJobProperties(*v)
380				if err != nil {
381					return err
382				}
383				cjp.Properties = properties
384			}
385		}
386	}
387
388	return nil
389}
390
391// BasicCreateJobProperties the common Data Lake Analytics job properties for job submission.
392type BasicCreateJobProperties interface {
393	AsCreateUSQLJobProperties() (*CreateUSQLJobProperties, bool)
394	AsCreateJobProperties() (*CreateJobProperties, bool)
395}
396
397// CreateJobProperties the common Data Lake Analytics job properties for job submission.
398type CreateJobProperties struct {
399	// RuntimeVersion - the runtime version of the Data Lake Analytics engine to use for the specific type of job being run.
400	RuntimeVersion *string `json:"runtimeVersion,omitempty"`
401	// Script - the script to run. Please note that the maximum script size is 3 MB.
402	Script *string `json:"script,omitempty"`
403	// Type - Possible values include: 'TypeBasicCreateJobPropertiesTypeCreateJobProperties', 'TypeBasicCreateJobPropertiesTypeUSQL'
404	Type TypeBasicCreateJobProperties `json:"type,omitempty"`
405}
406
407func unmarshalBasicCreateJobProperties(body []byte) (BasicCreateJobProperties, error) {
408	var m map[string]interface{}
409	err := json.Unmarshal(body, &m)
410	if err != nil {
411		return nil, err
412	}
413
414	switch m["type"] {
415	case string(TypeBasicCreateJobPropertiesTypeUSQL):
416		var cusjp CreateUSQLJobProperties
417		err := json.Unmarshal(body, &cusjp)
418		return cusjp, err
419	default:
420		var cjp CreateJobProperties
421		err := json.Unmarshal(body, &cjp)
422		return cjp, err
423	}
424}
425func unmarshalBasicCreateJobPropertiesArray(body []byte) ([]BasicCreateJobProperties, error) {
426	var rawMessages []*json.RawMessage
427	err := json.Unmarshal(body, &rawMessages)
428	if err != nil {
429		return nil, err
430	}
431
432	cjpArray := make([]BasicCreateJobProperties, len(rawMessages))
433
434	for index, rawMessage := range rawMessages {
435		cjp, err := unmarshalBasicCreateJobProperties(*rawMessage)
436		if err != nil {
437			return nil, err
438		}
439		cjpArray[index] = cjp
440	}
441	return cjpArray, nil
442}
443
444// MarshalJSON is the custom marshaler for CreateJobProperties.
445func (cjp CreateJobProperties) MarshalJSON() ([]byte, error) {
446	cjp.Type = TypeBasicCreateJobPropertiesTypeCreateJobProperties
447	objectMap := make(map[string]interface{})
448	if cjp.RuntimeVersion != nil {
449		objectMap["runtimeVersion"] = cjp.RuntimeVersion
450	}
451	if cjp.Script != nil {
452		objectMap["script"] = cjp.Script
453	}
454	if cjp.Type != "" {
455		objectMap["type"] = cjp.Type
456	}
457	return json.Marshal(objectMap)
458}
459
460// AsCreateUSQLJobProperties is the BasicCreateJobProperties implementation for CreateJobProperties.
461func (cjp CreateJobProperties) AsCreateUSQLJobProperties() (*CreateUSQLJobProperties, bool) {
462	return nil, false
463}
464
465// AsCreateJobProperties is the BasicCreateJobProperties implementation for CreateJobProperties.
466func (cjp CreateJobProperties) AsCreateJobProperties() (*CreateJobProperties, bool) {
467	return &cjp, true
468}
469
470// AsBasicCreateJobProperties is the BasicCreateJobProperties implementation for CreateJobProperties.
471func (cjp CreateJobProperties) AsBasicCreateJobProperties() (BasicCreateJobProperties, bool) {
472	return &cjp, true
473}
474
475// CreateUSQLJobProperties u-SQL job properties used when submitting U-SQL jobs.
476type CreateUSQLJobProperties struct {
477	// CompileMode - the specific compilation mode for the job used during execution. If this is not specified during submission, the server will determine the optimal compilation mode. Possible values include: 'Semantic', 'Full', 'SingleBox'
478	CompileMode CompileMode `json:"compileMode,omitempty"`
479	// RuntimeVersion - the runtime version of the Data Lake Analytics engine to use for the specific type of job being run.
480	RuntimeVersion *string `json:"runtimeVersion,omitempty"`
481	// Script - the script to run. Please note that the maximum script size is 3 MB.
482	Script *string `json:"script,omitempty"`
483	// Type - Possible values include: 'TypeBasicCreateJobPropertiesTypeCreateJobProperties', 'TypeBasicCreateJobPropertiesTypeUSQL'
484	Type TypeBasicCreateJobProperties `json:"type,omitempty"`
485}
486
487// MarshalJSON is the custom marshaler for CreateUSQLJobProperties.
488func (cusjp CreateUSQLJobProperties) MarshalJSON() ([]byte, error) {
489	cusjp.Type = TypeBasicCreateJobPropertiesTypeUSQL
490	objectMap := make(map[string]interface{})
491	if cusjp.CompileMode != "" {
492		objectMap["compileMode"] = cusjp.CompileMode
493	}
494	if cusjp.RuntimeVersion != nil {
495		objectMap["runtimeVersion"] = cusjp.RuntimeVersion
496	}
497	if cusjp.Script != nil {
498		objectMap["script"] = cusjp.Script
499	}
500	if cusjp.Type != "" {
501		objectMap["type"] = cusjp.Type
502	}
503	return json.Marshal(objectMap)
504}
505
506// AsCreateUSQLJobProperties is the BasicCreateJobProperties implementation for CreateUSQLJobProperties.
507func (cusjp CreateUSQLJobProperties) AsCreateUSQLJobProperties() (*CreateUSQLJobProperties, bool) {
508	return &cusjp, true
509}
510
511// AsCreateJobProperties is the BasicCreateJobProperties implementation for CreateUSQLJobProperties.
512func (cusjp CreateUSQLJobProperties) AsCreateJobProperties() (*CreateJobProperties, bool) {
513	return nil, false
514}
515
516// AsBasicCreateJobProperties is the BasicCreateJobProperties implementation for CreateUSQLJobProperties.
517func (cusjp CreateUSQLJobProperties) AsBasicCreateJobProperties() (BasicCreateJobProperties, bool) {
518	return &cusjp, true
519}
520
521// DataPath a Data Lake Analytics job data path item.
522type DataPath struct {
523	autorest.Response `json:"-"`
524	// JobID - READ-ONLY; the id of the job this data is for.
525	JobID *uuid.UUID `json:"jobId,omitempty"`
526	// Command - READ-ONLY; the command that this job data relates to.
527	Command *string `json:"command,omitempty"`
528	// Paths - READ-ONLY; the list of paths to all of the job data.
529	Paths *[]string `json:"paths,omitempty"`
530}
531
532// Diagnostics error diagnostic information for failed jobs.
533type Diagnostics struct {
534	// ColumnNumber - READ-ONLY; the column where the error occurred.
535	ColumnNumber *int32 `json:"columnNumber,omitempty"`
536	// End - READ-ONLY; the ending index of the error.
537	End *int32 `json:"end,omitempty"`
538	// LineNumber - READ-ONLY; the line number the error occurred on.
539	LineNumber *int32 `json:"lineNumber,omitempty"`
540	// Message - READ-ONLY; the error message.
541	Message *string `json:"message,omitempty"`
542	// Severity - READ-ONLY; the severity of the error. Possible values include: 'Warning', 'Error', 'Info', 'SevereWarning', 'Deprecated', 'UserWarning'
543	Severity SeverityTypes `json:"severity,omitempty"`
544	// Start - READ-ONLY; the starting index of the error.
545	Start *int32 `json:"start,omitempty"`
546}
547
548// ErrorDetails the Data Lake Analytics job error details.
549type ErrorDetails struct {
550	// Description - READ-ONLY; the error message description
551	Description *string `json:"description,omitempty"`
552	// Details - READ-ONLY; the details of the error message.
553	Details *string `json:"details,omitempty"`
554	// EndOffset - READ-ONLY; the end offset in the job where the error was found.
555	EndOffset *int32 `json:"endOffset,omitempty"`
556	// ErrorID - READ-ONLY; the specific identifier for the type of error encountered in the job.
557	ErrorID *string `json:"errorId,omitempty"`
558	// FilePath - READ-ONLY; the path to any supplemental error files, if any.
559	FilePath *string `json:"filePath,omitempty"`
560	// HelpLink - READ-ONLY; the link to MSDN or Azure help for this type of error, if any.
561	HelpLink *string `json:"helpLink,omitempty"`
562	// InternalDiagnostics - READ-ONLY; the internal diagnostic stack trace if the user requesting the job error details has sufficient permissions it will be retrieved, otherwise it will be empty.
563	InternalDiagnostics *string `json:"internalDiagnostics,omitempty"`
564	// LineNumber - READ-ONLY; the specific line number in the job where the error occurred.
565	LineNumber *int32 `json:"lineNumber,omitempty"`
566	// Message - READ-ONLY; the user friendly error message for the failure.
567	Message *string `json:"message,omitempty"`
568	// Resolution - READ-ONLY; the recommended resolution for the failure, if any.
569	Resolution *string `json:"resolution,omitempty"`
570	// InnerError - READ-ONLY; the inner error of this specific job error message, if any.
571	InnerError *InnerError `json:"innerError,omitempty"`
572	// Severity - READ-ONLY; the severity level of the failure. Possible values include: 'Warning', 'Error', 'Info', 'SevereWarning', 'Deprecated', 'UserWarning'
573	Severity SeverityTypes `json:"severity,omitempty"`
574	// Source - READ-ONLY; the ultimate source of the failure (usually either SYSTEM or USER).
575	Source *string `json:"source,omitempty"`
576	// StartOffset - READ-ONLY; the start offset in the job where the error was found
577	StartOffset *int32 `json:"startOffset,omitempty"`
578}
579
580// HiveJobProperties hive job properties used when retrieving Hive jobs.
581type HiveJobProperties struct {
582	// LogsLocation - READ-ONLY; the Hive logs location
583	LogsLocation *string `json:"logsLocation,omitempty"`
584	// OutputLocation - READ-ONLY; the location of Hive job output files (both execution output and results)
585	OutputLocation *string `json:"outputLocation,omitempty"`
586	// StatementCount - READ-ONLY; the number of statements that will be run based on the script
587	StatementCount *int32 `json:"statementCount,omitempty"`
588	// ExecutedStatementCount - READ-ONLY; the number of statements that have been run based on the script
589	ExecutedStatementCount *int32 `json:"executedStatementCount,omitempty"`
590	// RuntimeVersion - READ-ONLY; the runtime version of the Data Lake Analytics engine to use for the specific type of job being run.
591	RuntimeVersion *string `json:"runtimeVersion,omitempty"`
592	// Script - the script to run. Please note that the maximum script size is 3 MB.
593	Script *string `json:"script,omitempty"`
594	// Type - Possible values include: 'TypeJobProperties', 'TypeUSQL', 'TypeHive'
595	Type Type `json:"type,omitempty"`
596}
597
598// MarshalJSON is the custom marshaler for HiveJobProperties.
599func (hjp HiveJobProperties) MarshalJSON() ([]byte, error) {
600	hjp.Type = TypeHive
601	objectMap := make(map[string]interface{})
602	if hjp.Script != nil {
603		objectMap["script"] = hjp.Script
604	}
605	if hjp.Type != "" {
606		objectMap["type"] = hjp.Type
607	}
608	return json.Marshal(objectMap)
609}
610
611// AsUSQLJobProperties is the BasicProperties implementation for HiveJobProperties.
612func (hjp HiveJobProperties) AsUSQLJobProperties() (*USQLJobProperties, bool) {
613	return nil, false
614}
615
616// AsHiveJobProperties is the BasicProperties implementation for HiveJobProperties.
617func (hjp HiveJobProperties) AsHiveJobProperties() (*HiveJobProperties, bool) {
618	return &hjp, true
619}
620
621// AsProperties is the BasicProperties implementation for HiveJobProperties.
622func (hjp HiveJobProperties) AsProperties() (*Properties, bool) {
623	return nil, false
624}
625
626// AsBasicProperties is the BasicProperties implementation for HiveJobProperties.
627func (hjp HiveJobProperties) AsBasicProperties() (BasicProperties, bool) {
628	return &hjp, true
629}
630
631// InfoListResult list of JobInfo items.
632type InfoListResult struct {
633	autorest.Response `json:"-"`
634	// Value - READ-ONLY; the list of JobInfo items.
635	Value *[]InformationBasic `json:"value,omitempty"`
636	// NextLink - READ-ONLY; the link (url) to the next page of results.
637	NextLink *string `json:"nextLink,omitempty"`
638}
639
640// InfoListResultIterator provides access to a complete listing of InformationBasic values.
641type InfoListResultIterator struct {
642	i    int
643	page InfoListResultPage
644}
645
646// NextWithContext advances to the next value.  If there was an error making
647// the request the iterator does not advance and the error is returned.
648func (iter *InfoListResultIterator) NextWithContext(ctx context.Context) (err error) {
649	if tracing.IsEnabled() {
650		ctx = tracing.StartSpan(ctx, fqdn+"/InfoListResultIterator.NextWithContext")
651		defer func() {
652			sc := -1
653			if iter.Response().Response.Response != nil {
654				sc = iter.Response().Response.Response.StatusCode
655			}
656			tracing.EndSpan(ctx, sc, err)
657		}()
658	}
659	iter.i++
660	if iter.i < len(iter.page.Values()) {
661		return nil
662	}
663	err = iter.page.NextWithContext(ctx)
664	if err != nil {
665		iter.i--
666		return err
667	}
668	iter.i = 0
669	return nil
670}
671
672// Next advances to the next value.  If there was an error making
673// the request the iterator does not advance and the error is returned.
674// Deprecated: Use NextWithContext() instead.
675func (iter *InfoListResultIterator) Next() error {
676	return iter.NextWithContext(context.Background())
677}
678
679// NotDone returns true if the enumeration should be started or is not yet complete.
680func (iter InfoListResultIterator) NotDone() bool {
681	return iter.page.NotDone() && iter.i < len(iter.page.Values())
682}
683
684// Response returns the raw server response from the last page request.
685func (iter InfoListResultIterator) Response() InfoListResult {
686	return iter.page.Response()
687}
688
689// Value returns the current value or a zero-initialized value if the
690// iterator has advanced beyond the end of the collection.
691func (iter InfoListResultIterator) Value() InformationBasic {
692	if !iter.page.NotDone() {
693		return InformationBasic{}
694	}
695	return iter.page.Values()[iter.i]
696}
697
698// Creates a new instance of the InfoListResultIterator type.
699func NewInfoListResultIterator(page InfoListResultPage) InfoListResultIterator {
700	return InfoListResultIterator{page: page}
701}
702
703// IsEmpty returns true if the ListResult contains no values.
704func (ilr InfoListResult) IsEmpty() bool {
705	return ilr.Value == nil || len(*ilr.Value) == 0
706}
707
708// infoListResultPreparer prepares a request to retrieve the next set of results.
709// It returns nil if no more results exist.
710func (ilr InfoListResult) infoListResultPreparer(ctx context.Context) (*http.Request, error) {
711	if ilr.NextLink == nil || len(to.String(ilr.NextLink)) < 1 {
712		return nil, nil
713	}
714	return autorest.Prepare((&http.Request{}).WithContext(ctx),
715		autorest.AsJSON(),
716		autorest.AsGet(),
717		autorest.WithBaseURL(to.String(ilr.NextLink)))
718}
719
720// InfoListResultPage contains a page of InformationBasic values.
721type InfoListResultPage struct {
722	fn  func(context.Context, InfoListResult) (InfoListResult, error)
723	ilr InfoListResult
724}
725
726// NextWithContext advances to the next page of values.  If there was an error making
727// the request the page does not advance and the error is returned.
728func (page *InfoListResultPage) NextWithContext(ctx context.Context) (err error) {
729	if tracing.IsEnabled() {
730		ctx = tracing.StartSpan(ctx, fqdn+"/InfoListResultPage.NextWithContext")
731		defer func() {
732			sc := -1
733			if page.Response().Response.Response != nil {
734				sc = page.Response().Response.Response.StatusCode
735			}
736			tracing.EndSpan(ctx, sc, err)
737		}()
738	}
739	next, err := page.fn(ctx, page.ilr)
740	if err != nil {
741		return err
742	}
743	page.ilr = next
744	return nil
745}
746
747// Next advances to the next page of values.  If there was an error making
748// the request the page does not advance and the error is returned.
749// Deprecated: Use NextWithContext() instead.
750func (page *InfoListResultPage) Next() error {
751	return page.NextWithContext(context.Background())
752}
753
754// NotDone returns true if the page enumeration should be started or is not yet complete.
755func (page InfoListResultPage) NotDone() bool {
756	return !page.ilr.IsEmpty()
757}
758
759// Response returns the raw server response from the last page request.
760func (page InfoListResultPage) Response() InfoListResult {
761	return page.ilr
762}
763
764// Values returns the slice of values for the current page or nil if there are no values.
765func (page InfoListResultPage) Values() []InformationBasic {
766	if page.ilr.IsEmpty() {
767		return nil
768	}
769	return *page.ilr.Value
770}
771
772// Creates a new instance of the InfoListResultPage type.
773func NewInfoListResultPage(getNextPage func(context.Context, InfoListResult) (InfoListResult, error)) InfoListResultPage {
774	return InfoListResultPage{fn: getNextPage}
775}
776
777// Information the extended Data Lake Analytics job information properties returned when retrieving a
778// specific job.
779type Information struct {
780	autorest.Response `json:"-"`
781	// ErrorMessage - READ-ONLY; the error message details for the job, if the job failed.
782	ErrorMessage *[]ErrorDetails `json:"errorMessage,omitempty"`
783	// StateAuditRecords - READ-ONLY; the job state audit records, indicating when various operations have been performed on this job.
784	StateAuditRecords *[]StateAuditRecord `json:"stateAuditRecords,omitempty"`
785	// Properties - the job specific properties.
786	Properties BasicProperties `json:"properties,omitempty"`
787	// JobID - READ-ONLY; the job's unique identifier (a GUID).
788	JobID *uuid.UUID `json:"jobId,omitempty"`
789	// Name - the friendly name of the job.
790	Name *string `json:"name,omitempty"`
791	// Type - the job type of the current job (Hive or USql). Possible values include: 'USQL', 'Hive'
792	Type TypeEnum `json:"type,omitempty"`
793	// Submitter - READ-ONLY; the user or account that submitted the job.
794	Submitter *string `json:"submitter,omitempty"`
795	// DegreeOfParallelism - READ-ONLY; the degree of parallelism used for this job.
796	DegreeOfParallelism *int32 `json:"degreeOfParallelism,omitempty"`
797	// DegreeOfParallelismPercent - READ-ONLY; the degree of parallelism in percentage used for this job.
798	DegreeOfParallelismPercent *float64 `json:"degreeOfParallelismPercent,omitempty"`
799	// Priority - READ-ONLY; the priority value for the current job. Lower numbers have a higher priority. By default, a job has a priority of 1000. This must be greater than 0.
800	Priority *int32 `json:"priority,omitempty"`
801	// SubmitTime - READ-ONLY; the time the job was submitted to the service.
802	SubmitTime *date.Time `json:"submitTime,omitempty"`
803	// StartTime - READ-ONLY; the start time of the job.
804	StartTime *date.Time `json:"startTime,omitempty"`
805	// EndTime - READ-ONLY; the completion time of the job.
806	EndTime *date.Time `json:"endTime,omitempty"`
807	// State - READ-ONLY; the job state. When the job is in the Ended state, refer to Result and ErrorMessage for details. Possible values include: 'StateAccepted', 'StateCompiling', 'StateEnded', 'StateNew', 'StateQueued', 'StateRunning', 'StateScheduling', 'StateStarting', 'StatePaused', 'StateWaitingForCapacity'
808	State State `json:"state,omitempty"`
809	// Result - READ-ONLY; the result of job execution or the current result of the running job. Possible values include: 'None', 'Succeeded', 'Cancelled', 'Failed'
810	Result Result `json:"result,omitempty"`
811	// LogFolder - READ-ONLY; the log folder path to use in the following format: adl://<accountName>.azuredatalakestore.net/system/jobservice/jobs/Usql/2016/03/13/17/18/5fe51957-93bc-4de0-8ddc-c5a4753b068b/logs/.
812	LogFolder *string `json:"logFolder,omitempty"`
813	// LogFilePatterns - READ-ONLY; the list of log file name patterns to find in the logFolder. '*' is the only matching character allowed. Example format: jobExecution*.log or *mylog*.txt
814	LogFilePatterns *[]string `json:"logFilePatterns,omitempty"`
815	// Related - the recurring job relationship information properties.
816	Related *RelationshipProperties `json:"related,omitempty"`
817	// HierarchyQueueNode - READ-ONLY; the name of hierarchy queue node this job is assigned to, null if job has not been assigned yet or the account doesn't have hierarchy queue.
818	HierarchyQueueNode *string `json:"hierarchyQueueNode,omitempty"`
819}
820
821// UnmarshalJSON is the custom unmarshaler for Information struct.
822func (i *Information) UnmarshalJSON(body []byte) error {
823	var m map[string]*json.RawMessage
824	err := json.Unmarshal(body, &m)
825	if err != nil {
826		return err
827	}
828	for k, v := range m {
829		switch k {
830		case "errorMessage":
831			if v != nil {
832				var errorMessage []ErrorDetails
833				err = json.Unmarshal(*v, &errorMessage)
834				if err != nil {
835					return err
836				}
837				i.ErrorMessage = &errorMessage
838			}
839		case "stateAuditRecords":
840			if v != nil {
841				var stateAuditRecords []StateAuditRecord
842				err = json.Unmarshal(*v, &stateAuditRecords)
843				if err != nil {
844					return err
845				}
846				i.StateAuditRecords = &stateAuditRecords
847			}
848		case "properties":
849			if v != nil {
850				properties, err := unmarshalBasicProperties(*v)
851				if err != nil {
852					return err
853				}
854				i.Properties = properties
855			}
856		case "jobId":
857			if v != nil {
858				var jobID uuid.UUID
859				err = json.Unmarshal(*v, &jobID)
860				if err != nil {
861					return err
862				}
863				i.JobID = &jobID
864			}
865		case "name":
866			if v != nil {
867				var name string
868				err = json.Unmarshal(*v, &name)
869				if err != nil {
870					return err
871				}
872				i.Name = &name
873			}
874		case "type":
875			if v != nil {
876				var typeVar TypeEnum
877				err = json.Unmarshal(*v, &typeVar)
878				if err != nil {
879					return err
880				}
881				i.Type = typeVar
882			}
883		case "submitter":
884			if v != nil {
885				var submitter string
886				err = json.Unmarshal(*v, &submitter)
887				if err != nil {
888					return err
889				}
890				i.Submitter = &submitter
891			}
892		case "degreeOfParallelism":
893			if v != nil {
894				var degreeOfParallelism int32
895				err = json.Unmarshal(*v, &degreeOfParallelism)
896				if err != nil {
897					return err
898				}
899				i.DegreeOfParallelism = &degreeOfParallelism
900			}
901		case "degreeOfParallelismPercent":
902			if v != nil {
903				var degreeOfParallelismPercent float64
904				err = json.Unmarshal(*v, &degreeOfParallelismPercent)
905				if err != nil {
906					return err
907				}
908				i.DegreeOfParallelismPercent = &degreeOfParallelismPercent
909			}
910		case "priority":
911			if v != nil {
912				var priority int32
913				err = json.Unmarshal(*v, &priority)
914				if err != nil {
915					return err
916				}
917				i.Priority = &priority
918			}
919		case "submitTime":
920			if v != nil {
921				var submitTime date.Time
922				err = json.Unmarshal(*v, &submitTime)
923				if err != nil {
924					return err
925				}
926				i.SubmitTime = &submitTime
927			}
928		case "startTime":
929			if v != nil {
930				var startTime date.Time
931				err = json.Unmarshal(*v, &startTime)
932				if err != nil {
933					return err
934				}
935				i.StartTime = &startTime
936			}
937		case "endTime":
938			if v != nil {
939				var endTime date.Time
940				err = json.Unmarshal(*v, &endTime)
941				if err != nil {
942					return err
943				}
944				i.EndTime = &endTime
945			}
946		case "state":
947			if v != nil {
948				var state State
949				err = json.Unmarshal(*v, &state)
950				if err != nil {
951					return err
952				}
953				i.State = state
954			}
955		case "result":
956			if v != nil {
957				var resultVar Result
958				err = json.Unmarshal(*v, &resultVar)
959				if err != nil {
960					return err
961				}
962				i.Result = resultVar
963			}
964		case "logFolder":
965			if v != nil {
966				var logFolder string
967				err = json.Unmarshal(*v, &logFolder)
968				if err != nil {
969					return err
970				}
971				i.LogFolder = &logFolder
972			}
973		case "logFilePatterns":
974			if v != nil {
975				var logFilePatterns []string
976				err = json.Unmarshal(*v, &logFilePatterns)
977				if err != nil {
978					return err
979				}
980				i.LogFilePatterns = &logFilePatterns
981			}
982		case "related":
983			if v != nil {
984				var related RelationshipProperties
985				err = json.Unmarshal(*v, &related)
986				if err != nil {
987					return err
988				}
989				i.Related = &related
990			}
991		case "hierarchyQueueNode":
992			if v != nil {
993				var hierarchyQueueNode string
994				err = json.Unmarshal(*v, &hierarchyQueueNode)
995				if err != nil {
996					return err
997				}
998				i.HierarchyQueueNode = &hierarchyQueueNode
999			}
1000		}
1001	}
1002
1003	return nil
1004}
1005
1006// InformationBasic the common Data Lake Analytics job information properties.
1007type InformationBasic struct {
1008	// JobID - READ-ONLY; the job's unique identifier (a GUID).
1009	JobID *uuid.UUID `json:"jobId,omitempty"`
1010	// Name - the friendly name of the job.
1011	Name *string `json:"name,omitempty"`
1012	// Type - the job type of the current job (Hive or USql). Possible values include: 'USQL', 'Hive'
1013	Type TypeEnum `json:"type,omitempty"`
1014	// Submitter - READ-ONLY; the user or account that submitted the job.
1015	Submitter *string `json:"submitter,omitempty"`
1016	// DegreeOfParallelism - READ-ONLY; the degree of parallelism used for this job.
1017	DegreeOfParallelism *int32 `json:"degreeOfParallelism,omitempty"`
1018	// DegreeOfParallelismPercent - READ-ONLY; the degree of parallelism in percentage used for this job.
1019	DegreeOfParallelismPercent *float64 `json:"degreeOfParallelismPercent,omitempty"`
1020	// Priority - READ-ONLY; the priority value for the current job. Lower numbers have a higher priority. By default, a job has a priority of 1000. This must be greater than 0.
1021	Priority *int32 `json:"priority,omitempty"`
1022	// SubmitTime - READ-ONLY; the time the job was submitted to the service.
1023	SubmitTime *date.Time `json:"submitTime,omitempty"`
1024	// StartTime - READ-ONLY; the start time of the job.
1025	StartTime *date.Time `json:"startTime,omitempty"`
1026	// EndTime - READ-ONLY; the completion time of the job.
1027	EndTime *date.Time `json:"endTime,omitempty"`
1028	// State - READ-ONLY; the job state. When the job is in the Ended state, refer to Result and ErrorMessage for details. Possible values include: 'StateAccepted', 'StateCompiling', 'StateEnded', 'StateNew', 'StateQueued', 'StateRunning', 'StateScheduling', 'StateStarting', 'StatePaused', 'StateWaitingForCapacity'
1029	State State `json:"state,omitempty"`
1030	// Result - READ-ONLY; the result of job execution or the current result of the running job. Possible values include: 'None', 'Succeeded', 'Cancelled', 'Failed'
1031	Result Result `json:"result,omitempty"`
1032	// LogFolder - READ-ONLY; the log folder path to use in the following format: adl://<accountName>.azuredatalakestore.net/system/jobservice/jobs/Usql/2016/03/13/17/18/5fe51957-93bc-4de0-8ddc-c5a4753b068b/logs/.
1033	LogFolder *string `json:"logFolder,omitempty"`
1034	// LogFilePatterns - READ-ONLY; the list of log file name patterns to find in the logFolder. '*' is the only matching character allowed. Example format: jobExecution*.log or *mylog*.txt
1035	LogFilePatterns *[]string `json:"logFilePatterns,omitempty"`
1036	// Related - the recurring job relationship information properties.
1037	Related *RelationshipProperties `json:"related,omitempty"`
1038	// HierarchyQueueNode - READ-ONLY; the name of hierarchy queue node this job is assigned to, null if job has not been assigned yet or the account doesn't have hierarchy queue.
1039	HierarchyQueueNode *string `json:"hierarchyQueueNode,omitempty"`
1040}
1041
1042// InnerError the Data Lake Analytics job error details.
1043type InnerError struct {
1044	// DiagnosticCode - READ-ONLY; the diagnostic error code.
1045	DiagnosticCode *int32 `json:"diagnosticCode,omitempty"`
1046	// Severity - READ-ONLY; the severity level of the failure. Possible values include: 'Warning', 'Error', 'Info', 'SevereWarning', 'Deprecated', 'UserWarning'
1047	Severity SeverityTypes `json:"severity,omitempty"`
1048	// Details - READ-ONLY; the details of the error message.
1049	Details *string `json:"details,omitempty"`
1050	// Component - READ-ONLY; the component that failed.
1051	Component *string `json:"component,omitempty"`
1052	// ErrorID - READ-ONLY; the specific identifier for the type of error encountered in the job.
1053	ErrorID *string `json:"errorId,omitempty"`
1054	// HelpLink - READ-ONLY; the link to MSDN or Azure help for this type of error, if any.
1055	HelpLink *string `json:"helpLink,omitempty"`
1056	// InternalDiagnostics - READ-ONLY; the internal diagnostic stack trace if the user requesting the job error details has sufficient permissions it will be retrieved, otherwise it will be empty.
1057	InternalDiagnostics *string `json:"internalDiagnostics,omitempty"`
1058	// Message - READ-ONLY; the user friendly error message for the failure.
1059	Message *string `json:"message,omitempty"`
1060	// Resolution - READ-ONLY; the recommended resolution for the failure, if any.
1061	Resolution *string `json:"resolution,omitempty"`
1062	// Source - READ-ONLY; the ultimate source of the failure (usually either SYSTEM or USER).
1063	Source *string `json:"source,omitempty"`
1064	// Description - READ-ONLY; the error message description
1065	Description *string `json:"description,omitempty"`
1066	// InnerError - READ-ONLY; the inner error of this specific job error message, if any.
1067	InnerError *InnerError `json:"innerError,omitempty"`
1068}
1069
1070// PipelineInformation job Pipeline Information, showing the relationship of jobs and recurrences of those
1071// jobs in a pipeline.
1072type PipelineInformation struct {
1073	autorest.Response `json:"-"`
1074	// PipelineID - READ-ONLY; the job relationship pipeline identifier (a GUID).
1075	PipelineID *uuid.UUID `json:"pipelineId,omitempty"`
1076	// PipelineName - READ-ONLY; the friendly name of the job relationship pipeline, which does not need to be unique.
1077	PipelineName *string `json:"pipelineName,omitempty"`
1078	// PipelineURI - READ-ONLY; the pipeline uri, unique, links to the originating service for this pipeline.
1079	PipelineURI *string `json:"pipelineUri,omitempty"`
1080	// NumJobsFailed - READ-ONLY; the number of jobs in this pipeline that have failed.
1081	NumJobsFailed *int32 `json:"numJobsFailed,omitempty"`
1082	// NumJobsCanceled - READ-ONLY; the number of jobs in this pipeline that have been canceled.
1083	NumJobsCanceled *int32 `json:"numJobsCanceled,omitempty"`
1084	// NumJobsSucceeded - READ-ONLY; the number of jobs in this pipeline that have succeeded.
1085	NumJobsSucceeded *int32 `json:"numJobsSucceeded,omitempty"`
1086	// AuHoursFailed - READ-ONLY; the number of job execution hours that resulted in failed jobs.
1087	AuHoursFailed *float64 `json:"auHoursFailed,omitempty"`
1088	// AuHoursCanceled - READ-ONLY; the number of job execution hours that resulted in canceled jobs.
1089	AuHoursCanceled *float64 `json:"auHoursCanceled,omitempty"`
1090	// AuHoursSucceeded - READ-ONLY; the number of job execution hours that resulted in successful jobs.
1091	AuHoursSucceeded *float64 `json:"auHoursSucceeded,omitempty"`
1092	// LastSubmitTime - READ-ONLY; the last time a job in this pipeline was submitted.
1093	LastSubmitTime *date.Time `json:"lastSubmitTime,omitempty"`
1094	// Runs - READ-ONLY; the list of run identifiers representing each run of this pipeline.
1095	Runs *[]PipelineRunInformation `json:"runs,omitempty"`
1096	// Recurrences - READ-ONLY; the list of recurrence identifiers representing each recurrence in this pipeline.
1097	Recurrences *[]uuid.UUID `json:"recurrences,omitempty"`
1098}
1099
1100// PipelineInformationListResult list of job pipeline information items.
1101type PipelineInformationListResult struct {
1102	autorest.Response `json:"-"`
1103	// Value - READ-ONLY; the list of job pipeline information items.
1104	Value *[]PipelineInformation `json:"value,omitempty"`
1105	// NextLink - READ-ONLY; the link (url) to the next page of results.
1106	NextLink *string `json:"nextLink,omitempty"`
1107}
1108
1109// PipelineInformationListResultIterator provides access to a complete listing of PipelineInformation
1110// values.
1111type PipelineInformationListResultIterator struct {
1112	i    int
1113	page PipelineInformationListResultPage
1114}
1115
1116// NextWithContext advances to the next value.  If there was an error making
1117// the request the iterator does not advance and the error is returned.
1118func (iter *PipelineInformationListResultIterator) NextWithContext(ctx context.Context) (err error) {
1119	if tracing.IsEnabled() {
1120		ctx = tracing.StartSpan(ctx, fqdn+"/PipelineInformationListResultIterator.NextWithContext")
1121		defer func() {
1122			sc := -1
1123			if iter.Response().Response.Response != nil {
1124				sc = iter.Response().Response.Response.StatusCode
1125			}
1126			tracing.EndSpan(ctx, sc, err)
1127		}()
1128	}
1129	iter.i++
1130	if iter.i < len(iter.page.Values()) {
1131		return nil
1132	}
1133	err = iter.page.NextWithContext(ctx)
1134	if err != nil {
1135		iter.i--
1136		return err
1137	}
1138	iter.i = 0
1139	return nil
1140}
1141
1142// Next advances to the next value.  If there was an error making
1143// the request the iterator does not advance and the error is returned.
1144// Deprecated: Use NextWithContext() instead.
1145func (iter *PipelineInformationListResultIterator) Next() error {
1146	return iter.NextWithContext(context.Background())
1147}
1148
1149// NotDone returns true if the enumeration should be started or is not yet complete.
1150func (iter PipelineInformationListResultIterator) NotDone() bool {
1151	return iter.page.NotDone() && iter.i < len(iter.page.Values())
1152}
1153
1154// Response returns the raw server response from the last page request.
1155func (iter PipelineInformationListResultIterator) Response() PipelineInformationListResult {
1156	return iter.page.Response()
1157}
1158
1159// Value returns the current value or a zero-initialized value if the
1160// iterator has advanced beyond the end of the collection.
1161func (iter PipelineInformationListResultIterator) Value() PipelineInformation {
1162	if !iter.page.NotDone() {
1163		return PipelineInformation{}
1164	}
1165	return iter.page.Values()[iter.i]
1166}
1167
1168// Creates a new instance of the PipelineInformationListResultIterator type.
1169func NewPipelineInformationListResultIterator(page PipelineInformationListResultPage) PipelineInformationListResultIterator {
1170	return PipelineInformationListResultIterator{page: page}
1171}
1172
1173// IsEmpty returns true if the ListResult contains no values.
1174func (pilr PipelineInformationListResult) IsEmpty() bool {
1175	return pilr.Value == nil || len(*pilr.Value) == 0
1176}
1177
1178// pipelineInformationListResultPreparer prepares a request to retrieve the next set of results.
1179// It returns nil if no more results exist.
1180func (pilr PipelineInformationListResult) pipelineInformationListResultPreparer(ctx context.Context) (*http.Request, error) {
1181	if pilr.NextLink == nil || len(to.String(pilr.NextLink)) < 1 {
1182		return nil, nil
1183	}
1184	return autorest.Prepare((&http.Request{}).WithContext(ctx),
1185		autorest.AsJSON(),
1186		autorest.AsGet(),
1187		autorest.WithBaseURL(to.String(pilr.NextLink)))
1188}
1189
1190// PipelineInformationListResultPage contains a page of PipelineInformation values.
1191type PipelineInformationListResultPage struct {
1192	fn   func(context.Context, PipelineInformationListResult) (PipelineInformationListResult, error)
1193	pilr PipelineInformationListResult
1194}
1195
1196// NextWithContext advances to the next page of values.  If there was an error making
1197// the request the page does not advance and the error is returned.
1198func (page *PipelineInformationListResultPage) NextWithContext(ctx context.Context) (err error) {
1199	if tracing.IsEnabled() {
1200		ctx = tracing.StartSpan(ctx, fqdn+"/PipelineInformationListResultPage.NextWithContext")
1201		defer func() {
1202			sc := -1
1203			if page.Response().Response.Response != nil {
1204				sc = page.Response().Response.Response.StatusCode
1205			}
1206			tracing.EndSpan(ctx, sc, err)
1207		}()
1208	}
1209	next, err := page.fn(ctx, page.pilr)
1210	if err != nil {
1211		return err
1212	}
1213	page.pilr = next
1214	return nil
1215}
1216
1217// Next advances to the next page of values.  If there was an error making
1218// the request the page does not advance and the error is returned.
1219// Deprecated: Use NextWithContext() instead.
1220func (page *PipelineInformationListResultPage) Next() error {
1221	return page.NextWithContext(context.Background())
1222}
1223
1224// NotDone returns true if the page enumeration should be started or is not yet complete.
1225func (page PipelineInformationListResultPage) NotDone() bool {
1226	return !page.pilr.IsEmpty()
1227}
1228
1229// Response returns the raw server response from the last page request.
1230func (page PipelineInformationListResultPage) Response() PipelineInformationListResult {
1231	return page.pilr
1232}
1233
1234// Values returns the slice of values for the current page or nil if there are no values.
1235func (page PipelineInformationListResultPage) Values() []PipelineInformation {
1236	if page.pilr.IsEmpty() {
1237		return nil
1238	}
1239	return *page.pilr.Value
1240}
1241
1242// Creates a new instance of the PipelineInformationListResultPage type.
1243func NewPipelineInformationListResultPage(getNextPage func(context.Context, PipelineInformationListResult) (PipelineInformationListResult, error)) PipelineInformationListResultPage {
1244	return PipelineInformationListResultPage{fn: getNextPage}
1245}
1246
1247// PipelineRunInformation run info for a specific job pipeline.
1248type PipelineRunInformation struct {
1249	// RunID - READ-ONLY; the run identifier of an instance of pipeline executions (a GUID).
1250	RunID *uuid.UUID `json:"runId,omitempty"`
1251	// LastSubmitTime - READ-ONLY; the time this instance was last submitted.
1252	LastSubmitTime *date.Time `json:"lastSubmitTime,omitempty"`
1253}
1254
1255// BasicProperties the common Data Lake Analytics job properties.
1256type BasicProperties interface {
1257	AsUSQLJobProperties() (*USQLJobProperties, bool)
1258	AsHiveJobProperties() (*HiveJobProperties, bool)
1259	AsProperties() (*Properties, bool)
1260}
1261
1262// Properties the common Data Lake Analytics job properties.
1263type Properties struct {
1264	// RuntimeVersion - READ-ONLY; the runtime version of the Data Lake Analytics engine to use for the specific type of job being run.
1265	RuntimeVersion *string `json:"runtimeVersion,omitempty"`
1266	// Script - the script to run. Please note that the maximum script size is 3 MB.
1267	Script *string `json:"script,omitempty"`
1268	// Type - Possible values include: 'TypeJobProperties', 'TypeUSQL', 'TypeHive'
1269	Type Type `json:"type,omitempty"`
1270}
1271
1272func unmarshalBasicProperties(body []byte) (BasicProperties, error) {
1273	var m map[string]interface{}
1274	err := json.Unmarshal(body, &m)
1275	if err != nil {
1276		return nil, err
1277	}
1278
1279	switch m["type"] {
1280	case string(TypeUSQL):
1281		var usjp USQLJobProperties
1282		err := json.Unmarshal(body, &usjp)
1283		return usjp, err
1284	case string(TypeHive):
1285		var hjp HiveJobProperties
1286		err := json.Unmarshal(body, &hjp)
1287		return hjp, err
1288	default:
1289		var p Properties
1290		err := json.Unmarshal(body, &p)
1291		return p, err
1292	}
1293}
1294func unmarshalBasicPropertiesArray(body []byte) ([]BasicProperties, error) {
1295	var rawMessages []*json.RawMessage
1296	err := json.Unmarshal(body, &rawMessages)
1297	if err != nil {
1298		return nil, err
1299	}
1300
1301	pArray := make([]BasicProperties, len(rawMessages))
1302
1303	for index, rawMessage := range rawMessages {
1304		p, err := unmarshalBasicProperties(*rawMessage)
1305		if err != nil {
1306			return nil, err
1307		}
1308		pArray[index] = p
1309	}
1310	return pArray, nil
1311}
1312
1313// MarshalJSON is the custom marshaler for Properties.
1314func (p Properties) MarshalJSON() ([]byte, error) {
1315	p.Type = TypeJobProperties
1316	objectMap := make(map[string]interface{})
1317	if p.Script != nil {
1318		objectMap["script"] = p.Script
1319	}
1320	if p.Type != "" {
1321		objectMap["type"] = p.Type
1322	}
1323	return json.Marshal(objectMap)
1324}
1325
1326// AsUSQLJobProperties is the BasicProperties implementation for Properties.
1327func (p Properties) AsUSQLJobProperties() (*USQLJobProperties, bool) {
1328	return nil, false
1329}
1330
1331// AsHiveJobProperties is the BasicProperties implementation for Properties.
1332func (p Properties) AsHiveJobProperties() (*HiveJobProperties, bool) {
1333	return nil, false
1334}
1335
1336// AsProperties is the BasicProperties implementation for Properties.
1337func (p Properties) AsProperties() (*Properties, bool) {
1338	return &p, true
1339}
1340
1341// AsBasicProperties is the BasicProperties implementation for Properties.
1342func (p Properties) AsBasicProperties() (BasicProperties, bool) {
1343	return &p, true
1344}
1345
1346// RecurrenceInformation recurrence job information for a specific recurrence.
1347type RecurrenceInformation struct {
1348	autorest.Response `json:"-"`
1349	// RecurrenceID - READ-ONLY; the recurrence identifier (a GUID), unique per activity/script, regardless of iterations. This is something to link different occurrences of the same job together.
1350	RecurrenceID *uuid.UUID `json:"recurrenceId,omitempty"`
1351	// RecurrenceName - READ-ONLY; the recurrence name, user friendly name for the correlation between jobs.
1352	RecurrenceName *string `json:"recurrenceName,omitempty"`
1353	// NumJobsFailed - READ-ONLY; the number of jobs in this recurrence that have failed.
1354	NumJobsFailed *int32 `json:"numJobsFailed,omitempty"`
1355	// NumJobsCanceled - READ-ONLY; the number of jobs in this recurrence that have been canceled.
1356	NumJobsCanceled *int32 `json:"numJobsCanceled,omitempty"`
1357	// NumJobsSucceeded - READ-ONLY; the number of jobs in this recurrence that have succeeded.
1358	NumJobsSucceeded *int32 `json:"numJobsSucceeded,omitempty"`
1359	// AuHoursFailed - READ-ONLY; the number of job execution hours that resulted in failed jobs.
1360	AuHoursFailed *float64 `json:"auHoursFailed,omitempty"`
1361	// AuHoursCanceled - READ-ONLY; the number of job execution hours that resulted in canceled jobs.
1362	AuHoursCanceled *float64 `json:"auHoursCanceled,omitempty"`
1363	// AuHoursSucceeded - READ-ONLY; the number of job execution hours that resulted in successful jobs.
1364	AuHoursSucceeded *float64 `json:"auHoursSucceeded,omitempty"`
1365	// LastSubmitTime - READ-ONLY; the last time a job in this recurrence was submitted.
1366	LastSubmitTime *date.Time `json:"lastSubmitTime,omitempty"`
1367}
1368
1369// RecurrenceInformationListResult list of job recurrence information items.
1370type RecurrenceInformationListResult struct {
1371	autorest.Response `json:"-"`
1372	// Value - READ-ONLY; the list of job recurrence information items.
1373	Value *[]RecurrenceInformation `json:"value,omitempty"`
1374	// NextLink - READ-ONLY; the link (url) to the next page of results.
1375	NextLink *string `json:"nextLink,omitempty"`
1376}
1377
1378// RecurrenceInformationListResultIterator provides access to a complete listing of RecurrenceInformation
1379// values.
1380type RecurrenceInformationListResultIterator struct {
1381	i    int
1382	page RecurrenceInformationListResultPage
1383}
1384
1385// NextWithContext advances to the next value.  If there was an error making
1386// the request the iterator does not advance and the error is returned.
1387func (iter *RecurrenceInformationListResultIterator) NextWithContext(ctx context.Context) (err error) {
1388	if tracing.IsEnabled() {
1389		ctx = tracing.StartSpan(ctx, fqdn+"/RecurrenceInformationListResultIterator.NextWithContext")
1390		defer func() {
1391			sc := -1
1392			if iter.Response().Response.Response != nil {
1393				sc = iter.Response().Response.Response.StatusCode
1394			}
1395			tracing.EndSpan(ctx, sc, err)
1396		}()
1397	}
1398	iter.i++
1399	if iter.i < len(iter.page.Values()) {
1400		return nil
1401	}
1402	err = iter.page.NextWithContext(ctx)
1403	if err != nil {
1404		iter.i--
1405		return err
1406	}
1407	iter.i = 0
1408	return nil
1409}
1410
1411// Next advances to the next value.  If there was an error making
1412// the request the iterator does not advance and the error is returned.
1413// Deprecated: Use NextWithContext() instead.
1414func (iter *RecurrenceInformationListResultIterator) Next() error {
1415	return iter.NextWithContext(context.Background())
1416}
1417
1418// NotDone returns true if the enumeration should be started or is not yet complete.
1419func (iter RecurrenceInformationListResultIterator) NotDone() bool {
1420	return iter.page.NotDone() && iter.i < len(iter.page.Values())
1421}
1422
1423// Response returns the raw server response from the last page request.
1424func (iter RecurrenceInformationListResultIterator) Response() RecurrenceInformationListResult {
1425	return iter.page.Response()
1426}
1427
1428// Value returns the current value or a zero-initialized value if the
1429// iterator has advanced beyond the end of the collection.
1430func (iter RecurrenceInformationListResultIterator) Value() RecurrenceInformation {
1431	if !iter.page.NotDone() {
1432		return RecurrenceInformation{}
1433	}
1434	return iter.page.Values()[iter.i]
1435}
1436
1437// Creates a new instance of the RecurrenceInformationListResultIterator type.
1438func NewRecurrenceInformationListResultIterator(page RecurrenceInformationListResultPage) RecurrenceInformationListResultIterator {
1439	return RecurrenceInformationListResultIterator{page: page}
1440}
1441
1442// IsEmpty returns true if the ListResult contains no values.
1443func (rilr RecurrenceInformationListResult) IsEmpty() bool {
1444	return rilr.Value == nil || len(*rilr.Value) == 0
1445}
1446
1447// recurrenceInformationListResultPreparer prepares a request to retrieve the next set of results.
1448// It returns nil if no more results exist.
1449func (rilr RecurrenceInformationListResult) recurrenceInformationListResultPreparer(ctx context.Context) (*http.Request, error) {
1450	if rilr.NextLink == nil || len(to.String(rilr.NextLink)) < 1 {
1451		return nil, nil
1452	}
1453	return autorest.Prepare((&http.Request{}).WithContext(ctx),
1454		autorest.AsJSON(),
1455		autorest.AsGet(),
1456		autorest.WithBaseURL(to.String(rilr.NextLink)))
1457}
1458
1459// RecurrenceInformationListResultPage contains a page of RecurrenceInformation values.
1460type RecurrenceInformationListResultPage struct {
1461	fn   func(context.Context, RecurrenceInformationListResult) (RecurrenceInformationListResult, error)
1462	rilr RecurrenceInformationListResult
1463}
1464
1465// NextWithContext advances to the next page of values.  If there was an error making
1466// the request the page does not advance and the error is returned.
1467func (page *RecurrenceInformationListResultPage) NextWithContext(ctx context.Context) (err error) {
1468	if tracing.IsEnabled() {
1469		ctx = tracing.StartSpan(ctx, fqdn+"/RecurrenceInformationListResultPage.NextWithContext")
1470		defer func() {
1471			sc := -1
1472			if page.Response().Response.Response != nil {
1473				sc = page.Response().Response.Response.StatusCode
1474			}
1475			tracing.EndSpan(ctx, sc, err)
1476		}()
1477	}
1478	next, err := page.fn(ctx, page.rilr)
1479	if err != nil {
1480		return err
1481	}
1482	page.rilr = next
1483	return nil
1484}
1485
1486// Next advances to the next page of values.  If there was an error making
1487// the request the page does not advance and the error is returned.
1488// Deprecated: Use NextWithContext() instead.
1489func (page *RecurrenceInformationListResultPage) Next() error {
1490	return page.NextWithContext(context.Background())
1491}
1492
1493// NotDone returns true if the page enumeration should be started or is not yet complete.
1494func (page RecurrenceInformationListResultPage) NotDone() bool {
1495	return !page.rilr.IsEmpty()
1496}
1497
1498// Response returns the raw server response from the last page request.
1499func (page RecurrenceInformationListResultPage) Response() RecurrenceInformationListResult {
1500	return page.rilr
1501}
1502
1503// Values returns the slice of values for the current page or nil if there are no values.
1504func (page RecurrenceInformationListResultPage) Values() []RecurrenceInformation {
1505	if page.rilr.IsEmpty() {
1506		return nil
1507	}
1508	return *page.rilr.Value
1509}
1510
1511// Creates a new instance of the RecurrenceInformationListResultPage type.
1512func NewRecurrenceInformationListResultPage(getNextPage func(context.Context, RecurrenceInformationListResult) (RecurrenceInformationListResult, error)) RecurrenceInformationListResultPage {
1513	return RecurrenceInformationListResultPage{fn: getNextPage}
1514}
1515
1516// RelationshipProperties job relationship information properties including pipeline information,
1517// correlation information, etc.
1518type RelationshipProperties struct {
1519	// PipelineID - the job relationship pipeline identifier (a GUID).
1520	PipelineID *uuid.UUID `json:"pipelineId,omitempty"`
1521	// PipelineName - the friendly name of the job relationship pipeline, which does not need to be unique.
1522	PipelineName *string `json:"pipelineName,omitempty"`
1523	// PipelineURI - the pipeline uri, unique, links to the originating service for this pipeline.
1524	PipelineURI *string `json:"pipelineUri,omitempty"`
1525	// RunID - the run identifier (a GUID), unique identifier of the iteration of this pipeline.
1526	RunID *uuid.UUID `json:"runId,omitempty"`
1527	// RecurrenceID - the recurrence identifier (a GUID), unique per activity/script, regardless of iterations. This is something to link different occurrences of the same job together.
1528	RecurrenceID *uuid.UUID `json:"recurrenceId,omitempty"`
1529	// RecurrenceName - the recurrence name, user friendly name for the correlation between jobs.
1530	RecurrenceName *string `json:"recurrenceName,omitempty"`
1531}
1532
1533// Resource the Data Lake Analytics job resources.
1534type Resource struct {
1535	// Name - the name of the resource.
1536	Name *string `json:"name,omitempty"`
1537	// ResourcePath - the path to the resource.
1538	ResourcePath *string `json:"resourcePath,omitempty"`
1539	// Type - the job resource type. Possible values include: 'VertexResource', 'JobManagerResource', 'StatisticsResource', 'VertexResourceInUserFolder', 'JobManagerResourceInUserFolder', 'StatisticsResourceInUserFolder'
1540	Type ResourceType `json:"type,omitempty"`
1541}
1542
1543// StateAuditRecord the Data Lake Analytics job state audit records for tracking the lifecycle of a job.
1544type StateAuditRecord struct {
1545	// NewState - READ-ONLY; the new state the job is in.
1546	NewState *string `json:"newState,omitempty"`
1547	// TimeStamp - READ-ONLY; the time stamp that the state change took place.
1548	TimeStamp *date.Time `json:"timeStamp,omitempty"`
1549	// RequestedByUser - READ-ONLY; the user who requests the change.
1550	RequestedByUser *string `json:"requestedByUser,omitempty"`
1551	// Details - READ-ONLY; the details of the audit log.
1552	Details *string `json:"details,omitempty"`
1553}
1554
1555// Statistics the Data Lake Analytics job execution statistics.
1556type Statistics struct {
1557	autorest.Response `json:"-"`
1558	// LastUpdateTimeUtc - READ-ONLY; the last update time for the statistics.
1559	LastUpdateTimeUtc *date.Time `json:"lastUpdateTimeUtc,omitempty"`
1560	// FinalizingTimeUtc - READ-ONLY; the job finalizing start time.
1561	FinalizingTimeUtc *date.Time `json:"finalizingTimeUtc,omitempty"`
1562	// Stages - READ-ONLY; the list of stages for the job.
1563	Stages *[]StatisticsVertexStage `json:"stages,omitempty"`
1564}
1565
1566// StatisticsVertexStage the Data Lake Analytics job statistics vertex stage information.
1567type StatisticsVertexStage struct {
1568	// DataRead - READ-ONLY; the amount of data read, in bytes.
1569	DataRead *int64 `json:"dataRead,omitempty"`
1570	// DataReadCrossPod - READ-ONLY; the amount of data read across multiple pods, in bytes.
1571	DataReadCrossPod *int64 `json:"dataReadCrossPod,omitempty"`
1572	// DataReadIntraPod - READ-ONLY; the amount of data read in one pod, in bytes.
1573	DataReadIntraPod *int64 `json:"dataReadIntraPod,omitempty"`
1574	// DataToRead - READ-ONLY; the amount of data remaining to be read, in bytes.
1575	DataToRead *int64 `json:"dataToRead,omitempty"`
1576	// DataWritten - READ-ONLY; the amount of data written, in bytes.
1577	DataWritten *int64 `json:"dataWritten,omitempty"`
1578	// DuplicateDiscardCount - READ-ONLY; the number of duplicates that were discarded.
1579	DuplicateDiscardCount *int32 `json:"duplicateDiscardCount,omitempty"`
1580	// FailedCount - READ-ONLY; the number of failures that occurred in this stage.
1581	FailedCount *int32 `json:"failedCount,omitempty"`
1582	// MaxVertexDataRead - READ-ONLY; the maximum amount of data read in a single vertex, in bytes.
1583	MaxVertexDataRead *int64 `json:"maxVertexDataRead,omitempty"`
1584	// MinVertexDataRead - READ-ONLY; the minimum amount of data read in a single vertex, in bytes.
1585	MinVertexDataRead *int64 `json:"minVertexDataRead,omitempty"`
1586	// ReadFailureCount - READ-ONLY; the number of read failures in this stage.
1587	ReadFailureCount *int32 `json:"readFailureCount,omitempty"`
1588	// RevocationCount - READ-ONLY; the number of vertices that were revoked during this stage.
1589	RevocationCount *int32 `json:"revocationCount,omitempty"`
1590	// RunningCount - READ-ONLY; the number of currently running vertices in this stage.
1591	RunningCount *int32 `json:"runningCount,omitempty"`
1592	// ScheduledCount - READ-ONLY; the number of currently scheduled vertices in this stage
1593	ScheduledCount *int32 `json:"scheduledCount,omitempty"`
1594	// StageName - READ-ONLY; the name of this stage in job execution.
1595	StageName *string `json:"stageName,omitempty"`
1596	// SucceededCount - READ-ONLY; the number of vertices that succeeded in this stage.
1597	SucceededCount *int32 `json:"succeededCount,omitempty"`
1598	// TempDataWritten - READ-ONLY; the amount of temporary data written, in bytes.
1599	TempDataWritten *int64 `json:"tempDataWritten,omitempty"`
1600	// TotalCount - READ-ONLY; the total vertex count for this stage.
1601	TotalCount *int32 `json:"totalCount,omitempty"`
1602	// TotalFailedTime - READ-ONLY; the amount of time that failed vertices took up in this stage.
1603	TotalFailedTime *string `json:"totalFailedTime,omitempty"`
1604	// TotalProgress - READ-ONLY; the current progress of this stage, as a percentage.
1605	TotalProgress *int32 `json:"totalProgress,omitempty"`
1606	// TotalSucceededTime - READ-ONLY; the amount of time all successful vertices took in this stage.
1607	TotalSucceededTime *string `json:"totalSucceededTime,omitempty"`
1608}
1609
1610// USQLJobProperties u-SQL job properties used when retrieving U-SQL jobs.
1611type USQLJobProperties struct {
1612	// Resources - READ-ONLY; the list of resources that are required by the job
1613	Resources *[]Resource `json:"resources,omitempty"`
1614	// Statistics - the job specific statistics.
1615	Statistics *Statistics `json:"statistics,omitempty"`
1616	// DebugData - the job specific debug data locations.
1617	DebugData *DataPath `json:"debugData,omitempty"`
1618	// Diagnostics - READ-ONLY; the diagnostics for the job.
1619	Diagnostics *[]Diagnostics `json:"diagnostics,omitempty"`
1620	// AlgebraFilePath - READ-ONLY; the algebra file path after the job has completed
1621	AlgebraFilePath *string `json:"algebraFilePath,omitempty"`
1622	// TotalCompilationTime - READ-ONLY; the total time this job spent compiling. This value should not be set by the user and will be ignored if it is.
1623	TotalCompilationTime *string `json:"totalCompilationTime,omitempty"`
1624	// TotalPauseTime - READ-ONLY; the total time this job spent paused. This value should not be set by the user and will be ignored if it is.
1625	TotalPauseTime *string `json:"totalPauseTime,omitempty"`
1626	// TotalQueuedTime - READ-ONLY; the total time this job spent queued. This value should not be set by the user and will be ignored if it is.
1627	TotalQueuedTime *string `json:"totalQueuedTime,omitempty"`
1628	// TotalRunningTime - READ-ONLY; the total time this job spent executing. This value should not be set by the user and will be ignored if it is.
1629	TotalRunningTime *string `json:"totalRunningTime,omitempty"`
1630	// RootProcessNodeID - READ-ONLY; the ID used to identify the job manager coordinating job execution. This value should not be set by the user and will be ignored if it is.
1631	RootProcessNodeID *string `json:"rootProcessNodeId,omitempty"`
1632	// YarnApplicationID - READ-ONLY; the ID used to identify the yarn application executing the job. This value should not be set by the user and will be ignored if it is.
1633	YarnApplicationID *string `json:"yarnApplicationId,omitempty"`
1634	// YarnApplicationTimeStamp - READ-ONLY; the timestamp (in ticks) for the yarn application executing the job. This value should not be set by the user and will be ignored if it is.
1635	YarnApplicationTimeStamp *int64 `json:"yarnApplicationTimeStamp,omitempty"`
1636	// CompileMode - READ-ONLY; the specific compilation mode for the job used during execution. If this is not specified during submission, the server will determine the optimal compilation mode. Possible values include: 'Semantic', 'Full', 'SingleBox'
1637	CompileMode CompileMode `json:"compileMode,omitempty"`
1638	// RuntimeVersion - READ-ONLY; the runtime version of the Data Lake Analytics engine to use for the specific type of job being run.
1639	RuntimeVersion *string `json:"runtimeVersion,omitempty"`
1640	// Script - the script to run. Please note that the maximum script size is 3 MB.
1641	Script *string `json:"script,omitempty"`
1642	// Type - Possible values include: 'TypeJobProperties', 'TypeUSQL', 'TypeHive'
1643	Type Type `json:"type,omitempty"`
1644}
1645
1646// MarshalJSON is the custom marshaler for USQLJobProperties.
1647func (usjp USQLJobProperties) MarshalJSON() ([]byte, error) {
1648	usjp.Type = TypeUSQL
1649	objectMap := make(map[string]interface{})
1650	if usjp.Statistics != nil {
1651		objectMap["statistics"] = usjp.Statistics
1652	}
1653	if usjp.DebugData != nil {
1654		objectMap["debugData"] = usjp.DebugData
1655	}
1656	if usjp.Script != nil {
1657		objectMap["script"] = usjp.Script
1658	}
1659	if usjp.Type != "" {
1660		objectMap["type"] = usjp.Type
1661	}
1662	return json.Marshal(objectMap)
1663}
1664
1665// AsUSQLJobProperties is the BasicProperties implementation for USQLJobProperties.
1666func (usjp USQLJobProperties) AsUSQLJobProperties() (*USQLJobProperties, bool) {
1667	return &usjp, true
1668}
1669
1670// AsHiveJobProperties is the BasicProperties implementation for USQLJobProperties.
1671func (usjp USQLJobProperties) AsHiveJobProperties() (*HiveJobProperties, bool) {
1672	return nil, false
1673}
1674
1675// AsProperties is the BasicProperties implementation for USQLJobProperties.
1676func (usjp USQLJobProperties) AsProperties() (*Properties, bool) {
1677	return nil, false
1678}
1679
1680// AsBasicProperties is the BasicProperties implementation for USQLJobProperties.
1681func (usjp USQLJobProperties) AsBasicProperties() (BasicProperties, bool) {
1682	return &usjp, true
1683}
1684