diff --git a/client/metrics/get_v1_metrics_milestone_funnel_parameters.go b/client/metrics/get_v1_metrics_milestone_funnel_parameters.go new file mode 100644 index 0000000..eb6d593 --- /dev/null +++ b/client/metrics/get_v1_metrics_milestone_funnel_parameters.go @@ -0,0 +1,1106 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package metrics + +// 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" + "github.com/go-openapi/swag" +) + +// NewGetV1MetricsMilestoneFunnelParams creates a new GetV1MetricsMilestoneFunnelParams 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 NewGetV1MetricsMilestoneFunnelParams() *GetV1MetricsMilestoneFunnelParams { + return &GetV1MetricsMilestoneFunnelParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetV1MetricsMilestoneFunnelParamsWithTimeout creates a new GetV1MetricsMilestoneFunnelParams object +// with the ability to set a timeout on a request. +func NewGetV1MetricsMilestoneFunnelParamsWithTimeout(timeout time.Duration) *GetV1MetricsMilestoneFunnelParams { + return &GetV1MetricsMilestoneFunnelParams{ + timeout: timeout, + } +} + +// NewGetV1MetricsMilestoneFunnelParamsWithContext creates a new GetV1MetricsMilestoneFunnelParams object +// with the ability to set a context for a request. +func NewGetV1MetricsMilestoneFunnelParamsWithContext(ctx context.Context) *GetV1MetricsMilestoneFunnelParams { + return &GetV1MetricsMilestoneFunnelParams{ + Context: ctx, + } +} + +// NewGetV1MetricsMilestoneFunnelParamsWithHTTPClient creates a new GetV1MetricsMilestoneFunnelParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetV1MetricsMilestoneFunnelParamsWithHTTPClient(client *http.Client) *GetV1MetricsMilestoneFunnelParams { + return &GetV1MetricsMilestoneFunnelParams{ + HTTPClient: client, + } +} + +/* +GetV1MetricsMilestoneFunnelParams contains all the parameters to send to the API endpoint + + for the get v1 metrics milestone funnel operation. + + Typically these are written to a http.Request. +*/ +type GetV1MetricsMilestoneFunnelParams struct { + + /* Archived. + + Return archived incidents + */ + Archived *bool + + /* AssignedTeams. + + A comma separated list of IDs for assigned teams or 'is_empty' to filter for incidents with no active team assignments + */ + AssignedTeams *string + + /* Conditions. + + A JSON string that defines 'logic' and 'user_data' + */ + Conditions *string + + /* CreatedAtOrAfter. + + Filters for incidents that were created at or after this time + + Format: date-time + */ + CreatedAtOrAfter *strfmt.DateTime + + /* CreatedAtOrBefore. + + Filters for incidents that were created at or before this time + + Format: date-time + */ + CreatedAtOrBefore *strfmt.DateTime + + /* CurrentMilestones. + + A comma separated list of current milestones + */ + CurrentMilestones *string + + /* EndDate. + + Filters for incidents that started on or before this date + + Format: date + */ + EndDate *strfmt.Date + + /* Environments. + + A comma separated list of environment IDs or 'is_empty' to filter for incidents with no impacted environments + */ + Environments *string + + /* ExcludedInfrastructureIds. + + A comma separated list of infrastucture IDs. Returns incidents that do not have the following infrastructure ids associated with them. + */ + ExcludedInfrastructureIds *string + + /* Functionalities. + + A comma separated list of functionality IDs or 'is_empty' to filter for incidents with no impacted functionalities + */ + Functionalities *string + + // GroupBy. + GroupBy []string + + /* Name. + + A query to search incidents by their name + */ + Name *string + + /* Priorities. + + A text value of priority + */ + Priorities *string + + /* PriorityNotSet. + + Flag for including incidents where priority has not been set + */ + PriorityNotSet *bool + + /* Query. + + A text query for an incident that searches on name, summary, and desciption + */ + Query *string + + /* ResolvedAtOrAfter. + + Filters for incidents that were resolved at or after this time. Combine this with the `current_milestones` parameter if you wish to omit incidents that were re-opened and are still active. + + Format: date-time + */ + ResolvedAtOrAfter *strfmt.DateTime + + /* ResolvedAtOrBefore. + + Filters for incidents that were resolved at or before this time. Combine this with the `current_milestones` parameter if you wish to omit incidents that were re-opened and are still active. + + Format: date-time + */ + ResolvedAtOrBefore *strfmt.DateTime + + /* SavedSearchID. + + The id of a previously saved search. + */ + SavedSearchID *string + + /* Services. + + A comma separated list of service IDs or 'is_empty' to filter for incidents with no impacted services + */ + Services *string + + /* Severities. + + A text value of severity + */ + Severities *string + + /* SeverityNotSet. + + Flag for including incidents where severity has not been set + */ + SeverityNotSet *bool + + /* StartDate. + + Filters for incidents that started on or after this date + + Format: date + */ + StartDate *strfmt.Date + + /* Status. + + Incident status + */ + Status *string + + /* TagMatchStrategy. + + A matching strategy for the tags provided + */ + TagMatchStrategy *string + + /* Tags. + + A comma separated list of tags + */ + Tags *string + + /* Teams. + + A comma separated list of team IDs + */ + Teams *string + + /* UpdatedAfter. + + Filters for incidents that were updated after this date + + Format: date-time + */ + UpdatedAfter *strfmt.DateTime + + /* UpdatedBefore. + + Filters for incidents that were updated before this date + + Format: date-time + */ + UpdatedBefore *strfmt.DateTime + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get v1 metrics milestone funnel params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetV1MetricsMilestoneFunnelParams) WithDefaults() *GetV1MetricsMilestoneFunnelParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get v1 metrics milestone funnel params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetV1MetricsMilestoneFunnelParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get v1 metrics milestone funnel params +func (o *GetV1MetricsMilestoneFunnelParams) WithTimeout(timeout time.Duration) *GetV1MetricsMilestoneFunnelParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get v1 metrics milestone funnel params +func (o *GetV1MetricsMilestoneFunnelParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get v1 metrics milestone funnel params +func (o *GetV1MetricsMilestoneFunnelParams) WithContext(ctx context.Context) *GetV1MetricsMilestoneFunnelParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get v1 metrics milestone funnel params +func (o *GetV1MetricsMilestoneFunnelParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get v1 metrics milestone funnel params +func (o *GetV1MetricsMilestoneFunnelParams) WithHTTPClient(client *http.Client) *GetV1MetricsMilestoneFunnelParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get v1 metrics milestone funnel params +func (o *GetV1MetricsMilestoneFunnelParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithArchived adds the archived to the get v1 metrics milestone funnel params +func (o *GetV1MetricsMilestoneFunnelParams) WithArchived(archived *bool) *GetV1MetricsMilestoneFunnelParams { + o.SetArchived(archived) + return o +} + +// SetArchived adds the archived to the get v1 metrics milestone funnel params +func (o *GetV1MetricsMilestoneFunnelParams) SetArchived(archived *bool) { + o.Archived = archived +} + +// WithAssignedTeams adds the assignedTeams to the get v1 metrics milestone funnel params +func (o *GetV1MetricsMilestoneFunnelParams) WithAssignedTeams(assignedTeams *string) *GetV1MetricsMilestoneFunnelParams { + o.SetAssignedTeams(assignedTeams) + return o +} + +// SetAssignedTeams adds the assignedTeams to the get v1 metrics milestone funnel params +func (o *GetV1MetricsMilestoneFunnelParams) SetAssignedTeams(assignedTeams *string) { + o.AssignedTeams = assignedTeams +} + +// WithConditions adds the conditions to the get v1 metrics milestone funnel params +func (o *GetV1MetricsMilestoneFunnelParams) WithConditions(conditions *string) *GetV1MetricsMilestoneFunnelParams { + o.SetConditions(conditions) + return o +} + +// SetConditions adds the conditions to the get v1 metrics milestone funnel params +func (o *GetV1MetricsMilestoneFunnelParams) SetConditions(conditions *string) { + o.Conditions = conditions +} + +// WithCreatedAtOrAfter adds the createdAtOrAfter to the get v1 metrics milestone funnel params +func (o *GetV1MetricsMilestoneFunnelParams) WithCreatedAtOrAfter(createdAtOrAfter *strfmt.DateTime) *GetV1MetricsMilestoneFunnelParams { + o.SetCreatedAtOrAfter(createdAtOrAfter) + return o +} + +// SetCreatedAtOrAfter adds the createdAtOrAfter to the get v1 metrics milestone funnel params +func (o *GetV1MetricsMilestoneFunnelParams) SetCreatedAtOrAfter(createdAtOrAfter *strfmt.DateTime) { + o.CreatedAtOrAfter = createdAtOrAfter +} + +// WithCreatedAtOrBefore adds the createdAtOrBefore to the get v1 metrics milestone funnel params +func (o *GetV1MetricsMilestoneFunnelParams) WithCreatedAtOrBefore(createdAtOrBefore *strfmt.DateTime) *GetV1MetricsMilestoneFunnelParams { + o.SetCreatedAtOrBefore(createdAtOrBefore) + return o +} + +// SetCreatedAtOrBefore adds the createdAtOrBefore to the get v1 metrics milestone funnel params +func (o *GetV1MetricsMilestoneFunnelParams) SetCreatedAtOrBefore(createdAtOrBefore *strfmt.DateTime) { + o.CreatedAtOrBefore = createdAtOrBefore +} + +// WithCurrentMilestones adds the currentMilestones to the get v1 metrics milestone funnel params +func (o *GetV1MetricsMilestoneFunnelParams) WithCurrentMilestones(currentMilestones *string) *GetV1MetricsMilestoneFunnelParams { + o.SetCurrentMilestones(currentMilestones) + return o +} + +// SetCurrentMilestones adds the currentMilestones to the get v1 metrics milestone funnel params +func (o *GetV1MetricsMilestoneFunnelParams) SetCurrentMilestones(currentMilestones *string) { + o.CurrentMilestones = currentMilestones +} + +// WithEndDate adds the endDate to the get v1 metrics milestone funnel params +func (o *GetV1MetricsMilestoneFunnelParams) WithEndDate(endDate *strfmt.Date) *GetV1MetricsMilestoneFunnelParams { + o.SetEndDate(endDate) + return o +} + +// SetEndDate adds the endDate to the get v1 metrics milestone funnel params +func (o *GetV1MetricsMilestoneFunnelParams) SetEndDate(endDate *strfmt.Date) { + o.EndDate = endDate +} + +// WithEnvironments adds the environments to the get v1 metrics milestone funnel params +func (o *GetV1MetricsMilestoneFunnelParams) WithEnvironments(environments *string) *GetV1MetricsMilestoneFunnelParams { + o.SetEnvironments(environments) + return o +} + +// SetEnvironments adds the environments to the get v1 metrics milestone funnel params +func (o *GetV1MetricsMilestoneFunnelParams) SetEnvironments(environments *string) { + o.Environments = environments +} + +// WithExcludedInfrastructureIds adds the excludedInfrastructureIds to the get v1 metrics milestone funnel params +func (o *GetV1MetricsMilestoneFunnelParams) WithExcludedInfrastructureIds(excludedInfrastructureIds *string) *GetV1MetricsMilestoneFunnelParams { + o.SetExcludedInfrastructureIds(excludedInfrastructureIds) + return o +} + +// SetExcludedInfrastructureIds adds the excludedInfrastructureIds to the get v1 metrics milestone funnel params +func (o *GetV1MetricsMilestoneFunnelParams) SetExcludedInfrastructureIds(excludedInfrastructureIds *string) { + o.ExcludedInfrastructureIds = excludedInfrastructureIds +} + +// WithFunctionalities adds the functionalities to the get v1 metrics milestone funnel params +func (o *GetV1MetricsMilestoneFunnelParams) WithFunctionalities(functionalities *string) *GetV1MetricsMilestoneFunnelParams { + o.SetFunctionalities(functionalities) + return o +} + +// SetFunctionalities adds the functionalities to the get v1 metrics milestone funnel params +func (o *GetV1MetricsMilestoneFunnelParams) SetFunctionalities(functionalities *string) { + o.Functionalities = functionalities +} + +// WithGroupBy adds the groupBy to the get v1 metrics milestone funnel params +func (o *GetV1MetricsMilestoneFunnelParams) WithGroupBy(groupBy []string) *GetV1MetricsMilestoneFunnelParams { + o.SetGroupBy(groupBy) + return o +} + +// SetGroupBy adds the groupBy to the get v1 metrics milestone funnel params +func (o *GetV1MetricsMilestoneFunnelParams) SetGroupBy(groupBy []string) { + o.GroupBy = groupBy +} + +// WithName adds the name to the get v1 metrics milestone funnel params +func (o *GetV1MetricsMilestoneFunnelParams) WithName(name *string) *GetV1MetricsMilestoneFunnelParams { + o.SetName(name) + return o +} + +// SetName adds the name to the get v1 metrics milestone funnel params +func (o *GetV1MetricsMilestoneFunnelParams) SetName(name *string) { + o.Name = name +} + +// WithPriorities adds the priorities to the get v1 metrics milestone funnel params +func (o *GetV1MetricsMilestoneFunnelParams) WithPriorities(priorities *string) *GetV1MetricsMilestoneFunnelParams { + o.SetPriorities(priorities) + return o +} + +// SetPriorities adds the priorities to the get v1 metrics milestone funnel params +func (o *GetV1MetricsMilestoneFunnelParams) SetPriorities(priorities *string) { + o.Priorities = priorities +} + +// WithPriorityNotSet adds the priorityNotSet to the get v1 metrics milestone funnel params +func (o *GetV1MetricsMilestoneFunnelParams) WithPriorityNotSet(priorityNotSet *bool) *GetV1MetricsMilestoneFunnelParams { + o.SetPriorityNotSet(priorityNotSet) + return o +} + +// SetPriorityNotSet adds the priorityNotSet to the get v1 metrics milestone funnel params +func (o *GetV1MetricsMilestoneFunnelParams) SetPriorityNotSet(priorityNotSet *bool) { + o.PriorityNotSet = priorityNotSet +} + +// WithQuery adds the query to the get v1 metrics milestone funnel params +func (o *GetV1MetricsMilestoneFunnelParams) WithQuery(query *string) *GetV1MetricsMilestoneFunnelParams { + o.SetQuery(query) + return o +} + +// SetQuery adds the query to the get v1 metrics milestone funnel params +func (o *GetV1MetricsMilestoneFunnelParams) SetQuery(query *string) { + o.Query = query +} + +// WithResolvedAtOrAfter adds the resolvedAtOrAfter to the get v1 metrics milestone funnel params +func (o *GetV1MetricsMilestoneFunnelParams) WithResolvedAtOrAfter(resolvedAtOrAfter *strfmt.DateTime) *GetV1MetricsMilestoneFunnelParams { + o.SetResolvedAtOrAfter(resolvedAtOrAfter) + return o +} + +// SetResolvedAtOrAfter adds the resolvedAtOrAfter to the get v1 metrics milestone funnel params +func (o *GetV1MetricsMilestoneFunnelParams) SetResolvedAtOrAfter(resolvedAtOrAfter *strfmt.DateTime) { + o.ResolvedAtOrAfter = resolvedAtOrAfter +} + +// WithResolvedAtOrBefore adds the resolvedAtOrBefore to the get v1 metrics milestone funnel params +func (o *GetV1MetricsMilestoneFunnelParams) WithResolvedAtOrBefore(resolvedAtOrBefore *strfmt.DateTime) *GetV1MetricsMilestoneFunnelParams { + o.SetResolvedAtOrBefore(resolvedAtOrBefore) + return o +} + +// SetResolvedAtOrBefore adds the resolvedAtOrBefore to the get v1 metrics milestone funnel params +func (o *GetV1MetricsMilestoneFunnelParams) SetResolvedAtOrBefore(resolvedAtOrBefore *strfmt.DateTime) { + o.ResolvedAtOrBefore = resolvedAtOrBefore +} + +// WithSavedSearchID adds the savedSearchID to the get v1 metrics milestone funnel params +func (o *GetV1MetricsMilestoneFunnelParams) WithSavedSearchID(savedSearchID *string) *GetV1MetricsMilestoneFunnelParams { + o.SetSavedSearchID(savedSearchID) + return o +} + +// SetSavedSearchID adds the savedSearchId to the get v1 metrics milestone funnel params +func (o *GetV1MetricsMilestoneFunnelParams) SetSavedSearchID(savedSearchID *string) { + o.SavedSearchID = savedSearchID +} + +// WithServices adds the services to the get v1 metrics milestone funnel params +func (o *GetV1MetricsMilestoneFunnelParams) WithServices(services *string) *GetV1MetricsMilestoneFunnelParams { + o.SetServices(services) + return o +} + +// SetServices adds the services to the get v1 metrics milestone funnel params +func (o *GetV1MetricsMilestoneFunnelParams) SetServices(services *string) { + o.Services = services +} + +// WithSeverities adds the severities to the get v1 metrics milestone funnel params +func (o *GetV1MetricsMilestoneFunnelParams) WithSeverities(severities *string) *GetV1MetricsMilestoneFunnelParams { + o.SetSeverities(severities) + return o +} + +// SetSeverities adds the severities to the get v1 metrics milestone funnel params +func (o *GetV1MetricsMilestoneFunnelParams) SetSeverities(severities *string) { + o.Severities = severities +} + +// WithSeverityNotSet adds the severityNotSet to the get v1 metrics milestone funnel params +func (o *GetV1MetricsMilestoneFunnelParams) WithSeverityNotSet(severityNotSet *bool) *GetV1MetricsMilestoneFunnelParams { + o.SetSeverityNotSet(severityNotSet) + return o +} + +// SetSeverityNotSet adds the severityNotSet to the get v1 metrics milestone funnel params +func (o *GetV1MetricsMilestoneFunnelParams) SetSeverityNotSet(severityNotSet *bool) { + o.SeverityNotSet = severityNotSet +} + +// WithStartDate adds the startDate to the get v1 metrics milestone funnel params +func (o *GetV1MetricsMilestoneFunnelParams) WithStartDate(startDate *strfmt.Date) *GetV1MetricsMilestoneFunnelParams { + o.SetStartDate(startDate) + return o +} + +// SetStartDate adds the startDate to the get v1 metrics milestone funnel params +func (o *GetV1MetricsMilestoneFunnelParams) SetStartDate(startDate *strfmt.Date) { + o.StartDate = startDate +} + +// WithStatus adds the status to the get v1 metrics milestone funnel params +func (o *GetV1MetricsMilestoneFunnelParams) WithStatus(status *string) *GetV1MetricsMilestoneFunnelParams { + o.SetStatus(status) + return o +} + +// SetStatus adds the status to the get v1 metrics milestone funnel params +func (o *GetV1MetricsMilestoneFunnelParams) SetStatus(status *string) { + o.Status = status +} + +// WithTagMatchStrategy adds the tagMatchStrategy to the get v1 metrics milestone funnel params +func (o *GetV1MetricsMilestoneFunnelParams) WithTagMatchStrategy(tagMatchStrategy *string) *GetV1MetricsMilestoneFunnelParams { + o.SetTagMatchStrategy(tagMatchStrategy) + return o +} + +// SetTagMatchStrategy adds the tagMatchStrategy to the get v1 metrics milestone funnel params +func (o *GetV1MetricsMilestoneFunnelParams) SetTagMatchStrategy(tagMatchStrategy *string) { + o.TagMatchStrategy = tagMatchStrategy +} + +// WithTags adds the tags to the get v1 metrics milestone funnel params +func (o *GetV1MetricsMilestoneFunnelParams) WithTags(tags *string) *GetV1MetricsMilestoneFunnelParams { + o.SetTags(tags) + return o +} + +// SetTags adds the tags to the get v1 metrics milestone funnel params +func (o *GetV1MetricsMilestoneFunnelParams) SetTags(tags *string) { + o.Tags = tags +} + +// WithTeams adds the teams to the get v1 metrics milestone funnel params +func (o *GetV1MetricsMilestoneFunnelParams) WithTeams(teams *string) *GetV1MetricsMilestoneFunnelParams { + o.SetTeams(teams) + return o +} + +// SetTeams adds the teams to the get v1 metrics milestone funnel params +func (o *GetV1MetricsMilestoneFunnelParams) SetTeams(teams *string) { + o.Teams = teams +} + +// WithUpdatedAfter adds the updatedAfter to the get v1 metrics milestone funnel params +func (o *GetV1MetricsMilestoneFunnelParams) WithUpdatedAfter(updatedAfter *strfmt.DateTime) *GetV1MetricsMilestoneFunnelParams { + o.SetUpdatedAfter(updatedAfter) + return o +} + +// SetUpdatedAfter adds the updatedAfter to the get v1 metrics milestone funnel params +func (o *GetV1MetricsMilestoneFunnelParams) SetUpdatedAfter(updatedAfter *strfmt.DateTime) { + o.UpdatedAfter = updatedAfter +} + +// WithUpdatedBefore adds the updatedBefore to the get v1 metrics milestone funnel params +func (o *GetV1MetricsMilestoneFunnelParams) WithUpdatedBefore(updatedBefore *strfmt.DateTime) *GetV1MetricsMilestoneFunnelParams { + o.SetUpdatedBefore(updatedBefore) + return o +} + +// SetUpdatedBefore adds the updatedBefore to the get v1 metrics milestone funnel params +func (o *GetV1MetricsMilestoneFunnelParams) SetUpdatedBefore(updatedBefore *strfmt.DateTime) { + o.UpdatedBefore = updatedBefore +} + +// WriteToRequest writes these params to a swagger request +func (o *GetV1MetricsMilestoneFunnelParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Archived != nil { + + // query param archived + var qrArchived bool + + if o.Archived != nil { + qrArchived = *o.Archived + } + qArchived := swag.FormatBool(qrArchived) + if qArchived != "" { + + if err := r.SetQueryParam("archived", qArchived); err != nil { + return err + } + } + } + + if o.AssignedTeams != nil { + + // query param assigned_teams + var qrAssignedTeams string + + if o.AssignedTeams != nil { + qrAssignedTeams = *o.AssignedTeams + } + qAssignedTeams := qrAssignedTeams + if qAssignedTeams != "" { + + if err := r.SetQueryParam("assigned_teams", qAssignedTeams); err != nil { + return err + } + } + } + + if o.Conditions != nil { + + // query param conditions + var qrConditions string + + if o.Conditions != nil { + qrConditions = *o.Conditions + } + qConditions := qrConditions + if qConditions != "" { + + if err := r.SetQueryParam("conditions", qConditions); err != nil { + return err + } + } + } + + if o.CreatedAtOrAfter != nil { + + // query param created_at_or_after + var qrCreatedAtOrAfter strfmt.DateTime + + if o.CreatedAtOrAfter != nil { + qrCreatedAtOrAfter = *o.CreatedAtOrAfter + } + qCreatedAtOrAfter := qrCreatedAtOrAfter.String() + if qCreatedAtOrAfter != "" { + + if err := r.SetQueryParam("created_at_or_after", qCreatedAtOrAfter); err != nil { + return err + } + } + } + + if o.CreatedAtOrBefore != nil { + + // query param created_at_or_before + var qrCreatedAtOrBefore strfmt.DateTime + + if o.CreatedAtOrBefore != nil { + qrCreatedAtOrBefore = *o.CreatedAtOrBefore + } + qCreatedAtOrBefore := qrCreatedAtOrBefore.String() + if qCreatedAtOrBefore != "" { + + if err := r.SetQueryParam("created_at_or_before", qCreatedAtOrBefore); err != nil { + return err + } + } + } + + if o.CurrentMilestones != nil { + + // query param current_milestones + var qrCurrentMilestones string + + if o.CurrentMilestones != nil { + qrCurrentMilestones = *o.CurrentMilestones + } + qCurrentMilestones := qrCurrentMilestones + if qCurrentMilestones != "" { + + if err := r.SetQueryParam("current_milestones", qCurrentMilestones); err != nil { + return err + } + } + } + + if o.EndDate != nil { + + // query param end_date + var qrEndDate strfmt.Date + + if o.EndDate != nil { + qrEndDate = *o.EndDate + } + qEndDate := qrEndDate.String() + if qEndDate != "" { + + if err := r.SetQueryParam("end_date", qEndDate); err != nil { + return err + } + } + } + + if o.Environments != nil { + + // query param environments + var qrEnvironments string + + if o.Environments != nil { + qrEnvironments = *o.Environments + } + qEnvironments := qrEnvironments + if qEnvironments != "" { + + if err := r.SetQueryParam("environments", qEnvironments); err != nil { + return err + } + } + } + + if o.ExcludedInfrastructureIds != nil { + + // query param excluded_infrastructure_ids + var qrExcludedInfrastructureIds string + + if o.ExcludedInfrastructureIds != nil { + qrExcludedInfrastructureIds = *o.ExcludedInfrastructureIds + } + qExcludedInfrastructureIds := qrExcludedInfrastructureIds + if qExcludedInfrastructureIds != "" { + + if err := r.SetQueryParam("excluded_infrastructure_ids", qExcludedInfrastructureIds); err != nil { + return err + } + } + } + + if o.Functionalities != nil { + + // query param functionalities + var qrFunctionalities string + + if o.Functionalities != nil { + qrFunctionalities = *o.Functionalities + } + qFunctionalities := qrFunctionalities + if qFunctionalities != "" { + + if err := r.SetQueryParam("functionalities", qFunctionalities); err != nil { + return err + } + } + } + + if o.GroupBy != nil { + + // binding items for group_by + joinedGroupBy := o.bindParamGroupBy(reg) + + // form array param group_by + if err := r.SetFormParam("group_by", joinedGroupBy...); err != nil { + return err + } + } + + if o.Name != nil { + + // query param name + var qrName string + + if o.Name != nil { + qrName = *o.Name + } + qName := qrName + if qName != "" { + + if err := r.SetQueryParam("name", qName); err != nil { + return err + } + } + } + + if o.Priorities != nil { + + // query param priorities + var qrPriorities string + + if o.Priorities != nil { + qrPriorities = *o.Priorities + } + qPriorities := qrPriorities + if qPriorities != "" { + + if err := r.SetQueryParam("priorities", qPriorities); err != nil { + return err + } + } + } + + if o.PriorityNotSet != nil { + + // query param priority_not_set + var qrPriorityNotSet bool + + if o.PriorityNotSet != nil { + qrPriorityNotSet = *o.PriorityNotSet + } + qPriorityNotSet := swag.FormatBool(qrPriorityNotSet) + if qPriorityNotSet != "" { + + if err := r.SetQueryParam("priority_not_set", qPriorityNotSet); err != nil { + return err + } + } + } + + 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 o.ResolvedAtOrAfter != nil { + + // query param resolved_at_or_after + var qrResolvedAtOrAfter strfmt.DateTime + + if o.ResolvedAtOrAfter != nil { + qrResolvedAtOrAfter = *o.ResolvedAtOrAfter + } + qResolvedAtOrAfter := qrResolvedAtOrAfter.String() + if qResolvedAtOrAfter != "" { + + if err := r.SetQueryParam("resolved_at_or_after", qResolvedAtOrAfter); err != nil { + return err + } + } + } + + if o.ResolvedAtOrBefore != nil { + + // query param resolved_at_or_before + var qrResolvedAtOrBefore strfmt.DateTime + + if o.ResolvedAtOrBefore != nil { + qrResolvedAtOrBefore = *o.ResolvedAtOrBefore + } + qResolvedAtOrBefore := qrResolvedAtOrBefore.String() + if qResolvedAtOrBefore != "" { + + if err := r.SetQueryParam("resolved_at_or_before", qResolvedAtOrBefore); err != nil { + return err + } + } + } + + if o.SavedSearchID != nil { + + // query param saved_search_id + var qrSavedSearchID string + + if o.SavedSearchID != nil { + qrSavedSearchID = *o.SavedSearchID + } + qSavedSearchID := qrSavedSearchID + if qSavedSearchID != "" { + + if err := r.SetQueryParam("saved_search_id", qSavedSearchID); err != nil { + return err + } + } + } + + if o.Services != nil { + + // query param services + var qrServices string + + if o.Services != nil { + qrServices = *o.Services + } + qServices := qrServices + if qServices != "" { + + if err := r.SetQueryParam("services", qServices); err != nil { + return err + } + } + } + + if o.Severities != nil { + + // query param severities + var qrSeverities string + + if o.Severities != nil { + qrSeverities = *o.Severities + } + qSeverities := qrSeverities + if qSeverities != "" { + + if err := r.SetQueryParam("severities", qSeverities); err != nil { + return err + } + } + } + + if o.SeverityNotSet != nil { + + // query param severity_not_set + var qrSeverityNotSet bool + + if o.SeverityNotSet != nil { + qrSeverityNotSet = *o.SeverityNotSet + } + qSeverityNotSet := swag.FormatBool(qrSeverityNotSet) + if qSeverityNotSet != "" { + + if err := r.SetQueryParam("severity_not_set", qSeverityNotSet); err != nil { + return err + } + } + } + + if o.StartDate != nil { + + // query param start_date + var qrStartDate strfmt.Date + + if o.StartDate != nil { + qrStartDate = *o.StartDate + } + qStartDate := qrStartDate.String() + if qStartDate != "" { + + if err := r.SetQueryParam("start_date", qStartDate); err != nil { + return err + } + } + } + + if o.Status != nil { + + // query param status + var qrStatus string + + if o.Status != nil { + qrStatus = *o.Status + } + qStatus := qrStatus + if qStatus != "" { + + if err := r.SetQueryParam("status", qStatus); err != nil { + return err + } + } + } + + if o.TagMatchStrategy != nil { + + // query param tag_match_strategy + var qrTagMatchStrategy string + + if o.TagMatchStrategy != nil { + qrTagMatchStrategy = *o.TagMatchStrategy + } + qTagMatchStrategy := qrTagMatchStrategy + if qTagMatchStrategy != "" { + + if err := r.SetQueryParam("tag_match_strategy", qTagMatchStrategy); err != nil { + return err + } + } + } + + if o.Tags != nil { + + // query param tags + var qrTags string + + if o.Tags != nil { + qrTags = *o.Tags + } + qTags := qrTags + if qTags != "" { + + if err := r.SetQueryParam("tags", qTags); err != nil { + return err + } + } + } + + if o.Teams != nil { + + // query param teams + var qrTeams string + + if o.Teams != nil { + qrTeams = *o.Teams + } + qTeams := qrTeams + if qTeams != "" { + + if err := r.SetQueryParam("teams", qTeams); err != nil { + return err + } + } + } + + if o.UpdatedAfter != nil { + + // query param updated_after + var qrUpdatedAfter strfmt.DateTime + + if o.UpdatedAfter != nil { + qrUpdatedAfter = *o.UpdatedAfter + } + qUpdatedAfter := qrUpdatedAfter.String() + if qUpdatedAfter != "" { + + if err := r.SetQueryParam("updated_after", qUpdatedAfter); err != nil { + return err + } + } + } + + if o.UpdatedBefore != nil { + + // query param updated_before + var qrUpdatedBefore strfmt.DateTime + + if o.UpdatedBefore != nil { + qrUpdatedBefore = *o.UpdatedBefore + } + qUpdatedBefore := qrUpdatedBefore.String() + if qUpdatedBefore != "" { + + if err := r.SetQueryParam("updated_before", qUpdatedBefore); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindParamGetV1MetricsMilestoneFunnel binds the parameter group_by +func (o *GetV1MetricsMilestoneFunnelParams) bindParamGroupBy(formats strfmt.Registry) []string { + groupByIR := o.GroupBy + + var groupByIC []string + for _, groupByIIR := range groupByIR { // explode []string + + groupByIIV := groupByIIR // string as string + groupByIC = append(groupByIC, groupByIIV) + } + + // items.CollectionFormat: "" + groupByIS := swag.JoinByFormat(groupByIC, "") + + return groupByIS +} diff --git a/client/metrics/get_v1_metrics_milestone_funnel_responses.go b/client/metrics/get_v1_metrics_milestone_funnel_responses.go new file mode 100644 index 0000000..24e678d --- /dev/null +++ b/client/metrics/get_v1_metrics_milestone_funnel_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package metrics + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// GetV1MetricsMilestoneFunnelReader is a Reader for the GetV1MetricsMilestoneFunnel structure. +type GetV1MetricsMilestoneFunnelReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetV1MetricsMilestoneFunnelReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetV1MetricsMilestoneFunnelOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetV1MetricsMilestoneFunnelOK creates a GetV1MetricsMilestoneFunnelOK with default headers values +func NewGetV1MetricsMilestoneFunnelOK() *GetV1MetricsMilestoneFunnelOK { + return &GetV1MetricsMilestoneFunnelOK{} +} + +/* +GetV1MetricsMilestoneFunnelOK describes a response with status code 200, with default header values. + +Returns a report with time bucketed milestone data +*/ +type GetV1MetricsMilestoneFunnelOK struct { + Payload *models.MetricsMilestonesFunnelEntity +} + +// IsSuccess returns true when this get v1 metrics milestone funnel o k response has a 2xx status code +func (o *GetV1MetricsMilestoneFunnelOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get v1 metrics milestone funnel o k response has a 3xx status code +func (o *GetV1MetricsMilestoneFunnelOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get v1 metrics milestone funnel o k response has a 4xx status code +func (o *GetV1MetricsMilestoneFunnelOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get v1 metrics milestone funnel o k response has a 5xx status code +func (o *GetV1MetricsMilestoneFunnelOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get v1 metrics milestone funnel o k response a status code equal to that given +func (o *GetV1MetricsMilestoneFunnelOK) IsCode(code int) bool { + return code == 200 +} + +func (o *GetV1MetricsMilestoneFunnelOK) Error() string { + return fmt.Sprintf("[GET /v1/metrics/milestone_funnel][%d] getV1MetricsMilestoneFunnelOK %+v", 200, o.Payload) +} + +func (o *GetV1MetricsMilestoneFunnelOK) String() string { + return fmt.Sprintf("[GET /v1/metrics/milestone_funnel][%d] getV1MetricsMilestoneFunnelOK %+v", 200, o.Payload) +} + +func (o *GetV1MetricsMilestoneFunnelOK) GetPayload() *models.MetricsMilestonesFunnelEntity { + return o.Payload +} + +func (o *GetV1MetricsMilestoneFunnelOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.MetricsMilestonesFunnelEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/metrics/metrics_client.go b/client/metrics/metrics_client.go index 9fd1613..43f5c4a 100644 --- a/client/metrics/metrics_client.go +++ b/client/metrics/metrics_client.go @@ -36,6 +36,8 @@ type ClientService interface { GetV1MetricsInfraTypeInfraID(params *GetV1MetricsInfraTypeInfraIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1MetricsInfraTypeInfraIDOK, error) + GetV1MetricsMilestoneFunnel(params *GetV1MetricsMilestoneFunnelParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1MetricsMilestoneFunnelOK, error) + GetV1MetricsMttx(params *GetV1MetricsMttxParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1MetricsMttxOK, error) GetV1MetricsRetrospectives(params *GetV1MetricsRetrospectivesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1MetricsRetrospectivesOK, error) @@ -168,6 +170,47 @@ func (a *Client) GetV1MetricsInfraTypeInfraID(params *GetV1MetricsInfraTypeInfra panic(msg) } +/* +GetV1MetricsMilestoneFunnel lists funnel metrics + +Returns a report with time bucketed milestone data +*/ +func (a *Client) GetV1MetricsMilestoneFunnel(params *GetV1MetricsMilestoneFunnelParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1MetricsMilestoneFunnelOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetV1MetricsMilestoneFunnelParams() + } + op := &runtime.ClientOperation{ + ID: "getV1MetricsMilestoneFunnel", + Method: "GET", + PathPattern: "/v1/metrics/milestone_funnel", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &GetV1MetricsMilestoneFunnelReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*GetV1MetricsMilestoneFunnelOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for getV1MetricsMilestoneFunnel: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + /* GetV1MetricsMttx Fetch infrastructure metrics based on custom query */ diff --git a/models/metrics_milestones_funnel_entity.go b/models/metrics_milestones_funnel_entity.go new file mode 100644 index 0000000..e40b0e7 --- /dev/null +++ b/models/metrics_milestones_funnel_entity.go @@ -0,0 +1,265 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// MetricsMilestonesFunnelEntity Metrics_MilestonesFunnelEntity model +// +// swagger:model Metrics_MilestonesFunnelEntity +type MetricsMilestonesFunnelEntity struct { + + // columns + Columns []*MetricsMilestonesFunnelEntityColumnEntity `json:"columns"` + + // data + Data []*MetricsMilestonesFunnelEntityDataBucketEntity `json:"data"` + + // groupings + Groupings *MetricsMilestonesFunnelEntityGroupingsEntity `json:"groupings,omitempty"` + + // meta + Meta *MetricsMilestonesFunnelEntityMetaEntity `json:"meta,omitempty"` +} + +// Validate validates this metrics milestones funnel entity +func (m *MetricsMilestonesFunnelEntity) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateColumns(formats); err != nil { + res = append(res, err) + } + + if err := m.validateData(formats); err != nil { + res = append(res, err) + } + + if err := m.validateGroupings(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMeta(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *MetricsMilestonesFunnelEntity) validateColumns(formats strfmt.Registry) error { + if swag.IsZero(m.Columns) { // not required + return nil + } + + for i := 0; i < len(m.Columns); i++ { + if swag.IsZero(m.Columns[i]) { // not required + continue + } + + if m.Columns[i] != nil { + if err := m.Columns[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("columns" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("columns" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *MetricsMilestonesFunnelEntity) validateData(formats strfmt.Registry) error { + if swag.IsZero(m.Data) { // not required + return nil + } + + for i := 0; i < len(m.Data); i++ { + if swag.IsZero(m.Data[i]) { // not required + continue + } + + if m.Data[i] != nil { + if err := m.Data[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("data" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("data" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *MetricsMilestonesFunnelEntity) validateGroupings(formats strfmt.Registry) error { + if swag.IsZero(m.Groupings) { // not required + return nil + } + + if m.Groupings != nil { + if err := m.Groupings.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("groupings") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("groupings") + } + return err + } + } + + return nil +} + +func (m *MetricsMilestonesFunnelEntity) validateMeta(formats strfmt.Registry) error { + if swag.IsZero(m.Meta) { // not required + return nil + } + + if m.Meta != nil { + if err := m.Meta.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("meta") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("meta") + } + return err + } + } + + return nil +} + +// ContextValidate validate this metrics milestones funnel entity based on the context it is used +func (m *MetricsMilestonesFunnelEntity) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateColumns(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateData(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateGroupings(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateMeta(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *MetricsMilestonesFunnelEntity) contextValidateColumns(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Columns); i++ { + + if m.Columns[i] != nil { + if err := m.Columns[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("columns" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("columns" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *MetricsMilestonesFunnelEntity) contextValidateData(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Data); i++ { + + if m.Data[i] != nil { + if err := m.Data[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("data" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("data" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *MetricsMilestonesFunnelEntity) contextValidateGroupings(ctx context.Context, formats strfmt.Registry) error { + + if m.Groupings != nil { + if err := m.Groupings.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("groupings") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("groupings") + } + return err + } + } + + return nil +} + +func (m *MetricsMilestonesFunnelEntity) contextValidateMeta(ctx context.Context, formats strfmt.Registry) error { + + if m.Meta != nil { + if err := m.Meta.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("meta") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("meta") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *MetricsMilestonesFunnelEntity) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *MetricsMilestonesFunnelEntity) UnmarshalBinary(b []byte) error { + var res MetricsMilestonesFunnelEntity + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/models/metrics_milestones_funnel_entity_column_entity.go b/models/metrics_milestones_funnel_entity_column_entity.go new file mode 100644 index 0000000..7c89c63 --- /dev/null +++ b/models/metrics_milestones_funnel_entity_column_entity.go @@ -0,0 +1,59 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// MetricsMilestonesFunnelEntityColumnEntity metrics milestones funnel entity column entity +// +// swagger:model Metrics_MilestonesFunnelEntity_ColumnEntity +type MetricsMilestonesFunnelEntityColumnEntity struct { + + // The UUID of the milestone + ID string `json:"id,omitempty"` + + // The name of the milestone + Label string `json:"label,omitempty"` + + // The slug of the milestone + Name string `json:"name,omitempty"` + + // The description of the milestone + Tooltip string `json:"tooltip,omitempty"` +} + +// Validate validates this metrics milestones funnel entity column entity +func (m *MetricsMilestonesFunnelEntityColumnEntity) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this metrics milestones funnel entity column entity based on context it is used +func (m *MetricsMilestonesFunnelEntityColumnEntity) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *MetricsMilestonesFunnelEntityColumnEntity) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *MetricsMilestonesFunnelEntityColumnEntity) UnmarshalBinary(b []byte) error { + var res MetricsMilestonesFunnelEntityColumnEntity + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/models/metrics_milestones_funnel_entity_data_bucket_entity.go b/models/metrics_milestones_funnel_entity_data_bucket_entity.go new file mode 100644 index 0000000..b871a03 --- /dev/null +++ b/models/metrics_milestones_funnel_entity_data_bucket_entity.go @@ -0,0 +1,183 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// MetricsMilestonesFunnelEntityDataBucketEntity metrics milestones funnel entity data bucket entity +// +// swagger:model Metrics_MilestonesFunnelEntity_DataBucketEntity +type MetricsMilestonesFunnelEntityDataBucketEntity struct { + + // filter params + FilterParams *MetricsMilestonesFunnelEntityDataBucketFilterParamsEntity `json:"filter_params,omitempty"` + + // milestone counts + MilestoneCounts []*MetricsMilestonesFunnelEntityDataBucketMilestoneCountEntity `json:"milestone_counts"` + + // The start datetime for the period + // Format: date-time + TimeBucket strfmt.DateTime `json:"time_bucket,omitempty"` +} + +// Validate validates this metrics milestones funnel entity data bucket entity +func (m *MetricsMilestonesFunnelEntityDataBucketEntity) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateFilterParams(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMilestoneCounts(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTimeBucket(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *MetricsMilestonesFunnelEntityDataBucketEntity) validateFilterParams(formats strfmt.Registry) error { + if swag.IsZero(m.FilterParams) { // not required + return nil + } + + if m.FilterParams != nil { + if err := m.FilterParams.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("filter_params") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("filter_params") + } + return err + } + } + + return nil +} + +func (m *MetricsMilestonesFunnelEntityDataBucketEntity) validateMilestoneCounts(formats strfmt.Registry) error { + if swag.IsZero(m.MilestoneCounts) { // not required + return nil + } + + for i := 0; i < len(m.MilestoneCounts); i++ { + if swag.IsZero(m.MilestoneCounts[i]) { // not required + continue + } + + if m.MilestoneCounts[i] != nil { + if err := m.MilestoneCounts[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("milestone_counts" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("milestone_counts" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *MetricsMilestonesFunnelEntityDataBucketEntity) validateTimeBucket(formats strfmt.Registry) error { + if swag.IsZero(m.TimeBucket) { // not required + return nil + } + + if err := validate.FormatOf("time_bucket", "body", "date-time", m.TimeBucket.String(), formats); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this metrics milestones funnel entity data bucket entity based on the context it is used +func (m *MetricsMilestonesFunnelEntityDataBucketEntity) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateFilterParams(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateMilestoneCounts(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *MetricsMilestonesFunnelEntityDataBucketEntity) contextValidateFilterParams(ctx context.Context, formats strfmt.Registry) error { + + if m.FilterParams != nil { + if err := m.FilterParams.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("filter_params") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("filter_params") + } + return err + } + } + + return nil +} + +func (m *MetricsMilestonesFunnelEntityDataBucketEntity) contextValidateMilestoneCounts(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.MilestoneCounts); i++ { + + if m.MilestoneCounts[i] != nil { + if err := m.MilestoneCounts[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("milestone_counts" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("milestone_counts" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *MetricsMilestonesFunnelEntityDataBucketEntity) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *MetricsMilestonesFunnelEntityDataBucketEntity) UnmarshalBinary(b []byte) error { + var res MetricsMilestonesFunnelEntityDataBucketEntity + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/models/metrics_milestones_funnel_entity_data_bucket_filter_params_entity.go b/models/metrics_milestones_funnel_entity_data_bucket_filter_params_entity.go new file mode 100644 index 0000000..16d6b2a --- /dev/null +++ b/models/metrics_milestones_funnel_entity_data_bucket_filter_params_entity.go @@ -0,0 +1,94 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// MetricsMilestonesFunnelEntityDataBucketFilterParamsEntity metrics milestones funnel entity data bucket filter params entity +// +// swagger:model Metrics_MilestonesFunnelEntity_DataBucketFilterParamsEntity +type MetricsMilestonesFunnelEntityDataBucketFilterParamsEntity struct { + + // The end datetime for the period not inclusive + // Format: date + EndDate strfmt.Date `json:"end_date,omitempty"` + + // The start datetime for the period + // Format: date-time + StartDate strfmt.DateTime `json:"start_date,omitempty"` +} + +// Validate validates this metrics milestones funnel entity data bucket filter params entity +func (m *MetricsMilestonesFunnelEntityDataBucketFilterParamsEntity) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateEndDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStartDate(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *MetricsMilestonesFunnelEntityDataBucketFilterParamsEntity) validateEndDate(formats strfmt.Registry) error { + if swag.IsZero(m.EndDate) { // not required + return nil + } + + if err := validate.FormatOf("end_date", "body", "date", m.EndDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MetricsMilestonesFunnelEntityDataBucketFilterParamsEntity) validateStartDate(formats strfmt.Registry) error { + if swag.IsZero(m.StartDate) { // not required + return nil + } + + if err := validate.FormatOf("start_date", "body", "date-time", m.StartDate.String(), formats); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this metrics milestones funnel entity data bucket filter params entity based on context it is used +func (m *MetricsMilestonesFunnelEntityDataBucketFilterParamsEntity) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *MetricsMilestonesFunnelEntityDataBucketFilterParamsEntity) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *MetricsMilestonesFunnelEntityDataBucketFilterParamsEntity) UnmarshalBinary(b []byte) error { + var res MetricsMilestonesFunnelEntityDataBucketFilterParamsEntity + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/models/metrics_milestones_funnel_entity_data_bucket_milestone_count_entity.go b/models/metrics_milestones_funnel_entity_data_bucket_milestone_count_entity.go new file mode 100644 index 0000000..7f318da --- /dev/null +++ b/models/metrics_milestones_funnel_entity_data_bucket_milestone_count_entity.go @@ -0,0 +1,53 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// MetricsMilestonesFunnelEntityDataBucketMilestoneCountEntity metrics milestones funnel entity data bucket milestone count entity +// +// swagger:model Metrics_MilestonesFunnelEntity_DataBucketMilestoneCountEntity +type MetricsMilestonesFunnelEntityDataBucketMilestoneCountEntity struct { + + // The frequency count of that milestone for the period + Count int32 `json:"count,omitempty"` + + // The UUID of the milestone + MilestoneID string `json:"milestone_id,omitempty"` +} + +// Validate validates this metrics milestones funnel entity data bucket milestone count entity +func (m *MetricsMilestonesFunnelEntityDataBucketMilestoneCountEntity) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this metrics milestones funnel entity data bucket milestone count entity based on context it is used +func (m *MetricsMilestonesFunnelEntityDataBucketMilestoneCountEntity) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *MetricsMilestonesFunnelEntityDataBucketMilestoneCountEntity) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *MetricsMilestonesFunnelEntityDataBucketMilestoneCountEntity) UnmarshalBinary(b []byte) error { + var res MetricsMilestonesFunnelEntityDataBucketMilestoneCountEntity + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/models/metrics_milestones_funnel_entity_groupings_entity.go b/models/metrics_milestones_funnel_entity_groupings_entity.go new file mode 100644 index 0000000..d135d7d --- /dev/null +++ b/models/metrics_milestones_funnel_entity_groupings_entity.go @@ -0,0 +1,50 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// MetricsMilestonesFunnelEntityGroupingsEntity metrics milestones funnel entity groupings entity +// +// swagger:model Metrics_MilestonesFunnelEntity_GroupingsEntity +type MetricsMilestonesFunnelEntityGroupingsEntity struct { + + // The bucket size for the data + BucketSize string `json:"bucket_size,omitempty"` +} + +// Validate validates this metrics milestones funnel entity groupings entity +func (m *MetricsMilestonesFunnelEntityGroupingsEntity) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this metrics milestones funnel entity groupings entity based on context it is used +func (m *MetricsMilestonesFunnelEntityGroupingsEntity) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *MetricsMilestonesFunnelEntityGroupingsEntity) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *MetricsMilestonesFunnelEntityGroupingsEntity) UnmarshalBinary(b []byte) error { + var res MetricsMilestonesFunnelEntityGroupingsEntity + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/models/metrics_milestones_funnel_entity_meta_entity.go b/models/metrics_milestones_funnel_entity_meta_entity.go new file mode 100644 index 0000000..5d58030 --- /dev/null +++ b/models/metrics_milestones_funnel_entity_meta_entity.go @@ -0,0 +1,53 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// MetricsMilestonesFunnelEntityMetaEntity metrics milestones funnel entity meta entity +// +// swagger:model Metrics_MilestonesFunnelEntity_MetaEntity +type MetricsMilestonesFunnelEntityMetaEntity struct { + + // added milestones + AddedMilestones []string `json:"added_milestones"` + + // deleted milestones + DeletedMilestones []string `json:"deleted_milestones"` +} + +// Validate validates this metrics milestones funnel entity meta entity +func (m *MetricsMilestonesFunnelEntityMetaEntity) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this metrics milestones funnel entity meta entity based on context it is used +func (m *MetricsMilestonesFunnelEntityMetaEntity) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *MetricsMilestonesFunnelEntityMetaEntity) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *MetricsMilestonesFunnelEntityMetaEntity) UnmarshalBinary(b []byte) error { + var res MetricsMilestonesFunnelEntityMetaEntity + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +}