// WriteToRequest writes these params to a swagger request
func (o *GetMatchingEntitiesParams) WriteToRequest(r client.Request, reg strfmt.Registry) error {

	var res []error

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

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

	// query param namespace
	if err := r.SetQueryParam("namespace", o.Namespace); 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
}
Ejemplo n.º 2
0
// WriteToRequest writes these params to a swagger request
func (o *DiscoveryParams) WriteToRequest(r client.Request, 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 *GetOrgRobotsParams) WriteToRequest(r client.Request, 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 client.Request, 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 *ListTagImagesParams) WriteToRequest(r client.Request, 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.º 6
0
// WriteToRequest writes these params to a swagger request
func (o *ListReposParams) WriteToRequest(r client.Request, reg strfmt.Registry) error {

	var res []error

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

	// query param limit
	if err := r.SetQueryParam("limit", swag.FormatInt64(o.Limit)); err != nil {
		return err
	}

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

	// query param page
	if err := r.SetQueryParam("page", swag.FormatInt64(o.Page)); err != nil {
		return err
	}

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

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

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

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

	var res []error

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

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

	var res []error

	// query param permissions
	if err := r.SetQueryParam("permissions", swag.FormatBool(o.Permissions)); 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 client.Request, reg strfmt.Registry) error {

	var res []error

	// path param ID
	if err := r.SetPathParam("ID", o.ID); 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.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 *GetAllRatePlansParams) WriteToRequest(r client.Request, 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.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.º 11
0
// WriteToRequest writes these params to a swagger request
func (o *ListReposParams) WriteToRequest(r client.Request, 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.Limit != nil {

		// query param limit
		var qrLimit int64
		if o.Limit != nil {
			qrLimit = *o.Limit
		}
		qLimit := swag.FormatInt64(qrLimit)
		if qLimit != "" {
			if err := r.SetQueryParam("limit", qLimit); 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.Page != nil {

		// query param page
		var qrPage int64
		if o.Page != nil {
			qrPage = *o.Page
		}
		qPage := swag.FormatInt64(qrPage)
		if qPage != "" {
			if err := r.SetQueryParam("page", qPage); 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 *GetMatchingEntitiesParams) WriteToRequest(r client.Request, 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
}