/** * Generated by API Builder - https://www.apibuilder.io * Service version: 2.0.0-dev * User agent: apibuilder app.apibuilder.io/hbc/svc-sundial/2.0.0-dev/ning_1_9_mock_client */ package com.hbc.svc.sundial.v2.mock { trait Client extends com.hbc.svc.sundial.v2.interfaces.Client { val baseUrl: String = "http://mock.localhost" override def healthchecks: com.hbc.svc.sundial.v2.Healthchecks = MockHealthchecksImpl override def processes: com.hbc.svc.sundial.v2.Processes = MockProcessesImpl override def processDefinitions: com.hbc.svc.sundial.v2.ProcessDefinitions = MockProcessDefinitionsImpl override def tasks: com.hbc.svc.sundial.v2.Tasks = MockTasksImpl } object MockHealthchecksImpl extends MockHealthchecks trait MockHealthchecks extends com.hbc.svc.sundial.v2.Healthchecks { def getMetrics( requestHeaders: Seq[(String, String)] = Nil )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[String] = scala.concurrent.Future.successful { Factories.randomString() } } object MockProcessesImpl extends MockProcesses trait MockProcesses extends com.hbc.svc.sundial.v2.Processes { /** * Retrieves a list of process runs based on search parameters. */ def get( processDefinitionName: _root_.scala.Option[String] = None, startTime: _root_.scala.Option[_root_.org.joda.time.DateTime] = None, endTime: _root_.scala.Option[_root_.org.joda.time.DateTime] = None, maxRecords: _root_.scala.Option[Int] = None, allowedStatuses: Seq[com.hbc.svc.sundial.v2.models.ProcessStatus], requestHeaders: Seq[(String, String)] = Nil )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Seq[com.hbc.svc.sundial.v2.models.Process]] = scala.concurrent.Future.successful { Nil } /** * Retrieves a process run */ def getByProcessId( processId: _root_.java.util.UUID, requestHeaders: Seq[(String, String)] = Nil )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[com.hbc.svc.sundial.v2.models.Process] = scala.concurrent.Future.successful { com.hbc.svc.sundial.v2.mock.Factories.makeProcess() } /** * Retries a failed process run by restarting failed tasks; tasks will be given a * single additional attempt */ def postRetryByProcessId( processId: _root_.java.util.UUID, requestHeaders: Seq[(String, String)] = Nil )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Unit] = scala.concurrent.Future.successful { // unit type } /** * Terminates an active process */ def postKillByProcessId( processId: _root_.java.util.UUID, requestHeaders: Seq[(String, String)] = Nil )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Unit] = scala.concurrent.Future.successful { // unit type } } object MockProcessDefinitionsImpl extends MockProcessDefinitions trait MockProcessDefinitions extends com.hbc.svc.sundial.v2.ProcessDefinitions { /** * Get all currently registered process definitions */ def get( requestHeaders: Seq[(String, String)] = Nil )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Seq[com.hbc.svc.sundial.v2.models.ProcessDefinition]] = scala.concurrent.Future.successful { Nil } /** * Get a registered process definition */ def getByProcessDefinitionName( processDefinitionName: String, requestHeaders: Seq[(String, String)] = Nil )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[com.hbc.svc.sundial.v2.models.ProcessDefinition] = scala.concurrent.Future.successful { com.hbc.svc.sundial.v2.mock.Factories.makeProcessDefinition() } /** * Updates or creates a process definition */ def putByProcessDefinitionName( processDefinitionName: String, processDefinition: com.hbc.svc.sundial.v2.models.ProcessDefinition, requestHeaders: Seq[(String, String)] = Nil )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[com.hbc.svc.sundial.v2.models.ProcessDefinition] = scala.concurrent.Future.successful { com.hbc.svc.sundial.v2.mock.Factories.makeProcessDefinition() } /** * Deletes a registered process definition */ def deleteByProcessDefinitionName( processDefinitionName: String, requestHeaders: Seq[(String, String)] = Nil )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Unit] = scala.concurrent.Future.successful { // unit type } /** * Triggers a new instance of the process */ def postTriggerByProcessDefinitionName( processDefinitionName: String, taskDefinitionName: _root_.scala.Option[String] = None, requestHeaders: Seq[(String, String)] = Nil )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Unit] = scala.concurrent.Future.successful { // unit type } /** * Pause the process schedule */ def postPauseByProcessDefinitionName( processDefinitionName: String, requestHeaders: Seq[(String, String)] = Nil )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Unit] = scala.concurrent.Future.successful { // unit type } /** * Resume the process schedule */ def postResumeByProcessDefinitionName( processDefinitionName: String, requestHeaders: Seq[(String, String)] = Nil )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Unit] = scala.concurrent.Future.successful { // unit type } } object MockTasksImpl extends MockTasks trait MockTasks extends com.hbc.svc.sundial.v2.Tasks { /** * Retrieves the most recent tasks meeting the given criteria */ def get( processDefinitionName: String, taskDefinitionName: String, allowedStatuses: Seq[com.hbc.svc.sundial.v2.models.TaskStatus], startTime: _root_.scala.Option[_root_.org.joda.time.DateTime] = None, endTime: _root_.scala.Option[_root_.org.joda.time.DateTime] = None, limit: _root_.scala.Option[Int] = None, requestHeaders: Seq[(String, String)] = Nil )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Seq[com.hbc.svc.sundial.v2.models.Task]] = scala.concurrent.Future.successful { Nil } /** * Appends log entries for a task; intended for use within the task executable */ def postLogEntriesByTaskId( taskId: _root_.java.util.UUID, logEntries: Seq[com.hbc.svc.sundial.v2.models.LogEntry], requestHeaders: Seq[(String, String)] = Nil )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Unit] = scala.concurrent.Future.successful { // unit type } /** * Appends metadata entries for a task; intended for use within the task executable */ def postMetadataByTaskId( taskId: _root_.java.util.UUID, metadataEntries: Seq[com.hbc.svc.sundial.v2.models.MetadataEntry], requestHeaders: Seq[(String, String)] = Nil )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Unit] = scala.concurrent.Future.successful { // unit type } /** * Marks the task as having succeeded */ def postSucceedByTaskId( taskId: _root_.java.util.UUID, requestHeaders: Seq[(String, String)] = Nil )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Unit] = scala.concurrent.Future.successful { // unit type } /** * Marks the task as having failed */ def postFailByTaskId( taskId: _root_.java.util.UUID, requestHeaders: Seq[(String, String)] = Nil )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Unit] = scala.concurrent.Future.successful { // unit type } } object Factories { def randomString(length: Int = 24): String = { _root_.scala.util.Random.alphanumeric.take(length).mkString } def makeDefaultEmrJobFlowRole(): com.hbc.svc.sundial.v2.models.DefaultEmrJobFlowRole = com.hbc.svc.sundial.v2.models.DefaultEmrJobFlowRole.DefaultEmrJobFlowRole def makeDefaultEmrServiceRole(): com.hbc.svc.sundial.v2.models.DefaultEmrServiceRole = com.hbc.svc.sundial.v2.models.DefaultEmrServiceRole.DefaultEmrServiceRole def makeEmrApplication(): com.hbc.svc.sundial.v2.models.EmrApplication = com.hbc.svc.sundial.v2.models.EmrApplication.Hadoop def makeEmrReleaseLabel(): com.hbc.svc.sundial.v2.models.EmrReleaseLabel = com.hbc.svc.sundial.v2.models.EmrReleaseLabel.Emr5200 def makeNotificationOptions(): com.hbc.svc.sundial.v2.models.NotificationOptions = com.hbc.svc.sundial.v2.models.NotificationOptions.Always def makeOnDemand(): com.hbc.svc.sundial.v2.models.OnDemand = com.hbc.svc.sundial.v2.models.OnDemand.OnDemand def makeProcessOverlapAction(): com.hbc.svc.sundial.v2.models.ProcessOverlapAction = com.hbc.svc.sundial.v2.models.ProcessOverlapAction.Wait def makeProcessStatus(): com.hbc.svc.sundial.v2.models.ProcessStatus = com.hbc.svc.sundial.v2.models.ProcessStatus.Running def makeTaskStatus(): com.hbc.svc.sundial.v2.models.TaskStatus = com.hbc.svc.sundial.v2.models.TaskStatus.Submitted def makeBatchImageCommand(): com.hbc.svc.sundial.v2.models.BatchImageCommand = com.hbc.svc.sundial.v2.models.BatchImageCommand( image = Factories.randomString(24), tag = Factories.randomString(24), command = Nil, memory = 1, vCpus = 1, jobRoleArn = None, environmentVariables = Nil, jobQueue = None ) def makeContinuousSchedule(): com.hbc.svc.sundial.v2.models.ContinuousSchedule = com.hbc.svc.sundial.v2.models.ContinuousSchedule( bufferSeconds = None ) def makeCronSchedule(): com.hbc.svc.sundial.v2.models.CronSchedule = com.hbc.svc.sundial.v2.models.CronSchedule( dayOfWeek = Factories.randomString(24), month = Factories.randomString(24), dayOfMonth = Factories.randomString(24), hours = Factories.randomString(24), minutes = Factories.randomString(24) ) def makeCustomEmrJobFlowRole(): com.hbc.svc.sundial.v2.models.CustomEmrJobFlowRole = com.hbc.svc.sundial.v2.models.CustomEmrJobFlowRole( roleName = Factories.randomString(24) ) def makeCustomEmrServiceRole(): com.hbc.svc.sundial.v2.models.CustomEmrServiceRole = com.hbc.svc.sundial.v2.models.CustomEmrServiceRole( roleName = Factories.randomString(24) ) def makeEmail(): com.hbc.svc.sundial.v2.models.Email = com.hbc.svc.sundial.v2.models.Email( name = Factories.randomString(24), email = Factories.randomString(24), notifyWhen = com.hbc.svc.sundial.v2.mock.Factories.makeNotificationOptions() ) def makeEmrCommand(): com.hbc.svc.sundial.v2.models.EmrCommand = com.hbc.svc.sundial.v2.models.EmrCommand( emrCluster = com.hbc.svc.sundial.v2.mock.Factories.makeEmrCluster(), jobName = Factories.randomString(24), region = Factories.randomString(24), `class` = Factories.randomString(24), s3JarPath = Factories.randomString(24), sparkConf = Nil, sparkPackages = Nil, args = Nil, s3LogDetails = None, loadData = None, saveResults = None ) def makeEmrConfiguration(): com.hbc.svc.sundial.v2.models.EmrConfiguration = com.hbc.svc.sundial.v2.models.EmrConfiguration( classification = None, configurations = None, properties = None ) def makeEmrInstanceGroupDetails(): com.hbc.svc.sundial.v2.models.EmrInstanceGroupDetails = com.hbc.svc.sundial.v2.models.EmrInstanceGroupDetails( emrInstanceType = Factories.randomString(24), instanceCount = 1, awsMarket = com.hbc.svc.sundial.v2.mock.Factories.makeAwsMarket(), ebsVolumeSize = None ) def makeEnvironmentVariable(): com.hbc.svc.sundial.v2.models.EnvironmentVariable = com.hbc.svc.sundial.v2.models.EnvironmentVariable( variableName = Factories.randomString(24), value = Factories.randomString(24) ) def makeExistingEmrCluster(): com.hbc.svc.sundial.v2.models.ExistingEmrCluster = com.hbc.svc.sundial.v2.models.ExistingEmrCluster( clusterId = Factories.randomString(24) ) def makeHealthcheck(): com.hbc.svc.sundial.v2.models.Healthcheck = com.hbc.svc.sundial.v2.models.Healthcheck( status = Factories.randomString(24) ) def makeLogEntry(): com.hbc.svc.sundial.v2.models.LogEntry = com.hbc.svc.sundial.v2.models.LogEntry( logEntryId = _root_.java.util.UUID.randomUUID, when = _root_.org.joda.time.DateTime.now, source = Factories.randomString(24), message = Factories.randomString(24) ) def makeMavenPackage(): com.hbc.svc.sundial.v2.models.MavenPackage = com.hbc.svc.sundial.v2.models.MavenPackage( groupId = Factories.randomString(24), artifactId = Factories.randomString(24), version = Factories.randomString(24) ) def makeMetadataEntry(): com.hbc.svc.sundial.v2.models.MetadataEntry = com.hbc.svc.sundial.v2.models.MetadataEntry( metadataEntryId = _root_.java.util.UUID.randomUUID, when = _root_.org.joda.time.DateTime.now, key = Factories.randomString(24), value = Factories.randomString(24) ) def makeNewEmrCluster(): com.hbc.svc.sundial.v2.models.NewEmrCluster = com.hbc.svc.sundial.v2.models.NewEmrCluster( name = Factories.randomString(24), releaseLabel = com.hbc.svc.sundial.v2.mock.Factories.makeEmrReleaseLabel(), applications = Nil, s3LogUri = Factories.randomString(24), masterInstance = com.hbc.svc.sundial.v2.mock.Factories.makeEmrInstanceGroupDetails(), coreInstance = None, taskInstance = None, ec2Subnet = None, emrServiceRole = com.hbc.svc.sundial.v2.mock.Factories.makeEmrServiceRole(), emrJobFlowRole = com.hbc.svc.sundial.v2.mock.Factories.makeEmrJobFlowRole(), visibleToAllUsers = true, configurations = None, securityConfiguration = None ) def makePagerduty(): com.hbc.svc.sundial.v2.models.Pagerduty = com.hbc.svc.sundial.v2.models.Pagerduty( serviceKey = Factories.randomString(24), numConsecutiveFailures = 1, apiUrl = Factories.randomString(24) ) def makeProcess(): com.hbc.svc.sundial.v2.models.Process = com.hbc.svc.sundial.v2.models.Process( processId = _root_.java.util.UUID.randomUUID, processDefinitionName = Factories.randomString(24), startTime = _root_.org.joda.time.DateTime.now, status = com.hbc.svc.sundial.v2.mock.Factories.makeProcessStatus(), task = Nil ) def makeProcessDefinition(): com.hbc.svc.sundial.v2.models.ProcessDefinition = com.hbc.svc.sundial.v2.models.ProcessDefinition( processDefinitionName = Factories.randomString(24), paused = None, processDescription = None, schedule = None, taskDefinitions = Nil, overlapAction = com.hbc.svc.sundial.v2.mock.Factories.makeProcessOverlapAction(), notifications = None ) def makeS3Cp(): com.hbc.svc.sundial.v2.models.S3Cp = com.hbc.svc.sundial.v2.models.S3Cp( source = Factories.randomString(24), destination = Factories.randomString(24) ) def makeS3LogDetails(): com.hbc.svc.sundial.v2.models.S3LogDetails = com.hbc.svc.sundial.v2.models.S3LogDetails( logGroupName = Factories.randomString(24), logStreamName = Factories.randomString(24) ) def makeShellScriptCommand(): com.hbc.svc.sundial.v2.models.ShellScriptCommand = com.hbc.svc.sundial.v2.models.ShellScriptCommand( script = Factories.randomString(24), environmentVariables = None ) def makeSpot(): com.hbc.svc.sundial.v2.models.Spot = com.hbc.svc.sundial.v2.models.Spot( bidPrice = BigDecimal("1") ) def makeTask(): com.hbc.svc.sundial.v2.models.Task = com.hbc.svc.sundial.v2.models.Task( taskId = _root_.java.util.UUID.randomUUID, processId = _root_.java.util.UUID.randomUUID, processDefinitionName = Factories.randomString(24), taskDefinitionName = Factories.randomString(24), startTime = _root_.org.joda.time.DateTime.now, endTime = None, previousAttemptCount = 1, logEntries = Nil, metadataEntries = Nil, executionState = None, status = com.hbc.svc.sundial.v2.mock.Factories.makeTaskStatus() ) def makeTaskDefinition(): com.hbc.svc.sundial.v2.models.TaskDefinition = com.hbc.svc.sundial.v2.models.TaskDefinition( taskDefinitionName = Factories.randomString(24), dependencies = Nil, executable = com.hbc.svc.sundial.v2.mock.Factories.makeTaskExecutable(), maxAttempts = 1, maxRuntimeSeconds = None, backoffBaseSeconds = 1, backoffExponent = 1.0, requireExplicitSuccess = true ) def makeTaskDependency(): com.hbc.svc.sundial.v2.models.TaskDependency = com.hbc.svc.sundial.v2.models.TaskDependency( taskDefinitionName = Factories.randomString(24), successRequired = true ) def makeAwsMarket(): com.hbc.svc.sundial.v2.models.AwsMarket = com.hbc.svc.sundial.v2.mock.Factories.makeOnDemand() def makeEmrCluster(): com.hbc.svc.sundial.v2.models.EmrCluster = com.hbc.svc.sundial.v2.mock.Factories.makeNewEmrCluster() def makeEmrJobFlowRole(): com.hbc.svc.sundial.v2.models.EmrJobFlowRole = com.hbc.svc.sundial.v2.mock.Factories.makeDefaultEmrJobFlowRole() def makeEmrServiceRole(): com.hbc.svc.sundial.v2.models.EmrServiceRole = com.hbc.svc.sundial.v2.mock.Factories.makeDefaultEmrServiceRole() def makeNotification(): com.hbc.svc.sundial.v2.models.Notification = com.hbc.svc.sundial.v2.mock.Factories.makeEmail() def makeProcessSchedule(): com.hbc.svc.sundial.v2.models.ProcessSchedule = com.hbc.svc.sundial.v2.mock.Factories.makeCronSchedule() def makeTaskExecutable(): com.hbc.svc.sundial.v2.models.TaskExecutable = com.hbc.svc.sundial.v2.mock.Factories.makeShellScriptCommand() } }