Ejemplo n.º 1
0
// WriteToRequest writes these params to a swagger request
func (o *ListTagImagesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {

	var res []error

	if o.Owned != nil {

		// query param owned
		var qrOwned bool
		if o.Owned != nil {
			qrOwned = *o.Owned
		}
		qOwned := swag.FormatBool(qrOwned)
		if qOwned != "" {
			if err := r.SetQueryParam("owned", qOwned); err != nil {
				return err
			}
		}

	}

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

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

	if len(res) > 0 {
		return errors.CompositeValidationError(res...)
	}
	return nil
}
Ejemplo n.º 2
0
// WriteToRequest writes these params to a swagger request
func (o *DiscoveryParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {

	var res []error

	if o.Internal != nil {

		// query param internal
		var qrInternal bool
		if o.Internal != nil {
			qrInternal = *o.Internal
		}
		qInternal := swag.FormatBool(qrInternal)
		if qInternal != "" {
			if err := r.SetQueryParam("internal", qInternal); err != nil {
				return err
			}
		}

	}

	if len(res) > 0 {
		return errors.CompositeValidationError(res...)
	}
	return nil
}
// WriteToRequest writes these params to a swagger request
func (o *GetRepoImageSecurityParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {

	var res []error

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

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

	if o.Vulnerabilities != nil {

		// query param vulnerabilities
		var qrVulnerabilities bool
		if o.Vulnerabilities != nil {
			qrVulnerabilities = *o.Vulnerabilities
		}
		qVulnerabilities := swag.FormatBool(qrVulnerabilities)
		if qVulnerabilities != "" {
			if err := r.SetQueryParam("vulnerabilities", qVulnerabilities); err != nil {
				return err
			}
		}

	}

	if len(res) > 0 {
		return errors.CompositeValidationError(res...)
	}
	return nil
}
Ejemplo n.º 4
0
// WriteToRequest writes these params to a swagger request
func (o *GetOrgRobotsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {

	var res []error

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

	if o.Permissions != nil {

		// query param permissions
		var qrPermissions bool
		if o.Permissions != nil {
			qrPermissions = *o.Permissions
		}
		qPermissions := swag.FormatBool(qrPermissions)
		if qPermissions != "" {
			if err := r.SetQueryParam("permissions", qPermissions); err != nil {
				return err
			}
		}

	}

	if len(res) > 0 {
		return errors.CompositeValidationError(res...)
	}
	return nil
}
// WriteToRequest writes these params to a swagger request
func (o *GetOrganizationTeamMembersParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {

	var res []error

	if o.IncludePending != nil {

		// query param includePending
		var qrIncludePending bool
		if o.IncludePending != nil {
			qrIncludePending = *o.IncludePending
		}
		qIncludePending := swag.FormatBool(qrIncludePending)
		if qIncludePending != "" {
			if err := r.SetQueryParam("includePending", qIncludePending); err != nil {
				return err
			}
		}

	}

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

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

	if len(res) > 0 {
		return errors.CompositeValidationError(res...)
	}
	return nil
}
// WriteToRequest writes these params to a swagger request
func (o *GetSubscriptionByIDParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {

	var res []error

	if o.IncludeRetired != nil {

		// query param include_retired
		var qrIncludeRetired bool
		if o.IncludeRetired != nil {
			qrIncludeRetired = *o.IncludeRetired
		}
		qIncludeRetired := swag.FormatBool(qrIncludeRetired)
		if qIncludeRetired != "" {
			if err := r.SetQueryParam("include_retired", qIncludeRetired); err != nil {
				return err
			}
		}

	}

	valuesOrganizations := o.Organizations

	joinedOrganizations := swag.JoinByFormat(valuesOrganizations, "multi")
	// query array param organizations
	if err := r.SetQueryParam("organizations", joinedOrganizations...); err != nil {
		return err
	}

	// path param subscription-ID
	if err := r.SetPathParam("subscription-ID", o.SubscriptionID); err != nil {
		return err
	}

	if len(res) > 0 {
		return errors.CompositeValidationError(res...)
	}
	return nil
}
// WriteToRequest writes these params to a swagger request
func (o *GetRatePlanByProductAndRatePlanParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {

	var res []error

	if o.IncludeRetired != nil {

		// query param include_retired
		var qrIncludeRetired bool
		if o.IncludeRetired != nil {
			qrIncludeRetired = *o.IncludeRetired
		}
		qIncludeRetired := swag.FormatBool(qrIncludeRetired)
		if qIncludeRetired != "" {
			if err := r.SetQueryParam("include_retired", qIncludeRetired); err != nil {
				return err
			}
		}

	}

	if o.Offset != nil {

		// query param offset
		var qrOffset int32
		if o.Offset != nil {
			qrOffset = *o.Offset
		}
		qOffset := swag.FormatInt32(qrOffset)
		if qOffset != "" {
			if err := r.SetQueryParam("offset", qOffset); err != nil {
				return err
			}
		}

	}

	if o.Order != nil {

		// query param order
		var qrOrder string
		if o.Order != nil {
			qrOrder = *o.Order
		}
		qOrder := qrOrder
		if qOrder != "" {
			if err := r.SetQueryParam("order", qOrder); err != nil {
				return err
			}
		}

	}

	if o.OrderBy != nil {

		// query param order_by
		var qrOrderBy string
		if o.OrderBy != nil {
			qrOrderBy = *o.OrderBy
		}
		qOrderBy := qrOrderBy
		if qOrderBy != "" {
			if err := r.SetQueryParam("order_by", qOrderBy); err != nil {
				return err
			}
		}

	}

	valuesOrganizations := o.Organizations

	joinedOrganizations := swag.JoinByFormat(valuesOrganizations, "multi")
	// query array param organizations
	if err := r.SetQueryParam("organizations", joinedOrganizations...); err != nil {
		return err
	}

	// path param product-ID
	if err := r.SetPathParam("product-ID", o.ProductID); err != nil {
		return err
	}

	// path param rate-plan-ID
	if err := r.SetPathParam("rate-plan-ID", o.RatePlanID); err != nil {
		return err
	}

	if o.Records != nil {

		// query param records
		var qrRecords int32
		if o.Records != nil {
			qrRecords = *o.Records
		}
		qRecords := swag.FormatInt32(qrRecords)
		if qRecords != "" {
			if err := r.SetQueryParam("records", qRecords); err != nil {
				return err
			}
		}

	}

	if len(res) > 0 {
		return errors.CompositeValidationError(res...)
	}
	return nil
}
// WriteToRequest writes these params to a swagger request
func (o *GetMatchingEntitiesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {

	var res []error

	if o.IncludeOrgs != nil {

		// query param includeOrgs
		var qrIncludeOrgs bool
		if o.IncludeOrgs != nil {
			qrIncludeOrgs = *o.IncludeOrgs
		}
		qIncludeOrgs := swag.FormatBool(qrIncludeOrgs)
		if qIncludeOrgs != "" {
			if err := r.SetQueryParam("includeOrgs", qIncludeOrgs); err != nil {
				return err
			}
		}

	}

	if o.IncludeTeams != nil {

		// query param includeTeams
		var qrIncludeTeams bool
		if o.IncludeTeams != nil {
			qrIncludeTeams = *o.IncludeTeams
		}
		qIncludeTeams := swag.FormatBool(qrIncludeTeams)
		if qIncludeTeams != "" {
			if err := r.SetQueryParam("includeTeams", qIncludeTeams); err != nil {
				return err
			}
		}

	}

	if o.Namespace != nil {

		// query param namespace
		var qrNamespace string
		if o.Namespace != nil {
			qrNamespace = *o.Namespace
		}
		qNamespace := qrNamespace
		if qNamespace != "" {
			if err := r.SetQueryParam("namespace", qNamespace); err != nil {
				return err
			}
		}

	}

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

	if len(res) > 0 {
		return errors.CompositeValidationError(res...)
	}
	return nil
}
// WriteToRequest writes these params to a swagger request
func (o *GetAllSubscriptionsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {

	var res []error

	valuesAccountID := o.AccountID

	joinedAccountID := swag.JoinByFormat(valuesAccountID, "multi")
	// query array param accountID
	if err := r.SetQueryParam("accountID", joinedAccountID...); err != nil {
		return err
	}

	if o.ExcludeChildren != nil {

		// query param exclude_children
		var qrExcludeChildren bool
		if o.ExcludeChildren != nil {
			qrExcludeChildren = *o.ExcludeChildren
		}
		qExcludeChildren := swag.FormatBool(qrExcludeChildren)
		if qExcludeChildren != "" {
			if err := r.SetQueryParam("exclude_children", qExcludeChildren); err != nil {
				return err
			}
		}

	}

	if o.ExcludeServiceEnded != nil {

		// query param exclude_service_ended
		var qrExcludeServiceEnded bool
		if o.ExcludeServiceEnded != nil {
			qrExcludeServiceEnded = *o.ExcludeServiceEnded
		}
		qExcludeServiceEnded := swag.FormatBool(qrExcludeServiceEnded)
		if qExcludeServiceEnded != "" {
			if err := r.SetQueryParam("exclude_service_ended", qExcludeServiceEnded); err != nil {
				return err
			}
		}

	}

	if o.IncludeRetired != nil {

		// query param include_retired
		var qrIncludeRetired bool
		if o.IncludeRetired != nil {
			qrIncludeRetired = *o.IncludeRetired
		}
		qIncludeRetired := swag.FormatBool(qrIncludeRetired)
		if qIncludeRetired != "" {
			if err := r.SetQueryParam("include_retired", qIncludeRetired); err != nil {
				return err
			}
		}

	}

	if o.Metadata != nil {

		// query param metadata
		var qrMetadata string
		if o.Metadata != nil {
			qrMetadata = *o.Metadata
		}
		qMetadata := qrMetadata
		if qMetadata != "" {
			if err := r.SetQueryParam("metadata", qMetadata); err != nil {
				return err
			}
		}

	}

	if o.Offset != nil {

		// query param offset
		var qrOffset int32
		if o.Offset != nil {
			qrOffset = *o.Offset
		}
		qOffset := swag.FormatInt32(qrOffset)
		if qOffset != "" {
			if err := r.SetQueryParam("offset", qOffset); err != nil {
				return err
			}
		}

	}

	if o.Order != nil {

		// query param order
		var qrOrder string
		if o.Order != nil {
			qrOrder = *o.Order
		}
		qOrder := qrOrder
		if qOrder != "" {
			if err := r.SetQueryParam("order", qOrder); err != nil {
				return err
			}
		}

	}

	if o.OrderBy != nil {

		// query param order_by
		var qrOrderBy string
		if o.OrderBy != nil {
			qrOrderBy = *o.OrderBy
		}
		qOrderBy := qrOrderBy
		if qOrderBy != "" {
			if err := r.SetQueryParam("order_by", qOrderBy); err != nil {
				return err
			}
		}

	}

	valuesOrganizations := o.Organizations

	joinedOrganizations := swag.JoinByFormat(valuesOrganizations, "multi")
	// query array param organizations
	if err := r.SetQueryParam("organizations", joinedOrganizations...); err != nil {
		return err
	}

	if o.Records != nil {

		// query param records
		var qrRecords int32
		if o.Records != nil {
			qrRecords = *o.Records
		}
		qRecords := swag.FormatInt32(qrRecords)
		if qRecords != "" {
			if err := r.SetQueryParam("records", qRecords); err != nil {
				return err
			}
		}

	}

	if len(res) > 0 {
		return errors.CompositeValidationError(res...)
	}
	return nil
}
Ejemplo n.º 10
0
// WriteToRequest writes these params to a swagger request
func (o *ListReposParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {

	var res []error

	if o.LastModified != nil {

		// query param last_modified
		var qrLastModified bool
		if o.LastModified != nil {
			qrLastModified = *o.LastModified
		}
		qLastModified := swag.FormatBool(qrLastModified)
		if qLastModified != "" {
			if err := r.SetQueryParam("last_modified", qLastModified); err != nil {
				return err
			}
		}

	}

	if o.Namespace != nil {

		// query param namespace
		var qrNamespace string
		if o.Namespace != nil {
			qrNamespace = *o.Namespace
		}
		qNamespace := qrNamespace
		if qNamespace != "" {
			if err := r.SetQueryParam("namespace", qNamespace); err != nil {
				return err
			}
		}

	}

	if o.NextPage != nil {

		// query param next_page
		var qrNextPage string
		if o.NextPage != nil {
			qrNextPage = *o.NextPage
		}
		qNextPage := qrNextPage
		if qNextPage != "" {
			if err := r.SetQueryParam("next_page", qNextPage); err != nil {
				return err
			}
		}

	}

	if o.Popularity != nil {

		// query param popularity
		var qrPopularity bool
		if o.Popularity != nil {
			qrPopularity = *o.Popularity
		}
		qPopularity := swag.FormatBool(qrPopularity)
		if qPopularity != "" {
			if err := r.SetQueryParam("popularity", qPopularity); err != nil {
				return err
			}
		}

	}

	if o.Public != nil {

		// query param public
		var qrPublic bool
		if o.Public != nil {
			qrPublic = *o.Public
		}
		qPublic := swag.FormatBool(qrPublic)
		if qPublic != "" {
			if err := r.SetQueryParam("public", qPublic); err != nil {
				return err
			}
		}

	}

	if o.Starred != nil {

		// query param starred
		var qrStarred bool
		if o.Starred != nil {
			qrStarred = *o.Starred
		}
		qStarred := swag.FormatBool(qrStarred)
		if qStarred != "" {
			if err := r.SetQueryParam("starred", qStarred); err != nil {
				return err
			}
		}

	}

	if len(res) > 0 {
		return errors.CompositeValidationError(res...)
	}
	return nil
}
// WriteToRequest writes these params to a swagger request
func (o *GetInvoiceAsPDFParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {

	var res []error

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

	if o.GroupLineItemsBy != nil {

		// query param group_line_items_by
		var qrGroupLineItemsBy string
		if o.GroupLineItemsBy != nil {
			qrGroupLineItemsBy = *o.GroupLineItemsBy
		}
		qGroupLineItemsBy := qrGroupLineItemsBy
		if qGroupLineItemsBy != "" {
			if err := r.SetQueryParam("group_line_items_by", qGroupLineItemsBy); err != nil {
				return err
			}
		}

	}

	if o.IncludeFooter != nil {

		// query param include_footer
		var qrIncludeFooter bool
		if o.IncludeFooter != nil {
			qrIncludeFooter = *o.IncludeFooter
		}
		qIncludeFooter := swag.FormatBool(qrIncludeFooter)
		if qIncludeFooter != "" {
			if err := r.SetQueryParam("include_footer", qIncludeFooter); err != nil {
				return err
			}
		}

	}

	if o.IncludeRetired != nil {

		// query param include_retired
		var qrIncludeRetired bool
		if o.IncludeRetired != nil {
			qrIncludeRetired = *o.IncludeRetired
		}
		qIncludeRetired := swag.FormatBool(qrIncludeRetired)
		if qIncludeRetired != "" {
			if err := r.SetQueryParam("include_retired", qIncludeRetired); err != nil {
				return err
			}
		}

	}

	if o.InclusiveEnd != nil {

		// query param inclusive_end
		var qrInclusiveEnd bool
		if o.InclusiveEnd != nil {
			qrInclusiveEnd = *o.InclusiveEnd
		}
		qInclusiveEnd := swag.FormatBool(qrInclusiveEnd)
		if qInclusiveEnd != "" {
			if err := r.SetQueryParam("inclusive_end", qInclusiveEnd); err != nil {
				return err
			}
		}

	}

	if o.Offset != nil {

		// query param offset
		var qrOffset int32
		if o.Offset != nil {
			qrOffset = *o.Offset
		}
		qOffset := swag.FormatInt32(qrOffset)
		if qOffset != "" {
			if err := r.SetQueryParam("offset", qOffset); err != nil {
				return err
			}
		}

	}

	if o.Order != nil {

		// query param order
		var qrOrder string
		if o.Order != nil {
			qrOrder = *o.Order
		}
		qOrder := qrOrder
		if qOrder != "" {
			if err := r.SetQueryParam("order", qOrder); err != nil {
				return err
			}
		}

	}

	if o.OrderBy != nil {

		// query param order_by
		var qrOrderBy string
		if o.OrderBy != nil {
			qrOrderBy = *o.OrderBy
		}
		qOrderBy := qrOrderBy
		if qOrderBy != "" {
			if err := r.SetQueryParam("order_by", qOrderBy); err != nil {
				return err
			}
		}

	}

	valuesOrganizations := o.Organizations

	joinedOrganizations := swag.JoinByFormat(valuesOrganizations, "multi")
	// query array param organizations
	if err := r.SetQueryParam("organizations", joinedOrganizations...); err != nil {
		return err
	}

	if o.Records != nil {

		// query param records
		var qrRecords int32
		if o.Records != nil {
			qrRecords = *o.Records
		}
		qRecords := swag.FormatInt32(qrRecords)
		if qRecords != "" {
			if err := r.SetQueryParam("records", qRecords); err != nil {
				return err
			}
		}

	}

	if o.ShowPlanOnlyWhenAmbiguous != nil {

		// query param show_plan_only_when_ambiguous
		var qrShowPlanOnlyWhenAmbiguous bool
		if o.ShowPlanOnlyWhenAmbiguous != nil {
			qrShowPlanOnlyWhenAmbiguous = *o.ShowPlanOnlyWhenAmbiguous
		}
		qShowPlanOnlyWhenAmbiguous := swag.FormatBool(qrShowPlanOnlyWhenAmbiguous)
		if qShowPlanOnlyWhenAmbiguous != "" {
			if err := r.SetQueryParam("show_plan_only_when_ambiguous", qShowPlanOnlyWhenAmbiguous); err != nil {
				return err
			}
		}

	}

	if o.ShowZeroCost != nil {

		// query param show_zero_cost
		var qrShowZeroCost bool
		if o.ShowZeroCost != nil {
			qrShowZeroCost = *o.ShowZeroCost
		}
		qShowZeroCost := swag.FormatBool(qrShowZeroCost)
		if qShowZeroCost != "" {
			if err := r.SetQueryParam("show_zero_cost", qShowZeroCost); err != nil {
				return err
			}
		}

	}

	if o.TierBreakdown != nil {

		// query param tier_breakdown
		var qrTierBreakdown bool
		if o.TierBreakdown != nil {
			qrTierBreakdown = *o.TierBreakdown
		}
		qTierBreakdown := swag.FormatBool(qrTierBreakdown)
		if qTierBreakdown != "" {
			if err := r.SetQueryParam("tier_breakdown", qTierBreakdown); err != nil {
				return err
			}
		}

	}

	if len(res) > 0 {
		return errors.CompositeValidationError(res...)
	}
	return nil
}
// WriteToRequest writes these params to a swagger request
func (o *GetAllAccountsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {

	var res []error

	valuesID := o.ID

	joinedID := swag.JoinByFormat(valuesID, "multi")
	// query array param id
	if err := r.SetQueryParam("id", joinedID...); err != nil {
		return err
	}

	if o.IncludeRetired != nil {

		// query param include_retired
		var qrIncludeRetired bool
		if o.IncludeRetired != nil {
			qrIncludeRetired = *o.IncludeRetired
		}
		qIncludeRetired := swag.FormatBool(qrIncludeRetired)
		if qIncludeRetired != "" {
			if err := r.SetQueryParam("include_retired", qIncludeRetired); err != nil {
				return err
			}
		}

	}

	if o.Metadata != nil {

		// query param metadata
		var qrMetadata string
		if o.Metadata != nil {
			qrMetadata = *o.Metadata
		}
		qMetadata := qrMetadata
		if qMetadata != "" {
			if err := r.SetQueryParam("metadata", qMetadata); err != nil {
				return err
			}
		}

	}

	if o.Offset != nil {

		// query param offset
		var qrOffset int32
		if o.Offset != nil {
			qrOffset = *o.Offset
		}
		qOffset := swag.FormatInt32(qrOffset)
		if qOffset != "" {
			if err := r.SetQueryParam("offset", qOffset); err != nil {
				return err
			}
		}

	}

	if o.Order != nil {

		// query param order
		var qrOrder string
		if o.Order != nil {
			qrOrder = *o.Order
		}
		qOrder := qrOrder
		if qOrder != "" {
			if err := r.SetQueryParam("order", qOrder); err != nil {
				return err
			}
		}

	}

	if o.OrderBy != nil {

		// query param order_by
		var qrOrderBy string
		if o.OrderBy != nil {
			qrOrderBy = *o.OrderBy
		}
		qOrderBy := qrOrderBy
		if qOrderBy != "" {
			if err := r.SetQueryParam("order_by", qOrderBy); err != nil {
				return err
			}
		}

	}

	valuesOrganizations := o.Organizations

	joinedOrganizations := swag.JoinByFormat(valuesOrganizations, "multi")
	// query array param organizations
	if err := r.SetQueryParam("organizations", joinedOrganizations...); err != nil {
		return err
	}

	if o.Records != nil {

		// query param records
		var qrRecords int32
		if o.Records != nil {
			qrRecords = *o.Records
		}
		qRecords := swag.FormatInt32(qrRecords)
		if qRecords != "" {
			if err := r.SetQueryParam("records", qRecords); err != nil {
				return err
			}
		}

	}

	if o.UsersOnly != nil {

		// query param users_only
		var qrUsersOnly bool
		if o.UsersOnly != nil {
			qrUsersOnly = *o.UsersOnly
		}
		qUsersOnly := swag.FormatBool(qrUsersOnly)
		if qUsersOnly != "" {
			if err := r.SetQueryParam("users_only", qUsersOnly); err != nil {
				return err
			}
		}

	}

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