// 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
// API: GET /api/social/tweet/public_tweets
func (o *TweetsListParams) WriteToRequest(r client.Request, reg strfmt.Registry) error {
	// path param name
	if err := r.SetPathParam("social/tweet", "public_tweets"); err != nil {
		return err
	}
	if err := r.SetQueryParam("sort", o.Sort); err != nil {
		return err
	}
	if o.LastId > 0 {
		if err := r.SetQueryParam("last_id",
			fmt.Sprintf("%d", o.LastId)); err != nil {
			return err
		}
	}
	if o.DefaultLikeCount > 0 {
		if err := r.SetQueryParam("default_like_count",
			fmt.Sprintf("%d", o.DefaultLikeCount)); err != nil {
			return err
		}
	}
	if err := r.SetQueryParam("filter",
		strconv.FormatBool(o.Filter)); err != nil {
		return err
	}
	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 *ListOrgLogsParams) WriteToRequest(r client.Request, reg strfmt.Registry) error {

	var res []error

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

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

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

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

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

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

	var res []error

	if o.Query != nil {

		// query param query
		var qrQuery string
		if o.Query != nil {
			qrQuery = *o.Query
		}
		qQuery := qrQuery
		if qQuery != "" {
			if err := r.SetQueryParam("query", qQuery); err != nil {
				return err
			}
		}

	}

	if len(res) > 0 {
		return errors.CompositeValidationError(res...)
	}
	return nil
}
// WriteToRequest writes these params to a swagger request
// API: DELETE /api/social/tweet/{tweet_id}
func (o *TweetDeleteParams) WriteToRequest(r client.Request, reg strfmt.Registry) error {
	// path param name
	if err := r.SetPathParam("social/tweet",
		strconv.Itoa(o.TweetId)); err != nil {
		return err
	}
	return nil
}
// WriteToRequest writes these params to a swagger request
// API: POST /api/social/tweet/{tweet_id}/like
func (o *TweetLikeParams) WriteToRequest(r client.Request, reg strfmt.Registry) error {
	// path param name
	if err := r.SetPathParam("social", "tweet"); err != nil {
		return err
	}
	if err := r.SetPathParam(fmt.Sprintf("%d", o.TweetId), "like"); err != nil {
		return err
	}

	return nil
}
示例#8
0
// WriteToRequest writes these params to a swagger request
func (o *CreateTaskParams) WriteToRequest(r client.Request, reg strfmt.Registry) error {

	var res []error

	if err := r.SetBodyParam(o.Body); 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

	// 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
}
// WriteToRequest writes these params to a swagger request
func (o *GetOrganizationMembersParams) 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 len(res) > 0 {
		return errors.CompositeValidationError(res...)
	}
	return nil
}
// WriteToRequest writes these params to a swagger request
func (o *GetUserInformationParams) WriteToRequest(r client.Request, reg strfmt.Registry) error {

	var res []error

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

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

	var res []error

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

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

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

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

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

	var res []error

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

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

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

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

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

	var res []error

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

	if len(res) > 0 {
		return errors.CompositeValidationError(res...)
	}
	return nil
}
// 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
}
示例#16
0
// WriteToRequest writes these params to a swagger request
func (o *GetTaskDetailsParams) WriteToRequest(r client.Request, reg strfmt.Registry) error {

	var res []error

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

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

	var res []error

	if o.Body == nil {
		o.Body = new(models.ComponentVersion)
	}

	if err := r.SetBodyParam(o.Body); err != nil {
		return err
	}

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

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

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

	if len(res) > 0 {
		return errors.CompositeValidationError(res...)
	}
	return nil
}
示例#18
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
}
// WriteToRequest writes these params to a swagger request
func (o *ListRepoUserPermissionsParams) WriteToRequest(r client.Request, reg strfmt.Registry) error {

	var res []error

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

	if len(res) > 0 {
		return errors.CompositeValidationError(res...)
	}
	return nil
}
// WriteToRequest writes these params to a swagger request
func (o *DestroyOneParams) 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
	}

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

	var res []error

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

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

	var res []error

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

	if len(res) > 0 {
		return errors.CompositeValidationError(res...)
	}
	return nil
}
示例#23
0
// WriteToRequest writes these params to a swagger request
func (o *ListTasksParams) WriteToRequest(r client.Request, reg strfmt.Registry) error {

	var res []error

	if o.PageSize != nil {

		// query param pageSize
		var qrPageSize int32
		if o.PageSize != nil {
			qrPageSize = *o.PageSize
		}
		qPageSize := swag.FormatInt32(qrPageSize)
		if qPageSize != "" {
			if err := r.SetQueryParam("pageSize", qPageSize); err != nil {
				return err
			}
		}

	}

	if o.SinceID != nil {

		// query param sinceId
		var qrSinceID int64
		if o.SinceID != nil {
			qrSinceID = *o.SinceID
		}
		qSinceID := swag.FormatInt64(qrSinceID)
		if qSinceID != "" {
			if err := r.SetQueryParam("sinceId", qSinceID); err != nil {
				return err
			}
		}

	}

	valuesStatus := o.Status

	joinedStatus := swag.JoinByFormat(valuesStatus, "pipes")
	// query array param status
	if err := r.SetQueryParam("status", joinedStatus...); err != nil {
		return err
	}

	valuesTags := o.Tags

	joinedTags := swag.JoinByFormat(valuesTags, "")
	// query array param tags
	if err := r.SetQueryParam("tags", joinedTags...); err != nil {
		return err
	}

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

	var res []error

	if o.Request == nil {
		o.Request = new(models.CreateSubscriptionBatchRequest)
	}

	if err := r.SetBodyParam(o.Request); err != nil {
		return err
	}

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

	var res []error

	if o.Body == nil {
		o.Body = new(models.Cluster)
	}

	if err := r.SetBodyParam(o.Body); err != nil {
		return err
	}

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

	var res []error

	if o.Request == nil {
		o.Request = new(models.UpdateProfileRequest)
	}

	if err := r.SetBodyParam(o.Request); err != nil {
		return err
	}

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

	var res []error

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

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

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

	var res []error

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

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

	if len(res) > 0 {
		return errors.CompositeValidationError(res...)
	}
	return nil
}
示例#29
0
// WriteToRequest writes these params to a swagger request
func (o *Params) WriteToRequest(r client.Request, reg strfmt.Registry) error {

	var res []error

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

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

	if len(res) > 0 {
		return errors.CompositeValidationError(res...)
	}
	return nil
}
// WriteToRequest writes these params to a swagger request
func (o *DeleteOrganizationPrototypePermissionParams) 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
	}

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

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