// Code generated by go-swagger; DO NOT EDIT.

package service_principals_service

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

import (
	"context"
	"net/http"
	"time"

	"github.com/go-openapi/errors"
	"github.com/go-openapi/runtime"
	cr "github.com/go-openapi/runtime/client"
	"github.com/go-openapi/strfmt"
)

// NewServicePrincipalsServiceCreateServicePrincipalParams creates a new ServicePrincipalsServiceCreateServicePrincipalParams object,
// with the default timeout for this client.
//
// Default values are not hydrated, since defaults are normally applied by the API server side.
//
// To enforce default values in parameter, use SetDefaults or WithDefaults.
func NewServicePrincipalsServiceCreateServicePrincipalParams() *ServicePrincipalsServiceCreateServicePrincipalParams {
	return &ServicePrincipalsServiceCreateServicePrincipalParams{
		timeout: cr.DefaultTimeout,
	}
}

// NewServicePrincipalsServiceCreateServicePrincipalParamsWithTimeout creates a new ServicePrincipalsServiceCreateServicePrincipalParams object
// with the ability to set a timeout on a request.
func NewServicePrincipalsServiceCreateServicePrincipalParamsWithTimeout(timeout time.Duration) *ServicePrincipalsServiceCreateServicePrincipalParams {
	return &ServicePrincipalsServiceCreateServicePrincipalParams{
		timeout: timeout,
	}
}

// NewServicePrincipalsServiceCreateServicePrincipalParamsWithContext creates a new ServicePrincipalsServiceCreateServicePrincipalParams object
// with the ability to set a context for a request.
func NewServicePrincipalsServiceCreateServicePrincipalParamsWithContext(ctx context.Context) *ServicePrincipalsServiceCreateServicePrincipalParams {
	return &ServicePrincipalsServiceCreateServicePrincipalParams{
		Context: ctx,
	}
}

// NewServicePrincipalsServiceCreateServicePrincipalParamsWithHTTPClient creates a new ServicePrincipalsServiceCreateServicePrincipalParams object
// with the ability to set a custom HTTPClient for a request.
func NewServicePrincipalsServiceCreateServicePrincipalParamsWithHTTPClient(client *http.Client) *ServicePrincipalsServiceCreateServicePrincipalParams {
	return &ServicePrincipalsServiceCreateServicePrincipalParams{
		HTTPClient: client,
	}
}

/*
ServicePrincipalsServiceCreateServicePrincipalParams contains all the parameters to send to the API endpoint

	for the service principals service create service principal operation.

	Typically these are written to a http.Request.
*/
type ServicePrincipalsServiceCreateServicePrincipalParams struct {

	// Body.
	Body ServicePrincipalsServiceCreateServicePrincipalBody

	/* ParentResourceName.

	     parent_resource_name is the resource name of the project or organization
	at which the service principal should be created (e.g.
	"project/<project_id>" or "organization/<organization_id>")
	*/
	ParentResourceName string

	timeout    time.Duration
	Context    context.Context
	HTTPClient *http.Client
}

// WithDefaults hydrates default values in the service principals service create service principal params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *ServicePrincipalsServiceCreateServicePrincipalParams) WithDefaults() *ServicePrincipalsServiceCreateServicePrincipalParams {
	o.SetDefaults()
	return o
}

// SetDefaults hydrates default values in the service principals service create service principal params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *ServicePrincipalsServiceCreateServicePrincipalParams) SetDefaults() {
	// no default values defined for this parameter
}

// WithTimeout adds the timeout to the service principals service create service principal params
func (o *ServicePrincipalsServiceCreateServicePrincipalParams) WithTimeout(timeout time.Duration) *ServicePrincipalsServiceCreateServicePrincipalParams {
	o.SetTimeout(timeout)
	return o
}

// SetTimeout adds the timeout to the service principals service create service principal params
func (o *ServicePrincipalsServiceCreateServicePrincipalParams) SetTimeout(timeout time.Duration) {
	o.timeout = timeout
}

// WithContext adds the context to the service principals service create service principal params
func (o *ServicePrincipalsServiceCreateServicePrincipalParams) WithContext(ctx context.Context) *ServicePrincipalsServiceCreateServicePrincipalParams {
	o.SetContext(ctx)
	return o
}

// SetContext adds the context to the service principals service create service principal params
func (o *ServicePrincipalsServiceCreateServicePrincipalParams) SetContext(ctx context.Context) {
	o.Context = ctx
}

// WithHTTPClient adds the HTTPClient to the service principals service create service principal params
func (o *ServicePrincipalsServiceCreateServicePrincipalParams) WithHTTPClient(client *http.Client) *ServicePrincipalsServiceCreateServicePrincipalParams {
	o.SetHTTPClient(client)
	return o
}

// SetHTTPClient adds the HTTPClient to the service principals service create service principal params
func (o *ServicePrincipalsServiceCreateServicePrincipalParams) SetHTTPClient(client *http.Client) {
	o.HTTPClient = client
}

// WithBody adds the body to the service principals service create service principal params
func (o *ServicePrincipalsServiceCreateServicePrincipalParams) WithBody(body ServicePrincipalsServiceCreateServicePrincipalBody) *ServicePrincipalsServiceCreateServicePrincipalParams {
	o.SetBody(body)
	return o
}

// SetBody adds the body to the service principals service create service principal params
func (o *ServicePrincipalsServiceCreateServicePrincipalParams) SetBody(body ServicePrincipalsServiceCreateServicePrincipalBody) {
	o.Body = body
}

// WithParentResourceName adds the parentResourceName to the service principals service create service principal params
func (o *ServicePrincipalsServiceCreateServicePrincipalParams) WithParentResourceName(parentResourceName string) *ServicePrincipalsServiceCreateServicePrincipalParams {
	o.SetParentResourceName(parentResourceName)
	return o
}

// SetParentResourceName adds the parentResourceName to the service principals service create service principal params
func (o *ServicePrincipalsServiceCreateServicePrincipalParams) SetParentResourceName(parentResourceName string) {
	o.ParentResourceName = parentResourceName
}

// WriteToRequest writes these params to a swagger request
func (o *ServicePrincipalsServiceCreateServicePrincipalParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {

	if err := r.SetTimeout(o.timeout); err != nil {
		return err
	}
	var res []error
	if err := r.SetBodyParam(o.Body); err != nil {
		return err
	}

	// path param parent_resource_name
	if err := r.SetPathParam("parent_resource_name", o.ParentResourceName); err != nil {
		return err
	}

	if len(res) > 0 {
		return errors.CompositeValidationError(res...)
	}
	return nil
}
