1package spark 2 3// Copyright (c) Microsoft Corporation. All rights reserved. 4// Licensed under the MIT License. See License.txt in the project root for license information. 5// 6// Code generated by Microsoft (R) AutoRest Code Generator. 7// Changes may cause incorrect behavior and will be lost if the code is regenerated. 8 9import ( 10 "encoding/json" 11 "github.com/Azure/go-autorest/autorest" 12 "github.com/Azure/go-autorest/autorest/date" 13) 14 15// The package's fully qualified name. 16const fqdn = "github.com/Azure/azure-sdk-for-go/services/preview/synapse/2019-11-01-preview/spark" 17 18// BatchJob ... 19type BatchJob struct { 20 autorest.Response `json:"-"` 21 LivyInfo *BatchJobState `json:"livyInfo,omitempty"` 22 // Name - The batch name. 23 Name *string `json:"name,omitempty"` 24 // WorkspaceName - The workspace name. 25 WorkspaceName *string `json:"workspaceName,omitempty"` 26 // SparkPoolName - The Spark pool name. 27 SparkPoolName *string `json:"sparkPoolName,omitempty"` 28 // SubmitterName - The submitter name. 29 SubmitterName *string `json:"submitterName,omitempty"` 30 // SubmitterID - The submitter identifier. 31 SubmitterID *string `json:"submitterId,omitempty"` 32 // ArtifactID - The artifact identifier. 33 ArtifactID *string `json:"artifactId,omitempty"` 34 // JobType - The job type. Possible values include: 'SparkBatch', 'SparkSession' 35 JobType JobType `json:"jobType,omitempty"` 36 // Result - The Spark batch job result. Possible values include: 'Uncertain', 'Succeeded', 'Failed', 'Cancelled' 37 Result BatchJobResultType `json:"result,omitempty"` 38 // Scheduler - The scheduler information. 39 Scheduler *Scheduler `json:"schedulerInfo,omitempty"` 40 // Plugin - The plugin information. 41 Plugin *ServicePlugin `json:"pluginInfo,omitempty"` 42 // Errors - The error information. 43 Errors *[]ServiceError `json:"errorInfo,omitempty"` 44 // Tags - The tags. 45 Tags map[string]*string `json:"tags"` 46 // ID - The session Id. 47 ID *int32 `json:"id,omitempty"` 48 // AppID - The application id of this session 49 AppID *string `json:"appId,omitempty"` 50 // AppInfo - The detailed application info. 51 AppInfo map[string]*string `json:"appInfo"` 52 // State - The batch state 53 State *string `json:"state,omitempty"` 54 // LogLines - The log lines. 55 LogLines *[]string `json:"log,omitempty"` 56} 57 58// MarshalJSON is the custom marshaler for BatchJob. 59func (bj BatchJob) MarshalJSON() ([]byte, error) { 60 objectMap := make(map[string]interface{}) 61 if bj.LivyInfo != nil { 62 objectMap["livyInfo"] = bj.LivyInfo 63 } 64 if bj.Name != nil { 65 objectMap["name"] = bj.Name 66 } 67 if bj.WorkspaceName != nil { 68 objectMap["workspaceName"] = bj.WorkspaceName 69 } 70 if bj.SparkPoolName != nil { 71 objectMap["sparkPoolName"] = bj.SparkPoolName 72 } 73 if bj.SubmitterName != nil { 74 objectMap["submitterName"] = bj.SubmitterName 75 } 76 if bj.SubmitterID != nil { 77 objectMap["submitterId"] = bj.SubmitterID 78 } 79 if bj.ArtifactID != nil { 80 objectMap["artifactId"] = bj.ArtifactID 81 } 82 if bj.JobType != "" { 83 objectMap["jobType"] = bj.JobType 84 } 85 if bj.Result != "" { 86 objectMap["result"] = bj.Result 87 } 88 if bj.Scheduler != nil { 89 objectMap["schedulerInfo"] = bj.Scheduler 90 } 91 if bj.Plugin != nil { 92 objectMap["pluginInfo"] = bj.Plugin 93 } 94 if bj.Errors != nil { 95 objectMap["errorInfo"] = bj.Errors 96 } 97 if bj.Tags != nil { 98 objectMap["tags"] = bj.Tags 99 } 100 if bj.ID != nil { 101 objectMap["id"] = bj.ID 102 } 103 if bj.AppID != nil { 104 objectMap["appId"] = bj.AppID 105 } 106 if bj.AppInfo != nil { 107 objectMap["appInfo"] = bj.AppInfo 108 } 109 if bj.State != nil { 110 objectMap["state"] = bj.State 111 } 112 if bj.LogLines != nil { 113 objectMap["log"] = bj.LogLines 114 } 115 return json.Marshal(objectMap) 116} 117 118// BatchJobCollection response for batch list operation. 119type BatchJobCollection struct { 120 autorest.Response `json:"-"` 121 // From - The start index of fetched sessions. 122 From *int32 `json:"from,omitempty"` 123 // Total - Number of sessions fetched. 124 Total *int32 `json:"total,omitempty"` 125 // Sessions - Batch list 126 Sessions *[]BatchJob `json:"sessions,omitempty"` 127} 128 129// BatchJobOptions ... 130type BatchJobOptions struct { 131 Tags map[string]*string `json:"tags"` 132 ArtifactID *string `json:"artifactId,omitempty"` 133 Name *string `json:"name,omitempty"` 134 File *string `json:"file,omitempty"` 135 ClassName *string `json:"className,omitempty"` 136 Arguments *[]string `json:"args,omitempty"` 137 Jars *[]string `json:"jars,omitempty"` 138 PythonFiles *[]string `json:"pyFiles,omitempty"` 139 Files *[]string `json:"files,omitempty"` 140 Archives *[]string `json:"archives,omitempty"` 141 Configuration map[string]*string `json:"conf"` 142 DriverMemory *string `json:"driverMemory,omitempty"` 143 DriverCores *int32 `json:"driverCores,omitempty"` 144 ExecutorMemory *string `json:"executorMemory,omitempty"` 145 ExecutorCores *int32 `json:"executorCores,omitempty"` 146 ExecutorCount *int32 `json:"numExecutors,omitempty"` 147} 148 149// MarshalJSON is the custom marshaler for BatchJobOptions. 150func (bjo BatchJobOptions) MarshalJSON() ([]byte, error) { 151 objectMap := make(map[string]interface{}) 152 if bjo.Tags != nil { 153 objectMap["tags"] = bjo.Tags 154 } 155 if bjo.ArtifactID != nil { 156 objectMap["artifactId"] = bjo.ArtifactID 157 } 158 if bjo.Name != nil { 159 objectMap["name"] = bjo.Name 160 } 161 if bjo.File != nil { 162 objectMap["file"] = bjo.File 163 } 164 if bjo.ClassName != nil { 165 objectMap["className"] = bjo.ClassName 166 } 167 if bjo.Arguments != nil { 168 objectMap["args"] = bjo.Arguments 169 } 170 if bjo.Jars != nil { 171 objectMap["jars"] = bjo.Jars 172 } 173 if bjo.PythonFiles != nil { 174 objectMap["pyFiles"] = bjo.PythonFiles 175 } 176 if bjo.Files != nil { 177 objectMap["files"] = bjo.Files 178 } 179 if bjo.Archives != nil { 180 objectMap["archives"] = bjo.Archives 181 } 182 if bjo.Configuration != nil { 183 objectMap["conf"] = bjo.Configuration 184 } 185 if bjo.DriverMemory != nil { 186 objectMap["driverMemory"] = bjo.DriverMemory 187 } 188 if bjo.DriverCores != nil { 189 objectMap["driverCores"] = bjo.DriverCores 190 } 191 if bjo.ExecutorMemory != nil { 192 objectMap["executorMemory"] = bjo.ExecutorMemory 193 } 194 if bjo.ExecutorCores != nil { 195 objectMap["executorCores"] = bjo.ExecutorCores 196 } 197 if bjo.ExecutorCount != nil { 198 objectMap["numExecutors"] = bjo.ExecutorCount 199 } 200 return json.Marshal(objectMap) 201} 202 203// BatchJobState ... 204type BatchJobState struct { 205 // NotStartedAt - the time that at which "not_started" livy state was first seen. 206 NotStartedAt *date.Time `json:"notStartedAt,omitempty"` 207 // StartingAt - the time that at which "starting" livy state was first seen. 208 StartingAt *date.Time `json:"startingAt,omitempty"` 209 // RunningAt - the time that at which "running" livy state was first seen. 210 RunningAt *date.Time `json:"runningAt,omitempty"` 211 // DeadAt - time that at which "dead" livy state was first seen. 212 DeadAt *date.Time `json:"deadAt,omitempty"` 213 // SuccessAt - the time that at which "success" livy state was first seen. 214 SuccessAt *date.Time `json:"successAt,omitempty"` 215 // TerminatedAt - the time that at which "killed" livy state was first seen. 216 TerminatedAt *date.Time `json:"killedAt,omitempty"` 217 // RecoveringAt - the time that at which "recovering" livy state was first seen. 218 RecoveringAt *date.Time `json:"recoveringAt,omitempty"` 219 // CurrentState - the Spark job state. 220 CurrentState *string `json:"currentState,omitempty"` 221 JobCreationRequest *Request `json:"jobCreationRequest,omitempty"` 222} 223 224// Request ... 225type Request struct { 226 Name *string `json:"name,omitempty"` 227 File *string `json:"file,omitempty"` 228 ClassName *string `json:"className,omitempty"` 229 Arguments *[]string `json:"args,omitempty"` 230 Jars *[]string `json:"jars,omitempty"` 231 PythonFiles *[]string `json:"pyFiles,omitempty"` 232 Files *[]string `json:"files,omitempty"` 233 Archives *[]string `json:"archives,omitempty"` 234 Configuration map[string]*string `json:"conf"` 235 DriverMemory *string `json:"driverMemory,omitempty"` 236 DriverCores *int32 `json:"driverCores,omitempty"` 237 ExecutorMemory *string `json:"executorMemory,omitempty"` 238 ExecutorCores *int32 `json:"executorCores,omitempty"` 239 ExecutorCount *int32 `json:"numExecutors,omitempty"` 240} 241 242// MarshalJSON is the custom marshaler for Request. 243func (r Request) MarshalJSON() ([]byte, error) { 244 objectMap := make(map[string]interface{}) 245 if r.Name != nil { 246 objectMap["name"] = r.Name 247 } 248 if r.File != nil { 249 objectMap["file"] = r.File 250 } 251 if r.ClassName != nil { 252 objectMap["className"] = r.ClassName 253 } 254 if r.Arguments != nil { 255 objectMap["args"] = r.Arguments 256 } 257 if r.Jars != nil { 258 objectMap["jars"] = r.Jars 259 } 260 if r.PythonFiles != nil { 261 objectMap["pyFiles"] = r.PythonFiles 262 } 263 if r.Files != nil { 264 objectMap["files"] = r.Files 265 } 266 if r.Archives != nil { 267 objectMap["archives"] = r.Archives 268 } 269 if r.Configuration != nil { 270 objectMap["conf"] = r.Configuration 271 } 272 if r.DriverMemory != nil { 273 objectMap["driverMemory"] = r.DriverMemory 274 } 275 if r.DriverCores != nil { 276 objectMap["driverCores"] = r.DriverCores 277 } 278 if r.ExecutorMemory != nil { 279 objectMap["executorMemory"] = r.ExecutorMemory 280 } 281 if r.ExecutorCores != nil { 282 objectMap["executorCores"] = r.ExecutorCores 283 } 284 if r.ExecutorCount != nil { 285 objectMap["numExecutors"] = r.ExecutorCount 286 } 287 return json.Marshal(objectMap) 288} 289 290// Scheduler ... 291type Scheduler struct { 292 SubmittedAt *date.Time `json:"submittedAt,omitempty"` 293 ScheduledAt *date.Time `json:"scheduledAt,omitempty"` 294 EndedAt *date.Time `json:"endedAt,omitempty"` 295 CancellationRequestedAt *date.Time `json:"cancellationRequestedAt,omitempty"` 296 // CurrentState - Possible values include: 'SchedulerCurrentStateQueued', 'SchedulerCurrentStateScheduled', 'SchedulerCurrentStateEnded' 297 CurrentState SchedulerCurrentState `json:"currentState,omitempty"` 298} 299 300// ServiceError ... 301type ServiceError struct { 302 Message *string `json:"message,omitempty"` 303 ErrorCode *string `json:"errorCode,omitempty"` 304 // Source - Possible values include: 'System', 'User', 'Unknown', 'Dependency' 305 Source ErrorSource `json:"source,omitempty"` 306} 307 308// ServicePlugin ... 309type ServicePlugin struct { 310 PreparationStartedAt *date.Time `json:"preparationStartedAt,omitempty"` 311 ResourceAcquisitionStartedAt *date.Time `json:"resourceAcquisitionStartedAt,omitempty"` 312 SubmissionStartedAt *date.Time `json:"submissionStartedAt,omitempty"` 313 MonitoringStartedAt *date.Time `json:"monitoringStartedAt,omitempty"` 314 CleanupStartedAt *date.Time `json:"cleanupStartedAt,omitempty"` 315 // CurrentState - Possible values include: 'Preparation', 'ResourceAcquisition', 'Queued', 'Submission', 'Monitoring', 'Cleanup', 'Ended' 316 CurrentState PluginCurrentState `json:"currentState,omitempty"` 317} 318 319// Session ... 320type Session struct { 321 autorest.Response `json:"-"` 322 LivyInfo *SessionState `json:"livyInfo,omitempty"` 323 Name *string `json:"name,omitempty"` 324 WorkspaceName *string `json:"workspaceName,omitempty"` 325 SparkPoolName *string `json:"sparkPoolName,omitempty"` 326 SubmitterName *string `json:"submitterName,omitempty"` 327 SubmitterID *string `json:"submitterId,omitempty"` 328 ArtifactID *string `json:"artifactId,omitempty"` 329 // JobType - Possible values include: 'SparkBatch', 'SparkSession' 330 JobType JobType `json:"jobType,omitempty"` 331 // Result - Possible values include: 'SessionResultTypeUncertain', 'SessionResultTypeSucceeded', 'SessionResultTypeFailed', 'SessionResultTypeCancelled' 332 Result SessionResultType `json:"result,omitempty"` 333 Scheduler *Scheduler `json:"schedulerInfo,omitempty"` 334 Plugin *ServicePlugin `json:"pluginInfo,omitempty"` 335 Errors *[]ServiceError `json:"errorInfo,omitempty"` 336 Tags map[string]*string `json:"tags"` 337 ID *int32 `json:"id,omitempty"` 338 AppID *string `json:"appId,omitempty"` 339 AppInfo map[string]*string `json:"appInfo"` 340 State *string `json:"state,omitempty"` 341 LogLines *[]string `json:"log,omitempty"` 342} 343 344// MarshalJSON is the custom marshaler for Session. 345func (s Session) MarshalJSON() ([]byte, error) { 346 objectMap := make(map[string]interface{}) 347 if s.LivyInfo != nil { 348 objectMap["livyInfo"] = s.LivyInfo 349 } 350 if s.Name != nil { 351 objectMap["name"] = s.Name 352 } 353 if s.WorkspaceName != nil { 354 objectMap["workspaceName"] = s.WorkspaceName 355 } 356 if s.SparkPoolName != nil { 357 objectMap["sparkPoolName"] = s.SparkPoolName 358 } 359 if s.SubmitterName != nil { 360 objectMap["submitterName"] = s.SubmitterName 361 } 362 if s.SubmitterID != nil { 363 objectMap["submitterId"] = s.SubmitterID 364 } 365 if s.ArtifactID != nil { 366 objectMap["artifactId"] = s.ArtifactID 367 } 368 if s.JobType != "" { 369 objectMap["jobType"] = s.JobType 370 } 371 if s.Result != "" { 372 objectMap["result"] = s.Result 373 } 374 if s.Scheduler != nil { 375 objectMap["schedulerInfo"] = s.Scheduler 376 } 377 if s.Plugin != nil { 378 objectMap["pluginInfo"] = s.Plugin 379 } 380 if s.Errors != nil { 381 objectMap["errorInfo"] = s.Errors 382 } 383 if s.Tags != nil { 384 objectMap["tags"] = s.Tags 385 } 386 if s.ID != nil { 387 objectMap["id"] = s.ID 388 } 389 if s.AppID != nil { 390 objectMap["appId"] = s.AppID 391 } 392 if s.AppInfo != nil { 393 objectMap["appInfo"] = s.AppInfo 394 } 395 if s.State != nil { 396 objectMap["state"] = s.State 397 } 398 if s.LogLines != nil { 399 objectMap["log"] = s.LogLines 400 } 401 return json.Marshal(objectMap) 402} 403 404// SessionCollection ... 405type SessionCollection struct { 406 autorest.Response `json:"-"` 407 From *int32 `json:"from,omitempty"` 408 Total *int32 `json:"total,omitempty"` 409 Sessions *[]Session `json:"sessions,omitempty"` 410} 411 412// SessionOptions ... 413type SessionOptions struct { 414 Tags map[string]*string `json:"tags"` 415 ArtifactID *string `json:"artifactId,omitempty"` 416 Name *string `json:"name,omitempty"` 417 File *string `json:"file,omitempty"` 418 ClassName *string `json:"className,omitempty"` 419 Arguments *[]string `json:"args,omitempty"` 420 Jars *[]string `json:"jars,omitempty"` 421 PythonFiles *[]string `json:"pyFiles,omitempty"` 422 Files *[]string `json:"files,omitempty"` 423 Archives *[]string `json:"archives,omitempty"` 424 Configuration map[string]*string `json:"conf"` 425 DriverMemory *string `json:"driverMemory,omitempty"` 426 DriverCores *int32 `json:"driverCores,omitempty"` 427 ExecutorMemory *string `json:"executorMemory,omitempty"` 428 ExecutorCores *int32 `json:"executorCores,omitempty"` 429 ExecutorCount *int32 `json:"numExecutors,omitempty"` 430} 431 432// MarshalJSON is the custom marshaler for SessionOptions. 433func (so SessionOptions) MarshalJSON() ([]byte, error) { 434 objectMap := make(map[string]interface{}) 435 if so.Tags != nil { 436 objectMap["tags"] = so.Tags 437 } 438 if so.ArtifactID != nil { 439 objectMap["artifactId"] = so.ArtifactID 440 } 441 if so.Name != nil { 442 objectMap["name"] = so.Name 443 } 444 if so.File != nil { 445 objectMap["file"] = so.File 446 } 447 if so.ClassName != nil { 448 objectMap["className"] = so.ClassName 449 } 450 if so.Arguments != nil { 451 objectMap["args"] = so.Arguments 452 } 453 if so.Jars != nil { 454 objectMap["jars"] = so.Jars 455 } 456 if so.PythonFiles != nil { 457 objectMap["pyFiles"] = so.PythonFiles 458 } 459 if so.Files != nil { 460 objectMap["files"] = so.Files 461 } 462 if so.Archives != nil { 463 objectMap["archives"] = so.Archives 464 } 465 if so.Configuration != nil { 466 objectMap["conf"] = so.Configuration 467 } 468 if so.DriverMemory != nil { 469 objectMap["driverMemory"] = so.DriverMemory 470 } 471 if so.DriverCores != nil { 472 objectMap["driverCores"] = so.DriverCores 473 } 474 if so.ExecutorMemory != nil { 475 objectMap["executorMemory"] = so.ExecutorMemory 476 } 477 if so.ExecutorCores != nil { 478 objectMap["executorCores"] = so.ExecutorCores 479 } 480 if so.ExecutorCount != nil { 481 objectMap["numExecutors"] = so.ExecutorCount 482 } 483 return json.Marshal(objectMap) 484} 485 486// SessionState ... 487type SessionState struct { 488 NotStartedAt *date.Time `json:"notStartedAt,omitempty"` 489 StartingAt *date.Time `json:"startingAt,omitempty"` 490 IdleAt *date.Time `json:"idleAt,omitempty"` 491 DeadAt *date.Time `json:"deadAt,omitempty"` 492 ShuttingDownAt *date.Time `json:"shuttingDownAt,omitempty"` 493 TerminatedAt *date.Time `json:"killedAt,omitempty"` 494 RecoveringAt *date.Time `json:"recoveringAt,omitempty"` 495 BusyAt *date.Time `json:"busyAt,omitempty"` 496 ErrorAt *date.Time `json:"errorAt,omitempty"` 497 CurrentState *string `json:"currentState,omitempty"` 498 JobCreationRequest *Request `json:"jobCreationRequest,omitempty"` 499} 500 501// Statement ... 502type Statement struct { 503 autorest.Response `json:"-"` 504 ID *int32 `json:"id,omitempty"` 505 Code *string `json:"code,omitempty"` 506 State *string `json:"state,omitempty"` 507 Output *StatementOutput `json:"output,omitempty"` 508} 509 510// StatementCancellationResult ... 511type StatementCancellationResult struct { 512 autorest.Response `json:"-"` 513 Msg *string `json:"msg,omitempty"` 514} 515 516// StatementCollection ... 517type StatementCollection struct { 518 autorest.Response `json:"-"` 519 Total *int32 `json:"total_statements,omitempty"` 520 Statements *[]Statement `json:"statements,omitempty"` 521} 522 523// StatementOptions ... 524type StatementOptions struct { 525 Code *string `json:"code,omitempty"` 526 // Kind - Possible values include: 'Spark', 'Pyspark', 'Dotnetspark', 'SQL' 527 Kind StatementLanguageType `json:"kind,omitempty"` 528} 529 530// StatementOutput ... 531type StatementOutput struct { 532 Status *string `json:"status,omitempty"` 533 ExecutionCount *int32 `json:"execution_count,omitempty"` 534 Data interface{} `json:"data,omitempty"` 535 ErrorName *string `json:"ename,omitempty"` 536 ErrorValue *string `json:"evalue,omitempty"` 537 Traceback *[]string `json:"traceback,omitempty"` 538} 539