jkawamoto/roadie

View on GitHub
cloud/azure/batch/client/job_schedules/job_schedules_client.go

Summary

Maintainability
A
0 mins
Test Coverage
package job_schedules

// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command

import (
    "github.com/go-openapi/runtime"

    strfmt "github.com/go-openapi/strfmt"
)

// New creates a new job schedules API client.
func New(transport runtime.ClientTransport, formats strfmt.Registry) *Client {
    return &Client{transport: transport, formats: formats}
}

/*
Client for job schedules API
*/
type Client struct {
    transport runtime.ClientTransport
    formats   strfmt.Registry
}

/*
JobScheduleAdd adds a job schedule to the specified account
*/
func (a *Client) JobScheduleAdd(params *JobScheduleAddParams) (*JobScheduleAddCreated, error) {
    // TODO: Validate the params before sending
    if params == nil {
        params = NewJobScheduleAddParams()
    }

    result, err := a.transport.Submit(&runtime.ClientOperation{
        ID:                 "JobSchedule_Add",
        Method:             "POST",
        PathPattern:        "/jobschedules",
        ProducesMediaTypes: []string{"application/json"},
        ConsumesMediaTypes: []string{"application/json; odata=minimalmetadata"},
        Schemes:            []string{"https"},
        Params:             params,
        Reader:             &JobScheduleAddReader{formats: a.formats},
        Context:            params.Context,
        Client:             params.HTTPClient,
    })
    if err != nil {
        return nil, err
    }
    return result.(*JobScheduleAddCreated), nil

}

/*
JobScheduleDelete deletes a job schedule from the specified account

When you delete a job schedule, this also deletes all jobs and tasks under that schedule. When tasks are deleted, all the files in their working directories on the compute nodes are also deleted (the retention period is ignored). The job schedule statistics are no longer accessible once the job schedule is deleted, though they are still counted towards account lifetime statistics.
*/
func (a *Client) JobScheduleDelete(params *JobScheduleDeleteParams) (*JobScheduleDeleteAccepted, error) {
    // TODO: Validate the params before sending
    if params == nil {
        params = NewJobScheduleDeleteParams()
    }

    result, err := a.transport.Submit(&runtime.ClientOperation{
        ID:                 "JobSchedule_Delete",
        Method:             "DELETE",
        PathPattern:        "/jobschedules/{jobScheduleId}",
        ProducesMediaTypes: []string{"application/json"},
        ConsumesMediaTypes: []string{"application/json; odata=minimalmetadata"},
        Schemes:            []string{"https"},
        Params:             params,
        Reader:             &JobScheduleDeleteReader{formats: a.formats},
        Context:            params.Context,
        Client:             params.HTTPClient,
    })
    if err != nil {
        return nil, err
    }
    return result.(*JobScheduleDeleteAccepted), nil

}

/*
JobScheduleDisable disables a job schedule

No new jobs will be created until the job schedule is enabled again.
*/
func (a *Client) JobScheduleDisable(params *JobScheduleDisableParams) (*JobScheduleDisableNoContent, error) {
    // TODO: Validate the params before sending
    if params == nil {
        params = NewJobScheduleDisableParams()
    }

    result, err := a.transport.Submit(&runtime.ClientOperation{
        ID:                 "JobSchedule_Disable",
        Method:             "POST",
        PathPattern:        "/jobschedules/{jobScheduleId}/disable",
        ProducesMediaTypes: []string{"application/json"},
        ConsumesMediaTypes: []string{"application/json; odata=minimalmetadata"},
        Schemes:            []string{"https"},
        Params:             params,
        Reader:             &JobScheduleDisableReader{formats: a.formats},
        Context:            params.Context,
        Client:             params.HTTPClient,
    })
    if err != nil {
        return nil, err
    }
    return result.(*JobScheduleDisableNoContent), nil

}

/*
JobScheduleEnable enables a job schedule
*/
func (a *Client) JobScheduleEnable(params *JobScheduleEnableParams) (*JobScheduleEnableNoContent, error) {
    // TODO: Validate the params before sending
    if params == nil {
        params = NewJobScheduleEnableParams()
    }

    result, err := a.transport.Submit(&runtime.ClientOperation{
        ID:                 "JobSchedule_Enable",
        Method:             "POST",
        PathPattern:        "/jobschedules/{jobScheduleId}/enable",
        ProducesMediaTypes: []string{"application/json"},
        ConsumesMediaTypes: []string{"application/json; odata=minimalmetadata"},
        Schemes:            []string{"https"},
        Params:             params,
        Reader:             &JobScheduleEnableReader{formats: a.formats},
        Context:            params.Context,
        Client:             params.HTTPClient,
    })
    if err != nil {
        return nil, err
    }
    return result.(*JobScheduleEnableNoContent), nil

}

/*
JobScheduleExists checks the specified job schedule exists
*/
func (a *Client) JobScheduleExists(params *JobScheduleExistsParams) (*JobScheduleExistsOK, error) {
    // TODO: Validate the params before sending
    if params == nil {
        params = NewJobScheduleExistsParams()
    }

    result, err := a.transport.Submit(&runtime.ClientOperation{
        ID:                 "JobSchedule_Exists",
        Method:             "HEAD",
        PathPattern:        "/jobschedules/{jobScheduleId}",
        ProducesMediaTypes: []string{"application/json"},
        ConsumesMediaTypes: []string{"application/json; odata=minimalmetadata"},
        Schemes:            []string{"https"},
        Params:             params,
        Reader:             &JobScheduleExistsReader{formats: a.formats},
        Context:            params.Context,
        Client:             params.HTTPClient,
    })
    if err != nil {
        return nil, err
    }
    return result.(*JobScheduleExistsOK), nil

}

/*
JobScheduleGet Gets information about the specified job schedule.
*/
func (a *Client) JobScheduleGet(params *JobScheduleGetParams) (*JobScheduleGetOK, error) {
    // TODO: Validate the params before sending
    if params == nil {
        params = NewJobScheduleGetParams()
    }

    result, err := a.transport.Submit(&runtime.ClientOperation{
        ID:                 "JobSchedule_Get",
        Method:             "GET",
        PathPattern:        "/jobschedules/{jobScheduleId}",
        ProducesMediaTypes: []string{"application/json"},
        ConsumesMediaTypes: []string{"application/json; odata=minimalmetadata"},
        Schemes:            []string{"https"},
        Params:             params,
        Reader:             &JobScheduleGetReader{formats: a.formats},
        Context:            params.Context,
        Client:             params.HTTPClient,
    })
    if err != nil {
        return nil, err
    }
    return result.(*JobScheduleGetOK), nil

}

/*
JobScheduleList lists all of the job schedules in the specified account
*/
func (a *Client) JobScheduleList(params *JobScheduleListParams) (*JobScheduleListOK, error) {
    // TODO: Validate the params before sending
    if params == nil {
        params = NewJobScheduleListParams()
    }

    result, err := a.transport.Submit(&runtime.ClientOperation{
        ID:                 "JobSchedule_List",
        Method:             "GET",
        PathPattern:        "/jobschedules",
        ProducesMediaTypes: []string{"application/json"},
        ConsumesMediaTypes: []string{"application/json; odata=minimalmetadata"},
        Schemes:            []string{"https"},
        Params:             params,
        Reader:             &JobScheduleListReader{formats: a.formats},
        Context:            params.Context,
        Client:             params.HTTPClient,
    })
    if err != nil {
        return nil, err
    }
    return result.(*JobScheduleListOK), nil

}

/*
JobSchedulePatch updates the properties of the specified job schedule

This replaces only the job schedule properties specified in the request. For example, if the schedule property is not specified with this request, then the Batch service will keep the existing schedule. Changes to a job schedule only impact jobs created by the schedule after the update has taken place; currently running jobs are unaffected.
*/
func (a *Client) JobSchedulePatch(params *JobSchedulePatchParams) (*JobSchedulePatchOK, error) {
    // TODO: Validate the params before sending
    if params == nil {
        params = NewJobSchedulePatchParams()
    }

    result, err := a.transport.Submit(&runtime.ClientOperation{
        ID:                 "JobSchedule_Patch",
        Method:             "PATCH",
        PathPattern:        "/jobschedules/{jobScheduleId}",
        ProducesMediaTypes: []string{"application/json"},
        ConsumesMediaTypes: []string{"application/json; odata=minimalmetadata"},
        Schemes:            []string{"https"},
        Params:             params,
        Reader:             &JobSchedulePatchReader{formats: a.formats},
        Context:            params.Context,
        Client:             params.HTTPClient,
    })
    if err != nil {
        return nil, err
    }
    return result.(*JobSchedulePatchOK), nil

}

/*
JobScheduleTerminate terminates a job schedule
*/
func (a *Client) JobScheduleTerminate(params *JobScheduleTerminateParams) (*JobScheduleTerminateAccepted, error) {
    // TODO: Validate the params before sending
    if params == nil {
        params = NewJobScheduleTerminateParams()
    }

    result, err := a.transport.Submit(&runtime.ClientOperation{
        ID:                 "JobSchedule_Terminate",
        Method:             "POST",
        PathPattern:        "/jobschedules/{jobScheduleId}/terminate",
        ProducesMediaTypes: []string{"application/json"},
        ConsumesMediaTypes: []string{"application/json; odata=minimalmetadata"},
        Schemes:            []string{"https"},
        Params:             params,
        Reader:             &JobScheduleTerminateReader{formats: a.formats},
        Context:            params.Context,
        Client:             params.HTTPClient,
    })
    if err != nil {
        return nil, err
    }
    return result.(*JobScheduleTerminateAccepted), nil

}

/*
JobScheduleUpdate updates the properties of the specified job schedule

This fully replaces all the updateable properties of the job schedule. For example, if the schedule property is not specified with this request, then the Batch service will remove the existing schedule. Changes to a job schedule only impact jobs created by the schedule after the update has taken place; currently running jobs are unaffected.
*/
func (a *Client) JobScheduleUpdate(params *JobScheduleUpdateParams) (*JobScheduleUpdateOK, error) {
    // TODO: Validate the params before sending
    if params == nil {
        params = NewJobScheduleUpdateParams()
    }

    result, err := a.transport.Submit(&runtime.ClientOperation{
        ID:                 "JobSchedule_Update",
        Method:             "PUT",
        PathPattern:        "/jobschedules/{jobScheduleId}",
        ProducesMediaTypes: []string{"application/json"},
        ConsumesMediaTypes: []string{"application/json; odata=minimalmetadata"},
        Schemes:            []string{"https"},
        Params:             params,
        Reader:             &JobScheduleUpdateReader{formats: a.formats},
        Context:            params.Context,
        Client:             params.HTTPClient,
    })
    if err != nil {
        return nil, err
    }
    return result.(*JobScheduleUpdateOK), nil

}

// SetTransport changes the transport on the client
func (a *Client) SetTransport(transport runtime.ClientTransport) {
    a.transport = transport
}